diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md new file mode 100644 index 00000000..2d62a270 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md @@ -0,0 +1,289 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 3.0.2 - 2024-09-06 +### Changed +- Internal updates. + +## 3.0.1 - 2024-09-06 +### Added +- Threats List: Add pagination. [#39058] + +### Changed +- Admin menu: change order of Jetpack sub-menu items. [#39095] +- Updated package dependencies. [#39176] + +### Fixed +- Security Scanning: Adds a background to the scan progress bar. [#38847] +- General: Delete relevant Protect options on deactivation. [#38815] +- Auto Fixers: Disable the unignore threats button when a fixer is in progress. [#38898] +- Security Scanning: Fix the threat fixed on date in the history view. [#39164] +- General: Improves the manual scan link button loading state. [#38897] + +## 3.0.0-beta - 2024-08-09 +### Added +- Firewall: add dedicated WAF allow and block list toggles [#38265] +- General: add "contact support" links [#38416] +- Security Scanning: add threats history view [#38117] + +### Changed +- General: indicate compatibility with the upcoming version of WordPress - 6.6. [#37962] + +### Removed +- General: update WordPress version requirements to WordPress 6.5. [#38382] + +### Fixed +- Fix an issue where the connection error hook was always resetting the notice [#38120] +- Fix image optimization [#38573] +- Fix in-progress threat fixer loading indicator [#38051] +- Fix threat fix modal title [#38312] + +## 2.2.0 - 2024-05-24 +### Added +- Add data to WAF logs and a toggle for users to opt-in to share more data with us if needed. [#36377] +- Trigger a red bubble notification when a bad install is detected. [#36449] + +### Changed +- Update WordPress minimum version requirement to WordPress 6.4. [#37047] +- Only show installation errors on the plugins page. [#36390] + +### Fixed +- Jetpack Protect Footer: ensure that "Go to cloud" links are not shown when on a platform with no firewall support. [#36794] + +## 2.1.0 - 2024-03-14 +### Added +- Added onboarding flows. [#34649] +- Added firewall standalone mode indicator. [#34840] + +### Changed +- General: indicate compatibility with the upcoming version of WordPress, 6.5. [#35820] +- Use blog ID instead of site slug in checkout links. [#35004] +- Updated package dependencies. [#36325] +- Updated package lockfile. [#35672] + +### Fixed +- Prevent text orphans in the site scanning header. [#35935] + +## 2.0.0 - 2024-01-18 +### Changed +- Firewall: use datetime versioning for rules file updates. [#34698] +- General: unify display of notifications across Scan and Firewall screens [#34702] +- General: indicate full compatibility with the latest version of WordPress, 6.4. [#33776] +- General: update PHP requirement to PHP 7.0+ [#34126] +- General: update WordPress version requirements to WordPress 6.3. [#34127] +- General: update package dependencies. [#34882] +- General: update lockfile. [#33607] + +### Fixed +- Fix Modal component overflow scrolling. [#34475] +- Fix Popover component styling. [#34424] +- Improved helper script installer logging. [#34297] + +## 1.4.2 - 2023-10-19 +### Changed +- General: update WordPress version requirements to WordPress 6.2. [#32762] [#32772] +- Updated Jetpack submenu sort order so individual features are alpha-sorted. [#32958] +- Updated method used to render Connection initial state. [#32499] +- Updated package dependencies. [#33692] + +## 1.4.1 - 2023-07-18 +### Changed +- Brute Force Protection: add access to feature in environments that otherwise do not support the WAF. [#31952] +- General: indicate full compatibility with the latest version of WordPress, 6.3. [#31910] +- Update WordPress version requirements. Now requires version 6.1. [#30120] +- Update package dependencies. [#31952] + +### Fixed +- Scan: Fixed sorting of threats by severity. [#31124] +- License Activation: add filtering for unattached and unrevoked licenses within upgrade flow check. [#31086] + +## 1.4.0 - 2023-05-05 +### Added +- Add brute force protection. [#28401] + +### Changed +- General: indicate full compatibility with the latest version of WordPress, 6.2. [#29341] +- Improve the firewall status heading to provide more information based on the current configuration. [#28401] +- Updated package dependencies. [#29480] + +## 1.3.0 - 2023-03-13 +### Added +- Add ability to toggle automatic and manual firewall rules independently. [#27726] +- Add improved messaging for currently enabled firewall features. [#27845] +- Disable Jetpack Firewall on unsupported environments. [#27939] +- Add link to pricing page for getting started with an existing plan or license key. [#27745] + +### Changed +- Updated package dependencies. [#29297] +- Update to React 18. [#28710] +- Use `flex-start`/`flex-end` instead of `start`/`end` for better browser compatibility. [#28530] + +### Fixed +- Fix connection button loading indicators. [#28514] +- Fix Protect status report caching. [#28766] +- Remove unnecessary full path from example in UI. [#29037] +- Other assorted fixes for minor bugs and grammar. [#27846] [#28091] [#28397] [#28273] + +## 1.2.0 - 2023-01-16 +### Added +- Add web application firewall (WAF) features [#27528] +- Add progress bar to site scannnig screen [#27171] + +### Fixed +- Poll for scan status while scanner is provisioning [#28275] +- Bug fixes + +## 1.1.2 - 2022-11-30 +### Changed +- changed description and author [#27618] +- Updated package dependencies. [#27043] + +## 1.1.1 - 2022-11-18 +### Fixed +- Fix issue with plugin activation. + +## 1.1.0 - 2022-11-17 +### Added +- Add features for paid Jetpack Scan users, including file and database threats, on-demand scanning, and threat auto-fixers. + +### Changed +- Compatibility: WordPress 6.1 compatibility + +### Fixed +- Adjust alignment of spinner icon and loading text on the in-progress scan screen. + +## 1.0.4 - 2022-08-29 +### Fixed +- Fixed NaN error that prevented the pricing interstitial from rendering. + +## 1.0.3 - 2022-08-26 +### Added +- Added a default 'See all results' label to the mobile navigation button. +- Added a spinner to the in progress scan page in admin +- Added JITM functionality +- Added threat descriptions. +- My Jetpack includes JITMs + +### Changed +- Add condition to check plugin activation context before redirecting + +### Fixed +- Fixed alignment of long navigation item labels on mobile screen sizes. + +## 1.0.2 - 2022-07-27 +### Changed +- Updated package dependencies. + +### Fixed +- Fix protect admin toolbar icon display when Jetpack enabled and connected +- Minor bug fix - added isset() checks for report data properties + +## 1.0.1 - 2022-07-07 +### Added +- Added two new FAQ entries +- Protect: record even just after the site is registered + +### Changed +- Moved normalization of the Protect status report data to the server side. +- Renamed `master` references to `trunk` +- Reorder JS imports for `import/order` eslint rule. + +### Fixed +- Fixed bug that would not display Core vulnerabilities. +- Removed legacy code and documentation and adds new docs for the debug helper plugin. +- Fixed recommendation for plugins that don't have a fix yet +- Protect: Fix visual issue of the Interstitial page + +## 1.0.0 - 2022-05-31 +### Added +- Add additional tracking events +- Add Alert icon to the error admin page +- Add checks to the Site Health page +- Add custom hook to handle viewport sizes via CSS +- Add error message when adding plugin fails +- Add first approach of Interstitial page +- Add Jetpack Scan to promotion section when site doesn't have Security bundle +- Add missing prop-types module dependency +- Add Navigation dropdown mode and use it for small/medium screens +- Add ProductOffer component +- Add product offer component +- Add title and redirect for vul at wpscan +- Add 'get themes' to synced callables in Protect +- Add installedThemes to the initial state +- Add notifications to the menu item and the admin bar +- Add status polling to the Protect admin page. +- Added details to the FAQ question on how Jetpack Protect is different from other Jetpack products. +- Added Jetpack Protect readme file for the plugin listing. +- Added option to display terms of service below product activation button. +- Added Social card to My Jetpack. +- Added the list of installed plugins to the initial state +- Change ConnectScreen by the Interstitial component +- Creates Status Class +- Empty state screen +- Expose and use IconsCard component +- Flush cache on plugin deactivation +- Footer component +- Handle error in the UI +- Hooks on plugin activation and deactivation +- Hook to read data from the initial state +- Implement Footer +- Implement Add Security bundle workflow +- Introduce Accordion component +- Introduce Navigation component +- Introduce Summary component +- Introduce VulnerabilitiesList component +- JS Components: Introduce Alert component. Add error to ProductOffer components +- More options to the testing api responses +- Record admin page-view and get security from footer events +- Render Security component with data provided by wpcom +- Request and expose to the client the Security bundle data +- Update logo + +### Changed +- Add empty state for no vuls +- Add popover at Badge +- Cache empty statuses for a short period of time +- Changed connection screen to the one that does not require a product +- Changed the method used to disconnect +- Changed the wording for the initial screen. +- Change expiration time of plugin cache +- Clean connection data. Update to latest connection API +- Configure Sync to only what we need to sync +- Janitorial: require a more recent version of WordPress now that WP 6.0 is coming out. +- JS Components: Add subTitle prop to ProductOffer component +- JS Components: iterate over Dialog component +- Improve Dialog layout in medium viewport size +- Move VulnerabilitiesList to section hero +- New VulsList +- Redesign Summary component +- Re-implement "Your results will be ready soon" layout +- Re-implement Admin page by using Dialog component +- Remove use of `pnpx` in preparation for pnpm 7.0. +- Replace deprecated external-link variation by using isExternalLink prop +- Require only site level connection +- Truncate items at NavigationGroup +- Tweak footer +- Update Footer and VulsList for small/medium viewport +- Update Navigation to be external controlled +- Update Protect icon +- Update VulnerabilitiesList to remove severity and add fixed in +- Updated package dependencies. +- Update package.json metadata. +- Updates CTA wording to reduce confusion when user already has Jetpack Security Bundle which includes Jetpack Scan +- Update the Status when connection is established +- Use data provided by My Jetpack to render Product offer +- Use weight Button prop to style the "learn more" footer link +- Use a different copy when there are no found vulnerabilities but there are still some unchecked items + +### Removed +- Removed Full Sync from loaded modules as Full Sync Immediately is present by default now + +### Fixed +- Adjust spacing and overflow properties of the navigation labels to improve display of long names. +- Fix Connectino initialization +- Fix fatal when checking whether site site has vuls +- Fix right margin in primary layout diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.eot b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.eot new file mode 100644 index 00000000..51f012dd Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.eot differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.svg new file mode 100644 index 00000000..51e14560 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.svg @@ -0,0 +1,11 @@ + + + +Generated by IcoMoon + + + + + + + \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.ttf b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.ttf new file mode 100644 index 00000000..c44c262f Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.woff b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.woff new file mode 100644 index 00000000..dc898ac5 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.woff differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/images/in-progress.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/images/in-progress.png new file mode 100644 index 00000000..7d712a97 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/images/in-progress.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/jetpack-protect.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/jetpack-protect.css new file mode 100644 index 00000000..d194c5b1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/jetpack-protect.css @@ -0,0 +1,30 @@ +@font-face { + font-family: 'jetpack-protect'; + src: url('fonts/jetpack-protect.eot?31wpn'); + src: url('fonts/jetpack-protect.eot?31wpn#iefix') format('embedded-opentype'), + url('fonts/jetpack-protect.ttf?31wpn') format('truetype'), + url('fonts/jetpack-protect.woff?31wpn') format('woff'), + url('fonts/jetpack-protect.svg?31wpn#jetpack-protect') format('svg'); + font-weight: normal; + font-style: normal; + font-display: block; + } + +[class^="jp-protect-icon"], [class*=" jp-protect-icon"] { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'jetpack-protect' !important; + speak: never; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.jp-protect-icon:before { + content: "\e900"; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-dabfeaa364c305be480c.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-dabfeaa364c305be480c.png new file mode 100644 index 00000000..7d712a97 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-dabfeaa364c305be480c.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.asset.php new file mode 100644 index 00000000..05f931fd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.asset.php @@ -0,0 +1 @@ + array('jetpack-connection', 'jetpack-script-data', 'moment', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '8d3412963d3c47f0ac0a'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.css new file mode 100644 index 00000000..4054c56b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.css @@ -0,0 +1 @@ +._aiMxmJRAw5jRPbZFX57{background-color:var(--jp-gray-90);border-radius:var(--jp-border-radius);color:var(--jp-white);display:flex;overflow:hidden}._aiMxmJRAw5jRPbZFX57.eWgNBUaexiR66ZI1Px4U{border-left:4px solid var(--jp-yellow-20);margin-bottom:calc(var(--spacing-base)*3)}._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{margin-left:calc(var(--spacing-base)*3);position:fixed;right:calc(var(--spacing-base)*3);top:calc(var(--spacing-base)*6)}@media(max-width:782px){._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{top:calc(var(--spacing-base)*8)}}._aiMxmJRAw5jRPbZFX57 a,._aiMxmJRAw5jRPbZFX57 a:active,._aiMxmJRAw5jRPbZFX57 a:hover,._aiMxmJRAw5jRPbZFX57 a:link,._aiMxmJRAw5jRPbZFX57 a:visited{color:var(--jp-white)}.BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-yellow-30);fill:var(--jp-white);align-items:center;display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}.hRRUwTCPRpurhMwRNZkg .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-green-50)}.Z6q3IxY_uR1y2lAPTkVF .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-red)}.eWgNBUaexiR66ZI1Px4U .BnI88X_e8ItF1c9Uozmj{fill:var(--jp-yellow-50);background-color:var(--jp-yellow-5)}.ST8sowTbBVLRPrk4ZQrn{font-size:14px;padding:calc(var(--spacing-base)*1.75)}.eWgNBUaexiR66ZI1Px4U .ST8sowTbBVLRPrk4ZQrn{background-color:var(--jp-yellow-5);color:var(--jp-gray-90)}.lMkO08Vd8YQMfwrwaI8u{fill:var(--jp-gray);align-items:center;background:#0000;border:none;cursor:pointer;display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}._Wc3apZobag_9Ag_THTb{display:flex;justify-content:space-between}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-right:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-left:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-right:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-left:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-right:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-left:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-right:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-left:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-right:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-left:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-right:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-left:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-right:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-left:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-right:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-left:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-right:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-left:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-right:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-left:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-right:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-left:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-right:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-left:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-right:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-left:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-right:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-left:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-right:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-left:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-right:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-left:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-right:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-left:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-right:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-left:calc(var( --spacing-base )*8)}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.51px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-right:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.51px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-left:calc(var(--spacing-base)/2)}.kdsaL7c4bpTwf_A4fIUT{padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6);text-align:center}.b0eN3as5AgxQW7EAkarg{margin-bottom:0}@keyframes rotate-spinner{to{transform:rotate(1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid #0000;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-right-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.JiJhrZaThvWCpM2AfGen{border-radius:32px;flex-shrink:0;font-size:12px;font-style:normal;font-weight:600;line-height:16px;padding:calc(var(--spacing-base)/2);position:relative;text-align:center;width:60px}._7SGksgOpcPbHfPPpQTV{background:var(--jp-red-5);color:var(--jp-red-60)}.pGNquShR54adQ61sx3lP{background:var(--jp-yellow-5);color:var(--jp-yellow-60)}.IM5kkexAfwGLM6zz0Exd{background:var(--jp-gray-0);color:var(--jp-gray-50)}.NHzH3tt6CypjZ92CvK9x{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;padding:calc(var(--spacing-base)*2)}.NHzH3tt6CypjZ92CvK9x:first-of-type{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x:last-of-type{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x+.NHzH3tt6CypjZ92CvK9x{border-top:0}.D9zvYDUrOP_zwSm0yJMs{margin-right:calc(var(--spacing-base)*2);min-width:24px}._XISfmbjoVlqhB61hHYn{width:100%}.AQDPBnMZFu7BOBuo8mYW{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.cZ9s5eCAZe3R82Y6Ru3z{color:var(--jp-gray-80);font-size:14px;line-height:21px}.AKnbWQiViZ2O_dwCV8Fw,.W6alQ2_S5Rh06djX9m27{align-self:center;margin-left:calc(var(--spacing-base)*2);margin-right:var(--spacing-base)}.uUEJGMrSV3XoBwX5xEwA{display:flex;justify-content:space-between}.sQkG5Cu80gPaeFj3L_wa{margin-bottom:calc(var(--spacing-base)*5)}.oIl6GCMeUnzE0inXbuj9{display:flex;justify-content:space-between}.RP2MVoGqaCFXPKZhhxQ1{margin-bottom:calc(var(--spacing-base)*5)}.YpEs8b7KE7fzVuXUbOEb{display:flex;justify-content:space-between}.EqpwvErHtRi_WQkJKgi1{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;margin-bottom:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2)}.EicvN1QaJu5OJLzdUN5A{margin-right:calc(var(--spacing-base)*2);min-width:24px}.b7ynAmUwGlxK_vxyIN0y{width:100%}.uSV9HYRxjL4S6zIZDlqP{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.XpW8Mvw_XFEbqxUdw155{color:var(--jp-gray-80);font-size:14px;line-height:21px}.Fkj60BmQ5sUo9zHcJwVv{align-self:center;margin-left:calc(var(--spacing-base)*2);margin-right:var(--spacing-base)}.XLzPr74ad3osCq9kxy2q{display:flex;justify-content:space-between}.jNlU3vgp4xEGwmX5aTyK{background-color:var(--jp-gray-5)}.gE8s4nh3f7iGIBrFeyCT{list-style-type:disc;padding-left:calc(var(--spacing-base)*2.5)}.L9hh_sX51PzO41icwJlh{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;margin-bottom:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2)}.o8E4Bv6U0d7USFxSjRCj{margin-right:calc(var(--spacing-base)*2);min-width:24px}.sT31awD6bHO8KJewvmaO{width:100%}.VVTRIG51r8ORUIBPs5gN{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.AiaWRbRLFT9xvP9vn5jA{color:var(--jp-gray-80);font-size:14px;line-height:21px}.MP1wWkqvqfvAc7Izl7x4{align-self:center;margin-left:calc(var(--spacing-base)*2);margin-right:var(--spacing-base)}.i9X_KxEJiGpRT7q_RU6i{display:flex;justify-content:space-between}.WtVEv641JBaLl929sZq2{align-items:flex-start;background-color:#00000040;bottom:0;display:flex;justify-content:center;left:0;overflow-y:auto;padding-top:calc(var(--spacing-base)*12 + 2px);position:fixed;right:0;top:0;z-index:1000001}.G0aPt7WmA1rkUE0wcTno{background:var(--jp-white);border:1px solid var(--jp-gray);border-radius:calc(var(--jp-border-radius)*2);box-shadow:0 8px 20px #00000040;padding:calc(var(--spacing-base)*4);position:relative;width:616px}.VkrhWjfEIlIwYEumycbP{background:none;border:none;cursor:pointer;padding:0;position:absolute;right:calc(var(--spacing-base)*3);top:calc(var(--spacing-base)*3)}.yFzeV4cmWRbZKk5tIyEw{display:block}.gridicon{fill:currentColor;display:inline-block}.gridicon.needs-offset g{transform:translate(1px,1px)}.gridicon.needs-offset-x g{transform:translate(1px)}.gridicon.needs-offset-y g{transform:translateY(1px)}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-5:#f5e6b3;--jp-yellow-10:#f2cf75;--jp-yellow-40:#c08c00;--jp-orange-20:#faa754;--jp-blue-5:#ced9f2;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-border-radius-rna:8px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px;--jp-highlight:#3858e9}:where(body){font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-right:-62px}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-left:-62px}.icon-tooltip-helper .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.icon-tooltip-helper .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.icon-tooltip-helper.is-wide .components-popover__content{width:440px}.icon-tooltip-wrapper{color:var(--jp-black);display:inline-block;position:relative}.icon-tooltip-wrapper .components-button.is-link:focus:not(:disabled){box-shadow:none}.icon-tooltip-helper{height:18px;left:-53px;pointer-events:none;position:absolute;top:0;width:124px}.icon-tooltip-container{pointer-events:all}.icon-tooltip-container .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;margin:0 10px;max-width:90vw;outline:none;padding:24px;white-space:normal;width:304px}.icon-tooltip-title{font-size:16px;font-weight:600;line-height:19px}.icon-tooltip-title:not(:last-child){margin-bottom:8px}.icon-tooltip-content{font-size:14px;font-weight:400;line-height:24px}.icon-tooltip-content ul{list-style-type:disc;margin:0 0 0 1rem}.icon-tooltip-content ul li:last-child{margin-bottom:0}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50);text-decoration:underline;white-space:nowrap}.p4qz2tkq0p9hxucJ6Qk2{--padding:calc(var(--spacing-base)*4);color:var(--jp-black)}.lbNDyXioOwvyvbALtCBm{--gap:calc(var(--spacing-base)*3);padding:var(--padding) 0;position:relative}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm{column-gap:var(--gap);display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--columns),1fr);grid-template-rows:repeat(var(--rows),minmax(min-content,max-content))}.cLaNK_XcbTGlRQ4Tp43Q{margin-top:var(--padding)}.s2Lsn4kbm6BrS3DSndRB .cLaNK_XcbTGlRQ4Tp43Q{display:contents}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>*{background:var(--jp-white);position:relative}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>:after{bottom:0;box-shadow:0 4px 24px #0000000d;content:"";left:0;position:absolute;right:0;top:0;z-index:-1}.cLaNK_XcbTGlRQ4Tp43Q>:first-child{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius);border-width:1px 1px 0}.cLaNK_XcbTGlRQ4Tp43Q>:last-child{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius);border-width:0 1px 1px}.DAkZc1P9A3K12fjEliMg{display:flex;flex-direction:column;justify-content:space-between;padding:var(--padding)}.WUBuYABl8nymjs9NnCEL{align-items:center;display:flex;padding-bottom:calc(var(--spacing-base)*2);position:relative}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)){padding-top:calc(var(--spacing-base)*2)}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{background-color:var(--jp-gray);content:"";height:1px;left:var(--padding);position:absolute;right:var(--padding);top:0;z-index:5}.s2Lsn4kbm6BrS3DSndRB .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{left:0;right:unset;width:calc(100% + var(--gap))}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm>:last-child .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{width:100%}.ANtCFeb41NhA8PA3H7ZN,.WUBuYABl8nymjs9NnCEL:last-of-type{padding-bottom:var(--padding)}.Ql2gy_148yW8Vw5vhaKD{padding-left:var(--padding);padding-right:var(--padding)}.EAQrAnQEW1z1BfdY5gbC{margin:0 var(--spacing-base);fill:var(--jp-gray);flex-shrink:0}.EAQrAnQEW1z1BfdY5gbC.JDSTlLoOC_4aUoH2oNM2{fill:var(--jp-green-40)}.EAQrAnQEW1z1BfdY5gbC.zNdQRJ1w7BvaQOYyqzHK{fill:var(--jp-red-50)}.lr7vbX95SKtoe7DarJcZ{margin-left:auto}.s2Lsn4kbm6BrS3DSndRB .lr7vbX95SKtoe7DarJcZ{margin:0 var(--spacing-base);top:1px}.WUBuYABl8nymjs9NnCEL .KRrGp2xdkeBOxLZeuQ6X{fill:var(--jp-gray-20);flex-shrink:0}.H_ZJiRVJg0LiMXPGOcmt{text-align:center;width:fit-content}.H_ZJiRVJg0LiMXPGOcmt>a{color:#000}.s2Lsn4kbm6BrS3DSndRB .H_ZJiRVJg0LiMXPGOcmt{grid-column:2;overflow:hidden;padding-left:var(--padding);padding-right:var(--padding);white-space:nowrap}.x21z_DixObRDsDaWotP1{align-items:right;display:flex;justify-content:right;margin:0 calc(var(--spacing-base)*4)}.dovianZYLKhnbnh9I06o{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-end}.lljtQMhW7lq5tE5SDJEf{align-items:flex-start;display:flex;flex-basis:0;flex-grow:2}.lljtQMhW7lq5tE5SDJEf .NubApIV1vQCRUNprfm6b{margin-left:auto}.dhFQXpZfMwVI8vuYHnwC{align-items:flex-start;display:inline-flex;flex:0 0 auto;position:relative}.dhFQXpZfMwVI8vuYHnwC:first-child{margin-right:calc(var(--spacing-base)*2)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k{color:var(--jp-gray-20)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.C64ZjjUAqJC1T2Sa7apS{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start;margin-bottom:calc(var(--spacing-base)*3)}.UpZDGew6Ay1hPoP6eI7b{color:var(--jp-gray-40);font-size:var(--font-body-small);line-height:20px}.UpZDGew6Ay1hPoP6eI7b:after{content:"​"}.NubApIV1vQCRUNprfm6b{background-color:var(--jp-yellow-10);border-radius:4px;font-size:13px;font-weight:600;margin-left:var(--spacing-base);padding-left:var(--spacing-base);padding-right:var(--spacing-base)}.TDiiPbuW1Z0_05u_pvcK{font-weight:400}.UL3B1tQ854mN7r6taB61{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.IG56Hw7ZR_7rKVsM78qw:focus:not(:disabled){box-shadow:none}.jp-dashboard-footer{align-items:center;color:var(--jp-black);display:flex;flex-wrap:wrap;font-size:var(--font-body-extra-small);line-height:1.333;max-width:1128px;width:100%}.jp-dashboard-footer a{text-decoration:none}.jp-dashboard-footer a:any-link,.jp-dashboard-footer a[role=button]{color:inherit}.jp-dashboard-footer a:hover{text-decoration:underline;text-decoration-thickness:1.5px}.jp-dashboard-footer a:focus{border-radius:2px;box-shadow:none;outline:1.5px solid currentColor;outline-offset:3px}.jp-dashboard-footer.is-sm>ul{gap:.125rem}.jp-dashboard-footer.is-md,.jp-dashboard-footer.is-sm>ul{align-items:flex-start;flex-direction:column}.jp-dashboard-footer>ul{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;list-style:none;margin:0;padding:0;width:100%}.jp-dashboard-footer>ul>li{margin-bottom:0}.jp-dashboard-footer>ul>li>a{align-items:center;display:flex;gap:.25rem;min-height:44px}.jp-dashboard-footer__accessible-external-link{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px}.jp-dashboard-footer__jp-item{font-weight:600;padding-inline-end:1rem}.jp-dashboard-footer.is-sm .jp-dashboard-footer__jp-item{padding-bottom:1rem}.jp-dashboard-footer.is-lg .jp-dashboard-footer__a8c-item{margin-inline-start:auto}.jp-dashboard-footer.is-sm .jp-dashboard-footer__a8c-item{padding-top:1rem}.jp-dashboard-footer__a8c-item>a,.jp-dashboard-footer__jp-item>a{text-decoration:none}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}.sexr0jUxC1jVixdKiDnC{margin-left:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-left:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}.lyrXe0pA852TUmyekDb5{display:flex}.KgEeDTKgTC5ZjzYlbTqN{color:var(--jp-black);font-size:var(--font-body);line-height:1.5;margin-right:calc(var(--spacing-base)*4);padding:var(--spacing-base) 0;text-decoration:none}.KgEeDTKgTC5ZjzYlbTqN:last-child{margin-right:0}.KgEeDTKgTC5ZjzYlbTqN:focus,.KgEeDTKgTC5ZjzYlbTqN:hover{border-bottom-color:var(--jp-green);box-shadow:none;color:var(--jp-green)}.Lv4WoNVkeJntqvUyG4dX{border-bottom:1px solid var(--jp-black)}.vvXnRXxrU1kP1KsdSr4J{margin-top:calc(var(--spacing-base)*3*-1)}.aDCTkUFaJEeZzYYE6qv5{background-color:var(--jp-green);border-radius:32px;color:var(--jp-white);font-size:12px;letter-spacing:-2%;line-height:1;margin-left:var(--spacing-base);padding:calc(var(--spacing-base)/2) var(--spacing-base);position:relative;top:-1px}.uQlXhcfYn9tbnK27_Gct{align-items:center;display:flex}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:checked,.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:indeterminate{background:var(--jp-green-40);border-color:var(--jp-green-40)}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--jp-green-40)}.PO9zDOaSkcv_RqpfZF_v,.e5YHJiYcvfgdEEJsS_YM{margin-bottom:calc(var(--spacing-base)*7);margin-top:calc(var(--spacing-base)*7)}@media(max-width:599px){.PO9zDOaSkcv_RqpfZF_v{margin-top:0}}svg.V6B8ltQ7TH3UKzUC_qy1{color:var(--jp-black);height:32px;margin:0;width:32px}.C9hcvYAbgHPhN2Tl22xg{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.C9hcvYAbgHPhN2Tl22xg .XkbIpr2gzB4XEhHgzkY4{margin-right:calc(var(--spacing-base)/2)}.BfcZn0_X33Ajdd1Gl18G{display:flex}.BfcZn0_X33Ajdd1Gl18G>.rBmVJIeTNpd0RJWaRGuJ{display:flex;margin-left:calc(var(--spacing-base)/2);fill:var(--jp-gray-20)}.jVq5444f1Xh6nNkz0Qe_{margin-top:calc(var(--spacing-base)*4)}.amF9cOnMiv2nHbkMXQiQ{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.FodE_7RbLD8zeBSd6eVR{display:flex;flex-wrap:wrap;margin-left:auto}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-right:calc(var(--spacing-base)*3)}.twyPhW_K164HITnDrwEg{padding:calc(var(--spacing-base)*2);width:250px}.tbcd9xc_TjcFdokOt3F_{font-size:18px}@media(max-width:599px){.pnoqLV3l30xuvj2hLlJc{width:90%}.FodE_7RbLD8zeBSd6eVR{margin-top:calc(var(--spacing-base)*3)}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-bottom:var(--spacing-base);margin-right:0}}.bZ4b33s2MdcOjaDKBbeV{--spacing-base:8px;--wp-admin-border-width-focus:1.5px;align-items:center;display:flex;white-space:nowrap}.UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-gray-50);border-radius:50%;flex-shrink:0;height:.666em;width:.666em}.QuS0vdcr87FsiBvSSrvA{font-weight:600;line-height:1.666;margin-left:calc(var(--spacing-base)/2)}.bZ4b33s2MdcOjaDKBbeV.bGx0wbQAwuY7k8P3PHVQ a,.bZ4b33s2MdcOjaDKBbeV.bGx0wbQAwuY7k8P3PHVQ span{color:var(--jp-green-50)}.bZ4b33s2MdcOjaDKBbeV.bGx0wbQAwuY7k8P3PHVQ .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-green-50)}.bZ4b33s2MdcOjaDKBbeV.wR8Cz8uHgObTQavolv5y a,.bZ4b33s2MdcOjaDKBbeV.wR8Cz8uHgObTQavolv5y span{color:var(--jp-gray-50)}.bZ4b33s2MdcOjaDKBbeV.wR8Cz8uHgObTQavolv5y .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-gray-50)}.bZ4b33s2MdcOjaDKBbeV.IzbBYGwBKhSYFUQlIMww a,.bZ4b33s2MdcOjaDKBbeV.IzbBYGwBKhSYFUQlIMww span{color:var(--jp-red-50)}.bZ4b33s2MdcOjaDKBbeV.IzbBYGwBKhSYFUQlIMww .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-red-50)}.bZ4b33s2MdcOjaDKBbeV.Kdvp_HJf89IBrZuCaLm8 a,.bZ4b33s2MdcOjaDKBbeV.Kdvp_HJf89IBrZuCaLm8 span{color:var(--jp-yellow-30)}.bZ4b33s2MdcOjaDKBbeV.Kdvp_HJf89IBrZuCaLm8 .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-yellow-30)}.bZ4b33s2MdcOjaDKBbeV.hVf5vsbBWm8OFye7cy7a a,.bZ4b33s2MdcOjaDKBbeV.hVf5vsbBWm8OFye7cy7a span{color:var(--jp-blue-40)}.bZ4b33s2MdcOjaDKBbeV.hVf5vsbBWm8OFye7cy7a .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-blue-40)}.IunwKwdvL271DxBIniPb[type=checkbox]{display:none}.svA9WxEcOByd5S2fZonA{border:2px solid var(--jp-black);border-radius:100px;box-sizing:border-box;cursor:pointer;display:inline-block;height:24px;outline:0;padding:2px;position:relative;transition:all .4s ease,box-shadow 0s;vertical-align:middle;width:48px}.svA9WxEcOByd5S2fZonA:after{background:var(--jp-black);border-radius:50%;content:"";display:block;height:16px;left:0;position:relative;transition:all .2s ease;width:16px}.IunwKwdvL271DxBIniPb:checked+.svA9WxEcOByd5S2fZonA:after{left:22px}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-black);border-color:var(--jp-black)}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-green);border-color:var(--jp-green)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:disabled+span.svA9WxEcOByd5S2fZonA{cursor:default;opacity:.25}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA{border-radius:8px;height:16px;width:24px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA:after{height:12px;width:12px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n:checked+.svA9WxEcOByd5S2fZonA:after{left:8px}.Clxt94RgGnDrhORZZyPr,.K2OG1vK5PSOYDWKtqKKG{margin-bottom:calc(var(--spacing-base)*7);margin-top:calc(var(--spacing-base)*7)}.msOlyh2T7D6uhbM6AROg{align-items:center;background:none;border:2px solid var(--jp-green-40);border-radius:var(--jp-border-radius);color:var(--jp-gray-80);display:flex;gap:calc(var(--spacing-base)*3);justify-content:space-between;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);position:relative;text-align:left;width:100%}.msOlyh2T7D6uhbM6AROg a,.msOlyh2T7D6uhbM6AROg button{all:unset;color:var(--jp-gray-80);cursor:pointer}.msOlyh2T7D6uhbM6AROg a:after,.msOlyh2T7D6uhbM6AROg button:after{content:"";height:100%;left:0;position:absolute;top:0;width:100%}.msOlyh2T7D6uhbM6AROg:focus-within{border-color:var(--jp-black)}.msOlyh2T7D6uhbM6AROg:focus-within .cPN7USVqSBpxUswfDtUZ,.msOlyh2T7D6uhbM6AROg:hover .cPN7USVqSBpxUswfDtUZ{transform:translateX(calc(var(--spacing-base)*2))}.msOlyh2T7D6uhbM6AROg:focus-within .EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg:hover .EmnJAyEzzn1QpA8HtypY{text-decoration:underline;text-decoration-thickness:2px}.EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg .EmnJAyEzzn1QpA8HtypY{font-weight:700}.cPN7USVqSBpxUswfDtUZ{fill:var(--jp-green-40);pointer-events:none;transition:transform .1s ease-out}.vV7YZikAz0oHYsuvtxMq{display:inline;margin:0 0 0 calc(var(--spacing-base)/3);vertical-align:middle}.vV7YZikAz0oHYsuvtxMq svg{position:relative;z-index:10}.T1YaMupeZmBIpXZHY9EZ{display:inline}.rigH8UdiDrmmSLQMUurD{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);color:var(--jp-black);display:block;font-size:var(--font-body);letter-spacing:-.02em;line-height:1.5;padding:var(--spacing-base) calc(var(--spacing-base)*1.5);transition:box-shadow .1s ease-out;width:100%}.rigH8UdiDrmmSLQMUurD::placeholder{color:var(--jp-gray-20)}.rigH8UdiDrmmSLQMUurD:focus{box-shadow:0 0 0 2px var(--jp-green-5)}.rigH8UdiDrmmSLQMUurD:focus,.rigH8UdiDrmmSLQMUurD:hover:not(:disabled){border:1px solid var(--jp-green)}.rigH8UdiDrmmSLQMUurD:disabled{background-color:var(--jp-gray-0);color:var(--jp-gray-30)}.V8FDM08CpcwQs4UwN2nI{color:var(--jp-black);display:block;font-size:var(--font-title-small);font-weight:600;margin-bottom:var(--spacing-base)}.L1LjeCYPldBcTLILS13l{max-width:calc(744px + var(--spacing-base)*6);width:100%}.JWWznnb8sAKHIOhE59_z{display:flex}.JWWznnb8sAKHIOhE59_z:not(:first-child){margin-top:calc(var(--spacing-base)*7)}.kV5wl2UResIqqBdSTuQr{margin-right:calc(var(--spacing-base)*2);padding-top:calc(var(--spacing-base)/2)}@media(min-width:600px){.kV5wl2UResIqqBdSTuQr{margin-right:calc(var(--spacing-base)*5)}}.oePuSIKcH_JzEhDJcHh8{width:100%}.mxYw7vghJF8H8C0FjvPz{align-items:center;display:flex}.lyiOCAyjT_eQyDg8Ier_ .oePuSIKcH_JzEhDJcHh8{opacity:.5}.IclfL4iNXTZfBAbHZdog>:last-child{margin-top:calc(var(--spacing-base)*2)}@media(min-width:600px){.IclfL4iNXTZfBAbHZdog{display:flex;justify-content:space-between}}.bOadM4auwszaOl0el95T{display:flex;flex-wrap:wrap;margin-top:calc(var(--spacing-base)*2)}.G7vkgqk8AEd6pRbNUyE4{color:var(--jp-green-50);margin-right:calc(var(--spacing-base)/2)}.qnlbRElIsj4nB45F5s3a{color:var(--jp-gray-50)}.TvvdPGzRa_ubn3BnQOnQ{color:var(--jp-red-50)}.ciEDIqQimh9OqgCN4t3c{display:flex;flex-wrap:wrap}.qQ3tqN6Pi9DJ2xYLvfvA{color:var(--jp-gray-50)}.xmutRBXpbSs8i1QMo5FT{margin-right:calc(var(--spacing-base)/2)}.kQ5SrYe6QmF63mEYQ26R,.xmutRBXpbSs8i1QMo5FT{color:var(--jp-green-50)}.yAFMUkq1ot9DZF05RUwG{margin-top:calc(var(--spacing-base)*3)}@media(min-width:600px){.yAFMUkq1ot9DZF05RUwG{padding-left:calc(var(--spacing-base)*11)}}.EbfrbByI7NQ2_MD_gDXp{align-items:center;border:1px solid var(--jp-gray-30);border-radius:4px;color:var(--jp-gray-30);display:flex;font-size:12px;height:21px;margin-bottom:calc(var(--spacing-base)*2);margin-left:var(--spacing-base);padding:calc(var(--spacing-base)/2)}.hCwaBLH_6dELyWWwB8S1{padding:calc(var(--spacing-base)*3);width:304px}.V3U9oKSdRmKjOQ523C86{display:flex;justify-content:space-between}.OSrT4pA4vIGzg9EE6rcv{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-3)}.OSrT4pA4vIGzg9EE6rcv:focus,.OSrT4pA4vIGzg9EE6rcv:focus:not(:disabled){box-shadow:none}.rbL50q3wwzE6X7VBHcmW{display:flex;justify-content:flex-end}.gF7LiE_q_elhMrhdypAl{color:var(--jp-gray-50)}.gF7LiE_q_elhMrhdypAl:before{background:var(--jp-gray-50);border-radius:50%;content:"";display:inline-block;height:8px;margin-right:var(--spacing-base);width:8px}.gF7LiE_q_elhMrhdypAl.fbJbqf_YrPpMG4JKF79U{color:var(--jp-green-40)}.gF7LiE_q_elhMrhdypAl.fbJbqf_YrPpMG4JKF79U:before{background:var(--jp-green-40)}.g593fzjQCE_4rNiiwLdg{line-height:1;margin-bottom:calc(var(--spacing-base)*1.5)}.CIp_BwDbLdjYPSVrreqg{align-items:flex-start;justify-content:space-between}.CIp_BwDbLdjYPSVrreqg,.m2epTt5F7wBQNcMdguwQ{display:flex;margin-top:calc(var(--spacing-base)*2)}.m2epTt5F7wBQNcMdguwQ{justify-content:right}.HrEvG7sxsWbTLD0sk477{border-bottom:2px solid var(--jp-gray-5);margin-top:calc(var(--spacing-base)*7)}.VHYulMcpzbr10HWR0iSE{align-items:flex-start;border:1px solid var(--jp-black);border-color:var(--jp-gray-5);border-left-width:6px;border-radius:4px;display:flex;font-size:var(--font-body);padding:24px 31px 27px 18px}.FGpSkMCiIHQjszcV0dbn{margin-right:20px}.FGpSkMCiIHQjszcV0dbn,.KoWZcCwhW13xvkEb0QON{height:calc(var(--spacing-base)*3);width:calc(var(--spacing-base)*3)}.KoWZcCwhW13xvkEb0QON{background-color:#0000;border:none;cursor:pointer;outline:none}@media screen and (max-width:600px){.VHYulMcpzbr10HWR0iSE{box-shadow:0 4px 8px #00000008,0 1px 2px #0000000f;padding-top:68px;position:relative}.FGpSkMCiIHQjszcV0dbn{left:24px;position:absolute;top:24px}.KoWZcCwhW13xvkEb0QON{position:absolute;right:24px;top:24px}}.smrfczkC53EaFM8OJUXs{flex-grow:1}.IKYRWoPwt9xOVEx1wzNS{font-weight:600;margin-bottom:8px}.qM0qY6mPYp1MPN54A3Kg{align-items:center;display:flex;margin-top:20px}.qM0qY6mPYp1MPN54A3Kg a,.qM0qY6mPYp1MPN54A3Kg a:active,.qM0qY6mPYp1MPN54A3Kg a:focus,.qM0qY6mPYp1MPN54A3Kg a:hover{color:var(--jp-black)}.qM0qY6mPYp1MPN54A3Kg>*{margin-right:24px}.A5YkDkkXuiYgavrY6Nux{border-left-color:var(--jp-red)}.A5YkDkkXuiYgavrY6Nux .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-red)}.cT5rwuPMZzWvi5o6shMl{border-left-color:var(--jp-yellow-20)}.cT5rwuPMZzWvi5o6shMl .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-yellow-20)}.yo0O3uvNomPsYUXFCpAS{border-left-color:var(--black)}.yo0O3uvNomPsYUXFCpAS .y_IPyP1wIAOhyNaqvXJq{fill:var(--black)}.oZdDFf1jBLkzn5ICCC6x{border-left-color:var(--jp-green)}.oZdDFf1jBLkzn5ICCC6x .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-green)}.EU0Rvu4PDqVtnCAmbgHg{height:56px;margin-bottom:calc(var(--spacing-base)*8);width:48px}.EU0Rvu4PDqVtnCAmbgHg>svg{left:-40px;position:relative;top:-36px}.MeZ8EJKfFWG5h1abL4gD{padding:calc(var(--spacing-base)*7) 0}.vzMlFr1AXWqefpRrb976{align-items:center;display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*3)}.gYSOMa4xxLXmsNzvFPkW{background-color:var(--jp-gray-5);border-radius:calc(var(--spacing-base)*3);width:100%}.hNJWdt5qmZkWYAH_vjIp{background-color:var(--jp-green-40);border-radius:calc(var(--spacing-base)*3);height:9px;transition:width .2s}.DHMUfGyHbl5BgD5vjxVz{color:var(--jp-gray-90);font-weight:600;line-height:24px;margin-left:auto;padding-left:var(--spacing-base)}.XqQBRzrxyMhhZvPXIHgk .components-button{box-shadow:inset 0 0 0 1.5px var(--jp-gray);position:relative}.XqQBRzrxyMhhZvPXIHgk .components-button:first-child{border-radius:var(--jp-border-radius) 0 0 var(--jp-border-radius)}.XqQBRzrxyMhhZvPXIHgk .components-button:last-child{border-radius:0 var(--jp-border-radius) var(--jp-border-radius) 0}.XqQBRzrxyMhhZvPXIHgk .components-button:hover{z-index:1}.XqQBRzrxyMhhZvPXIHgk .components-button+.components-button{margin-left:-1.5px}.ttGgvvtxu52J_2mCCopL{padding:calc(var(--spacing-base)*7) 0}.HKtrpPFSTSG9Xek34vBa,.UZsYf4noF2SMuyOqGWPA{align-items:center;display:flex}.HKtrpPFSTSG9Xek34vBa{height:100%}.HKtrpPFSTSG9Xek34vBa img{object-fit:cover;width:100%}.dgFk23NY71PPMar8DEME,.t_Av4raklvnsBRBA4hms{margin-top:calc(var(--spacing-base)*3 + 1px)}.t_Av4raklvnsBRBA4hms{display:flex;justify-content:flex-end}.B5k6PdQs1UVDzb2J98wR>:first-child{flex:1}@media(min-width:960px){.B5k6PdQs1UVDzb2J98wR{align-items:flex-start;display:flex}}._h9h7RagEFrCDu7S2Vfi{display:flex;flex-direction:column;gap:var(--spacing-base)}._h9h7RagEFrCDu7S2Vfi>:last-child{margin-top:calc(var(--spacing-base)*2)}.sSzimfzP9ZeilBh2H0Um{align-items:center;color:var(--jp-black);display:flex;margin-bottom:0}.X7CVf27QOnW2yuV332eo{margin-left:-4px;margin-right:var(--spacing-base)}.SaA9v6DNQOHPx1EK90y9{align-items:flex-end;flex-direction:column}.SaA9v6DNQOHPx1EK90y9,.kadiUBzNiR_qFA1y7Eig{display:flex;gap:calc(var(--spacing-base)*2)}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aLWBKY0yRghEk7tNCgK3{fill:var(--color-bluesky)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw{fill:var(--color-nextdoor)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI{fill:var(--color-threads)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI.social-logo{border-radius:40%}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box}.GqFcAwJvIrg1v7f6QUfw{display:flex;flex-direction:column;min-height:230px;padding:calc(var(--spacing-base)*3);width:304px}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S{display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*2)}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S .KnqJLKwSceJTwFJrPGHq{max-width:226px}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S .PJU0_yA9jNf7ao0jhHut{background-color:var(--jp-white);color:var(--jp-gray-90);flex-shrink:0;height:calc(var(--spacing-base)*3);min-width:unset;width:calc(var(--spacing-base)*3)}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S .PJU0_yA9jNf7ao0jhHut:hover:not(:focus){box-shadow:none}.GqFcAwJvIrg1v7f6QUfw .rrORM3zqHfGvqiPduEXY{align-items:flex-end;display:flex;flex-grow:1;height:calc(var(--spacing-base)*6);justify-content:flex-end;margin-top:calc(var(--spacing-base)*2)}.GqFcAwJvIrg1v7f6QUfw .rrORM3zqHfGvqiPduEXY .Q7fUcDUGhteXEr18rZPC{color:var(--jp-gray-60);flex-grow:1;margin-bottom:var(--spacing-base)}.GqFcAwJvIrg1v7f6QUfw .rrORM3zqHfGvqiPduEXY .S5LAeskUiEQ0JlPhr0Ze{flex-shrink:0}.OtDl6kocO_m2s9sRHaqX{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;max-height:600px;width:100%}.BjwJh1S1YVPI7AjmTx6a+.BjwJh1S1YVPI7AjmTx6a{margin-top:calc(var(--spacing-base)*5)}.YWfK8VTp2wnByBauYPKg{background-color:var(--jp-gray-0);overflow-x:scroll;padding:calc(var(--spacing-base)*3)}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:flex-end;margin-top:calc(var(--spacing-base)*3);padding-top:calc(var(--spacing-base)*3)}.ap6lG79CncSqdigJS_WA{margin-top:calc(var(--spacing-base)*4)}.uym7dGHhp6ifjF57yOAO{align-items:flex-end;display:flex;margin-bottom:calc(var(--spacing-base)*2.25)}.e_2eFTR8RyHwmfeqJL4F{flex:1;margin-bottom:0}.IKQVU01PrDMMV5UFLOKv{display:flex;gap:calc(var(--spacing-base)*2)}.pkw2LnOTd8VvQ3oT8sXQ{border-top:1px solid var(--jp-gray);display:flex;justify-content:right;padding-top:calc(var(--spacing-base)*4);width:100%}.pkw2LnOTd8VvQ3oT8sXQ>:last-child{margin-left:calc(var(--spacing-base)*2)}.qazuloIt0teplSEwxRN0{background-color:#fff;border:1px solid var(--jp-gray);border-bottom:none;color:var(--jp-gray-50);display:grid;grid-template-columns:repeat(9,1fr);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);width:100%}.qazuloIt0teplSEwxRN0>span:first-child{grid-column:1/7}.qazuloIt0teplSEwxRN0>span:not(:first-child){text-align:center}.iJ_biSBRDribuNKX0Zuw{margin:calc(var(--spacing-base)*4) calc(var(--spacing-base)*8);text-align:center}@media(max-width:599px){.uym7dGHhp6ifjF57yOAO{margin-bottom:calc(var(--spacing-base)*3)}.e_2eFTR8RyHwmfeqJL4F{display:none}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:center}.pkw2LnOTd8VvQ3oT8sXQ>*{width:50%}}.v640YfEL85A9rCvyHSzW{align-items:center;display:flex;gap:4px;justify-content:center;margin-bottom:calc(var(--spacing-base)*2);margin-top:calc(var(--spacing-base)*4)}.v640YfEL85A9rCvyHSzW button{font-size:var(--font-body);height:auto;line-height:32px;min-width:32px;padding:0 var(--spacing-base);width:auto}.v640YfEL85A9rCvyHSzW button.gfxpe4zp6ShFsIsce8Ii,.v640YfEL85A9rCvyHSzW button.gfxpe4zp6ShFsIsce8Ii:hover:not(:disabled){background:none;color:var(--jp-black)}.x8UuVEhWucPfdq0hEJg6{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius)}.x8UuVEhWucPfdq0hEJg6>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.eb6Ovfvm1yONz4mdOwbH{background-color:var(--jp-white)}.jF9LXpXR3TxZVDw7TVXT{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.jF9LXpXR3TxZVDw7TVXT>:first-of-type{grid-column:1/8}.jF9LXpXR3TxZVDw7TVXT>:last-of-type{grid-column:9}.jF9LXpXR3TxZVDw7TVXT:hover{background:var(--jp-gray-0)}.lNQgAfpwdAUSOLZd8dlD{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.WRQwDYPdffWznX158azR{margin-right:var(--spacing-base)}.dJx9pvlYjDnKn11n5wo8{font-weight:600;margin-bottom:var(--spacing-base);margin-left:calc(var(--spacing-base)*4)}.EKcbLuSblRc7UpzgsFXw{align-items:center}.ILMBWlMLcXc0n97IisrG{overflow:hidden;transform-origin:top center}.T8XIzCNJBQy1UETN5gjU{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.kWoHGiaZSbq9XJVyUOMC{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.HQgjxePFDRJHamBAGcVU{background-color:var(--jp-white);border-radius:var(--jp-border-radius);box-shadow:0 0 40px #00000014;margin:0;padding:var(--spacing-base) 0}.KtdsNIMumOoHNWMLmuAJ{align-items:center;display:flex;justify-content:space-between;margin:0;padding:calc(var(--spacing-base)*2);text-align:left}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2{cursor:pointer;outline-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:focus:not(.owofT85W_XvVdb5vr1GN),.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:hover:not(.owofT85W_XvVdb5vr1GN){background-color:var(--jp-gray-0)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN{background-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .NESnw2xCLrBpP6WlYZL4{color:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .aohnd_y_1lrMuww8NH63{fill:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .Rnas_2_2_eLZSYfZ347E{background-color:var(--jp-red);border:1px solid var(--jp-red);color:var(--jp-white)}.NESnw2xCLrBpP6WlYZL4{align-items:center;display:flex;overflow-x:hidden;padding-right:var(--spacing-base)}.m4_14yNRByDyO9yf9pGg{display:block;overflow-x:hidden;text-overflow:ellipsis}.aohnd_y_1lrMuww8NH63{margin-right:calc(var(--spacing-base)*2)}.Rnas_2_2_eLZSYfZ347E{align-items:center;border:1px solid var(--jp-red-60);border-radius:50%;box-sizing:border-box;color:var(--jp-red-60);display:flex;justify-content:center;min-width:30px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.X8NRHUTBa_4wDvoHN9TT{fill:var(--jp-green-50)}.CsuOteurQlJm4IjXqyZ0{fill:var(--jp-gray-20)}.fvbewglUxEvV1o04yzzp{--icon-size:28px;--item-spacing:calc(var( --spacing-base )*2);--left-spacing:calc(var( --icon-size ) + var( --item-spacing ));list-style:none}.DINy59MKjwiQanaoDTiV{padding:calc(var(--spacing-base)*2)}.XoacHJljw8zRW_fkBSyg{padding:0}.mXM4WZRePVTa07dhQ6MD{margin-left:var(--left-spacing)}.sI3V8khLdCqxkhJQ_XnI{display:flex;justify-content:flex-start;padding:calc(var(--spacing-base)*2)}.hgdxMuIvZwTZ0sfXaols{padding:calc(var(--spacing-base)*2);width:250px}.UErHS2HAh1gszGfYuVIf{align-items:center;background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);display:flex;justify-content:space-between;padding:calc(var(--spacing-base)*2);width:100%}.lEhH1hvCcxLVFMHI8Gwv{display:flex;justify-content:flex-start}.c57Vj4QhAHwcK_HZMxtN{margin-right:var(--spacing-base)}.LumryWNddoF092fZgN2O{font-size:var(--font-body);line-height:1.5}.NFMwU3H5k2qArZe2TTp9{background-color:var(--jp-gray-10);font-weight:600;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.G5W9M8qfo3sGl2OIbwg9{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:Courier\ 10 Pitch,Courier,monospace;overflow-x:scroll;white-space:pre}.Bx4RDCUR316fm_jgGS8N{background-color:var(--jp-gray-10);color:var(--jp-gray-50);display:flex;flex-direction:column;padding:0 var(--spacing-base);text-align:right}.GhN0JvAyRQI3SnVWp2Ot{display:flex;flex-direction:column;flex-grow:1;overflow-x:visible}.GhN0JvAyRQI3SnVWp2Ot del,.GhN0JvAyRQI3SnVWp2Ot div,.GhN0JvAyRQI3SnVWp2Ot ins{padding:0 var(--spacing-base);text-decoration:none}.GhN0JvAyRQI3SnVWp2Ot del{background-color:var(--jp-red-0);color:var(--jp-red-60)}.GhN0JvAyRQI3SnVWp2Ot ins{background-color:var(--jp-green-5);color:var(--jp-green-60)}.xpPHTch5ul0xuZaUoTNa{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:monospace;overflow-x:scroll;padding:0}.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-0)}.i0_0xMrNWoak1brIaDQq{display:flex;flex-direction:column;text-align:right}.C9fLawPLkMNSZthfwxj6{background-color:var(--jp-gray-10);color:var(--font-body);padding:0 calc(var(--spacing-base)/2)}.C9fLawPLkMNSZthfwxj6.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-50);color:var(--jp-white)}.ogixgg8fRGekmYGtevh1{display:flex;flex:1;flex-direction:column;overflow-x:visible;white-space:pre}.jYPCgKMDRKfT3vnx0mdG{padding-left:var(--spacing-base)}.UEQ1NqkrwNmaQR7qdEK3{background-color:var(--jp-red);border-radius:calc(var(--jp-border-radius)/2);color:var(--jp-white);padding:calc(var(--spacing-base)/4) calc(var(--spacing-base)/2)}.sfXsfklfkeSRtE9ivQwF{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:inline-block;width:100%}.sfXsfklfkeSRtE9ivQwF>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.ozRrKPlj1QFGUyd3oVke{background-color:var(--jp-white)}.PyvnSHQuuUkZvVsArigy{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.PyvnSHQuuUkZvVsArigy>:first-of-type{grid-column:1/7}.PyvnSHQuuUkZvVsArigy>:last-of-type{grid-column:9}.PyvnSHQuuUkZvVsArigy>:not(:first-child){margin:auto}.PyvnSHQuuUkZvVsArigy:hover{background:var(--jp-gray-0)}.u9Xod5s8bCRNj9MR1Drl{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.IbeyulkpO9kjYJ4OkYUD{margin-right:var(--spacing-base)}.KiCgmjHm2f0JDU3cMsgf{font-weight:600}.KiCgmjHm2f0JDU3cMsgf,.kh5zuLR1zNf7KCsxhAZ5{margin-bottom:var(--spacing-base);margin-left:calc(var(--spacing-base)*4)}.kh5zuLR1zNf7KCsxhAZ5{font-size:var(--font-body-small);font-weight:400}.z1z63g62c73XbcPk9DWc{background-color:var(--jp-gray-50);display:inline-block;height:4px;margin:2px 12px;width:4px}.kJ8t3FAtd5VAYjk31SfA{align-items:center}.JP0IJZcYRohfgntEozjm{overflow:hidden;transform-origin:top center}.y7c6zi2wjEnbW3F29fmP{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.wQWiN_J0SqgduvadyGnm{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.v1fUFCBPmd6miSCf_ehK{fill:var(--jp-green-40)}.oR9QG6gRLvyzqiuIarmu{border-radius:32px;flex-shrink:0;font-size:12px;font-style:normal;font-weight:600;line-height:16px;margin-left:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);position:relative;text-align:center;width:60px}.oR9QG6gRLvyzqiuIarmu.bZ8KDXMWoim85Zv31E7E{background-color:#008a20;color:var(--jp-white)}.oR9QG6gRLvyzqiuIarmu.uYEkrN4rh8n5cs3aPrYC{background-color:var(--jp-gray-50);color:var(--jp-white)}.WOX88CWB12lzxcMcl_ns{color:#008a20}@media(max-width:599px){.PyvnSHQuuUkZvVsArigy{display:grid;grid-auto-rows:minmax(auto,auto)}.PyvnSHQuuUkZvVsArigy>:first-child{grid-column:1/8;grid-row:1}.PyvnSHQuuUkZvVsArigy>:nth-child(2){grid-row:2;padding-left:calc(var(--spacing-base)*4)}.PyvnSHQuuUkZvVsArigy>:nth-child(3){grid-row:2}.PyvnSHQuuUkZvVsArigy>:nth-child(3) span{margin-top:var(--spacing-base);position:absolute}.PyvnSHQuuUkZvVsArigy>:last-child{grid-column:10;grid-row:1/3}.oR9QG6gRLvyzqiuIarmu{display:none}}@media(max-width:1200px){.kh5zuLR1zNf7KCsxhAZ5{display:grid}.z1z63g62c73XbcPk9DWc{display:none}}.aEAAkNfx0ERh4LEvCBVw>:first-child{flex:1}@media(min-width:960px){.aEAAkNfx0ERh4LEvCBVw{align-items:flex-start;display:flex}}.f3l2VSMBpGpf6Ta1jP5f{align-items:center;color:var(--jp-black);display:flex}.v4n86Hu06mIkxqFkfYY2{margin-left:-4px;margin-right:var(--spacing-base)}.fTSgXuIQCZFFBxzFCE0q{align-items:flex-end;display:flex;flex-direction:column;gap:calc(var(--spacing-base)*2)}.KmIjHqrMs3duMPaUf50k{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;max-height:600px;width:100%}.DJS67UCXVaM7nIMJePYQ{align-items:flex-end;display:flex;justify-content:flex-end;margin-bottom:calc(var(--spacing-base)*2.25)}.s4378tf2MiM0bMIxQZkI{flex:1;margin-bottom:0}.jifq7nsF5kZYrcpGQ35V{display:flex;gap:calc(var(--spacing-base)*2)}@media(max-width:599px){.DJS67UCXVaM7nIMJePYQ{margin-bottom:calc(var(--spacing-base)*3)}.s4378tf2MiM0bMIxQZkI{display:none}}*{box-sizing:border-box}#jetpack-protect-root{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.51px;--actions-size:28px} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js new file mode 100644 index 00000000..1fc941e9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js @@ -0,0 +1,69 @@ +/*! For license information please see index.js.LICENSE.txt */ +(()=>{var e={9826:(e,t,a)=>{"use strict";a.d(t,{i:()=>n});const c={AED:{symbol:"د.إ.‏",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.‏",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.‏",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.‏",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.‏",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.‏",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.‏",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.‏",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.‏",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.‏",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£‏",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.‏",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function n(e){return c[e]||{symbol:"$",grouping:",",decimal:".",precision:2}}},7397:(e,t,a)=>{"use strict";a.d(t,{vA:()=>r});var c=a(9826),n=a(8506);function r(e,t,a={}){const r=(0,c.i)(t);if(!r||isNaN(e))return null;const{decimal:l,grouping:s,precision:i,symbol:o}={...r,...a},m=e<0?"-":"",p=Math.abs(e),d=Math.floor(p);return{sign:m,symbol:o,integer:(0,n.A)(p,i,l,s).split(l)[0],fraction:i>0?(0,n.A)(p-d,i,l,s).slice(1):""}}},8506:(e,t,a)=>{"use strict";function c(e,t=0,a=".",c=","){const n=(e+"").replace(/[^0-9+\-Ee.]/g,""),r=isFinite(+n)?+n:0,l=isFinite(+t)?Math.abs(t):0,s=(l?function(e,t){const a=Math.pow(10,t);return""+(Math.round(e*a)/a).toFixed(t)}(r,l):""+Math.round(r)).split(".");return s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,c)),(s[1]||"").lengthc})},1113:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var c=a(6087);const n=(0,c.forwardRef)((function({icon:e,size:t=24,...a},n){return(0,c.cloneElement)(e,{width:t,height:t,...a,ref:n})}))},1797:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})})},3883:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})})},7350:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(c.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})},8888:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})},9115:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},8248:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(c.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})})},1249:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})})},991:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})},4314:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(c.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})})},2072:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(c.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})})},3512:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})})},1651:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"})})},748:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})})},9783:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})})},435:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(c.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})})},311:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,n.jsx)(c.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})})},4648:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(5573),n=a(790);const r=(0,n.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,n.jsx)(c.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})})},6185:e=>{"use strict";function t(e){return e&&"object"==typeof e?n(e)||r(e)?e:c(e)?function(e,t){if(e.map)return e.map(t);for(var a=[],c=0;c{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const a="color: "+this.color;t.splice(1,0,a,"color: inherit");let c=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(c++,"%c"===e&&(n=c))})),t.splice(n,0,a)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=a(3212)(t);const{formatters:c}=e.exports;c.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},3212:(e,t,a)=>{e.exports=function(e){function t(e){let a,n,r,l=null;function s(...e){if(!s.enabled)return;const c=s,n=Number(new Date),r=n-(a||n);c.diff=r,c.prev=a,c.curr=n,a=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let l=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((a,n)=>{if("%%"===a)return"%";l++;const r=t.formatters[n];if("function"==typeof r){const t=e[l];a=r.call(c,t),e.splice(l,1),l--}return a})),t.formatArgs.call(c,e);(c.log||t.log).apply(c,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=c,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==l?l:(n!==t.namespaces&&(n=t.namespaces,r=t.enabled(e)),r),set:e=>{l=e}}),"function"==typeof t.init&&t.init(s),s}function c(e,a){const c=t(this.namespace+(void 0===a?":":a)+e);return c.log=this.log,c}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let a;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const c=("string"==typeof e?e:"").split(/[\s,]+/),n=c.length;for(a=0;a{t[a]=e[a]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let a=0;for(let t=0;t{"use strict";t.i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.split(/\r\n|[\n\v\f\r\x85]/),c=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],n=[],r=0;function l(){var e={};for(n.push(e);r{"use strict";a.d(t,{AO:()=>u,Rr:()=>h,TM:()=>o,rc:()=>c});var c,n=a(7790);!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(c||(c={}));var r=function(e){return e};var l="beforeunload",s="hashchange",i="popstate";function o(e){void 0===e&&(e={});var t=e.window,a=void 0===t?document.defaultView:t,o=a.history;function g(){var e=h(a.location.hash.substr(1)),t=e.pathname,c=void 0===t?"/":t,n=e.search,l=void 0===n?"":n,s=e.hash,i=void 0===s?"":s,m=o.state||{};return[m.idx,r({pathname:c,search:l,hash:i,state:m.usr||null,key:m.key||"default"})]}var v=null;function f(){if(v)b.call(v),v=null;else{var e=c.Pop,t=g(),a=t[0],n=t[1];if(b.length){if(null!=a){var r=y-a;r&&(v={action:e,location:n,retry:function(){x(-1*r)}},x(r))}}else S(e)}}a.addEventListener(i,f),a.addEventListener(s,(function(){u(g()[1])!==u(w)&&f()}));var E=c.Pop,A=g(),y=A[0],w=A[1],k=p(),b=p();function _(e){return function(){var e=document.querySelector("base"),t="";if(e&&e.getAttribute("href")){var c=a.location.href,n=c.indexOf("#");t=-1===n?c:c.slice(0,n)}return t}()+"#"+("string"==typeof e?e:u(e))}function R(e,t){return void 0===t&&(t=null),r((0,n.A)({pathname:w.pathname,hash:"",search:""},"string"==typeof e?h(e):e,{state:t,key:d()}))}function C(e,t){return[{usr:e.state,key:e.key,idx:t},_(e)]}function j(e,t,a){return!b.length||(b.call({action:e,location:t,retry:a}),!1)}function S(e){E=e;var t=g();y=t[0],w=t[1],k.call({action:E,location:w})}function x(e){o.go(e)}null==y&&(y=0,o.replaceState((0,n.A)({},o.state,{idx:y}),""));var N={get action(){return E},get location(){return w},createHref:_,push:function e(t,n){var r=c.Push,l=R(t,n);if(j(r,l,(function(){e(t,n)}))){var s=C(l,y+1),i=s[0],m=s[1];try{o.pushState(i,"",m)}catch(e){a.location.assign(m)}S(r)}},replace:function e(t,a){var n=c.Replace,r=R(t,a);if(j(n,r,(function(){e(t,a)}))){var l=C(r,y),s=l[0],i=l[1];o.replaceState(s,"",i),S(n)}},go:x,back:function(){x(-1)},forward:function(){x(1)},listen:function(e){return k.push(e)},block:function(e){var t=b.push(e);return 1===b.length&&a.addEventListener(l,m),function(){t(),b.length||a.removeEventListener(l,m)}}};return N}function m(e){e.preventDefault(),e.returnValue=""}function p(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function d(){return Math.random().toString(36).substr(2,8)}function u(e){var t=e.pathname,a=void 0===t?"/":t,c=e.search,n=void 0===c?"":c,r=e.hash,l=void 0===r?"":r;return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),l&&"#"!==l&&(a+="#"===l.charAt(0)?l:"#"+l),a}function h(e){var t={};if(e){var a=e.indexOf("#");a>=0&&(t.hash=e.substr(a),e=e.substr(0,a));var c=e.indexOf("?");c>=0&&(t.search=e.substr(c),e=e.substr(0,c)),e&&(t.pathname=e)}return t}},8579:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={wrapper:"GqFcAwJvIrg1v7f6QUfw",header:"OENx8kmm62tkWGukzP2S",title:"KnqJLKwSceJTwFJrPGHq","close-button":"PJU0_yA9jNf7ao0jhHut",footer:"rrORM3zqHfGvqiPduEXY",steps:"Q7fUcDUGhteXEr18rZPC","action-button":"S5LAeskUiEQ0JlPhr0Ze"}},2021:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"admin-page":"sexr0jUxC1jVixdKiDnC",background:"vKQ11sLeAM45M04P1ccj"}},6888:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"section-hero":"vMa4i_Dza2t5Zi_Bw9Nf"}},2258:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={button:"zI5tJ_qhWE6Oe6Lk75GY","is-icon-button":"tuBt2DLqimiImoqVzPqo",small:"Na39I683LAaSA99REg14",normal:"ipS7tKy9GntCS4R3vekF",icon:"paGLQwtPEaJmtArCcmyK",regular:"lZAo6_oGfclXOO9CC6Rd","full-width":"xJDOiJxTt0R_wSl8Ipz_",loading:"q_tVWqMjl39RcY6WtQA6","external-icon":"CDuBjJp_8jxzx5j6Nept"}},2127:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={cut:"msOlyh2T7D6uhbM6AROg",icon:"cPN7USVqSBpxUswfDtUZ",cta:"EmnJAyEzzn1QpA8HtypY",iconContainer:"vV7YZikAz0oHYsuvtxMq",description:"T1YaMupeZmBIpXZHY9EZ"}},3689:()=>{},4803:()=>{},2300:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"star-icon":"cuoSlhSNrqf1dozY22Xb",jetpack:"lAIiifeLMmZAPlQ9n9ZR","checkmark-icon":"JLquNpQVlysAamuh5lJO",socialIcon:"cbOwD8Y4tFjwimmtchQI",bluesky:"aLWBKY0yRghEk7tNCgK3",facebook:"aHOlEBGD5EA8NKRw3xTw",instagram:"cL3m0xBYTYhIKI7lCqDB",twitter:"af4Y_zItXvLAOEoSDPSv",linkedin:"f68aqF3XSD1OBvXR1get",tumblr:"xFI0dt3UiXRlRQdqPWkx",google:"q7JEoyymveP6kF747M43",mastodon:"DKOBOTVmTLbh26gUH_73",nextdoor:"n5XodNsuMfMAAvqHFmbw",whatsapp:"fftumuc_lJ6v0tq4UMVR",threads:"inzgC27qxdt7hSdhTWRI"}},4206:()=>{},8403:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)"}},7371:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",smCols:"4",mdCols:"8",lgCols:"12","col-sm-1":"RuVLl3q4lxTQa3wbhBJB","col-sm-1-start":"f9LZTRG4MMK42rS89afW","col-sm-1-end":"bHe_zKxjjpUwHw_MdYE1","col-sm-2":"QZbNrOqE2aNSn50xVhpU","col-sm-2-start":"ev7W3z7zVYPeHAlYqZjf","col-sm-2-end":"NJWd1m_e7lOiPYru2ZMP","col-sm-3":"Xc6nt1Qc1DI0Z2A3gt1r","col-sm-3-start":"UIcN_GXiPRoIsin8Kohg","col-sm-3-end":"GRKCyqb5LufCSCgykKFc","col-sm-4":"i_qTq8gqhhC3vIUepVRB","col-sm-4-start":"G3qaZ3Jpbvam_1XvGxgc","col-sm-4-end":"VRCNYKZtO9zukEwmgP1y","col-md-1":"tRm008K_WJL79WoNZTNL","col-md-1-start":"l5T2P_bgKts4tdaRkS1d","col-md-1-end":"zOCxfLZpF6BlgC7a_Yq1","col-md-2":"F80DdgVn0m5OpvtSQWka","col-md-2-start":"oI1c7JYfiJtMQHbhngtU","col-md-2-end":"pMQtA_4jh1_1lVknqEP5","col-md-3":"VenqMpdgyKQVUNNQcfqd","col-md-3-start":"seNYL99uoczf9V4MxBxT","col-md-3-end":"YKfF1HFhI9KygA5l3b2J","col-md-4":"yAi0Cv1xDWkoqsaUhvhR","col-md-4-start":"ubhnyZOnkgxNhh6XtVWv","col-md-4-end":"RGOPGQbWMJ9Ei5oFxS7X","col-md-5":"Sz1E2aWbX483ijdi6yge","col-md-5-start":"tku6_bRYrX9tMbgYGmIl","col-md-5-end":"b5JHttOhSEcI1WBlqAjk","col-md-6":"FboSx5MoKTAWbxXyYlCw","col-md-6-start":"Jhs8yEEmodG30edbJvag","col-md-6-end":"IpzbbKVqEqPcfIGkXkwt","col-md-7":"mhCPwfAZ4Kmm_empzJAq","col-md-7-start":"x034ilrJF7rO9UJB2rI1","col-md-7-end":"Wt8t2e16viRrOJ1lLA5v","col-md-8":"S6pIrEy9AMLKx9bgh_Ae","col-md-8-start":"kEfI4tGyuWfHTlRnvIab","col-md-8-end":"PUzX4RRsKq1dnsz3gebS","col-lg-1":"X_pdcLJikd8LS_YAdJlB","col-lg-1-start":"tl936d14Huby4khYp05X","col-lg-1-end":"hnge0LnR69d3NXEtEE1t","col-lg-2":"fj0NUMuyZQcPNgKcjp5Z","col-lg-2-start":"R2ncBX7a2NigdYCcV1OX","col-lg-2-end":"t8vMSDVYno9k9itRwnXb","col-lg-3":"wsDuEN2GqHx6qzo8dUdk","col-lg-3-start":"cIEVPUweWtLBy3xaXnMx","col-lg-3-end":"fajUWBwu1m2B479j3jmz","col-lg-4":"YR0c7fQTgMkDdWzwSyLp","col-lg-4-start":"xlwp8BmplxkKNMI7gamo","col-lg-4-end":"_C4O1w9DUqx1m3gPf8aA","col-lg-5":"Z54F1hAErckAIrKlxnXW","col-lg-5-start":"ezSDWkRHmKSxDJXxuiOH","col-lg-5-end":"T0ChoeAjGJjkkNrYhD4g","col-lg-6":"qtMoMPF6yHvGJnWHSsde","col-lg-6-start":"gdoywN5VPiWERfIBqkph","col-lg-6-end":"wUev_VH5uf_pwFFlbnAU","col-lg-7":"egIPDFJsOpownTClq9XP","col-lg-7-start":"yGhp9yoAW7k0kQik9AB7","col-lg-7-end":"SJ43U9mR5wUg5V2qBeQA","col-lg-8":"cTuyHfMwSUJxN_HdIEgd","col-lg-8-start":"smCr8DaIagcumdvdldiK","col-lg-8-end":"T03NHzQJvzwL6wAfIiTL","col-lg-9":"pMvxM3RJGjqyNdf9qg1Y","col-lg-9-start":"iIVpNRwEnQ_JI5gpp9EN","col-lg-9-end":"ZbQ4u4vGSX5rJOje4uGL","col-lg-10":"gKb5wuIDAlKGbrjK2vxy","col-lg-10-start":"Z7pINdImE2WJiYnZBTqm","col-lg-10-end":"ZTxp6qpvwurMdOnLLSz1","col-lg-11":"NnQTlbfnxPDR6cQ7rygg","col-lg-11-start":"O137wZd6Yl0olSA9PsXR","col-lg-11-end":"zf2OJtQ2MPz6SDoh6CB0","col-lg-12":"U3H6UHW6HqRt9hdzVg3O","col-lg-12-start":"zynnNeS_ZBTxABcVpUQH","col-lg-12-end":"vI8tltFZtFUNAy9Iag9s"}},2420:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",container:"SqdhUZkXCRuIpErj1B3z",fluid:"OZC_9a1LhpWF9dv15Gdh"}},7410:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={container:"VHYulMcpzbr10HWR0iSE","icon-wrapper":"FGpSkMCiIHQjszcV0dbn","close-button":"KoWZcCwhW13xvkEb0QON","main-content":"smrfczkC53EaFM8OJUXs",title:"IKYRWoPwt9xOVEx1wzNS","action-bar":"qM0qY6mPYp1MPN54A3Kg","is-error":"A5YkDkkXuiYgavrY6Nux",icon:"y_IPyP1wIAOhyNaqvXJq","is-warning":"cT5rwuPMZzWvi5o6shMl","is-info":"yo0O3uvNomPsYUXFCpAS","is-success":"oZdDFf1jBLkzn5ICCC6x"}},3142:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={container:"p4qz2tkq0p9hxucJ6Qk2",table:"lbNDyXioOwvyvbALtCBm","is-viewport-large":"s2Lsn4kbm6BrS3DSndRB",card:"cLaNK_XcbTGlRQ4Tp43Q","is-primary":"CYt1X0eH1icRjhtJ28jx",header:"DAkZc1P9A3K12fjEliMg",item:"WUBuYABl8nymjs9NnCEL","last-feature":"ANtCFeb41NhA8PA3H7ZN",value:"Ql2gy_148yW8Vw5vhaKD",icon:"EAQrAnQEW1z1BfdY5gbC","icon-check":"JDSTlLoOC_4aUoH2oNM2","icon-cross":"zNdQRJ1w7BvaQOYyqzHK",popover:"lr7vbX95SKtoe7DarJcZ","popover-icon":"KRrGp2xdkeBOxLZeuQ6X",tos:"H_ZJiRVJg0LiMXPGOcmt","tos-container":"x21z_DixObRDsDaWotP1"}},3407:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={container:"dovianZYLKhnbnh9I06o","price-container":"lljtQMhW7lq5tE5SDJEf","promo-label":"NubApIV1vQCRUNprfm6b",price:"dhFQXpZfMwVI8vuYHnwC","is-not-off-price":"eD7hzxFmdtG_MgmBtl_k",footer:"C64ZjjUAqJC1T2Sa7apS",legend:"UpZDGew6Ay1hPoP6eI7b",symbol:"TDiiPbuW1Z0_05u_pvcK"}},8325:()=>{},416:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={status:"bZ4b33s2MdcOjaDKBbeV",status__indicator:"UzkzDaqt2mXprJh2OXRz",status__label:"QuS0vdcr87FsiBvSSrvA","is-active":"bGx0wbQAwuY7k8P3PHVQ","is-inactive":"wR8Cz8uHgObTQavolv5y","is-error":"IzbBYGwBKhSYFUQlIMww","is-action":"Kdvp_HJf89IBrZuCaLm8","is-initializing":"hVf5vsbBWm8OFye7cy7a"}},9634:()=>{},4495:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={reset:"WQVtrU6q0L1Igcj7wCrQ","headline-medium":"UujoBFTnQNY2cWU2SIsH","headline-small":"TeGO5V_thHw5lDAm1_2M","headline-small-regular":"WolQzb2MsSgiNmLtc7_j","title-medium":"hUB0JT8p1T2Hw28N6qC8","title-medium-semi-bold":"gKZWDv5chz3_O3Syp74H","title-small":"zY2No8Ga4b8shbOQGhnv",body:"tIj0D1t8Cc892ikmgFPZ","body-small":"KdcN0BnOaVeVhyLRKqhS","body-extra-small":"dso3Rh3tl3Xv1GumBktz","body-extra-small-bold":"mQ1UlbN9u4Mg9byO8m7v",label:"PItlW5vRExLnTj4a8eLE","m-0":"TwRpPlktzxhmFVeua7P5","mx-0":"zVfqx7gyb3o9mxfGynn1","my-0":"iSHVzNiB9iVleGljaQxy","mt-0":"xqDIp6cNVr_E6RXaiPyD","mr-0":"S8EwaXk1kyPizt6x4WH2","mb-0":"ODX5Vr1TARoLFkDDFooD","ml-0":"cphJ8dCpfimnky7P2FHg","m-1":"PFgIhNxIyiSuNvQjAIYj","mx-1":"M2jKmUzDxvJjjVEPU3zn","my-1":"io15gAh8tMTNbSEfwJKk","mt-1":"rcTN5uw9xIEeMEGL3Xi_","mr-1":"CQSkybjq2TcRM1Xo9COV","mb-1":"hfqOWgq6_MEGdFE82eOY","ml-1":"I8MxZQYTbuu595yfesWA","m-2":"kQkc6rmdpvLKPkyoJtVQ","mx-2":"j6vFPxWuu4Jan2ldoxpp","my-2":"hqr39dC4H_AbactPAkCG","mt-2":"c3dQnMi16C6J6Ecy4283","mr-2":"YNZmHOuRo6hU7zzKfPdP","mb-2":"Db8lbak1_wunpPk8NwKU","ml-2":"ftsYE5J9hLzquQ0tA5dY","m-3":"Det4MHzLUW7EeDnafPzq","mx-3":"h_8EEAztC29Vve1datb5","my-3":"YXIXJ0h1k47u6hzK8KcM","mt-3":"soADBBkcIKCBXzCTuV9_","mr-3":"zSX59ziEaEWGjnpZa4uV","mb-3":"yrVTnq_WBMbejg89c2ZQ","ml-3":"UKtHPJnI2cXBWtPDm5hM","m-4":"guexok_Tqd5Tf52hRlbT","mx-4":"oS1E2KfTBZkJ3F0tN7T6","my-4":"DN1OhhXi6AoBgEdDSbGd","mt-4":"ot2kkMcYHv53hLZ4LSn0","mr-4":"A1krOZZhlQ6Sp8Cy4bly","mb-4":"pkDbXXXL32237M0hokEh","ml-4":"XXv4kDTGvEnQeuGKOPU3","m-5":"yGqHk1a57gaISwkXwXe6","mx-5":"X8cghM358X3DkXLc9aNK","my-5":"GdfSmGwHlFnN2S6xBn1f","mt-5":"yqeuzwyGQ7zG0avrGqi_","mr-5":"g9emeCkuHvYhveiJbfXO","mb-5":"Lvk3dqcyHbZ07QCRlrUQ","ml-5":"r3yQECDQ9qX0XZzXlVAg","m-6":"aQhlPwht2Cz1X_63Miw0","mx-6":"JyHb0vK3wJgpblL9s5j8","my-6":"cY2gULL1lAv6WPNIRuf3","mt-6":"NBWQ9Lwhh_fnry3lg_p7","mr-6":"yIOniNe5E40C8fWvBm5V","mb-6":"t30usboNSyqfQWIwHvT3","ml-6":"Nm_TyFkYCMhOoghoToKJ","m-7":"C4qJKoBXpgKtpmrqtEKB","mx-7":"S93Srbu6NQ_PBr7DmTiD","my-7":"fJj8k6gGJDks3crUZxOS","mt-7":"cW6D6djs7Ppm7fD7TeoV","mr-7":"DuCnqNfcxcP3Z__Yo5Ro","mb-7":"im8407m2fw5vOg7O2zsw","ml-7":"G0fbeBgvz2sh3uTP9gNl","m-8":"kvW3sBCxRxUqz1jrVMJl","mx-8":"tOjEqjLONQdkiYx_XRnw","my-8":"op5hFSx318zgxsoZZNLN","mt-8":"c9WfNHP6TFKWIfLxv52J","mr-8":"sBA75QqcqRwwYSHJh2wc","mb-8":"GpL6idrXmSOM6jB8Ohsf","ml-8":"HbtWJoQwpgGycz8dGzeT","p-0":"uxX3khU88VQ_Ah49Ejsa","px-0":"KX0FhpBKwKzs9fOUdbNz","py-0":"PfK8vKDyN32dnimlzYjz","pt-0":"emxLHRjQuJsImnPbQIzE","pr-0":"kJ8WzlpTVgdViXt8ukP9","pb-0":"tg_UIUI11VBzrTAn2AzJ","pl-0":"uczvl8kaz84oPQJ2DB2R","p-1":"o7UHPcdVK3lt7q3lqV4o","px-1":"IDqEOxvDoYrFYxELPmtX","py-1":"DdywPW2qSYlu2pt8tpO2","pt-1":"npy3hw4A5QSkDicb2CJJ","pr-1":"LgbptTApNY5NwLQvEFAt","pb-1":"WZQy2SZuZso59bUsXXyl","pl-1":"o331apInxNunbYB3SfPE","p-2":"fMPIyD9Vqki1Lrc_yJnG","px-2":"i2pMcTcdrr10IQoiSm_L","py-2":"eA702gn32kwptiI1obXH","pt-2":"o9bGieUKcYc8o0Ij9oZX","pr-2":"SwZcFez1RDqWsOFjB5iG","pb-2":"eHpLc_idmuEqeqCTvqkN","pl-2":"vU39i2B4P1fUTMB2l6Vo","p-3":"JHWNzBnE29awhdu5BEh1","px-3":"X72lGbb56L3KFzC2xQ9N","py-3":"BzfNhRG8wXdCEB5ocQ6e","pt-3":"srV0KSDC83a2fiimSMMQ","pr-3":"lUWfkmbQjCskhcNwkyCm","pb-3":"Ts0dIlc3aTSL7V4cIHis","pl-3":"CzlqQXXhX6MvorArFZ8B","p-4":"TqMPkQtR_DdZuKb5vBoV","px-4":"a7UrjhI69Vetlcj9ZVzz","py-4":"StEhBzGs2Gi5dDEkjhAv","pt-4":"FGneZfZyvYrt1dG0zcnm","pr-4":"APEH216rpdlJWgD2fHc8","pb-4":"oGwXC3ohCic9XnAj6x69","pl-4":"U6gnT9y42ViPNOcNzBwb","p-5":"IpdRLBwnHqbqFrixgbYC","px-5":"HgNeXvkBa9o3bQ5fvFZm","py-5":"tJtFZM3XfPG9v9TSDfN1","pt-5":"PdifHW45QeXYfK568uD8","pr-5":"mbLkWTTZ0Za_BBbFZ5b2","pb-5":"vVWpZpLlWrkTt0hMk8XU","pl-5":"RxfaJj5a1Nt6IavEo5Zl","p-6":"SppJULDGdnOGcjZNCYBy","px-6":"palY2nLwdoyooPUm9Hhk","py-6":"WYw1JvZC0ppLdvSAPhr_","pt-6":"YEEJ9b90ueQaPfiU8aeN","pr-6":"QE0ssnsKvWJMqlhPbY5u","pb-6":"n8yA3jHlMRyLd5UIfoND","pl-6":"tXHmxYnHzbwtfxEaG51n","p-7":"kBTsPKkO_3g_tLkj77Um","px-7":"RyhrFx6Y1FGDrGAAyaxm","py-7":"CBwRpB0bDN3iEdQPPMJO","pt-7":"vQVSq6SvWKbOMu6r4H6b","pr-7":"oBy5__aEADMsH46mrgFX","pb-7":"KVEXoJqf1s92j0JMdNmN","pl-7":"ZMXGNrNaKW3k_3TLz0Fq","p-8":"tuiR9PhkHXhGyEgzRZRI","px-8":"U7454qyWkQNa2iaSJziu","py-8":"VLYIv2GVocjuN93e8HC8","pt-8":"X1rm9DQ1zLGLfogja5Gn","pr-8":"JS7G6kAuqJo5GIuF8S5t","pb-8":"Y8F9ga1TDCMbM1lj4gUz","pl-8":"AJuyNGrI63BOWql719H8"}},9422:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={global:"_fUXxnSp5pagKBp9gSN7"}},1517:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={navigation:"vvXnRXxrU1kP1KsdSr4J",badge:"aDCTkUFaJEeZzYYE6qv5"}},3940:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={container:"EU0Rvu4PDqVtnCAmbgHg"}},3902:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"button-group":"XqQBRzrxyMhhZvPXIHgk"}},9370:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={loading:"kdsaL7c4bpTwf_A4fIUT",loading__message:"b0eN3as5AgxQW7EAkarg"}},2148:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={footer:"_Wc3apZobag_9Ag_THTb"}},1526:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"diff-viewer":"LumryWNddoF092fZgN2O","diff-viewer__filename":"NFMwU3H5k2qArZe2TTp9","diff-viewer__file":"G5W9M8qfo3sGl2OIbwg9","diff-viewer__line-numbers":"Bx4RDCUR316fm_jgGS8N","diff-viewer__lines":"GhN0JvAyRQI3SnVWp2Ot"}},2938:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"main-content":"MeZ8EJKfFWG5h1abL4gD"}},934:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"footer-checkbox":"uQlXhcfYn9tbnK27_Gct","standalone-mode-section":"e5YHJiYcvfgdEEJsS_YM","share-data-section":"PO9zDOaSkcv_RqpfZF_v"}},1416:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={spinner:"V6B8ltQ7TH3UKzUC_qy1","firewall-subheading":"C9hcvYAbgHPhN2Tl22xg","brute-force-protection-subheading":"XkbIpr2gzB4XEhHgzkY4","firewall-subheading__content":"BfcZn0_X33Ajdd1Gl18G","icon-popover":"rBmVJIeTNpd0RJWaRGuJ","upgrade-button":"jVq5444f1Xh6nNkz0Qe_","firewall-header":"amF9cOnMiv2nHbkMXQiQ","stat-card-wrapper":"FodE_7RbLD8zeBSd6eVR","popover-text":"twyPhW_K164HITnDrwEg","loading-text":"tbcd9xc_TjcFdokOt3F_","firewall-heading":"pnoqLV3l30xuvj2hLlJc"}},4047:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={list:"sQkG5Cu80gPaeFj3L_wa",footer:"oIl6GCMeUnzE0inXbuj9"}},2318:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={list:"RP2MVoGqaCFXPKZhhxQ1",footer:"YpEs8b7KE7fzVuXUbOEb"}},9443:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"form-toggle":"IunwKwdvL271DxBIniPb","form-toggle__switch":"svA9WxEcOByd5S2fZonA","is-compact":"wOd7DeP76v1fczKfah5n"}},4493:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={accordion:"x8UuVEhWucPfdq0hEJg6","accordion-item":"eb6Ovfvm1yONz4mdOwbH","accordion-header":"jF9LXpXR3TxZVDw7TVXT","accordion-header-label":"lNQgAfpwdAUSOLZd8dlD","accordion-header-label-icon":"WRQwDYPdffWznX158azR","accordion-header-description":"dJx9pvlYjDnKn11n5wo8","accordion-header-button":"EKcbLuSblRc7UpzgsFXw","accordion-body":"ILMBWlMLcXc0n97IisrG","accordion-body-close":"T8XIzCNJBQy1UETN5gjU","accordion-body-open":"kWoHGiaZSbq9XJVyUOMC"}},4871:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={threat:"EqpwvErHtRi_WQkJKgi1",threat__icon:"EicvN1QaJu5OJLzdUN5A",threat__summary:"b7ynAmUwGlxK_vxyIN0y",threat__summary__label:"uSV9HYRxjL4S6zIZDlqP",threat__summary__title:"XpW8Mvw_XFEbqxUdw155",threat__severity:"Fkj60BmQ5sUo9zHcJwVv",footer:"XLzPr74ad3osCq9kxy2q"}},840:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"protect-header":"UL3B1tQ854mN7r6taB61","get-started-button":"IG56Hw7ZR_7rKVsM78qw"}},4054:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"marked-lines":"xpPHTch5ul0xuZaUoTNa","marked-lines__marked-line":"AMOpkL9LURkyTK8316cw","marked-lines__line-numbers":"i0_0xMrNWoak1brIaDQq","marked-lines__line-number":"C9fLawPLkMNSZthfwxj6","marked-lines__lines":"ogixgg8fRGekmYGtevh1","marked-lines__line":"jYPCgKMDRKfT3vnx0mdG","marked-lines__mark":"UEQ1NqkrwNmaQR7qdEK3"}},7259:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={modal:"WtVEv641JBaLl929sZq2",modal__window:"G0aPt7WmA1rkUE0wcTno",modal__close:"VkrhWjfEIlIwYEumycbP",modal__close__icon:"yFzeV4cmWRbZKk5tIyEw"}},3066:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={navigation:"HQgjxePFDRJHamBAGcVU","navigation-item":"KtdsNIMumOoHNWMLmuAJ",clickable:"ewyV4ZGn34WDNXmK3ej2",selected:"owofT85W_XvVdb5vr1GN","navigation-item-label":"NESnw2xCLrBpP6WlYZL4","navigation-item-icon":"aohnd_y_1lrMuww8NH63","navigation-item-badge":"Rnas_2_2_eLZSYfZ347E","navigation-item-label-text":"m4_14yNRByDyO9yf9pGg","navigation-item-check-badge":"X8NRHUTBa_4wDvoHN9TT","navigation-item-info-badge":"CsuOteurQlJm4IjXqyZ0","navigation-group":"fvbewglUxEvV1o04yzzp","navigation-group-label":"DINy59MKjwiQanaoDTiV","navigation-group-content":"XoacHJljw8zRW_fkBSyg","navigation-group-list":"mXM4WZRePVTa07dhQ6MD","navigation-group-truncate":"sI3V8khLdCqxkhJQ_XnI","popover-text":"hgdxMuIvZwTZ0sfXaols","navigation-dropdown-button":"UErHS2HAh1gszGfYuVIf","navigation-dropdown-label":"lEhH1hvCcxLVFMHI8Gwv","navigation-dropdown-icon":"c57Vj4QhAHwcK_HZMxtN"}},600:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={notice:"_aiMxmJRAw5jRPbZFX57","notice--info":"eWgNBUaexiR66ZI1Px4U","notice--floating":"ZGELG1CO333FilJXOaeI",notice__icon:"BnI88X_e8ItF1c9Uozmj","notice--success":"hRRUwTCPRpurhMwRNZkg","notice--error":"Z6q3IxY_uR1y2lAPTkVF",notice__message:"ST8sowTbBVLRPrk4ZQrn",notice__close:"lMkO08Vd8YQMfwrwaI8u"}},7489:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={accordion:"sfXsfklfkeSRtE9ivQwF","accordion-item":"ozRrKPlj1QFGUyd3oVke","accordion-header":"PyvnSHQuuUkZvVsArigy","accordion-header-label":"u9Xod5s8bCRNj9MR1Drl","accordion-header-label-icon":"IbeyulkpO9kjYJ4OkYUD","accordion-header-description":"KiCgmjHm2f0JDU3cMsgf","accordion-header-status":"kh5zuLR1zNf7KCsxhAZ5","accordion-header-status-separator":"z1z63g62c73XbcPk9DWc","accordion-header-button":"kJ8t3FAtd5VAYjk31SfA","accordion-body":"JP0IJZcYRohfgntEozjm","accordion-body-close":"y7c6zi2wjEnbW3F29fmP","accordion-body-open":"wQWiN_J0SqgduvadyGnm","icon-check":"v1fUFCBPmd6miSCf_ehK","status-badge":"oR9QG6gRLvyzqiuIarmu",fixed:"bZ8KDXMWoim85Zv31E7E",ignored:"uYEkrN4rh8n5cs3aPrYC","is-fixed":"WOX88CWB12lzxcMcl_ns"}},8744:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"progress-bar":"vzMlFr1AXWqefpRrb976","progress-bar__wrapper":"gYSOMa4xxLXmsNzvFPkW","progress-bar__bar":"hNJWdt5qmZkWYAH_vjIp","progress-bar__percent":"DHMUfGyHbl5BgD5vjxVz"}},4969:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"product-section":"Clxt94RgGnDrhORZZyPr","info-section":"K2OG1vK5PSOYDWKtqKKG"}},2399:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"threat-severity-badge":"JiJhrZaThvWCpM2AfGen","is-critical":"_7SGksgOpcPbHfPPpQTV","is-high":"pGNquShR54adQ61sx3lP","is-low":"IM5kkexAfwGLM6zz0Exd"}},1847:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={mark:"jNlU3vgp4xEGwmX5aTyK",list:"gE8s4nh3f7iGIBrFeyCT"}},4356:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={tabs:"lyrXe0pA852TUmyekDb5",tab:"KgEeDTKgTC5ZjzYlbTqN","tab--active":"Lv4WoNVkeJntqvUyG4dX"}},6578:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={textarea:"rigH8UdiDrmmSLQMUurD",label:"V8FDM08CpcwQs4UwN2nI"}},9054:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={threat:"NHzH3tt6CypjZ92CvK9x",threat__icon:"D9zvYDUrOP_zwSm0yJMs",threat__summary:"_XISfmbjoVlqhB61hHYn",threat__summary__label:"AQDPBnMZFu7BOBuo8mYW",threat__summary__title:"cZ9s5eCAZe3R82Y6Ru3z",threat__severity:"AKnbWQiViZ2O_dwCV8Fw",threat__checkbox:"W6alQ2_S5Rh06djX9m27"}},1476:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={empty:"OtDl6kocO_m2s9sRHaqX","threat-section":"BjwJh1S1YVPI7AjmTx6a","threat-filename":"YWfK8VTp2wnByBauYPKg","threat-footer":"pkw2LnOTd8VvQ3oT8sXQ","threat-item-cta":"ap6lG79CncSqdigJS_WA","list-header":"uym7dGHhp6ifjF57yOAO","list-title":"e_2eFTR8RyHwmfeqJL4F","list-header__controls":"IKQVU01PrDMMV5UFLOKv","accordion-header":"qazuloIt0teplSEwxRN0","manual-scan":"iJ_biSBRDribuNKX0Zuw","pagination-container":"v640YfEL85A9rCvyHSzW",unfocused:"gfxpe4zp6ShFsIsce8Ii"}},6834:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={threat:"L9hh_sX51PzO41icwJlh",threat__icon:"o8E4Bv6U0d7USFxSjRCj",threat__summary:"sT31awD6bHO8KJewvmaO",threat__summary__label:"VVTRIG51r8ORUIBPs5gN",threat__summary__title:"AiaWRbRLFT9xvP9vn5jA",threat__severity:"MP1wWkqvqfvAc7Izl7x4",footer:"i9X_KxEJiGpRT7q_RU6i"}},8340:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={footer:"uUEJGMrSV3XoBwX5xEwA"}},7642:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={container:"L1LjeCYPldBcTLILS13l","toggle-section":"JWWznnb8sAKHIOhE59_z","toggle-section__control":"kV5wl2UResIqqBdSTuQr","toggle-section__content":"oePuSIKcH_JzEhDJcHh8","toggle-section__title":"mxYw7vghJF8H8C0FjvPz","toggle-section--disabled":"lyiOCAyjT_eQyDg8Ier_","toggle-section__details":"IclfL4iNXTZfBAbHZdog","automatic-rules-stats":"bOadM4auwszaOl0el95T","automatic-rules-stats__version":"G7vkgqk8AEd6pRbNUyE4","automatic-rules-stats__last-updated":"qnlbRElIsj4nB45F5s3a","automatic-rules-stats__failed-install":"TvvdPGzRa_ubn3BnQOnQ","manual-rules-stats":"ciEDIqQimh9OqgCN4t3c","manual-rules-stats__no-rules":"qQ3tqN6Pi9DJ2xYLvfvA","manual-rules-stats__block-list-count":"xmutRBXpbSs8i1QMo5FT","manual-rules-stats__allow-list-count":"kQ5SrYe6QmF63mEYQ26R","upgrade-trigger-section":"yAFMUkq1ot9DZF05RUwG",badge:"EbfrbByI7NQ2_MD_gDXp",popover:"hCwaBLH_6dELyWWwB8S1",popover__header:"V3U9oKSdRmKjOQ523C86",popover__button:"OSrT4pA4vIGzg9EE6rcv",popover__footer:"rbL50q3wwzE6X7VBHcmW",status:"gF7LiE_q_elhMrhdypAl",active:"fbJbqf_YrPpMG4JKF79U","allow-list-current-ip":"g593fzjQCE_4rNiiwLdg","allow-list-button-container":"CIp_BwDbLdjYPSVrreqg","block-list-button-container":"m2epTt5F7wBQNcMdguwQ",divider:"HrEvG7sxsWbTLD0sk477"}},5960:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={summary:"aEAAkNfx0ERh4LEvCBVw",summary__title:"f3l2VSMBpGpf6Ta1jP5f",summary__icon:"v4n86Hu06mIkxqFkfYY2",summary__actions:"fTSgXuIQCZFFBxzFCE0q",empty:"KmIjHqrMs3duMPaUf50k","list-header":"DJS67UCXVaM7nIMJePYQ","list-title":"s4378tf2MiM0bMIxQZkI","list-header__controls":"jifq7nsF5kZYrcpGQ35V"}},6359:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={"main-content":"ttGgvvtxu52J_2mCCopL","loading-content":"UZsYf4noF2SMuyOqGWPA",illustration:"HKtrpPFSTSG9Xek34vBa","connection-error-col":"dgFk23NY71PPMar8DEME","history-button-col":"t_Av4raklvnsBRBA4hms","scan-section-header":"B5k6PdQs1UVDzb2J98wR","scan-section-header__content":"_h9h7RagEFrCDu7S2Vfi","scan-section-header__subtitle":"sSzimfzP9ZeilBh2H0Um","scan-section-header__icon":"X7CVf27QOnW2yuV332eo","scan-section-header__controls":"SaA9v6DNQOHPx1EK90y9","scan-section-header__controls__row":"kadiUBzNiR_qFA1y7Eig"}},5490:()=>{},4997:e=>{var t=1e3,a=60*t,c=60*a,n=24*c,r=7*n,l=365.25*n;function s(e,t,a,c){var n=t>=1.5*a;return Math.round(e/a)+" "+c+(n?"s":"")}e.exports=function(e,i){i=i||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var i=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*l;case"weeks":case"week":case"w":return i*r;case"days":case"day":case"d":return i*n;case"hours":case"hour":case"hrs":case"hr":case"h":return i*c;case"minutes":case"minute":case"mins":case"min":case"m":return i*a;case"seconds":case"second":case"secs":case"sec":case"s":return i*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}(e);if("number"===o&&isFinite(e))return i.long?function(e){var r=Math.abs(e);if(r>=n)return s(e,r,n,"day");if(r>=c)return s(e,r,c,"hour");if(r>=a)return s(e,r,a,"minute");if(r>=t)return s(e,r,t,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=n)return Math.round(e/n)+"d";if(r>=c)return Math.round(e/c)+"h";if(r>=a)return Math.round(e/a)+"m";if(r>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},5762:(e,t,a)=>{"use strict";var c=a(3761);function n(){}function r(){}r.resetWarningCache=n,e.exports=function(){function e(e,t,a,n,r,l){if(l!==c){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:n};return a.PropTypes=a,a}},8120:(e,t,a)=>{e.exports=a(5762)()},3761:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9959:(e,t,a)=>{"use strict";a.d(t,{I9:()=>m,k2:()=>d});var c=a(1609),n=a(4623),r=a(726);function l(){return l=Object.assign||function(e){for(var t=1;t=0||(n[a]=e[a]);return n}const i=["onClick","reloadDocument","replace","state","target","to"],o=["aria-current","caseSensitive","className","end","style","to","children"];function m(e){let{basename:t,children:a,window:l}=e,s=(0,c.useRef)();null==s.current&&(s.current=(0,n.TM)({window:l}));let i=s.current,[o,m]=(0,c.useState)({action:i.action,location:i.location});return(0,c.useLayoutEffect)((()=>i.listen(m)),[i]),(0,c.createElement)(r.Ix,{basename:t,children:a,location:o.location,navigationType:o.action,navigator:i})}const p=(0,c.forwardRef)((function(e,t){let{onClick:a,reloadDocument:o,replace:m=!1,state:p,target:d,to:u}=e,h=s(e,i),g=(0,r.$P)(u),v=function(e,t){let{target:a,replace:l,state:s}=void 0===t?{}:t,i=(0,r.Zp)(),o=(0,r.zy)(),m=(0,r.x$)(e);return(0,c.useCallback)((t=>{if(!(0!==t.button||a&&"_self"!==a||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let a=!!l||(0,n.AO)(o)===(0,n.AO)(m);i(e,{replace:a,state:s})}}),[o,i,m,l,s,a,e])}(u,{replace:m,state:p,target:d});return(0,c.createElement)("a",l({},h,{href:g,onClick:function(e){a&&a(e),e.defaultPrevented||o||v(e)},ref:t,target:d}))}));const d=(0,c.forwardRef)((function(e,t){let{"aria-current":a="page",caseSensitive:n=!1,className:i="",end:m=!1,style:d,to:u,children:h}=e,g=s(e,o),v=(0,r.zy)(),f=(0,r.x$)(u),E=v.pathname,A=f.pathname;n||(E=E.toLowerCase(),A=A.toLowerCase());let y,w=E===A||!m&&E.startsWith(A)&&"/"===E.charAt(A.length),k=w?a:void 0;y="function"==typeof i?i({isActive:w}):[i,w?"active":null].filter(Boolean).join(" ");let b="function"==typeof d?d({isActive:w}):d;return(0,c.createElement)(p,l({},g,{"aria-current":k,className:y,ref:t,style:b,to:u}),"function"==typeof h?h({isActive:w}):h)}))},726:(e,t,a)=>{"use strict";a.d(t,{$P:()=>u,BV:()=>d,C5:()=>o,Ix:()=>p,Zp:()=>v,g:()=>f,qh:()=>m,x$:()=>E,zy:()=>g});var c=a(1609),n=a(4623);function r(e,t){if(!e)throw new Error(t)}const l=(0,c.createContext)(null);const s=(0,c.createContext)(null);const i=(0,c.createContext)({outlet:null,matches:[]});function o(e){let{to:t,replace:a,state:n}=e;h()||r(!1);let l=v();return(0,c.useEffect)((()=>{l(t,{replace:a,state:n})})),null}function m(e){r(!1)}function p(e){let{basename:t="/",children:a=null,location:i,navigationType:o=n.rc.Pop,navigator:m,static:p=!1}=e;h()&&r(!1);let d=I(t),u=(0,c.useMemo)((()=>({basename:d,navigator:m,static:p})),[d,m,p]);"string"==typeof i&&(i=(0,n.Rr)(i));let{pathname:g="/",search:v="",hash:f="",state:E=null,key:A="default"}=i,y=(0,c.useMemo)((()=>{let e=z(g,d);return null==e?null:{pathname:e,search:v,hash:f,state:E,key:A}}),[d,g,v,f,E,A]);return null==y?null:(0,c.createElement)(l.Provider,{value:u},(0,c.createElement)(s.Provider,{children:a,value:{location:y,navigationType:o}}))}function d(e){let{children:t,location:a}=e;return function(e,t){h()||r(!1);let{matches:a}=(0,c.useContext)(i),l=a[a.length-1],s=l?l.params:{},o=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;0;let m,p=g();if(t){var d;let e="string"==typeof t?(0,n.Rr)(t):t;"/"===o||(null==(d=e.pathname)?void 0:d.startsWith(o))||r(!1),m=e}else m=p;let u=m.pathname||"/",v="/"===o?u:u.slice(o.length)||"/",f=function(e,t,a){void 0===a&&(a="/");let c="string"==typeof t?(0,n.Rr)(t):t,r=z(c.pathname||"/",a);if(null==r)return null;let l=y(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let a=e.length===t.length&&e.slice(0,-1).every(((e,a)=>e===t[a]));return a?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(l);let s=null;for(let e=0;null==s&&eObject.assign({},e,{params:Object.assign({},s,e.params),pathname:P([o,e.pathname]),pathnameBase:"/"===e.pathnameBase?o:P([o,e.pathnameBase])}))),a)}(A(t),a)}function u(e){h()||r(!1);let{basename:t,navigator:a}=(0,c.useContext)(l),{hash:s,pathname:i,search:o}=E(e),m=i;if("/"!==t){let a=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?(0,n.Rr)(e).pathname:e.pathname}(e),c=null!=a&&a.endsWith("/");m="/"===i?t+(c?"/":""):P([t,i])}return a.createHref({pathname:m,search:o,hash:s})}function h(){return null!=(0,c.useContext)(s)}function g(){return h()||r(!1),(0,c.useContext)(s).location}function v(){h()||r(!1);let{basename:e,navigator:t}=(0,c.useContext)(l),{matches:a}=(0,c.useContext)(i),{pathname:n}=g(),s=JSON.stringify(a.map((e=>e.pathnameBase))),o=(0,c.useRef)(!1);return(0,c.useEffect)((()=>{o.current=!0})),(0,c.useCallback)((function(a,c){if(void 0===c&&(c={}),!o.current)return;if("number"==typeof a)return void t.go(a);let r=L(a,JSON.parse(s),n);"/"!==e&&(r.pathname=P([e,r.pathname])),(c.replace?t.replace:t.push)(r,c.state)}),[e,t,s,n])}function f(){let{matches:e}=(0,c.useContext)(i),t=e[e.length-1];return t?t.params:{}}function E(e){let{matches:t}=(0,c.useContext)(i),{pathname:a}=g(),n=JSON.stringify(t.map((e=>e.pathnameBase)));return(0,c.useMemo)((()=>L(e,JSON.parse(n),a)),[e,n,a])}function A(e){let t=[];return c.Children.forEach(e,(e=>{if(!(0,c.isValidElement)(e))return;if(e.type===c.Fragment)return void t.push.apply(t,A(e.props.children));e.type!==m&&r(!1);let a={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(a.children=A(e.props.children)),t.push(a)})),t}function y(e,t,a,c){return void 0===t&&(t=[]),void 0===a&&(a=[]),void 0===c&&(c=""),e.forEach(((e,n)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:n,route:e};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(c)||r(!1),l.relativePath=l.relativePath.slice(c.length));let s=P([c,l.relativePath]),i=a.concat(l);e.children&&e.children.length>0&&(!0===e.index&&r(!1),y(e.children,t,i,s)),(null!=e.path||e.index)&&t.push({path:s,score:S(s,e.index),routesMeta:i})})),t}const w=/^:\w+$/,k=3,b=2,_=1,R=10,C=-2,j=e=>"*"===e;function S(e,t){let a=e.split("/"),c=a.length;return a.some(j)&&(c+=C),t&&(c+=b),a.filter((e=>!j(e))).reduce(((e,t)=>e+(w.test(t)?k:""===t?_:R)),c)}function x(e,t){let{routesMeta:a}=e,c={},n="/",r=[];for(let e=0;e(0,c.createElement)(i.Provider,{children:void 0!==n.route.element?n.route.element:a,value:{outlet:a,matches:t.concat(e.slice(0,r+1))}})),null)}function M(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,c]=function(e,t,a){void 0===t&&(t=!1);void 0===a&&(a=!0);let c=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(c.push(t),"([^\\/]+)")));e.endsWith("*")?(c.push("*"),n+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n+=a?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)";let r=new RegExp(n,t?void 0:"i");return[r,c]}(e.path,e.caseSensitive,e.end),n=t.match(a);if(!n)return null;let r=n[0],l=r.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:c.reduce(((e,t,a)=>{if("*"===t){let e=s[a]||"";l=r.slice(0,r.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e){try{return decodeURIComponent(e)}catch(t){return e}}(s[a]||""),e}),{}),pathname:r,pathnameBase:l,pattern:e}}function L(e,t,a){let c,r="string"==typeof e?(0,n.Rr)(e):e,l=""===e||""===r.pathname?"/":r.pathname;if(null==l)c=a;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}c=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:a,search:c="",hash:r=""}="string"==typeof e?(0,n.Rr)(e):e,l=a?a.startsWith("/")?a:function(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)})),a.length>1?a.join("/"):"/"}(a,t):t;return{pathname:l,search:T(c),hash:V(r)}}(r,c);return l&&"/"!==l&&l.endsWith("/")&&!s.pathname.endsWith("/")&&(s.pathname+="/"),s}function z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=e.charAt(t.length);return a&&"/"!==a?null:e.slice(t.length)||"/"}const P=e=>e.join("/").replace(/\/\/+/g,"/"),I=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),T=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",V=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},372:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var c=a(6941);const n=a.n(c)()("dops:analytics");let r,l;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const s={initialize:function(e,t,a){s.setUser(e,t),s.setSuperProps(a),s.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){l={ID:e,username:t}},setSuperProps:function(e){r=e},assignSuperProps:function(e){r=Object.assign(r||{},e)},mc:{bumpStat:function(e,t){const a=function(e,t){let a="";if("object"==typeof e){for(const t in e)a+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);n("Bumping stats %o",e)}else a="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),n('Bumping stat "%s" in group "%s"',t,e);return a}(e,t);s.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+a+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const a=function(e,t){let a="";if("object"==typeof e){for(const t in e)a+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);n("Built stats %o",e)}else a="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),n('Built stat "%s" in group "%s"',t,e);return a}(e,t);s.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+a+"&t="+Math.random())}},pageView:{record:function(e,t){s.tracks.recordPageView(e),s.ga.recordPageView(e,t)}},purchase:{record:function(e,t,a,c,n,r,l){s.ga.recordPurchase(e,t,a,c,n,r,l)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(r&&(n("- Super Props: %o",r),t=Object.assign(t,r)),n('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):n('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};s.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){s.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){n("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};s.ga.initialized||(l&&(e={userId:"u-"+l.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),s.ga.initialized=!0)},recordPageView:function(e,t){s.ga.initialize(),n("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,a,c){s.ga.initialize();let r="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==a&&(r+=" [Option Label: "+a+"]"),void 0!==c&&(r+=" [Option Value: "+c+"]"),n(r),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,a,c)},recordPurchase:function(e,t,a,c,n,r,l){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:c,currency:l}),window.ga("ecommerce:addItem",{id:e,name:t,sku:a,price:n,quantity:r}),window.ga("ecommerce:send")}},identifyUser:function(){l&&window._tkq.push(["identifyUser",l.ID,l.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},i=s},5932:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>p});var c=a(6439),n=a(3832);function r(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const l=r("JsonParseError"),s=r("JsonParseAfterRedirectError"),i=r("Api404Error"),o=r("Api404AfterRedirectError"),m=r("FetchNetworkError");const p=new function(e,t){let a=e,r=e,l={"X-WP-Nonce":t},s={credentials:"same-origin",headers:l},i={method:"post",credentials:"same-origin",headers:Object.assign({},l,{"Content-type":"application/json"})},o=function(e){const t=e.split("?"),a=t.length>1?t[1]:"",c=a.length?a.split("&"):[];return c.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+c.join("&")};const m={setApiRoot(e){a=e},setWpcomOriginApiUrl(e){r=e},setApiNonce(e){l={"X-WP-Nonce":e},s={credentials:"same-origin",headers:l},i={method:"post",credentials:"same-origin",headers:Object.assign({},l,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{o=e},registerSite:(e,t,n)=>{const r={registration_nonce:e,no_iframe:!0};return(0,c.jetpackConfigHas)("consumer_slug")&&(r.plugin_slug=(0,c.jetpackConfigGet)("consumer_slug")),null!==t&&(r.redirect_uri=t),n&&(r.from=n),h(`${a}jetpack/v4/connection/register`,i,{body:JSON.stringify(r)}).then(d).then(u)},fetchAuthorizationUrl:e=>p((0,n.addQueryArgs)(`${a}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),s).then(d).then(u),fetchSiteConnectionData:()=>p(`${a}jetpack/v4/connection/data`,s).then(u),fetchSiteConnectionStatus:()=>p(`${a}jetpack/v4/connection`,s).then(u),fetchSiteConnectionTest:()=>p(`${a}jetpack/v4/connection/test`,s).then(d).then(u),fetchUserConnectionData:()=>p(`${a}jetpack/v4/connection/data`,s).then(u),fetchUserTrackingSettings:()=>p(`${a}jetpack/v4/tracking/settings`,s).then(d).then(u),updateUserTrackingSettings:e=>h(`${a}jetpack/v4/tracking/settings`,i,{body:JSON.stringify(e)}).then(d).then(u),disconnectSite:()=>h(`${a}jetpack/v4/connection`,i,{body:JSON.stringify({isActive:!1})}).then(d).then(u),fetchConnectUrl:()=>p(`${a}jetpack/v4/connection/url`,s).then(d).then(u),unlinkUser:()=>h(`${a}jetpack/v4/connection/user`,i,{body:JSON.stringify({linked:!1})}).then(d).then(u),reconnect:()=>h(`${a}jetpack/v4/connection/reconnect`,i).then(d).then(u),fetchConnectedPlugins:()=>p(`${a}jetpack/v4/connection/plugins`,s).then(d).then(u),setHasSeenWCConnectionModal:()=>h(`${a}jetpack/v4/seen-wc-connection-modal`,i).then(d).then(u),fetchModules:()=>p(`${a}jetpack/v4/module/all`,s).then(d).then(u),fetchModule:e=>p(`${a}jetpack/v4/module/${e}`,s).then(d).then(u),activateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,i,{body:JSON.stringify({active:!0})}).then(d).then(u),deactivateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,i,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${a}jetpack/v4/module/${e}`,i,{body:JSON.stringify(t)}).then(d).then(u),updateSettings:e=>h(`${a}jetpack/v4/settings`,i,{body:JSON.stringify(e)}).then(d).then(u),getProtectCount:()=>p(`${a}jetpack/v4/module/protect/data`,s).then(d).then(u),resetOptions:e=>h(`${a}jetpack/v4/options/${e}`,i,{body:JSON.stringify({reset:!0})}).then(d).then(u),activateVaultPress:()=>h(`${a}jetpack/v4/plugins`,i,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(d).then(u),getVaultPressData:()=>p(`${a}jetpack/v4/module/vaultpress/data`,s).then(d).then(u),installPlugin:(e,t)=>{const c={slug:e,status:"active"};return t&&(c.source=t),h(`${a}jetpack/v4/plugins`,i,{body:JSON.stringify(c)}).then(d).then(u)},activateAkismet:()=>h(`${a}jetpack/v4/plugins`,i,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(d).then(u),getAkismetData:()=>p(`${a}jetpack/v4/module/akismet/data`,s).then(d).then(u),checkAkismetKey:()=>p(`${a}jetpack/v4/module/akismet/key/check`,s).then(d).then(u),checkAkismetKeyTyped:e=>h(`${a}jetpack/v4/module/akismet/key/check`,i,{body:JSON.stringify({api_key:e})}).then(d).then(u),fetchStatsData:e=>p(function(e){let t=`${a}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),s).then(d).then(u).then(v),getPluginUpdates:()=>p(`${a}jetpack/v4/updates/plugins`,s).then(d).then(u),getPlans:()=>p(`${a}jetpack/v4/plans`,s).then(d).then(u),fetchSettings:()=>p(`${a}jetpack/v4/settings`,s).then(d).then(u),updateSetting:e=>h(`${a}jetpack/v4/settings`,i,{body:JSON.stringify(e)}).then(d).then(u),fetchSiteData:()=>p(`${a}jetpack/v4/site`,s).then(d).then(u).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>p(`${a}jetpack/v4/site/features`,s).then(d).then(u).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>p(`${a}jetpack/v4/site/products`,s).then(d).then(u),fetchSitePurchases:()=>p(`${a}jetpack/v4/site/purchases`,s).then(d).then(u).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>p(`${a}jetpack/v4/site/benefits`,s).then(d).then(u).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>p(`${a}jetpack/v4/site/discount`,s).then(d).then(u).then((e=>e.data)),fetchSetupQuestionnaire:()=>p(`${a}jetpack/v4/setup/questionnaire`,s).then(d).then(u),fetchRecommendationsData:()=>p(`${a}jetpack/v4/recommendations/data`,s).then(d).then(u),fetchRecommendationsProductSuggestions:()=>p(`${a}jetpack/v4/recommendations/product-suggestions`,s).then(d).then(u),fetchRecommendationsUpsell:()=>p(`${a}jetpack/v4/recommendations/upsell`,s).then(d).then(u),fetchRecommendationsConditional:()=>p(`${a}jetpack/v4/recommendations/conditional`,s).then(d).then(u),saveRecommendationsData:e=>h(`${a}jetpack/v4/recommendations/data`,i,{body:JSON.stringify({data:e})}).then(d),fetchProducts:()=>p(`${a}jetpack/v4/products`,s).then(d).then(u),fetchRewindStatus:()=>p(`${a}jetpack/v4/rewind`,s).then(d).then(u).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>p(`${a}jetpack/v4/scan`,s).then(d).then(u).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${a}jetpack/v4/notice/${e}`,i,{body:JSON.stringify({dismissed:!0})}).then(d).then(u),fetchPluginsData:()=>p(`${a}jetpack/v4/plugins`,s).then(d).then(u),fetchIntroOffers:()=>p(`${a}jetpack/v4/intro-offers`,s).then(d).then(u),fetchVerifySiteGoogleStatus:e=>p(null!==e?`${a}jetpack/v4/verify-site/google/${e}`:`${a}jetpack/v4/verify-site/google`,s).then(d).then(u),verifySiteGoogle:e=>h(`${a}jetpack/v4/verify-site/google`,i,{body:JSON.stringify({keyring_id:e})}).then(d).then(u),submitSurvey:e=>h(`${a}jetpack/v4/marketing/survey`,i,{body:JSON.stringify(e)}).then(d).then(u),saveSetupQuestionnaire:e=>h(`${a}jetpack/v4/setup/questionnaire`,i,{body:JSON.stringify(e)}).then(d).then(u),updateLicensingError:e=>h(`${a}jetpack/v4/licensing/error`,i,{body:JSON.stringify(e)}).then(d).then(u),updateLicenseKey:e=>h(`${a}jetpack/v4/licensing/set-license`,i,{body:JSON.stringify({license:e})}).then(d).then(u),getUserLicensesCounts:()=>p(`${a}jetpack/v4/licensing/user/counts`,s).then(d).then(u),getUserLicenses:()=>p(`${a}jetpack/v4/licensing/user/licenses`,s).then(d).then(u),updateLicensingActivationNoticeDismiss:e=>h(`${a}jetpack/v4/licensing/user/activation-notice-dismiss`,i,{body:JSON.stringify({last_detached_count:e})}).then(d).then(u),updateRecommendationsStep:e=>h(`${a}jetpack/v4/recommendations/step`,i,{body:JSON.stringify({step:e})}).then(d),confirmIDCSafeMode:()=>h(`${a}jetpack/v4/identity-crisis/confirm-safe-mode`,i).then(d),startIDCFresh:e=>h(`${a}jetpack/v4/identity-crisis/start-fresh`,i,{body:JSON.stringify({redirect_uri:e})}).then(d).then(u),migrateIDC:()=>h(`${a}jetpack/v4/identity-crisis/migrate`,i).then(d),attachLicenses:e=>h(`${a}jetpack/v4/licensing/attach-licenses`,i,{body:JSON.stringify({licenses:e})}).then(d).then(u),fetchSearchPlanInfo:()=>p(`${r}jetpack/v4/search/plan`,s).then(d).then(u),fetchSearchSettings:()=>p(`${r}jetpack/v4/search/settings`,s).then(d).then(u),updateSearchSettings:e=>h(`${r}jetpack/v4/search/settings`,i,{body:JSON.stringify(e)}).then(d).then(u),fetchSearchStats:()=>p(`${r}jetpack/v4/search/stats`,s).then(d).then(u),fetchWafSettings:()=>p(`${a}jetpack/v4/waf`,s).then(d).then(u),updateWafSettings:e=>h(`${a}jetpack/v4/waf`,i,{body:JSON.stringify(e)}).then(d).then(u),fetchWordAdsSettings:()=>p(`${a}jetpack/v4/wordads/settings`,s).then(d).then(u),updateWordAdsSettings:e=>h(`${a}jetpack/v4/wordads/settings`,i,{body:JSON.stringify(e)}),fetchSearchPricing:()=>p(`${r}jetpack/v4/search/pricing`,s).then(d).then(u),fetchMigrationStatus:()=>p(`${a}jetpack/v4/migration/status`,s).then(d).then(u),fetchBackupUndoEvent:()=>p(`${a}jetpack/v4/site/backup/undo-event`,s).then(d).then(u),fetchBackupPreflightStatus:()=>p(`${a}jetpack/v4/site/backup/preflight`,s).then(d).then(u)};function p(e,t){return fetch(o(e),t)}function h(e,t,a){return fetch(e,Object.assign({},t,a)).catch(g)}function v(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,m)};function d(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new o(e.redirected):new i})):e.json().catch((e=>h(e))).then((t=>{const a=new Error(`${t.message} (Status ${e.status})`);throw a.response=t,a.name="ApiError",a}))}function u(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,a){throw t?new s(a):new l}function g(){throw new m}},1330:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var c=a(6427),n=a(7723),r=a(991),l=a(1112),s=a(442),i=a(7425),o=a(723),m=a(8579);const __=n.__,p=({hideCloseButton:e=!1,title:t,children:a,step:p=null,totalSteps:d=null,buttonContent:u=null,buttonDisabled:h=!1,buttonHref:g=null,buttonExternalLink:v=!1,offset:f=32,onClose:E,onClick:A,...y})=>{const[w]=(0,s.A)("sm");if(!t||!a||!u)return null;y.position||(y.position=w?"top center":"middle right");const k={...y,offset:f,onClose:E},b=Number.isFinite(p)&&Number.isFinite(d);let _=null;return b&&(_=(0,n.sprintf)(/* translators: 1 Current step, 2 Total steps */ +__("%1$d of %2$d","jetpack-protect"),p,d)),React.createElement(c.Popover,k,React.createElement(o.Ay,null,React.createElement("div",{className:m.A.wrapper},React.createElement("div",{className:m.A.header},React.createElement(i.Ay,{variant:"title-small",className:m.A.title},t),!e&&React.createElement(React.Fragment,null,React.createElement(l.A,{size:"small",variant:"tertiary","aria-label":"close",className:m.A["close-button"],icon:r.A,iconSize:16,onClick:E}))),a,React.createElement("div",{className:m.A.footer},b&&React.createElement(i.Ay,{variant:"body",className:m.A.steps},_),React.createElement(l.A,{variant:"primary",className:m.A["action-button"],disabled:h,onClick:A,isExternalLink:v,href:g},u)))))}},2947:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var c=a(7723),n=a(3022),r=a(8250),l=a(7142),s=a(8509),i=a(5918),o=a(2021);const __=c.__,m=({children:e,moduleName:t=__("Jetpack","jetpack-protect"),moduleNameHref:a,showHeader:c=!0,showFooter:m=!0,showBackground:p=!0,header:d})=>{const u=(0,n.A)(o.A["admin-page"],{[o.A.background]:p});return React.createElement("div",{className:u},c&&React.createElement(i.A,{horizontalSpacing:5},React.createElement(s.A,null,d||React.createElement(l.A,null))),React.createElement(i.A,{fluid:!0,horizontalSpacing:0},React.createElement(s.A,null,e)),m&&React.createElement(i.A,{horizontalSpacing:5},React.createElement(s.A,null,React.createElement(r.A,{moduleName:t,moduleNameHref:a}))))}},766:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(1609),n=a.n(c),r=a(6888);const l=({children:e})=>n().createElement("div",{className:r.A["section-hero"]},e)},8907:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(6072),n=a.n(c),r=a(7723),l=a(3022),s=a(1609),i=a.n(s);const __=r.__,o=({title:e=__("An Automattic Airline","jetpack-protect"),height:t=7,className:a,...c})=>i().createElement("svg",n()({role:"img",x:"0",y:"0",viewBox:"0 0 935 38.2",enableBackground:"new 0 0 935 38.2","aria-labelledby":"jp-automattic-byline-logo-title",height:t,className:(0,l.A)("jp-automattic-byline-logo",a)},c),i().createElement("desc",{id:"jp-automattic-byline-logo-title"},e),i().createElement("path",{d:"M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z"}),i().createElement("path",{d:"M37.5 36.7l-4.7-8.9H11.7l-4.6 8.9H0L19.4 0.8H25l19.7 35.9H37.5zM22 7.8l-7.8 15.1h15.9L22 7.8zM82.8 36.7l-23.3-24 -2.3-2.5v26.6h-6.7v-36H57l22.6 24 2.3 2.6V0.8h6.7v35.9H82.8z"}),i().createElement("path",{d:"M719.9 37l-4.8-8.9H694l-4.6 8.9h-7.1l19.5-36h5.6l19.8 36H719.9zM704.4 8l-7.8 15.1h15.9L704.4 8zM733 37V1h6.8v36H733zM781 37c-1.8 0-2.6-2.5-2.9-5.8l-0.2-3.7c-0.2-3.6-1.7-5.1-8.4-5.1h-12.8V37H750V1h19.6c10.8 0 15.7 4.3 15.7 9.9 0 3.9-2 7.7-9 9 7 0.5 8.5 3.7 8.6 7.9l0.1 3c0.1 2.5 0.5 4.3 2.2 6.1V37H781zM778.5 11.8c0-2.6-2.1-5.1-7.9-5.1h-13.8v10.8h14.4c5 0 7.3-2.4 7.3-5.2V11.8zM794.8 37V1h6.8v30.4h28.2V37H794.8zM836.7 37V1h6.8v36H836.7zM886.2 37l-23.4-24.1 -2.3-2.5V37h-6.8V1h6.5l22.7 24.1 2.3 2.6V1h6.8v36H886.2zM902.3 37V1H935v5.6h-26v9.2h20v5.5h-20v10.1h26V37H902.3z"}))},1112:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var c=a(6072),n=a.n(c),r=a(6427),l=a(7723),s=a(1113),i=a(3512),o=a(3022),m=a(1609),p=a.n(m),d=a(2258);const __=l.__,u=(0,m.forwardRef)(((e,t)=>{const{children:a,variant:c="primary",size:l="normal",weight:m="bold",icon:u,iconSize:h,disabled:g,isDestructive:v,isLoading:f,isExternalLink:E,className:A,text:y,fullWidth:w,...k}=e,b=(0,o.A)(d.A.button,A,{[d.A.normal]:"normal"===l,[d.A.small]:"small"===l,[d.A.icon]:Boolean(u),[d.A.loading]:f,[d.A.regular]:"regular"===m,[d.A["full-width"]]:w,[d.A["is-icon-button"]]:Boolean(u)&&!a});k.ref=t;const _="normal"===l?20:16,R=E&&p().createElement(p().Fragment,null,p().createElement(s.A,{size:_,icon:i.A,className:d.A["external-icon"]}),p().createElement(r.VisuallyHidden,{as:"span"},/* translators: accessibility text */ +__("(opens in a new tab)","jetpack-protect"))),C=E?"_blank":void 0,j=a?.[0]&&null!==a[0]&&"components-tooltip"!==a?.[0]?.props?.className;return p().createElement(r.Button,n()({target:C,variant:c,className:(0,o.A)(b,{"has-text":!!u&&j}),icon:E?void 0:u,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:v,text:y},k),f&&p().createElement(r.Spinner,null),p().createElement("span",null,a),R)}));u.displayName="Button";const h=u},4437:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(1113),n=a(1797),r=a(3022),l=a(597),s=a(7425),i=a(2127);const o=({description:e,cta:t,onClick:a,href:o,openInNewTab:m=!1,className:p,tooltipText:d=""})=>{const u=void 0!==o?"a":"button",h="a"===u?{href:o,...m&&{target:"_blank"}}:{onClick:a};return React.createElement("div",{className:(0,r.A)(i.A.cut,p)},React.createElement("div",null,React.createElement("div",null,React.createElement(s.Ay,{className:i.A.description},e),d&&React.createElement(l.A,{className:i.A.iconContainer,iconSize:16,offset:4},React.createElement(s.Ay,{variant:"body-small"},d))),React.createElement("div",null,React.createElement(u,h,React.createElement(s.Ay,{className:i.A.cta},t)))),React.createElement(c.A,{icon:n.A,className:i.A.icon,size:30}))}},1883:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(7723),n=a(3022),r=a(1609);a(3689);const __=c.__;class l extends r.Component{static defaultProps={"aria-hidden":"false",focusable:"true"};needsOffset(e,t){return["gridicons-arrow-left","gridicons-arrow-right","gridicons-calendar","gridicons-cart","gridicons-folder","gridicons-info","gridicons-info-outline","gridicons-posts","gridicons-star-outline","gridicons-star"].indexOf(e)>=0&&t%18==0}getSVGDescription(e){if("description"in this.props)return this.props.description;switch(e){default:return"";case"gridicons-audio":return __("Has audio.","jetpack-protect");case"gridicons-arrow-left":return __("Arrow left","jetpack-protect");case"gridicons-arrow-right":return __("Arrow right","jetpack-protect");case"gridicons-calendar":return __("Is an event.","jetpack-protect");case"gridicons-cart":return __("Is a product.","jetpack-protect");case"chevron-down":return __("Show filters","jetpack-protect");case"gridicons-comment":return __("Matching comment.","jetpack-protect");case"gridicons-cross":return __("Close.","jetpack-protect");case"gridicons-filter":return __("Toggle search filters.","jetpack-protect");case"gridicons-folder":return __("Category","jetpack-protect");case"gridicons-info":case"gridicons-info-outline":return __("Information.","jetpack-protect");case"gridicons-image-multiple":return __("Has multiple images.","jetpack-protect");case"gridicons-image":return __("Has an image.","jetpack-protect");case"gridicons-page":return __("Page","jetpack-protect");case"gridicons-post":return __("Post","jetpack-protect");case"gridicons-jetpack-search":case"gridicons-search":return __("Magnifying Glass","jetpack-protect");case"gridicons-tag":return __("Tag","jetpack-protect");case"gridicons-video":return __("Has a video.","jetpack-protect")}}renderIcon(e){switch(e){default:return null;case"gridicons-audio":return React.createElement("g",null,React.createElement("path",{d:"M8 4v10.184C7.686 14.072 7.353 14 7 14c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V7h7v4.184c-.314-.112-.647-.184-1-.184-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V4H8z"}));case"gridicons-arrow-left":return React.createElement("g",null,React.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}));case"gridicons-arrow-right":return React.createElement("g",null,React.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"}));case"gridicons-block":return React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12c0-4.418 3.582-8 8-8 1.848 0 3.545.633 4.9 1.686L5.686 16.9C4.633 15.545 4 13.848 4 12zm8 8c-1.848 0-3.546-.633-4.9-1.686L18.314 7.1C19.367 8.455 20 10.152 20 12c0 4.418-3.582 8-8 8z"}));case"gridicons-calendar":return React.createElement("g",null,React.createElement("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.105 0-2 .896-2 2v13c0 1.104.895 2 2 2h14c1.104 0 2-.896 2-2V6c0-1.104-.896-2-2-2zm0 15H5V8h14v11z"}));case"gridicons-cart":return React.createElement("g",null,React.createElement("path",{d:"M9 20c0 1.1-.9 2-2 2s-1.99-.9-1.99-2S5.9 18 7 18s2 .9 2 2zm8-2c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm.396-5c.937 0 1.75-.65 1.952-1.566L21 5H7V4c0-1.105-.895-2-2-2H3v2h2v11c0 1.105.895 2 2 2h12c0-1.105-.895-2-2-2H7v-2h10.396z"}));case"gridicons-checkmark":return React.createElement("g",null,React.createElement("path",{d:"M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z"}));case"gridicons-chevron-left":return React.createElement("g",null,React.createElement("path",{d:"M16.443 7.41L15.0399 6L9.06934 12L15.0399 18L16.443 16.59L11.8855 12L16.443 7.41Z"}));case"gridicons-chevron-right":return React.createElement("g",null,React.createElement("path",{d:"M10.2366 6L8.8335 7.41L13.391 12L8.8335 16.59L10.2366 18L16.2072 12L10.2366 6Z"}));case"gridicons-chevron-down":return React.createElement("g",null,React.createElement("path",{d:"M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586"}));case"gridicons-comment":return React.createElement("g",null,React.createElement("path",{d:"M3 6v9c0 1.105.895 2 2 2h9v5l5.325-3.804c1.05-.75 1.675-1.963 1.675-3.254V6c0-1.105-.895-2-2-2H5c-1.105 0-2 .895-2 2z"}));case"gridicons-computer":return React.createElement("g",null,React.createElement("path",{d:"M20 2H4c-1.104 0-2 .896-2 2v12c0 1.104.896 2 2 2h6v2H7v2h10v-2h-3v-2h6c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm0 14H4V4h16v12z"}));case"gridicons-cross":return React.createElement("g",null,React.createElement("path",{d:"M18.36 19.78L12 13.41l-6.36 6.37-1.42-1.42L10.59 12 4.22 5.64l1.42-1.42L12 10.59l6.36-6.36 1.41 1.41L13.41 12l6.36 6.36z"}));case"gridicons-filter":return React.createElement("g",null,React.createElement("path",{d:"M10 19h4v-2h-4v2zm-4-6h12v-2H6v2zM3 5v2h18V5H3z"}));case"gridicons-folder":return React.createElement("g",null,React.createElement("path",{d:"M18 19H6c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2h7c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2z"}));case"gridicons-image":return React.createElement("g",null,React.createElement("path",{d:"M13 9.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5-.672 1.5-1.5 1.5-1.5-.672-1.5-1.5zM22 6v12c0 1.105-.895 2-2 2H4c-1.105 0-2-.895-2-2V6c0-1.105.895-2 2-2h16c1.105 0 2 .895 2 2zm-2 0H4v7.444L8 9l5.895 6.55 1.587-1.85c.798-.932 2.24-.932 3.037 0L20 15.426V6z"}));case"gridicons-image-multiple":return React.createElement("g",null,React.createElement("path",{d:"M15 7.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5S17.328 9 16.5 9 15 8.328 15 7.5zM4 20h14c0 1.105-.895 2-2 2H4c-1.1 0-2-.9-2-2V8c0-1.105.895-2 2-2v14zM22 4v12c0 1.105-.895 2-2 2H8c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zM8 4v6.333L11 7l4.855 5.395.656-.73c.796-.886 2.183-.886 2.977 0l.513.57V4H8z"}));case"gridicons-info":return React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}));case"gridicons-info-outline":return React.createElement("g",null,React.createElement("path",{d:"M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"}));case"gridicons-jetpack-search":return React.createElement("g",null,React.createElement("path",{d:"M0 9.257C0 4.15 4.151 0 9.257 0c5.105 0 9.256 4.151 9.256 9.257a9.218 9.218 0 01-2.251 6.045l.034.033h1.053L24 22.01l-1.986 1.989-6.664-6.662v-1.055l-.033-.033a9.218 9.218 0 01-6.06 2.264C4.15 18.513 0 14.362 0 9.257zm4.169 1.537h4.61V1.82l-4.61 8.973zm5.547-3.092v8.974l4.61-8.974h-4.61z"}));case"gridicons-phone":return React.createElement("g",null,React.createElement("path",{d:"M16 2H8c-1.104 0-2 .896-2 2v16c0 1.104.896 2 2 2h8c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm-3 19h-2v-1h2v1zm3-2H8V5h8v14z"}));case"gridicons-pages":return React.createElement("g",null,React.createElement("path",{d:"M16 8H8V6h8v2zm0 2H8v2h8v-2zm4-6v12l-6 6H6c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zm-2 10V4H6v16h6v-4c0-1.105.895-2 2-2h4z"}));case"gridicons-posts":return React.createElement("g",null,React.createElement("path",{d:"M16 19H3v-2h13v2zm5-10H3v2h18V9zM3 5v2h11V5H3zm14 0v2h4V5h-4zm-6 8v2h10v-2H11zm-8 0v2h5v-2H3z"}));case"gridicons-search":return React.createElement("g",null,React.createElement("path",{d:"M21 19l-5.154-5.154C16.574 12.742 17 11.42 17 10c0-3.866-3.134-7-7-7s-7 3.134-7 7 3.134 7 7 7c1.42 0 2.742-.426 3.846-1.154L19 21l2-2zM5 10c0-2.757 2.243-5 5-5s5 2.243 5 5-2.243 5-5 5-5-2.243-5-5z"}));case"gridicons-star-outline":return React.createElement("g",null,React.createElement("path",{d:"M12 6.308l1.176 3.167.347.936.997.042 3.374.14-2.647 2.09-.784.62.27.963.91 3.25-2.813-1.872-.83-.553-.83.552-2.814 1.87.91-3.248.27-.962-.783-.62-2.648-2.092 3.374-.14.996-.04.347-.936L12 6.308M12 2L9.418 8.953 2 9.257l5.822 4.602L5.82 21 12 16.89 18.18 21l-2.002-7.14L22 9.256l-7.418-.305L12 2z"}));case"gridicons-star":return React.createElement("g",null,React.createElement("path",{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"}));case"gridicons-tag":return React.createElement("g",null,React.createElement("path",{d:"M20 2.007h-7.087c-.53 0-1.04.21-1.414.586L2.592 11.5c-.78.78-.78 2.046 0 2.827l7.086 7.086c.78.78 2.046.78 2.827 0l8.906-8.906c.376-.374.587-.883.587-1.413V4.007c0-1.105-.895-2-2-2zM17.007 9c-1.105 0-2-.895-2-2s.895-2 2-2 2 .895 2 2-.895 2-2 2z"}));case"gridicons-video":return React.createElement("g",null,React.createElement("path",{d:"M20 4v2h-2V4H6v2H4V4c-1.105 0-2 .895-2 2v12c0 1.105.895 2 2 2v-2h2v2h12v-2h2v2c1.105 0 2-.895 2-2V6c0-1.105-.895-2-2-2zM6 16H4v-3h2v3zm0-5H4V8h2v3zm4 4V9l4.5 3-4.5 3zm10 1h-2v-3h2v3zm0-5h-2V8h2v3z"}));case"gridicons-lock":return React.createElement(React.Fragment,null,React.createElement("g",{id:"lock"},React.createElement("path",{d:"M18,8h-1V7c0-2.757-2.243-5-5-5S7,4.243,7,7v1H6c-1.105,0-2,0.895-2,2v10c0,1.105,0.895,2,2,2h12c1.105,0,2-0.895,2-2V10 C20,8.895,19.105,8,18,8z M9,7c0-1.654,1.346-3,3-3s3,1.346,3,3v1H9V7z M13,15.723V18h-2v-2.277c-0.595-0.346-1-0.984-1-1.723 c0-1.105,0.895-2,2-2s2,0.895,2,2C14,14.738,13.595,15.376,13,15.723z"})),React.createElement("g",{id:"Layer_1"}));case"gridicons-external":return React.createElement("g",null,React.createElement("path",{d:"M19 13v6c0 1.105-.895 2-2 2H5c-1.105 0-2-.895-2-2V7c0-1.105.895-2 2-2h6v2H5v12h12v-6h2zM13 3v2h4.586l-7.793 7.793 1.414 1.414L19 6.414V11h2V3h-8z"}))}}render(){const{size:e=24,className:t=""}=this.props,a=this.props.height||e,c=this.props.width||e,r=this.props.style||{height:a,width:c},l="gridicons-"+this.props.icon,s=(0,n.A)("gridicon",l,t,{"needs-offset":this.needsOffset(l,e)}),i=this.getSVGDescription(l);return React.createElement("svg",{className:s,focusable:this.props.focusable,height:a,onClick:this.props.onClick,style:r,viewBox:"0 0 24 24",width:c,xmlns:"http://www.w3.org/2000/svg","aria-hidden":this.props["aria-hidden"]},i?React.createElement("desc",null,i):null,this.renderIcon(l))}}const s=l},597:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var c=a(6427),n=a(3022),r=a(1609),l=a.n(r),s=a(1112),i=a(1883);a(4803);const o=e=>({"top-end":"top left",top:"top center","top-start":"top right","bottom-end":"bottom left",bottom:"bottom center","bottom-start":"bottom right"}[e]),m=({className:e="",iconClassName:t="",placement:a="bottom-end",animate:m=!0,iconCode:p="info-outline",iconSize:d=18,offset:u=10,title:h,children:g,popoverAnchorStyle:v="icon",forceShow:f=!1,wide:E=!1,inline:A=!0,shift:y=!1})=>{const[w,k]=(0,r.useState)(!1),b=(0,r.useCallback)((()=>k(!1)),[k]),_=(0,r.useCallback)((e=>{e.preventDefault(),k(!w)}),[w,k]),R={position:o(a),placement:a,animate:m,noArrow:!1,resize:!1,flip:!1,offset:u,focusOnMount:"container",onClose:b,className:"icon-tooltip-container",inline:A,shift:y},C="wrapper"===v,j=(0,n.A)("icon-tooltip-wrapper",e),S={left:C?0:-(62-d/2)+"px"},x=C&&f;return l().createElement("div",{className:j,"data-testid":"icon-tooltip_wrapper"},!C&&l().createElement(s.A,{variant:"link",onMouseDown:_},l().createElement(i.A,{className:t,icon:p,size:d})),l().createElement("div",{className:(0,n.A)("icon-tooltip-helper",{"is-wide":E}),style:S},(x||w)&&l().createElement(c.Popover,R,l().createElement("div",null,h&&l().createElement("div",{className:"icon-tooltip-title"},h),l().createElement("div",{className:"icon-tooltip-content"},g)))))}},8478:(e,t,a)=>{"use strict";a.d(t,{Wy:()=>m});var c=a(6072),n=a.n(c),r=a(6427),l=a(3022),s=(a(4705),a(2300));const i=({className:e,size:t=24,viewBox:a="0 0 24 24",opacity:c=1,color:i="#2C3338",children:o})=>{const m={className:(0,l.A)(s.A.iconWrapper,e),width:t,height:t,viewBox:a,opacity:c,fill:void 0};return i&&(m.fill=i),React.createElement(r.SVG,n()({},m,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg"}),React.createElement(r.G,{opacity:c},o))},o={...{"anti-spam":({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M21.6,12.5c0,0.6-0.3,1-0.9,1c-0.6,0-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1C21.3,11.7,21.6,12.1,21.6,12.5z"}),React.createElement(r.Path,{d:"M4.1,12.5c0,0.6-0.3,1-0.9,1s-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1S4.1,12.1,4.1,12.5z"})),backup:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M2.1,5.8c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.5,0.1-0.7c0.1-0.4,0.4-0.6,0.7-0.8l8.3-2.9c0.1-0.1,0.3-0.1,0.4-0.1l0.5,0.1 l8.3,2.9c0.3,0.2,0.5,0.4,0.7,0.7c0.2,0.2,0.2,0.4,0.2,0.7c0,0.1,0,0.1,0,0.2v0.1c-0.1,0.5-0.2,0.9-0.3,1.4 c-0.2,0.4-0.3,1.2-0.7,2.2c-0.3,1-0.7,2.1-1.1,3.1c-0.5,1-1,2.1-1.6,3.3s-1.4,2.3-2.2,3.5c-0.9,1.1-1.8,2.2-2.8,3.1 c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4c-1.2-1.1-2.4-2.4-3.5-4c-1-1.6-1.9-3-2.5-4.3c-0.6-1.3-1.1-2.7-1.6-4 C2.8,8.7,2.5,7.6,2.3,7C2.3,6.5,2.1,6.1,2.1,5.8z M2.9,5.9c0,0.2,0.1,0.4,0.1,0.8C3.1,7,3.2,7.5,3.5,8.2C3.7,9,3.9,9.7,4.2,10.6 c0.3,0.7,0.7,1.7,1.1,2.7c0.4,1,1,2,1.5,2.9c0.5,1,1.2,1.9,1.9,2.9c0.8,1,1.6,1.9,2.4,2.6c0.2,0.2,0.4,0.2,0.5,0.2 c0.2,0,0.4-0.1,0.5-0.2c1.2-1,2.2-2.3,3.2-3.8c1-1.5,1.8-2.8,2.3-4c0.6-1.3,1.1-2.5,1.5-3.9c0.4-1.3,0.7-2.2,0.9-2.8 c0.1-0.5,0.2-1,0.3-1.3c0-0.1,0-0.1,0-0.1c0-0.2,0-0.3-0.1-0.4C20.3,5.2,20.2,5.1,20,5L12,2.1c0,0-0.1,0-0.2,0s-0.1,0-0.1,0h-0.2 l-8,2.8C3.2,5,3.1,5.2,3,5.3C2.9,5.5,2.9,5.6,2.9,5.8C2.9,5.8,2.9,5.8,2.9,5.9z M5.9,6.7h3l2.8,7l2.8-7h3c-0.1,0.1-0.2,0.5-0.3,0.8 C17,7.8,17,8.2,16.8,8.4c-0.1,0.3-0.2,0.5-0.4,0.8c0,0.1-0.1,0.1-0.1,0.1s-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.2,0.1-0.2,0.2c0,0-0.1,0.1-0.1,0.1s-0.1,0.1-0.1,0.1c0,0,0,0.1-0.1,0.2c0,0.1-0.1,0.1-0.1,0.1l-0.4,1.1 c-1.3,3.3-2.1,5.2-2.3,5.8h-2.2l-1-2.4c-0.1-0.3-0.3-0.8-0.5-1.3c-0.1-0.3-0.3-0.8-0.5-1.3L8,10.8c-0.1-0.1-0.1-0.2-0.1-0.4 C7.8,10.2,7.7,10,7.7,9.8C7.6,9.7,7.5,9.5,7.4,9.4C7.3,9.3,7.3,9.3,7.3,9.3c-0.1,0-0.2,0-0.2,0s-0.1,0-0.1,0 C6.6,8.5,6.3,7.6,5.9,6.7z"})),boost:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19505 16.2545C4.47368 16.561 4.94802 16.5836 5.25451 16.3049L10.2595 11.7549L14.2842 15.2765L19 10.5607V13.75H20.5V9.5V8.75239V8.7476V8H19.7529H19.7471H19H14.75V9.5H17.9393L14.2158 13.2235L10.2405 9.74507L4.2455 15.195C3.93901 15.4737 3.91642 15.948 4.19505 16.2545Z"})),crm:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M15.5 9.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm-2.25 6v-2a2.75 2.75 0 0 0-2.75-2.75h-4A2.75 2.75 0 0 0 3.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5Zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0 1 20.25 15ZM9.5 8.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1.5 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"})),extras:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M18.5 5.5V8H20V5.5h2.5V4H20V1.5h-1.5V4H16v1.5h2.5ZM12 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-6h-1.5v6a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h6V4Z"})),protect:({opacity:e=1,size:t,className:a,color:c})=>React.createElement(i,{className:a,size:t,opacity:e,color:c},React.createElement(r.Path,{d:"M12 3.17627L18.75 6.24445V10.8183C18.75 14.7173 16.2458 18.4089 12.7147 19.5735C12.2507 19.7265 11.7493 19.7265 11.2853 19.5735C7.75416 18.4089 5.25 14.7173 5.25 10.8183V6.24445L12 3.17627ZM6.75 7.21032V10.8183C6.75 14.1312 8.89514 17.2057 11.7551 18.149C11.914 18.2014 12.086 18.2014 12.2449 18.149C15.1049 17.2057 17.25 14.1312 17.25 10.8183V7.21032L12 4.82396L6.75 7.21032Z"}),React.createElement(r.Path,{d:"M15.5291 10.0315L11.1818 14.358L8.47095 11.66L9.52907 10.5968L11.1818 12.2417L14.4709 8.96826L15.5291 10.0315Z"})),scan:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"m12 3.176 6.75 3.068v4.574c0 3.9-2.504 7.59-6.035 8.755a2.283 2.283 0 0 1-1.43 0c-3.53-1.164-6.035-4.856-6.035-8.755V6.244L12 3.176ZM6.75 7.21v3.608c0 3.313 2.145 6.388 5.005 7.33.159.053.331.053.49 0 2.86-.942 5.005-4.017 5.005-7.33V7.21L12 4.824 6.75 7.21Z"})),search:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M17.5 11.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm1.5 0a5.5 5.5 0 0 1-9.142 4.121l-3.364 2.943-.988-1.128 3.373-2.952A5.5 5.5 0 1 1 19 11.5Z"})),social:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M15.5 3.97809V18.0219L7.5 15.5977V20H6V15.1431L3.27498 14.3173C2.22086 13.9979 1.5 13.0262 1.5 11.9248V10.0752C1.5 8.97375 2.22087 8.00207 3.27498 7.68264L15.5 3.97809ZM14 16L7.5 14.0303L7.5 7.96969L14 5.99999V16ZM6 8.42423L6 13.5757L3.70999 12.8818C3.28835 12.754 3 12.3654 3 11.9248V10.0752C3 9.63462 3.28835 9.24595 3.70999 9.11818L6 8.42423ZM17.5 11.75H21.5V10.25H17.5V11.75ZM21.5 16L17.5 15V13.5L21.5 14.5V16ZM17.5 8.5L21.5 7.5V6L17.5 7V8.5Z"})),star:({size:e,className:t=s.A["star-icon"],color:a})=>React.createElement(i,{className:t,size:e,color:a},React.createElement(r.Path,{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"})),videopress:({opacity:e=1,size:t,color:a})=>React.createElement(i,{size:t,opacity:e,color:a},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3,6.2c0.8,0,1.6,0.6,1.8,1.4l2.3,7.9c0,0,0,0,0,0l2.7-9.3h1.5h4.2c2.9,0,4.9,1.9,4.9,4.7c0,2.9-2,4.7-5,4.7 h-2h-2.5l-0.5,1.5c-0.4,1.4-1.7,2.3-3.2,2.3c-1.4,0-2.7-0.9-3.2-2.3L2.5,8.7C2.1,7.4,3,6.2,4.3,6.2z M13,12.8h2.9c1.3,0,2-0.7,2-1.9 c0-1.2-0.8-1.8-2-1.8h-1.7L13,12.8z"})),jetpack:({size:e,className:t=s.A.jetpack,color:a})=>React.createElement(i,{className:t,size:e,color:a,viewBox:"0 0 32 32"},React.createElement(r.Path,{className:"jetpack-logo__icon-circle",d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z"}),React.createElement(r.Polygon,{fill:"#fff",points:"15,19 7,19 15,3"}),React.createElement(r.Polygon,{fill:"#fff",points:"17,29 17,13 25,13"})),share:({size:e=16,className:t,color:a})=>React.createElement(i,{className:t,size:e,color:a,viewBox:"0 0 16 16"},React.createElement(r.Path,{fill:"#161722",fillRule:"evenodd",d:"M8.3 4.66C3.85 5.308.727 9.75.034 13.69l-.02.117c-.137.842.809 1.232 1.446.68 2.013-1.745 3.648-2.475 5.318-2.719a10.482 10.482 0 011.524-.103v2.792c0 .694.82 1.041 1.3.55l6.176-6.307a.79.79 0 00.012-1.088L9.614 1.004C9.14.496 8.301.84 8.301 1.542v3.117zm1.525-1.175v1.85a.773.773 0 01-.654.77l-.655.096c-2.133.311-3.987 1.732-5.295 3.672-.472.7-.854 1.44-1.143 2.18a12.32 12.32 0 011.675-.972c1.58-.75 3.048-.972 4.548-.972h.762a.77.77 0 01.762.779v1.69l4.347-4.44-4.347-4.653z",clipRule:"evenodd"})),ai:({size:e=24,color:t="#069e08"})=>React.createElement(i,{color:t,size:e,viewBox:"0 0 32 32"},React.createElement(r.Path,{className:"spark-first",d:"M9.33301 5.33325L10.4644 8.20188L13.333 9.33325L10.4644 10.4646L9.33301 13.3333L8.20164 10.4646L5.33301 9.33325L8.20164 8.20188L9.33301 5.33325Z"}),React.createElement(r.Path,{className:"spark-second",d:"M21.3333 5.33333L22.8418 9.15817L26.6667 10.6667L22.8418 12.1752L21.3333 16L19.8248 12.1752L16 10.6667L19.8248 9.15817L21.3333 5.33333Z"}),React.createElement(r.Path,{className:"spark-third",d:"M14.6667 13.3333L16.5523 18.1144L21.3333 20L16.5523 21.8856L14.6667 26.6667L12.781 21.8856L8 20L12.781 18.1144L14.6667 13.3333Z"}))}};function m(e){return o[e]?o[e]:null}},8250:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var c=a(6072),n=a.n(c),r=a(7143),l=a(7723),s=a(1113),i=a(3512),o=a(3022),m=a(1609),p=a.n(m),d=a(3924),u=a(4293),h=a(1069),g=a(8907),v=(a(4206),a(7142)),f=a(442);const __=l.__,_x=l._x,E=()=>p().createElement(v.A,{logoColor:"#000",showText:!1,height:16,"aria-hidden":"true"}),A=()=>p().createElement(p().Fragment,null,p().createElement(s.A,{icon:i.A,size:16}),p().createElement("span",{className:"jp-dashboard-footer__accessible-external-link"},/* translators: accessibility text */ +__("(opens in a new tab)","jetpack-protect"))),y=({moduleName:e=__("Jetpack","jetpack-protect"),className:t,moduleNameHref:a="https://jetpack.com",menu:c,onAboutClick:l,onPrivacyClick:s,onTermsClick:i,...m})=>{const[v]=(0,f.A)("sm","<="),[y]=(0,f.A)("md","<="),[w]=(0,f.A)("lg",">"),{isActive:k,connectedPlugins:b}=(0,r.useSelect)((e=>{const t=e(u.a);return{connectedPlugins:t?.getConnectedPlugins(),...t.getConnectionStatus()}}),[u.a]),_=(0,h.A)(),R=_&&k&&b?.some((({slug:e})=>"jetpack"===e));let C=[{label:_x("About","Link to learn more about Jetpack.","jetpack-protect"),title:__("About Jetpack","jetpack-protect"),href:R?new URL("admin.php?page=jetpack_about",_).href:(0,d.A)("jetpack-about"),target:R?"_self":"_blank",onClick:l},{label:_x("Privacy","Shorthand for Privacy Policy.","jetpack-protect"),title:__("Automattic's Privacy Policy","jetpack-protect"),href:R?new URL("admin.php?page=jetpack#/privacy",_).href:(0,d.A)("a8c-privacy"),target:R?"_self":"_blank",onClick:s},{label:_x("Terms","Shorthand for Terms of Service.","jetpack-protect"),title:__("WordPress.com Terms of Service","jetpack-protect"),href:(0,d.A)("wpcom-tos"),target:"_blank",onClick:i}];c&&(C=[...C,...c]);const j=p().createElement(p().Fragment,null,p().createElement(E,null),e);return p().createElement("footer",n()({className:(0,o.A)("jp-dashboard-footer",{"is-sm":v,"is-md":y,"is-lg":w},t),"aria-label":__("Jetpack","jetpack-protect")},m),p().createElement("ul",null,p().createElement("li",{className:"jp-dashboard-footer__jp-item"},a?p().createElement("a",{href:a},j):j),C.map((e=>{const t="button"===e.role,a=!t&&"_blank"===e.target;return p().createElement("li",{key:e.label},p().createElement("a",{href:e.href,title:e.title,target:e.target,onClick:e.onClick,onKeyDown:e.onKeyDown,className:(0,o.A)("jp-dashboard-footer__menu-item",{"is-external":a}),role:e.role,rel:a?"noopener noreferrer":void 0,tabIndex:t?0:void 0},e.label,a&&p().createElement(A,null)))})),p().createElement("li",{className:"jp-dashboard-footer__a8c-item"},p().createElement("a",{href:R?new URL("admin.php?page=jetpack_about",_).href:(0,d.A)("a8c-about"),"aria-label":__("An Automattic Airline","jetpack-protect")},p().createElement(g.A,{"aria-hidden":"true"})))))}},7142:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(6072),n=a.n(c),r=a(7723),l=a(3022),s=a(1609),i=a.n(s);const __=r.__,o=({logoColor:e="#069e08",showText:t=!0,className:a,height:c=32,...r})=>{const s=t?"0 0 118 32":"0 0 32 32";return i().createElement("svg",n()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:s,className:(0,l.A)("jetpack-logo",a),"aria-labelledby":"jetpack-logo-title",height:c},r,{role:"img"}),i().createElement("title",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-protect")),i().createElement("path",{fill:e,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),t&&i().createElement(i().Fragment,null,i().createElement("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),i().createElement("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),i().createElement("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),i().createElement("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),i().createElement("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z"}),i().createElement("path",{d:"M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z"}),i().createElement("path",{d:"M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z"})))}},8509:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(3022),n=a(1609),r=a(7371);const l=Number(r.A.smCols),s=Number(r.A.mdCols),i=Number(r.A.lgCols),o=e=>{const{children:t,tagName:a="div",className:o}=e,m=Math.min(l,"number"==typeof e.sm?e.sm:l),p=Math.min(l,"object"==typeof e.sm?e.sm.start:0),d=Math.min(l,"object"==typeof e.sm?e.sm.end:0),u=Math.min(s,"number"==typeof e.md?e.md:s),h=Math.min(s,"object"==typeof e.md?e.md.start:0),g=Math.min(s,"object"==typeof e.md?e.md.end:0),v=Math.min(i,"number"==typeof e.lg?e.lg:i),f=Math.min(i,"object"==typeof e.lg?e.lg.start:0),E=Math.min(i,"object"==typeof e.lg?e.lg.end:0),A=(0,c.A)(o,{[r.A[`col-sm-${m}`]]:!(p&&d),[r.A[`col-sm-${p}-start`]]:p>0,[r.A[`col-sm-${d}-end`]]:d>0,[r.A[`col-md-${u}`]]:!(h&&g),[r.A[`col-md-${h}-start`]]:h>0,[r.A[`col-md-${g}-end`]]:g>0,[r.A[`col-lg-${v}`]]:!(f&&E),[r.A[`col-lg-${f}-start`]]:f>0,[r.A[`col-lg-${E}-end`]]:E>0});return(0,n.createElement)(a,{className:A},t)}},5918:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(3022),n=a(1609),r=a(2420);const l=({children:e,fluid:t=!1,tagName:a="div",className:l,horizontalGap:s=1,horizontalSpacing:i=1})=>{const o=(0,n.useMemo)((()=>{const e=`calc( var(--horizontal-spacing) * ${i} )`;return{paddingTop:e,paddingBottom:e,rowGap:`calc( var(--horizontal-spacing) * ${s} )`}}),[s,i]),m=(0,c.A)(l,r.A.container,{[r.A.fluid]:t});return(0,n.createElement)(a,{className:m,style:o},e)}},442:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(9491),n=a(8403);const r=["sm","md","lg"],l=(e,t)=>{const a=Array.isArray(e)?e:[e],l=Array.isArray(t)?t:[t],[s,i,o]=r,m={sm:(0,c.useMediaQuery)(n.A[s]),md:(0,c.useMediaQuery)(n.A[i]),lg:(0,c.useMediaQuery)(n.A[o])};return a.map(((e,t)=>{const a=l[t];return a?((e,t,a)=>{const c=r.indexOf(e),n=c+1,l=t.includes("=");let s=[];return t.startsWith("<")&&(s=r.slice(0,l?n:c)),t.startsWith(">")&&(s=r.slice(l?c:n)),s?.length?s.some((e=>a[e])):a[e]})(e,a,m):m[e]}))}},7656:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(311),n=a(9783),r=a(3883),l=a(1113),s=a(991),i=a(3022),o=a(1609),m=a.n(o),p=a(7410);const d=e=>{switch(e){case"error":case"warning":default:return c.A;case"info":return n.A;case"success":return r.A}},u=({level:e="info",title:t,children:a,actions:c,hideCloseButton:n=!1,onClose:r})=>{const o=(0,i.A)(p.A.container,p.A[`is-${e}`]);return m().createElement("div",{className:o},m().createElement("div",{className:p.A["icon-wrapper"]},m().createElement(l.A,{icon:d(e),className:p.A.icon})),m().createElement("div",{className:p.A["main-content"]},t&&m().createElement("div",{className:p.A.title},t),a,c&&c.length>0&&m().createElement("div",{className:p.A["action-bar"]},c.map(((e,t)=>m().createElement("div",{key:t,className:p.A.action},e))))),!n&&m().createElement("button",{"aria-label":"close",className:p.A["close-button"],onClick:r},m().createElement(l.A,{icon:s.A})))}},9245:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>k,N0:()=>w,eY:()=>A,i7:()=>y});var c=a(7723),n=a(1113),r=a(3883),l=a(1249),s=a(3022),i=a(1609),o=a.n(i),m=a(597),p=a(442),d=a(5879),u=a(7425),h=a(3142);const __=c.__,g=__("Included","jetpack-protect"),v=__("Not included","jetpack-protect"),f=__("Coming soon","jetpack-protect"),E=(0,i.createContext)(void 0),A=({isIncluded:e=!1,isComingSoon:t=!1,index:a=0,label:d=null,tooltipInfo:A,tooltipTitle:y,tooltipClassName:w=""})=>{const[k]=(0,p.A)("lg"),b=(0,i.useContext)(E)[a],_=t||e,R=b.name,C=b.tooltipInfo,j=b.tooltipTitle,S=A||!k&&C,x=((e,t,a)=>e?{lg:f, +// translators: Name of the current feature +default:(0,c.sprintf)(__("%s coming soon","jetpack-protect"),a)}:{lg:t?g:v,default:t?a:(0,c.sprintf)(/* translators: Name of the current feature */ +__("%s not included","jetpack-protect"),a)})(t,e,R),N=k?x.lg:x.default;return o().createElement("div",{className:(0,s.A)(h.A.item,h.A.value)},o().createElement(n.A,{className:(0,s.A)(h.A.icon,_?h.A["icon-check"]:h.A["icon-cross"]),size:32,icon:_?r.A:l.A}),o().createElement(u.Ay,{variant:"body-small"},d||N),S&&o().createElement(m.A,{title:y||j,iconClassName:h.A["popover-icon"],className:(0,s.A)(h.A.popover,w),placement:"bottom-end",iconSize:14,offset:4,wide:Boolean(y&&A)},o().createElement(u.Ay,{variant:"body-small",component:"div"},A||C)))},y=({children:e})=>o().createElement("div",{className:h.A.header},e),w=({primary:e=!1,children:t})=>{let a=0;return o().createElement("div",{className:(0,s.A)(h.A.card,{[h.A["is-primary"]]:e})},i.Children.map(t,(e=>{const t=e;return t.type===A?(a++,(0,i.cloneElement)(t,{index:a-1})):t})))},k=({title:e,items:t,children:a,showIntroOfferDisclaimer:c=!1})=>{const[n]=(0,p.A)("lg");return o().createElement(E.Provider,{value:t},o().createElement("div",{className:(0,s.A)(h.A.container,{[h.A["is-viewport-large"]]:n}),style:{"--rows":t.length+1,"--columns":i.Children.toArray(a).length+1}},o().createElement("div",{className:h.A.table},o().createElement(u.Ay,{variant:"headline-small"},e),n&&t.map(((e,a)=>o().createElement("div",{className:(0,s.A)(h.A.item,{[h.A["last-feature"]]:a===t.length-1}),key:a},o().createElement(u.Ay,{variant:"body-small"},o().createElement("strong",null,e.name)),e.tooltipInfo&&o().createElement(m.A,{title:e.tooltipTitle,iconClassName:h.A["popover-icon"],className:h.A.popover,placement:e.tooltipPlacement?e.tooltipPlacement:"bottom-end",iconSize:14,offset:4,wide:Boolean(e.tooltipTitle&&e.tooltipInfo)},o().createElement(u.Ay,{variant:"body-small"},e.tooltipInfo))))),a)),o().createElement("div",{className:h.A["tos-container"]},o().createElement("div",{className:h.A.tos},c&&o().createElement(u.Ay,{variant:"body-small"},__("Reduced pricing is a limited offer for the first year and renews at regular price.","jetpack-protect")),o().createElement(d.A,{multipleButtons:!0}))))}},489:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var c=a(7723),n=a(3022),r=a(7425),l=a(2746),s=a(3407);const __=c.__,i=({price:e,offPrice:t,currency:a="",showNotOffPrice:c=!0,hideDiscountLabel:i=!0,promoLabel:o="",legend:m=__("/month, paid yearly","jetpack-protect"),isNotConvenientPrice:p=!1,hidePriceFraction:d=!1,children:u})=>{if(null==e&&null==t||!a)return null;c=c&&null!=t;const h="number"==typeof e&&"number"==typeof t?Math.floor((e-t)/e*100):0,g=!i&&h&&h>0?h+__("% off","jetpack-protect"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:s.A.container},React.createElement("div",{className:(0,n.A)(s.A["price-container"],"product-price_container")},React.createElement(l.g,{value:t??e,currency:a,isOff:!p,hidePriceFraction:d}),c&&React.createElement(l.g,{value:e,currency:a,isOff:!1,hidePriceFraction:d}),g&&React.createElement(r.Ay,{className:(0,n.A)(s.A["promo-label"],"product-price_promo_label")},g))),React.createElement("div",{className:s.A.footer},u||React.createElement(r.Ay,{className:(0,n.A)(s.A.legend,"product-price_legend")},m),o&&React.createElement(r.Ay,{className:(0,n.A)(s.A["promo-label"],"product-price_promo_label")},o)))}},2746:(e,t,a)=>{"use strict";a.d(t,{g:()=>s});var c=a(7397),n=a(3022),r=a(7425),l=a(3407);const s=({value:e,currency:t,isOff:a,hidePriceFraction:s})=>{const i=(0,n.A)(l.A.price,"product-price_price",{[l.A["is-not-off-price"]]:!a}),{symbol:o,integer:m,fraction:p}=(0,c.vA)(e,t),d=!s||!p.endsWith("00");return React.createElement(r.Ay,{className:i,variant:"headline-medium",component:"p"},React.createElement(r.Ay,{className:l.A.symbol,component:"sup",variant:"title-medium"},o),m,d&&React.createElement(r.Ay,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,p)))}},6461:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var c=a(8120),n=a.n(c),r=a(1609),l=a.n(r);a(8325);const s=({color:e="#FFFFFF",className:t="",size:a=20})=>{const c=t+" jp-components-spinner",n={width:a,height:a,fontSize:a,borderTopColor:e},r={borderTopColor:e,borderRightColor:e};return l().createElement("div",{className:c},l().createElement("div",{className:"jp-components-spinner__outer",style:n},l().createElement("div",{className:"jp-components-spinner__inner",style:r})))};s.propTypes={color:n().string,className:n().string,size:n().number};const i=s},1158:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(7723),n=a(3022),r=a(7425),l=a(416);const __=c.__,s=({className:e,label:t,status:a="inactive"})=>{const c={active:__("Active","jetpack-protect"),error:__("Error","jetpack-protect"),action:__("Action needed","jetpack-protect"),inactive:__("Inactive","jetpack-protect"),initializing:__("Setting up","jetpack-protect")};return React.createElement(r.Ay,{variant:"body-extra-small",className:(0,n.A)(l.A.status,{[l.A[`is-${a}`]]:a},e)},React.createElement("span",{className:l.A.status__indicator}),React.createElement("span",{className:l.A.status__label},t||""===t?t:c[a]))}},5879:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(6072),n=a.n(c),r=a(6087),l=a(7723),s=a(3022),i=a(3924),o=a(7425);a(9634);const __=l.__,m=({multipleButtonsLabels:e})=>Array.isArray(e)&&e.length>1?(0,r.createInterpolateElement)((0,l.sprintf)(/* translators: %1$s is button label 1 and %2$s is button label 2 */ +__("By clicking %1$s or %2$s, you agree to our Terms of Service and to sync your site‘s data with us.","jetpack-protect"),e[0],e[1]),{strong:React.createElement("strong",null),tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}):(0,r.createInterpolateElement)(__("By clicking the buttons above, you agree to our Terms of Service and to sync your site‘s data with us.","jetpack-protect"),{tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),p=({agreeButtonLabel:e})=>(0,r.createInterpolateElement)((0,l.sprintf)(/* translators: %s is a button label */ +__("By clicking %s, you agree to our Terms of Service and to sync your site‘s data with us.","jetpack-protect"),e),{strong:React.createElement("strong",null),tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),d=({slug:e,children:t})=>React.createElement("a",{className:"terms-of-service__link",href:(0,i.A)(e),rel:"noopener noreferrer",target:"_blank"},t),u=({className:e,multipleButtons:t,agreeButtonLabel:a,...c})=>React.createElement(o.Ay,n()({className:(0,s.A)(e,"terms-of-service")},c),t?React.createElement(m,{multipleButtonsLabels:t}):React.createElement(p,{agreeButtonLabel:a}))},110:(e,t,a)=>{"use strict";a.d(t,{Q:()=>c,Z:()=>n});const c={"headline-medium":"h1","headline-small":"h2","headline-small-regular":"h2","title-medium":"h3","title-medium-semi-bold":"h3","title-small":"h4",body:"p","body-small":"p","body-extra-small":"p","body-extra-small-bold":"p",label:"p"},n=["mt","mr","mb","ml","mx","my","m","pt","pr","pb","pl","px","py","p"]},7425:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>p,H3:()=>d,hE:()=>u});var c=a(6072),n=a.n(c),r=a(3022),l=a(1609),s=a.n(l),i=a(110),o=a(4495);const m=(0,l.forwardRef)((({variant:e="body",children:t,component:a,className:c,...m},p)=>{const d=a||i.Q[e]||"span",u=(0,l.useMemo)((()=>i.Z.reduce(((e,t)=>(void 0!==m[t]&&(e+=o.A[`${t}-${m[t]}`]+" ",delete m[t]),e)),"")),[m]);return m.ref=p,s().createElement(d,n()({className:(0,r.A)(o.A.reset,o.A[e],c,u)},m),t)}));m.displayName="Text";const p=m,d=({children:e,weight:t="bold",...a})=>{const c="headline-small"+("bold"===t?"":`-${t}`);return s().createElement(m,n()({variant:c,mb:3},a),e)},u=({children:e,size:t="medium",...a})=>s().createElement(m,n()({variant:`title-${t}`,mb:1},a),e)},723:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>d});var c=a(1609),n=a.n(c),r=a(9422);const l={"--font-headline-medium":"48px","--font-headline-small":"36px","--font-title-medium":"24px","--font-title-small":"20px","--font-body":"16px","--font-body-small":"14px","--font-body-extra-small":"12px","--font-title-large":"var(--font-headline-small)","--font-label":"var(--font-body-extra-small)"},s={"--jp-black":"#000000","--jp-black-80":"#2c3338","--jp-white":"#ffffff","--jp-white-off":"#f9f9f6","--jp-gray":"#dcdcde","--jp-gray-0":"#F6F7F7","--jp-gray-5":"var(--jp-gray)","--jp-gray-10":"#C3C4C7","--jp-gray-20":"#A7AAAD","--jp-gray-40":"#787C82","--jp-gray-50":"#646970","--jp-gray-60":"#50575E","--jp-gray-70":"#3C434A","--jp-gray-80":"#2C3338","--jp-gray-90":"#1d2327","--jp-gray-off":"#e2e2df","--jp-red-0":"#F7EBEC","--jp-red-5":"#FACFD2","--jp-red-40":"#E65054","--jp-red-50":"#D63638","--jp-red-60":"#B32D2E","--jp-red-70":"#8A2424","--jp-red-80":"#691C1C","--jp-red":"#d63639","--jp-yellow-5":"#F5E6B3","--jp-yellow-10":"#F2CF75","--jp-yellow-20":"#F0C930","--jp-yellow-30":"#DEB100","--jp-yellow-40":"#C08C00","--jp-yellow-50":"#9D6E00","--jp-yellow-60":"#7D5600","--jp-blue-20":"#68B3E8","--jp-blue-40":"#1689DB","--jp-pink":"#C9356E","--jp-green-0":"#f0f2eb","--jp-green-5":"#d0e6b8","--jp-green-10":"#9dd977","--jp-green-20":"#64ca43","--jp-green-30":"#2fb41f","--jp-green-40":"#069e08","--jp-green-50":"#008710","--jp-green-60":"#007117","--jp-green-70":"#005b18","--jp-green-80":"#004515","--jp-green-90":"#003010","--jp-green-100":"#001c09","--jp-green":"#069e08","--jp-green-primary":"var( --jp-green-40 )","--jp-green-secondary":"var( --jp-green-30 )"},i={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},o={"--spacing-base":"8px"},m={},p=(e,t,a)=>{const c={...l,...s,...i,...o};for(const t in c)e.style.setProperty(t,c[t]);a&&e.classList.add(r.A.global),t&&(m[t]={provided:!0,root:e})},d=({children:e=null,targetDom:t,id:a,withGlobalStyles:r=!0})=>{const l=(0,c.useRef)(),s=m?.[a]?.provided;return(0,c.useLayoutEffect)((()=>{if(!s)return t?p(t,a,r):void(l?.current&&p(l.current,a,r))}),[t,l,s,a,r]),t?n().createElement(n().Fragment,null,e):n().createElement("div",{ref:l},e)}},1069:(e,t,a)=>{"use strict";function c(){return window.Initial_State?.adminUrl||window.Jetpack_Editor_Initial_State?.adminUrl||window?.myJetpackInitialState?.adminUrl||null}a.d(t,{A:()=>c})},3924:(e,t,a)=>{"use strict";function c(e,t={}){const a={};let c;if("undefined"!=typeof window&&(c=window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv),0===e.search("https://")){const t=new URL(e);e=`https://${t.host}${t.pathname}`,a.url=encodeURIComponent(e)}else a.source=encodeURIComponent(e);for(const e in t)a[e]=encodeURIComponent(t[e]);!Object.keys(a).includes("site")&&"undefined"!=typeof jetpack_redirects&&Object.hasOwn(jetpack_redirects,"currentSiteRawUrl")&&(a.site=jetpack_redirects.currentBlogID??jetpack_redirects.currentSiteRawUrl),c&&(a.calypso_env=c);return"https://jetpack.com/redirect/?"+Object.keys(a).map((e=>e+"="+a[e])).join("&")}a.d(t,{A:()=>c})},6439:(e,t,a)=>{let c={};try{c=a(4611)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),c={missingConfig:!0}}const n=e=>Object.hasOwn(c,e);e.exports={jetpackConfigHas:n,jetpackConfigGet:e=>{if(!n(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return c[e]}}},3935:(e,t,a)=>{"use strict";a.d(t,{A1:()=>i,Ay:()=>k,DO:()=>s,Ij:()=>l,Kl:()=>u,LW:()=>o,MU:()=>h,XY:()=>m,ZO:()=>r,dz:()=>p,gH:()=>d,v_:()=>n});var c=a(5932);const n="SET_CONNECTION_STATUS",r="SET_CONNECTION_STATUS_IS_FETCHING",l="SET_SITE_IS_REGISTERING",s="SET_USER_IS_CONNECTING",i="SET_REGISTRATION_ERROR",o="CLEAR_REGISTRATION_ERROR",m="SET_AUTHORIZATION_URL",p="DISCONNECT_USER_SUCCESS",d="SET_CONNECTED_PLUGINS",u="SET_CONNECTION_ERRORS",h="SET_IS_OFFLINE_MODE",g=e=>({type:n,connectionStatus:e}),v=e=>({type:l,isRegistering:e}),f=e=>({type:s,isConnecting:e}),E=e=>({type:i,registrationError:e}),A=()=>({type:o}),y=e=>({type:m,authorizationUrl:e}),w=e=>({type:d,connectedPlugins:e});const k={setConnectionStatus:g,setConnectionStatusIsFetching:e=>({type:r,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:v,setUserIsConnecting:f,setRegistrationError:E,clearRegistrationError:A,setAuthorizationUrl:y,registerSite:function*({registrationNonce:e,redirectUri:t,from:a=""}){yield A(),yield v(!0);try{const c=yield{type:"REGISTER_SITE",registrationNonce:e,redirectUri:t,from:a};return yield g({isRegistered:!0}),yield y(c.authorizeUrl),yield v(!1),Promise.resolve(c)}catch(e){return yield E(e),yield v(!1),Promise.reject(e)}},connectUser:function*({from:e,redirectFunc:t,redirectUri:a}={}){yield f(!0),yield{type:"CONNECT_USER",from:e,redirectFunc:t,redirectUri:a}},disconnectUserSuccess:()=>({type:p}),setConnectedPlugins:w,refreshConnectedPlugins:()=>async({dispatch:e})=>await new Promise((t=>c.Ay.fetchConnectedPlugins().then((a=>{e(w(a)),t(a)})))),setConnectionErrors:e=>({type:u,connectionErrors:e}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})}},2494:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(5932),n=a(7143),r=a(2279);const l={FETCH_AUTHORIZATION_URL:({redirectUri:e})=>c.Ay.fetchAuthorizationUrl(e),REGISTER_SITE:({registrationNonce:e,redirectUri:t,from:a})=>c.Ay.registerSite(e,t,a),CONNECT_USER:(0,n.createRegistryControl)((({resolveSelect:e})=>({from:t,redirectFunc:a,redirectUri:c}={})=>new Promise(((n,l)=>{e(r.A).getAuthorizationUrl(c).then((e=>{const c=a||(e=>window.location.assign(e)),r=new URL(e);t&&r.searchParams.set("from",encodeURIComponent(t));const l=r.toString();c(l),n(l)})).catch((e=>{l(e)}))}))))}},5051:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(7143),n=a(3935);const r=(0,c.combineReducers)({connectionStatus:(e={},t)=>{switch(t.type){case n.v_:return{...e,...t.connectionStatus};case n.dz:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:(e=!1,t)=>t.type===n.ZO?t.isFetching:e,siteIsRegistering:(e=!1,t)=>t.type===n.Ij?t.isRegistering:e,userIsConnecting:(e=!1,t)=>t.type===n.DO?t.isConnecting:e,registrationError:(e,t)=>{switch(t.type){case n.LW:return!1;case n.A1:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===n.XY?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:(e={},t)=>t.type===n.gH?t.connectedPlugins:e,connectionErrors:(e={},t)=>t.type===n.Kl?t.connectionErrors:e,isOfflineMode:(e=!1,t)=>t.type===n.MU?t.isConnecting:e})},8019:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(7143),n=a(3935),r=a(2279);const l={...{getAuthorizationUrl:{isFulfilled:(e,...t)=>{const a=Boolean(e.authorizationUrl),n=(0,c.select)(r.A).hasFinishedResolution("getAuthorizationUrl",t);return a&&!n&&(0,c.dispatch)(r.A).finishResolution("getAuthorizationUrl",t),a},*fulfill(e){const t=yield n.Ay.fetchAuthorizationUrl(e);yield n.Ay.setAuthorizationUrl(t.authorizeUrl)}}}}},2676:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c={...{getConnectionStatus:e=>e.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionErrors:e=>e.connectionErrors||[],getIsOfflineMode:e=>e.isOfflineMode||!1,getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}}},8734:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(7143);class n{static store=null;static mayBeInit(e,t){null===n.store&&(n.store=(0,c.createReduxStore)(e,t),(0,c.register)(n.store))}}const r=n},2279:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const c="jetpack-connection"},4293:(e,t,a)=>{"use strict";a.d(t,{a:()=>m.A});var c=a(7999),n=a(3935),r=a(2494),l=a(5051),s=a(8019),i=a(2676),o=a(8734),m=a(2279);const p=window.JP_CONNECTION_INITIAL_STATE||(0,c.getScriptData)()?.connection;p||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),o.A.mayBeInit(m.A,{__experimentalUseThunks:!0,reducer:l.A,actions:n.Ay,selectors:i.A,resolvers:s.A,controls:r.A,initialState:p||{}})},4705:(e,t,a)=>{"use strict";a(8992),a(1135)},1135:(e,t,a)=>{"use strict";a.d(t,{$:()=>c});const c=[{name:"amazon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M13.582 8.182c-1.648.185-3.802.308-5.344.984-1.781.769-3.03 2.337-3.03 4.644 0 2.953 1.86 4.429 4.253 4.429 2.02 0 3.125-.477 4.685-2.065.516.747.685 1.109 1.629 1.894a.59.59 0 0 0 .672-.066l.006.006c.567-.505 1.599-1.401 2.18-1.888.231-.188.19-.496.009-.754-.52-.718-1.072-1.303-1.072-2.634V8.305c0-1.876.133-3.599-1.249-4.891C15.23 2.369 13.422 2 12.04 2 9.336 2 6.318 3.01 5.686 6.351c-.068.355.191.542.423.594l2.754.298c.258-.013.445-.266.494-.523.236-1.151 1.2-1.706 2.284-1.706.584 0 1.249.215 1.595.738.398.584.346 1.384.346 2.061zm-.533 5.906c-.451.8-1.169 1.291-1.967 1.291-1.09 0-1.728-.83-1.728-2.061 0-2.42 2.171-2.86 4.227-2.86v.615c.001 1.108.027 2.031-.532 3.015m7.634 5.251C18.329 21.076 14.917 22 11.979 22c-4.118 0-7.826-1.522-10.632-4.057-.22-.199-.024-.471.241-.317 3.027 1.762 6.771 2.823 10.639 2.823 2.608 0 5.476-.541 8.115-1.66.397-.169.73.262.341.55m.653 1.704c-.194.163-.379.076-.293-.139.284-.71.92-2.298.619-2.684s-1.99-.183-2.749-.092c-.23.027-.266-.173-.059-.319 1.348-.946 3.555-.673 3.811-.356.26.32-.066 2.533-1.329 3.59"})))},{name:"behance",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M7.799 5.698c.589 0 1.12.051 1.606.156q.722.155 1.241.507.516.351.804.938c.188.387.281.871.281 1.443q0 .93-.421 1.551-.424.62-1.255 1.014 1.133.328 1.689 1.146.559.822.557 1.975 0 .935-.359 1.612a3.14 3.14 0 0 1-.973 1.114q-.613.432-1.399.637A6.1 6.1 0 0 1 7.963 18H2V5.698zm-.35 4.97q.721 0 1.192-.345.465-.344.463-1.119 0-.43-.152-.707a1.1 1.1 0 0 0-.416-.427 1.7 1.7 0 0 0-.596-.216 3.6 3.6 0 0 0-.697-.06H4.709v2.874zm.151 5.237q.401.001.759-.077c.243-.053.457-.137.637-.261.182-.12.332-.283.441-.491q.164-.31.163-.798-.002-.948-.533-1.357c-.356-.27-.83-.404-1.413-.404H4.709v3.388zm8.562-.041q.552.538 1.583.538.74 0 1.277-.374c.354-.248.571-.514.654-.79h2.155c-.347 1.072-.872 1.838-1.589 2.299-.708.463-1.572.693-2.58.693q-1.05 0-1.899-.337a4 4 0 0 1-1.439-.958 4.4 4.4 0 0 1-.904-1.484 5.4 5.4 0 0 1-.32-1.899q0-1 .329-1.863a4.4 4.4 0 0 1 .933-1.492q.607-.63 1.444-.994a4.6 4.6 0 0 1 1.857-.363q1.131-.001 1.98.44a3.94 3.94 0 0 1 1.389 1.181 4.8 4.8 0 0 1 .783 1.69q.24.947.171 1.983h-6.428c-.001.706.237 1.372.604 1.73m2.811-4.68c-.291-.321-.783-.496-1.384-.496q-.585 0-.973.2a2 2 0 0 0-.621.491 1.8 1.8 0 0 0-.328.628 2.7 2.7 0 0 0-.111.587h3.98c-.058-.625-.271-1.085-.563-1.41m-3.916-3.446h4.985V6.524h-4.985z"})))},{name:"blogger-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.779 9.904h-.981l-.021.001a1.163 1.163 0 0 1-1.16-1.079l-.001-.013A5.813 5.813 0 0 0 11.803 3H8.871a5.813 5.813 0 0 0-5.813 5.813v6.375a5.813 5.813 0 0 0 5.813 5.813h6.257a5.814 5.814 0 0 0 5.813-5.813l.002-4.121a1.164 1.164 0 0 0-1.164-1.163M8.726 7.713h3.291a1.117 1.117 0 1 1 0 2.234H8.726a1.117 1.117 0 1 1 0-2.234m6.601 8.657H8.72a1.057 1.057 0 1 1 0-2.114h6.607a1.057 1.057 0 1 1 0 2.114"})))},{name:"blogger",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M14.722 14.019a.654.654 0 0 1-.654.654H9.977a.654.654 0 0 1 0-1.308h4.091c.361 0 .654.293.654.654m-4.741-3.321h2.038a.692.692 0 0 0 0-1.384H9.981a.692.692 0 0 0 0 1.384M21 5v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2m-3.456 6.39a.72.72 0 0 0-.72-.72h-.607l-.013.001a.72.72 0 0 1-.718-.668l-.001-.008a3.6 3.6 0 0 0-3.599-3.599H10.07a3.6 3.6 0 0 0-3.599 3.599v3.947a3.6 3.6 0 0 0 3.599 3.599h3.874a3.6 3.6 0 0 0 3.599-3.599z"})))},{name:"bluesky",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.2 3.3c-.5-.2-1.4-.5-3.6 1C15.4 6 12.9 9.2 12 11c-.9-1.8-3.4-5-5.7-6.7-2.2-1.6-3-1.3-3.6-1S2 4.6 2 5.1s.3 4.7.5 5.4c.7 2.3 3.1 3.1 5.3 2.8-3.3.5-6.2 1.7-2.4 5.9 4.2 4.3 5.7-.9 6.5-3.6.8 2.7 1.7 7.7 6.4 3.6 3.6-3.6 1-5.4-2.3-5.9 2.2.2 4.6-.5 5.3-2.8.4-.7.7-4.8.7-5.4 0-.5-.1-1.5-.8-1.8"})))},{name:"codepen",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m22.016 8.84-.007-.037q-.006-.037-.015-.072-.007-.022-.013-.042l-.023-.062-.02-.042a.4.4 0 0 0-.03-.057l-.025-.038-.035-.052-.03-.037q-.021-.026-.043-.045-.015-.018-.035-.035a.4.4 0 0 0-.048-.04l-.037-.03-.015-.012-9.161-6.096a.86.86 0 0 0-.955 0L2.359 8.237l-.015.012-.038.028-.048.04a.638.638 0 0 0-.078.082q-.018.018-.03.037-.018.026-.035.052l-.025.038q-.016.031-.03.059l-.02.041a1 1 0 0 0-.034.106q-.01.034-.016.071-.003.02-.006.037a1 1 0 0 0-.009.114v6.093q0 .056.008.112l.007.038q.006.035.015.072a.2.2 0 0 0 .013.04q.01.032.022.063l.02.04a.4.4 0 0 0 .055.096l.035.052.03.037.042.045.035.035q.023.02.048.04l.038.03.013.01 9.163 6.095a.858.858 0 0 0 .959.004l9.163-6.095.015-.01q.02-.015.037-.03l.048-.04q.02-.017.035-.035.025-.024.043-.045l.03-.037.035-.052.025-.038a.4.4 0 0 0 .03-.058l.02-.04.023-.063c.003-.013.01-.027.013-.04q.009-.037.015-.072l.007-.037q.006-.062.007-.117V8.954a1 1 0 0 0-.008-.114m-9.154-4.376 6.751 4.49-3.016 2.013-3.735-2.492zm-1.724 0v4.009l-3.735 2.494-3.014-2.013zm-7.439 6.098L5.853 12l-2.155 1.438zm7.439 8.974-6.749-4.491 3.015-2.011 3.735 2.492zM12 14.035 8.953 12 12 9.966 15.047 12zm.862 5.501v-4.009l3.735-2.492 3.016 2.011zm7.441-6.098L18.147 12l2.156-1.438z"})))},{name:"deezer",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20.129 3.662c.222-1.287.548-2.096.909-2.098h.001c.673.002 1.219 2.809 1.219 6.274s-.546 6.274-1.22 6.274c-.276 0-.531-.477-.736-1.276-.324 2.926-.997 4.937-1.776 4.937-.603 0-1.144-1.208-1.507-3.114-.248 3.624-.872 6.195-1.602 6.195-.458 0-.875-1.019-1.184-2.678C13.861 21.6 13.003 24 12.002 24s-1.861-2.399-2.231-5.824c-.307 1.659-.724 2.678-1.184 2.678-.73 0-1.352-2.571-1.602-6.195-.363 1.905-.903 3.114-1.507 3.114-.778 0-1.452-2.011-1.776-4.937-.204.802-.46 1.276-.736 1.276-.674 0-1.22-2.809-1.22-6.274s.546-6.274 1.22-6.274c.362 0 .685.812.91 2.098.357-2.22.94-3.662 1.6-3.662.784 0 1.463 2.04 1.784 5.002.314-2.156.791-3.53 1.325-3.53.749 0 1.385 2.703 1.621 6.474.443-1.933 1.085-3.146 1.795-3.146s1.352 1.214 1.795 3.146c.237-3.771.872-6.474 1.621-6.474.533 0 1.009 1.374 1.325 3.53.321-2.962 1-5.002 1.784-5.002.658 0 1.244 1.443 1.603 3.662M0 7.221c0-1.549.31-2.805.692-2.805s.692 1.256.692 2.805-.31 2.805-.692 2.805S0 8.77 0 7.221m22.616 0c0-1.549.31-2.805.692-2.805S24 5.672 24 7.221s-.31 2.805-.692 2.805-.692-1.256-.692-2.805"})))},{name:"discord",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20.33 4.523A20 20 0 0 0 15.379 3a14 14 0 0 0-.634 1.289 18.4 18.4 0 0 0-5.495 0A14 14 0 0 0 8.615 3 20 20 0 0 0 3.66 4.527C.527 9.163-.323 13.684.102 18.141a20 20 0 0 0 6.073 3.049 14.7 14.7 0 0 0 1.301-2.097 13 13 0 0 1-2.048-.978q.258-.189.502-.378a14.27 14.27 0 0 0 12.142 0q.247.202.502.378a13 13 0 0 1-2.052.98 14.5 14.5 0 0 0 1.301 2.095 19.9 19.9 0 0 0 6.076-3.047c.498-5.168-.851-9.648-3.568-13.62M8.013 15.4c-1.183 0-2.161-1.074-2.161-2.395S6.796 10.6 8.01 10.6s2.183 1.083 2.163 2.405S9.22 15.4 8.013 15.4m7.974 0c-1.186 0-2.16-1.074-2.16-2.395s.944-2.405 2.16-2.405 2.178 1.083 2.157 2.405-.951 2.395-2.158 2.395"})))},{name:"dribbble",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10m8.434-8.631c-.292-.092-2.644-.794-5.32-.365 1.117 3.07 1.572 5.57 1.659 6.09a8.56 8.56 0 0 0 3.661-5.725m-5.098 6.507c-.127-.749-.623-3.361-1.822-6.477l-.056.019c-4.818 1.679-6.547 5.02-6.701 5.334A8.5 8.5 0 0 0 12 20.555a8.5 8.5 0 0 0 3.336-.679m-9.682-2.152c.193-.331 2.538-4.213 6.943-5.637q.167-.054.337-.102a29 29 0 0 0-.692-1.45c-4.266 1.277-8.405 1.223-8.778 1.216a8.497 8.497 0 0 0 2.19 5.973m-2.015-7.46c.382.005 3.901.02 7.897-1.041a55 55 0 0 0-3.167-4.94 8.57 8.57 0 0 0-4.73 5.981m6.359-6.555a46 46 0 0 1 3.187 5c3.037-1.138 4.323-2.867 4.477-3.085a8.51 8.51 0 0 0-7.664-1.915m8.614 2.903c-.18.243-1.612 2.078-4.77 3.367a27 27 0 0 1 .751 1.678c2.842-.357 5.666.215 5.948.275a8.5 8.5 0 0 0-1.929-5.32"})))},{name:"dropbox",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 6.134 6.069 9.797 2 6.54l5.883-3.843zm-10 6.92 5.883 3.843L12 13.459 6.069 9.797zm10 .405 4.116 3.439L22 13.054l-4.069-3.257zM22 6.54l-5.884-3.843L12 6.134l5.931 3.663zm-9.989 7.66-4.129 3.426-1.767-1.153v1.291l5.896 3.539 5.897-3.539v-1.291l-1.769 1.153z"})))},{name:"eventbrite",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M18.041 3.931 5.959 3A2.96 2.96 0 0 0 3 5.959v12.083A2.96 2.96 0 0 0 5.959 21l12.083-.931C19.699 19.983 21 18.744 21 17.11V6.89c0-1.634-1.259-2.863-2.959-2.959M16.933 8.17c-.082.215-.192.432-.378.551-.188.122-.489.132-.799.132-1.521 0-3.062-.048-4.607-.048q-.23 1.061-.451 2.128c.932-.004 1.873.005 2.81.005.726 0 1.462-.069 1.586.525.04.189-.001.426-.052.615-.105.38-.258.676-.625.783-.185.054-.408.058-.646.058-1.145 0-2.345.017-3.493.02-.169.772-.328 1.553-.489 2.333 1.57-.005 3.067-.041 4.633-.058.627-.007 1.085.194 1.009.85a2.2 2.2 0 0 1-.211.725c-.102.208-.248.376-.488.452-.237.075-.541.064-.862.078-.304.014-.614.008-.924.016-.309.009-.619.022-.919.022-1.253 0-2.429.08-3.683.073-.603-.004-1.014-.249-1.124-.757-.059-.273-.018-.58.036-.841a3543 3543 0 0 1 1.629-7.763c.056-.265.114-.511.225-.714a1.24 1.24 0 0 1 .79-.62c.368-.099.883-.047 1.344-.047.305 0 .612.008.914.016.925.026 1.817.03 2.747.053.304.007.615.016.915.016.621 0 1.17.073 1.245.614.039.288-.051.567-.132.783"})))},{name:"facebook",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10"})))},{name:"fediverse",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 743 743"},React.createElement("g",null,React.createElement("path",{d:"M181.131 275.137a68.9 68.9 0 0 1-29.465 29.328l161.758 162.389 38.998-19.764zm213.363 214.187-38.998 19.764 81.963 82.283a68.9 68.9 0 0 1 29.471-29.332zM581.646 339.391l-91.576 46.41 6.752 43.189 103.616-52.513a68.9 68.9 0 0 1-18.792-37.086m-144.738 73.351L220.383 522.477a68.9 68.9 0 0 1 18.795 37.089L443.66 455.934zM367.275 142.438l-104.48 203.97 30.848 30.967 110.623-215.957a68.9 68.9 0 0 1-36.991-18.98M235.621 399.459l-52.922 103.314a68.9 68.9 0 0 1 36.987 18.979l46.781-91.328zM150.768 304.918a68.9 68.9 0 0 1-34.416 7.195 69 69 0 0 1-6.651-.695l30.903 197.662a68.9 68.9 0 0 1 34.416-7.195 69 69 0 0 1 6.646.695zM239.342 560.545c.707 4.589.949 9.239.72 13.877a68.9 68.9 0 0 1-7.267 27.18l197.629 31.712c-.708-4.59-.95-9.24-.723-13.878a68.9 68.9 0 0 1 7.27-27.178zM601.133 377.199l-91.219 178.082a68.9 68.9 0 0 1 36.994 18.983l91.217-178.08a68.9 68.9 0 0 1-36.992-18.985M476.723 125.33a68.9 68.9 0 0 1-29.471 29.332l141.266 141.811a68.9 68.9 0 0 1 29.468-29.332zM347.787 104.631l-178.576 90.498a68.9 68.9 0 0 1 18.793 37.086l178.574-90.502a68.9 68.9 0 0 1-18.791-37.082M446.926 154.826a68.9 68.9 0 0 1-34.983 7.483 69 69 0 0 1-6.029-.633l15.818 101.291 43.163 6.926zm-16 167.028 37.4 239.482a68.9 68.9 0 0 1 33.914-6.943q3.625.206 7.207.791L474.09 328.777zM188.131 232.975c.734 4.66.988 9.383.758 14.095a68.9 68.9 0 0 1-7.16 26.983l101.369 16.281 19.923-38.908zm173.736 27.9-19.926 38.912 239.514 38.467a69 69 0 0 1-.695-13.719 68.9 68.9 0 0 1 7.349-27.324z"}),React.createElement("path",{fillOpacity:".996",d:"M412.284 156.054c34.538 1.882 64.061-24.592 65.943-59.13s-24.592-64.062-59.131-65.943c-34.538-1.882-64.061 24.592-65.943 59.13s24.593 64.062 59.131 65.943M646.144 390.82c34.538 1.881 64.062-24.593 65.943-59.131s-24.592-64.061-59.13-65.943-64.062 24.593-65.943 59.131 24.592 64.061 59.13 65.943M495.086 685.719c34.538 1.881 64.062-24.592 65.943-59.13s-24.592-64.062-59.13-65.943-64.062 24.592-65.943 59.13 24.592 64.062 59.13 65.943M167.866 633.211c34.538 1.882 64.062-24.592 65.943-59.13s-24.592-64.062-59.13-65.943-64.062 24.592-65.943 59.13 24.592 64.062 59.13 65.943M116.692 305.86c34.538 1.882 64.062-24.592 65.943-59.13s-24.592-64.062-59.131-65.943c-34.538-1.881-64.061 24.592-65.943 59.13s24.593 64.062 59.131 65.943"})))},{name:"feed",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M2 8.667V12c5.515 0 10 4.485 10 10h3.333c0-7.363-5.97-13.333-13.333-13.333M2 2v3.333c9.19 0 16.667 7.477 16.667 16.667H22C22 10.955 13.045 2 2 2m2.5 15a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"})))},{name:"flickr",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5m11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5"})))},{name:"foursquare",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M17.573 2H6.905C5.434 2 5 3.107 5 3.805v16.948c0 .785.422 1.077.66 1.172.238.097.892.177 1.285-.275 0 0 5.035-5.843 5.122-5.93.132-.132.132-.132.262-.132h3.26c1.368 0 1.588-.977 1.732-1.552.078-.318.692-3.428 1.225-6.122l.675-3.368C19.56 2.893 19.14 2 17.573 2m-1.078 5.22c-.053.252-.372.518-.665.518h-4.157c-.467 0-.802.318-.802.787v.508c0 .467.337.798.805.798h3.528c.331 0 .655.362.583.715s-.407 2.102-.448 2.295c-.04.193-.262.523-.655.523h-2.88c-.523 0-.683.068-1.033.503-.35.437-3.505 4.223-3.505 4.223-.032.035-.063.027-.063-.015V4.852c0-.298.26-.648.648-.648h8.562c.315 0 .61.297.528.683z"})))},{name:"ghost",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M10.203 20.997H3.005v-3.599h7.198zm10.792-3.599h-7.193v3.599h7.193zm.003-7.198H3v3.599h17.998zm-7.195-7.197H3.005v3.599h10.798zm7.197 0h-3.599v3.599H21z"})))},{name:"git",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M23.519 10.947 13.053.482a1.543 1.543 0 0 0-2.183 0L8.696 2.656l2.756 2.756a1.83 1.83 0 0 1 1.886.439 1.84 1.84 0 0 1 .436 1.898l2.656 2.657a1.83 1.83 0 0 1 1.899.436 1.837 1.837 0 0 1 0 2.597 1.84 1.84 0 0 1-2.599 0 1.84 1.84 0 0 1-.4-1.998l-2.478-2.477v6.521a1.837 1.837 0 0 1 .485 2.945 1.837 1.837 0 0 1-2.597 0 1.837 1.837 0 0 1 0-2.598 1.8 1.8 0 0 1 .602-.401V8.85a1.8 1.8 0 0 1-.602-.4 1.84 1.84 0 0 1-.395-2.009L7.628 3.723.452 10.898a1.544 1.544 0 0 0 0 2.184l10.467 10.467a1.544 1.544 0 0 0 2.183 0l10.417-10.418a1.546 1.546 0 0 0 0-2.184"})))},{name:"github",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.419 2.865 8.166 6.839 9.489.5.09.682-.218.682-.484 0-.236-.009-.866-.014-1.699-2.782.602-3.369-1.34-3.369-1.34-.455-1.157-1.11-1.465-1.11-1.465-.909-.62.069-.608.069-.608 1.004.071 1.532 1.03 1.532 1.03.891 1.529 2.341 1.089 2.91.833.091-.647.349-1.086.635-1.337-2.22-.251-4.555-1.111-4.555-4.943 0-1.091.39-1.984 1.03-2.682-.103-.254-.447-1.27.097-2.646 0 0 .84-.269 2.75 1.025A9.6 9.6 0 0 1 12 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.748-1.025 2.748-1.025.546 1.376.202 2.394.1 2.646.64.699 1.026 1.591 1.026 2.682 0 3.841-2.337 4.687-4.565 4.935.359.307.679.917.679 1.852 0 1.335-.012 2.415-.012 2.741 0 .269.18.579.688.481A10 10 0 0 0 22 12c0-5.523-4.477-10-10-10"})))},{name:"google-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m-.05 16c-3.312 0-6-2.688-6-6s2.688-6 6-6c1.62 0 2.976.594 4.014 1.566L14.26 9.222c-.432-.408-1.188-.888-2.31-.888-1.986 0-3.606 1.65-3.606 3.672s1.62 3.672 3.606 3.672c2.298 0 3.144-1.59 3.3-2.532h-3.306v-2.238h5.616c.084.378.15.732.15 1.23 0 3.426-2.298 5.862-5.76 5.862"})))},{name:"google-plus-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M8 11h6.61c.06.35.11.7.11 1.16 0 4-2.68 6.84-6.72 6.84-3.87 0-7-3.13-7-7s3.13-7 7-7c1.89 0 3.47.69 4.69 1.83l-1.9 1.83c-.52-.5-1.43-1.08-2.79-1.08-2.39 0-4.34 1.98-4.34 4.42S5.61 16.42 8 16.42c2.77 0 3.81-1.99 3.97-3.02H8zm15 0h-2V9h-2v2h-2v2h2v2h2v-2h2"})))},{name:"google-plus",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m-1.919 14.05a4.051 4.051 0 0 1 0-8.1c1.094 0 2.009.401 2.709 1.057l-1.15 1.118a2.23 2.23 0 0 0-1.559-.599c-1.341 0-2.434 1.114-2.434 2.479s1.094 2.479 2.434 2.479c1.551 0 2.122-1.073 2.227-1.709h-2.232v-1.511h3.791c.057.255.101.494.101.83.001 2.312-1.55 3.956-3.887 3.956M19 12.75h-1.25V14h-1.5v-1.25H15v-1.5h1.25V10h1.5v1.25H19z"})))},{name:"google",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.02 10.18v3.73h5.51c-.26 1.57-1.67 4.22-5.5 4.22-3.31 0-6.01-2.75-6.01-6.12s2.7-6.12 6.01-6.12c1.87 0 3.13.8 3.85 1.48l2.84-2.76C16.99 2.99 14.73 2 12.03 2c-5.52 0-10 4.48-10 10s4.48 10 10 10c5.77 0 9.6-4.06 9.6-9.77 0-.83-.11-1.42-.25-2.05z"})))},{name:"instagram",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 4.622c2.403 0 2.688.009 3.637.052.877.04 1.354.187 1.671.31.42.163.72.358 1.035.673s.51.615.673 1.035c.123.317.27.794.31 1.671.043.949.052 1.234.052 3.637s-.009 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.671-.163.42-.358.72-.673 1.035s-.615.51-1.035.673c-.317.123-.794.27-1.671.31-.949.043-1.233.052-3.637.052s-2.688-.009-3.637-.052c-.877-.04-1.354-.187-1.671-.31a2.8 2.8 0 0 1-1.035-.673 2.8 2.8 0 0 1-.673-1.035c-.123-.317-.27-.794-.31-1.671-.043-.949-.052-1.234-.052-3.637s.009-2.688.052-3.637c.04-.877.187-1.354.31-1.671.163-.42.358-.72.673-1.035s.615-.51 1.035-.673c.317-.123.794-.27 1.671-.31.949-.043 1.234-.052 3.637-.052M12 3c-2.444 0-2.751.01-3.711.054-.958.044-1.612.196-2.184.418a4.4 4.4 0 0 0-1.594 1.039c-.5.5-.808 1.002-1.038 1.594-.223.572-.375 1.226-.419 2.184C3.01 9.249 3 9.556 3 12s.01 2.751.054 3.711c.044.958.196 1.612.418 2.185.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.267.054 3.711.054s2.751-.01 3.711-.054c.958-.044 1.612-.196 2.185-.418a4.4 4.4 0 0 0 1.594-1.038c.5-.5.808-1.002 1.038-1.594.222-.572.375-1.227.418-2.185.044-.96.054-1.267.054-3.711s-.01-2.751-.054-3.711c-.044-.958-.196-1.612-.418-2.185A4.4 4.4 0 0 0 19.49 4.51c-.5-.5-1.002-.808-1.594-1.038-.572-.222-1.227-.375-2.185-.418C14.751 3.01 14.444 3 12 3m0 4.378a4.622 4.622 0 1 0 0 9.244 4.622 4.622 0 0 0 0-9.244M12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6m4.804-8.884a1.08 1.08 0 1 0 .001 2.161 1.08 1.08 0 0 0-.001-2.161"})))},{name:"json-feed",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m8.522 17.424.027.027c1.076-1.076 1.854-.993 3.154.306l2.053 2.053c2.136 2.136 4.131 2.028 6.515-.356l.729-.728-1.548-1.548-.373.373c-1.349 1.349-2.293 1.366-3.585.075l-2.409-2.409c-1.242-1.242-2.475-1.366-3.659-.381l-.232-.232c1.01-1.225.911-2.368-.29-3.568l-2.16-2.162c-1.317-1.317-1.308-2.236.058-3.602l.372-.372-1.54-1.54-.728.729c-2.393 2.393-2.525 4.346-.439 6.433l1.78 1.78c1.3 1.3 1.383 2.095.315 3.163l.008.008a1.384 1.384 0 0 0 1.952 1.951"}),React.createElement("circle",{cx:"13.089",cy:"10.905",r:"1.383"}),React.createElement("circle",{cx:"16.349",cy:"7.644",r:"1.383"}),React.createElement("circle",{cx:"19.61",cy:"4.383",r:"1.383"})))},{name:"line",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M14.255 9.572v3.333c0 .084-.066.15-.15.15h-.534a.16.16 0 0 1-.122-.061l-1.528-2.063v1.978c0 .084-.066.15-.15.15h-.534a.15.15 0 0 1-.15-.15V9.576c0-.084.066-.15.15-.15h.529a.14.14 0 0 1 .122.066l1.528 2.063V9.577c0-.084.066-.15.15-.15h.534a.15.15 0 0 1 .155.145m-3.844-.15h-.534a.15.15 0 0 0-.15.15v3.333c0 .084.066.15.15.15h.534c.084 0 .15-.066.15-.15V9.572c0-.08-.066-.15-.15-.15m-1.289 2.794H7.664V9.572a.15.15 0 0 0-.15-.15H6.98a.15.15 0 0 0-.15.15v3.333q0 .062.042.103a.16.16 0 0 0 .103.042h2.142c.084 0 .15-.066.15-.15v-.534a.15.15 0 0 0-.145-.15m7.945-2.794h-2.142c-.08 0-.15.066-.15.15v3.333c0 .08.066.15.15.15h2.142c.084 0 .15-.066.15-.15v-.534a.15.15 0 0 0-.15-.15h-1.458v-.563h1.458c.084 0 .15-.066.15-.15v-.539a.15.15 0 0 0-.15-.15h-1.458v-.563h1.458c.084 0 .15-.066.15-.15v-.534c-.005-.08-.07-.15-.15-.15M22.5 5.33v13.373c-.005 2.1-1.725 3.802-3.83 3.797H5.297c-2.1-.005-3.802-1.73-3.797-3.83V5.297c.005-2.1 1.73-3.802 3.83-3.797h13.373c2.1.005 3.802 1.725 3.797 3.83m-2.888 5.747c0-3.422-3.431-6.206-7.645-6.206s-7.645 2.784-7.645 6.206c0 3.066 2.719 5.634 6.394 6.122.895.192.792.52.591 1.725-.033.192-.155.755.661.413s4.402-2.592 6.009-4.439c1.106-1.219 1.636-2.452 1.636-3.82"})))},{name:"link",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M17 13H7v-2h10zm1-6h-1c-1.631 0-3.065.792-3.977 2H18c1.103 0 2 .897 2 2v2c0 1.103-.897 2-2 2h-4.977c.913 1.208 2.347 2 3.977 2h1a4 4 0 0 0 4-4v-2a4 4 0 0 0-4-4M2 11v2a4 4 0 0 0 4 4h1c1.63 0 3.065-.792 3.977-2H6c-1.103 0-2-.897-2-2v-2c0-1.103.897-2 2-2h4.977C10.065 7.792 8.631 7 7 7H6a4 4 0 0 0-4 4"})))},{name:"linkedin",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.7 3H4.3A1.3 1.3 0 0 0 3 4.3v15.4A1.3 1.3 0 0 0 4.3 21h15.4a1.3 1.3 0 0 0 1.3-1.3V4.3A1.3 1.3 0 0 0 19.7 3M8.339 18.338H5.667v-8.59h2.672zM7.004 8.574a1.548 1.548 0 1 1-.002-3.096 1.548 1.548 0 0 1 .002 3.096m11.335 9.764H15.67v-4.177c0-.996-.017-2.278-1.387-2.278-1.389 0-1.601 1.086-1.601 2.206v4.249h-2.667v-8.59h2.559v1.174h.037c.356-.675 1.227-1.387 2.526-1.387 2.703 0 3.203 1.779 3.203 4.092v4.711z"})))},{name:"mail",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 4.236-8 4.882-8-4.882V6h16z"})))},{name:"mastodon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M11.973 2.352c-2.468.02-4.842.286-6.225.921 0 0-2.742 1.229-2.742 5.415 0 .958-.018 2.105.012 3.32.1 4.094.75 8.128 4.535 9.129 1.745.462 3.244.56 4.45.494 2.19-.122 3.417-.781 3.417-.781l-.072-1.588s-1.565.491-3.32.431c-1.74-.06-3.576-.188-3.858-2.324a4 4 0 0 1-.04-.598s1.709.416 3.874.516c1.324.06 2.563-.076 3.824-.226 2.418-.29 4.524-1.78 4.79-3.141.416-2.144.38-5.232.38-5.232 0-4.186-2.74-5.415-2.74-5.415-1.383-.635-3.76-.9-6.227-.921zM9.18 5.622c1.028 0 1.804.395 2.318 1.185l.502.84.5-.84c.514-.79 1.292-1.186 2.32-1.186.888 0 1.605.313 2.15.922q.795.915.794 2.469v5.068h-2.008V9.16c0-1.037-.438-1.562-1.31-1.562-.966 0-1.448.622-1.448 1.857v2.693h-1.996V9.455c0-1.235-.484-1.857-1.45-1.857-.872 0-1.308.525-1.308 1.562v4.92H6.236V9.012q-.001-1.554.793-2.469c.547-.609 1.263-.922 2.15-.922"})))},{name:"medium-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{fillRule:"nonzero",d:"M7.423 6c3.27 0 5.922 2.686 5.922 6s-2.651 6-5.922 6S1.5 15.313 1.5 12s2.652-6 5.923-6m9.458.351c1.635 0 2.961 2.53 2.961 5.65 0 3.118-1.325 5.648-2.96 5.648S13.92 15.119 13.92 12s1.325-5.649 2.96-5.649m4.577.589c.576 0 1.042 2.265 1.042 5.06s-.466 5.06-1.042 5.06c-.575 0-1.04-2.265-1.04-5.06s.465-5.06 1.04-5.06"})))},{name:"medium",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M3 3v18h18V3zm15 4.26-1 .93a.28.28 0 0 0-.11.27v6.8a.27.27 0 0 0 .11.27l.94.93v.2h-4.75v-.2l1-1c.09-.1.09-.12.09-.27V9.74l-2.71 6.9h-.37L8 9.74v4.62a.67.67 0 0 0 .17.54l1.27 1.54v.2H5.86v-.2l1.27-1.54a.64.64 0 0 0 .17-.54V9a.5.5 0 0 0-.16-.4L6 7.26v-.2h3.52L12.23 13l2.38-5.94H18z"})))},{name:"messenger",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.026.375C5.462.375.375 5.172.375 11.652c0 3.389 1.393 6.318 3.66 8.341.391.352.311.556.377 2.73a.934.934 0 0 0 1.307.823c2.48-1.092 2.512-1.178 2.933-1.064 7.185 1.977 14.973-2.621 14.973-10.83 0-6.48-5.035-11.277-11.599-11.277m6.996 8.678L15.6 14.47a1.75 1.75 0 0 1-2.527.465l-2.723-2.038a.7.7 0 0 0-.844 0l-3.674 2.786c-.49.372-1.133-.216-.802-.735l3.422-5.417a1.75 1.75 0 0 1 2.527-.465l2.722 2.037a.7.7 0 0 0 .844 0L18.22 8.32c.489-.374 1.132.213.801.732"})))},{name:"microblog",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.641 17.086c1.294-1.522 2.067-3.438 2.067-5.521 0-4.957-4.371-8.972-9.763-8.972s-9.763 4.015-9.763 8.972 4.371 8.972 9.763 8.972a10.5 10.5 0 0 0 3.486-.59.315.315 0 0 1 .356.112c.816 1.101 2.09 1.876 3.506 2.191a.194.194 0 0 0 .192-.309 3.82 3.82 0 0 1 .162-4.858zm-3.065-6.575-2.514 1.909.912 3.022a.286.286 0 0 1-.437.317l-2.592-1.802-2.592 1.802a.285.285 0 0 1-.436-.317l.912-3.022-2.515-1.909a.285.285 0 0 1 .167-.513l3.155-.066 1.038-2.981a.285.285 0 0 1 .539 0l1.038 2.981 3.155.066a.285.285 0 0 1 .17.513"})))},{name:"nextdoor",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",strokeMiterlimit:"10",viewBox:"0 0 130 130"},React.createElement("g",null,React.createElement("path",{d:"M64.25 3.531c-31.144.337-57.596 24.22-60.469 55.907-3.064 33.799 21.857 63.685 55.657 66.75s63.685-21.857 66.75-55.657-21.857-63.686-55.657-66.75a62 62 0 0 0-6.281-.25m3.938 34.907C82.468 38.438 93.5 48.58 93.5 61.5v27c0 .685-.565 1.25-1.25 1.25H80.906a1.267 1.267 0 0 1-1.25-1.25V63.375c0-5.58-4.309-11.937-11.469-11.937-7.47 0-11.468 6.357-11.468 11.937V88.5c0 .685-.565 1.25-1.25 1.25H44.125c-.68 0-1.219-.57-1.219-1.25V64.156c0-.74-.529-1.364-1.25-1.531-13.13-2.93-15.115-10.285-15.375-21.125-.005-.332.142-.67.375-.906.233-.237.543-.375.875-.375l11.688.062c.66.01 1.187.529 1.218 1.188.13 4.44.438 9.406 4.438 9.406.83 0 1.443-1.179 1.813-1.719 4.41-6.48 12.28-10.718 21.5-10.718"})))},{name:"patreon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20 7.408c-.003-2.299-1.746-4.182-3.79-4.862-2.54-.844-5.888-.722-8.312.453-2.939 1.425-3.862 4.545-3.896 7.656-.028 2.559.22 9.297 3.92 9.345 2.75.036 3.159-3.603 4.43-5.356.906-1.247 2.071-1.599 3.506-1.963 2.465-.627 4.146-2.626 4.142-5.273"})))},{name:"pinterest-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.289 2C6.617 2 3.606 5.648 3.606 9.622c0 1.846 1.025 4.146 2.666 4.878.25.111.381.063.439-.169.044-.175.267-1.029.365-1.428a.37.37 0 0 0-.091-.362c-.54-.63-.975-1.791-.975-2.873 0-2.777 2.194-5.464 5.933-5.464 3.23 0 5.49 2.108 5.49 5.122 0 3.407-1.794 5.768-4.13 5.768-1.291 0-2.257-1.021-1.948-2.277.372-1.495 1.089-3.112 1.089-4.191 0-.967-.542-1.775-1.663-1.775-1.319 0-2.379 1.309-2.379 3.059 0 1.115.394 1.869.394 1.869s-1.302 5.279-1.54 6.261c-.405 1.666.053 4.368.094 4.604.021.126.167.169.25.063.129-.165 1.699-2.419 2.142-4.051.158-.59.817-2.995.817-2.995.43.784 1.681 1.446 3.013 1.446 3.963 0 6.822-3.494 6.822-7.833C20.394 5.112 16.849 2 12.289 2"})))},{name:"pinterest",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.236 2.636 7.855 6.356 9.312-.087-.791-.166-2.005.035-2.869.182-.78 1.173-4.971 1.173-4.971s-.299-.599-.299-1.484c0-1.39.806-2.429 1.809-2.429.853 0 1.265.641 1.265 1.409 0 .858-.546 2.141-.828 3.329-.236.996.499 1.807 1.481 1.807 1.777 0 3.144-1.874 3.144-4.579 0-2.394-1.72-4.068-4.177-4.068-2.845 0-4.515 2.134-4.515 4.34 0 .859.331 1.781.744 2.282a.3.3 0 0 1 .069.287c-.077.316-.246.995-.279 1.134-.044.183-.145.222-.334.134-1.249-.581-2.03-2.407-2.03-3.874 0-3.154 2.292-6.051 6.607-6.051 3.469 0 6.165 2.472 6.165 5.775 0 3.446-2.173 6.22-5.189 6.22-1.013 0-1.966-.526-2.292-1.148l-.623 2.377c-.226.869-.835 1.957-1.243 2.622.936.289 1.93.445 2.961.445 5.523 0 10-4.477 10-10S17.523 2 12 2"})))},{name:"pocket",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.927 4.194A1.82 1.82 0 0 0 20.222 3H3.839a1.823 1.823 0 0 0-1.813 1.814v6.035l.069 1.2c.29 2.73 1.707 5.115 3.899 6.778l.119.089.025.018a9.9 9.9 0 0 0 3.91 1.727 10.06 10.06 0 0 0 4.049-.014.3.3 0 0 0 .064-.023 9.9 9.9 0 0 0 3.753-1.691l.025-.018q.06-.043.119-.089c2.192-1.664 3.609-4.049 3.898-6.778l.069-1.2V4.814a1.8 1.8 0 0 0-.098-.62m-4.235 6.287-4.704 4.512a1.37 1.37 0 0 1-1.898 0l-4.705-4.512a1.371 1.371 0 1 1 1.898-1.979l3.756 3.601 3.755-3.601a1.372 1.372 0 0 1 1.898 1.979"})))},{name:"polldaddy",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.487 2 2 6.487 2 12c0 5.514 4.487 10 10 10 5.514 0 10-4.486 10-10 0-5.513-4.486-10-10-10m.991 1.68c2.361.084 4.657 1.251 6.197 3.136.283.334.541.693.774 1.067a7.78 7.78 0 0 0-6.094-2.94 7.76 7.76 0 0 0-5.896 2.703q-.008.006-.016.014l-.152.159-.031.032a6.12 6.12 0 0 0-1.633 4.165 6.15 6.15 0 0 0 6.143 6.143c.57 0 1.123-.081 1.649-.227-1.849.839-4.131.747-5.926-.324-1.841-1.089-3.171-3.111-3.433-5.313A7.39 7.39 0 0 1 6.69 6.137C8.294 4.5 10.634 3.563 12.991 3.68m3.373 8.519c-.049-2.024-1.587-3.889-3.544-4.174-1.927-.343-3.917.857-4.451 2.661a3.67 3.67 0 0 0 .2 2.653c.39.8 1.067 1.451 1.894 1.759 1.664.654 3.63-.27 4.173-1.863.593-1.58-.396-3.423-1.94-3.776-1.52-.407-3.161.757-3.204 2.243a2.36 2.36 0 0 0 .753 1.879c.501.476 1.23.667 1.871.529a2.07 2.07 0 0 0 1.469-1.134 1.91 1.91 0 0 0-.087-1.767c-.297-.513-.859-.863-1.429-.881a1.7 1.7 0 0 0-1.437.679 1.53 1.53 0 0 0-.18 1.489q.006.016.016.03c.193.634.774 1.1 1.467 1.117a1.6 1.6 0 0 1-.97-.183c-.466-.244-.809-.747-.893-1.29a1.8 1.8 0 0 1 .499-1.539 2.02 2.02 0 0 1 1.58-.606c.593.04 1.159.35 1.517.859.364.496.51 1.156.383 1.773-.116.62-.529 1.174-1.093 1.514a2.52 2.52 0 0 1-1.914.286c-.65-.161-1.226-.606-1.584-1.206a2.83 2.83 0 0 1-.341-2.031c.143-.7.573-1.321 1.176-1.753 1.193-.883 3.056-.751 4.106.411 1.106 1.1 1.327 3.027.406 4.371-.877 1.376-2.74 2.086-4.374 1.594-1.639-.449-2.913-2.079-3.031-3.853-.07-.884.13-1.797.583-2.577.445-.777 1.155-1.432 1.972-1.862 1.64-.88 3.816-.743 5.349.424 1.251.924 2.083 2.42 2.236 4.009l.001.03c0 2.9-2.359 5.26-5.26 5.26a5.2 5.2 0 0 1-1.947-.376 5 5 0 0 0 2.613-.079 4.96 4.96 0 0 0 2.514-1.751c.618-.828.95-1.861.901-2.869M12 21.113c-5.024 0-9.111-4.087-9.111-9.113 0-4.789 3.713-8.723 8.411-9.081a7 7 0 0 0-.397.06c-2.644.453-5.017 2.106-6.32 4.409-1.309 2.301-1.391 5.19-.3 7.527 1.056 2.34 3.253 4.156 5.776 4.553 2.497.44 5.133-.483 6.787-2.301 1.719-1.797 2.269-4.529 1.486-6.796-.583-1.81-1.976-3.331-3.7-4.046 3.417.594 6.174 3.221 6.174 6.781 0 1.004-.241 2.02-.657 2.966-1.498 2.984-4.586 5.041-8.149 5.041"})))},{name:"print",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M9 16h6v2H9zm13 1h-3v3a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2V9a2 2 0 0 1 2-2h1V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v2h1a2 2 0 0 1 2 2zM7 7h10V5H7zm10 7H7v6h10zm3-3.5a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 20 10.5"})))},{name:"quora",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M47.736 16.521c-.41-.81-.898-1.631-1.846-1.631a1 1 0 0 0-.527.107l-.322-.644a2.93 2.93 0 0 1 1.836-.595c1.26 0 1.914.605 2.431 1.397a6.8 6.8 0 0 0 .449-2.675c0-2.773-.869-4.199-2.929-4.199-1.992 0-2.851 1.465-2.851 4.199s.859 4.17 2.851 4.17a4 4 0 0 0 .869-.107zm.498.966a6 6 0 0 1-1.367.185 5.27 5.27 0 0 1-5.263-5.204c0-3.114 2.558-5.233 5.263-5.233s5.282 2.109 5.282 5.233a5.08 5.08 0 0 1-1.992 4.072c.381.566.781.956 1.319.956.595 0 .839-.459.878-.82h.781c.049.488-.195 2.48-2.373 2.48-1.319 0-2.012-.761-2.529-1.66zm5.624-2.646v-3.563c0-.371-.146-.586-.615-.586h-.498v-.956h3.251v5.048c0 .849.459 1.231 1.161 1.231a1.56 1.56 0 0 0 1.465-.839V11.28c0-.371-.146-.586-.615-.586h-.527v-.957h3.28v5.302c0 .527.195.732.8.732h.107v.976l-2.929.468V16.21h-.057a3.12 3.12 0 0 1-2.509 1.152c-1.28 0-2.304-.644-2.304-2.558zm12.059 1.611c1.152 0 1.592-1.005 1.611-3.027.02-1.982-.459-2.929-1.611-2.929-1.005 0-1.641.956-1.641 2.929 0 2.021.625 3.027 1.641 3.027m0 .956a3.906 3.906 0 0 1-3.974-3.974c0-2.334 1.836-3.886 3.974-3.886 2.226 0 4.004 1.582 4.004 3.886a3.867 3.867 0 0 1-4.004 3.974m4.072-.146v-.956h.312c.781 0 .859-.224.859-.908v-4.121c0-.371-.215-.586-.732-.586h-.42v-.955h2.968l.146 1.553h.108c.371-1.113 1.221-1.699 2.051-1.699.693 0 1.221.39 1.221 1.181 0 .547-.264 1.093-1.005 1.093-.664 0-.8-.449-1.358-.449-.488 0-.869.468-.869 1.152v2.783c0 .673.166.908.937.908h.439v.956h-4.658zm9.901-1.093c.956 0 1.338-.898 1.338-1.797v-1.211c-.732.722-2.304.742-2.304 2.021 0 .625.371.986.966.986m1.387 0c-.39.752-1.191 1.26-2.314 1.26-1.309 0-2.148-.732-2.148-1.914 0-2.451 3.417-1.797 4.423-3.427v-.185c0-1.25-.488-1.445-1.035-1.445-1.524 0-.83 1.631-2.226 1.631-.673 0-.937-.371-.937-.859 0-.927 1.093-1.67 3.173-1.67 1.963 0 3.163.537 3.163 2.49v3.114q-.02.742.595.742a1 1 0 0 0 .449-.127l.254.615c-.205.312-.752.869-1.836.869-.908 0-1.465-.42-1.543-1.113h-.01zm-68.554 2.558c-.83-1.641-1.807-3.3-3.711-3.3a2.9 2.9 0 0 0-1.093.215l-.644-1.299a5.66 5.66 0 0 1 3.662-1.211c2.548 0 3.857 1.231 4.892 2.792q.917-2.012.908-5.38c0-5.585-1.748-8.417-5.829-8.417-4.033 0-5.76 2.87-5.76 8.417s1.738 8.397 5.76 8.397a5.9 5.9 0 0 0 1.748-.224zm.996 1.953a9.8 9.8 0 0 1-2.744.371C5.614 21.041.371 16.764.371 10.545.371 4.277 5.614 0 10.965 0c5.448 0 10.642 4.248 10.642 10.545a10.25 10.25 0 0 1-4.013 8.201c.732 1.152 1.563 1.914 2.665 1.914 1.201 0 1.689-.927 1.768-1.66h1.572c.088.966-.4 4.999-4.775 4.999-2.646 0-4.052-1.543-5.106-3.339z"})))},{name:"reddit",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M22 11.816a2.28 2.28 0 0 0-2.277-2.277c-.593 0-1.122.24-1.526.614-1.481-.965-3.455-1.594-5.647-1.69l1.171-3.702 3.18.748a1.88 1.88 0 0 0 1.876 1.862 1.88 1.88 0 0 0 1.877-1.878 1.88 1.88 0 0 0-1.877-1.877c-.769 0-1.431.466-1.72 1.13l-3.508-.826a.386.386 0 0 0-.46.261l-1.35 4.268c-2.316.038-4.411.67-5.97 1.671a2.24 2.24 0 0 0-1.492-.581A2.28 2.28 0 0 0 2 11.816c0 .814.433 1.523 1.078 1.925a4 4 0 0 0-.061.672c0 3.292 4.011 5.97 8.941 5.97s8.941-2.678 8.941-5.97q-.002-.32-.053-.632A2.26 2.26 0 0 0 22 11.816m-3.224-7.422a1.1 1.1 0 1 1-.001 2.199 1.1 1.1 0 0 1 .001-2.199M2.777 11.816c0-.827.672-1.5 1.499-1.5.313 0 .598.103.838.269-.851.676-1.477 1.479-1.812 2.36a1.48 1.48 0 0 1-.525-1.129m9.182 7.79c-4.501 0-8.164-2.329-8.164-5.193S7.457 9.22 11.959 9.22s8.164 2.329 8.164 5.193-3.663 5.193-8.164 5.193m8.677-6.605c-.326-.89-.948-1.701-1.797-2.384.248-.186.55-.301.883-.301.827 0 1.5.673 1.5 1.5.001.483-.23.911-.586 1.185m-11.64 1.703c-.76 0-1.397-.616-1.397-1.376s.637-1.397 1.397-1.397 1.376.637 1.376 1.397-.616 1.376-1.376 1.376m7.405-1.376c0 .76-.616 1.376-1.376 1.376s-1.399-.616-1.399-1.376.639-1.397 1.399-1.397 1.376.637 1.376 1.397m-1.172 3.38a.39.39 0 0 1 0 .55c-.674.674-1.727 1.002-3.219 1.002l-.011-.002-.011.002c-1.492 0-2.544-.328-3.218-1.002a.389.389 0 1 1 .55-.55c.521.521 1.394.775 2.669.775l.011.002.011-.002c1.275 0 2.148-.253 2.669-.775a.387.387 0 0 1 .549 0"})))},{name:"share",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M18 16c-.788 0-1.499.31-2.034.807L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.048 4.118A3 3 0 0 0 15 19a3 3 0 1 0 3-3"})))},{name:"skype",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m10.113 2.699.1-.02q.05.025.098.051zM2.72 10.223l-.017.103q.025.048.051.095zm18.555 3.548q.009-.053.018-.106-.025-.047-.052-.095zm-7.712 7.428q.049.027.096.053l.105-.017zM22 16.386a5.55 5.55 0 0 1-1.637 3.953 5.55 5.55 0 0 1-3.953 1.637 5.6 5.6 0 0 1-2.75-.725l.105-.017-.202-.035q.049.027.096.053a9.5 9.5 0 0 1-1.654.147 9.4 9.4 0 0 1-3.676-.743 9.4 9.4 0 0 1-3.002-2.023 9.4 9.4 0 0 1-2.023-3.002 9.4 9.4 0 0 1-.743-3.676c0-.546.049-1.093.142-1.628q.025.048.051.095l-.034-.199-.017.103A5.6 5.6 0 0 1 2 7.615c0-1.493.582-2.898 1.637-3.953A5.56 5.56 0 0 1 7.59 2.024c.915 0 1.818.228 2.622.655l-.1.02.199.031q-.049-.026-.098-.051l.004-.001a9.5 9.5 0 0 1 1.788-.169 9.41 9.41 0 0 1 6.678 2.766 9.4 9.4 0 0 1 2.024 3.002 9.4 9.4 0 0 1 .743 3.676c0 .575-.054 1.15-.157 1.712q-.025-.047-.052-.095l.034.201q.009-.053.018-.106c.461.829.707 1.767.707 2.721m-5.183-2.248c0-1.331-.613-2.743-3.033-3.282l-2.209-.49c-.84-.192-1.807-.444-1.807-1.237s.679-1.348 1.903-1.348c2.468 0 2.243 1.696 3.468 1.696.645 0 1.209-.379 1.209-1.031 0-1.521-2.435-2.663-4.5-2.663-2.242 0-4.63.952-4.63 3.488 0 1.221.436 2.521 2.839 3.123l2.984.745c.903.223 1.129.731 1.129 1.189 0 .762-.758 1.507-2.129 1.507-2.679 0-2.307-2.062-3.743-2.062-.645 0-1.113.444-1.113 1.078 0 1.236 1.501 2.886 4.856 2.886 3.195 0 4.776-1.538 4.776-3.599"})))},{name:"sms",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M17.696 4C20.069 4 22 5.973 22 8.398v4.357c0 2.04-1.368 3.783-3.261 4.266v4.427l-5.234-4.295h-7.2C3.93 17.153 2 15.18 2 12.755V8.398C2 5.973 3.931 4 6.304 4zM7.028 8.515c-.98 0-1.66.562-1.66 1.349-.009.497.322.91.985 1.178l.39.142c.242.097.305.171.305.297 0 .162-.131.251-.442.251s-.76-.135-1.004-.284l-.112.046-.215.868c.359.258.832.364 1.33.364 1.104 0 1.764-.523 1.764-1.333-.008-.574-.305-.956-.954-1.216l-.393-.146c-.266-.108-.341-.181-.341-.287 0-.152.131-.243.387-.243.274 0 .587.093.808.214l.109-.047.214-.837c-.315-.224-.741-.316-1.171-.316m10.302 0c-.98 0-1.66.562-1.66 1.349-.008.497.322.91.985 1.178l.39.142c.243.097.305.171.305.297 0 .162-.13.251-.442.251-.311 0-.76-.135-1.004-.284l-.112.046-.215.868c.359.258.832.364 1.33.364 1.104 0 1.764-.523 1.764-1.333-.008-.574-.305-.956-.954-1.216l-.393-.146c-.266-.108-.341-.181-.341-.287 0-.152.131-.243.387-.243.274 0 .587.093.808.214l.109-.047.214-.837c-.316-.224-.741-.316-1.171-.316m-3.733 0c-.297 0-.55.066-.78.202l-.144.098a2 2 0 0 0-.264.247l-.078.095-.027-.077c-.15-.34-.55-.565-1.033-.565l-.169.007a1.36 1.36 0 0 0-.896.42l-.08.09-.038-.363-.075-.067H8.994l-.075.079.024.634c.005.2.008.397.008.604v2.652l.075.075h1.178l.075-.075v-2.269q-.002-.168.042-.274c.083-.23.262-.392.496-.392.314 0 .483.267.483.753v2.182l.075.075h1.179l.075-.075v-2.277c0-.097.016-.213.043-.285.077-.224.26-.373.486-.373.33 0 .5.272.5.817v2.118l.074.075h1.179l.075-.075v-2.293c0-1.131-.537-1.763-1.39-1.763Z"})))},{name:"snapchat",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M11.989 1.728c3.221.001 5.904 2.683 5.908 5.912q.002 1.133.067 2.094a.737.737 0 0 0 .902.669l1.009-.237a.6.6 0 0 1 .129-.015c.256 0 .492.175.55.434a.74.74 0 0 1-.479.861l-1.532.618a.823.823 0 0 0-.485.98c1.229 4.543 4.661 4.071 4.661 4.662 0 .743-2.587.848-2.821 1.082s-.01 1.368-.532 1.588a1.1 1.1 0 0 1-.409.056c-.393 0-.95-.077-1.536-.077-.509 0-1.04.058-1.507.273-1.239.572-2.433 1.641-3.914 1.641S9.325 21.2 8.086 20.628c-.467-.216-.998-.273-1.507-.273-.586 0-1.143.077-1.536.077-.17 0-.31-.014-.409-.056-.522-.22-.299-1.354-.532-1.588s-2.821-.337-2.821-1.08c0-.592 3.432-.119 4.661-4.662a.824.824 0 0 0-.486-.98l-1.532-.618a.74.74 0 0 1-.479-.861.56.56 0 0 1 .679-.419l1.009.237q.086.02.169.02a.737.737 0 0 0 .733-.689q.065-.961.067-2.094c.004-3.229 2.666-5.91 5.887-5.912m0-1.281c-.961 0-1.898.194-2.784.574A7.2 7.2 0 0 0 6.93 2.572a7.2 7.2 0 0 0-1.539 2.282A7.1 7.1 0 0 0 4.82 7.64a33 33 0 0 1-.029 1.369l-.375-.088a2 2 0 0 0-.421-.049 1.86 1.86 0 0 0-1.135.389 1.84 1.84 0 0 0-.666 1.049 2.024 2.024 0 0 0 1.271 2.335l1.124.454c-.744 2.285-2.117 2.723-3.041 3.018a5 5 0 0 0-.659.246C.087 16.76 0 17.436 0 17.708c0 .521.247.996.694 1.339.223.17.499.311.844.43.47.162 1.016.265 1.459.347.021.164.053.341.106.518.22.738.684 1.069 1.034 1.217.332.14.676.156.905.156.224 0 .462-.018.713-.036.269-.02.548-.041.823-.041.426 0 .743.051.97.155.311.144.64.337.989.542.972.571 2.073 1.217 3.462 1.217s2.49-.647 3.462-1.217c.349-.205.679-.399.989-.542.226-.105.544-.155.97-.155.275 0 .554.021.823.041.251.019.488.036.713.036.229 0 .573-.016.905-.156.35-.147.814-.478 1.034-1.217.053-.178.084-.354.106-.518.443-.082.989-.185 1.459-.347.345-.119.621-.259.844-.43.448-.342.694-.818.694-1.339 0-.272-.087-.948-.891-1.347a5 5 0 0 0-.659-.246c-.924-.295-2.297-.733-3.041-3.018l1.124-.454a2.025 2.025 0 0 0 1.271-2.335 1.83 1.83 0 0 0-.666-1.049 1.86 1.86 0 0 0-1.556-.34l-.375.088a33 33 0 0 1-.029-1.369 7.1 7.1 0 0 0-.575-2.789c-.365-.853-.886-1.62-1.547-2.282s-1.428-1.182-2.28-1.547a7.1 7.1 0 0 0-2.786-.574"})))},{name:"soundcloud",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M23.587 13.923a3.303 3.303 0 0 1-3.344 3.117h-8.037a.674.674 0 0 1-.667-.67V7.717a.74.74 0 0 1 .444-.705s.739-.512 2.296-.512a5.27 5.27 0 0 1 2.702.742 5.35 5.35 0 0 1 2.516 3.485 3.1 3.1 0 0 1 .852-.116 3.217 3.217 0 0 1 3.237 3.312m-13.05-5.659c.242 2.935.419 5.612 0 8.538a.261.261 0 0 1-.519 0c-.39-2.901-.221-5.628 0-8.538a.26.26 0 0 1 .398-.25.26.26 0 0 1 .12.25zm-1.627 8.541a.273.273 0 0 1-.541 0 32.7 32.7 0 0 1 0-7.533.274.274 0 0 1 .544 0 29.4 29.4 0 0 1-.003 7.533m-1.63-7.788c.264 2.69.384 5.099-.003 7.782a.262.262 0 0 1-.522 0c-.374-2.649-.249-5.127 0-7.782a.264.264 0 0 1 .525 0m-1.631 7.792a.268.268 0 0 1-.532 0 27.6 27.6 0 0 1 0-7.034.27.27 0 1 1 .541 0 25.8 25.8 0 0 1-.01 7.034zm-1.63-5.276c.412 1.824.227 3.435-.015 5.294a.255.255 0 0 1-.504 0c-.22-1.834-.402-3.482-.015-5.295a.268.268 0 0 1 .535 0m-1.626-.277c.378 1.869.254 3.451-.01 5.325-.031.277-.506.28-.531 0-.239-1.846-.352-3.476-.01-5.325a.277.277 0 0 1 .551 0m-1.643.907c.396 1.239.261 2.246-.016 3.517a.258.258 0 0 1-.514 0c-.239-1.246-.336-2.274-.021-3.517a.276.276 0 0 1 .55 0z"})))},{name:"spotify",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424a.62.62 0 0 1-.857.207c-2.348-1.435-5.304-1.76-8.785-.964a.622.622 0 1 1-.277-1.215c3.809-.871 7.077-.496 9.713 1.115a.623.623 0 0 1 .206.857M17.81 13.7a.78.78 0 0 1-1.072.257c-2.687-1.652-6.785-2.131-9.965-1.166A.779.779 0 1 1 6.32 11.3c3.632-1.102 8.147-.568 11.234 1.328a.78.78 0 0 1 .256 1.072m.105-2.835c-3.223-1.914-8.54-2.09-11.618-1.156a.935.935 0 1 1-.542-1.79c3.532-1.072 9.404-.865 13.115 1.338a.936.936 0 1 1-.955 1.608"})))},{name:"squarespace",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20.87 9.271a3.86 3.86 0 0 0-5.458 0l-6.141 6.141a.964.964 0 1 0 1.365 1.364l6.14-6.14a1.929 1.929 0 1 1 2.729 2.729l-6.022 6.022a1.93 1.93 0 0 0 2.729 0l4.658-4.658a3.86 3.86 0 0 0 0-5.458m-2.047 2.047a.965.965 0 0 0-1.365 0l-6.14 6.14a1.93 1.93 0 0 1-2.729 0 .964.964 0 1 0-1.364 1.364 3.86 3.86 0 0 0 5.458 0l6.14-6.14a.966.966 0 0 0 0-1.364m-2.047-6.141a3.86 3.86 0 0 0-5.458 0l-6.14 6.14a.964.964 0 1 0 1.364 1.364l6.141-6.14a1.93 1.93 0 0 1 2.729 0 .965.965 0 1 0 1.364-1.364m-2.047 2.047a.964.964 0 0 0-1.364 0l-6.14 6.141a1.929 1.929 0 1 1-2.729-2.729l6.022-6.022a1.93 1.93 0 0 0-2.729 0L3.13 9.271a3.86 3.86 0 0 0 5.458 5.458l6.14-6.141a.963.963 0 0 0 .001-1.364"})))},{name:"stackexchange",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M4 11.606h16v3.272H4zM4 7.377h16v3.272H4zM17.514 3H6.55C5.147 3 4 4.169 4 5.614v.848h16v-.85C20 4.167 18.895 3 17.514 3M4 15.813v.85c0 1.445 1.147 2.614 2.55 2.614h6.799v3.463l3.357-3.463h.744c1.402 0 2.55-1.169 2.55-2.614v-.85z"})))},{name:"stackoverflow",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M18.18 20.103V14.78h1.767v7.09H4v-7.09h1.767v5.323z"}),React.createElement("path",{d:"m7.717 14.275 8.673 1.813.367-1.744-8.673-1.813zm1.147-4.13 8.031 3.74.734-1.606-8.031-3.763zm2.226-3.946 6.815 5.667 1.124-1.354-6.815-5.667zM15.495 2l-1.423 1.055 5.277 7.113 1.423-1.055zM7.533 18.314h8.857v-1.767H7.533z"})))},{name:"stumbleupon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 4.294a4.47 4.47 0 0 0-4.471 4.471v6.353a1.059 1.059 0 1 1-2.118 0v-2.824H2v2.941a4.471 4.471 0 0 0 8.942 0v-6.47a1.059 1.059 0 1 1 2.118 0v1.294l1.412.647 2-.647V8.765A4.473 4.473 0 0 0 12 4.294m1.059 8.059v2.882a4.471 4.471 0 0 0 8.941 0v-2.824h-3.412v2.824a1.059 1.059 0 1 1-2.118 0v-2.882l-2 .647z"})))},{name:"substack",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.904 9.182H4.095V7.054h15.81v2.127M4.095 11.109V21L12 16.583 19.905 21v-9.891zM19.905 3H4.095v2.127h15.81z"})))},{name:"telegram",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m3.08 14.757s-.25.625-.936.325l-2.541-1.949-1.63 1.486s-.127.096-.266.036c0 0-.12-.011-.27-.486s-.911-2.972-.911-2.972L6 12.349s-.387-.137-.425-.438c-.037-.3.437-.462.437-.462l10.03-3.934s.824-.362.824.238z"})))},{name:"threads",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 192 192"},React.createElement("g",null,React.createElement("path",{d:"M141.537 88.988a67 67 0 0 0-2.518-1.143c-1.482-27.307-16.403-42.94-41.457-43.1h-.34c-14.986 0-27.449 6.396-35.12 18.036l13.779 9.452c5.73-8.695 14.724-10.548 21.348-10.548h.229c8.249.053 14.474 2.452 18.503 7.129 2.932 3.405 4.893 8.111 5.864 14.05-7.314-1.243-15.224-1.626-23.68-1.14-23.82 1.371-39.134 15.264-38.105 34.568.522 9.792 5.4 18.216 13.735 23.719 7.047 4.652 16.124 6.927 25.557 6.412 12.458-.683 22.231-5.436 29.049-14.127 5.178-6.6 8.453-15.153 9.899-25.93 5.937 3.583 10.337 8.298 12.767 13.966 4.132 9.635 4.373 25.468-8.546 38.376-11.319 11.308-24.925 16.2-45.488 16.351-22.809-.169-40.06-7.484-51.275-21.742C35.236 139.966 29.808 120.682 29.605 96c.203-24.682 5.63-43.966 16.133-57.317C56.954 24.425 74.204 17.11 97.013 16.94c22.975.17 40.526 7.52 52.171 21.847 5.71 7.026 10.015 15.86 12.853 26.162l16.147-4.308c-3.44-12.68-8.853-23.606-16.219-32.668C147.036 9.607 125.202.195 97.07 0h-.113C68.882.194 47.292 9.642 32.788 28.08 19.882 44.485 13.224 67.315 13.001 95.932L13 96v.067c.224 28.617 6.882 51.447 19.788 67.854C47.292 182.358 68.882 191.806 96.957 192h.113c24.96-.173 42.554-6.708 57.048-21.189 18.963-18.945 18.392-42.692 12.142-57.27-4.484-10.454-13.033-18.945-24.723-24.553M98.44 129.507c-10.44.588-21.286-4.098-21.82-14.135-.397-7.442 5.296-15.746 22.461-16.735q2.948-.17 5.79-.169c6.235 0 12.068.606 17.371 1.765-1.978 24.702-13.58 28.713-23.802 29.274"})))},{name:"tiktok-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M5 3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm7.531 3h2.053s-.114 2.635 2.85 2.82v2.04s-1.582.099-2.85-.87l.021 4.207a3.804 3.804 0 1 1-3.802-3.802h.533v2.082a1.73 1.73 0 0 0-1.922.648 1.727 1.727 0 0 0 1.947 2.646 1.73 1.73 0 0 0 1.19-1.642z"})))},{name:"tiktok",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.22 2h3.42s-.19 4.394 4.75 4.702v3.396s-2.636.166-4.75-1.448l.037 7.012a6.338 6.338 0 1 1-6.34-6.339h.89v3.472a2.882 2.882 0 1 0 2.024 2.752z"})))},{name:"tripadvisor",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.01 9.859c.236-1.002.985-2.003.985-2.003l-3.341-.002C16.779 6.643 14.502 6 11.979 6 9.363 6 7 6.659 5.135 7.877L2 7.88s.74.988.98 1.983a4.98 4.98 0 0 0-.977 2.961 5.01 5.01 0 0 0 5.009 5.003 5 5 0 0 0 3.904-1.875l1.065 1.592 1.076-1.606a4.96 4.96 0 0 0 1.838 1.448 4.98 4.98 0 0 0 3.831.151 5.01 5.01 0 0 0 2.963-6.431 5 5 0 0 0-.679-1.247m-13.998 6.96a4 4 0 0 1-3.998-3.995 4 4 0 0 1 3.998-3.997 4 4 0 0 1 3.996 3.997 4 4 0 0 1-3.996 3.995m4.987-4.36A5.007 5.007 0 0 0 7.11 7.821c1.434-.613 3.081-.947 4.867-.947 1.798 0 3.421.324 4.853.966a4.984 4.984 0 0 0-4.831 4.619m6.288 4.134a3.97 3.97 0 0 1-3.058-.122 3.96 3.96 0 0 1-2.075-2.245v-.001a3.97 3.97 0 0 1 .118-3.056 3.97 3.97 0 0 1 2.246-2.077 4.005 4.005 0 0 1 5.135 2.366 4.006 4.006 0 0 1-2.366 5.135"}),React.createElement("path",{d:"M6.949 10.307a2.477 2.477 0 0 0-2.475 2.472 2.48 2.48 0 0 0 2.475 2.474 2.474 2.474 0 0 0 0-4.946m0 4.094a1.626 1.626 0 0 1-1.624-1.623 1.621 1.621 0 1 1 1.624 1.623M16.981 10.307a2.477 2.477 0 0 0-2.474 2.472 2.48 2.48 0 0 0 2.474 2.474 2.476 2.476 0 0 0 2.472-2.474 2.475 2.475 0 0 0-2.472-2.472m0 4.094a1.625 1.625 0 0 1-1.622-1.623 1.622 1.622 0 1 1 1.622 1.623"}),React.createElement("path",{d:"M7.778 12.778a.832.832 0 1 1-1.664.002.832.832 0 0 1 1.664-.002M16.981 11.947a.832.832 0 1 0 .002 1.666.832.832 0 0 0-.002-1.666"})))},{name:"tumblr-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M16.749 17.396c-.357.17-1.041.319-1.551.332-1.539.041-1.837-1.081-1.85-1.896V9.847h3.861v-2.91h-3.847V2.039h-2.817c-.046 0-.127.041-.138.144-.165 1.499-.867 4.13-3.783 5.181v2.484h1.945v6.282c0 2.151 1.587 5.206 5.775 5.135 1.413-.024 2.982-.616 3.329-1.126z"})))},{name:"tumblr",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m-5.569 14.265c-2.446.042-3.372-1.742-3.372-2.998v-3.668H8.923v-1.45c1.703-.614 2.113-2.15 2.209-3.025.007-.06.054-.084.081-.084h1.645V8.9h2.246v1.7H12.85v3.495c.008.476.182 1.131 1.081 1.107.298-.008.697-.094.906-.194l.54 1.601c-.205.296-1.121.641-1.946.656"})))},{name:"twitch",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M16.499 8.089h-1.636v4.91h1.636zm-4.499 0h-1.637v4.91H12zM4.228 3.178 3 6.451v13.092h4.499V22h2.456l2.454-2.456h3.681L21 14.636V3.178zm15.136 10.638L16.5 16.681H12l-2.453 2.453V16.68H5.863V4.814h13.501z"})))},{name:"twitter-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M22.23 5.924a8.2 8.2 0 0 1-2.357.646 4.12 4.12 0 0 0 1.804-2.27 8.2 8.2 0 0 1-2.606.996 4.103 4.103 0 0 0-6.991 3.742 11.65 11.65 0 0 1-8.457-4.287 4.1 4.1 0 0 0-.556 2.063 4.1 4.1 0 0 0 1.825 3.415 4.1 4.1 0 0 1-1.859-.513v.052a4.104 4.104 0 0 0 3.292 4.023 4.1 4.1 0 0 1-1.853.07 4.11 4.11 0 0 0 3.833 2.85 8.24 8.24 0 0 1-5.096 1.756 8 8 0 0 1-.979-.057 11.6 11.6 0 0 0 6.29 1.843c7.547 0 11.675-6.252 11.675-11.675q0-.267-.012-.531a8.3 8.3 0 0 0 2.047-2.123"})))},{name:"twitter",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m-2.534 6.71q.007.148.007.298c0 3.045-2.318 6.556-6.556 6.556a6.5 6.5 0 0 1-3.532-1.035q.27.032.55.032a4.63 4.63 0 0 0 2.862-.986 2.31 2.31 0 0 1-2.152-1.6 2.3 2.3 0 0 0 1.04-.04 2.306 2.306 0 0 1-1.848-2.259v-.029c.311.173.666.276 1.044.288a2.303 2.303 0 0 1-.713-3.076 6.54 6.54 0 0 0 4.749 2.407 2.305 2.305 0 0 1 3.926-2.101 4.6 4.6 0 0 0 1.463-.559 2.3 2.3 0 0 1-1.013 1.275c.466-.056.91-.18 1.323-.363-.31.461-.7.867-1.15 1.192"})))},{name:"untappd",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m11 13.299-5.824 8.133c-.298.416-.8.635-1.308.572-.578-.072-1.374-.289-2.195-.879S.392 19.849.139 19.323a1.4 1.4 0 0 1 .122-1.425l5.824-8.133a3.1 3.1 0 0 1 1.062-.927l1.146-.604c.23-.121.436-.283.608-.478.556-.631 2.049-2.284 4.696-4.957l.046-.212a.13.13 0 0 1 .096-.1l.146-.037a.135.135 0 0 0 .101-.141l-.015-.18a.13.13 0 0 1 .125-.142c.176-.005.518.046 1.001.393s.64.656.692.824a.13.13 0 0 1-.095.164l-.175.044a.13.13 0 0 0-.101.141l.012.15a.13.13 0 0 1-.063.123l-.186.112c-1.679 3.369-2.764 5.316-3.183 6.046a2.2 2.2 0 0 0-.257.73l-.205 1.281A3.1 3.1 0 0 1 11 13.3zm12.739 4.598-5.824-8.133a3.1 3.1 0 0 0-1.062-.927l-1.146-.605a2.1 2.1 0 0 1-.608-.478 51 51 0 0 0-.587-.654.09.09 0 0 0-.142.018 97 97 0 0 1-1.745 3.223 1.4 1.4 0 0 0-.171.485 3.5 3.5 0 0 0 0 1.103l.01.064c.075.471.259.918.536 1.305l5.824 8.133c.296.413.79.635 1.294.574a4.76 4.76 0 0 0 2.209-.881 4.76 4.76 0 0 0 1.533-1.802 1.4 1.4 0 0 0-.122-1.425zM8.306 3.366l.175.044a.134.134 0 0 1 .101.141l-.012.15a.13.13 0 0 0 .063.123l.186.112q.465.933.869 1.721c.026.051.091.06.129.019q.655-.703 1.585-1.668a.137.137 0 0 0 .003-.19c-.315-.322-.645-.659-1.002-1.02l-.046-.212a.13.13 0 0 0-.096-.099l-.146-.037a.135.135 0 0 1-.101-.141l.015-.18a.13.13 0 0 0-.123-.142c-.175-.005-.518.045-1.002.393-.483.347-.64.656-.692.824a.13.13 0 0 0 .095.164z"})))},{name:"vimeo",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M22.396 7.164q-.139 3.039-4.245 8.32Q13.907 21 10.97 21q-1.82 0-3.079-3.359l-1.68-6.159q-.934-3.36-2.005-3.36-.234.001-1.634.98l-.978-1.261q1.541-1.353 3.037-2.708 2.056-1.774 3.084-1.869 2.429-.234 2.99 3.321.607 3.836.841 4.769.7 3.181 1.542 3.181.653 0 1.963-2.065 1.307-2.063 1.401-3.142.187-1.781-1.401-1.782-.747.001-1.541.341 1.534-5.024 5.862-4.884 3.21.095 3.024 4.161"})))},{name:"vk",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{fillRule:"evenodd",d:"M1.687 1.687C0 3.374 0 6.09 0 11.52v.96c0 5.431 0 8.146 1.687 9.833S6.09 24 11.52 24h.96c5.431 0 8.146 0 9.833-1.687S24 17.91 24 12.48v-.96c0-5.431 0-8.146-1.687-9.833S17.91 0 12.48 0h-.96C6.09 0 3.374 0 1.687 1.687M4.05 7.3c.13 6.24 3.25 9.99 8.72 9.99h.31v-3.57c2.01.2 3.53 1.67 4.14 3.57h2.84c-.78-2.84-2.83-4.41-4.11-5.01 1.28-.74 3.08-2.54 3.51-4.98h-2.58c-.56 1.98-2.22 3.78-3.8 3.95V7.3H10.5v6.92c-1.6-.4-3.62-2.34-3.71-6.92z"})))},{name:"whatsapp",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m2.048 22 1.406-5.136a9.9 9.9 0 0 1-1.323-4.955C2.133 6.446 6.579 2 12.042 2a9.85 9.85 0 0 1 7.011 2.906 9.85 9.85 0 0 1 2.9 7.011c-.002 5.464-4.448 9.91-9.91 9.91h-.004a9.9 9.9 0 0 1-4.736-1.206zm5.497-3.172.301.179a8.2 8.2 0 0 0 4.193 1.148h.003c4.54 0 8.235-3.695 8.237-8.237a8.2 8.2 0 0 0-2.41-5.828 8.18 8.18 0 0 0-5.824-2.416c-4.544 0-8.239 3.695-8.241 8.237a8.2 8.2 0 0 0 1.259 4.384l.196.312-.832 3.04zm9.49-4.554c-.062-.103-.227-.165-.475-.289s-1.465-.723-1.692-.806-.392-.124-.557.124-.64.806-.784.971-.289.186-.536.062-1.046-.385-1.991-1.229c-.736-.657-1.233-1.468-1.378-1.715s-.015-.382.109-.505c.111-.111.248-.289.371-.434.124-.145.165-.248.248-.413s.041-.31-.021-.434-.557-1.343-.763-1.839c-.202-.483-.407-.417-.559-.425-.144-.007-.31-.009-.475-.009a.9.9 0 0 0-.66.31c-.226.248-.866.847-.866 2.066s.887 2.396 1.011 2.562 1.746 2.666 4.23 3.739c.591.255 1.052.408 1.412.522.593.189 1.133.162 1.56.098.476-.071 1.465-.599 1.671-1.177.206-.58.206-1.075.145-1.179"})))},{name:"woocommerce",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19 2H5C3.3 2 2 3.3 2 5v11c0 1.7 1.3 3 3 3h4l6 3-1-3h5c1.7 0 3-1.3 3-3V5c0-1.7-1.3-3-3-3m-1.6 4.5c-.4.8-.8 2.1-1 3.9-.3 1.8-.4 3.1-.3 4.1 0 .3 0 .5-.1.7s-.3.4-.6.4-.6-.1-.9-.4c-1-1-1.8-2.6-2.4-4.6-.7 1.4-1.2 2.4-1.6 3.1-.6 1.2-1.2 1.8-1.6 1.9-.3 0-.5-.2-.8-.7-.5-1.4-1.1-4.2-1.7-8.2 0-.3 0-.5.2-.7.1-.2.4-.3.7-.4.5 0 .9.2.9.8.3 2.3.7 4.2 1.1 5.7l2.4-4.5c.2-.4.4-.6.8-.6q.75 0 .9.9c.3 1.4.6 2.6 1 3.7.3-2.7.8-4.7 1.4-5.9.2-.3.4-.5.7-.5.2 0 .5.1.7.2q.3.3.3.6c0 .3 0 .4-.1.5"})))},{name:"wordpress",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.158 12.786 9.46 20.625a9 9 0 0 0 5.526-.144 1 1 0 0 1-.065-.124zM3.009 12a8.99 8.99 0 0 0 5.067 8.092L3.788 8.341A8.95 8.95 0 0 0 3.009 12m15.06-.454c0-1.112-.399-1.881-.741-2.48-.456-.741-.883-1.368-.883-2.109 0-.826.627-1.596 1.51-1.596q.06.002.116.007A8.96 8.96 0 0 0 12 3.009a8.98 8.98 0 0 0-7.512 4.052c.211.007.41.011.579.011.94 0 2.396-.114 2.396-.114.484-.028.541.684.057.741 0 0-.487.057-1.029.085l3.274 9.739 1.968-5.901-1.401-3.838c-.484-.028-.943-.085-.943-.085-.485-.029-.428-.769.057-.741 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.485-.028.542.684.057.741 0 0-.488.057-1.029.085l3.249 9.665.897-2.996q.684-1.753.684-2.907m1.82-3.86q.06.428.06.924c0 .912-.171 1.938-.684 3.22l-2.746 7.94a8.98 8.98 0 0 0 4.47-7.771 8.9 8.9 0 0 0-1.1-4.313M12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})))},{name:"x",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387z"})))},{name:"xanga",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M9 9h6v6H9zM3 9h6V3H3zm12 0h6V3h-6zm0 12h6v-6h-6zM3 21h6v-6H3z"})))},{name:"youtube",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.8 8.001s-.195-1.378-.795-1.985c-.76-.797-1.613-.801-2.004-.847-2.799-.202-6.997-.202-6.997-.202h-.009s-4.198 0-6.997.202c-.39.047-1.242.051-2.003.847-.6.607-.795 1.985-.795 1.985S2 9.62 2 11.238v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.761.797 1.76.771 2.205.855 1.6.153 6.8.201 6.8.201s4.203-.006 7.001-.209c.391-.047 1.243-.051 2.004-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517c0-1.618-.2-3.237-.2-3.237M9.935 14.594l-.001-5.62 5.404 2.82z"})))}]},8992:(e,t,a)=>{"use strict";a(6072);var c=a(8120),n=a.n(c),r=a(1609);a(1135);r.PureComponent,n().string.isRequired,n().number,n().func,n().string},5973:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(1455),n=a.n(c),r=a(6185),l=a.n(r);const s={fetchWaf:()=>n()({path:"jetpack-protect/v1/waf",method:"GET"}).then(l()),toggleWaf:()=>n()({method:"POST",path:"jetpack-protect/v1/toggle-waf"}),updateWaf:e=>n()({method:"POST",path:"jetpack/v4/waf",data:e}),wafSeen:()=>n()({path:"jetpack-protect/v1/waf-seen",method:"POST"}),wafUpgradeSeen:()=>n()({path:"jetpack-protect/v1/waf-upgrade-seen",method:"POST"}),fetchOnboardingProgress:()=>n()({path:"jetpack-protect/v1/onboarding-progress",method:"GET"}),completeOnboardingSteps:e=>n()({path:"jetpack-protect/v1/onboarding-progress",method:"POST",data:{step_ids:e}}),fetchScanHistory:()=>n()({path:"jetpack-protect/v1/scan-history",method:"GET"})}},1186:(e,t,a)=>{"use strict";a.d(t,{A:()=>_});var c=a(6072),n=a.n(c),r=a(2947),l=a(5918),s=a(9384),i=a(1455),o=a.n(i),m=a(7143),p=a(7723),d=a(3832),u=a(1609),h=a.n(u),g=a(8140),v=a(6516),f=a(7478),E=a(8097),A=a(4962),y=a(3041),w=a(241),k=a(1517),b=a(6062);const __=p.__,_=({children:e})=>{(0,b.A)();const{isSeen:t}=(0,v.A)(),a=(0,m.useSelect)((e=>e(f.a).getNotice())),{refreshPlan:c,startScanOptimistically:i,refreshStatus:p,refreshScanHistory:_}=(0,m.useDispatch)(f.a),{adminUrl:R}=window.jetpackProtectInitialState||{},{run:C,isRegistered:j,hasCheckoutStarted:S}=(0,s.useProductCheckoutWorkflow)({productSlug:g.J3,redirectUrl:(0,d.addQueryArgs)(R,{checkPlan:!0}),siteProductAvailabilityHandler:async()=>o()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((e=>e)),useBlogIdSuffix:!0});return(0,u.useEffect)((()=>{(0,d.getQueryArg)(window.location.search,"checkPlan")&&(i(),setTimeout((()=>{c(),p(!0),_()}),5e3))}),[c,p,_,i]),!j||S?h().createElement(E.A,{onScanAdd:C}):h().createElement(r.A,{moduleName:__("Jetpack Protect","jetpack-protect"),header:h().createElement(A.A,null)},a.message&&h().createElement(y.A,n()({floating:!0,dismissable:!0},a)),h().createElement(l.A,{horizontalSpacing:0},h().createElement(w.A,{className:k.A.navigation},h().createElement(w.o,{link:"/scan",label:__("Scan","jetpack-protect")}),h().createElement(w.o,{link:"/firewall",label:h().createElement(h().Fragment,null,__("Firewall","jetpack-protect"),!1===t&&h().createElement("span",{className:k.A.badge},__("New","jetpack-protect")))}))),e)}},6062:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(9384),n=a(7143),r=a(1609),l=a(7478);const s=()=>{const{isRegistered:e}=(0,c.useConnection)(),{refreshStatus:t,refreshScanHistory:a}=(0,n.useDispatch)(l.a),s=(0,n.useSelect)((e=>e(l.a).getStatus()));(0,r.useEffect)((()=>{e&&!s.status&&(t(),a())}),[e])}},2929:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(6427),n=a(1609),r=a.n(n),l=a(3940);function s({className:e,color:t="#D63638"}){return r().createElement("div",{className:l.A.container},r().createElement(c.SVG,{className:e,width:"127",height:"136",viewBox:"0 0 127 136",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r().createElement(c.G,{filter:"url(#filter0_d_2716_19567)"},r().createElement(c.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M63.4061 36L86.8123 46.4057V61.9177C86.8123 75.141 78.1289 87.6611 65.8844 91.6107C64.2754 92.1298 62.5369 92.1297 60.9279 91.6107C48.6834 87.6611 40 75.141 40 61.9177V46.4057L63.4061 36Z",fill:t}),r().createElement(c.Rect,{x:"59.8953",y:"72.1666",width:"7.02184",height:"7",rx:"3.5",fill:"white"}),r().createElement(c.Path,{d:"M59.9619 51.0626C59.9258 50.4868 60.383 50 60.9599 50H65.8524C66.4293 50 66.8866 50.4868 66.8505 51.0626L65.8056 67.7292C65.7725 68.2562 65.3355 68.6667 64.8075 68.6667H62.0048C61.4769 68.6667 61.0398 68.2562 61.0068 67.7292L59.9619 51.0626Z",fill:"white"})),r().createElement("defs",null,r().createElement("filter",{id:"filter0_d_2716_19567",x:"0",y:"0",width:"126.812",height:"136",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},r().createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),r().createElement("feOffset",{dy:"4"}),r().createElement("feGaussianBlur",{stdDeviation:"20"}),r().createElement("feComposite",{in2:"hardAlpha",operator:"out"}),r().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),r().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2716_19567"}),r().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2716_19567",result:"shape"})))))}},4907:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var c=a(6072),n=a.n(c),r=a(1112),l=a(6427),s=a(1609),i=a.n(s),o=a(3902);function m({children:e,...t}){return i().createElement(l.ButtonGroup,n()({className:o.A["button-group"]},t),e)}m.Button=e=>i().createElement(r.A,e);const p=m},5747:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(6461),n=a(7143),r=a(7723),l=a(7478),s=a(9417),i=a(9370);const __=r.__,o=({children:e})=>{const{checkCredentials:t}=(0,n.useDispatch)(l.a),{credentials:a,credentialsIsFetching:r}=(0,n.useSelect)((e=>({credentials:e(l.a).getCredentials(),credentialsIsFetching:e(l.a).getCredentialsIsFetching()})));return a||r||t(),a?0===a.length?React.createElement(s.A,null):e:React.createElement("div",{className:i.A.loading},React.createElement(c.A,{color:"black",style:{color:"black",marginTop:0,marginLeft:0}}),React.createElement("p",{className:i.A.loading__message},__("Checking credentials…","jetpack-protect")))}},9417:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(7425),n=a(1112),r=a(3924),l=a(7143),s=a(7723),i=a(1609),o=a(7478),m=a(3041),p=a(2148);const __=s.__,d=()=>{const{setModal:e}=(0,l.useDispatch)(o.a),{siteSuffix:t,blogID:a}=window.jetpackProtectInitialState,{checkCredentials:s}=(0,l.useDispatch)(o.a),d=(0,l.useSelect)((e=>e(o.a).getCredentials()));return(0,i.useEffect)((()=>{const e=setInterval((()=>{d&&0!==d.length||s()}),3e3);return()=>clearInterval(e)}),[s,d]),React.createElement(React.Fragment,null,React.createElement(c.Ay,{variant:"title-medium",mb:2},__("Site credentials needed","jetpack-protect")),React.createElement(m.A,{type:"info",message:__("Before Jetpack Protect can auto-fix threats on your site, it needs your server credentials.","jetpack-protect")}),React.createElement(c.Ay,{mb:3},__("Your server credentials allow Jetpack Protect to access the server that’s powering your website. This information is securely saved and only used to perform fix threats detected on your site.","jetpack-protect")),React.createElement(c.Ay,{mb:3},__("Once you’ve entered server credentials, Jetpack Protect will be fixing the selected threats.","jetpack-protect")),React.createElement("div",{className:p.A.footer},React.createElement(n.A,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-protect")),React.createElement(n.A,{isExternalLink:!0,weight:"regular",href:(0,r.A)("jetpack-settings-security-credentials",{site:a??t})},__("Enter server credentials","jetpack-protect"))))}},9627:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(9032),n=a(1609),r=a(1526);const l=e=>{const t=e.lastIndexOf("/");return t>-1?[e.slice(0,t),e.slice(t)]:["",e]},s=({diff:e})=>React.createElement("div",{className:r.A["diff-viewer"]},(0,c.i)(e).map(((e,t)=>React.createElement(n.Fragment,{key:t},React.createElement("div",{key:`file-${t}`,className:r.A["diff-viewer__filename"]},(({oldFileName:e,newFileName:t})=>{const a="a"===e[0]&&"/"===e[1]&&"b"===t[0]&&"/"===t[1],[c,s]=a?[e.slice(2),t.slice(2)]:[e,t];if(c===s){const[e,t]=l(c);return React.createElement(n.Fragment,null,e&&React.createElement("span",{className:r.A["diff-viewer__path-prefix"]},e),React.createElement("span",{className:r.A["diff-viewer__path"]},t))}const i=Math.max(c.length,s.length);for(let e=0,t=0;e{let a=0;return e.lines.map(((c,n)=>React.createElement("div",{key:`${t}-${n}`},"+"===c[0]?" ":e.oldStart+a++)))}))),React.createElement("div",{key:"right-numbers",className:r.A["diff-viewer__line-numbers"]},e.hunks.map(((e,t)=>{let a=0;return e.lines.map(((c,n)=>React.createElement("div",{key:`${t}-${n}`},"-"===c[0]?" ":e.newStart+a++)))}))),React.createElement("div",{className:r.A["diff-viewer__lines"]},e.hunks.map(((e,t)=>e.lines.map(((e,a)=>{const c=e.slice(1).replace(/^\s*$/," "),n=`${t}-${a}`;switch(e[0]){case" ":return React.createElement("div",{key:n},c);case"-":return React.createElement("del",{key:n},c);case"+":return React.createElement("ins",{key:n},c);default:return}}))))))))))},7137:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var c=a(7425),n=a(7723),r=a(1609),l=a.n(r),s=a(5242),i=a(2929),o=a(5165),m=a(2938);const __=n.__;function p({baseErrorMessage:e="",errorMessage:t="",errorCode:a=""}){let n=t?`${t} (${a}).`:e;return n+=" "+__("Try again in a few minutes.","jetpack-protect"),l().createElement(o.A,{main:l().createElement("div",{className:m.A["main-content"]},l().createElement(i.A,{className:m.A["alert-icon-wrapper"],color:"#D63638"}),l().createElement(c.H3,null,e),l().createElement(c.Ay,null,n)),secondary:l().createElement("div",{className:m.A.illustration},l().createElement("img",{src:s,alt:""})),preserveSecondaryOnMobile:!1})}},8955:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var c=a(7425),n=a(1112),r=a(766),l=a(6427),s=a(7143),i=a(6087),o=a(7723),m=a(1609),p=a(8140),d=a(727),u=a(6516),h=a(7478),g=a(5165),v=a(934);const __=o.__,f=()=>{const{setModal:e}=(0,s.useDispatch)(h.a);return React.createElement("div",{className:v.A["standalone-mode-section"]},React.createElement(c.hE,null,__("Standalone mode","jetpack-protect")),React.createElement(c.Ay,{mb:2},__("Learn how you can execute the firewall before WordPress initializes. This mode offers the most protection.","jetpack-protect")),React.createElement(n.A,{variant:"link",isExternalLink:!0,weight:"regular",onClick:t=>{t.preventDefault(),e({type:"STANDALONE_MODE"})}},__("Learn more","jetpack-protect")))},E=()=>{const{config:e,isUpdating:t,toggleShareDebugData:a}=(0,u.A)(),{hasRequiredPlan:n}=(0,d.A)(),{jetpackWafShareDebugData:r}=e||{},{setNotice:o}=(0,s.useDispatch)(h.a),[g,f]=(0,m.useState)({jetpack_waf_share_debug_data:r}),E=(0,m.useCallback)((()=>{f({...g,jetpack_waf_share_debug_data:!g.jetpack_waf_share_debug_data}),a().then((()=>o({type:"success",duration:5e3,dismissable:!0,message:__("Changes saved.","jetpack-protect")}))).catch((()=>{o({type:"error",dismissable:!0,message:(0,i.createInterpolateElement)(__("An error ocurred. Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(l.ExternalLink,{href:n?p.NW:p.pQ})})})}))}),[g,a,o,n]);return(0,m.useEffect)((()=>{f({jetpack_waf_share_debug_data:r})}),[r]),React.createElement("div",{className:v.A["share-data-section"]},React.createElement(c.hE,{mb:2},__(" Share detailed data with Jetpack","jetpack-protect")),React.createElement("div",{className:v.A["footer-checkbox"]},React.createElement(l.CheckboxControl,{checked:Boolean(g.jetpack_waf_share_debug_data),onChange:E,disabled:t}),React.createElement(c.Ay,null,__("Allow Jetpack to collect detailed data from blocked requests to enhance firewall protection and accuracy.","jetpack-protect"))))},A=()=>{const{config:e,isUpdating:t,toggleShareData:a}=(0,u.A)(),{hasRequiredPlan:n}=(0,d.A)(),{jetpackWafShareData:r}=e||{},{setNotice:o}=(0,s.useDispatch)(h.a),[g,f]=(0,m.useState)({jetpack_waf_share_data:r}),E=(0,m.useCallback)((()=>{f({...g,jetpack_waf_share_data:!g.jetpack_waf_share_data}),a().then((()=>o({type:"success",duration:5e3,dismissable:!0,message:__("Changes saved.","jetpack-protect")}))).catch((()=>{o({type:"error",dismissable:!0,message:(0,i.createInterpolateElement)(__("An error ocurred. Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(l.ExternalLink,{href:n?p.NW:p.pQ})})})}))}),[g,a,o,n]);return(0,m.useEffect)((()=>{f({jetpack_waf_share_data:r})}),[r]),React.createElement("div",{className:v.A["share-data-section"]},React.createElement(c.hE,{mb:2},__(" Share basic data with Jetpack","jetpack-protect")),React.createElement("div",{className:v.A["footer-checkbox"]},React.createElement(l.CheckboxControl,{checked:Boolean(g.jetpack_waf_share_data),onChange:E,disabled:t}),React.createElement(c.Ay,null,__("Allow Jetpack to collect basic data from blocked requests to improve firewall protection and accuracy.","jetpack-protect"))))},y=()=>{const{isEnabled:e}=(0,u.A)();return React.createElement(r.A,null,React.createElement(g.A,{main:React.createElement(f,null),secondary:e&&React.createElement(React.Fragment,null,React.createElement(A,null),React.createElement(E,null)),preserveSecondaryOnMobile:!0}))}},9921:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var c=a(1112),n=a(7425),r=a(766),l=a(5918),s=a(8509),i=a(1158),o=a(9384),m=a(6427),p=a(7723),d=a(1113),u=a(748),h=a(1609),g=a.n(h),v=a(8140),f=a(1226),E=a(727),A=a(6516),y=a(1416);const __=p.__,w=()=>{const{adminUrl:e}=window.jetpackProtectInitialState||{},t=e+"#/firewall",{config:{automaticRulesAvailable:a}}=(0,A.A)(),{run:n}=(0,o.useProductCheckoutWorkflow)({productSlug:v.J3,redirectUrl:t,useBlogIdSuffix:!0}),{recordEventHandler:r}=(0,f.A)(),l=r("jetpack_protect_waf_header_get_scan_link_click",n);return g().createElement(c.A,{className:y.A["upgrade-button"],onClick:l},a?__("Upgrade to update automatic security rules","jetpack-protect",0):__("Upgrade to enable automatic firewall protection","jetpack-protect"))},k=({children:e=__("The free version of the firewall does not receive updates to automatic security rules.","jetpack-protect")})=>{const[t,a]=(0,h.useState)(!1),c=(0,h.useCallback)((()=>{a(!0)}),[]),r=(0,h.useCallback)((()=>{a(!1)}),[]);return g().createElement("div",{className:y.A["icon-popover"],onMouseLeave:r,onMouseEnter:c,onClick:c,onFocus:c,onBlur:r,role:"presentation"},g().createElement(d.A,{icon:u.A}),t&&g().createElement(m.Popover,{noArrow:!1,offset:5,inline:!0},g().createElement(n.Ay,{className:y.A["popover-text"],variant:"body-small"},e)))},b=({className:e,text:t="",popover:a=!1,children:c})=>g().createElement("div",{className:y.A["firewall-subheading__content"]},g().createElement(n.Ay,{className:y.A[e],weight:600},t),a&&g().createElement(k,{children:c})),_=({jetpackWafIpBlockListEnabled:e,jetpackWafIpAllowListEnabled:t,hasRequiredPlan:a,automaticRulesAvailable:c,jetpackWafAutomaticRules:n,bruteForceProtectionIsEnabled:r,wafSupported:l})=>{const s=e||t,i=l&&n&&s,o=l&&n&&!s,m=l&&!n&&s,p=l&&!n&&!s;return g().createElement(g().Fragment,null,g().createElement("div",{className:y.A["firewall-subheading"]},l&&r&&g().createElement(b,{className:"brute-force-protection-subheading",text:__("Brute force protection is active.","jetpack-protect")}),p&&g().createElement(b,{text:__("There are no firewall rules applied.","jetpack-protect")}),o&&g().createElement(b,{text:__("Automatic firewall protection is enabled.","jetpack-protect"),popover:!a}),m&&g().createElement(b,{text:__("Only manual IP list rules apply.","jetpack-protect"),popover:!a&&!c,children:__("The free version of the firewall only allows for use of manual rules.","jetpack-protect")}),i&&g().createElement(b,{text:__("All firewall rules apply.","jetpack-protect"),popover:!a})),!a&&l&&g().createElement(w,null))},R=({status:e,hasRequiredPlan:t,automaticRulesEnabled:a,automaticRulesAvailable:c,jetpackWafIpBlockListEnabled:o,jetpackWafIpAllowListEnabled:p,jetpackWafAutomaticRules:d,bruteForceProtectionIsEnabled:u,wafSupported:h,standaloneMode:v})=>g().createElement(r.A,null,g().createElement(l.A,{className:y.A["firewall-header"],horizontalSpacing:7,horizontalGap:0},g().createElement(s.A,null,"on"===e&&g().createElement(g().Fragment,null,g().createElement(i.A,{status:"active",label:v?__("Standalone mode","jetpack-protect"):__("Active","jetpack-protect",0)})," ",g().createElement(n.H3,{className:y.A["firewall-heading"],mb:1,mt:2},!h&&__("Brute force protection is active","jetpack-protect"),h&&(a?__("Automatic firewall is on","jetpack-protect"):__("Firewall is on","jetpack-protect",0))),g().createElement(_,{jetpackWafIpBlockListEnabled:o,jetpackWafIpAllowListEnabled:p,jetpackWafAutomaticRules:d,bruteForceProtectionIsEnabled:u,hasRequiredPlan:t,automaticRulesAvailable:c,wafSupported:h})),"off"===e&&g().createElement(g().Fragment,null,g().createElement(i.A,{status:"inactive",label:__("Inactive","jetpack-protect")}),g().createElement(n.H3,{className:y.A["firewall-heading"],mb:1,mt:2},!h&&__("Brute force protection is disabled","jetpack-protect"),h&&(c?__("Automatic firewall is off","jetpack-protect"):__("Firewall is off","jetpack-protect",0))),g().createElement(_,{jetpackWafIpBlockListEnabled:o,jetpackWafIpAllowListEnabled:p,jetpackWafAutomaticRules:d,bruteForceProtectionIsEnabled:u,hasRequiredPlan:t,automaticRulesAvailable:c,wafSupported:h})),"loading"===e&&g().createElement(g().Fragment,null,g().createElement(m.Spinner,{className:y.A.spinner}),g().createElement(n.H3,{className:y.A["firewall-heading"],mb:2,mt:2},__("Automatic firewall is being set up","jetpack-protect")),g().createElement(n.Ay,{className:y.A["loading-text"],weight:600},__("Please wait…","jetpack-protect")))),g().createElement(s.A,null,g().createElement("div",{className:y.A["stat-card-wrapper"]})))),C=()=>{const{config:{jetpackWafAutomaticRules:e,jetpackWafIpBlockListEnabled:t,jetpackWafIpAllowListEnabled:a,standaloneMode:c,automaticRulesAvailable:n,bruteForceProtection:r},isToggling:l,wafSupported:s,isEnabled:i}=(0,A.A)(),{hasRequiredPlan:o}=(0,E.A)(),m=(s?i:r)?"on":"off";return g().createElement(R,{status:l?"loading":m,hasRequiredPlan:o,automaticRulesEnabled:e,automaticRulesAvailable:n,jetpackWafIpBlockListEnabled:t,jetpackWafIpAllowListEnabled:a,jetpackWafAutomaticRules:e,bruteForceProtectionIsEnabled:r,wafSupported:s,standaloneMode:c})}},8680:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(7425),n=a(1112),r=a(7143),l=a(7723),s=a(1609),i=a(7478),o=a(5747),m=a(1571),p=a(4031),d=a(4047);const __=l.__,u=({threatList:e=[]})=>{const{setModal:t,fixThreats:a}=(0,r.useDispatch)(i.a),{threatsUpdating:l}=(0,r.useSelect)((e=>e(i.a).getThreatsUpdating())),[u,h]=(0,s.useState)(e.map((({id:e})=>e))),g=(0,s.useCallback)(((e,t)=>{h(e?[...u,t.id]:u.filter((e=>e!==t.id)))}),[u]);return React.createElement(p.A,null,React.createElement(o.A,null,React.createElement(c.Ay,{variant:"title-medium",mb:2},__("Fix all threats","jetpack-protect")),React.createElement(c.Ay,{mb:3},__("Jetpack will be fixing the selected threats:","jetpack-protect")),React.createElement("div",{className:d.A.list},e.map((e=>React.createElement(m.A,{key:e.id,threat:e,fixAllDialog:!0,onCheckFix:g})))),React.createElement("div",{className:d.A.footer},React.createElement(n.A,{variant:"secondary",onClick:e=>{e.preventDefault(),t({type:null})}},__("Cancel","jetpack-protect")),React.createElement(n.A,{isLoading:Boolean(l)&&l[u[0]],onClick:async e=>{e.preventDefault(),a(u,(()=>{t({type:null})}))},disabled:!u.length},__("Fix all threats","jetpack-protect")))))}},2607:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(7425),n=a(1112),r=a(7143),l=a(7723),s=a(7478),i=a(5747),o=a(1571),m=a(4031),p=a(2318);const __=l.__,d=({id:e,fixable:t,label:a,icon:l,severity:d})=>{const{setModal:u,fixThreats:h}=(0,r.useDispatch)(s.a),g=(0,r.useSelect)((e=>e(s.a).getThreatsUpdating()));return React.createElement(m.A,null,React.createElement(i.A,null,React.createElement(c.Ay,{variant:"title-medium",mb:2},__("Fix Threat","jetpack-protect")),React.createElement(c.Ay,{mb:3},__("Jetpack will be fixing the selected threat:","jetpack-protect")),React.createElement("div",{className:p.A.list},React.createElement(o.A,{threat:{id:e,fixable:t,label:a,icon:l,severity:d},fixAllDialog:!1})),React.createElement("div",{className:p.A.footer},React.createElement(n.A,{variant:"secondary",onClick:e=>{e.preventDefault(),u({type:null})}},__("Cancel","jetpack-protect")),React.createElement(n.A,{isLoading:Boolean(g&&g[e]),onClick:async t=>{t.preventDefault(),h([e],(()=>{u({type:null})}))}},__("Fix threat","jetpack-protect")))))}},7508:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(1609),n=a(9443);const r=({ariaLabel:e,checked:t=!1,className:a="",disabled:r=!1,id:l,onChange:s=()=>{},onKeyDown:i=()=>{},switchClassNames:o="",toggling:m})=>{const p=(0,c.useCallback)((e=>{r||s(e)}),[r,s]),d=(0,c.useCallback)((e=>{r||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s(e)),i(e))}),[r,s,i]);return React.createElement(React.Fragment,null,React.createElement("div",null,React.createElement("input",{className:`${n.A["form-toggle"]} ${a} ${m?n.A["is-toggling"]:""}`,type:"checkbox",checked:t,readOnly:!0,disabled:r}),React.createElement("span",{className:`${n.A["form-toggle__switch"]} ${o}`,disabled:r,id:l,onClick:p,onKeyDown:d,role:"checkbox","aria-checked":t,"aria-label":e,tabIndex:r?-1:0})))}},4114:(e,t,a)=>{"use strict";a.d(t,{A:()=>u,E:()=>d});var c=a(7425),n=a(1113),r=a(8248),l=a(7350),s=a(3022),i=a(1609),o=a.n(i),m=a(4493);const p=o().createContext(),d=({id:e,title:t,label:a,icon:d,children:u,onOpen:h})=>{const g=(0,i.useContext)(p),v=g?.open===e,f=g?.setOpen,E=(0,s.A)(m.A["accordion-body"],{[m.A["accordion-body-open"]]:v,[m.A["accordion-body-close"]]:!v}),A=(0,i.useCallback)((()=>{v||h?.(),f((t=>t===e?null:e))}),[v,h,f,e]);return o().createElement("div",{className:m.A["accordion-item"]},o().createElement("button",{className:m.A["accordion-header"],onClick:A},o().createElement("div",null,o().createElement(c.Ay,{className:m.A["accordion-header-label"],mb:1},o().createElement(n.A,{icon:d,className:m.A["accordion-header-label-icon"]}),a),o().createElement(c.Ay,{className:m.A["accordion-header-description"],variant:v?"title-small":"body"},t)),o().createElement("div",{className:m.A["accordion-header-button"]},o().createElement(n.A,{icon:v?r.A:l.A,size:38}))),o().createElement("div",{className:E,"aria-hidden":v?"false":"true"},u))},u=({children:e})=>{const[t,a]=(0,i.useState)();return o().createElement(p.Provider,{value:{open:t,setOpen:a}},o().createElement("div",{className:m.A.accordion},e))}},5920:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var c=a(3924),n=a(7425),r=a(1112),l=a(7143),s=a(6087),i=a(7723),o=a(1113),m=a(7478),p=a(5576),d=a(4031),u=a(4871);const __=i.__,h=({id:e,title:t,label:a,icon:i,severity:h})=>{const{setModal:g,ignoreThreat:v}=(0,l.useDispatch)(m.a),f=(0,l.useSelect)((e=>e(m.a).getThreatsUpdating())),E=(0,c.A)("jetpack-protect-codeable-referral");return React.createElement(d.A,null,React.createElement(n.Ay,{variant:"title-medium",mb:2},__("Do you really want to ignore this threat?","jetpack-protect")),React.createElement(n.Ay,{mb:3},__("Jetpack will ignore the threat:","jetpack-protect")),React.createElement("div",{className:u.A.threat},React.createElement(o.A,{icon:i,className:u.A.threat__icon}),React.createElement("div",{className:u.A.threat__summary},React.createElement(n.Ay,{className:u.A.threat__summary__label,mb:1},a),React.createElement(n.Ay,{className:u.A.threat__summary__title},t)),React.createElement("div",{className:u.A.threat__severity},React.createElement(p.A,{severity:h}))),React.createElement(n.Ay,{mb:4},(0,s.createInterpolateElement)(__("By choosing to ignore this threat, you acknowledge that you have reviewed the detected code. You are accepting the risks of maintaining a potentially malicious or vulnerable file on your site. If you are unsure, please request an estimate with Codeable.","jetpack-protect"),{codeableLink:React.createElement(r.A,{variant:"link",isExternalLink:!0,href:E})})),React.createElement("div",{className:u.A.footer},React.createElement(r.A,{variant:"secondary",onClick:e=>{e.preventDefault(),g({type:null})}},__("Cancel","jetpack-protect")),React.createElement(r.A,{isDestructive:!0,isLoading:Boolean(f&&f[e]),onClick:async t=>{t.preventDefault(),v(e,(()=>{g({type:null})}))}},__("Ignore threat","jetpack-protect"))))}},8097:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var c=a(2947),n=a(7425),r=a(766),l=a(5918),s=a(8509),i=a(6087),o=a(7723),m=a(1609),p=a.n(m),d=a(1226),u=a(4962),h=a(9374),g=a(840);const __=o.__,v=({onScanAdd:e})=>((0,d.A)({pageViewEventName:"protect_interstitial"}),p().createElement(c.A,{moduleName:__("Jetpack Protect","jetpack-protect"),header:p().createElement("div",{className:g.A["protect-header"]},p().createElement(u.A,null),p().createElement(n.Ay,{variant:"body-small"},(0,i.createInterpolateElement)(__("Already have an existing plan or license key? Click here to get started","jetpack-protect"),{a:p().createElement("a",{href:"admin.php?page=my-jetpack#/add-license"})})))},p().createElement(r.A,null,p().createElement(l.A,{horizontalSpacing:3,horizontalGap:3},p().createElement(s.A,{sm:4,md:8,lg:12},p().createElement(h.A,{onScanAdd:e}))))))},4962:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(6427),n=a(1609),r=a.n(n);function l({iconColor:e="#069E08",color:t="#000"}){return r().createElement(c.SVG,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 245 41",width:245},r().createElement(c.Path,{d:"M159.347 27.3605H156.978V7.9082H162.371C163.176 7.9082 163.917 7.95666 164.596 8.05359C165.284 8.15051 165.914 8.30074 166.486 8.50428C167.649 8.92104 168.531 9.54619 169.132 10.3797C169.733 11.2036 170.033 12.2213 170.033 13.4328C170.033 14.4214 169.834 15.2937 169.437 16.0497C169.049 16.796 168.482 17.4211 167.736 17.9251C166.99 18.4291 166.079 18.812 165.003 19.0737C163.937 19.3257 162.725 19.4517 161.368 19.4517C160.719 19.4517 160.045 19.4226 159.347 19.3644V27.3605ZM159.347 17.1982C159.667 17.237 160.002 17.2661 160.35 17.2854C160.699 17.3048 161.029 17.3145 161.339 17.3145C162.454 17.3145 163.403 17.2273 164.189 17.0528C164.974 16.8784 165.613 16.6264 166.108 16.2968C166.602 15.9576 166.961 15.5505 167.183 15.0756C167.406 14.591 167.518 14.0434 167.518 13.4328C167.518 12.6768 167.334 12.0565 166.965 11.5719C166.607 11.0873 166.093 10.719 165.424 10.467C165.008 10.3119 164.528 10.2053 163.985 10.1471C163.442 10.0793 162.812 10.0453 162.095 10.0453H159.347V17.1982Z",fill:t}),r().createElement(c.Path,{d:"M181.093 15.3809H180.919C180.386 15.3809 179.862 15.4294 179.349 15.5263C178.835 15.6232 178.35 15.7735 177.895 15.977C177.449 16.1708 177.042 16.4131 176.674 16.7039C176.315 16.9947 176.014 17.3388 175.772 17.7361V27.3605H173.519V13.5491H175.263L175.699 15.7444H175.743C175.966 15.3858 176.237 15.0514 176.557 14.7412C176.887 14.4311 177.255 14.1597 177.662 13.9271C178.069 13.6945 178.515 13.5152 179 13.3892C179.484 13.2535 179.993 13.1856 180.526 13.1856C180.623 13.1856 180.72 13.1905 180.817 13.2002C180.924 13.2002 181.016 13.205 181.093 13.2147V15.3809Z",fill:t}),r().createElement(c.Path,{d:"M193.302 20.4694C193.302 19.6164 193.195 18.8604 192.982 18.2014C192.779 17.5326 192.488 16.9705 192.11 16.5149C191.741 16.0497 191.3 15.7008 190.787 15.4682C190.273 15.2258 189.711 15.1047 189.1 15.1047C188.49 15.1047 187.928 15.2258 187.414 15.4682C186.9 15.7008 186.454 16.0497 186.076 16.5149C185.708 16.9705 185.417 17.5326 185.204 18.2014C185.001 18.8604 184.899 19.6164 184.899 20.4694C184.899 21.3126 185.001 22.0686 185.204 22.7373C185.417 23.3964 185.713 23.9537 186.091 24.4092C186.469 24.8648 186.915 25.2137 187.428 25.456C187.942 25.6886 188.504 25.8049 189.115 25.8049C189.725 25.8049 190.283 25.6886 190.787 25.456C191.3 25.2137 191.741 24.8648 192.11 24.4092C192.488 23.9537 192.779 23.3964 192.982 22.7373C193.195 22.0686 193.302 21.3126 193.302 20.4694ZM195.657 20.4694C195.657 21.5549 195.502 22.5435 195.192 23.4352C194.882 24.3269 194.441 25.0926 193.869 25.7322C193.307 26.3622 192.623 26.8517 191.819 27.2006C191.015 27.5495 190.113 27.724 189.115 27.724C188.088 27.724 187.167 27.5495 186.353 27.2006C185.548 26.8517 184.86 26.3622 184.288 25.7322C183.726 25.0926 183.295 24.3269 182.994 23.4352C182.694 22.5435 182.544 21.5549 182.544 20.4694C182.544 19.3741 182.699 18.3807 183.009 17.489C183.319 16.5973 183.755 15.8316 184.317 15.1919C184.889 14.5522 185.577 14.0579 186.382 13.709C187.196 13.3601 188.102 13.1856 189.1 13.1856C190.118 13.1856 191.034 13.3601 191.848 13.709C192.662 14.0579 193.35 14.5522 193.913 15.1919C194.475 15.8316 194.906 16.5973 195.206 17.489C195.507 18.3807 195.657 19.3741 195.657 20.4694Z",fill:t}),r().createElement(c.Path,{d:"M206.354 27.3896C206.16 27.4672 205.864 27.5398 205.467 27.6077C205.07 27.6755 204.595 27.7143 204.042 27.724C203.315 27.724 202.685 27.6319 202.152 27.4478C201.619 27.2733 201.173 27.0213 200.815 26.6918C200.466 26.3525 200.204 25.9455 200.03 25.4705C199.855 24.9956 199.768 24.4674 199.768 23.8859V15.4827H197.107V13.5491H199.768V9.76911H202.021V13.5491H206.15V15.4827H202.021V23.5369C202.021 23.8568 202.065 24.1524 202.152 24.4238C202.249 24.6952 202.395 24.9326 202.588 25.1362C202.792 25.33 203.049 25.4851 203.359 25.6014C203.669 25.708 204.042 25.7613 204.478 25.7613C204.779 25.7613 205.094 25.7371 205.423 25.6886C205.763 25.6402 206.073 25.5772 206.354 25.4996V27.3896Z",fill:t}),r().createElement(c.Path,{d:"M214.681 15.1192C214.167 15.1192 213.687 15.221 213.242 15.4245C212.805 15.6281 212.423 15.9043 212.093 16.2532C211.764 16.6021 211.497 17.0141 211.293 17.489C211.09 17.9542 210.964 18.4534 210.915 18.9864H217.894C217.894 18.4437 217.821 17.9397 217.676 17.4744C217.54 16.9995 217.337 16.5876 217.065 16.2387C216.794 15.8898 216.459 15.6184 216.062 15.4245C215.665 15.221 215.204 15.1192 214.681 15.1192ZM215.917 25.7613C216.663 25.7613 217.341 25.7032 217.952 25.5869C218.572 25.4609 219.188 25.2864 219.798 25.0635V26.9389C219.304 27.1812 218.693 27.3702 217.967 27.5059C217.24 27.6513 216.459 27.724 215.626 27.724C214.637 27.724 213.707 27.598 212.835 27.346C211.972 27.094 211.216 26.6869 210.567 26.1248C209.917 25.5626 209.403 24.8309 209.025 23.9295C208.657 23.0184 208.473 21.9232 208.473 20.6438C208.473 19.3838 208.647 18.2934 208.996 17.3727C209.345 16.4422 209.811 15.6668 210.392 15.0465C210.974 14.4262 211.642 13.961 212.398 13.6509C213.154 13.3407 213.944 13.1856 214.768 13.1856C215.544 13.1856 216.266 13.3165 216.934 13.5782C217.613 13.8302 218.199 14.2324 218.693 14.7849C219.188 15.3373 219.575 16.0497 219.857 16.922C220.147 17.7943 220.293 18.8411 220.293 20.0623C220.293 20.1786 220.293 20.2804 220.293 20.3676C220.293 20.4451 220.288 20.6293 220.278 20.92H210.799C210.799 21.802 210.93 22.5532 211.192 23.1735C211.463 23.7841 211.827 24.2832 212.282 24.6709C212.747 25.0489 213.29 25.3252 213.91 25.4996C214.531 25.6741 215.199 25.7613 215.917 25.7613Z",fill:t}),r().createElement(c.Path,{d:"M229.885 13.1856C230.553 13.1856 231.193 13.2583 231.804 13.4037C232.414 13.5394 232.938 13.7332 233.374 13.9852V15.8607C232.763 15.6281 232.201 15.4536 231.687 15.3373C231.174 15.221 230.65 15.1628 230.117 15.1628C229.555 15.1628 228.998 15.2549 228.445 15.4391C227.893 15.6232 227.398 15.9285 226.962 16.355C226.526 16.7718 226.172 17.3291 225.901 18.0269C225.639 18.7151 225.508 19.5728 225.508 20.6002C225.508 21.3465 225.605 22.0346 225.799 22.6646C226.003 23.2946 226.298 23.8423 226.686 24.3075C227.083 24.763 227.578 25.1216 228.169 25.3833C228.76 25.6353 229.444 25.7613 230.219 25.7613C230.781 25.7613 231.348 25.7032 231.92 25.5869C232.492 25.4609 233.049 25.2864 233.592 25.0635V26.9389C233.427 27.0358 233.209 27.1328 232.938 27.2297C232.676 27.3266 232.385 27.409 232.065 27.4768C231.745 27.5544 231.406 27.6125 231.048 27.6513C230.689 27.6998 230.33 27.724 229.972 27.724C229.041 27.724 228.159 27.5835 227.326 27.3024C226.502 27.0213 225.78 26.59 225.16 26.0085C224.539 25.4269 224.05 24.6903 223.691 23.7986C223.333 22.907 223.153 21.8505 223.153 20.6293C223.153 19.7182 223.245 18.8992 223.429 18.1723C223.623 17.4454 223.885 16.8057 224.215 16.2532C224.544 15.7008 224.927 15.2307 225.363 14.843C225.809 14.4553 226.279 14.1403 226.773 13.898C227.277 13.646 227.796 13.4667 228.329 13.3601C228.862 13.2438 229.381 13.1856 229.885 13.1856Z",fill:t}),r().createElement(c.Path,{d:"M244.143 27.3896C243.949 27.4672 243.654 27.5398 243.256 27.6077C242.859 27.6755 242.384 27.7143 241.832 27.724C241.105 27.724 240.475 27.6319 239.942 27.4478C239.409 27.2733 238.963 27.0213 238.604 26.6918C238.255 26.3525 237.993 25.9455 237.819 25.4705C237.645 24.9956 237.557 24.4674 237.557 23.8859V15.4827H234.897V13.5491H237.557V9.76911H239.811V13.5491H243.94V15.4827H239.811V23.5369C239.811 23.8568 239.854 24.1524 239.942 24.4238C240.039 24.6952 240.184 24.9326 240.378 25.1362C240.581 25.33 240.838 25.4851 241.148 25.6014C241.458 25.708 241.832 25.7613 242.268 25.7613C242.568 25.7613 242.883 25.7371 243.213 25.6886C243.552 25.6402 243.862 25.5772 244.143 25.4996V27.3896Z",fill:t}),r().createElement(c.Path,{d:"M20.1063 40.2111C31.2106 40.2111 40.2126 31.2091 40.2126 20.1048C40.2126 9.00048 31.2106 0 20.1063 0C9.00197 0 0 9.00197 0 20.1063C0 31.2106 9.00197 40.2111 20.1063 40.2111Z",fill:e}),r().createElement(c.Path,{d:"M21.104 16.7295V36.2209L31.1571 16.7295H21.104Z",fill:"white"}),r().createElement(c.Path,{d:"M19.0701 23.4444V3.99023L9.05566 23.4444H19.0701Z",fill:"white"}),r().createElement(c.Path,{d:"M51.9141 33.3819C51.3379 32.499 50.8019 31.6176 50.2644 30.7733C53.1038 29.0462 54.0626 27.666 54.0626 25.0559V9.97619H50.7245V7.09961H57.8236V24.2891C57.8236 28.6635 56.558 31.1188 51.9141 33.3819Z",fill:t}),r().createElement(c.Path,{d:"M81.6522 23.0994C81.6522 24.557 82.6885 24.7104 83.3793 24.7104C84.0702 24.7104 85.0677 24.4796 85.8345 24.2503V26.9363C84.7595 27.2817 83.6473 27.5497 82.1122 27.5497C80.2705 27.5497 78.122 26.8589 78.122 23.6354V15.7307H76.1655V13.006H78.122V8.97852H81.6522V13.0075H86.1025V15.7322H81.6522V23.0994Z",fill:t}),r().createElement(c.Path,{d:"M89.0193 34.7251V12.9691H92.3961V14.2734C93.7391 13.2371 95.2355 12.585 97.0773 12.585C100.262 12.585 102.795 14.8109 102.795 19.6067C102.795 24.3652 100.033 27.5113 95.4663 27.5113C94.3541 27.5113 93.4711 27.358 92.5495 27.1659V34.6864H89.0193V34.7251ZM96.1557 15.5017C95.1194 15.5017 93.8151 16.0005 92.5867 17.0755V24.4814C93.3535 24.6347 94.1605 24.7494 95.234 24.7494C97.7279 24.7494 99.1484 23.1756 99.1484 19.8762C99.1484 16.8447 98.1121 15.5017 96.1557 15.5017Z",fill:t}),r().createElement(c.Path,{d:"M116.683 27.2051H113.384V25.6313H113.306C112.155 26.5142 110.735 27.4731 108.625 27.4731C106.783 27.4731 104.788 26.1301 104.788 23.4054C104.788 19.7605 107.896 19.0696 110.083 18.7629L113.19 18.3416V17.9202C113.19 16.001 112.423 15.3876 110.619 15.3876C109.736 15.3876 107.665 15.6556 105.976 16.3464L105.67 13.5071C107.205 12.9696 109.315 12.5869 111.08 12.5869C114.533 12.5869 116.759 13.9686 116.759 18.0736V27.2051H116.683ZM113.153 20.5675L110.236 21.0276C109.353 21.1422 108.433 21.6797 108.433 22.984C108.433 24.1349 109.085 24.7871 110.044 24.7871C111.08 24.7871 112.193 24.1736 113.152 23.4828V20.5675H113.153Z",fill:t}),r().createElement(c.Path,{d:"M131.264 26.745C129.806 27.2438 128.502 27.5505 126.851 27.5505C121.556 27.5505 119.445 24.5191 119.445 20.1074C119.445 15.465 122.362 12.5869 127.08 12.5869C128.845 12.5869 129.92 12.8936 131.109 13.2778V16.2705C130.073 15.8863 128.577 15.465 127.119 15.465C124.97 15.465 123.129 16.6159 123.129 19.9153C123.129 23.5602 124.97 24.6739 127.311 24.6739C128.423 24.6739 129.652 24.4431 131.301 23.791V26.745H131.264Z",fill:t}),r().createElement(c.Path,{d:"M137.941 19.1093C138.247 18.7639 138.478 18.4185 142.928 13.0077H147.532L141.776 19.7615L148.068 27.2432H143.464L137.978 20.4895V27.2432H134.449V7.09973H137.979V19.1093H137.941Z",fill:t}),r().createElement(c.Path,{d:"M73.5167 26.7445C71.6749 27.3207 70.1011 27.55 68.2593 27.55C63.7316 27.55 60.9309 25.2869 60.9309 19.9908C60.9309 16.1152 63.3102 12.585 67.8752 12.585C72.403 12.585 73.9768 15.731 73.9768 18.7238C73.9768 19.7213 73.8993 20.2588 73.8621 20.8335H64.7306C64.808 23.9409 66.5724 24.6705 69.2197 24.6705C70.6773 24.6705 71.9816 24.325 73.4795 23.7875V26.7416H73.5167V26.7445ZM70.2947 18.4945C70.2947 16.7673 69.7185 15.271 67.8395 15.271C66.0751 15.271 65.0001 16.5365 64.7693 18.4945H70.2947Z",fill:t}))}},8331:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(4054);const n=e=>React.createElement("mark",{key:e,className:c.A["marked-lines__mark"]},e),r=({context:e})=>{const{marks:t,...a}=e;return React.createElement("div",{className:c.A["marked-lines"]},React.createElement("div",{className:c.A["marked-lines__line-numbers"]},Object.keys(a).map((e=>{const a=Object.hasOwn(t,e);return React.createElement("div",{key:e,className:`${c.A["marked-lines__line-number"]} ${a?c.A["marked-lines__marked-line"]:""}`},e)}))),React.createElement("div",{className:c.A["marked-lines__lines"]},Object.keys(a).map((e=>{const r=a[e]||" ",l=Object.hasOwn(t,e);return React.createElement("div",{key:e,className:`${c.A["marked-lines__line"]} ${l?c.A["marked-lines__marked-line"]:""} `},React.createElement(React.Fragment,null,l?((e,t)=>{const[a,c]=e.reduce((([e,a],[c,r])=>{const l=t.slice(c,r);return[[...e,...c>a?[t.slice(a,c),n(l)]:[n(l)]],r]}),[[],0]);return c{"use strict";a.d(t,{A:()=>v});var c=a(7143),n=a(7723),r=a(1113),l=a(991),s=a(7478),i=a(9417),o=a(8680),m=a(2607),p=a(5920),d=a(3144),u=a(9623),h=a(7259);const __=n.__,g={IGNORE_THREAT:p.A,UNIGNORE_THREAT:u.A,FIX_THREAT:m.A,FIX_ALL_THREATS:o.A,CREDENTIALS_NEEDED:i.A,STANDALONE_MODE:d.A},v=()=>{const e=(0,c.useSelect)((e=>e(s.a).getModalType())),t=(0,c.useSelect)((e=>e(s.a).getModalProps())),{setModal:a}=(0,c.useDispatch)(s.a);if(!e)return null;const n=g[e];return React.createElement("div",{className:h.A.modal},React.createElement("div",{className:h.A.modal__window},React.createElement("button",{onClick:e=>{e.preventDefault(),a({type:null})},className:h.A.modal__close,title:__("Close Modal Window","jetpack-protect")},React.createElement(r.A,{icon:l.A,size:24,className:h.A.modal__close__icon,"aria-label":__("Close Modal Window","jetpack-protect")})),React.createElement(n,t)))}},9278:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var c=a(7425),n=a(6427),r=a(7723),l=a(1113),s=a(9783),i=a(3883),o=a(8120),m=a.n(o),p=a(1609),d=a.n(p),u=a(3066);const __=r.__,h=({count:e,checked:t})=>{const{popoverText:a,badgeElement:r}=((e,t)=>t?0===e?{popoverText:__("No known threats found to affect this version","jetpack-protect"),badgeElement:d().createElement(l.A,{icon:i.A,size:28,className:u.A["navigation-item-check-badge"]})}:{popoverText:null,badgeElement:d().createElement(c.Ay,{variant:"body-extra-small",className:u.A["navigation-item-badge"],component:"div"},e)}:{popoverText:__("This item was added to your site after the most recent scan. We will check for threats during the next scheduled one.","jetpack-protect"),badgeElement:d().createElement(l.A,{icon:s.A,size:28,className:u.A["navigation-item-info-badge"]})})(e,t),[o,m]=(0,p.useState)(!1),h=(0,p.useCallback)((()=>{m(!0)}),[]),g=(0,p.useCallback)((()=>{m(!1)}),[]);return d().createElement("div",{onMouseLeave:a?g:null,onMouseEnter:a?h:null,onClick:a?h:null,onFocus:a?h:null,onBlur:a?g:null,role:"presentation"},r,o&&d().createElement(n.Popover,{noArrow:!1,inline:!0},d().createElement(c.Ay,{variant:"body-small",className:u.A["popover-text"]},a)))};h.propTypes={count:m().number,checked:m().bool};const g=h},5498:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var c=a(1112),n=a(7723),r=a(1609),l=a.n(r),s=a(1549),i=a(3066),o=a(43);const __=n.__,m=({icon:e,label:t,children:a})=>{const[m,p]=(0,r.useState)(!0),{mode:d}=(0,r.useContext)(o._),u=Array.isArray(a)&&a?.length>=8&&"list"===d,h=u&&m?a.slice(0,8):a,g=u?a?.length-8:0,v=(0,r.useCallback)((()=>{p((e=>!e))}),[]);return l().createElement("li",{tabIndex:-1,role:"menuitem",className:i.A["navigation-group"]},l().createElement(s.A,{icon:e,className:i.A["navigation-group-label"]},t),l().createElement("div",{className:i.A["navigation-group-list"]},l().createElement("ul",{className:i.A["navigation-group-content"]},h),u&&l().createElement("div",{className:i.A["navigation-group-truncate"]},l().createElement(c.A,{variant:"link",onClick:v},m?(0,n.sprintf)(/* translators: %s: Number of hide items */ +__("Show %s more","jetpack-protect"),g):(0,n.sprintf)(/* translators: %s: Number of hide items */ +__("Hide %s items","jetpack-protect"),g)))))}},59:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>f,Me:()=>p.A,s$:()=>d.A});var c=a(7425),n=a(6427),r=a(7723),l=a(1113),s=a(8248),i=a(7350),o=a(1609),m=a.n(o),p=a(5498),d=a(7366),u=a(3066),h=a(43);const __=r.__,g=({children:e})=>m().createElement("ul",{className:u.A.navigation,role:"menu"},e),v=({children:e,data:t})=>{const a=(0,o.useRef)(void 0),[r,p]=(0,o.useState)(!1),d=t?.items?.find((e=>e?.id===t?.selectedItem))??{label:__("See all results","jetpack-protect")},{label:h,icon:g}=d,v=(0,o.useCallback)((()=>{p((e=>!e))}),[]);return m().createElement("button",{className:u.A["navigation-dropdown-button"],onClick:v,ref:a},m().createElement("div",{className:u.A["navigation-dropdown-label"]},g&&m().createElement(l.A,{icon:g,className:u.A["navigation-dropdown-icon"]}),m().createElement(c.Ay,null,h)),m().createElement(l.A,{icon:r?s.A:i.A,size:32}),m().createElement(n.Popover,{position:"bottom center",anchorRef:a?.current,inline:!0},m().createElement("div",{style:{display:r?"block":"none",width:a?.current?.getBoundingClientRect?.()?.width}},e)))},f=({children:e,selected:t,onSelect:a,mode:c="list"})=>{const n=(0,h.A)({selected:t,onSelect:a}),r=(e=>{switch(e){case"list":default:return g;case"dropdown":return v}})(c);return m().createElement(h._.Provider,{value:{...n,mode:c}},m().createElement(r,{data:n},e))}},7366:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var c=a(3022),n=a(1609),r=a.n(n),l=a(9278),s=a(1549),i=a(3066),o=a(43);const m=({id:e,label:t,icon:a,badge:m,disabled:p,onClick:d,onKeyDown:u,onFocus:h,checked:g})=>{const v=(0,n.useContext)(o._),f=v?.selectedItem===e,E=v?.registerItem,A=v?.registerRef,y=v?.handleClickItem,w=v?.handleKeyDownItem,k=v?.handleFocusItem,b=(0,c.A)(i.A["navigation-item"],{[i.A.clickable]:!p,[i.A.selected]:f}),_=(0,n.useCallback)((t=>{d?.(t),y?.(e)}),[y,e,d]),R=(0,n.useCallback)((e=>{u?.(e),w?.(e)}),[w,u]),C=(0,n.useCallback)((t=>{A(t,e)}),[A,e]),j=(0,n.useCallback)((t=>{h?.(t),k?.(e)}),[k,e,h]);return(0,n.useEffect)((()=>{E({id:e,disabled:p,label:t,icon:a})}),[]),r().createElement("li",{className:b,onClick:p?null:_,onKeyDown:R,onFocus:p?null:j,role:"menuitem",tabIndex:p?-1:0,ref:C},r().createElement(s.A,{icon:a},t),r().createElement(l.A,{count:m,checked:g}))}},1549:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(7425),n=a(1113),r=a(3022),l=a(8120),s=a.n(l),i=a(1609),o=a.n(i),m=a(3066);const p=({icon:e,children:t,className:a})=>o().createElement(c.Ay,{className:(0,r.A)(m.A["navigation-item-label"],a)},e&&o().createElement(n.A,{icon:e,className:m.A["navigation-item-icon"],size:28}),o().createElement("span",{className:m.A["navigation-item-label-content"]},t));p.propTypes={icon:s().node,children:s().node.isRequired};const d=p},43:(e,t,a)=>{"use strict";a.d(t,{A:()=>r,_:()=>n});var c=a(1609);const n=a.n(c)().createContext(),r=({selected:e,onSelect:t})=>{const[a,n]=(0,c.useState)([]),[r,l]=(0,c.useState)([]),[s,i]=(0,c.useState)(),o=(e,t)=>{const c=e-1,n=c<0?t:c,r=a[n];return r?.disabled?o(n,t):r},m=(e,t)=>{const c=e+1,n=c>t?0:c,r=a[n];return r?.disabled?m(n,t):r};return{selectedItem:e,handleClickItem:e=>{t(e)},handleKeyDownItem:c=>{const n=c?.code,l=a.findIndex((t=>t?.id===e)),i=a.length-1;let p;if("ArrowUp"===n){const e=o(l,i);p=e?.id}else if("ArrowDown"===n){const e=m(l,i);p=e?.id}else"Enter"!==n&&"Space"!==n||!s||(p=s);if(p){const e=r[p];e?.focus(),t(p)}},handleFocusItem:e=>{i(e)},registerRef:(e,t)=>{l((a=>!a[t]&&e?{...a,[t]:e}:a))},registerItem:e=>{n((t=>{const a=[...t],c=e?.id,n=a.findIndex((e=>e?.id===c));return n>=0?a[n]=e:a.push(e),a}))},items:a}}},3041:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(7143),n=a(7723),r=a(3883),l=a(311),s=a(9783),i=a(1113),o=a(991),m=a(1609),p=a(7478),d=a(600);const __=n.__,u=({dismissable:e=!1,duration:t=null,floating:a=!1,message:n,type:u="success"})=>{const{clearNotice:h}=(0,c.useDispatch)(p.a);let g;switch(u){case"success":g=r.A;break;case"error":g=l.A;break;default:g=s.A}const v=(0,m.useCallback)((()=>{h()}),[h]);return(0,m.useEffect)((()=>{let e;return t&&(e=setTimeout(h,t)),()=>clearTimeout(e)}),[h,t,n]),React.createElement("div",{className:`${d.A.notice} ${d.A[`notice--${u}`]} ${a?d.A["notice--floating"]:""}`},React.createElement("div",{className:d.A.notice__icon},React.createElement(i.A,{icon:g})),React.createElement("div",{className:d.A.notice__message},n),e&&React.createElement("button",{className:d.A.notice__close,"aria-label":__("Dismiss notice.","jetpack-protect"),onClick:v},React.createElement(i.A,{icon:o.A})))}},4254:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(1330),n=a(7723),r=a(1609),l=a(1936);const __=n.__,s=({id:e,anchor:t,position:a})=>{const{stepsCount:n,currentStep:s,currentStepCount:i,completeCurrentStep:o,completeAllCurrentSteps:m}=(0,l.Ay)(),{setRenderedSteps:p}=(0,r.useContext)(l.OC);return(0,r.useEffect)((()=>(p((t=>[...t,e])),()=>{p((t=>t.filter((t=>t!==e))))})),[e,p]),s?.id!==e?null:React.createElement(c.A,{anchor:t,title:s.title,noArrow:!1,children:s.description,buttonContent:i{"use strict";a.d(t,{A:()=>b,S:()=>k});var c=a(7425),n=a(442),r=a(6461),l=a(7143),s=a(8443),i=a(7723),o=a(1113),m=a(3883),p=a(8248),d=a(7350),u=a(3022),h=a(1609),g=a.n(h),v=a(7478),f=a(5576),E=a(7489);const __=i.__,A=g().createContext(),y=({firstDetected:e,fixedOn:t,status:a})=>g().createElement(g().Fragment,null,e&&g().createElement(c.Ay,{className:E.A["accordion-header-status"]},(0,i.sprintf)(/* translators: %s: First detected date */ +__("Threat found %s","jetpack-protect"),(0,s.dateI18n)("M j, Y",e)),"fixed"===a&&g().createElement(g().Fragment,null,g().createElement("span",{className:E.A["accordion-header-status-separator"]}),g().createElement("span",{className:E.A["is-fixed"]},(0,i.sprintf)(/* translators: %s: Fixed on date */ +__("Threat fixed %s","jetpack-protect"),(0,s.dateI18n)("M j, Y",t)))),"ignored"===a&&g().createElement(g().Fragment,null,g().createElement("span",{className:E.A["accordion-header-status-separator"]}),g().createElement("span",{className:E.A["is-ignored"]},__("Threat ignored","jetpack-protect")))),("fixed"===a||"ignored"===a)&&g().createElement(w,{status:"fixed"===a?"fixed":"ignored"})),w=({status:e})=>g().createElement("div",{className:`${E.A["status-badge"]} ${E.A[e]}`},"fixed"===e?__("Fixed","jetpack-protect"):__("Ignored","jetpack-protect",0)),k=({id:e,title:t,label:a,icon:s,fixable:i,severity:w,children:k,firstDetected:b,fixedOn:_,onOpen:R,status:C,hideAutoFixColumn:j=!1})=>{const S=(0,h.useContext)(A),x=S?.open===e,N=S?.setOpen,M=(0,l.useSelect)((e=>e(v.a).getThreatsAreFixing())),L=(0,u.A)(E.A["accordion-body"],{[E.A["accordion-body-open"]]:x,[E.A["accordion-body-close"]]:!x}),z=(0,h.useCallback)((()=>{x||R?.(),N((t=>t===e?null:e))}),[x,R,N,e]),[P]=(0,n.A)(["sm","lg"],[null,"<"]);return g().createElement("div",{className:E.A["accordion-item"]},g().createElement("button",{className:E.A["accordion-header"],onClick:z},g().createElement("div",null,g().createElement(c.Ay,{className:E.A["accordion-header-label"],mb:1},g().createElement(o.A,{icon:s,className:E.A["accordion-header-label-icon"]}),a),g().createElement(c.Ay,{className:E.A["accordion-header-description"],variant:x?"title-small":"body"},t),("fixed"===C||"ignored"===C)&&g().createElement(y,{firstDetected:b,status:C,fixedOn:_})),g().createElement("div",null,g().createElement(f.A,{severity:w})),!j&&g().createElement("div",null,i&&g().createElement(g().Fragment,null,M.indexOf(e)>=0?g().createElement(r.A,{color:"black"}):g().createElement(o.A,{icon:m.A,className:E.A["icon-check"],size:28}),P&&g().createElement("span",null,__("Auto-fix","jetpack-protect")))),g().createElement("div",{className:E.A["accordion-header-button"]},g().createElement(o.A,{icon:x?p.A:d.A,size:38}))),g().createElement("div",{className:L,"aria-hidden":x?"false":"true"},k))},b=({children:e})=>{const[t,a]=(0,h.useState)();return g().createElement(A.Provider,{value:{open:t,setOpen:a}},g().createElement("div",{className:E.A.accordion},e))}},5409:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(726),n=a(727);function r({children:e,redirect:t="/"}){const{hasRequiredPlan:a}=(0,n.A)();return a?e:React.createElement(c.C5,{to:t,replace:!0})}},9374:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var c=a(9245),n=a(489),r=a(1112),l=a(9384),s=a(7143),i=a(7723),o=a(1609),m=a.n(o),p=a(1226),d=a(727),u=a(6516),h=a(7478);const __=i.__,g=({onScanAdd:e})=>{const{handleRegisterSite:t,registrationError:a}=(0,l.useConnection)({skipUserConnection:!0}),{refreshPlan:i,refreshStatus:g,startScanOptimistically:v}=(0,s.useDispatch)(h.a),[f,E]=(0,o.useState)(!1),[A,y]=(0,o.useState)(!1),{jetpackScan:w}=(0,d.A)(),{refreshWaf:k}=(0,u.A)(),{pricingForUi:b}=w,{introductoryOffer:_,currencyCode:R="USD"}=b,C=b.cost?Math.ceil(b.cost/12*100)/100:null,j=_?.costPerInterval?Math.ceil(_.costPerInterval/12*100)/100:null,{recordEvent:S,recordEventHandler:x}=(0,p.A)(),N=x("jetpack_protect_pricing_table_get_scan_link_click",(()=>{y(!0),e()})),M=(0,o.useCallback)((async()=>{S("jetpack_protect_connected_product_activated"),E(!0);try{await t(),v(),await i(),await k(),await g(!0)}finally{E(!1)}}),[t,S,k,i,g,v]),L={title:__("Stay one step ahead of threats","jetpack-protect"),items:[{name:__("Scan for threats and vulnerabilities","jetpack-protect")},{name:__("Daily automated scans","jetpack-protect")},{name:__("Web Application Firewall","jetpack-protect")},{name:__("Brute force protection","jetpack-protect")},{name:__("Access to scan on Cloud","jetpack-protect")},{name:__("One-click auto fixes","jetpack-protect")},{name:__("Notifications","jetpack-protect")},{name:__("Severity labels","jetpack-protect")}]};return m().createElement(m().Fragment,null,m().createElement(c.Ay,L,m().createElement(c.N0,{primary:!0},m().createElement(c.i7,null,m().createElement(n.A,{price:C,offPrice:j,leyend:__("/month, billed yearly","jetpack-protect"),currency:R,hideDiscountLabel:!1}),m().createElement(r.A,{fullWidth:!0,onClick:N,isLoading:A,disabled:f||A},__("Get Jetpack Protect","jetpack-protect"))),m().createElement(c.eY,{isIncluded:!0,label:m().createElement("strong",null,__("Line by line malware scanning","jetpack-protect"))}),m().createElement(c.eY,{isIncluded:!0,label:m().createElement("strong",null,__("Plus on-demand manual scans","jetpack-protect"))}),m().createElement(c.eY,{isIncluded:!0,label:m().createElement("strong",null,__("Automatic protection and rule updates","jetpack-protect"))}),m().createElement(c.eY,{isIncluded:!0}),m().createElement(c.eY,{isIncluded:!0}),m().createElement(c.eY,{isIncluded:!0}),m().createElement(c.eY,{isIncluded:!0}),m().createElement(c.eY,{isIncluded:!0})),m().createElement(c.N0,null,m().createElement(c.i7,null,m().createElement(n.A,{price:0,leyend:__("Free forever","jetpack-protect"),currency:R,hidePriceFraction:!0}),m().createElement(r.A,{fullWidth:!0,variant:"secondary",onClick:M,isLoading:f,disabled:f||A,error:a?__("An error occurred. Please try again.","jetpack-protect"):null},__("Start for free","jetpack-protect"))),m().createElement(c.eY,{isIncluded:!0,label:__("Check items against database","jetpack-protect")}),m().createElement(c.eY,{isIncluded:!0}),m().createElement(c.eY,{isIncluded:!0,label:__("Manual rules only","jetpack-protect")}),m().createElement(c.eY,{isIncluded:!0}),m().createElement(c.eY,{isIncluded:!1}),m().createElement(c.eY,{isIncluded:!1}),m().createElement(c.eY,{isIncluded:!1}),m().createElement(c.eY,{isIncluded:!1}))))}},4256:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(3022),n=a(8744);const r=({className:e,total:t=100,value:a})=>{if(null==a)return null;const r=Math.min(Math.round(a/t*100),100),l={width:`${r}%`};return React.createElement("div",{className:(0,c.A)(e,n.A["progress-bar"])},React.createElement("div",{className:n.A["progress-bar__wrapper"]},React.createElement("div",{"aria-valuemax":t,"aria-valuemin":0,"aria-valuenow":Math.min(a,t),className:n.A["progress-bar__bar"],role:"progressbar",style:l})),React.createElement("p",{className:n.A["progress-bar__percent"]},`${r}%`))}},7827:(e,t,a)=>{"use strict";function c(){return React.createElement("svg",{width:"80",height:"96",viewBox:"0 0 80 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40 0.00634766L80 17.7891V44.2985C80 66.8965 65.1605 88.2927 44.2352 95.0425C41.4856 95.9295 38.5144 95.9295 35.7648 95.0425C14.8395 88.2927 0 66.8965 0 44.2985V17.7891L40 0.00634766Z",fill:"#069E08"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9 33.6909L35.375 67.9124L19.2047 55.9263L22.7848 51.1264L34.1403 59.5436L56.0851 30.122L60.9 33.6909Z",fill:"white"}))}a.d(t,{A:()=>c})},3535:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var c=a(6072),n=a.n(c),r=a(1112),l=a(7143),s=a(7723),i=a(1609),o=a.n(i),m=a(7478);const __=s.__,p=(0,i.forwardRef)((({variant:e="secondary",children:t,...a},c)=>{const{scan:s}=(0,l.useDispatch)(m.a),i=(0,l.useSelect)((e=>e(m.a).getScanIsEnqueuing()),[]);return o().createElement(r.A,n()({ref:c,variant:e,isLoading:i,onClick:e=>{e.preventDefault(),s()}},a),t??__("Scan now","jetpack-protect"))}))},9454:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var c=a(3924),n=a(7425),r=a(1112),l=a(4437),s=a(5918),i=a(8509),o=a(9384),m=a(7723),p=a(1609),d=a.n(p),u=a(8140),h=a(1226),g=a(727),v=a(6516),f=a(5165),E=a(4969);const __=m.__,A=()=>{const{adminUrl:e,siteSuffix:t,blogID:a}=window.jetpackProtectInitialState||{},{run:s}=(0,o.useProductCheckoutWorkflow)({productSlug:u.J3,redirectUrl:e,useBlogIdSuffix:!0}),{recordEventHandler:i}=(0,h.A)(),m=i("jetpack_protect_footer_get_scan_link_click",s),{hasRequiredPlan:p}=(0,g.A)();if(p){const e=(0,c.A)("jetpack-scan-dash",{site:a??t});return d().createElement("div",{className:E.A["product-section"]},d().createElement(n.hE,null,__("Get access to our Cloud","jetpack-protect")),d().createElement(n.Ay,{mb:3},__("With your Protect upgrade, you have free access to scan your site on our Cloud, so you can be aware and fix your threats even if your site goes down. ","jetpack-protect")),d().createElement(r.A,{variant:"secondary",weight:"regular",href:e},__("Go to Cloud","jetpack-protect")))}return d().createElement("div",{className:E.A["product-section"]},d().createElement(n.hE,null,__("Advanced scan results","jetpack-protect")),d().createElement(n.Ay,{mb:3},__("Upgrade Jetpack Protect to get advanced scan tools, including one-click fixes for most threats and malware scanning.","jetpack-protect")),d().createElement(l.A,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:m}))},y=()=>{const{hasRequiredPlan:e}=(0,g.A)(),{globalStats:t}=(0,v.A)(),a=parseInt(t?.totalVulnerabilities),l=isNaN(a)?"50,000":a.toLocaleString();if(e){const e=(0,c.A)("protect-footer-learn-more-scan");return d().createElement("div",{className:E.A["info-section"]},d().createElement(n.hE,null,__("Line-by-line scanning","jetpack-protect")),d().createElement(n.Ay,{mb:2},__("We actively review line-by-line of your site files to identify threats and vulnerabilities. Jetpack monitors millions of websites to keep your site secure all the time. ","jetpack-protect"),d().createElement(r.A,{variant:"link",target:"_blank",weight:"regular",href:e},__("Learn more","jetpack-protect"))))}const s=(0,c.A)("jetpack-protect-footer-learn-more");return d().createElement("div",{className:E.A["info-section"]},d().createElement(n.hE,null,(0,m.sprintf)( +// translators: placeholder is the number of total vulnerabilities i.e. "22,000". +__("Over %s listed vulnerabilities","jetpack-protect"),l)),d().createElement(n.Ay,{mb:3},(0,m.sprintf)( +// translators: placeholder is the number of total vulnerabilities i.e. "22,000". +__("Every day we check your plugin, theme, and WordPress versions against our %s listed vulnerabilities powered by WPScan, an Automattic brand.","jetpack-protect"),l)),d().createElement(r.A,{variant:"link",isExternalLink:!0,href:s,weight:"regular"},__("Learn more","jetpack-protect")))},w=()=>{const{waf:e}=window.jetpackProtectInitialState||{};return e.wafSupported?d().createElement(f.A,{main:d().createElement(A,null),secondary:d().createElement(y,null),preserveSecondaryOnMobile:!0}):d().createElement(s.A,{horizontalSpacing:0,horizontalGap:0,fluid:!1},d().createElement(i.A,null,d().createElement(y,null)))}},5165:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var c=a(442),n=a(5918),r=a(8509),l=a(1609),s=a.n(l);const i=({main:e,secondary:t,preserveSecondaryOnMobile:a=!1})=>{const[l,i]=(0,c.A)(["sm","lg"]),o=!a&&l;return s().createElement(n.A,{horizontalSpacing:0,horizontalGap:0,fluid:!1},!o&&s().createElement(s().Fragment,null,s().createElement(r.A,{sm:12,md:4,lg:6},e),i&&s().createElement(r.A,{lg:1}),s().createElement(r.A,{sm:12,md:4,lg:5},t)),o&&s().createElement(r.A,null,e))}},5576:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(7723),n=a(2399);const __=c.__,r=e=>e>=5?"is-critical":e>=3&&e<5?"is-high":"is-low",l=({severity:e})=>React.createElement("div",{className:`${n.A["threat-severity-badge"]} ${n.A[r(e)]}`},(e=>{const t=__("Critical","jetpack-protect"),a=__("High","jetpack-protect"),c=__("Low","jetpack-protect");return e>=5?t:e>=3&&e<5?a:c})(e))},3144:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(7425),n=a(6087),r=a(7723),l=a(1847);const __=r.__,s=()=>React.createElement(React.Fragment,null,React.createElement(c.Ay,{variant:"title-medium-semi-bold",mb:2},__("Enhanced protection","jetpack-protect")),React.createElement(c.Ay,{mb:2},__("Learn how you can execute Jetpack Firewall before WordPress initializes. This mode offers the most protection.","jetpack-protect")),React.createElement("ul",{className:l.A.list},React.createElement("li",{className:l.A["list-item"]},React.createElement(c.Ay,{variant:"body-small"},(0,n.createInterpolateElement)(__("To ensure the firewall can best protect your site, please update: auto_prepend_file PHP directive to point to wp-content/jetpack-waf/bootstrap.php Typically this is set either in an .htaccess file or in the global PHP configuration; contact your host for further assistance.","jetpack-protect"),{mark:React.createElement("mark",{className:l.A.mark})}))),React.createElement("li",{className:l.A["list-item"]},React.createElement(c.Ay,{variant:"body-small"},__("Don't forget to undo this action when Firewall is turned off, or when you uninstall Jetpack.","jetpack-protect")))))},147:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var c=a(442),n=a(8443),r=a(7723),l=a(1609),s=a.n(l),i=a(727),o=a(7115),m=a(4254);const __=r.__,p=()=>{const[e]=(0,c.A)("sm"),{counts:{current:{threats:t}},lastChecked:a,hasRequiredPlan:p}=(0,i.A)(),[d,u]=(0,l.useState)(null);return s().createElement(o.A,{title:t>0?(0,r.sprintf)(/* translators: %s: Total number of threats */ +__("%1$s %2$s found","jetpack-protect"),t,1===t?"threat":"threats"):void 0,subtitle:s().createElement(s().Fragment,null,s().createElement("div",{ref:u},(0,r.sprintf)(/* translators: %s: Latest check date */ +__("Latest results as of %s","jetpack-protect"),(0,n.dateI18n)("F jS",a))),!p&&s().createElement(m.A,{id:"free-daily-scans",position:e?"bottom":"middle right",anchor:d}))})}},241:(e,t,a)=>{"use strict";a.d(t,{A:()=>l,o:()=>r});var c=a(9959),n=a(4356);const r=({label:e,link:t})=>React.createElement(c.k2,{to:t,className:({isActive:e})=>e?`${n.A.tab} ${n.A["tab--active"]}`:n.A.tab},e),l=({children:e,className:t=""})=>React.createElement("nav",{className:`${n.A.tabs} ${t}`},e)},4491:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var c=a(6578);const n=({disabled:e=!1,id:t,label:a="",description:n="",placeholder:r="",rows:l=3,value:s="",onChange:i=()=>{}})=>React.createElement("div",null,Boolean(a)&&React.createElement("label",{className:c.A.label,htmlFor:t},a),Boolean(n)&&n,React.createElement("textarea",{className:c.A.textarea,disabled:e,placeholder:r,rows:l,id:t,name:t,onChange:i,value:s||""}))},1571:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var c=a(7425),n=a(7723),r=a(1113),l=a(1609),s=a.n(l),i=a(5576),o=a(9054);const __=n.__,m=e=>{switch(e.fixer){case"replace":return __("Jetpack Scan will replace the affected file or directory.","jetpack-protect");case"delete":return __("Jetpack Scan will delete the affected file or directory.","jetpack-protect");case"update":return e.target?(0,n.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */ +__("Jetpack Scan will update to a newer version %s.","jetpack-protect"),e.target):__("Jetpack Scan will update to a newer version.","jetpack-protect");case"edit":return __("Jetpack Scan will edit the affected file or directory.","jetpack-protect");case"rollback":return e.target?(0,n.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */ +__("Jetpack Scan will rollback the affected file to the version from %s.","jetpack-protect"),e.target):__("Jetpack Scan will rollback the affected file to an older (clean) version.","jetpack-protect");default:return __("Jetpack Scan will resolve the threat.","jetpack-protect")}};function p({threat:e,fixAllDialog:t,onCheckFix:a}){const[n,p]=(0,l.useState)(!0),d=(0,l.useCallback)((t=>{p(t.target.checked),a(t.target.checked,e)}),[a,e]);return s().createElement(s().Fragment,null,s().createElement("div",{className:o.A.threat},s().createElement(r.A,{icon:e.icon,className:o.A.threat__icon}),s().createElement("div",{className:o.A.threat__summary},s().createElement(c.Ay,{className:o.A.threat__summary__label,mb:1},e.label),s().createElement(c.Ay,{className:o.A.threat__summary__title},m(e.fixable))),s().createElement("div",{className:o.A.threat__severity},s().createElement(i.A,{severity:e.severity})),t&&s().createElement("div",{className:o.A.threat__checkbox},s().createElement("input",{type:"checkbox",checked:n,onChange:d,value:e.id}))))}},9314:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(7425),n=a(6087),r=a(7723),l=a(1609),s=a(727),i=a(4254),o=a(3535),m=a(1476);const __=r.__,_n=r._n,p=()=>React.createElement("svg",{width:"80",height:"96",viewBox:"0 0 80 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40 0.00634766L80 17.7891V44.2985C80 66.8965 65.1605 88.2927 44.2352 95.0425C41.4856 95.9295 38.5144 95.9295 35.7648 95.0425C14.8395 88.2927 0 66.8965 0 44.2985V17.7891L40 0.00634766Z",fill:"#069E08"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9 33.6909L35.375 67.9124L19.2047 55.9263L22.7848 51.1264L34.1403 59.5436L56.0851 30.122L60.9 33.6909Z",fill:"white"})),d=()=>{const{lastChecked:e,hasRequiredPlan:t}=(0,s.A)(),[a,d]=(0,l.useState)(null),u=(0,l.useMemo)((()=>e?(e=>{const t=new Date,a=6e4*t.getTimezoneOffset(),c=Math.floor((new Date(t.getTime()+a).getTime()-e)/1e3);let n=c/31536e3;return n>1?(0,r.sprintf)( +// translators: placeholder is a number amount of years i.e. "5 years ago". +_n("%s year ago","%s years ago",Math.floor(n),"jetpack-protect"),Math.floor(n)):(n=c/2592e3,n>1?(0,r.sprintf)( +// translators: placeholder is a number amount of months i.e. "5 months ago". +_n("%s month ago","%s months ago",Math.floor(n),"jetpack-protect"),Math.floor(n)):(n=c/86400,n>1?(0,r.sprintf)( +// translators: placeholder is a number amount of days i.e. "5 days ago". +_n("%s day ago","%s days ago",Math.floor(n),"jetpack-protect"),Math.floor(n)):(n=c/3600,n>1?(0,r.sprintf)( +// translators: placeholder is a number amount of hours i.e. "5 hours ago". +_n("%s hour ago","%s hours ago",Math.floor(n),"jetpack-protect"),Math.floor(n)):(n=c/60,n>1?(0,r.sprintf)( +// translators: placeholder is a number amount of minutes i.e. "5 minutes ago". +_n("%s minute ago","%s minutes ago",Math.floor(n),"jetpack-protect"),Math.floor(n)):__("a few seconds ago","jetpack-protect")))))})(Date.parse(e)):null),[e]);return React.createElement("div",{className:m.A.empty},React.createElement(p,null),React.createElement(c.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(c.Ay,{mb:4},(0,n.createInterpolateElement)((0,r.sprintf)( +// translators: placeholder is the amount of time since the last scan, i.e. "5 minutes ago". +__("The last Protect scan ran %s and everything looked great.","jetpack-protect"),u),{strong:React.createElement("strong",null)})),t&&React.createElement(React.Fragment,null,React.createElement(o.A,{ref:d}),React.createElement(i.A,{id:"paid-daily-and-manual-scans",position:"bottom middle",anchor:a})))}},5190:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var c=a(1112),n=a(7425),r=a(4437),l=a(9384),s=a(7723),i=a(1609),o=a.n(i),m=a(8140),p=a(1226),d=a(4114),u=a(4569),h=a(1476);const __=s.__,g=({description:e,fixedIn:t,icon:a,id:u,label:g,name:v,source:f,title:E,type:A})=>{const{adminUrl:y}=window.jetpackProtectInitialState||{},{run:w}=(0,l.useProductCheckoutWorkflow)({productSlug:m.J3,redirectUrl:y,useBlogIdSuffix:!0}),{recordEventHandler:k}=(0,p.A)(),b=k("jetpack_protect_threat_list_get_scan_link_click",w),_=f?o().createElement(c.A,{variant:"link",isExternalLink:!0,weight:"regular",href:f},__("See more technical details of this threat","jetpack-protect")):null;return o().createElement(d.E,{id:u,label:g,title:E,icon:a,onOpen:(0,i.useCallback)((()=>{["core","plugin","theme"].includes(A)&&k(`jetpack_protect_${A}_threat_open`)}),[k,A])},e&&o().createElement("div",{className:h.A["threat-section"]},o().createElement(n.Ay,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),o().createElement(n.Ay,{mb:2},e),_),t&&o().createElement("div",{className:h.A["threat-section"]},o().createElement(n.Ay,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),o().createElement(n.Ay,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ /* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ +(0,s.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),v,t)),o().createElement(r.A,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:b,className:h.A["threat-item-cta"]})),!e&&o().createElement("div",{className:h.A["threat-section"]},_))},v=({list:e})=>o().createElement(u.A,{list:e},(({currentItems:e})=>o().createElement(d.A,null,e.map((({description:e,fixedIn:t,icon:a,id:c,label:n,name:r,source:l,table:s,title:i,type:m,version:p})=>o().createElement(g,{description:e,fixedIn:t,icon:a,id:c,label:n,key:c,name:r,source:l,table:s,title:i,type:m,version:p}))))))},5661:(e,t,a)=>{"use strict";a.d(t,{A:()=>k});var c=a(442),n=a(5918),r=a(8509),l=a(7425),s=a(1112),i=a(7143),o=a(7723),m=a(1609),p=a.n(m),d=a(727),u=a(7478),h=a(4254),g=a(3535),v=a(9314),f=a(5190),E=a(9395),A=a(6742),y=a(1476),w=a(993);const __=o.__,k=()=>{const{hasRequiredPlan:e}=(0,d.A)(),{item:t,list:a,selected:k,setSelected:b}=(0,w.A)(),_=a.filter((e=>e.fixable)),[R]=(0,c.A)("sm"),[C,j]=(0,m.useState)(null),[S,x]=(0,m.useState)(null),{setModal:N}=(0,i.useDispatch)(u.a),[M,L]=(0,m.useState)(null),[z,P]=(0,m.useState)(null),I=(0,m.useCallback)((()=>{switch(k){case"all":return 1===a.length?__("All threats","jetpack-protect"):(0,o.sprintf)(/* translators: placeholder is the amount of threats found on the site. */ +__("All %s threats","jetpack-protect"),a.length);case"core":return(0,o.sprintf)(/* translators: placeholder is the amount of WordPress threats found on the site. */ +__("%1$s WordPress %2$s","jetpack-protect"),a.length,1===a.length?"threat":"threats");case"files":return(0,o.sprintf)(/* translators: placeholder is the amount of file threats found on the site. */ +__("%1$s file %2$s","jetpack-protect"),a.length,1===a.length?"threat":"threats");case"database":return(0,o.sprintf)(/* translators: placeholder is the amount of database threats found on the site. */ +__("%1$s database %2$s","jetpack-protect"),a.length,1===a.length?"threat":"threats");default:return(0,o.sprintf)(/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ +__("%1$s %2$s in %3$s %4$s","jetpack-protect"),a.length,1===a.length?"threat":"threats",t?.name,t?.version)}}),[k,a,t]);return p().createElement(n.A,{fluid:!0,horizontalSpacing:0,horizontalGap:3},p().createElement(r.A,{lg:4},p().createElement("div",{ref:j},p().createElement(E.A,{selected:k,onSelect:b})),p().createElement(h.A,{id:e?"paid-scan-results":"free-scan-results",position:"top",anchor:C})),p().createElement(r.A,{lg:8},a?.length>0?p().createElement(p().Fragment,null,p().createElement("div",{className:y.A["list-header"]},p().createElement(l.hE,{className:y.A["list-title"]},I()),e&&p().createElement("div",{className:y.A["list-header__controls"]},_.length>0&&p().createElement(p().Fragment,null,p().createElement(s.A,{ref:L,variant:"primary",onClick:(T=_,e=>{e.preventDefault(),N({type:"FIX_ALL_THREATS",props:{threatList:T}})})},(0,o.sprintf)(/* translators: Translates to Show auto fixers $s: Number of fixable threats. */ +__("Show auto fixers (%s)","jetpack-protect"),_.length)),p().createElement(h.A,{id:"paid-fix-all-threats",position:R?"bottom right":"middle left",anchor:M})),p().createElement("div",null,p().createElement(g.A,{ref:P}),p().createElement(h.A,{id:"paid-daily-and-manual-scans",position:R?"bottom left":"middle left",anchor:z})))),e?p().createElement(p().Fragment,null,p().createElement("div",{ref:x},p().createElement(A.A,{list:a}),p().createElement("div",{className:y.A["manual-scan"]},p().createElement(l.Ay,{variant:"body-small",mb:4},__("If you have manually fixed any of the threats listed above, you can run a manual scan now or wait for Jetpack to scan your site later today.","jetpack-protect")),p().createElement(g.A,null))),p().createElement(h.A,{id:"paid-understand-severity",position:"top",anchor:S})):p().createElement(f.A,{list:a})):p().createElement(v.A,null)));var T}},9395:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var c=a(442),n=a(7723),r=a(311),l=a(4648),s=a(435),i=a(2072),o=a(4314),m=a(1651),p=a(1609),d=a(1226),u=a(727),h=a(59);const __=n.__,g=({selected:e,onSelect:t,sourceType:a="scan",statusFilter:n="all"})=>{const{results:{plugins:g,themes:v},counts:{current:{threats:f,core:E,files:A,database:y}},hasRequiredPlan:w}=(0,u.A)({sourceType:a,filter:{status:n}}),{recordEvent:k}=(0,d.A)(),[b]=(0,c.A)("lg","<"),_=(0,p.useCallback)((()=>{k("jetpack_protect_navigation_all_click")}),[k]),R=(0,p.useCallback)((()=>{k("jetpack_protect_navigation_core_click")}),[k]),C=(0,p.useCallback)((()=>{k("jetpack_protect_navigation_plugin_click")}),[k]),j=(0,p.useCallback)((()=>{k("jetpack_protect_navigation_theme_click")}),[k]),S=(0,p.useCallback)((()=>{k("jetpack_protect_navigation_file_click")}),[k]),x=(0,p.useCallback)((()=>{k("jetpack_protect_navigation_database_click")}),[k]),N=(0,p.useMemo)((()=>"fixed"===n?__("All fixed threats","jetpack-protect"):"ignored"===n?__("All ignored threats","jetpack-protect",0):__("All threats","jetpack-protect")),[n]);return React.createElement(h.Ay,{selected:e,onSelect:t,mode:b?"dropdown":"list"},React.createElement(h.s$,{initial:!0,id:"all",label:N,icon:r.A,badge:f,disabled:f<=0,onClick:_,checked:!0}),React.createElement(h.s$,{id:"core",label:__("WordPress","jetpack-protect"),icon:l.A,badge:E,disabled:E<=0,onClick:R,checked:!0}),React.createElement(h.Me,{label:__("Plugins","jetpack-protect"),icon:s.A},g.map((({name:e,threats:t,checked:a})=>React.createElement(h.s$,{key:e,id:e,label:e,checked:a,badge:t?.length,disabled:t?.length<=0,onClick:C})))),React.createElement(h.Me,{label:__("Themes","jetpack-protect"),icon:i.A},v.map((({name:e,threats:t,checked:a})=>React.createElement(h.s$,{key:e,id:e,label:e,checked:a,badge:t?.length,disabled:t?.length<=0,onClick:j})))),w&&React.createElement(React.Fragment,null,React.createElement(h.s$,{id:"files",label:__("Files","jetpack-protect"),icon:o.A,badge:A,disabled:A<=0,onClick:S,checked:!0}),React.createElement(h.s$,{id:"database",label:__("Database","jetpack-protect"),icon:m.A,badge:y,disabled:y<=0,onClick:x,checked:!0})))}},4569:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(1112),n=a(442),r=a(7723),l=a(8888),s=a(9115),i=a(1609),o=a.n(i),m=a(1476);const __=r.__,p=({pageNumber:e,currentPage:t,onPageChange:a})=>{const n=(0,i.useMemo)((()=>t===e),[t,e]),l=(0,i.useCallback)((()=>{a(e)}),[a,e]);return o().createElement(c.A,{size:"medium",className:n?null:m.A.unfocused,onClick:l,"aria-current":n?"page":void 0,"aria-label":(0,r.sprintf)(/* translators: placeholder is a page number, i.e. "Page 123" */ +__("Page %d","jetpack-protect"),e)},e)},d=({list:e,itemPerPage:t=10,children:a})=>{const[r]=(0,n.A)("sm"),[d,u]=(0,i.useState)(1),h=(0,i.useCallback)((()=>u(d-1)),[d,u]),g=(0,i.useCallback)((()=>u(d+1)),[d,u]),v=(0,i.useMemo)((()=>Math.ceil(e.length/t)),[e,t]),f=(0,i.useMemo)((()=>{const a=d*t,c=a-t;return e.slice(c,a)}),[d,e,t]),E=(0,i.useMemo)((()=>{if(r)return[d];const e=[1];return d>3&&v>4&&e.push("…"),1===d?e.push(d+1,d+2,d+3):2===d?e.push(d,d+1,d+2):d3&&e.push(d-2),d>2&&e.push(d-1),e.push(d)):d===v&&(d>=5&&e.push(d-3),d>=4&&e.push(d-2),e.push(d-1)),e[e.length-1]e<=v||isNaN(e)))}),[d,r,v]);return o().createElement(o().Fragment,null,a({currentItems:f}),v>1&&o().createElement("nav",{role:"navigation","aria-label":__("Threat list pages","jetpack-protect"),className:m.A["pagination-container"]},o().createElement(c.A,{onClick:h,disabled:1===d,variant:"link",icon:l.A,iconSize:24,"aria-label":__("Previous page","jetpack-protect")}),E.map(((e,t)=>"number"==typeof e?o().createElement(p,{key:e,pageNumber:e,currentPage:d,onPageChange:u}):o().createElement("span",{key:`ellipses_${t}`},e))),o().createElement(c.A,{onClick:g,disabled:d===v,variant:"link",icon:s.A,iconSize:24,"aria-label":__("Next page","jetpack-protect")})))}},6742:(e,t,a)=>{"use strict";a.d(t,{A:()=>E});var c=a(1112),n=a(7425),r=a(442),l=a(7143),s=a(7723),i=a(1609),o=a.n(i),m=a(1226),p=a(7478),d=a(9627),u=a(8331),h=a(2006),g=a(4569),v=a(1476);const __=s.__,f=({context:e,description:t,diff:a,filename:r,firstDetected:g,fixedIn:f,fixedOn:E,icon:A,fixable:y,id:w,label:k,name:b,source:_,title:R,type:C,severity:j,status:S,hideAutoFixColumn:x=!1})=>{const N=(0,l.useSelect)((e=>e(p.a).getThreatsAreFixing())),{setModal:M}=(0,l.useDispatch)(p.a),{recordEvent:L}=(0,m.A)(),z=N.indexOf(w)>=0,P=_?o().createElement(c.A,{variant:"link",isExternalLink:!0,weight:"regular",href:_},__("See more technical details of this threat","jetpack-protect")):null;return o().createElement(h.S,{id:w,label:k,title:R,icon:A,fixable:y,severity:j,firstDetected:g,fixedOn:E,status:S,onOpen:(0,i.useCallback)((()=>{["core","plugin","theme","file","database"].includes(C)&&L(`jetpack_protect_${C}_threat_open`)}),[L,C]),hideAutoFixColumn:x},t&&o().createElement("div",{className:v.A["threat-section"]},o().createElement(n.Ay,{variant:"title-small",mb:2},"fixed"!==S?__("What is the problem?","jetpack-protect"):__("What was the problem?","jetpack-protect",0)),o().createElement(n.Ay,{mb:2},t),P),(r||e||a)&&o().createElement(n.Ay,{variant:"title-small",mb:2},__("The technical details","jetpack-protect")),r&&o().createElement(o().Fragment,null,o().createElement(n.Ay,{mb:2},/* translators: filename follows in separate line; e.g. "PHP.Injection.5 in: `post.php`" */ +__("Threat found in file:","jetpack-protect")),o().createElement("pre",{className:v.A["threat-filename"]},r)),e&&o().createElement(u.A,{context:e}),a&&o().createElement(d.A,{diff:a}),f&&"fixed"!==S&&o().createElement("div",{className:v.A["threat-section"]},o().createElement(n.Ay,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),o().createElement(n.Ay,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ /* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ +(0,s.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),b,f))),!t&&o().createElement("div",{className:v.A["threat-section"]},P),["ignored","current"].includes(S)&&o().createElement("div",{className:v.A["threat-footer"]},"ignored"===S&&o().createElement(c.A,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),M({type:"UNIGNORE_THREAT",props:{id:w,label:k,title:R,icon:A,severity:j}})},disabled:z},__("Unignore threat","jetpack-protect")),"current"===S&&o().createElement(o().Fragment,null,o().createElement(c.A,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),M({type:"IGNORE_THREAT",props:{id:w,label:k,title:R,icon:A,severity:j}})}},__("Ignore threat","jetpack-protect")),y&&o().createElement(c.A,{disabled:z,onClick:e=>{e.preventDefault(),M({type:"FIX_THREAT",props:{id:w,fixable:y,label:k,icon:A,severity:j}})}},__("Fix threat","jetpack-protect")))))},E=({list:e,hideAutoFixColumn:t=!1})=>{const[a]=(0,r.A)(["sm","lg"],[null,"<"]);return o().createElement(o().Fragment,null,!a&&o().createElement("div",{className:v.A["accordion-header"]},o().createElement("span",null,__("Details","jetpack-protect")),o().createElement("span",null,__("Severity","jetpack-protect")),!t&&o().createElement("span",null,__("Auto-fix","jetpack-protect")),o().createElement("span",null)),o().createElement(g.A,{list:e},(({currentItems:e})=>o().createElement(h.A,null,e.map((({context:e,description:a,diff:c,filename:n,firstDetected:r,fixedIn:l,fixedOn:s,icon:i,fixable:m,id:p,label:d,name:u,severity:h,source:g,table:v,title:E,type:A,version:y,status:w})=>o().createElement(f,{context:e,description:a,diff:c,filename:n,firstDetected:r,fixedIn:l,fixedOn:s,icon:i,fixable:m,id:p,key:p,label:d,name:u,severity:h,source:g,table:v,title:E,type:A,version:y,status:w,hideAutoFixColumn:t})))))))}},993:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(4648),n=a(4314),r=a(1651),l=a(435),s=a(2072),i=a(1609),o=a(727);const m=(e,t)=>t.severity-e.severity,p=(e,t)=>"object"==typeof e&&0===Object.keys(e).length?[]:Array.isArray(e)?e.map((e=>p(e,t))).flat():e?.threats.map((a=>({...a,...e,...t}))),d=({source:e,status:t}={source:"scan",status:"all"})=>{const[a,d]=(0,i.useState)("all"),{results:{plugins:u,themes:h,core:g,files:v,database:f}}=(0,o.A)({sourceType:e,filter:{status:t,key:a}}),{unsortedList:E,item:A}=(0,i.useMemo)((()=>{if(a&&"all"!==a){switch(a){case"core":return{unsortedList:p(g,{icon:c.A}),item:g};case"files":return{unsortedList:p({threats:v},{icon:n.A}),item:v};case"database":return{unsortedList:p({threats:f},{icon:r.A}),item:f}}const e=u.find((e=>e?.name===a));if(e)return{unsortedList:p(e,{icon:l.A}),item:e};const t=h.find((e=>e?.name===a));if(t)return{unsortedList:p(t,{icon:s.A}),item:t}}return{unsortedList:[...p(g,{icon:c.A}),...p(u,{icon:l.A}),...p(h,{icon:s.A}),...p({threats:v},{icon:n.A}),...p({threats:f},{icon:r.A})],item:null}}),[g,f,v,u,a,h]),y=e=>e.name&&e.version?`${e.name} (${e.version})`:e.filename?e.filename.split("/").pop():e.table?e.table:void 0,w=(0,i.useMemo)((()=>E.sort(m).map((e=>({label:y(e),...e})))),[E]);return(0,i.useEffect)((()=>{"all"!==a&&"all"!==t&&0===w.length&&d("all")}),[a,t,A,w]),{item:A,list:w,selected:a,setSelected:d}}},9623:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(7425),n=a(1112),r=a(7143),l=a(7723),s=a(1113),i=a(7478),o=a(5576),m=a(4031),p=a(6834);const __=l.__,d=({id:e,title:t,label:a,icon:l,severity:d})=>{const{setModal:u,unignoreThreat:h}=(0,r.useDispatch)(i.a),g=(0,r.useSelect)((e=>e(i.a).getThreatsUpdating()));return React.createElement(m.A,null,React.createElement(c.Ay,{variant:"title-medium",mb:2},__("Do you really want to unignore this threat?","jetpack-protect")),React.createElement(c.Ay,{mb:3},__("Jetpack will unignore the threat:","jetpack-protect")),React.createElement("div",{className:p.A.threat},React.createElement(s.A,{icon:l,className:p.A.threat__icon}),React.createElement("div",{className:p.A.threat__summary},React.createElement(c.Ay,{className:p.A.threat__summary__label,mb:1},a),React.createElement(c.Ay,{className:p.A.threat__summary__title},t)),React.createElement("div",{className:p.A.threat__severity},React.createElement(o.A,{severity:d}))),React.createElement("div",{className:p.A.footer},React.createElement(n.A,{variant:"secondary",onClick:e=>{e.preventDefault(),u({type:null})}},__("Cancel","jetpack-protect")),React.createElement(n.A,{isDestructive:!0,isLoading:Boolean(g&&g[e]),onClick:async t=>{t.preventDefault(),h(e,(()=>{u({type:null})}))}},__("Unignore threat","jetpack-protect"))))}},4031:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(9384),n=a(1221);const r=({children:e})=>{const{isUserConnected:t,hasConnectedOwner:a}=(0,c.useConnection)();return t&&a?e:React.createElement(n.A,null)}},1221:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var c=a(7425),n=a(1112),r=a(9384),l=a(7143),s=a(7723),i=a(7478),o=a(3041),m=a(8340);const __=s.__,p=()=>{const{setModal:e}=(0,l.useDispatch)(i.a),{userIsConnecting:t,handleConnectUser:a}=(0,r.useConnection)({redirectUri:"admin.php?page=jetpack-protect"});return React.createElement(React.Fragment,null,React.createElement(c.Ay,{variant:"title-medium",mb:2},__("User connection needed","jetpack-protect")),React.createElement(o.A,{type:"info",message:__("Before Jetpack Protect can ignore and auto-fix threats on your site, a user connection is needed.","jetpack-protect")}),React.createElement(c.Ay,{mb:3},__("A user connection provides Jetpack Protect the access necessary to perform these tasks.","jetpack-protect")),React.createElement(c.Ay,{mb:3},__("Once you’ve secured a user connection, all Jetpack Protect features will be available for use.","jetpack-protect")),React.createElement("div",{className:m.A.footer},React.createElement(n.A,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-protect")),React.createElement(n.A,{isExternalLink:!0,weight:"regular",isLoading:t,onClick:a},__("Connect your user account","jetpack-protect"))))}},8140:(e,t,a)=>{"use strict";a.d(t,{J3:()=>r,JD:()=>l,Mm:()=>i,NW:()=>n,_R:()=>s,pQ:()=>c,vI:()=>o});const c="https://wordpress.org/support/plugin/jetpack-protect/",n="https://jetpack.com/contact-support/?rel=support",r="jetpack_scan",l="optimistically_scanning",s="idle",i="unavailable",o=["scheduled","scanning",l]},1226:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(372),n=a(9384),r=a(1609);const l=({pageViewEventName:e,pageViewNamespace:t="jetpack",pageViewSuffix:a="page_view",pageViewEventProperties:l={}}={})=>{const{isUserConnected:s,isRegistered:i,userConnectionData:o}=(0,n.useConnection)(),{login:m,ID:p}=o.currentUser?.wpcomUser||{},{tracks:d}=c.A,{recordEvent:u}=d,h=(0,r.useCallback)((async(e,t)=>{u(e,t)}),[u]),g=(0,r.useCallback)(((e,t,a=()=>{})=>(a="function"==typeof t?t:a,t="function"==typeof t?{}:t,()=>h(e,t).then(a))),[h]);(0,r.useEffect)((()=>{s&&p&&m&&c.A.initialize(p,m)}),[s,p,m]);const v=e?`${t}_${e}_${a}`:null;return(0,r.useEffect)((()=>{i&&v&&u(v,l)}),[]),{recordEvent:h,recordEventHandler:g}}},1936:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>m,Ll:()=>o,OC:()=>i,dn:()=>s});var c=a(7143),n=a(1609),r=a(5973),l=a(7478);const s=(0,n.createContext)([]),i=(0,n.createContext)([]),o=({children:e})=>{const[t,a]=(0,n.useState)([]);return React.createElement(i.Provider,{value:{renderedSteps:t,setRenderedSteps:a}},e)},m=()=>{const{completeOnboardingSteps:e,fetchOnboardingProgress:t}=r.A,a=(0,n.useContext)(s),{renderedSteps:o}=(0,n.useContext)(i),m=(0,c.useSelect)((e=>e(l.a).getOnboardingProgress())),{setOnboardingProgress:p}=(0,c.useDispatch)(l.a),{currentStep:d,currentStepCount:u,stepsCount:h}=(0,n.useMemo)((()=>a.reduce(((e,t)=>(o.includes(t.id)&&(e.stepsCount++,e.currentStep||-1!==(m||[]).indexOf(t.id)||(e.currentStep=t,e.currentStepCount=e.stepsCount)),e)),{currentStep:null,currentStepCount:null,stepsCount:0})),[m,o,a]),g=(0,n.useCallback)((()=>{d&&(p([...m,d.id]),e([d.id]))}),[d,p,m,e]),v=(0,n.useCallback)((()=>{const t=a.reduce(((e,t)=>(t.id.startsWith("free-")&&e.push(t.id),e)),[]),c=[...m,...t];p([...new Set(c)]),e(t)}),[a,m,p,e]),f=(0,n.useCallback)((()=>{const t=a.reduce(((e,t)=>(t.id.startsWith("paid-")&&e.push(t.id),e)),[]),c=[...m,...t];p([...new Set(c)]),e(t)}),[a,m,p,e]),E=(0,n.useCallback)((()=>{d.id.startsWith("paid-")?f():v()}),[v,f,d]);return(0,n.useEffect)((()=>{null===m&&t().then((e=>p(e)))}),[t,m,p]),{progress:m,stepsCount:h,currentStep:d,currentStepCount:u,completeCurrentStep:g,completeAllCurrentSteps:E}}},727:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(7143),n=a(7723),r=a(1609),l=a(7478);const __=n.__,s=["all","core","plugins","themes","files","database"],i=(e,t,a)=>Array.isArray(e)?e.filter((e=>(!t.status||"all"===t.status||e.status===t.status)&&(!t.key||"all"===t.key||t.key===a))):[];function o({sourceType:e,filter:t}={sourceType:"scan",filter:{status:null,key:null}}){const{status:a,scanHistory:n,jetpackScan:o,hasRequiredPlan:m}=(0,c.useSelect)((e=>({status:e(l.a).getStatus(),scanHistory:e(l.a).getScanHistory(),jetpackScan:e(l.a).getJetpackScan(),hasRequiredPlan:e(l.a).hasRequiredPlan()}))),{counts:p,results:d,error:u,lastChecked:h,hasUncheckedItems:g}=(0,r.useMemo)((()=>{const c="history"===e?{...n}:{...a},r={results:{core:[],plugins:[],themes:[],files:[],database:[]},counts:{all:{threats:0,core:0,plugins:0,themes:0,files:0,database:0},current:{threats:0,core:0,plugins:0,themes:0,files:0,database:0}},error:null,lastChecked:c.lastChecked||null,hasUncheckedItems:c.hasUncheckedItems||!1},l=(e,a)=>{if(!Array.isArray(e))return[];e.forEach((e=>{r.counts.all[a]+=e?.threats?.length||0,r.counts.all.threats+=e?.threats?.length||0;const c=i(e?.threats,t,s.includes(t.key)?a:e?.name);r.results[a].push({...e,threats:c}),r.counts.current[a]+=c.length,r.counts.current.threats+=c.length}))},o=(e,a)=>{if(!Array.isArray(e))return[];r.counts.all[a]+=e.length,r.counts.all.threats+=e.length;const c=i(e,t,a);r.results[a]=[...r.results[a],...c],r.counts.current[a]+=c.length,r.counts.current.threats+=c.length};let m=Array.isArray(c.core)?c.core:[];return c.core.threats&&(m=[c.core]),l(m,"core"),l(c?.plugins,"plugins"),l(c?.themes,"themes"),o(c?.files,"files"),o(c?.database,"database"),c.error&&(r.error={message:c.errorMessage||__("An error occurred.","jetpack-protect"),code:c.errorCode||500}),r}),[n,e,a,t]);return{results:d,counts:p,error:u,lastChecked:h,hasUncheckedItems:g,jetpackScan:o,hasRequiredPlan:m}}},6516:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var c=a(7143),n=a(1609),r=a(5973),l=a(7478);const s=()=>{const{setWafConfig:e,setWafStats:t,setWafIsEnabled:a,setWafIsUpdating:s,setWafIsToggling:i}=(0,c.useDispatch)(l.a),o=(0,c.useSelect)((e=>e(l.a).getWaf())),m=(0,n.useCallback)((()=>(s(!0),r.A.fetchWaf().then((c=>{a(c?.isEnabled),e(c?.config),t(c?.stats)})).finally((()=>s(!1))))),[e,t,a,s]),p=(0,n.useCallback)((()=>(o.isEnabled||i(!0),s(!0),r.A.toggleWaf().then(m).finally((()=>{i(!1),s(!1)})))),[m,o.isEnabled,i,s]),d=(0,n.useCallback)((()=>o.isEnabled?Promise.resolve():p()),[p,o.isEnabled]),u=(0,n.useCallback)((()=>(s(!0),d().then((()=>r.A.updateWaf({jetpack_waf_automatic_rules:!o.config.jetpackWafAutomaticRules}))).then(m).finally((()=>s(!1))))),[d,m,s,o.config.jetpackWafAutomaticRules]),h=(0,n.useCallback)((()=>(s(!0),r.A.updateWaf({jetpack_waf_ip_allow_list_enabled:!o.config.jetpackWafIpAllowListEnabled}).then(m).finally((()=>s(!1))))),[m,s,o.config.jetpackWafIpAllowListEnabled]),g=(0,n.useCallback)((()=>(s(!0),r.A.updateWaf({jetpack_waf_ip_block_list_enabled:!o.config.jetpackWafIpBlockListEnabled}).then(m).finally((()=>s(!1))))),[m,s,o.config.jetpackWafIpBlockListEnabled]),v=(0,n.useCallback)((()=>(s(!0),r.A.updateWaf({brute_force_protection:!o.config.bruteForceProtection}).then(m).finally((()=>s(!1))))),[m,s,o.config.bruteForceProtection]),f=(0,n.useCallback)((()=>(s(!0),d().then((()=>r.A.updateWaf({jetpack_waf_share_data:!o.config.jetpackWafShareData}))).then(m).finally((()=>s(!1))))),[d,m,s,o.config.jetpackWafShareData]),E=(0,n.useCallback)((()=>(s(!0),d().then((()=>r.A.updateWaf({jetpack_waf_share_debug_data:!o.config.jetpackWafShareDebugData}))).then(m).finally((()=>s(!1))))),[d,m,s,o.config.jetpackWafShareDebugData]),A=(0,n.useCallback)((e=>(s(!0),r.A.updateWaf(e).then(m).finally((()=>s(!1))))),[m,s]);return(0,n.useEffect)((()=>{void 0!==o.config||o.isFetching||m()}),[o.config,o.isFetching,s,m]),{...o,refreshWaf:m,toggleWaf:p,toggleAutomaticRules:u,toggleIpAllowList:h,toggleIpBlockList:g,toggleBruteForceProtection:v,toggleShareData:f,toggleShareDebugData:E,updateConfig:A}}},1671:(e,t,a)=>{"use strict";a.d(t,{A:()=>I});var c=a(442),n=a(7656),r=a(7425),l=a(1112),s=a(4437),i=a(5918),o=a(8509),m=a(9384),p=a(6427),d=a(7143),u=a(6087),h=a(7723),g=a(1113),v=a(1249),f=a(6154),E=a.n(f),A=a(1609),y=a(5973),w=a(1186),k=a(8955),b=a(9921),_=a(7508),R=a(9454),C=a(4491),j=a(8140),S=a(1226),x=a(727),N=a(6516),M=a(7478),L=a(7642);const __=h.__,z=window?.jetpackProtectInitialState?.adminUrl,P=5e3,I=()=>{const[e]=(0,c.A)(["sm","lg"],[null,"<"]),{setWafIsSeen:t,setWafUpgradeIsSeen:a,setNotice:f}=(0,d.useDispatch)(M.a),{config:{jetpackWafAutomaticRules:I,jetpackWafIpBlockListEnabled:T,jetpackWafIpAllowListEnabled:V,jetpackWafIpBlockList:F,jetpackWafIpAllowList:H,automaticRulesAvailable:B,bruteForceProtection:O},currentIp:D,isEnabled:U,isSeen:W,upgradeIsSeen:q,displayUpgradeBadge:$,wafSupported:J,isUpdating:G,stats:{automaticRulesLastUpdated:Z},toggleAutomaticRules:K,toggleIpAllowList:Q,toggleIpBlockList:Y,toggleBruteForceProtection:X,toggleWaf:ee,updateConfig:te}=(0,N.A)(),{hasRequiredPlan:ae}=(0,x.A)(),{run:ce}=(0,m.useProductCheckoutWorkflow)({productSlug:j.J3,redirectUrl:`${z}#/firewall`,useBlogIdSuffix:!0}),{recordEventHandler:ne,recordEvent:re}=(0,S.A)(),[le,se]=(0,A.useState)(!1),[ie,oe]=(0,A.useState)({jetpack_waf_automatic_rules:I,jetpack_waf_ip_block_list_enabled:T,jetpack_waf_ip_allow_list_enabled:V,jetpack_waf_ip_block_list:F,jetpack_waf_ip_allow_list:H,brute_force_protection:O}),[me,pe]=(0,A.useState)(!1),[de,ue]=(0,A.useState)(!1),[he,ge]=(0,A.useState)(!1),ve=U&&!me,fe=U&&(ae||B),Ee=!me&&!!ie.jetpack_waf_ip_allow_list_enabled,Ae=ie.jetpack_waf_ip_block_list!==F,ye=ie.jetpack_waf_ip_allow_list!==H,we=!!ie.jetpack_waf_ip_block_list,ke=!!ie.jetpack_waf_ip_allow_list,be=U&&ie.jetpack_waf_ip_block_list_enabled,_e=(0,A.useCallback)((e=>{switch(e.code){case"file_system_error":return __("A filesystem error occurred.","jetpack-protect");case"rules_api_error":return __("An error occurred retrieving the latest firewall rules from Jetpack.","jetpack-protect");default:return!1}}),[]),Re=(0,A.useCallback)((e=>{const t=_e(e)||__("An error occurred.","jetpack-protect"),a=(0,u.createInterpolateElement)(__("Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(p.ExternalLink,{href:ae?j.NW:j.pQ})});f({type:"error",message:React.createElement(React.Fragment,null,t," ",a)})}),[_e,f,ae]),Ce=ne("jetpack_protect_waf_page_get_scan_link_click",ce),je=(0,A.useCallback)((()=>{pe(!0),ue(!0),te(ie).then((()=>f({type:"success",duration:P,message:__("Allow list changes saved.","jetpack-protect")}))).catch(Re).finally((()=>{pe(!1),ue(!1)}))}),[te,ie,Re,f]),Se=(0,A.useCallback)((()=>{pe(!0),ge(!0),te(ie).then((()=>f({type:"success",duration:P,message:__("Block list changes saved.","jetpack-protect")}))).catch(Re).finally((()=>{pe(!1),ge(!1)}))}),[te,ie,Re,f]),xe=(0,A.useCallback)((e=>{const{value:t,id:a}=e.target;oe({...ie,[a]:t})}),[ie]),Ne=(0,A.useCallback)((()=>{pe(!0);const e=!ie.jetpack_waf_automatic_rules;oe({...ie,jetpack_waf_automatic_rules:e}),K().then((()=>{se(!1),f({type:"success",duration:P,message:e?__("Automatic firewall protection is enabled.","jetpack-protect"):__("Automatic firewall protection is disabled.","jetpack-protect",0)}),re(e?"jetpack_protect_automatic_rules_enabled":"jetpack_protect_automatic_rules_disabled")})).then((()=>{q||(a(!0),y.A.wafUpgradeSeen())})).catch((e=>{se(!0),Re(e)})).finally((()=>pe(!1)))}),[ie,K,f,re,q,a,Re]),Me=(0,A.useCallback)((()=>{pe(!0);const e=!ie.brute_force_protection;oe({...ie,brute_force_protection:e}),X().then((()=>{f({type:"success",duration:P,message:e?__("Brute force protection is enabled.","jetpack-protect"):__("Brute force protection is disabled.","jetpack-protect",0)}),re(e?"jetpack_protect_brute_force_protection_enabled":"jetpack_protect_brute_force_protection_disabled")})).catch(Re).finally((()=>pe(!1)))}),[ie,X,Re,f,re]),Le=(0,A.useCallback)((()=>{const e=!ie.jetpack_waf_ip_allow_list_enabled;pe(!0),ue(!0),oe({...ie,jetpack_waf_ip_allow_list_enabled:e}),Q().then((()=>{f({type:"success",duration:P,message:e?__("Allow list active.","jetpack-protect"):__("Allow list is disabled.","jetpack-protect",0)}),re(e?"jetpack_protect_ip_allow_list_enabled":"jetpack_protect_ip_allow_list_disabled")})).catch(Re).finally((()=>{pe(!1),ue(!1)}))}),[ie,Q,Re,f,re]),ze=(0,A.useCallback)((()=>{const e=!ie.jetpack_waf_ip_block_list_enabled;pe(!0),ge(!0),oe({...ie,jetpack_waf_ip_block_list_enabled:e}),Y().then((()=>{f({type:"success",duration:P,message:e?__("Block list is active.","jetpack-protect"):__("Block list is disabled.","jetpack-protect",0)}),re(e?"jetpack_protect_ip_block_list_enabled":"jetpack_protect_ip_block_list_disabled")})).catch(Re).finally((()=>{pe(!1),ge(!1)}))}),[ie,Y,Re,f,re]),Pe=(0,A.useCallback)((()=>{a(!0),y.A.wafUpgradeSeen()}),[a]),Ie=(0,A.useMemo)((()=>ie.jetpack_waf_ip_allow_list.includes(D)),[ie.jetpack_waf_ip_allow_list,D]),Te=(0,A.useCallback)((()=>{const e=ie.jetpack_waf_ip_allow_list.length>0?`${ie.jetpack_waf_ip_allow_list}\n${D}`:D;oe((t=>({...t,jetpack_waf_ip_allow_list:e})))}),[ie.jetpack_waf_ip_allow_list,D]);(0,A.useEffect)((()=>{G||oe({jetpack_waf_automatic_rules:I,jetpack_waf_ip_block_list_enabled:T,jetpack_waf_ip_allow_list_enabled:V,jetpack_waf_ip_block_list:F,jetpack_waf_ip_allow_list:H,brute_force_protection:O})}),[T,V,F,H,I,O,G]),(0,A.useEffect)((()=>{W||(t(!0),y.A.wafSeen())}),[W,t]),(0,S.A)({pageViewEventName:"protect_waf",pageViewEventProperties:{has_plan:ae}});const Ve=React.createElement(n.A,{level:"error",title:"Jetpack Firewall is currently disabled.",children:React.createElement(r.Ay,null,__("Re-enable the Firewall to continue.","jetpack-protect")),actions:[React.createElement(l.A,{variant:"link",onClick:ee,isLoading:G,disabled:G},__("Enable Firewall","jetpack-protect"))],hideCloseButton:!0}),Fe=React.createElement(React.Fragment,null,React.createElement("div",{className:`${L.A["toggle-section"]} ${fe?"":L.A["toggle-section--disabled"]}`},React.createElement("div",{className:L.A["toggle-section__control"]},React.createElement(_.A,{checked:!!fe&&ie.jetpack_waf_automatic_rules,onChange:Ne,disabled:!ve||!fe}),ae&&!1===q&&React.createElement(p.Popover,{noArrow:!1,offset:8,position:"top right",inline:!0},React.createElement("div",{className:L.A.popover},React.createElement("div",{className:L.A.popover__header},React.createElement(r.Ay,{className:L.A.popover__title,variant:"title-small"},__("Thanks for upgrading!","jetpack-protect")),React.createElement(l.A,{className:L.A.popover__button,variant:"icon"},React.createElement(g.A,{onClick:Pe,icon:v.A,size:24,"aria-label":__("Close Window","jetpack-protect")}))),React.createElement(r.Ay,{className:L.A.popover__description,variant:"body",mt:2,mb:3},__("Turn on Jetpack Firewall to automatically protect your site with the latest security rules.","jetpack-protect")),React.createElement("div",{className:L.A.popover__footer},React.createElement(l.A,{onClick:Pe},__("Got it","jetpack-protect")))))),React.createElement("div",{className:L.A["toggle-section__content"]},React.createElement("div",{className:L.A["toggle-section__title"]},React.createElement(r.Ay,{variant:"title-medium",mb:2},__("Automatic firewall protection","jetpack-protect")),!e&&ae&&$&&React.createElement("span",{className:L.A.badge},__("NOW AVAILABLE","jetpack-protect"))),React.createElement(r.Ay,null,__("Block untrusted traffic by scanning every request made to your site. Jetpack’s security rules are always up-to-date to protect against the latest threats.","jetpack-protect")),React.createElement("div",{className:L.A["toggle-section__details"]},I&&Z&&!le&&React.createElement("div",{className:L.A["automatic-rules-stats"]},React.createElement(r.Ay,{className:L.A["automatic-rules-stats__version"],variant:"body-small"},__("Automatic security rules installed.","jetpack-protect")),React.createElement(r.Ay,{className:L.A["automatic-rules-stats__last-updated"],variant:"body-small"},(0,h.sprintf)( +// translators: placeholder is the date latest rules were updated i.e. "September 23, 2022". +__("Last updated on %s.","jetpack-protect"),E().unix(Z).format("MMMM D, YYYY")))),le&&React.createElement(React.Fragment,null,React.createElement(r.Ay,{className:L.A["automatic-rules-stats__failed-install"],variant:"body-small",mt:2},__("Failed to update automatic firewall rules.","jetpack-protect")," ",_e(le)),React.createElement(l.A,{variant:"link",href:ae?j.NW:j.pQ},React.createElement(r.Ay,{variant:"body-small"},__("Contact support","jetpack-protect"))))))),!ae&&React.createElement("div",{className:L.A["upgrade-trigger-section"]},React.createElement(s.A,{className:L.A["upgrade-trigger"],description:fe?__("Your site is not receiving the latest updates to automatic rules","jetpack-protect",0):__("Set up automatic rules with one click","jetpack-protect"),cta:fe?__("Upgrade to keep your site secure with up-to-date firewall rules","jetpack-protect",0):__("Upgrade to enable automatic firewall protection","jetpack-protect"),onClick:Ce}))),He=React.createElement("div",{className:L.A["toggle-section"]},React.createElement("div",{className:L.A["toggle-section__control"]},React.createElement(_.A,{id:"brute_force_protection",checked:ie.brute_force_protection,onChange:Me,disabled:me})),React.createElement("div",{className:L.A["toggle-section__content"]},React.createElement(r.Ay,{variant:"title-medium",mb:2},__("Brute force protection","jetpack-protect")),React.createElement(r.Ay,null,__("Prevent bots and hackers from attempting to log in to your website with common username and password combinations.","jetpack-protect")))),Be=React.createElement("div",{className:`${L.A["toggle-section"]} ${U?"":L.A["toggle-section--disabled"]}`},React.createElement("div",{className:L.A["toggle-section__control"]},React.createElement(_.A,{id:"jetpack_waf_ip_block_list_enabled",checked:be,onChange:ze,disabled:!ve})),React.createElement("div",{className:L.A["toggle-section__content"]},React.createElement(r.Ay,{variant:"title-medium",mb:2},__("Block IP addresses","jetpack-protect")),React.createElement(r.Ay,{mb:1},__("Stop specific visitors from accessing your site by their IP address.","jetpack-protect")),(be||we)&&React.createElement("div",{className:L.A["manual-rules-section"]},React.createElement(C.A,{id:"jetpack_waf_ip_block_list",placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:ie.jetpack_waf_ip_block_list,onChange:xe,disabled:!ve||!be})),be&&React.createElement("div",{className:L.A["block-list-button-container"]},React.createElement(l.A,{onClick:Se,isLoading:he,disabled:!ve||!Ae},__("Save block list","jetpack-protect"))))),Oe=React.createElement(React.Fragment,null,React.createElement("div",{className:L.A["toggle-section"]},React.createElement("div",{className:L.A["toggle-section__control"]},React.createElement(_.A,{id:"jetpack_waf_ip_allow_list_enabled",checked:ie.jetpack_waf_ip_allow_list_enabled,onChange:Le,disabled:me})),React.createElement("div",{className:L.A["toggle-section__content"]},React.createElement(r.Ay,{variant:"title-medium",mb:2},__("Trusted IP addresses","jetpack-protect")),React.createElement(r.Ay,{mb:1},__("IP addresses added to this list are always allowed by Jetpack.","jetpack-protect")),(ie.jetpack_waf_ip_allow_list_enabled||ke)&&React.createElement("div",{className:L.A["manual-rules-section"]},React.createElement(C.A,{id:"jetpack_waf_ip_allow_list",placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:ie.jetpack_waf_ip_allow_list,onChange:xe,disabled:!Ee}),React.createElement(r.Ay,{variant:"body-extra-small",mt:1},__("Add IP addresses here to ensure they always have access to your site, regardless of Jetpack's security features.","jetpack-protect"))),ie.jetpack_waf_ip_allow_list_enabled&&React.createElement("div",{className:L.A["allow-list-button-container"]},React.createElement("div",null,React.createElement(r.Ay,{variant:"body-small",className:L.A["allow-list-current-ip"]},(0,u.createInterpolateElement)((0,h.sprintf)( +// translators: placeholder is the user's current IP address. +__("Your current IP: %s","jetpack-protect"),D),{strong:React.createElement("strong",null)})),React.createElement(l.A,{variant:"secondary",size:"small",onClick:Te,disabled:!Ee||Ie||me},__("+ Add to Allow List","jetpack-protect"))),React.createElement(l.A,{onClick:je,isLoading:de,disabled:me||!ye},__("Save allow list","jetpack-protect"))))));return React.createElement(w.A,null,React.createElement(b.A,null),React.createElement(i.A,{className:L.A.container,horizontalSpacing:8,horizontalGap:4},J&&!U&&React.createElement(o.A,null,Ve," "),React.createElement(o.A,null,React.createElement("div",{className:L.A["toggle-wrapper"]},J&&Fe,He,J&&React.createElement(React.Fragment,null,Be,React.createElement("div",{className:L.A.divider})),Oe))),J?React.createElement(k.A,null):React.createElement(R.A,null))}},5717:(e,t,a)=>{"use strict";a.d(t,{A:()=>k});var c=a(766),n=a(5918),r=a(8509),l=a(7425),s=a(7723),i=a(1609),o=a(726),m=a(1186),p=a(7137),d=a(7827),u=a(9454),h=a(9395),g=a(6742),v=a(993),f=a(1226),E=a(727),A=a(7115),y=a(2621),w=a(5960);const __=s.__,_n=s._n,k=()=>{(0,f.A)({pageViewEventName:"protect_scan_history"});const{filter:e="all"}=(0,o.g)(),{item:t,list:a,selected:k,setSelected:b}=(0,v.A)({source:"history",status:e}),{counts:_,error:R,hasRequiredPlan:C}=(0,E.A)({sourceType:"history",filter:{status:e}}),{threats:j}=_.all,{counts:S}=(0,E.A)({sourceType:"history",filter:{status:"fixed",key:k}}),{threats:x}=S.current,{counts:N}=(0,E.A)({sourceType:"history",filter:{status:"ignored",key:k}}),{threats:M}=N.current,L=(0,i.useCallback)((()=>{switch(k){case"all":if(1===a.length)switch(e){case"fixed":return __("All fixed threats","jetpack-protect");case"ignored":return __("All ignored threats","jetpack-protect",0);default:return __("All threats","jetpack-protect")}switch(e){case"fixed":return(0,s.sprintf)(/* translators: placeholder is the amount of fixed threats found on the site. */ +__("All %s fixed threats","jetpack-protect"),a.length);case"ignored":return(0,s.sprintf)(/* translators: placeholder is the amount of ignored threats found on the site. */ +__("All %s ignored threats","jetpack-protect"),a.length);default:return(0,s.sprintf)(/* translators: placeholder is the amount of threats found on the site. */ +__("All %s threats","jetpack-protect"),a.length)}case"core":switch(e){case"fixed":return(0,s.sprintf)(/* translators: placeholder is the amount of fixed WordPress threats found on the site. */ +_n("%1$s fixed WordPress threat","%1$s fixed WordPress threats",a.length,"jetpack-protect"),a.length);case"ignored":return(0,s.sprintf)(/* translators: placeholder is the amount of ignored WordPress threats found on the site. */ +_n("%1$s ignored WordPress threat","%1$s ignored WordPress threats",a.length,"jetpack-protect"),a.length);default:return(0,s.sprintf)(/* translators: placeholder is the amount of WordPress threats found on the site. */ +_n("%1$s WordPress threat","%1$s WordPress threats",a.length,"jetpack-protect"),a.length)}case"files":switch(e){case"fixed":return(0,s.sprintf)(/* translators: placeholder is the amount of fixed file threats found on the site. */ +_n("%1$s fixed file threat","%1$s fixed file threats",a.length,"jetpack-protect"),a.length);case"ignored":return(0,s.sprintf)(/* translators: placeholder is the amount of ignored file threats found on the site. */ +_n("%1$s ignored file threat","%1$s ignored file threats",a.length,"jetpack-protect"),a.length);default:return(0,s.sprintf)(/* translators: placeholder is the amount of file threats found on the site. */ +_n("%1$s file threat","%1$s file threats",a.length,"jetpack-protect"),a.length)}case"database":switch(e){case"fixed":return(0,s.sprintf)(/* translators: placeholder is the amount of fixed database threats found on the site. */ +_n("%1$s fixed database threat","%1$s fixed database threats",a.length,"jetpack-protect"),a.length);case"ignored":return(0,s.sprintf)(/* translators: placeholder is the amount of ignored database threats found on the site. */ +_n("%1$s ignored database threat","%1$s ignored database threats",a.length,"jetpack-protect"),a.length);default:return(0,s.sprintf)(/* translators: placeholder is the amount of database threats found on the site. */ +_n("%1$s database threat","%1$s database threats",a.length,"jetpack-protect"),a.length)}default:switch(e){case"fixed":return(0,s.sprintf)(/* translators: Translates to "123 fixed threats in Example Plugin (1.2.3)" */ +_n("%1$s fixed threat in %2$s %3$s","%1$s fixed threats in %2$s %3$s",a.length,"jetpack-protect"),a.length,t?.name,t?.version);case"ignored":return(0,s.sprintf)(/* translators: Translates to "123 ignored threats in Example Plugin (1.2.3)" */ +_n("%1$s ignored threat in %2$s %3$s","%1$s ignored threats in %2$s %3$s",a.length,"jetpack-protect"),a.length,t?.name,t?.version);default:return(0,s.sprintf)(/* translators: Translates to "123 threats in Example Plugin (1.2.3)" */ +_n("%1$s threat in %2$s %3$s","%1$s threats in %2$s %3$s",a.length,"jetpack-protect"),a.length,t?.name,t?.version)}}}),[k,a.length,e,t?.name,t?.version]);return C?0===a.length&&"all"!==e?React.createElement(o.C5,{to:"/scan/history"}):React.createElement(m.A,null,React.createElement(c.A,null,React.createElement(n.A,{horizontalSpacing:3,horizontalGap:4},React.createElement(r.A,null,React.createElement(A.A,{subtitle:R?null:__("Threat history","jetpack-protect"),title:R?null:(0,s.sprintf)(/* translators: %s: Total number of threats */ +__("%1$s previously active %2$s","jetpack-protect"),j,1===j?"threat":"threats")})),R?React.createElement(r.A,null,React.createElement(p.A,{baseErrorMessage:__("An error occurred loading your site's threat history.","jetpack-protect"),errorMessage:R.message,errorCode:R.code})):React.createElement(r.A,null,React.createElement(n.A,{fluid:!0,horizontalSpacing:0,horizontalGap:3},React.createElement(r.A,{lg:4},React.createElement(h.A,{selected:k,onSelect:b,sourceType:"history",statusFilter:e})),React.createElement(r.A,{lg:8},a.length>0?React.createElement("div",null,React.createElement("div",{className:w.A["list-header"]},React.createElement(l.hE,{className:w.A["list-title"]},L()),React.createElement("div",{className:w.A["list-header__controls"]},React.createElement(y.A,{numFixed:x,numIgnored:M}))),React.createElement(g.A,{list:a,hideAutoFixColumn:!0})):React.createElement(React.Fragment,null,React.createElement("div",{className:w.A["list-header"]},React.createElement("div",{className:w.A["list-header__controls"]},React.createElement(y.A,null))),React.createElement("div",{className:w.A.empty},React.createElement(d.A,null),React.createElement(l.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(l.Ay,{mb:4},(0,s.sprintf)(/* translators: %s: Filter type */ +__("There are no%sthreats in your scan history.","jetpack-protect"),"all"===e?" ":` ${e} `))))))))),React.createElement(u.A,null)):React.createElement(o.C5,{to:"/scan"})}},2621:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var c=a(7723),n=a(1609),r=a.n(n),l=a(726),s=a(4907);const __=c.__;function i({numFixed:e,numIgnored:t}){const a=(0,l.Zp)(),{filter:c="all"}=(0,l.g)(),i=(0,n.useCallback)((e=>()=>a(e)),[a]);return r().createElement(s.A,null,r().createElement(s.A.Button,{variant:"all"===c?"primary":"secondary",onClick:i("/scan/history")},__("All","jetpack-protect")),r().createElement(s.A.Button,{variant:"fixed"===c?"primary":"secondary",onClick:i("/scan/history/fixed"),disabled:!e},__("Fixed","jetpack-protect")),r().createElement(s.A.Button,{variant:"ignored"===c?"primary":"secondary",onClick:i("/scan/history/ignored"),disabled:!t},__("Ignored","jetpack-protect")))}},5148:(e,t,a)=>{"use strict";a.d(t,{A:()=>V});var c=a(8509),n=a(5918),r=a(7425),l=a(766),s=a(9384),i=a(6427),o=a(7143),m=a(7723),p=a(1609),d=a.n(p),u=a(5242),h=a(1186),g=a(7137),v=a(4256),f=a(9454),E=a(5165),A=a(147),y=a(5661),w=a(8140),k=a(1226),b=a(1936),_=a(727),R=a(6516),C=a(7478),j=a(3411),S=a(7115),x=a(6359),N=a(3396),M=a(4404);const __=m.__,L=()=>{const{hasConnectionError:e}=(0,s.useConnectionErrorNotice)();return d().createElement(d().Fragment,null,e&&d().createElement(c.A,{className:x.A["connection-error-col"]},d().createElement(s.ConnectionError,null)),d().createElement(c.A,null,d().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"})))},z=()=>d().createElement(n.A,{horizontalSpacing:0},d().createElement(L,null)),P=({errorMessage:e,errorCode:t})=>d().createElement(d().Fragment,null,d().createElement(z,null),d().createElement(n.A,{horizontalSpacing:3,horizontalGap:4},d().createElement(c.A,null,d().createElement(S.A,null)),d().createElement(c.A,null,d().createElement(g.A,{baseErrorMessage:__("We are having problems scanning your site.","jetpack-protect"),errorMessage:e,errorCode:t})))),I=({currentProgress:e})=>{const{hasRequiredPlan:t}=(0,_.A)(),{globalStats:a}=(0,R.A)(),l=parseInt(a?.totalVulnerabilities),s=isNaN(l)?"50,000":l.toLocaleString();return d().createElement(d().Fragment,null,d().createElement(z,null),d().createElement(n.A,{horizontalSpacing:3,horizontalGap:4},d().createElement(c.A,null,d().createElement(S.A,null)),d().createElement(c.A,null,d().createElement(E.A,{main:d().createElement("div",{className:x.A["main-content"]},d().createElement(n.A,{horizontalSpacing:3,horizontalGap:7},d().createElement(c.A,{className:x.A["loading-content"]},d().createElement(i.Spinner,{style:{color:"black",marginTop:0,marginLeft:0}}),d().createElement("span",null,__("Scanning your site…","jetpack-protect"))),d().createElement(c.A,null,d().createElement(r.H3,{style:{textWrap:"balance"}},__("Your results will be ready soon","jetpack-protect")),t&&null!==e&&e>=0&&d().createElement(v.A,{value:e}),d().createElement(r.Ay,null,(0,m.sprintf)( +// translators: placeholder is the number of total vulnerabilities i.e. "22,000". +__("We are scanning for security threats from our more than %s listed vulnerabilities, powered by WPScan. This could take a minute or two.","jetpack-protect"),s))))),secondary:d().createElement("div",{className:x.A.illustration},d().createElement("img",{src:u,alt:""})),preserveSecondaryOnMobile:!1}))))},T=()=>d().createElement(d().Fragment,null,d().createElement(z,null),d().createElement(n.A,{horizontalSpacing:3,horizontalGap:4},d().createElement(c.A,null,d().createElement(A.A,null)),d().createElement(c.A,null,d().createElement(y.A,null)))),V=()=>{const{lastChecked:e,hasRequiredPlan:t}=(0,_.A)(),{refreshStatus:a}=(0,o.useDispatch)(C.a),{scanInProgress:c,statusIsFetching:n,scanIsUnavailable:r,status:s,scanError:i}=(0,o.useSelect)((e=>({scanError:e(C.a).scanError(),scanInProgress:e(C.a).scanInProgress(),scanIsUnavailable:e(C.a).getScanIsUnavailable(),status:e(C.a).getStatus(),statusIsFetching:e(C.a).getStatusIsFetching()})));let m;m=i?"error":e?"active":"in_progress",(0,k.A)({pageViewEventName:"protect_admin",pageViewEventProperties:{check_status:m,has_plan:t}}),(0,M.A)(),(0,N.A)(),(0,p.useEffect)((()=>{n||w.Mm!==s.status||r||a(!0)}),[n,s.status,a,r]);const u=(0,p.useMemo)((()=>c?d().createElement(I,{currentProgress:s.currentProgress}):i?d().createElement(P,{errorMessage:i.message,errorCode:i.code}):d().createElement(T,null)),[c,s.currentProgress,i]);return d().createElement(b.dn.Provider,{value:j.A},d().createElement(h.A,null,d().createElement(l.A,null,u),d().createElement(f.A,null)))}},3411:(e,t,a)=>{"use strict";a.d(t,{A:()=>E});var c=a(6072),n=a.n(c),r=a(7425),l=a(1112),s=a(3924),i=a(9384),o=a(6087),m=a(7723),p=a(8140),d=a(1226);const __=m.__,{adminUrl:u,siteSuffix:h}=window.jetpackProtectInitialState,g=__("Your scan results","jetpack-protect"),v=React.createElement(r.Ay,null,__("Navigate through the results of the scan on your WordPress installation, plugins, themes, and other files","jetpack-protect")),f=e=>{const{run:t}=(0,i.useProductCheckoutWorkflow)({productSlug:p.J3,redirectUrl:u}),{recordEventHandler:a}=(0,d.A)(),c=a("jetpack_protect_onboarding_get_scan_link_click",t);return React.createElement(l.A,n()({variant:"link",weight:"regular",onClick:c},e))},E=[{id:"free-scan-results",title:g,description:v},{id:"free-daily-scans",title:__("Daily automated scans","jetpack-protect"),description:React.createElement(r.Ay,null,(0,o.createInterpolateElement)(__("We run daily automated scans. Do you want to be able to scan manually? Upgrade","jetpack-protect"),{upgradeLink:React.createElement(f,null)}))},{id:"paid-scan-results",title:g,description:v},{id:"paid-fix-all-threats",title:__("Auto-fix with one click","jetpack-protect"),description:React.createElement(r.Ay,null,__("Jetpack Protect offers one-click fixes for most threats. Press this button to be safe again.","jetpack-protect"),React.createElement("br",null),React.createElement("br",null),(0,o.createInterpolateElement)(__("Note that you'll have to input your server credentials first.","jetpack-protect"),{credentialsLink:React.createElement(l.A,{variant:"link",weight:"regular",href:(0,s.A)("jetpack-settings-security-credentials",{site:h})})}))},{id:"paid-understand-severity",title:__("Understand severity","jetpack-protect"),description:React.createElement(r.Ay,null,__("Learn how critical these threats are for the security of your site by glancing at the severity labels.","jetpack-protect"))},{id:"paid-daily-and-manual-scans",title:__("Daily & manual scanning","jetpack-protect"),description:React.createElement(r.Ay,null,__("We run daily automated scans but you can also run on-demand scans if you want to check the latest status.","jetpack-protect"))}]},7115:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(8478),n=a(5918),r=a(8509),l=a(7425),s=a(1609),i=a.n(s),o=a(727),m=a(5412),p=a(6359);const d=({title:e,subtitle:t,controls:a})=>{const s=(0,c.Wy)("protect"),{hasRequiredPlan:d}=(0,o.A)();return i().createElement(n.A,{fluid:!0},i().createElement(r.A,null,i().createElement("div",{className:p.A["scan-section-header"]},i().createElement("div",{className:p.A["scan-section-header__content"]},t&&i().createElement(l.hE,{size:"small",className:p.A["scan-section-header__subtitle"]},i().createElement(s,{size:32,className:p.A["scan-section-header__icon"]}),t),e&&i().createElement(l.Ay,{variant:"headline-small",component:"h1",className:p.A["scan-section-header__title"]},e),!!d&&i().createElement(m.A,null)),i().createElement("div",{className:p.A["scan-section-header__controls"]},i().createElement("div",{className:p.A["scan-section-header__controls__row"]},a)))))}},5412:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var c=a(7723),n=a(1609),r=a.n(n),l=a(726),s=a(4907);const __=c.__;function i(){const e=(0,l.Zp)(),t=(0,l.zy)(),a=(0,n.useCallback)((()=>e("/scan")),[e]),c=(0,n.useCallback)((()=>e("/scan/history")),[e]);return r().createElement("div",null,r().createElement(s.A,null,r().createElement(s.A.Button,{variant:"/scan"===t.pathname?"primary":"secondary",onClick:a},__("Scanner","jetpack-protect")),r().createElement(s.A.Button,{variant:t.pathname.includes("/scan/history")?"primary":"secondary",onClick:c},__("History","jetpack-protect"))))}},3396:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(7143),n=a(1609),r=a(7478);const l=()=>{const{checkCredentials:e}=(0,c.useDispatch)(r.a),t=(0,c.useSelect)((e=>e(r.a).getCredentials()));(0,n.useEffect)((()=>{t||e()}),[e,t])}},4404:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var c=a(1455),n=a.n(c),r=a(7143),l=a(6185),s=a.n(l),i=a(1609),o=a(8140),m=a(1226),p=a(7478);const d=()=>{const{recordEvent:e}=(0,m.A)(),t=(0,r.useSelect)((e=>e(p.a).getStatus())),{setStatus:a,setStatusProgress:c,setStatusIsFetching:l,setScanIsUnavailable:d}=(0,r.useDispatch)(p.a);(0,i.useEffect)((()=>{let r;const i=e=>o.vI.indexOf(e)>=0,m=(e,t)=>!t&&o._R===e,p=()=>new Promise(((e,t)=>{n()({path:"jetpack-protect/v1/status?hard_refresh=true",method:"GET"}).then((a=>{if(a?.error)throw a?.error_message;if(i(a?.status)||m(a?.status,a?.last_checked))return c(a?.current_progress),void(r=setTimeout((()=>{p().then((t=>e(t))).catch((e=>t(e)))}),1e4));e(a)})).catch((()=>{setTimeout((()=>{p().then((t=>e(t))).catch((e=>t(e)))}),5e3)}))}));if(i(t?.status)||m(t?.status,t?.lastChecked))return r=setTimeout((()=>{l(!0),p().then((t=>{d(o.Mm===t.status),a(s()(t)),e("jetpack_protect_scan_completed",{scan_status:t.status})})).finally((()=>{l(!1)}))}),1e4),()=>clearTimeout(r)}),[t?.status,t?.lastChecked,d,a,c,l,e])}},3772:(e,t,a)=>{"use strict";a.d(t,{$Z:()=>I,A1:()=>p,Ay:()=>ee,B6:()=>y,E0:()=>T,EJ:()=>w,JD:()=>P,Mf:()=>b,Wl:()=>d,bK:()=>f,bf:()=>L,c5:()=>_,cF:()=>M,ci:()=>S,fm:()=>j,hk:()=>A,iS:()=>E,iZ:()=>z,id:()=>m,jy:()=>N,mD:()=>u,oJ:()=>C,oW:()=>k,pW:()=>g,vN:()=>R,vT:()=>x,wd:()=>v,yA:()=>h});var c=a(1455),n=a.n(c),r=a(7723),l=a(6185),s=a.n(l),i=a(5973),o=a(8140);const _n=r._n,__=r.__,m="SET_CREDENTIALS_STATE_IS_FETCHING",p="SET_CREDENTIALS_STATE",d="SET_SCAN_HISTORY",u="SET_STATUS",h="SET_STATUS_PROGRESS",g="START_SCAN_OPTIMISTICALLY",v="SET_STATUS_IS_FETCHING",f="SET_SCAN_IS_UNAVAILABLE",E="SET_SCAN_IS_ENQUEUING",A="SET_INSTALLED_PLUGINS",y="SET_INSTALLED_THEMES",w="SET_WP_VERSION",k="SET_JETPACK_SCAN",b="SET_THREAT_IS_UPDATING",_="SET_THREATS_ARE_FIXING",R="SET_MODAL",C="SET_NOTICE",j="CLEAR_NOTICE",S="SET_HAS_REQUIRED_PLAN",x="SET_ONBOARDING_PROGRESS",N="SET_WAF_IS_SEEN",M="SET_WAF_UPGRADE_IS_SEEN",L="SET_WAF_IS_ENABLED",z="SET_WAF_IS_UPDATING",P="SET_WAF_IS_TOGGLING",I="SET_WAF_CONFIG",T="SET_WAF_STATS",V=e=>({type:d,scanHistory:e}),F=e=>({type:u,status:e}),H=()=>({type:g}),B=e=>n()({path:"jetpack-protect/v1/status"+(e?"?hard_refresh=true":""),method:"GET"}),O=(e=!1)=>async({dispatch:t})=>(t($(!0)),await new Promise(((a,c)=>B(e).then(U).then((e=>{t(J(o.Mm===e.status)),t(F(s()(e))),a(e)})).catch((e=>{c(e)})).finally((()=>{t($(!1))}))))),D=()=>async({dispatch:e})=>i.A.fetchScanHistory().then((e=>s()(e))).then((t=>{e(V(t))})),U=(e,t=0)=>new Promise(((a,c)=>{o.Mm===e.status&&t<3?B(!0).then((e=>{setTimeout((()=>{U(e,t+1).then((e=>a(e))).catch((e=>c(e)))}),5e3)})).catch(c):a(e)})),W=e=>({type:m,isFetching:e}),q=e=>({type:p,credentials:e}),$=e=>({type:v,status:e}),J=e=>({type:f,status:e}),G=e=>({type:E,isEnqueuing:e}),Z=(e,t)=>({type:b,payload:{threatId:e,isUpdating:t}}),K=e=>({type:_,threatIds:e}),Q=e=>async({dispatch:t})=>{const a=e.reduce(((e,t)=>`${e}threat_ids[]=${t}&`),"jetpack-protect/v1/fix-threats-status?");return t(K(e)),await n()({path:a,method:"GET"}).then((async a=>{const c=Object.values(a.threats);if(c.filter((e=>"in_progress"===e.status)).length>0)return await new Promise((()=>{setTimeout((()=>{t(Q(e))}),1e3)}));if(!c.filter((e=>"fixed"===e.status)).length===e.length)throw"Not all threats could be fixed."})).then((()=>{t(O()),t(D()),t(Y({type:"success",message:(0,r.sprintf)( +// translators: placeholder is the number amount of fixed threats. +_n("%s threat was fixed successfully","%s threats were fixed successfully",e.length,"jetpack-protect"),e.length)}))})).catch((()=>{t(Y({type:"error",message:__("Not all threats could be fixed. Please contact our support.","jetpack-protect")}))})).finally((()=>{t(K([]))}))},Y=e=>({type:C,payload:e}),X=e=>({type:S,hasRequiredPlan:e}),ee={checkCredentials:()=>async({dispatch:e})=>await new Promise(((t,a)=>(e(W(!0)),n()({path:"jetpack-protect/v1/check-credentials",method:"POST"}).then((a=>{e(q(a)),t(a)})).catch((e=>{a(e)})).finally((()=>{e(W(!1))}))))),setCredentials:q,setCredentialsIsFetching:W,setScanHistory:V,setStatus:F,setStatusProgress:e=>({type:h,currentProgress:e}),startScanOptimistically:H,refreshStatus:O,refreshScanHistory:D,setStatusIsFetching:$,setScanIsEnqueuing:G,setInstalledPlugins:e=>({type:A,plugins:e}),setInstalledThemes:e=>({type:y,themes:e}),setwpVersion:e=>({type:w,version:e}),setJetpackScan:e=>({type:k,scan:e}),ignoreThreat:(e,t=()=>{})=>async({dispatch:a})=>(a(Z(e,!0)),await new Promise((()=>n()({path:`jetpack-protect/v1/ignore-threat?threat_id=${e}`,method:"POST"}).then((()=>a(O()))).then((()=>a(D()))).then((()=>a(Y({type:"success",message:__("Threat ignored","jetpack-protect")})))).catch((()=>a(Y({type:"error",message:__("An error ocurred ignoring the threat.","jetpack-protect")})))).finally((()=>{a(Z(e,!1)),t()}))))),unignoreThreat:(e,t=()=>{})=>async({dispatch:a})=>(a(Z(e,!0)),await new Promise((()=>n()({path:`jetpack-protect/v1/unignore-threat?threat_id=${e}`,method:"POST"}).then((()=>a(D()))).then((()=>a(O()))).then((()=>a(Y({type:"success",message:__("Threat unignored","jetpack-protect")})))).catch((()=>a(Y({type:"error",message:__("An error ocurred unignoring the threat.","jetpack-protect")})))).finally((()=>{a(Z(e,!1)),t()}))))),setModal:e=>({type:R,payload:e}),setNotice:Y,clearNotice:()=>({type:j}),fixThreats:(e,t=()=>{})=>async({dispatch:a})=>(e.forEach((e=>{a(Z(e,!0))})),await new Promise((()=>n()({path:`jetpack-protect/v1/fix-threats?threat_ids=${e}`,method:"POST",data:{threatIds:e}}).then((()=>a(Y({type:"success",message:__("We're hard at work fixing this threat in the background. Please check back shortly.","jetpack-protect")})))).then((()=>{setTimeout((()=>a(Q(e))),1e3)})).catch((()=>a(Y({type:"error",message:__("Error fixing threats. Please contact support.","jetpack-protect")})))).finally((()=>{e.forEach((e=>{a(Z(e,!1))})),t()}))))),scan:(e=()=>{})=>async({dispatch:t})=>(t(G(!0)),await new Promise((()=>n()({path:"jetpack-protect/v1/scan",method:"POST"}).then((()=>{t(H()),setTimeout((()=>t(O(!0))),5e3)})).catch((()=>t(Y({type:"error",message:__("An error ocurred enqueuing the scan","jetpack-protect")})))).finally((()=>{t(G(!1)),e()}))))),setThreatsAreFixing:K,refreshPlan:()=>({dispatch:e})=>{n()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((t=>e(X(t))))},setHasRequiredPlan:X,setScanIsUnavailable:J,setOnboardingProgress:e=>({type:x,progress:e}),setWafIsEnabled:e=>({type:L,isEnabled:e}),setWafIsSeen:e=>({type:N,isSeen:e}),setWafUpgradeIsSeen:e=>({type:M,upgradeIsSeen:e}),setWafIsUpdating:e=>({type:z,isUpdating:e}),setWafIsToggling:e=>({type:P,isToggling:e}),setWafConfig:e=>({type:I,config:e}),setWafStats:e=>({type:T,stats:e})}},3010:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(7143),n=a(6185),r=a.n(n),l=a(8140),s=a(3772);const i={wafSupported:null,bruteForceSupported:null,isSeen:!1,upgradeIsSeen:!1,isEnabled:!1,isUpdating:!1,isToggling:!1,config:void 0,stats:void 0},o=(0,c.combineReducers)({credentials:(e=null,t)=>t.type===s.A1?t.credentials:e,credentialsIsFetching:(e=!1,t)=>t.type===s.id?t.isFetching:e,scanHistory:(e={},t)=>t.type===s.Wl?r()(t.scanHistory):e,status:(e={},t)=>{switch(t.type){case s.mD:return t.status;case s.yA:return{...e,currentProgress:t.currentProgress};case s.pW:return{...e,currentProgress:0,status:l.JD}}return e},statusIsFetching:(e=!1,t)=>t.type===s.wd?t.status:e,scanIsUnavailable:(e=!1,t)=>t.type===s.bK?t.status:e,scanIsEnqueuing:(e=!1,t)=>t.type===s.iS?t.isEnqueuing:e,installedPlugins:(e={},t)=>t.type===s.hk?t.plugins:e,installedThemes:(e={},t)=>t.type===s.B6?t.themes:e,wpVersion:(e={},t)=>t.type===s.EJ?t.version:e,jetpackScan:(e={},t)=>t.type===s.oW?t.scan:e,threatsUpdating:(e={},t)=>t.type===s.Mf?{...e,[t.payload.threatId]:t.payload.isUpdating}:e,modal:(e={},t)=>t.type===s.vN?{...e,...t.payload}:e,notice:(e={},t)=>{switch(t.type){case s.oJ:return{...e,...t.payload};case s.fm:return{}}return e},threatsAreFixing:(e=[],t)=>t.type===s.c5?t.threatIds:e,hasRequiredPlan:(e=!1,t)=>t.type===s.ci?t.hasRequiredPlan:e,onboardingProgress:(e=null,t)=>t.type===s.vT?t.progress:e,waf:(e=i,t)=>{switch(t.type){case s.jy:return{...e,isSeen:t.isSeen};case s.cF:return{...e,upgradeIsSeen:t.upgradeIsSeen};case s.bf:return{...e,isEnabled:t.isEnabled};case s.$Z:return{...e,config:t.config};case s.E0:return{...e,stats:t.stats};case s.iZ:return{...e,isUpdating:t.isUpdating};case s.JD:return{...e,isToggling:t.isToggling}}return e}})},3260:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(1455),n=a.n(c),r=a(3772);const l={getJetpackScan:{isFulfilled:e=>Object.keys(e?.jetpackScan).length>0,fulfill:()=>async({dispatch:e})=>{const t=await n()({path:"/my-jetpack/v1/site/products/scan",method:"GET"});e(r.Ay.setJetpackScan(t))}}}},5649:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var c=a(7723),n=a(8140);const __=c.__,r={getCredentials:e=>e.credentials||null,getCredentialsIsFetching:e=>e.credentialsIsFetching||!1,getInstalledPlugins:e=>e.installedPlugins||{},getInstalledThemes:e=>e.installedThemes||{},getScanHistory:e=>e.scanHistory||{},getStatus:e=>e.status||{},getStatusIsFetching:e=>e.statusIsFetching||!1,getScanIsUnavailable:e=>e.scanIsUnavailable||!1,getScanIsEnqueuing:e=>e.scanIsEnqueuing||!1,scanInProgress:e=>{const{status:t,lastChecked:a,error:c}=r.getStatus(e),l=r.getScanIsUnavailable(e);return n.JD===t||!l&&(!!n.vI.includes(t)||!a&&!c)},scanError:e=>{const{status:t,error:a,errorCode:c,errorMessage:n}=r.getStatus(e),l=r.getScanIsUnavailable(e),s=r.getStatusIsFetching(e);return a?{code:c,message:n}:l?{code:"scan_unavailable",message:__("We are having problems scanning your site.","jetpack-protect")}:t||s?null:{code:"scan_unavailable",message:__("We are having problems scanning your site.","jetpack-protect")}},getWpVersion:e=>e.wpVersion||"",getJetpackScan:e=>e.jetpackScan||{},getThreatsUpdating:e=>e.threatsUpdating||{},getModalType:e=>e.modal?.type||null,getModalProps:e=>e.modal?.props||{},getNotice:e=>e.notice||null,getThreatsAreFixing:e=>e.threatsAreFixing||[],hasRequiredPlan:e=>e.hasRequiredPlan||!1,getOnboardingProgress:e=>e.onboardingProgress||null,getWaf:e=>e.waf},l=r},6673:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(7143);class n{static store=null;static mayBeInit(e,t){null===n.store&&(n.store=(0,c.createReduxStore)(e,t),(0,c.register)(n.store))}}const r=n},7478:(e,t,a)=>{"use strict";a.d(t,{a:()=>m,k:()=>p});var c=a(6185),n=a.n(c),r=a(3772),l=a(3010),s=a(3260),i=a(5649),o=a(6673);const m="jetpack-protect";function p(){o.A.mayBeInit(m,{__experimentalUseThunks:!0,reducer:l.A,actions:r.Ay,selectors:i.A,resolvers:s.A,initialState:n()(window.jetpackProtectInitialState)||{}})}},5242:(e,t,a)=>{"use strict";e.exports=a.p+"images/in-progress-dabfeaa364c305be480c.png"},4611:e=>{"use strict";if(void 0==={consumer_slug:"jetpack-protect"}){var t=new Error('Cannot find module \'{"consumer_slug":"jetpack-protect"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"jetpack-protect"}},9384:e=>{"use strict";e.exports=window.JetpackConnection},7999:e=>{"use strict";e.exports=window.JetpackScriptDataModule},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},6154:e=>{"use strict";e.exports=window.moment},1455:e=>{"use strict";e.exports=window.wp.apiFetch},6427:e=>{"use strict";e.exports=window.wp.components},9491:e=>{"use strict";e.exports=window.wp.compose},7143:e=>{"use strict";e.exports=window.wp.data},8443:e=>{"use strict";e.exports=window.wp.date},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives},3832:e=>{"use strict";e.exports=window.wp.url},6072:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;tc})},3022:(e,t,a)=>{"use strict";function c(e){var t,a,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;tn});const n=function(){for(var e,t,a=0,n="",r=arguments.length;a{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var c in t)a.o(t,c)&&!a.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:t[c]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var c=t.getElementsByTagName("script");if(c.length)for(var n=c.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=c[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{"use strict";var e=a(723),t=a(6087),c=a(1609),n=a.n(c),r=a(726),l=a(9959),s=a(4440),i=a(5409),o=a(1936),m=a(1671),p=a(5148),d=a(5717),u=a(7478);a(5490);function h(){const e=(0,r.zy)();return(0,c.useEffect)((()=>window.scrollTo(0,0)),[e]),null}(0,u.k)(),function(){const a=document.getElementById("jetpack-protect-root");if(null===a)return;const c=n().createElement(e.Ay,null,n().createElement(o.Ll,{value:{renderedSteps:[]}},n().createElement(l.I9,null,n().createElement(h,null),n().createElement(r.BV,null,n().createElement(r.qh,{path:"/scan",element:n().createElement(p.A,null)}),n().createElement(r.qh,{path:"/scan/history",element:n().createElement(i.A,null,n().createElement(d.A,null))}),n().createElement(r.qh,{path:"/scan/history/:filter",element:n().createElement(i.A,null,n().createElement(d.A,null))}),n().createElement(r.qh,{path:"/firewall",element:n().createElement(m.A,null)}),n().createElement(r.qh,{path:"*",element:n().createElement(r.C5,{to:"/scan",replace:!0})}))),n().createElement(s.A,null)));t.createRoot(a).render(c)}()})()})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js.LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js.LICENSE.txt new file mode 100644 index 00000000..e6a98f84 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js.LICENSE.txt @@ -0,0 +1,29 @@ +/* + * Exposes number format capability + * + * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors). + * @license See CREDITS.md + * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js + */ + +/** + * React Router DOM v6.2.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ + +/** + * React Router v6.2.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.rtl.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.rtl.css new file mode 100644 index 00000000..98348029 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.rtl.css @@ -0,0 +1 @@ +._aiMxmJRAw5jRPbZFX57{background-color:var(--jp-gray-90);border-radius:var(--jp-border-radius);color:var(--jp-white);display:flex;overflow:hidden}._aiMxmJRAw5jRPbZFX57.eWgNBUaexiR66ZI1Px4U{border-right:4px solid var(--jp-yellow-20);margin-bottom:calc(var(--spacing-base)*3)}._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{left:calc(var(--spacing-base)*3);margin-right:calc(var(--spacing-base)*3);position:fixed;top:calc(var(--spacing-base)*6)}@media(max-width:782px){._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{top:calc(var(--spacing-base)*8)}}._aiMxmJRAw5jRPbZFX57 a,._aiMxmJRAw5jRPbZFX57 a:active,._aiMxmJRAw5jRPbZFX57 a:hover,._aiMxmJRAw5jRPbZFX57 a:link,._aiMxmJRAw5jRPbZFX57 a:visited{color:var(--jp-white)}.BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-yellow-30);fill:var(--jp-white);align-items:center;display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}.hRRUwTCPRpurhMwRNZkg .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-green-50)}.Z6q3IxY_uR1y2lAPTkVF .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-red)}.eWgNBUaexiR66ZI1Px4U .BnI88X_e8ItF1c9Uozmj{fill:var(--jp-yellow-50);background-color:var(--jp-yellow-5)}.ST8sowTbBVLRPrk4ZQrn{font-size:14px;padding:calc(var(--spacing-base)*1.75)}.eWgNBUaexiR66ZI1Px4U .ST8sowTbBVLRPrk4ZQrn{background-color:var(--jp-yellow-5);color:var(--jp-gray-90)}.lMkO08Vd8YQMfwrwaI8u{fill:var(--jp-gray);align-items:center;background:#0000;border:none;cursor:pointer;display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}._Wc3apZobag_9Ag_THTb{display:flex;justify-content:space-between}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-left:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-right:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-left:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-right:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-left:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-right:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-left:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-right:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-left:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-right:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-left:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-right:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-left:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-right:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-left:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-right:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-left:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-right:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-left:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-right:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-left:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-right:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-left:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-right:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-left:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-right:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-left:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-right:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-left:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-right:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-left:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-right:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-left:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-right:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-left:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-right:calc(var( --spacing-base )*8)}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.51px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-left:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.51px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-right:calc(var(--spacing-base)/2)}.kdsaL7c4bpTwf_A4fIUT{padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6);text-align:center}.b0eN3as5AgxQW7EAkarg{margin-bottom:0}@keyframes rotate-spinner{to{transform:rotate(-1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid #0000;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-left-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.JiJhrZaThvWCpM2AfGen{border-radius:32px;flex-shrink:0;font-size:12px;font-style:normal;font-weight:600;line-height:16px;padding:calc(var(--spacing-base)/2);position:relative;text-align:center;width:60px}._7SGksgOpcPbHfPPpQTV{background:var(--jp-red-5);color:var(--jp-red-60)}.pGNquShR54adQ61sx3lP{background:var(--jp-yellow-5);color:var(--jp-yellow-60)}.IM5kkexAfwGLM6zz0Exd{background:var(--jp-gray-0);color:var(--jp-gray-50)}.NHzH3tt6CypjZ92CvK9x{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;padding:calc(var(--spacing-base)*2)}.NHzH3tt6CypjZ92CvK9x:first-of-type{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x:last-of-type{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x+.NHzH3tt6CypjZ92CvK9x{border-top:0}.D9zvYDUrOP_zwSm0yJMs{margin-left:calc(var(--spacing-base)*2);min-width:24px}._XISfmbjoVlqhB61hHYn{width:100%}.AQDPBnMZFu7BOBuo8mYW{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.cZ9s5eCAZe3R82Y6Ru3z{color:var(--jp-gray-80);font-size:14px;line-height:21px}.AKnbWQiViZ2O_dwCV8Fw,.W6alQ2_S5Rh06djX9m27{align-self:center;margin-left:var(--spacing-base);margin-right:calc(var(--spacing-base)*2)}.uUEJGMrSV3XoBwX5xEwA{display:flex;justify-content:space-between}.sQkG5Cu80gPaeFj3L_wa{margin-bottom:calc(var(--spacing-base)*5)}.oIl6GCMeUnzE0inXbuj9{display:flex;justify-content:space-between}.RP2MVoGqaCFXPKZhhxQ1{margin-bottom:calc(var(--spacing-base)*5)}.YpEs8b7KE7fzVuXUbOEb{display:flex;justify-content:space-between}.EqpwvErHtRi_WQkJKgi1{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;margin-bottom:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2)}.EicvN1QaJu5OJLzdUN5A{margin-left:calc(var(--spacing-base)*2);min-width:24px}.b7ynAmUwGlxK_vxyIN0y{width:100%}.uSV9HYRxjL4S6zIZDlqP{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.XpW8Mvw_XFEbqxUdw155{color:var(--jp-gray-80);font-size:14px;line-height:21px}.Fkj60BmQ5sUo9zHcJwVv{align-self:center;margin-left:var(--spacing-base);margin-right:calc(var(--spacing-base)*2)}.XLzPr74ad3osCq9kxy2q{display:flex;justify-content:space-between}.jNlU3vgp4xEGwmX5aTyK{background-color:var(--jp-gray-5)}.gE8s4nh3f7iGIBrFeyCT{list-style-type:disc;padding-right:calc(var(--spacing-base)*2.5)}.L9hh_sX51PzO41icwJlh{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;margin-bottom:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2)}.o8E4Bv6U0d7USFxSjRCj{margin-left:calc(var(--spacing-base)*2);min-width:24px}.sT31awD6bHO8KJewvmaO{width:100%}.VVTRIG51r8ORUIBPs5gN{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.AiaWRbRLFT9xvP9vn5jA{color:var(--jp-gray-80);font-size:14px;line-height:21px}.MP1wWkqvqfvAc7Izl7x4{align-self:center;margin-left:var(--spacing-base);margin-right:calc(var(--spacing-base)*2)}.i9X_KxEJiGpRT7q_RU6i{display:flex;justify-content:space-between}.WtVEv641JBaLl929sZq2{align-items:flex-start;background-color:#00000040;bottom:0;display:flex;justify-content:center;left:0;overflow-y:auto;padding-top:calc(var(--spacing-base)*12 + 2px);position:fixed;right:0;top:0;z-index:1000001}.G0aPt7WmA1rkUE0wcTno{background:var(--jp-white);border:1px solid var(--jp-gray);border-radius:calc(var(--jp-border-radius)*2);box-shadow:0 8px 20px #00000040;padding:calc(var(--spacing-base)*4);position:relative;width:616px}.VkrhWjfEIlIwYEumycbP{background:none;border:none;cursor:pointer;left:calc(var(--spacing-base)*3);padding:0;position:absolute;top:calc(var(--spacing-base)*3)}.yFzeV4cmWRbZKk5tIyEw{display:block}.gridicon{fill:currentColor;display:inline-block}.gridicon.needs-offset g{transform:translate(-1px,1px)}.gridicon.needs-offset-x g{transform:translate(-1px)}.gridicon.needs-offset-y g{transform:translateY(1px)}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-5:#f5e6b3;--jp-yellow-10:#f2cf75;--jp-yellow-40:#c08c00;--jp-orange-20:#faa754;--jp-blue-5:#ced9f2;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-border-radius-rna:8px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px;--jp-highlight:#3858e9}:where(body){font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(-8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-left:-62px}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-right:-62px}.icon-tooltip-helper .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.icon-tooltip-helper .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.icon-tooltip-helper.is-wide .components-popover__content{width:440px}.icon-tooltip-wrapper{color:var(--jp-black);display:inline-block;position:relative}.icon-tooltip-wrapper .components-button.is-link:focus:not(:disabled){box-shadow:none}.icon-tooltip-helper{height:18px;pointer-events:none;position:absolute;right:-53px;top:0;width:124px}.icon-tooltip-container{pointer-events:all}.icon-tooltip-container .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;margin:0 10px;max-width:90vw;outline:none;padding:24px;white-space:normal;width:304px}.icon-tooltip-title{font-size:16px;font-weight:600;line-height:19px}.icon-tooltip-title:not(:last-child){margin-bottom:8px}.icon-tooltip-content{font-size:14px;font-weight:400;line-height:24px}.icon-tooltip-content ul{list-style-type:disc;margin:0 1rem 0 0}.icon-tooltip-content ul li:last-child{margin-bottom:0}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50);text-decoration:underline;white-space:nowrap}.p4qz2tkq0p9hxucJ6Qk2{--padding:calc(var(--spacing-base)*4);color:var(--jp-black)}.lbNDyXioOwvyvbALtCBm{--gap:calc(var(--spacing-base)*3);padding:var(--padding) 0;position:relative}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm{column-gap:var(--gap);display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--columns),1fr);grid-template-rows:repeat(var(--rows),minmax(min-content,max-content))}.cLaNK_XcbTGlRQ4Tp43Q{margin-top:var(--padding)}.s2Lsn4kbm6BrS3DSndRB .cLaNK_XcbTGlRQ4Tp43Q{display:contents}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>*{background:var(--jp-white);position:relative}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>:after{bottom:0;box-shadow:0 4px 24px #0000000d;content:"";left:0;position:absolute;right:0;top:0;z-index:-1}.cLaNK_XcbTGlRQ4Tp43Q>:first-child{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius);border-width:1px 1px 0}.cLaNK_XcbTGlRQ4Tp43Q>:last-child{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius);border-width:0 1px 1px}.DAkZc1P9A3K12fjEliMg{display:flex;flex-direction:column;justify-content:space-between;padding:var(--padding)}.WUBuYABl8nymjs9NnCEL{align-items:center;display:flex;padding-bottom:calc(var(--spacing-base)*2);position:relative}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)){padding-top:calc(var(--spacing-base)*2)}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{background-color:var(--jp-gray);content:"";height:1px;left:var(--padding);position:absolute;right:var(--padding);top:0;z-index:5}.s2Lsn4kbm6BrS3DSndRB .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{left:unset;right:0;width:calc(100% + var(--gap))}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm>:last-child .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{width:100%}.ANtCFeb41NhA8PA3H7ZN,.WUBuYABl8nymjs9NnCEL:last-of-type{padding-bottom:var(--padding)}.Ql2gy_148yW8Vw5vhaKD{padding-left:var(--padding);padding-right:var(--padding)}.EAQrAnQEW1z1BfdY5gbC{margin:0 var(--spacing-base);fill:var(--jp-gray);flex-shrink:0}.EAQrAnQEW1z1BfdY5gbC.JDSTlLoOC_4aUoH2oNM2{fill:var(--jp-green-40)}.EAQrAnQEW1z1BfdY5gbC.zNdQRJ1w7BvaQOYyqzHK{fill:var(--jp-red-50)}.lr7vbX95SKtoe7DarJcZ{margin-right:auto}.s2Lsn4kbm6BrS3DSndRB .lr7vbX95SKtoe7DarJcZ{margin:0 var(--spacing-base);top:1px}.WUBuYABl8nymjs9NnCEL .KRrGp2xdkeBOxLZeuQ6X{fill:var(--jp-gray-20);flex-shrink:0}.H_ZJiRVJg0LiMXPGOcmt{text-align:center;width:fit-content}.H_ZJiRVJg0LiMXPGOcmt>a{color:#000}.s2Lsn4kbm6BrS3DSndRB .H_ZJiRVJg0LiMXPGOcmt{grid-column:2;overflow:hidden;padding-left:var(--padding);padding-right:var(--padding);white-space:nowrap}.x21z_DixObRDsDaWotP1{align-items:right;display:flex;justify-content:right;margin:0 calc(var(--spacing-base)*4)}.dovianZYLKhnbnh9I06o{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-end}.lljtQMhW7lq5tE5SDJEf{align-items:flex-start;display:flex;flex-basis:0;flex-grow:2}.lljtQMhW7lq5tE5SDJEf .NubApIV1vQCRUNprfm6b{margin-right:auto}.dhFQXpZfMwVI8vuYHnwC{align-items:flex-start;display:inline-flex;flex:0 0 auto;position:relative}.dhFQXpZfMwVI8vuYHnwC:first-child{margin-left:calc(var(--spacing-base)*2)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k{color:var(--jp-gray-20)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.C64ZjjUAqJC1T2Sa7apS{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start;margin-bottom:calc(var(--spacing-base)*3)}.UpZDGew6Ay1hPoP6eI7b{color:var(--jp-gray-40);font-size:var(--font-body-small);line-height:20px}.UpZDGew6Ay1hPoP6eI7b:after{content:"​"}.NubApIV1vQCRUNprfm6b{background-color:var(--jp-yellow-10);border-radius:4px;font-size:13px;font-weight:600;margin-right:var(--spacing-base);padding-left:var(--spacing-base);padding-right:var(--spacing-base)}.TDiiPbuW1Z0_05u_pvcK{font-weight:400}.UL3B1tQ854mN7r6taB61{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.IG56Hw7ZR_7rKVsM78qw:focus:not(:disabled){box-shadow:none}.jp-dashboard-footer{align-items:center;color:var(--jp-black);display:flex;flex-wrap:wrap;font-size:var(--font-body-extra-small);line-height:1.333;max-width:1128px;width:100%}.jp-dashboard-footer a{text-decoration:none}.jp-dashboard-footer a:any-link,.jp-dashboard-footer a[role=button]{color:inherit}.jp-dashboard-footer a:hover{text-decoration:underline;text-decoration-thickness:1.5px}.jp-dashboard-footer a:focus{border-radius:2px;box-shadow:none;outline:1.5px solid currentColor;outline-offset:3px}.jp-dashboard-footer.is-sm>ul{gap:.125rem}.jp-dashboard-footer.is-md,.jp-dashboard-footer.is-sm>ul{align-items:flex-start;flex-direction:column}.jp-dashboard-footer>ul{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;list-style:none;margin:0;padding:0;width:100%}.jp-dashboard-footer>ul>li{margin-bottom:0}.jp-dashboard-footer>ul>li>a{align-items:center;display:flex;gap:.25rem;min-height:44px}.jp-dashboard-footer__accessible-external-link{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px}.jp-dashboard-footer__jp-item{font-weight:600;padding-inline-end:1rem}.jp-dashboard-footer.is-sm .jp-dashboard-footer__jp-item{padding-bottom:1rem}.jp-dashboard-footer.is-lg .jp-dashboard-footer__a8c-item{margin-inline-start:auto}.jp-dashboard-footer.is-sm .jp-dashboard-footer__a8c-item{padding-top:1rem}.jp-dashboard-footer__a8c-item>a,.jp-dashboard-footer__jp-item>a{text-decoration:none}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}.sexr0jUxC1jVixdKiDnC{margin-right:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-right:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}.lyrXe0pA852TUmyekDb5{display:flex}.KgEeDTKgTC5ZjzYlbTqN{color:var(--jp-black);font-size:var(--font-body);line-height:1.5;margin-left:calc(var(--spacing-base)*4);padding:var(--spacing-base) 0;text-decoration:none}.KgEeDTKgTC5ZjzYlbTqN:last-child{margin-left:0}.KgEeDTKgTC5ZjzYlbTqN:focus,.KgEeDTKgTC5ZjzYlbTqN:hover{border-bottom-color:var(--jp-green);box-shadow:none;color:var(--jp-green)}.Lv4WoNVkeJntqvUyG4dX{border-bottom:1px solid var(--jp-black)}.vvXnRXxrU1kP1KsdSr4J{margin-top:calc(var(--spacing-base)*3*-1)}.aDCTkUFaJEeZzYYE6qv5{background-color:var(--jp-green);border-radius:32px;color:var(--jp-white);font-size:12px;letter-spacing:-2%;line-height:1;margin-right:var(--spacing-base);padding:calc(var(--spacing-base)/2) var(--spacing-base);position:relative;top:-1px}.uQlXhcfYn9tbnK27_Gct{align-items:center;display:flex}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:checked,.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:indeterminate{background:var(--jp-green-40);border-color:var(--jp-green-40)}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--jp-green-40)}.PO9zDOaSkcv_RqpfZF_v,.e5YHJiYcvfgdEEJsS_YM{margin-bottom:calc(var(--spacing-base)*7);margin-top:calc(var(--spacing-base)*7)}@media(max-width:599px){.PO9zDOaSkcv_RqpfZF_v{margin-top:0}}svg.V6B8ltQ7TH3UKzUC_qy1{color:var(--jp-black);height:32px;margin:0;width:32px}.C9hcvYAbgHPhN2Tl22xg{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.C9hcvYAbgHPhN2Tl22xg .XkbIpr2gzB4XEhHgzkY4{margin-left:calc(var(--spacing-base)/2)}.BfcZn0_X33Ajdd1Gl18G{display:flex}.BfcZn0_X33Ajdd1Gl18G>.rBmVJIeTNpd0RJWaRGuJ{display:flex;margin-right:calc(var(--spacing-base)/2);fill:var(--jp-gray-20)}.jVq5444f1Xh6nNkz0Qe_{margin-top:calc(var(--spacing-base)*4)}.amF9cOnMiv2nHbkMXQiQ{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.FodE_7RbLD8zeBSd6eVR{display:flex;flex-wrap:wrap;margin-right:auto}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-left:calc(var(--spacing-base)*3)}.twyPhW_K164HITnDrwEg{padding:calc(var(--spacing-base)*2);width:250px}.tbcd9xc_TjcFdokOt3F_{font-size:18px}@media(max-width:599px){.pnoqLV3l30xuvj2hLlJc{width:90%}.FodE_7RbLD8zeBSd6eVR{margin-top:calc(var(--spacing-base)*3)}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-bottom:var(--spacing-base);margin-left:0}}.bZ4b33s2MdcOjaDKBbeV{--spacing-base:8px;--wp-admin-border-width-focus:1.5px;align-items:center;display:flex;white-space:nowrap}.UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-gray-50);border-radius:50%;flex-shrink:0;height:.666em;width:.666em}.QuS0vdcr87FsiBvSSrvA{font-weight:600;line-height:1.666;margin-right:calc(var(--spacing-base)/2)}.bZ4b33s2MdcOjaDKBbeV.bGx0wbQAwuY7k8P3PHVQ a,.bZ4b33s2MdcOjaDKBbeV.bGx0wbQAwuY7k8P3PHVQ span{color:var(--jp-green-50)}.bZ4b33s2MdcOjaDKBbeV.bGx0wbQAwuY7k8P3PHVQ .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-green-50)}.bZ4b33s2MdcOjaDKBbeV.wR8Cz8uHgObTQavolv5y a,.bZ4b33s2MdcOjaDKBbeV.wR8Cz8uHgObTQavolv5y span{color:var(--jp-gray-50)}.bZ4b33s2MdcOjaDKBbeV.wR8Cz8uHgObTQavolv5y .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-gray-50)}.bZ4b33s2MdcOjaDKBbeV.IzbBYGwBKhSYFUQlIMww a,.bZ4b33s2MdcOjaDKBbeV.IzbBYGwBKhSYFUQlIMww span{color:var(--jp-red-50)}.bZ4b33s2MdcOjaDKBbeV.IzbBYGwBKhSYFUQlIMww .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-red-50)}.bZ4b33s2MdcOjaDKBbeV.Kdvp_HJf89IBrZuCaLm8 a,.bZ4b33s2MdcOjaDKBbeV.Kdvp_HJf89IBrZuCaLm8 span{color:var(--jp-yellow-30)}.bZ4b33s2MdcOjaDKBbeV.Kdvp_HJf89IBrZuCaLm8 .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-yellow-30)}.bZ4b33s2MdcOjaDKBbeV.hVf5vsbBWm8OFye7cy7a a,.bZ4b33s2MdcOjaDKBbeV.hVf5vsbBWm8OFye7cy7a span{color:var(--jp-blue-40)}.bZ4b33s2MdcOjaDKBbeV.hVf5vsbBWm8OFye7cy7a .UzkzDaqt2mXprJh2OXRz{background-color:var(--jp-blue-40)}.IunwKwdvL271DxBIniPb[type=checkbox]{display:none}.svA9WxEcOByd5S2fZonA{border:2px solid var(--jp-black);border-radius:100px;box-sizing:border-box;cursor:pointer;display:inline-block;height:24px;outline:0;padding:2px;position:relative;transition:all .4s ease,box-shadow 0s;vertical-align:middle;width:48px}.svA9WxEcOByd5S2fZonA:after{background:var(--jp-black);border-radius:50%;content:"";display:block;height:16px;position:relative;right:0;transition:all .2s ease;width:16px}.IunwKwdvL271DxBIniPb:checked+.svA9WxEcOByd5S2fZonA:after{right:22px}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-black);border-color:var(--jp-black)}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-green);border-color:var(--jp-green)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:disabled+span.svA9WxEcOByd5S2fZonA{cursor:default;opacity:.25}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA{border-radius:8px;height:16px;width:24px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA:after{height:12px;width:12px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n:checked+.svA9WxEcOByd5S2fZonA:after{right:8px}.Clxt94RgGnDrhORZZyPr,.K2OG1vK5PSOYDWKtqKKG{margin-bottom:calc(var(--spacing-base)*7);margin-top:calc(var(--spacing-base)*7)}.msOlyh2T7D6uhbM6AROg{align-items:center;background:none;border:2px solid var(--jp-green-40);border-radius:var(--jp-border-radius);color:var(--jp-gray-80);display:flex;gap:calc(var(--spacing-base)*3);justify-content:space-between;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);position:relative;text-align:right;width:100%}.msOlyh2T7D6uhbM6AROg a,.msOlyh2T7D6uhbM6AROg button{all:unset;color:var(--jp-gray-80);cursor:pointer}.msOlyh2T7D6uhbM6AROg a:after,.msOlyh2T7D6uhbM6AROg button:after{content:"";height:100%;position:absolute;right:0;top:0;width:100%}.msOlyh2T7D6uhbM6AROg:focus-within{border-color:var(--jp-black)}.msOlyh2T7D6uhbM6AROg:focus-within .cPN7USVqSBpxUswfDtUZ,.msOlyh2T7D6uhbM6AROg:hover .cPN7USVqSBpxUswfDtUZ{transform:translateX(calc((var(--spacing-base)*2)*-1))}.msOlyh2T7D6uhbM6AROg:focus-within .EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg:hover .EmnJAyEzzn1QpA8HtypY{text-decoration:underline;text-decoration-thickness:2px}.EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg .EmnJAyEzzn1QpA8HtypY{font-weight:700}.cPN7USVqSBpxUswfDtUZ{fill:var(--jp-green-40);pointer-events:none;transition:transform .1s ease-out}.vV7YZikAz0oHYsuvtxMq{display:inline;margin:0 calc(var(--spacing-base)/3) 0 0;vertical-align:middle}.vV7YZikAz0oHYsuvtxMq svg{position:relative;z-index:10}.T1YaMupeZmBIpXZHY9EZ{display:inline}.rigH8UdiDrmmSLQMUurD{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);color:var(--jp-black);display:block;font-size:var(--font-body);letter-spacing:-.02em;line-height:1.5;padding:var(--spacing-base) calc(var(--spacing-base)*1.5);transition:box-shadow .1s ease-out;width:100%}.rigH8UdiDrmmSLQMUurD::placeholder{color:var(--jp-gray-20)}.rigH8UdiDrmmSLQMUurD:focus{box-shadow:0 0 0 2px var(--jp-green-5)}.rigH8UdiDrmmSLQMUurD:focus,.rigH8UdiDrmmSLQMUurD:hover:not(:disabled){border:1px solid var(--jp-green)}.rigH8UdiDrmmSLQMUurD:disabled{background-color:var(--jp-gray-0);color:var(--jp-gray-30)}.V8FDM08CpcwQs4UwN2nI{color:var(--jp-black);display:block;font-size:var(--font-title-small);font-weight:600;margin-bottom:var(--spacing-base)}.L1LjeCYPldBcTLILS13l{max-width:calc(744px + var(--spacing-base)*6);width:100%}.JWWznnb8sAKHIOhE59_z{display:flex}.JWWznnb8sAKHIOhE59_z:not(:first-child){margin-top:calc(var(--spacing-base)*7)}.kV5wl2UResIqqBdSTuQr{margin-left:calc(var(--spacing-base)*2);padding-top:calc(var(--spacing-base)/2)}@media(min-width:600px){.kV5wl2UResIqqBdSTuQr{margin-left:calc(var(--spacing-base)*5)}}.oePuSIKcH_JzEhDJcHh8{width:100%}.mxYw7vghJF8H8C0FjvPz{align-items:center;display:flex}.lyiOCAyjT_eQyDg8Ier_ .oePuSIKcH_JzEhDJcHh8{opacity:.5}.IclfL4iNXTZfBAbHZdog>:last-child{margin-top:calc(var(--spacing-base)*2)}@media(min-width:600px){.IclfL4iNXTZfBAbHZdog{display:flex;justify-content:space-between}}.bOadM4auwszaOl0el95T{display:flex;flex-wrap:wrap;margin-top:calc(var(--spacing-base)*2)}.G7vkgqk8AEd6pRbNUyE4{color:var(--jp-green-50);margin-left:calc(var(--spacing-base)/2)}.qnlbRElIsj4nB45F5s3a{color:var(--jp-gray-50)}.TvvdPGzRa_ubn3BnQOnQ{color:var(--jp-red-50)}.ciEDIqQimh9OqgCN4t3c{display:flex;flex-wrap:wrap}.qQ3tqN6Pi9DJ2xYLvfvA{color:var(--jp-gray-50)}.xmutRBXpbSs8i1QMo5FT{margin-left:calc(var(--spacing-base)/2)}.kQ5SrYe6QmF63mEYQ26R,.xmutRBXpbSs8i1QMo5FT{color:var(--jp-green-50)}.yAFMUkq1ot9DZF05RUwG{margin-top:calc(var(--spacing-base)*3)}@media(min-width:600px){.yAFMUkq1ot9DZF05RUwG{padding-right:calc(var(--spacing-base)*11)}}.EbfrbByI7NQ2_MD_gDXp{align-items:center;border:1px solid var(--jp-gray-30);border-radius:4px;color:var(--jp-gray-30);display:flex;font-size:12px;height:21px;margin-bottom:calc(var(--spacing-base)*2);margin-right:var(--spacing-base);padding:calc(var(--spacing-base)/2)}.hCwaBLH_6dELyWWwB8S1{padding:calc(var(--spacing-base)*3);width:304px}.V3U9oKSdRmKjOQ523C86{display:flex;justify-content:space-between}.OSrT4pA4vIGzg9EE6rcv{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-3)}.OSrT4pA4vIGzg9EE6rcv:focus,.OSrT4pA4vIGzg9EE6rcv:focus:not(:disabled){box-shadow:none}.rbL50q3wwzE6X7VBHcmW{display:flex;justify-content:flex-end}.gF7LiE_q_elhMrhdypAl{color:var(--jp-gray-50)}.gF7LiE_q_elhMrhdypAl:before{background:var(--jp-gray-50);border-radius:50%;content:"";display:inline-block;height:8px;margin-left:var(--spacing-base);width:8px}.gF7LiE_q_elhMrhdypAl.fbJbqf_YrPpMG4JKF79U{color:var(--jp-green-40)}.gF7LiE_q_elhMrhdypAl.fbJbqf_YrPpMG4JKF79U:before{background:var(--jp-green-40)}.g593fzjQCE_4rNiiwLdg{line-height:1;margin-bottom:calc(var(--spacing-base)*1.5)}.CIp_BwDbLdjYPSVrreqg{align-items:flex-start;justify-content:space-between}.CIp_BwDbLdjYPSVrreqg,.m2epTt5F7wBQNcMdguwQ{display:flex;margin-top:calc(var(--spacing-base)*2)}.m2epTt5F7wBQNcMdguwQ{justify-content:right}.HrEvG7sxsWbTLD0sk477{border-bottom:2px solid var(--jp-gray-5);margin-top:calc(var(--spacing-base)*7)}.VHYulMcpzbr10HWR0iSE{align-items:flex-start;border:1px solid var(--jp-black);border-color:var(--jp-gray-5);border-radius:4px;border-right-width:6px;display:flex;font-size:var(--font-body);padding:24px 18px 27px 31px}.FGpSkMCiIHQjszcV0dbn{margin-left:20px}.FGpSkMCiIHQjszcV0dbn,.KoWZcCwhW13xvkEb0QON{height:calc(var(--spacing-base)*3);width:calc(var(--spacing-base)*3)}.KoWZcCwhW13xvkEb0QON{background-color:#0000;border:none;cursor:pointer;outline:none}@media screen and (max-width:600px){.VHYulMcpzbr10HWR0iSE{box-shadow:0 4px 8px #00000008,0 1px 2px #0000000f;padding-top:68px;position:relative}.FGpSkMCiIHQjszcV0dbn{position:absolute;right:24px;top:24px}.KoWZcCwhW13xvkEb0QON{left:24px;position:absolute;top:24px}}.smrfczkC53EaFM8OJUXs{flex-grow:1}.IKYRWoPwt9xOVEx1wzNS{font-weight:600;margin-bottom:8px}.qM0qY6mPYp1MPN54A3Kg{align-items:center;display:flex;margin-top:20px}.qM0qY6mPYp1MPN54A3Kg a,.qM0qY6mPYp1MPN54A3Kg a:active,.qM0qY6mPYp1MPN54A3Kg a:focus,.qM0qY6mPYp1MPN54A3Kg a:hover{color:var(--jp-black)}.qM0qY6mPYp1MPN54A3Kg>*{margin-left:24px}.A5YkDkkXuiYgavrY6Nux{border-right-color:var(--jp-red)}.A5YkDkkXuiYgavrY6Nux .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-red)}.cT5rwuPMZzWvi5o6shMl{border-right-color:var(--jp-yellow-20)}.cT5rwuPMZzWvi5o6shMl .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-yellow-20)}.yo0O3uvNomPsYUXFCpAS{border-right-color:var(--black)}.yo0O3uvNomPsYUXFCpAS .y_IPyP1wIAOhyNaqvXJq{fill:var(--black)}.oZdDFf1jBLkzn5ICCC6x{border-right-color:var(--jp-green)}.oZdDFf1jBLkzn5ICCC6x .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-green)}.EU0Rvu4PDqVtnCAmbgHg{height:56px;margin-bottom:calc(var(--spacing-base)*8);width:48px}.EU0Rvu4PDqVtnCAmbgHg>svg{position:relative;right:-40px;top:-36px}.MeZ8EJKfFWG5h1abL4gD{padding:calc(var(--spacing-base)*7) 0}.vzMlFr1AXWqefpRrb976{align-items:center;display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*3)}.gYSOMa4xxLXmsNzvFPkW{background-color:var(--jp-gray-5);border-radius:calc(var(--spacing-base)*3);width:100%}.hNJWdt5qmZkWYAH_vjIp{background-color:var(--jp-green-40);border-radius:calc(var(--spacing-base)*3);height:9px;transition:width .2s}.DHMUfGyHbl5BgD5vjxVz{color:var(--jp-gray-90);font-weight:600;line-height:24px;margin-right:auto;padding-right:var(--spacing-base)}.XqQBRzrxyMhhZvPXIHgk .components-button{box-shadow:inset 0 0 0 1.5px var(--jp-gray);position:relative}.XqQBRzrxyMhhZvPXIHgk .components-button:first-child{border-radius:0 var(--jp-border-radius) var(--jp-border-radius) 0}.XqQBRzrxyMhhZvPXIHgk .components-button:last-child{border-radius:var(--jp-border-radius) 0 0 var(--jp-border-radius)}.XqQBRzrxyMhhZvPXIHgk .components-button:hover{z-index:1}.XqQBRzrxyMhhZvPXIHgk .components-button+.components-button{margin-right:-1.5px}.ttGgvvtxu52J_2mCCopL{padding:calc(var(--spacing-base)*7) 0}.HKtrpPFSTSG9Xek34vBa,.UZsYf4noF2SMuyOqGWPA{align-items:center;display:flex}.HKtrpPFSTSG9Xek34vBa{height:100%}.HKtrpPFSTSG9Xek34vBa img{object-fit:cover;width:100%}.dgFk23NY71PPMar8DEME,.t_Av4raklvnsBRBA4hms{margin-top:calc(var(--spacing-base)*3 + 1px)}.t_Av4raklvnsBRBA4hms{display:flex;justify-content:flex-end}.B5k6PdQs1UVDzb2J98wR>:first-child{flex:1}@media(min-width:960px){.B5k6PdQs1UVDzb2J98wR{align-items:flex-start;display:flex}}._h9h7RagEFrCDu7S2Vfi{display:flex;flex-direction:column;gap:var(--spacing-base)}._h9h7RagEFrCDu7S2Vfi>:last-child{margin-top:calc(var(--spacing-base)*2)}.sSzimfzP9ZeilBh2H0Um{align-items:center;color:var(--jp-black);display:flex;margin-bottom:0}.X7CVf27QOnW2yuV332eo{margin-left:var(--spacing-base);margin-right:-4px}.SaA9v6DNQOHPx1EK90y9{align-items:flex-end;flex-direction:column}.SaA9v6DNQOHPx1EK90y9,.kadiUBzNiR_qFA1y7Eig{display:flex;gap:calc(var(--spacing-base)*2)}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aLWBKY0yRghEk7tNCgK3{fill:var(--color-bluesky)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw{fill:var(--color-nextdoor)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI{fill:var(--color-threads)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI.social-logo{border-radius:40%}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box}.GqFcAwJvIrg1v7f6QUfw{display:flex;flex-direction:column;min-height:230px;padding:calc(var(--spacing-base)*3);width:304px}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S{display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*2)}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S .KnqJLKwSceJTwFJrPGHq{max-width:226px}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S .PJU0_yA9jNf7ao0jhHut{background-color:var(--jp-white);color:var(--jp-gray-90);flex-shrink:0;height:calc(var(--spacing-base)*3);min-width:unset;width:calc(var(--spacing-base)*3)}.GqFcAwJvIrg1v7f6QUfw .OENx8kmm62tkWGukzP2S .PJU0_yA9jNf7ao0jhHut:hover:not(:focus){box-shadow:none}.GqFcAwJvIrg1v7f6QUfw .rrORM3zqHfGvqiPduEXY{align-items:flex-end;display:flex;flex-grow:1;height:calc(var(--spacing-base)*6);justify-content:flex-end;margin-top:calc(var(--spacing-base)*2)}.GqFcAwJvIrg1v7f6QUfw .rrORM3zqHfGvqiPduEXY .Q7fUcDUGhteXEr18rZPC{color:var(--jp-gray-60);flex-grow:1;margin-bottom:var(--spacing-base)}.GqFcAwJvIrg1v7f6QUfw .rrORM3zqHfGvqiPduEXY .S5LAeskUiEQ0JlPhr0Ze{flex-shrink:0}.OtDl6kocO_m2s9sRHaqX{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;max-height:600px;width:100%}.BjwJh1S1YVPI7AjmTx6a+.BjwJh1S1YVPI7AjmTx6a{margin-top:calc(var(--spacing-base)*5)}.YWfK8VTp2wnByBauYPKg{background-color:var(--jp-gray-0);overflow-x:scroll;padding:calc(var(--spacing-base)*3)}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:flex-end;margin-top:calc(var(--spacing-base)*3);padding-top:calc(var(--spacing-base)*3)}.ap6lG79CncSqdigJS_WA{margin-top:calc(var(--spacing-base)*4)}.uym7dGHhp6ifjF57yOAO{align-items:flex-end;display:flex;margin-bottom:calc(var(--spacing-base)*2.25)}.e_2eFTR8RyHwmfeqJL4F{flex:1;margin-bottom:0}.IKQVU01PrDMMV5UFLOKv{display:flex;gap:calc(var(--spacing-base)*2)}.pkw2LnOTd8VvQ3oT8sXQ{border-top:1px solid var(--jp-gray);display:flex;justify-content:right;padding-top:calc(var(--spacing-base)*4);width:100%}.pkw2LnOTd8VvQ3oT8sXQ>:last-child{margin-right:calc(var(--spacing-base)*2)}.qazuloIt0teplSEwxRN0{background-color:#fff;border:1px solid var(--jp-gray);border-bottom:none;color:var(--jp-gray-50);display:grid;grid-template-columns:repeat(9,1fr);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);width:100%}.qazuloIt0teplSEwxRN0>span:first-child{grid-column:1/7}.qazuloIt0teplSEwxRN0>span:not(:first-child){text-align:center}.iJ_biSBRDribuNKX0Zuw{margin:calc(var(--spacing-base)*4) calc(var(--spacing-base)*8);text-align:center}@media(max-width:599px){.uym7dGHhp6ifjF57yOAO{margin-bottom:calc(var(--spacing-base)*3)}.e_2eFTR8RyHwmfeqJL4F{display:none}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:center}.pkw2LnOTd8VvQ3oT8sXQ>*{width:50%}}.v640YfEL85A9rCvyHSzW{align-items:center;display:flex;gap:4px;justify-content:center;margin-bottom:calc(var(--spacing-base)*2);margin-top:calc(var(--spacing-base)*4)}.v640YfEL85A9rCvyHSzW button{font-size:var(--font-body);height:auto;line-height:32px;min-width:32px;padding:0 var(--spacing-base);width:auto}.v640YfEL85A9rCvyHSzW button.gfxpe4zp6ShFsIsce8Ii,.v640YfEL85A9rCvyHSzW button.gfxpe4zp6ShFsIsce8Ii:hover:not(:disabled){background:none;color:var(--jp-black)}.x8UuVEhWucPfdq0hEJg6{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius)}.x8UuVEhWucPfdq0hEJg6>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.eb6Ovfvm1yONz4mdOwbH{background-color:var(--jp-white)}.jF9LXpXR3TxZVDw7TVXT{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.jF9LXpXR3TxZVDw7TVXT>:first-of-type{grid-column:1/8}.jF9LXpXR3TxZVDw7TVXT>:last-of-type{grid-column:9}.jF9LXpXR3TxZVDw7TVXT:hover{background:var(--jp-gray-0)}.lNQgAfpwdAUSOLZd8dlD{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.WRQwDYPdffWznX158azR{margin-left:var(--spacing-base)}.dJx9pvlYjDnKn11n5wo8{font-weight:600;margin-bottom:var(--spacing-base);margin-right:calc(var(--spacing-base)*4)}.EKcbLuSblRc7UpzgsFXw{align-items:center}.ILMBWlMLcXc0n97IisrG{overflow:hidden;transform-origin:top center}.T8XIzCNJBQy1UETN5gjU{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.kWoHGiaZSbq9XJVyUOMC{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.HQgjxePFDRJHamBAGcVU{background-color:var(--jp-white);border-radius:var(--jp-border-radius);box-shadow:0 0 40px #00000014;margin:0;padding:var(--spacing-base) 0}.KtdsNIMumOoHNWMLmuAJ{align-items:center;display:flex;justify-content:space-between;margin:0;padding:calc(var(--spacing-base)*2);text-align:right}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2{cursor:pointer;outline-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:focus:not(.owofT85W_XvVdb5vr1GN),.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:hover:not(.owofT85W_XvVdb5vr1GN){background-color:var(--jp-gray-0)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN{background-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .NESnw2xCLrBpP6WlYZL4{color:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .aohnd_y_1lrMuww8NH63{fill:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .Rnas_2_2_eLZSYfZ347E{background-color:var(--jp-red);border:1px solid var(--jp-red);color:var(--jp-white)}.NESnw2xCLrBpP6WlYZL4{align-items:center;display:flex;overflow-x:hidden;padding-left:var(--spacing-base)}.m4_14yNRByDyO9yf9pGg{display:block;overflow-x:hidden;text-overflow:ellipsis}.aohnd_y_1lrMuww8NH63{margin-left:calc(var(--spacing-base)*2)}.Rnas_2_2_eLZSYfZ347E{align-items:center;border:1px solid var(--jp-red-60);border-radius:50%;box-sizing:border-box;color:var(--jp-red-60);display:flex;justify-content:center;min-width:30px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.X8NRHUTBa_4wDvoHN9TT{fill:var(--jp-green-50)}.CsuOteurQlJm4IjXqyZ0{fill:var(--jp-gray-20)}.fvbewglUxEvV1o04yzzp{--icon-size:28px;--item-spacing:calc(var( --spacing-base )*2);--left-spacing:calc(var( --icon-size ) + var( --item-spacing ));list-style:none}.DINy59MKjwiQanaoDTiV{padding:calc(var(--spacing-base)*2)}.XoacHJljw8zRW_fkBSyg{padding:0}.mXM4WZRePVTa07dhQ6MD{margin-right:var(--left-spacing)}.sI3V8khLdCqxkhJQ_XnI{display:flex;justify-content:flex-start;padding:calc(var(--spacing-base)*2)}.hgdxMuIvZwTZ0sfXaols{padding:calc(var(--spacing-base)*2);width:250px}.UErHS2HAh1gszGfYuVIf{align-items:center;background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);display:flex;justify-content:space-between;padding:calc(var(--spacing-base)*2);width:100%}.lEhH1hvCcxLVFMHI8Gwv{display:flex;justify-content:flex-start}.c57Vj4QhAHwcK_HZMxtN{margin-left:var(--spacing-base)}.LumryWNddoF092fZgN2O{font-size:var(--font-body);line-height:1.5}.NFMwU3H5k2qArZe2TTp9{background-color:var(--jp-gray-10);font-weight:600;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.G5W9M8qfo3sGl2OIbwg9{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:Courier\ 10 Pitch,Courier,monospace;overflow-x:scroll;white-space:pre}.Bx4RDCUR316fm_jgGS8N{background-color:var(--jp-gray-10);color:var(--jp-gray-50);display:flex;flex-direction:column;padding:0 var(--spacing-base);text-align:left}.GhN0JvAyRQI3SnVWp2Ot{display:flex;flex-direction:column;flex-grow:1;overflow-x:visible}.GhN0JvAyRQI3SnVWp2Ot del,.GhN0JvAyRQI3SnVWp2Ot div,.GhN0JvAyRQI3SnVWp2Ot ins{padding:0 var(--spacing-base);text-decoration:none}.GhN0JvAyRQI3SnVWp2Ot del{background-color:var(--jp-red-0);color:var(--jp-red-60)}.GhN0JvAyRQI3SnVWp2Ot ins{background-color:var(--jp-green-5);color:var(--jp-green-60)}.xpPHTch5ul0xuZaUoTNa{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:monospace;overflow-x:scroll;padding:0}.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-0)}.i0_0xMrNWoak1brIaDQq{display:flex;flex-direction:column;text-align:left}.C9fLawPLkMNSZthfwxj6{background-color:var(--jp-gray-10);color:var(--font-body);padding:0 calc(var(--spacing-base)/2)}.C9fLawPLkMNSZthfwxj6.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-50);color:var(--jp-white)}.ogixgg8fRGekmYGtevh1{display:flex;flex:1;flex-direction:column;overflow-x:visible;white-space:pre}.jYPCgKMDRKfT3vnx0mdG{padding-right:var(--spacing-base)}.UEQ1NqkrwNmaQR7qdEK3{background-color:var(--jp-red);border-radius:calc(var(--jp-border-radius)/2);color:var(--jp-white);padding:calc(var(--spacing-base)/4) calc(var(--spacing-base)/2)}.sfXsfklfkeSRtE9ivQwF{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:inline-block;width:100%}.sfXsfklfkeSRtE9ivQwF>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.ozRrKPlj1QFGUyd3oVke{background-color:var(--jp-white)}.PyvnSHQuuUkZvVsArigy{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.PyvnSHQuuUkZvVsArigy>:first-of-type{grid-column:1/7}.PyvnSHQuuUkZvVsArigy>:last-of-type{grid-column:9}.PyvnSHQuuUkZvVsArigy>:not(:first-child){margin:auto}.PyvnSHQuuUkZvVsArigy:hover{background:var(--jp-gray-0)}.u9Xod5s8bCRNj9MR1Drl{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.IbeyulkpO9kjYJ4OkYUD{margin-left:var(--spacing-base)}.KiCgmjHm2f0JDU3cMsgf{font-weight:600}.KiCgmjHm2f0JDU3cMsgf,.kh5zuLR1zNf7KCsxhAZ5{margin-bottom:var(--spacing-base);margin-right:calc(var(--spacing-base)*4)}.kh5zuLR1zNf7KCsxhAZ5{font-size:var(--font-body-small);font-weight:400}.z1z63g62c73XbcPk9DWc{background-color:var(--jp-gray-50);display:inline-block;height:4px;margin:2px 12px;width:4px}.kJ8t3FAtd5VAYjk31SfA{align-items:center}.JP0IJZcYRohfgntEozjm{overflow:hidden;transform-origin:top center}.y7c6zi2wjEnbW3F29fmP{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.wQWiN_J0SqgduvadyGnm{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.v1fUFCBPmd6miSCf_ehK{fill:var(--jp-green-40)}.oR9QG6gRLvyzqiuIarmu{border-radius:32px;flex-shrink:0;font-size:12px;font-style:normal;font-weight:600;line-height:16px;margin-right:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);position:relative;text-align:center;width:60px}.oR9QG6gRLvyzqiuIarmu.bZ8KDXMWoim85Zv31E7E{background-color:#008a20;color:var(--jp-white)}.oR9QG6gRLvyzqiuIarmu.uYEkrN4rh8n5cs3aPrYC{background-color:var(--jp-gray-50);color:var(--jp-white)}.WOX88CWB12lzxcMcl_ns{color:#008a20}@media(max-width:599px){.PyvnSHQuuUkZvVsArigy{display:grid;grid-auto-rows:minmax(auto,auto)}.PyvnSHQuuUkZvVsArigy>:first-child{grid-column:1/8;grid-row:1}.PyvnSHQuuUkZvVsArigy>:nth-child(2){grid-row:2;padding-right:calc(var(--spacing-base)*4)}.PyvnSHQuuUkZvVsArigy>:nth-child(3){grid-row:2}.PyvnSHQuuUkZvVsArigy>:nth-child(3) span{margin-top:var(--spacing-base);position:absolute}.PyvnSHQuuUkZvVsArigy>:last-child{grid-column:10;grid-row:1/3}.oR9QG6gRLvyzqiuIarmu{display:none}}@media(max-width:1200px){.kh5zuLR1zNf7KCsxhAZ5{display:grid}.z1z63g62c73XbcPk9DWc{display:none}}.aEAAkNfx0ERh4LEvCBVw>:first-child{flex:1}@media(min-width:960px){.aEAAkNfx0ERh4LEvCBVw{align-items:flex-start;display:flex}}.f3l2VSMBpGpf6Ta1jP5f{align-items:center;color:var(--jp-black);display:flex}.v4n86Hu06mIkxqFkfYY2{margin-left:var(--spacing-base);margin-right:-4px}.fTSgXuIQCZFFBxzFCE0q{align-items:flex-end;display:flex;flex-direction:column;gap:calc(var(--spacing-base)*2)}.KmIjHqrMs3duMPaUf50k{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;max-height:600px;width:100%}.DJS67UCXVaM7nIMJePYQ{align-items:flex-end;display:flex;justify-content:flex-end;margin-bottom:calc(var(--spacing-base)*2.25)}.s4378tf2MiM0bMIxQZkI{flex:1;margin-bottom:0}.jifq7nsF5kZYrcpGQ35V{display:flex;gap:calc(var(--spacing-base)*2)}@media(max-width:599px){.DJS67UCXVaM7nIMJePYQ{margin-bottom:calc(var(--spacing-base)*3)}.s4378tf2MiM0bMIxQZkI{display:none}}*{box-sizing:border-box}#jetpack-protect-root{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.51px;--actions-size:28px} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/composer.json new file mode 100644 index 00000000..6c02a837 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/composer.json @@ -0,0 +1,76 @@ +{ + "name": "automattic/jetpack-protect", + "description": "Social plugin", + "type": "wordpress-plugin", + "license": "GPL-2.0-or-later", + "require": { + "ext-json": "*", + "automattic/jetpack-assets": "^2.3.7", + "automattic/jetpack-admin-ui": "^0.4.5", + "automattic/jetpack-autoloader": "^3.1.0", + "automattic/jetpack-composer-plugin": "^2.0.3", + "automattic/jetpack-config": "^2.0.4", + "automattic/jetpack-my-jetpack": "^4.35.3", + "automattic/jetpack-plugins-installer": "^0.4.3", + "automattic/jetpack-sync": "^3.10.0", + "automattic/jetpack-transport-helper": "^0.2.4", + "automattic/jetpack-plans": "^0.4.10", + "automattic/jetpack-waf": "^0.18.5", + "automattic/jetpack-status": "^4.0.1", + "automattic/jetpack-protect-status": "^0.1.5" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "0.4.2" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "build-development": [ + "pnpm run build" + ], + "build-production": [ + "pnpm run build-production-concurrently" + ], + "watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run watch" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "repositories": [], + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "mirror-repo": "Automattic/jetpack-protect-plugin", + "autorelease": true, + "autotagger": { + "v": false + }, + "release-branch-prefix": "protect", + "wp-plugin-slug": "jetpack-protect", + "wp-svn-autopublish": true, + "version-constants": { + "JETPACK_PROTECT_VERSION": "jetpack-protect.php" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true, + "automattic/jetpack-autoloader": true, + "automattic/jetpack-composer-plugin": true + }, + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ3_0_2" + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack-protect.php new file mode 100644 index 00000000..dda7f189 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack-protect.php @@ -0,0 +1,140 @@ + array( + 'plugin' => 'Jetpack Protect', + ), + ); + + return $slugs; + } + ); + + add_action( + 'admin_notices', + function () { + if ( get_current_screen()->id !== 'plugins' ) { + return; + } + + $message = sprintf( + wp_kses( + /* translators: Placeholder is a link to a support document. */ + __( 'Your installation of Jetpack Protect is incomplete. If you installed Jetpack Protect from GitHub, please refer to this document to set up your development environment. Jetpack Protect must have Composer dependencies installed and built via the build command.', 'jetpack-protect' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project' + ); + wp_admin_notice( + $message, + array( + 'type' => 'error', + 'dismissible' => true, + ) + ); + } + ); + + return; +} + +// Redirect to plugin page when the plugin is activated. +add_action( 'activated_plugin', 'jetpack_protect_plugin_activation' ); + +/** + * Redirects to plugin page when the plugin is activated + * + * @param string $plugin Path to the plugin file relative to the plugins directory. + */ +function jetpack_protect_plugin_activation( $plugin ) { + if ( + JETPACK_PROTECT_ROOT_FILE_RELATIVE_PATH === $plugin && + ( new \Automattic\Jetpack\Paths() )->is_current_request_activating_plugin_from_plugins_screen( JETPACK_PROTECT_ROOT_FILE_RELATIVE_PATH ) + ) { + wp_safe_redirect( esc_url( admin_url( 'admin.php?page=jetpack-protect' ) ) ); + exit; + } +} + +// Add "Settings" link to plugins page. +add_filter( + 'plugin_action_links_' . JETPACK_PROTECT_FOLDER . '/jetpack-protect.php', + function ( $actions ) { + $settings_link = '' . __( 'Dashboard', 'jetpack-protect' ) . ''; + array_unshift( $actions, $settings_link ); + + return $actions; + } +); + +register_activation_hook( __FILE__, array( 'Jetpack_Protect', 'plugin_activation' ) ); +register_deactivation_hook( __FILE__, array( 'Jetpack_Protect', 'plugin_deactivation' ) ); + +// Main plugin class. +new Jetpack_Protect(); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/CHANGELOG.md new file mode 100644 index 00000000..1e7d3ab7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/CHANGELOG.md @@ -0,0 +1,171 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.0.2] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [2.0.1] - 2024-03-12 +### Changed +- Internal updates. + +## [2.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [1.4.22] - 2023-09-19 + +- Minor internal updates. + +## [1.4.21] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.4.20] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.4.19] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.4.18] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.4.17] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.4.16] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.4.15] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.4.14] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.4.13] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.4.12] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.4.11] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.4.10] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.4.9] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.4.8] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.4.7] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.4.6] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.4.5] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- updated annotations versions + +## [1.4.4] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.4.3] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.4.2] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.4.1] - 2021-02-05 + +- CI: Make tests more generic + +## [1.4.0] - 2021-01-20 + +- Add mirror-repo information to all current composer packages + +## [1.3.0] - 2020-12-17 + +- Coverage Update whitelist for backend tests +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.2.0] - 2020-09-17 + +## [1.1.1] - 2020-09-17 + +- a8c-mc-stats: Do not distribute test files + +## [1.1.0] - 2020-08-13 + +- CI: Try collect js coverage + +## 1.0.0 - 2020-07-27 + +- Creates the MC Stats package + +[2.0.2]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.22...v2.0.0 +[1.4.22]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.21...v1.4.22 +[1.4.21]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.20...v1.4.21 +[1.4.20]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.19...v1.4.20 +[1.4.19]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.18...v1.4.19 +[1.4.18]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.17...v1.4.18 +[1.4.17]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.16...v1.4.17 +[1.4.16]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.15...v1.4.16 +[1.4.15]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.14...v1.4.15 +[1.4.14]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.13...v1.4.14 +[1.4.13]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.12...v1.4.13 +[1.4.12]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.11...v1.4.12 +[1.4.11]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.10...v1.4.11 +[1.4.10]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.9...v1.4.10 +[1.4.9]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.8...v1.4.9 +[1.4.8]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.7...v1.4.8 +[1.4.7]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.6...v1.4.7 +[1.4.6]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/composer.json new file mode 100644 index 00000000..e2c638c5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/composer.json @@ -0,0 +1,41 @@ +{ + "name": "automattic/jetpack-a8c-mc-stats", + "description": "Used to record internal usage stats for Automattic. Not visible to site owners.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-a8c-mc-stats", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php new file mode 100644 index 00000000..9e573cd7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php @@ -0,0 +1,181 @@ +use_transparent_pixel = $use_transparent_pixel; + } + + /** + * Store a stat for later output. + * + * @param string $group The stat group. + * @param string $name The stat name to bump. + * + * @return boolean true if stat successfully added + */ + public function add( $group, $name ) { + + if ( ! \is_string( $group ) || ! \is_string( $name ) ) { + return false; + } + + if ( ! isset( $this->stats[ $group ] ) ) { + $this->stats[ $group ] = array(); + } + + if ( \in_array( $name, $this->stats[ $group ], true ) ) { + return false; + } + + $this->stats[ $group ][] = $name; + + return true; + } + + /** + * Gets current stats stored to be processed + * + * @return array $stats + */ + public function get_current_stats() { + return $this->stats; + } + + /** + * Return the stats from a group in an array ready to be added as parameters in a query string + * + * @param string $group_name The name of the group to retrieve. + * @return array Array with one item, where the key is the prefixed group and the value are all stats concatenated with a comma. If group not found, an empty array will be returned + */ + public function get_group_query_args( $group_name ) { + $stats = $this->get_current_stats(); + if ( isset( $stats[ $group_name ] ) && ! empty( $stats[ $group_name ] ) ) { + return array( "x_jetpack-{$group_name}" => implode( ',', $stats[ $group_name ] ) ); + } + return array(); + } + + /** + * Gets a list of trac URLs for every stored URL + * + * @return array An array of URLs + */ + public function get_stats_urls() { + + $urls = array(); + + foreach ( $this->get_current_stats() as $group => $stat ) { + $group_query_string = $this->get_group_query_args( $group ); + $urls[] = $this->build_stats_url( $group_query_string ); + } + + return $urls; + } + + /** + * Outputs the tracking pixels for the current stats and empty the stored stats from the object + * + * @return void + */ + public function do_stats() { + $urls = $this->get_stats_urls(); + foreach ( $urls as $url ) { + echo ''; + } + $this->stats = array(); + } + + /** + * Pings the stats server for the current stats and empty the stored stats from the object + * + * @return void + */ + public function do_server_side_stats() { + $urls = $this->get_stats_urls(); + foreach ( $urls as $url ) { + $this->do_server_side_stat( $url ); + } + $this->stats = array(); + } + + /** + * Runs stats code for a one-off, server-side. + * + * @param string $url string The URL to be pinged. Should include `x_jetpack-{$group}={$stats}` or whatever we want to store. + * + * @return bool If it worked. + */ + public function do_server_side_stat( $url ) { + $response = wp_remote_get( esc_url_raw( $url ) ); + if ( is_wp_error( $response ) ) { + return false; + } + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + return true; + } + + /** + * Builds the stats url. + * + * @param array $args array|string The arguments to append to the URL. + * + * @return string The URL to be pinged. + */ + public function build_stats_url( $args ) { + $defaults = array( + 'v' => 'wpcom2', + 'rand' => md5( wp_rand( 0, 999 ) . time() ), + ); + $args = wp_parse_args( $args, $defaults ); + $gifname = true === $this->use_transparent_pixel ? 'b.gif' : 'g.gif'; + + /** + * Filter the URL used as the Stats tracking pixel. + * + * @since-jetpack 2.3.2 + * @since 1.0.0 + * + * @param string $url Base URL used as the Stats tracking pixel. + */ + $base_url = apply_filters( + 'jetpack_stats_base_url', + 'https://pixel.wp.com/' . $gifname + ); + $url = add_query_arg( $args, $base_url ); + return $url; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/CHANGELOG.md new file mode 100644 index 00000000..f211e5dc --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/CHANGELOG.md @@ -0,0 +1,198 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.4.5] - 2024-09-05 +### Changed +- Jetpack menu: only register Jetpack admin page for contributor roles and above. [#39081] + +## [0.4.4] - 2024-08-29 +### Changed +- Admin menu: change order of Jetpack sub-menu items [#39095] + +## [0.4.3] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [0.4.2] - 2024-04-22 +### Changed +- Internal updates. + +## [0.4.1] - 2024-03-12 +### Changed +- Internal updates. + +## [0.4.0] - 2024-03-01 +### Added +- Register menus in network admin as well as regular admin. [#36058] + +## [0.3.2] - 2024-01-29 +### Fixed +- Wait until 'admin_menu' action to call `add_menu()`, to avoid triggering the l10n load too early. [#35279] + +## [0.3.1] - 2023-11-24 + +## [0.3.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [0.2.25] - 2023-11-14 + +## [0.2.24] - 2023-10-30 +### Fixed +- Handle Akismet submenu even if Jetpack is present, as Jetpack now relies on this package to do so. [#33559] + +## [0.2.23] - 2023-09-19 +### Changed +- Updated Jetpack submenu sort order so individual features are alpha-sorted. [#32958] + +## [0.2.22] - 2023-09-11 +### Fixed +- Akismet: update naming to common form [#32908] + +## [0.2.21] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [0.2.20] - 2023-04-25 +### Fixed +- Avoid errors when used in combination with an older version of the Logo package. [#30136] + +## [0.2.19] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.2.18] - 2023-04-04 +### Changed +- Menu icon: update to latest version of the Jetpack logo [#29418] + +## [0.2.17] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.2.16] - 2023-01-25 +### Changed +- Minor internal updates. + +## [0.2.15] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [0.2.14] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [0.2.13] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [0.2.12] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [0.2.11] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.2.10] - 2022-07-12 +### Changed +- Updated package dependencies. + +## [0.2.9] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [0.2.8] - 2022-06-14 +### Changed +- Updated package dependencies. + +## [0.2.7] - 2022-04-26 +### Changed +- Update package.json metadata. + +## [0.2.6] - 2022-04-05 +### Changed +- Updated package dependencies. + +## [0.2.5] - 2022-03-08 +### Fixed +- Do not handle Akismet submenu if Jetpack plugin is present + +## [0.2.4] - 2022-02-09 +### Added +- Support for akismet menu with stand-alone plugins + +### Fixed +- Fixes menu order working around a bug in add_submenu_page + +## [0.2.3] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [0.2.2] - 2022-01-18 +### Changed +- General: update required node version to v16.13.2 + +## [0.2.1] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [0.2.0] - 2021-12-14 +### Added +- New method to get the top level menu item + +## [0.1.1] - 2021-11-17 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## 0.1.0 - 2021-10-13 +### Added +- Created the package. + +### Changed +- Updated package dependencies. + +### Fixed +- Fixing menu visibility issues. + +[0.4.5]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.4...0.4.5 +[0.4.4]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.3...0.4.4 +[0.4.3]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.2...0.4.3 +[0.4.2]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.1...0.4.2 +[0.4.1]: https://github.com/Automattic/jetpack-admin-ui/compare/0.4.0...0.4.1 +[0.4.0]: https://github.com/Automattic/jetpack-admin-ui/compare/0.3.2...0.4.0 +[0.3.2]: https://github.com/Automattic/jetpack-admin-ui/compare/0.3.1...0.3.2 +[0.3.1]: https://github.com/Automattic/jetpack-admin-ui/compare/0.3.0...0.3.1 +[0.3.0]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.25...0.3.0 +[0.2.25]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.24...0.2.25 +[0.2.24]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.23...0.2.24 +[0.2.23]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.22...0.2.23 +[0.2.22]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.21...0.2.22 +[0.2.21]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.20...0.2.21 +[0.2.20]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.19...0.2.20 +[0.2.19]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.18...0.2.19 +[0.2.18]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.17...0.2.18 +[0.2.17]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.16...0.2.17 +[0.2.16]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.15...0.2.16 +[0.2.15]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.14...0.2.15 +[0.2.14]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.13...0.2.14 +[0.2.13]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.12...0.2.13 +[0.2.12]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.11...0.2.12 +[0.2.11]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.10...0.2.11 +[0.2.10]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.9...0.2.10 +[0.2.9]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.8...0.2.9 +[0.2.8]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.7...0.2.8 +[0.2.7]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.6...0.2.7 +[0.2.6]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.5...0.2.6 +[0.2.5]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.4...0.2.5 +[0.2.4]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.3...0.2.4 +[0.2.3]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.2...0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.1...0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-admin-ui/compare/0.1.1...0.2.0 +[0.1.1]: https://github.com/Automattic/jetpack-admin-ui/compare/0.1.0...0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/composer.json new file mode 100644 index 00000000..c91a9ca5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/composer.json @@ -0,0 +1,54 @@ +{ + "name": "automattic/jetpack-admin-ui", + "description": "Generic Jetpack wp-admin UI elements", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-logo": "^2.0.4", + "automattic/wordbless": "dev-master" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-admin-ui", + "textdomain": "jetpack-admin-ui", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-admin-ui/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "0.4.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-admin-menu.php" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php new file mode 100644 index 00000000..fdafba56 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php @@ -0,0 +1,208 @@ +get_base64_logo() + : 'dashicons-admin-plugins'; + + if ( ! $jetpack_plugin_present ) { + add_menu_page( + 'Jetpack', + 'Jetpack', + 'edit_posts', + 'jetpack', + '__return_null', + $icon, + 3 + ); + + // If Jetpack plugin is not present, user will only be able to see this menu if they have enough capability to at least one of the sub menus being added. + $can_see_toplevel_menu = false; + } + + /** + * The add_sub_menu function has a bug and will not keep the right order of menu items. + * + * @see https://core.trac.wordpress.org/ticket/52035 + * Let's order the items before registering them. + * Since this all happens after the Jetpack plugin menu items were added, all items will be added after Jetpack plugin items - unless position is very low number (smaller than the number of menu items present in Jetpack plugin). + */ + usort( + self::$menu_items, + function ( $a, $b ) { + $position_a = empty( $a['position'] ) ? 0 : $a['position']; + $position_b = empty( $b['position'] ) ? 0 : $b['position']; + $result = $position_a <=> $position_b; + + if ( 0 === $result ) { + $result = strcmp( $a['menu_title'], $b['menu_title'] ); + } + + return $result; + } + ); + + foreach ( self::$menu_items as $menu_item ) { + if ( ! current_user_can( $menu_item['capability'] ) ) { + continue; + } + + $can_see_toplevel_menu = true; + + add_submenu_page( + 'jetpack', + $menu_item['page_title'], + $menu_item['menu_title'], + $menu_item['capability'], + $menu_item['menu_slug'], + $menu_item['function'], + $menu_item['position'] + ); + } + + if ( ! $jetpack_plugin_present ) { + remove_submenu_page( 'jetpack', 'jetpack' ); + } + + if ( ! $can_see_toplevel_menu ) { + remove_menu_page( 'jetpack' ); + } + } + + /** + * Adds a new submenu to the Jetpack Top level menu + * + * The parameters this method accepts are the same as @see add_submenu_page. This class will + * aggreagate all menu items registered by stand-alone plugins and make sure they all go under the same + * Jetpack top level menu. It will also handle the top level menu registration in case the Jetpack plugin is not present. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu + * is selected. + * @param string $menu_title The text to be used for the menu. + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by. Should be unique for this menu + * and only include lowercase alphanumeric, dashes, and underscores characters + * to be compatible with sanitize_key(). + * @param callable $function The function to be called to output the content for this page. + * @param int $position The position in the menu order this item should appear. Leave empty typically. + * + * @return string The resulting page's hook_suffix + */ + public static function add_menu( $page_title, $menu_title, $capability, $menu_slug, $function, $position = null ) { + self::init(); + self::$menu_items[] = compact( 'page_title', 'menu_title', 'capability', 'menu_slug', 'function', 'position' ); + + /** + * Let's return the page hook so consumers can use. + * We know all pages will be under Jetpack top level menu page, so we can hardcode the first part of the string. + * Using get_plugin_page_hookname here won't work because the top level page is not registered yet. + */ + return 'jetpack_page_' . $menu_slug; + } + + /** + * Gets the slug for the first item under the Jetpack top level menu + * + * @return string|null + */ + public static function get_top_level_menu_item_slug() { + global $submenu; + if ( ! empty( $submenu['jetpack'] ) ) { + $item = reset( $submenu['jetpack'] ); + if ( isset( $item[2] ) ) { + return $item[2]; + } + } + } + + /** + * Gets the URL for the first item under the Jetpack top level menu + * + * @param string $fallback If Jetpack menu is not there or no children is found, return this fallback instead. Default to admin_url(). + * @return string + */ + public static function get_top_level_menu_item_url( $fallback = false ) { + $slug = self::get_top_level_menu_item_slug(); + + if ( $slug ) { + $url = menu_page_url( $slug, false ); + return $url; + } + + $url = $fallback ? $fallback : admin_url(); + return $url; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/.eslintrc.cjs b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/.eslintrc.cjs new file mode 100644 index 00000000..66a22f5e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/.eslintrc.cjs @@ -0,0 +1,3 @@ +module.exports = { + extends: [ require.resolve( 'jetpack-js-tools/eslintrc/react' ) ], +}; diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md new file mode 100644 index 00000000..2a075024 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md @@ -0,0 +1,611 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.3.7] - 2024-09-05 +### Changed +- Internal updates. + +## [2.3.6] - 2024-09-05 +### Changed +- Updated package dependencies. [#39176] + +### Fixed +- Fixed script data not available in block editor iframe [#39221] + +## [2.3.5] - 2024-08-29 +### Changed +- Updated package dependencies. [#39111] + +## [2.3.4] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [2.3.3] - 2024-08-21 +### Changed +- i18n loader script & React JSX runtime: load scripts in the footer. [#38929] + +## [2.3.2] - 2024-08-15 +### Changed +- Updated package dependencies. [#38662] + +## [2.3.1] - 2024-08-12 +### Fixed +- Fixed variable names. [#38606] + +## [2.3.0] - 2024-08-08 +### Added +- Added jetpack-initial-state package to consolidate the logic for Initial state. [#38430] + +## [2.2.0] - 2024-07-23 +### Added +- Assets: Add JSX runtime polyfill `react-jsx-runtime` for WordPress < 6.6. [#38428] + +## [2.1.13] - 2024-07-03 +### Changed +- Updated package dependencies. [#38132] + +## [2.1.12] - 2024-06-05 +### Changed +- Updated package dependencies. [#37669] + +## [2.1.11] - 2024-05-20 +### Changed +- Internal updates. + +## [2.1.10] - 2024-05-16 +### Added +- Assets: Adding comments to explain why we use variables within translation functions [#37397] + +### Changed +- Updated package dependencies. [#37379] + +## [2.1.9] - 2024-05-06 +### Changed +- Updated package dependencies. [#37147] + +## [2.1.8] - 2024-04-22 +### Changed +- Internal updates. + +## [2.1.7] - 2024-04-08 +### Changed +- Updated package dependencies. [#36760] + +## [2.1.6] - 2024-03-27 +### Changed +- Updated package dependencies. [#36585] + +## [2.1.5] - 2024-03-18 +### Changed +- Internal updates. + +## [2.1.4] - 2024-03-12 +### Changed +- Internal updates. + +## [2.1.3] - 2024-03-12 +### Changed +- Updated package dependencies. [#36325] + +## [2.1.2] - 2024-03-04 +### Changed +- Updated package dependencies. [#36095] + +## [2.1.1] - 2024-02-13 +### Changed +- Updated package dependencies. [#35608] + +## [2.1.0] - 2024-02-05 +### Added +- Add support for script enqueuing strategies implemented in WordPress 6.3 [#34072] + +### Changed +- Updated package dependencies. [#35384] + +## [2.0.4] - 2024-01-04 +### Changed +- Updated package dependencies. [#34815] + +## [2.0.3] - 2023-12-11 +### Changed +- Updated package dependencies. [#34492] + +## [2.0.2] - 2023-12-03 +### Changed +- Updated package dependencies. [#34411] [#34427] + +## [2.0.1] - 2023-11-21 + +## [2.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [1.18.15] - 2023-11-14 +### Changed +- Updated package dependencies. [#34093] + +## [1.18.14] - 2023-11-03 + +## [1.18.13] - 2023-10-19 +### Changed +- Updated package dependencies. [#33687] + +## [1.18.12] - 2023-10-10 +### Changed +- Updated package dependencies. [#33428] + +### Fixed +- Pass `false`, not `null`, to `WP_Scripts->add()`. [#33513] + +## [1.18.11] - 2023-09-19 + +- Minor internal updates. + +## [1.18.10] - 2023-09-04 +### Changed +- Updated package dependencies. [#32803] + +## [1.18.9] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.18.8] - 2023-08-09 +### Changed +- Updated package dependencies. [#32166] + +## [1.18.7] - 2023-07-11 +### Changed +- Updated package dependencies. [#31785] + +## [1.18.6] - 2023-07-05 +### Changed +- Updated package dependencies. [#31659] + +## [1.18.5] - 2023-06-21 +### Changed +- Updated package dependencies. [#31468] + +## [1.18.4] - 2023-06-06 +### Changed +- Updated package dependencies. [#31129] + +## [1.18.3] - 2023-05-15 +### Changed +- Internal updates. + +## [1.18.2] - 2023-05-02 +### Changed +- Updated package dependencies. [#30375] + +## [1.18.1] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.18.0] - 2023-04-04 +### Changed +- Async script enqueuing: switch to static method. [#29780] +- Updated package dependencies. [#29854] + +## [1.17.34] - 2023-03-20 +### Changed +- Updated package dependencies. [#29471] + +## [1.17.33] - 2023-03-08 +### Changed +- Updated package dependencies. [#29216] + +## [1.17.32] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.17.31] - 2023-02-15 +### Changed +- Update to React 18. [#28710] + +## [1.17.30] - 2023-01-25 +### Changed +- Minor internal updates. + +## [1.17.29] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.17.28] - 2022-12-02 +### Changed +- Updated package dependencies. + +## [1.17.27] - 2022-11-28 +### Changed +- Updated package dependencies. [#27576] + +## [1.17.26] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.17.25] - 2022-11-08 +### Changed +- Updated package dependencies. [#27289] + +## [1.17.24] - 2022-11-01 +### Changed +- Updated package dependencies. + +## [1.17.23] - 2022-10-13 +### Changed +- Updated package dependencies. [#26791] + +## [1.17.22] - 2022-10-05 +### Changed +- Updated package dependencies. [#26568] + +## [1.17.21] - 2022-08-25 +### Changed +- Updated package dependencies. [#25814] + +## [1.17.20] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.17.19] - 2022-07-12 +### Changed +- Updated package dependencies. + +## [1.17.18] - 2022-07-06 +### Changed +- Updated package dependencies + +## [1.17.17] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.17.16] - 2022-06-14 + +## [1.17.15] - 2022-06-08 +### Changed +- Reorder JS imports for `import/order` eslint rule. [#24601] + +## [1.17.14] - 2022-05-18 +### Changed +- Updated package dependencies [#24372] + +## [1.17.13] - 2022-05-10 +### Changed +- Updated package dependencies. [#24302] + +## [1.17.12] - 2022-05-04 +### Added +- Add missing JavaScript dependencies, and fix a test. [#24096] + +## [1.17.11] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.17.10] - 2022-04-19 +### Fixed +- Assets: Defer the enqueued script instead of its translations + +## [1.17.9] - 2022-04-05 +### Changed +- Updated package dependencies. + +## [1.17.8] - 2022-03-29 +### Changed +- Updated package dependencies. + +## [1.17.7] - 2022-03-23 +### Changed +- Updated package dependencies. + +## [1.17.6] - 2022-03-02 +### Changed +- Updated package dependencies. + +## [1.17.5] - 2022-02-16 +### Changed +- Updated package dependencies. + +## [1.17.4] - 2022-02-09 +### Changed +- Updated package dependencies. + +## [1.17.3] - 2022-02-02 +### Fixed +- Fixed minor coding standard violation. + +## [1.17.2] - 2022-02-01 +### Changed +- Build: remove unneeded files from production build. + +## [1.17.1] - 2022-01-27 +### Changed +- Updated package dependencies. + +## [1.17.0] - 2022-01-25 +### Added +- Accept package path prefixes from jetpack-composer-plugin and use them when lazy-loading JS translations. +- Generate the `wp-jp-i18n-loader` module needed by the new i18n-loader-webpack-plugin. + +### Deprecated +- Deprecated the `wp-jp-i18n-state` module. + +## [1.16.2] - 2022-01-18 +### Fixed +- Handle the case where `WP_LANG_DIR` is in `WP_CONTENT_DIR`, but `WP_CONTENT_DIR` is not in `ABSPATH`. + +## [1.16.1] - 2022-01-05 +### Fixed +- Don't issue a "doing it wrong" warning for registering aliases during plugin activation. + +## [1.16.0] - 2022-01-04 +### Added +- Document use of jetpack-assets, jetpack-composer-plugin, and i18n-loader-webpack-plugin together. + +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies +- Updated package textdomain from `jetpack` to `jetpack-assets`. + +## [1.15.0] - 2021-12-20 +### Added +- Add `alias_textdomain()`. + +## [1.14.0] - 2021-12-14 +### Added +- Generate `wp-jp-i18n-state` script. + +## [1.13.1] - 2021-11-22 +### Fixed +- Call `_doing_it_wrong` correctly. + +## [1.13.0] - 2021-11-22 +### Added +- Have `Assets::register_script()` accept a textdomain for `wp_set_script_translations` (and complain if no textdomain is passed when `wp-i18n` is depended on). + +### Changed +- Updated package dependencies + +### Fixed +- Added missing option doc for `Assets::register_script()`. + +## [1.12.0] - 2021-11-15 +### Added +- Add `Assets::register_script()` for easier loading of Webpack-built scripts. + +## [1.11.10] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.11.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.11.8] - 2021-10-06 +### Changed +- Updated package dependencies + +## [1.11.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.11.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- update annotations versions + +## [1.11.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.11.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.11.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.11.2] - 2021-02-23 + +- CI: Make tests more generic + +## [1.11.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.11.0] - 2021-01-05 + +- Update dependency brain/monkey to v2.6.0 + +## [1.10.0] - 2020-12-08 + +- Assets: introduce new method to process static resources +- Assets: Use defer for script tags +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.9.1] - 2020-11-24 + +- Update dependency brain/monkey to v2.5.0 +- Updated PHPCS: Packages and Debugger + +## [1.9.0] - 2020-10-27 + +- Instagram oEmbed: Simplify + +## [1.8.0] - 2020-09-29 + +- Consolidate the Lazy Images package to rely on the Assets package + +## [1.7.0] - 2020-08-25 + +- Packages: Update filenames after #16810 +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.6.0] - 2020-07-28 + +- Various: Use wp_resource_hints + +## [1.5.0] - 2020-06-30 + +- PHPCS: Clean up the packages +- WooCommerce Analytics: avoid 404 error when enqueuing script + +## [1.4.0] - 2020-05-26 + +- Add Jetpack Scan threat notifications + +## [1.3.0] - 2020-04-28 + +- Update dependencies to latest stable + +## [1.2.0] - 2020-03-31 + +- Update dependencies to latest stable + +## [1.1.1] - 2020-01-27 + +- Pin dependency brain/monkey to 2.4.0 + +## [1.1.0] - 2020-01-14 + +- Packages: Various improvements for wp.com or self-contained consumers + +## [1.0.3] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.1] - 2019-10-28 + +- PHPCS: JITM and Assets packages +- Packages: Add gitattributes files to all packages that need th… + +## 1.0.0 - 2019-09-14 + +- Statically access asset tools + +[2.3.7]: https://github.com/Automattic/jetpack-assets/compare/v2.3.6...v2.3.7 +[2.3.6]: https://github.com/Automattic/jetpack-assets/compare/v2.3.5...v2.3.6 +[2.3.5]: https://github.com/Automattic/jetpack-assets/compare/v2.3.4...v2.3.5 +[2.3.4]: https://github.com/Automattic/jetpack-assets/compare/v2.3.3...v2.3.4 +[2.3.3]: https://github.com/Automattic/jetpack-assets/compare/v2.3.2...v2.3.3 +[2.3.2]: https://github.com/Automattic/jetpack-assets/compare/v2.3.1...v2.3.2 +[2.3.1]: https://github.com/Automattic/jetpack-assets/compare/v2.3.0...v2.3.1 +[2.3.0]: https://github.com/Automattic/jetpack-assets/compare/v2.2.0...v2.3.0 +[2.2.0]: https://github.com/Automattic/jetpack-assets/compare/v2.1.13...v2.2.0 +[2.1.13]: https://github.com/Automattic/jetpack-assets/compare/v2.1.12...v2.1.13 +[2.1.12]: https://github.com/Automattic/jetpack-assets/compare/v2.1.11...v2.1.12 +[2.1.11]: https://github.com/Automattic/jetpack-assets/compare/v2.1.10...v2.1.11 +[2.1.10]: https://github.com/Automattic/jetpack-assets/compare/v2.1.9...v2.1.10 +[2.1.9]: https://github.com/Automattic/jetpack-assets/compare/v2.1.8...v2.1.9 +[2.1.8]: https://github.com/Automattic/jetpack-assets/compare/v2.1.7...v2.1.8 +[2.1.7]: https://github.com/Automattic/jetpack-assets/compare/v2.1.6...v2.1.7 +[2.1.6]: https://github.com/Automattic/jetpack-assets/compare/v2.1.5...v2.1.6 +[2.1.5]: https://github.com/Automattic/jetpack-assets/compare/v2.1.4...v2.1.5 +[2.1.4]: https://github.com/Automattic/jetpack-assets/compare/v2.1.3...v2.1.4 +[2.1.3]: https://github.com/Automattic/jetpack-assets/compare/v2.1.2...v2.1.3 +[2.1.2]: https://github.com/Automattic/jetpack-assets/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/Automattic/jetpack-assets/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-assets/compare/v2.0.4...v2.1.0 +[2.0.4]: https://github.com/Automattic/jetpack-assets/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-assets/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-assets/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-assets/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-assets/compare/v1.18.15...v2.0.0 +[1.18.15]: https://github.com/Automattic/jetpack-assets/compare/v1.18.14...v1.18.15 +[1.18.14]: https://github.com/Automattic/jetpack-assets/compare/v1.18.13...v1.18.14 +[1.18.13]: https://github.com/Automattic/jetpack-assets/compare/v1.18.12...v1.18.13 +[1.18.12]: https://github.com/Automattic/jetpack-assets/compare/v1.18.11...v1.18.12 +[1.18.11]: https://github.com/Automattic/jetpack-assets/compare/v1.18.10...v1.18.11 +[1.18.10]: https://github.com/Automattic/jetpack-assets/compare/v1.18.9...v1.18.10 +[1.18.9]: https://github.com/Automattic/jetpack-assets/compare/v1.18.8...v1.18.9 +[1.18.8]: https://github.com/Automattic/jetpack-assets/compare/v1.18.7...v1.18.8 +[1.18.7]: https://github.com/Automattic/jetpack-assets/compare/v1.18.6...v1.18.7 +[1.18.6]: https://github.com/Automattic/jetpack-assets/compare/v1.18.5...v1.18.6 +[1.18.5]: https://github.com/Automattic/jetpack-assets/compare/v1.18.4...v1.18.5 +[1.18.4]: https://github.com/Automattic/jetpack-assets/compare/v1.18.3...v1.18.4 +[1.18.3]: https://github.com/Automattic/jetpack-assets/compare/v1.18.2...v1.18.3 +[1.18.2]: https://github.com/Automattic/jetpack-assets/compare/v1.18.1...v1.18.2 +[1.18.1]: https://github.com/Automattic/jetpack-assets/compare/v1.18.0...v1.18.1 +[1.18.0]: https://github.com/Automattic/jetpack-assets/compare/v1.17.34...v1.18.0 +[1.17.34]: https://github.com/Automattic/jetpack-assets/compare/v1.17.33...v1.17.34 +[1.17.33]: https://github.com/Automattic/jetpack-assets/compare/v1.17.32...v1.17.33 +[1.17.32]: https://github.com/Automattic/jetpack-assets/compare/v1.17.31...v1.17.32 +[1.17.31]: https://github.com/Automattic/jetpack-assets/compare/v1.17.30...v1.17.31 +[1.17.30]: https://github.com/Automattic/jetpack-assets/compare/v1.17.29...v1.17.30 +[1.17.29]: https://github.com/Automattic/jetpack-assets/compare/v1.17.28...v1.17.29 +[1.17.28]: https://github.com/Automattic/jetpack-assets/compare/v1.17.27...v1.17.28 +[1.17.27]: https://github.com/Automattic/jetpack-assets/compare/v1.17.26...v1.17.27 +[1.17.26]: https://github.com/Automattic/jetpack-assets/compare/v1.17.25...v1.17.26 +[1.17.25]: https://github.com/Automattic/jetpack-assets/compare/v1.17.24...v1.17.25 +[1.17.24]: https://github.com/Automattic/jetpack-assets/compare/v1.17.23...v1.17.24 +[1.17.23]: https://github.com/Automattic/jetpack-assets/compare/v1.17.22...v1.17.23 +[1.17.22]: https://github.com/Automattic/jetpack-assets/compare/v1.17.21...v1.17.22 +[1.17.21]: https://github.com/Automattic/jetpack-assets/compare/v1.17.20...v1.17.21 +[1.17.20]: https://github.com/Automattic/jetpack-assets/compare/v1.17.19...v1.17.20 +[1.17.19]: https://github.com/Automattic/jetpack-assets/compare/v1.17.18...v1.17.19 +[1.17.18]: https://github.com/Automattic/jetpack-assets/compare/v1.17.17...v1.17.18 +[1.17.17]: https://github.com/Automattic/jetpack-assets/compare/v1.17.16...v1.17.17 +[1.17.16]: https://github.com/Automattic/jetpack-assets/compare/v1.17.15...v1.17.16 +[1.17.15]: https://github.com/Automattic/jetpack-assets/compare/v1.17.14...v1.17.15 +[1.17.14]: https://github.com/Automattic/jetpack-assets/compare/v1.17.13...v1.17.14 +[1.17.13]: https://github.com/Automattic/jetpack-assets/compare/v1.17.12...v1.17.13 +[1.17.12]: https://github.com/Automattic/jetpack-assets/compare/v1.17.11...v1.17.12 +[1.17.11]: https://github.com/Automattic/jetpack-assets/compare/v1.17.10...v1.17.11 +[1.17.10]: https://github.com/Automattic/jetpack-assets/compare/v1.17.9...v1.17.10 +[1.17.9]: https://github.com/Automattic/jetpack-assets/compare/v1.17.8...v1.17.9 +[1.17.8]: https://github.com/Automattic/jetpack-assets/compare/v1.17.7...v1.17.8 +[1.17.7]: https://github.com/Automattic/jetpack-assets/compare/v1.17.6...v1.17.7 +[1.17.6]: https://github.com/Automattic/jetpack-assets/compare/v1.17.5...v1.17.6 +[1.17.5]: https://github.com/Automattic/jetpack-assets/compare/v1.17.4...v1.17.5 +[1.17.4]: https://github.com/Automattic/jetpack-assets/compare/v1.17.3...v1.17.4 +[1.17.3]: https://github.com/Automattic/jetpack-assets/compare/v1.17.2...v1.17.3 +[1.17.2]: https://github.com/Automattic/jetpack-assets/compare/v1.17.1...v1.17.2 +[1.17.1]: https://github.com/Automattic/jetpack-assets/compare/v1.17.0...v1.17.1 +[1.17.0]: https://github.com/Automattic/jetpack-assets/compare/v1.16.2...v1.17.0 +[1.16.2]: https://github.com/Automattic/jetpack-assets/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-assets/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-assets/compare/v1.15.0...v1.16.0 +[1.15.0]: https://github.com/Automattic/jetpack-assets/compare/v1.14.0...v1.15.0 +[1.14.0]: https://github.com/Automattic/jetpack-assets/compare/v1.13.1...v1.14.0 +[1.13.1]: https://github.com/Automattic/jetpack-assets/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-assets/compare/v1.12.0...v1.13.0 +[1.12.0]: https://github.com/Automattic/jetpack-assets/compare/v1.11.10...v1.12.0 +[1.11.10]: https://github.com/Automattic/jetpack-assets/compare/v1.11.9...v1.11.10 +[1.11.9]: https://github.com/Automattic/jetpack-assets/compare/v1.11.8...v1.11.9 +[1.11.8]: https://github.com/Automattic/jetpack-assets/compare/v1.11.7...v1.11.8 +[1.11.7]: https://github.com/Automattic/jetpack-assets/compare/v1.11.6...v1.11.7 +[1.11.6]: https://github.com/Automattic/jetpack-assets/compare/v1.11.5...v1.11.6 +[1.11.5]: https://github.com/Automattic/jetpack-assets/compare/v1.11.4...v1.11.5 +[1.11.4]: https://github.com/Automattic/jetpack-assets/compare/v1.11.3...v1.11.4 +[1.11.3]: https://github.com/Automattic/jetpack-assets/compare/v1.11.2...v1.11.3 +[1.11.2]: https://github.com/Automattic/jetpack-assets/compare/v1.11.1...v1.11.2 +[1.11.1]: https://github.com/Automattic/jetpack-assets/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/Automattic/jetpack-assets/compare/v1.10.0...v1.11.0 +[1.10.0]: https://github.com/Automattic/jetpack-assets/compare/v1.9.1...v1.10.0 +[1.9.1]: https://github.com/Automattic/jetpack-assets/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/Automattic/jetpack-assets/compare/v1.8.0...v1.9.0 +[1.8.0]: https://github.com/Automattic/jetpack-assets/compare/v1.7.0...v1.8.0 +[1.7.0]: https://github.com/Automattic/jetpack-assets/compare/v1.6.0...v1.7.0 +[1.6.0]: https://github.com/Automattic/jetpack-assets/compare/v1.5.0...v1.6.0 +[1.5.0]: https://github.com/Automattic/jetpack-assets/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-assets/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-assets/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-assets/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-assets/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-assets/compare/v1.0.3...v1.1.0 +[1.0.3]: https://github.com/Automattic/jetpack-assets/compare/v1.0.1...v1.0.3 +[1.0.1]: https://github.com/Automattic/jetpack-assets/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/actions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/actions.php new file mode 100644 index 00000000..487100d8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/actions.php @@ -0,0 +1,25 @@ + 1, + 'function' => array( Automattic\Jetpack\Assets::class, 'wp_default_scripts_hook' ), + ); + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + $wp_filter['plugins_loaded'][1][] = array( + 'accepted_args' => 0, + 'function' => array( Automattic\Jetpack\Assets\Script_Data::class, 'configure' ), + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.asset.php new file mode 100644 index 00000000..cb123d3a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.asset.php @@ -0,0 +1 @@ + array('wp-i18n'), 'version' => 'becd7d9884bc1b331e45'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.js new file mode 100644 index 00000000..2712dfa9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.js @@ -0,0 +1 @@ +(()=>{var e={477:function(e){e.exports=function(e){function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n={};return r.m=e,r.c=n,r.i=function(e){return e},r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r(r.s=1)}([function(e,r,n){"use strict";function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,r){for(var n=0;n>>32-o)+n&4294967295}},{key:"ff",value:function(r,n,t,o,a,i,f){return e.cmn(n&t|~n&o,r,n,a,i,f)}},{key:"gg",value:function(r,n,t,o,a,i,f){return e.cmn(n&o|t&~o,r,n,a,i,f)}},{key:"hh",value:function(r,n,t,o,a,i,f){return e.cmn(n^t^o,r,n,a,i,f)}},{key:"ii",value:function(r,n,t,o,a,i,f){return e.cmn(t^(n|~o),r,n,a,i,f)}},{key:"md51",value:function(r){for(var n=r.length,t=[1732584193,-271733879,-1732584194,271733878],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0,i=64;i<=n;i+=64)e.md5cycle(t,e.md5blk(r.substring(i-64,i)));for(r=r.substring(i-64),i=0,a=r.length;i>2]|=r.charCodeAt(i)<<(i%4<<3);if(o[i>>2]|=128<<(i%4<<3),i>55)for(e.md5cycle(t,o),i=0;i<16;i++)o[i]=0;return o[14]=8*n,e.md5cycle(t,o),t}},{key:"md5blk",value:function(e){for(var r=[],n=0;n<64;n+=4)r[n>>2]=e.charCodeAt(n)+(e.charCodeAt(n+1)<<8)+(e.charCodeAt(n+2)<<16)+(e.charCodeAt(n+3)<<24);return r}},{key:"rhex",value:function(r){var n="";return n+=e.hexArray[r>>4&15]+e.hexArray[15&r],n+=e.hexArray[r>>12&15]+e.hexArray[r>>8&15],(n+=e.hexArray[r>>20&15]+e.hexArray[r>>16&15])+(e.hexArray[r>>28&15]+e.hexArray[r>>24&15])}},{key:"hex",value:function(r){for(var n=r.length,t=0;t{const t=n(723),{default:o}=n(477),a={plugin:"plugins/",theme:"themes/",core:""},i=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);e.exports={state:{baseUrl:null,locale:null,domainMap:{},domainPaths:{}},async downloadI18n(e,r,n){const f=this.state;if(!f||"string"!=typeof f.baseUrl)throw new Error("wp.jpI18nLoader.state is not set");if("en_US"===f.locale)return;if("undefined"==typeof fetch)throw new Error("Fetch API is not available.");const u=i(f.domainPaths,r)?f.domainPaths[r]:"";let c,h;const l=e.indexOf("?");l>=0?(c=o.hash(u+e.substring(0,l)),h=e.substring(l)):(c=o.hash(u+e),h="");const s=i(f.domainMap,r)?f.domainMap[r]:a[n]+r,g=await fetch(`${f.baseUrl}${s}-${f.locale}-${c}.json${h}`);if(!g.ok)throw new Error(`HTTP request failed: ${g.status} ${g.statusText}`);const d=await g.json(),p=i(d.locale_data,r)?d.locale_data[r]:d.locale_data.messages;p[""].domain=r,t.setLocaleData(p,r)}}},723:e=>{"use strict";e.exports=window.wp.i18n}},r={};var n=function n(t){var o=r[t];if(void 0!==o)return o.exports;var a=r[t]={exports:{}};return e[t].call(a.exports,a,a.exports,n),a.exports}(305);(window.wp=window.wp||{}).jpI18nLoader=n})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/jetpack-script-data.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/jetpack-script-data.asset.php new file mode 100644 index 00000000..af7fa2e6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/jetpack-script-data.asset.php @@ -0,0 +1 @@ + array(), 'version' => '0274966690f87adbeccb'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/jetpack-script-data.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/jetpack-script-data.js new file mode 100644 index 00000000..c445d9f2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/jetpack-script-data.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JetpackScriptDataModule=t():e.JetpackScriptDataModule=t()}(self,(()=>(()=>{var e={729:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getActiveFeatures:()=>a.mH,getAdminUrl:()=>a.hT,getJetpackAdminPageUrl:()=>a.oQ,getMyJetpackUrl:()=>a.e5,getScriptData:()=>a.au,getSiteData:()=>a.sV});var o=r(428),n={};for(const e in o)"default"!==e&&(n[e]=()=>o[e]);r.d(t,n);var a=r(336)},428:()=>{},336:(e,t,r)=>{"use strict";function o(){return window.JetpackScriptData}function n(){return o().site}function a(e=""){return`${o().site.admin_url}${e}`}function i(e=""){return a(`admin.php?page=jetpack${e}`)}function u(e=""){return a(`admin.php?page=my-jetpack${e}`)}function p(){return o().site.plan?.features?.active??[]}r.d(t,{au:()=>o,e5:()=>u,hT:()=>a,mH:()=>p,oQ:()=>i,sV:()=>n})}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o);var e=r(729),t={};for(const r in e)"default"!==r&&(t[r]=()=>e[r]);r.d(o,t)})(),o})())); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/react-jsx-runtime.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/react-jsx-runtime.js new file mode 100644 index 00000000..88aaa29f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/react-jsx-runtime.js @@ -0,0 +1,2 @@ +/*! For license information please see react-jsx-runtime.js.LICENSE.txt */ +(()=>{"use strict";var r={572:(r,e,t)=>{var o=t(609),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,f=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function _(r,e,t){var o,s={},_=null,i=null;for(o in void 0!==t&&(_=""+t),void 0!==e.key&&(_=""+e.key),void 0!==e.ref&&(i=e.ref),e)a.call(e,o)&&!p.hasOwnProperty(o)&&(s[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps)void 0===s[o]&&(s[o]=e[o]);return{$$typeof:n,type:r,key:_,ref:i,props:s,_owner:f.current}}e.Fragment=s,e.jsx=_,e.jsxs=_},48:(r,e,t)=>{r.exports=t(572)},609:r=>{r.exports=window.React}},e={},t=function t(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return r[o](s,s.exports,t),s.exports}(48);window.ReactJSXRuntime=t})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/react-jsx-runtime.js.LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/react-jsx-runtime.js.LICENSE.txt new file mode 100644 index 00000000..e68557b2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/react-jsx-runtime.js.LICENSE.txt @@ -0,0 +1,9 @@ +/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json new file mode 100644 index 00000000..4832c094 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json @@ -0,0 +1,57 @@ +{ + "name": "automattic/jetpack-assets", + "description": "Asset management utilities for Jetpack ecosystem packages", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-constants": "^2.0.4" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-development": [ + "pnpm run build" + ], + "build-production": [ + "pnpm run build-production" + ], + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-js": [ + "pnpm run test" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-assets", + "textdomain": "jetpack-assets", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-assets/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.3.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php new file mode 100644 index 00000000..3177ab69 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php @@ -0,0 +1,769 @@ + array( string target_domain, string target_type, string semver, string path_prefix ) )`. + */ + private static $domain_map = array(); + + /** + * Constructor. + * + * Static-only class, so nothing here. + */ + private function __construct() {} + + // //////////////////// + // region Async script loading + + /** + * Get the singleton instance of the class. + * + * @return Assets + */ + public static function instance() { + if ( ! isset( self::$instance ) ) { + self::$instance = new Assets(); + } + + return self::$instance; + } + + /** + * A public method for adding the async script. + * + * @deprecated Since 2.1.0, the `strategy` feature should be used instead, with the "defer" setting. + * + * @param string $script_handle Script handle. + */ + public static function add_async_script( $script_handle ) { + _deprecated_function( __METHOD__, '2.1.0' ); + + wp_script_add_data( $script_handle, 'strategy', 'defer' ); + } + + /** + * Add an async attribute to scripts that can be loaded deferred. + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script + * + * @deprecated Since 2.1.0, the `strategy` feature should be used instead. + * + * @param string $tag The + ' . esc_html__( 'Every Jetpack site needs at least one connected admin for the features to work properly. Please connect to your WordPress.com account via the button below. Once you connect, you may refresh this page to see an option to change the connection owner.', 'jetpack-connection' ) . '

'; + $connect_url = $connection_manager->get_authorization_url(); + $connect_url = add_query_arg( 'from', 'delete_connection_owner_notice', $connect_url ); + echo "" . esc_html__( 'Connect to WordPress.com', 'jetpack-connection' ) . ''; + } + + echo '

'; + printf( + wp_kses( + /* translators: URL to Jetpack support doc regarding the primary user. */ + __( "Learn more about the connection owner and what will break if you do not have one.", 'jetpack-connection' ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, + ), + ) + ), + esc_url( Redirect::get_url( 'jetpack-support-primary-user' ) ) + ); + echo '

'; + echo '

'; + printf( + wp_kses( + /* translators: URL to contact Jetpack support. */ + __( 'As always, feel free to contact our support team if you have any questions.', 'jetpack-connection' ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, + ), + ) + ), + esc_url( Redirect::get_url( 'jetpack-contact-support' ) ) + ); + echo '

'; + echo ''; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php new file mode 100644 index 00000000..abe1a6ab --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php @@ -0,0 +1,780 @@ + [ + * $user_id => [ + * $error_details + * ] + * ] + * ] + * + * For each error code we store a maximum of 5 errors for 5 different user ids. + * + * An user ID can be + * * 0 for blog tokens + * * positive integer for user tokens + * * 'invalid' for malformed tokens + * + * @since 1.14.2 + */ +class Error_Handler { + + /** + * The name of the option that stores the errors + * + * @since 1.14.2 + * + * @var string + */ + const STORED_ERRORS_OPTION = 'jetpack_connection_xmlrpc_errors'; + + /** + * The name of the option that stores the errors + * + * @since 1.14.2 + * + * @var string + */ + const STORED_VERIFIED_ERRORS_OPTION = 'jetpack_connection_xmlrpc_verified_errors'; + + /** + * The prefix of the transient that controls the gate for each error code + * + * @since 1.14.2 + * + * @var string + */ + const ERROR_REPORTING_GATE = 'jetpack_connection_error_reporting_gate_'; + + /** + * Time in seconds a test should live in the database before being discarded + * + * @since 1.14.2 + */ + const ERROR_LIFE_TIME = DAY_IN_SECONDS; + + /** + * The error code for event tracking purposes. + * If there are many, only the first error code will be tracked. + * + * @var string + */ + private $error_code; + + /** + * List of known errors. Only error codes in this list will be handled + * + * @since 1.14.2 + * + * @var array + */ + public $known_errors = array( + 'malformed_token', + 'malformed_user_id', + 'unknown_user', + 'no_user_tokens', + 'empty_master_user_option', + 'no_token_for_user', + 'token_malformed', + 'user_id_mismatch', + 'no_possible_tokens', + 'no_valid_user_token', + 'no_valid_blog_token', + 'unknown_token', + 'could_not_sign', + 'invalid_scheme', + 'invalid_secret', + 'invalid_token', + 'token_mismatch', + 'invalid_body', + 'invalid_signature', + 'invalid_body_hash', + 'invalid_nonce', + 'signature_mismatch', + 'invalid_connection_owner', + ); + + /** + * Holds the instance of this singleton class + * + * @since 1.14.2 + * + * @var Error_Handler $instance + */ + public static $instance = null; + + /** + * Initialize instance, hookds and load verified errors handlers + * + * @since 1.14.2 + */ + private function __construct() { + defined( 'JETPACK__ERRORS_PUBLIC_KEY' ) || define( 'JETPACK__ERRORS_PUBLIC_KEY', 'KdZY80axKX+nWzfrOcizf0jqiFHnrWCl9X8yuaClKgM=' ); + + add_action( 'rest_api_init', array( $this, 'register_verify_error_endpoint' ) ); + + // Handle verified errors on admin pages. + add_action( 'admin_init', array( $this, 'handle_verified_errors' ) ); + + // If the site gets reconnected, clear errors. + add_action( 'jetpack_site_registered', array( $this, 'delete_all_errors' ) ); + add_action( 'jetpack_get_site_data_success', array( $this, 'delete_all_api_errors' ) ); + add_filter( 'jetpack_connection_disconnect_site_wpcom', array( $this, 'delete_all_errors_and_return_unfiltered_value' ) ); + add_filter( 'jetpack_connection_delete_all_tokens', array( $this, 'delete_all_errors_and_return_unfiltered_value' ) ); + add_action( 'jetpack_unlinked_user', array( $this, 'delete_all_errors' ) ); + add_action( 'jetpack_updated_user_token', array( $this, 'delete_all_errors' ) ); + } + + /** + * Gets the list of verified errors and act upon them + * + * @since 1.14.2 + * + * @return void + */ + public function handle_verified_errors() { + $verified_errors = $this->get_verified_errors(); + foreach ( array_keys( $verified_errors ) as $error_code ) { + switch ( $error_code ) { + case 'malformed_token': + case 'token_malformed': + case 'no_possible_tokens': + case 'no_valid_user_token': + case 'no_valid_blog_token': + case 'unknown_token': + case 'could_not_sign': + case 'invalid_token': + case 'token_mismatch': + case 'invalid_signature': + case 'signature_mismatch': + case 'no_user_tokens': + case 'no_token_for_user': + case 'invalid_connection_owner': + add_action( 'admin_notices', array( $this, 'generic_admin_notice_error' ) ); + add_action( 'react_connection_errors_initial_state', array( $this, 'jetpack_react_dashboard_error' ) ); + $this->error_code = $error_code; + + // Since we are only generically handling errors, we don't need to trigger error messages for each one of them. + break 2; + } + } + } + + /** + * Gets the instance of this singleton class + * + * @since 1.14.2 + * + * @return Error_Handler $instance + */ + public static function get_instance() { + if ( self::$instance === null ) { + self::$instance = new self(); + } + return self::$instance; + } + + /** + * Keep track of a connection error that was encountered + * + * @param \WP_Error $error The error object. + * @param boolean $force Force the report, even if should_report_error is false. + * @param boolean $skip_wpcom_verification Set to 'true' to verify the error locally and skip the WP.com verification. + * + * @return void + * @since 1.14.2 + */ + public function report_error( \WP_Error $error, $force = false, $skip_wpcom_verification = false ) { + if ( in_array( $error->get_error_code(), $this->known_errors, true ) && $this->should_report_error( $error ) || $force ) { + $stored_error = $this->store_error( $error ); + if ( $stored_error ) { + $skip_wpcom_verification ? $this->verify_error( $stored_error ) : $this->send_error_to_wpcom( $stored_error ); + } + } + } + + /** + * Checks the status of the gate + * + * This protects the site (and WPCOM) against over loads. + * + * @since 1.14.2 + * + * @param \WP_Error $error the error object. + * @return boolean $should_report True if gate is open and the error should be reported. + */ + public function should_report_error( \WP_Error $error ) { + if ( defined( 'JETPACK_DEV_DEBUG' ) && JETPACK_DEV_DEBUG ) { + return true; + } + + /** + * Whether to bypass the gate for the error handling + * + * By default, we only process errors once an hour for each error code. + * This is done to avoid overflows. If you need to disable this gate, you can set this variable to true. + * + * This filter is useful for unit testing + * + * @since 1.14.2 + * + * @param boolean $bypass_gate whether to bypass the gate. Default is false, do not bypass. + */ + $bypass_gate = apply_filters( 'jetpack_connection_bypass_error_reporting_gate', false ); + if ( true === $bypass_gate ) { + return true; + } + + $transient = self::ERROR_REPORTING_GATE . $error->get_error_code(); + + if ( get_transient( $transient ) ) { + return false; + } + + set_transient( $transient, true, HOUR_IN_SECONDS ); + return true; + } + + /** + * Stores the error in the database so we know there is an issue and can inform the user + * + * @since 1.14.2 + * + * @param \WP_Error $error the error object. + * @return boolean|array False if stored errors were not updated and the error array if it was successfully stored. + */ + public function store_error( \WP_Error $error ) { + + $stored_errors = $this->get_stored_errors(); + $error_array = $this->wp_error_to_array( $error ); + $error_code = $error->get_error_code(); + $user_id = $error_array['user_id']; + + if ( ! isset( $stored_errors[ $error_code ] ) || ! is_array( $stored_errors[ $error_code ] ) ) { + $stored_errors[ $error_code ] = array(); + } + + $stored_errors[ $error_code ][ $user_id ] = $error_array; + + // Let's store a maximum of 5 different user ids for each error code. + $error_code_count = is_countable( $stored_errors[ $error_code ] ) ? count( $stored_errors[ $error_code ] ) : 0; + if ( $error_code_count > 5 ) { + // array_shift will destroy keys here because they are numeric, so manually remove first item. + $keys = array_keys( $stored_errors[ $error_code ] ); + unset( $stored_errors[ $error_code ][ $keys[0] ] ); + } + + if ( update_option( self::STORED_ERRORS_OPTION, $stored_errors ) ) { + return $error_array; + } + + return false; + } + + /** + * Converts a WP_Error object in the array representation we store in the database + * + * @since 1.14.2 + * + * @param \WP_Error $error the error object. + * @return boolean|array False if error is invalid or the error array + */ + public function wp_error_to_array( \WP_Error $error ) { + + $data = $error->get_error_data(); + + if ( ! isset( $data['signature_details'] ) || ! is_array( $data['signature_details'] ) ) { + return false; + } + + $signature_details = $data['signature_details']; + + if ( ! isset( $signature_details['token'] ) ) { + return false; + } + + $user_id = $this->get_user_id_from_token( $signature_details['token'] ); + + $error_array = array( + 'error_code' => $error->get_error_code(), + 'user_id' => $user_id, + 'error_message' => $error->get_error_message(), + 'error_data' => $signature_details, + 'timestamp' => time(), + 'nonce' => wp_generate_password( 10, false ), + 'error_type' => empty( $data['error_type'] ) ? '' : $data['error_type'], + ); + + return $error_array; + } + + /** + * Sends the error to WP.com to be verified + * + * @since 1.14.2 + * + * @param array $error_array The array representation of the error as it is stored in the database. + * @return bool + */ + public function send_error_to_wpcom( $error_array ) { + + $blog_id = \Jetpack_Options::get_option( 'id' ); + + $encrypted_data = $this->encrypt_data_to_wpcom( $error_array ); + + if ( false === $encrypted_data ) { + return false; + } + + $args = array( + 'body' => array( + 'error_data' => $encrypted_data, + ), + ); + + // send encrypted data to WP.com Public-API v2. + wp_remote_post( "https://public-api.wordpress.com/wpcom/v2/sites/{$blog_id}/jetpack-report-error/", $args ); + return true; + } + + /** + * Encrypt data to be sent over to WP.com + * + * @since 1.14.2 + * + * @param array|string $data the data to be encoded. + * @return boolean|string The encoded string on success, false on failure + */ + public function encrypt_data_to_wpcom( $data ) { + + try { + // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + $encrypted_data = base64_encode( sodium_crypto_box_seal( wp_json_encode( $data ), base64_decode( JETPACK__ERRORS_PUBLIC_KEY ) ) ); + // phpcs:enable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + // phpcs:enable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + } catch ( \SodiumException $e ) { + // error encrypting data. + return false; + } + + return $encrypted_data; + } + + /** + * Extracts the user ID from a token + * + * @since 1.14.2 + * + * @param string $token the token used to make the request. + * @return string $the user id or `invalid` if user id not present. + */ + public function get_user_id_from_token( $token ) { + $user_id = 'invalid'; + + if ( $token ) { + $parsed_token = explode( ':', wp_unslash( $token ) ); + + if ( isset( $parsed_token[2] ) && ctype_digit( $parsed_token[2] ) ) { + $user_id = $parsed_token[2]; + } + } + + return $user_id; + } + + /** + * Gets the reported errors stored in the database + * + * @since 1.14.2 + * + * @return array $errors + */ + public function get_stored_errors() { + + $stored_errors = get_option( self::STORED_ERRORS_OPTION ); + + if ( ! is_array( $stored_errors ) ) { + $stored_errors = array(); + } + + $stored_errors = $this->garbage_collector( $stored_errors ); + + return $stored_errors; + } + + /** + * Gets the verified errors stored in the database + * + * @since 1.14.2 + * + * @return array $errors + */ + public function get_verified_errors() { + + $verified_errors = get_option( self::STORED_VERIFIED_ERRORS_OPTION ); + + if ( ! is_array( $verified_errors ) ) { + $verified_errors = array(); + } + + $verified_errors = $this->garbage_collector( $verified_errors ); + + return $verified_errors; + } + + /** + * Removes expired errors from the array + * + * This method is called by get_stored_errors and get_verified errors and filters their result + * Whenever a new error is stored to the database or verified, this will be triggered and the + * expired error will be permantently removed from the database + * + * @since 1.14.2 + * + * @param array $errors array of errors as stored in the database. + * @return array + */ + private function garbage_collector( $errors ) { + foreach ( $errors as $error_code => $users ) { + foreach ( $users as $user_id => $error ) { + if ( self::ERROR_LIFE_TIME < time() - (int) $error['timestamp'] ) { + unset( $errors[ $error_code ][ $user_id ] ); + } + } + } + // Clear empty error codes. + $errors = array_filter( + $errors, + function ( $user_errors ) { + return ! empty( $user_errors ); + } + ); + return $errors; + } + + /** + * Delete all stored and verified errors from the database + * + * @since 1.14.2 + * + * @return void + */ + public function delete_all_errors() { + $this->delete_stored_errors(); + $this->delete_verified_errors(); + } + + /** + * Delete all stored and verified API errors from the database, leave the non-API errors intact. + * + * @since 1.54.0 + * + * @return void + */ + public function delete_all_api_errors() { + $type_filter = function ( $errors ) { + if ( is_array( $errors ) ) { + foreach ( $errors as $key => $error ) { + if ( ! empty( $error['error_type'] ) && in_array( $error['error_type'], array( 'xmlrpc', 'rest' ), true ) ) { + unset( $errors[ $key ] ); + } + } + } + + return count( $errors ) ? $errors : null; + }; + + $stored_errors = $this->get_stored_errors(); + if ( is_array( $stored_errors ) && count( $stored_errors ) ) { + $stored_errors = array_filter( array_map( $type_filter, $stored_errors ) ); + if ( count( $stored_errors ) ) { + update_option( static::STORED_ERRORS_OPTION, $stored_errors ); + } else { + delete_option( static::STORED_ERRORS_OPTION ); + } + } + + $verified_errors = $this->get_verified_errors(); + if ( is_array( $verified_errors ) && count( $verified_errors ) ) { + $verified_errors = array_filter( array_map( $type_filter, $verified_errors ) ); + if ( count( $verified_errors ) ) { + update_option( static::STORED_VERIFIED_ERRORS_OPTION, $verified_errors ); + } else { + delete_option( static::STORED_VERIFIED_ERRORS_OPTION ); + } + } + } + + /** + * Delete all stored and verified errors from the database and returns unfiltered value + * + * This is used to hook into a couple of filters that expect true to not short circuit the disconnection flow + * + * @since 8.9.0 + * + * @param mixed $check The input sent by the filter. + * @return boolean + */ + public function delete_all_errors_and_return_unfiltered_value( $check ) { + $this->delete_all_errors(); + return $check; + } + + /** + * Delete the reported errors stored in the database + * + * @since 1.14.2 + * + * @return boolean True, if option is successfully deleted. False on failure. + */ + public function delete_stored_errors() { + return delete_option( self::STORED_ERRORS_OPTION ); + } + + /** + * Delete the verified errors stored in the database + * + * @since 1.14.2 + * + * @return boolean True, if option is successfully deleted. False on failure. + */ + public function delete_verified_errors() { + return delete_option( self::STORED_VERIFIED_ERRORS_OPTION ); + } + + /** + * Gets an error based on the nonce + * + * Receives a nonce and finds the related error. + * + * @since 1.14.2 + * + * @param string $nonce The nonce created for the error we want to get. + * @return null|array Returns the error array representation or null if error not found. + */ + public function get_error_by_nonce( $nonce ) { + $errors = $this->get_stored_errors(); + foreach ( $errors as $user_group ) { + foreach ( $user_group as $error ) { + if ( $error['nonce'] === $nonce ) { + return $error; + } + } + } + return null; + } + + /** + * Adds an error to the verified error list + * + * @since 1.14.2 + * + * @param array $error The error array, as it was saved in the unverified errors list. + * @return void + */ + public function verify_error( $error ) { + + $verified_errors = $this->get_verified_errors(); + $error_code = $error['error_code']; + $user_id = $error['user_id']; + + if ( ! isset( $verified_errors[ $error_code ] ) ) { + $verified_errors[ $error_code ] = array(); + } + + $verified_errors[ $error_code ][ $user_id ] = $error; + + update_option( self::STORED_VERIFIED_ERRORS_OPTION, $verified_errors ); + } + + /** + * Register REST API end point for error hanlding. + * + * @since 1.14.2 + * + * @return void + */ + public function register_verify_error_endpoint() { + register_rest_route( + 'jetpack/v4', + '/verify_xmlrpc_error', + array( + 'methods' => \WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'verify_xml_rpc_error' ), + 'permission_callback' => '__return_true', + 'args' => array( + 'nonce' => array( + 'required' => true, + 'type' => 'string', + ), + ), + ) + ); + } + + /** + * Handles verification that a xml rpc error is legit and came from WordPres.com + * + * @since 1.14.2 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return boolean + */ + public function verify_xml_rpc_error( \WP_REST_Request $request ) { + $error = $this->get_error_by_nonce( $request['nonce'] ); + + if ( $error ) { + $this->verify_error( $error ); + return new \WP_REST_Response( true, 200 ); + } + + return new \WP_REST_Response( false, 200 ); + } + + /** + * Prints a generic error notice for all connection errors + * + * @since 8.9.0 + * + * @return void + */ + public function generic_admin_notice_error() { + // do not add admin notice to the jetpack dashboard. + global $pagenow; + if ( 'admin.php' === $pagenow || isset( $_GET['page'] ) && 'jetpack' === $_GET['page'] ) { // phpcs:ignore + return; + } + + if ( ! current_user_can( 'jetpack_connect' ) ) { + return; + } + + /** + * Filters the message to be displayed in the admin notices area when there's a connection error. + * + * By default we don't display any errors. + * + * Return an empty value to disable the message. + * + * @since 8.9.0 + * + * @param string $message The error message. + * @param array $errors The array of errors. See Automattic\Jetpack\Connection\Error_Handler for details on the array structure. + */ + $message = apply_filters( 'jetpack_connection_error_notice_message', '', $this->get_verified_errors() ); + + /** + * Fires inside the admin_notices hook just before displaying the error message for a broken connection. + * + * If you want to disable the default message from being displayed, return an emtpy value in the jetpack_connection_error_notice_message filter. + * + * @since 8.9.0 + * + * @param array $errors The array of errors. See Automattic\Jetpack\Connection\Error_Handler for details on the array structure. + */ + do_action( 'jetpack_connection_error_notice', $this->get_verified_errors() ); + + if ( empty( $message ) ) { + return; + } + + wp_admin_notice( + esc_html( $message ), + array( + 'type' => 'error', + 'dismissible' => true, + 'additional_classes' => array( 'jetpack-message', 'jp-connect' ), + 'attributes' => array( 'style' => 'display:block !important;' ), + ) + ); + } + + /** + * Adds the error message to the Jetpack React Dashboard + * + * @since 8.9.0 + * + * @param array $errors The array of errors. See Automattic\Jetpack\Connection\Error_Handler for details on the array structure. + * @return array + */ + public function jetpack_react_dashboard_error( $errors ) { + $errors[] = array( + 'code' => 'connection_error', + 'message' => __( 'Your connection with WordPress.com seems to be broken. If you\'re experiencing issues, please try reconnecting.', 'jetpack-connection' ), + 'action' => 'reconnect', + 'data' => array( 'api_error_code' => $this->error_code ), + ); + return $errors; + } + + /** + * Check REST API response for errors, and report them to WP.com if needed. + * + * @see wp_remote_request() For more information on the $http_response array format. + * @param array|\WP_Error $http_response The response or WP_Error on failure. + * @param array $auth_data Auth data, allowed keys: `token`, `timestamp`, `nonce`, `body-hash`. + * @param string $url Request URL. + * @param string $method Request method. + * @param string $error_type The source of an error: 'xmlrpc' or 'rest'. + * + * @return void + */ + public function check_api_response_for_errors( $http_response, $auth_data, $url, $method, $error_type ) { + if ( 200 === wp_remote_retrieve_response_code( $http_response ) || ! is_array( $auth_data ) || ! $url || ! $method ) { + return; + } + + $body_raw = wp_remote_retrieve_body( $http_response ); + if ( ! $body_raw ) { + return; + } + + $body = json_decode( $body_raw, true ); + if ( empty( $body['error'] ) || ( ! is_string( $body['error'] ) && ! is_int( $body['error'] ) ) ) { + return; + } + + $error = new \WP_Error( + $body['error'], + empty( $body['message'] ) ? '' : $body['message'], + array( + 'signature_details' => array( + 'token' => empty( $auth_data['token'] ) ? '' : $auth_data['token'], + 'timestamp' => empty( $auth_data['timestamp'] ) ? '' : $auth_data['timestamp'], + 'nonce' => empty( $auth_data['nonce'] ) ? '' : $auth_data['nonce'], + 'body_hash' => empty( $auth_data['body_hash'] ) ? '' : $auth_data['body_hash'], + 'method' => $method, + 'url' => $url, + ), + 'error_type' => in_array( $error_type, array( 'xmlrpc', 'rest' ), true ) ? $error_type : '', + ) + ); + + $this->report_error( $error, false, true ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php new file mode 100644 index 00000000..cc32b536 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php @@ -0,0 +1,310 @@ +cron_name, array( $this, 'cron_exec' ) ); + + if ( ! wp_next_scheduled( $this->cron_name ) ) { + // Deal with the old pre-3.0 weekly one. + $timestamp = wp_next_scheduled( 'jetpack_heartbeat' ); + if ( $timestamp ) { + wp_unschedule_event( $timestamp, 'jetpack_heartbeat' ); + } + + wp_schedule_event( time(), 'daily', $this->cron_name ); + } + + add_filter( 'jetpack_xmlrpc_unauthenticated_methods', array( __CLASS__, 'jetpack_xmlrpc_methods' ) ); + + if ( defined( 'WP_CLI' ) && WP_CLI ) { + WP_CLI::add_command( 'jetpack-heartbeat', array( $this, 'cli_callback' ) ); + } + + add_action( 'rest_api_init', array( $this, 'initialize_rest_api' ) ); + } + + /** + * Method that gets executed on the wp-cron call + * + * @since 1.0.0 + * @since-jetpack 2.3.3 + * @global string $wp_version + */ + public function cron_exec() { + + $a8c_mc_stats = new A8c_Mc_Stats(); + + /* + * This should run daily. Figuring in for variances in + * WP_CRON, don't let it run more than every 23 hours at most. + * + * i.e. if it ran less than 23 hours ago, fail out. + */ + $last = (int) Jetpack_Options::get_option( 'last_heartbeat' ); + if ( $last && ( $last + DAY_IN_SECONDS - HOUR_IN_SECONDS > time() ) ) { + return; + } + + /* + * Check for an identity crisis + * + * If one exists: + * - Bump stat for ID crisis + * - Email site admin about potential ID crisis + */ + + // Coming Soon! + + foreach ( self::generate_stats_array( 'v2-' ) as $key => $value ) { + if ( is_array( $value ) ) { + foreach ( $value as $v ) { + $a8c_mc_stats->add( $key, (string) $v ); + } + } else { + $a8c_mc_stats->add( $key, (string) $value ); + } + } + + Jetpack_Options::update_option( 'last_heartbeat', time() ); + + $a8c_mc_stats->do_server_side_stats(); + + /** + * Fires when we synchronize all registered options on heartbeat. + * + * @since 3.3.0 + */ + do_action( 'jetpack_heartbeat' ); + } + + /** + * Generates heartbeat stats data. + * + * @param string $prefix Prefix to add before stats identifier. + * + * @return array The stats array. + */ + public static function generate_stats_array( $prefix = '' ) { + + /** + * This filter is used to build the array of stats that are bumped once a day by Jetpack Heartbeat. + * + * Filter the array and add key => value pairs where + * * key is the stat group name + * * value is the stat name. + * + * Example: + * add_filter( 'jetpack_heartbeat_stats_array', function( $stats ) { + * $stats['is-https'] = is_ssl() ? 'https' : 'http'; + * }); + * + * This will bump the stats for the 'is-https/https' or 'is-https/http' stat. + * + * @param array $stats The stats to be filtered. + * @param string $prefix The prefix that will automatically be added at the begining at each stat group name. + */ + $stats = apply_filters( 'jetpack_heartbeat_stats_array', array(), $prefix ); + $return = array(); + + // Apply prefix to stats. + foreach ( $stats as $stat => $value ) { + $return[ "$prefix$stat" ] = $value; + } + + return $return; + } + + /** + * Registers jetpack.getHeartbeatData xmlrpc method + * + * @param array $methods The list of methods to be filtered. + * @return array $methods + */ + public static function jetpack_xmlrpc_methods( $methods ) { + $methods['jetpack.getHeartbeatData'] = array( __CLASS__, 'xmlrpc_data_response' ); + return $methods; + } + + /** + * Handles the response for the jetpack.getHeartbeatData xmlrpc method + * + * @param array $params The parameters received in the request. + * @return array $params all the stats that heartbeat handles. + */ + public static function xmlrpc_data_response( $params = array() ) { + // The WordPress XML-RPC server sets a default param of array() + // if no argument is passed on the request and the method handlers get this array in $params. + // generate_stats_array() needs a string as first argument. + $params = empty( $params ) ? '' : $params; + return self::generate_stats_array( $params ); + } + + /** + * Clear scheduled events + * + * @return void + */ + public function deactivate() { + // Deal with the old pre-3.0 weekly one. + $timestamp = wp_next_scheduled( 'jetpack_heartbeat' ); + if ( $timestamp ) { + wp_unschedule_event( $timestamp, 'jetpack_heartbeat' ); + } + + $timestamp = wp_next_scheduled( $this->cron_name ); + wp_unschedule_event( $timestamp, $this->cron_name ); + } + + /** + * Interact with the Heartbeat + * + * ## OPTIONS + * + * inspect (default): Gets the list of data that is going to be sent in the heartbeat and the date/time of the last heartbeat + * + * @param array $args Arguments passed via CLI. + * + * @return void + */ + public function cli_callback( $args ) { + + $allowed_args = array( + 'inspect', + ); + + if ( isset( $args[0] ) && ! in_array( $args[0], $allowed_args, true ) ) { + /* translators: %s is a command like "prompt" */ + WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack-connection' ), $args[0] ) ); + } + + $stats = self::generate_stats_array(); + $formatted_stats = array(); + + foreach ( $stats as $stat_name => $bin ) { + $formatted_stats[] = array( + 'Stat name' => $stat_name, + 'Bin' => $bin, + ); + } + + WP_CLI\Utils\format_items( 'table', $formatted_stats, array( 'Stat name', 'Bin' ) ); + + $last_heartbeat = Jetpack_Options::get_option( 'last_heartbeat' ); + + if ( $last_heartbeat ) { + $last_date = gmdate( 'Y-m-d H:i:s', $last_heartbeat ); + /* translators: %s is the full datetime of the last heart beat e.g. 2020-01-01 12:21:23 */ + WP_CLI::line( sprintf( __( 'Last heartbeat sent at: %s', 'jetpack-connection' ), $last_date ) ); + } + } + + /** + * Initialize the heartbeat REST API. + * + * @return void + */ + public function initialize_rest_api() { + register_rest_route( + 'jetpack/v4', + '/heartbeat/data', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'rest_heartbeat_data' ), + 'permission_callback' => array( $this, 'rest_heartbeat_data_permission_check' ), + 'args' => array( + 'prefix' => array( + 'description' => __( 'Prefix to add before the stats identifiers.', 'jetpack-connection' ), + 'type' => 'string', + ), + ), + ) + ); + } + + /** + * Endpoint to retrieve the heartbeat data. + * + * @param WP_REST_Request $request The request data. + * + * @since 2.7.0 + * + * @return array + */ + public function rest_heartbeat_data( WP_REST_Request $request ) { + return static::generate_stats_array( $request->get_param( 'prefix' ) ); + } + + /** + * Check permissions for the `get_heartbeat_data` endpoint. + * + * @return true|WP_Error + */ + public function rest_heartbeat_data_permission_check() { + if ( current_user_can( 'jetpack_connect' ) ) { + return true; + } + + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( 'invalid_permission_heartbeat_data', REST_Connector::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php new file mode 100644 index 00000000..5f44ab4a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php @@ -0,0 +1,73 @@ + esc_url_raw( rest_url() ), + 'apiNonce' => wp_create_nonce( 'wp_rest' ), + 'registrationNonce' => wp_create_nonce( 'jetpack-registration-nonce' ), + 'connectionStatus' => REST_Connector::connection_status( false ), + 'userConnectionData' => REST_Connector::get_user_connection_data( false ), + 'connectedPlugins' => REST_Connector::get_connection_plugins( false ), + 'wpVersion' => $wp_version, + 'siteSuffix' => $status->get_site_suffix(), + 'connectionErrors' => Error_Handler::get_instance()->get_verified_errors(), + 'isOfflineMode' => $status->is_offline_mode(), + 'calypsoEnv' => ( new Status\Host() )->get_calypso_env(), + ); + } + + /** + * Set the connection script data. + * + * @param array $data The script data. + */ + public static function set_connection_script_data( $data ) { + + $data['connection'] = self::get_data(); + + return $data; + } + + /** + * Render the initial state into a JavaScript variable. + * + * @return string + */ + public static function render() { + return 'var JP_CONNECTION_INITIAL_STATE; typeof JP_CONNECTION_INITIAL_STATE === "object" || (JP_CONNECTION_INITIAL_STATE = JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( self::get_data() ) ) . '")));'; + } + + /** + * Render the initial state using an inline script. + * + * @param string $handle The JS script handle. + * + * @return void + */ + public static function render_script( $handle ) { + wp_add_inline_script( $handle, static::render(), 'before' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php new file mode 100644 index 00000000..3765b877 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php @@ -0,0 +1,2659 @@ +set_plugin_instance( new Plugin( $plugin_slug ) ); + } + } + + /** + * Initializes required listeners. This is done separately from the constructors + * because some objects sometimes need to instantiate separate objects of this class. + * + * @todo Implement a proper nonce verification. + */ + public static function configure() { + $manager = new self(); + + add_filter( + 'jetpack_constant_default_value', + __NAMESPACE__ . '\Utils::jetpack_api_constant_filter', + 10, + 2 + ); + + $manager->setup_xmlrpc_handlers( + null, + $manager->has_connected_owner(), + $manager->verify_xml_rpc_signature() + ); + + $manager->error_handler = Error_Handler::get_instance(); + + if ( $manager->is_connected() ) { + add_filter( 'xmlrpc_methods', array( $manager, 'public_xmlrpc_methods' ) ); + add_filter( 'shutdown', array( new Package_Version_Tracker(), 'maybe_update_package_versions' ) ); + } + + add_action( 'rest_api_init', array( $manager, 'initialize_rest_api_registration_connector' ) ); + + ( new Nonce_Handler() )->init_schedule(); + + add_action( 'plugins_loaded', __NAMESPACE__ . '\Plugin_Storage::configure', 100 ); + + add_filter( 'map_meta_cap', array( $manager, 'jetpack_connection_custom_caps' ), 1, 4 ); + + Heartbeat::init(); + add_filter( 'jetpack_heartbeat_stats_array', array( $manager, 'add_stats_to_heartbeat' ) ); + + Webhooks::init( $manager ); + + // Unlink user before deleting the user from WP.com. + add_action( 'deleted_user', array( $manager, 'disconnect_user_force' ), 9, 1 ); + add_action( 'remove_user_from_blog', array( $manager, 'disconnect_user_force' ), 9, 1 ); + + // Set up package version hook. + add_filter( 'jetpack_package_versions', __NAMESPACE__ . '\Package_Version::send_package_version_to_tracker' ); + + if ( defined( 'JETPACK__SANDBOX_DOMAIN' ) && JETPACK__SANDBOX_DOMAIN ) { + ( new Server_Sandbox() )->init(); + } + + // Initialize connection notices. + new Connection_Notice(); + + // Initialize token locks. + new Tokens_Locks(); + + // Initial Partner management. + Partner::init(); + } + + /** + * Sets up the XMLRPC request handlers. + * + * @since 1.25.0 Deprecate $is_active param. + * @since 2.8.4 Deprecate $request_params param. + * + * @param array|null $deprecated Deprecated. Not used. + * @param bool $has_connected_owner Whether the site has a connected owner. + * @param bool $is_signed whether the signature check has been successful. + * @param Jetpack_XMLRPC_Server $xmlrpc_server (optional) an instance of the server to use instead of instantiating a new one. + */ + public function setup_xmlrpc_handlers( + $deprecated, + $has_connected_owner, + $is_signed, + Jetpack_XMLRPC_Server $xmlrpc_server = null + ) { + add_filter( 'xmlrpc_blog_options', array( $this, 'xmlrpc_options' ), 1000, 2 ); + if ( $deprecated !== null ) { + _deprecated_argument( __METHOD__, '2.8.4' ); + } + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using the 'for' request param to early return unless it's 'jetpack'. + if ( ! isset( $_GET['for'] ) || 'jetpack' !== $_GET['for'] ) { + return false; + } + + // Alternate XML-RPC, via ?for=jetpack&jetpack=comms. + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This just determines whether to handle the request as an XML-RPC request. The actual XML-RPC endpoints do the appropriate nonce checking where applicable. Plus we make sure to clear all cookies via require_jetpack_authentication called later in method. + if ( isset( $_GET['jetpack'] ) && 'comms' === $_GET['jetpack'] ) { + if ( ! Constants::is_defined( 'XMLRPC_REQUEST' ) ) { + // Use the real constant here for WordPress' sake. + define( 'XMLRPC_REQUEST', true ); + } + + add_action( 'template_redirect', array( $this, 'alternate_xmlrpc' ) ); + + add_filter( 'xmlrpc_methods', array( $this, 'remove_non_jetpack_xmlrpc_methods' ), 1000 ); + } + + if ( ! Constants::get_constant( 'XMLRPC_REQUEST' ) ) { + return false; + } + + // Display errors can cause the XML to be not well formed. + // This only affects Jetpack XML-RPC endpoints received from WordPress.com servers. + // All other XML-RPC requests are unaffected. + @ini_set( 'display_errors', false ); // phpcs:ignore + + if ( $xmlrpc_server ) { + $this->xmlrpc_server = $xmlrpc_server; + } else { + $this->xmlrpc_server = new Jetpack_XMLRPC_Server(); + } + + $this->require_jetpack_authentication(); + + if ( $is_signed ) { + // If the site is connected either at a site or user level and the request is signed, expose the methods. + // The callback is responsible to determine whether the request is signed with blog or user token and act accordingly. + // The actual API methods. + $callback = array( $this->xmlrpc_server, 'xmlrpc_methods' ); + + // Hack to preserve $HTTP_RAW_POST_DATA. + add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); + + } elseif ( $has_connected_owner && ! $is_signed ) { + // The jetpack.authorize method should be available for unauthenticated users on a site with an + // active Jetpack connection, so that additional users can link their account. + $callback = array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ); + } else { + // Any other unsigned request should expose the bootstrap methods. + $callback = array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ); + new XMLRPC_Connector( $this ); + } + + add_filter( 'xmlrpc_methods', $callback ); + + // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. + add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); + return true; + } + + /** + * Initializes the REST API connector on the init hook. + */ + public function initialize_rest_api_registration_connector() { + new REST_Connector( $this ); + } + + /** + * Since a lot of hosts use a hammer approach to "protecting" WordPress sites, + * and just blanket block all requests to /xmlrpc.php, or apply other overly-sensitive + * security/firewall policies, we provide our own alternate XML RPC API endpoint + * which is accessible via a different URI. Most of the below is copied directly + * from /xmlrpc.php so that we're replicating it as closely as possible. + * + * @todo Tighten $wp_xmlrpc_server_class a bit to make sure it doesn't do bad things. + * + * @return never + */ + public function alternate_xmlrpc() { + // Some browser-embedded clients send cookies. We don't want them. + $_COOKIE = array(); + + include_once ABSPATH . 'wp-admin/includes/admin.php'; + include_once ABSPATH . WPINC . '/class-IXR.php'; + include_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php'; + + /** + * Filters the class used for handling XML-RPC requests. + * + * @since 1.7.0 + * @since-jetpack 3.1.0 + * + * @param string $class The name of the XML-RPC server class. + */ + $wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' ); + $wp_xmlrpc_server = new $wp_xmlrpc_server_class(); + + // Fire off the request. + nocache_headers(); + $wp_xmlrpc_server->serve_request(); + + exit; + } + + /** + * Removes all XML-RPC methods that are not `jetpack.*`. + * Only used in our alternate XML-RPC endpoint, where we want to + * ensure that Core and other plugins' methods are not exposed. + * + * @param array $methods a list of registered WordPress XMLRPC methods. + * @return array filtered $methods + */ + public function remove_non_jetpack_xmlrpc_methods( $methods ) { + $jetpack_methods = array(); + + foreach ( $methods as $method => $callback ) { + if ( str_starts_with( $method, 'jetpack.' ) ) { + $jetpack_methods[ $method ] = $callback; + } + } + + return $jetpack_methods; + } + + /** + * Removes all other authentication methods not to allow other + * methods to validate unauthenticated requests. + */ + public function require_jetpack_authentication() { + // Don't let anyone authenticate. + $_COOKIE = array(); + remove_all_filters( 'authenticate' ); + remove_all_actions( 'wp_login_failed' ); + + if ( $this->is_connected() ) { + // Allow Jetpack authentication. + add_filter( 'authenticate', array( $this, 'authenticate_jetpack' ), 10, 3 ); + } + } + + /** + * Authenticates XML-RPC and other requests from the Jetpack Server + * + * @param WP_User|Mixed $user user object if authenticated. + * @param String $username username. + * @param String $password password string. + * @return WP_User|Mixed authenticated user or error. + */ + public function authenticate_jetpack( $user, $username, $password ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + if ( is_a( $user, '\\WP_User' ) ) { + return $user; + } + + $token_details = $this->verify_xml_rpc_signature(); + + if ( ! $token_details ) { + return $user; + } + + if ( 'user' !== $token_details['type'] ) { + return $user; + } + + if ( ! $token_details['user_id'] ) { + return $user; + } + + nocache_headers(); + + return new \WP_User( $token_details['user_id'] ); + } + + /** + * Verifies the signature of the current request. + * + * @return false|array + */ + public function verify_xml_rpc_signature() { + if ( $this->xmlrpc_verification === null ) { + $this->xmlrpc_verification = $this->internal_verify_xml_rpc_signature(); + + if ( is_wp_error( $this->xmlrpc_verification ) ) { + /** + * Action for logging XMLRPC signature verification errors. This data is sensitive. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param WP_Error $signature_verification_error The verification error + */ + do_action( 'jetpack_verify_signature_error', $this->xmlrpc_verification ); + + Error_Handler::get_instance()->report_error( $this->xmlrpc_verification ); + + } + } + + return is_wp_error( $this->xmlrpc_verification ) ? false : $this->xmlrpc_verification; + } + + /** + * Verifies the signature of the current request. + * + * This function has side effects and should not be used. Instead, + * use the memoized version `->verify_xml_rpc_signature()`. + * + * @internal + * @todo Refactor to use proper nonce verification. + */ + private function internal_verify_xml_rpc_signature() { + // phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + // It's not for us. + if ( ! isset( $_GET['token'] ) || empty( $_GET['signature'] ) ) { + return false; + } + + $signature_details = array( + 'token' => isset( $_GET['token'] ) ? wp_unslash( $_GET['token'] ) : '', + 'timestamp' => isset( $_GET['timestamp'] ) ? wp_unslash( $_GET['timestamp'] ) : '', + 'nonce' => isset( $_GET['nonce'] ) ? wp_unslash( $_GET['nonce'] ) : '', + 'body_hash' => isset( $_GET['body-hash'] ) ? wp_unslash( $_GET['body-hash'] ) : '', + 'method' => isset( $_SERVER['REQUEST_METHOD'] ) ? wp_unslash( $_SERVER['REQUEST_METHOD'] ) : null, + 'url' => wp_unslash( ( isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : null ) . ( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : null ) ), // Temp - will get real signature URL later. + 'signature' => isset( $_GET['signature'] ) ? wp_unslash( $_GET['signature'] ) : '', + ); + + $error_type = 'xmlrpc'; + + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + @list( $token_key, $version, $user_id ) = explode( ':', wp_unslash( $_GET['token'] ) ); + // phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + + $jetpack_api_version = Constants::get_constant( 'JETPACK__API_VERSION' ); + + if ( + empty( $token_key ) + || + empty( $version ) || (string) $jetpack_api_version !== $version ) { + return new \WP_Error( 'malformed_token', 'Malformed token in request', compact( 'signature_details', 'error_type' ) ); + } + + if ( '0' === $user_id ) { + $token_type = 'blog'; + $user_id = 0; + } else { + $token_type = 'user'; + if ( empty( $user_id ) || ! ctype_digit( $user_id ) ) { + return new \WP_Error( + 'malformed_user_id', + 'Malformed user_id in request', + compact( 'signature_details', 'error_type' ) + ); + } + $user_id = (int) $user_id; + + $user = new \WP_User( $user_id ); + if ( ! $user || ! $user->exists() ) { + return new \WP_Error( + 'unknown_user', + sprintf( 'User %d does not exist', $user_id ), + compact( 'signature_details', 'error_type' ) + ); + } + } + + $token = $this->get_tokens()->get_access_token( $user_id, $token_key, false ); + if ( is_wp_error( $token ) ) { + $token->add_data( compact( 'signature_details', 'error_type' ) ); + return $token; + } elseif ( ! $token ) { + return new \WP_Error( + 'unknown_token', + sprintf( 'Token %s:%s:%d does not exist', $token_key, $version, $user_id ), + compact( 'signature_details', 'error_type' ) + ); + } + + $jetpack_signature = new \Jetpack_Signature( $token->secret, (int) \Jetpack_Options::get_option( 'time_diff' ) ); + // phpcs:disable WordPress.Security.NonceVerification.Missing -- Used to verify a cryptographic signature of the post data. Also a nonce is verified later in the function. + if ( isset( $_POST['_jetpack_is_multipart'] ) ) { + $post_data = $_POST; // We need all of $_POST in order to verify a cryptographic signature of the post data. + $file_hashes = array(); + foreach ( $post_data as $post_data_key => $post_data_value ) { + if ( ! str_starts_with( $post_data_key, '_jetpack_file_hmac_' ) ) { + continue; + } + $post_data_key = substr( $post_data_key, strlen( '_jetpack_file_hmac_' ) ); + $file_hashes[ $post_data_key ] = $post_data_value; + } + + foreach ( $file_hashes as $post_data_key => $post_data_value ) { + unset( $post_data[ "_jetpack_file_hmac_{$post_data_key}" ] ); + $post_data[ $post_data_key ] = $post_data_value; + } + + ksort( $post_data ); + + $body = http_build_query( stripslashes_deep( $post_data ) ); + } elseif ( $this->raw_post_data === null ) { + $body = file_get_contents( 'php://input' ); + } else { + $body = null; + } + // phpcs:enable + + $signature = $jetpack_signature->sign_current_request( + array( 'body' => $body === null ? $this->raw_post_data : $body ) + ); + + $signature_details['url'] = $jetpack_signature->current_request_url; + + if ( ! $signature ) { + return new \WP_Error( + 'could_not_sign', + 'Unknown signature error', + compact( 'signature_details', 'error_type' ) + ); + } elseif ( is_wp_error( $signature ) ) { + return $signature; + } + + // phpcs:disable WordPress.Security.NonceVerification.Recommended + $timestamp = (int) $_GET['timestamp']; + $nonce = wp_unslash( (string) $_GET['nonce'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- WP Core doesn't sanitize nonces either. + // phpcs:enable WordPress.Security.NonceVerification.Recommended + + // Use up the nonce regardless of whether the signature matches. + if ( ! ( new Nonce_Handler() )->add( $timestamp, $nonce ) ) { + return new \WP_Error( + 'invalid_nonce', + 'Could not add nonce', + compact( 'signature_details', 'error_type' ) + ); + } + + // Be careful about what you do with this debugging data. + // If a malicious requester has access to the expected signature, + // bad things might be possible. + $signature_details['expected'] = $signature; + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! hash_equals( $signature, wp_unslash( $_GET['signature'] ) ) ) { + return new \WP_Error( + 'signature_mismatch', + 'Signature mismatch', + compact( 'signature_details', 'error_type' ) + ); + } + + /** + * Action for additional token checking. + * + * @since 1.7.0 + * @since-jetpack 7.7.0 + * + * @param array $post_data request data. + * @param array $token_data token data. + */ + return apply_filters( + 'jetpack_signature_check_token', + array( + 'type' => $token_type, + 'token_key' => $token_key, + 'user_id' => $token->external_user_id, + ), + $token, + $this->raw_post_data + ); + } + + /** + * Returns true if the current site is connected to WordPress.com and has the minimum requirements to enable Jetpack UI. + * + * This method is deprecated since version 1.25.0 of this package. Please use has_connected_owner instead. + * + * Since this method has a wide spread use, we decided not to throw any deprecation warnings for now. + * + * @deprecated 1.25.0 + * @see Manager::has_connected_owner + * @return Boolean is the site connected? + */ + public function is_active() { + return (bool) $this->get_tokens()->get_access_token( true ); + } + + /** + * Obtains an instance of the Tokens class. + * + * @return Tokens the Tokens object + */ + public function get_tokens() { + return new Tokens(); + } + + /** + * Returns true if the site has both a token and a blog id, which indicates a site has been registered. + * + * @access public + * @deprecated 1.12.1 Use is_connected instead + * @see Manager::is_connected + * + * @return bool + */ + public function is_registered() { + _deprecated_function( __METHOD__, '1.12.1' ); + return $this->is_connected(); + } + + /** + * Returns true if the site has both a token and a blog id, which indicates a site has been connected. + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function is_connected() { + $has_blog_id = (bool) \Jetpack_Options::get_option( 'id' ); + $has_blog_token = (bool) $this->get_tokens()->get_access_token(); + return $has_blog_id && $has_blog_token; + } + + /** + * Returns true if the site has at least one connected administrator. + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function has_connected_admin() { + return (bool) count( $this->get_connected_users( 'manage_options' ) ); + } + + /** + * Returns true if the site has any connected user. + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function has_connected_user() { + return (bool) count( $this->get_connected_users( 'any', 1 ) ); + } + + /** + * Returns an array of users that have user tokens for communicating with wpcom. + * Able to select by specific capability. + * + * @since 9.9.1 Added $limit parameter. + * + * @param string $capability The capability of the user. + * @param int|null $limit How many connected users to get before returning. + * @return WP_User[] Array of WP_User objects if found. + */ + public function get_connected_users( $capability = 'any', $limit = null ) { + $connected_users = array(); + $user_tokens = $this->get_tokens()->get_user_tokens(); + + if ( ! is_array( $user_tokens ) || empty( $user_tokens ) ) { + return $connected_users; + } + $connected_user_ids = array_keys( $user_tokens ); + + if ( ! empty( $connected_user_ids ) ) { + foreach ( $connected_user_ids as $id ) { + // Check for capability. + if ( 'any' !== $capability && ! user_can( $id, $capability ) ) { + continue; + } + + $user_data = get_userdata( $id ); + if ( $user_data instanceof \WP_User ) { + $connected_users[] = $user_data; + if ( $limit && count( $connected_users ) >= $limit ) { + return $connected_users; + } + } + } + } + + return $connected_users; + } + + /** + * Returns true if the site has a connected Blog owner (master_user). + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function has_connected_owner() { + return (bool) $this->get_connection_owner_id(); + } + + /** + * Returns true if the site is connected only at a site level. + * + * Note that we are explicitly checking for the existence of the master_user option in order to account for cases where we don't have any user tokens (user-level connection) but the master_user option is set, which could be the result of a problematic user connection. + * + * @access public + * @since 1.25.0 + * @deprecated 1.27.0 + * + * @return bool + */ + public function is_userless() { + _deprecated_function( __METHOD__, '1.27.0', 'Automattic\\Jetpack\\Connection\\Manager::is_site_connection' ); + return $this->is_site_connection(); + } + + /** + * Returns true if the site is connected only at a site level. + * + * Note that we are explicitly checking for the existence of the master_user option in order to account for cases where we don't have any user tokens (user-level connection) but the master_user option is set, which could be the result of a problematic user connection. + * + * @access public + * @since 1.27.0 + * + * @return bool + */ + public function is_site_connection() { + return $this->is_connected() && ! $this->has_connected_user() && ! \Jetpack_Options::get_option( 'master_user' ); + } + + /** + * Checks to see if the connection owner of the site is missing. + * + * @return bool + */ + public function is_missing_connection_owner() { + $connection_owner = $this->get_connection_owner_id(); + if ( ! get_user_by( 'id', $connection_owner ) ) { + return true; + } + + return false; + } + + /** + * Returns true if the user with the specified identifier is connected to + * WordPress.com. + * + * @param int $user_id the user identifier. Default is the current user. + * @return bool Boolean is the user connected? + */ + public function is_user_connected( $user_id = false ) { + $user_id = false === $user_id ? get_current_user_id() : absint( $user_id ); + if ( ! $user_id ) { + return false; + } + + return (bool) $this->get_tokens()->get_access_token( $user_id ); + } + + /** + * Returns the local user ID of the connection owner. + * + * @return bool|int Returns the ID of the connection owner or False if no connection owner found. + */ + public function get_connection_owner_id() { + $owner = $this->get_connection_owner(); + return $owner instanceof \WP_User ? $owner->ID : false; + } + + /** + * Get the wpcom user data of the current|specified connected user. + * + * @todo Refactor to properly load the XMLRPC client independently. + * + * @param Integer $user_id the user identifier. + * @return bool|array An array with the WPCOM user data on success, false otherwise. + */ + public function get_connected_user_data( $user_id = null ) { + if ( ! $user_id ) { + $user_id = get_current_user_id(); + } + + // Check if the user is connected and return false otherwise. + if ( ! $this->is_user_connected( $user_id ) ) { + return false; + } + + $transient_key = "jetpack_connected_user_data_$user_id"; + $cached_user_data = get_transient( $transient_key ); + + if ( $cached_user_data ) { + return $cached_user_data; + } + + $xml = new Jetpack_IXR_Client( + array( + 'user_id' => $user_id, + ) + ); + $xml->query( 'wpcom.getUser' ); + + if ( ! $xml->isError() ) { + $user_data = $xml->getResponse(); + set_transient( $transient_key, $xml->getResponse(), DAY_IN_SECONDS ); + return $user_data; + } + + return false; + } + + /** + * Returns a user object of the connection owner. + * + * @return WP_User|false False if no connection owner found. + */ + public function get_connection_owner() { + + $user_id = \Jetpack_Options::get_option( 'master_user' ); + + if ( ! $user_id ) { + return false; + } + + // Make sure user is connected. + $user_token = $this->get_tokens()->get_access_token( $user_id ); + + $connection_owner = false; + + if ( $user_token && is_object( $user_token ) && isset( $user_token->external_user_id ) ) { + $connection_owner = get_userdata( $user_token->external_user_id ); + } + + if ( $connection_owner === false ) { + Error_Handler::get_instance()->report_error( + new WP_Error( + 'invalid_connection_owner', + 'Invalid connection owner', + array( + 'user_id' => $user_id, + 'has_user_token' => (bool) $user_token, + 'error_type' => 'connection', + 'signature_details' => array( + 'token' => '', + ), + ) + ), + false, + true + ); + } + + return $connection_owner; + } + + /** + * Returns true if the provided user is the Jetpack connection owner. + * If user ID is not specified, the current user will be used. + * + * @param Integer|Boolean $user_id the user identifier. False for current user. + * @return Boolean True the user the connection owner, false otherwise. + */ + public function is_connection_owner( $user_id = false ) { + if ( ! $user_id ) { + $user_id = get_current_user_id(); + } + + return ( (int) $user_id ) === $this->get_connection_owner_id(); + } + + /** + * Connects the user with a specified ID to a WordPress.com user using the + * remote login flow. + * + * @access public + * + * @param Integer $user_id (optional) the user identifier, defaults to current user. + * @param String $redirect_url the URL to redirect the user to for processing, defaults to + * admin_url(). + * @return WP_Error only in case of a failed user lookup. + */ + public function connect_user( $user_id = null, $redirect_url = null ) { + $user = null; + if ( null === $user_id ) { + $user = wp_get_current_user(); + } else { + $user = get_user_by( 'ID', $user_id ); + } + + if ( empty( $user ) ) { + return new \WP_Error( 'user_not_found', 'Attempting to connect a non-existent user.' ); + } + + if ( null === $redirect_url ) { + $redirect_url = admin_url(); + } + + // Using wp_redirect intentionally because we're redirecting outside. + wp_redirect( $this->get_authorization_url( $user, $redirect_url ) ); // phpcs:ignore WordPress.Security.SafeRedirect + exit(); + } + + /** + * Force user disconnect. + * + * @param int $user_id Local (external) user ID. + * + * @return bool + */ + public function disconnect_user_force( $user_id ) { + if ( ! (int) $user_id ) { + // Missing user ID. + return false; + } + + return $this->disconnect_user( $user_id, true, true ); + } + + /** + * Unlinks the current user from the linked WordPress.com user. + * + * @access public + * @static + * + * @todo Refactor to properly load the XMLRPC client independently. + * + * @param Integer $user_id the user identifier. + * @param bool $can_overwrite_primary_user Allow for the primary user to be disconnected. + * @param bool $force_disconnect_locally Disconnect user locally even if we were unable to disconnect them from WP.com. + * @return Boolean Whether the disconnection of the user was successful. + */ + public function disconnect_user( $user_id = null, $can_overwrite_primary_user = false, $force_disconnect_locally = false ) { + $user_id = empty( $user_id ) ? get_current_user_id() : (int) $user_id; + $is_primary_user = Jetpack_Options::get_option( 'master_user' ) === $user_id; + + if ( $is_primary_user && ! $can_overwrite_primary_user ) { + return false; + } + + if ( in_array( $user_id, self::$disconnected_users, true ) ) { + // The user is already disconnected. + return false; + } + + // Attempt to disconnect the user from WordPress.com. + $is_disconnected_from_wpcom = $this->unlink_user_from_wpcom( $user_id ); + + $is_disconnected_locally = false; + if ( $is_disconnected_from_wpcom || $force_disconnect_locally ) { + // Disconnect the user locally. + $is_disconnected_locally = $this->get_tokens()->disconnect_user( $user_id ); + + if ( $is_disconnected_locally ) { + // Delete cached connected user data. + $transient_key = "jetpack_connected_user_data_$user_id"; + delete_transient( $transient_key ); + + /** + * Fires after the current user has been unlinked from WordPress.com. + * + * @since 1.7.0 + * @since-jetpack 4.1.0 + * + * @param int $user_id The current user's ID. + */ + do_action( 'jetpack_unlinked_user', $user_id ); + + if ( $is_primary_user ) { + Jetpack_Options::delete_option( 'master_user' ); + } + } + } + + self::$disconnected_users[] = $user_id; + + return $is_disconnected_from_wpcom && $is_disconnected_locally; + } + + /** + * Request to wpcom for a user to be unlinked from their WordPress.com account + * + * @param int $user_id The user identifier. + * + * @return bool Whether the disconnection of the user was successful. + */ + public function unlink_user_from_wpcom( $user_id ) { + // Attempt to disconnect the user from WordPress.com. + $xml = new Jetpack_IXR_Client(); + + $xml->query( 'jetpack.unlink_user', $user_id ); + if ( $xml->isError() ) { + return false; + } + + return (bool) $xml->getResponse(); + } + + /** + * Update the connection owner. + * + * @since 1.29.0 + * + * @param Integer $new_owner_id The ID of the user to become the connection owner. + * + * @return true|WP_Error True if owner successfully changed, WP_Error otherwise. + */ + public function update_connection_owner( $new_owner_id ) { + $roles = new Roles(); + if ( ! user_can( $new_owner_id, $roles->translate_role_to_cap( 'administrator' ) ) ) { + return new WP_Error( + 'new_owner_not_admin', + __( 'New owner is not admin', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + $old_owner_id = $this->get_connection_owner_id(); + + if ( $old_owner_id === $new_owner_id ) { + return new WP_Error( + 'new_owner_is_existing_owner', + __( 'New owner is same as existing owner', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + if ( ! $this->is_user_connected( $new_owner_id ) ) { + return new WP_Error( + 'new_owner_not_connected', + __( 'New owner is not connected', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + // Notify WPCOM about the connection owner change. + $owner_updated_wpcom = $this->update_connection_owner_wpcom( $new_owner_id ); + + if ( $owner_updated_wpcom ) { + // Update the connection owner in Jetpack only if they were successfully updated on WPCOM. + // This will ensure consistency with WPCOM. + \Jetpack_Options::update_option( 'master_user', $new_owner_id ); + + // Track it. + ( new Tracking() )->record_user_event( 'set_connection_owner_success' ); + + return true; + } + return new WP_Error( + 'error_setting_new_owner', + __( 'Could not confirm new owner.', 'jetpack-connection' ), + array( 'status' => 500 ) + ); + } + + /** + * Request to WPCOM to update the connection owner. + * + * @since 1.29.0 + * + * @param Integer $new_owner_id The ID of the user to become the connection owner. + * + * @return Boolean Whether the ownership transfer was successful. + */ + public function update_connection_owner_wpcom( $new_owner_id ) { + // Notify WPCOM about the connection owner change. + $xml = new Jetpack_IXR_Client( + array( + 'user_id' => get_current_user_id(), + ) + ); + $xml->query( + 'jetpack.switchBlogOwner', + array( + 'new_blog_owner' => $new_owner_id, + ) + ); + if ( $xml->isError() ) { + return false; + } + + return (bool) $xml->getResponse(); + } + + /** + * Returns the requested Jetpack API URL. + * + * @param String $relative_url the relative API path. + * @return String API URL. + */ + public function api_url( $relative_url ) { + $api_base = Constants::get_constant( 'JETPACK__API_BASE' ); + $api_version = '/' . Constants::get_constant( 'JETPACK__API_VERSION' ) . '/'; + + /** + * Filters the API URL that Jetpack uses for server communication. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param String $url the generated URL. + * @param String $relative_url the relative URL that was passed as an argument. + * @param String $api_base the API base string that is being used. + * @param String $api_version the API version string that is being used. + */ + return apply_filters( + 'jetpack_api_url', + rtrim( $api_base . $relative_url, '/\\' ) . $api_version, + $relative_url, + $api_base, + $api_version + ); + } + + /** + * Returns the Jetpack XMLRPC WordPress.com API endpoint URL. + * + * @return String XMLRPC API URL. + */ + public function xmlrpc_api_url() { + $base = preg_replace( + '#(https?://[^?/]+)(/?.*)?$#', + '\\1', + Constants::get_constant( 'JETPACK__API_BASE' ) + ); + return untrailingslashit( $base ) . '/xmlrpc.php'; + } + + /** + * Attempts Jetpack registration which sets up the site for connection. Should + * remain public because the call to action comes from the current site, not from + * WordPress.com. + * + * @param String $api_endpoint (optional) an API endpoint to use, defaults to 'register'. + * @return true|WP_Error The error object. + */ + public function register( $api_endpoint = 'register' ) { + // Clean-up leftover tokens just in-case. + // This fixes an edge case that was preventing users to register when the blog token was missing but + // there were still leftover user tokens present. + $this->delete_all_connection_tokens( true ); + + add_action( 'pre_update_jetpack_option_register', array( '\\Jetpack_Options', 'delete_option' ) ); + $secrets = ( new Secrets() )->generate( 'register', get_current_user_id(), 600 ); + + if ( false === $secrets ) { + return new WP_Error( 'cannot_save_secrets', __( 'Jetpack experienced an issue trying to save options (cannot_save_secrets). We suggest that you contact your hosting provider, and ask them for help checking that the options table is writable on your site.', 'jetpack-connection' ) ); + } + + if ( + empty( $secrets['secret_1'] ) || + empty( $secrets['secret_2'] ) || + empty( $secrets['exp'] ) + ) { + return new \WP_Error( 'missing_secrets' ); + } + + // Better to try (and fail) to set a higher timeout than this system + // supports than to have register fail for more users than it should. + $timeout = $this->set_min_time_limit( 60 ) / 2; + + $gmt_offset = get_option( 'gmt_offset' ); + if ( ! $gmt_offset ) { + $gmt_offset = 0; + } + + $stats_options = get_option( 'stats_options' ); + $stats_id = isset( $stats_options['blog_id'] ) + ? $stats_options['blog_id'] + : null; + + /* This action is documented in src/class-package-version-tracker.php */ + $package_versions = apply_filters( 'jetpack_package_versions', array() ); + + $active_plugins_using_connection = Plugin_Storage::get_all(); + + /** + * Filters the request body for additional property addition. + * + * @since 1.7.0 + * @since-jetpack 7.7.0 + * + * @param array $post_data request data. + * @param Array $token_data token data. + */ + $body = apply_filters( + 'jetpack_register_request_body', + array_merge( + array( + 'siteurl' => Urls::site_url(), + 'home' => Urls::home_url(), + 'gmt_offset' => $gmt_offset, + 'timezone_string' => (string) get_option( 'timezone_string' ), + 'site_name' => (string) get_option( 'blogname' ), + 'secret_1' => $secrets['secret_1'], + 'secret_2' => $secrets['secret_2'], + 'site_lang' => get_locale(), + 'timeout' => $timeout, + 'stats_id' => $stats_id, + 'state' => get_current_user_id(), + 'site_created' => $this->get_assumed_site_creation_date(), + 'jetpack_version' => Constants::get_constant( 'JETPACK__VERSION' ), + 'ABSPATH' => Constants::get_constant( 'ABSPATH' ), + 'current_user_email' => wp_get_current_user()->user_email, + 'connect_plugin' => $this->get_plugin() ? $this->get_plugin()->get_slug() : null, + 'package_versions' => $package_versions, + 'active_connected_plugins' => $active_plugins_using_connection, + ), + self::$extra_register_params + ) + ); + + $args = array( + 'method' => 'POST', + 'body' => $body, + 'headers' => array( + 'Accept' => 'application/json', + ), + 'timeout' => $timeout, + ); + + $args['body'] = static::apply_activation_source_to_args( $args['body'] ); + + // TODO: fix URLs for bad hosts. + $response = Client::_wp_remote_request( + $this->api_url( $api_endpoint ), + $args, + true + ); + + // Make sure the response is valid and does not contain any Jetpack errors. + $registration_details = $this->validate_remote_register_response( $response ); + + if ( is_wp_error( $registration_details ) ) { + return $registration_details; + } elseif ( ! $registration_details ) { + return new \WP_Error( + 'unknown_error', + 'Unknown error registering your Jetpack site.', + wp_remote_retrieve_response_code( $response ) + ); + } + + if ( empty( $registration_details->jetpack_secret ) || ! is_string( $registration_details->jetpack_secret ) ) { + return new \WP_Error( + 'jetpack_secret', + 'Unable to validate registration of your Jetpack site.', + wp_remote_retrieve_response_code( $response ) + ); + } + + if ( isset( $registration_details->jetpack_public ) ) { + $jetpack_public = (int) $registration_details->jetpack_public; + } else { + $jetpack_public = false; + } + + Jetpack_Options::update_options( + array( + 'id' => (int) $registration_details->jetpack_id, + 'public' => $jetpack_public, + ) + ); + + update_option( Package_Version_Tracker::PACKAGE_VERSION_OPTION, $package_versions ); + + $this->get_tokens()->update_blog_token( (string) $registration_details->jetpack_secret ); + + if ( ! Jetpack_Options::get_option( 'id' ) || ! $this->get_tokens()->get_access_token() ) { + return new WP_Error( + 'connection_data_save_failed', + 'Failed to save connection data in the database' + ); + } + + $alternate_authorization_url = isset( $registration_details->alternate_authorization_url ) ? $registration_details->alternate_authorization_url : ''; + + add_filter( + 'jetpack_register_site_rest_response', + function ( $response ) use ( $alternate_authorization_url ) { + $response['alternateAuthorizeUrl'] = $alternate_authorization_url; + return $response; + } + ); + + /** + * Fires when a site is registered on WordPress.com. + * + * @since 1.7.0 + * @since-jetpack 3.7.0 + * + * @param int $json->jetpack_id Jetpack Blog ID. + * @param string $json->jetpack_secret Jetpack Blog Token. + * @param int|bool $jetpack_public Is the site public. + */ + do_action( + 'jetpack_site_registered', + $registration_details->jetpack_id, + $registration_details->jetpack_secret, + $jetpack_public + ); + + if ( isset( $registration_details->token ) ) { + /** + * Fires when a user token is sent along with the registration data. + * + * @since 1.7.0 + * @since-jetpack 7.6.0 + * + * @param object $token the administrator token for the newly registered site. + */ + do_action( 'jetpack_site_registered_user_token', $registration_details->token ); + } + + return true; + } + + /** + * Attempts Jetpack registration. + * + * @param bool $tos_agree Whether the user agreed to TOS. + * + * @return bool|WP_Error + */ + public function try_registration( $tos_agree = true ) { + if ( $tos_agree ) { + $terms_of_service = new Terms_Of_Service(); + $terms_of_service->agree(); + } + + /** + * Action fired when the user attempts the registration. + * + * @since 1.26.0 + */ + $pre_register = apply_filters( 'jetpack_pre_register', null ); + + if ( is_wp_error( $pre_register ) ) { + return $pre_register; + } + + $tracking_data = array(); + + if ( null !== $this->get_plugin() ) { + $tracking_data['plugin_slug'] = $this->get_plugin()->get_slug(); + } + + $tracking = new Tracking(); + $tracking->record_user_event( 'jpc_register_begin', $tracking_data ); + + add_filter( 'jetpack_register_request_body', array( Utils::class, 'filter_register_request_body' ) ); + + $result = $this->register(); + + remove_filter( 'jetpack_register_request_body', array( Utils::class, 'filter_register_request_body' ) ); + + // If there was an error with registration and the site was not registered, record this so we can show a message. + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Adds a parameter to the register request body + * + * @since 1.26.0 + * + * @param string $name The name of the parameter to be added. + * @param string $value The value of the parameter to be added. + * + * @throws \InvalidArgumentException If supplied arguments are not strings. + * @return void + */ + public function add_register_request_param( $name, $value ) { + if ( ! is_string( $name ) || ! is_string( $value ) ) { + throw new \InvalidArgumentException( 'name and value must be strings' ); + } + self::$extra_register_params[ $name ] = $value; + } + + /** + * Takes the response from the Jetpack register new site endpoint and + * verifies it worked properly. + * + * @since 1.7.0 + * @since-jetpack 2.6.0 + * + * @param Mixed $response the response object, or the error object. + * @return string|WP_Error A JSON object on success or WP_Error on failures + **/ + protected function validate_remote_register_response( $response ) { + if ( is_wp_error( $response ) ) { + return new \WP_Error( + 'register_http_request_failed', + $response->get_error_message() + ); + } + + $code = wp_remote_retrieve_response_code( $response ); + $entity = wp_remote_retrieve_body( $response ); + + if ( $entity ) { + $registration_response = json_decode( $entity ); + } else { + $registration_response = false; + } + + $code_type = (int) ( $code / 100 ); + if ( 5 === $code_type ) { + return new \WP_Error( 'wpcom_5??', $code ); + } elseif ( 408 === $code ) { + return new \WP_Error( 'wpcom_408', $code ); + } elseif ( ! empty( $registration_response->error ) ) { + if ( + 'xml_rpc-32700' === $registration_response->error + && ! function_exists( 'xml_parser_create' ) + ) { + $error_description = __( "PHP's XML extension is not available. Jetpack requires the XML extension to communicate with WordPress.com. Please contact your hosting provider to enable PHP's XML extension.", 'jetpack-connection' ); + } else { + $error_description = isset( $registration_response->error_description ) + ? (string) $registration_response->error_description + : ''; + } + + return new \WP_Error( + (string) $registration_response->error, + $error_description, + $code + ); + } elseif ( 200 !== $code ) { + return new \WP_Error( 'wpcom_bad_response', $code ); + } + + // Jetpack ID error block. + if ( empty( $registration_response->jetpack_id ) ) { + return new \WP_Error( + 'jetpack_id', + /* translators: %s is an error message string */ + sprintf( __( 'Error Details: Jetpack ID is empty. Do not publicly post this error message! %s', 'jetpack-connection' ), $entity ), + $entity + ); + } elseif ( ! is_scalar( $registration_response->jetpack_id ) ) { + return new \WP_Error( + 'jetpack_id', + /* translators: %s is an error message string */ + sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack-connection' ), $entity ), + $entity + ); + } elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) { + return new \WP_Error( + 'jetpack_id', + /* translators: %s is an error message string */ + sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack-connection' ), $entity ), + $entity + ); + } + + return $registration_response; + } + + /** + * Adds a used nonce to a list of known nonces. + * + * @param int $timestamp the current request timestamp. + * @param string $nonce the nonce value. + * @return bool whether the nonce is unique or not. + * + * @deprecated since 1.24.0 + * @see Nonce_Handler::add() + */ + public function add_nonce( $timestamp, $nonce ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Nonce_Handler::add' ); + return ( new Nonce_Handler() )->add( $timestamp, $nonce ); + } + + /** + * Cleans nonces that were saved when calling ::add_nonce. + * + * @todo Properly prepare the query before executing it. + * + * @param bool $all whether to clean even non-expired nonces. + * + * @deprecated since 1.24.0 + * @see Nonce_Handler::clean_all() + */ + public function clean_nonces( $all = false ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Nonce_Handler::clean_all' ); + ( new Nonce_Handler() )->clean_all( $all ? PHP_INT_MAX : ( time() - Nonce_Handler::LIFETIME ) ); + } + + /** + * Sets the Connection custom capabilities. + * + * @param string[] $caps Array of the user's capabilities. + * @param string $cap Capability name. + * @param int $user_id The user ID. + * @param array $args Adds the context to the cap. Typically the object ID. + */ + public function jetpack_connection_custom_caps( $caps, $cap, $user_id, $args ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + switch ( $cap ) { + case 'jetpack_connect': + case 'jetpack_reconnect': + $is_offline_mode = ( new Status() )->is_offline_mode(); + if ( $is_offline_mode ) { + $caps = array( 'do_not_allow' ); + break; + } + // Pass through. If it's not offline mode, these should match disconnect. + // Let users disconnect if it's offline mode, just in case things glitch. + case 'jetpack_disconnect': + /** + * Filters the jetpack_disconnect capability. + * + * @since 1.14.2 + * + * @param array An array containing the capability name. + */ + $caps = apply_filters( 'jetpack_disconnect_cap', array( 'manage_options' ) ); + break; + case 'jetpack_connect_user': + $is_offline_mode = ( new Status() )->is_offline_mode(); + if ( $is_offline_mode ) { + $caps = array( 'do_not_allow' ); + break; + } + // With site connections in mind, non-admin users can connect their account only if a connection owner exists. + $caps = $this->has_connected_owner() ? array( 'read' ) : array( 'manage_options' ); + break; + } + return $caps; + } + + /** + * Builds the timeout limit for queries talking with the wpcom servers. + * + * Based on local php max_execution_time in php.ini + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * @return int + **/ + public function get_max_execution_time() { + $timeout = (int) ini_get( 'max_execution_time' ); + + // Ensure exec time set in php.ini. + if ( ! $timeout ) { + $timeout = 30; + } + return $timeout; + } + + /** + * Sets a minimum request timeout, and returns the current timeout + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * @param Integer $min_timeout the minimum timeout value. + **/ + public function set_min_time_limit( $min_timeout ) { + $timeout = $this->get_max_execution_time(); + if ( $timeout < $min_timeout ) { + $timeout = $min_timeout; + set_time_limit( $timeout ); + } + return $timeout; + } + + /** + * Get our assumed site creation date. + * Calculated based on the earlier date of either: + * - Earliest admin user registration date. + * - Earliest date of post of any post type. + * + * @since 1.7.0 + * @since-jetpack 7.2.0 + * + * @return string Assumed site creation date and time. + */ + public function get_assumed_site_creation_date() { + $cached_date = get_transient( 'jetpack_assumed_site_creation_date' ); + if ( ! empty( $cached_date ) ) { + return $cached_date; + } + + $earliest_registered_users = get_users( + array( + 'role' => 'administrator', + 'orderby' => 'user_registered', + 'order' => 'ASC', + 'fields' => array( 'user_registered' ), + 'number' => 1, + ) + ); + $earliest_registration_date = $earliest_registered_users[0]->user_registered; + + $earliest_posts = get_posts( + array( + 'posts_per_page' => 1, + 'post_type' => 'any', + 'post_status' => 'any', + 'orderby' => 'date', + 'order' => 'ASC', + ) + ); + + // If there are no posts at all, we'll count only on user registration date. + if ( $earliest_posts ) { + $earliest_post_date = $earliest_posts[0]->post_date; + } else { + $earliest_post_date = PHP_INT_MAX; + } + + $assumed_date = min( $earliest_registration_date, $earliest_post_date ); + set_transient( 'jetpack_assumed_site_creation_date', $assumed_date ); + + return $assumed_date; + } + + /** + * Adds the activation source string as a parameter to passed arguments. + * + * @todo Refactor to use rawurlencode() instead of urlencode(). + * + * @param array $args arguments that need to have the source added. + * @return array $amended arguments. + */ + public static function apply_activation_source_to_args( $args ) { + list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' ); + + if ( $activation_source_name ) { + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode + $args['_as'] = urlencode( $activation_source_name ); + } + + if ( $activation_source_keyword ) { + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode + $args['_ak'] = urlencode( $activation_source_keyword ); + } + + return $args; + } + + /** + * Generates two secret tokens and the end of life timestamp for them. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + * @param Integer $exp Expiration time in seconds. + */ + public function generate_secrets( $action, $user_id = false, $exp = 600 ) { + return ( new Secrets() )->generate( $action, $user_id, $exp ); + } + + /** + * Returns two secret tokens and the end of life timestamp for them. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Secrets->get() instead. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + * @return string|array an array of secrets or an error string. + */ + public function get_secrets( $action, $user_id ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Secrets->get' ); + return ( new Secrets() )->get( $action, $user_id ); + } + + /** + * Deletes secret tokens in case they, for example, have expired. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Secrets->delete() instead. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + */ + public function delete_secrets( $action, $user_id ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Secrets->delete' ); + ( new Secrets() )->delete( $action, $user_id ); + } + + /** + * Deletes all connection tokens and transients from the local Jetpack site. + * If the plugin object has been provided in the constructor, the function first checks + * whether it's the only active connection. + * If there are any other connections, the function will do nothing and return `false` + * (unless `$ignore_connected_plugins` is set to `true`). + * + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + * + * @return bool True if disconnected successfully, false otherwise. + */ + public function delete_all_connection_tokens( $ignore_connected_plugins = false ) { + // refuse to delete if we're not the last Jetpack plugin installed. + if ( ! $ignore_connected_plugins && null !== $this->plugin && ! $this->plugin->is_only() ) { + return false; + } + + /** + * Fires upon the disconnect attempt. + * Return `false` to prevent the disconnect. + * + * @since 1.14.2 + */ + if ( ! apply_filters( 'jetpack_connection_delete_all_tokens', true ) ) { + return false; + } + + \Jetpack_Options::delete_option( + array( + 'master_user', + 'time_diff', + 'fallback_no_verify_ssl_certs', + ) + ); + + ( new Secrets() )->delete_all(); + $this->get_tokens()->delete_all(); + + // Delete cached connected user data. + $transient_key = 'jetpack_connected_user_data_' . get_current_user_id(); + delete_transient( $transient_key ); + + // Delete all XML-RPC errors. + Error_Handler::get_instance()->delete_all_errors(); + + return true; + } + + /** + * Tells WordPress.com to disconnect the site and clear all tokens from cached site. + * If the plugin object has been provided in the constructor, the function first check + * whether it's the only active connection. + * If there are any other connections, the function will do nothing and return `false` + * (unless `$ignore_connected_plugins` is set to `true`). + * + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + * + * @return bool True if disconnected successfully, false otherwise. + */ + public function disconnect_site_wpcom( $ignore_connected_plugins = false ) { + if ( ! $ignore_connected_plugins && null !== $this->plugin && ! $this->plugin->is_only() ) { + return false; + } + + if ( ( new Status() )->is_offline_mode() && ! apply_filters( 'jetpack_connection_disconnect_site_wpcom_offline_mode', false ) ) { + // Prevent potential disconnect of the live site by removing WPCOM tokens. + return false; + } + + /** + * Fires upon the disconnect attempt. + * Return `false` to prevent the disconnect. + * + * @since 1.14.2 + */ + if ( ! apply_filters( 'jetpack_connection_disconnect_site_wpcom', true, $this ) ) { + return false; + } + + $xml = new Jetpack_IXR_Client(); + $xml->query( 'jetpack.deregister', get_current_user_id() ); + + return true; + } + + /** + * Disconnect the plugin and remove the tokens. + * This function will automatically perform "soft" or "hard" disconnect depending on whether other plugins are using the connection. + * This is a proxy method to simplify the Connection package API. + * + * @see Manager::disconnect_site() + * + * @param boolean $disconnect_wpcom Should disconnect_site_wpcom be called. + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + * @return bool + */ + public function remove_connection( $disconnect_wpcom = true, $ignore_connected_plugins = false ) { + + $this->disconnect_site( $disconnect_wpcom, $ignore_connected_plugins ); + + return true; + } + + /** + * Completely clearing up the connection, and initiating reconnect. + * + * @return true|WP_Error True if reconnected successfully, a `WP_Error` object otherwise. + */ + public function reconnect() { + ( new Tracking() )->record_user_event( 'restore_connection_reconnect' ); + + $this->disconnect_site_wpcom( true ); + + return $this->register(); + } + + /** + * Validate the tokens, and refresh the invalid ones. + * + * @return string|bool|WP_Error True if connection restored or string indicating what's to be done next. A `WP_Error` object or false otherwise. + */ + public function restore() { + // If this is a site connection we need to trigger a full reconnection as our only secure means of + // communication with WPCOM, aka the blog token, is compromised. + if ( $this->is_site_connection() ) { + return $this->reconnect(); + } + + $validate_tokens_response = $this->get_tokens()->validate(); + + // If token validation failed, trigger a full reconnection. + if ( is_array( $validate_tokens_response ) && + isset( $validate_tokens_response['blog_token']['is_healthy'] ) && + isset( $validate_tokens_response['user_token']['is_healthy'] ) ) { + $blog_token_healthy = $validate_tokens_response['blog_token']['is_healthy']; + $user_token_healthy = $validate_tokens_response['user_token']['is_healthy']; + } else { + $blog_token_healthy = false; + $user_token_healthy = false; + } + + // Tokens are both valid, or both invalid. We can't fix the problem we don't see, so the full reconnection is needed. + if ( $blog_token_healthy === $user_token_healthy ) { + $result = $this->reconnect(); + return ( true === $result ) ? 'authorize' : $result; + } + + if ( ! $blog_token_healthy ) { + return $this->refresh_blog_token(); + } + + if ( ! $user_token_healthy ) { + return ( true === $this->refresh_user_token() ) ? 'authorize' : false; + } + + return false; + } + + /** + * Responds to a WordPress.com call to register the current site. + * Should be changed to protected. + * + * @param array $registration_data Array of [ secret_1, user_id ]. + */ + public function handle_registration( array $registration_data ) { + list( $registration_secret_1, $registration_user_id ) = $registration_data; + if ( empty( $registration_user_id ) ) { + return new \WP_Error( 'registration_state_invalid', __( 'Invalid Registration State', 'jetpack-connection' ), 400 ); + } + + return ( new Secrets() )->verify( 'register', $registration_secret_1, (int) $registration_user_id ); + } + + /** + * Perform the API request to validate the blog and user tokens. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Tokens->validate_tokens() instead. + * + * @param int|null $user_id ID of the user we need to validate token for. Current user's ID by default. + * + * @return array|false|WP_Error The API response: `array( 'blog_token_is_healthy' => true|false, 'user_token_is_healthy' => true|false )`. + */ + public function validate_tokens( $user_id = null ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->validate' ); + return $this->get_tokens()->validate( $user_id ); + } + + /** + * Verify a Previously Generated Secret. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Secrets->verify() instead. + * + * @param string $action The type of secret to verify. + * @param string $secret_1 The secret string to compare to what is stored. + * @param int $user_id The user ID of the owner of the secret. + * @return \WP_Error|string WP_Error on failure, secret_2 on success. + */ + public function verify_secrets( $action, $secret_1, $user_id ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Secrets->verify' ); + return ( new Secrets() )->verify( $action, $secret_1, $user_id ); + } + + /** + * Responds to a WordPress.com call to authorize the current user. + * Should be changed to protected. + */ + public function handle_authorization() { + } + + /** + * Obtains the auth token. + * + * @param array $data The request data. + * @return object|\WP_Error Returns the auth token on success. + * Returns a \WP_Error on failure. + */ + public function get_token( $data ) { + return $this->get_tokens()->get( $data, $this->api_url( 'token' ) ); + } + + /** + * Builds a URL to the Jetpack connection auth page. + * + * @since 2.7.6 Added optional $from and $raw parameters. + * + * @param WP_User|null $user (optional) defaults to the current logged in user. + * @param string|null $redirect (optional) a redirect URL to use instead of the default. + * @param bool|string $from If not false, adds 'from=$from' param to the connect URL. + * @param bool $raw If true, URL will not be escaped. + * + * @return string Connect URL. + */ + public function get_authorization_url( $user = null, $redirect = null, $from = false, $raw = false ) { + if ( empty( $user ) ) { + $user = wp_get_current_user(); + } + + $roles = new Roles(); + $role = $roles->translate_user_to_role( $user ); + $signed_role = $this->get_tokens()->sign_role( $role ); + + /** + * Filter the URL of the first time the user gets redirected back to your site for connection + * data processing. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site admin URL. + */ + $processing_url = apply_filters( 'jetpack_connect_processing_url', admin_url( 'admin.php' ) ); + + /** + * Filter the URL to redirect the user back to when the authorization process + * is complete. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site URL. + */ + $redirect = apply_filters( 'jetpack_connect_redirect_url', $redirect ); + + $secrets = ( new Secrets() )->generate( 'authorize', $user->ID, 2 * HOUR_IN_SECONDS ); + + /** + * Filter the type of authorization. + * 'calypso' completes authorization on wordpress.com/jetpack/connect + * while 'jetpack' ( or any other value ) completes the authorization at jetpack.wordpress.com. + * + * @since 1.7.0 + * @since-jetpack 4.3.3 + * + * @param string $auth_type Defaults to 'calypso', can also be 'jetpack'. + */ + $auth_type = apply_filters( 'jetpack_auth_type', 'calypso' ); + + /** + * Filters the user connection request data for additional property addition. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param array $request_data request data. + */ + $body = apply_filters( + 'jetpack_connect_request_body', + array( + 'response_type' => 'code', + 'client_id' => \Jetpack_Options::get_option( 'id' ), + 'redirect_uri' => add_query_arg( + array( + 'handler' => 'jetpack-connection-webhooks', + 'action' => 'authorize', + '_wpnonce' => wp_create_nonce( "jetpack-authorize_{$role}_{$redirect}" ), + 'redirect' => $redirect ? rawurlencode( $redirect ) : false, + ), + esc_url( $processing_url ) + ), + 'state' => $user->ID, + 'scope' => $signed_role, + 'user_email' => $user->user_email, + 'user_login' => $user->user_login, + 'is_active' => $this->has_connected_owner(), // TODO Deprecate this. + 'jp_version' => (string) Constants::get_constant( 'JETPACK__VERSION' ), + 'auth_type' => $auth_type, + 'secret' => $secrets['secret_1'], + 'blogname' => get_option( 'blogname' ), + 'site_url' => Urls::site_url(), + 'home_url' => Urls::home_url(), + 'site_icon' => get_site_icon_url(), + 'site_lang' => get_locale(), + 'site_created' => $this->get_assumed_site_creation_date(), + 'allow_site_connection' => ! $this->has_connected_owner(), + 'calypso_env' => ( new Host() )->get_calypso_env(), + 'source' => ( new Host() )->get_source_query(), + ) + ); + + $body = static::apply_activation_source_to_args( urlencode_deep( $body ) ); + + $api_url = $this->api_url( 'authorize' ); + + $url = add_query_arg( $body, $api_url ); + + if ( is_network_admin() ) { + $url = add_query_arg( 'is_multisite', network_admin_url( 'admin.php?page=jetpack-settings' ), $url ); + } + + if ( $from ) { + $url = add_query_arg( 'from', $from, $url ); + } + + if ( $raw ) { + $url = esc_url_raw( $url ); + } + + /** + * Filter the URL used when connecting a user to a WordPress.com account. + * + * @since 2.0.0 + * @since 2.7.6 Added $raw parameter. + * + * @param string $url Connection URL. + * @param bool $raw If true, URL will not be escaped. + */ + return apply_filters( 'jetpack_build_authorize_url', $url, $raw ); + } + + /** + * Authorizes the user by obtaining and storing the user token. + * + * @param array $data The request data. + * @return string|\WP_Error Returns a string on success. + * Returns a \WP_Error on failure. + */ + public function authorize( $data = array() ) { + /** + * Action fired when user authorization starts. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + */ + do_action( 'jetpack_authorize_starting' ); + + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + + if ( ! $role ) { + return new \WP_Error( 'no_role', 'Invalid request.', 400 ); + } + + $cap = $roles->translate_role_to_cap( $role ); + if ( ! $cap ) { + return new \WP_Error( 'no_cap', 'Invalid request.', 400 ); + } + + if ( ! empty( $data['error'] ) ) { + return new \WP_Error( $data['error'], 'Error included in the request.', 400 ); + } + + if ( ! isset( $data['state'] ) ) { + return new \WP_Error( 'no_state', 'Request must include state.', 400 ); + } + + if ( ! ctype_digit( $data['state'] ) ) { + return new \WP_Error( $data['error'], 'State must be an integer.', 400 ); + } + + $current_user_id = get_current_user_id(); + if ( $current_user_id !== (int) $data['state'] ) { + return new \WP_Error( 'wrong_state', 'State does not match current user.', 400 ); + } + + if ( empty( $data['code'] ) ) { + return new \WP_Error( 'no_code', 'Request must include an authorization code.', 400 ); + } + + $token = $this->get_tokens()->get( $data, $this->api_url( 'token' ) ); + + if ( is_wp_error( $token ) ) { + $code = $token->get_error_code(); + if ( empty( $code ) ) { + $code = 'invalid_token'; + } + return new \WP_Error( $code, $token->get_error_message(), 400 ); + } + + if ( ! $token ) { + return new \WP_Error( 'no_token', 'Error generating token.', 400 ); + } + + $is_connection_owner = ! $this->has_connected_owner(); + + $this->get_tokens()->update_user_token( $current_user_id, sprintf( '%s.%d', $token, $current_user_id ), $is_connection_owner ); + + /** + * Fires after user has successfully received an auth token. + * + * @since 1.7.0 + * @since-jetpack 3.9.0 + */ + do_action( 'jetpack_user_authorized' ); + + if ( ! $is_connection_owner ) { + /** + * Action fired when a secondary user has been authorized. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + */ + do_action( 'jetpack_authorize_ending_linked' ); + return 'linked'; + } + + /** + * Action fired when the master user has been authorized. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param array $data The request data. + */ + do_action( 'jetpack_authorize_ending_authorized', $data ); + + \Jetpack_Options::delete_raw_option( 'jetpack_last_connect_url_check' ); + + ( new Nonce_Handler() )->reschedule(); + + return 'authorized'; + } + + /** + * Disconnects from the Jetpack servers. + * Forgets all connection details and tells the Jetpack servers to do the same. + * + * @param boolean $disconnect_wpcom Should disconnect_site_wpcom be called. + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + */ + public function disconnect_site( $disconnect_wpcom = true, $ignore_connected_plugins = true ) { + if ( ! $ignore_connected_plugins && null !== $this->plugin && ! $this->plugin->is_only() ) { + return false; + } + + wp_clear_scheduled_hook( 'jetpack_clean_nonces' ); + + ( new Nonce_Handler() )->clean_all(); + + /** + * Fires before a site is disconnected. + * + * @since 1.36.3 + */ + do_action( 'jetpack_site_before_disconnected' ); + + // If the site is in an IDC because sync is not allowed, + // let's make sure to not disconnect the production site. + if ( $disconnect_wpcom ) { + $tracking = new Tracking(); + $tracking->record_user_event( 'disconnect_site', array() ); + + $this->disconnect_site_wpcom( $ignore_connected_plugins ); + } + + $this->delete_all_connection_tokens( $ignore_connected_plugins ); + + // Remove tracked package versions, since they depend on the Jetpack Connection. + delete_option( Package_Version_Tracker::PACKAGE_VERSION_OPTION ); + + $jetpack_unique_connection = \Jetpack_Options::get_option( 'unique_connection' ); + if ( $jetpack_unique_connection ) { + // Check then record unique disconnection if site has never been disconnected previously. + if ( - 1 === $jetpack_unique_connection['disconnected'] ) { + $jetpack_unique_connection['disconnected'] = 1; + } else { + if ( 0 === $jetpack_unique_connection['disconnected'] ) { + $a8c_mc_stats_instance = new A8c_Mc_Stats(); + $a8c_mc_stats_instance->add( 'connections', 'unique-disconnect' ); + $a8c_mc_stats_instance->do_server_side_stats(); + } + // increment number of times disconnected. + $jetpack_unique_connection['disconnected'] += 1; + } + + \Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection ); + } + + /** + * Fires when a site is disconnected. + * + * @since 1.30.1 + */ + do_action( 'jetpack_site_disconnected' ); + } + + /** + * The Base64 Encoding of the SHA1 Hash of the Input. + * + * @param string $text The string to hash. + * @return string + */ + public function sha1_base64( $text ) { + return base64_encode( sha1( $text, true ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + } + + /** + * This function mirrors Jetpack_Data::is_usable_domain() in the WPCOM codebase. + * + * @param string $domain The domain to check. + * + * @return bool|WP_Error + */ + public function is_usable_domain( $domain ) { + + // If it's empty, just fail out. + if ( ! $domain ) { + return new \WP_Error( + 'fail_domain_empty', + /* translators: %1$s is a domain name. */ + sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it is empty.', 'jetpack-connection' ), $domain ) + ); + } + + /** + * Skips the usuable domain check when connecting a site. + * + * Allows site administrators with domains that fail gethostname-based checks to pass the request to WP.com + * + * @since 1.7.0 + * @since-jetpack 4.1.0 + * + * @param bool If the check should be skipped. Default false. + */ + if ( apply_filters( 'jetpack_skip_usuable_domain_check', false ) ) { + return true; + } + + // None of the explicit localhosts. + $forbidden_domains = array( + 'wordpress.com', + 'localhost', + 'localhost.localdomain', + 'local.wordpress.test', // VVV pattern. + 'local.wordpress-trunk.test', // VVV pattern. + 'src.wordpress-develop.test', // VVV pattern. + 'build.wordpress-develop.test', // VVV pattern. + ); + if ( in_array( $domain, $forbidden_domains, true ) ) { + return new \WP_Error( + 'fail_domain_forbidden', + sprintf( + /* translators: %1$s is a domain name. */ + __( + 'Domain `%1$s` just failed is_usable_domain check as it is in the forbidden array.', + 'jetpack-connection' + ), + $domain + ) + ); + } + + // No .test or .local domains. + if ( preg_match( '#\.(test|local)$#i', $domain ) ) { + return new \WP_Error( + 'fail_domain_tld', + sprintf( + /* translators: %1$s is a domain name. */ + __( + 'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.', + 'jetpack-connection' + ), + $domain + ) + ); + } + + // No WPCOM subdomains. + if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) { + return new \WP_Error( + 'fail_subdomain_wpcom', + sprintf( + /* translators: %1$s is a domain name. */ + __( + 'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.', + 'jetpack-connection' + ), + $domain + ) + ); + } + + // If PHP was compiled without support for the Filter module (very edge case). + if ( ! function_exists( 'filter_var' ) ) { + // Just pass back true for now, and let wpcom sort it out. + return true; + } + + $domain = preg_replace( '#^https?://#', '', untrailingslashit( $domain ) ); + + if ( filter_var( $domain, FILTER_VALIDATE_IP ) + && ! filter_var( $domain, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) + ) { + return new \WP_Error( + 'fail_ip_forbidden', + sprintf( + /* translators: %1$s is a domain name. */ + __( + 'IP address `%1$s` just failed is_usable_domain check as it is in the private network.', + 'jetpack-connection' + ), + $domain + ) + ); + } + + return true; + } + + /** + * Gets the requested token. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Tokens->get_access_token() instead. + * + * @param int|false $user_id false: Return the Blog Token. int: Return that user's User Token. + * @param string|false $token_key If provided, check that the token matches the provided input. + * @param bool|true $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. + * + * @return object|false + * + * @see $this->get_tokens()->get_access_token() + */ + public function get_access_token( $user_id = false, $token_key = false, $suppress_errors = true ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->get_access_token' ); + return $this->get_tokens()->get_access_token( $user_id, $token_key, $suppress_errors ); + } + + /** + * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths + * since it is passed by reference to various methods. + * Capture it here so we can verify the signature later. + * + * @param array $methods an array of available XMLRPC methods. + * @return array the same array, since this method doesn't add or remove anything. + */ + public function xmlrpc_methods( $methods ) { + $this->raw_post_data = isset( $GLOBALS['HTTP_RAW_POST_DATA'] ) ? $GLOBALS['HTTP_RAW_POST_DATA'] : null; + return $methods; + } + + /** + * Resets the raw post data parameter for testing purposes. + */ + public function reset_raw_post_data() { + $this->raw_post_data = null; + } + + /** + * Registering an additional method. + * + * @param array $methods an array of available XMLRPC methods. + * @return array the amended array in case the method is added. + */ + public function public_xmlrpc_methods( $methods ) { + if ( array_key_exists( 'wp.getOptions', $methods ) ) { + $methods['wp.getOptions'] = array( $this, 'jetpack_get_options' ); + } + return $methods; + } + + /** + * Handles a getOptions XMLRPC method call. + * + * @param array $args method call arguments. + * @return array|IXR_Error An amended XMLRPC server options array. + */ + public function jetpack_get_options( $args ) { + global $wp_xmlrpc_server; + + $wp_xmlrpc_server->escape( $args ); + + $username = $args[1]; + $password = $args[2]; + + $user = $wp_xmlrpc_server->login( $username, $password ); + if ( ! $user ) { + return $wp_xmlrpc_server->error; + } + + $options = array(); + $user_data = $this->get_connected_user_data(); + if ( is_array( $user_data ) ) { + $options['jetpack_user_id'] = array( + 'desc' => __( 'The WP.com user ID of the connected user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['ID'], + ); + $options['jetpack_user_login'] = array( + 'desc' => __( 'The WP.com username of the connected user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['login'], + ); + $options['jetpack_user_email'] = array( + 'desc' => __( 'The WP.com user email of the connected user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['email'], + ); + $options['jetpack_user_site_count'] = array( + 'desc' => __( 'The number of sites of the connected WP.com user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['site_count'], + ); + } + $wp_xmlrpc_server->blog_options = array_merge( $wp_xmlrpc_server->blog_options, $options ); + $args = stripslashes_deep( $args ); + return $wp_xmlrpc_server->wp_getOptions( $args ); + } + + /** + * Adds Jetpack-specific options to the output of the XMLRPC options method. + * + * @param array $options standard Core options. + * @return array amended options. + */ + public function xmlrpc_options( $options ) { + $jetpack_client_id = false; + if ( $this->is_connected() ) { + $jetpack_client_id = \Jetpack_Options::get_option( 'id' ); + } + $options['jetpack_version'] = array( + 'desc' => __( 'Jetpack Plugin Version', 'jetpack-connection' ), + 'readonly' => true, + 'value' => Constants::get_constant( 'JETPACK__VERSION' ), + ); + + $options['jetpack_client_id'] = array( + 'desc' => __( 'The Client ID/WP.com Blog ID of this site', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $jetpack_client_id, + ); + return $options; + } + + /** + * Resets the saved authentication state in between testing requests. + */ + public function reset_saved_auth_state() { + $this->xmlrpc_verification = null; + } + + /** + * Sign a user role with the master access token. + * If not specified, will default to the current user. + * + * @access public + * + * @param string $role User role. + * @param int $user_id ID of the user. + * @return string Signed user role. + */ + public function sign_role( $role, $user_id = null ) { + return $this->get_tokens()->sign_role( $role, $user_id ); + } + + /** + * Set the plugin instance. + * + * @param Plugin $plugin_instance The plugin instance. + * + * @return $this + */ + public function set_plugin_instance( Plugin $plugin_instance ) { + $this->plugin = $plugin_instance; + + return $this; + } + + /** + * Retrieve the plugin management object. + * + * @return Plugin|null + */ + public function get_plugin() { + return $this->plugin; + } + + /** + * Get all connected plugins information, excluding those disconnected by user. + * WARNING: the method cannot be called until Plugin_Storage::configure is called, which happens on plugins_loaded + * Even if you don't use Jetpack Config, it may be introduced later by other plugins, + * so please make sure not to run the method too early in the code. + * + * @return array|WP_Error + */ + public function get_connected_plugins() { + $maybe_plugins = Plugin_Storage::get_all(); + + if ( $maybe_plugins instanceof WP_Error ) { + return $maybe_plugins; + } + + return $maybe_plugins; + } + + /** + * Force plugin disconnect. After its called, the plugin will not be allowed to use the connection. + * Note: this method does not remove any access tokens. + * + * @deprecated since 1.39.0 + * @return bool + */ + public function disable_plugin() { + return null; + } + + /** + * Force plugin reconnect after user-initiated disconnect. + * After its called, the plugin will be allowed to use the connection again. + * Note: this method does not initialize access tokens. + * + * @deprecated since 1.39.0. + * @return bool + */ + public function enable_plugin() { + return null; + } + + /** + * Whether the plugin is allowed to use the connection, or it's been disconnected by user. + * If no plugin slug was passed into the constructor, always returns true. + * + * @deprecated 1.42.0 This method no longer has a purpose after the removal of the soft disconnect feature. + * + * @return bool + */ + public function is_plugin_enabled() { + return true; + } + + /** + * Perform the API request to refresh the blog token. + * Note that we are making this request on behalf of the Jetpack master user, + * given they were (most probably) the ones that registered the site at the first place. + * + * @return WP_Error|bool The result of updating the blog_token option. + */ + public function refresh_blog_token() { + ( new Tracking() )->record_user_event( 'restore_connection_refresh_blog_token' ); + + $blog_id = \Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + return new WP_Error( 'site_not_registered', 'Site not registered.' ); + } + + $url = sprintf( + '%s/%s/v%s/%s', + Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ), + 'wpcom', + '2', + 'sites/' . $blog_id . '/jetpack-refresh-blog-token' + ); + $method = 'POST'; + $user_id = get_current_user_id(); + + $response = Client::remote_request( compact( 'url', 'method', 'user_id' ) ); + + if ( is_wp_error( $response ) ) { + return new WP_Error( 'refresh_blog_token_http_request_failed', $response->get_error_message() ); + } + + $code = wp_remote_retrieve_response_code( $response ); + $entity = wp_remote_retrieve_body( $response ); + + if ( $entity ) { + $json = json_decode( $entity ); + } else { + $json = false; + } + + if ( 200 !== $code ) { + if ( empty( $json->code ) ) { + return new WP_Error( 'unknown', '', $code ); + } + + /* translators: Error description string. */ + $error_description = isset( $json->message ) ? sprintf( __( 'Error Details: %s', 'jetpack-connection' ), (string) $json->message ) : ''; + + return new WP_Error( (string) $json->code, $error_description, $code ); + } + + if ( empty( $json->jetpack_secret ) || ! is_scalar( $json->jetpack_secret ) ) { + return new WP_Error( 'jetpack_secret', '', $code ); + } + + Error_Handler::get_instance()->delete_all_errors(); + + return $this->get_tokens()->update_blog_token( (string) $json->jetpack_secret ); + } + + /** + * Disconnect the user from WP.com, and initiate the reconnect process. + * + * @return bool + */ + public function refresh_user_token() { + ( new Tracking() )->record_user_event( 'restore_connection_refresh_user_token' ); + $this->disconnect_user( null, true, true ); + return true; + } + + /** + * Fetches a signed token. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Tokens->get_signed_token() instead. + * + * @param object $token the token. + * @return WP_Error|string a signed token + */ + public function get_signed_token( $token ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->get_signed_token' ); + return $this->get_tokens()->get_signed_token( $token ); + } + + /** + * If the site-level connection is active, add the list of plugins using connection to the heartbeat (except Jetpack itself) + * + * @param array $stats The Heartbeat stats array. + * @return array $stats + */ + public function add_stats_to_heartbeat( $stats ) { + + if ( ! $this->is_connected() ) { + return $stats; + } + + $active_plugins_using_connection = Plugin_Storage::get_all(); + foreach ( array_keys( $active_plugins_using_connection ) as $plugin_slug ) { + if ( 'jetpack' !== $plugin_slug ) { + $stats_group = isset( $active_plugins_using_connection['jetpack'] ) ? 'combined-connection' : 'standalone-connection'; + $stats[ $stats_group ][] = $plugin_slug; + } + } + return $stats; + } + + /** + * Get the WPCOM or self-hosted site ID. + * + * @param bool $quiet Return null instead of an error. + * + * @return int|WP_Error|null + */ + public static function get_site_id( $quiet = false ) { + $is_wpcom = ( defined( 'IS_WPCOM' ) && IS_WPCOM ); + $site_id = $is_wpcom ? get_current_blog_id() : \Jetpack_Options::get_option( 'id' ); + if ( ! $site_id ) { + return $quiet + ? null + : new \WP_Error( + 'unavailable_site_id', + __( 'Sorry, something is wrong with your Jetpack connection.', 'jetpack-connection' ), + 403 + ); + } + return (int) $site_id; + } + + /** + * Check if Jetpack is ready for uninstall cleanup. + * + * @param string $current_plugin_slug The current plugin's slug. + * + * @return bool + */ + public static function is_ready_for_cleanup( $current_plugin_slug ) { + $active_plugins = get_option( Plugin_Storage::ACTIVE_PLUGINS_OPTION_NAME ); + + return empty( $active_plugins ) || ! is_array( $active_plugins ) + || ( count( $active_plugins ) === 1 && array_key_exists( $current_plugin_slug, $active_plugins ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php new file mode 100644 index 00000000..48e14a15 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php @@ -0,0 +1,212 @@ +db = $wpdb; + } + + /** + * Scheduling the WP-cron cleanup event. + */ + public function init_schedule() { + add_action( 'jetpack_clean_nonces', array( __CLASS__, 'clean_scheduled' ) ); + if ( ! wp_next_scheduled( 'jetpack_clean_nonces' ) ) { + wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' ); + } + } + + /** + * Reschedule the WP-cron cleanup event to make it start sooner. + */ + public function reschedule() { + wp_clear_scheduled_hook( 'jetpack_clean_nonces' ); + wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' ); + } + + /** + * Adds a used nonce to a list of known nonces. + * + * @param int $timestamp the current request timestamp. + * @param string $nonce the nonce value. + * + * @return bool whether the nonce is unique or not. + */ + public function add( $timestamp, $nonce ) { + if ( isset( static::$nonces_used_this_request[ "$timestamp:$nonce" ] ) ) { + return static::$nonces_used_this_request[ "$timestamp:$nonce" ]; + } + + // This should always have gone through Jetpack_Signature::sign_request() first to check $timestamp and $nonce. + $timestamp = (int) $timestamp; + $nonce = esc_sql( $nonce ); + + // Raw query so we can avoid races: add_option will also update. + $show_errors = $this->db->hide_errors(); + + // Running `try...finally` to make sure that we re-enable errors in case of an exception. + try { + $old_nonce = $this->db->get_row( + $this->db->prepare( "SELECT 1 FROM `{$this->db->options}` WHERE option_name = %s", "jetpack_nonce_{$timestamp}_{$nonce}" ) + ); + + if ( $old_nonce === null ) { + $return = (bool) $this->db->query( + $this->db->prepare( + "INSERT INTO `{$this->db->options}` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s)", + "jetpack_nonce_{$timestamp}_{$nonce}", + time(), + 'no' + ) + ); + } else { + $return = false; + } + } finally { + $this->db->show_errors( $show_errors ); + } + + static::$nonces_used_this_request[ "$timestamp:$nonce" ] = $return; + + return $return; + } + + /** + * Removing all existing nonces, or at least as many as possible. + * Capped at 20 seconds to avoid breaking the site. + * + * @param int $cutoff_timestamp All nonces added before this timestamp will be removed. + * @param int $time_limit How long the cleanup can run (in seconds). + * + * @return true + */ + public function clean_all( $cutoff_timestamp = PHP_INT_MAX, $time_limit = 20 ) { + // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed + for ( $end_time = time() + $time_limit; time() < $end_time; ) { + $result = $this->delete( static::CLEAN_ALL_LIMIT_PER_BATCH, $cutoff_timestamp ); + + if ( ! $result ) { + break; + } + } + + return true; + } + + /** + * Scheduled clean up of the expired nonces. + */ + public static function clean_scheduled() { + /** + * Adjust the time limit for the scheduled cleanup. + * + * @since 9.5.0 + * + * @param int $time_limit How long the cleanup can run (in seconds). + */ + $time_limit = apply_filters( 'jetpack_connection_nonce_cleanup_runtime_limit', static::SCHEDULED_CLEANUP_TIME_LIMIT ); + + ( new static() )->clean_all( time() - static::LIFETIME, $time_limit ); + } + + /** + * Delete the nonces. + * + * @param int $limit How many nonces to delete. + * @param null|int $cutoff_timestamp All nonces added before this timestamp will be removed. + * + * @return int|false Number of removed nonces, or `false` if nothing to remove (or in case of a database error). + */ + public function delete( $limit = 10, $cutoff_timestamp = null ) { + global $wpdb; + + $ids = $wpdb->get_col( + $wpdb->prepare( + "SELECT option_id FROM `{$wpdb->options}`" + . " WHERE `option_name` >= 'jetpack_nonce_' AND `option_name` < %s" + . ' LIMIT %d', + 'jetpack_nonce_' . $cutoff_timestamp, + $limit + ) + ); + + if ( ! is_array( $ids ) ) { + // There's an error and we can't proceed. + return false; + } + + // Removing zeroes in case AUTO_INCREMENT of the options table is broken, and all ID's are zeroes. + $ids = array_filter( $ids ); + + if ( array() === $ids ) { + // There's nothing to remove. + return false; + } + + $ids_fill = implode( ', ', array_fill( 0, count( $ids ), '%d' ) ); + + $args = $ids; + $args[] = 'jetpack_nonce_%'; + + // The Code Sniffer is unable to understand what's going on... + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber + return $wpdb->query( $wpdb->prepare( "DELETE FROM `{$wpdb->options}` WHERE `option_id` IN ( {$ids_fill} ) AND option_name LIKE %s", $args ) ); + } + + /** + * Clean the cached nonces valid during the current request, therefore making them invalid. + * + * @return bool + */ + public static function invalidate_request_nonces() { + static::$nonces_used_this_request = array(); + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php new file mode 100644 index 00000000..2d1b3743 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php @@ -0,0 +1,176 @@ +is_rate_limiting() ) { + return; + } + + /** + * Obtains the package versions. + * + * @since 1.30.2 + * + * @param array An associative array of Jetpack package slugs and their corresponding versions as key/value pairs. + */ + $filter_versions = apply_filters( 'jetpack_package_versions', array() ); + + if ( ! is_array( $filter_versions ) ) { + return; + } + + $option_versions = get_option( self::PACKAGE_VERSION_OPTION, array() ); + + foreach ( $filter_versions as $package => $version ) { + if ( ! is_string( $package ) || ! is_string( $version ) ) { + unset( $filter_versions[ $package ] ); + } + } + + if ( ! is_array( $option_versions ) + || count( array_diff_assoc( $filter_versions, $option_versions ) ) + || count( array_diff_assoc( $option_versions, $filter_versions ) ) + ) { + $this->update_package_versions_option( $filter_versions ); + } + } + + /** + * Updates the package versions option. + * + * @param array $package_versions The package versions. + */ + protected function update_package_versions_option( $package_versions ) { + if ( ! $this->is_sync_enabled() ) { + $this->update_package_versions_via_remote_request( $package_versions ); + return; + } + + update_option( self::PACKAGE_VERSION_OPTION, $package_versions ); + } + + /** + * Whether Jetpack Sync is enabled. + * + * @return boolean true if Sync is present and enabled, false otherwise + */ + protected function is_sync_enabled() { + if ( class_exists( 'Automattic\Jetpack\Sync\Settings' ) && \Automattic\Jetpack\Sync\Settings::is_sync_enabled() ) { + + return true; + } + + return false; + } + + /** + * Fallback for updating the package versions via a remote request when Sync is not present. + * + * Updates the package versions as follows: + * - Sends the updated package versions to wpcom. + * - Updates the 'jetpack_package_versions' option. + * + * @param array $package_versions The package versions. + */ + protected function update_package_versions_via_remote_request( $package_versions ) { + $connection = new Manager(); + if ( ! $connection->is_connected() ) { + return; + } + + $site_id = \Jetpack_Options::get_option( 'id' ); + + $last_failed_attempt_within_hour = get_transient( self::CACHED_FAILED_REQUEST_KEY ); + + if ( $last_failed_attempt_within_hour ) { + return; + } + + $body = wp_json_encode( + array( + 'package_versions' => $package_versions, + ) + ); + + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%d/jetpack-package-versions', $site_id ), + '2', + array( + 'headers' => array( 'content-type' => 'application/json' ), + 'method' => 'POST', + ), + $body, + 'wpcom' + ); + + if ( 200 === wp_remote_retrieve_response_code( $response ) ) { + update_option( self::PACKAGE_VERSION_OPTION, $package_versions ); + } else { + set_transient( self::CACHED_FAILED_REQUEST_KEY, time(), self::CACHED_FAILED_REQUEST_EXPIRATION ); + } + } + + /** + * Check if version check is being rate limited, and update the rate limiting transient if needed. + * + * @return bool + */ + private function is_rate_limiting() { + if ( get_transient( static::RATE_LIMITER_KEY ) ) { + return true; + } + + set_transient( static::RATE_LIMITER_KEY, time(), static::RATE_LIMITER_TIMEOUT ); + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php new file mode 100644 index 00000000..253aa0ab --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php @@ -0,0 +1,30 @@ + array( + 'name' => 'IONOS', + 'logo' => array( + 'src' => '/images/ionos-logo.jpg', + 'width' => 119, + 'height' => 32, + ), + ), + ); + + /** + * A list of supported presets. + * + * @var array + */ + private static $supported_presets = array( + 'IONA' => 'jetpack_backup_daily', + ); + + /** + * Get singleton instance of class. + * + * @return Partner_Coupon + */ + public static function get_instance() { + if ( self::$instance === null ) { + self::$instance = new Partner_Coupon( array( Connection_Client::class, 'wpcom_json_api_request_as_blog' ) ); + } + + return self::$instance; + } + + /** + * Constructor. + * + * @param callable $request_as_blog Callable that executes a blog-authenticated request. + */ + public function __construct( $request_as_blog ) { + $this->request_as_blog = $request_as_blog; + } + + /** + * Register hooks to catch and purge coupon. + * + * @param string $plugin_slug The plugin slug to differentiate between Jetpack connections. + * @param string $redirect_location The location we should redirect to after catching the coupon. + */ + public static function register_coupon_admin_hooks( $plugin_slug, $redirect_location ) { + $instance = self::get_instance(); + + // We have to use an anonymous function, so we can pass along relevant information + // and not have to hardcode values for a single plugin. + // This open up the opportunity for e.g. the "all-in-one" and backup plugins + // to both implement partner coupon logic. + add_action( + 'admin_init', + function () use ( $plugin_slug, $redirect_location, $instance ) { + $instance->catch_coupon( $plugin_slug, $redirect_location ); + $instance->maybe_purge_coupon( $plugin_slug ); + } + ); + } + + /** + * Catch partner coupon and redirect to claim component. + * + * @param string $plugin_slug The plugin slug to differentiate between Jetpack connections. + * @param string $redirect_location The location we should redirect to after catching the coupon. + */ + public function catch_coupon( $plugin_slug, $redirect_location ) { + // Accept and store a partner coupon if present, and redirect to Jetpack connection screen. + $partner_coupon = isset( $_GET['jetpack-partner-coupon'] ) ? sanitize_text_field( wp_unslash( $_GET['jetpack-partner-coupon'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( $partner_coupon ) { + Jetpack_Options::update_options( + array( + self::$coupon_option => $partner_coupon, + self::$added_option => time(), + ) + ); + + $connection = new Connection_Manager( $plugin_slug ); + if ( $connection->is_connected() ) { + $redirect_location = add_query_arg( array( 'showCouponRedemption' => 1 ), $redirect_location ); + wp_safe_redirect( $redirect_location ); + } else { + wp_safe_redirect( $redirect_location ); + } + } + } + + /** + * Purge partner coupon. + * + * We try to remotely check if a coupon looks valid. We also automatically purge + * partner coupons after a certain amount of time to prevent unnecessary look-ups + * and/or promoting a product for months or years in the future due to unknown + * errors. + * + * @param string $plugin_slug The plugin slug to differentiate between Jetpack connections. + */ + public function maybe_purge_coupon( $plugin_slug ) { + // Only run coupon checks on Jetpack admin pages. + // The "admin-ui" package is responsible for registering the Jetpack admin + // page for all Jetpack plugins and has hardcoded the settings page to be + // "jetpack", so we shouldn't need to allow for dynamic/custom values. + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['page'] ) || 'jetpack' !== $_GET['page'] ) { + return; + } + + if ( ( new Status() )->is_offline_mode() ) { + return; + } + + $connection = new Connection_Manager( $plugin_slug ); + if ( ! $connection->is_connected() ) { + return; + } + + if ( $this->maybe_purge_coupon_by_added_date() ) { + return; + } + + // Limit checks to happen once a minute at most. + if ( get_transient( self::$last_check_transient ) ) { + return; + } + + set_transient( self::$last_check_transient, true, MINUTE_IN_SECONDS ); + + $this->maybe_purge_coupon_by_availability_check(); + } + + /** + * Purge coupon based on local added date. + * + * We automatically remove the coupon after a month to "self-heal" if + * something in the claim process has broken with the site. + * + * @return bool Return whether we should skip further purge checks. + */ + protected function maybe_purge_coupon_by_added_date() { + $date = Jetpack_Options::get_option( self::$added_option, '' ); + + if ( empty( $date ) ) { + return true; + } + + $expire_date = strtotime( '+30 days', $date ); + $today = time(); + + if ( $today >= $expire_date ) { + $this->delete_coupon_data(); + + return true; + } + + return false; + } + + /** + * Purge coupon based on availability check. + * + * @return bool Return whether we deleted coupon data. + */ + protected function maybe_purge_coupon_by_availability_check() { + $blog_id = Jetpack_Options::get_option( 'id', false ); + + if ( ! $blog_id ) { + return false; + } + + $coupon = self::get_coupon(); + + if ( ! $coupon ) { + return false; + } + + $response = call_user_func_array( + $this->request_as_blog, + array( + add_query_arg( + array( 'coupon_code' => $coupon['coupon_code'] ), + sprintf( + '/sites/%d/jetpack-partner/coupon/v1/site/coupon', + $blog_id + ) + ), + 2, + array( 'method' => 'GET' ), + null, + 'wpcom', + ) + ); + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + + if ( + 200 === wp_remote_retrieve_response_code( $response ) && + is_array( $body ) && + isset( $body['available'] ) && + false === $body['available'] + ) { + $this->delete_coupon_data(); + + return true; + } + + return false; + } + + /** + * Delete all coupon data. + */ + protected function delete_coupon_data() { + Jetpack_Options::delete_option( + array( + self::$coupon_option, + self::$added_option, + ) + ); + } + + /** + * Get partner coupon data. + * + * @return array|bool + */ + public static function get_coupon() { + $coupon_code = Jetpack_Options::get_option( self::$coupon_option, '' ); + + if ( ! is_string( $coupon_code ) || empty( $coupon_code ) ) { + return false; + } + + $instance = self::get_instance(); + $partner = $instance->get_coupon_partner( $coupon_code ); + + if ( ! $partner ) { + return false; + } + + $preset = $instance->get_coupon_preset( $coupon_code ); + + if ( ! $preset ) { + return false; + } + + $product = $instance->get_coupon_product( $preset ); + + if ( ! $product ) { + return false; + } + + return array( + 'coupon_code' => $coupon_code, + 'partner' => $partner, + 'preset' => $preset, + 'product' => $product, + ); + } + + /** + * Get coupon partner. + * + * @param string $coupon_code Coupon code to go through. + * @return array|bool + */ + private function get_coupon_partner( $coupon_code ) { + if ( ! is_string( $coupon_code ) || false === strpos( $coupon_code, '_' ) ) { + return false; + } + + $prefix = strtok( $coupon_code, '_' ); + $supported_partners = $this->get_supported_partners(); + + if ( ! isset( $supported_partners[ $prefix ] ) ) { + return false; + } + + return array( + 'name' => $supported_partners[ $prefix ]['name'], + 'prefix' => $prefix, + 'logo' => isset( $supported_partners[ $prefix ]['logo'] ) ? $supported_partners[ $prefix ]['logo'] : null, + ); + } + + /** + * Get coupon product. + * + * @param string $coupon_preset The preset we wish to find a product for. + * @return array|bool + */ + private function get_coupon_product( $coupon_preset ) { + if ( ! is_string( $coupon_preset ) ) { + return false; + } + + /** + * Allow for plugins to register supported products. + * + * @since 1.6.0 + * + * @param array A list of product details. + * @return array + */ + $product_details = apply_filters( 'jetpack_partner_coupon_products', array() ); + $product_slug = $this->get_supported_presets()[ $coupon_preset ]; + + foreach ( $product_details as $product ) { + if ( ! $this->array_keys_exist( array( 'title', 'slug', 'description', 'features' ), $product ) ) { + continue; + } + + if ( $product_slug === $product['slug'] ) { + return $product; + } + } + + return false; + } + + /** + * Checks if multiple keys are present in an array. + * + * @param array $needles The keys we wish to check for. + * @param array $haystack The array we want to compare keys against. + * + * @return bool + */ + private function array_keys_exist( $needles, $haystack ) { + foreach ( $needles as $needle ) { + if ( ! isset( $haystack[ $needle ] ) ) { + return false; + } + } + + return true; + } + + /** + * Get coupon preset. + * + * @param string $coupon_code Coupon code to go through. + * @return string|bool + */ + private function get_coupon_preset( $coupon_code ) { + if ( ! is_string( $coupon_code ) ) { + return false; + } + + $regex = '/^.*?_(?P.*?)_.+$/'; + $matches = array(); + + if ( ! preg_match( $regex, $coupon_code, $matches ) ) { + return false; + } + + return isset( $this->get_supported_presets()[ $matches['slug'] ] ) ? $matches['slug'] : false; + } + + /** + * Get supported partners. + * + * @return array + */ + private function get_supported_partners() { + /** + * Allow external code to add additional supported partners. + * + * @since partner-1.6.0 + * @since 2.0.0 + * + * @param array $supported_partners A list of supported partners. + * @return array + */ + return apply_filters( 'jetpack_partner_coupon_supported_partners', self::$supported_partners ); + } + + /** + * Get supported presets. + * + * @return array + */ + private function get_supported_presets() { + /** + * Allow external code to add additional supported presets. + * + * @since partner-1.6.0 + * @since 2.0.0 + * + * @param array $supported_presets A list of supported presets. + * @return array + */ + return apply_filters( 'jetpack_partner_coupon_supported_presets', self::$supported_presets ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php new file mode 100644 index 00000000..cfb7bb7e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php @@ -0,0 +1,215 @@ +add_code_as_query_arg( self::SUBSIDIARY_CODE, $url ); + } + + /** + * Adds the affiliate code to the passed URL. + * + * @param string $url The URL. + * + * @return string + */ + public function add_affiliate_code_as_query_arg( $url ) { + return $this->add_code_as_query_arg( self::AFFILIATE_CODE, $url ); + } + + /** + * Adds the partner subsidiary code to the passed array. + * + * @since partner-1.5.0 + * @since 2.0.0 + * + * @param array $params The parameters array. + * + * @return array + */ + public function add_subsidiary_id_to_params_array( $params ) { + if ( ! is_array( $params ) ) { + return $params; + } + return array_merge( $params, $this->get_code_as_array( self::SUBSIDIARY_CODE ) ); + } + + /** + * Adds the affiliate code to the passed array. + * + * @since partner-1.5.0 + * @since 2.0.0 + * + * @param array $params The parameters array. + * + * @return array + */ + public function add_affiliate_code_to_params_array( $params ) { + if ( ! is_array( $params ) ) { + return $params; + } + return array_merge( $params, $this->get_code_as_array( self::AFFILIATE_CODE ) ); + } + + /** + * Returns the passed URL with the partner code added as a URL query arg. + * + * @since partner-1.0.0 + * @since 2.0.0 + * + * @param string $type The partner code. + * @param string $url The URL where the partner subsidiary id will be added. + * + * @return string The passed URL with the partner code added. + */ + public function add_code_as_query_arg( $type, $url ) { + return add_query_arg( $this->get_code_as_array( $type ), $url ); + } + + /** + * Gets the partner code in an associative array format + * + * @since partner-1.5.0 + * @since 2.0.0 + * + * @param string $type The partner code. + * @return array + */ + private function get_code_as_array( $type ) { + switch ( $type ) { + case self::AFFILIATE_CODE: + $query_arg_name = 'aff'; + break; + case self::SUBSIDIARY_CODE: + $query_arg_name = 'subsidiaryId'; + break; + default: + return array(); + } + + $code = $this->get_partner_code( $type ); + + if ( '' === $code ) { + return array(); + } + + return array( $query_arg_name => $code ); + } + + /** + * Returns a partner code. + * + * @since partner-1.0.0 + * @since 2.0.0 + * + * @param string $type This can be either 'affiliate' or 'subsidiary'. Returns empty string when code is unknown. + * + * @return string The partner code. + */ + public function get_partner_code( $type ) { + switch ( $type ) { + case self::AFFILIATE_CODE: + /** + * Allow to filter the affiliate code. + * + * @since partner-1.0.0 + * @since-jetpack 6.9.0 + * @since 2.0.0 + * + * @param string $affiliate_code The affiliate code, blank by default. + */ + return apply_filters( 'jetpack_affiliate_code', get_option( 'jetpack_affiliate_code', '' ) ); + case self::SUBSIDIARY_CODE: + /** + * Allow to filter the partner subsidiary id. + * + * @since partner-1.0.0 + * @since 2.0.0 + * + * @param string $subsidiary_id The partner subsidiary id, blank by default. + */ + return apply_filters( + 'jetpack_partner_subsidiary_id', + get_option( 'jetpack_partner_subsidiary_id', '' ) + ); + default: + return ''; + } + } + + /** + * Resets the singleton for testing purposes. + */ + public static function reset() { + self::$instance = null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php new file mode 100644 index 00000000..21d9402b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php @@ -0,0 +1,306 @@ +is_connected() ) { + return; + } + + $site_id = \Jetpack_Options::get_option( 'id' ); + + $body = wp_json_encode( + array( + 'active_connected_plugins' => self::$plugins, + ) + ); + + Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%d/jetpack-active-connected-plugins', $site_id ), + '2', + array( + 'headers' => array( 'content-type' => 'application/json' ), + 'method' => 'POST', + ), + $body, + 'wpcom' + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php new file mode 100644 index 00000000..10b5c7b9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php @@ -0,0 +1,122 @@ +slug = $slug; + } + + /** + * Get the plugin slug. + * + * @return string + */ + public function get_slug() { + return $this->slug; + } + + /** + * Add the plugin connection info into Jetpack. + * + * @param string $name Plugin name, required. + * @param array $args Plugin arguments, optional. + * + * @return $this + * @see $this->arguments_whitelist + */ + public function add( $name, array $args = array() ) { + $args = compact( 'name' ) + array_intersect_key( $args, array_flip( $this->arguments_whitelist ) ); + + Plugin_Storage::upsert( $this->slug, $args ); + + return $this; + } + + /** + * Remove the plugin connection info from Jetpack. + * + * @return $this + */ + public function remove() { + Plugin_Storage::delete( $this->slug ); + + return $this; + } + + /** + * Determine if this plugin connection is the only one active at the moment, if any. + * + * @return bool + */ + public function is_only() { + $plugins = Plugin_Storage::get_all(); + + return ! $plugins || ( array_key_exists( $this->slug, $plugins ) && 1 === count( $plugins ) ); + } + + /** + * Add the plugin to the set of disconnected ones. + * + * @deprecated since 1.39.0. + * + * @return bool + */ + public function disable() { + return true; + } + + /** + * Remove the plugin from the set of disconnected ones. + * + * @deprecated since 1.39.0. + * + * @return bool + */ + public function enable() { + return true; + } + + /** + * Whether this plugin is allowed to use the connection. + * + * @deprecated since 11.0 + * @return bool + */ + public function is_enabled() { + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php new file mode 100644 index 00000000..196a0991 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php @@ -0,0 +1,222 @@ +connection_manager = new Manager(); + } + + /** + * Controls the single instance of this class. + * + * @static + */ + public static function init() { + if ( ! self::$instance ) { + self::$instance = new self(); + + add_filter( 'determine_current_user', array( self::$instance, 'wp_rest_authenticate' ) ); + add_filter( 'rest_authentication_errors', array( self::$instance, 'wp_rest_authentication_errors' ) ); + } + + return self::$instance; + } + + /** + * Authenticates requests from Jetpack server to WP REST API endpoints. + * Uses the existing XMLRPC request signing implementation. + * + * @param int|bool $user User ID if one has been determined, false otherwise. + * + * @return int|null The user id or null if the request was authenticated via blog token, or not authenticated at all. + */ + public function wp_rest_authenticate( $user ) { + if ( $this->doing_determine_current_user_filter ) { + return $user; + } + + $this->doing_determine_current_user_filter = true; + + try { + if ( ! empty( $user ) ) { + // Another authentication method is in effect. + return $user; + } + + add_filter( + 'jetpack_constant_default_value', + __NAMESPACE__ . '\Utils::jetpack_api_constant_filter', + 10, + 2 + ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['_for'] ) || 'jetpack' !== $_GET['_for'] ) { + // Nothing to do for this authentication method. + return null; + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['token'] ) && ! isset( $_GET['signature'] ) ) { + // Nothing to do for this authentication method. + return null; + } + + if ( ! isset( $_SERVER['REQUEST_METHOD'] ) ) { + $this->rest_authentication_status = new WP_Error( + 'rest_invalid_request', + __( 'The request method is missing.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } + + // Only support specific request parameters that have been tested and + // are known to work with signature verification. A different method + // can be passed to the WP REST API via the '?_method=' parameter if + // needed. + if ( 'GET' !== $_SERVER['REQUEST_METHOD'] && 'POST' !== $_SERVER['REQUEST_METHOD'] ) { + $this->rest_authentication_status = new WP_Error( + 'rest_invalid_request', + __( 'This request method is not supported.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } + if ( 'POST' !== $_SERVER['REQUEST_METHOD'] && ! empty( file_get_contents( 'php://input' ) ) ) { + $this->rest_authentication_status = new WP_Error( + 'rest_invalid_request', + __( 'This request method does not support body parameters.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } + + $verified = $this->connection_manager->verify_xml_rpc_signature(); + + if ( + $verified && + isset( $verified['type'] ) && + 'blog' === $verified['type'] + ) { + // Site-level authentication successful. + $this->rest_authentication_status = true; + $this->rest_authentication_type = 'blog'; + return null; + } + + if ( + $verified && + isset( $verified['type'] ) && + 'user' === $verified['type'] && + ! empty( $verified['user_id'] ) + ) { + // User-level authentication successful. + $this->rest_authentication_status = true; + $this->rest_authentication_type = 'user'; + return $verified['user_id']; + } + + // Something else went wrong. Probably a signature error. + $this->rest_authentication_status = new WP_Error( + 'rest_invalid_signature', + __( 'The request is not signed correctly.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } finally { + $this->doing_determine_current_user_filter = false; + } + } + + /** + * Report authentication status to the WP REST API. + * + * @param WP_Error|mixed $value Error from another authentication handler, null if we should handle it, or another value if not. + * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} + */ + public function wp_rest_authentication_errors( $value ) { + if ( null !== $value ) { + return $value; + } + return $this->rest_authentication_status; + } + + /** + * Resets the saved authentication state in between testing requests. + */ + public function reset_saved_auth_state() { + $this->rest_authentication_status = null; + $this->connection_manager->reset_saved_auth_state(); + } + + /** + * Whether the request was signed with a blog token. + * + * @since 1.29.0 + * + * @return bool True if the request was signed with a valid blog token, false otherwise. + */ + public static function is_signed_with_blog_token() { + $instance = self::init(); + + return true === $instance->rest_authentication_status && 'blog' === $instance->rest_authentication_type; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php new file mode 100644 index 00000000..b99f981e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php @@ -0,0 +1,1024 @@ +connection = $connection; + + self::$user_permissions_error_msg = esc_html__( + 'You do not have the correct user permissions to perform this action. + Please contact your site admin if you think this is a mistake.', + 'jetpack-connection' + ); + + $jp_version = Constants::get_constant( 'JETPACK__VERSION' ); + + if ( ! $this->connection->has_connected_owner() ) { + // Register a site. + register_rest_route( + 'jetpack/v4', + '/verify_registration', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'verify_registration' ), + 'permission_callback' => '__return_true', + ) + ); + } + + // Authorize a remote user. + register_rest_route( + 'jetpack/v4', + '/remote_authorize', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::remote_authorize', + 'permission_callback' => '__return_true', + ) + ); + + // Authorize a remote user. + register_rest_route( + 'jetpack/v4', + '/remote_provision', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'remote_provision' ), + 'permission_callback' => array( $this, 'remote_provision_permission_check' ), + ) + ); + + register_rest_route( + 'jetpack/v4', + '/remote_register', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'remote_register' ), + 'permission_callback' => array( $this, 'remote_register_permission_check' ), + ) + ); + + // Connect a remote user. + register_rest_route( + 'jetpack/v4', + '/remote_connect', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'remote_connect' ), + 'permission_callback' => array( $this, 'remote_connect_permission_check' ), + ) + ); + + // The endpoint verifies blog connection and blog token validity. + register_rest_route( + 'jetpack/v4', + '/connection/check', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'connection_check' ), + 'permission_callback' => array( $this, 'connection_check_permission_check' ), + ) + ); + + // Get current connection status of Jetpack. + register_rest_route( + 'jetpack/v4', + '/connection', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::connection_status', + 'permission_callback' => '__return_true', + ) + ); + + // Disconnect site. + register_rest_route( + 'jetpack/v4', + '/connection', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::disconnect_site', + 'permission_callback' => __CLASS__ . '::disconnect_site_permission_check', + 'args' => array( + 'isActive' => array( + 'description' => __( 'Set to false will trigger the site to disconnect.', 'jetpack-connection' ), + 'validate_callback' => function ( $value ) { + if ( false !== $value ) { + return new WP_Error( + 'rest_invalid_param', + __( 'The isActive argument should be set to false.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + return true; + }, + 'required' => true, + ), + ), + ) + ); + + // We are only registering this route if Jetpack-the-plugin is not active or it's version is ge 10.0-alpha. + // The reason for doing so is to avoid conflicts between the Connection package and + // older versions of Jetpack, registering the same route twice. + if ( empty( $jp_version ) || version_compare( $jp_version, '10.0-alpha', '>=' ) ) { + // Get current user connection data. + register_rest_route( + 'jetpack/v4', + '/connection/data', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_user_connection_data', + 'permission_callback' => __CLASS__ . '::user_connection_data_permission_check', + ) + ); + } + + // Get list of plugins that use the Jetpack connection. + register_rest_route( + 'jetpack/v4', + '/connection/plugins', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( __CLASS__, 'get_connection_plugins' ), + 'permission_callback' => __CLASS__ . '::connection_plugins_permission_check', + ) + ); + + // Full or partial reconnect in case of connection issues. + register_rest_route( + 'jetpack/v4', + '/connection/reconnect', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'connection_reconnect' ), + 'permission_callback' => __CLASS__ . '::jetpack_reconnect_permission_check', + ) + ); + + // Register the site (get `blog_token`). + register_rest_route( + 'jetpack/v4', + '/connection/register', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'connection_register' ), + 'permission_callback' => __CLASS__ . '::jetpack_register_permission_check', + 'args' => array( + 'from' => array( + 'description' => __( 'Indicates where the registration action was triggered for tracking/segmentation purposes', 'jetpack-connection' ), + 'type' => 'string', + ), + 'registration_nonce' => array( + 'description' => __( 'The registration nonce', 'jetpack-connection' ), + 'type' => 'string', + 'required' => true, + ), + 'redirect_uri' => array( + 'description' => __( 'URI of the admin page where the user should be redirected after connection flow', 'jetpack-connection' ), + 'type' => 'string', + ), + 'plugin_slug' => array( + 'description' => __( 'Indicates from what plugin the request is coming from', 'jetpack-connection' ), + 'type' => 'string', + ), + ), + ) + ); + + // Get authorization URL. + register_rest_route( + 'jetpack/v4', + '/connection/authorize_url', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'connection_authorize_url' ), + 'permission_callback' => __CLASS__ . '::user_connection_data_permission_check', + 'args' => array( + 'redirect_uri' => array( + 'description' => __( 'URI of the admin page where the user should be redirected after connection flow', 'jetpack-connection' ), + 'type' => 'string', + ), + ), + ) + ); + + register_rest_route( + 'jetpack/v4', + '/user-token', + array( + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( static::class, 'update_user_token' ), + 'permission_callback' => array( static::class, 'update_user_token_permission_check' ), + 'args' => array( + 'user_token' => array( + 'description' => __( 'New user token', 'jetpack-connection' ), + 'type' => 'string', + 'required' => true, + ), + 'is_connection_owner' => array( + 'description' => __( 'Is connection owner', 'jetpack-connection' ), + 'type' => 'boolean', + ), + ), + ), + ) + ); + + // Set the connection owner. + register_rest_route( + 'jetpack/v4', + '/connection/owner', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( static::class, 'set_connection_owner' ), + 'permission_callback' => array( static::class, 'set_connection_owner_permission_check' ), + 'args' => array( + 'owner' => array( + 'description' => __( 'New owner', 'jetpack-connection' ), + 'type' => 'integer', + 'required' => true, + ), + ), + ) + ); + } + + /** + * Handles verification that a site is registered. + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return string|WP_Error + */ + public function verify_registration( WP_REST_Request $request ) { + $registration_data = array( $request['secret_1'], $request['state'] ); + + return $this->connection->handle_registration( $registration_data ); + } + + /** + * Handles verification that a site is registered + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return array|WP_Error + */ + public static function remote_authorize( $request ) { + $xmlrpc_server = new Jetpack_XMLRPC_Server(); + $result = $xmlrpc_server->remote_authorize( $request ); + + if ( is_a( $result, 'IXR_Error' ) ) { + $result = new WP_Error( $result->code, $result->message ); + } + + return $result; + } + + /** + * Initiate the site provisioning process. + * + * @since 2.5.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return WP_Error|array + */ + public static function remote_provision( WP_REST_Request $request ) { + $xmlrpc_server = new Jetpack_XMLRPC_Server(); + $result = $xmlrpc_server->remote_provision( $request ); + + if ( is_a( $result, 'IXR_Error' ) ) { + $result = new WP_Error( $result->code, $result->message ); + } + + return $result; + } + + /** + * Connect a remote user. + * + * @since 2.6.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return WP_Error|array + */ + public static function remote_connect( WP_REST_Request $request ) { + $xmlrpc_server = new Jetpack_XMLRPC_Server(); + $result = $xmlrpc_server->remote_connect( $request ); + + if ( is_a( $result, 'IXR_Error' ) ) { + $result = new WP_Error( $result->code, $result->message ); + } + + return $result; + } + + /** + * Register the site so that a plan can be provisioned. + * + * @since 2.5.0 + * + * @param WP_REST_Request $request The request object. + * + * @return WP_Error|array + */ + public function remote_register( WP_REST_Request $request ) { + $xmlrpc_server = new Jetpack_XMLRPC_Server(); + $result = $xmlrpc_server->remote_register( $request ); + + if ( is_a( $result, 'IXR_Error' ) ) { + $result = new WP_Error( $result->code, $result->message ); + } + + return $result; + } + + /** + * Remote provision endpoint permission check. + * + * @return true|WP_Error + */ + public function remote_provision_permission_check() { + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( 'invalid_permission_remote_provision', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Remote connect endpoint permission check. + * + * @return true|WP_Error + */ + public function remote_connect_permission_check() { + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( 'invalid_permission_remote_connect', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Remote register endpoint permission check. + * + * @return true|WP_Error + */ + public function remote_register_permission_check() { + if ( $this->connection->has_connected_owner() ) { + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( 'already_registered', __( 'Blog is already registered', 'jetpack-connection' ), 400 ); + } + + return true; + } + + /** + * Get connection status for this Jetpack site. + * + * @since 1.7.0 + * @since-jetpack 4.3.0 + * + * @param bool $rest_response Should we return a rest response or a simple array. Default to rest response. + * + * @return WP_REST_Response|array Connection information. + */ + public static function connection_status( $rest_response = true ) { + $status = new Status(); + $connection = new Manager(); + + $connection_status = array( + 'isActive' => $connection->has_connected_owner(), // TODO deprecate this. + 'isStaging' => $status->in_safe_mode(), // TODO deprecate this. + 'isRegistered' => $connection->is_connected(), + 'isUserConnected' => $connection->is_user_connected(), + 'hasConnectedOwner' => $connection->has_connected_owner(), + 'offlineMode' => array( + 'isActive' => $status->is_offline_mode(), + 'constant' => defined( 'JETPACK_DEV_DEBUG' ) && JETPACK_DEV_DEBUG, + 'url' => $status->is_local_site(), + /** This filter is documented in packages/status/src/class-status.php */ + 'filter' => ( apply_filters( 'jetpack_development_mode', false ) || apply_filters( 'jetpack_offline_mode', false ) ), // jetpack_development_mode is deprecated. + 'wpLocalConstant' => defined( 'WP_LOCAL_DEV' ) && WP_LOCAL_DEV, + ), + 'isPublic' => '1' == get_option( 'blog_public' ), // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual + ); + + /** + * Filters the connection status data. + * + * @since 1.25.0 + * + * @param array An array containing the connection status data. + */ + $connection_status = apply_filters( 'jetpack_connection_status', $connection_status ); + + if ( $rest_response ) { + return rest_ensure_response( + $connection_status + ); + } else { + return $connection_status; + } + } + + /** + * Get plugins connected to the Jetpack. + * + * @param bool $rest_response Should we return a rest response or a simple array. Default to rest response. + * + * @since 1.13.1 + * @since 1.38.0 Added $rest_response param. + * + * @return WP_REST_Response|WP_Error Response or error object, depending on the request result. + */ + public static function get_connection_plugins( $rest_response = true ) { + $plugins = ( new Manager() )->get_connected_plugins(); + + if ( is_wp_error( $plugins ) ) { + return $plugins; + } + + array_walk( + $plugins, + function ( &$data, $slug ) { + $data['slug'] = $slug; + } + ); + + if ( $rest_response ) { + return rest_ensure_response( array_values( $plugins ) ); + } + + return array_values( $plugins ); + } + + /** + * Verify that user can view Jetpack admin page and can activate plugins. + * + * @since 1.15.0 + * + * @return bool|WP_Error Whether user has the capability 'activate_plugins'. + */ + public static function activate_plugins_permission_check() { + if ( current_user_can( 'activate_plugins' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_activate_plugins', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Permission check for the connection_plugins endpoint + * + * @return bool|WP_Error + */ + public static function connection_plugins_permission_check() { + if ( true === static::activate_plugins_permission_check() ) { + return true; + } + + if ( true === static::is_request_signed_by_jetpack_debugger() ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_activate_plugins', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Permission check for the disconnect site endpoint. + * + * @since 1.30.1 + * + * @return bool|WP_Error True if user is able to disconnect the site. + */ + public static function disconnect_site_permission_check() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + return true; + } + + return new WP_Error( + 'invalid_user_permission_jetpack_disconnect', + self::get_user_permissions_error_msg(), + array( 'status' => rest_authorization_required_code() ) + ); + } + + /** + * Get miscellaneous user data related to the connection. Similar data available in old "My Jetpack". + * Information about the master/primary user. + * Information about the current user. + * + * @param bool $rest_response Should we return a rest response or a simple array. Default to rest response. + * + * @since 1.30.1 + * + * @return \WP_REST_Response|array + */ + public static function get_user_connection_data( $rest_response = true ) { + $blog_id = \Jetpack_Options::get_option( 'id' ); + + $connection = new Manager(); + + $current_user = wp_get_current_user(); + $connection_owner = $connection->get_connection_owner(); + + $owner_display_name = false === $connection_owner ? null : $connection_owner->display_name; + + $is_user_connected = $connection->is_user_connected(); + $is_master_user = false === $connection_owner ? false : ( $current_user->ID === $connection_owner->ID ); + $wpcom_user_data = $connection->get_connected_user_data(); + + // Add connected user gravatar to the returned wpcom_user_data. + // Probably we shouldn't do this when $wpcom_user_data is false, but we have been since 2016 so + // clients probably expect that by now. + if ( false === $wpcom_user_data ) { + $wpcom_user_data = array(); + } + $wpcom_user_data['avatar'] = ( ! empty( $wpcom_user_data['email'] ) ? + get_avatar_url( + $wpcom_user_data['email'], + array( + 'size' => 64, + 'default' => 'mysteryman', + ) + ) + : false ); + + $current_user_connection_data = array( + 'isConnected' => $is_user_connected, + 'isMaster' => $is_master_user, + 'username' => $current_user->user_login, + 'id' => $current_user->ID, + 'blogId' => $blog_id, + 'wpcomUser' => $wpcom_user_data, + 'gravatar' => get_avatar_url( $current_user->ID, 64, 'mm', '', array( 'force_display' => true ) ), + 'permissions' => array( + 'connect' => current_user_can( 'jetpack_connect' ), + 'connect_user' => current_user_can( 'jetpack_connect_user' ), + 'disconnect' => current_user_can( 'jetpack_disconnect' ), + ), + ); + + /** + * Filters the current user connection data. + * + * @since 1.30.1 + * + * @param array An array containing the current user connection data. + */ + $current_user_connection_data = apply_filters( 'jetpack_current_user_connection_data', $current_user_connection_data ); + + $response = array( + 'currentUser' => $current_user_connection_data, + 'connectionOwner' => $owner_display_name, + ); + + if ( $rest_response ) { + return rest_ensure_response( $response ); + } + + return $response; + } + + /** + * Permission check for the connection/data endpoint + * + * @return bool|WP_Error + */ + public static function user_connection_data_permission_check() { + if ( current_user_can( 'jetpack_connect_user' ) ) { + return true; + } + + return new WP_Error( + 'invalid_user_permission_user_connection_data', + self::get_user_permissions_error_msg(), + array( 'status' => rest_authorization_required_code() ) + ); + } + + /** + * Verifies if the request was signed with the Jetpack Debugger key + * + * @param string|null $pub_key The public key used to verify the signature. Default is the Jetpack Debugger key. This is used for testing purposes. + * + * @return bool + */ + public static function is_request_signed_by_jetpack_debugger( $pub_key = null ) { + // phpcs:disable WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['signature'] ) || ! isset( $_GET['timestamp'] ) || ! isset( $_GET['url'] ) || ! isset( $_GET['rest_route'] ) ) { + return false; + } + + // signature timestamp must be within 5min of current time. + if ( abs( time() - (int) $_GET['timestamp'] ) > 300 ) { + return false; + } + + $signature = base64_decode( filter_var( wp_unslash( $_GET['signature'] ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + + $signature_data = wp_json_encode( + array( + 'rest_route' => filter_var( wp_unslash( $_GET['rest_route'] ) ), + 'timestamp' => (int) $_GET['timestamp'], + 'url' => filter_var( wp_unslash( $_GET['url'] ) ), + ) + ); + + if ( + ! function_exists( 'openssl_verify' ) + || 1 !== openssl_verify( + $signature_data, + $signature, + $pub_key ? $pub_key : static::JETPACK__DEBUGGER_PUBLIC_KEY + ) + ) { + return false; + } + + // phpcs:enable WordPress.Security.NonceVerification.Recommended + + return true; + } + + /** + * Verify that user is allowed to disconnect Jetpack. + * + * @since 1.15.0 + * + * @return bool|WP_Error Whether user has the capability 'jetpack_disconnect'. + */ + public static function jetpack_reconnect_permission_check() { + if ( current_user_can( 'jetpack_reconnect' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_jetpack_disconnect', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Returns generic error message when user is not allowed to perform an action. + * + * @return string The error message. + */ + public static function get_user_permissions_error_msg() { + return self::$user_permissions_error_msg; + } + + /** + * The endpoint tried to partially or fully reconnect the website to WP.com. + * + * @since 1.15.0 + * + * @return \WP_REST_Response|WP_Error + */ + public function connection_reconnect() { + $response = array(); + + $next = null; + + $result = $this->connection->restore(); + + if ( is_wp_error( $result ) ) { + $response = $result; + } elseif ( is_string( $result ) ) { + $next = $result; + } else { + $next = true === $result ? 'completed' : 'failed'; + } + + switch ( $next ) { + case 'authorize': + $response['status'] = 'in_progress'; + $response['authorizeUrl'] = $this->connection->get_authorization_url(); + break; + case 'completed': + $response['status'] = 'completed'; + /** + * Action fired when reconnection has completed successfully. + * + * @since 1.18.1 + */ + do_action( 'jetpack_reconnection_completed' ); + break; + case 'failed': + $response = new WP_Error( 'Reconnect failed' ); + break; + } + + return rest_ensure_response( $response ); + } + + /** + * Verify that user is allowed to connect Jetpack. + * + * @since 1.26.0 + * + * @return bool|WP_Error Whether user has the capability 'jetpack_connect'. + */ + public static function jetpack_register_permission_check() { + if ( current_user_can( 'jetpack_connect' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_jetpack_connect', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * The endpoint tried to partially or fully reconnect the website to WP.com. + * + * @since 1.7.0 + * @since-jetpack 7.7.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public function connection_register( $request ) { + if ( ! wp_verify_nonce( $request->get_param( 'registration_nonce' ), 'jetpack-registration-nonce' ) ) { + return new WP_Error( 'invalid_nonce', __( 'Unable to verify your request.', 'jetpack-connection' ), array( 'status' => 403 ) ); + } + + if ( isset( $request['from'] ) ) { + $this->connection->add_register_request_param( 'from', (string) $request['from'] ); + } + + if ( ! empty( $request['plugin_slug'] ) ) { + // If `plugin_slug` matches a plugin using the connection, let's inform the plugin that is establishing the connection. + $connected_plugin = Plugin_Storage::get_one( (string) $request['plugin_slug'] ); + if ( ! is_wp_error( $connected_plugin ) && ! empty( $connected_plugin ) ) { + $this->connection->set_plugin_instance( new Plugin( (string) $request['plugin_slug'] ) ); + } + } + + $result = $this->connection->try_registration(); + + if ( is_wp_error( $result ) ) { + return $result; + } + + $redirect_uri = $request->get_param( 'redirect_uri' ) ? admin_url( $request->get_param( 'redirect_uri' ) ) : null; + + $authorize_url = ( new Authorize_Redirect( $this->connection ) )->build_authorize_url( $redirect_uri ); + + /** + * Filters the response of jetpack/v4/connection/register endpoint + * + * @param array $response Array response + * @since 1.27.0 + */ + $response_body = apply_filters( + 'jetpack_register_site_rest_response', + array() + ); + + // We manipulate the alternate URLs after the filter is applied, so they can not be overwritten. + $response_body['authorizeUrl'] = $authorize_url; + if ( ! empty( $response_body['alternateAuthorizeUrl'] ) ) { + $response_body['alternateAuthorizeUrl'] = Redirect::get_url( $response_body['alternateAuthorizeUrl'] ); + } + + return rest_ensure_response( $response_body ); + } + + /** + * Get the authorization URL. + * + * @since 1.27.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public function connection_authorize_url( $request ) { + $redirect_uri = $request->get_param( 'redirect_uri' ) ? admin_url( $request->get_param( 'redirect_uri' ) ) : null; + $authorize_url = $this->connection->get_authorization_url( null, $redirect_uri ); + + return rest_ensure_response( + array( + 'authorizeUrl' => $authorize_url, + ) + ); + } + + /** + * The endpoint tried to partially or fully reconnect the website to WP.com. + * + * @since 1.29.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function update_user_token( $request ) { + $token_parts = explode( '.', $request['user_token'] ); + + if ( count( $token_parts ) !== 3 || ! (int) $token_parts[2] || ! ctype_digit( $token_parts[2] ) ) { + return new WP_Error( 'invalid_argument_user_token', esc_html__( 'Invalid user token is provided', 'jetpack-connection' ) ); + } + + $user_id = (int) $token_parts[2]; + + if ( false === get_userdata( $user_id ) ) { + return new WP_Error( 'invalid_argument_user_id', esc_html__( 'Invalid user id is provided', 'jetpack-connection' ) ); + } + + $connection = new Manager(); + + if ( ! $connection->is_connected() ) { + return new WP_Error( 'site_not_connected', esc_html__( 'Site is not connected', 'jetpack-connection' ) ); + } + + $is_connection_owner = isset( $request['is_connection_owner'] ) + ? (bool) $request['is_connection_owner'] + : ( new Manager() )->get_connection_owner_id() === $user_id; + + ( new Tokens() )->update_user_token( $user_id, $request['user_token'], $is_connection_owner ); + + /** + * Fires when the user token gets successfully replaced. + * + * @since 1.29.0 + * + * @param int $user_id User ID. + * @param string $token New user token. + */ + do_action( 'jetpack_updated_user_token', $user_id, $request['user_token'] ); + + return rest_ensure_response( + array( + 'success' => true, + ) + ); + } + + /** + * Disconnects Jetpack from the WordPress.com Servers + * + * @since 1.30.1 + * + * @return bool|WP_Error True if Jetpack successfully disconnected. + */ + public static function disconnect_site() { + $connection = new Manager(); + + if ( $connection->is_connected() ) { + $connection->disconnect_site(); + return rest_ensure_response( array( 'code' => 'success' ) ); + } + + return new WP_Error( + 'disconnect_failed', + esc_html__( 'Failed to disconnect the site as it appears already disconnected.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + /** + * Verify that the API client is allowed to replace user token. + * + * @since 1.29.0 + * + * @return bool|WP_Error + */ + public static function update_user_token_permission_check() { + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( 'invalid_permission_update_user_token', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Change the connection owner. + * + * @since 1.29.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function set_connection_owner( $request ) { + $new_owner_id = $request['owner']; + + $owner_set = ( new Manager() )->update_connection_owner( $new_owner_id ); + + if ( is_wp_error( $owner_set ) ) { + return $owner_set; + } + + return rest_ensure_response( + array( + 'code' => 'success', + ) + ); + } + + /** + * Check that user has permission to change the master user. + * + * @since 1.7.0 + * @since-jetpack 6.2.0 + * @since-jetpack 7.7.0 Update so that any user with jetpack_disconnect privs can set owner. + * + * @return bool|WP_Error True if user is able to change master user. + */ + public static function set_connection_owner_permission_check() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_set_connection_owner', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * The endpoint verifies blog connection and blog token validity. + * + * @since 2.7.0 + * + * @return mixed|null + */ + public function connection_check() { + /** + * Filters the successful response of the REST API test_connection method + * + * @param string $response The response string. + */ + $status = apply_filters( 'jetpack_rest_connection_check_response', 'success' ); + + return rest_ensure_response( + array( + 'status' => $status, + ) + ); + } + + /** + * Remote connect endpoint permission check. + * + * @return true|WP_Error + */ + public function connection_check_permission_check() { + if ( current_user_can( 'jetpack_connect' ) ) { + return true; + } + + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( 'invalid_permission_connection_check', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php new file mode 100644 index 00000000..6f5de990 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php @@ -0,0 +1,282 @@ + time() + ) { + return $secrets[ $secret_name ]; + } + + $secret_value = array( + 'secret_1' => call_user_func( $callable ), + 'secret_2' => call_user_func( $callable ), + 'exp' => time() + $exp, + ); + + $secrets[ $secret_name ] = $secret_value; + + $res = Jetpack_Options::update_raw_option( self::LEGACY_SECRETS_OPTION_NAME, $secrets ); + return $res ? $secrets[ $secret_name ] : false; + } + + /** + * Returns two secret tokens and the end of life timestamp for them. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + * @return string|array an array of secrets or an error string. + */ + public function get( $action, $user_id ) { + $secret_name = 'jetpack_' . $action . '_' . $user_id; + $secrets = Jetpack_Options::get_raw_option( + self::LEGACY_SECRETS_OPTION_NAME, + array() + ); + + if ( ! isset( $secrets[ $secret_name ] ) ) { + return self::SECRETS_MISSING; + } + + if ( $secrets[ $secret_name ]['exp'] < time() ) { + $this->delete( $action, $user_id ); + return self::SECRETS_EXPIRED; + } + + return $secrets[ $secret_name ]; + } + + /** + * Deletes secret tokens in case they, for example, have expired. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + */ + public function delete( $action, $user_id ) { + $secret_name = 'jetpack_' . $action . '_' . $user_id; + $secrets = Jetpack_Options::get_raw_option( + self::LEGACY_SECRETS_OPTION_NAME, + array() + ); + if ( isset( $secrets[ $secret_name ] ) ) { + unset( $secrets[ $secret_name ] ); + Jetpack_Options::update_raw_option( self::LEGACY_SECRETS_OPTION_NAME, $secrets ); + } + } + + /** + * Verify a Previously Generated Secret. + * + * @param string $action The type of secret to verify. + * @param string $secret_1 The secret string to compare to what is stored. + * @param int $user_id The user ID of the owner of the secret. + * @return WP_Error|string WP_Error on failure, secret_2 on success. + */ + public function verify( $action, $secret_1, $user_id ) { + $allowed_actions = array( 'register', 'authorize', 'publicize' ); + if ( ! in_array( $action, $allowed_actions, true ) ) { + return new WP_Error( 'unknown_verification_action', 'Unknown Verification Action', 400 ); + } + + $user = get_user_by( 'id', $user_id ); + + /** + * We've begun verifying the previously generated secret. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param string $action The type of secret to verify. + * @param \WP_User $user The user object. + */ + do_action( 'jetpack_verify_secrets_begin', $action, $user ); + + /** Closure to run the 'fail' action and return an error. */ + $return_error = function ( WP_Error $error ) use ( $action, $user ) { + /** + * Verifying of the previously generated secret has failed. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param string $action The type of secret to verify. + * @param \WP_User $user The user object. + * @param WP_Error $error The error object. + */ + do_action( 'jetpack_verify_secrets_fail', $action, $user, $error ); + + return $error; + }; + + $stored_secrets = $this->get( $action, $user_id ); + $this->delete( $action, $user_id ); + + $error = null; + if ( empty( $secret_1 ) ) { + $error = $return_error( + new WP_Error( + 'verify_secret_1_missing', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is missing.', 'jetpack-connection' ), 'secret_1' ), + 400 + ) + ); + } elseif ( ! is_string( $secret_1 ) ) { + $error = $return_error( + new WP_Error( + 'verify_secret_1_malformed', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is malformed.', 'jetpack-connection' ), 'secret_1' ), + 400 + ) + ); + } elseif ( empty( $user_id ) ) { + // $user_id is passed around during registration as "state". + $error = $return_error( + new WP_Error( + 'state_missing', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is missing.', 'jetpack-connection' ), 'state' ), + 400 + ) + ); + } elseif ( ! ctype_digit( (string) $user_id ) ) { + $error = $return_error( + new WP_Error( + 'state_malformed', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is malformed.', 'jetpack-connection' ), 'state' ), + 400 + ) + ); + } elseif ( self::SECRETS_MISSING === $stored_secrets ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_missing', + __( 'Verification secrets not found', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( self::SECRETS_EXPIRED === $stored_secrets ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_expired', + __( 'Verification took too long', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( ! $stored_secrets ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_empty', + __( 'Verification secrets are empty', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( is_wp_error( $stored_secrets ) ) { + $stored_secrets->add_data( 400 ); + $error = $return_error( $stored_secrets ); + } elseif ( empty( $stored_secrets['secret_1'] ) || empty( $stored_secrets['secret_2'] ) || empty( $stored_secrets['exp'] ) ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_incomplete', + __( 'Verification secrets are incomplete', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( ! hash_equals( $secret_1, $stored_secrets['secret_1'] ) ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_mismatch', + __( 'Secret mismatch', 'jetpack-connection' ), + 400 + ) + ); + } + + // Something went wrong during the checks, returning the error. + if ( ! empty( $error ) ) { + return $error; + } + + /** + * We've succeeded at verifying the previously generated secret. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param string $action The type of secret to verify. + * @param \WP_User $user The user object. + */ + do_action( 'jetpack_verify_secrets_success', $action, $user ); + + return $stored_secrets['secret_2']; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php new file mode 100644 index 00000000..a9ca288e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php @@ -0,0 +1,243 @@ + new URL, 'host' => new Host, 'new_signature => New signature if url was changed ] + */ + public function server_sandbox_request_parameters( $sandbox, $url, $headers, $data = null, $method = 'GET' ) { + $host = ''; + $new_signature = ''; + + if ( ! is_string( $sandbox ) || ! is_string( $url ) ) { + return array( + 'url' => $url, + 'host' => $host, + 'new_signature' => $new_signature, + ); + } + + $url_host = wp_parse_url( $url, PHP_URL_HOST ); + + switch ( $url_host ) { + case 'public-api.wordpress.com': + case 'jetpack.wordpress.com': + case 'jetpack.com': + case 'dashboard.wordpress.com': + $host = isset( $headers['Host'] ) ? $headers['Host'] : $url_host; + $original_url = $url; + $url = preg_replace( + '@^(https?://)' . preg_quote( $url_host, '@' ) . '(?=[/?#].*|$)@', + '${1}' . $sandbox, + $url, + 1 + ); + + /** + * Whether to add the X Debug query parameter to the request made to the Sandbox + * + * @since 1.36.0 + * + * @param bool $add_parameter Whether to add the parameter to the request or not. Default is to false. + * @param string $url The URL of the request being made. + * @param string $host The host of the request being made. + */ + if ( apply_filters( 'jetpack_sandbox_add_profile_parameter', false, $url, $host ) ) { + $url = add_query_arg( 'XDEBUG_PROFILE', 1, $url ); + + // URL has been modified since the signature was created. We'll need a new one. + $original_url = add_query_arg( 'XDEBUG_PROFILE', 1, $original_url ); + $new_signature = $this->get_new_signature( $original_url, $headers, $data, $method ); + + } + } + + return compact( 'url', 'host', 'new_signature' ); + } + + /** + * Gets a new signature for the request + * + * @param string $url The new URL to be signed. + * @param array $headers The headers of the request about to be made. + * @param string $data The body of request about to be made. + * @param string $method The method of the request about to be made. + * @return string|null + */ + private function get_new_signature( $url, $headers, $data, $method ) { + + if ( ! empty( $headers['Authorization'] ) ) { + $a_headers = $this->extract_authorization_headers( $headers ); + if ( ! empty( $a_headers ) ) { + $token_details = explode( ':', $a_headers['token'] ); + + if ( count( $token_details ) === 3 ) { + $user_id = $token_details[2]; + $token = ( new Tokens() )->get_access_token( $user_id ); + $time_diff = (int) \Jetpack_Options::get_option( 'time_diff' ); + $jetpack_signature = new \Jetpack_Signature( $token->secret, $time_diff ); + + $signature = $jetpack_signature->sign_request( + $a_headers['token'], + $a_headers['timestamp'], + $a_headers['nonce'], + $a_headers['body-hash'], + $method, + $url, + $data, + false + ); + + if ( $signature && ! is_wp_error( $signature ) ) { + return $signature; + } elseif ( is_wp_error( $signature ) ) { + $this->log_new_signature_error( $signature->get_error_message() ); + } + } else { + $this->log_new_signature_error( 'Malformed token on Authorization Header' ); + } + } else { + $this->log_new_signature_error( 'Error extracting Authorization Header' ); + } + } else { + $this->log_new_signature_error( 'Empty Authorization Header' ); + } + } + + /** + * Logs error if the attempt to create a new signature fails + * + * @param string $message The error message. + * @return void + */ + private function log_new_signature_error( $message ) { + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + error_log( sprintf( "SANDBOXING: Error re-signing the request. '%s'", $message ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + } + } + + /** + * Extract the values in the Authorization header into an array + * + * @param array $headers The headers of the request about to be made. + * @return array|null + */ + public function extract_authorization_headers( $headers ) { + if ( ! empty( $headers['Authorization'] ) && is_string( $headers['Authorization'] ) ) { + $header = str_replace( 'X_JETPACK ', '', $headers['Authorization'] ); + $vars = explode( ' ', $header ); + $result = array(); + foreach ( $vars as $var ) { + $elements = explode( '"', $var ); + if ( count( $elements ) === 3 ) { + $result[ substr( $elements[0], 0, -1 ) ] = $elements[1]; + } + } + return $result; + } + } + + /** + * Modifies parameters of request in order to send the request to the + * server specified by `JETPACK__SANDBOX_DOMAIN`. + * + * Attached to the `requests-requests.before_request` filter. + * + * @param string $url URL of request about to be made. + * @param array $headers Headers of request about to be made. + * @param array|string $data Data of request about to be made. + * @param string $type Type of request about to be made. + * @return void + */ + public function server_sandbox( &$url, &$headers, &$data = null, &$type = null ) { + if ( ! Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ) ) { + return; + } + + $original_url = $url; + + $request_parameters = $this->server_sandbox_request_parameters( Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ), $url, $headers, $data, $type ); + + $url = $request_parameters['url']; + + if ( $request_parameters['host'] ) { + $headers['Host'] = $request_parameters['host']; + + if ( $request_parameters['new_signature'] ) { + $headers['Authorization'] = preg_replace( '/signature=\"[^\"]+\"/', 'signature="' . $request_parameters['new_signature'] . '"', $headers['Authorization'] ); + } + + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + error_log( sprintf( "SANDBOXING via '%s': '%s'", Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ), $original_url ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + } + } + } + + /** + * Adds a "Jetpack API Sandboxed" item to the admin bar if the JETPACK__SANDBOX_DOMAIN + * constant is set. + * + * Attached to the `admin_bar_menu` action. + * + * @param \WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. + */ + public function admin_bar_add_sandbox_item( $wp_admin_bar ) { + if ( ! Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ) ) { + return; + } + + $node = array( + 'id' => 'jetpack-connection-api-sandbox', + 'title' => 'Jetpack API Sandboxed', + 'meta' => array( + 'title' => 'Sandboxing via ' . Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ), + ), + ); + + $wp_admin_bar->add_menu( $node ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php new file mode 100644 index 00000000..b208123f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php @@ -0,0 +1,111 @@ +set_agree(); + /** + * Acton fired when the master user has agreed to the terms of service. + * + * @since 1.0.4 + * @since-jetpack 7.9.0 + */ + do_action( 'jetpack_agreed_to_terms_of_service' ); + } + + /** + * Allow the site to reject to the terms of service. + */ + public function reject() { + $this->set_reject(); + /** + * Acton fired when the master user has revoked their agreement to the terms of service. + * + * @since 1.0.4 + * @since-jetpack 7.9.1 + */ + do_action( 'jetpack_reject_terms_of_service' ); + } + + /** + * Returns whether the master user has agreed to the terms of service. + * + * The following conditions have to be met in order to agree to the terms of service. + * 1. The master user has gone though the connect flow. + * 2. The site is not in dev mode. + * 3. The master user of the site is still connected (deprecated @since 1.4.0). + * + * @return bool + */ + public function has_agreed() { + if ( $this->is_offline_mode() ) { + return false; + } + /** + * Before 1.4.0 we used to also check if the master user of the site is connected + * by calling the Connection related `is_active` method. + * As of 1.4.0 we have removed this check in order to resolve the + * circular dependencies it was introducing to composer packages. + * + * @since 1.4.0 + */ + return $this->get_raw_has_agreed(); + } + + /** + * Abstracted for testing purposes. + * Tells us if the site is in dev mode. + * + * @return bool + */ + protected function is_offline_mode() { + return ( new Status() )->is_offline_mode(); + } + + /** + * Gets just the Jetpack Option that contains the terms of service state. + * Abstracted for testing purposes. + * + * @return bool + */ + protected function get_raw_has_agreed() { + return \Jetpack_Options::get_option( self::OPTION_NAME, false ); + } + + /** + * Sets the correct Jetpack Option to mark the that the site has agreed to the terms of service. + * Abstracted for testing purposes. + */ + protected function set_agree() { + \Jetpack_Options::update_option( self::OPTION_NAME, true ); + } + + /** + * Sets the correct Jetpack Option to mark that the site has rejected the terms of service. + * Abstracted for testing purposes. + */ + protected function set_reject() { + \Jetpack_Options::update_option( self::OPTION_NAME, false ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php new file mode 100644 index 00000000..e6819a7c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php @@ -0,0 +1,76 @@ +init_aiowpm(); + + static::$is_initialized = true; + } + + /** + * Set the token lock for AIOWPM plugin export. + * + * @param array $params The filter parameters. + * + * @return array + */ + public function aiowpm_set_lock( $params ) { + ( new Tokens() )->set_lock(); + return $params; + } + + /** + * Remove the token lock for AIOWPM plugin export. + * + * @param array $params The filter parameters. + * + * @return array + */ + public function aiowpm_remove_lock( $params ) { + ( new Tokens() )->remove_lock(); + return $params; + } + + /** + * Initialize the All-in-One-WP-Migration plugin hooks. + * + * @return void + */ + private function init_aiowpm() { + add_filter( 'ai1wm_export', array( $this, 'aiowpm_set_lock' ), 180 ); + add_filter( 'ai1wm_export', array( $this, 'aiowpm_remove_lock' ), 250 ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php new file mode 100644 index 00000000..1b10356d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php @@ -0,0 +1,687 @@ +remove_lock(); + } + + /** + * Perform the API request to validate the blog and user tokens. + * + * @param int|null $user_id ID of the user we need to validate token for. Current user's ID by default. + * + * @return array|false|WP_Error The API response: `array( 'blog_token_is_healthy' => true|false, 'user_token_is_healthy' => true|false )`. + */ + public function validate( $user_id = null ) { + $blog_id = Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + return new WP_Error( 'site_not_registered', 'Site not registered.' ); + } + $url = sprintf( + '%s/%s/v%s/%s', + Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ), + 'wpcom', + '2', + 'sites/' . $blog_id . '/jetpack-token-health' + ); + + $user_token = $this->get_access_token( $user_id ? $user_id : get_current_user_id() ); + $blog_token = $this->get_access_token(); + + // Cannot validate non-existent tokens. + if ( false === $user_token || false === $blog_token ) { + return false; + } + + $method = 'POST'; + $body = array( + 'user_token' => $this->get_signed_token( $user_token ), + 'blog_token' => $this->get_signed_token( $blog_token ), + ); + $response = Client::_wp_remote_request( $url, compact( 'body', 'method' ) ); + + if ( is_wp_error( $response ) || ! wp_remote_retrieve_body( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + + return $body ? $body : false; + } + + /** + * Perform the API request to validate only the blog. + * + * @return bool|WP_Error Boolean with the test result. WP_Error if test cannot be performed. + */ + public function validate_blog_token() { + $blog_id = Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + return new WP_Error( 'site_not_registered', 'Site not registered.' ); + } + $url = sprintf( + '%s/%s/v%s/%s', + Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ), + 'wpcom', + '2', + 'sites/' . $blog_id . '/jetpack-token-health/blog' + ); + + $method = 'GET'; + $response = Client::remote_request( compact( 'url', 'method' ) ); + + if ( is_wp_error( $response ) || ! wp_remote_retrieve_body( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + + return is_array( $body ) && isset( $body['is_healthy'] ) && true === $body['is_healthy']; + } + + /** + * Obtains the auth token. + * + * @param array $data The request data. + * @param string $token_api_url The URL of the Jetpack "token" API. + * @return object|WP_Error Returns the auth token on success. + * Returns a WP_Error on failure. + */ + public function get( $data, $token_api_url ) { + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + + if ( ! $role ) { + return new WP_Error( 'role', __( 'An administrator for this blog must set up the Jetpack connection.', 'jetpack-connection' ) ); + } + + $client_secret = $this->get_access_token(); + if ( ! $client_secret ) { + return new WP_Error( 'client_secret', __( 'You need to register your Jetpack before connecting it.', 'jetpack-connection' ) ); + } + + /** + * Filter the URL of the first time the user gets redirected back to your site for connection + * data processing. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site admin URL. + */ + $processing_url = apply_filters( 'jetpack_token_processing_url', admin_url( 'admin.php' ) ); + + $redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : ''; + + /** + * Filter the URL to redirect the user back to when the authentication process + * is complete. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site URL. + */ + $redirect = apply_filters( 'jetpack_token_redirect_url', $redirect ); + + $redirect_uri = ( 'calypso' === $data['auth_type'] ) + ? $data['redirect_uri'] + : add_query_arg( + array( + 'handler' => 'jetpack-connection-webhooks', + 'action' => 'authorize', + '_wpnonce' => wp_create_nonce( "jetpack-authorize_{$role}_{$redirect}" ), + 'redirect' => $redirect ? rawurlencode( $redirect ) : false, + ), + esc_url( $processing_url ) + ); + + /** + * Filters the token request data. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param array $request_data request data. + */ + $body = apply_filters( + 'jetpack_token_request_body', + array( + 'client_id' => Jetpack_Options::get_option( 'id' ), + 'client_secret' => $client_secret->secret, + 'grant_type' => 'authorization_code', + 'code' => $data['code'], + 'redirect_uri' => $redirect_uri, + ) + ); + + $args = array( + 'method' => 'POST', + 'body' => $body, + 'headers' => array( + 'Accept' => 'application/json', + ), + ); + add_filter( 'http_request_timeout', array( $this, 'return_30' ), PHP_INT_MAX - 1 ); + $response = Client::_wp_remote_request( $token_api_url, $args ); + remove_filter( 'http_request_timeout', array( $this, 'return_30' ), PHP_INT_MAX - 1 ); + + if ( is_wp_error( $response ) ) { + return new WP_Error( 'token_http_request_failed', $response->get_error_message() ); + } + + $code = wp_remote_retrieve_response_code( $response ); + $entity = wp_remote_retrieve_body( $response ); + + if ( $entity ) { + $json = json_decode( $entity ); + } else { + $json = false; + } + + if ( 200 !== $code || ! empty( $json->error ) ) { + if ( empty( $json->error ) ) { + return new WP_Error( 'unknown', '', $code ); + } + + /* translators: Error description string. */ + $error_description = isset( $json->error_description ) ? sprintf( __( 'Error Details: %s', 'jetpack-connection' ), (string) $json->error_description ) : ''; + + return new WP_Error( (string) $json->error, $error_description, $code ); + } + + if ( empty( $json->access_token ) || ! is_scalar( $json->access_token ) ) { + return new WP_Error( 'access_token', '', $code ); + } + + if ( empty( $json->token_type ) || 'X_JETPACK' !== strtoupper( $json->token_type ) ) { + return new WP_Error( 'token_type', '', $code ); + } + + if ( empty( $json->scope ) ) { + return new WP_Error( 'scope', 'No Scope', $code ); + } + + // TODO: get rid of the error silencer. + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + @list( $role, $hmac ) = explode( ':', $json->scope ); + if ( empty( $role ) || empty( $hmac ) ) { + return new WP_Error( 'scope', 'Malformed Scope', $code ); + } + + if ( $this->sign_role( $role ) !== $json->scope ) { + return new WP_Error( 'scope', 'Invalid Scope', $code ); + } + + $cap = $roles->translate_role_to_cap( $role ); + if ( ! $cap ) { + return new WP_Error( 'scope', 'No Cap', $code ); + } + + if ( ! current_user_can( $cap ) ) { + return new WP_Error( 'scope', 'current_user_cannot', $code ); + } + + return (string) $json->access_token; + } + + /** + * Enters a user token into the user_tokens option + * + * @param int $user_id The user id. + * @param string $token The user token. + * @param bool $is_master_user Whether the user is the master user. + * @return bool + */ + public function update_user_token( $user_id, $token, $is_master_user ) { + // Not designed for concurrent updates. + $user_tokens = $this->get_user_tokens(); + if ( ! is_array( $user_tokens ) ) { + $user_tokens = array(); + } + $user_tokens[ $user_id ] = $token; + if ( $is_master_user ) { + $master_user = $user_id; + $options = compact( 'user_tokens', 'master_user' ); + } else { + $options = compact( 'user_tokens' ); + } + return Jetpack_Options::update_options( $options ); + } + + /** + * Sign a user role with the master access token. + * If not specified, will default to the current user. + * + * @access public + * + * @param string $role User role. + * @param int $user_id ID of the user. + * @return string Signed user role. + */ + public function sign_role( $role, $user_id = null ) { + if ( empty( $user_id ) ) { + $user_id = (int) get_current_user_id(); + } + + if ( ! $user_id ) { + return false; + } + + $token = $this->get_access_token(); + if ( ! $token || is_wp_error( $token ) ) { + return false; + } + + return $role . ':' . hash_hmac( 'md5', "{$role}|{$user_id}", $token->secret ); + } + + /** + * Increases the request timeout value to 30 seconds. + * + * @return int Returns 30. + */ + public function return_30() { + return 30; + } + + /** + * Gets the requested token. + * + * Tokens are one of two types: + * 1. Blog Tokens: These are the "main" tokens. Each site typically has one Blog Token, + * though some sites can have multiple "Special" Blog Tokens (see below). These tokens + * are not associated with a user account. They represent the site's connection with + * the Jetpack servers. + * 2. User Tokens: These are "sub-"tokens. Each connected user account has one User Token. + * + * All tokens look like "{$token_key}.{$private}". $token_key is a public ID for the + * token, and $private is a secret that should never be displayed anywhere or sent + * over the network; it's used only for signing things. + * + * Blog Tokens can be "Normal" or "Special". + * * Normal: The result of a normal connection flow. They look like + * "{$random_string_1}.{$random_string_2}" + * That is, $token_key and $private are both random strings. + * Sites only have one Normal Blog Token. Normal Tokens are found in either + * Jetpack_Options::get_option( 'blog_token' ) (usual) or the JETPACK_BLOG_TOKEN + * constant (rare). + * * Special: A connection token for sites that have gone through an alternative + * connection flow. They look like: + * ";{$special_id}{$special_version};{$wpcom_blog_id};.{$random_string}" + * That is, $private is a random string and $token_key has a special structure with + * lots of semicolons. + * Most sites have zero Special Blog Tokens. Special tokens are only found in the + * JETPACK_BLOG_TOKEN constant. + * + * In particular, note that Normal Blog Tokens never start with ";" and that + * Special Blog Tokens always do. + * + * When searching for a matching Blog Tokens, Blog Tokens are examined in the following + * order: + * 1. Defined Special Blog Tokens (via the JETPACK_BLOG_TOKEN constant) + * 2. Stored Normal Tokens (via Jetpack_Options::get_option( 'blog_token' )) + * 3. Defined Normal Tokens (via the JETPACK_BLOG_TOKEN constant) + * + * @param int|false $user_id false: Return the Blog Token. int: Return that user's User Token. + * @param string|false $token_key If provided, check that the token matches the provided input. + * @param bool|true $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. + * + * @return object|false|WP_Error + */ + public function get_access_token( $user_id = false, $token_key = false, $suppress_errors = true ) { + if ( $this->is_locked() ) { + $this->delete_all(); + return false; + } + + $possible_special_tokens = array(); + $possible_normal_tokens = array(); + $user_tokens = $this->get_user_tokens(); + + if ( $user_id ) { + if ( ! $user_tokens ) { + return $suppress_errors ? false : new WP_Error( 'no_user_tokens', __( 'No user tokens found', 'jetpack-connection' ) ); + } + if ( true === $user_id ) { // connection owner. + $user_id = Jetpack_Options::get_option( 'master_user' ); + if ( ! $user_id ) { + return $suppress_errors ? false : new WP_Error( 'empty_master_user_option', __( 'No primary user defined', 'jetpack-connection' ) ); + } + } + if ( ! isset( $user_tokens[ $user_id ] ) || ! $user_tokens[ $user_id ] ) { + // translators: %s is the user ID. + return $suppress_errors ? false : new WP_Error( 'no_token_for_user', sprintf( __( 'No token for user %d', 'jetpack-connection' ), $user_id ) ); + } + $user_token_chunks = explode( '.', $user_tokens[ $user_id ] ); + if ( empty( $user_token_chunks[1] ) || empty( $user_token_chunks[2] ) ) { + // translators: %s is the user ID. + return $suppress_errors ? false : new WP_Error( 'token_malformed', sprintf( __( 'Token for user %d is malformed', 'jetpack-connection' ), $user_id ) ); + } + if ( $user_token_chunks[2] !== (string) $user_id ) { + // translators: %1$d is the ID of the requested user. %2$d is the user ID found in the token. + return $suppress_errors ? false : new WP_Error( 'user_id_mismatch', sprintf( __( 'Requesting user_id %1$d does not match token user_id %2$d', 'jetpack-connection' ), $user_id, $user_token_chunks[2] ) ); + } + $possible_normal_tokens[] = "{$user_token_chunks[0]}.{$user_token_chunks[1]}"; + } else { + $stored_blog_token = Jetpack_Options::get_option( 'blog_token' ); + if ( $stored_blog_token ) { + $possible_normal_tokens[] = $stored_blog_token; + } + + $defined_tokens_string = Constants::get_constant( 'JETPACK_BLOG_TOKEN' ); + + if ( $defined_tokens_string ) { + $defined_tokens = explode( ',', $defined_tokens_string ); + foreach ( $defined_tokens as $defined_token ) { + if ( ';' === $defined_token[0] ) { + $possible_special_tokens[] = $defined_token; + } else { + $possible_normal_tokens[] = $defined_token; + } + } + } + } + + if ( self::MAGIC_NORMAL_TOKEN_KEY === $token_key ) { + $possible_tokens = $possible_normal_tokens; + } else { + $possible_tokens = array_merge( $possible_special_tokens, $possible_normal_tokens ); + } + + if ( ! $possible_tokens ) { + // If no user tokens were found, it would have failed earlier, so this is about blog token. + return $suppress_errors ? false : new WP_Error( 'no_possible_tokens', __( 'No blog token found', 'jetpack-connection' ) ); + } + + $valid_token = false; + + if ( false === $token_key ) { + // Use first token. + $valid_token = $possible_tokens[0]; + } elseif ( self::MAGIC_NORMAL_TOKEN_KEY === $token_key ) { + // Use first normal token. + $valid_token = $possible_tokens[0]; // $possible_tokens only contains normal tokens because of earlier check. + } else { + // Use the token matching $token_key or false if none. + // Ensure we check the full key. + $token_check = rtrim( $token_key, '.' ) . '.'; + + foreach ( $possible_tokens as $possible_token ) { + if ( hash_equals( substr( $possible_token, 0, strlen( $token_check ) ), $token_check ) ) { + $valid_token = $possible_token; + break; + } + } + } + + if ( ! $valid_token ) { + if ( $user_id ) { + // translators: %d is the user ID. + return $suppress_errors ? false : new WP_Error( 'no_valid_user_token', sprintf( __( 'Invalid token for user %d', 'jetpack-connection' ), $user_id ) ); + } else { + return $suppress_errors ? false : new WP_Error( 'no_valid_blog_token', __( 'Invalid blog token', 'jetpack-connection' ) ); + } + } + + return (object) array( + 'secret' => $valid_token, + 'external_user_id' => (int) $user_id, + ); + } + + /** + * Updates the blog token to a new value. + * + * @access public + * + * @param string $token the new blog token value. + * @return Boolean Whether updating the blog token was successful. + */ + public function update_blog_token( $token ) { + return Jetpack_Options::update_option( 'blog_token', $token ); + } + + /** + * Unlinks the current user from the linked WordPress.com user. + * + * @access public + * @static + * + * @todo Refactor to properly load the XMLRPC client independently. + * + * @param int $user_id The user identifier. + * + * @return bool Whether the disconnection of the user was successful. + */ + public function disconnect_user( $user_id ) { + $tokens = $this->get_user_tokens(); + if ( ! $tokens ) { + return false; + } + + if ( ! isset( $tokens[ $user_id ] ) ) { + return false; + } + + unset( $tokens[ $user_id ] ); + + $this->update_user_tokens( $tokens ); + + return true; + } + + /** + * Returns an array of user_id's that have user tokens for communicating with wpcom. + * Able to select by specific capability. + * + * @deprecated 1.30.0 + * @see Manager::get_connected_users + * + * @param string $capability The capability of the user. + * @param int|null $limit How many connected users to get before returning. + * @return array Array of WP_User objects if found. + */ + public function get_connected_users( $capability = 'any', $limit = null ) { + _deprecated_function( __METHOD__, '1.30.0' ); + return ( new Manager( 'jetpack' ) )->get_connected_users( $capability, $limit ); + } + + /** + * Fetches a signed token. + * + * @param object $token the token. + * @return WP_Error|string a signed token + */ + public function get_signed_token( $token ) { + if ( ! isset( $token->secret ) || empty( $token->secret ) ) { + return new WP_Error( 'invalid_token' ); + } + + list( $token_key, $token_secret ) = explode( '.', $token->secret ); + + $token_key = sprintf( + '%s:%d:%d', + $token_key, + Constants::get_constant( 'JETPACK__API_VERSION' ), + $token->external_user_id + ); + + $timestamp = time(); + + if ( function_exists( 'wp_generate_password' ) ) { + $nonce = wp_generate_password( 10, false ); + } else { + $nonce = substr( sha1( wp_rand( 0, 1000000 ) ), 0, 10 ); + } + + $normalized_request_string = implode( + "\n", + array( + $token_key, + $timestamp, + $nonce, + ) + ) . "\n"; + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + $signature = base64_encode( hash_hmac( 'sha1', $normalized_request_string, $token_secret, true ) ); + + $auth = array( + 'token' => $token_key, + 'timestamp' => $timestamp, + 'nonce' => $nonce, + 'signature' => $signature, + ); + + $header_pieces = array(); + foreach ( $auth as $key => $value ) { + $header_pieces[] = sprintf( '%s="%s"', $key, $value ); + } + + return implode( ' ', $header_pieces ); + } + + /** + * Gets the list of user tokens + * + * @since 1.30.0 + * + * @return bool|array An array of user tokens where keys are user IDs and values are the tokens. False if no user token is found. + */ + public function get_user_tokens() { + return Jetpack_Options::get_option( 'user_tokens' ); + } + + /** + * Updates the option that stores the user tokens + * + * @since 1.30.0 + * + * @param array $tokens An array of user tokens where keys are user IDs and values are the tokens. + * @return bool Was the option successfully updated? + * + * @todo add validate the input. + */ + public function update_user_tokens( $tokens ) { + return Jetpack_Options::update_option( 'user_tokens', $tokens ); + } + + /** + * Lock the tokens to the current site URL. + * + * @param int $timespan How long the tokens should be locked, in seconds. + * + * @return bool + */ + public function set_lock( $timespan = HOUR_IN_SECONDS ) { + try { + $expires = ( new DateTime() )->add( DateInterval::createFromDateString( (int) $timespan . ' seconds' ) ); + } catch ( Exception $e ) { + return false; + } + + if ( false === $expires ) { + return false; + } + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + return Jetpack_Options::update_option( 'token_lock', $expires->format( static::DATE_FORMAT_ATOM ) . '|||' . base64_encode( Urls::site_url() ) ); + } + + /** + * Remove the site lock from tokens. + * + * @return bool + */ + public function remove_lock() { + Jetpack_Options::delete_option( 'token_lock' ); + + return true; + } + + /** + * Check if the domain is locked, remove the lock if needed. + * Possible scenarios: + * - lock expired, site URL matches the lock URL: remove the lock, return false. + * - lock not expired, site URL matches the lock URL: return false. + * - site URL does not match the lock URL (expiration date is ignored): return true, do not remove the lock. + * + * @return bool + */ + public function is_locked() { + $the_lock = Jetpack_Options::get_option( 'token_lock' ); + if ( ! $the_lock ) { + // Not locked. + return false; + } + + $the_lock = explode( '|||', $the_lock, 2 ); + if ( count( $the_lock ) !== 2 ) { + // Something's wrong with the lock. + $this->remove_lock(); + return false; + } + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + $locked_site_url = base64_decode( $the_lock[1] ); + $expires = $the_lock[0]; + + $expiration_date = DateTime::createFromFormat( static::DATE_FORMAT_ATOM, $expires ); + if ( false === $expiration_date || ! $locked_site_url ) { + // Something's wrong with the lock. + $this->remove_lock(); + return false; + } + + if ( Urls::site_url() === $locked_site_url ) { + if ( new DateTime() > $expiration_date ) { + // Site lock expired. + // Site URL matches, removing the lock. + $this->remove_lock(); + } + + return false; + } + + // Site URL doesn't match. + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php new file mode 100644 index 00000000..edf23af7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php @@ -0,0 +1,319 @@ +product_name = $product_name; + $this->connection = $connection; + if ( $this->connection === null ) { + // TODO We should always pass a Connection. + $this->connection = new Connection\Manager(); + } + + if ( ! did_action( 'jetpack_set_tracks_ajax_hook' ) ) { + add_action( 'wp_ajax_jetpack_tracks', array( $this, 'ajax_tracks' ) ); + + /** + * Fires when the Tracking::ajax_tracks() callback has been hooked to the + * wp_ajax_jetpack_tracks action. This action is used to ensure that + * the callback is hooked only once. + * + * @since 1.13.11 + */ + do_action( 'jetpack_set_tracks_ajax_hook' ); + } + } + + /** + * Universal method for for all tracking events triggered via the JavaScript client. + * + * @access public + */ + public function ajax_tracks() { + // Check for nonce. + if ( + empty( $_REQUEST['tracksNonce'] ) + || ! wp_verify_nonce( $_REQUEST['tracksNonce'], 'jp-tracks-ajax-nonce' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WP core doesn't pre-sanitize nonces either. + ) { + wp_send_json_error( + __( 'You aren’t authorized to do that.', 'jetpack-connection' ), + 403 + ); + } + + if ( ! isset( $_REQUEST['tracksEventName'] ) || ! isset( $_REQUEST['tracksEventType'] ) ) { + wp_send_json_error( + __( 'No valid event name or type.', 'jetpack-connection' ), + 403 + ); + } + + $tracks_data = array(); + if ( 'click' === $_REQUEST['tracksEventType'] && isset( $_REQUEST['tracksEventProp'] ) ) { + if ( is_array( $_REQUEST['tracksEventProp'] ) ) { + $tracks_data = array_map( 'filter_var', wp_unslash( $_REQUEST['tracksEventProp'] ) ); + } else { + $tracks_data = array( 'clicked' => filter_var( wp_unslash( $_REQUEST['tracksEventProp'] ) ) ); + } + } + + $this->record_user_event( filter_var( wp_unslash( $_REQUEST['tracksEventName'] ) ), $tracks_data, null, false ); + + wp_send_json_success(); + } + + /** + * Register script necessary for tracking. + * + * @param boolean $enqueue Also enqueue? defaults to false. + */ + public static function register_tracks_functions_scripts( $enqueue = false ) { + + // Register jp-tracks as it is a dependency. + wp_register_script( + 'jp-tracks', + '//stats.wp.com/w.js', + array(), + gmdate( 'YW' ), + true + ); + + Assets::register_script( + 'jp-tracks-functions', + '../dist/tracks-callables.js', + __FILE__, + array( + 'dependencies' => array( 'jp-tracks' ), + 'enqueue' => $enqueue, + 'in_footer' => true, + ) + ); + } + + /** + * Enqueue script necessary for tracking. + */ + public function enqueue_tracks_scripts() { + Assets::register_script( + 'jptracks', + '../dist/tracks-ajax.js', + __FILE__, + array( + 'dependencies' => array( 'jquery' ), + 'enqueue' => true, + 'in_footer' => true, + ) + ); + + wp_localize_script( + 'jptracks', + 'jpTracksAJAX', + array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'jpTracksAJAX_nonce' => wp_create_nonce( 'jp-tracks-ajax-nonce' ), + ) + ); + } + + /** + * Send an event in Tracks. + * + * @param string $event_type Type of the event. + * @param array $data Data to send with the event. + * @param mixed $user Username, user_id, or WP_User object. + * @param bool $use_product_prefix Whether to use the object's product name as a prefix to the event type. If + * set to false, the prefix will be 'jetpack_'. + */ + public function record_user_event( $event_type, $data = array(), $user = null, $use_product_prefix = true ) { + if ( ! $user ) { + $user = wp_get_current_user(); + } + $site_url = get_option( 'siteurl' ); + + $data['_via_ua'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; + $data['_via_ip'] = isset( $_SERVER['REMOTE_ADDR'] ) ? filter_var( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : ''; + $data['_lg'] = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) : ''; + $data['blog_url'] = $site_url; + $data['blog_id'] = \Jetpack_Options::get_option( 'id' ); + + // Top level events should not be namespaced. + if ( '_aliasUser' !== $event_type ) { + $prefix = $use_product_prefix ? $this->product_name : 'jetpack'; + $event_type = $prefix . '_' . $event_type; + } + + $data['jetpack_version'] = defined( 'JETPACK__VERSION' ) ? JETPACK__VERSION : '0'; + + return $this->tracks_record_event( $user, $event_type, $data ); + } + + /** + * Record an event in Tracks - this is the preferred way to record events from PHP. + * + * @param mixed $user username, user_id, or WP_User object. + * @param string $event_name The name of the event. + * @param array $properties Custom properties to send with the event. + * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred. + * + * @return bool true for success | \WP_Error if the event pixel could not be fired + */ + public function tracks_record_event( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) { + + // We don't want to track user events during unit tests/CI runs. + if ( $user instanceof \WP_User && 'wptests_capabilities' === $user->cap_key ) { + return false; + } + $terms_of_service = new Terms_Of_Service(); + $status = new Status(); + // Don't track users who have not agreed to our TOS. + if ( ! $this->should_enable_tracking( $terms_of_service, $status ) ) { + return false; + } + + $event_obj = $this->tracks_build_event_obj( $user, $event_name, $properties, $event_timestamp_millis ); + + if ( is_wp_error( $event_obj->error ) ) { + return $event_obj->error; + } + + return $event_obj->record(); + } + + /** + * Determines whether tracking should be enabled. + * + * @param \Automattic\Jetpack\Terms_Of_Service $terms_of_service A Terms_Of_Service object. + * @param \Automattic\Jetpack\Status $status A Status object. + * + * @return boolean True if tracking should be enabled, else false. + */ + public function should_enable_tracking( $terms_of_service, $status ) { + if ( $status->is_offline_mode() ) { + return false; + } + + return $terms_of_service->has_agreed() || $this->connection->is_user_connected(); + } + + /** + * Procedurally build a Tracks Event Object. + * NOTE: Use this only when the simpler Automattic\Jetpack\Tracking->jetpack_tracks_record_event() function won't work for you. + * + * @param \WP_User $user WP_User object. + * @param string $event_name The name of the event. + * @param array $properties Custom properties to send with the event. + * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred. + * + * @return \Jetpack_Tracks_Event|\WP_Error + */ + private function tracks_build_event_obj( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) { + $identity = $this->tracks_get_identity( $user->ID ); + + $properties['user_lang'] = $user->get( 'WPLANG' ); + + $blog_details = array( + 'blog_lang' => isset( $properties['blog_lang'] ) ? $properties['blog_lang'] : get_bloginfo( 'language' ), + 'blog_id' => \Jetpack_Options::get_option( 'id' ), + ); + + $timestamp = ( false !== $event_timestamp_millis ) ? $event_timestamp_millis : round( microtime( true ) * 1000 ); + $timestamp_string = is_string( $timestamp ) ? $timestamp : number_format( $timestamp, 0, '', '' ); + + return new \Jetpack_Tracks_Event( + array_merge( + $blog_details, + (array) $properties, + $identity, + array( + '_en' => $event_name, + '_ts' => $timestamp_string, + ) + ) + ); + } + + /** + * Get the identity to send to tracks. + * + * @param int $user_id The user id of the local user. + * + * @return array $identity + */ + public function tracks_get_identity( $user_id ) { + + // Meta is set, and user is still connected. Use WPCOM ID. + $wpcom_id = get_user_meta( $user_id, 'jetpack_tracks_wpcom_id', true ); + if ( $wpcom_id && $this->connection->is_user_connected( $user_id ) ) { + return array( + '_ut' => 'wpcom:user_id', + '_ui' => $wpcom_id, + ); + } + + // User is connected, but no meta is set yet. Use WPCOM ID and set meta. + if ( $this->connection->is_user_connected( $user_id ) ) { + $wpcom_user_data = $this->connection->get_connected_user_data( $user_id ); + update_user_meta( $user_id, 'jetpack_tracks_wpcom_id', $wpcom_user_data['ID'] ); + + return array( + '_ut' => 'wpcom:user_id', + '_ui' => $wpcom_user_data['ID'], + ); + } + + // User isn't linked at all. Fall back to anonymous ID. + $anon_id = get_user_meta( $user_id, 'jetpack_tracks_anon_id', true ); + if ( ! $anon_id ) { + $anon_id = \Jetpack_Tracks_Client::get_anon_id(); + add_user_meta( $user_id, 'jetpack_tracks_anon_id', $anon_id, false ); + } + + if ( ! isset( $_COOKIE['tk_ai'] ) && ! headers_sent() ) { + setcookie( 'tk_ai', $anon_id, 0, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), false ); // phpcs:ignore Jetpack.Functions.SetCookie -- This is a random string and should be fine. + } + + return array( + '_ut' => 'anon', + '_ui' => $anon_id, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php new file mode 100644 index 00000000..f8c22cee --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php @@ -0,0 +1,192 @@ +update_user_token() instead. + * + * @param int $user_id The user id. + * @param string $token The user token. + * @param bool $is_master_user Whether the user is the master user. + * @return bool + */ + public static function update_user_token( $user_id, $token, $is_master_user ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->update_user_token' ); + return ( new Tokens() )->update_user_token( $user_id, $token, $is_master_user ); + } + + /** + * Filters the value of the api constant. + * + * @param String $constant_value The constant value. + * @param String $constant_name The constant name. + * @return mixed | null + */ + public static function jetpack_api_constant_filter( $constant_value, $constant_name ) { + if ( $constant_value !== null ) { + // If the constant value was already set elsewhere, use that value. + return $constant_value; + } + + if ( defined( "self::DEFAULT_$constant_name" ) ) { + return constant( "self::DEFAULT_$constant_name" ); + } + + return null; + } + + /** + * Add a filter to initialize default values of the constants. + */ + public static function init_default_constants() { + add_filter( + 'jetpack_constant_default_value', + array( __CLASS__, 'jetpack_api_constant_filter' ), + 10, + 2 + ); + } + + /** + * Filters the registration request body to include tracking properties. + * + * @param array $properties Already prepared tracking properties. + * @return array amended properties. + */ + public static function filter_register_request_body( $properties ) { + $tracking = new Tracking(); + $tracks_identity = $tracking->tracks_get_identity( get_current_user_id() ); + + return array_merge( + $properties, + array( + '_ui' => $tracks_identity['_ui'], + '_ut' => $tracks_identity['_ut'], + ) + ); + } + + /** + * Generate a new user from a SSO attempt. + * + * @param object $user_data WordPress.com user information. + */ + public static function generate_user( $user_data ) { + $username = $user_data->login; + /** + * Determines how many times the SSO module can attempt to randomly generate a user. + * + * @module sso + * + * @since jetpack-4.3.2 + * + * @param int 5 By default, SSO will attempt to random generate a user up to 5 times. + */ + $num_tries = (int) apply_filters( 'jetpack_sso_allowed_username_generate_retries', 5 ); + + $exists = username_exists( $username ); + $tries = 0; + while ( $exists && $tries++ < $num_tries ) { + $username = $user_data->login . '_' . $user_data->ID . '_' . wp_rand(); + $exists = username_exists( $username ); + } + + if ( $exists ) { + return false; + } + + $user = (object) array(); + $user->user_pass = wp_generate_password( 20 ); + $user->user_login = wp_slash( $username ); + $user->user_email = wp_slash( $user_data->email ); + $user->display_name = $user_data->display_name; + $user->first_name = $user_data->first_name; + $user->last_name = $user_data->last_name; + $user->url = $user_data->url; + $user->description = $user_data->description; + + if ( isset( $user_data->role ) && $user_data->role ) { + $user->role = $user_data->role; + } + + $created_user_id = wp_insert_user( $user ); + + update_user_meta( $created_user_id, 'wpcom_user_id', $user_data->ID ); + return get_userdata( $created_user_id ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php new file mode 100644 index 00000000..de580c06 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php @@ -0,0 +1,213 @@ +connection = $connection; + } + + /** + * Initialize the webhooks. + * + * @param Manager $connection The Connection Manager object. + */ + public static function init( $connection ) { + $webhooks = new static( $connection ); + + add_action( 'init', array( $webhooks, 'controller' ) ); + add_action( 'load-toplevel_page_jetpack', array( $webhooks, 'fallback_jetpack_controller' ) ); + } + + /** + * Jetpack plugin used to trigger this webhooks in Jetpack::admin_page_load() + * + * The Jetpack toplevel menu is still accessible for stand-alone plugins, and while there's no content for that page, there are still + * actions from Calypso and WPCOM that reach that route regardless of the site having the Jetpack plugin or not. That's why we are still handling it here. + */ + public function fallback_jetpack_controller() { + $this->controller( true ); + } + + /** + * The "controller" decides which handler we need to run. + * + * @param bool $force Do not check if it's a webhook request and just run the controller. + */ + public function controller( $force = false ) { + if ( ! $force ) { + // The nonce is verified in specific handlers. + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( empty( $_GET['handler'] ) || 'jetpack-connection-webhooks' !== $_GET['handler'] ) { + return; + } + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( isset( $_GET['connect_url_redirect'] ) ) { + $this->handle_connect_url_redirect(); + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( empty( $_GET['action'] ) ) { + return; + } + + // The nonce is verified in specific handlers. + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + switch ( $_GET['action'] ) { + case 'authorize': + $this->handle_authorize(); + $this->do_exit(); + break; // @phan-suppress-current-line PhanPluginUnreachableCode -- Safer to include it even though do_exit never returns. + case 'authorize_redirect': + $this->handle_authorize_redirect(); + $this->do_exit(); + break; // @phan-suppress-current-line PhanPluginUnreachableCode -- Safer to include it even though do_exit never returns. + // Class Jetpack::admin_page_load() still handles other cases. + } + } + + /** + * Perform the authorization action. + */ + public function handle_authorize() { + if ( $this->connection->is_connected() && $this->connection->is_user_connected() ) { + $redirect_url = apply_filters( 'jetpack_client_authorize_already_authorized_url', admin_url() ); + wp_safe_redirect( $redirect_url ); + + return; + } + do_action( 'jetpack_client_authorize_processing' ); + + $data = stripslashes_deep( $_GET ); // We need all request data under the context of an authorization request. + $data['auth_type'] = 'client'; + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + $redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : ''; + + check_admin_referer( "jetpack-authorize_{$role}_{$redirect}" ); + + $tracking = new Tracking(); + + $result = $this->connection->authorize( $data ); + + if ( is_wp_error( $result ) ) { + do_action( 'jetpack_client_authorize_error', $result ); + + $tracking->record_user_event( + 'jpc_client_authorize_fail', + array( + 'error_code' => $result->get_error_code(), + 'error_message' => $result->get_error_message(), + ) + ); + } else { + /** + * Fires after the Jetpack client is authorized to communicate with WordPress.com. + * + * @param int Jetpack Blog ID. + * + * @since 1.7.0 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_client_authorized', Jetpack_Options::get_option( 'id' ) ); + + $tracking->record_user_event( 'jpc_client_authorize_success' ); + } + + $fallback_redirect = apply_filters( 'jetpack_client_authorize_fallback_url', admin_url() ); + $redirect = wp_validate_redirect( $redirect ) ? $redirect : $fallback_redirect; + + wp_safe_redirect( $redirect ); + } + + /** + * The authorhize_redirect webhook handler + */ + public function handle_authorize_redirect() { + $authorize_redirect_handler = new Webhooks\Authorize_Redirect( $this->connection ); + $authorize_redirect_handler->handle(); + } + + /** + * The `exit` is wrapped into a method so we could mock it. + * + * @return never + */ + protected function do_exit() { + exit; + } + + /** + * Handle the `connect_url_redirect` action, + * which is usually called to repeat an attempt for user to authorize the connection. + * + * @return void + */ + public function handle_connect_url_redirect() { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. + $from = ! empty( $_GET['from'] ) ? sanitize_text_field( wp_unslash( $_GET['from'] ) ) : 'iframe'; + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- no site changes, sanitization happens in get_authorization_url() + $redirect = ! empty( $_GET['redirect_after_auth'] ) ? wp_unslash( $_GET['redirect_after_auth'] ) : false; + + add_filter( 'allowed_redirect_hosts', array( Host::class, 'allow_wpcom_environments' ) ); + + if ( ! $this->connection->is_user_connected() ) { + if ( ! $this->connection->is_connected() ) { + $this->connection->register(); + } + + $connect_url = add_query_arg( 'from', $from, $this->connection->get_authorization_url( null, $redirect ) ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. + if ( isset( $_GET['notes_iframe'] ) ) { + $connect_url .= '¬es_iframe'; + } + wp_safe_redirect( $connect_url ); + $this->do_exit(); + } elseif ( ! isset( $_GET['calypso_env'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. + ( new CookieState() )->state( 'message', 'already_authorized' ); + wp_safe_redirect( $redirect ); + $this->do_exit(); + } else { + $connect_url = add_query_arg( + array( + 'from' => $from, + 'already_authorized' => true, + ), + $this->connection->get_authorization_url() + ); + wp_safe_redirect( $connect_url ); + $this->do_exit(); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php new file mode 100644 index 00000000..bc525104 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php @@ -0,0 +1,106 @@ + [ + * $user_id => [ + * arrat of Jetpack_IXR_ClientMulticall + * ] + * ] + * ] + * + * @var array + */ + public static $clients = array(); + + /** + * Adds a new XMLRPC call to the queue to be processed on shutdown + * + * @param string $method The XML-RPC method. + * @param integer $user_id The user ID used to make the request (will use this user's token); Use 0 for the blog token. + * @param mixed ...$args This function accepts any number of additional arguments, that will be passed to the call. + * @return void + */ + public static function add_call( $method, $user_id = 0, ...$args ) { + global $blog_id; + + $client_blog_id = is_multisite() ? $blog_id : 0; + + if ( ! isset( self::$clients[ $client_blog_id ] ) ) { + self::$clients[ $client_blog_id ] = array(); + } + + if ( ! isset( self::$clients[ $client_blog_id ][ $user_id ] ) ) { + self::$clients[ $client_blog_id ][ $user_id ] = new Jetpack_IXR_ClientMulticall( array( 'user_id' => $user_id ) ); + } + + // https://plugins.trac.wordpress.org/ticket/2041 + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + array_unshift( $args, $method ); + + call_user_func_array( array( self::$clients[ $client_blog_id ][ $user_id ], 'addCall' ), $args ); + + if ( false === has_action( 'shutdown', array( 'Automattic\Jetpack\Connection\XMLRPC_Async_Call', 'do_calls' ) ) ) { + add_action( 'shutdown', array( 'Automattic\Jetpack\Connection\XMLRPC_Async_Call', 'do_calls' ) ); + } + } + + /** + * Trigger the calls at shutdown + * + * @return void + */ + public static function do_calls() { + foreach ( self::$clients as $client_blog_id => $blog_clients ) { + if ( $client_blog_id > 0 ) { + $switch_success = switch_to_blog( $client_blog_id ); + + if ( ! $switch_success ) { + continue; + } + } + + foreach ( $blog_clients as $client ) { + if ( empty( $client->calls ) ) { + continue; + } + + flush(); + $client->query(); + } + + if ( $client_blog_id > 0 ) { + restore_current_blog(); + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php new file mode 100644 index 00000000..a5693cf2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php @@ -0,0 +1,85 @@ +connection = $connection; + + // Adding the filter late to avoid being overwritten by Jetpack's XMLRPC server. + add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ), 20 ); + } + + /** + * Attached to the `xmlrpc_methods` filter. + * + * @param array $methods The already registered XML-RPC methods. + * @return array + */ + public function xmlrpc_methods( $methods ) { + return array_merge( + $methods, + array( + 'jetpack.verifyRegistration' => array( $this, 'verify_registration' ), + ) + ); + } + + /** + * Handles verification that a site is registered. + * + * @param array $registration_data The data sent by the XML-RPC client: + * [ $secret_1, $user_id ]. + * + * @return string|IXR_Error + */ + public function verify_registration( $registration_data ) { + return $this->output( $this->connection->handle_registration( $registration_data ) ); + } + + /** + * Normalizes output for XML-RPC. + * + * @param mixed $data The data to output. + */ + private function output( $data ) { + if ( is_wp_error( $data ) ) { + $code = $data->get_error_data(); + if ( ! $code ) { + $code = -10520; + } + + if ( ! class_exists( IXR_Error::class ) ) { + require_once ABSPATH . WPINC . '/class-IXR.php'; + } + return new IXR_Error( + $code, + sprintf( 'Jetpack: [%s] %s', $data->get_error_code(), $data->get_error_message() ) + ); + } + + return $data; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/admin-bar.scss b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/admin-bar.scss new file mode 100644 index 00000000..262b0819 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/admin-bar.scss @@ -0,0 +1,30 @@ +#wpadminbar #wp-admin-bar-jetpack-idc { + margin-right: 5px; + + .jp-idc-admin-bar { + border-radius: 2px; + font-weight: 500; + font-size: 14px; + line-height: 20px; + color: #EFEFF0; + padding: 6px 8px; + } + + &.hide { + display: none; + } + + .dashicons { + font-family: 'dashicons'; + margin-top: -6px; + + &:before { + font-size: 18px; + } + } + + .ab-item { + padding: 0; + background: #E68B28; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/admin.jsx b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/admin.jsx new file mode 100644 index 00000000..8d731738 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/admin.jsx @@ -0,0 +1,62 @@ +import { IDCScreen } from '@automattic/jetpack-idc'; +import * as WPElement from '@wordpress/element'; +import React from 'react'; + +import './admin-bar.scss'; +import './style.scss'; + +/** + * The initial renderer function. + */ +function render() { + if ( ! Object.hasOwn( window, 'JP_IDENTITY_CRISIS__INITIAL_STATE' ) ) { + return; + } + + const container = document.getElementById( + window.JP_IDENTITY_CRISIS__INITIAL_STATE.containerID || 'jp-identity-crisis-container' + ); + + if ( null === container ) { + return; + } + + const { + WP_API_root, + WP_API_nonce, + wpcomHomeUrl, + currentUrl, + redirectUri, + tracksUserData, + tracksEventData, + isSafeModeConfirmed, + consumerData, + isAdmin, + possibleDynamicSiteUrlDetected, + isDevelopmentSite, + } = window.JP_IDENTITY_CRISIS__INITIAL_STATE; + + if ( ! isSafeModeConfirmed ) { + const component = ( + + ); + WPElement.createRoot( container ).render( component ); + } +} + +window.addEventListener( 'load', () => render() ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/style.scss b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/style.scss new file mode 100644 index 00000000..14f09db9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/_inc/style.scss @@ -0,0 +1,9 @@ +#jp-identity-crisis-container .jp-idc__idc-screen { + margin-top: 40px; + margin-bottom: 40px; +} + +#jp-identity-crisis-container.notice { + background: none; + border: none; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-exception.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-exception.php new file mode 100644 index 00000000..f6bd4140 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-exception.php @@ -0,0 +1,13 @@ +disconnect_site( true ); + } else { + $connection->disconnect_site( false ); + } + + delete_option( static::PERSISTENT_BLOG_ID_OPTION_NAME ); + + // Clear IDC options. + self::clear_all_idc_options(); + } + + /** + * Filter to prevent site from disconnecting from WPCOM if it's in an IDC. + * + * @see jetpack_connection_disconnect_site_wpcom filter. + * + * @return bool False if the site is in IDC, true otherwise. + */ + public static function jetpack_connection_disconnect_site_wpcom_filter() { + return ! self::validate_sync_error_idc_option(); + } + + /** + * This method loops through the array of processed items from sync and checks if one of the items was the + * home_url or site_url callable. If so, then we delete the jetpack_migrate_for_idc option. + * + * @param array $processed_items Array of processed items that were synced to WordPress.com. + */ + public function maybe_clear_migrate_option( $processed_items ) { + foreach ( (array) $processed_items as $item ) { + + // First, is this item a jetpack_sync_callable action? If so, then proceed. + $callable_args = ( is_array( $item ) && isset( $item[0] ) && isset( $item[1] ) && 'jetpack_sync_callable' === $item[0] ) + ? $item[1] + : null; + + // Second, if $callable_args is set, check if the callable was home_url or site_url. If so, + // clear the migrate option. + if ( + isset( $callable_args[0] ) + && ( 'home_url' === $callable_args[0] || 'site_url' === $callable_args[1] ) + ) { + Jetpack_Options::delete_option( 'migrate_for_idc' ); + break; + } + } + } + + /** + * WordPress init. + * + * @return void + */ + public function wordpress_init() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + if ( + isset( $_GET['jetpack_idc_clear_confirmation'] ) && isset( $_GET['_wpnonce'] ) && + wp_verify_nonce( $_GET['_wpnonce'], 'jetpack_idc_clear_confirmation' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WordPress core doesn't unslash or verify nonces either. + ) { + Jetpack_Options::delete_option( 'safe_mode_confirmed' ); + self::$is_safe_mode_confirmed = false; + } else { + self::$is_safe_mode_confirmed = (bool) Jetpack_Options::get_option( 'safe_mode_confirmed' ); + } + } + + // 121 Priority so that it's the most inner Jetpack item in the admin bar. + add_action( 'admin_bar_menu', array( $this, 'display_admin_bar_button' ), 121 ); + + UI::init(); + } + + /** + * Add the idc query arguments to the url. + * + * @param string $url The remote request url. + */ + public function add_idc_query_args_to_url( $url ) { + $status = new Status(); + if ( ! is_string( $url ) + || $status->is_offline_mode() + || self::validate_sync_error_idc_option() ) { + return $url; + } + $home_url = Urls::home_url(); + $site_url = Urls::site_url(); + $hostname = wp_parse_url( $site_url, PHP_URL_HOST ); + + // If request is from an IP, make sure ip_requester option is set + if ( self::url_is_ip( $hostname ) ) { + self::maybe_update_ip_requester( $hostname ); + } + + $query_args = array( + 'home' => $home_url, + 'siteurl' => $site_url, + ); + + if ( self::should_handle_idc() ) { + $query_args['idc'] = true; + } + + if ( \Jetpack_Options::get_option( 'migrate_for_idc', false ) ) { + $query_args['migrate_for_idc'] = true; + } + + if ( is_multisite() ) { + $query_args['multisite'] = true; + } + + return add_query_arg( $query_args, $url ); + } + + /** + * Renders the admin bar button. + * + * @return void + */ + public function display_admin_bar_button() { + global $wp_admin_bar; + + $href = is_admin() + ? add_query_arg( 'jetpack_idc_clear_confirmation', '1' ) + : add_query_arg( 'jetpack_idc_clear_confirmation', '1', admin_url() ); + + $href = wp_nonce_url( $href, 'jetpack_idc_clear_confirmation' ); + + $consumer_data = UI::get_consumer_data(); + $label = isset( $consumer_data['customContent']['adminBarSafeModeLabel'] ) + ? esc_html( $consumer_data['customContent']['adminBarSafeModeLabel'] ) + : esc_html__( 'Jetpack Safe Mode', 'jetpack-connection' ); + + $title = sprintf( + '', + '', + $label + ); + + $menu = array( + 'id' => 'jetpack-idc', + 'title' => $title, + 'href' => esc_url( $href ), + 'parent' => 'top-secondary', + ); + + if ( ! self::$is_safe_mode_confirmed ) { + $menu['meta'] = array( + 'class' => 'hide', + ); + } + + $wp_admin_bar->add_node( $menu ); + } + + /** + * Checks if the site is currently in an identity crisis. + * + * @return array|bool Array of options that are in a crisis, or false if everything is OK. + */ + public static function check_identity_crisis() { + $connection = new Connection_Manager( 'jetpack' ); + + if ( ! $connection->is_connected() || ( new Status() )->is_offline_mode() || ! self::validate_sync_error_idc_option() ) { + return false; + } + return Jetpack_Options::get_option( 'sync_error_idc' ); + } + + /** + * Checks the HTTP response body for the 'idc_detected' key. If the key exists, + * checks the idc_detected value for a valid idc error. + * + * @param array|WP_Error $http_response The HTTP response. + * + * @return bool Whether the site is in an identity crisis. + */ + public function check_http_response_for_idc_detected( $http_response ) { + if ( ! is_array( $http_response ) ) { + return false; + } + $response_body = json_decode( wp_remote_retrieve_body( $http_response ), true ); + + if ( isset( $response_body['idc_detected'] ) ) { + return $this->check_response_for_idc( $response_body['idc_detected'] ); + } + + if ( isset( $response_body['migrated_for_idc'] ) ) { + Jetpack_Options::delete_option( 'migrate_for_idc' ); + } + + return false; + } + + /** + * Checks the WPCOM response to determine if the site is in an identity crisis. Updates the + * sync_error_idc option if it is. + * + * @param array $response The response data. + * + * @return bool Whether the site is in an identity crisis. + */ + public function check_response_for_idc( $response ) { + if ( is_array( $response ) && isset( $response['error_code'] ) ) { + $error_code = $response['error_code']; + $allowed_idc_error_codes = array( + 'jetpack_url_mismatch', + 'jetpack_home_url_mismatch', + 'jetpack_site_url_mismatch', + ); + + if ( in_array( $error_code, $allowed_idc_error_codes, true ) ) { + Jetpack_Options::update_option( + 'sync_error_idc', + self::get_sync_error_idc_option( $response ) + ); + } + + return true; + } + + return false; + } + + /** + * Clears all IDC specific options. This method is used on disconnect and reconnect. + * + * @return void + */ + public static function clear_all_idc_options() { + // If the site is currently in IDC, let's also clear the VaultPress connection options. + // We have to check if the site is in IDC, otherwise we'd be clearing the VaultPress + // connection any time the Jetpack connection is cycled. + if ( self::validate_sync_error_idc_option() ) { + delete_option( 'vaultpress' ); + delete_option( 'vaultpress_auto_register' ); + } + + Jetpack_Options::delete_option( + array( + 'sync_error_idc', + 'safe_mode_confirmed', + 'migrate_for_idc', + ) + ); + + delete_transient( 'jetpack_idc_possible_dynamic_site_url_detected' ); + } + + /** + * Checks whether the sync_error_idc option is valid or not, and if not, will do cleanup. + * + * @return bool + * @since-jetpack 5.4.0 Do not call get_sync_error_idc_option() unless site is in IDC + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + public static function validate_sync_error_idc_option() { + $is_valid = false; + + // Is the site opted in and does the stored sync_error_idc option match what we now generate? + $sync_error = Jetpack_Options::get_option( 'sync_error_idc' ); + if ( $sync_error && self::should_handle_idc() ) { + $local_options = self::get_sync_error_idc_option(); + + // Ensure all values are set. + if ( isset( $sync_error['home'] ) && isset( $local_options['home'] ) && isset( $sync_error['siteurl'] ) && isset( $local_options['siteurl'] ) ) { + // If the WP.com expected home and siteurl match local home and siteurl it is not valid IDC. + if ( + isset( $sync_error['wpcom_home'] ) && + isset( $sync_error['wpcom_siteurl'] ) && + $sync_error['wpcom_home'] === $local_options['home'] && + $sync_error['wpcom_siteurl'] === $local_options['siteurl'] + ) { + // Enable migrate_for_idc so that sync actions are accepted. + Jetpack_Options::update_option( 'migrate_for_idc', true ); + } elseif ( $sync_error['home'] === $local_options['home'] && $sync_error['siteurl'] === $local_options['siteurl'] ) { + $is_valid = true; + } + } + } + + /** + * Filters whether the sync_error_idc option is valid. + * + * @param bool $is_valid If the sync_error_idc is valid or not. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + $is_valid = (bool) apply_filters( 'jetpack_sync_error_idc_validation', $is_valid ); + + if ( ! $is_valid && $sync_error ) { + // Since the option exists, and did not validate, delete it. + Jetpack_Options::delete_option( 'sync_error_idc' ); + } + + return $is_valid; + } + + /** + * Reverses WP.com URLs stored in sync_error_idc option. + * + * @param array $sync_error error option containing reversed URLs. + * @return array + */ + public static function reverse_wpcom_urls_for_idc( $sync_error ) { + if ( isset( $sync_error['reversed_url'] ) ) { + if ( array_key_exists( 'wpcom_siteurl', $sync_error ) ) { + $sync_error['wpcom_siteurl'] = strrev( $sync_error['wpcom_siteurl'] ); + } + if ( array_key_exists( 'wpcom_home', $sync_error ) ) { + $sync_error['wpcom_home'] = strrev( $sync_error['wpcom_home'] ); + } + } + return $sync_error; + } + + /** + * Normalizes a url by doing three things: + * - Strips protocol + * - Strips www + * - Adds a trailing slash + * + * @param string $url URL to parse. + * + * @return WP_Error|string + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + public static function normalize_url_protocol_agnostic( $url ) { + $parsed_url = wp_parse_url( trailingslashit( esc_url_raw( $url ) ) ); + if ( ! $parsed_url || empty( $parsed_url['host'] ) || empty( $parsed_url['path'] ) ) { + return new WP_Error( + 'cannot_parse_url', + sprintf( + /* translators: %s: URL to parse. */ + esc_html__( 'Cannot parse URL %s', 'jetpack-connection' ), + $url + ) + ); + } + + // Strip www and protocols. + $url = preg_replace( '/^www\./i', '', $parsed_url['host'] . $parsed_url['path'] ); + + return $url; + } + + /** + * Gets the value that is to be saved in the jetpack_sync_error_idc option. + * + * @param array $response HTTP response. + * + * @return array Array of the local urls, wpcom urls, and error code. + * @since 0.2.0 + * @since-jetpack 4.4.0 + * @since-jetpack 5.4.0 Add transient since home/siteurl retrieved directly from DB. + */ + public static function get_sync_error_idc_option( $response = array() ) { + // Since the local options will hit the database directly, store the values + // in a transient to allow for autoloading and caching on subsequent views. + $local_options = get_transient( 'jetpack_idc_local' ); + if ( false === $local_options ) { + $local_options = array( + 'home' => Urls::home_url(), + 'siteurl' => Urls::site_url(), + ); + set_transient( 'jetpack_idc_local', $local_options, MINUTE_IN_SECONDS ); + } + + $options = array_merge( $local_options, $response ); + + $returned_values = array(); + foreach ( $options as $key => $option ) { + if ( 'error_code' === $key ) { + $returned_values[ $key ] = $option; + continue; + } + + $normalized_url = self::normalize_url_protocol_agnostic( $option ); + if ( is_wp_error( $normalized_url ) ) { + continue; + } + + $returned_values[ $key ] = $normalized_url; + } + // We need to protect WPCOM URLs from search & replace by reversing them. See https://wp.me/pf5801-3R + // Add 'reversed_url' key for backward compatibility + if ( array_key_exists( 'wpcom_home', $returned_values ) && array_key_exists( 'wpcom_siteurl', $returned_values ) ) { + $returned_values['reversed_url'] = true; + $returned_values = self::reverse_wpcom_urls_for_idc( $returned_values ); + } + + return $returned_values; + } + + /** + * Returns the value of the jetpack_should_handle_idc filter or constant. + * If set to true, the site will be put into staging mode. + * + * This method uses both the current jetpack_should_handle_idc filter + * and constant to determine whether an IDC should be handled. + * + * @return bool + * @since 0.2.6 + */ + public static function should_handle_idc() { + if ( Constants::is_defined( 'JETPACK_SHOULD_HANDLE_IDC' ) ) { + $default = Constants::get_constant( 'JETPACK_SHOULD_HANDLE_IDC' ); + } else { + $default = ! Constants::is_defined( 'SUNRISE' ) && ! is_multisite(); + } + + /** + * Allows sites to opt in for IDC mitigation which blocks the site from syncing to WordPress.com when the home + * URL or site URL do not match what WordPress.com expects. The default value is either true, or the value of + * JETPACK_SHOULD_HANDLE_IDC constant if set. + * + * @param bool $default Whether the site is opted in to IDC mitigation. + * + * @since 0.2.6 + */ + return (bool) apply_filters( 'jetpack_should_handle_idc', $default ); + } + + /** + * Whether the site is undergoing identity crisis. + * + * @return bool + */ + public static function has_identity_crisis() { + return false !== static::check_identity_crisis() && ! static::$is_safe_mode_confirmed; + } + + /** + * Whether an admin has confirmed safe mode. + * Unlike `static::$is_safe_mode_confirmed` this function always returns the actual flag value. + * + * @return bool + */ + public static function safe_mode_is_confirmed() { + return Jetpack_Options::get_option( 'safe_mode_confirmed' ); + } + + /** + * Returns the mismatched URLs. + * + * @return array|bool The mismatched urls, or false if the site is not connected, offline, in safe mode, or the IDC error is not valid. + */ + public static function get_mismatched_urls() { + if ( ! static::has_identity_crisis() ) { + return false; + } + + $data = static::check_identity_crisis(); + + if ( ! $data || + ! isset( $data['error_code'] ) || + ! isset( $data['wpcom_home'] ) || + ! isset( $data['home'] ) || + ! isset( $data['wpcom_siteurl'] ) || + ! isset( $data['siteurl'] ) + ) { + // The jetpack_sync_error_idc option is missing a key. + return false; + } + + if ( 'jetpack_site_url_mismatch' === $data['error_code'] ) { + return array( + 'wpcom_url' => $data['wpcom_siteurl'], + 'current_url' => $data['siteurl'], + ); + } + + return array( + 'wpcom_url' => $data['wpcom_home'], + 'current_url' => $data['home'], + ); + } + + /** + * Try to detect $_SERVER['HTTP_HOST'] being used within WP_SITEURL or WP_HOME definitions inside of wp-config. + * + * If `HTTP_HOST` usage is found, it's possbile (though not certain) that site URLs are dynamic. + * + * When a site URL is dynamic, it can lead to a Jetpack IDC. If potentially dynamic usage is detected, + * helpful support info will be shown on the IDC UI about setting a static site/home URL. + * + * @return bool True if potentially dynamic site urls were detected in wp-config, false otherwise. + */ + public static function detect_possible_dynamic_site_url() { + $transient_key = 'jetpack_idc_possible_dynamic_site_url_detected'; + $transient_val = get_transient( $transient_key ); + + if ( false !== $transient_val ) { + return (bool) $transient_val; + } + + $path = self::locate_wp_config(); + $wp_config = $path ? file_get_contents( $path ) : false; // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + if ( $wp_config ) { + $matched = preg_match( + '/define ?\( ?[\'"](?:WP_SITEURL|WP_HOME).+(?:HTTP_HOST).+\);/', + $wp_config + ); + + if ( $matched ) { + set_transient( $transient_key, 1, HOUR_IN_SECONDS ); + return true; + } + } + + set_transient( $transient_key, 0, HOUR_IN_SECONDS ); + return false; + } + + /** + * Gets path to WordPress configuration. + * Source: https://github.com/wp-cli/wp-cli/blob/master/php/utils.php + * + * @return string + */ + public static function locate_wp_config() { + static $path; + + if ( null === $path ) { + $path = false; + + if ( getenv( 'WP_CONFIG_PATH' ) && file_exists( getenv( 'WP_CONFIG_PATH' ) ) ) { + $path = getenv( 'WP_CONFIG_PATH' ); + } elseif ( file_exists( ABSPATH . 'wp-config.php' ) ) { + $path = ABSPATH . 'wp-config.php'; + } elseif ( file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) { + $path = dirname( ABSPATH ) . '/wp-config.php'; + } + + if ( $path ) { + $path = realpath( $path ); + } + } + + return $path; + } + + /** + * Adds `url_secret` to the `jetpack.idcUrlValidation` URL validation endpoint. + * Adds `url_secret_error` in case of an error. + * + * @param array $response The endpoint response that we're modifying. + * + * @return array + * + * phpcs:ignore Squiz.Commenting.FunctionCommentThrowTag -- The exception is being caught, false positive. + */ + public static function add_secret_to_url_validation_response( array $response ) { + try { + $secret = new URL_Secret(); + + $secret->create(); + + if ( $secret->exists() ) { + $response['url_secret'] = $secret->get_secret(); + } + } catch ( Exception $e ) { + $response['url_secret_error'] = new WP_Error( 'unable_to_create_url_secret', $e->getMessage() ); + } + + return $response; + } + + /** + * Check if URL is an IP. + * + * @param string $hostname The hostname to check. + * @return bool + */ + public static function url_is_ip( $hostname = null ) { + + if ( ! $hostname ) { + $hostname = wp_parse_url( Urls::site_url(), PHP_URL_HOST ); + } + + $is_ip = filter_var( $hostname, FILTER_VALIDATE_IP ) !== false ? $hostname : false; + return $is_ip; + } + + /** + * Add IDC-related data to the registration query. + * + * @param array $params The existing query params. + * + * @return array + */ + public static function register_request_body( array $params ) { + $persistent_blog_id = get_option( static::PERSISTENT_BLOG_ID_OPTION_NAME ); + if ( $persistent_blog_id ) { + $params['persistent_blog_id'] = $persistent_blog_id; + $params['url_secret'] = URL_Secret::create_secret( 'registration_request_url_secret_failed' ); + } + + return $params; + } + + /** + * Set the necessary options when site gets registered. + * + * @param int $blog_id The blog ID. + * + * @return void + */ + public static function site_registered( $blog_id ) { + update_option( static::PERSISTENT_BLOG_ID_OPTION_NAME, (int) $blog_id, false ); + } + + /** + * Check if we need to update the ip_requester option. + * + * @param string $hostname The hostname to check. + * + * @return void + */ + public static function maybe_update_ip_requester( $hostname ) { + // Check if transient exists + $transient_key = ip2long( $hostname ); + if ( $transient_key && ! get_transient( 'jetpack_idc_ip_requester_' . $transient_key ) ) { + self::set_ip_requester_for_idc( $hostname, $transient_key ); + } + } + + /** + * If URL is an IP, add the IP value to the ip_requester option with its expiry value. + * + * @param string $hostname The hostname to check. + * @param int $transient_key The transient key. + */ + public static function set_ip_requester_for_idc( $hostname, $transient_key ) { + // Check if option exists + $data = Jetpack_Options::get_option( 'identity_crisis_ip_requester' ); + + $ip_requester = array( + 'ip' => $hostname, + 'expires_at' => time() + 360, + ); + + // If not set, initialize it + if ( empty( $data ) ) { + $data = array( $ip_requester ); + } else { + $updated_data = array(); + $updated_value = false; + + // Remove expired values and update existing IP + foreach ( $data as $item ) { + if ( time() > $item['expires_at'] ) { + continue; // Skip expired IP + } + + if ( $item['ip'] === $hostname ) { + $item['expires_at'] = time() + 360; + $updated_value = true; + } + + $updated_data[] = $item; + } + + if ( ! $updated_value || empty( $updated_data ) ) { + $updated_data[] = $ip_requester; + } + + $data = $updated_data; + } + + self::update_ip_requester( $data, $transient_key ); + } + + /** + * Update the ip_requester option and set a transient to expire in 5 minutes. + * + * @param array $data The data to be updated. + * @param int $transient_key The transient key. + * + * @return void + */ + public static function update_ip_requester( $data, $transient_key ) { + // Update the option + $updated = Jetpack_Options::update_option( 'identity_crisis_ip_requester', $data ); + // Set a transient to expire in 5 minutes + if ( $updated ) { + $transient_name = 'jetpack_idc_ip_requester_' . $transient_key; + set_transient( $transient_name, $data, 300 ); + } + } + + /** + * Adds `ip_requester` to the `jetpack.idcUrlValidation` URL validation endpoint. + * + * @param array $response The enpoint response that we're modifying. + * + * @return array + */ + public static function add_ip_requester_to_url_validation_response( array $response ) { + $requesters = Jetpack_Options::get_option( 'identity_crisis_ip_requester' ); + if ( $requesters ) { + // Loop through the requesters and add the IP to the response if it's not expired + $i = 0; + foreach ( $requesters as $ip ) { + if ( $ip['expires_at'] > time() ) { + $response['ip_requester'][] = $ip['ip']; + } + // Limit the response to five IPs + $i = ++$i; + if ( $i === 5 ) { + break; + } + } + } + return $response; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-rest-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-rest-endpoints.php new file mode 100644 index 00000000..b3547811 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-rest-endpoints.php @@ -0,0 +1,322 @@ + WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::confirm_safe_mode', + 'permission_callback' => __CLASS__ . '::identity_crisis_mitigation_permission_check', + ) + ); + + // Handles the request to migrate stats and subscribers during an identity crisis. + register_rest_route( + 'jetpack/v4', + 'identity-crisis/migrate', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::migrate_stats_and_subscribers', + 'permission_callback' => __CLASS__ . '::identity_crisis_mitigation_permission_check', + ) + ); + + // IDC resolve: create an entirely new shadow site for this URL. + register_rest_route( + 'jetpack/v4', + '/identity-crisis/start-fresh', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::start_fresh_connection', + 'permission_callback' => __CLASS__ . '::identity_crisis_mitigation_permission_check', + 'args' => array( + 'redirect_uri' => array( + 'description' => __( 'URI of the admin page where the user should be redirected after connection flow', 'jetpack-connection' ), + 'type' => 'string', + ), + ), + ) + ); + + // Fetch URL and secret for IDC check. + register_rest_route( + 'jetpack/v4', + '/identity-crisis/idc-url-validation', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( static::class, 'validate_urls_and_set_secret' ), + 'permission_callback' => array( static::class, 'url_secret_permission_check' ), + ) + ); + + // Fetch URL verification secret. + register_rest_route( + 'jetpack/v4', + '/identity-crisis/url-secret', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( static::class, 'fetch_url_secret' ), + 'permission_callback' => array( static::class, 'url_secret_permission_check' ), + ) + ); + + // Fetch URL verification secret. + register_rest_route( + 'jetpack/v4', + '/identity-crisis/compare-url-secret', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( static::class, 'compare_url_secret' ), + 'permission_callback' => array( static::class, 'compare_url_secret_permission_check' ), + 'args' => array( + 'secret' => array( + 'description' => __( 'URL secret to compare to the ones stored in the database.', 'jetpack-connection' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + } + + /** + * Handles identity crisis mitigation, confirming safe mode for this site. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @return bool | WP_Error True if option is properly set. + */ + public static function confirm_safe_mode() { + $updated = Jetpack_Options::update_option( 'safe_mode_confirmed', true ); + if ( $updated ) { + return rest_ensure_response( + array( + 'code' => 'success', + ) + ); + } + + return new WP_Error( + 'error_setting_jetpack_safe_mode', + esc_html__( 'Could not confirm safe mode.', 'jetpack-connection' ), + array( 'status' => 500 ) + ); + } + + /** + * Handles identity crisis mitigation, migrating stats and subscribers from old url to this, new url. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @return bool | WP_Error True if option is properly set. + */ + public static function migrate_stats_and_subscribers() { + if ( Jetpack_Options::get_option( 'sync_error_idc' ) && ! Jetpack_Options::delete_option( 'sync_error_idc' ) ) { + return new WP_Error( + 'error_deleting_sync_error_idc', + esc_html__( 'Could not delete sync error option.', 'jetpack-connection' ), + array( 'status' => 500 ) + ); + } + + if ( Jetpack_Options::get_option( 'migrate_for_idc' ) || Jetpack_Options::update_option( 'migrate_for_idc', true ) ) { + return rest_ensure_response( + array( + 'code' => 'success', + ) + ); + } + return new WP_Error( + 'error_setting_jetpack_migrate', + esc_html__( 'Could not confirm migration.', 'jetpack-connection' ), + array( 'status' => 500 ) + ); + } + + /** + * This IDC resolution will disconnect the site and re-connect to a completely new + * and separate shadow site than the original. + * + * It will first will disconnect the site without phoning home as to not disturb the production site. + * It then builds a fresh connection URL and sends it back along with the response. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function start_fresh_connection( $request ) { + /** + * Fires when Users have requested through Identity Crisis for the connection to be reset. + * Should be used to disconnect any connections and reset options. + * + * @since 0.2.0 + */ + do_action( 'jetpack_idc_disconnect' ); + + $connection = new Connection_Manager(); + $result = $connection->try_registration( true ); + + // early return if site registration fails. + if ( ! $result || is_wp_error( $result ) ) { + return rest_ensure_response( $result ); + } + + $redirect_uri = $request->get_param( 'redirect_uri' ) ? admin_url( $request->get_param( 'redirect_uri' ) ) : null; + + /** + * Filters the connection url that users should be redirected to for re-establishing their connection. + * + * @since 0.2.0 + * + * @param \WP_REST_Response|WP_Error $connection_url Connection URL user should be redirected to. + */ + return apply_filters( 'jetpack_idc_authorization_url', rest_ensure_response( $connection->get_authorization_url( null, $redirect_uri ) ) ); + } + + /** + * Verify that user can mitigate an identity crisis. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @return true|WP_Error True if the user has capability 'jetpack_disconnect', an error object otherwise. + */ + public static function identity_crisis_mitigation_permission_check() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + return true; + } + $error_msg = esc_html__( + 'You do not have the correct user permissions to perform this action. + Please contact your site admin if you think this is a mistake.', + 'jetpack-connection' + ); + + return new WP_Error( 'invalid_user_permission_identity_crisis', $error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Endpoint for URL validation and creating a secret. + * + * @since 0.18.0 + * + * @return array + */ + public static function validate_urls_and_set_secret() { + $xmlrpc_server = new Jetpack_XMLRPC_Server(); + $result = $xmlrpc_server->validate_urls_for_idc_mitigation(); + + return $result; + } + + /** + * Endpoint for fetching the existing secret. + * + * @return WP_Error|\WP_REST_Response + */ + public static function fetch_url_secret() { + $secret = new URL_Secret(); + + if ( ! $secret->exists() ) { + return new WP_Error( 'missing_url_secret', esc_html__( 'URL secret does not exist.', 'jetpack-connection' ) ); + } + + return rest_ensure_response( + array( + 'code' => 'success', + 'data' => array( + 'secret' => $secret->get_secret(), + 'expires_at' => $secret->get_expires_at(), + ), + ) + ); + } + + /** + * Endpoint for comparing the existing secret. + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return WP_Error|\WP_REST_Response + */ + public static function compare_url_secret( $request ) { + $match = false; + + $storage = new URL_Secret(); + + if ( $storage->exists() ) { + $remote_secret = $request->get_param( 'secret' ); + $match = $remote_secret && hash_equals( $storage->get_secret(), $remote_secret ); + } + + return rest_ensure_response( + array( + 'code' => 'success', + 'match' => $match, + ) + ); + } + + /** + * Verify url_secret create/fetch permissions (valid blog token authentication). + * + * @return true|WP_Error + */ + public static function url_secret_permission_check() { + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( + 'invalid_user_permission_identity_crisis', + esc_html__( 'You do not have the correct user permissions to perform this action.', 'jetpack-connection' ), + array( 'status' => rest_authorization_required_code() ) + ); + } + + /** + * The endpoint is only available on non-connected sites. + * use `/identity-crisis/url-secret` for connected sites. + * + * @return true|WP_Error + */ + public static function compare_url_secret_permission_check() { + return ( new Connection_Manager() )->is_connected() + ? new WP_Error( + 'invalid_connection_status', + esc_html__( 'The endpoint is not available on connected sites.', 'jetpack-connection' ), + array( 'status' => 403 ) + ) + : true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-ui.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-ui.php new file mode 100644 index 00000000..ee4c5acb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-ui.php @@ -0,0 +1,204 @@ + true, + 'textdomain' => 'jetpack-connection', + ) + ); + Assets::enqueue_script( 'jp_identity_crisis_banner' ); + wp_add_inline_script( 'jp_identity_crisis_banner', static::get_initial_state(), 'before' ); + + add_action( 'admin_notices', array( static::class, 'render_container' ) ); + } + } + + /** + * Create the container element for the IDC banner. + */ + public static function render_container() { + ?> +
+ esc_url_raw( rest_url() ), + 'WP_API_nonce' => wp_create_nonce( 'wp_rest' ), + 'wpcomHomeUrl' => ( is_array( $idc_urls ) && array_key_exists( 'wpcom_url', $idc_urls ) ) ? $idc_urls['wpcom_url'] : null, + 'currentUrl' => ( is_array( $idc_urls ) && array_key_exists( 'current_url', $idc_urls ) ) ? $idc_urls['current_url'] : null, + 'redirectUri' => isset( $_SERVER['REQUEST_URI'] ) ? str_replace( '/wp-admin/', '/', filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) : '', + 'tracksUserData' => Jetpack_Tracks_Client::get_connected_user_tracks_identity(), + 'tracksEventData' => array( + 'isAdmin' => $is_admin, + 'currentScreen' => $current_screen ? $current_screen->id : false, + 'blogID' => Jetpack_Options::get_option( 'id' ), + 'platform' => static::get_platform(), + ), + 'isSafeModeConfirmed' => Identity_Crisis::$is_safe_mode_confirmed, + 'consumerData' => static::get_consumer_data(), + 'isAdmin' => $is_admin, + 'possibleDynamicSiteUrlDetected' => $possible_dynamic_site_url_detected, + 'isDevelopmentSite' => $is_development_site, + + /** + * Use the filter to provide custom HTML elecontainer ID. + * + * @since 0.10.0 + * + * @param string|null $containerID The container ID. + */ + 'containerID' => apply_filters( 'identity_crisis_container_id', null ), + ); + } + + /** + * Get the package consumer data. + * + * @return array + */ + public static function get_consumer_data() { + if ( null !== static::$consumers ) { + return static::$consumers; + } + + $consumers = apply_filters( 'jetpack_idc_consumers', array() ); + + if ( ! $consumers ) { + return array(); + } + + usort( + $consumers, + function ( $c1, $c2 ) { + $priority1 = ( array_key_exists( 'priority', $c1 ) && (int) $c1['priority'] ) ? (int) $c1['priority'] : 10; + $priority2 = ( array_key_exists( 'priority', $c2 ) && (int) $c2['priority'] ) ? (int) $c2['priority'] : 10; + + return $priority1 <=> $priority2; + } + ); + + $consumer_chosen = null; + $consumer_url_length = 0; + + foreach ( $consumers as $consumer ) { + if ( empty( $consumer['admin_page'] ) || ! is_string( $consumer['admin_page'] ) ) { + continue; + } + + if ( isset( $_SERVER['REQUEST_URI'] ) && str_starts_with( filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ) ), $consumer['admin_page'] ) && strlen( $consumer['admin_page'] ) > $consumer_url_length ) { + $consumer_chosen = $consumer; + $consumer_url_length = strlen( $consumer['admin_page'] ); + } + } + + static::$consumers = $consumer_chosen ? $consumer_chosen : array_shift( $consumers ); + + return static::$consumers; + } + + /** + * Get the site platform. + * + * @return string + */ + private static function get_platform() { + $host = new Host(); + + if ( $host->is_woa_site() ) { + return 'woa'; + } + + if ( $host->is_vip_site() ) { + return 'vip'; + } + + if ( $host->is_newspack_site() ) { + return 'newspack'; + } + + return 'self-hosted'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-url-secret.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-url-secret.php new file mode 100644 index 00000000..e2ff3f8b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-url-secret.php @@ -0,0 +1,159 @@ +fetch(); + + if ( $secret_data !== null ) { + $this->secret = $secret_data['secret']; + $this->expires_at = $secret_data['expires_at']; + } + } + + /** + * Fetch the URL secret from the database. + * + * @return array|null + */ + private function fetch() { + $data = Jetpack_Options::get_option( static::OPTION_KEY ); + + if ( $data === false || empty( $data['secret'] ) || empty( $data['expires_at'] ) ) { + return null; + } + + if ( time() > $data['expires_at'] ) { + Jetpack_Options::delete_option( static::OPTION_KEY ); + return null; + } + + return $data; + } + + /** + * Create new secret and save it in the options. + * + * @throws Exception Thrown if unable to save the new secret. + * + * @return bool + */ + public function create() { + $secret_data = array( + 'secret' => $this->generate_secret(), + 'expires_at' => strval( time() + static::LIFESPAN ), + ); + + $result = Jetpack_Options::update_option( static::OPTION_KEY, $secret_data ); + + if ( ! $result ) { + throw new Exception( esc_html__( 'Unable to save new URL secret', 'jetpack-connection' ) ); + } + + $this->secret = $secret_data['secret']; + $this->expires_at = $secret_data['expires_at']; + + return true; + } + + /** + * Get the URL secret. + * + * @return string|null + */ + public function get_secret() { + return $this->secret; + } + + /** + * Get the URL secret expiration date. + * + * @return string|null + */ + public function get_expires_at() { + return $this->expires_at; + } + + /** + * Check if the secret exists. + * + * @return bool + */ + public function exists() { + return $this->secret && $this->expires_at; + } + + /** + * Generate the secret string. + * + * @return string + */ + private function generate_secret() { + return wp_generate_password( 12, false ); + } + + /** + * Generate secret for response. + * + * @param string $flow used to tell which flow generated the exception. + * @return string|null + */ + public static function create_secret( $flow = 'generating_secret_failed' ) { + $secret_value = null; + try { + + $secret = new self(); + $secret->create(); + + if ( $secret->exists() ) { + $secret_value = $secret->get_secret(); + } + } catch ( Exception $e ) { + // Track the error and proceed. + ( new Tracking() )->record_user_event( $flow, array( 'current_url' => Urls::site_url() ) ); + } + return $secret_value; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php new file mode 100644 index 00000000..804f3848 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php @@ -0,0 +1,17 @@ +role = apply_filters( 'jetpack_force_2fa_cap', 'manage_options' ); + + // Bail if Jetpack SSO is not active + if ( ! ( new Modules() )->is_active( 'sso' ) ) { + add_action( 'admin_notices', array( $this, 'admin_notice' ) ); + return; + } + + $this->force_2fa(); + } + + /** + * Display an admin notice if Jetpack SSO is not active. + */ + public function admin_notice() { + /** + * Filter if an admin notice is deplayed when Force 2FA is required, but SSO is not enabled. + * Defaults to true. + * + * @param bool $display_notice Whether to display the notice. + * @return bool + * @since jetpack-12.7 + * @module SSO + */ + if ( apply_filters( 'jetpack_force_2fa_dependency_notice', true ) && current_user_can( $this->role ) ) { + wp_admin_notice( + esc_html__( 'Jetpack Force 2FA requires Jetpack’s SSO feature.', 'jetpack-connection' ), + array( + 'type' => 'warning', + ) + ); + } + } + + /** + * Force 2FA when using Jetpack SSO and force Jetpack SSO. + * + * @return void + */ + private function force_2fa() { + // Allows WP.com login to a local account if it matches the local account. + add_filter( 'jetpack_sso_match_by_email', '__return_true', 9999 ); + + // multisite + if ( is_multisite() ) { + + // Hide the login form + add_filter( 'jetpack_remove_login_form', '__return_true', 9999 ); + add_filter( 'jetpack_sso_bypass_login_forward_wpcom', '__return_true', 9999 ); + add_filter( 'jetpack_sso_display_disclaimer', '__return_false', 9999 ); + + add_filter( + 'wp_authenticate_user', + function () { + return new WP_Error( 'wpcom-required', $this->get_login_error_message() ); }, + 9999 + ); + + add_filter( 'jetpack_sso_require_two_step', '__return_true' ); + + add_filter( 'allow_password_reset', '__return_false' ); + } else { + // Not multisite. + + // Completely disable the standard login form for admins. + add_filter( + 'wp_authenticate_user', + function ( $user ) { + if ( is_wp_error( $user ) ) { + return $user; + } + if ( $user->has_cap( $this->role ) ) { + return new WP_Error( 'wpcom-required', $this->get_login_error_message(), $user->user_login ); + } + return $user; + }, + 9999 + ); + + add_filter( + 'allow_password_reset', + function ( $allow, $user_id ) { + if ( user_can( $user_id, $this->role ) ) { + return false; + } + return $allow; }, + 9999, + 2 + ); + + add_action( 'jetpack_sso_pre_handle_login', array( $this, 'jetpack_set_two_step' ) ); + } + } + + /** + * Specifically set the two step filter for Jetpack SSO. + * + * @param Object $user_data The user data from WordPress.com. + * + * @return void + */ + public function jetpack_set_two_step( $user_data ) { + $user = SSO::get_user_by_wpcom_id( $user_data->ID ); + + // Borrowed from Jetpack. Ignores the match_by_email setting. + if ( empty( $user ) ) { + $user = get_user_by( 'email', $user_data->email ); + } + + if ( $user && $user->has_cap( $this->role ) ) { + add_filter( 'jetpack_sso_require_two_step', '__return_true' ); + } + } + + /** + * Get the login error message. + * + * @return string + */ + private function get_login_error_message() { + /** + * Filter the login error message. + * Defaults to a message that explains the user must use a WordPress.com account with 2FA enabled. + * + * @param string $message The login error message. + * @return string + * @since jetpack-12.7 + * @module SSO + */ + return apply_filters( + 'jetpack_force_2fa_login_error_message', + sprintf( 'For added security, please log in using your WordPress.com account.

Note: Your account must have Two Step Authentication enabled, which can be configured from Security Settings.', 'https://support.wordpress.com/security/two-step-authentication/', 'https://wordpress.com/me/security/two-step' ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php new file mode 100644 index 00000000..2fdf7369 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php @@ -0,0 +1,387 @@ + $original_request ) + ); + } + + /** + * Check if the site has a custom login page URL, and return it. + * If default login page URL is used (`wp-login.php`), `null` will be returned. + * + * @return string|null + */ + public static function get_custom_login_url() { + $login_url = wp_login_url(); + + if ( str_ends_with( $login_url, 'wp-login.php' ) ) { + // No custom URL found. + return null; + } + + $site_url = trailingslashit( site_url() ); + + if ( ! str_starts_with( $login_url, $site_url ) ) { + // Something went wrong, we can't properly extract the custom URL. + return null; + } + + // Extracting the "path" part of the URL, because we don't need the `site_url` part. + return str_ireplace( $site_url, '', $login_url ); + } + + /** + * Clear the cookies that store the profile information for the last + * WPCOM user to connect. + */ + public static function clear_wpcom_profile_cookies() { + if ( isset( $_COOKIE[ 'jetpack_sso_wpcom_name_' . COOKIEHASH ] ) ) { + setcookie( + 'jetpack_sso_wpcom_name_' . COOKIEHASH, + ' ', + time() - YEAR_IN_SECONDS, + COOKIEPATH, + COOKIE_DOMAIN, + is_ssl(), + true + ); + } + + if ( isset( $_COOKIE[ 'jetpack_sso_wpcom_gravatar_' . COOKIEHASH ] ) ) { + setcookie( + 'jetpack_sso_wpcom_gravatar_' . COOKIEHASH, + ' ', + time() - YEAR_IN_SECONDS, + COOKIEPATH, + COOKIE_DOMAIN, + is_ssl(), + true + ); + } + } + + /** + * Remove an SSO connection for a user. + * + * @param int $user_id The local user id. + */ + public static function delete_connection_for_user( $user_id ) { + $wpcom_user_id = get_user_meta( $user_id, 'wpcom_user_id', true ); + if ( ! $wpcom_user_id ) { + return; + } + + $xml = new Jetpack_IXR_Client( + array( + 'wpcom_user_id' => $user_id, + ) + ); + $xml->query( 'jetpack.sso.removeUser', $wpcom_user_id ); + + if ( $xml->isError() ) { + return false; + } + + // Clean up local data stored for SSO. + delete_user_meta( $user_id, 'wpcom_user_id' ); + delete_user_meta( $user_id, 'wpcom_user_data' ); + self::clear_wpcom_profile_cookies(); + + return $xml->getResponse(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php new file mode 100644 index 00000000..289ba6c7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php @@ -0,0 +1,272 @@ +Security Settings to configure Two-step Authentication for your account.', + 'jetpack-connection' + ), + array( 'a' => array( 'href' => array() ) ) + ), + Redirect::get_url( 'calypso-me-security-two-step' ), + Redirect::get_url( 'wpcom-support-security-two-step-authentication' ) + ); + + $message .= sprintf( '

%s

', $error ); + + return $message; + } + + /** + * Error message displayed when the user tries to SSO, but match by email + * is off and they already have an account with their email address on + * this site. + * + * @param string $message Error message. + * @return string + */ + public static function error_msg_email_already_exists( $message ) { + $error = sprintf( + wp_kses( + /* translators: login URL */ + __( + 'You already have an account on this site. Please sign in with your username and password and then connect to WordPress.com.', + 'jetpack-connection' + ), + array( 'a' => array( 'href' => array() ) ) + ), + esc_url_raw( add_query_arg( 'jetpack-sso-show-default-form', '1', wp_login_url() ) ) + ); + + $message .= sprintf( '

%s

', $error ); + + return $message; + } + + /** + * Error message that is displayed when the current site is in an identity crisis and SSO can not be used. + * + * @since jetpack-4.3.2 + * + * @param string $message Error Message. + * + * @return string + */ + public static function error_msg_identity_crisis( $message ) { + $error = esc_html__( 'Logging in with WordPress.com is not currently available because this site is experiencing connection problems.', 'jetpack-connection' ); + $message .= sprintf( '

%s

', $error ); + return $message; + } + + /** + * Error message that is displayed when we are not able to verify the SSO nonce due to an XML error or + * failed validation. In either case, we prompt the user to try again or log in with username and password. + * + * @since jetpack-4.3.2 + * + * @param string $message Error message. + * + * @return string + */ + public static function error_invalid_response_data( $message ) { + $error = esc_html__( + 'There was an error logging you in via WordPress.com, please try again or try logging in with your username and password.', + 'jetpack-connection' + ); + $message .= sprintf( '

%s

', $error ); + return $message; + } + + /** + * Error message that is displayed when we were not able to automatically create an account for a user + * after a user has logged in via SSO. By default, this message is triggered after trying to create an account 5 times. + * + * @since jetpack-4.3.2 + * + * @param string $message Error message. + * + * @return string + */ + public static function error_unable_to_create_user( $message ) { + $error = esc_html__( + 'There was an error creating a user for you. Please contact the administrator of your site.', + 'jetpack-connection' + ); + $message .= sprintf( '

%s

', $error ); + return $message; + } + + /** + * When the default login form is hidden, this method is called on the 'authenticate' filter with a priority of 30. + * This method disables the ability to submit the default login form. + * + * @param WP_User|WP_Error $user Either the user attempting to login or an existing authentication failure. + * + * @return WP_Error + */ + public static function disable_default_login_form( $user ) { + if ( is_wp_error( $user ) ) { + return $user; + } + + /** + * Since we're returning an error that will be shown as a red notice, let's remove the + * informational "blue" notice. + */ + remove_filter( 'login_message', array( static::class, 'msg_login_by_jetpack' ) ); + return new WP_Error( 'jetpack_sso_required', self::get_sso_required_message() ); + } + + /** + * Message displayed when the site admin has disabled the default WordPress + * login form in Settings > General > Secure Sign On + * + * @since jetpack-2.7 + * @param string $message Error message. + * + * @return string + **/ + public static function msg_login_by_jetpack( $message ) { + $message .= sprintf( '

%s

', self::get_sso_required_message() ); + return $message; + } + + /** + * Get the message for SSO required. + * + * @return string + */ + public static function get_sso_required_message() { + $msg = esc_html__( + 'A WordPress.com account is required to access this site. Click the button below to sign in or create a free WordPress.com account.', + 'jetpack-connection' + ); + + /** + * Filter the message displayed when the default WordPress login form is disabled. + * + * @module sso + * + * @since jetpack-2.8.0 + * + * @param string $msg Disclaimer when default WordPress login form is disabled. + */ + return apply_filters( 'jetpack_sso_disclaimer_message', $msg ); + } + + /** + * Message displayed when the user can not be found after approving the SSO process on WordPress.com + * + * @param string $message Error message. + * + * @return string + */ + public static function cant_find_user( $message ) { + $error = __( + "We couldn't find your account. If you already have an account, make sure you have connected to WordPress.com.", + 'jetpack-connection' + ); + + /** + * Filters the "couldn't find your account" notice after an attempted SSO. + * + * @module sso + * + * @since jetpack-10.5.0 + * + * @param string $error Error text. + */ + $error = apply_filters( 'jetpack_sso_unknown_user_notice', $error ); + + $message .= sprintf( '

%s

', esc_html( $error ) ); + + return $message; + } + + /** + * Error message that is displayed when the current site is in an identity crisis and SSO can not be used. + * + * @since jetpack-4.4.0 + * @deprecated since 2.10.0 + * + * @param string $message Error message. + * + * @return string + */ + public static function sso_not_allowed_in_staging( $message ) { + _deprecated_function( __FUNCTION__, '2.10.0', 'sso_not_allowed_in_safe_mode' ); + $error = __( + 'Logging in with WordPress.com is disabled for sites that are in staging mode.', + 'jetpack-connection' + ); + + /** + * Filters the disallowed notice for staging sites attempting SSO. + * + * @module sso + * + * @since jetpack-10.5.0 + * + * @param string $error Error text. + */ + $error = apply_filters_deprecated( 'jetpack_sso_disallowed_staging_notice', array( $error ), '2.9.1', 'jetpack_sso_disallowed_safe_mode_notice' ); + $message .= sprintf( '

%s

', esc_html( $error ) ); + return $message; + } + + /** + * Error message that is displayed when the current site is in an identity crisis and SSO can not be used. + * + * @since 2.10.0 + * + * @param string $message Error message. + * + * @return string + */ + public static function sso_not_allowed_in_safe_mode( $message ) { + $error = __( + 'Logging in with WordPress.com is disabled for sites that are in safe mode.', + 'jetpack-connection' + ); + + /** + * Filters the disallowed notice for sites in safe mode attempting SSO. + * + * @module sso + * + * @since 2.10.0 + * + * @param string $error Error text. + */ + $error = apply_filters( 'jetpack_sso_disallowed_safe_mode_notice', $error ); + $message .= sprintf( '

%s

', esc_html( $error ) ); + return $message; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php new file mode 100644 index 00000000..b1c69934 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php @@ -0,0 +1,1276 @@ +is_user_connected() && + ! is_multisite() && + /** + * Toggle the ability to invite new users to create a WordPress.com account. + * + * @module sso + * + * @since 2.7.2 + * + * @param bool true Whether to allow admins to invite new users to create a WordPress.com account. + */ + apply_filters( 'jetpack_sso_invite_new_users_wpcom', true ) + ) { + new User_Admin(); + } + } + + /** + * Returns the single instance of the Automattic\Jetpack\Connection\SSO object + * + * @since jetpack-2.8 + * @return \Automattic\Jetpack\Connection\SSO + */ + public static function get_instance() { + if ( self::$instance !== null ) { + return self::$instance; + } + + self::$instance = new SSO(); + return self::$instance; + } + + /** + * Add SSO callables to the sync whitelist. + * + * @since 2.8.1 + * + * @param array $callables list of callables. + * + * @return array list of callables. + */ + public function sync_sso_callables( $callables ) { + $sso_callables = array( + 'sso_is_two_step_required' => array( Helpers::class, 'is_two_step_required' ), + 'sso_should_hide_login_form' => array( Helpers::class, 'should_hide_login_form' ), + 'sso_match_by_email' => array( Helpers::class, 'match_by_email' ), + 'sso_new_user_override' => array( Helpers::class, 'new_user_override' ), + 'sso_bypass_default_login_form' => array( Helpers::class, 'bypass_login_forward_wpcom' ), + ); + + return array_merge( $callables, $sso_callables ); + } + + /** + * Safety heads-up added to the logout messages when SSO is enabled. + * Some folks on a shared computer don't know that they need to log out of WordPress.com as well. + * + * @param WP_Error $errors WP_Error object. + */ + public function sso_reminder_logout_wpcom( $errors ) { + if ( ( new Host() )->is_wpcom_platform() ) { + return $errors; + } + + if ( ! empty( $errors->errors['loggedout'] ) ) { + $logout_message = wp_kses( + sprintf( + /* translators: %1$s is a link to the WordPress.com account settings page. */ + __( 'If you are on a shared computer, remember to also log out of WordPress.com.', 'jetpack-connection' ), + 'https://wordpress.com/me' + ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ); + $errors->add( 'jetpack-sso-show-logout', $logout_message, 'message' ); + } + return $errors; + } + + /** + * If jetpack_force_logout == 1 in current user meta the user will be forced + * to logout and reauthenticate with the site. + **/ + public function maybe_logout_user() { + global $current_user; + + if ( 1 === (int) $current_user->jetpack_force_logout ) { + delete_user_meta( $current_user->ID, 'jetpack_force_logout' ); + Helpers::delete_connection_for_user( $current_user->ID ); + wp_logout(); + wp_safe_redirect( wp_login_url() ); + exit; + } + } + + /** + * Adds additional methods the WordPress xmlrpc API for handling SSO specific features + * + * @param array $methods API methods. + * @return array + **/ + public function xmlrpc_methods( $methods ) { + $methods['jetpack.userDisconnect'] = array( $this, 'xmlrpc_user_disconnect' ); + return $methods; + } + + /** + * Marks a user's profile for disconnect from WordPress.com and forces a logout + * the next time the user visits the site. + * + * @param int $user_id User to disconnect from the site. + **/ + public function xmlrpc_user_disconnect( $user_id ) { + $user_query = new WP_User_Query( + array( + 'meta_key' => 'wpcom_user_id', + 'meta_value' => $user_id, + ) + ); + $user = $user_query->get_results(); + $user = $user[0]; + + if ( $user instanceof WP_User ) { + $user = wp_set_current_user( $user->ID ); + update_user_meta( $user->ID, 'jetpack_force_logout', '1' ); + Helpers::delete_connection_for_user( $user->ID ); + return true; + } + return false; + } + + /** + * Enqueues scripts and styles necessary for SSO login. + */ + public function login_enqueue_scripts() { + global $action; + + if ( ! Helpers::display_sso_form_for_action( $action ) ) { + return; + } + + Assets::register_script( + 'jetpack-sso-login', + '../../dist/jetpack-sso-login.js', + __FILE__, + array( + 'enqueue' => true, + 'version' => Package_Version::PACKAGE_VERSION, + ) + ); + } + + /** + * Adds Jetpack SSO classes to login body + * + * @param array $classes Array of classes to add to body tag. + * @return array Array of classes to add to body tag. + */ + public function login_body_class( $classes ) { + global $action; + + if ( ! Helpers::display_sso_form_for_action( $action ) ) { + return $classes; + } + + // Always add the jetpack-sso class so that we can add SSO specific styling even when the SSO form isn't being displayed. + $classes[] = 'jetpack-sso'; + + if ( ! ( new Status() )->in_safe_mode() ) { + /** + * Should we show the SSO login form? + * + * $_GET['jetpack-sso-default-form'] is used to provide a fallback in case JavaScript is not enabled. + * + * The default_to_sso_login() method allows us to dynamically decide whether we show the SSO login form or not. + * The SSO module uses the method to display the default login form if we can not find a user to log in via SSO. + * But, the method could be filtered by a site admin to always show the default login form if that is preferred. + */ + if ( empty( $_GET['jetpack-sso-show-default-form'] ) && Helpers::show_sso_login() ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $classes[] = 'jetpack-sso-form-display'; + } + } + + return $classes; + } + + /** + * Inlined admin styles for SSO. + */ + public function print_inline_admin_css() { + ?> + + General > Secure Sign On that allows users to + * turn off the login form on wp-login.php + * + * @since jetpack-2.7 + **/ + public function register_settings() { + + add_settings_section( + 'jetpack_sso_settings', + __( 'Secure Sign On', 'jetpack-connection' ), + '__return_false', + 'jetpack-sso' + ); + + /* + * Settings > General > Secure Sign On + * Require two step authentication + */ + register_setting( + 'jetpack-sso', + 'jetpack_sso_require_two_step', + array( $this, 'validate_jetpack_sso_require_two_step' ) + ); + + add_settings_field( + 'jetpack_sso_require_two_step', + '', // Output done in render $callback: __( 'Require Two-Step Authentication' , 'jetpack-connection' ). + array( $this, 'render_require_two_step' ), + 'jetpack-sso', + 'jetpack_sso_settings' + ); + + /* + * Settings > General > Secure Sign On + */ + register_setting( + 'jetpack-sso', + 'jetpack_sso_match_by_email', + array( $this, 'validate_jetpack_sso_match_by_email' ) + ); + + add_settings_field( + 'jetpack_sso_match_by_email', + '', // Output done in render $callback: __( 'Match by Email' , 'jetpack-connection' ). + array( $this, 'render_match_by_email' ), + 'jetpack-sso', + 'jetpack_sso_settings' + ); + } + + /** + * Builds the display for the checkbox allowing user to require two step + * auth be enabled on WordPress.com accounts before login. Displays in Settings > General + * + * @since jetpack-2.7 + **/ + public function render_require_two_step() { + ?> + + General. + * + * @param bool $input The jetpack_sso_require_two_step option setting. + * + * @since jetpack-2.7 + * @return int + **/ + public function validate_jetpack_sso_require_two_step( $input ) { + return ( ! empty( $input ) ) ? 1 : 0; + } + + /** + * Builds the display for the checkbox allowing the user to allow matching logins by email + * Displays in Settings > General + * + * @since jetpack-2.9 + **/ + public function render_match_by_email() { + ?> + + General. + * + * @param bool $input The jetpack_sso_match_by_email option setting. + * + * @since jetpack-2.9 + * @return int + **/ + public function validate_jetpack_sso_match_by_email( $input ) { + return ( ! empty( $input ) ) ? 1 : 0; + } + + /** + * Checks to determine if the user wants to login on wp-login + * + * This function mostly exists to cover the exceptions to login + * that may exist as other parameters to $_GET[action] as $_GET[action] + * does not have to exist. By default WordPress assumes login if an action + * is not set, however this may not be true, as in the case of logout + * where $_GET[loggedout] is instead set + * + * @return boolean + **/ + private function wants_to_login() { + $wants_to_login = false; + + // Cover default WordPress behavior. + $action = isset( $_REQUEST['action'] ) ? filter_var( wp_unslash( $_REQUEST['action'] ) ) : 'login'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + + // And now the exceptions. + $action = isset( $_GET['loggedout'] ) ? 'loggedout' : $action; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + + if ( Helpers::display_sso_form_for_action( $action ) ) { + $wants_to_login = true; + } + + return $wants_to_login; + } + + /** + * Initialization for a SSO request. + */ + public function login_init() { + global $action; + + $tracking = new Tracking(); + + if ( Helpers::should_hide_login_form() ) { + /** + * Since the default authenticate filters fire at priority 20 for checking username and password, + * let's fire at priority 30. wp_authenticate_spam_check is fired at priority 99, but since we return a + * WP_Error in disable_default_login_form, then we won't trigger spam processing logic. + */ + add_filter( 'authenticate', array( Notices::class, 'disable_default_login_form' ), 30 ); + + /** + * Filter the display of the disclaimer message appearing when default WordPress login form is disabled. + * + * @module sso + * + * @since jetpack-2.8.0 + * + * @param bool true Should the disclaimer be displayed. Default to true. + */ + $display_sso_disclaimer = apply_filters( 'jetpack_sso_display_disclaimer', true ); + if ( $display_sso_disclaimer ) { + add_filter( 'login_message', array( Notices::class, 'msg_login_by_jetpack' ) ); + } + } + + if ( 'jetpack-sso' === $action ) { + if ( isset( $_GET['result'] ) && isset( $_GET['user_id'] ) && isset( $_GET['sso_nonce'] ) && 'success' === $_GET['result'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $this->handle_login(); + $this->display_sso_login_form(); + } elseif ( ( new Status() )->in_safe_mode() ) { + add_filter( 'login_message', array( Notices::class, 'sso_not_allowed_in_safe_mode' ) ); + } else { + // Is it wiser to just use wp_redirect than do this runaround to wp_safe_redirect? + add_filter( 'allowed_redirect_hosts', array( Helpers::class, 'allowed_redirect_hosts' ) ); + $reauth = ! empty( $_GET['force_reauth'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $sso_url = $this->get_sso_url_or_die( $reauth ); + + $tracking->record_user_event( 'sso_login_redirect_success' ); + wp_safe_redirect( $sso_url ); + exit; + } + } elseif ( Helpers::display_sso_form_for_action( $action ) ) { + + // Save cookies so we can handle redirects after SSO. + static::save_cookies(); + + /** + * Check to see if the site admin wants to automagically forward the user + * to the WordPress.com login page AND that the request to wp-login.php + * is not something other than login (Like logout!) + */ + if ( Helpers::bypass_login_forward_wpcom() && $this->wants_to_login() ) { + add_filter( 'allowed_redirect_hosts', array( Helpers::class, 'allowed_redirect_hosts' ) ); + $reauth = ! empty( $_GET['force_reauth'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $sso_url = $this->get_sso_url_or_die( $reauth ); + $tracking->record_user_event( 'sso_login_redirect_bypass_success' ); + wp_safe_redirect( $sso_url ); + exit; + } + + $this->display_sso_login_form(); + } + } + + /** + * Ensures that we can get a nonce from WordPress.com via XML-RPC before setting + * up the hooks required to display the SSO form. + */ + public function display_sso_login_form() { + add_filter( 'login_body_class', array( $this, 'login_body_class' ) ); + add_action( 'login_head', array( $this, 'print_inline_admin_css' ) ); + + if ( ( new Status() )->in_safe_mode() ) { + add_filter( 'login_message', array( Notices::class, 'sso_not_allowed_in_safe_mode' ) ); + return; + } + + $sso_nonce = self::request_initial_nonce(); + if ( is_wp_error( $sso_nonce ) ) { + return; + } + + add_action( 'login_form', array( $this, 'login_form' ) ); + add_action( 'login_enqueue_scripts', array( $this, 'login_enqueue_scripts' ) ); + } + + /** + * Conditionally save the redirect_to url as a cookie. + * + * @since jetpack-4.6.0 Renamed to save_cookies from maybe_save_redirect_cookies + */ + public static function save_cookies() { + if ( headers_sent() ) { + return new WP_Error( 'headers_sent', __( 'Cannot deal with cookie redirects, as headers are already sent.', 'jetpack-connection' ) ); + } + + setcookie( + 'jetpack_sso_original_request', + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sniff misses the wrapping esc_url_raw(). + esc_url_raw( set_url_scheme( ( isset( $_SERVER['HTTP_HOST'] ) ? wp_unslash( $_SERVER['HTTP_HOST'] ) : '' ) . ( isset( $_SERVER['REQUEST_URI'] ) ? wp_unslash( $_SERVER['REQUEST_URI'] ) : '' ) ) ), + time() + HOUR_IN_SECONDS, + COOKIEPATH, + COOKIE_DOMAIN, + is_ssl(), + true + ); + + if ( ! empty( $_GET['redirect_to'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + // If we have something to redirect to. + $url = esc_url_raw( wp_unslash( $_GET['redirect_to'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + setcookie( 'jetpack_sso_redirect_to', $url, time() + HOUR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); + } elseif ( ! empty( $_COOKIE['jetpack_sso_redirect_to'] ) ) { + // Otherwise, if it's already set, purge it. + setcookie( 'jetpack_sso_redirect_to', ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); + } + } + + /** + * Outputs the Jetpack SSO button and description as well as the toggle link + * for switching between Jetpack SSO and default login. + */ + public function login_form() { + $site_name = get_bloginfo( 'name' ); + if ( ! $site_name ) { + $site_name = get_bloginfo( 'url' ); + } + + $display_name = ! empty( $_COOKIE[ 'jetpack_sso_wpcom_name_' . COOKIEHASH ] ) + ? sanitize_text_field( wp_unslash( $_COOKIE[ 'jetpack_sso_wpcom_name_' . COOKIEHASH ] ) ) + : false; + $gravatar = ! empty( $_COOKIE[ 'jetpack_sso_wpcom_gravatar_' . COOKIEHASH ] ) + ? esc_url_raw( wp_unslash( $_COOKIE[ 'jetpack_sso_wpcom_gravatar_' . COOKIEHASH ] ) ) + : false; + + ?> +
+ +
+ + +

+ %s', 'jetpack-connection' ), esc_html( $display_name ) ), + array( 'span' => true ) + ); + ?> +

+
+ + + + +
+ build_sso_button( array(), true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaping done in build_sso_button() ?> + + + + + + +

+ +

+ +
+ + +
+ +
+ + + + + + + + + +
+ is_user_connected() ) { + Helpers::delete_connection_for_user( get_current_user_id() ); + } + } + + /** + * Retrieves nonce used for SSO form. + * + * @return string|WP_Error + */ + public static function request_initial_nonce() { + $nonce = ! empty( $_COOKIE['jetpack_sso_nonce'] ) + ? sanitize_key( wp_unslash( $_COOKIE['jetpack_sso_nonce'] ) ) + : false; + + if ( ! $nonce ) { + $xml = new Jetpack_IXR_Client(); + $xml->query( 'jetpack.sso.requestNonce' ); + + if ( $xml->isError() ) { + return new WP_Error( $xml->getErrorCode(), $xml->getErrorMessage() ); + } + + $nonce = sanitize_key( $xml->getResponse() ); + + setcookie( + 'jetpack_sso_nonce', + $nonce, + time() + ( 10 * MINUTE_IN_SECONDS ), + COOKIEPATH, + COOKIE_DOMAIN, + is_ssl(), + true + ); + } + + return $nonce; + } + + /** + * The function that actually handles the login! + */ + public function handle_login() { + $wpcom_nonce = isset( $_GET['sso_nonce'] ) ? sanitize_key( $_GET['sso_nonce'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $wpcom_user_id = isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + + $xml = new Jetpack_IXR_Client(); + $xml->query( 'jetpack.sso.validateResult', $wpcom_nonce, $wpcom_user_id ); + + $user_data = $xml->isError() ? false : $xml->getResponse(); + if ( empty( $user_data ) ) { + add_filter( 'jetpack_sso_default_to_sso_login', '__return_false' ); + add_filter( 'login_message', array( Notices::class, 'error_invalid_response_data' ) ); + return; + } + + $user_data = (object) $user_data; + $user = null; + + /** + * Fires before Jetpack's SSO modifies the log in form. + * + * @module sso + * + * @since jetpack-2.6.0 + * + * @param object $user_data WordPress.com User information. + */ + do_action( 'jetpack_sso_pre_handle_login', $user_data ); + + $tracking = new Tracking(); + + if ( Helpers::is_two_step_required() && 0 === (int) $user_data->two_step_enabled ) { + $this->user_data = $user_data; + + $tracking->record_user_event( + 'sso_login_failed', + array( + 'error_message' => 'error_msg_enable_two_step', + ) + ); + + $error = new WP_Error( 'two_step_required', __( 'You must have Two-Step Authentication enabled on your WordPress.com account.', 'jetpack-connection' ) ); + + /** This filter is documented in core/src/wp-includes/pluggable.php */ + do_action( 'wp_login_failed', $user_data->login, $error ); + add_filter( 'login_message', array( Notices::class, 'error_msg_enable_two_step' ) ); + return; + } + + $user_found_with = ''; + if ( empty( $user ) && isset( $user_data->external_user_id ) ) { + $user_found_with = 'external_user_id'; + $user = get_user_by( 'id', (int) $user_data->external_user_id ); + if ( $user ) { + $expected_id = get_user_meta( $user->ID, 'wpcom_user_id', true ); + if ( $expected_id && $expected_id != $user_data->ID ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison, Universal.Operators.StrictComparisons.LooseNotEqual + $error = new WP_Error( 'expected_wpcom_user', __( 'Something got a little mixed up and an unexpected WordPress.com user logged in.', 'jetpack-connection' ) ); + + $tracking->record_user_event( + 'sso_login_failed', + array( + 'error_message' => 'error_unexpected_wpcom_user', + ) + ); + + /** This filter is documented in core/src/wp-includes/pluggable.php */ + do_action( 'wp_login_failed', $user_data->login, $error ); + add_filter( 'login_message', array( Notices::class, 'error_invalid_response_data' ) ); // @todo Need to have a better notice. This is only for the sake of testing the validation. + return; + } + update_user_meta( $user->ID, 'wpcom_user_id', $user_data->ID ); + } + } + + // If we don't have one by wpcom_user_id, try by the email? + if ( empty( $user ) && Helpers::match_by_email() ) { + $user_found_with = 'match_by_email'; + $user = get_user_by( 'email', $user_data->email ); + if ( $user ) { + update_user_meta( $user->ID, 'wpcom_user_id', $user_data->ID ); + } + } + + // If we've still got nothing, create the user. + $new_user_override_role = Helpers::new_user_override( $user_data ); + if ( empty( $user ) && ( get_option( 'users_can_register' ) || $new_user_override_role ) ) { + /** + * If not matching by email we still need to verify the email does not exist + * or this blows up + * + * If match_by_email is true, we know the email doesn't exist, as it would have + * been found in the first pass. If get_user_by( 'email' ) doesn't find the + * user, then we know that email is unused, so it's safe to add. + */ + if ( Helpers::match_by_email() || ! get_user_by( 'email', $user_data->email ) ) { + + if ( $new_user_override_role ) { + $user_data->role = $new_user_override_role; + } + + $user = Utils::generate_user( $user_data ); + if ( ! $user ) { + $tracking->record_user_event( + 'sso_login_failed', + array( + 'error_message' => 'could_not_create_username', + ) + ); + add_filter( 'login_message', array( Notices::class, 'error_unable_to_create_user' ) ); + return; + } + + $user_found_with = $new_user_override_role + ? 'user_created_new_user_override' + : 'user_created_users_can_register'; + } else { + $tracking->record_user_event( + 'sso_login_failed', + array( + 'error_message' => 'error_msg_email_already_exists', + ) + ); + + $this->user_data = $user_data; + add_action( 'login_message', array( Notices::class, 'error_msg_email_already_exists' ) ); + return; + } + } + + /** + * Fires after we got login information from WordPress.com. + * + * @module sso + * + * @since jetpack-2.6.0 + * + * @param WP_User|false|null $user Local User information. + * @param object $user_data WordPress.com User Login information. + */ + do_action( 'jetpack_sso_handle_login', $user, $user_data ); + + if ( $user ) { + // Cache the user's details, so we can present it back to them on their user screen. + update_user_meta( $user->ID, 'wpcom_user_data', $user_data ); + + add_filter( 'auth_cookie_expiration', array( Helpers::class, 'extend_auth_cookie_expiration_for_sso' ) ); + wp_set_auth_cookie( $user->ID, true ); + remove_filter( 'auth_cookie_expiration', array( Helpers::class, 'extend_auth_cookie_expiration_for_sso' ) ); + + /** This filter is documented in core/src/wp-includes/user.php */ + do_action( 'wp_login', $user->user_login, $user ); + + wp_set_current_user( $user->ID ); + + $_request_redirect_to = isset( $_REQUEST['redirect_to'] ) ? esc_url_raw( wp_unslash( $_REQUEST['redirect_to'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $redirect_to = user_can( $user, 'edit_posts' ) ? admin_url() : self::profile_page_url(); + + // If we have a saved redirect to request in a cookie. + if ( ! empty( $_COOKIE['jetpack_sso_redirect_to'] ) ) { + // Set that as the requested redirect to. + $redirect_to = esc_url_raw( wp_unslash( $_COOKIE['jetpack_sso_redirect_to'] ) ); + $_request_redirect_to = $redirect_to; + } + + $json_api_auth_environment = Helpers::get_json_api_auth_environment(); + + $is_json_api_auth = ! empty( $json_api_auth_environment ); + $is_user_connected = ( new Manager() )->is_user_connected( $user->ID ); + $roles = new Roles(); + $tracking->record_user_event( + 'sso_user_logged_in', + array( + 'user_found_with' => $user_found_with, + 'user_connected' => (bool) $is_user_connected, + 'user_role' => $roles->translate_current_user_to_role(), + 'is_json_api_auth' => $is_json_api_auth, + ) + ); + + if ( $is_json_api_auth ) { + $authorize_json_api = new Authorize_Json_Api(); + $authorize_json_api->verify_json_api_authorization_request( $json_api_auth_environment ); + $authorize_json_api->store_json_api_authorization_token( $user->user_login, $user ); + + } elseif ( ! $is_user_connected ) { + wp_safe_redirect( + add_query_arg( + array( + 'redirect_to' => $redirect_to, + 'request_redirect_to' => $_request_redirect_to, + 'calypso_env' => ( new Host() )->get_calypso_env(), + 'jetpack-sso-auth-redirect' => '1', + ), + admin_url() + ) + ); + exit; + } + + add_filter( 'allowed_redirect_hosts', array( Helpers::class, 'allowed_redirect_hosts' ) ); + wp_safe_redirect( + /** This filter is documented in core/src/wp-login.php */ + apply_filters( 'login_redirect', $redirect_to, $_request_redirect_to, $user ) + ); + exit; + } + + add_filter( 'jetpack_sso_default_to_sso_login', '__return_false' ); + + $tracking->record_user_event( + 'sso_login_failed', + array( + 'error_message' => 'cant_find_user', + ) + ); + + $this->user_data = $user_data; + + $error = new WP_Error( 'account_not_found', __( 'Account not found. If you already have an account, make sure you have connected to WordPress.com.', 'jetpack-connection' ) ); + + /** This filter is documented in core/src/wp-includes/pluggable.php */ + do_action( 'wp_login_failed', $user_data->login, $error ); + add_filter( 'login_message', array( Notices::class, 'cant_find_user' ) ); + } + + /** + * Retrieve the admin profile page URL. + */ + public static function profile_page_url() { + return admin_url( 'profile.php' ); + } + + /** + * Builds the "Login to WordPress.com" button that is displayed on the login page as well as user profile page. + * + * @param array $args An array of arguments to add to the SSO URL. + * @param boolean $is_primary If the button have the `button-primary` class. + * @return string Returns the HTML markup for the button. + */ + public function build_sso_button( $args = array(), $is_primary = false ) { + $url = $this->build_sso_button_url( $args ); + $classes = $is_primary + ? 'jetpack-sso button button-primary' + : 'jetpack-sso button'; + + return sprintf( + '%3$s %4$s', + esc_url( $url ), + $classes, + '', + esc_html__( 'Log in with WordPress.com', 'jetpack-connection' ) + ); + } + + /** + * Builds a URL with `jetpack-sso` action and option args which is used to setup SSO. + * + * @param array $args An array of arguments to add to the SSO URL. + * @return string The URL used for SSO. + */ + public function build_sso_button_url( $args = array() ) { + $defaults = array( + 'action' => 'jetpack-sso', + ); + + $args = wp_parse_args( $args, $defaults ); + + if ( ! empty( $_GET['redirect_to'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $args['redirect_to'] = rawurlencode( esc_url_raw( wp_unslash( $_GET['redirect_to'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + } + + return add_query_arg( $args, wp_login_url() ); + } + + /** + * Retrieves a WordPress.com SSO URL with appropriate query parameters or dies. + * + * @param boolean $reauth If the user be forced to reauthenticate on WordPress.com. + * @param array $args Optional query parameters. + * @return string The WordPress.com SSO URL. + */ + public function get_sso_url_or_die( $reauth = false, $args = array() ) { + $custom_login_url = Helpers::get_custom_login_url(); + if ( $custom_login_url ) { + $args['login_url'] = rawurlencode( $custom_login_url ); + } + + if ( empty( $reauth ) ) { + $sso_redirect = $this->build_sso_url( $args ); + } else { + Helpers::clear_wpcom_profile_cookies(); + $sso_redirect = $this->build_reauth_and_sso_url( $args ); + } + + // If there was an error retrieving the SSO URL, then error. + if ( is_wp_error( $sso_redirect ) ) { + $error_message = sanitize_text_field( + sprintf( '%s: %s', $sso_redirect->get_error_code(), $sso_redirect->get_error_message() ) + ); + $tracking = new Tracking(); + $tracking->record_user_event( + 'sso_login_redirect_failed', + array( + 'error_message' => $error_message, + ) + ); + wp_die( esc_html( $error_message ) ); + } + + return $sso_redirect; + } + + /** + * Build WordPress.com SSO URL with appropriate query parameters. + * + * @param array $args Optional query parameters. + * @return string|WP_Error WordPress.com SSO URL + */ + public function build_sso_url( $args = array() ) { + $sso_nonce = ! empty( $args['sso_nonce'] ) ? $args['sso_nonce'] : self::request_initial_nonce(); + $defaults = array( + 'action' => 'jetpack-sso', + 'site_id' => Manager::get_site_id( true ), + 'sso_nonce' => $sso_nonce, + 'calypso_auth' => '1', + ); + + $args = wp_parse_args( $args, $defaults ); + + if ( is_wp_error( $sso_nonce ) ) { + return $sso_nonce; + } + + return add_query_arg( $args, 'https://wordpress.com/wp-login.php' ); + } + + /** + * Build WordPress.com SSO URL with appropriate query parameters, + * including the parameters necessary to force the user to reauthenticate + * on WordPress.com. + * + * @param array $args Optional query parameters. + * @return string|WP_Error WordPress.com SSO URL + */ + public function build_reauth_and_sso_url( $args = array() ) { + $sso_nonce = ! empty( $args['sso_nonce'] ) ? $args['sso_nonce'] : self::request_initial_nonce(); + $redirect = $this->build_sso_url( + array( + 'force_auth' => '1', + 'sso_nonce' => $sso_nonce, + ) + ); + + if ( is_wp_error( $redirect ) ) { + return $redirect; + } + + $defaults = array( + 'action' => 'jetpack-sso', + 'site_id' => Manager::get_site_id( true ), + 'sso_nonce' => $sso_nonce, + 'reauth' => '1', + 'redirect_to' => rawurlencode( $redirect ), + 'calypso_auth' => '1', + ); + + $args = wp_parse_args( $args, $defaults ); + + if ( is_wp_error( $args['sso_nonce'] ) ) { + return $args['sso_nonce']; + } + + return add_query_arg( $args, 'https://wordpress.com/wp-login.php' ); + } + + /** + * Determines local user associated with a given WordPress.com user ID. + * + * @since jetpack-2.6.0 + * + * @param int $wpcom_user_id User ID from WordPress.com. + * @return null|object Local user object if found, null if not. + */ + public static function get_user_by_wpcom_id( $wpcom_user_id ) { + $user_query = new WP_User_Query( + array( + 'meta_key' => 'wpcom_user_id', + 'meta_value' => (int) $wpcom_user_id, + 'number' => 1, + ) + ); + + $users = $user_query->get_results(); + return $users ? array_shift( $users ) : null; + } + + /** + * When jetpack-sso-auth-redirect query parameter is set, will redirect user to + * WordPress.com authorization flow. + * + * We redirect here instead of in handle_login() because Jetpack::init()->build_connect_url + * calls menu_page_url() which doesn't work properly until admin menus are registered. + */ + public function maybe_authorize_user_after_sso() { + if ( empty( $_GET['jetpack-sso-auth-redirect'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + return; + } + + $redirect_to = ! empty( $_GET['redirect_to'] ) ? esc_url_raw( wp_unslash( $_GET['redirect_to'] ) ) : admin_url(); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $request_redirect_to = ! empty( $_GET['request_redirect_to'] ) ? esc_url_raw( wp_unslash( $_GET['request_redirect_to'] ) ) : $redirect_to; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + + /** This filter is documented in core/src/wp-login.php */ + $redirect_after_auth = apply_filters( 'login_redirect', $redirect_to, $request_redirect_to, wp_get_current_user() ); + + /** + * Since we are passing this redirect to WordPress.com and therefore can not use wp_safe_redirect(), + * let's sanitize it here to make sure it's safe. If the redirect is not safe, then use admin_url(). + */ + $redirect_after_auth = wp_sanitize_redirect( $redirect_after_auth ); + $redirect_after_auth = wp_validate_redirect( $redirect_after_auth, admin_url() ); + + /** + * Return the raw connect URL with our redirect and attribute connection to SSO. + * We remove any other filters that may be turning on the in-place connection + * since we will be redirecting the user as opposed to iFraming. + */ + remove_all_filters( 'jetpack_use_iframe_authorization_flow' ); + add_filter( 'jetpack_use_iframe_authorization_flow', '__return_false' ); + + $connection = new Manager( 'jetpack-connection' ); + $connect_url = ( new Authorize_Redirect( $connection ) )->build_authorize_url( $redirect_after_auth, 'sso', true ); + + add_filter( 'allowed_redirect_hosts', array( Helpers::class, 'allowed_redirect_hosts' ) ); + wp_safe_redirect( $connect_url ); + exit; + } + + /** + * Cache user's display name and Gravatar so it can be displayed on the login screen. These cookies are + * stored when the user logs out, and then deleted when the user logs in. + */ + public function store_wpcom_profile_cookies_on_logout() { + $user_id = get_current_user_id(); + if ( ! ( new Manager() )->is_user_connected( $user_id ) ) { + return; + } + + $user_data = $this->get_user_data( $user_id ); + if ( ! $user_data ) { + return; + } + + setcookie( + 'jetpack_sso_wpcom_name_' . COOKIEHASH, + $user_data->display_name, + time() + WEEK_IN_SECONDS, + COOKIEPATH, + COOKIE_DOMAIN, + is_ssl(), + true + ); + + setcookie( + 'jetpack_sso_wpcom_gravatar_' . COOKIEHASH, + get_avatar_url( + $user_data->email, + array( + 'size' => 144, + 'default' => 'mystery', + ) + ), + time() + WEEK_IN_SECONDS, + COOKIEPATH, + COOKIE_DOMAIN, + is_ssl(), + true + ); + } + + /** + * Determines if a local user is connected to WordPress.com + * + * @since jetpack-2.8 + * @param integer $user_id - Local user id. + * @return boolean + **/ + public function is_user_connected( $user_id ) { + return $this->get_user_data( $user_id ); + } + + /** + * Retrieves a user's WordPress.com data + * + * @since jetpack-2.8 + * @param integer $user_id - Local user id. + * @return mixed null or stdClass + **/ + public function get_user_data( $user_id ) { + return get_user_meta( $user_id, 'wpcom_user_data', true ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php new file mode 100644 index 00000000..42c7e045 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php @@ -0,0 +1,1322 @@ + 'defer', + 'in_footer' => true, + 'enqueue' => true, + ) + ); + } + + /** + * Intercept the arguments for building the table, and create WP_User_Query instance + * + * @param array $args The search arguments. + * + * @return array + */ + public function set_user_query( $args ) { + self::$user_search = new WP_User_Query( $args ); + return $args; + } + + /** + * Revokes WordPress.com invitation. + * + * @param int $user_id The user ID. + */ + public function revoke_user_invite( $user_id ) { + try { + $has_pending_invite = self::has_pending_wpcom_invite( $user_id ); + + if ( $has_pending_invite ) { + $response = self::send_revoke_wpcom_invite( $has_pending_invite ); + $event = 'sso_user_invite_revoked'; + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $body = json_decode( wp_remote_retrieve_body( $response ) ); + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => 'invalid-revoke-api-error', + ); + + if ( ! empty( $body ) && ! empty( $body->message ) ) { + $tracking_event_data['error_message'] = $body->message; + } + self::$tracking->record_user_event( + $event, + $tracking_event_data + ); + return $response; + } + + $body = json_decode( $response['body'] ); + + if ( ! $body->deleted ) { + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => 'invalid-invite-revoke', + ) + ); + } else { + self::$tracking->record_user_event( $event, array( 'success' => 'true' ) ); + } + + return $response; + } else { + // Delete external contributor if it exists. + $wpcom_user_data = ( new Manager() )->get_connected_user_data( $user_id ); + if ( isset( $wpcom_user_data['ID'] ) ) { + return self::delete_external_contributor( $wpcom_user_data['ID'] ); + } + } + } catch ( \Exception $e ) { + return false; + } + } + + /** + * Renders invitations errors/success messages in users.php. + */ + public function handle_invitation_results() { + $valid_nonce = isset( $_GET['_wpnonce'] ) + ? wp_verify_nonce( sanitize_key( $_GET['_wpnonce'] ), 'jetpack-sso-invite-user' ) + : false; + + if ( ! $valid_nonce || ! isset( $_GET['jetpack-sso-invite-user'] ) ) { + return; + } + if ( $_GET['jetpack-sso-invite-user'] === 'success' ) { + return wp_admin_notice( __( 'User was invited successfully!', 'jetpack-connection' ), array( 'type' => 'success' ) ); + } + if ( $_GET['jetpack-sso-invite-user'] === 'reinvited-success' ) { + return wp_admin_notice( __( 'User was re-invited successfully!', 'jetpack-connection' ), array( 'type' => 'success' ) ); + } + + if ( $_GET['jetpack-sso-invite-user'] === 'successful-revoke' ) { + return wp_admin_notice( __( 'User invite revoked successfully.', 'jetpack-connection' ), array( 'type' => 'success' ) ); + } + + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-api-error-message'] ) ) { + return wp_admin_notice( wp_kses( wp_unslash( $_GET['jetpack-sso-api-error-message'] ), array() ), array( 'type' => 'error' ) ); + } + + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-error'] ) ) { + switch ( $_GET['jetpack-sso-invite-error'] ) { + case 'invalid-user': + return wp_admin_notice( __( 'Tried to invite a user that doesn’t exist.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'invalid-email': + return wp_admin_notice( __( 'Tried to invite a user that doesn’t have an email address.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'invalid-user-permissions': + return wp_admin_notice( __( 'You don’t have permission to invite users.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'invalid-user-revoke': + return wp_admin_notice( __( 'Tried to revoke an invite for a user that doesn’t exist.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'invalid-invite-revoke': + return wp_admin_notice( __( 'Tried to revoke an invite that doesn’t exist.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'invalid-revoke-permissions': + return wp_admin_notice( __( 'You don’t have permission to revoke invites.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'empty-invite': + return wp_admin_notice( __( 'There is no previous invite for this user', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'invalid-invite': + return wp_admin_notice( __( 'Attempted to send a new invitation to a user using an invite that doesn’t exist.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'error-revoke': + return wp_admin_notice( __( 'An error has occurred when revoking the invite for the user.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + case 'invalid-revoke-api-error': + return wp_admin_notice( __( 'An error has occurred when revoking the user invite.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + default: + return wp_admin_notice( __( 'An error has occurred when inviting the user to the site.', 'jetpack-connection' ), array( 'type' => 'error' ) ); + } + } + } + + /** + * Invites a user to connect to WordPress.com to allow them to log in via SSO. + */ + public function invite_user_to_wpcom() { + check_admin_referer( 'jetpack-sso-invite-user', 'invite_nonce' ); + $nonce = wp_create_nonce( 'jetpack-sso-invite-user' ); + $event = 'sso_user_invite_sent'; + + if ( ! current_user_can( 'create_users' ) ) { + $error = 'invalid-user-permissions'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error, + '_wpnonce' => $nonce, + ); + return self::create_error_notice_and_redirect( $query_params ); + } elseif ( isset( $_GET['user_id'] ) ) { + $user_id = intval( wp_unslash( $_GET['user_id'] ) ); + $user = get_user_by( 'id', $user_id ); + $user_email = $user->user_email; + + if ( ! $user || ! $user_email ) { + $reason = ! $user ? 'invalid-user' : 'invalid-email'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $reason, + '_wpnonce' => $nonce, + ); + + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $reason, + ) + ); + return self::create_error_notice_and_redirect( $query_params ); + } + + $blog_id = Manager::get_site_id( true ); + $roles = new Roles(); + $user_role = $roles->translate_user_to_role( $user ); + + $url = '/sites/' . $blog_id . '/invites/new'; + $response = Client::wpcom_json_api_request_as_user( + $url, + 'v2', + array( + 'method' => 'POST', + ), + array( + 'invitees' => array( + array( + 'email_or_username' => $user_email, + 'role' => $user_role, + ), + ), + ), + 'wpcom' + ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $error_code = 'invalid-invite-api-error'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error_code, + '_wpnonce' => $nonce, + ); + + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => $error_code, + ); + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + if ( ! empty( $body ) && ! empty( $body->message ) ) { + $query_params['jetpack-sso-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; + } + + self::$tracking->record_user_event( + $event, + $tracking_event_data + ); + return self::create_error_notice_and_redirect( $query_params ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + // access the first item since we're inviting one user. + if ( is_array( $body ) && ! empty( $body ) ) { + $body = $body[0]; + } + + $query_params = array( + 'jetpack-sso-invite-user' => $body->success ? 'success' : 'failed', + '_wpnonce' => $nonce, + ); + + if ( ! $body->success && $body->errors ) { + $response_error = array_keys( (array) $body->errors ); + $query_params['jetpack-sso-invite-error'] = $response_error[0]; + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $response_error[0], + ) + ); + } else { + self::$tracking->record_user_event( $event, array( 'success' => 'true' ) ); + } + + return self::create_error_notice_and_redirect( $query_params ); + } else { + $error = 'invalid-user'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error, + '_wpnonce' => $nonce, + ); + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $error, + ) + ); + return self::create_error_notice_and_redirect( $query_params ); + } + wp_die(); + } + + /** + * Revokes a user's invitation to connect to WordPress.com. + * + * @param string $invite_id The ID of the invite to revoke. + */ + public function send_revoke_wpcom_invite( $invite_id ) { + $blog_id = Manager::get_site_id( true ); + + $url = '/sites/' . $blog_id . '/invites/delete'; + return Client::wpcom_json_api_request_as_user( + $url, + 'v2', + array( + 'method' => 'POST', + ), + array( + 'invite_ids' => array( $invite_id ), + ), + 'wpcom' + ); + } + + /** + * Handles logic to revoke user invite. + */ + public function handle_request_revoke_invite() { + check_admin_referer( 'jetpack-sso-revoke-user-invite', 'revoke_invite_nonce' ); + $nonce = wp_create_nonce( 'jetpack-sso-invite-user' ); + $event = 'sso_user_invite_revoked'; + if ( ! current_user_can( 'promote_users' ) ) { + $error = 'invalid-revoke-permissions'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error, + '_wpnonce' => $nonce, + ); + + return self::create_error_notice_and_redirect( $query_params ); + } elseif ( isset( $_GET['user_id'] ) ) { + $user_id = intval( wp_unslash( $_GET['user_id'] ) ); + $user = get_user_by( 'id', $user_id ); + if ( ! $user ) { + $error = 'invalid-user-revoke'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error, + '_wpnonce' => $nonce, + ); + + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $error, + ) + ); + return self::create_error_notice_and_redirect( $query_params ); + } + + if ( ! isset( $_GET['invite_id'] ) ) { + $error = 'invalid-invite-revoke'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error, + '_wpnonce' => $nonce, + ); + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $error, + ) + ); + return self::create_error_notice_and_redirect( $query_params ); + } + + $invite_id = sanitize_text_field( wp_unslash( $_GET['invite_id'] ) ); + $response = self::send_revoke_wpcom_invite( $invite_id ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $error = 'invalid-revoke-api-error'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error, // general error message + '_wpnonce' => $nonce, + ); + + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => $error, + ); + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + if ( ! empty( $body ) && ! empty( $body->message ) ) { + $query_params['jetpack-sso-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; + } + + self::$tracking->record_user_event( + $event, + $tracking_event_data + ); + return self::create_error_notice_and_redirect( $query_params ); + } + + $body = json_decode( $response['body'] ); + $query_params = array( + 'jetpack-sso-invite-user' => $body->deleted ? 'successful-revoke' : 'failed', + '_wpnonce' => $nonce, + ); + if ( ! $body->deleted ) { // no invite was deleted, probably it does not exist + $error = 'invalid-invite-revoke'; + $query_params['jetpack-sso-invite-error'] = $error; + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $error, + ) + ); + } else { + self::$tracking->record_user_event( $event, array( 'success' => 'true' ) ); + } + return self::create_error_notice_and_redirect( $query_params ); + } else { + $error = 'invalid-user-revoke'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $error, + '_wpnonce' => $nonce, + ); + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $error, + ) + ); + return self::create_error_notice_and_redirect( $query_params ); + } + + wp_die(); + } + + /** + * Handles resend user invite. + */ + public function handle_request_resend_invite() { + check_admin_referer( 'jetpack-sso-resend-user-invite', 'resend_invite_nonce' ); + $nonce = wp_create_nonce( 'jetpack-sso-invite-user' ); + $event = 'sso_user_invite_resend'; + if ( ! current_user_can( 'create_users' ) ) { + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => 'invalid-user-permissions', + '_wpnonce' => $nonce, + ); + return self::create_error_notice_and_redirect( $query_params ); + } elseif ( isset( $_GET['invite_id'] ) ) { + $invite_slug = sanitize_text_field( wp_unslash( $_GET['invite_id'] ) ); + $blog_id = Manager::get_site_id( true ); + $url = '/sites/' . $blog_id . '/invites/resend'; + $response = Client::wpcom_json_api_request_as_user( + $url, + 'v2', + array( + 'method' => 'POST', + ), + array( + 'invite_slug' => $invite_slug, + ), + 'wpcom' + ); + + $status_code = wp_remote_retrieve_response_code( $response ); + + if ( 200 !== $status_code ) { + $message_type = $status_code === 404 ? 'invalid-invite' : ''; // empty is the general error message + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => $message_type, + '_wpnonce' => $nonce, + ); + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $message_type, + ) + ); + return self::create_error_notice_and_redirect( $query_params ); + } + + $body = json_decode( $response['body'] ); + $invite_response_message = $body->success ? 'reinvited-success' : 'failed'; + $query_params = array( + 'jetpack-sso-invite-user' => $invite_response_message, + '_wpnonce' => $nonce, + ); + + if ( ! $body->success ) { + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $invite_response_message, + ) + ); + } else { + self::$tracking->record_user_event( $event, array( 'success' => 'true' ) ); + } + + return self::create_error_notice_and_redirect( $query_params ); + } else { + $error = 'empty-invite'; + $query_params = array( + 'jetpack-sso-invite-user' => 'failed', + 'jetpack-sso-invite-error' => 'empty-invite', + '_wpnonce' => $nonce, + ); + self::$tracking->record_user_event( + $event, + array( + 'success' => 'false', + 'error_message' => $error, + ) + ); + return self::create_error_notice_and_redirect( $query_params ); + } + } + + /** + * Adds 'Revoke invite' and 'Resend invite' link to user table row actions. + * Removes 'Reset password' link. + * + * @param array $actions - User row actions. + * @param WP_User $user_object - User object. + */ + public function jetpack_user_table_row_actions( $actions, $user_object ) { + $user_id = $user_object->ID; + $has_pending_invite = self::has_pending_wpcom_invite( $user_id ); + + if ( current_user_can( 'promote_users' ) && $has_pending_invite ) { + $nonce = wp_create_nonce( 'jetpack-sso-revoke-user-invite' ); + $actions['sso_revoke_invite'] = sprintf( + '%s', + add_query_arg( + array( + 'action' => 'jetpack_revoke_invite_user_to_wpcom', + 'user_id' => $user_id, + 'revoke_invite_nonce' => $nonce, + 'invite_id' => $has_pending_invite, + ), + admin_url( 'admin-post.php' ) + ), + esc_html__( 'Revoke invite', 'jetpack-connection' ) + ); + } + if ( current_user_can( 'promote_users' ) && $has_pending_invite ) { + $nonce = wp_create_nonce( 'jetpack-sso-resend-user-invite' ); + $actions['sso_resend_invite'] = sprintf( + '%s', + add_query_arg( + array( + 'action' => 'jetpack_resend_invite_user_to_wpcom', + 'user_id' => $user_id, + 'resend_invite_nonce' => $nonce, + 'invite_id' => $has_pending_invite, + ), + admin_url( 'admin-post.php' ) + ), + esc_html__( 'Resend invite', 'jetpack-connection' ) + ); + } + + if ( + current_user_can( 'promote_users' ) + && ( + $has_pending_invite + || ( new Manager() )->is_user_connected( $user_id ) + ) + ) { + unset( $actions['resetpassword'] ); + } + + return $actions; + } + + /** + * Render the invitation email message. + */ + public function render_invitation_email_message() { + $message = wp_kses( + __( + 'We highly recommend inviting users to join WordPress.com and log in securely using Secure Sign On to ensure maximum security and efficiency.', + 'jetpack-connection' + ), + array( + 'a' => array( + 'class' => array(), + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ); + wp_admin_notice( + $message, + array( + 'id' => 'invitation_message', + 'type' => 'info', + 'dismissible' => false, + 'additional_classes' => array( 'jetpack-sso-admin-create-user-invite-message' ), + ) + ); + } + + /** + * Render a note that wp.com invites will be automatically revoked. + */ + public function render_invitations_notices_for_deleted_users() { + check_admin_referer( 'bulk-users' ); + + // When one user is deleted, the param is `user`, when multiple users are deleted, the param is `users`. + // We start with `users` and fallback to `user`. + $user_id = isset( $_GET['user'] ) ? intval( wp_unslash( $_GET['user'] ) ) : null; + $user_ids = isset( $_GET['users'] ) ? array_map( 'intval', wp_unslash( $_GET['users'] ) ) : array( $user_id ); + + $users_with_invites = array_filter( + $user_ids, + function ( $user_id ) { + return $user_id !== null && self::has_pending_wpcom_invite( $user_id ); + } + ); + + $users_with_invites = array_map( + function ( $user_id ) { + $user = get_user_by( 'id', $user_id ); + return $user->user_login; + }, + $users_with_invites + ); + + $invites_count = count( $users_with_invites ); + if ( $invites_count > 0 ) { + $users_with_invites = implode( ', ', $users_with_invites ); + $message = wp_kses( + sprintf( + /* translators: %s is a comma-separated list of user logins. */ + _n( + 'WordPress.com invitation will be automatically revoked for user: %s.', + 'WordPress.com invitations will be automatically revoked for users: %s.', + $invites_count, + 'jetpack-connection' + ), + $users_with_invites + ), + array( 'strong' => true ) + ); + wp_admin_notice( + $message, + array( + 'id' => 'invitation_message', + 'type' => 'info', + 'dismissible' => false, + 'additional_classes' => array( 'jetpack-sso-admin-create-user-invite-message' ), + ) + ); + } + } + + /** + * Render WordPress.com invite checkbox for new user registration. + * + * @param string $type The type of new user form the hook follows. + */ + public function render_wpcom_invite_checkbox( $type ) { + /* + * Only check this box by default on WordPress.com sites + * that do not use the WooCommerce plugin. + */ + $is_checked = ( new Host() )->is_wpcom_platform() && ! class_exists( 'WooCommerce' ); + + if ( $type === 'add-new-user' ) { + ?> + + + + + +
+ + +
+ + + + +
+
+ is_wpcom_platform() ) { + return; + } + + if ( $type === 'add-new-user' ) { + ?> + + + + + +
+ + +
+ + + + +
+
+ + + + + + +
+ + +
+ 500 + ) { + $errors->add( + 'custom_email_message', + wp_kses( + __( 'Error: The custom message is too long. Please keep it under 500 characters.', 'jetpack-connection' ), + array( + 'strong' => array(), + ) + ) + ); + } + + $site_id = Manager::get_site_id( true ); + if ( ! $site_id ) { + $errors->add( + 'invalid_site_id', + wp_kses( + __( 'Error: Invalid site ID.', 'jetpack-connection' ), + array( + 'strong' => array(), + ) + ) + ); + } + + // Bail if there are any errors. + if ( $errors->has_errors() ) { + return $errors; + } + + $new_user_request = array( + 'email_or_username' => sanitize_email( $user->user_email ), + 'role' => sanitize_key( $user->role ), + ); + + if ( + isset( $_POST['custom_email_message'] ) + && strlen( sanitize_text_field( wp_unslash( $_POST['custom_email_message'] ) ) ) > 0 + ) { + $new_user_request['message'] = sanitize_text_field( wp_unslash( $_POST['custom_email_message'] ) ); + } + + if ( isset( $_POST['user_external_contractor'] ) ) { + $new_user_request['is_external'] = true; + } + + $response = Client::wpcom_json_api_request_as_user( + sprintf( + '/sites/%d/invites/new', + (int) $site_id + ), + '2', // Api version + array( + 'method' => 'POST', + ), + array( + 'invitees' => array( $new_user_request ), + ) + ); + + $event_name = 'sso_new_user_invite_sent'; + $custom_message_sent = isset( $new_user_request['message'] ) ? 'true' : 'false'; + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $errors->add( + 'invitation_not_sent', + wp_kses( + __( 'Error: The user invitation email could not be sent, the user account was not created.', 'jetpack-connection' ), + array( + 'strong' => array(), + ) + ) + ); + self::$tracking->record_user_event( + $event_name, + array( + 'success' => 'false', + 'error' => wp_remote_retrieve_body( $response ), // Get as much information as possible. + ) + ); + } else { + self::$tracking->record_user_event( + $event_name, + array( + 'success' => 'true', + 'custom_message_sent' => $custom_message_sent, + ) + ); + } + + return $errors; + } + + /** + * Adds a column in the user admin table to display user connection status and actions. + * + * @param array $columns User list table columns. + * + * @return array + */ + public function jetpack_user_connected_th( $columns ) { + Assets::register_script( + 'jetpack-sso-users', + '../../dist/jetpack-sso-users.js', + __FILE__, + array( + 'strategy' => 'defer', + 'in_footer' => true, + 'enqueue' => true, + 'version' => Package_Version::PACKAGE_VERSION, + ) + ); + + $tooltip_string = esc_attr__( 'Jetpack SSO allows a seamless and secure experience on WordPress.com. Join millions of WordPress users who trust us to keep their accounts safe.', 'jetpack-connection' ); + + wp_add_inline_script( + 'jetpack-sso-users', + "var Jetpack_SSOTooltip = { 'tooltipString': '{$tooltip_string}' }", + 'before' + ); + + $columns['user_jetpack'] = sprintf( + '%2$s', + $tooltip_string, + esc_html__( 'SSO Status', 'jetpack-connection' ), + esc_attr__( 'Tooltip', 'jetpack-connection' ) + ); + return $columns; + } + + /** + * Executed when our WP_User_Query instance is set, and we don't have cached invites. + * This function uses the user emails and the 'are-users-invited' endpoint to build the cache. + * + * @return void + */ + private static function rebuild_invite_cache() { + $blog_id = Manager::get_site_id( true ); + + if ( self::$cached_invites === null && self::$user_search !== null ) { + + self::$cached_invites = array(); + + $results = self::$user_search->get_results(); + + $user_emails = array_reduce( + $results, + function ( $current, $item ) { + if ( ! ( new Manager() )->is_user_connected( $item->ID ) ) { + $current[] = rawurlencode( $item->user_email ); + } else { + self::$cached_invites[] = array( + 'email_or_username' => $item->user_email, + 'invited' => false, + 'invite_code' => '', + ); + } + return $current; + }, + array() + ); + + if ( ! empty( $user_emails ) ) { + $url = '/sites/' . $blog_id . '/invites/are-users-invited'; + + $response = Client::wpcom_json_api_request_as_user( + $url, + 'v2', + array( + 'method' => 'POST', + ), + array( 'users' => $user_emails ), + 'wpcom' + ); + + if ( 200 === wp_remote_retrieve_response_code( $response ) ) { + $body = json_decode( $response['body'], true ); + + // ensure array_merge happens with the right parameters + if ( empty( $body ) ) { + $body = array(); + } + + self::$cached_invites = array_merge( self::$cached_invites, $body ); + } + } + } + } + + /** + * Check if there is cached invite for a user email. + * + * @access private + * @static + * + * @param string $email The user email. + * + * @return array|void Returns the cached invite if found. + */ + public static function get_pending_cached_wpcom_invite( $email ) { + if ( self::$cached_invites === null ) { + self::rebuild_invite_cache(); + } + + if ( ! empty( self::$cached_invites ) && is_array( self::$cached_invites ) ) { + $index = array_search( $email, array_column( self::$cached_invites, 'email_or_username' ), true ); + if ( $index !== false ) { + return self::$cached_invites[ $index ]; + } + } + } + + /** + * Check if a given user is invited to the site. + * + * @access private + * @static + * @param int $user_id The user ID. + * + * @return false|string returns the user invite code if the user is invited, false otherwise. + */ + private static function has_pending_wpcom_invite( $user_id ) { + $blog_id = Manager::get_site_id( true ); + $user = get_user_by( 'id', $user_id ); + $cached_invite = self::get_pending_cached_wpcom_invite( $user->user_email ); + + if ( $cached_invite ) { + return $cached_invite['invite_code']; + } + + $url = '/sites/' . $blog_id . '/invites/is-invited'; + $url = add_query_arg( + array( + 'email_or_username' => rawurlencode( $user->user_email ), + ), + $url + ); + $response = Client::wpcom_json_api_request_as_user( + $url, + 'v2', + array(), + null, + 'wpcom' + ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + $body_response = wp_remote_retrieve_body( $response ); + if ( empty( $body_response ) ) { + return false; + } + + $body = json_decode( $body_response, true ); + if ( ! empty( $body['invite_code'] ) ) { + return $body['invite_code']; + } + + return false; + } + + /** + * Delete an external contributor from the site. + * + * @access private + * @static + * @param int $user_id The user ID. + * + * @return bool Returns true if the user was successfully deleted, false otherwise. + */ + private static function delete_external_contributor( $user_id ) { + $blog_id = Manager::get_site_id( true ); + $url = '/sites/' . $blog_id . '/external-contributors/remove'; + $response = Client::wpcom_json_api_request_as_user( + $url, + 'v2', + array( + 'method' => 'POST', + ), + array( + 'user_id' => $user_id, + ), + 'wpcom' + ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + return true; + } + + /** + * Show Jetpack SSO user connection status. + * + * @param string $val HTML for the column. + * @param string $col User list table column. + * @param int $user_id User ID. + * + * @return string + */ + public function jetpack_show_connection_status( $val, $col, $user_id ) { + if ( 'user_jetpack' === $col ) { + if ( ( new Manager() )->is_user_connected( $user_id ) ) { + $connection_html = sprintf( + '%2$s', + esc_attr__( 'This user is connected and can log-in to this site.', 'jetpack-connection' ), + esc_html__( 'Connected', 'jetpack-connection' ) + ); + return $connection_html; + } else { + $has_pending_invite = self::has_pending_wpcom_invite( $user_id ); + if ( $has_pending_invite ) { + $connection_html = sprintf( + '%2$s', + esc_attr__( 'This user didn’t accept the invitation to join this site yet.', 'jetpack-connection' ), + esc_html__( 'Pending invite', 'jetpack-connection' ) + ); + return $connection_html; + } + $nonce = wp_create_nonce( 'jetpack-sso-invite-user' ); + $connection_html = sprintf( + // Using formmethod and formaction because we can't nest forms and have to submit using the main form. + ' + %2$s + + %3$s + + ', + add_query_arg( + array( + 'user_id' => $user_id, + 'invite_nonce' => $nonce, + 'action' => 'jetpack_invite_user_to_wpcom', + ), + admin_url( 'admin-post.php' ) + ), + esc_html__( 'Send invite', 'jetpack-connection' ), + esc_attr__( 'This user doesn’t have an SSO connection to WordPress.com. Invite them to the site to increase security and improve their experience.', 'jetpack-connection' ), + esc_attr__( 'Tooltip', 'jetpack-connection' ) + ); + return $connection_html; + } + } + return $val; + } + + /** + * Creates error notices and redirects the user to the previous page. + * + * @param array $query_params - query parameters added to redirection URL. + */ + public function create_error_notice_and_redirect( $query_params ) { + $ref = wp_get_referer(); + if ( empty( $ref ) ) { + $ref = network_admin_url( 'users.php' ); + } + + $url = add_query_arg( + $query_params, + $ref + ); + return wp_safe_redirect( $url ); + } + + /** + * Style the Jetpack user rows and columns. + */ + public function jetpack_user_table_styles() { + ?> + + p, +.jetpack-sso-form-display #loginform>div { + display: none; +} + +.jetpack-sso-form-display #loginform #jetpack-sso-wrap { + display: block; +} + +.jetpack-sso-form-display #loginform { + padding: 26px 24px; +} + +.jetpack-sso-or { + margin-bottom: 16px; + position: relative; + text-align: center; +} + +.jetpack-sso-or:before { + background: #dcdcde; + content: ''; + height: 1px; + position: absolute; + left: 0; + top: 50%; + width: 100%; +} + +.jetpack-sso-or span { + background: #fff; + color: #777; + position: relative; + padding: 0 8px; + text-transform: uppercase +} + +#jetpack-sso-wrap .button { + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-bottom: 16px; + width: 100%; +} + +#jetpack-sso-wrap .button .genericon-wordpress { + font-size: 24px; + margin-right: 4px; +} + +#jetpack-sso-wrap__user img { + border-radius: 50%; + display: block; + margin: 0 auto 16px; +} + +#jetpack-sso-wrap__user h2 { + font-size: 21px; + font-weight: 300; + margin-bottom: 16px; + text-align: center; +} + +#jetpack-sso-wrap__user h2 span { + font-weight: bold; +} + +.jetpack-sso-wrap__reauth { + margin-bottom: 16px; +} + +.jetpack-sso-form-display #nav { + display: none; +} + +.jetpack-sso-form-display #backtoblog { + margin: 24px 0 0; +} + +.jetpack-sso-clear:after { + content: ""; + display: table; + clear: both; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js new file mode 100644 index 00000000..980741be --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js @@ -0,0 +1,27 @@ +document.addEventListener( 'DOMContentLoaded', () => { + const body = document.querySelector( 'body' ), + toggleSSO = document.querySelector( '.jetpack-sso-toggle' ), + userLogin = document.getElementById( 'user_login' ), + userPassword = document.getElementById( 'user_pass' ), + ssoWrap = document.getElementById( 'jetpack-sso-wrap' ), + loginForm = document.getElementById( 'loginform' ), + overflow = document.createElement( 'div' ); + + overflow.className = 'jetpack-sso-clear'; + + loginForm.appendChild( overflow ); + overflow.appendChild( document.querySelector( 'p.forgetmenot' ) ); + overflow.appendChild( document.querySelector( 'p.submit' ) ); + + loginForm.appendChild( ssoWrap ); + body.classList.add( 'jetpack-sso-repositioned' ); + + toggleSSO.addEventListener( 'click', e => { + e.preventDefault(); + body.classList.toggle( 'jetpack-sso-form-display' ); + if ( ! body.classList.contains( 'jetpack-sso-form-display' ) ) { + userLogin.focus(); + userPassword.disabled = false; + } + } ); +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js new file mode 100644 index 00000000..242786a9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js @@ -0,0 +1,64 @@ +document.addEventListener( 'DOMContentLoaded', function () { + document + .querySelectorAll( '.jetpack-sso-invitation-tooltip-icon:not(.sso-disconnected-user)' ) + .forEach( function ( tooltip ) { + tooltip.innerHTML += ' [?]'; + + const tooltipTextbox = document.createElement( 'span' ); + tooltipTextbox.classList.add( 'jetpack-sso-invitation-tooltip', 'jetpack-sso-th-tooltip' ); + + const tooltipString = window.Jetpack_SSOTooltip.tooltipString; + tooltipTextbox.innerHTML += tooltipString; + + tooltip.addEventListener( 'mouseenter', appendTooltip ); + tooltip.addEventListener( 'focus', appendTooltip ); + tooltip.addEventListener( 'mouseleave', removeTooltip ); + tooltip.addEventListener( 'blur', removeTooltip ); + + /** + * Display the tooltip textbox. + */ + function appendTooltip() { + tooltip.appendChild( tooltipTextbox ); + tooltipTextbox.style.display = 'block'; + } + + /** + * Remove the tooltip textbox. + */ + function removeTooltip() { + // Only remove tooltip if the element isn't currently active. + if ( document.activeElement === tooltip ) { + return; + } + tooltip.removeChild( tooltipTextbox ); + } + } ); + document + .querySelectorAll( '.jetpack-sso-invitation-tooltip-icon:not(.jetpack-sso-status-column)' ) + .forEach( function ( tooltip ) { + tooltip.addEventListener( 'mouseenter', appendSSOInvitationTooltip ); + tooltip.addEventListener( 'focus', appendSSOInvitationTooltip ); + tooltip.addEventListener( 'mouseleave', removeSSOInvitationTooltip ); + tooltip.addEventListener( 'blur', removeSSOInvitationTooltip ); + } ); + + /** + * Display the SSO invitation tooltip textbox. + */ + function appendSSOInvitationTooltip() { + this.querySelector( '.jetpack-sso-invitation-tooltip' ).style.display = 'block'; + } + + /** + * Remove the SSO invitation tooltip textbox. + * + * @param {Event} event - Triggering event. + */ + function removeSSOInvitationTooltip( event ) { + if ( document.activeElement === event.target ) { + return; + } + this.querySelector( '.jetpack-sso-invitation-tooltip' ).style.display = 'none'; + } +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php new file mode 100644 index 00000000..be6e886d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php @@ -0,0 +1,211 @@ +connection = $connection; + } + + /** + * Handle the webhook + * + * This method implements what's in Jetpack::admin_page_load when the Jetpack plugin is not present + * + * @return never + */ + public function handle() { + + add_filter( + 'allowed_redirect_hosts', + function ( $domains ) { + $domains[] = 'jetpack.com'; + $domains[] = 'jetpack.wordpress.com'; + $domains[] = 'wordpress.com'; + // Calypso envs. + $domains[] = 'calypso.localhost'; + $domains[] = 'wpcalypso.wordpress.com'; + $domains[] = 'horizon.wordpress.com'; + return array_unique( $domains ); + } + ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $dest_url = empty( $_GET['dest_url'] ) ? null : esc_url_raw( wp_unslash( $_GET['dest_url'] ) ); + + if ( ! $dest_url || ( 0 === stripos( $dest_url, 'https://jetpack.com/' ) && 0 === stripos( $dest_url, 'https://wordpress.com/' ) ) ) { + // The destination URL is missing or invalid, nothing to do here. + exit; + } + + // The user is either already connected, or finished the connection process. + if ( $this->connection->is_connected() && $this->connection->is_user_connected() ) { + if ( class_exists( '\Automattic\Jetpack\Licensing' ) && method_exists( '\Automattic\Jetpack\Licensing', 'handle_user_connected_redirect' ) ) { + Licensing::instance()->handle_user_connected_redirect( $dest_url ); + } + + wp_safe_redirect( $dest_url ); + exit; + } elseif ( ! empty( $_GET['done'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + // The user decided not to proceed with setting up the connection. + + wp_safe_redirect( Admin_Menu::get_top_level_menu_item_url() ); + exit; + } + + $redirect_args = array( + 'page' => 'jetpack', + 'action' => 'authorize_redirect', + 'dest_url' => rawurlencode( $dest_url ), + 'done' => '1', + ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! empty( $_GET['from'] ) && 'jetpack_site_only_checkout' === $_GET['from'] ) { + $redirect_args['from'] = 'jetpack_site_only_checkout'; + } + + wp_safe_redirect( $this->build_authorize_url( add_query_arg( $redirect_args, admin_url( 'admin.php' ) ) ) ); + exit; + } + + /** + * Create the Jetpack authorization URL. + * + * @since 2.7.6 Added optional $from and $raw parameters. + * + * @param bool|string $redirect URL to redirect to. + * @param bool|string $from If not false, adds 'from=$from' param to the connect URL. + * @param bool $raw If true, URL will not be escaped. + * + * @todo Update default value for redirect since the called function expects a string. + * + * @return mixed|void + */ + public function build_authorize_url( $redirect = false, $from = false, $raw = false ) { + + add_filter( 'jetpack_connect_request_body', array( __CLASS__, 'filter_connect_request_body' ) ); + add_filter( 'jetpack_connect_redirect_url', array( __CLASS__, 'filter_connect_redirect_url' ) ); + + $url = $this->connection->get_authorization_url( wp_get_current_user(), $redirect, $from, $raw ); + + remove_filter( 'jetpack_connect_request_body', array( __CLASS__, 'filter_connect_request_body' ) ); + remove_filter( 'jetpack_connect_redirect_url', array( __CLASS__, 'filter_connect_redirect_url' ) ); + + /** + * Filter the URL used when authorizing a user to a WordPress.com account. + * + * @since jetpack-8.9.0 + * @since 2.7.6 Added $raw parameter. + * + * @param string $url Connection URL. + * @param bool $raw If true, URL will not be escaped. + */ + return apply_filters( 'jetpack_build_authorize_url', $url, $raw ); + } + + /** + * Filters the redirection URL that is used for connect requests. The redirect + * URL should return the user back to the My Jetpack page. + * + * @param string $redirect the default redirect URL used by the package. + * @return string the modified URL. + */ + public static function filter_connect_redirect_url( $redirect ) { + $jetpack_admin_page = esc_url_raw( admin_url( 'admin.php?page=my-jetpack' ) ); + $redirect = $redirect + ? wp_validate_redirect( esc_url_raw( $redirect ), $jetpack_admin_page ) + : $jetpack_admin_page; + + if ( + class_exists( 'Jetpack_Network' ) + && isset( $_REQUEST['is_multisite'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended + ) { + $redirect = Jetpack_Network::init()->get_url( 'network_admin_page' ); + } + + return $redirect; + } + + /** + * Filters the connection URL parameter array. + * + * @param array $args default URL parameters used by the package. + * @return array the modified URL arguments array. + */ + public static function filter_connect_request_body( $args ) { + if ( + Constants::is_defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) + && include_once Constants::get_constant( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) + ) { + $gp_locale = GP_Locales::by_field( 'wp_locale', get_locale() ); + $args['locale'] = isset( $gp_locale ) && isset( $gp_locale->slug ) + ? $gp_locale->slug + : ''; + } + + $tracking = new Tracking(); + $tracks_identity = $tracking->tracks_get_identity( $args['state'] ); + + $args = array_merge( + $args, + array( + '_ui' => $tracks_identity['_ui'], + '_ut' => $tracks_identity['_ut'], + ) + ); + + $calypso_env = ( new Host() )->get_calypso_env(); + + if ( ! empty( $calypso_env ) ) { + $args['calypso_env'] = $calypso_env; + } + + return $args; + } + + /** + * Return Calypso environment value; used for developing Jetpack and pairing + * it with different Calypso enrionments, such as localhost. + * Copied from Jetpack class. + * + * @deprecated 2.7.6 + * + * @since 1.37.1 + * + * @return string Calypso environment + */ + public static function get_calypso_env() { + _deprecated_function( __METHOD__, '2.7.6', 'Automattic\\Jetpack\\Status\\Host::get_calypso_env' ); + + return ( new Host() )->get_calypso_env(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/CHANGELOG.md new file mode 100644 index 00000000..842f3a81 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/CHANGELOG.md @@ -0,0 +1,214 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.0.4] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [2.0.3] - 2024-05-29 +### Fixed +- Fix phpdoc type on `Constants::set_constant()` value parameter. [#37606] + +## [2.0.2] - 2024-04-30 +### Changed +- Internal updates. + +## [2.0.1] - 2024-03-12 +### Changed +- Internal updates. + +## [2.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [1.6.23] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.6.22] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.6.21] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.6.20] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.6.19] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.6.18] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.6.17] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.6.16] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.6.15] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.6.14] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.6.13] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.6.12] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.6.11] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.6.10] - 2021-10-26 +### Fixed +- Updated is_true docblock to be more accurate. + +## [1.6.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.6.8] - 2021-10-06 +### Changed +- Updated package dependencies + +## [1.6.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.6.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- Updated versions in annotations + +## [1.6.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.6.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.6.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.6.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.6.1] - 2021-01-19 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.6.0] - 2020-12-14 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.5.1] - 2020-10-28 + +- Updated PHPCS: Packages and Debugger + +## [1.5.0] - 2020-08-13 + +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.4.0] - 2020-07-01 + +- Package Unit tests: update test file names to make sure they runs in Travis + +## [1.3.0] - 2020-06-22 + +- PHPCS: Clean up the packages + +## [1.2.0] - 2020-04-15 + +- Use jp.com redirect in all links +- Connection: add a filter for setting Jetpack api constants + +## [1.1.3] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.1.2] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.1.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## [1.1.0] - 2019-09-14 + +## 1.0.0 - 2019-07-09 + +- Packages: Finish the constants package + +[2.0.4]: https://github.com/Automattic/jetpack-constants/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-constants/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-constants/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-constants/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-constants/compare/v1.6.23...v2.0.0 +[1.6.23]: https://github.com/Automattic/jetpack-constants/compare/v1.6.22...v1.6.23 +[1.6.22]: https://github.com/Automattic/jetpack-constants/compare/v1.6.21...v1.6.22 +[1.6.21]: https://github.com/Automattic/jetpack-constants/compare/v1.6.20...v1.6.21 +[1.6.20]: https://github.com/Automattic/jetpack-constants/compare/v1.6.19...v1.6.20 +[1.6.19]: https://github.com/Automattic/jetpack-constants/compare/v1.6.18...v1.6.19 +[1.6.18]: https://github.com/Automattic/jetpack-constants/compare/v1.6.17...v1.6.18 +[1.6.17]: https://github.com/Automattic/jetpack-constants/compare/v1.6.16...v1.6.17 +[1.6.16]: https://github.com/Automattic/jetpack-constants/compare/v1.6.15...v1.6.16 +[1.6.15]: https://github.com/Automattic/jetpack-constants/compare/v1.6.14...v1.6.15 +[1.6.14]: https://github.com/Automattic/jetpack-constants/compare/v1.6.13...v1.6.14 +[1.6.13]: https://github.com/Automattic/jetpack-constants/compare/v1.6.12...v1.6.13 +[1.6.12]: https://github.com/Automattic/jetpack-constants/compare/v1.6.11...v1.6.12 +[1.6.11]: https://github.com/Automattic/jetpack-constants/compare/v1.6.10...v1.6.11 +[1.6.10]: https://github.com/Automattic/jetpack-constants/compare/v1.6.9...v1.6.10 +[1.6.9]: https://github.com/Automattic/jetpack-constants/compare/v1.6.8...v1.6.9 +[1.6.8]: https://github.com/Automattic/jetpack-constants/compare/v1.6.7...v1.6.8 +[1.6.7]: https://github.com/Automattic/jetpack-constants/compare/v1.6.6...v1.6.7 +[1.6.6]: https://github.com/Automattic/jetpack-constants/compare/v1.6.5...v1.6.6 +[1.6.5]: https://github.com/Automattic/jetpack-constants/compare/v1.6.4...v1.6.5 +[1.6.4]: https://github.com/Automattic/jetpack-constants/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/Automattic/jetpack-constants/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-constants/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-constants/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-constants/compare/v1.5.1...v1.6.0 +[1.5.1]: https://github.com/Automattic/jetpack-constants/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-constants/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-constants/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-constants/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-constants/compare/v1.1.3...v1.2.0 +[1.1.3]: https://github.com/Automattic/jetpack-constants/compare/v1.1.2...v1.1.3 +[1.1.2]: https://github.com/Automattic/jetpack-constants/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-constants/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-constants/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/composer.json new file mode 100644 index 00000000..9c4b937e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/composer.json @@ -0,0 +1,42 @@ +{ + "name": "automattic/jetpack-constants", + "description": "A wrapper for defining constants in a more testable way.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-constants", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-constants/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php new file mode 100644 index 00000000..45768a94 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php @@ -0,0 +1,124 @@ += 7.0. [#34192] + +## [1.5.1] - 2023-11-14 + +## [1.5.0] - 2023-11-13 +### Added +- Added 'cookieinformationscanner' and 'facebookexternalhit' to the bot user agent list. [#34026] + +## [1.4.27] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.4.26] - 2023-06-12 +### Fixed +- Catch PHP notice if User Agent is not available [#31279] + +## [1.4.25] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.4.24] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.4.23] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.4.22] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.4.21] - 2022-11-22 +### Added +- Add a guard in `functions.php` against being loaded twice from different copies of the package. [#27475] + +### Changed +- Updated package dependencies. [#27043] + +## [1.4.20] - 2022-11-07 +### Fixed +- Ensure that User_Agent is loaded in environments without autoload enabled. (e.g.: WordPress.com and Super Cache) [#27223] + +## [1.4.19] - 2022-10-25 +### Changed +- Update `wp_unslash` wrapper to possibly run on wpcom before WordPress is loaded. [#26971] + +## [1.4.18] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.4.17] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.4.16] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.4.15] - 2022-04-19 +### Changed +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` + +## [1.4.14] - 2022-03-29 +### Changed +- Microperformance: Use === null instead of is_null + +## [1.4.13] - 2022-02-09 +### Fixed +- Fixed some new PHPCS warnings. + +## [1.4.12] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.4.11] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.4.10] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.4.9] - 2021-11-16 +### Fixed +- Verify $_SERVER['HTTP_USER_AGENT'] exists before use. + +## [1.4.8] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.4.7] - 2021-10-19 +### Deprecated +- General: remove numerous long-deprecated functions. + +## [1.4.6] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.4.5] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.4.4] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.4.3] - 2021-08-31 +### Changed +- Run composer update on test-php command instead of phpunit. +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- Updated versions in annotations. + +## [1.4.2] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.4.1] - 2021-04-27 +### Changed +- Updated package dependencies. + +## [1.4.0] - 2021-03-30 +### Added +- Added Opera Desktop detection +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.3.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.3.1] - 2021-01-19 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.3.0] - 2020-12-09 + +- Codesniffer: Update mediawiki/mediawiki-codesniffer dependency +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.2.1] - 2020-11-10 + +- Improve PHP 8 compatibility +- Updated PHPCS: Packages and Debugger + +## [1.2.0] - 2020-10-19 + +- Replaced intval() with (int) as part of issue #17432. + +## [1.1.0] - 2020-08-13 + +- CI: Try collect js coverage + +## 1.0.0 - 2020-06-25 + +- Moving jetpack_is_mobile into a package + +[2.1.4]: https://github.com/Automattic/jetpack-device-detection/compare/v2.1.3...v2.1.4 +[2.1.3]: https://github.com/Automattic/jetpack-device-detection/compare/v2.1.2...v2.1.3 +[2.1.2]: https://github.com/Automattic/jetpack-device-detection/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/Automattic/jetpack-device-detection/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-device-detection/compare/v2.0.1...v2.1.0 +[2.0.1]: https://github.com/Automattic/jetpack-device-detection/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-device-detection/compare/v1.5.1...v2.0.0 +[1.5.1]: https://github.com/Automattic/jetpack-device-detection/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.27...v1.5.0 +[1.4.27]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.26...v1.4.27 +[1.4.26]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.25...v1.4.26 +[1.4.25]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.24...v1.4.25 +[1.4.24]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.23...v1.4.24 +[1.4.23]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.22...v1.4.23 +[1.4.22]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.21...v1.4.22 +[1.4.21]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.20...v1.4.21 +[1.4.20]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.19...v1.4.20 +[1.4.19]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.18...v1.4.19 +[1.4.18]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.17...v1.4.18 +[1.4.17]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.16...v1.4.17 +[1.4.16]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.15...v1.4.16 +[1.4.15]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.14...v1.4.15 +[1.4.14]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.13...v1.4.14 +[1.4.13]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.12...v1.4.13 +[1.4.12]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.11...v1.4.12 +[1.4.11]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.10...v1.4.11 +[1.4.10]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.9...v1.4.10 +[1.4.9]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.8...v1.4.9 +[1.4.8]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.7...v1.4.8 +[1.4.7]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.6...v1.4.7 +[1.4.6]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-device-detection/compare/v1.3.2...v1.4.0 +[1.3.2]: https://github.com/Automattic/jetpack-device-detection/compare/v1.3.1...v1.3.2 +[1.3.1]: https://github.com/Automattic/jetpack-device-detection/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-device-detection/compare/v1.2.1...v1.3.0 +[1.2.1]: https://github.com/Automattic/jetpack-device-detection/compare/v1.2.0...v1.2.1 +[1.2.0]: https://github.com/Automattic/jetpack-device-detection/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-device-detection/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/composer.json new file mode 100644 index 00000000..9b1b6aff --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/composer.json @@ -0,0 +1,41 @@ +{ + "name": "automattic/jetpack-device-detection", + "description": "A way to detect device types based on User-Agent header.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-device-detection", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-device-detection/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.1.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php new file mode 100644 index 00000000..767a552c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php @@ -0,0 +1,224 @@ + (bool) Whether the current device is a mobile phone. + * 'is_smartphone' => (bool) Whether the current device is a smartphone. + * 'is_tablet' => (bool) Whether the current device is a tablet device. + * 'is_handheld' => (bool) Whether the current device is a handheld device. + * 'is_desktop' => (bool) Whether the current device is a laptop / desktop device. + * 'platform' => (string) Detected platform. + * 'is_phone_matched_ua' => (string) Matched UA. + * ); + */ + public static function get_info( $ua = '' ) { + $ua_info = new User_Agent_Info( $ua ); + + $info = array( + 'is_phone' => self::is_mobile( 'any', false, $ua_info ), + 'is_phone_matched_ua' => self::is_mobile( 'any', true, $ua_info ), + 'is_smartphone' => self::is_mobile( 'smart', false, $ua_info ), + 'is_tablet' => $ua_info->is_tablet(), + 'platform' => $ua_info->get_platform(), + 'desktop_platform' => $ua_info->get_desktop_platform(), + 'browser' => $ua_info->get_browser(), + ); + + $info['is_handheld'] = $info['is_phone'] || $info['is_tablet']; + $info['is_desktop'] = ! $info['is_handheld']; + + if ( function_exists( 'apply_filters' ) ) { + /** + * Filter the value of Device_Detection::get_info. + * + * @since 1.0.0 + * + * @param array $info Array of device information. + * @param string $ua User agent string passed to Device_Detection::get_info. + * @param User_Agent_Info $ua_info Instance of Automattic\Jetpack\Device_Detection\User_Agent_Info. + */ + $info = apply_filters( 'jetpack_device_detection_get_info', $info, $ua, $ua_info ); + } + return $info; + } + + /** + * Detects phone devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_phone( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_phone']; + } + + /** + * Detects smartphone devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_smartphone( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_smartphone']; + } + + /** + * Detects tablet devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_tablet( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_tablet']; + } + + /** + * Detects desktop devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_desktop( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_desktop']; + } + + /** + * Detects handheld (i.e. phone + tablet) devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_handheld( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_handheld']; + } + + /** + * Determine if the current User Agent matches the passed $kind. + * + * @param string $kind Category of mobile device to check for. Either: any, dumb, smart. + * @param bool $return_matched_agent Boolean indicating if the UA should be returned. + * @param User_Agent_Info $ua_info Boolean indicating if the UA should be returned. + * + * @return bool|string Boolean indicating if current UA matches $kind. If `$return_matched_agent` is true, returns the UA string. + */ + private static function is_mobile( $kind, $return_matched_agent, $ua_info ) { + $kinds = array( + 'smart' => false, + 'dumb' => false, + 'any' => false, + ); + $first_run = true; + $matched_agent = ''; + + // If an invalid kind is passed in, reset it to default. + if ( ! isset( $kinds[ $kind ] ) ) { + $kind = 'any'; + } + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( filter_var( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ); + if ( strpos( $agent, 'ipad' ) ) { + return false; + } + + // Remove Samsung Galaxy tablets (SCH-I800) from being mobile devices. + if ( strpos( $agent, 'sch-i800' ) ) { + return false; + } + + if ( $ua_info->is_android_tablet() && false === $ua_info->is_kindle_touch() ) { + return false; + } + + if ( $ua_info->is_blackberry_tablet() ) { + return false; + } + + if ( $first_run ) { + $first_run = false; + + // checks for iPhoneTier devices & RichCSS devices. + if ( $ua_info->isTierIphone() || $ua_info->isTierRichCSS() ) { + $kinds['smart'] = true; + $matched_agent = $ua_info->matched_agent; + } + + if ( ! $kinds['smart'] ) { + // if smart, we are not dumb so no need to check. + $dumb_agents = $ua_info->dumb_agents; + + foreach ( $dumb_agents as $dumb_agent ) { + if ( false !== strpos( $agent, $dumb_agent ) ) { + $kinds['dumb'] = true; + $matched_agent = $dumb_agent; + + break; + } + } + + if ( ! $kinds['dumb'] ) { + if ( isset( $_SERVER['HTTP_X_WAP_PROFILE'] ) ) { + $kinds['dumb'] = true; + $matched_agent = 'http_x_wap_profile'; + } elseif ( isset( $_SERVER['HTTP_ACCEPT'] ) && ( preg_match( '/wap\.|\.wap/i', $_SERVER['HTTP_ACCEPT'] ) || false !== strpos( strtolower( $_SERVER['HTTP_ACCEPT'] ), 'application/vnd.wap.xhtml+xml' ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- This is doing the validating. + $kinds['dumb'] = true; + $matched_agent = 'vnd.wap.xhtml+xml'; + } + } + } + + if ( $kinds['dumb'] || $kinds['smart'] ) { + $kinds['any'] = true; + } + } + + $value = $kinds[ $kind ]; + + if ( $return_matched_agent ) { + $value = $matched_agent; + } + return $value; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php new file mode 100644 index 00000000..96fb68cd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php @@ -0,0 +1,1755 @@ +useragent = $ua; + } elseif ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + $this->useragent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about validating. + } + } + + /** + * This method detects the mobile User Agent name. + * + * @return string The matched User Agent name, false otherwise. + */ + public function get_mobile_user_agent_name() { + if ( static::is_chrome_for_iOS() ) { // Keep this check before the safari rule. + return 'chrome-for-ios'; + } elseif ( static::is_iphone_or_ipod( 'iphone-safari' ) ) { + return 'iphone'; + } elseif ( static::is_ipad( 'ipad-safari' ) ) { + return 'ipad'; + } elseif ( static::is_android_tablet() ) { // Keep this check before the android rule. + return 'android_tablet'; + } elseif ( static::is_android() ) { + return 'android'; + } elseif ( static::is_blackberry_10() ) { + return 'blackberry_10'; + } elseif ( static::is_blackbeberry() ) { + return 'blackberry'; + } elseif ( static::is_WindowsPhone7() ) { + return 'win7'; + } elseif ( static::is_windows_phone_8() ) { + return 'winphone8'; + } elseif ( static::is_opera_mini() ) { + return 'opera-mini'; + } elseif ( static::is_opera_mini_dumb() ) { + return 'opera-mini-dumb'; + } elseif ( static::is_opera_mobile() ) { + return 'opera-mobi'; + } elseif ( static::is_blackberry_tablet() ) { + return 'blackberry_tablet'; + } elseif ( static::is_kindle_fire() ) { + return 'kindle-fire'; + } elseif ( static::is_PalmWebOS() ) { + return 'webos'; + } elseif ( static::is_S60_OSSBrowser() ) { + return 'series60'; + } elseif ( static::is_firefox_os() ) { + return 'firefoxOS'; + } elseif ( static::is_firefox_mobile() ) { + return 'firefox_mobile'; + } elseif ( static::is_MaemoTablet() ) { + return 'maemo'; + } elseif ( static::is_MeeGo() ) { + return 'meego'; + } elseif ( static::is_TouchPad() ) { + return 'hp_tablet'; + } elseif ( static::is_facebook_for_iphone() ) { + return 'facebook-for-iphone'; + } elseif ( static::is_facebook_for_ipad() ) { + return 'facebook-for-ipad'; + } elseif ( static::is_twitter_for_iphone() ) { + return 'twitter-for-iphone'; + } elseif ( static::is_twitter_for_ipad() ) { + return 'twitter-for-ipad'; + } elseif ( static::is_wordpress_for_ios() ) { + return 'ios-app'; + } elseif ( static::is_iphone_or_ipod( 'iphone-not-safari' ) ) { + return 'iphone-unknown'; + } elseif ( static::is_ipad( 'ipad-not-safari' ) ) { + return 'ipad-unknown'; + } elseif ( static::is_Nintendo_3DS() ) { + return 'nintendo-3ds'; + } else { + $agent = $this->useragent; + $dumb_agents = $this->dumb_agents; + foreach ( $dumb_agents as $dumb_agent ) { + if ( false !== strpos( $agent, $dumb_agent ) ) { + return $dumb_agent; + } + } + } + + return false; + } + + /** + * This method detects the mobile device's platform. All return strings are from the class constants. + * Note that this function returns the platform name, not the UA name/type. You should use a different function + * if you need to test the UA capabilites. + * + * @return string|bool Name of the platform, false otherwise. + */ + public function get_platform() { + if ( isset( $this->platform ) ) { + return $this->platform; + } + + if ( empty( $this->useragent ) ) { + return false; + } + + if ( strpos( $this->useragent, 'windows phone' ) !== false ) { + $this->platform = self::PLATFORM_WINDOWS; + } elseif ( strpos( $this->useragent, 'windows ce' ) !== false ) { + $this->platform = self::PLATFORM_WINDOWS; + } elseif ( strpos( $this->useragent, 'ipad' ) !== false ) { + $this->platform = self::PLATFORM_IPAD; + } elseif ( strpos( $this->useragent, 'ipod' ) !== false ) { + $this->platform = self::PLATFORM_IPOD; + } elseif ( strpos( $this->useragent, 'iphone' ) !== false ) { + $this->platform = self::PLATFORM_IPHONE; + } elseif ( strpos( $this->useragent, 'android' ) !== false ) { + if ( static::is_android_tablet() ) { + $this->platform = self::PLATFORM_ANDROID_TABLET; + } else { + $this->platform = self::PLATFORM_ANDROID; + } + } elseif ( static::is_kindle_fire() ) { + $this->platform = self::PLATFORM_ANDROID_TABLET; + } elseif ( static::is_blackberry_10() ) { + $this->platform = self::PLATFORM_BLACKBERRY_10; + } elseif ( strpos( $this->useragent, 'blackberry' ) !== false ) { + $this->platform = self::PLATFORM_BLACKBERRY; + } elseif ( static::is_blackberry_tablet() ) { + $this->platform = self::PLATFORM_BLACKBERRY; + } elseif ( static::is_symbian_platform() ) { + $this->platform = self::PLATFORM_SYMBIAN; + } elseif ( static::is_symbian_s40_platform() ) { + $this->platform = self::PLATFORM_SYMBIAN_S40; + } elseif ( static::is_J2ME_platform() ) { + $this->platform = self::PLATFORM_J2ME_MIDP; + } elseif ( static::is_firefox_os() ) { + $this->platform = self::PLATFORM_FIREFOX_OS; + } else { + $this->platform = false; + } + + return $this->platform; + } + + /** + * Returns the platform for desktops + * + * @return string + */ + public function get_desktop_platform() { + $ua = $this->useragent; + if ( empty( $ua ) ) { + return false; + } + $platform = self::OTHER; + + if ( static::is_linux_desktop() ) { + $platform = self::PLATFORM_DESKTOP_LINUX; + } elseif ( static::is_mac_desktop() ) { + $platform = self::PLATFORM_DESKTOP_MAC; + } elseif ( static::is_windows_desktop() ) { + $platform = self::PLATFORM_DESKTOP_WINDOWS; + } elseif ( static::is_chrome_desktop() ) { + $platform = self::PLATFORM_DESKTOP_CHROME; + } + return $platform; + } + + /** + * A simple pattern matching method for extracting the browser from the user agent. + * + * @return string + */ + public function get_browser() { + $ua = $this->useragent; + if ( empty( $ua ) ) { + return self::OTHER; + } + + if ( static::is_opera_mini() || static::is_opera_mobile() || static::is_opera_desktop() || static::is_opera_mini_dumb() ) { + return self::BROWSER_OPERA; + } elseif ( static::is_edge_browser() ) { + return self::BROWSER_EDGE; + } elseif ( static::is_chrome_desktop() || self::is_chrome_for_iOS() ) { + return self::BROWSER_CHROME; + } elseif ( static::is_safari_browser() ) { + return self::BROWSER_SAFARI; + } elseif ( static::is_firefox_mobile() || static::is_firefox_desktop() ) { + return self::BROWSER_FIREFOX; + } elseif ( static::is_ie_browser() ) { + return self::BROWSER_IE; + } + return self::OTHER; + } + + /** + * This method detects for UA which can display iPhone-optimized web content. + * Includes iPhone, iPod Touch, Android, WebOS, Fennec (Firefox mobile), etc. + */ + public function isTierIphone() { + if ( isset( $this->isTierIphone ) ) { + return $this->isTierIphone; + } + if ( $this->is_iphoneOrIpod() ) { + $this->matched_agent = 'iphone'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_android() ) { + $this->matched_agent = 'android'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_windows_phone_8() ) { + $this->matched_agent = 'winphone8'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_WindowsPhone7() ) { + $this->matched_agent = 'win7'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_blackberry_10() ) { + $this->matched_agent = 'blackberry-10'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_blackbeberry() && 'blackberry-webkit' === static::detect_blackberry_browser_version() ) { + $this->matched_agent = 'blackberry-webkit'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_blackberry_tablet() ) { + $this->matched_agent = 'blackberry_tablet'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_PalmWebOS() ) { + $this->matched_agent = 'webos'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_TouchPad() ) { + $this->matched_agent = 'hp_tablet'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_firefox_os() ) { + $this->matched_agent = 'firefoxOS'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_firefox_mobile() ) { + $this->matched_agent = 'fennec'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_opera_mobile() ) { + $this->matched_agent = 'opera-mobi'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_MaemoTablet() ) { + $this->matched_agent = 'maemo'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_MeeGo() ) { + $this->matched_agent = 'meego'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_kindle_touch() ) { + $this->matched_agent = 'kindle-touch'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( static::is_Nintendo_3DS() ) { + $this->matched_agent = 'nintendo-3ds'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } else { + $this->isTierIphone = false; + } + return $this->isTierIphone; + } + + /** + * This method detects for UA which are likely to be capable + * but may not necessarily support JavaScript. + * Excludes all iPhone Tier UA. + */ + public function isTierRichCss() { + if ( isset( $this->isTierRichCss ) ) { + return $this->isTierRichCss; + } + if ( $this->isTierIphone() ) { + return false; + } + + // The following devices are explicitly ok. + if ( static::is_S60_OSSBrowser() ) { + $this->matched_agent = 'series60'; + $this->isTierIphone = false; + $this->isTierRichCss = true; + $this->isTierGenericMobile = false; + } elseif ( static::is_opera_mini() ) { + $this->matched_agent = 'opera-mini'; + $this->isTierIphone = false; + $this->isTierRichCss = true; + $this->isTierGenericMobile = false; + } elseif ( static::is_blackbeberry() ) { + $detectedDevice = static::detect_blackberry_browser_version(); + if ( + 'blackberry-5' === $detectedDevice + || 'blackberry-4.7' === $detectedDevice + || 'blackberry-4.6' === $detectedDevice + ) { + $this->matched_agent = $detectedDevice; + $this->isTierIphone = false; + $this->isTierRichCss = true; + $this->isTierGenericMobile = false; + } + } else { + $this->isTierRichCss = false; + } + + return $this->isTierRichCss; + } + + /** + * Detects if the user is using a tablet. + * props Corey Gilmore, BGR.com + * + * @return bool + */ + public function is_tablet() { + return ( 0 // Never true, but makes it easier to manage our list of tablet conditions. + || self::is_ipad() + || self::is_android_tablet() + || self::is_blackberry_tablet() + || self::is_kindle_fire() + || self::is_MaemoTablet() + || self::is_TouchPad() + ); + } + + /** + * Detects if the current UA is the default iPhone or iPod Touch Browser. + * + * DEPRECATED: use is_iphone_or_ipod + */ + public function is_iphoneOrIpod() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( ( strpos( $ua, 'iphone' ) !== false ) || ( strpos( $ua, 'ipod' ) !== false ) ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser. + * + * They type can check for any iPhone, an iPhone using Safari, or an iPhone using something other than Safari. + * + * Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPhone browser), + * you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'. + * Otherwise those browsers will be 'catched' by the iphone string. + * + * @param string $type Type of iPhone detection. + */ + public static function is_iphone_or_ipod( $type = 'iphone-any' ) { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $is_iphone = ( strpos( $ua, 'iphone' ) !== false ) || ( strpos( $ua, 'ipod' ) !== false ); + $is_safari = ( false !== strpos( $ua, 'safari' ) ); + + if ( 'iphone-safari' === $type ) { + return $is_iphone && $is_safari; + } elseif ( 'iphone-not-safari' === $type ) { + return $is_iphone && ! $is_safari; + } else { + return $is_iphone; + } + } + + /** + * Detects if the current UA is Chrome for iOS + * + * The User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/ instead of Version/. + * - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3 + */ + public static function is_chrome_for_iOS() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( self::is_iphone_or_ipod( 'iphone-safari' ) === false ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'crios/' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Twitter for iPhone + * + * Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone + * Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone + */ + public static function is_twitter_for_iphone() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'ipad' ) !== false ) { + return false; + } + + if ( strpos( $ua, 'twitter for iphone' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Twitter for iPad + * + * Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad + * Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone + */ + public static function is_twitter_for_ipad() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'twitter for ipad' ) !== false ) { + return true; + } elseif ( strpos( $ua, 'ipad' ) !== false && strpos( $ua, 'twitter for iphone' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Facebook for iPhone + * - Facebook 4020.0 (iPhone; iPhone OS 5.0.1; fr_FR) + * - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0] + * - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US] + */ + public static function is_facebook_for_iphone() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'iphone' ) ) { + return false; + } + + if ( false !== strpos( $ua, 'facebook' ) && false === strpos( $ua, 'ipad' ) ) { + return true; + } elseif ( false !== strpos( $ua, 'fbforiphone' ) && false === strpos( $ua, 'tablet' ) ) { + return true; + } elseif ( false !== strpos( $ua, 'fban/fbios;' ) && false === strpos( $ua, 'tablet' ) ) { // FB app v5.0 or higher. + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Facebook for iPad + * - Facebook 4020.0 (iPad; iPhone OS 5.0.1; en_US) + * - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0] + * - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US] + */ + public static function is_facebook_for_ipad() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'ipad' ) ) { + return false; + } + + if ( false !== strpos( $ua, 'facebook' ) || false !== strpos( $ua, 'fbforiphone' ) || false !== strpos( $ua, 'fban/fbios;' ) ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is WordPress for iOS + */ + public static function is_wordpress_for_ios() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( false !== strpos( $ua, 'wp-iphone' ) ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current device is an iPad. + * They type can check for any iPad, an iPad using Safari, or an iPad using something other than Safari. + * + * Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPad browser), + * you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'. + * Otherwise those browsers will be 'catched' by the ipad string. + * + * @param string $type iPad type. + */ + public static function is_ipad( $type = 'ipad-any' ) { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $is_ipad = ( false !== strpos( $ua, 'ipad' ) ); + $is_safari = ( false !== strpos( $ua, 'safari' ) ); + + if ( 'ipad-safari' === $type ) { + return $is_ipad && $is_safari; + } elseif ( 'ipad-not-safari' === $type ) { + return $is_ipad && ! $is_safari; + } else { + return $is_ipad; + } + } + + /** + * Detects if the current browser is Firefox Mobile (Fennec) + * + * See http://www.useragentstring.com/pages/Fennec/ + * Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1 + * Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1 + */ + public static function is_firefox_mobile() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'fennec' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is Firefox for desktop + * + * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox + * Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion + * The platform section will include 'Mobile' for phones and 'Tablet' for tablets. + */ + public static function is_firefox_desktop() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false !== strpos( $ua, 'firefox' ) && false === strpos( $ua, 'mobile' ) && false === strpos( $ua, 'tablet' ) ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is FirefoxOS Native browser + * + * Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0 + */ + public static function is_firefox_os() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'mozilla' ) !== false && strpos( $ua, 'mobile' ) !== false && strpos( $ua, 'gecko' ) !== false && strpos( $ua, 'firefox' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detect Safari browser + */ + public static function is_safari_browser() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + if ( false === strpos( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ), 'Safari' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + return true; + } + + /** + * Detect Edge browser + */ + public static function is_edge_browser() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + if ( false === strpos( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ), 'Edge' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + return true; + } + + /** + * Detect Edge browser + */ + public static function is_ie_browser() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + $ua = wp_unslash( $_SERVER['HTTP_USER_AGENT'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( false === ( strpos( $ua, 'MSIE' ) || strpos( $ua, 'Trident/7' ) ) ) { + return false; + } + return true; + } + + /** + * Detect modern Opera desktop + * + * Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 OPR/74.0.3911.203 + * + * Looking for "OPR/" specifically. + */ + public static function is_opera_desktop() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( false === strpos( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ), 'OPR/' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + + return true; + } + + /** + * Detects if the current browser is Opera Mobile + * + * What is the difference between Opera Mobile and Opera Mini? + * - Opera Mobile is a full Internet browser for mobile devices. + * - Opera Mini always uses a transcoder to convert the page for a small display. + * (it uses Opera advanced server compression technology to compress web content before it gets to a device. + * The rendering engine is on Opera's server.) + * + * Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00" + * Opera/9.50 (Nintendo DSi; Opera/507; U; en-US) + */ + public static function is_opera_mobile() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mobi' ) !== false ) { + return true; + } elseif ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'nintendo dsi' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is Opera Mini + * + * Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr) + * Opera/9.80 (Android;Opera Mini/6.0.24212/24.746 U;en) Presto/2.5.25 Version/10.5454 + * Opera/9.80 (iPhone; Opera Mini/5.0.019802/18.738; U; en) Presto/2.4.15 + * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 + * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 + * Opera/9.80 (Series 60; Opera Mini/5.1.22783/23.334; U; en) Presto/2.5.25 Version/10.54 + * Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54 + */ + public static function is_opera_mini() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mini' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is Opera Mini, but not on a smart device OS(Android, iOS, etc) + * Used to send users on dumb devices to m.wor + */ + public static function is_opera_mini_dumb() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( self::is_opera_mini() ) { + if ( strpos( $ua, 'android' ) !== false || strpos( $ua, 'iphone' ) !== false || strpos( $ua, 'ipod' ) !== false + || strpos( $ua, 'ipad' ) !== false || strpos( $ua, 'blackberry' ) !== false ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is a Windows Phone 7 device. + * ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910) + */ + public static function is_WindowsPhone7() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'windows phone os 7' ) ) { + return false; + } elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } + + /** + * Detects if the current browser is a Windows Phone 8 device. + * ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; ; [;]) + */ + public static function is_windows_phone_8() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( strpos( $ua, 'windows phone 8' ) === false ) { + return false; + } else { + return true; + } + } + + /** + * Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad. + * + * Ex1: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1 + * Ex2: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1 + */ + public static function is_PalmWebOS() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'webos' ) ) { + return false; + } elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } + + /** + * Detects if the current browser is the HP TouchPad default browser. This excludes phones wt WebOS. + * + * TouchPad Emulator: Mozilla/5.0 (hp-desktop; Linux; hpwOS/2.0; U; it-IT) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 Desktop/1.0 + * TouchPad: Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0 + */ + public static function is_TouchPad() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $http_user_agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( false !== strpos( $http_user_agent, 'hp-tablet' ) || false !== strpos( $http_user_agent, 'hpwos' ) || false !== strpos( $http_user_agent, 'touchpad' ) ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is the Series 60 Open Source Browser. + * + * OSS Browser 3.2 on E75: Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 NokiaE75-1/110.48.125 Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 + * + * 7.0 Browser (Nokia 5800 XpressMusic (v21.0.025)) : Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/21.0.025; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 + * + * Browser 7.1 (Nokia N97 (v12.0.024)) : Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344 + */ + public static function is_S60_OSSBrowser() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } + + $pos_webkit = strpos( $agent, 'webkit' ); + if ( false !== $pos_webkit ) { + // First, test for WebKit, then make sure it's either Symbian or S60. + if ( strpos( $agent, 'symbian' ) !== false || strpos( $agent, 'series60' ) !== false ) { + return true; + } else { + return false; + } + } elseif ( strpos( $agent, 'symbianos' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'nokia' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } + + return false; + } + + /** + * Detects if the device platform is the Symbian Series 60. + */ + public static function is_symbian_platform() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_webkit = strpos( $agent, 'webkit' ); + if ( false !== $pos_webkit ) { + // First, test for WebKit, then make sure it's either Symbian or S60. + if ( strpos( $agent, 'symbian' ) !== false || strpos( $agent, 'series60' ) !== false ) { + return true; + } else { + return false; + } + } elseif ( strpos( $agent, 'symbianos' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'nokia' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'opera mini' ) !== false ) { + if ( strpos( $agent, 'symbianos' ) !== false || strpos( $agent, 'symbos' ) !== false || strpos( $agent, 'series 60' ) !== false ) { + return true; + } + } + + return false; + } + + /** + * Detects if the device platform is the Symbian Series 40. + * Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser. + * This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'. + */ + public static function is_symbian_s40_platform() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $agent, 'series40' ) !== false ) { + if ( strpos( $agent, 'nokia' ) !== false || strpos( $agent, 'ovibrowser' ) !== false || strpos( $agent, 'nokiabrowser' ) !== false ) { + return true; + } + } + + return false; + } + + /** + * Returns if the device belongs to J2ME capable family. + * + * @return bool + */ + public static function is_J2ME_platform() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $agent, 'j2me/midp' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) { + return true; + } + return false; + } + + /** + * Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets. + */ + public static function is_MaemoTablet() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_maemo = strpos( $agent, 'maemo' ); + if ( false === $pos_maemo ) { + return false; + } + + // Must be Linux + Tablet, or else it could be something else. + if ( strpos( $agent, 'tablet' ) !== false && strpos( $agent, 'linux' ) !== false ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current UA is a MeeGo device (Nokia Smartphone). + */ + public static function is_MeeGo() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'meego' ) ) { + return false; + } elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } + + /** + * The is_webkit() method can be used to check the User Agent for an webkit generic browser. + */ + public static function is_webkit() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_webkit = strpos( $agent, 'webkit' ); + + if ( false !== $pos_webkit ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is the Native Android browser. + * + * @return boolean true if the browser is Android otherwise false + */ + public static function is_android() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_android = strpos( $agent, 'android' ); + if ( false !== $pos_android ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is the Native Android Tablet browser. + * Assumes 'Android' should be in the user agent, but not 'mobile' + * + * @return boolean true if the browser is Android and not 'mobile' otherwise false + */ + public static function is_android_tablet() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_android = strpos( $agent, 'android' ); + $pos_mobile = strpos( $agent, 'mobile' ); + $post_android_app = strpos( $agent, 'wp-android' ); + + if ( false !== $pos_android && false === $pos_mobile && false === $post_android_app ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is the Kindle Fire Native browser. + * + * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true + * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false + * + * @return boolean true if the browser is Kindle Fire Native browser otherwise false + */ + public static function is_kindle_fire() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_silk = strpos( $agent, 'silk/' ); + $pos_silk_acc = strpos( $agent, 'silk-accelerated=' ); + if ( false !== $pos_silk && false !== $pos_silk_acc ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is the Kindle Touch Native browser + * + * Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+ + * + * @return boolean true if the browser is Kindle monochrome Native browser otherwise false + */ + public static function is_kindle_touch() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_kindle_touch = strpos( $agent, 'kindle/3.0+' ); + if ( false !== $pos_kindle_touch && false === self::is_kindle_fire() ) { + return true; + } else { + return false; + } + } + + /** + * Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) + */ + public static function is_windows8_auth() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos = strpos( $agent, 'msauthhost' ); + if ( false !== $pos ) { + return true; + } else { + return false; + } + } + + /** + * Detect if user agent is the WordPress.com Windows 8 app. + */ + public static function is_wordpress_for_win8() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos = strpos( $agent, 'wp-windows8' ); + if ( false !== $pos ) { + return true; + } else { + return false; + } + } + + /** + * Detect if user agent is the WordPress.com Desktop app. + */ + public static function is_wordpress_desktop_app() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos = strpos( $agent, 'WordPressDesktop' ); + if ( false !== $pos ) { + return true; + } else { + return false; + } + } + + /** + * The is_blackberry_tablet() method can be used to check the User Agent for a RIM blackberry tablet. + * The user agent of the BlackBerry® Tablet OS follows a format similar to the following: + * Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+ + */ + public static function is_blackberry_tablet() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_playbook = stripos( $agent, 'PlayBook' ); + $pos_rim_tablet = stripos( $agent, 'RIM Tablet' ); + + if ( ( false === $pos_playbook ) || ( false === $pos_rim_tablet ) ) { + return false; + } else { + return true; + } + } + + /** + * The is_blackbeberry() method can be used to check the User Agent for a blackberry device. + * Note that opera mini on BB matches this rule. + */ + public static function is_blackbeberry() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_blackberry = strpos( $agent, 'blackberry' ); + if ( false !== $pos_blackberry ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * The is_blackberry_10() method can be used to check the User Agent for a BlackBerry 10 device. + */ + public static function is_blackberry_10() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return ( strpos( $agent, 'bb10' ) !== false ) && ( strpos( $agent, 'mobile' ) !== false ); + } + + /** + * Determines whether a desktop platform is Linux OS + * + * @return bool + */ + public static function is_linux_desktop() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + if ( ! preg_match( '/linux/i', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + return true; + } + + /** + * Determines whether a desktop platform is Mac OS + * + * @return bool + */ + public static function is_mac_desktop() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + if ( ! preg_match( '/macintosh|mac os x/i', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + return true; + } + + /** + * Determines whether a desktop platform is Windows OS + * + * @return bool + */ + public static function is_windows_desktop() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + if ( ! preg_match( '/windows|win32/i', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + return true; + } + + /** + * Determines whether a desktop platform is Chrome OS + * + * @return bool + */ + public static function is_chrome_desktop() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + if ( ! preg_match( '/chrome/i', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + return true; + } + + /** + * Retrieve the blackberry OS version. + * + * Return strings are from the following list: + * - blackberry-10 + * - blackberry-7 + * - blackberry-6 + * - blackberry-torch //only the first edition. The 2nd edition has the OS7 onboard and doesn't need any special rule. + * - blackberry-5 + * - blackberry-4.7 + * - blackberry-4.6 + * - blackberry-4.5 + * + * @return string Version of the BB OS. + * If version is not found, get_blackbeberry_OS_version will return boolean false. + */ + public static function get_blackbeberry_OS_version() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( self::is_blackberry_10() ) { + return 'blackberry-10'; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_blackberry = stripos( $agent, 'blackberry' ); + if ( false === $pos_blackberry ) { + // Not a blackberry device. + return false; + } + + // Blackberry devices OS 6.0 or higher. + // Mozilla/5.0 (BlackBerry; U; BlackBerry 9670; en) AppleWebKit/534.3+ (KHTML, like Gecko) Version/6.0.0.286 Mobile Safari/534.3+. + // Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+. + // Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0 Mobile Safari/534.11+. + $pos_webkit = stripos( $agent, 'webkit' ); + if ( false !== $pos_webkit ) { + // Detected blackberry webkit browser. + $pos_torch = stripos( $agent, 'BlackBerry 9800' ); + if ( false !== $pos_torch ) { + return 'blackberry-torch'; // Match the torch first edition. the 2nd edition should use the OS7 and doesn't need any special rule. + } elseif ( preg_match( '#Version\/([\d\.]+)#i', $agent, $matches ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher. + $version = $matches[1]; + $version_num = explode( '.', $version ); + if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) { + return 'blackberry-6'; // not a BB device that match our rule. + } else { + return 'blackberry-' . $version_num[0]; + } + } else { + // if doesn't match returns the minimun version with a webkit browser. we should never fall here. + return 'blackberry-6'; // not a BB device that match our rule. + } + } + + // Blackberry devices <= 5.XX. + // BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179. + if ( preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) { + $version = $matches[1]; + } else { + return false; // not a BB device that match our rule. + } + + $version_num = explode( '.', $version ); + + if ( is_array( $version_num ) === false || count( $version_num ) <= 1 ) { + return false; + } + + $version_num_major = (int) $version_num[0]; + $version_num_minor = (int) $version_num[1]; + + if ( 5 === $version_num_major ) { + return 'blackberry-5'; + } elseif ( 4 === $version_num_major && 7 === $version_num_minor ) { + return 'blackberry-4.7'; + } elseif ( 4 === $version_num_major && 6 === $version_num_minor ) { + return 'blackberry-4.6'; + } elseif ( 4 === $version_num_major && 5 === $version_num_minor ) { + return 'blackberry-4.5'; + } else { + return false; + } + } + + /** + * Retrieve the blackberry browser version. + * + * Return string are from the following list: + * - blackberry-10 + * - blackberry-webkit + * - blackberry-5 + * - blackberry-4.7 + * - blackberry-4.6 + * + * @return string Type of the BB browser. + * If browser's version is not found, detect_blackbeberry_browser_version will return boolean false. + */ + public static function detect_blackberry_browser_version() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( self::is_blackberry_10() ) { + return 'blackberry-10'; + } + + $pos_blackberry = strpos( $agent, 'blackberry' ); + if ( false === $pos_blackberry ) { + // Not a blackberry device. + return false; + } + + $pos_webkit = strpos( $agent, 'webkit' ); + + if ( ! ( false === $pos_webkit ) ) { + return 'blackberry-webkit'; + } else { + if ( ! preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) { + return false; // not a BB device that match our rule. + } + + $version_num = explode( '.', $matches[1] ); + + if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) { + return false; + } + + $version_num_major = (int) $version_num[0]; + $version_num_minor = (int) $version_num[1]; + + if ( 5 === $version_num_major ) { + return 'blackberry-5'; + } elseif ( 4 === $version_num_major && 7 === $version_num_minor ) { + return 'blackberry-4.7'; + } elseif ( 4 === $version_num_major && 6 === $version_num_minor ) { + return 'blackberry-4.6'; + } else { + // A very old BB device is found or this is a BB device that doesn't match our rules. + return false; + } + } + } + + /** + * Checks if a visitor is coming from one of the WordPress mobile apps. + * + * @return bool + */ + public static function is_mobile_app() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( isset( $_SERVER['X_USER_AGENT'] ) && preg_match( '|wp-webos|', $_SERVER['X_USER_AGENT'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- This is validating. + return true; // Wp4webos 1.1 or higher. + } + + $app_agents = array( 'wp-android', 'wp-blackberry', 'wp-iphone', 'wp-nokia', 'wp-webos', 'wp-windowsphone' ); + // the mobile reader on iOS has an incorrect UA when loading the reader + // currently it is the default one provided by the iOS framework which + // causes problems with 2-step-auth + // User-Agent WordPress/3.1.4 CFNetwork/609 Darwin/13.0.0. + $app_agents[] = 'wordpress/3.1'; + + foreach ( $app_agents as $app_agent ) { + if ( false !== strpos( $agent, $app_agent ) ) { + return true; + } + } + return false; + } + + /** + * Detects if the current browser is Nintendo 3DS handheld. + * + * Example: Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US + * can differ in language, version and region + */ + public static function is_Nintendo_3DS() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( strpos( $ua, 'nintendo 3ds' ) !== false ) { + return true; + } + return false; + } + + /** + * Was the current request made by a known bot? + * + * @return boolean + */ + public static function is_bot() { + static $is_bot = null; + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( $is_bot === null ) { + $is_bot = self::is_bot_user_agent( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + } + + return $is_bot; + } + + /** + * Is the given user-agent a known bot? + * If you want an is_bot check for the current request's UA, use is_bot() instead of passing a user-agent to this method. + * + * @param string $ua A user-agent string. + * + * @return boolean + */ + public static function is_bot_user_agent( $ua = null ) { + + if ( empty( $ua ) ) { + return false; + } + + $bot_agents = array( + 'alexa', + 'altavista', + 'ask jeeves', + 'attentio', + 'baiduspider', + 'bingbot', + 'chtml generic', + 'crawler', + 'fastmobilecrawl', + 'feedfetcher-google', + 'firefly', + 'froogle', + 'gigabot', + 'googlebot', + 'googlebot-mobile', + 'heritrix', + 'httrack', + 'ia_archiver', + 'irlbot', + 'iescholar', + 'infoseek', + 'jumpbot', + 'linkcheck', + 'lycos', + 'mediapartners', + 'mediobot', + 'motionbot', + 'msnbot', + 'mshots', + 'openbot', + 'pss-webkit-request', + 'pythumbnail', + 'scooter', + 'slurp', + 'snapbot', + 'spider', + 'taptubot', + 'technoratisnoop', + 'teoma', + 'twiceler', + 'yahooseeker', + 'yahooysmcm', + 'yammybot', + 'ahrefsbot', + 'pingdom.com_bot', + 'kraken', + 'yandexbot', + 'twitterbot', + 'tweetmemebot', + 'openhosebot', + 'queryseekerspider', + 'linkdexbot', + 'grokkit-crawler', + 'livelapbot', + 'germcrawler', + 'domaintunocrawler', + 'grapeshotcrawler', + 'cloudflare-alwaysonline', + 'cookieinformationscanner', // p1699315886066389-slack-C0438NHCLSY + 'facebookexternalhit', // https://www.facebook.com/externalhit_uatext.php + 'feedburner', + 'yacybot', // http://yacy.net/bot.html + 'trendictionbot', // http://www.trendiction.de/bot; + 'elisabot', + 'linkfluence', // http://linkfluence.com/ + 'semrushbot', // https://www.semrush.com/bot/ + 'archive.org_bot', // http://archive.org/details/archive.org_bot + 'ezlynxbot', // https://www.ezoic.com/bot + 'siteauditbot', // https://www.semrush.com/bot/ + 'snapchat', // https://developers.snap.com/robots + 'applebot', // https://support.apple.com/en-ca/HT204683 + 'bne.es_bot', // https://www.bne.es/es/colecciones/archivo-web-espanola/aviso-webmasters + 'google-safety;', // https://www.google.com/bot.html + 'mojeekbot', // https://www.mojeek.com/bot.html + 'linkwalker', // https://www.linkwalker.com/ + ); + + foreach ( $bot_agents as $bot_agent ) { + if ( false !== stripos( $ua, $bot_agent ) ) { + return true; + } + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/functions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/functions.php new file mode 100644 index 00000000..a530e7f9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/functions.php @@ -0,0 +1,36 @@ + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.asset.php new file mode 100644 index 00000000..ff8c9609 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.asset.php @@ -0,0 +1 @@ + array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-polyfill', 'wp-url'), 'version' => '94dc255b5871f56d5cf3'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.js new file mode 100644 index 00000000..b8e20305 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.js @@ -0,0 +1,2 @@ +/*! For license information please see index.js.LICENSE.txt */ +(()=>{"use strict";var e={792:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(790),i=n(609);const o={isEligible:!0};function a(e){const t=(t,n={})=>{const r={...o,...n},[,a]=(0,i.useReducer)((e=>e+1),0),s=(0,i.useRef)(t);if((0,i.useEffect)((()=>{let n=!0;return r.isEligible&&e.loadExperimentAssignment(t).then((()=>{n&&a()})),()=>{n=!1}}),[t,r.isEligible]),t===s.current||s.current.startsWith("explat_test")||e.config.logError({message:"[ExPlat] useExperiment: experimentName should never change between renders!"}),!r.isEligible)return[!1,null];const m=e.dangerouslyGetMaybeLoadedExperimentAssignment(t);return[!m,m]};return{useExperiment:t,Experiment:({defaultExperience:e,treatmentExperience:n,loadingExperience:i,name:o,options:a})=>{const[s,m]=t(o,a);return s?(0,r.jsx)(r.Fragment,{children:i}):m?.variationName?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsx)(r.Fragment,{children:e})},ProvideExperimentData:({children:e,name:n,options:r})=>{const[i,o]=t(n,r);return e(i,o)}}}},517:(e,t,n)=>{n.d(t,{kU:()=>c,pg:()=>l});var r=n(689),i=n(808),o=n(738),a=n(762),s=n(626);const m=1e4;Error;function c(e){if("undefined"==typeof window)throw new Error("Running outside of a browser context.");const t={},n=(...t)=>{try{e.logError(...t)}catch(e){}};try{(0,r.bZ)()}catch(e){n({message:e.message,source:"removeExpiredExperimentAssignments-error"})}return{loadExperimentAssignment:async c=>{try{if(!s.Eo(c))throw new Error(`Invalid experimentName: "${c}"`);const n=(0,r.B1)(c);if(n&&i.H2(n))return n;void 0===t[c]&&(t[c]=(t=>a.MC((async()=>{const n=await o.FI(e,t);return(0,r.a2)(n),n})))(c));let l=m;Math.random()>.5&&(l=5e3);const p=await a.BK(t[c](),l);if(!p)throw new Error("Could not fetch ExperimentAssignment");return p}catch(e){n({message:e.message,experimentName:c,source:"loadExperimentAssignment-initialError"})}try{const e=(0,r.B1)(c);if(e)return e;const t=(0,i.fj)(c);return(0,r.a2)(t),t}catch(e){return n({message:e.message,experimentName:c,source:"loadExperimentAssignment-fallbackError"}),(0,i.fj)(c)}},dangerouslyGetExperimentAssignment:t=>{try{if(!s.Eo(t))throw new Error(`Invalid experimentName: ${t}`);const i=(0,r.B1)(t);if(!i)throw new Error("Trying to dangerously get an ExperimentAssignment that hasn't loaded.");return e.isDevelopmentMode&&i&&a.XZ()-i.retrievedTimestamp<1e3&&n({message:"Warning: Trying to dangerously get an ExperimentAssignment too soon after loading it.",experimentName:t,source:"dangerouslyGetExperimentAssignment"}),i}catch(r){return e.isDevelopmentMode&&n({message:r.message,experimentName:t,source:"dangerouslyGetExperimentAssignment-error"}),(0,i.fj)(t)}},dangerouslyGetMaybeLoadedExperimentAssignment:t=>{try{if(!s.Eo(t))throw new Error(`Invalid experimentName: ${t}`);const e=(0,r.B1)(t);return e||null}catch(r){return e.isDevelopmentMode&&n({message:r.message,experimentName:t,source:"dangerouslyGetMaybeLoadedExperimentAssignment-error"}),(0,i.fj)(t)}},config:e}}function l(e){return{loadExperimentAssignment:async t=>(e.logError({message:"Attempting to load ExperimentAssignment in SSR context",experimentName:t}),(0,i.fj)(t)),dangerouslyGetExperimentAssignment:t=>(e.logError({message:"Attempting to dangerously get ExperimentAssignment in SSR context",experimentName:t}),(0,i.fj)(t)),dangerouslyGetMaybeLoadedExperimentAssignment:t=>(e.logError({message:"Attempting to dangerously get ExperimentAssignment in SSR context",experimentName:t}),(0,i.fj)(t)),config:e}}},226:(e,t,n)=>{n.d(t,{k:()=>i});var r=n(517);const i="undefined"==typeof window?r.pg:r.kU},689:(e,t,n)=>{n.d(t,{B1:()=>c,a2:()=>m,bZ:()=>d});var r=n(808),i=n(765),o=n(626);const a="explat-experiment-",s=e=>`${a}-${e}`;function m(e){o.zV(e);const t=c(e.experimentName);if(t&&e.retrievedTimestamp[...Array(e).keys()];function p(e){return e.startsWith(a)}function u(e){return e.slice(a.length+1)}function d(){l(i.A.length).map((e=>i.A.key(e))).filter(p).map(u).filter((e=>{try{if(r.H2(c(e)))return!1}catch(e){}return!0})).map(s).map((e=>i.A.removeItem(e)))}},808:(e,t,n)=>{n.d(t,{H2:()=>i,fj:()=>a,fn:()=>o});var r=n(762);function i(e){return r.XZ()({experimentName:e,variationName:null,retrievedTimestamp:r.XZ(),ttl:Math.max(o,t),isFallbackExperimentAssignment:!0})},765:(e,t,n)=>{n.d(t,{A:()=>i});let r={_data:{},setItem:function(e,t){this._data[e]=t},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:null},removeItem:function(e){delete this._data[e]},clear:function(){this._data={}},get length(){return Object.keys(this._data).length},key:function(e){const t=Object.keys(this._data);return e in t?t[e]:null}};try{window.localStorage&&(r=window.localStorage)}catch(e){}const i=r},738:(e,t,n)=>{n.d(t,{FI:()=>p});var r=n(808),i=n(765),o=n(762),a=n(626);function s(e){if(function(e){return(0,a.Gv)(e)&&(0,a.Gv)(e.variations)&&"number"==typeof e.ttl&&0{const t=await e();if(t)return i.A.setItem(m,t),i.A.setItem(c,String((0,o.XZ)())),t;const n=i.A.getItem(m),r=i.A.getItem(c);return n&&r&&(0,o.XZ)()-parseInt(r,10)<864e5?n:null};async function p(e,t){const n=(0,o.XZ)(),{variations:i,ttl:m}=s(await e.fetchExperimentAssignment({anonId:await l(e.getAnonId),experimentName:t})),c=Math.max(r.fn,m),p=Object.entries(i).map((([e,t])=>({experimentName:e,variationName:t,retrievedTimestamp:n,ttl:c}))).map(a.zV);if(p.length>1)throw new Error("Received multiple experiment assignments while trying to fetch exactly one.");if(0===p.length)return r.fj(t,c);const u=p[0];if(u.experimentName!==t)throw new Error("Newly fetched ExperimentAssignment's experiment name does not match request.");if(!r.H2(u))throw new Error("Newly fetched experiment isn't alive.");return u}},762:(e,t,n)=>{n.d(t,{BK:()=>a,If:()=>r,MC:()=>s,XZ:()=>o});const r=1e3;let i=Date.now();function o(){const e=Date.now();return i=isetTimeout((()=>n(new Error(`Promise has timed-out after ${t}ms.`))),t)))])}function s(e){let t=null;return()=>(t||(t=e().finally((()=>{t=null}))),t)}},626:(e,t,n)=>{function r(e){return"object"==typeof e&&null!==e}function i(e){return"string"==typeof e&&""!==e&&/^[a-z0-9_]*$/.test(e)}function o(e){if(!function(e){return r(e)&&i(e.experimentName)&&(i(e.variationName)||null===e.variationName)&&"number"==typeof e.retrievedTimestamp&&"number"==typeof e.ttl&&0!==e.ttl}(e))throw new Error("Invalid ExperimentAssignment");return e}n.d(t,{Eo:()=>i,Gv:()=>r,zV:()=>o})},767:(e,t)=>{t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var r={},o=t||{},s=e.split(i),m=o.decode||n,c=0;c{n.d(t,{Ck:()=>a,wf:()=>o});var r=n(767);let i=null;const o=async()=>{let e=0;return i=new Promise((t=>{const n=()=>{const i=r.parse(document.cookie).tk_ai||null;"string"!=typeof i||""===i?99<=e?t(null):(e+=1,setTimeout(n,50)):t(i)};n()})),i},a=async()=>await i},222:(e,t,n)=>{n.d(t,{V:()=>m,z:()=>s});var r=n(455),i=n.n(r),o=n(832);const a=(e=!1)=>async({experimentName:t,anonId:n})=>{if(!n)throw new Error("Tracking is disabled, can't fetch experimentAssignment");const r={experiment_name:t,anon_id:n??void 0,as_connected_user:e},a=(0,o.addQueryArgs)("jetpack/v4/explat/assignments",r);return await i()({path:a})},s=a(!1),m=a(!0)},69:(e,t,n)=>{n.d(t,{v:()=>i});var r=n(382);const i=e=>{const t=e=>{r.D&&console.error("[ExPlat] Unable to send error to server:",e)};try{const{message:n,...i}=e,o={message:n,properties:{...i,context:"explat",explat_client:"jetpack"}};if(r.D)console.error("[ExPlat] ",e.message,e);else{const e=new window.FormData;e.append("error",JSON.stringify(o)),window.fetch("https://public-api.wordpress.com/rest/v1.1/js-error",{method:"POST",body:e}).catch(t)}}catch(e){t(e)}}},382:(e,t,n)=>{n.d(t,{D:()=>r});const r=!1},609:e=>{e.exports=window.React},790:e=>{e.exports=window.ReactJSXRuntime},455:e=>{e.exports=window.wp.apiFetch},832:e=>{e.exports=window.wp.url}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r=n(226),i=n(792),o=n(889),a=n(222),s=n(69),m=n(382);(0,o.wf)().catch((e=>(0,s.v)({message:e.message})));const c=(0,r.k)({fetchExperimentAssignment:a.z,getAnonId:o.Ck,logError:s.v,isDevelopmentMode:m.D}),{loadExperimentAssignment:l,dangerouslyGetExperimentAssignment:p}=c,{useExperiment:u,Experiment:d,ProvideExperimentData:g}=(0,i.A)(c),f=(0,r.k)({fetchExperimentAssignment:a.V,getAnonId:o.Ck,logError:s.v,isDevelopmentMode:m.D}),{loadExperimentAssignment:x,dangerouslyGetExperimentAssignment:h}=f,{useExperiment:w,Experiment:E,ProvideExperimentData:y}=(0,i.A)(f)})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.js.LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.js.LICENSE.txt new file mode 100644 index 00000000..8d392d0d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/build/index.js.LICENSE.txt @@ -0,0 +1,6 @@ +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/composer.json new file mode 100644 index 00000000..7b769e12 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/composer.json @@ -0,0 +1,63 @@ +{ + "name": "automattic/jetpack-explat", + "description": "A package for running A/B tests on the Experimentation Platform (ExPlat) in the plugin.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-connection": "^4.0.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "test-js": [ + "echo 'Run `pnpm run test` when ready'" + ], + "test-js-watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run test --watch" + ], + "build-development": [ + "pnpm run build" + ], + "build-production": [ + "NODE_ENV=production pnpm run build" + ], + "watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run watch" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-explat/compare/v${old}...v${new}" + }, + "mirror-repo": "Automattic/jetpack-explat", + "textdomain": "jetpack-explat", + "version-constants": { + "::PACKAGE_VERSION": "src/class-explat.php" + } + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/global.d.ts b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/global.d.ts new file mode 100644 index 00000000..9eed072d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/global.d.ts @@ -0,0 +1,9 @@ +export declare global { + namespace NodeJS { + interface ProcessEnv { + NODE_ENV: 'development' | 'production' | 'test'; + } + } +} + +export {}; diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/class-explat.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/class-explat.php new file mode 100644 index 00000000..39ee3f9b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/class-explat.php @@ -0,0 +1,44 @@ + WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_assignments' ), + 'permission_callback' => '__return_true', + 'args' => array( + 'experiment_name' => array( + 'type' => 'string', + ), + 'anon_id' => array( + 'type' => 'string', + ), + 'as_connected_user' => array( + 'type' => 'boolean', + ), + ), + ) + ); + } + + /** + * Get the assignments for a given experiment and anon_id + * + * @param WP_REST_Request $request The REST request object. + * @return WP_REST_Response + */ + public function get_assignments( $request ) { + $response = null; + $is_user_connected = ( new Jetpack_Connection() )->is_user_connected(); + $request_path = '/experiments/' . self::EXPLAT_API_VERSION . '/assignments/jetpack'; + $args = array( + 'experiment_name' => $request['experiment_name'], + 'anon_id' => $request['anon_id'], + ); + + if ( $request['as_connected_user'] && $is_user_connected ) { + $response = Client::wpcom_json_api_request_as_user( + add_query_arg( $args, $request_path ), + 'v2' + ); + } else { + $response = wp_remote_get( + add_query_arg( $args, self::WPCOM_API_BASE_URL . $request_path ) + ); + } + + if ( is_wp_error( $response ) ) { + return new WP_Error( + 'wp_error_fetching_assignment', + $response->get_error_message(), + array( 'status' => 500 ) + ); + } + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( 200 !== $response_code ) { + return new WP_Error( + 'http_error_fetching_assignment', + wp_remote_retrieve_response_message( $response ), + array( 'status' => $response_code ) + ); + } + + return rest_ensure_response( + json_decode( wp_remote_retrieve_body( $response ), true ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/anon.ts b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/anon.ts new file mode 100644 index 00000000..5afc6b90 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/anon.ts @@ -0,0 +1,61 @@ +/** + * External dependencies + */ +import cookie from 'cookie'; + +let initializeAnonIdPromise: Promise< string | null > | null = null; +const anonIdPollingIntervalMilliseconds = 50; +const anonIdPollingIntervalMaxAttempts = 100; // 50 * 100 = 5000 = 5 seconds + +/** + * Gather w.js anonymous cookie, tk_ai + * + * @return {?string} The anonymous cookie value, or null if it doesn't exist + */ +export const readAnonCookie = (): string | null => { + return cookie.parse( document.cookie ).tk_ai || null; +}; + +/** + * Initializes the anonId: + * - Polls for AnonId receival + * - Should only be called once at startup + * - Happens to be safe to call multiple times if it is necessary to reset the anonId - something like this was necessary for testing. + * + * This purely for boot-time initialization, in usual circumstances it will be retrieved within 100-300ms, it happens in parallel booting + * so should only delay experiment loading that much for boot-time experiments. In some circumstances such as a very slow connection this + * can take a lot longer. + * + * The state of initializeAnonIdPromise should be used rather than the return of this function. + * The return is only avaliable to make this easier to test. + * + * Throws on error. + * + * @return {Promise} The anonymous cookie value, or null if it doesn't exist + */ +export const initializeAnonId = async (): Promise< string | null > => { + let attempt = 0; + initializeAnonIdPromise = new Promise( res => { + const poll = () => { + const anonId = readAnonCookie(); + if ( typeof anonId === 'string' && anonId !== '' ) { + res( anonId ); + return; + } + + if ( anonIdPollingIntervalMaxAttempts - 1 <= attempt ) { + res( null ); + return; + } + attempt += 1; + setTimeout( poll, anonIdPollingIntervalMilliseconds ); + }; + poll(); + } ); + + return initializeAnonIdPromise; +}; + +export const getAnonId = async (): Promise< string | null > => { + return await initializeAnonIdPromise; +}; diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/assignment.ts b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/assignment.ts new file mode 100644 index 00000000..80bd7d8f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/assignment.ts @@ -0,0 +1,29 @@ +import apiFetch from '@wordpress/api-fetch'; +import { addQueryArgs } from '@wordpress/url'; + +const fetchExperimentAssignment = + ( asConnectedUser = false ) => + async ( { + experimentName, + anonId, + }: { + experimentName: string; + anonId: string | null; + } ): Promise< unknown > => { + if ( ! anonId ) { + throw new Error( `Tracking is disabled, can't fetch experimentAssignment` ); + } + + const params = { + experiment_name: experimentName, + anon_id: anonId ?? undefined, + as_connected_user: asConnectedUser, + }; + + const assignmentsRequestUrl = addQueryArgs( 'jetpack/v4/explat/assignments', params ); + + return await apiFetch( { path: assignmentsRequestUrl } ); + }; + +export const fetchExperimentAssignmentAnonymously = fetchExperimentAssignment( false ); +export const fetchExperimentAssignmentWithAuth = fetchExperimentAssignment( true ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/error.ts b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/error.ts new file mode 100644 index 00000000..84c19118 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/error.ts @@ -0,0 +1,39 @@ +/** + * Internal dependencies + */ +import { isDevelopmentMode } from './utils'; + +export const logError = ( error: Record< string, string > & { message: string } ): void => { + const onLoggingError = ( e: unknown ) => { + if ( isDevelopmentMode ) { + console.error( '[ExPlat] Unable to send error to server:', e ); // eslint-disable-line no-console + } + }; + + try { + const { message, ...properties } = error; + const logStashError = { + message, + properties: { + ...properties, + context: 'explat', + explat_client: 'jetpack', + }, + }; + + if ( isDevelopmentMode ) { + console.error( '[ExPlat] ', error.message, error ); // eslint-disable-line no-console + } else { + const body = new window.FormData(); + body.append( 'error', JSON.stringify( logStashError ) ); + window + .fetch( 'https://public-api.wordpress.com/rest/v1.1/js-error', { + method: 'POST', + body, + } ) + .catch( onLoggingError ); + } + } catch ( e ) { + onLoggingError( e ); + } +}; diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/index.ts b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/index.ts new file mode 100644 index 00000000..b21c993f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/index.ts @@ -0,0 +1,51 @@ +/** + * External dependencies + */ +import { createExPlatClient } from '@automattic/explat-client'; +import createExPlatClientReactHelpers from '@automattic/explat-client-react-helpers'; +/** + * Internal dependencies + */ +import { getAnonId, initializeAnonId } from './anon'; +import { + fetchExperimentAssignmentAnonymously, + fetchExperimentAssignmentWithAuth, +} from './assignment'; +import { logError } from './error'; +import { isDevelopmentMode } from './utils'; + +export const initializeExPlat = (): void => { + initializeAnonId().catch( e => logError( { message: e.message } ) ); +}; + +initializeExPlat(); + +const exPlatClient = createExPlatClient( { + fetchExperimentAssignment: fetchExperimentAssignmentAnonymously, + getAnonId, + logError, + isDevelopmentMode, +} ); + +export const { loadExperimentAssignment, dangerouslyGetExperimentAssignment } = exPlatClient; + +export const { useExperiment, Experiment, ProvideExperimentData } = + createExPlatClientReactHelpers( exPlatClient ); + +const exPlatClientWithAuth = createExPlatClient( { + fetchExperimentAssignment: fetchExperimentAssignmentWithAuth, + getAnonId, + logError, + isDevelopmentMode, +} ); + +export const { + loadExperimentAssignment: loadExperimentAssignmentWithAuth, + dangerouslyGetExperimentAssignment: dangerouslyGetExperimentAssignmentWithAuth, +} = exPlatClientWithAuth; + +export const { + useExperiment: useExperimentWithAuth, + Experiment: ExperimentWithAuth, + ProvideExperimentData: ProvideExperimentDataWithAuth, +} = createExPlatClientReactHelpers( exPlatClientWithAuth ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/utils.ts b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/utils.ts new file mode 100644 index 00000000..75694463 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-explat/src/client/utils.ts @@ -0,0 +1,4 @@ +/** + * Boolean determining if environment is development. + */ +export const isDevelopmentMode = process.env.NODE_ENV === 'development'; diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/CHANGELOG.md new file mode 100644 index 00000000..808b30b8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.3] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [0.2.2] - 2024-03-12 +### Changed +- Internal updates. + +## [0.2.1] - 2023-11-21 +### Changed +- Added a note of non-usage of PHP8+ functions yet. [#34137] + +## [0.2.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [0.1.6] - 2023-09-19 + +- Minor internal updates. + +## [0.1.5] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [0.1.4] - 2023-05-29 +### Changed +- Internal updates. + +## [0.1.3] - 2023-05-11 + +- Updated package dependencies + +## [0.1.2] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.1.1] - 2023-03-28 +### Changed +- Update README.md [#28401] + +## 0.1.0 - 2023-02-28 +### Added +- Added a utility function to extract an array of IP addresses from a given string. [#29131] +- Add jetpack-ip package functionality [#28846] +- Initialized the package. [#28765] + +[0.2.3]: https://github.com/automattic/jetpack-ip/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/automattic/jetpack-ip/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/automattic/jetpack-ip/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/automattic/jetpack-ip/compare/v0.1.6...v0.2.0 +[0.1.6]: https://github.com/automattic/jetpack-ip/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/automattic/jetpack-ip/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/automattic/jetpack-ip/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/automattic/jetpack-ip/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/automattic/jetpack-ip/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/automattic/jetpack-ip/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/composer.json new file mode 100644 index 00000000..38282789 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/composer.json @@ -0,0 +1,46 @@ +{ + "name": "automattic/jetpack-ip", + "description": "Utilities for working with IP addresses.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-ip", + "changelogger": { + "link-template": "https://github.com/automattic/jetpack-ip/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "textdomain": "jetpack-ip", + "version-constants": { + "::PACKAGE_VERSION": "src/class-utils.php" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php new file mode 100644 index 00000000..a062d775 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php @@ -0,0 +1,209 @@ +trusted_header ) && isset( $_SERVER[ $trusted_header_data->trusted_header ] ) ) { + $ip = wp_unslash( $_SERVER[ $trusted_header_data->trusted_header ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- clean_ip does it below. + $segments = $trusted_header_data->segments; + $reverse_order = $trusted_header_data->reverse; + } else { + $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- clean_ip does it below. + } + + if ( ! $ip ) { + return false; + } + + $ips = explode( ',', $ip ); + if ( ! isset( $segments ) || ! $segments ) { + $segments = 1; + } + if ( isset( $reverse_order ) && $reverse_order ) { + $ips = array_reverse( $ips ); + } + $ip_count = count( $ips ); + if ( 1 === $ip_count ) { + return self::clean_ip( $ips[0] ); + } elseif ( $ip_count >= $segments ) { + $the_one = $ip_count - $segments; + return self::clean_ip( $ips[ $the_one ] ); + } else { + return self::clean_ip( isset( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : null ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- clean_ip does it. + } + } + + /** + * Clean IP address. + * + * @param string $ip The IP address to clean. + * @return string|false The cleaned IP address. + */ + public static function clean_ip( $ip ) { + + // Some misconfigured servers give back extra info, which comes after "unless". + $ips = explode( ' unless ', $ip ); + $ip = $ips[0]; + + $ip = strtolower( trim( $ip ) ); + + // Check for IPv4 with port. + if ( preg_match( '/^(\d+\.\d+\.\d+\.\d+):\d+$/', $ip, $matches ) ) { + $ip = $matches[1]; + } + + // Check for IPv6 (or IPvFuture) with brackets and optional port. + if ( preg_match( '/^\[([a-z0-9\-._~!$&\'()*+,;=:]+)\](?::\d+)?$/', $ip, $matches ) ) { + $ip = $matches[1]; + } + + // Check for IPv4 IP cast as IPv6. + if ( preg_match( '/^::ffff:(\d+\.\d+\.\d+\.\d+)$/', $ip, $matches ) ) { + $ip = $matches[1]; + } + + // Validate and return. + return filter_var( $ip, FILTER_VALIDATE_IP ) ? $ip : false; + } + + /** + * Checks an IP to see if it is within a private range. + * + * @param int $ip IP address. + * @return bool True if IP address is private, false otherwise. + */ + public static function ip_is_private( $ip ) { + // We are dealing with ipv6, so we can simply rely on filter_var. + // Note: str_contains() is not used here, as wp-includes/compat.php may not be loaded in this file. + if ( false === strpos( $ip, '.' ) ) { + return ! filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ); + } + // We are dealing with ipv4. + $private_ip4_addresses = array( + '10.0.0.0|10.255.255.255', // Single class A network. + '172.16.0.0|172.31.255.255', // 16 contiguous class B network. + '192.168.0.0|192.168.255.255', // 256 contiguous class C network. + '169.254.0.0|169.254.255.255', // Link-local address also referred to as Automatic Private IP Addressing. + '127.0.0.0|127.255.255.255', // localhost. + ); + $long_ip = ip2long( $ip ); + if ( -1 !== $long_ip ) { + foreach ( $private_ip4_addresses as $pri_addr ) { + list ( $start, $end ) = explode( '|', $pri_addr ); + if ( $long_ip >= ip2long( $start ) && $long_ip <= ip2long( $end ) ) { + return true; + } + } + } + return false; + } + + /** + * Uses inet_pton if available to convert an IP address to a binary string. + * Returns false if an invalid IP address is given. + * + * @param mixed $ip IP address. + * @return int|string|bool + */ + public static function convert_ip_address( $ip ) { + return inet_pton( $ip ); + } + + /** + * Checks that a given IP address is within a given low - high range. + * + * @param mixed $ip IP. + * @param mixed $range_low Range Low. + * @param mixed $range_high Range High. + * @return Bool + */ + public static function ip_address_is_in_range( $ip, $range_low, $range_high ) { + $ip_num = inet_pton( $ip ); + $ip_low = inet_pton( $range_low ); + $ip_high = inet_pton( $range_high ); + if ( $ip_num && $ip_low && $ip_high && strcmp( $ip_num, $ip_low ) >= 0 && strcmp( $ip_num, $ip_high ) <= 0 ) { + return true; + } + return false; + } + + /** + * Extracts IP addresses from a given string. + * + * We allow for both, one IP per line or comma-; semicolon; or whitespace-separated lists. This also validates the IP addresses + * and only returns the ones that look valid. IP ranges using the "-" character are also supported. + * + * @param string $ips List of ips - example: "8.8.8.8\n4.4.4.4,2.2.2.2;1.1.1.1 9.9.9.9,5555.5555.5555.5555,1.1.1.10-1.1.1.20". + * @return array List of valid IP addresses. - example based on input example: array('8.8.8.8', '4.4.4.4', '2.2.2.2', '1.1.1.1', '9.9.9.9', '1.1.1.10-1.1.1.20') + */ + public static function get_ip_addresses_from_string( $ips ) { + $ips = (string) $ips; + $ips = preg_split( '/[\s,;]/', $ips ); + + $result = array(); + + foreach ( $ips as $ip ) { + // Validate both IP values from the range. + $range = explode( '-', $ip ); + if ( count( $range ) === 2 ) { + if ( self::validate_ip_range( $range[0], $range[1] ) ) { + $result[] = $ip; + } + continue; + } + + // Validate the single IP value. + if ( filter_var( $ip, FILTER_VALIDATE_IP ) !== false ) { + $result[] = $ip; + } + } + + return $result; + } + + /** + * Validates the low and high IP addresses of a range. + * + * @param string $range_low Low IP address. + * @param string $range_high High IP address. + * @return bool True if the range is valid, false otherwise. + */ + public static function validate_ip_range( $range_low, $range_high ) { + // Validate that both IP addresses are valid. + if ( ! filter_var( $range_low, FILTER_VALIDATE_IP ) || ! filter_var( $range_high, FILTER_VALIDATE_IP ) ) { + return false; + } + + // Validate that the $range_low is lower or equal to $range_high. + // The inet_pton will give us binary string of an ipv4 or ipv6. + // We can then use strcmp to see if the address is in range. + $ip_low = inet_pton( $range_low ); + $ip_high = inet_pton( $range_high ); + if ( false === $ip_low || false === $ip_high ) { + return false; + } + if ( strcmp( $ip_low, $ip_high ) > 0 ) { + return false; + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md new file mode 100644 index 00000000..d8c3bdc2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md @@ -0,0 +1,928 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [3.1.21] - 2024-09-05 +### Changed +- Update dependencies. + +## [3.1.20] - 2024-09-05 +### Changed +- Updated package dependencies. [#39176] + +## [3.1.19] - 2024-08-29 +### Changed +- Updated package dependencies. [#39111] + +## [3.1.18] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [3.1.17] - 2024-08-19 +### Fixed +- Lossless image optimization for images (should improve performance with no visible changes). [#38750] + +## [3.1.16] - 2024-08-15 +### Changed +- Updated package dependencies. [#38662] + +## [3.1.15] - 2024-08-08 +### Fixed +- JITM: Fix background for RTL languages. [#38706] + +## [3.1.14] - 2024-07-18 +### Changed +- Update margins on jitms in my jetpack [#38283] + +## [3.1.13] - 2024-07-03 +### Changed +- Updated package dependencies. [#38132] + +## [3.1.12] - 2024-06-05 +### Changed +- Updated package dependencies. [#37669] + +## [3.1.11] - 2024-05-16 +### Changed +- Updated package dependencies. [#37379] + +## [3.1.10] - 2024-05-06 +### Changed +- Updated package dependencies. [#37147] + +## [3.1.9] - 2024-04-26 +### Changed +- Internal updates. + +## [3.1.8] - 2024-04-25 +### Changed +- Internal updates. + +## [3.1.7] - 2024-04-22 +### Changed +- Internal updates. + +## [3.1.6] - 2024-04-15 +### Changed +- Internal updates. + +## [3.1.5] - 2024-04-11 +### Changed +- Internal updates. + +## [3.1.4] - 2024-04-08 +### Changed +- Updated package dependencies. [#36760] + +## [3.1.3] - 2024-03-27 +### Changed +- Updated package dependencies. [#36585] + +## [3.1.2] - 2024-03-25 +### Changed +- Update Phan baselines [#36441] + +## [3.1.1] - 2024-03-14 +### Changed +- Internal updates. + +## [3.1.0] - 2024-03-12 +### Changed +- Performance: only enqueue the JITM JavaScript on pages where it will be used. [#35997] +- Updated package dependencies. [#36325] + +## [3.0.5] - 2024-03-04 +### Changed +- Updated package dependencies. [#36095] + +## [3.0.4] - 2024-02-13 +### Changed +- Updated package dependencies. [#35608] + +## [3.0.3] - 2024-02-05 +### Changed +- Updated package dependencies. [#35384] + +## [3.0.2] - 2024-01-04 +### Changed +- Updated package dependencies. [#34815] + +## [3.0.1] - 2023-12-03 +### Changed +- Updated package dependencies. [#34411] + +## [3.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +### Removed +- Removed the Partner package requirement. Relying on the Connection package instead. [#33832] + +## [2.5.3] - 2023-11-14 +### Changed +- Updated package dependencies. [#34093] + +## [2.5.2] - 2023-11-03 + +## [2.5.1] - 2023-10-19 +### Changed +- Updated package dependencies. [#33687] + +## [2.5.0] - 2023-10-10 +### Added +- JITMs can now redirect to a specific Jetpack settings page. [#32826] + +### Changed +- Update color of WooCommerce logo. [#33491] +- Updated package dependencies. [#33428] + +## [2.4.0] - 2023-09-28 +### Changed +- Moved tracking for JITM buttons into JITM script, added message_path property [#33252] + +## [2.3.19] - 2023-09-19 + +- Minor internal updates. + +## [2.3.18] - 2023-09-04 +### Changed +- Updated package dependencies. [#32803] + +## [2.3.17] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [2.3.16] - 2023-08-21 +### Fixed +- Update secondary button styling [#32503] + +## [2.3.15] - 2023-08-09 +### Changed +- Updated package dependencies. [#32166] + +## [2.3.14] - 2023-07-25 +### Changed +- Updated package dependencies. [#32040] + +## [2.3.13] - 2023-07-17 +### Changed +- Generate query string when using the WPCOM API to fetch JITMs [#31809] + +## [2.3.12] - 2023-07-11 +### Changed +- Updated package dependencies. [#31785] + +## [2.3.11] - 2023-07-05 +### Changed +- Updated package dependencies. [#31659] + +## [2.3.10] - 2023-06-23 +### Changed +- Updated package dependencies. [#31468] + +## [2.3.9] - 2023-06-06 +### Changed +- Updated package dependencies. [#31129] + +## [2.3.8] - 2023-05-08 +### Added +- JITM: Add jetpack-videopress to JITM refetch on hashchange list [#30465] + +## [2.3.7] - 2023-05-02 +### Changed +- Updated package dependencies. [#30375] + +## [2.3.6] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [2.3.5] - 2023-04-04 +### Added +- Add external link icons in JITM [#29654] + +### Changed +- Updated package dependencies. [#29854] + +## [2.3.4] - 2023-03-28 +### Fixed +- JITM: Fix button overflow when text length is too big [#29749] + +## [2.3.3] - 2023-03-27 +### Changed +- JITM: Update styles [#29709] + +## [2.3.2] - 2023-03-20 +### Changed +- Updated package dependencies. [#29471] + +## [2.3.1] - 2023-03-08 +### Changed +- Updated package dependencies. [#29216] + +## [2.3.0] - 2023-02-20 +### Changed +- Moving deleting connection owner notice from JITM to Connection package. [#28516] + +## [2.2.42] - 2023-02-15 +### Changed +- Update to React 18. [#28710] + +## [2.2.41] - 2023-02-06 +### Fixed +- JITM: minor fix for styles on Safari browser. + +## [2.2.40] - 2023-01-30 +### Changed +- Updated styles for Just in Time Messages (notices) [#27515] + +## [2.2.39] - 2023-01-25 +### Changed +- Minor internal updates. + +## [2.2.38] - 2023-01-23 +### Fixed +- Prevent the activation page from displaying the JP License Activation JITM. [#27959] + +## [2.2.37] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [2.2.36] - 2022-12-27 +### Removed +- Remove src/js files from final bundle [#27930] + +## [2.2.35] - 2022-12-02 +### Changed +- Updated package dependencies. [#27696] + +## [2.2.34] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [2.2.33] - 2022-11-08 +### Changed +- Updated package dependencies. [#27289] + +## [2.2.32] - 2022-11-07 +### Changed +- Updated package dependencies. [#27278] + +## [2.2.31] - 2022-11-01 +### Changed +- Updated package dependencies. [#27196] + +## [2.2.30] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [2.2.29] - 2022-10-13 +### Changed +- Updated package dependencies. [#26791] + +## [2.2.28] - 2022-10-05 +### Changed +- Updated package dependencies. [#26568] + +## [2.2.27] - 2022-09-08 +### Changed +- Updated package dependencies. + +## [2.2.26] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [2.2.25] - 2022-08-25 +### Changed +- Updated package dependencies. [#25814] + +## [2.2.24] - 2022-08-23 +### Added +- Add custom styling rules for the JITMs displayed in My Jetpack. [#22452] +- Updated JITM readme. [#25739] + +### Changed +- Updated package dependencies. [#25628] + +## [2.2.23] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [2.2.22] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [2.2.21] - 2022-07-12 +### Changed +- Updated package dependencies. + +## [2.2.20] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [2.2.19] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [2.2.18] - 2022-06-08 +### Changed +- Reorder JS imports for `import/order` eslint rule. [#24601] + +## [2.2.17] - 2022-05-18 +### Changed +- Updated package dependencies [#24372] + +## [2.2.16] - 2022-05-10 +### Changed +- Updated package dependencies. [#24302] + +## [2.2.15] - 2022-05-04 +### Changed +- Remove use of `pnpx` in preparation for pnpm 7.0. [#24210] +- Updated package dependencies. [#24095] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [2.2.14] - 2022-04-26 +### Changed +- Updated package dependencies. +- Update package.json metadata. + +## [2.2.13] - 2022-04-19 +### Changed +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` + +## [2.2.12] - 2022-04-12 +### Changed +- Updated package dependencies. + +## [2.2.11] - 2022-04-06 +### Changed +- Updated package dependencies + +### Removed +- Removed tracking dependency. + +## [2.2.10] - 2022-03-29 +### Changed +- Updated package dependencies. + +## [2.2.9] - 2022-03-23 +### Changed +- Updated package dependencies. + +## [2.2.8] - 2022-03-02 +### Changed +- Updated package dependencies + +## [2.2.7] - 2022-02-22 +### Changed +- Updated package dependencies. + +## [2.2.6] - 2022-02-16 +### Changed +- Updated package dependencies. + +## [2.2.5] - 2022-02-09 +### Changed +- Updated package dependencies. + +## [2.2.4] - 2022-02-02 +### Changed +- Build: remove unneeded files from production build. +- Update use of old jQuery interfaces + +## [2.2.3] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [2.2.2] - 2022-01-18 +### Changed +- General: update required node version to v16.13.2 + +## [2.2.1] - 2022-01-11 +### Changed +- Updated package dependencies. + +## [2.2.0] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies. +- Updated package textdomain from `jetpack` to `jetpack-jitm`. + +## [2.1.1] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [2.1.0] - 2021-11-30 +### Added +- Add proper JS and CSS builder. +- Adds filters to allow sideloading of the Jetpack Backup plugin through JITMs. +- JITM: Added ability to sideload Jetpack Boost plugin. + +### Changed +- Add `output.filename` in Webpack config to override changed default. +- Colors: update Jetpack Primary color to match latest brand book. + +### Fixed +- JITM: wrap CTA below text on small viewports + +## [2.0.8] - 2021-11-23 +### Changed +- Updated package dependencies. + +## [2.0.7] - 2021-11-16 +### Added +- Use monorepo `validate-es` script to validate Webpack builds. + +### Changed +- Updated package dependencies. + +## [2.0.6] - 2021-11-09 +### Changed +- Update webpack build config. + +## [2.0.5] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [2.0.4] - 2021-10-26 +### Changed +- Updated package dependencies. + +## [2.0.3] - 2021-10-19 +### Changed +- Updated package dependencies. + +## [2.0.2] - 2021-10-12 +### Changed +- Updated package dependencies + +## [2.0.1] - 2021-09-28 +### Changed +- Allow Node ^14.17.6 to be used in this project. This shouldn't change the behavior of the code itself. +- Updated package dependencies. + +## [2.0.0] - 2021-08-31 +### Changed +- Run composer update on test-php command instead of phpunit. +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- Update annotations versions. +- Updated package dependencies. +- Update to latest webpack, webpack-cli and calypso-build. +- Upgrade to Webpack 5. +- Use Node 16.7.0 in tooling. + +### Removed +- Removed IE11 support. + +## [1.16.2] - 2021-07-27 +### Changed +- Updated package dependencies. + +## [1.16.1] - 2021-06-29 +### Changed +- Update package dependencies. +- Update node version requirement to 14.16.1 +- Update the usage of Redirect lib and passes the unlinked param as a query argument. + +## [1.16.0] - 2021-05-25 +### Added +- JITM: allow the plugin to set the icon for pre-connection JITMs. +- JITM: move sync updated option hook to the JITM package. + +### Changed +- JITM: prevent JITMs from being registered more than once. +- JITM: remove jetpack-constants dependency from composer.json +- JITM: set the default values of the jetpack_just_in_time_msgs and jetpack_just_in_time_msg_cache filters to true. +- JITM: Use an action instead of a property to prevent JITMs from being registered multiple times +- JITM: Use the Device_Detection package to determine if the device is mobile. +- Updated package dependencies +- update jetpack-redirect dependency + +## [1.15.1] - 2021-05-03 +### Changed +- JITM: Use manager::get_authorization_url to obtain the authorization url in the user deletion notice. + +## [1.15.0] - 2021-04-27 +### Added +- Move JITM's REST API endpoints into the package + +### Changed +- Always display pre-connection JITMs, without the need to set a filter. +- Avoid wrapping text in the main CTA button. +- Bump JITM package version requirement. +- JITM: Update CTA redirect url with unlinked query arg to indicate current user is not connected. +- Update package dependencies. +- Use the a8c-mc-stats package to generate stats. + +## [1.14.1] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Use is_connected instead of is_active to instantiate Pre/Post_Connection_JITM +- Add a jetpack_pre_connection_jitms filter. +- Update colors to match upcoming WP 5.7 color changes +- Update Node to match latest LTS 12 +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.14.0] - 2021-02-23 + +- Recommendations: Hide JITMs when banner is displaying +- Setup Wizard: Remove setup wizard +- JITM: move jetpack-jitm.js to the JITM package +- CI: Make tests more generic + +## [1.13.5] - 2021-02-08 + +- Update dependencies to latest stable + +## [1.13.4] - 2021-01-28 + +- Update dependencies to latest stable + +## [1.13.3] - 2021-01-26 + +- Update dependencies to latest stable + +## [1.13.2] - 2021-01-26 + +- Update dependencies to latest stable + +## [1.13.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.13.0] - 2021-01-05 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.12.2] - 2020-12-09 + +- Update dependencies to latest stable + +## [1.12.1] - 2020-11-24 + +- Version packages for release + +## [1.12.0] - 2020-11-24 + +- Status: Introduce get_site_suffix method +- General: update minimum required version to WordPress 5.5 +- Updated PHPCS: Packages and Debugger + +## [1.11.2] - 2020-11-05 + +- Update dependencies to latest stable + +## [1.11.1] - 2020-10-29 + +- Update dependencies to latest stable + +## [1.11.0] - 2020-10-27 + +- JITM: add a Pre_Connection_JITM::generate_admin_url method +- JITM: use is_active from the connection package +- JITM: regenerate assets + +## [1.10.4] - 2020-10-14 + +- Update dependencies to latest stable + +## [1.10.3] - 2020-10-09 + +- Update dependencies to latest stable + +## [1.10.2] - 2020-10-06 + +- Update dependencies to latest stable + +## [1.10.1] - 2020-10-01 + +- Update dependencies to latest stable + +## [1.10.0] - 2020-09-29 + +- Update dependencies to latest stable + +## [1.9.1] - 2020-09-09 + +- Update dependencies to latest stable + +## [1.9.0] - 2020-08-26 + +- Compat: add new Creative Mail compat file +- Packages: Update filenames after #16810 +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.8.2] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.8.1] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.8.0] - 2020-07-28 + +- Core Compat: Site Environment +- Core REST API: Add permission callback to delete_jitm_message endpoint + +## [1.7.2] - 2020-07-06 + +- Update dependencies to latest stable + +## [1.7.1] - 2020-07-01 + +- Update dependencies to latest stable + +## [1.7.0] - 2020-06-30 + +- PHPCS: Clean up the packages +- Hide pre-connection JITM on the posts page when few posts are published +- Jetpack Setup Wizard: Do not show pre-connection JITMs to non admins +- JITM: change 'setup' to 'set up' in pre-connection JITMs +- Pre-connection JITMS: Link to connect-in-place flow +- JITM: add Redirect use statement + +## [1.6.5] - 2020-06-01 + +- Hide pre-connection JITM on the posts page when few posts are published + +## [1.6.4] - 2020-06-01 + +- Update dependencies to latest stable + +## [1.6.3] - 2020-05-29 + +- Jetpack Setup Wizard: Do not show pre-connection JITMs to non admins + +## [1.6.2] - 2020-05-29 + +- JITM: change 'setup' to 'set up' in pre-connection JITMs +- Pre-connection JITMS: Link to connect-in-place flow + +## [1.6.1] - 2020-05-28 + +- JITM: add Redirect use statement + +## [1.6.0] - 2020-05-26 + +- JITM: expand docs and tests to account for pre-connection messages +- Improve responsiveness of JITMs +- JITM: fix the use statements +- Implement pre-connection JITMs +- JITM: Allow JITM on stats pages + +## [1.5.1] - 2020-04-30 + +- JITM: Allow JITM on stats pages + +## [1.5.0] - 2020-04-28 + +- Use jp.com redirect in all links + +## [1.4.0] - 2020-03-31 + +- Update dependencies to latest stable + +## [1.3.0] - 2020-03-31 + +- Use dynamic Jetpack logos on JITMs + +## [1.2.0] - 2020-02-25 + +- JITM: Show ToS update notice + +## [1.1.2] - 2020-02-14 + +- SSO: do not display JITM when not in wp-admin + +## [1.1.1] - 2020-01-23 + +- Moved JITM initialization to plugins_loaded. + +## [1.1.0] - 2020-01-07 + +- Add partner subsidiary id to upgrade URLs. + +## [1.0.10] - 2019-11-25 + +- Connection Owner Deletion Notice: Fix display bug and sanitize… + +## [1.0.9] - 2019-11-19 + +- Don't show JITMs on Gutenberg editor pages (for now) + +## [1.0.8] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.7] - 2019-11-08 + +- Remove unused get_emblem method + +## [1.0.6] - 2019-10-31 + +- Inherit 400 weight for button fonts + +## [1.0.5] - 2019-10-28 + +- PHPCS: JITM and Assets packages + +## [1.0.4] - 2019-10-24 + +- Update Jetpack button and card styles to match WordPress 5.3 + +## [1.0.3] - 2019-10-23 + +- Use spread operator instead of func_get_args + +## [1.0.2] - 2019-10-17 + +- Change the class in the add_filter() calls to $this. Also fix some + +## [1.0.1] - 2019-09-27 + +- Initial trial of prefer-dist +- JITM: Send the user's role in the request for JITM messages + +## 1.0.0 - 2019-09-14 + +- Update Jetpack to use new JITM package + +[3.1.21]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.20...v3.1.21 +[3.1.20]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.19...v3.1.20 +[3.1.19]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.18...v3.1.19 +[3.1.18]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.17...v3.1.18 +[3.1.17]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.16...v3.1.17 +[3.1.16]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.15...v3.1.16 +[3.1.15]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.14...v3.1.15 +[3.1.14]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.13...v3.1.14 +[3.1.13]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.12...v3.1.13 +[3.1.12]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.11...v3.1.12 +[3.1.11]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.10...v3.1.11 +[3.1.10]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.9...v3.1.10 +[3.1.9]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.8...v3.1.9 +[3.1.8]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.7...v3.1.8 +[3.1.7]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.6...v3.1.7 +[3.1.6]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.5...v3.1.6 +[3.1.5]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.4...v3.1.5 +[3.1.4]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.3...v3.1.4 +[3.1.3]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.2...v3.1.3 +[3.1.2]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.1...v3.1.2 +[3.1.1]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.0...v3.1.1 +[3.1.0]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.5...v3.1.0 +[3.0.5]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.4...v3.0.5 +[3.0.4]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.3...v3.0.4 +[3.0.3]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.2...v3.0.3 +[3.0.2]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.1...v3.0.2 +[3.0.1]: https://github.com/Automattic/jetpack-jitm/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.5.3...v3.0.0 +[2.5.3]: https://github.com/Automattic/jetpack-jitm/compare/v2.5.2...v2.5.3 +[2.5.2]: https://github.com/Automattic/jetpack-jitm/compare/v2.5.1...v2.5.2 +[2.5.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.5.0...v2.5.1 +[2.5.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.4.0...v2.5.0 +[2.4.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.19...v2.4.0 +[2.3.19]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.18...v2.3.19 +[2.3.18]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.17...v2.3.18 +[2.3.17]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.16...v2.3.17 +[2.3.16]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.15...v2.3.16 +[2.3.15]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.14...v2.3.15 +[2.3.14]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.13...v2.3.14 +[2.3.13]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.12...v2.3.13 +[2.3.12]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.11...v2.3.12 +[2.3.11]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.10...v2.3.11 +[2.3.10]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.9...v2.3.10 +[2.3.9]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.8...v2.3.9 +[2.3.8]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.7...v2.3.8 +[2.3.7]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.6...v2.3.7 +[2.3.6]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.5...v2.3.6 +[2.3.5]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.4...v2.3.5 +[2.3.4]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.3...v2.3.4 +[2.3.3]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.2...v2.3.3 +[2.3.2]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.1...v2.3.2 +[2.3.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.0...v2.3.1 +[2.3.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.42...v2.3.0 +[2.2.42]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.41...v2.2.42 +[2.2.41]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.40...v2.2.41 +[2.2.40]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.39...v2.2.40 +[2.2.39]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.38...v2.2.39 +[2.2.38]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.37...v2.2.38 +[2.2.37]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.36...v2.2.37 +[2.2.36]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.35...v2.2.36 +[2.2.35]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.34...v2.2.35 +[2.2.34]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.33...v2.2.34 +[2.2.33]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.32...v2.2.33 +[2.2.32]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.31...v2.2.32 +[2.2.31]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.30...v2.2.31 +[2.2.30]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.29...v2.2.30 +[2.2.29]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.28...v2.2.29 +[2.2.28]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.27...v2.2.28 +[2.2.27]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.26...v2.2.27 +[2.2.26]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.25...v2.2.26 +[2.2.25]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.24...v2.2.25 +[2.2.24]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.23...v2.2.24 +[2.2.23]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.22...v2.2.23 +[2.2.22]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.21...v2.2.22 +[2.2.21]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.20...v2.2.21 +[2.2.20]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.19...v2.2.20 +[2.2.19]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.18...v2.2.19 +[2.2.18]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.17...v2.2.18 +[2.2.17]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.16...v2.2.17 +[2.2.16]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.15...v2.2.16 +[2.2.15]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.14...v2.2.15 +[2.2.14]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.13...v2.2.14 +[2.2.13]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.12...v2.2.13 +[2.2.12]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.11...v2.2.12 +[2.2.11]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.10...v2.2.11 +[2.2.10]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.9...v2.2.10 +[2.2.9]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.8...v2.2.9 +[2.2.8]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.7...v2.2.8 +[2.2.7]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.6...v2.2.7 +[2.2.6]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.5...v2.2.6 +[2.2.5]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.4...v2.2.5 +[2.2.4]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.3...v2.2.4 +[2.2.3]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.2...v2.2.3 +[2.2.2]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.1...v2.2.2 +[2.2.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.1.1...v2.2.0 +[2.1.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.8...v2.1.0 +[2.0.8]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.7...v2.0.8 +[2.0.7]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.6...v2.0.7 +[2.0.6]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.5...v2.0.6 +[2.0.5]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.4...v2.0.5 +[2.0.4]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.16.2...v2.0.0 +[1.16.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.15.1...v1.16.0 +[1.15.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.15.0...v1.15.1 +[1.15.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.14.1...v1.15.0 +[1.14.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.14.0...v1.14.1 +[1.14.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.5...v1.14.0 +[1.13.5]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.4...v1.13.5 +[1.13.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.3...v1.13.4 +[1.13.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.2...v1.13.3 +[1.13.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.1...v1.13.2 +[1.13.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.12.2...v1.13.0 +[1.12.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.12.1...v1.12.2 +[1.12.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.12.0...v1.12.1 +[1.12.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.11.2...v1.12.0 +[1.11.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.11.1...v1.11.2 +[1.11.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.4...v1.11.0 +[1.10.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.3...v1.10.4 +[1.10.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.2...v1.10.3 +[1.10.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.1...v1.10.2 +[1.10.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.0...v1.10.1 +[1.10.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.9.1...v1.10.0 +[1.9.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.8.2...v1.9.0 +[1.8.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.8.1...v1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.7.2...v1.8.0 +[1.7.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.5...v1.7.0 +[1.6.5]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.4...v1.6.5 +[1.6.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.5.1...v1.6.0 +[1.5.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.1.2...v1.2.0 +[1.1.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.10...v1.1.0 +[1.0.10]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.9...v1.0.10 +[1.0.9]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.8...v1.0.9 +[1.0.8]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.7...v1.0.8 +[1.0.7]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.6...v1.0.7 +[1.0.6]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.5...v1.0.6 +[1.0.5]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.4...v1.0.5 +[1.0.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.3...v1.0.4 +[1.0.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-f9c9ff650c08ee46f153.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-f9c9ff650c08ee46f153.png new file mode 100644 index 00000000..07ae0ef4 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-f9c9ff650c08ee46f153.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.asset.php new file mode 100644 index 00000000..20c214ea --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.asset.php @@ -0,0 +1 @@ + array('jquery', 'wp-polyfill'), 'version' => 'a41583033504a4ed0b13'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.css new file mode 100644 index 00000000..f8d6f089 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.css @@ -0,0 +1 @@ +.jitm-button{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid #000;border-radius:4px;box-sizing:border-box;color:#000;cursor:pointer;display:inline-block;font-size:14px;font-weight:600;margin:0;min-width:90px;outline:0;overflow:hidden;padding:7px 14px 9px;text-align:center;text-decoration:none;text-overflow:ellipsis;vertical-align:top;width:100%}.jitm-button.is-primary{background:#000;color:#fff}.jitm-button.is-primary .gridicons-external-link{fill:#fff}.jitm-button.is-secondary .gridicons-external-link{fill:#000}.jitm-button.is-secondary:hover{background:#f6f7f7;color:#000}.jitm-button.is-secondary:hover .gridicons-external-link{fill:#000}.jitm-button:focus,.jitm-button:hover{background:#414141;border-color:#414141;color:#fff}.jitm-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2271b1}.jitm-button:disabled,.jitm-button[disabled]{background:#dcdcde;border-color:#dcdcde;color:#a7aaad;cursor:default}.jitm-button.is-compact{font-size:14px;height:32px;line-height:1;white-space:nowrap}.jitm-button.is-compact .gridicon{margin-top:-8px;top:4px}.jitm-button.is-compact .gridicons-plus-small{margin-left:-4px}.jitm-button.is-compact .gridicons-plus-small:last-of-type{margin-left:0}.jitm-button.is-compact .gridicons-plus-small+.gridicon{margin-left:-4px}.jitm-button.is-compact .gridicons-external-link{margin:-3px 0 -3px 2px}.jitm-button.hidden{display:none}.jitm-card{background-color:#fff;border:1px solid #fff;border-radius:2px;box-shadow:0 1px 4px #00000029;box-sizing:border-box;clear:both;display:block;margin:3rem 1.25rem 0 auto;padding:1rem 1rem 1rem 1.25rem;position:relative}.jitm-card:after{clear:both;content:".";display:block;height:0;visibility:hidden}.jitm-card.is-compact{margin-bottom:.0625rem}@media(min-width:481px){.jitm-card.is-compact{margin-bottom:1px;padding:1rem 1.5rem}}.jitm-card.is-card-link{padding-right:3rem}.my-jetpack-jitm-card .jitm-card{margin-bottom:1.5rem;margin-right:0;margin-top:1.5rem}#screen-meta-links+.jitm-card{margin:2.5rem 1.5385em 0 auto}.post-php .jitm-card{margin-right:0}.jp-lower .jitm-card{margin:0 0 1.5rem}.jitm-banner.jitm-card{display:flex;position:relative;z-index:2}.jitm-banner.jitm-card:before{border-bottom-left-radius:1px;border-top-left-radius:1px;content:"";height:100%;left:0;position:absolute;top:0;width:4px}@media(max-width:480px){.jitm-banner.jitm-card{display:flex;flex-direction:column}}.jitm-banner.jitm-card.is-card-link{padding:.75rem 3rem .75rem 1rem}.jitm-banner.jitm-card.is-dismissible{padding-right:3rem}.jitm-banner.jitm-card:before{background-color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon{color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon-circle{background-color:#4ab866}.jitm-banner.jitm-card.is-upgrade-personal:before{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon{color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon-circle{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-premium:before{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon{color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon-circle{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-business:before,.jitm-banner.jitm-card.woo-jitm:before{background-color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon{color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon-circle,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon-circle{background-color:#855da6}.jitm-banner.jitm-card .jitm-card__link-indicator{align-items:center;color:#0087be;display:flex}.jitm-banner.jitm-card:hover{transition:all .1s ease-in-out}.jitm-banner.jitm-card:hover.is-card-link{box-shadow:0 0 0 1px #a2a2a2,0 2px 4px #d5d5d5}.jitm-banner.jitm-card:hover .jitm-card__link-indicator{color:#005082}@media(min-width:481px){.jitm-banner.jitm-card{padding:1rem 1rem 1rem 1.25rem}.jitm-banner.jitm-card.is-dismissible{padding-right:1rem}}.jitm-banner__buttons_container{display:flex;gap:1rem;height:50%;margin:auto 1rem auto 0;overflow:hidden}@media(min-width:481px){.jitm-banner__buttons_container{margin-left:1rem}}.jitm-banner__icons{display:flex}.jitm-banner__icons .jitm-banner__icon,.jitm-banner__icons .jitm-banner__icon-circle{border-radius:50%;flex-shrink:0;height:1.5rem;margin-right:1rem;margin-top:-.125rem;text-align:center;top:.25rem;width:1.5rem}.jitm-banner__icons .jitm-banner__icon{align-self:center;color:#fff;display:block}.jitm-banner__icons .jitm-banner__icon-circle{color:#fff;display:none;padding:.1875rem .25rem .25rem .1875rem}@media(min-width:481px){.jitm-banner__icons{align-items:center}.jitm-banner__icons .jitm-banner__icon{display:none}.jitm-banner__icons .jitm-banner__icon-circle{display:block}}.jitm-banner__icon-plan{display:flex;margin-right:1rem}.jitm-banner__icon-plan .dops-plan-icon{height:2rem;width:2rem}.jitm-banner__icon-plan .jp-emblem{position:relative;top:.125rem}@media(max-width:480px){.jitm-banner__icon-plan .jp-emblem{margin-bottom:1rem}}.jitm-banner__icon-plan .jp-emblem svg{height:2rem;width:2rem;fill:#069e08}.jitm-banner__icon-plan .jp-emblem .jitm-jp-logo{height:inherit;width:2.5rem;fill:inherit}@media(min-width:481px){.jitm-banner__icon-plan{align-items:center}}.jitm-banner__background{background-image:url(images/background-f9c9ff650c08ee46f153.png);background-position:100%;background-repeat:no-repeat;height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}.rtl .jitm-banner__background{background-position:0;transform:scaleX(-1)}.jitm-banner__content{align-items:center;display:flex;flex-grow:1;flex-shrink:100000;flex-wrap:wrap}@media(max-width:480px){.jitm-banner__content{margin-right:0}}@media(min-width:481px){.jitm-banner__content{flex-wrap:nowrap}}@media(max-width:960px){.jitm-banner__content{margin-right:5px}}.jitm-banner__info{flex-grow:1;line-height:1.4}@media(min-width:481px){.jitm-banner__info{flex-basis:50%}}@media(min-width:961px){.jitm-banner__info{flex-basis:70%}}.jitm-banner__info .jitm-banner__description,.jitm-banner__info .jitm-banner__description a,.jitm-banner__info .jitm-banner__title{color:#000}.jitm-banner__info .jitm-banner__title{font-size:.9375rem;font-weight:700;line-height:136%}.jitm-banner__info .jitm-banner__description{font-size:.8125rem;line-height:150%;margin-top:.125rem}.jitm-banner__info .banner__list{font-size:12px;list-style:none;margin:10px 0}.jitm-banner__info .banner__list li{margin:6px 0}.jitm-banner__info .banner__list li .gridicon{fill:#a2a2a2;display:inline;margin-right:12px;vertical-align:bottom}.jitm-banner__action{align-self:center;font-size:.75rem;overflow:hidden;text-align:left}.jitm-banner__action .jitm-banner__prices{display:flex;justify-content:flex-start}.jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:0}.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted,.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted .dops-plan-price__currency-symbol{color:#414141}.has-call-to-action .jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:.5rem}@media(max-width:480px){.jitm-banner__action{margin-top:1rem}}@media(min-width:481px){.jitm-banner__action{text-align:center;width:auto}.jitm-banner__action .is-dismissible{margin-top:2.5rem}.jitm-banner__action .jitm-banner__prices{justify-content:flex-end;text-align:right}}.jitm-banner__dismiss{display:block;line-height:.5;margin-bottom:auto;margin-top:auto;text-decoration:none}.jitm-banner__dismiss:before{color:#6f6f6f;content:"";font:400 20px/1 dashicons}@media(min-width:661px){.jitm-banner__dismiss{margin-right:-.5rem}}@media(max-width:480px){.jitm-banner__dismiss{align-items:center;display:flex;height:48px;justify-content:center;margin:0;position:absolute;right:0;top:0;width:48px}}.jitm-banner__action+.jitm-banner__dismiss{margin-left:.625rem}#dolly+.jitm-card{margin:3rem 1rem 0 auto} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.js new file mode 100644 index 00000000..a58f31a9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.js @@ -0,0 +1 @@ +(()=>{"use strict";var t={428:t=>{t.exports=window.jQuery}},a={};function e(n){var i=a[n];if(void 0!==i)return i.exports;var c=a[n]={exports:{}};return t[n](c,c.exports,e),c.exports}e.n=t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a:a}),a},e.d=(t,a)=>{for(var n in a)e.o(a,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:a[n]})},e.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a);var n=e(428);e.n(n)()(document).ready((function(t){var a={default:function(a){const e='\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t';var n='
';if(n+='
',n+='
',n+='
'+a.content.icon+"
",n+='
',n+='
'+a.content.message+"
",a.content.description&&""!==a.content.description){if(n+='
'+a.content.description,a.content.list.length>0){n+='
"}if(n+="
",n+="
",n+='
',a.activate_module&&(n+='",a.module_settings_link&&(n+='")),a.CTA.message){var o="jitm-button is-compact";a.CTA.primary&&null===a.activate_module?o+=" is-primary":o+=" is-secondary";var r=a.CTA.ajax_action,s=a.CTA.newWindow&&!r;n+='"}return n+="
",a.is_dismissible&&(n+=''),t(n+="
")}},e=function(){t(".jetpack-jitm-message").each((function(){var e=t(this),n=e.data("message-path"),i=e.data("query"),c=e.data("redirect"),o=location.hash;o=o.replace(/#\//,"_"),n.includes("jetpack_page_my-jetpack")?n=n.replace("jetpack_page_my-jetpack","jetpack_page_my-jetpack"+o):"_dashboard"!==o&&(n=n.replace("toplevel_page_jetpack","toplevel_page_jetpack"+o));var r=!!t(".jetpack-logo__masthead").length;t.get(window.jitm_config.api_root+"jetpack/v4/jitm",{message_path:n,query:i,full_jp_logo_exists:r,_wpnonce:e.data("nonce")}).then((function(n){"object"==typeof n&&n[1]&&(n=[n[1]]),0!==n.length&&n[0].content&&function(e,n,i){var c;(c=n.template)&&a[c]||(c="default"),n.url=n.url+"&redirect="+i;var o,r=a[c](n);r.find(".jitm-banner__dismiss").on("click",(o=r,function(a){a.preventDefault(),o.hide(),t.ajax({url:window.jitm_config.api_root+"jetpack/v4/jitm",method:"POST",beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",window.jitm_config.nonce)},data:{id:n.id,feature_class:n.feature_class}})})),t("#jp-admin-notices").length>0?(e.innerHTML=r,t("#jp-admin-notices").find(".jitm-card")&&t(".jitm-card").replaceWith(r),r.prependTo(t("#jp-admin-notices"))):e.replaceWith(r),r.find("#jitm-banner__activate a").on("click",(function(){var a=t(this);if(a.attr("disabled"))return!1;t.ajax({url:window.jitm_config.api_root+"jetpack/v4/module/"+a.data("module")+"/active",method:"POST",beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",e.data("nonce")),t("#jitm-banner__activate a").text(window.jitm_config.activating_module_text),t("#jitm-banner__activate a").attr("disabled",!0)}}).done((function(){if(t("#jitm-banner__activate a").text(window.jitm_config.activated_module_text),t("#jitm-banner__activate a").attr("disabled",!0),a.data("settings_link"))return t("#jitm-banner__settings").show(),void t("#jitm-banner__activate").hide();setTimeout((function(){r.fadeOut("slow")}),2e3)}))})),r.find(".jitm-button[data-ajax-action]").on("click",(function(a){a.preventDefault();var n=t(this);return n.attr("disabled",!0),t.post(window.ajaxurl,{action:n.data("ajax-action"),_nonce:e.data("ajax-nonce")}).done((function(){r.fadeOut("slow")})).fail((function(){n.attr("disabled",!1)})),!1})),r.find(".jitm-button").on("click",(function(a){var e=t(this),n=e.attr("data-jptracks-name");if(void 0!==n){var i={clicked:e.attr("data-jptracks-prop")||!1,jitm_message_path:e.attr("data-jitm-path")||!1};window.jpTracksAJAX&&window.jpTracksAJAX.record_ajax_event(n,"click",i)}}))}(e,n[0],c)}))}))};e(),t(window).on("hashchange",(function(t){const a=t.originalEvent.newURL;if(["jetpack","my-jetpack","jetpack-backup","jetpack-boost","jetpack-protect","jetpack-search","jetpack-social","jetpack-videopress"].some((t=>a.includes(`admin.php?page=${t}`)))){var n=document.querySelector(".jitm-card");n&&n.remove(),e()}}))}))})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.rtl.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.rtl.css new file mode 100644 index 00000000..b87e4632 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.rtl.css @@ -0,0 +1 @@ +.jitm-button{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid #000;border-radius:4px;box-sizing:border-box;color:#000;cursor:pointer;display:inline-block;font-size:14px;font-weight:600;margin:0;min-width:90px;outline:0;overflow:hidden;padding:7px 14px 9px;text-align:center;text-decoration:none;text-overflow:ellipsis;vertical-align:top;width:100%}.jitm-button.is-primary{background:#000;color:#fff}.jitm-button.is-primary .gridicons-external-link{fill:#fff}.jitm-button.is-secondary .gridicons-external-link{fill:#000}.jitm-button.is-secondary:hover{background:#f6f7f7;color:#000}.jitm-button.is-secondary:hover .gridicons-external-link{fill:#000}.jitm-button:focus,.jitm-button:hover{background:#414141;border-color:#414141;color:#fff}.jitm-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2271b1}.jitm-button:disabled,.jitm-button[disabled]{background:#dcdcde;border-color:#dcdcde;color:#a7aaad;cursor:default}.jitm-button.is-compact{font-size:14px;height:32px;line-height:1;white-space:nowrap}.jitm-button.is-compact .gridicon{margin-top:-8px;top:4px}.jitm-button.is-compact .gridicons-plus-small{margin-right:-4px}.jitm-button.is-compact .gridicons-plus-small:last-of-type{margin-right:0}.jitm-button.is-compact .gridicons-plus-small+.gridicon{margin-right:-4px}.jitm-button.is-compact .gridicons-external-link{margin:-3px 2px -3px 0}.jitm-button.hidden{display:none}.jitm-card{background-color:#fff;border:1px solid #fff;border-radius:2px;box-shadow:0 1px 4px #00000029;box-sizing:border-box;clear:both;display:block;margin:3rem auto 0 1.25rem;padding:1rem 1.25rem 1rem 1rem;position:relative}.jitm-card:after{clear:both;content:".";display:block;height:0;visibility:hidden}.jitm-card.is-compact{margin-bottom:.0625rem}@media(min-width:481px){.jitm-card.is-compact{margin-bottom:1px;padding:1rem 1.5rem}}.jitm-card.is-card-link{padding-left:3rem}.my-jetpack-jitm-card .jitm-card{margin-bottom:1.5rem;margin-left:0;margin-top:1.5rem}#screen-meta-links+.jitm-card{margin:2.5rem auto 0 1.5385em}.post-php .jitm-card{margin-left:0}.jp-lower .jitm-card{margin:0 0 1.5rem}.jitm-banner.jitm-card{display:flex;position:relative;z-index:2}.jitm-banner.jitm-card:before{border-bottom-right-radius:1px;border-top-right-radius:1px;content:"";height:100%;position:absolute;right:0;top:0;width:4px}@media(max-width:480px){.jitm-banner.jitm-card{display:flex;flex-direction:column}}.jitm-banner.jitm-card.is-card-link{padding:.75rem 1rem .75rem 3rem}.jitm-banner.jitm-card.is-dismissible{padding-left:3rem}.jitm-banner.jitm-card:before{background-color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon{color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon-circle{background-color:#4ab866}.jitm-banner.jitm-card.is-upgrade-personal:before{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon{color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon-circle{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-premium:before{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon{color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon-circle{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-business:before,.jitm-banner.jitm-card.woo-jitm:before{background-color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon{color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon-circle,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon-circle{background-color:#855da6}.jitm-banner.jitm-card .jitm-card__link-indicator{align-items:center;color:#0087be;display:flex}.jitm-banner.jitm-card:hover{transition:all .1s ease-in-out}.jitm-banner.jitm-card:hover.is-card-link{box-shadow:0 0 0 1px #a2a2a2,0 2px 4px #d5d5d5}.jitm-banner.jitm-card:hover .jitm-card__link-indicator{color:#005082}@media(min-width:481px){.jitm-banner.jitm-card{padding:1rem 1.25rem 1rem 1rem}.jitm-banner.jitm-card.is-dismissible{padding-left:1rem}}.jitm-banner__buttons_container{display:flex;gap:1rem;height:50%;margin:auto 0 auto 1rem;overflow:hidden}@media(min-width:481px){.jitm-banner__buttons_container{margin-right:1rem}}.jitm-banner__icons{display:flex}.jitm-banner__icons .jitm-banner__icon,.jitm-banner__icons .jitm-banner__icon-circle{border-radius:50%;flex-shrink:0;height:1.5rem;margin-left:1rem;margin-top:-.125rem;text-align:center;top:.25rem;width:1.5rem}.jitm-banner__icons .jitm-banner__icon{align-self:center;color:#fff;display:block}.jitm-banner__icons .jitm-banner__icon-circle{color:#fff;display:none;padding:.1875rem .1875rem .25rem .25rem}@media(min-width:481px){.jitm-banner__icons{align-items:center}.jitm-banner__icons .jitm-banner__icon{display:none}.jitm-banner__icons .jitm-banner__icon-circle{display:block}}.jitm-banner__icon-plan{display:flex;margin-left:1rem}.jitm-banner__icon-plan .dops-plan-icon{height:2rem;width:2rem}.jitm-banner__icon-plan .jp-emblem{position:relative;top:.125rem}@media(max-width:480px){.jitm-banner__icon-plan .jp-emblem{margin-bottom:1rem}}.jitm-banner__icon-plan .jp-emblem svg{height:2rem;width:2rem;fill:#069e08}.jitm-banner__icon-plan .jp-emblem .jitm-jp-logo{height:inherit;width:2.5rem;fill:inherit}@media(min-width:481px){.jitm-banner__icon-plan{align-items:center}}.jitm-banner__background{background-image:url(images/background-f9c9ff650c08ee46f153.png);background-position:0;background-repeat:no-repeat;height:100%;position:absolute;right:0;top:0;width:100%;z-index:-1}.rtl .jitm-banner__background{background-position:100%;transform:scaleX(-1)}.jitm-banner__content{align-items:center;display:flex;flex-grow:1;flex-shrink:100000;flex-wrap:wrap}@media(max-width:480px){.jitm-banner__content{margin-left:0}}@media(min-width:481px){.jitm-banner__content{flex-wrap:nowrap}}@media(max-width:960px){.jitm-banner__content{margin-left:5px}}.jitm-banner__info{flex-grow:1;line-height:1.4}@media(min-width:481px){.jitm-banner__info{flex-basis:50%}}@media(min-width:961px){.jitm-banner__info{flex-basis:70%}}.jitm-banner__info .jitm-banner__description,.jitm-banner__info .jitm-banner__description a,.jitm-banner__info .jitm-banner__title{color:#000}.jitm-banner__info .jitm-banner__title{font-size:.9375rem;font-weight:700;line-height:136%}.jitm-banner__info .jitm-banner__description{font-size:.8125rem;line-height:150%;margin-top:.125rem}.jitm-banner__info .banner__list{font-size:12px;list-style:none;margin:10px 0}.jitm-banner__info .banner__list li{margin:6px 0}.jitm-banner__info .banner__list li .gridicon{fill:#a2a2a2;display:inline;margin-left:12px;vertical-align:bottom}.jitm-banner__action{align-self:center;font-size:.75rem;overflow:hidden;text-align:right}.jitm-banner__action .jitm-banner__prices{display:flex;justify-content:flex-start}.jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:0}.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted,.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted .dops-plan-price__currency-symbol{color:#414141}.has-call-to-action .jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:.5rem}@media(max-width:480px){.jitm-banner__action{margin-top:1rem}}@media(min-width:481px){.jitm-banner__action{text-align:center;width:auto}.jitm-banner__action .is-dismissible{margin-top:2.5rem}.jitm-banner__action .jitm-banner__prices{justify-content:flex-end;text-align:left}}.jitm-banner__dismiss{display:block;line-height:.5;margin-bottom:auto;margin-top:auto;text-decoration:none}.jitm-banner__dismiss:before{color:#6f6f6f;content:"";font:400 20px/1 dashicons}@media(min-width:661px){.jitm-banner__dismiss{margin-left:-.5rem}}@media(max-width:480px){.jitm-banner__dismiss{align-items:center;display:flex;height:48px;justify-content:center;left:0;margin:0;position:absolute;top:0;width:48px}}.jitm-banner__action+.jitm-banner__dismiss{margin-right:.625rem}#dolly+.jitm-card{margin:3rem auto 0 1rem} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/composer.json new file mode 100644 index 00000000..975f3341 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/composer.json @@ -0,0 +1,63 @@ +{ + "name": "automattic/jetpack-jitm", + "description": "Just in time messages for Jetpack", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-a8c-mc-stats": "^2.0.2", + "automattic/jetpack-assets": "^2.3.7", + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-device-detection": "^2.1.4", + "automattic/jetpack-logo": "^2.0.4", + "automattic/jetpack-redirect": "^2.0.4", + "automattic/jetpack-status": "^4.0.0" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-production": [ + "pnpm run build-production" + ], + "build-development": [ + "pnpm run build" + ], + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run watch" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-jitm", + "textdomain": "jetpack-jitm", + "version-constants": { + "::PACKAGE_VERSION": "src/class-jitm.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-jitm/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "3.1.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php new file mode 100644 index 00000000..802cce7d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php @@ -0,0 +1,347 @@ +register(); + } + + /** + * Pre/Post Connection JITM factory metod + * + * @return Post_Connection_JITM|Pre_Connection_JITM JITM instance. + */ + public static function get_instance() { + if ( ( new Connection_Manager() )->is_connected() ) { + $jitm = new Post_Connection_JITM(); + } else { + $jitm = new Pre_Connection_JITM(); + } + return $jitm; + } + + /** + * Sets up JITM action callbacks if needed. + */ + public function register() { + if ( did_action( 'jetpack_registered_jitms' ) ) { + // JITMs have already been registered. + return; + } + + if ( ! $this->jitms_enabled() ) { + // Do nothing. + return; + } + + add_action( 'rest_api_init', array( __NAMESPACE__ . '\\Rest_Api_Endpoints', 'register_endpoints' ) ); + + add_action( 'current_screen', array( $this, 'prepare_jitms' ) ); + + /** + * These are sync actions that we need to keep track of for jitms. + */ + add_filter( 'jetpack_sync_before_send_updated_option', array( $this, 'jetpack_track_last_sync_callback' ), 99 ); + + /** + * Fires when the JITMs are registered. This action is used to ensure that + * JITMs are registered only once. + * + * @since 1.16.0 + */ + do_action( 'jetpack_registered_jitms' ); + } + + /** + * Checks the jetpack_just_in_time_msgs filters and whether the site + * is offline to determine whether JITMs are enabled. + * + * @return bool True if JITMs are enabled, else false. + */ + public function jitms_enabled() { + /** + * Filter to turn off all just in time messages + * + * @since 1.1.0 + * @since-jetpack 3.7.0 + * @since-jetpack 5.4.0 Correct docblock to reflect default arg value + * + * @param bool true Whether to show just in time messages. + */ + if ( ! apply_filters( 'jetpack_just_in_time_msgs', true ) ) { + return false; + } + + // Folks cannot connect to WordPress.com and won't really be able to act on the pre-connection messages. So bail. + if ( ( new Status() )->is_offline_mode() ) { + return false; + } + + return true; + } + + /** + * Prepare actions according to screen and post type. + * + * @since 1.1.0 + * @since-jetpack 3.8.2 + * + * @uses Jetpack_Autoupdate::get_possible_failures() + * + * @param \WP_Screen $screen WP Core's screen object. + */ + public function prepare_jitms( $screen ) { + /** + * Filter to hide JITMs on certain screens. + * + * @since 1.14.0 + * + * @param bool true Whether to show just in time messages. + * @param string $string->id The ID of the current screen. + */ + if ( apply_filters( 'jetpack_display_jitms_on_screen', true, $screen->id ) ) { + add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) ); + add_action( 'admin_notices', array( $this, 'ajax_message' ) ); + add_action( 'edit_form_top', array( $this, 'ajax_message' ) ); + } + } + + /** + * Check if the current page is a Jetpack or WooCommerce admin page. + * Noting that this is a very basic check, and pages from other plugins may also match. + * + * @since 3.1.0 + * + * @return bool True if the current page is a Jetpack or WooCommerce admin page, else false. + */ + public function is_a8c_admin_page() { + if ( ! function_exists( 'get_current_screen' ) ) { + return false; + } + + $current_screen = get_current_screen(); + + // We never want to show JITMs on the block editor. + if ( + method_exists( $current_screen, 'is_block_editor' ) + && $current_screen->is_block_editor() + ) { + return false; + } + + return ( + $current_screen + && $current_screen->id + && (bool) preg_match( '/jetpack|woo|shop|product/', $current_screen->id ) + ); + } + + /** + * Function to enqueue jitm css and js + */ + public function jitm_enqueue_files() { + // Only load those files on the Jetpack or Woo admin pages. + if ( ! $this->is_a8c_admin_page() ) { + return; + } + + Assets::register_script( + 'jetpack-jitm', + '../build/index.js', + __FILE__, + array( + 'in_footer' => true, + 'dependencies' => array( 'jquery' ), + 'enqueue' => true, + ) + ); + wp_localize_script( + 'jetpack-jitm', + 'jitm_config', + array( + 'api_root' => esc_url_raw( rest_url() ), + 'activate_module_text' => esc_html__( 'Activate', 'jetpack-jitm' ), + 'activated_module_text' => esc_html__( 'Activated', 'jetpack-jitm' ), + 'activating_module_text' => esc_html__( 'Activating', 'jetpack-jitm' ), + 'settings_module_text' => esc_html__( 'Settings', 'jetpack-jitm' ), + 'nonce' => wp_create_nonce( 'wp_rest' ), + ) + ); + } + + /** + * Is the current page a block editor page? + * + * @since 1.1.0 + * @since-jetpack 8.0.0 + * + * @deprecated 3.1.0 + */ + public function is_gutenberg_page() { + _deprecated_function( __METHOD__, '3.1.0' ); + $current_screen = get_current_screen(); + return ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ); + } + + /** + * Get's the current message path for display of a JITM + * + * @return string The message path + */ + public function get_message_path() { + $screen = get_current_screen(); + + return 'wp:' . $screen->id . ':' . current_filter(); + } + + /** + * Injects the dom to show a JITM inside of wp-admin. + */ + public function ajax_message() { + if ( ! is_admin() ) { + return; + } + + // Only add this to Jetpack or Woo admin pages. + if ( ! $this->is_a8c_admin_page() ) { + return; + } + + $message_path = $this->get_message_path(); + $query_string = _http_build_query( $_GET, '', ',' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $current_screen = isset( $_SERVER['REQUEST_URI'] ) ? wp_unslash( $_SERVER['REQUEST_URI'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- Escaped below + ?> +
+ ' . ( ( $full_jp_logo_exists ) ? $jetpack_logo->get_jp_emblem() : $jetpack_logo->get_jp_emblem_larger() ) . ''; + break; + case 'woocommerce': + $content_icon = ''; + break; + default: + $content_icon = ''; + break; + } + return $content_icon; + } + + /** + * Returns an array containing the supported icons for JITMs. + * + * The list includes an empty string, which is used when no icon should be displayed. + * + * @return array The list of supported icons. + */ + public function get_supported_icons() { + return array( + 'jetpack', + 'woocommerce', + '', + ); + } + + /** + * Stores dismiss data into an option + * + * @param string $key Dismiss key. + */ + public function save_dismiss( $key ) { + $hide_jitm = \Jetpack_Options::get_option( 'hide_jitm' ); + if ( ! is_array( $hide_jitm ) ) { + $hide_jitm = array(); + } + + if ( ! isset( $hide_jitm[ $key ] ) || ! is_array( $hide_jitm[ $key ] ) ) { + $hide_jitm[ $key ] = array( + 'last_dismissal' => 0, + 'number' => 0, + ); + } + + $hide_jitm[ $key ] = array( + 'last_dismissal' => time(), + 'number' => $hide_jitm[ $key ]['number'] + 1, + ); + + \Jetpack_Options::update_option( 'hide_jitm', $hide_jitm ); + } + + /** + * Sets the 'jetpack_last_plugin_sync' transient when the active_plugins option is synced. + * + * @param array $params The action parameters. + * + * @return array Returns the action parameters unchanged. + */ + public function jetpack_track_last_sync_callback( $params ) { + /** + * This filter is documented in the Automattic\Jetpack\JITMS\Post_Connection_JITM class. + */ + if ( ! apply_filters( 'jetpack_just_in_time_msg_cache', true ) ) { + return $params; + } + + if ( is_array( $params ) && isset( $params[0] ) ) { + $option = $params[0]; + if ( 'active_plugins' === $option ) { + // Use the cache if we can, but not terribly important if it gets evicted. + set_transient( 'jetpack_last_plugin_sync', time(), HOUR_IN_SECONDS ); + } + } + + return $params; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php new file mode 100644 index 00000000..8ab43298 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php @@ -0,0 +1,417 @@ +tracking = new Tracking(); + } + + /** + * A special filter for WooCommerce, to set a message based on local state. + * + * @param object $content The current message. + * + * @return object The new message. + */ + public static function jitm_woocommerce_services_msg( $content ) { + if ( ! function_exists( 'wc_get_base_location' ) ) { + return $content; + } + + $base_location = wc_get_base_location(); + + switch ( $base_location['country'] ) { + case 'US': + $content->message = esc_html__( 'New free service: Show USPS shipping rates on your store! Added bonus: print shipping labels without leaving WooCommerce.', 'jetpack-jitm' ); + break; + case 'CA': + $content->message = esc_html__( 'New free service: Show Canada Post shipping rates on your store!', 'jetpack-jitm' ); + break; + default: + $content->message = ''; + } + + return $content; + } + + /** + * A special filter for WooCommerce Call To Action button + * + * @return string The new CTA + */ + public static function jitm_jetpack_woo_services_install() { + return wp_nonce_url( + add_query_arg( + array( + 'wc-services-action' => 'install', + ), + admin_url( 'admin.php?page=wc-settings' ) + ), + 'wc-services-install' + ); + } + + /** + * A special filter for WooCommerce Call To Action button. + * + * @return string The new CTA + */ + public static function jitm_jetpack_woo_services_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'wc-services-action' => 'activate', + ), + admin_url( 'admin.php?page=wc-settings' ) + ), + 'wc-services-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to install the Creative Mail plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_creative_mail_install() { + return wp_nonce_url( + add_query_arg( + array( + 'creative-mail-action' => 'install', + ), + admin_url( 'edit.php?post_type=feedback' ) + ), + 'creative-mail-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to activate the Creative Mail plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_creative_mail_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'creative-mail-action' => 'activate', + ), + admin_url( 'edit.php?post_type=feedback' ) + ), + 'creative-mail-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to install the Jetpack Backup plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_backup_install() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-backup-action' => 'install', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-backup-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to activate the Jetpack Backup plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_backup_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-backup-action' => 'activate', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-backup-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to install the Jetpack Boost plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_boost_install() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-boost-action' => 'install', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-boost-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to activate the Jetpack Boost plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_boost_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-boost-action' => 'activate', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-boost-install' + ); + } + + /** + * Dismisses a JITM feature class so that it will no longer be shown. + * + * @param string $id The id of the JITM that was dismissed. + * @param string $feature_class The feature class of the JITM that was dismissed. + * + * @return bool Always true. + */ + public function dismiss( $id, $feature_class ) { + $this->tracking->record_user_event( + 'jitm_dismiss_client', + array( + 'jitm_id' => $id, + 'feature_class' => $feature_class, + ) + ); + $this->save_dismiss( $feature_class ); + return true; + } + + /** + * Asks the wpcom API for the current message to display keyed on query string and message path + * + * @param string $message_path The message path to ask for. + * @param string $query The query string originally from the front end. + * @param bool $full_jp_logo_exists If there is a full Jetpack logo already on the page. + * + * @return array The JITM's to show, or an empty array if there is nothing to show + */ + public function get_messages( $message_path, $query, $full_jp_logo_exists ) { + // WooCommerce Services. + add_filter( 'jitm_woocommerce_services_msg', array( $this, 'jitm_woocommerce_services_msg' ) ); + add_filter( 'jitm_jetpack_woo_services_install', array( $this, 'jitm_jetpack_woo_services_install' ) ); + add_filter( 'jitm_jetpack_woo_services_activate', array( $this, 'jitm_jetpack_woo_services_activate' ) ); + + // Creative Mail. + add_filter( 'jitm_jetpack_creative_mail_install', array( $this, 'jitm_jetpack_creative_mail_install' ) ); + add_filter( 'jitm_jetpack_creative_mail_activate', array( $this, 'jitm_jetpack_creative_mail_activate' ) ); + + // Jetpack Backup. + add_filter( 'jitm_jetpack_backup_install', array( $this, 'jitm_jetpack_backup_install' ) ); + add_filter( 'jitm_jetpack_backup_activate', array( $this, 'jitm_jetpack_backup_activate' ) ); + + // Jetpack Boost. + add_filter( 'jitm_jetpack_boost_install', array( $this, 'jitm_jetpack_boost_install' ) ); + add_filter( 'jitm_jetpack_boost_activate', array( $this, 'jitm_jetpack_boost_activate' ) ); + + $user = wp_get_current_user(); + + // Unauthenticated or invalid requests just bail. + if ( ! $user ) { + return array(); + } + + $user_roles = implode( ',', $user->roles ); + $site_id = \Jetpack_Options::get_option( 'id' ); + + // Build our jitm request. + $path = add_query_arg( + array( + 'external_user_id' => urlencode_deep( $user->ID ), + 'user_roles' => urlencode_deep( $user_roles ), + 'query_string' => urlencode_deep( build_query( $query ) ), + 'mobile_browser' => Device_Detection::is_smartphone() ? 1 : 0, + '_locale' => get_user_locale(), + ), + sprintf( '/sites/%d/jitm/%s', $site_id, $message_path ) + ); + + // Attempt to get from cache. + $envelopes = get_transient( 'jetpack_jitm_' . substr( md5( $path ), 0, 31 ) ); + + // If something is in the cache and it was put in the cache after the last sync we care about, use it. + $use_cache = false; + + /** + * Filter to turn off jitm caching + * + * @since 1.1.0 + * @since-jetpack 5.4.0 + * + * @param bool true Whether to cache just in time messages + */ + if ( apply_filters( 'jetpack_just_in_time_msg_cache', true ) ) { + $use_cache = true; + } + + if ( $use_cache ) { + $last_sync = (int) get_transient( 'jetpack_last_plugin_sync' ); + $from_cache = $envelopes && $last_sync > 0 && $last_sync < $envelopes['last_response_time']; + } else { + $from_cache = false; + } + + // Otherwise, ask again. + if ( ! $from_cache ) { + $wpcom_response = Client::wpcom_json_api_request_as_blog( + $path, + '2', + array( + 'user_id' => $user->ID, + 'user_roles' => implode( ',', $user->roles ), + ), + null, + 'wpcom' + ); + + // silently fail...might be helpful to track it? + if ( is_wp_error( $wpcom_response ) ) { + return array(); + } + + $envelopes = json_decode( $wpcom_response['body'] ); + + if ( ! is_array( $envelopes ) ) { + return array(); + } + + $expiration = isset( $envelopes[0] ) ? $envelopes[0]->ttl : 300; + + // Do not cache if expiration is 0 or we're not using the cache. + if ( 0 !== $expiration && $use_cache ) { + $envelopes['last_response_time'] = time(); + + set_transient( 'jetpack_jitm_' . substr( md5( $path ), 0, 31 ), $envelopes, $expiration ); + } + } + + $hidden_jitms = \Jetpack_Options::get_option( 'hide_jitm' ); + unset( $envelopes['last_response_time'] ); + + /** + * Allow adding your own custom JITMs after a set of JITMs has been received. + * + * @since 1.1.0 + * @since-jetpack 6.9.0 + * @since-jetpack 8.3.0 - Added Message path. + * + * @param array $envelopes array of existing JITMs. + * @param string $message_path The message path to ask for. + */ + $envelopes = apply_filters( 'jetpack_jitm_received_envelopes', $envelopes, $message_path ); + + foreach ( $envelopes as $idx => &$envelope ) { + + $dismissed_feature = isset( $hidden_jitms[ $envelope->feature_class ] ) && is_array( $hidden_jitms[ $envelope->feature_class ] ) ? $hidden_jitms[ $envelope->feature_class ] : null; + + // If the this feature class has been dismissed and the request has not passed the ttl, skip it as it's been dismissed. + if ( is_array( $dismissed_feature ) && ( time() - $dismissed_feature['last_dismissal'] < $envelope->expires || $dismissed_feature['number'] >= $envelope->max_dismissal ) ) { + unset( $envelopes[ $idx ] ); + continue; + } + + $this->tracking->record_user_event( + 'jitm_view_client', + array( + 'jitm_id' => $envelope->id, + 'jitm_message_path' => $message_path, + ) + ); + + $url_params = array( + 'u' => $user->ID, + ); + + // Get affiliate code and add it to the array of URL parameters. + $aff = Partner::init()->get_partner_code( Partner::AFFILIATE_CODE ); + if ( '' !== $aff ) { + $url_params['aff'] = $aff; + } + + // Check if the current user has connected their WP.com account + // and if not add this information to the the array of URL parameters. + if ( ! ( new Manager() )->is_user_connected( $user->ID ) ) { + $url_params['query'] = 'unlinked=1'; + } + $envelope->url = esc_url( Redirect::get_url( "jitm-$envelope->id", $url_params ) ); + + $stats = new A8c_Mc_Stats(); + + $envelope->jitm_stats_url = $stats->build_stats_url( array( 'x_jetpack-jitm' => $envelope->id ) ); + + // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + // $CTA is not valid per PHPCS, but it is part of the return from WordPress.com, so allowing. + if ( $envelope->CTA->hook ) { + $envelope->url = apply_filters( 'jitm_' . $envelope->CTA->hook, $envelope->url ); + unset( $envelope->CTA->hook ); + } + // phpcs:enable + + if ( isset( $envelope->content->hook ) ) { + $envelope->content = apply_filters( 'jitm_' . $envelope->content->hook, $envelope->content ); + unset( $envelope->content->hook ); + } + + // No point in showing an empty message. + if ( empty( $envelope->content->message ) ) { + unset( $envelopes[ $idx ] ); + continue; + } + + $envelope->content->icon = $this->generate_icon( $envelope->content->icon, $full_jp_logo_exists ); + $envelope->message_path = esc_attr( $message_path ); + + $stats->add( 'jitm', $envelope->id . '-viewed' ); + $stats->do_server_side_stats(); + } + + return $envelopes; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php new file mode 100644 index 00000000..6a779873 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php @@ -0,0 +1,171 @@ +validate_messages( $messages ); + + $formatted_messages = array(); + + foreach ( $messages as $message ) { + if ( ! preg_match( $message['message_path'], $message_path ) ) { + continue; + } + + $obj = new \stdClass(); + $obj->CTA = array( // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + 'message' => $message['button_caption'], + 'newWindow' => false, + ); + $obj->url = $message['button_link']; + $obj->id = $message['id']; + $obj->is_dismissible = true; + $obj->content = array( + 'message' => $message['message'], + 'description' => $message['description'], + 'list' => array(), + 'icon' => $this->get_message_icon( $message ), + ); + + $formatted_messages[] = $obj; + } + + return $formatted_messages; + } + + /** + * Validates that each of the messages contains all of the required keys: + * - id + * - message_path + * - message + * - description + * - button_link + * - button_caption + * + * @param array $messages An array of JITM messages. + * + * @return array An array of JITM messages that contain all of the required keys. + */ + private function validate_messages( $messages ) { + if ( ! is_array( $messages ) ) { + return array(); + } + + $expected_keys = array_flip( array( 'id', 'message_path', 'message', 'description', 'button_link', 'button_caption' ) ); + + foreach ( $messages as $index => $message ) { + if ( count( array_intersect_key( $expected_keys, $message ) ) !== count( $expected_keys ) ) { + // Remove any messages that are missing expected keys. + unset( $messages[ $index ] ); + } + } + + return $messages; + } + + /** + * Get the icon for the message. + * + * The message may contain an 'icon' key. If the value of the 'icon' key matches a supported icon (or empty string), the value is used. + * If the message does not contain an icon key or if the value does not match a supported icon, the Jetpack icon is used by default. + * + * @param array $message A pre-connection JITM. + * + * @return string The icon to use in the JITM. + */ + private function get_message_icon( $message ) { + // Default to the Jetpack icon. + $icon = 'jetpack'; + + if ( ! isset( $message['icon'] ) ) { + return $icon; + } + + $supported_icons = $this->get_supported_icons(); + + if ( in_array( $message['icon'], $supported_icons, true ) ) { + // Only use the message icon if it's a supported icon or an empty string (for no icon). + $icon = $message['icon']; + } + + return $icon; + } + + /** + * Retrieve the current message to display keyed on query string and message path + * + * @param string $message_path The message path to ask for. + * @param string $query The query string originally from the front end. Unused in this subclass. + * @param bool $full_jp_logo_exists If there is a full Jetpack logo already on the page. + * + * @return array The JITMs to show, or an empty array if there is nothing to show + */ + public function get_messages( $message_path, $query, $full_jp_logo_exists ) { + if ( ! current_user_can( 'install_plugins' ) ) { + return array(); + } + + $messages = $this->filter_messages( $message_path ); + + if ( empty( $messages ) ) { + return array(); + } + + $hidden_jitms = \Jetpack_Options::get_option( 'hide_jitm' ); + + foreach ( $messages as $idx => &$envelope ) { + $dismissed_feature = isset( $hidden_jitms[ 'pre-connection-' . $envelope->id ] ) && + is_array( $hidden_jitms[ 'pre-connection-' . $envelope->id ] ) ? $hidden_jitms[ 'pre-connection-' . $envelope->id ] : null; + + if ( is_array( $dismissed_feature ) ) { + unset( $messages[ $idx ] ); + continue; + } + + $envelope->content['icon'] = $this->generate_icon( $envelope->content['icon'], $full_jp_logo_exists ); + } + + return $messages; + } + + /** + * Dismisses a JITM ID so that it will no longer be shown. + * + * @param string $id The id of the JITM that was dismissed. + * + * @return bool Always true + */ + public function dismiss( $id ) { + $this->save_dismiss( 'pre-connection-' . $id ); + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php new file mode 100644 index 00000000..8e0a127e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php @@ -0,0 +1,98 @@ + WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_jitm_message', + 'permission_callback' => '__return_true', + ) + ); + + register_rest_route( + 'jetpack/v4', + '/jitm', + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => __CLASS__ . '::delete_jitm_message', + 'permission_callback' => __CLASS__ . '::delete_jitm_message_permission_callback', + ) + ); + } + + /** + * Asks for a jitm, unless they've been disabled, in which case it returns an empty array + * + * @param WP_REST_Request $request The request object. + * + * @return array An array of jitms + */ + public static function get_jitm_message( $request ) { + $jitm = JITM::get_instance(); + + if ( ! $jitm->jitms_enabled() ) { + return array(); + } + + // add the search term to the query params if it exists + $query = $request['query']; + if ( ! empty( $request['s'] ) ) { + $query['s'] = $request['s']; + } + + return $jitm->get_messages( $request['message_path'], urldecode_deep( $query ), 'true' === $request['full_jp_logo_exists'] ); + } + + /** + * Dismisses a jitm. + * + * @param WP_REST_Request $request The request object. + * + * @return bool Always True + */ + public static function delete_jitm_message( $request ) { + $jitm = JITM::get_instance(); + + if ( ! $jitm->jitms_enabled() ) { + return true; + } + + return $jitm->dismiss( $request['id'], $request['feature_class'] ); + } + + /** + * Verify that the user can dismiss JITM messages. + * + * @return bool|WP_Error True if user is able to dismiss JITM messages. + */ + public static function delete_jitm_message_permission_callback() { + if ( current_user_can( 'read' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_jetpack_delete_jitm_message', REST_Connector::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/css/jetpack-admin-jitm.scss b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/css/jetpack-admin-jitm.scss new file mode 100644 index 00000000..e054d763 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/css/jetpack-admin-jitm.scss @@ -0,0 +1,516 @@ +// Just in Time Messaging - message prompts + +// TODO: Switch to using the `@automattic/jetpack-base-styles` package when its ready. +@import '../../plugins/jetpack/_inc/client/scss/functions/rem'; +@import '../../plugins/jetpack/_inc/client/scss/variables/colors'; +@import '../../plugins/jetpack/_inc/client/scss/mixins/breakpoints'; +@import '../../plugins/jetpack/_inc/client/scss/calypso-colors'; + +@mixin clear-fix { + &::after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } +} + +@mixin jitm-banner-color( $color ) { + &::before { + background-color: $color; + } + + .jitm-banner__icon { + color: $color; + } + + .jitm-banner__icon-circle { + background-color: $color; + } +} + +// New JITMS - modified calypso banner styles +$blue-medium-dark: #2271b1; +$jp-gray: #dcdcde; +$jp-gray-0: #f6f7f7; +$jp-gray-20: #a7aaad; + +.jitm-button { + border-style: solid; + border-width: 1px; + cursor: pointer; + display: inline-block; + margin: 0; + outline: 0; + overflow: hidden; + text-overflow: ellipsis; + text-decoration: none; + vertical-align: top; + box-sizing: border-box; + font-size: 14px; + border-radius: 4px; + padding: 7px 14px 9px; + -webkit-appearance: none; + appearance: none; + text-align: center; + min-width: 90px; + font-weight: 600; + border-color: black; + background: $white; + color: black; + width: 100%; + + // Primary buttons + &.is-primary { + background: black; + color: $white; + .gridicons-external-link { + fill: $white; + } + } + + // Secondary buttons + &.is-secondary { + .gridicons-external-link { + fill: black; + } + &:hover{ + color: black; + background: $jp-gray-0; + .gridicons-external-link { + fill: black; + } + } + } + + &:hover, + &:focus { + border-color: $gray-dark; + background: $gray-dark; + color: $white; + } + &:focus { + box-shadow: + 0 0 0 1px $white, + 0 0 0 3px $blue-medium-dark; + } + + &[disabled], + &:disabled { + color: $jp-gray-20; + background: $jp-gray; + border-color: $jp-gray; + cursor: default; + } + &.is-compact { + height: 32px; + font-size: 14px; + line-height: 1; + white-space: nowrap; + + .gridicon { + top: 4px; + margin-top: -8px; + } + // Make the left margin of the small plus icon visually less huge + .gridicons-plus-small { + margin-left: -4px; + } + // Reset the left margin if the button contains only the plus icon + .gridicons-plus-small:last-of-type { + margin-left: 0; + } + // Make plus icon nudged closer to adjacent icons for add-people and add-plugin type buttons + .gridicons-plus-small + .gridicon { + margin-left: -4px; + } + + // Properly align icon with the button text + .gridicons-external-link { + margin: -3px 0 -3px 2px; + } + } + &.hidden { + display: none; + } +} + +.jitm-card { + display: block; + clear: both; + position: relative; + margin: rem( 48px ) rem( 20px ) 0 auto; + padding: rem( 16px ); + padding-left: rem( 20px ); + box-sizing: border-box; + background-color: $white; + border: 1px solid $white; + border-radius: 2px; + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.16); + + @include clear-fix; + + // Compact Card + &.is-compact { + margin-bottom: rem( 1px ); + + @include breakpoint( ">480px" ) { + margin-bottom: 1px; + padding: rem( 16px ) rem( 24px ); + } + } + + &.is-card-link { + padding-right: rem( 48px ); + } +} + +// Minor adjustments for the display in My Jetpack. +.my-jetpack-jitm-card { + .jitm-card { + margin-right: 0; + margin-bottom: 1.5rem; + margin-top: 1.5rem; + } +} + +// if JITM appears directly below WordPress "help" menu adjust margins +#screen-meta-links+.jitm-card { + margin: rem( 40px ) 1.5385em 0 auto; +} + +// if JITM appears directly below WordPress hello dolly adjust margins +#dolly+.jitm-card { + margin: 3rem 1rem 0 auto; +} + +// remove right margin for jitms in the editor +.post-php .jitm-card { + margin-right: 0; +} + + // if JITM appears inside of the jetpack dashboard adjust margins + .jp-lower .jitm-card { + margin: 0 0 rem( 24px ); + } + +.jitm-banner.jitm-card { + display: flex; + position: relative; + z-index: 2; + + &::before { + content: ''; + width: 4px; + position: absolute; + top: 0; + left: 0; + height: 100%; + border-top-left-radius: 1px; + border-bottom-left-radius: 1px; + } + + @include breakpoint( "<480px" ) { + display: flex; + flex-direction: column; + } + + &.is-card-link { + padding: rem( 12px ) rem( 48px ) rem( 12px ) rem( 16px ); + } + &.is-dismissible { + padding-right: rem( 48px ); + } + + @include jitm-banner-color( $alert-green ); + + &.is-upgrade-personal { + @include jitm-banner-color( $alert-yellow ); + } + &.is-upgrade-premium { + @include jitm-banner-color( #069e08 ); + } + &.is-upgrade-business, + &.woo-jitm { + @include jitm-banner-color( $alert-purple ); + } + + .jitm-card__link-indicator { + align-items: center; + color: $blue-wordpress; + display: flex; + } + + &:hover { + transition: all 100ms ease-in-out; + &.is-card-link { + box-shadow: 0 0 0 1px $gray, 0 2px 4px lighten( $gray, 20% ); + } + .jitm-card__link-indicator { + color: $blue-dark; + } + } + + @include breakpoint( ">480px" ) { + padding: rem( 16px ); + padding-left: rem( 20px ); + + &.is-dismissible { + padding-right: rem( 16px ); + } + } +} + +.jitm-banner__buttons_container { + display: flex; + height: 50%; + margin: auto rem( 16px ) auto 0; + gap: rem( 16px ); + overflow: hidden; + + @include breakpoint( ">480px" ) { + margin-left: rem( 16px ); + } +} + +.jitm-banner__icons { + display: flex; + + .jitm-banner__icon, + .jitm-banner__icon-circle { + border-radius: 50%; + flex-shrink: 0; + height: rem( 24px ); + width: rem( 24px ); + margin-right: rem( 16px ); + margin-top: rem( -2px ); + text-align: center; + top: rem( 4px ); + } + + .jitm-banner__icon { + align-self: center; + color: $white; + display: block; + } + + .jitm-banner__icon-circle { + color: white; + display: none; + padding: rem( 3px ) rem( 4px ) rem( 4px ) rem( 3px ); + } + + @include breakpoint( ">480px" ) { + align-items: center; + + .jitm-banner__icon { + display: none; + } + .jitm-banner__icon-circle { + display: block; + } + } +} + +.jitm-banner__icon-plan { + display: flex; + margin-right: rem( 16px ); + + .dops-plan-icon { + height: rem( 32px ); + width: rem( 32px ); + } + + .jp-emblem { + position: relative; + top: rem( 2px ); + + @include breakpoint( "<480px" ) { + margin-bottom: rem( 16px ); + } + + svg { + height: rem( 32px ); + width: rem( 32px ); + fill: $green-primary; + } + + .jitm-jp-logo { + height: inherit; + width: rem( 40px ); + fill: inherit; + } + } + + @include breakpoint( ">480px" ) { + align-items: center; + } +} + +.jitm-banner__background { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url( "../images/background.png" ); + background-repeat: no-repeat; + background-position: right center; + z-index: -1; + + .rtl & { + background-position: left center; + transform: scaleX(-1); + } +} + +.jitm-banner__content { + align-items: center; + display: flex; + flex-grow: 1; + flex-wrap: wrap; + flex-shrink: 100000; + + @include breakpoint( "<480px" ) { + margin-right: 0; + } + + @include breakpoint( ">480px" ) { + flex-wrap: nowrap; + } + + @include breakpoint( "<960px" ) { + margin-right: 5px; + } +} + +.jitm-banner__info { + flex-grow: 1; + line-height: 1.4; + + @include breakpoint( ">480px" ) { + flex-basis: 50%; + } + + @include breakpoint( ">960px" ) { + flex-basis: 70%; + } + + .jitm-banner__title, + .jitm-banner__description, + .jitm-banner__description a { + color: black; + } + + .jitm-banner__title { + font-size: rem( 15px ); + font-weight: 700; + line-height: 136%; + } + + .jitm-banner__description { + font-size: rem( 13px ); + line-height: 150%; + margin-top: rem( 2px ); + } + + .banner__list { + font-size: 12px; + list-style: none; + margin: 10px 0; + li { + margin: 6px 0; + .gridicon { + fill: $gray; + display: inline; + margin-right: 12px; + vertical-align: bottom; + } + } + } +} + +.jitm-banner__action { + align-self: center; + font-size: rem( 12px ); + text-align: left; + overflow: hidden; + + .jitm-banner__prices { + display: flex; + justify-content: flex-start; + + .dops-plan-price { + margin-bottom: 0; + } + + .dops-plan-price.is-discounted, + .dops-plan-price.is-discounted .dops-plan-price__currency-symbol { + color: $gray-dark; + } + + .has-call-to-action & .dops-plan-price { + margin-bottom: rem( 8px ); + } + } + + @include breakpoint( "<480px" ) { + margin-top: 1rem; + } + + @include breakpoint( ">480px" ) { + text-align: center; + width: auto; + + .is-dismissible { + margin-top: rem( 40px ); + } + + .jitm-banner__prices { + justify-content: flex-end; + text-align: right; + } + } +} + +.jitm-banner__dismiss { + display: block; + text-decoration: none; + line-height: .5; + margin-top: auto; + margin-bottom: auto; + + &::before { + color: darken($gray, 20%); + font: 400 20px/1 dashicons; + content: '\f335'; + } + + @include breakpoint( ">660px" ) { + margin-right: rem( -8px ); + } + + @include breakpoint( "<480px" ) { + position: absolute; + top: 0; + right: 0; + + display: flex; + justify-content: center; + align-items: center; + margin: 0; + + // Minimum touch area + width: 48px; + height: 48px; + } +} + +.jitm-banner__action + .jitm-banner__dismiss { + margin-left: rem( 10px ); +} + +#dolly + .jitm-card { + margin: 3rem 1rem 0 auto; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/images/background.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/images/background.png new file mode 100644 index 00000000..07ae0ef4 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/images/background.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/CHANGELOG.md new file mode 100644 index 00000000..9722b347 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/CHANGELOG.md @@ -0,0 +1,355 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.0.9] - 2024-09-05 +### Changed +- Update dependencies. + +## [2.0.8] - 2024-09-05 +### Changed +- Update dependencies. + +## [2.0.7] - 2024-08-26 +### Changed +- Updated package dependencies. [#39004] + +## [2.0.6] - 2024-08-19 +### Changed +- Internal updates. + +## [2.0.5] - 2024-04-22 +### Changed +- Internal updates. + +## [2.0.4] - 2024-04-08 +### Changed +- Internal updates. + +## [2.0.3] - 2024-03-25 +### Changed +- Internal updates. + +## [2.0.2] - 2024-03-14 +### Changed +- Internal updates. + +## [2.0.1] - 2023-11-21 + +## [2.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [1.8.4] - 2023-09-19 + +- Minor internal updates. + +## [1.8.3] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.8.2] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.8.1] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.8.0] - 2023-02-08 +### Added +- After connection flow, load unattached licenses. If any of them match the product that's being connected, redirect users to the license activation page. [#28509] + +## [1.7.14] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.7.13] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.7.12] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.7.11] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [1.7.10] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [1.7.9] - 2022-09-08 +### Changed +- Updated package dependencies. + +## [1.7.8] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [1.7.7] - 2022-08-23 +### Changed +- Updated package dependencies. [#25628] + +## [1.7.6] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [1.7.5] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.7.4] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.7.3] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [1.7.2] - 2022-05-04 +### Changed +- Updated package dependencies. [#24095] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [1.7.1] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.7.0] - 2022-04-19 +### Changed +- Moved licensing endpoints from the Jetpack plugin to the Licensing package + +## [1.6.4] - 2022-04-12 +### Changed +- Updated package dependencies. + +## [1.6.3] - 2022-03-02 +### Changed +- Updated package dependencies. + +## [1.6.2] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.6.1] - 2022-01-18 +### Changed +- Updated package dependencies. + +## [1.6.0] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies +- Updated package textdomain from `jetpack` to `jetpack-licensing`. + +## [1.5.4] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.5.3] - 2021-12-03 +### Changed +- Increases the timeout of the license activation request from 10 to 30 seconds. + +## [1.5.2] - 2021-11-30 +### Changed +- Updated package dependencies. + +## [1.5.1] - 2021-11-23 +### Changed +- Updated package dependencies. + +## [1.5.0] - 2021-11-16 +### Added +- Add a test for update to WPCOM return change. +- Added get_license_activation_notice_dismiss() function. + +## [1.4.9] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.4.8] - 2021-10-19 +### Changed +- Updated package dependencies. + +## [1.4.7] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.4.6] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.4.5] - 2021-08-31 +### Changed +- Run composer update on test-php command instead of phpunit. +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- Updated versions in annotations. + +## [1.4.4] - 2021-07-27 +### Changed +- Updated package dependencies. + +## [1.4.3] - 2021-06-29 +### Changed +- Updated package dependencies. + +## [1.4.2] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.4.1] - 2021-04-27 +### Changed +- Updated package dependencies. + +## [1.4.0] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies +- Dashboard: add new option to input license key. + +### Changed +- Replace usage of deprecated is_active method +- Update package dependencies. + +### Fixed +- Fix stored licenses not being attached on option creation +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.3.4] - 2021-02-23 + +- CI: Make tests more generic +- codesniffer: Hack around mediawiki-codesniffer bug + +## [1.3.3] - 2021-02-08 + +- Update dependencies to latest stable + +## [1.3.2] - 2021-01-28 + +- Update dependencies to latest stable + +## [1.3.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.3.0] - 2021-01-05 + +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.2.4] - 2020-11-24 + +- Version packages for release + +## [1.2.3] - 2020-11-24 + +- Updated PHPCS: Packages and Debugger + +## [1.2.2] - 2020-11-05 + +- Update dependencies to latest stable + +## [1.2.1] - 2020-10-29 + +- Update dependencies to latest stable + +## [1.2.0] - 2020-10-27 + +- Licensing: use Oxford comma in error message + +## [1.1.4] - 2020-10-14 + +- Update dependencies to latest stable + +## [1.1.3] - 2020-10-09 + +- Update dependencies to latest stable + +## [1.1.2] - 2020-10-06 + +- Update dependencies to latest stable + +## [1.1.1] - 2020-10-01 + +- Update dependencies to latest stable + +## [1.1.0] - 2020-09-29 + +- Update dependencies to latest stable + +## 1.0.0 - 2020-09-24 + +- Licensing: Add support for Jetpack licenses + +[2.0.9]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.8...v2.0.9 +[2.0.8]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.7...v2.0.8 +[2.0.7]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.6...v2.0.7 +[2.0.6]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.5...v2.0.6 +[2.0.5]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.4...v2.0.5 +[2.0.4]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-licensing/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.8.4...v2.0.0 +[1.8.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.8.3...v1.8.4 +[1.8.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.8.2...v1.8.3 +[1.8.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.8.1...v1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.14...v1.8.0 +[1.7.14]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.13...v1.7.14 +[1.7.13]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.12...v1.7.13 +[1.7.12]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.11...v1.7.12 +[1.7.11]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.10...v1.7.11 +[1.7.10]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.9...v1.7.10 +[1.7.9]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.8...v1.7.9 +[1.7.8]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.7...v1.7.8 +[1.7.7]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.6...v1.7.7 +[1.7.6]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.4...v1.7.0 +[1.6.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.4...v1.6.0 +[1.5.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.9...v1.5.0 +[1.4.9]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.8...v1.4.9 +[1.4.8]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.7...v1.4.8 +[1.4.7]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.6...v1.4.7 +[1.4.6]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.4...v1.4.0 +[1.3.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.3...v1.3.4 +[1.3.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.2...v1.3.3 +[1.3.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.1...v1.3.2 +[1.3.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.4...v1.3.0 +[1.2.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.3...v1.2.4 +[1.2.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.2...v1.2.3 +[1.2.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.1...v1.2.2 +[1.2.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.0...v1.2.1 +[1.2.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.4...v1.2.0 +[1.1.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.3...v1.1.4 +[1.1.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.2...v1.1.3 +[1.1.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/composer.json new file mode 100644 index 00000000..2b08026c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/composer.json @@ -0,0 +1,51 @@ +{ + "name": "automattic/jetpack-licensing", + "description": "Everything needed to manage Jetpack licenses client-side.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-connection": "^4.0.0" + }, + "require-dev": { + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-licensing", + "textdomain": "jetpack-licensing", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-licensing/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php new file mode 100644 index 00000000..0972505a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php @@ -0,0 +1,449 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_licensing_error', + 'permission_callback' => __CLASS__ . '::can_manage_options_check', + ), + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_licensing_error', + 'permission_callback' => __CLASS__ . '::can_manage_options_check', + 'args' => array( + 'error' => array( + 'required' => true, + 'type' => 'string', + 'validate_callback' => __CLASS__ . '::validate_string', + 'sanitize_callback' => 'sanitize_text_field', + ), + ), + ), + ) + ); + + /** + * Sets a license. This is still used as part of the first pass at licensing done for partners. + * + * See https://github.com/Automattic/jetpack/pull/23687 for more details. + */ + register_rest_route( + 'jetpack/v4', + '/licensing/set-license', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::set_jetpack_license', + 'permission_callback' => __CLASS__ . '::set_jetpack_license_key_permission_check', + 'args' => array( + 'license' => array( + 'required' => true, + 'type' => 'string', + 'validate_callback' => __CLASS__ . '::validate_string', + 'sanitize_callback' => 'sanitize_text_field', + ), + ), + ) + ); + + /** + * Get Jetpack user licenses. + */ + register_rest_route( + 'jetpack/v4', + 'licensing/user/licenses', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_user_licenses', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + ) + ); + + /** + * Get Jetpack user license counts. + */ + register_rest_route( + 'jetpack/v4', + 'licensing/user/counts', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_user_license_counts', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + ) + ); + + /** + * Update user-licensing activation notice dismiss info. + */ + register_rest_route( + 'jetpack/v4', + 'licensing/user/activation-notice-dismiss', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_licensing_activation_notice_dismiss', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + 'args' => array( + 'last_detached_count' => array( + 'required' => true, + 'type' => 'integer', + 'validate_callback' => __CLASS__ . '::validate_non_neg_int', + ), + ), + ) + ); + + /** + * Attach licenses to user account + */ + register_rest_route( + 'jetpack/v4', + '/licensing/attach-licenses', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::attach_jetpack_licenses', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + 'args' => array( + 'licenses' => array( + 'required' => true, + 'type' => 'array', + 'items' => array( + 'type' => 'string', + ), + ), + ), + ) + ); + } + + /** + * Verify that the user can set a Jetpack license key + * + * @since 1.7.0 + * + * @since-jetpack 9.5.0 + * + * @return bool|WP_Error True if user is able to set a Jetpack license key + */ + public static function set_jetpack_license_key_permission_check() { + if ( Licensing::instance()->is_licensing_input_enabled() ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_set_jetpack_license_key', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Verify that user can view and update user-licensing data. + * + * @since 1.7.0 + * + * @return bool Whether the user is currently connected and they are the connection owner. + */ + public static function user_licensing_permission_check() { + $connection_manager = new Connection_Manager( 'jetpack' ); + + if ( $connection_manager->is_user_connected() && $connection_manager->is_connection_owner() ) { + return true; + } + + return new WP_Error( 'invalid_permission_manage_user_licenses', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Verify that user can manage_options + * + * @since 1.7.0 + * + * @return bool Whether user has the capability 'manage_options'. + */ + public static function can_manage_options_check() { + if ( current_user_can( 'manage_options' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_view_admin', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Validates that the parameter is a string. + * + * @since 1.7.0 + * + * @since-jetpack 4.3.0 + * + * @param string $value Value to check. + * @param WP_REST_Request $request The request sent to the WP REST API. + * @param string $param Name of the parameter passed to endpoint holding $value. + * + * @return bool|WP_Error + */ + public static function validate_string( $value, $request, $param ) { + if ( ! is_string( $value ) ) { + /* translators: %s: The literal parameter name. Should not be translated. */ + return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be a string.', 'jetpack-licensing' ), $param ) ); + } + return true; + } + + /** + * Validates that the parameter is a non-negative integer (includes 0). + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @param int $value Value to check. + * @param WP_REST_Request $request The request sent to the WP REST API. + * @param string $param Name of the parameter passed to endpoint holding $value. + * + * @return bool|WP_Error + */ + public static function validate_non_neg_int( $value, $request, $param ) { + if ( ! is_numeric( $value ) || $value < 0 ) { + return new WP_Error( + 'invalid_param', + /* translators: %s: The literal parameter name. Should not be translated. */ + sprintf( esc_html__( '%s must be a non-negative integer.', 'jetpack-licensing' ), $param ) + ); + } + return true; + } + + /** + * Update the last licensing error message. + * + * @since 1.7.0 + * + * @since-jetpack 9.0.0 + * + * @param WP_REST_Request $request The request. + * + * @return bool true. + */ + public static function update_licensing_error( $request ) { + Licensing::instance()->log_error( $request['error'] ); + + return true; + } + + /** + * Get the last licensing error message, if any. + * + * @since 1.7.0 + * + * @since-jetpack 9.0.0 + * + * @return string Licensing error message or empty string. + */ + public static function get_licensing_error() { + return Licensing::instance()->last_error(); + } + + /** + * Set a Jetpack license + * + * @since 1.7.0 + * + * @since-jetpack 9.6.0 + * + * @param WP_REST_Request $request The request. + * + * @return WP_REST_Response|WP_Error A response object if the option was successfully updated, or a WP_Error if it failed. + */ + public static function set_jetpack_license( $request ) { + $license = trim( sanitize_text_field( $request['license'] ) ); + + if ( Licensing::instance()->append_license( $license ) ) { + return rest_ensure_response( array( 'code' => 'success' ) ); + } + + return new WP_Error( + 'setting_license_key_failed', + esc_html__( 'Could not set this license key. Please try again.', 'jetpack-licensing' ), + array( 'status' => 500 ) + ); + } + + /** + * Gets the users licenses. + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @return string|WP_Error A JSON object of user licenses if the request was successful, or a WP_Error otherwise. + */ + public static function get_user_licenses() { + $wpcom_request = Client::wpcom_json_api_request_as_user( + '/jetpack-licensing/user/licenses', + '2', + array( + 'method' => 'GET', + 'headers' => array( + 'Content-Type' => 'application/json', + 'X-Forwarded-For' => ( new Visitor() )->get_ip( true ), + ), + ) + ); + + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + if ( 200 === $response_code ) { + $licenses = json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + return $licenses; + } else { + return new WP_Error( + 'failed_to_fetch_data', + esc_html__( 'Unable to fetch the requested data.', 'jetpack-licensing' ), + array( 'status' => $response_code ) + ); + } + } + + /** + * Gets the users licenses counts. + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @return string|WP_Error A JSON object of user license counts if the request was successful, or a WP_Error otherwise. + */ + public static function get_user_license_counts() { + $wpcom_request = Client::wpcom_json_api_request_as_user( + '/jetpack-licensing/user/licenses/counts', + '2', + array( + 'method' => 'GET', + 'headers' => array( + 'Content-Type' => 'application/json', + 'X-Forwarded-For' => ( new Visitor() )->get_ip( true ), + ), + ) + ); + + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + if ( 200 === $response_code ) { + $license_counts = json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + return $license_counts; + } else { + return new WP_Error( + 'failed_to_fetch_data', + esc_html__( 'Unable to fetch the requested data.', 'jetpack-licensing' ), + array( 'status' => $response_code ) + ); + } + } + + /** + * Update the user-licenses activation notice dismissal data. + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return array|WP_Error + */ + public static function update_licensing_activation_notice_dismiss( $request ) { + + if ( ! isset( $request['last_detached_count'] ) ) { + return new WP_Error( 'invalid_param', esc_html__( 'Missing parameter "last_detached_count".', 'jetpack-licensing' ), array( 'status' => 404 ) ); + } + + $default = array( + 'last_detached_count' => null, + 'last_dismissed_time' => null, + ); + $last_detached_count = ( '' === $request['last_detached_count'] ) + ? $default['last_detached_count'] + : $request['last_detached_count']; + $last_dismissed_time = ( '' === $request['last_detached_count'] ) + ? $default['last_dismissed_time'] + // Use UTC timezone and convert to ISO8601 format(DateTime::W3C) for best compatibility with JavaScript Date in all browsers. + : ( new \DateTime( 'NOW', new \DateTimeZone( 'UTC' ) ) )->format( \DateTime::W3C ); + + $notice_data = array( + 'last_detached_count' => $last_detached_count, + 'last_dismissed_time' => $last_dismissed_time, + ); + + Jetpack_Options::update_option( 'licensing_activation_notice_dismiss', $notice_data, true ); + return rest_ensure_response( $notice_data ); + } + + /** + * Attach Jetpack licenses + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @param WP_REST_Request $request The request. + * + * @return WP_REST_Response|WP_Error A response object + */ + public static function attach_jetpack_licenses( $request ) { + $licenses = array_map( + function ( $license ) { + return trim( sanitize_text_field( $license ) ); + }, + $request['licenses'] + ); + return rest_ensure_response( Licensing::instance()->attach_licenses( $licenses ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php new file mode 100644 index 00000000..13982d71 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php @@ -0,0 +1,359 @@ +register_endpoints(); + } + + /** + * Get Jetpack connection manager instance. + * + * @return Connection_Manager + */ + protected function connection() { + static $connection; + + if ( null === $connection ) { + $connection = new Connection_Manager(); + } + + return $connection; + } + + /** + * Get the last license attach request error that has occurred, if any. + * + * @return string Human-readable error message or an empty string. + */ + public function last_error() { + return Jetpack_Options::get_option( 'licensing_error', '' ); + } + + /** + * Log an error to be surfaced to the user at a later time. + * + * @param string $error Human-readable error message. + * @return void + */ + public function log_error( $error ) { + $substr = function_exists( 'mb_substr' ) ? 'mb_substr' : 'substr'; + Jetpack_Options::update_option( 'licensing_error', $substr( $error, 0, 1024 ) ); + } + + /** + * Get all stored licenses. + * + * @return string[] License keys. + */ + public function stored_licenses() { + $licenses = (array) get_option( self::LICENSES_OPTION_NAME, array() ); + $licenses = array_filter( $licenses, 'is_scalar' ); + $licenses = array_map( 'strval', $licenses ); + $licenses = array_filter( $licenses ); + + return $licenses; + } + + /** + * Append a license + * + * @param string $license A jetpack license key. + * @return bool True if the option was updated with the new license, false otherwise. + */ + public function append_license( $license ) { + $licenses = $this->stored_licenses(); + + array_push( $licenses, $license ); + + return update_option( self::LICENSES_OPTION_NAME, $licenses ); + } + + /** + * Make an authenticated WP.com XMLRPC multicall request to attach the provided license keys. + * + * @param string[] $licenses License keys to attach. + * @return Jetpack_IXR_ClientMulticall + */ + protected function attach_licenses_request( array $licenses ) { + $xml = new Jetpack_IXR_ClientMulticall( array( 'timeout' => 30 ) ); + + foreach ( $licenses as $license ) { + $xml->addCall( 'jetpack.attachLicense', $license ); + } + + $xml->query(); + + return $xml; + } + + /** + * Attach the given licenses. + * + * @param string[] $licenses Licenses to attach. + * @return array|WP_Error Results for each license (which may include WP_Error instances) or a WP_Error instance. + */ + public function attach_licenses( array $licenses ) { + if ( ! $this->connection()->has_connected_owner() ) { + return new WP_Error( 'not_connected', __( 'Jetpack doesn\'t have a connected owner.', 'jetpack-licensing' ) ); + } + + if ( empty( $licenses ) ) { + return array(); + } + + $xml = $this->attach_licenses_request( $licenses ); + + if ( $xml->isError() ) { + $error = new WP_Error( 'request_failed', __( 'License attach request failed.', 'jetpack-licensing' ) ); + $error->add( $xml->getErrorCode(), $xml->getErrorMessage() ); + return $error; + } + + $results = array_map( + function ( $response ) { + if ( isset( $response['faultCode'] ) || isset( $response['faultString'] ) ) { + return new WP_Error( $response['faultCode'], $response['faultString'] ); + } + + return $response; + }, + (array) $xml->getResponse() + ); + + return $results; + } + + /** + * Attach all stored licenses. + * + * @return array|WP_Error Results for each license (which may include WP_Error instances) or a WP_Error instance. + */ + public function attach_stored_licenses() { + $licenses = $this->stored_licenses(); + $results = $this->attach_licenses( $licenses ); + + if ( is_wp_error( $results ) ) { + if ( 'request_failed' === $results->get_error_code() ) { + $this->log_error( + __( 'Failed to attach your Jetpack license(s). Please try reconnecting Jetpack.', 'jetpack-licensing' ) + ); + } + + return $results; + } + + $failed = array(); + + foreach ( $results as $index => $result ) { + if ( isset( $licenses[ $index ] ) && is_wp_error( $result ) ) { + $failed[] = $licenses[ $index ]; + } + } + + if ( ! empty( $failed ) ) { + $this->log_error( + sprintf( + /* translators: %s is a comma-separated list of license keys. */ + __( 'The following Jetpack licenses are invalid, already in use, or revoked: %s', 'jetpack-licensing' ), + implode( ', ', $failed ) + ) + ); + } + + return $results; + } + + /** + * Attach all stored licenses during connection flow for the connection owner. + * + * @return void + */ + public function attach_stored_licenses_on_connection() { + if ( $this->connection()->is_connection_owner() ) { + $this->attach_stored_licenses(); + } + } + + /** + * Is the current user allowed to use the Licensing Input UI? + * + * @since 1.4.0 + * @return bool + */ + public static function is_licensing_input_enabled() { + /** + * Filter that checks if the user is allowed to see the Licensing UI. `true` enables it. + * + * @since 1.4.0 + * + * @param bool False by default. + */ + return apply_filters( 'jetpack_licensing_ui_enabled', false ) && current_user_can( 'jetpack_connect_user' ); + } + + /** + * Gets the user-licensing activation notice dismissal info. + * + * @since 10.4.0 + * @return array + */ + public function get_license_activation_notice_dismiss() { + + $default = array( + 'last_detached_count' => null, + 'last_dismissed_time' => null, + ); + + if ( $this->connection()->is_user_connected() && $this->connection()->is_connection_owner() ) { + return Jetpack_Options::get_option( 'licensing_activation_notice_dismiss', $default ); + } + + return $default; + } + + /** + * Load current user's licenses. + * + * @param bool $unattached_only Only return unattached licenses. + * + * @return array + */ + public function get_user_licenses( $unattached_only = false ) { + $licenses = Endpoints::get_user_licenses(); + + if ( empty( $licenses->items ) ) { + return array(); + } + + $items = $licenses->items; + + if ( $unattached_only ) { + $items = array_filter( + $items, + static function ( $item ) { + return $item->attached_at === null; + } + ); + } + + return $items; + } + + /** + * If the destination URL is checkout page, + * see if there are unattached licenses they could use instead of getting a new one. + * If found, redirect the user to license activation. + * + * @param string $dest_url User's destination URL. + * + * @return void + */ + public function handle_user_connected_redirect( $dest_url ) { + if ( ! preg_match( '#^https://[^/]+/checkout/#i', $dest_url ) ) { + return; + } + + $licenses = $this->get_user_licenses( true ); + $plugin_slug = null; + + $query_string = wp_parse_url( $dest_url, PHP_URL_QUERY ); + if ( $query_string ) { + parse_str( $query_string, $query_args ); + + if ( $query_args['redirect_to'] + && preg_match( '/^admin\.php\?page=(jetpack-\w+)/i', $query_args['redirect_to'], $matches ) + ) { + $plugin_slug = $matches[1]; + } + } + + /** + * Check for the user's unattached licenses. + * + * @since 3.8.2 + * + * @param bool $has_license Whether a license was already found. + * @param array $licenses Unattached licenses belonging to the user. + * @param string $plugin_slug Slug of the plugin that initiated the flow. + */ + if ( $plugin_slug && count( $licenses ) + && apply_filters( 'jetpack_connection_user_has_license', false, $licenses, $plugin_slug ) + ) { + wp_safe_redirect( '/wp-admin/admin.php?page=my-jetpack#/add-license' ); + exit; + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/CHANGELOG.md new file mode 100644 index 00000000..79a55848 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/CHANGELOG.md @@ -0,0 +1,223 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.0.4] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [2.0.3] - 2024-05-20 +### Changed +- Replaced heredoc syntax with strings. [#37396] + +## [2.0.2] - 2024-03-18 +### Changed +- Internal updates. + +## [2.0.1] - 2024-03-12 +### Changed +- Internal updates. + +## [2.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [1.6.3] - 2023-09-19 + +- Minor internal updates. + +## [1.6.2] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.6.1] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.6.0] - 2023-04-04 +### Added +- Add new method to get a base64 encoded SVG of the Jetpack logo. [#29418] + +## [1.5.22] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.5.21] - 2023-01-30 +### Changed +- Updated styles for Just in Time Messages (notices) [#27515] + +## [1.5.20] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.5.19] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.5.18] - 2022-11-07 +### Changed +- Updated package dependencies. + +## [1.5.17] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.5.16] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [1.5.15] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.5.14] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.5.13] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.5.12] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.5.11] - 2021-11-30 +### Changed +- Colors: update Jetpack Primary color to match latest brand book. + +## [1.5.10] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.5.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.5.8] - 2021-10-07 +### Changed +- Updated package dependencies + +## [1.5.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.5.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- update annotations versions + +## [1.5.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.5.4] - 2021-04-27 +### Changed +- Updated package dependencies. + +## [1.5.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.5.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.5.1] - 2021-01-19 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.5.0] - 2020-12-07 + +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.4.0] - 2020-08-13 + +- CI: Try collect js coverage + +## [1.3.0] - 2020-06-22 + +- PHPCS: Clean up the packages +- PHPCS Updates after WPCS 2.3 + +## [1.2.0] - 2020-03-27 + +- Use dynamic Jetpack logos on JITMs + +## [1.1.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.1.2] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.1.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## [1.1.0] - 2019-06-11 + +- Feature/jetpack packages pt 1. (May 31 - June 6) +- Update/package logo add gray +- Packages: Move JITM tests to package and fix deps +- Update Jetpack to use new JITM package +- Packages: Make logo package tests independent + +## 1.0.0 - 2019-05-29 + +- Packages: Add a basic Jetpack Logo package + +[2.0.4]: https://github.com/Automattic/jetpack-logo/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-logo/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-logo/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-logo/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-logo/compare/v1.6.3...v2.0.0 +[1.6.3]: https://github.com/Automattic/jetpack-logo/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-logo/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-logo/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-logo/compare/v1.5.22...v1.6.0 +[1.5.22]: https://github.com/Automattic/jetpack-logo/compare/v1.5.21...v1.5.22 +[1.5.21]: https://github.com/Automattic/jetpack-logo/compare/v1.5.20...v1.5.21 +[1.5.20]: https://github.com/Automattic/jetpack-logo/compare/v1.5.19...v1.5.20 +[1.5.19]: https://github.com/Automattic/jetpack-logo/compare/v1.5.18...v1.5.19 +[1.5.18]: https://github.com/Automattic/jetpack-logo/compare/v1.5.17...v1.5.18 +[1.5.17]: https://github.com/Automattic/jetpack-logo/compare/v1.5.16...v1.5.17 +[1.5.16]: https://github.com/Automattic/jetpack-logo/compare/v1.5.15...v1.5.16 +[1.5.15]: https://github.com/Automattic/jetpack-logo/compare/v1.5.14...v1.5.15 +[1.5.14]: https://github.com/Automattic/jetpack-logo/compare/v1.5.13...v1.5.14 +[1.5.13]: https://github.com/Automattic/jetpack-logo/compare/v1.5.12...v1.5.13 +[1.5.12]: https://github.com/Automattic/jetpack-logo/compare/v1.5.11...v1.5.12 +[1.5.11]: https://github.com/Automattic/jetpack-logo/compare/v1.5.10...v1.5.11 +[1.5.10]: https://github.com/Automattic/jetpack-logo/compare/v1.5.9...v1.5.10 +[1.5.9]: https://github.com/Automattic/jetpack-logo/compare/v1.5.8...v1.5.9 +[1.5.8]: https://github.com/Automattic/jetpack-logo/compare/v1.5.7...v1.5.8 +[1.5.7]: https://github.com/Automattic/jetpack-logo/compare/v1.5.6...v1.5.7 +[1.5.6]: https://github.com/Automattic/jetpack-logo/compare/v1.5.5...v1.5.6 +[1.5.5]: https://github.com/Automattic/jetpack-logo/compare/v1.5.4...v1.5.5 +[1.5.4]: https://github.com/Automattic/jetpack-logo/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/Automattic/jetpack-logo/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/Automattic/jetpack-logo/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/Automattic/jetpack-logo/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-logo/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-logo/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-logo/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-logo/compare/v1.1.4...v1.2.0 +[1.1.4]: https://github.com/Automattic/jetpack-logo/compare/v1.1.2...v1.1.4 +[1.1.2]: https://github.com/Automattic/jetpack-logo/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-logo/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-logo/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/composer.json new file mode 100644 index 00000000..e3ebc4e6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/composer.json @@ -0,0 +1,41 @@ +{ + "name": "automattic/jetpack-logo", + "description": "A logo for Jetpack", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-logo", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-logo/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php new file mode 100644 index 00000000..31b5b501 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php @@ -0,0 +1,122 @@ + tag. + * - jetpack-logo__icon-circle: the circle of the Jetpack mark. + * - jetpack-logo__icon-triangle: two shapes that correspond to each triangle in the Jetpack mark. + * - jetpack-logo__icon-text: the Jetpack lettering. + * + * @var string + */ +const JETPACK_LOGO_SVG = ' + +'; + +/** + * Create and render a Jetpack logo. + */ +class Logo { + + /** + * Return the Jetpack logo. + * + * @return string The Jetpack logo. + */ + public function render() { + return JETPACK_LOGO_SVG; + } + + /** + * Return string containing the Jetpack logo. + * + * @since 1.1.4 + * @since-jetpack 7.5.0 + * + * @param bool $logotype Should we use the full logotype (logo + text). Default to false. + * + * @return string + */ + public function get_jp_emblem( $logotype = false ) { + $logo_text = $this->get_jp_logo_parts(); + return sprintf( + '%2$s', + ( true === $logotype ? '118' : '32' ), + ( true === $logotype ? $logo_text['logo'] . $logo_text['text'] : $logo_text['logo'] ) + ); + } + + /** + * Return string containing the Jetpack logo in a slightly larger format than get_jp_emblem(). + * + * @since 1.1.4 + * @param bool $logotype Should we use the full logotype (logo + text). Default to false. + * @return string + */ + public function get_jp_emblem_larger( $logotype = false ) { + $logo_text = $this->get_jp_logo_parts(); + return sprintf( + '', + ( true === $logotype ? '118' : '32' ), + ( true === $logotype ? $logo_text['logo'] . $logo_text['text'] : $logo_text['logo'] ) + ); + } + + /** + * Return array containing the Jetpack logo and text + * + * @since 1.6.0 - Added $color parameter. + * + * @param string $color The color of the logo. + * + * @return array + */ + private function get_jp_logo_parts( $color = '#069e08' ) { + return array( + 'logo' => '', + 'text' => ' + + + + + + ', + ); + } + + /** + * Return a base64 encoded SVG of the Jetpack logo. + * Can be used as a data URI to use the logo inline in CSS. + * + * @since 1.6.0 + * + * @param string $color The color of the logo. + * + * @return string + */ + public function get_base64_logo( $color = '#ffffff' ) { + $logo_text = $this->get_jp_logo_parts( $color ); + $base_logo = sprintf( + '%1$s', + $logo_text['logo'] + ); + $encoded_logo = base64_encode( $base_logo ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- The encoded version is used as data URI to use the logo in CSS. + + return 'data:image/svg+xml;base64,' . $encoded_logo; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md new file mode 100644 index 00000000..a450fed4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md @@ -0,0 +1,1925 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [4.35.3] - 2024-09-06 +### Fixed +- Optimize repeated requests for unavailable WPCOM. [#39218] + +## [4.35.2] - 2024-09-06 +### Changed +- Internal updates. + +## [4.35.1] - 2024-09-05 +### Changed +- Internal updates. + +## [4.35.0] - 2024-09-05 +### Added +- My Jetpack: add support for feature-specific handling to product interstitials. [#38661] + +### Changed +- Jetpack AI product page: add fair usage link on over quota notice [#39192] +- Updated package dependencies. [#39176] + +### Fixed +- Gracefully fail when user data fetch failed. [#39179] + +## [4.34.0] - 2024-09-02 +### Changed +- My Jetpack: show over quota notice and period usage counter for unlimited plans [#39129] +- We update Welcome Flow A/B experiment to test other things [#39154] + +### Fixed +- My Jetpack: change Jetpack AI post checkout URL so the redirect works [#39166] + +## [4.33.1] - 2024-08-29 +### Changed +- Admin menu: change order of Jetpack sub-menu items [#39095] +- My Jetpack: reflect tier filters properly on product class and UI. Fix little nuances with date constructor [#39074] +- Updated package dependencies. [#39111] + +### Fixed +- Don't consider user lifecycle status when repeating evaluation [#39069] +- My Jetpack: Fix the popover and active button of the Bboost card are overlapping [#39067] + +## [4.33.0] - 2024-08-26 +### Added +- Add context switching to videopress card from yearly views to monthly views [#38979] + +### Changed +- My Jetpack: AI product class to handle better disabling tiers [#38989] +- Updated package dependencies. [#39004] + +### Fixed +- allow user currency in My Jetpack pricing [#38977] +- Fix tooltip title for videopress card [#39030] + +## [4.32.4] - 2024-08-21 +### Changed +- Removed unnecessary WAF dependency in My Jetpack. [#38942] + +### Fixed +- Notification bubbles: avoid PHP warning when information is missing. [#38963] +- Revert recent SVG image optimizations. [#38981] + +## [4.32.3] - 2024-08-19 +### Added +- Add stat trends for videopress card. [#38868] +- Add tooltip to VideoPress card. [#38842] +- Add value to active card state on VideoPress My Jetpack card. [#38812] + +### Changed +- Updated package dependencies. [#38893] + +### Fixed +- Lossless image optimization for images (should improve performance with no visible changes). [#38750] +- My Jetpack: ensure product screens redirect to the correct post-checkout URLs. [#38704] + +## [4.32.2] - 2024-08-15 +### Changed +- Updated package dependencies. [#38665] + +### Fixed +- fix empty hrefs causing page reload [#38845] + +## [4.32.1] - 2024-08-09 +### Added +- Add value to the inactive state on the VideoPress card in My Jetpack [#38748] + +### Changed +- Update uses of useConnection to useMyJetpackConnection and improve typing in a few places [#38721] + +### Removed +- Tests: Removed react-test-renderer. [#38755] + +### Fixed +- My Jetpack: fix a bug where a user would see and infinite loading spinner when trying to connect Jetpack with one click in the Welcome flow. [#38813] + +## [4.32.0] - 2024-08-05 +### Added +- Add Tracks events for Welcome Flow [#38641] + +### Changed +- change Jetpack AI product page link redirect [#38691] +- copy updates [#38648] +- Modify the Google Analytics notice to notify of the feature removal. [#38701] + +## [4.31.0] - 2024-08-01 +### Added +- Update Welcome Banner and set async site-only connection [#38534] + +### Changed +- Fixup versions [#38612] +- My Jetpack: modify Jetpack AI product class and interstitial links [#38602] +- React: Changing global JSX namespace to React.JSX [#38585] + +## [4.30.0] - 2024-07-29 +### Added +- Async card update after async site connection [#38549] +- My Jetpack: add A/A experiment to test for correct random assignment and prevent bias in metric performance. [#38327] +- Show View button on product card along with upgrade cta [#38550] + +### Changed +- Final minor enhancements to the Protect product card in My Jetpack. [#38420] + +### Removed +- Remove functionality that hid 1 value on the backup card for mid-sized screens [#38441] + +### Fixed +- Include Jetpack Legacy plans when checking if user has social included with plan [#38516] +- Update all tracks to snake case, camel case is not supported [#38576] + +## [4.29.0] - 2024-07-22 +### Added +- Added the auto-firewall status to the Protect product card in My Jetpack. [#38332] +- Added the number of logins blocked to the Protect card in My Jetpack. [#38396] + +### Changed +- Connection Screen: Removed mention of Stats from the list of available free features. [#38328] +- Display My Jetpack products segemented by ownership. [#38283] +- My Jetpack: Updated social icons in the connection screen. [#38334] +- Updated statuses to make more sense in relation to ownership. [#38390] + +## [4.28.0] - 2024-07-15 +### Added +- Add scan/threat info to the Protect card in My Jetpack. [#38165] + +### Changed +- Protect card: Add the Last scan time (with tooltip) based on product state. [#38091] +- Updated package dependencies. [#38091] + +### Fixed +- Fix Learn More link destination when the site was never connected. [#38225] + +## [4.27.2] - 2024-07-10 +### Fixed +- Social: Fixed plan slug [#38222] + +## [4.27.1] - 2024-07-03 +### Changed +- Updated package dependencies. [#38132] + +## [4.27.0] - 2024-07-01 +### Added +- Add the Google Analytics deprecation notice. [#38078] + +### Changed +- Reduce amount of historically active modules updates by only triggering on activation of plugin is a jetpack plugin [#38065] + +### Fixed +- Fix an issue where the connection error hook was always resetting the notice [#38120] + +## [4.26.0] - 2024-06-27 +### Changed +- Jetpack AI: Add Title Optimization section on the product page. [#38072] + +## [4.25.4] - 2024-06-26 +### Fixed +- Move historically active modules sync to admin_init [#38041] + +## [4.25.3] - 2024-06-24 +### Added +- Add more default args for tracks events [#37974] + +## [4.25.2] - 2024-06-21 +### Fixed +- Remove the need for api requests in broken modules check [#37908] + +## [4.25.1] - 2024-06-17 +### Fixed +- Remove check for broken modules from red bubble connection check [#37911] + +## [4.25.0] - 2024-06-17 +### Changed +- Show tooltip on card hover instead of letter hover [#37858] +- Update connection footer to conditionally render warnings or errors [#37802] +- Update connection status card tests to TS [#37829] + +## [4.24.7] - 2024-06-13 +### Changed +- Updated package dependencies. [#37796] + +## [4.24.6] - 2024-06-11 +### Changed +- Conditionally show connection banner as error or info [#37707] +- Updated package dependencies. [#37779] + +## [4.24.5] - 2024-06-10 +### Changed +- Change codebase to use clsx instead of classnames. [#37708] + +## [4.24.4] - 2024-06-10 +### Added +- Add mechanism to track previously working plugins [#37537] + +### Changed +- Move PRODUCT_STATUSES to constants file [#37748] +- Send user to siteless pricing page if site is not connected [#37667] + +## [4.24.3] - 2024-06-05 +### Changed +- Updated package dependencies. [#37669] + +## [4.24.2] - 2024-06-03 +### Changed +- Update ToS wording. [#37536] +- Update CTA on A4A banner in My Jetpack. [#37628] + +## [4.24.1] - 2024-05-24 +### Changed +- Update Search to require user connection. [#37496] + +## [4.24.0] - 2024-05-23 +### Changed +- Improve the active/inactive statuses on My Jetpack. [#37217] + +## [4.23.3] - 2024-05-20 +### Added +- Add tracks events for dropdown on action buttons. [#37292] + +### Changed +- Updated package dependencies. [#37379] [#37380] [#37382] + +## [4.23.2] - 2024-05-09 +### Changed +- My Jetpack Agency banner copy change. [#37248] + +### Fixed +- Fix typo [#37303] + +## [4.23.1] - 2024-05-08 +### Changed +- Update dependencies. + +## [4.23.0] - 2024-05-06 +### Added +- Add a has_free_offering boolean on My Jetpack products. [#36710] +- Add copy for AI features on connection screen. [#37218] +- Define `$module_name` static property on `Hybrid_Product` (defaulting to null). [#37201] +- Jetpack AI: Add new badge to Featured Image video on the product page. [#37197] +- My Jetpack: Add errors from the connection package to the new notice component. [#36840] + +### Changed +- Change "go back" in My Jetpack interstitials to always return to the My Jetpack page. [#36685] +- Fix z-index issue and close action button dropdown when clicked outside. [#37169] +- Jetpack AI: Add featured image generation as a feature on the product interstitial. [#37199] +- Jetpack AI: Include video about featured image generation on the product page. [#37192] +- Updated package dependencies. [#37147] [#37148] [#37160] + +## [4.22.3] - 2024-04-29 +### Changed +- Internal updates. + +## [4.22.2] - 2024-04-25 +### Fixed +- My Jetpack: Fix issue where the TOS component was being called inside of a

, throwing a warning that

can't be a descendant of

. This also fixes the font size of the TOS text. [#37034] + +## [4.22.1] - 2024-04-22 +### Changed +- Internal updates. + +## [4.22.0] - 2024-04-11 +### Added +- Add new tracking event for product activations made through My Jetpack [#36745] +- My Jetpack: add a way to connect a Jetpack site to WordPress.com asynchronously and update the message in the notice to reflect that. [#36771] + +### Fixed +- Ensure page_view gets loaded before product_card_loaded [#36790] + +## [4.21.0] - 2024-04-08 +### Added +- Add 'from' property to connection call to WP.com. [#36741] +- My Jetpack: Update Notice component to allow adding a loading text when an action is in a loading state. Add a new resetNotice action to NoticeContext. [#36614] + +### Changed +- My Jetpack: Show Boost score increase in Boost product card. [#36072] +- Updated package dependencies. [#36756] [#36760] [#36761] +- Update My Jetpack to use the Notice component from @automattic/jetpack-components and be more consistent with the other notices in Jetpack. [#36711] + +### Removed +- My Jetpack: Removed custom Notice component from My Jetpack. [#36772] +- My Jetpack: Remove red bubble from connection notice in favor of using the status of the Notice component. [#36773] + +### Fixed +- Fix cache on front end request for boost speed scores [#36700] +- fix tier upgrades in my Jetpack [#36705] + +## [4.20.2] - 2024-04-02 +### Fixed +- Fix Boost score inconsistency [#36679] + +## [4.20.1] - 2024-04-01 +### Added +- Change Phan baselines. [#36627] + +## [4.20.0] - 2024-03-29 +### Added +- Track active red bubble slugs on My Jetpack page view [#36611] + +### Fixed +- Better handling on product interstitial pages if the site already has a paid product [#36570] +- Shows Jetpack CRM card as active on My Jetpack if the plugin is installed and active [#36594] + +## [4.19.0] - 2024-03-27 +### Added +- Add red bubble to notices tied to red bubble notifications [#36543] +- My Jetpack: add a version of WordPress' Notice component to My Jetpack considering the context of how we use notices on that screen [#36551] + +### Changed +- Updated package dependencies. [#36539, #36585] + +### Fixed +- Fixed Jetpack Creator going to the wrong screen when the free version is selected" [#36547] +- Fixes some pricing showing twice by connecting sites that select a free option [#36533] + +## [4.18.0] - 2024-03-25 +### Added +- Hook into red bubble notification when bad installation is detected [#36449] +- Jetpack AI: add notices on product page for exhausted requests [#35910] +- Jetpack AI: add plans/tier information on product page and corresponding CTAs [#35910] +- Jetpack AI: add support and create post links on product page [#35910] +- My Jetpack: add AI product page view event [#36488] +- My Jetpack: add feedback link on Jetpack AI product page [#35910] +- My Jetpack: AI pricing table is skipped once the user has opted for the free version [#35910] +- My Jetpack: change AI product for tiered pricing table display [#35910] + +### Changed +- Add notice priorities to My Jetpack [#36438] +- Jetpack AI: address responsive issues on the styles [#35910] +- My Jetpack: AI product page styles update and responsive fixes [#35910] +- My Jetpack: change AI card action button target for upgraded users, point to product page [#35910] + +### Removed +- My Jetpack: remove Jetpack AI code added throughout the new product page project [#35910] +- Removed reference to Creator Network, which is being deprecated. [#36168] + +### Fixed +- Boost tooltips: fix typo in string. [#36520] +- My Jetpack: fix AI interstitial "remain free" flow [#35910] +- My Jetpack: fix interstitial event property malformed name productSlug -> product_slug [#36486] +- My Jetpack: fix spacing issues on the new product page [#35910] +- My Jetpack: new AI interstitial margin on admin page was messing with correct top spacing [#35910] + +## [4.17.1] - 2024-03-18 +### Added +- Add a loaded event for My Jetpack product cards [#36397] + +## [4.17.0] - 2024-03-14 +### Changed +- Rewrite My Jetpack hooks to Typescript [#36288] + +## [4.16.0] - 2024-03-12 +### Added +- Add a red bubble notification that shows if the site is disconnected [#36263] +- Add README to data directory [#36301] +- Add whitelist to show errors only for certain queries [#36261] + +### Changed +- Migrate Stats counts out of redux and into tanstack queries [#36195] +- Replace window state calls with util function [#36271] +- Rewrite My Jetpack utils to typescript [#36296] +- Show small stats card in table if large stats card isn't showing [#36136] +- Updated package dependencies. [#36325] +- Update query hooks for my-jetpack data" [#36257] +- Update useMyJetpackConnection hook to TypeScript [#36300] + +### Removed +- Removing redux store [#36256] + +## [4.15.0] - 2024-03-07 +### Added +- Refactor My Jetpack's backup related redux state to react query. [#35982] + +### Changed +- Migrate dismiss welcome banner to tanstack [#36199] +- Migrate global notices to context [#36201] +- Migrate My Jetpack's licenses query and state to react-query [#36029] +- Moved lifecycle stats function out of redux [#36205] +- Updating purchase related redux data to tanstack/react [#35994] + +### Removed +- Connected Product offer is not being used, removing it to clean up a bit [#36203] + +### Fixed +- fix a few My Jetpack bugs when main plugin is not installed [#36139] +- Intersitital tables were not visibly loading when pressed [#36236] + +## [4.14.0] - 2024-03-04 +### Changed +- Migrate My Jetpack zendesk state to react-query [#36028] +- Updated package dependencies. + +### Fixed +- Add registration nonce to connect screen in My Jetpack [#36133] + +## [4.13.0] - 2024-03-01 +### Added +- Add site lifecycle status guess to My Jetpack [#35815] + +### Changed +- Changed product plan checks on My Jetpack cards [#36046] +- Display different Boost card tooltip content based on score letter grade. [#35863] +- Improve consistency and fix bugs in product start and checkout flows [#35908] +- Instanciate the Boost Score API (new Speed_Score()) in My Jetpack. [#36080] +- My Jetpack: add Tracks events to connection section [#35804] +- Refactor react-query to reduce code repetition [#35990] + +### Fixed +- fixed the purchase query for the boost card [#36004] + +## [4.12.1] - 2024-02-27 +### Added +- My Jetpack: Add an info popover in the Boost product card. [#35731] + +## [4.12.0] - 2024-02-26 +### Changed +- My Jetpack: decouple Jetpack AI insterstitial component [#35836] +- Remove translation of product names [#35830] +- Updating purchases state to use data query instead of redux [#35697] + +### Removed +- Remove kebab menu on My Jetpack cards [#35829] + +## [4.11.0] - 2024-02-22 +### Added +- Adding accesible text for external links on connection page and footer [#35733] + +### Changed +- change status and action of My Jetpack cards when plugin is missing [#35718] +- ESlint: disabled redundant role rule [#35800] +- My Jetpack: add product slugs to click events on interstitials [#35740] +- My Jetpack: let tier data pass on quantity data to checkout process for proper checkout URL crafting [#35817] +- Updated package dependencies. [#35793] + +### Fixed +- Backup Card: made stats readable by screen readers [#35786] +- Connection Screen: make VoiceOver announce lists as such [#35736] +- Do not initialize My Jetpack when in Offline mode. [#35807] +- Fix wrong prop type passed to ConnectedProductCard [#35789] + +## [4.10.0] - 2024-02-19 +### Added +- Add Boost Speed Score into My Jetpack Boost product card [#35606] +- Add connection indicator for screen readers [#35714] + +### Fixed +- Improved accessibility of Dismiss button in Connection Banner [#35694] +- My Jeptack Connection: Make footer logos a list for better screen readers interpretation. [#35667] +- My Jetpack: add label for screen readers to connect page close button [#35712] + +## [4.9.2] - 2024-02-13 +### Changed +- My Jetpack: various improvements to the Stats card. [#35355] +- Updated package dependencies. [#35608] + +## [4.9.1] - 2024-02-12 +### Added +- Add My Jetpack link to standalone plugins missing it [#35523] + +## [4.9.0] - 2024-02-07 +### Changed +- Add pricing info for AI and CRM on My Jetpack [#35457] +- Update the description of some cards to better describe the product on My Jetpack page [#35428] + +### Fixed +- Fixes issue on My Jetpack interstitials where some prices are 1 cent off [#35492] + +## [4.8.0] - 2024-02-05 +### Added +- Add tracking info to the Jetpack Manage Banner CTA [#35378] +- My Jetpack: support redirect_to parameter on the product interstitial. [#35263] + +### Changed +- Update CTA copy on the connection banner to make it clear which type of connection we are going to request [#35401] +- Updated package dependencies. +- Update product cards on My Jetpack to always display the status indidicator. [#35377] + +### Fixed +- Fix issue where most products are not installing their standalone product upon purchase [#35399] + +## [4.7.0] - 2024-01-29 +### Changed +- Update the UpsellBanner to use the Card component from WP components. [#35223] + +### Removed +- UpsellBanner component moved to js-packages/components [#35228] + +## [4.6.2] - 2024-01-22 +### Added +- My Jetpack: add contact us event for Jetpack AI [#35136] + +## [4.6.1] - 2024-01-22 +### Changed +- Display Jetpack Protect product card for all users. [#35142] +- Ensure that interstitial tables go straight to checkout just like insterstitial cards [#35049] + +## [4.6.0] - 2024-01-18 +### Added +- Add hosting provider check. [#34864] +- Add Jetpack Manage banner. [#35078] + +## [4.5.0] - 2024-01-18 +### Changed +- Use blog ID instead of site slug in checkout URL. [#34976] + +## [4.4.0] - 2024-01-15 +### Changed +- add plan check to My Jetpack Akismet product card [#34905] +- Prevent new users from seeing JITMs [#34927] +- To avoid displaying the Welcome banner to every user, now we only display it to new users. [#34883] + +## [4.3.0] - 2024-01-08 +### Added +- Add a check to determine if a user is "new" to Jetpack. [#34821] +- Add a button that links to the connection screen to the Welcome Banner in My Jetpack. [#34858] + +### Changed +- Add a product interstitial in My Jetpack for stats. [#34772] +- Added an image to Social interstitial. [#34814] +- Update Akismet card on My Jetpack to go to interstitial screen when there is no API key. [#34817] + +## [4.2.1] - 2024-01-04 +### Changed +- Updated package dependencies. [#34815] [#34816] + +### Fixed +- My Jetpack: Jetpack footer links are now consistent with footers in rest of Jetpack screens. [#34787] + +## [4.2.0] - 2024-01-02 +### Fixed +- Show JP Creator as active when JP Complete is purchased. [#34806] + +## [4.1.4] - 2023-12-20 +### Changed +- Updated package dependencies. [#34694] + +## [4.1.3] - 2023-12-11 +### Changed +- Updated Jetpack AI interstitial to repeat the feature's list on all the tiers. [#34541] + +## [4.1.2] - 2023-12-06 +### Changed +- Updated package dependencies. [#34416] + +### Fixed +- Creator Card: fix typo. [#34478] + +## [4.1.1] - 2023-12-05 +### Fixed +- My Jetpack: Fix outdated product cache issue when enabling tiers. [#34428] + +## [4.1.0] - 2023-12-03 +### Added +- Added Jetpack Creator to My Jetpack. [#34307] +- Added the welcome banner to My Jetpack. [#34384] +- Display a "Jetpack Manage" menu item to connected users. [#34353] +- Updated connection message to only display if the welcome banner has been dismissed. [#34420] + +### Changed +- Updated package dependencies. [#34411] [#34427] +- Updated the API calls used for My Jetpack backup card. [#34197] +- Updated the CTAs in My Jetpack for more clarity and to avoid inconsistencies. [#34300] + +### Fixed +- Dashboard: Prevented display of any notices from third-party services. [#34364] +- Fixed checkout error while selling the unlimited Jetpack AI plan. [#34339] +- Fixed Jetpack AI bi-yearly plan on product card. [#34276] +- Fixed product card menus. [#34285] + +## [4.0.3] - 2023-11-24 +### Changed +- Changed Jetpack AI insterstitial contact link to Jetpack Redirect. [#34252] +- Link Jetpack AI Contact Us button to support email on interstitial page. [#34240] +- Removed hardcoded tiers from Jetpack AI interstitial. [#34259] +- Trust next tier provided by the Jetpack AI feature endpoint. [#34239] + +## [4.0.2] - 2023-11-21 +### Changed +- Replace usage of strpos() with str_contains(). [#34137] + +## [4.0.1] - 2023-11-21 +### Added +- Marked Jetpack AI as upgradable in the interstitial page. [#34215] + +## [4.0.0] - 2023-11-20 +### Added +- Display an "Activity Log" menu item to connected users. [#34174] +- Added direct checkout support for products with quantity-based plans. [#34177] +- Added Jetpack AI prices by tier to the interstitial page. [#34196] + +### Changed +- Replaced usage of strpos() with str_starts_with(). [#34135] +- Updated required PHP version to >= 7.0. [#34126] +- Removed condition from the backup undoable event call, this datapoint will be removed. [#33997] + +## [3.12.2] - 2023-11-14 +### Changed +- My Jetpack: Fix a bug causing PHP fatal errors when the Jetpack AI feature information is not available. [#34095] +- Updated package dependencies. [#34093] + +## [3.12.1] - 2023-11-13 +### Changed +- AI Assistant: Updated the text and image for the interstitial based on AI plan tiers. [#33981] +- AI Assistant: Removed the ToS notice from the interstitial page. [#34076] + +## [3.12.0] - 2023-11-08 +### Added +- Updated purchased state for VaultPress backup card on My Jetpack. [#33927] + +## [3.11.1] - 2023-11-03 + +## [3.11.0] - 2023-10-30 +### Added +- Add site data to unpurchased state of VaultPress Backup card to My Jetpack. [#33607] + +## [3.10.0] - 2023-10-23 +### Added +- Add jetpack-plans dependency. It will be use to restore the reverted change on #33410. [#33706] + +### Changed +- Update checkout flow to connect "After" checkout vs before (if not connected). [#33257] + +### Fixed +- Use Current_Plan to check/return from has_required_plan on VP product class. [#33708] + +## [3.9.1] - 2023-10-19 +### Changed +- Make has_required_plan return true (as it was before #33410) as a way to revert the change. [#33697] +- Updated package dependencies. [#33687] + +## [3.9.0] - 2023-10-17 +### Added +- Add has_required_plan method for VideoPress product class, check plan purchase exists for site [#33410] + +### Changed +- Updated package dependencies. [#33646] + +## [3.8.2] - 2023-10-16 +### Changed +- Updated package dependencies. [#33429, #33584] + +## [3.8.1] - 2023-10-10 +### Changed +- Changes title of the my-jetpack page to "My Jetpack" [#33486] +- Updated package dependencies. [#33428] + +### Fixed +- My Jetpack: fix fatal error [#33523] +- My Jetpack: fix Stats card status when not connected [#33521] + +## [3.8.0] - 2023-10-03 +### Added +- Display a new section on My Jetpack to display the stats of the site. [#33283] + +## [3.7.0] - 2023-09-28 +### Added +- Add a section to display stats from Jetpack Stats in My Jetpack [#33160] + +### Changed +- Redirect to a proper upgrade page for free license owners [#33297] + +## [3.6.0] - 2023-09-25 +### Added +- Add barebones infrastructure for querying jetpack product data. [#33095] + +### Changed +- Stats: link to purchase page within WP Admin. [#33227] + +## [3.5.0] - 2023-09-19 +### Changed +- Added support for upgradable products. Updated the Stats card to handle upgradeable products. [#33058] +- Updated Jetpack submenu sort order so individual features are alpha-sorted. [#32958] + +### Fixed +- My Jetpack: Add AI Assistant Monthly to required plan check [#33078] + +## [3.4.5] - 2023-09-13 +### Changed +- Updated package dependencies. [#33001] + +## [3.4.4] - 2023-09-11 +### Changed +- General: remove WP 6.1 backwards compatibility checks [#32772] + +### Fixed +- Stats: stop showing upgrade button for sites with Complete plan [#32870] + +## [3.4.3] - 2023-09-04 +### Changed +- Updated package dependencies. [#32803] +- Updated package dependencies. [#32804] + +## [3.4.2] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [3.4.1] - 2023-08-22 +### Changed +- Connection: allow dismissing the IDC modal. [#32594] + +## [3.4.0] - 2023-08-21 +### Added +- Support Jetpack AI Yearly offering [#32130] + +### Changed +- Use the new method to render Connection initial state. [#32499] + +## [3.3.3] - 2023-08-14 +### Added +- Make My Jetpack the default WP-Admin page for Jetpack. [#32385] + +### Changed +- Start showing My Jetpack for authors, editors, and contributors [#32420] + +## [3.3.2] - 2023-08-09 +### Fixed +- Revert My Jetpack as first menu item. [#32384] + +## [3.3.1] - 2023-08-09 +### Changed +- Updated package dependencies. [#32166] + +## [3.3.0] - 2023-08-07 +### Added +- Add Identity Crisis screen modal. [#32249] + +### Changed +- Move 'My Jetpack' sub-menu item to first position. [#32240] + +### Fixed +- Fix IDC modal height issue. [#32316] + +## [3.2.1] - 2023-08-01 +### Added +- Add transient caching for zendesk jwt auth token. [#32140] + +### Changed +- My Jetpack: Rename the namespace of the JWT endpoint, and register it only when it isn't already registered [#32081] + +## [3.2.0] - 2023-07-25 +### Added +- My Jetpack: register jetpack-ai-jwt endpoint [#31965] +- My Jetpack: release Paid Stats to the public [#32020] + +### Changed +- My Jetpack: changed Stats features wording [#32046] +- Updated package dependencies. [#31999] +- Updated package dependencies. [#32040] + +### Fixed +- Make Jetpack logo in footer smaller [#31627] +- My Jetpack: enabled Stats purchase flow returning to Stats Dashboard [#31959] + +## [3.1.3] - 2023-07-17 +### Changed +- Updated package dependencies. [#31872] + +### Fixed +- Hide connection owner information if the data is invalid +- Don't suggest user connection if user is already connected, but connection owner is invalid [#31618] + +## [3.1.2] - 2023-07-11 +### Changed +- Updated package dependencies. [#31785] + +## [3.1.1] - 2023-07-10 +### Fixed +- Make product card primary buttons links when applicable [#31611] + +## [3.1.0] - 2023-07-05 +### Added +- Added Jetpack Stats card to My Jetpack [#31589] + +### Changed +- Jetpack Stats: Enable skipping interstitial page [#31629] +- Updated package dependencies. [#31659] + +### Fixed +- My Jetpack: hide Stats card for standalone plugins [#31689] +- Organize product cards in list [#31606] + +## [3.0.0] - 2023-06-26 +### Added +- Add authentication to Zendesk chat. [#31339] +- Stats: add stats card to my Jetpack. [#31531] + +## [2.15.0] - 2023-06-23 +### Added +- My Jetpack: add Stats product [#31368] + +### Changed +- Updated package dependencies. [#31468] + +## [2.14.3] - 2023-06-12 +### Added +- My Jetpack: populate the Jetpack AI product with feature data [#31238] + +## [2.14.2] - 2023-06-06 +### Changed +- Filter out revoked licenses from the license activation options. [#31088] +- Updated package dependencies. [#31129] + +## [2.14.1] - 2023-05-29 +### Added +- My Jetpack: Add new Jetpack AI card [#30904] + +### Changed +- My Jetpack: Enable Jetpack AI card [#30988] +- My Jetpack: Update AI class to be product and not module [#30905] +- My Jetpack: Update AI interstitial background [#30992] + +## [2.14.0] - 2023-05-22 +### Added +- Added ability to purchase Jetpack AI monthly product [#30793] +- Added tier data to the Boost product to support a pricing table interstitial page. [#29931] + +## [2.13.0] - 2023-05-15 +### Added +- Added My Jetpack interstitial for Jetpack AI [#30543] + +## [2.12.2] - 2023-05-11 +### Changed +- PHP 8.1 compatibility updates [#30517] + +## [2.12.1] - 2023-05-08 +### Added +- My Jetpack: Add deactivate plugin menu action on product card [#30489] + +### Changed +- My Jetpack: Remove icon from plugin activation action in product card [#30458] +- My Jetpack: Remove manage option from menu [#30440] +- My Jetpack: Remove product card icon [#30441] +- My Jetpack: Set a post-checkout redirect destination on the "Purchase a plan" link. [#27693] + +### Fixed +- My Jetpack: Add check for product status before requesting stats [#30430] +- My Jetpack: Reload page after successful license activation [#30364] +- My Jetpack: Use a single column for the page title section [#30406] + +## [2.12.0] - 2023-05-02 +### Added +- Add API to query Zendesk chat availability and use it to conditionally display zendesk chat. [#29942] +- Add pricing table interstitial view for Jetpack Protect. [#29930] +- My Jetpack: Add product detail table component for comparing product tiers. [#29759] + +### Changed +- My Jetpack: Move logic out of Product Card component. [#30274] +- Updated package dependencies. + +### Fixed +- Fix activation and layout on Protect interstatial page. [#29525] +- My Jetpack: Keep product card action button disabled while installing standalone plugin. [#30346] + +## [2.11.0] - 2023-05-01 +### Added +- Added Jetpack Starter bundle post-activation screen and plan header [#30368] + +## [2.10.3] - 2023-04-25 +### Added +- My Jetpack: Add flags field in initial state [#30241] +- My Jetpack: Add Install/Activate menu actions based on the standalone plugin status. [#30153] +- My Jetpack: Add neutral color in contextual card [#30250] +- My Jetpack: Add side-effect action to request the standalone plugin installation on the backend. [#30143] +- My Jetpack: Add stats to VideoPress card [#30197] +- My Jetpack: Enable menu for all hybrid products [#30247] +- My Jetpack: Reload page after standalone action [#30221] + +### Changed +- My Jetpack: Connect the standalone plugin menu options so they trigger the installation and activation when clicked. [#30168] +- MyJetpack: set the Social standalone page as the default admin one [#30193] +- MyJetpack: Try to activate the product module after installing the standalone plugin [#30215] +- Updated package dependencies. [#30015] + +## [2.10.2] - 2023-04-17 +### Added +- Ad missing TOS in Jetpack interstitial. [#29683] +- My Jetpack: Add endpoint to install the standalone plugin for hybrid products. [#30045] +- My Jetpack: Expose information about standalone plugin status on My Jetpack product initial state. [#29977] + +### Changed +- Backup and Scan: redirect after checkout to Jetpack recommendations page if Jetpack plugin is active. Otherwise, redirect back to plugin admin page. [#29708] +- My Jetpack: Adjustments in Product Card [#30014] +- Updated package dependencies. [#30019] + +## [2.10.1] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] +- My Jetpack: Introduce absent_with_plan status [#29920] + +### Changed +- My Jetpack: Turn Search into a hybrid product to handle it as module and as standalone plugin. [#29946] +- My Jetpack: Turn Social into a hybrid product to handle it as module and as standalone plugin. [#29935] +- My Jetpack: Turn VaultPress Backup into a Hybrid product to handle it as module and as standalone plugin. [#29928] +- My Jetpack: Turn VideoPress into a Hybrid product to handle it as module and as standalone plugin. [#29918] + +## [2.10.0] - 2023-04-04 +### Added +- My Jetpack: Adds a selector, reducer and resolver machinery to fetch product stats. [#29764] +- My Jetpack: Enhance Product Card [#29787] +- My Jetpack: Introduce menu in Product Card [#29815] + +### Changed +- * Updated add-anti-spam path to add-akismet to match the product key + * Updated product interstitial component to accept an existingLicenseKeyUrl + * Updated product interstitial component to display a product name instead of a title where preferProductName is set + * Make is_plugin_active available from the API [#29598] +- My Jetpack: Change the bottom of My Jetpack screen to use single-column rows on small viewports. [#29844] +- Updated package dependencies. [#29854] + +## [2.9.2] - 2023-04-03 +### Changed +- Internal updates. + +## [2.9.1] - 2023-03-28 +### Changed +- Move GoldenTokenModal component to licensing package. [#29748] + +## [2.9.0] - 2023-03-27 +### Added +- Adds new route for Golden Token. Also the experience of redeeming one [#29644] +- Clarified when license activation fails that a user connection is required, added a link to complete the connection, and added functionality to redirect back to license activation when the connection is done. [#29443] + +## [2.8.1] - 2023-03-20 +### Changed +- Product Interstitial: Use browser history to go back, in case they're coming from somewhere outside of the app. [#29138] +- Updated My Jetpack wpwrap color to --jp-white-off [#29568] +- Updated package dependencies. [#29471] + +## [2.8.0] - 2023-03-13 +### Added +- Add Zendesk chat module to My Jetpack page [#28712] + +## [2.7.13] - 2023-03-08 +### Changed +- Updated package dependencies. [#29216] + +## [2.7.12] - 2023-02-28 +### Changed +- Update billing language [#29126] + +## [2.7.11] - 2023-02-20 +### Fixed +- My Jetpack: Fix button to add bundle in product interstitial component [#28984] + +## [2.7.10] - 2023-02-15 +### Changed +- Update to React 18. [#28710] + +## [2.7.9] - 2023-02-08 +### Changed +- Updated package dependencies. [#28682, #28700] + +## [2.7.8] - 2023-02-06 +### Changed +- Updated package dependencies. + +## [2.7.7] - 2023-01-26 +### Changed +- Use `flex-start` instead of `start` for better browser compatibility. [#28530] + +## [2.7.6] - 2023-01-25 +### Changed +- Minor internal updates. + +## [2.7.5] - 2023-01-23 +### Fixed +- Components: Fix usage of box-sizing across the elements [#28489] +- Fixes the price display for products with intro offers for the first month. [#28424] + +## [2.7.4] - 2023-01-16 +### Changed +- Updated package dependencies. [#28303] + +## [2.7.3] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [2.7.2] - 2023-01-02 +### Added +- My Jetpack: Move VideoPress from Hybrid [#28097] + +### Changed +- My Jetpack: Move Search out of hybrid and deprecate Hybrid_Product class [#28113] + +## [2.7.1] - 2022-12-27 +### Changed +- Fix layout visual issues [#28055] +- My Jetpack: Move Backup out of hybrid product [#28022] +- My Jetpack: Move Social out of hybrid product [#28074] + +## [2.7.0] - 2022-12-19 +### Added +- Implement detached licenses redux store. [#27609] + +### Changed +- Updated package dependencies. [#27916] + +### Fixed +- Add translation context to Security product name. [#27920] + +## [2.6.1] - 2022-12-12 +### Changed +- Updated package dependencies. [#27888] + +## [2.6.0] - 2022-12-05 +### Changed +- Improve design of the error notice. [#27340] +- Updated package dependencies. [#27340] + +## [2.5.2] - 2022-12-02 +### Changed +- My Jetpack: Requires connection only if needed [#27615] +- Updated package dependencies. [#27697] + +## [2.5.1] - 2022-11-30 + +## [2.5.0] - 2022-11-28 +### Changed +- My Jetpack: rename Backup and Anti-Spam to new product names [#27377] +- Show My Jetpack even if site is disconnected [#26967] +- Updated package dependencies. [#27576] + +## [2.4.1] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [2.4.0] - 2022-11-17 +### Added +- Added Jetpack Protect to My Jetpack. [#26069] + +### Changed +- Updated package dependencies. [#26736] + +## [2.3.5] - 2022-11-10 +### Changed +- Updated package dependencies. [#27319] + +## [2.3.4] - 2022-11-08 +### Changed +- Updated package dependencies. [#27289] + +## [2.3.3] - 2022-11-01 +### Changed +- Updated package dependencies. [#27196] + +## [2.3.2] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [2.3.1] - 2022-10-25 +### Added +- Add a flag to indicate if the pricing is introductory with product price [#26982] +- My Jetpack: Support trial [#27033] + +### Changed +- Search: now support 38 languages [#27025] + +### Fixed +- Don't show old price when it's the same as new one [#27015] +- Search: check if free plan and new pricing is active using wpcom API [#27016] + +## [2.3.0] - 2022-10-19 +### Added +- Added support for free product and added free product for Search [#26808] + +### Changed +- Updated package dependencies. [#26883] + +## [2.2.3] - 2022-10-17 +### Changed +- Updated package dependencies. [#26851] + +## [2.2.2] - 2022-10-13 +### Changed +- Updated package dependencies. [#26790] + +## [2.2.1] - 2022-10-11 +### Changed +- Updated package dependencies. [#25973] + +## [2.2.0] - 2022-10-05 +### Added +- Integrate the new connection error message React component into My Jetpack. [#26485] +- Search: add post type breakdown endpoint [#26463] +- Trigger restore connection flow. [#26489] + +### Changed +- Updated package dependencies. [#26457] + +## [2.1.1] - 2022-09-27 +### Changed +- Updated package dependencies. + +## [2.1.0] - 2022-09-20 +### Added +- Added the ConnectionErrorNotice React component. [#26259] + +### Changed +- Updated package dependencies. + +### Fixed +- Fixed the tests for the Module_Product class by creating and using a sample, test-only module product class as the test subject instead of relying on Videopress or other concrete products. [#26227] + +## [2.0.5] - 2022-09-08 +### Changed +- Change VideoPress into a Hybrid product in My Jetpack [#25954] +- Updated package dependencies. + +## [2.0.4] - 2022-08-31 +### Added +- Allow plugins to override a product class. [#25891] + +### Changed +- Updated package dependencies. [#25856] + +## [2.0.3] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [2.0.2] - 2022-08-25 +### Changed +- Activate plugins in normal mode to trigger plugin_activated hooks [#25727] +- Updated package dependencies. [#25814] + +### Fixed +- Licensing: do not enable the Licensing UI if My Jetpack cannot be enabled. [#25667] +- Search: increased search plan/pricing API timeouts to 5s [#25775] + +## [2.0.1] - 2022-08-23 +### Added +- My Jetpack: Add container for JITMs [#22452] + +### Changed +- Updated package dependencies. [#25338, #25339, #25377, #25422, #25628, #25762, #25764] + +## [2.0.0] - 2022-08-09 +### Added +- Make product cards compatible with disclaimers and add disclaimer for backup card [#25265] + +### Changed +- Search: changed to only require site level connection [#24477] + +## [1.8.3] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [1.8.2] - 2022-07-27 +### Changed +- My Jetpack: changed link used in ProductCard component to a button when the plugin is absent + +## [1.8.1] - 2022-07-26 +### Changed +- My Jetpack: changed button used in ProductCard component from WordPress to Jetpack default [#25146] +- Updated package dependencies. [#25147] + +## [1.8.0] - 2022-07-19 +### Added +- My Jetpack: scroll window to top on route change [#25086] + +### Changed +- Updated package dependencies. [#24710] + +## [1.7.4] - 2022-07-12 +### Changed +- Updated package dependencies. [#25048, #25055] + +## [1.7.3] - 2022-07-06 +### Added +- Display alert when we cant automatically install the plugin [#24884] + +### Changed +- Updated package dependencies. [#24923] + +## [1.7.2] - 2022-06-28 +### Changed +- Disambiguate redirectUrls vars [#24839] +- Search: use centralized search pricing API [#24795] +- Updated package dependencies. [#24826] + +### Fixed +- Search Pricing: fix pricing fetch issue before site is connected [#24826] + +## [1.7.1] - 2022-06-21 +### Fixed +- My Jetpack: Replace wordpress from PNG to SVG at Connection [#24793] + +## [1.7.0] - 2022-06-21 +### Changed +- My Jetpack: set products grid to 3x3 for large viewport size +- Renaming master to trunk. +- Renaming `master` references to `trunk` + +## [1.6.2] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [1.6.1] - 2022-06-08 +### Changed +- Reorder JS imports for `import/order` eslint rule. [#24601] +- Updated package dependencies. [#24510] + +## [1.6.0] - 2022-05-30 +### Added +- Added Social to My Jetpack. + +### Changed +- Make My Jetpack use the new Modules class +- Replace deprecated external-link variation by using isExternalLink prop +- Updated package dependencies + +## [1.5.0] - 2022-05-24 +### Changed +- Default licensing UI in My Jetpack to be enabled [#24396] +- Updated package dependencies. [#24449] + +## [1.4.1] - 2022-05-19 +### Changed +- Updated package dependencies. [#24395] + +## [1.4.0] - 2022-05-18 +### Added +- Added a filter to allow stand-alone plugins to add product specific activation routines [#24334] +- My Jetpack: Add Protect class [#24347] +- My Jetpack: compute Search plugin price based on price tier [#24337] + +### Changed +- Add tiered pricing copy and update titles for Jetpack Search [#24357] +- Hide Activate a license link if there is no user connection since user connection is required [#24251] +- My Jetpack Hybrid products: Install Jetpack if stand-alone plugin installation fails [#24335] +- Updated Jetpack Scan feature list. [#23863] [#23795] [#24361] [#24372] + +## [1.3.0] - 2022-05-10 +### Changed +- Adds from arg to connection screen in My Jetpack so that we can begin tracking connections originating from My Jetpack [#24283] +- Updated package dependencies. [#24189] +- Updated references to old licensing activation UI to licensing activation UI in My Jetpack [#24189] + +## [1.2.1] - 2022-05-04 +### Added +- Add missing JavaScript dependencies. [#24096] + +### Changed +- My Jetpack: remove duplicated site suffix stored on rawUrl. Use siteSuffix instead. [#24094] +- Updated package dependencies. [#24095] [#24198] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [1.2.0] - 2022-04-26 +### Added +- Added activation screen component to My Jetpack licensing page + +### Changed +- Updated package dependencies. +- Update package.json metadata. + +## [1.1.0] - 2022-04-19 +### Added +- Adds a skeleton for the licensing UI along with a feature flag +- Better error handling for when the WPCOM server is unreachable +- Introduced ConnectedProductOffer component + +### Changed +- Turn Search into a Hybrid Product +- Updated package dependencies +- use connected plugin list from the connection store and ask for an update after activating a product + +## [1.0.2] - 2022-04-12 +### Changed +- Updated package dependencies. + +### Fixed +- Fixed bug in checkout URLs for sites installed in subdirs. + +## [1.0.1] - 2022-04-06 +### Removed +- Removed tracking dependency. + +## [1.0.0] - 2022-04-05 +### Added +- My Jetpack: improve Product and Interstitial components. + +### Changed +- Bump My Jetpack package to major version 1.0.0. +- My Jetpack: align price boxes in the interstitial product page. +- Updated package dependencies. + +## [0.6.13] - 2022-03-31 +### Added +- Added tracking events to Plans section external links + +### Changed +- My Jetpack: tweak plans section typography and descriptive text + +## [0.6.12] - 2022-03-29 +### Added +- Add missing JS peer dependencies. + +### Changed +- Microperformance: Use === null instead of is_null +- My Jetpack: Moved in product icon components +- My Jetpack: Tweak plan sections styles/sizes +- My Jetpack: Update ProductDetailCard to use components and theme variables +- My Jetpack: Use components to render headers elements +- Use different URLs for manage and purchase links in plans section + +### Fixed +- My Jetpack: Connect Screen logos quality + +## [0.6.11] - 2022-03-23 +### Added +- My Jetpack: add error styles to the whole Product card component +- My Jetpack: Make whole Product card clickable + +### Changed +- Changed opacity of product icons to 40% +- Changed title +- Improved should_initialize method +- My Jetpack: remove dropdown from CTA button in Product cards +- My Jetpack: Use Text and CSS vars on ProductCard +- Updated Boost product icon for clarity +- Updated package dependencies. +- Updated package dependencies. +- Updated styles for each product card status +- Update organization and copy of the Plans section + +### Removed +- My Jetpack: Remove client code that allows to deactivate a product + +### Fixed +- Fix Plans section top margin for plan list +- My Jetpack: jetpack_my_jetpack_should_initialize filter now respected when set to true. + +## [0.6.10] - 2022-03-15 +### Changed +- Make Backup go through the purchase flow after activation +- My Jetpack: Use ThemeProvider instead base-styles +- Updated package dependencies + +### Removed +- Removed Beta badge from menu item + +## [0.6.9] - 2022-03-09 +### Changed +- Updated package dependencies. + +## [0.6.8] - 2022-03-08 +### Added +- Added connected plugins slugs to My Jetpack tracking events +- Add link to jetpack.com in the footer +- My Jetpack: Add jetpack features link on connection screen +- My Jetpack: tidy Product card component +- My Jetpack: update Spinner in checkout button + +### Changed +- Components: update attributes used within the Button component to match recent deprecations and changes. +- My Jetpack: Add Connected Product Card stories +- My Jetpack: Add connection screen footer +- My Jetpack: clean/tidy Product data +- My Jetpack: Remove Layout component +- Only consider Backup product active when the plan is purchased + +### Fixed +- Fixed Backup flow when Jetpack plugin is active +- My Jetpack: align CTA buttons of My Jetpack overview +- My Jetpack: Fix button height in the Interstitial pages + +## [0.6.7] - 2022-03-02 +### Added +- Add My Jetpack action link to all Jetpack plugins +- My Jetpack: Handle cosmetic tweaks +- My Jetpack: Pass requiresUserConnection to ConnectionStatusCard + +### Changed +- Refactor and simplify Products class +- Updated package dependencies. + +### Fixed +- Disable browser cache for My Jetpack +- My Jetpack: fix products card section story +- My Jetpack: fix stories for the Interstitial pages + +## [0.6.6] - 2022-02-28 +### Fixed +- Re-doing 0.6.5 to fixup bad release. + +## [0.6.5] - 2022-02-28 +### Changed +- Tweak product card box model. + +### Fixed +- Use namespace in My Jetpack REST Products class to prevent fatal + +## [0.6.4] - 2022-02-25 +### Added +- Activate Jetpack plugin from Extras product card +- Added list of connected plugins to Disconnect dialog in My Jetpack +- Add Extras interstitial page +- My Jetpack: Handle cosmetic tweaks +- My Jetpack: Remove global notices when in my jetpack page +- My Jetpack: set height of Jetpack logo in the footer +- My Jetpack: tweak height of Jetpack Logo +- My Jetpack: update Product logos + +### Changed +- Disable My Jetpack on MS +- My Jetpack: compress extras product image +- Updated package dependencies. +- Update My Jetpack dashboard headline + +### Removed +- Remove unnecessary line from My Jetpack Initial state + +### Fixed +- Fix beta badge for RTL languages +- Handle plugin activating from Hybrid class +- Memoized RecordEvent from usAnalytics hook +- My Jetpack: Fix post activation url redirect +- My Jetpack: Move product list that requires user connection to selector +- Products::get_products_names should not load all product information +- Update automattic logo href in the footer + +## [0.6.3] - 2022-02-22 +### Changed +- Updated inline documentation + +### Fixed +- Use Jetpack namespace to fix fatal error + +## [0.6.2] - 2022-02-22 +### Added +- Add Beta badge +- Add Extras class +- Apply coupon discount to Product price when it exists +- Filesystem write access to the initial state +- Improve Product detail layout +- Implement close link on layout nav +- Prevent calling activation hook when activating backup + +### Changed +- Bump package versions. +- Improve My Jetpack link styles +- Improve redirect process after installing Product +- Fix interstitial CTA buttons layout +- Move from isPressed to CSS vars +- Redirect connect user to connection interstitial +- Point the link of the Manage button of CRM to its dashboard +- Redirect to post_activation_url after product activation from iterstitial screen +- Remove conditional loading depending on constant +- Send My Jetpack version with fired events +- Update the layout of interstitial page when it has an upgradable bundle + +### Fixed +- Check if product is active before checking if requires plan +- Fix check for plugin installation for hybrid products +- Fix click on security and add click on My Jetpack interstitial +- Fix clicks on VideoPress and CRM cards +- Fix Product prices +- Make Scan and Search interstitials install the plugin +- Purchases: ensure we retrieve translated version of active purchases +- Return needs purchase status for products module + +## [0.6.1] - 2022-02-16 +### Added +- Add Anti-Spam Product detail card +- Add CRM interstitial page +- Added wpcom plan slug to product info +- add manage and post activation urls +- Add Scan product: interstitial, route, data, etc... +- Add Security Product Bundle +- Add VideoPress data +- Add VideoPress interstitial cmp. Story. +- Add `#/add-videopress` route +- Change the discount value for all Products to 50 +- checks and activation for Security Bundle +- consume prices dynamically +- Do not show Porduct price when plan has required plan +- Finish Backup, Anti-Spam and Scan interstitial pages +- Fire Tracks Event when user clicks on Product Interstitial Back link +- Install proudcts from interstitial pages +- Make click on Fix connection show connection route +- package version to main class +- Pull product discount from wpcom +- Refactoring -> add icons component -> tweak icons for interstitial pages +- Register `#/add-anti-spam` route. Connect with interstitial page +- Restore Security bundle card in the UI +- Set default values for product data in the client (custom hook) +- set product status as error if active and requiring a missing user connection +- Set properly the checkout link for Products +- Set unlink=1 in the checkout URL when the user is not connected +- Tidy Product stories +- Update Backup product data. Tweak Icon. +- Update mock data for Search product. useMyJetpackNavigate() hook + +### Changed +- Adapt Scan actiavtion behavior as it is not a module +- Add global notices for activate/deactivate failures +- Add manage redirect +- Apply correct style for CTA buttons on Interstitial +- Avoid usage of 100vh on layout +- Fix setting height of the Product title in the detail component +- Implement is fulfilled handler for product resolver +- Improve global notice layout +- Reduce size of boost and search interstitial images +- Update structure with Layout component +- Only pass a productUrl if the product is not free on interstitial pages +- Only show the deactivate action when it makes sense +- Pass slug prop to event firing on product card button actions instead of name +- Remove unnecessary payload from request to activate or deactivate a product +- Replace renderActionButton function for ActionButton component +- Updated package dependencies. +- Use useMyJetpackNavigate when it's worth it + +### Fixed +- Fixed connection check labels and error message +- Fix upgradability for anti-spam and backup products +- Remove duplicted Icon in Product Card story +- Use key when looping through product detail icons + +## [0.6.0] - 2022-02-09 +### Added +- Add Boost interstitial cmp. +- Add has_required_plan to product info and implement method in Search +- Add Product princign harcoded data +- Add search product data +- Add title and features to products data +- anti spam product class +- Connect Boost card with the interstitial page via /add-boost root +- Fire Tracks event when clicking CTA button on product Interstitial page +- Fire Tracks event when clicking Manage button on product card +- Fire Tracks event when clickn Add link on My Jetpack product card +- Fire Tracks event when showing the Interstitial page +- Implement Free price for Boost product +- Implement Search product interstitial +- Introduce basic Layout component. Add GoBackLink component +- Introduce ProductDetailCard component +- My Jetpack: Add Connection screen +- Pass slug prop to ProductCard' +- Plan verification for Backup and Scan +- Restore getProduct() resolver +- Set the checkout URL for the Product detail component +- useCallback for functions that are bound to onEvents + +### Changed +- My Jetpack: Implement handler of connection notices +- My Jetpack: Update notice style and implements redirect for connection route +- Support multiple possible folder for each plugin +- Updated package dependencies + +### Removed +- dependency from search package + +### Fixed +- Fix My Jetpack's reducer for SET_PRODUCT_STATUS +- Fix the redirect URL value +- Show discounted price in Product Detail card +- typo + +## [0.5.0] - 2022-02-02 +### Added +- Added plugin installation functionality +- Adds Tracks events for activating and deactivating products from the product cards +- Fixes stories for ProductCard component +- Handle when site is not connected +- Initial approach to handle global notice +- Module Products +- My Jetpack: Add route handling +- My Jetpack: connect all product cards with data provider +- My Jetpack: connect Backup product class with Product class. Add long description and features fields. +- My Jetpack: handle redirect when no connection #22549 +- My Jetpack: reorganize stores by project/name +- Remove getProduct() resolver +- Support to Hybrid products +- Tweak dimms of the Product card status +- Update data handling - Implement request status in Product Card +- User connection requirement to product info +- uses the Plugin Installer package to safely checks plugins statuses + +### Changed +- Added filter for disabling the initialization of the My Jetpack package +- Build: remove unneeded files from production build. +- Do not initialize My Jetpack id site is not connected +- My Jetpack: Refactor styles to use layout components and theme provider +- My Jetpack: Update gap between product cards section +- Pick API root and nonce values from a new window var myJetpackRest +- Updated package dependencies. +- Update plugin absent status consistently + +### Fixed +- added unit test mock for new global variable myJetpackRest +- Fix tests +- Fix unsafe optional chaining. +- my-jetpack: fix tracking event when activating product +- Resolved minor code standard violation after implementing a stricter rule. + +## [0.4.0] - 2022-01-25 +### Added +- add API endpoints to manipulate products +- Added css module for My Jetpack Plans Section +- Added useAnalytics hook +- Added Visitor class for status regarding the site visitor. +- Add first data approach +- Add Products and REST_Products basic classes +- Adds very basic product cards section component to my jetpack +- My Jetpack: Add Product Card component +- My Jetpack: check user connectivity before to hit wpcom side +- My Jetpack: Implement data handling for enable/disable products +- Removed endpoint plans superseded by purchases + +### Changed +- Add Connections Section wrapping the Connection Status Card to My Jetpack +- Build: do not ship raw files in production bundle. + +### Removed +- Remove unused usePlans() custom react hook + +### Fixed +- Fixed svg attribute strokeWidth for Boost Card + +## [0.3.3] - 2022-01-18 +### Added +- Added redux store specific to my-jetpack +- Implement plans list properly in the PlansSection +- My Jetpack: Add scripts for JS tests +- My Jetpack: Include wordpress components as dep +- Reduxify purchases data + +### Changed +- General: update required node version to v16.13.2 +- Properly style the Plans Section according to proposed design +- Updated package dependencies. + +## [0.3.2] - 2022-01-13 +### Added +- My Jetpack: add story to `` component +- My Jetpack: first PlanSection implementation + +### Fixed +- Rename method enqueue_scritps to enqueue_scripts + +## [0.3.1] - 2022-01-11 +### Added +- Add devvelopment testing instructions to doc. + +### Changed +- Updated package dependencies. + +### Removed +- Remove use of deprecated `~` in sass-loader imports. + +## [0.3.0] - 2022-01-04 +### Changed +- Drop isRegistered and isUserConnected params from ConnectionStatusCard component +- Switch to pcov for code coverage. +- Updated package dependencies. +- Updated package textdomain from `jetpack` to `jetpack-my-jetpack`. + +## [0.2.0] - 2021-12-14 +### Added +- Added Connection Status Card to the page. +- Janitorial: add watch command to the plugin. + +### Changed +- Adapt to new layout components. +- Build: do not ship scss and jsx files in production build. + +### Fixed +- Build minimized JS for the production build. +- Fix JavaScript i18n strings. + +## [0.1.3] - 2021-12-07 +### Changed +- Updated package dependencies. + +## [0.1.2] - 2021-11-30 +### Added +- Janitorial: create mirror repo for the package. + +### Changed +- Remove now-redundant `output.filename` from Webpack config. + +## 0.1.1 - 2021-11-23 +### Changed +- Updated package dependencies. + +## 0.1.0 - 2021-11-17 +### Added +- Created package + +[4.35.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.35.2...4.35.3 +[4.35.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.35.1...4.35.2 +[4.35.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.35.0...4.35.1 +[4.35.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.34.0...4.35.0 +[4.34.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.33.1...4.34.0 +[4.33.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.33.0...4.33.1 +[4.33.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.32.4...4.33.0 +[4.32.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.32.3...4.32.4 +[4.32.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.32.2...4.32.3 +[4.32.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.32.1...4.32.2 +[4.32.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.32.0...4.32.1 +[4.32.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.31.0...4.32.0 +[4.31.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.30.0...4.31.0 +[4.30.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.29.0...4.30.0 +[4.29.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.28.0...4.29.0 +[4.28.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.27.2...4.28.0 +[4.27.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.27.1...4.27.2 +[4.27.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.27.0...4.27.1 +[4.27.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.26.0...4.27.0 +[4.26.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.25.4...4.26.0 +[4.25.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.25.3...4.25.4 +[4.25.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.25.2...4.25.3 +[4.25.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.25.1...4.25.2 +[4.25.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.25.0...4.25.1 +[4.25.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.7...4.25.0 +[4.24.7]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.6...4.24.7 +[4.24.6]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.5...4.24.6 +[4.24.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.4...4.24.5 +[4.24.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.3...4.24.4 +[4.24.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.2...4.24.3 +[4.24.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.1...4.24.2 +[4.24.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.24.0...4.24.1 +[4.24.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.23.3...4.24.0 +[4.23.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.23.2...4.23.3 +[4.23.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.23.1...4.23.2 +[4.23.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.23.0...4.23.1 +[4.23.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.22.3...4.23.0 +[4.22.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.22.2...4.22.3 +[4.22.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.22.1...4.22.2 +[4.22.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.22.0...4.22.1 +[4.22.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.21.0...4.22.0 +[4.21.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.20.2...4.21.0 +[4.20.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.20.1...4.20.2 +[4.20.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.20.0...4.20.1 +[4.20.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.19.0...4.20.0 +[4.19.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.18.0...4.19.0 +[4.18.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.17.1...4.18.0 +[4.17.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.17.0...4.17.1 +[4.17.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.16.0...4.17.0 +[4.16.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.15.0...4.16.0 +[4.15.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.14.0...4.15.0 +[4.14.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.13.0...4.14.0 +[4.13.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.12.1...4.13.0 +[4.12.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.12.0...4.12.1 +[4.12.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.11.0...4.12.0 +[4.11.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.10.0...4.11.0 +[4.10.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.9.2...4.10.0 +[4.9.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.9.1...4.9.2 +[4.9.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.9.0...4.9.1 +[4.9.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.8.0...4.9.0 +[4.8.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.7.0...4.8.0 +[4.7.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.6.2...4.7.0 +[4.6.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.6.1...4.6.2 +[4.6.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.6.0...4.6.1 +[4.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.5.0...4.6.0 +[4.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.4.0...4.5.0 +[4.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.3.0...4.4.0 +[4.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.2.1...4.3.0 +[4.2.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.2.0...4.2.1 +[4.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.1.4...4.2.0 +[4.1.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.1.3...4.1.4 +[4.1.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.1.2...4.1.3 +[4.1.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.1.1...4.1.2 +[4.1.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.1.0...4.1.1 +[4.1.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.0.3...4.1.0 +[4.0.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.0.2...4.0.3 +[4.0.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.0.1...4.0.2 +[4.0.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.0.0...4.0.1 +[4.0.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.12.2...4.0.0 +[3.12.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.12.1...3.12.2 +[3.12.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.12.0...3.12.1 +[3.12.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.11.1...3.12.0 +[3.11.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.11.0...3.11.1 +[3.11.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.10.0...3.11.0 +[3.10.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.9.1...3.10.0 +[3.9.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.9.0...3.9.1 +[3.9.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.8.2...3.9.0 +[3.8.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.8.1...3.8.2 +[3.8.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.8.0...3.8.1 +[3.8.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.7.0...3.8.0 +[3.7.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.6.0...3.7.0 +[3.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.5.0...3.6.0 +[3.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.4.5...3.5.0 +[3.4.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.4.4...3.4.5 +[3.4.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.4.3...3.4.4 +[3.4.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.4.2...3.4.3 +[3.4.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.4.1...3.4.2 +[3.4.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.4.0...3.4.1 +[3.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.3.3...3.4.0 +[3.3.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.3.2...3.3.3 +[3.3.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.3.1...3.3.2 +[3.3.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.3.0...3.3.1 +[3.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.2.1...3.3.0 +[3.2.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.1.3...3.2.0 +[3.1.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.1.2...3.1.3 +[3.1.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.1.1...3.1.2 +[3.1.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.1.0...3.1.1 +[3.1.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/3.0.0...3.1.0 +[3.0.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.15.0...3.0.0 +[2.15.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.14.3...2.15.0 +[2.14.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.14.2...2.14.3 +[2.14.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.14.1...2.14.2 +[2.14.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.14.0...2.14.1 +[2.14.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.13.0...2.14.0 +[2.13.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.12.2...2.13.0 +[2.12.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.12.1...2.12.2 +[2.12.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.12.0...2.12.1 +[2.12.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.11.0...2.12.0 +[2.11.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.10.3...2.11.0 +[2.10.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.10.2...2.10.3 +[2.10.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.10.1...2.10.2 +[2.10.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.10.0...2.10.1 +[2.10.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.9.2...2.10.0 +[2.9.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.9.1...2.9.2 +[2.9.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.9.0...2.9.1 +[2.9.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.8.1...2.9.0 +[2.8.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.8.0...2.8.1 +[2.8.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.13...2.8.0 +[2.7.13]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.12...2.7.13 +[2.7.12]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.11...2.7.12 +[2.7.11]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.10...2.7.11 +[2.7.10]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.9...2.7.10 +[2.7.9]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.8...2.7.9 +[2.7.8]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.7...2.7.8 +[2.7.7]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.6...2.7.7 +[2.7.6]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.5...2.7.6 +[2.7.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.4...2.7.5 +[2.7.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.3...2.7.4 +[2.7.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.2...2.7.3 +[2.7.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.1...2.7.2 +[2.7.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.0...2.7.1 +[2.7.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.6.1...2.7.0 +[2.6.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.6.0...2.6.1 +[2.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.2...2.6.0 +[2.5.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.1...2.5.2 +[2.5.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.0...2.5.1 +[2.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.4.1...2.5.0 +[2.4.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.4.0...2.4.1 +[2.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.5...2.4.0 +[2.3.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.4...2.3.5 +[2.3.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.3...2.3.4 +[2.3.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.2...2.3.3 +[2.3.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.1...2.3.2 +[2.3.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.0...2.3.1 +[2.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.3...2.3.0 +[2.2.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.2...2.2.3 +[2.2.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.1...2.2.2 +[2.2.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.0...2.2.1 +[2.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.1.1...2.2.0 +[2.1.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.1.0...2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.5...2.1.0 +[2.0.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.4...2.0.5 +[2.0.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.3...2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.2...2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.3...2.0.0 +[1.8.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.2...1.8.3 +[1.8.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.1...1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.0...1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.4...1.8.0 +[1.7.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.3...1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.2...1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.1...1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.0...1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.6.2...1.7.0 +[1.6.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.6.1...1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.6.0...1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.5.0...1.6.0 +[1.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.4.1...1.5.0 +[1.4.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.3.0...1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.2.1...1.3.0 +[1.2.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.0.2...1.1.0 +[1.0.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.13...1.0.0 +[0.6.13]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.12...0.6.13 +[0.6.12]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.11...0.6.12 +[0.6.11]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.10...0.6.11 +[0.6.10]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.9...0.6.10 +[0.6.9]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.8...0.6.9 +[0.6.8]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.7...0.6.8 +[0.6.7]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.6...0.6.7 +[0.6.6]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.5...0.6.6 +[0.6.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.4...0.6.5 +[0.6.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.3...0.6.4 +[0.6.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.2...0.6.3 +[0.6.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.1...0.6.2 +[0.6.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.0...0.6.1 +[0.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.5.0...0.6.0 +[0.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.4.0...0.5.0 +[0.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.3...0.4.0 +[0.3.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.2...0.3.3 +[0.3.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.1...0.3.2 +[0.3.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.0...0.3.1 +[0.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.2.0...0.3.0 +[0.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.1.3...0.2.0 +[0.1.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.1.2...0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.1.1...0.1.2 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/apple-92dacafad84e79708a74.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/apple-92dacafad84e79708a74.svg new file mode 100644 index 00000000..478fcfd9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/apple-92dacafad84e79708a74.svg @@ -0,0 +1,3 @@ + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-9e9a227e7e7280d0aa85.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-9e9a227e7e7280d0aa85.png new file mode 100644 index 00000000..4e7cb0ce Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-9e9a227e7e7280d0aa85.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/cloud-81ac85ba680343200f54.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/cloud-81ac85ba680343200f54.svg new file mode 100644 index 00000000..a033545d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/cloud-81ac85ba680343200f54.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-c399837fe1621b176d10.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-c399837fe1621b176d10.png new file mode 100644 index 00000000..47797572 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-c399837fe1621b176d10.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-8a2b204e2c720730e928.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-8a2b204e2c720730e928.png new file mode 100644 index 00000000..3984395b Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-8a2b204e2c720730e928.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/empty-avatar-fea23feddfa99b07c2e8.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/empty-avatar-fea23feddfa99b07c2e8.svg new file mode 100644 index 00000000..d648cc87 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/empty-avatar-fea23feddfa99b07c2e8.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/evaluation-blank-fbbfbcd75b50ade0f092.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/evaluation-blank-fbbfbcd75b50ade0f092.png new file mode 100644 index 00000000..99ef2671 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/evaluation-blank-fbbfbcd75b50ade0f092.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/evaluation-selected-196d1790b76830f9b73a.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/evaluation-selected-196d1790b76830f9b73a.png new file mode 100644 index 00000000..1ff0ab37 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/evaluation-selected-196d1790b76830f9b73a.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-c6bd0796750901faa7fd.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-c6bd0796750901faa7fd.png new file mode 100644 index 00000000..93435375 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-c6bd0796750901faa7fd.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/github-45c648158e3e86b560f5.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/github-45c648158e3e86b560f5.svg new file mode 100644 index 00000000..e7ae694e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/github-45c648158e3e86b560f5.svg @@ -0,0 +1,3 @@ + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/google-dec2a429bf1d8e83f9ad.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/google-dec2a429bf1d8e83f9ad.svg new file mode 100644 index 00000000..5794583d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/google-dec2a429bf1d8e83f9ad.svg @@ -0,0 +1 @@ + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-9de1caef5eb5c22da5d6.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-9de1caef5eb5c22da5d6.svg new file mode 100644 index 00000000..f8dbeb91 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-9de1caef5eb5c22da5d6.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-ai-d29bf65dcea46074d72f.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-ai-d29bf65dcea46074d72f.png new file mode 100644 index 00000000..b77ec6b9 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-ai-d29bf65dcea46074d72f.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-gray-7eeb5eb060c8adea8622.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-gray-7eeb5eb060c8adea8622.svg new file mode 100644 index 00000000..5a2a8b5f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-gray-7eeb5eb060c8adea8622.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-cef570e11997f185e23d.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-cef570e11997f185e23d.png new file mode 100644 index 00000000..bc305002 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-cef570e11997f185e23d.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-c5c132e713a79e05985f.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-c5c132e713a79e05985f.png new file mode 100644 index 00000000..3a84fe15 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-c5c132e713a79e05985f.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-manage-3a7ecaa604823c98c3cf.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-manage-3a7ecaa604823c98c3cf.svg new file mode 100644 index 00000000..1cbd2e82 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-manage-3a7ecaa604823c98c3cf.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-d177a31292d96d5ccbc2.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-d177a31292d96d5ccbc2.png new file mode 100644 index 00000000..a5d1e8d7 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-d177a31292d96d5ccbc2.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-inactive-cba3b43d918377b506e5.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-inactive-cba3b43d918377b506e5.svg new file mode 100644 index 00000000..5afa85d0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-inactive-cba3b43d918377b506e5.svg @@ -0,0 +1,3 @@ + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-off-47426e7b562ef20ae513.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-off-47426e7b562ef20ae513.svg new file mode 100644 index 00000000..e1f7f232 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-off-47426e7b562ef20ae513.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-partial-48b279219c6389a129b9.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-partial-48b279219c6389a129b9.svg new file mode 100644 index 00000000..03b09674 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-partial-48b279219c6389a129b9.svg @@ -0,0 +1,4 @@ + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-success-e64a26c3a6d0888fba06.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-success-e64a26c3a6d0888fba06.svg new file mode 100644 index 00000000..0f3ebeca --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/shield-success-e64a26c3a6d0888fba06.svg @@ -0,0 +1,4 @@ + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/site-cards-29522f090d5422fd7afd.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/site-cards-29522f090d5422fd7afd.png new file mode 100644 index 00000000..83e562ed Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/site-cards-29522f090d5422fd7afd.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/social-b8744a40c7c19a7bcc37.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/social-b8744a40c7c19a7bcc37.png new file mode 100644 index 00000000..00d8ac9d Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/social-b8744a40c7c19a7bcc37.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/stats-95b42796ede4f632b642.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/stats-95b42796ede4f632b642.png new file mode 100644 index 00000000..bd003303 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/stats-95b42796ede4f632b642.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9c064bc7b89c386e5e50.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9c064bc7b89c386e5e50.png new file mode 100644 index 00000000..f38227dc Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9c064bc7b89c386e5e50.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/wordpress-1fc3e0ba6c52e9707900.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/wordpress-1fc3e0ba6c52e9707900.svg new file mode 100644 index 00000000..b1cd75b6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/wordpress-1fc3e0ba6c52e9707900.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.asset.php new file mode 100644 index 00000000..32b8e762 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.asset.php @@ -0,0 +1 @@ + array('jetpack-connection', 'jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '1c3aa81dbb7f888e2783'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.css new file mode 100644 index 00000000..0cc5bb85 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.css @@ -0,0 +1 @@ +.jp-license-activation-screen-controls{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-controls h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-controls p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-controls label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-controls{padding:64px}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error{max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field .components-input-control__label.components-input-control__label.components-input-control__label,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error .components-input-control__label.components-input-control__label.components-input-control__label{font-size:var(--font-body);font-weight:600}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field select.components-select-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border-radius:var(--jp-border-radius);font-size:18px;line-height:24px;margin:0;min-height:48px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input{border:1px solid var(--jp-gray-40)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border:1px solid var(--jp-red)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error{align-items:flex-start;color:var(--jp-red);display:flex;flex-direction:row;max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error svg{margin-right:4px;fill:var(--jp-red);min-width:24px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error span{font-size:var(--font-body)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);display:flex;font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin-top:24px;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{width:auto}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:hover,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:focus,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active[disabled],.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button .jp-components-spinner,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active .jp-components-spinner{width:100%}@keyframes rotate-spinner{to{transform:rotate(1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid transparent;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-right-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.jp-license-activation-screen-illustration{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-illustration--wrapper{display:flex;flex:1}.jp-license-activation-screen-illustration--wrapper img{align-self:center;height:auto;max-width:100%}.jp-license-activation-screen-illustration--support-link{flex:0}.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin:0 40px 20px 0;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{width:auto}}.components-button.jp-license-activation-screen-success-info--button:active:hover,.components-button.jp-license-activation-screen-success-info--button:hover,.components-button.jp-license-activation-screen-success-info--button:visited:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:focus,.components-button.jp-license-activation-screen-success-info--button:focus,.components-button.jp-license-activation-screen-success-info--button:visited:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:disabled,.components-button.jp-license-activation-screen-success-info--button:active[disabled],.components-button.jp-license-activation-screen-success-info--button:disabled,.components-button.jp-license-activation-screen-success-info--button:visited:disabled,.components-button.jp-license-activation-screen-success-info--button:visited[disabled],.components-button.jp-license-activation-screen-success-info--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.components-button.jp-license-activation-screen-success-info--button .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:active .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:visited .jp-components-spinner{width:100%}.jp-license-activation-screen-success-info--product-details h1{line-height:52px}.jp-license-activation-screen-success-info--product-details a{color:var(--jp-black);text-decoration:underline!important}.jp-license-activation-screen-success-info--external-link{color:var(--jp-black);font-size:16px;font-style:normal;font-weight:600;text-decoration:underline!important;white-space:nowrap}.jp-license-activation-screen-success-info{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-success-info h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-success-info p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-success-info label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-success-info{padding:64px}}@media screen and (max-width:480px){.jp-license-activation-screen-success-info .jp-license-activation-screen-success-info--buttons{text-align:center}}.EiaNctK1_P9pPqOeiaSI{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ogHZg_sJCljylz3VJfsf{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.zv7eGvijKRkbPVakubHw{grid-column-end:span 1}.VoJNoiya_1ck3_kXS6_C{grid-column-end:span 2}.ecv0NO526NoTNbpALA1A{grid-column-end:span 3}.OfBdkceMzeHvRbzhqDlP{grid-column-end:span 4}@media(min-width:600px){.JLb3NpEKN8pOaWd7K1bu{grid-column-end:span 1}.fsMPGqPKE4mjMIPFwl77{grid-column-end:span 2}.DIK_zdaGAQ09eKspBJ4E{grid-column-end:span 3}.shXYpxPu3WCJsR8aOHtz{grid-column-end:span 4}.s7ElrOqG_yGd5SIfwqOR{grid-column-end:span 5}.Cxml9uzGvArAL8_RDs_p{grid-column-end:span 6}.aANxBKDGx72eDqU0iUPj{grid-column-end:span 7}.XxyzuTY3mnQcl9EGZadm{grid-column-end:span 8}}@media(min-width:960px){.Sfo4WaSNIWInJ93Abd3w{grid-column-end:span 1}.tQS7SKUGrU4THhWMysbo{grid-column-end:span 2}.I94U7mpY4h16pcOksZNF{grid-column-end:span 3}.uWMb9k77kQxBdS5MTt0s{grid-column-end:span 4}.rKwEEZQxK9s_POMg5Jss{grid-column-end:span 5}.UcPXX_s06IPCkF7ZjH3D{grid-column-end:span 6}.CrQdtiCFkRbzY6K2dFvt{grid-column-end:span 7}.rEUALOmOdUBXO0Us871z{grid-column-end:span 8}.NqXa9TlcTEviVsB53hBV{grid-column-end:span 9}.OnWVeiQiwgQ9lzdGPW66{grid-column-end:span 10}.D2PkTcy7b8u2K9QXY6VQ{grid-column-end:span 11}.EcqBhzAyxo5RDc2Y6m7K{grid-column-end:span 12}}@media(max-width:960px){.gB1mWzHOM38d80lrhBRX{display:none}}@media(max-width:600px){.KNQXLP78ejczOkour3zg{display:none}}.rBVbaVWBnBRtTMrUKZxm{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.rBVbaVWBnBRtTMrUKZxm span{display:block}.rBVbaVWBnBRtTMrUKZxm span:last-of-type{font-weight:600}.rBVbaVWBnBRtTMrUKZxm:focus span:last-of-type,.rBVbaVWBnBRtTMrUKZxm:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.rBVbaVWBnBRtTMrUKZxm:focus:after,.rBVbaVWBnBRtTMrUKZxm:hover:after{transform:translateY(-50%) translateX(8px)}.rBVbaVWBnBRtTMrUKZxm:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.gfM_DIJrVbRhmKdAphIm{background:var(--jp-white);border-radius:var(--jp-modal-radius);box-shadow:0 12px 16px -.5px rgba(0,0,0,.15);height:max-content;margin:3rem auto;max-width:414px;overflow:hidden;position:relative;transition:height .25s cubic-bezier(.59,.37,.18,1.19) 0;width:90%;will-change:height}.gfM_DIJrVbRhmKdAphIm>div:first-child{padding:0}.gfM_DIJrVbRhmKdAphIm *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.gfM_DIJrVbRhmKdAphIm p{color:var(--jp-black)}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:none}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:614px;transition-delay:2.15s}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh h2{margin-top:0}._j4GWTmW5psCHFYh6R0x{align-self:flex-start;margin-top:var(--jp-gap)!important;padding:8px var(--jp-modal-padding-small)!important;width:100%}.saSAjv8yulVXQDoqDJEI{font-weight:500;line-height:110%;margin-bottom:8px}.O_hcdbeMivIhBn7ApDnS{line-height:140%}@media(min-width:760px){.gfM_DIJrVbRhmKdAphIm{height:740px;max-width:1360px;position:relative;width:95%}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:block;left:64px;position:absolute;top:64px;z-index:99}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path{fill:#000}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{fill:#fff}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:740px;transition-delay:0}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path{transition:fill 2s ease .5s;fill:#fff}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{transition:fill 2s ease .5s;fill:#000}}@keyframes OmAVpCQ270MqI4IsT9Ky{20%{transform:translateY(0) scale(1)}65%{transform:translateY(16%) scale(1.4)}to{transform:translateY(0) scale(1)}}.Qn5xayjI_jH2m1d6BEoq{border-radius:var(--jp-button-radius);display:flex;height:50%;justify-content:center;min-height:400px;overflow:hidden;position:relative;transition:height .55s cubic-bezier(.59,.37,.18,1) 0s;will-change:height}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{height:100%;transition-delay:.65s}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq video{animation:OmAVpCQ270MqI4IsT9Ky 1.5s ease-in-out forwards}.Qn5xayjI_jH2m1d6BEoq video{height:100%;left:0;object-fit:cover;position:absolute;top:0;transform:scale(1);transition:all .85s cubic-bezier(1,0,.39,1) 0s;width:100%;will-change:transform}@media(min-width:760px){@keyframes Axe8f2LgqEBZHVcsRgY5{0%{animation-timing-function:cubic-bezier(.86,0,.07,1);left:60%;top:32px}50%{animation-timing-function:cubic-bezier(.17,.84,.44,1);bottom:32px;left:32px;top:32px;width:100%}to{left:32px;width:40%}}.Qn5xayjI_jH2m1d6BEoq{border-radius:12px;bottom:32px;display:block;height:auto;left:60%;overflow:hidden;position:absolute;right:32px;top:32px;transition-delay:0;transition:width .55s ease 0s;z-index:3}.Qn5xayjI_jH2m1d6BEoq video{height:100%;left:0;object-fit:cover;position:absolute;top:0;width:100%}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{animation-delay:.25s;animation-duration:2s;animation-fill-mode:forwards;animation-name:Axe8f2LgqEBZHVcsRgY5;height:auto}}.iBMDoShSmqpt72YfJb36{padding:var(--jp-modal-padding)}.iBMDoShSmqpt72YfJb36 h2{font-size:clamp(1.5rem,-.7353rem + 4.7059vw,3.5rem)}.iBMDoShSmqpt72YfJb36 p{font-size:clamp(1rem,.6974rem + 1.1696vw,1.75rem)}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:none;font-size:clamp(1.25rem,1.1491rem + .3899vw,1.5rem)}@media(min-width:760px){.iBMDoShSmqpt72YfJb36{bottom:15%;display:flex;flex-direction:column;gap:64px;left:64px;padding:0 var(--jp-modal-padding) 0 0;position:absolute;width:55%}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC{align-items:flex-start;display:flex;flex-direction:column;gap:16px;padding:0 32px 0 0}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC h2,.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC p{margin:0}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:block}.iBMDoShSmqpt72YfJb36 ._j4GWTmW5psCHFYh6R0x{align-self:flex-start;padding:16px var(--jp-modal-padding-large)!important;width:auto}.pnwbCuWbV0PNQr1LFpRh .iBMDoShSmqpt72YfJb36{left:-20px;opacity:0;transition:all .55s cubic-bezier(.59,.37,.18,1) .3s}}.HQVDZ6J3x6SJNYFX5khS{background:var(--jp-white);left:0;opacity:0;position:absolute;top:100%;transition:transform .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;width:100%;will-change:transform,opacity;z-index:2}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{opacity:1;transform:translateY(-100%);transition-delay:2s}@media(min-width:760px){.HQVDZ6J3x6SJNYFX5khS{align-items:flex-end;bottom:5%;container-type:inline-size;display:flex;flex-direction:column;gap:40px;left:45%;padding:0;right:32px;transform:translateY(0);transition-delay:0;transition:none;width:auto}.HQVDZ6J3x6SJNYFX5khS h2{width:100%}.HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{margin-right:var(--jp-modal-padding-large)}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{bottom:12%;left:45%;opacity:1;right:32px;top:unset;transform:translateY(0);transition:all .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;transition-delay:2s;width:auto}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS .l35bIyiqYJiZ6tVYvJtC{padding-left:32px}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{align-self:flex-end}}.KdvmPIjelQIFiPQGuIYf{background:var(--jp-gray-0);display:flex;flex-direction:column;gap:var(--jp-gap)}.KdvmPIjelQIFiPQGuIYf div{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-button-radius);box-shadow:0 0 40px 0 rgba(0,0,0,.08);flex:1;padding:var(--jp-modal-padding)}.KdvmPIjelQIFiPQGuIYf h3{font-size:24px;line-height:normal;margin:0}.KdvmPIjelQIFiPQGuIYf p{font-size:14px}@media(min-width:760px){.KdvmPIjelQIFiPQGuIYf{flex-direction:row;padding:var(--jp-modal-padding-large)}.KdvmPIjelQIFiPQGuIYf div{border:none;box-shadow:0 2px 16px rgba(0,0,0,.08),0 2px 2px rgba(0,0,0,.1)}.KdvmPIjelQIFiPQGuIYf div p{margin:8px 0}.KdvmPIjelQIFiPQGuIYf svg{margin-bottom:var(--jp-modal-padding-small)}}@container (max-width: 600px){.KdvmPIjelQIFiPQGuIYf div{padding:var(--jp-modal-padding-small)}}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aLWBKY0yRghEk7tNCgK3{fill:var(--color-bluesky)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw{fill:var(--color-nextdoor)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI{fill:var(--color-threads)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI.social-logo{border-radius:40%}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.51px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-right:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.51px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-left:calc(var(--spacing-base)/2)}.jp-license-activation-screen{border-radius:4px;box-shadow:0 4px 24px 0 rgba(0,0,0,.149);display:flex;flex-direction:column;min-height:540px;overflow:hidden}@media screen and (min-width:780px){.jp-license-activation-screen{flex-direction:row}}.hdasSNj9k3Sc5PwXK4uE{margin-right:4px;width:16px}.eWN8Hj0SBRDq1F48n_Fg{--gray-70:#3c434a;align-items:center;color:var(--gray-70);display:flex;font-size:14px;text-decoration:none}.jp-dashboard-footer{align-items:center;color:var(--jp-black);display:flex;flex-wrap:wrap;font-size:var(--font-body-extra-small);line-height:1.333;max-width:1128px;width:100%}.jp-dashboard-footer a{text-decoration:none}.jp-dashboard-footer a:any-link,.jp-dashboard-footer a[role=button]{color:inherit}.jp-dashboard-footer a:hover{text-decoration:underline;text-decoration-thickness:1.5px}.jp-dashboard-footer a:focus{border-radius:2px;box-shadow:none;outline:1.5px solid currentColor;outline-offset:3px}.jp-dashboard-footer.is-sm>ul{gap:.125rem}.jp-dashboard-footer.is-md,.jp-dashboard-footer.is-sm>ul{align-items:flex-start;flex-direction:column}.jp-dashboard-footer>ul{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;list-style:none;margin:0;padding:0;width:100%}.jp-dashboard-footer>ul>li{margin-bottom:0}.jp-dashboard-footer>ul>li>a{align-items:center;display:flex;gap:.25rem;min-height:44px}.jp-dashboard-footer__accessible-external-link{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px}.jp-dashboard-footer__jp-item{font-weight:600;padding-inline-end:1rem}.jp-dashboard-footer.is-sm .jp-dashboard-footer__jp-item{padding-bottom:1rem}.jp-dashboard-footer.is-lg .jp-dashboard-footer__a8c-item{margin-inline-start:auto}.jp-dashboard-footer.is-sm .jp-dashboard-footer__a8c-item{padding-top:1rem}.jp-dashboard-footer__a8c-item>a,.jp-dashboard-footer__jp-item>a{text-decoration:none}.sexr0jUxC1jVixdKiDnC{margin-left:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-left:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.rV_5QyvhDnsVjCX4pb0h{--gray-90:#1e1e1e;fill:var(--gray-90);width:24px}.MO1jDNY8VPqeNS9xL8jE{align-items:center;display:flex;text-decoration:none}.zvd4dCB_bBDiXJKKDqXm{position:relative}.ly4o9lSswAGHFXqGUEIO{position:absolute;right:32px;top:32px;z-index:1}.u64Go3kwEZ7MD9eji0H1{color:var(--jp-gray-50);font-size:13px;margin-bottom:8px;width:60%}._RT41NE3LU4R0ubcij2y{align-items:center;display:flex;gap:8px}._RT41NE3LU4R0ubcij2y li{background:none!important;margin:0!important;padding:0!important}.cFGWJeRiGHjAr8D7CWJW{max-width:110px}.Iz3l7a05TP6HK9S92TIL{width:16px}.lmQ0wFmnk4kKkGVjokPA{height:18px}.ZSFTmY3zE3VP4w0QeaqV{width:16px}.AoIs8wD92wKR8RpQj6Uc{align-items:center;display:inline-flex}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-right:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-left:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-right:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-left:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-right:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-left:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-right:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-left:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-right:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-left:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-right:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-left:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-right:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-left:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-right:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-left:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-right:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-left:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-right:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-left:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-right:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-left:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-right:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-left:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-right:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-left:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-right:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-left:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-right:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-left:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-right:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-left:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-right:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-left:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-right:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-left:calc(var( --spacing-base )*8)}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50);text-decoration:underline;white-space:nowrap}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe{align-items:center;display:flex;gap:var(--spacing-base);margin-bottom:calc(var(--spacing-base)*3)}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .VmtuLc2xRqmsO6cK8qjF{position:relative;width:54px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .MdTRfQ3eo5qZKChZlzNj,.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .PbEpL02SEH9VNAlbKCfV{width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .TD4AUM9gcTVAB6JHB5ZR{border-radius:50%;margin-left:-10px;position:absolute;width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .yjl73qv0VWoPP8IhGreh{border-top-style:solid;border-top:2px dashed var(--jp-black);height:0;width:67px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .J0GIu2rNR7rXocQTyd8p{border-color:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .rAV2E93SG8WpokuGk9jh{border-color:var(--jp-yellow-40)}.kezuOHNvu9vdvlJ86Fwg .YZ7FNKEm9qpvQ4ZkbAz5{transform:rotate(180deg)}.kezuOHNvu9vdvlJ86Fwg .TYNMsILey2vUwnyZSjJU{align-self:flex-end;margin-bottom:2px}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz{margin-bottom:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz,.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp{align-items:center;display:flex;gap:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.J0GIu2rNR7rXocQTyd8p{color:var(--jp-red);fill:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.rAV2E93SG8WpokuGk9jh{color:var(--jp-yellow-40);fill:var(--jp-yellow-40)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.q4_FOHifGawULuFBZke9 svg{fill:var(--jp-green-50)}.OpMBda4vebhRbW8Fm6YC{background:var(--jp-white);border:1px solid var(--jp-gray-5);border-radius:var(--jp-border-radius-rna);box-shadow:0 4px 12px 0 rgba(0,0,0,.06);display:flex;flex-direction:column;height:100%;padding:calc(var(--spacing-base)*3)}.OpMBda4vebhRbW8Fm6YC.BghJAx9hSagUdHWOUaYE{background:none;background-color:var(--jp-white-off);color:var(--jp-black-80);text-decoration:none}.OpMBda4vebhRbW8Fm6YC.BghJAx9hSagUdHWOUaYE:focus{background-color:var(--jp-white);box-shadow:0 0 0 1.5px var(--jp-black);outline:3px solid transparent}.OpMBda4vebhRbW8Fm6YC.IWsEW5nnNWUqqcT3K5L1{box-shadow:0 0 0 1.5px var(--jp-red-60)}.r3UCwgwCthua6lDCvIBI{align-items:center;display:flex;gap:var(--spacing-base);justify-content:space-between;margin-bottom:var(--spacing-base);width:100%}.r3UCwgwCthua6lDCvIBI h3{font-weight:700}.vpluqUMgmwx9_f8wCVIn{align-items:center;display:flex;flex-wrap:wrap-reverse;gap:var(--spacing-base);height:100%}.pIsYsXFAJ9KX2VrS5rmY{min-height:200px;position:relative}.gmPKCDKZcfQt9WieTyKS{flex-grow:1}.fDBaV7I4yUO6w5AWVEtr{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:auto;min-height:28px;padding-top:calc(var(--spacing-base)*3);width:100%}.SelsBZT7eIWRQyl1dasZ{display:flex;gap:var(--spacing-base);justify-content:flex-start}.LHYJUrOej3toDvOAiz4k{align-items:center;display:flex;gap:var(--spacing-base);justify-content:space-between;margin-bottom:calc(var(--spacing-base)*.5);width:100%}.LHYJUrOej3toDvOAiz4k h3{font-weight:700;line-height:28px}.JFjbc0JgC4qC92ehOiUr{display:flex;position:relative}.JFjbc0JgC4qC92ehOiUr .NBZgqk_CGGfY3Q16OHjT{align-items:center;border:.5px solid var(--jp-black);border-bottom-right-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius);box-shadow:inset 0 0 0 1px var(--jp-black);cursor:pointer;display:flex;justify-content:center;padding:0}.JFjbc0JgC4qC92ehOiUr .Jh6TlOGQNgBwU_fFxPrm{background-color:var(--jp-black);margin-left:.5px}.JFjbc0JgC4qC92ehOiUr .VBxTkBZVxHaVoyhMRJcz{background-color:var(--jp-white);border-left-width:0;margin-left:-.5px}.UZ3NDyOSbGY9NZWb3bUD{background:var(--jp-white);border-radius:calc(var(--jp-border-radius)/2);box-shadow:0 1px 1px 0 rgba(0,0,0,.1),0 1px 1.5px 0 rgba(0,0,0,.1),0 2px 3px -.5px rgba(0,0,0,.1);left:0;padding:var(--spacing-base);position:absolute;top:calc(100% + var(--spacing-base));z-index:1}.UZ3NDyOSbGY9NZWb3bUD .IpJGe_nvXXUiBOsAOkaV{align-items:center;background-color:var(--jp-white);border:none;cursor:pointer;display:flex;gap:calc(var(--spacing-base)*7);padding:var(--spacing-base);width:100%}.UZ3NDyOSbGY9NZWb3bUD .IpJGe_nvXXUiBOsAOkaV:hover{background-color:var(--jp-gray-0)}.UZ3NDyOSbGY9NZWb3bUD .SjzpxiAAVsU_xRrw55ub{align-items:center;display:flex;font-size:var(--font-label);gap:calc(var(--spacing-base)*.5)}.UZ3NDyOSbGY9NZWb3bUD .GQy61X1G7Wv3L3erNwxR{background-color:var(--jp-green-50);height:25px;width:25px}.QSePbRSFylCvM2cX8nN_ a,.QSePbRSFylCvM2cX8nN_ button{border-bottom-right-radius:0;border-top-right-radius:0}.aZvwqVNw6rvImSxn0DM9{align-items:baseline;display:flex;gap:calc(var(--spacing-base)*.5);margin-bottom:var(--spacing-base)}.R4OXFRkmlHAH8ScIgYXh{color:var(--jp-gray-100);font-size:var(--font-body);font-weight:600}.R4OXFRkmlHAH8ScIgYXh.g0_8bbVjnVh0D_pS264j{color:var(--jp-gray-30);text-decoration:line-through}.nqFgW_S2jbHPu9yPq9E_{color:var(--jp-gray-30);font-size:var(--font-body-extra-small)}.f5VJYwuJmjxH8PVxEbbv{align-items:center;display:flex;height:28px;white-space:nowrap}.f5VJYwuJmjxH8PVxEbbv:before{border-radius:50%;content:"";display:inline-block;height:8px;margin-right:var(--spacing-base);width:8px}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3{color:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3:before{background:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr{color:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr:before{background:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.TZUP7W6QYGajITiMNYas{color:var(--jp-yellow-40)}.f5VJYwuJmjxH8PVxEbbv.TZUP7W6QYGajITiMNYas:before{background:var(--jp-yellow-40)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02{color:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02:before{background:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.PdsJCfyyjSgrNDheF2qi:before{animation:dWP7ypkVXudMbAa38W5Z .5s linear infinite}@keyframes dWP7ypkVXudMbAa38W5Z{0%{opacity:0}50%{opacity:.5}to{opacity:0}}.wI7QgVzPXvVVu6kfnTT8{align-items:center;color:var(--jp-black);display:flex;justify-content:space-between;margin-top:1rem}.wI7QgVzPXvVVu6kfnTT8 .eqyxcUmdF0s3gmmlZGyD{display:flex;gap:1.5rem}.wI7QgVzPXvVVu6kfnTT8 .gxY6D0PeVtGk9iSB5E_u{align-items:center;display:flex;font-size:var(--font-body-small);gap:2px;margin:0}.wI7QgVzPXvVVu6kfnTT8 .D_uE0LD5CvpfM2FNp55k{align-items:center;display:flex;gap:2px}.wI7QgVzPXvVVu6kfnTT8 .VTBUdi1D4DW34F0yixMk{font-size:var(--font-body-small);margin:0}.BXQQYCO_pEmYmzBBwYxR{align-items:center;color:var(--jp-black);display:flex;gap:.25rem;margin-top:1rem}.BXQQYCO_pEmYmzBBwYxR .qdvOzzbrd3KQK7DNg8eg{font-size:var(--font-body-small);margin:0}.PFbMp_gtGLBMWbbYtO0q{display:flex;flex-grow:1;flex-wrap:wrap;gap:.25rem;justify-content:space-between}.ZFCNMiywyFvaifoIQI5w{color:var(--jp-gray-40)}.mj-boost-speed-score{margin:calc(var(--spacing-base)*-1);margin-bottom:0;padding:calc(var(--spacing-base))}.mj-boost-speed-score__grade{align-items:center;column-gap:1em;display:flex;font-size:var(--font-body-small);justify-content:space-between;line-height:24px;margin:8px 0}.mj-boost-speed-score__grade--letter{all:unset;border-radius:var(--jp-border-radius);color:var(--jp-green);cursor:pointer;font-size:var(--font-title-small);font-weight:700;line-height:24px;padding:0 5px}.mj-boost-speed-score__grade--letter:focus{outline:1px dotted var(--jp-black)}.boost-score-tooltip__heading{color:#000;font-size:var(--font-title-small);line-height:30px;margin:0}.boost-score-tooltip__content{font-size:var(--font-body);line-height:24px}.boost-score-tooltip__parent{max-width:340px;min-height:150px;padding:24px;width:calc(100vw - 64px)}@media(min-width:783px){.boost-score-tooltip__parent{width:100vw}}.boost-score-tooltip__parent p:last-child{margin-bottom:0}.mj-boost-speed-score__bar .jb-score-bar__label{display:none}.mj-boost-speed-score__bar .jb-score-bar__filler{border-radius:12px;min-width:49px}.mj-boost-speed-score__bar .jb-score-bar__bounds{border-radius:12px;height:24px;margin-left:0}.mj-boost-speed-score__bar .jb-score-bar__score{border-radius:12px;height:24px;width:30px}.mj-boost-speed-score__increase{align-items:center;color:var(--jp-green-50);display:flex;font-size:var(--font-body-small);line-height:28px;position:absolute;right:24px;top:26px;fill:var(--jp-green-50)}.gridicon{fill:currentColor;display:inline-block}.gridicon.needs-offset g{transform:translate(1px,1px)}.gridicon.needs-offset-x g{transform:translate(1px)}.gridicon.needs-offset-y g{transform:translateY(1px)}.jb-score-bar__label,.jb-score-bar__loading,.jb-score-bar__score{align-items:center;background-color:#fff;border:2px solid transparent;border-radius:42px;display:flex;height:42px}.jb-score-bar{color:var(--jp-gray-70);display:flex;width:100%}.jb-score-bar--mobile{margin-bottom:1.5rem}@media(max-width:767px){.jb-score-bar{flex-direction:column}.jb-score-bar__label{background-color:transparent}}.jb-score-bar__loading{align-items:center;display:flex;justify-content:center;width:42px}.jb-score-bar__label{display:grid;grid-template-columns:24px 1fr;grid-column-gap:10px;font-size:14px;justify-content:center;position:relative}@media(min-width:768px){.jb-score-bar__label{padding-left:15px;padding-right:15px;width:200px;z-index:50}}.jb-score-bar__score{border-radius:100%;font-weight:700;height:42px;justify-content:center;position:absolute;right:-1px;width:42px}.jb-score-bar__bounds{background-color:#f1f1f1;border-radius:21px;display:flex;height:42px;max-width:100%;position:relative;width:100%;z-index:40}@media(min-width:768px){.jb-score-bar__bounds{margin-left:-21px;width:calc(100% + 21px)}}.jb-score-bar__filler{border-radius:0 42px 42px 0;display:flex;justify-content:flex-end;min-width:85px;position:relative;transition:width .3s ease-in-out;width:0;will-change:width}@media(max-width:767px){.jb-score-bar__filler{border-radius:inherit;min-width:43px}}.jb-score-bar__no_boost_score{--clearance-space:74px;background:#fff;background-clip:padding-box;border:2px solid transparent;border-radius:50%;cursor:pointer;font-size:.7em;height:28px;line-height:1.625;padding:3px;position:absolute;text-align:center;top:6px;width:28px;z-index:2}.jb-score-bar__no_boost_score:hover{border:2px solid hsla(0,0%,100%,.5)}.jb-score-bar__no_boost_score:after{border-bottom:6px solid #fff;border-left:6px solid transparent;border-right:6px solid transparent;content:" ";height:0;left:6px;position:absolute;top:28px;width:0}.jb-score-bar__no_boost_score_tooltip{background:#fff;border-radius:4px;box-shadow:0 0 20px 0 hsla(0,0%,67%,.28);display:none;left:-10em;margin:0 16px;padding:16px;position:absolute;top:-62px;width:20em}.jb-score-bar__no_boost_score_tooltip:after{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;bottom:-6px;content:" ";height:0;left:10em;margin:0 -10px;position:absolute;width:0}.jb-score-bar__no_boost_score:hover .jb-score-bar__no_boost_score_tooltip{display:block}.jb-score-bar .fill-loading{background-color:var(--jp-white)}.jb-score-bar .fill-good{background-color:var(--jp-green)}.jb-score-bar .fill-mediocre{background-color:var(--jp-orange-20)}.jb-score-bar .fill-bad{background-color:var(--jp-red-50)}.info-tooltip__button{align-items:center;background:transparent;border:none;color:var(--jp-gray-50);cursor:pointer;display:flex;padding:2px}.info-tooltip__button svg{margin:0 auto}.info-tooltip__content h3{color:var(--jp-black);font-size:var(--font-title-small);font-weight:500;line-height:calc(var(--font-title-small) + 6px);margin:0 0 calc(var(--spacing-base)*2)}.info-tooltip__content p{color:var(--jp-gray-70);font-size:var(--font-body);line-height:var(--font-title-small);margin-bottom:0}.info-tooltip__content p a{color:var(--jp-black);text-decoration:underline}.info-tooltip__content p a:focus,.info-tooltip__content p a:hover{text-decoration:none}.g4lyov8aMDggdD4yOi1p{align-items:baseline;display:flex;margin-top:calc(var(--spacing-base)/2)}.g4lyov8aMDggdD4yOi1p .Ys5ScZ_dYn2O2AzDE5Yi{font-size:32px;font-weight:400;line-height:36px;margin-right:var(--spacing-base)}.sUNg_b7XteVXOrpHAkJg :last-child{margin-top:4px}.cF6QAJf1vXXAMuutXPcq{align-items:baseline;display:flex}.cF6QAJf1vXXAMuutXPcq.coY634LconQ7gzDDNJeu{color:var(--jp-gray-10);fill:var(--jp-gray-10)}.cF6QAJf1vXXAMuutXPcq.kyqpwKaL2FyQ8CtxJQ0f{color:var(--jp-green-50);fill:var(--jp-green-50)}.cF6QAJf1vXXAMuutXPcq.aXf37lEOcjpNV8ImLaYK{color:var(--jp-red-40);fill:var(--jp-red-40)}.cF6QAJf1vXXAMuutXPcq .OyGdoGzsQ48VaVVR99_H{left:2px;position:relative;top:2px}.cF6QAJf1vXXAMuutXPcq .cKLicfMCaDSGPlX222jF{font-size:14px;font-weight:600;line-height:24px}.ZaPXoMGC_e8NfFoBgA95,.gb2kSZHPauLu96D9HAIg{margin-bottom:1.5rem}.qpN923qyxjI06NCgFC8j>li{margin-bottom:0}.hpd1bQCLIZYXpZJa22qw{color:var(--jp-gray-100);font-size:var(--font-body-extra-small);font-weight:500;line-height:var(--font-title-small);margin-bottom:calc(var(--spacing-base) + 2px)}@media screen and (min-width:599px)and (max-width:1290px){ul.qpN923qyxjI06NCgFC8j{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}ul.qpN923qyxjI06NCgFC8j>li{grid-column-end:auto}}.value-section{display:flex;justify-content:space-between;margin-top:calc(var(--spacing-base)/2)}.value-section>div{align-items:flex-start;display:flex;flex-direction:column}.value-section__heading{align-items:center;display:flex;text-wrap:nowrap}.value-section__last-scan{align-items:center;column-gap:1px;display:flex;justify-content:flex-end;margin-top:var(--spacing-base);position:absolute;right:calc(var(--spacing-base)*3);width:calc(57% - var(--spacing-base)*3)}.value-section__last-scan div{color:var(--jp-gray-50);font-size:var(--font-body-extra-small);line-height:var(--font-body);text-align:right}@media(max-width:480px){.value-section__last-scan{width:calc(53% - var(--spacing-base)*3)}}.value-section__data{align-items:center;color:var(--jp-gray-50);display:flex;flex:1;font-size:var(--font-body-extra-small);font-weight:500;justify-content:center;line-height:var(--font-title-small)}.value-section__status-icon{display:block;margin-right:calc(var(--spacing-base) - 2px)}.value-section__status-text{letter-spacing:-.24px;margin-right:1px}.scan-threats__threat-count{color:var(--jp-black);font-size:calc(var(--font-title-large) - 4px);font-weight:400;line-height:var(--font-title-large)}.scan-threats__critical-threats{align-items:center;display:flex}.scan-threats__critical-threat-container{margin-left:1px}.scan-threats__critical-threat-container>button>svg{fill:var(--jp-red-50)}.scan-threats__critical-threat-count{color:var(--jp-red-50);margin-left:calc(var(--spacing-base)/4)}.logins_blocked__count{color:var(--jp-black);font-size:calc(var(--font-headline-small) - 4px);font-weight:400;line-height:var(--font-title-large)}.info-tooltip__content{max-width:340px;min-height:150px;padding:24px;width:calc(100vw - 64px)}.videopress-card__video-count{color:var(--jp-gray-90);display:flex;font-size:calc(var(--font-headline-small) - 4px);line-height:1.125;margin-top:calc(var(--spacing-base)/2)}.videopress-card__video-count .videopress-card__tooltip{height:18px}p.description{color:var(--jp-gray-70);font-size:var(--font-body-small);margin:0 0 1rem}.videopress-card__value-section{display:flex;gap:.75rem;justify-content:space-between}.videopress-card__value-section__container{align-items:flex-start;display:flex;flex-direction:column}.videopress-card__value-section__value-container{align-items:flex-end;display:flex;flex-wrap:wrap}.videopress-card__value-section__value{color:var(--jp-gray-90);font-size:calc(var(--font-headline-small) - 4px);line-height:1}.videopress-card__value-section__previous-value{align-items:center;display:flex;font-size:var(--font-body-extra-small);font-weight:600;line-height:18px}.videopress-card__value-section__previous-value.increase *{color:var(--jp-green-50);fill:var(--jp-green-50)}.videopress-card__value-section__previous-value.decrease *{color:var(--jp-red-50);fill:var(--jp-red-50)}.videopress-card__value-section__heading{align-items:center;display:flex;text-wrap:nowrap}.videopress-card__no-video-tooltip .info-tooltip__button{display:inline;vertical-align:middle}.iG63b_J1HNfT8xEIq619{margin-bottom:.75rem}.T8UhA3lZQjpZsyaah9J6{width:200px}@media screen and (min-width:599px)and (max-width:1290px){ul.g69ZGQc9wey1u1beD0IP{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}ul.g69ZGQc9wey1u1beD0IP>li{grid-column-end:auto}}.HeJe1crc9XaWWpLvIPit .components-modal__frame{border-bottom-left-radius:4px;border-left:4px solid #e68b28;border-top-left-radius:4px;max-height:100%}.HeJe1crc9XaWWpLvIPit .components-modal__content{margin-top:0;padding:0}.HeJe1crc9XaWWpLvIPit .components-modal__header{display:none}.HeJe1crc9XaWWpLvIPit .or0JUScxkJPmNsfrxkEK .jp-idc__idc-screen{border:0}.components-surface.components-card{border-radius:var(--jp-border-radius-rna)}.upsell-banner{background:#f9f9f6;background:linear-gradient(133deg,#ced9f2,#f9f9f6 10%,#f9f9f6 80%,#f5e6b3);display:flex;flex-direction:column}@media screen and (min-width:660px){.upsell-banner{flex-direction:row}}.upsell-banner.components-card__body.components-card-body{border-radius:var(--jp-border-radius-rna);padding:36px}.upsell-banner .upsell-banner--icon{align-items:flex-start;display:flex;margin-bottom:16px;margin-right:0;margin-top:16px}@media screen and (min-width:660px){.upsell-banner .upsell-banner--icon{align-items:center;margin-bottom:0;margin-right:28px;margin-top:0}}.upsell-banner .upsell-banner--content{display:flex;flex:1;flex-direction:column;justify-content:space-between}@media screen and (min-width:660px){.upsell-banner .upsell-banner--content{flex-direction:row}}.upsell-banner .upsell-banner--content .upsell-banner--content-info{display:flex;flex-direction:column}.upsell-banner .upsell-banner--content .upsell-banner--content-info h3{font-size:1.5rem;font-weight:500;line-height:32px;margin:0}.upsell-banner .upsell-banner--content .upsell-banner--content-info p{font-size:1rem;margin:8px 0 0}.upsell-banner .upsell-banner--content .upsell-banner--content-cta{align-items:center;display:flex;flex-direction:row;margin-left:0;margin-top:16px}@media screen and (min-width:660px){.upsell-banner .upsell-banner--content .upsell-banner--content-cta{margin-left:16px;margin-top:0}}.upsell-banner .upsell-banner--content .upsell-banner--content-cta .upsell-banner--content-cta-button{box-shadow:inset 0 0 0 1.5px #000;font-weight:400;padding:8px 16px;white-space:nowrap}.upsell-banner .upsell-banner--content .upsell-banner--content-cta .upsell-banner--content-cta-button.secondary{background-color:var(--jp-white);color:var(--jp-black)}.upsell-banner .upsell-banner--content .upsell-banner--content-cta .upsell-banner--content-cta-button.primary{margin-left:8px}.yWUvvF4WJLNDSpMgBMfm{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ka1fVHj2HOkHjhdoEFOZ{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.JMOO4Y_9yhTO9lwLnRUx{grid-column-end:span 1}.PFDPAqk51qox_ChLqJwm{grid-column-end:span 2}.ault0jHVfWpShqOGooIP{grid-column-end:span 3}.GqpvdRzmzPJELtSm4FEN{grid-column-end:span 4}@media(min-width:600px){.Ym4_YneEGD_iZD6W1C2o{grid-column-end:span 1}.NbvHnnDtWw8n9BEUQ0Oy{grid-column-end:span 2}.ElMT7rhxe5ZJKO41MnhW{grid-column-end:span 3}.yKjnqjibn_wW_1tWWt5Q{grid-column-end:span 4}.Pb30lOcQFpzUX57GwflS{grid-column-end:span 5}.pC1wxc_R8y4pNILHsiiY{grid-column-end:span 6}.pChscSCnudQoWGjMFKI_{grid-column-end:span 7}.qw1H2gAgF3lDCI2Tbkmb{grid-column-end:span 8}}@media(min-width:960px){.VzcA_rrxBK3g4ozA0oD9{grid-column-end:span 1}.pNAa7O2adRZD8Slgk9iR{grid-column-end:span 2}.tlIMLlipexblj8CeOx4B{grid-column-end:span 3}.Dvt0u5l2Rr1BhBmvYAzl{grid-column-end:span 4}.BiUsgNTc0tyc7tC5jnzE{grid-column-end:span 5}.ulJXAsj7G2ROJ1g3_s28{grid-column-end:span 6}.HsoVlyVLsXYClx9Atox0{grid-column-end:span 7}.oXxjRQNNj2cfIpFBqC1W{grid-column-end:span 8}.qXgUn4Adg9xE_JnbuDio{grid-column-end:span 9}.xMpqTLiLfYFEJiRPQQQq{grid-column-end:span 10}.IiGo3Sz2FDZN7_eGElwA{grid-column-end:span 11}.Om8BNCjfgqQ_wmPQjfOY{grid-column-end:span 12}}@media(max-width:960px){.t10ZWzP7ADjJnR4tqxRS{display:none}}@media(max-width:600px){.eOUlZG8Pelh_Xj0aSoHG{display:none}}.l546LrwBEePz434NFK5Q{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.l546LrwBEePz434NFK5Q span{display:block}.l546LrwBEePz434NFK5Q span:last-of-type{font-weight:600}.l546LrwBEePz434NFK5Q:focus span:last-of-type,.l546LrwBEePz434NFK5Q:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.l546LrwBEePz434NFK5Q:focus:after,.l546LrwBEePz434NFK5Q:hover:after{transform:translateY(-50%) translateX(8px)}.l546LrwBEePz434NFK5Q:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.Q7w4fcEcemZ2nlwaYNog{fill:var(--jp-yellow-30)!important;display:inline-block!important;width:1.1em!important}.AoNQsOaTt6gSf0H6Yasz{display:inline-block;position:relative}.v13ZwGzUnecPA7Y3URAl{height:18px;left:-53px;pointer-events:none;position:absolute;top:0;width:124px}.EeDbu9pXFWTsCzfTpv2v{pointer-events:all}.BmSvoIi3rErkcrRiOi2W{color:var(--jp-black);font-size:16px;font-weight:600;line-height:19px}.BmSvoIi3rErkcrRiOi2W:not(:last-child){margin-bottom:8px}.mojRoVuWdDJo0E6LEjJw{font-size:14px;font-weight:400;line-height:24px}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-right:-62px}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-left:-62px}.golden-token-icon-tooltip .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.golden-token-icon-tooltip .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.golden-token-icon-tooltip .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;outline:none;padding:24px;white-space:normal;width:304px}.golden-token-icon-tooltip .components-button.is-link:focus:not(:disabled){box-shadow:none}.wiobThfXJCuhGNrbFIT6 a,.wiobThfXJCuhGNrbFIT6 a:active,.wiobThfXJCuhGNrbFIT6 a:hover{color:var(--jp-black)}.VgAxgahF9bC2M__FiIgV{display:flex;margin-bottom:calc(var(--spacing-base)*3)}.dbRwkMLqcMF67njPoAF7{margin-right:8px}.Doju0RxvvN9JS12mf489{line-height:calc(var(--spacing-base)*3);margin:0 0 var(--spacing-base) 0}.Jvb1njqMy7ML1zikhbWn{margin-top:1rem}.mpr8_ygU8woV4bVR1xvw{align-items:center;display:flex;font-size:var(--font-title-small);font-weight:500;line-height:1.5;margin-bottom:.5rem;margin-top:0}.gwO_Q0L0jbwMARVlBezu{color:var(--jp-gray-60);font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:var(--font-body-small);font-weight:400;letter-spacing:-.15px;line-height:20px;margin-left:.75rem}.qwy7CsLeEbXvaPwgC9WV{display:flex;flex-flow:row nowrap;max-width:100%;overflow-x:scroll;padding:1px;scrollbar-width:none}.qwy7CsLeEbXvaPwgC9WV::-webkit-scrollbar{display:none}.qwy7CsLeEbXvaPwgC9WV .Hrbg7DeSJs6gas9zdPDR{border-color:var(--jp-gray-5);border-radius:5px;margin-bottom:0;margin-right:1.5rem;min-width:180px;padding:1rem 1.5rem;width:100%}@media only screen and (min-width:960px){.qwy7CsLeEbXvaPwgC9WV .Hrbg7DeSJs6gas9zdPDR{min-width:220px}}.qwy7CsLeEbXvaPwgC9WV .Hrbg7DeSJs6gas9zdPDR:last-child{margin-right:0}.NFpbo5AINn6I6avKFGby{margin-bottom:1.5rem}.aoQZCG0JeyWmy2J6vVxF{font-weight:500;line-height:20px;margin-bottom:.25rem}.M6ApyXg79vuXo6GwDkbO{align-items:flex-end;display:flex;flex-wrap:wrap;font-size:36px;font-weight:400;line-height:40px}.M6ApyXg79vuXo6GwDkbO.DYHb5e6QhgXejWyo9s78{cursor:pointer}.OlInbY5YnDO06MEQHv98{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:1;margin-right:.5rem}.EtbKbd5m85w7oYT4stIs{color:var(--jp-gray-20);display:none;font-size:var(--font-body-small);font-weight:600;line-height:24px;fill:var(--jp-gray-20)}@media screen and (min-width:960px){.EtbKbd5m85w7oYT4stIs{align-items:center;display:flex}}.EtbKbd5m85w7oYT4stIs.Awr7zl75sfAsFPHK9kDG{color:var(--jp-red-50);fill:var(--jp-red-50)}.EtbKbd5m85w7oYT4stIs.QFSZbIKFdWO3HEPBZyhc{color:var(--jp-green-50);fill:var(--jp-green-50)}.GgJAnS4gaEEGmRCP5n8y{align-content:flex-end;display:flex}.mjiNtwdbKpfo9edGVes4{margin-right:2px}.pAt4v_KG9Ir19wNcEtEj{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:calc(var(--spacing-base)*2.5);min-height:28px;width:100%}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}.jrGNTKcgeXk9HKzolut9{position:relative}.jrGNTKcgeXk9HKzolut9>.wg3mZsoPekZWlBgOvdZ6{overflow:hidden;padding:0}.jrGNTKcgeXk9HKzolut9>.wg3mZsoPekZWlBgOvdZ6.aDxB89WgtARQqNWd4ZeK:before{background-color:var(--jp-red-50);border:2px solid var(--jp-white-off);border-radius:50%;content:"";height:18px;left:-11px;position:absolute;top:-11px;width:18px}.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR{background-color:var(--jp-white);border-radius:50%;box-shadow:0 0 5px 1px rgba(0,0,0,.1);padding:8px;position:absolute;right:16px;top:16px;transform:scale(.75)}.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR:focus,.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR:hover{background-color:var(--jp-white)}.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR:disabled{pointer-events:none}.z5EQSkU36nsjxHEBSfNN{padding:0}.MwBwVaEj6u_zRgfrFR9b{padding:24px 16px}@media screen and (min-width:600){.MwBwVaEj6u_zRgfrFR9b{padding:32px 24px}}@media screen and (min-width:960px){.MwBwVaEj6u_zRgfrFR9b{padding:48px 12px 48px 48px}}.UgPNtuFW7lTJ06k39EsK{background-image:url(images/evaluation-blank-fbbfbcd75b50ade0f092.png),radial-gradient(circle at 40% 70%,rgba(206,217,242,.75) 0,hsla(0,0%,100%,0) 40%),radial-gradient(circle at 80% 80%,rgba(6,158,8,.15) 5%,hsla(0,0%,100%,0) 50%),radial-gradient(circle at 80% 20%,hsla(46,77%,83%,.75) 0,hsla(0,0%,100%,0) 50%);background-position:75%;background-repeat:no-repeat;background-size:393px,cover,cover,cover}.UgPNtuFW7lTJ06k39EsK.ilVOud0_OCGK4HciazB_{background-image:url(images/evaluation-selected-196d1790b76830f9b73a.png),radial-gradient(circle at 40% 70%,rgba(206,217,242,.75) 0,hsla(0,0%,100%,0) 40%),radial-gradient(circle at 80% 80%,rgba(6,158,8,.15) 5%,hsla(0,0%,100%,0) 50%),radial-gradient(circle at 80% 20%,hsla(46,77%,83%,.75) 0,hsla(0,0%,100%,0) 50%)}.EtcggGK0Bk8POQD986Og{background-image:url(images/site-cards-29522f090d5422fd7afd.png),radial-gradient(circle at 90% 30%,rgba(6,158,8,.15) 0,hsla(0,0%,100%,0) 35%),radial-gradient(circle at 75% 65%,rgba(206,217,242,.5) 5%,hsla(0,0%,100%,0) 15%),radial-gradient(circle at 90% 90%,hsla(46,77%,83%,.5) 0,hsla(0,0%,100%,0) 25%);background-repeat:no-repeat;background-size:cover}@media screen and (max-width:960px){.EtcggGK0Bk8POQD986Og{background-image:url(images/site-cards-29522f090d5422fd7afd.png),radial-gradient(circle at 55% 30%,rgba(6,158,8,.15) 0,hsla(0,0%,100%,0) 100%),radial-gradient(circle at 25% 40%,rgba(206,217,242,.5) 5%,hsla(0,0%,100%,0) 50%),radial-gradient(circle at 50% 85%,hsla(46,77%,83%,.3) 0,hsla(0,0%,100%,0) 35%);min-height:160px;order:-1}}.TSiu5sC6MdANROjUkUJM{margin-top:24px}.iqJfpZM9IYXuFSXvuoEe{font-size:16px!important;margin-top:16px}.Vozbq8Inlk5SxoVnn2G5{column-gap:40px;display:flex;flex-direction:row;margin-top:64px}.s_V1BM1Wtt3He4eF2TCu{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3);text-decoration:none!important}.wXWt0uFLFkFT7CqgOijQ{align-items:center;background-image:radial-gradient(circle at 80% 80%,rgba(6,158,8,.15) 5%,hsla(0,0%,100%,0) 50%);background-position:100% 80%;background-repeat:no-repeat;background-size:cover;display:flex;flex-direction:column;justify-content:center;padding:144px 0}.m_muvynofDds3hoh9u5m{margin-bottom:24px}.m_muvynofDds3hoh9u5m svg{color:var(--jp-green-40);height:48px;width:48px}.m_muvynofDds3hoh9u5m svg circle{stroke:var(--jp-green-5)}.m_muvynofDds3hoh9u5m svg circle,.m_muvynofDds3hoh9u5m svg path{stroke-width:4px}.jErCC9oKHSM15BxzFyQK{margin-bottom:0}.oVoYbwbFB6U2o90Njusk>div{background-color:var(--jp-white);font-size:16px;line-height:22px;margin:0;position:relative}.oVoYbwbFB6U2o90Njusk>div .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}@media screen and (min-width:960px){.oVoYbwbFB6U2o90Njusk>div .components-notice__content{gap:6rem}}.oVoYbwbFB6U2o90Njusk>div .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.oVoYbwbFB6U2o90Njusk>div .components-notice__dismiss{align-self:center}.oVoYbwbFB6U2o90Njusk>div .components-notice__action{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;height:auto;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-left:0;margin-top:24px;padding:8px 24px;text-decoration:none}@media screen and (min-width:960px){.oVoYbwbFB6U2o90Njusk>div .components-notice__action{margin-left:calc(var(--spacing-base)*2 + 24px)}}.oVoYbwbFB6U2o90Njusk>div.Snc8NEmDelsbhlH4285s .components-notice__action{margin-left:0;margin-top:0;white-space:nowrap}.oVoYbwbFB6U2o90Njusk>div.Snc8NEmDelsbhlH4285s .components-notice__content{align-items:center;flex-direction:row}.oVoYbwbFB6U2o90Njusk .R5tvcsARTGN0A_z3DygA{min-width:auto}.wBVXH4OTNwLHPRpN4nsq{display:flex;flex-grow:1;margin-right:var(--spacing-base)}.wBVXH4OTNwLHPRpN4nsq .terms-of-service{color:var(--jp-gray-70);font-size:var(--font-body-small)}.wBVXH4OTNwLHPRpN4nsq>svg{fill:var(--jp-red-60);align-self:flex-start;flex-shrink:0;margin-right:calc(var(--spacing-base)*2)}.wBVXH4OTNwLHPRpN4nsq>svg.F1qvEnFfHs5nz3zFZUOV{fill:none}.SrQxAOBa5ZaSKP8wlut9{border-bottom:none;margin:0}.TcCZnGE6mad8Dvz9pCZi{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+PHBhdGggc3Ryb2tlPSIjRDYzNjM5IiBzdHJva2Utd2lkdGg9IjEuNSIgZD0iTTEyIDIwYTggOCAwIDEgMCAwLTE2IDggOCAwIDAgMCAwIDE2WiIvPjxwYXRoIGZpbGw9IiNENjM2MzkiIGQ9Ik0xMyA3aC0ydjZoMnpNMTMgMTVoLTJ2MmgyeiIvPjwvc3ZnPg==) no-repeat 0 0;color:var(--jp-red);line-height:25px;padding-left:25px}._mn6o2Dtm5pfFWc8_A1K{--spacing-base:8px;min-width:264px}.VHYulMcpzbr10HWR0iSE{align-items:flex-start;border:1px solid var(--jp-black);border-color:var(--jp-gray-5);border-left-width:6px;border-radius:4px;display:flex;font-size:var(--font-body);padding:24px 31px 27px 18px}.FGpSkMCiIHQjszcV0dbn{margin-right:20px}.FGpSkMCiIHQjszcV0dbn,.KoWZcCwhW13xvkEb0QON{height:calc(var(--spacing-base)*3);width:calc(var(--spacing-base)*3)}.KoWZcCwhW13xvkEb0QON{background-color:transparent;border:none;cursor:pointer;outline:none}@media screen and (max-width:600px){.VHYulMcpzbr10HWR0iSE{box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);padding-top:68px;position:relative}.FGpSkMCiIHQjszcV0dbn{left:24px;position:absolute;top:24px}.KoWZcCwhW13xvkEb0QON{position:absolute;right:24px;top:24px}}.smrfczkC53EaFM8OJUXs{flex-grow:1}.IKYRWoPwt9xOVEx1wzNS{font-weight:600;margin-bottom:8px}.qM0qY6mPYp1MPN54A3Kg{align-items:center;display:flex;margin-top:20px}.qM0qY6mPYp1MPN54A3Kg a,.qM0qY6mPYp1MPN54A3Kg a:active,.qM0qY6mPYp1MPN54A3Kg a:focus,.qM0qY6mPYp1MPN54A3Kg a:hover{color:var(--jp-black)}.qM0qY6mPYp1MPN54A3Kg>*{margin-right:24px}.A5YkDkkXuiYgavrY6Nux{border-left-color:var(--jp-red)}.A5YkDkkXuiYgavrY6Nux .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-red)}.cT5rwuPMZzWvi5o6shMl{border-left-color:var(--jp-yellow-20)}.cT5rwuPMZzWvi5o6shMl .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-yellow-20)}.yo0O3uvNomPsYUXFCpAS{border-left-color:var(--black)}.yo0O3uvNomPsYUXFCpAS .y_IPyP1wIAOhyNaqvXJq{fill:var(--black)}.oZdDFf1jBLkzn5ICCC6x{border-left-color:var(--jp-green)}.oZdDFf1jBLkzn5ICCC6x .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-green)}.cAbGtJDGgLubucBnz7vM,.q0T8YyQxRawhpDtvJjxI{background-color:var(--jp-white)}.q0T8YyQxRawhpDtvJjxI{height:100%;padding:calc(var(--spacing-base)*8);position:relative}.B7JDqI_vtKxSy5GjvqA1{display:flex;flex-direction:column;height:100%}.zj7xadmhIWeuf7ZwvVTS{align-items:center;background:var(--jp-black);border-radius:var(--jp-border-radius) var(--jp-border-radius) 0 0;color:var(--jp-white);display:flex;height:calc(var(--spacing-base)*4);left:0;padding:0 var(--spacing-base);position:absolute;top:0;width:100%}.GsioW6IsC8EMYE3U6788{fill:var(--jp-white);margin-right:var(--spacing-base)}.cfEO8udWbRGPFJzW8Jg5,.dbz07JqxOlivjKO4vBEF{align-items:center;display:flex;height:calc(var(--spacing-base)*4);margin-bottom:calc(var(--spacing-base)*4)}.zlh3zbjUe4Z8cBs7uVVe{fill:#8c8f94;height:24px;line-height:24px}.qoZuzG5EcDa231hC6t0P{align-items:center;display:flex;justify-content:center}.qoZuzG5EcDa231hC6t0P svg{margin-right:var(--spacing-base)}.Q6uUUQCPWS6_6nLxIn68{display:inline-block;min-height:42px;padding:.5em 2em;text-align:center;width:100%}.Q6uUUQCPWS6_6nLxIn68 .YU4iBCRze09ZP3iCsdcb{margin:0}.Q6uUUQCPWS6_6nLxIn68.components-button.is-primary{height:auto;white-space:normal}.Q6uUUQCPWS6_6nLxIn68.is-secondary:hover:not(:disabled){background-color:var(--jp-black);color:var(--jp-white)}.OrQG7DjDd9Ha2Xj1Mx3L{margin-top:calc(var(--spacing-base)*2)}.Q1jaYDpa2AVfJpA29wT0{flex-grow:1;margin:0;margin-bottom:calc(var(--spacing-base)*2);padding:0}.Q1jaYDpa2AVfJpA29wT0 li{align-items:flex-start;display:flex;list-style:none;margin-bottom:var(--spacing-base)}.Q1jaYDpa2AVfJpA29wT0 svg{fill:var(--jp-green-primary);flex-shrink:0;margin-right:var(--spacing-base)}.HL4gSxsF0skYGhGuqH90 li:last-of-type{font-weight:700}.sEcLfpWjo0GF7QrxD3Lt{margin-top:calc(var(--spacing-base)*2)}.xgv3jRkeF39aEQELCwru{align-items:flex-end;color:var(--jp-black);display:flex;flex-wrap:wrap}.twlleZ5Ehq4bB7CvKVSW{position:relative}.twlleZ5Ehq4bB7CvKVSW:first-child{margin-right:calc(var(--spacing-base)*2)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8{color:var(--jp-gray-20)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.ApsgxIornVy_3KnciVeJ{color:var(--jp-gray-40);margin-bottom:calc(var(--spacing-base)*3)}.NMxcZL17aEP7v81uG3zD{margin-top:calc(var(--spacing-base)*5)}.gCTKfAPzJqZas7CaRbKN{margin-bottom:calc(var(--spacing-base)*4)}.demNsMJjhi7BLY7xhjU5{align-items:center;display:flex;font-size:var(--font-body);line-height:calc(var(--spacing-base)*3);margin:calc(var(--spacing-base)*2) 0;min-height:calc(var(--spacing-base)*3)}.QiUjdjJSkqh6nH7YMG5A{align-self:flex-start;height:calc(var(--spacing-base)*3);margin-right:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*3)}.Q080AHcq29J2fc68Hhk5{color:var(--jp-red)}.Q080AHcq29J2fc68Hhk5 .hYWbIwhppukXmGnsiT9H{fill:var(--jp-red)}.JjHuxWly0HI9C60gorbq{color:var(--jp-yellow-40)}.JjHuxWly0HI9C60gorbq .hYWbIwhppukXmGnsiT9H{fill:var(--jp-yellow-40)}.Cm8ZFHi3mngl4cj9Gatx{color:var(--jp-blue-40)}.Cm8ZFHi3mngl4cj9Gatx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-blue-40)}.ytGBsU015p3LGwOPwFDx{color:var(--jp-green)}.ytGBsU015p3LGwOPwFDx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-green)}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-5:#f5e6b3;--jp-yellow-10:#f2cf75;--jp-yellow-40:#c08c00;--jp-orange-20:#faa754;--jp-blue-5:#ced9f2;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-border-radius-rna:8px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px;--jp-highlight:#3858e9}:where(body){font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-right:-62px}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-left:-62px}.icon-tooltip-helper .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.icon-tooltip-helper .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.icon-tooltip-helper.is-wide .components-popover__content{width:440px}.icon-tooltip-wrapper{color:var(--jp-black);display:inline-block;position:relative}.icon-tooltip-wrapper .components-button.is-link:focus:not(:disabled){box-shadow:none}.icon-tooltip-helper{height:18px;left:-53px;pointer-events:none;position:absolute;top:0;width:124px}.icon-tooltip-container{pointer-events:all}.icon-tooltip-container .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;margin:0 10px;max-width:90vw;outline:none;padding:24px;white-space:normal;width:304px}.icon-tooltip-title{font-size:16px;font-weight:600;line-height:19px}.icon-tooltip-title:not(:last-child){margin-bottom:8px}.icon-tooltip-content{font-size:14px;font-weight:400;line-height:24px}.icon-tooltip-content ul{list-style-type:disc;margin:0 0 0 1rem}.icon-tooltip-content ul li:last-child{margin-bottom:0}.p4qz2tkq0p9hxucJ6Qk2{--padding:calc(var(--spacing-base)*4);color:var(--jp-black)}.lbNDyXioOwvyvbALtCBm{--gap:calc(var(--spacing-base)*3);padding:var(--padding) 0;position:relative}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm{column-gap:var(--gap);display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--columns),1fr);grid-template-rows:repeat(var(--rows),minmax(min-content,max-content))}.cLaNK_XcbTGlRQ4Tp43Q{margin-top:var(--padding)}.s2Lsn4kbm6BrS3DSndRB .cLaNK_XcbTGlRQ4Tp43Q{display:contents}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>*{background:var(--jp-white);position:relative}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>:after{bottom:0;box-shadow:0 4px 24px rgba(0,0,0,.05);content:"";left:0;position:absolute;right:0;top:0;z-index:-1}.cLaNK_XcbTGlRQ4Tp43Q>:first-child{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius);border-width:1px 1px 0}.cLaNK_XcbTGlRQ4Tp43Q>:last-child{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius);border-width:0 1px 1px}.DAkZc1P9A3K12fjEliMg{display:flex;flex-direction:column;justify-content:space-between;padding:var(--padding)}.WUBuYABl8nymjs9NnCEL{align-items:center;display:flex;padding-bottom:calc(var(--spacing-base)*2);position:relative}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)){padding-top:calc(var(--spacing-base)*2)}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{background-color:var(--jp-gray);content:"";height:1px;left:var(--padding);position:absolute;right:var(--padding);top:0;z-index:5}.s2Lsn4kbm6BrS3DSndRB .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{left:0;right:unset;width:calc(100% + var(--gap))}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm>:last-child .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{width:100%}.ANtCFeb41NhA8PA3H7ZN,.WUBuYABl8nymjs9NnCEL:last-of-type{padding-bottom:var(--padding)}.Ql2gy_148yW8Vw5vhaKD{padding-left:var(--padding);padding-right:var(--padding)}.EAQrAnQEW1z1BfdY5gbC{margin:0 var(--spacing-base);fill:var(--jp-gray);flex-shrink:0}.EAQrAnQEW1z1BfdY5gbC.JDSTlLoOC_4aUoH2oNM2{fill:var(--jp-green-40)}.EAQrAnQEW1z1BfdY5gbC.zNdQRJ1w7BvaQOYyqzHK{fill:var(--jp-red-50)}.lr7vbX95SKtoe7DarJcZ{margin-left:auto}.s2Lsn4kbm6BrS3DSndRB .lr7vbX95SKtoe7DarJcZ{margin:0 var(--spacing-base);top:1px}.WUBuYABl8nymjs9NnCEL .KRrGp2xdkeBOxLZeuQ6X{fill:var(--jp-gray-20);flex-shrink:0}.H_ZJiRVJg0LiMXPGOcmt{text-align:center;width:fit-content}.H_ZJiRVJg0LiMXPGOcmt>a{color:#000}.s2Lsn4kbm6BrS3DSndRB .H_ZJiRVJg0LiMXPGOcmt{grid-column:2;overflow:hidden;padding-left:var(--padding);padding-right:var(--padding);white-space:nowrap}.x21z_DixObRDsDaWotP1{align-items:right;display:flex;justify-content:right;margin:0 calc(var(--spacing-base)*4)}.dovianZYLKhnbnh9I06o{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-end}.lljtQMhW7lq5tE5SDJEf{align-items:flex-start;display:flex;flex-basis:0;flex-grow:2}.lljtQMhW7lq5tE5SDJEf .NubApIV1vQCRUNprfm6b{margin-left:auto}.dhFQXpZfMwVI8vuYHnwC{align-items:flex-start;display:inline-flex;flex:0 0 auto;position:relative}.dhFQXpZfMwVI8vuYHnwC:first-child{margin-right:calc(var(--spacing-base)*2)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k{color:var(--jp-gray-20)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.C64ZjjUAqJC1T2Sa7apS{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start;margin-bottom:calc(var(--spacing-base)*3)}.UpZDGew6Ay1hPoP6eI7b{color:var(--jp-gray-40);font-size:var(--font-body-small);line-height:20px}.UpZDGew6Ay1hPoP6eI7b:after{content:"​"}.NubApIV1vQCRUNprfm6b{background-color:var(--jp-yellow-10);border-radius:4px;font-size:13px;font-weight:600;margin-left:var(--spacing-base);padding-left:var(--spacing-base);padding-right:var(--spacing-base)}.TDiiPbuW1Z0_05u_pvcK{font-weight:400}.SWwV4Pw6OZ5vU3PqPXmr{--product-card-shadow:rgb(0 0 0/3%);background-color:var(--jp-white);border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);box-shadow:0 2px 6px var(--product-card-shadow),0 1px 2px var(--product-card-shadow)}.r7tUofa9Z3A5ziKVR1H7{align-items:center;display:flex}.r7tUofa9Z3A5ziKVR1H7 img{object-fit:cover;width:100%}.i_AnOR3MaQLraGvb2QU5{background-color:#f9f9f6}.YcYvLvdvWrb1EUZoVsE8{display:flex;flex-wrap:wrap;gap:calc(var(--horizontal-spacing)*2);justify-content:space-between}.uGTTsKoIOoZdYhk6uPnl{white-space:nowrap}.uGTTsKoIOoZdYhk6uPnl>span{font-size:var(--font-body-small)}.NzDTsxhX8D1mlckNpewR{font-weight:400!important}.svE2cJL5t2FarzcDQYNe{--product-card-shadow:rgb(0 0 0/3%);background-color:var(--jp-white);border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);box-shadow:0 2px 6px var(--product-card-shadow),0 1px 2px var(--product-card-shadow)}.dvEJEDNTnmVfVxtLa4uU{align-items:center;display:flex}.dvEJEDNTnmVfVxtLa4uU img{object-fit:cover;width:100%}.K1VY4DNP8PHMWAEVBC_h{background-color:#f9f9f6}.nk_COGPrkBNLp7lVt4sQ{display:flex;flex-wrap:wrap;gap:calc(var(--horizontal-spacing)*2);justify-content:space-between}.ukgQ5TmLablG3svUKjdw{white-space:nowrap}.ukgQ5TmLablG3svUKjdw>span{font-size:var(--font-body-small)}.Vofm70ADXSe43GamWEaF{font-weight:400!important}.EUcF2LKeC2GyhWD2FKCP{background-color:var(--jp-white);height:100%;padding:calc(var(--spacing-base)*8);position:relative}.Bm21LIBQtpRo3ZhOxXBG{display:flex;gap:calc(var(--spacing-base)*2)}.jwIGzADCnBI_ai9xYYiS{align-items:center;display:flex;flex-wrap:nowrap;font-size:22px;padding-bottom:calc(var(--spacing-base)*3);padding-top:calc(var(--spacing-base)*3)}.jwIGzADCnBI_ai9xYYiS .fTbxuhh_SfMgenyWvGN0{padding-bottom:calc(var(--spacing-base)/3);padding-left:var(--spacing-base)}.eR56lApoP14RIBAhO1UN{display:flex;flex-wrap:wrap;gap:calc(var(--spacing-base)*6);justify-content:space-between;margin:0 auto;max-width:1128px}@media only screen and (max-width:1366px){.eR56lApoP14RIBAhO1UN{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3)}}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD{display:flex;flex:1;flex-direction:column;justify-content:center}@media screen and (min-width:960px){.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD{max-width:70%}}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD .vAGLpjIGi6GA8ghbumN7{font-size:36px;font-weight:700;line-height:40px}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD .oag8YaslCEiUVu8GKKL3{font-weight:400;margin:calc(var(--spacing-base)*3) 0}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD .FhH03GPt9FK1VH9NZhYA{align-self:flex-start;font-size:16px;font-weight:500;letter-spacing:-.01em;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.eR56lApoP14RIBAhO1UN .VUXAtah2JvUCNc4cXjPp{align-items:center;display:flex;flex-wrap:wrap;gap:calc(var(--spacing-base)*3);justify-content:flex-end}@media only screen and (max-width:430px){.eR56lApoP14RIBAhO1UN .VUXAtah2JvUCNc4cXjPp{flex:1}}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw{border-color:var(--jp-gray-5);border-radius:5px;flex-grow:0;height:168px;margin-bottom:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);width:168px}@media only screen and (max-width:960px){.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw{width:30vw}}@media only screen and (max-width:430px){.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw{min-width:168px;width:100%}}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw>div:first-child{display:flex;flex-direction:column;justify-content:space-between}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw .Ll1l9bEuf5G5oh3AENep{fill:var(--jp-green)}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw .WrzTysWiqUiuEPvpFqau{margin-bottom:var(--spacing-base)}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw .d4faYkf9yL7oW7pwcjmP{font-size:36px;font-weight:700}.acffvOSYc5S8x4P_AYnQ{font-size:16px;line-height:24px;padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6)}.acffvOSYc5S8x4P_AYnQ:first-child{padding-bottom:0;padding-top:0}.acffvOSYc5S8x4P_AYnQ:nth-child(2n){background-color:var(--jp-white-off);padding-bottom:calc(var(--spacing-base)*8);padding-top:calc(var(--spacing-base)*8)}@media only screen and (max-width:960px){.acffvOSYc5S8x4P_AYnQ:nth-child(2n){padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6)}}.acffvOSYc5S8x4P_AYnQ a{color:inherit}.acffvOSYc5S8x4P_AYnQ .M5YNmgy60Q_UtaxKgQcv{margin:0 auto;max-width:744px}@media only screen and (max-width:1366px){.acffvOSYc5S8x4P_AYnQ .M5YNmgy60Q_UtaxKgQcv{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3)}}.acffvOSYc5S8x4P_AYnQ .HJiOvun8sHkiFpNL0sl6{margin:0 auto;max-width:1128px}@media only screen and (max-width:1366px){.acffvOSYc5S8x4P_AYnQ .HJiOvun8sHkiFpNL0sl6{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3)}}.acffvOSYc5S8x4P_AYnQ .mXinUJfpSTS9EVB8M8K_{font-size:34px;font-weight:400;line-height:40px;margin:0}.acffvOSYc5S8x4P_AYnQ .QKjsnliPyLu4n08yVUUM{font-size:16px}.acffvOSYc5S8x4P_AYnQ .xQJJkJ4v7Jm8iSJ0z0Dj{font-size:48px;line-height:24px;margin-bottom:calc(var(--spacing-base)*6)}.VWIBGwuHqtAKg_5Hch92{flex-direction:column}.VWIBGwuHqtAKg_5Hch92,.VWIBGwuHqtAKg_5Hch92 .mnkNhprYIatxfziERMwM{display:flex;gap:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2) 0}.VWIBGwuHqtAKg_5Hch92 .mnkNhprYIatxfziERMwM{flex-wrap:wrap;min-height:190px}.VWIBGwuHqtAKg_5Hch92 .WEiaYLqJwV2IzC8LD9Fs{background-color:var(--jp-white-off);border-radius:calc(var(--spacing-base)/2);height:157.5px;width:280px}.VWIBGwuHqtAKg_5Hch92 .WEiaYLqJwV2IzC8LD9Fs iframe{border-radius:inherit}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU{display:flex;flex:1;flex-direction:column;gap:var(--spacing-base);min-width:280px}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU ._OeUvI9GrP00qh6Uk7Tg{font-size:20px;font-weight:500;line-height:22px}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU .C6I5jYHW2IJSDBoKvhcB{color:var(--jp-gray-60);flex-grow:1;font-size:16px;font-weight:300;line-height:24px}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU .XdnAdAwkxAW5yvUx3NRr{font-size:15px;padding-left:0;text-decoration:underline}.MCKgMfLVZtkgWu5m5u6L{margin-bottom:calc(var(--spacing-base)*8)}.c0SItK48SRkWfZUCECbZ{border:1px solid var(--jp-green-40);border-radius:4px;color:var(--jp-green-40);font-size:12px;font-weight:500;height:22px;margin-left:5px;padding:2px 8px;position:relative;text-transform:uppercase;top:-2px}#my-jetpack-container{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);height:100%}#my-jetpack-container .jp-dashboard-footer__jetpack-symbol{height:16px}#wpbody-content>.notice{display:none!important}#wpwrap{background-color:var(--jp-white-off)}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js new file mode 100644 index 00000000..94521512 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js @@ -0,0 +1,97 @@ +/*! For license information please see index.js.LICENSE.txt */ +(()=>{var e={1792:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(790),c=a(1609);const r={isEligible:!0};function s(e){const t=(t,a={})=>{const n={...r,...a},[,s]=(0,c.useReducer)((e=>e+1),0),i=(0,c.useRef)(t);if((0,c.useEffect)((()=>{let a=!0;return n.isEligible&&e.loadExperimentAssignment(t).then((()=>{a&&s()})),()=>{a=!1}}),[t,n.isEligible]),t===i.current||i.current.startsWith("explat_test")||e.config.logError({message:"[ExPlat] useExperiment: experimentName should never change between renders!"}),!n.isEligible)return[!1,null];const l=e.dangerouslyGetMaybeLoadedExperimentAssignment(t);return[!l,l]};return{useExperiment:t,Experiment:({defaultExperience:e,treatmentExperience:a,loadingExperience:c,name:r,options:s})=>{const[i,l]=t(r,s);return i?(0,n.jsx)(n.Fragment,{children:c}):l?.variationName?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(n.Fragment,{children:e})},ProvideExperimentData:({children:e,name:a,options:n})=>{const[c,r]=t(a,n);return e(c,r)}}}},9517:(e,t,a)=>{"use strict";a.d(t,{kU:()=>o,pg:()=>u});var n=a(1689),c=a(2808),r=a(4738),s=a(524),i=a(5626);const l=1e4;Error;function o(e){if("undefined"==typeof window)throw new Error("Running outside of a browser context.");const t={},a=(...t)=>{try{e.logError(...t)}catch(e){}};try{(0,n.bZ)()}catch(e){a({message:e.message,source:"removeExpiredExperimentAssignments-error"})}return{loadExperimentAssignment:async o=>{try{if(!i.Eo(o))throw new Error(`Invalid experimentName: "${o}"`);const a=(0,n.B1)(o);if(a&&c.H2(a))return a;void 0===t[o]&&(t[o]=(t=>s.MC((async()=>{const a=await r.FI(e,t);return(0,n.a2)(a),a})))(o));let u=l;Math.random()>.5&&(u=5e3);const m=await s.BK(t[o](),u);if(!m)throw new Error("Could not fetch ExperimentAssignment");return m}catch(e){a({message:e.message,experimentName:o,source:"loadExperimentAssignment-initialError"})}try{const e=(0,n.B1)(o);if(e)return e;const t=(0,c.fj)(o);return(0,n.a2)(t),t}catch(e){return a({message:e.message,experimentName:o,source:"loadExperimentAssignment-fallbackError"}),(0,c.fj)(o)}},dangerouslyGetExperimentAssignment:t=>{try{if(!i.Eo(t))throw new Error(`Invalid experimentName: ${t}`);const c=(0,n.B1)(t);if(!c)throw new Error("Trying to dangerously get an ExperimentAssignment that hasn't loaded.");return e.isDevelopmentMode&&c&&s.XZ()-c.retrievedTimestamp<1e3&&a({message:"Warning: Trying to dangerously get an ExperimentAssignment too soon after loading it.",experimentName:t,source:"dangerouslyGetExperimentAssignment"}),c}catch(n){return e.isDevelopmentMode&&a({message:n.message,experimentName:t,source:"dangerouslyGetExperimentAssignment-error"}),(0,c.fj)(t)}},dangerouslyGetMaybeLoadedExperimentAssignment:t=>{try{if(!i.Eo(t))throw new Error(`Invalid experimentName: ${t}`);const e=(0,n.B1)(t);return e||null}catch(n){return e.isDevelopmentMode&&a({message:n.message,experimentName:t,source:"dangerouslyGetMaybeLoadedExperimentAssignment-error"}),(0,c.fj)(t)}},config:e}}function u(e){return{loadExperimentAssignment:async t=>(e.logError({message:"Attempting to load ExperimentAssignment in SSR context",experimentName:t}),(0,c.fj)(t)),dangerouslyGetExperimentAssignment:t=>(e.logError({message:"Attempting to dangerously get ExperimentAssignment in SSR context",experimentName:t}),(0,c.fj)(t)),dangerouslyGetMaybeLoadedExperimentAssignment:t=>(e.logError({message:"Attempting to dangerously get ExperimentAssignment in SSR context",experimentName:t}),(0,c.fj)(t)),config:e}}},2226:(e,t,a)=>{"use strict";a.d(t,{k:()=>c});var n=a(9517);const c="undefined"==typeof window?n.pg:n.kU},1689:(e,t,a)=>{"use strict";a.d(t,{B1:()=>o,a2:()=>l,bZ:()=>p});var n=a(2808),c=a(2765),r=a(5626);const s="explat-experiment-",i=e=>`${s}-${e}`;function l(e){r.zV(e);const t=o(e.experimentName);if(t&&e.retrievedTimestamp[...Array(e).keys()];function m(e){return e.startsWith(s)}function d(e){return e.slice(s.length+1)}function p(){u(c.A.length).map((e=>c.A.key(e))).filter(m).map(d).filter((e=>{try{if(n.H2(o(e)))return!1}catch(e){}return!0})).map(i).map((e=>c.A.removeItem(e)))}},2808:(e,t,a)=>{"use strict";a.d(t,{H2:()=>c,fj:()=>s,fn:()=>r});var n=a(524);function c(e){return n.XZ()({experimentName:e,variationName:null,retrievedTimestamp:n.XZ(),ttl:Math.max(r,t),isFallbackExperimentAssignment:!0})},2765:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});let n={_data:{},setItem:function(e,t){this._data[e]=t},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:null},removeItem:function(e){delete this._data[e]},clear:function(){this._data={}},get length(){return Object.keys(this._data).length},key:function(e){const t=Object.keys(this._data);return e in t?t[e]:null}};try{window.localStorage&&(n=window.localStorage)}catch(e){}const c=n},4738:(e,t,a)=>{"use strict";a.d(t,{FI:()=>m});var n=a(2808),c=a(2765),r=a(524),s=a(5626);function i(e){if(function(e){return(0,s.Gv)(e)&&(0,s.Gv)(e.variations)&&"number"==typeof e.ttl&&0{const t=await e();if(t)return c.A.setItem(l,t),c.A.setItem(o,String((0,r.XZ)())),t;const a=c.A.getItem(l),n=c.A.getItem(o);return a&&n&&(0,r.XZ)()-parseInt(n,10)<864e5?a:null};async function m(e,t){const a=(0,r.XZ)(),{variations:c,ttl:l}=i(await e.fetchExperimentAssignment({anonId:await u(e.getAnonId),experimentName:t})),o=Math.max(n.fn,l),m=Object.entries(c).map((([e,t])=>({experimentName:e,variationName:t,retrievedTimestamp:a,ttl:o}))).map(s.zV);if(m.length>1)throw new Error("Received multiple experiment assignments while trying to fetch exactly one.");if(0===m.length)return n.fj(t,o);const d=m[0];if(d.experimentName!==t)throw new Error("Newly fetched ExperimentAssignment's experiment name does not match request.");if(!n.H2(d))throw new Error("Newly fetched experiment isn't alive.");return d}},524:(e,t,a)=>{"use strict";a.d(t,{BK:()=>s,If:()=>n,MC:()=>i,XZ:()=>r});const n=1e3;let c=Date.now();function r(){const e=Date.now();return c=csetTimeout((()=>a(new Error(`Promise has timed-out after ${t}ms.`))),t)))])}function i(e){let t=null;return()=>(t||(t=e().finally((()=>{t=null}))),t)}},5626:(e,t,a)=>{"use strict";function n(e){return"object"==typeof e&&null!==e}function c(e){return"string"==typeof e&&""!==e&&/^[a-z0-9_]*$/.test(e)}function r(e){if(!function(e){return n(e)&&c(e.experimentName)&&(c(e.variationName)||null===e.variationName)&&"number"==typeof e.retrievedTimestamp&&"number"==typeof e.ttl&&0!==e.ttl}(e))throw new Error("Invalid ExperimentAssignment");return e}a.d(t,{Eo:()=>c,Gv:()=>n,zV:()=>r})},9826:(e,t,a)=>{"use strict";a.d(t,{i:()=>c});const n={AED:{symbol:"د.إ.‏",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.‏",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.‏",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.‏",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.‏",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.‏",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.‏",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.‏",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.‏",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.‏",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£‏",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.‏",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function c(e){return n[e]||{symbol:"$",grouping:",",decimal:".",precision:2}}},7397:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>r,vA:()=>s});var n=a(9826),c=a(8506);function r(e,t,a={}){const r=(0,n.i)(t);if(!r||isNaN(e))return null;const{decimal:s,grouping:i,precision:l,symbol:o}={...r,...a},u=e<0?"-":"";let m=(0,c.A)(Math.abs(e),l,s,i);return a.stripZeros&&(m=function(e,t){const a=new RegExp(`\\${t}0+$`);return e.replace(a,"")}(m,s)),`${u}${o}${m}`}function s(e,t,a={}){const r=(0,n.i)(t);if(!r||isNaN(e))return null;const{decimal:s,grouping:i,precision:l,symbol:o}={...r,...a},u=e<0?"-":"",m=Math.abs(e),d=Math.floor(m);return{sign:u,symbol:o,integer:(0,c.A)(m,l,s,i).split(s)[0],fraction:l>0?(0,c.A)(m-d,l,s,i).slice(1):""}}},8506:(e,t,a)=>{"use strict";function n(e,t=0,a=".",n=","){const c=(e+"").replace(/[^0-9+\-Ee.]/g,""),r=isFinite(+c)?+c:0,s=isFinite(+t)?Math.abs(t):0,i=(s?function(e,t){const a=Math.pow(10,t);return""+(Math.round(e*a)/a).toFixed(t)}(r,s):""+Math.round(r)).split(".");return i[0].length>3&&(i[0]=i[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,n)),(i[1]||"").lengthn})},6992:(e,t,a)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tm,Gh:()=>V,HS:()=>P,Rr:()=>d,TM:()=>s,V1:()=>i,pX:()=>F,pb:()=>z,rc:()=>c,sd:()=>L,tH:()=>I,ue:()=>v}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(c||(c={}));const r="popstate";function s(e){return void 0===e&&(e={}),h((function(e,t){let{pathname:a="/",search:n="",hash:c=""}=d(e.location.hash.substr(1));return u("",{pathname:a,search:n,hash:c},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let a=e.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let t=e.location.href,a=t.indexOf("#");n=-1===a?t:t.slice(0,a)}return n+"#"+("string"==typeof t?t:m(t))}),(function(e,t){l("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function i(e,t){if(!1===e||null==e)throw new Error(t)}function l(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function o(e){return{usr:e.state,key:e.key}}function u(e,t,a,c){return void 0===a&&(a=null),n({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?d(t):t,{state:a,key:t&&t.key||c||Math.random().toString(36).substr(2,8)})}function m(e){let{pathname:t="/",search:a="",hash:n=""}=e;return a&&"?"!==a&&(t+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function d(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substr(a),e=e.substr(0,a));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function p(e){let t="undefined"!=typeof window&&void 0!==window.location&&"null"!==window.location.origin?window.location.origin:window.location.href,a="string"==typeof e?e:m(e);return i(t,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,t)}function h(e,t,a,n){void 0===n&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,l=s.history,d=c.Pop,h=null;function g(){d=c.Pop,h&&h({action:d,location:v.location})}let v={get action(){return d},get location(){return e(s,l)},listen(e){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(r,g),h=e,()=>{s.removeEventListener(r,g),h=null}},createHref:e=>t(s,e),encodeLocation(e){let t=p("string"==typeof e?e:m(e));return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d=c.Push;let n=u(v.location,e,t);a&&a(n,e);let r=o(n),m=v.createHref(n);try{l.pushState(r,"",m)}catch(e){s.location.assign(m)}i&&h&&h({action:d,location:v.location})},replace:function(e,t){d=c.Replace;let n=u(v.location,e,t);a&&a(n,e);let r=o(n),s=v.createHref(n);l.replaceState(r,"",s),i&&h&&h({action:d,location:v.location})},go:e=>l.go(e)};return v}var g;function v(e,t,a){void 0===a&&(a="/");let n=z(("string"==typeof t?d(t):t).pathname||"/",a);if(null==n)return null;let c=f(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let a=e.length===t.length&&e.slice(0,-1).every(((e,a)=>e===t[a]));return a?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(c);let r=null;for(let e=0;null==r&&e{let s={relativePath:void 0===r?e.path||"":r,caseSensitive:!0===e.caseSensitive,childrenIndex:c,route:e};s.relativePath.startsWith("/")&&(i(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(n.length));let l=P([n,s.relativePath]),o=a.concat(s);e.children&&e.children.length>0&&(i(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),f(e.children,t,o,l)),(null!=e.path||e.index)&&t.push({path:l,score:C(l,e.index),routesMeta:o})};return e.forEach(((e,t)=>{var a;if(""!==e.path&&null!=(a=e.path)&&a.includes("?"))for(let a of w(e.path))c(e,t,a);else c(e,t)})),t}function w(e){let t=e.split("/");if(0===t.length)return[];let[a,...n]=t,c=a.endsWith("?"),r=a.replace(/\?$/,"");if(0===n.length)return c?[r,""]:[r];let s=w(n.join("/")),i=[];return i.push(...s.map((e=>""===e?r:[r,e].join("/")))),c&&i.push(...s),i.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(g||(g={}));const E=/^:\w+$/,k=3,y=2,A=1,b=10,j=-2,R=e=>"*"===e;function C(e,t){let a=e.split("/"),n=a.length;return a.some(R)&&(n+=j),t&&(n+=y),a.filter((e=>!R(e))).reduce(((e,t)=>e+(E.test(t)?k:""===t?A:b)),n)}function _(e,t){let{routesMeta:a}=e,n={},c="/",r=[];for(let e=0;e(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),c+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?c+="\\/*$":""!==e&&"/"!==e&&(c+="(?:(?=\\/|$))");let r=new RegExp(c,t?void 0:"i");return[r,n]}(e.path,e.caseSensitive,e.end),c=t.match(a);if(!c)return null;let r=c[0],s=r.replace(/(.)\/+$/,"$1"),i=c.slice(1);return{params:n.reduce(((e,t,a)=>{if("*"===t){let e=i[a]||"";s=r.slice(0,r.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(a){return M(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+a+")."),e}}(i[a]||"",t),e}),{}),pathname:r,pathnameBase:s,pattern:e}}function N(e){try{return decodeURI(e)}catch(t){return M(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,n=e.charAt(a);return n&&"/"!==n?null:e.slice(a)||"/"}function M(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function S(e,t,a,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function L(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function V(e,t,a,c){let r;void 0===c&&(c=!1),"string"==typeof e?r=d(e):(r=n({},e),i(!r.pathname||!r.pathname.includes("?"),S("?","pathname","search",r)),i(!r.pathname||!r.pathname.includes("#"),S("#","pathname","hash",r)),i(!r.search||!r.search.includes("#"),S("#","search","hash",r)));let s,l=""===e||""===r.pathname,o=l?"/":r.pathname;if(c||null==o)s=a;else{let e=t.length-1;if(o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}s=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:a,search:n="",hash:c=""}="string"==typeof e?d(e):e,r=a?a.startsWith("/")?a:function(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)})),a.length>1?a.join("/"):"/"}(a,t):t;return{pathname:r,search:B(n),hash:O(c)}}(r,s),m=o&&"/"!==o&&o.endsWith("/"),p=(l||"."===o)&&a.endsWith("/");return u.pathname.endsWith("/")||!m&&!p||(u.pathname+="/"),u}const P=e=>e.join("/").replace(/\/\/+/g,"/"),H=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),B=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",O=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class I extends Error{}class T{constructor(e,t,a,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}}function F(e){return e instanceof T}const U=["post","put","patch","delete"],D=(new Set(U),["get",...U]);new Set(D),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement},1113:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(6087);const c=(0,n.forwardRef)((function({icon:e,size:t=24,...a},c){return(0,n.cloneElement)(e,{width:t,height:t,...a,ref:c})}))},6955:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})})},7474:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})})},2510:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})})},3883:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})})},4969:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(n.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})},1249:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})})},991:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})},6994:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})})},3512:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})})},748:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})})},9783:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})})},7827:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(n.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"})})},2778:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsxs)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.jsx)(n.Path,{d:"M7.5 12C7.5 11.1716 6.82843 10.5 6 10.5C5.17157 10.5 4.5 11.1716 4.5 12C4.5 12.8284 5.17157 13.5 6 13.5C6.82843 13.5 7.5 12.8284 7.5 12Z"}),(0,c.jsx)(n.Path,{d:"M13.5 12C13.5 11.1716 12.8284 10.5 12 10.5C11.1716 10.5 10.5 11.1716 10.5 12C10.5 12.8284 11.1716 13.5 12 13.5C12.8284 13.5 13.5 12.8284 13.5 12Z"}),(0,c.jsx)(n.Path,{d:"M19.5 12C19.5 11.1716 18.8284 10.5 18 10.5C17.1716 10.5 16.5 11.1716 16.5 12C16.5 12.8284 17.1716 13.5 18 13.5C18.8284 13.5 19.5 12.8284 19.5 12Z"})]})},5788:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})})},5459:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})})},1871:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(n.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})})},311:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(5573),c=a(790);const r=(0,c.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,c.jsx)(n.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})})},8767:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=t||{},i=e.split(c),l=r.decode||a,o=0;o{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const a="color: "+this.color;t.splice(1,0,a,"color: inherit");let n=0,c=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(c=n))})),t.splice(c,0,a)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=a(3212)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},3212:(e,t,a)=>{e.exports=function(e){function t(e){let a,c,r,s=null;function i(...e){if(!i.enabled)return;const n=i,c=Number(new Date),r=c-(a||c);n.diff=r,n.prev=a,n.curr=c,a=c,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((a,c)=>{if("%%"===a)return"%";s++;const r=t.formatters[c];if("function"==typeof r){const t=e[s];a=r.call(n,t),e.splice(s,1),s--}return a})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return i.namespace=e,i.useColors=t.useColors(),i.color=t.selectColor(e),i.extend=n,i.destroy=t.destroy,Object.defineProperty(i,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(c!==t.namespaces&&(c=t.namespaces,r=t.enabled(e)),r),set:e=>{s=e}}),"function"==typeof t.init&&t.init(i),i}function n(e,a){const n=t(this.namespace+(void 0===a?":":a)+e);return n.log=this.log,n}function c(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(c),...t.skips.map(c).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let a;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),c=n.length;for(a=0;a{t[a]=e[a]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let a=0;for(let t=0;t{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.A=void 0;var c,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var a=l(t);if(a&&a.has(e))return a.get(e);var c={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!=s&&Object.prototype.hasOwnProperty.call(e,s)){var i=r?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(c,s,i):c[s]=e[s]}return c.default=e,a&&a.set(e,c),c}(a(1609)),s=(c=a(5739))&&c.__esModule?c:{default:c},i=["size","onClick","icon","className"];function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(l=function(e){return e?a:t})(e)}function o(){return o=Object.assign||function(e){for(var t,a=1;a{"use strict";a.d(t,{A:()=>n});const n={error:"TcCZnGE6mad8Dvz9pCZi",button:"_mn6o2Dtm5pfFWc8_A1K"}},2021:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"admin-page":"sexr0jUxC1jVixdKiDnC",background:"vKQ11sLeAM45M04P1ccj"}},654:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={section:"cAbGtJDGgLubucBnz7vM"}},6888:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"section-hero":"vMa4i_Dza2t5Zi_Bw9Nf"}},6588:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"demNsMJjhi7BLY7xhjU5","icon-wrapper":"QiUjdjJSkqh6nH7YMG5A","is-error":"Q080AHcq29J2fc68Hhk5",icon:"hYWbIwhppukXmGnsiT9H","is-warning":"JjHuxWly0HI9C60gorbq","is-info":"Cm8ZFHi3mngl4cj9Gatx","is-success":"ytGBsU015p3LGwOPwFDx"}},6552:()=>{},2258:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={button:"zI5tJ_qhWE6Oe6Lk75GY","is-icon-button":"tuBt2DLqimiImoqVzPqo",small:"Na39I683LAaSA99REg14",normal:"ipS7tKy9GntCS4R3vekF",icon:"paGLQwtPEaJmtArCcmyK",regular:"lZAo6_oGfclXOO9CC6Rd","full-width":"xJDOiJxTt0R_wSl8Ipz_",loading:"q_tVWqMjl39RcY6WtQA6","external-icon":"CDuBjJp_8jxzx5j6Nept"}},3689:()=>{},4803:()=>{},2300:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"star-icon":"cuoSlhSNrqf1dozY22Xb",jetpack:"lAIiifeLMmZAPlQ9n9ZR","checkmark-icon":"JLquNpQVlysAamuh5lJO",socialIcon:"cbOwD8Y4tFjwimmtchQI",bluesky:"aLWBKY0yRghEk7tNCgK3",facebook:"aHOlEBGD5EA8NKRw3xTw",instagram:"cL3m0xBYTYhIKI7lCqDB",twitter:"af4Y_zItXvLAOEoSDPSv",linkedin:"f68aqF3XSD1OBvXR1get",tumblr:"xFI0dt3UiXRlRQdqPWkx",google:"q7JEoyymveP6kF747M43",mastodon:"DKOBOTVmTLbh26gUH_73",nextdoor:"n5XodNsuMfMAAvqHFmbw",whatsapp:"fftumuc_lJ6v0tq4UMVR",threads:"inzgC27qxdt7hSdhTWRI"}},4206:()=>{},8403:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)"}},7371:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",smCols:"4",mdCols:"8",lgCols:"12","col-sm-1":"RuVLl3q4lxTQa3wbhBJB","col-sm-1-start":"f9LZTRG4MMK42rS89afW","col-sm-1-end":"bHe_zKxjjpUwHw_MdYE1","col-sm-2":"QZbNrOqE2aNSn50xVhpU","col-sm-2-start":"ev7W3z7zVYPeHAlYqZjf","col-sm-2-end":"NJWd1m_e7lOiPYru2ZMP","col-sm-3":"Xc6nt1Qc1DI0Z2A3gt1r","col-sm-3-start":"UIcN_GXiPRoIsin8Kohg","col-sm-3-end":"GRKCyqb5LufCSCgykKFc","col-sm-4":"i_qTq8gqhhC3vIUepVRB","col-sm-4-start":"G3qaZ3Jpbvam_1XvGxgc","col-sm-4-end":"VRCNYKZtO9zukEwmgP1y","col-md-1":"tRm008K_WJL79WoNZTNL","col-md-1-start":"l5T2P_bgKts4tdaRkS1d","col-md-1-end":"zOCxfLZpF6BlgC7a_Yq1","col-md-2":"F80DdgVn0m5OpvtSQWka","col-md-2-start":"oI1c7JYfiJtMQHbhngtU","col-md-2-end":"pMQtA_4jh1_1lVknqEP5","col-md-3":"VenqMpdgyKQVUNNQcfqd","col-md-3-start":"seNYL99uoczf9V4MxBxT","col-md-3-end":"YKfF1HFhI9KygA5l3b2J","col-md-4":"yAi0Cv1xDWkoqsaUhvhR","col-md-4-start":"ubhnyZOnkgxNhh6XtVWv","col-md-4-end":"RGOPGQbWMJ9Ei5oFxS7X","col-md-5":"Sz1E2aWbX483ijdi6yge","col-md-5-start":"tku6_bRYrX9tMbgYGmIl","col-md-5-end":"b5JHttOhSEcI1WBlqAjk","col-md-6":"FboSx5MoKTAWbxXyYlCw","col-md-6-start":"Jhs8yEEmodG30edbJvag","col-md-6-end":"IpzbbKVqEqPcfIGkXkwt","col-md-7":"mhCPwfAZ4Kmm_empzJAq","col-md-7-start":"x034ilrJF7rO9UJB2rI1","col-md-7-end":"Wt8t2e16viRrOJ1lLA5v","col-md-8":"S6pIrEy9AMLKx9bgh_Ae","col-md-8-start":"kEfI4tGyuWfHTlRnvIab","col-md-8-end":"PUzX4RRsKq1dnsz3gebS","col-lg-1":"X_pdcLJikd8LS_YAdJlB","col-lg-1-start":"tl936d14Huby4khYp05X","col-lg-1-end":"hnge0LnR69d3NXEtEE1t","col-lg-2":"fj0NUMuyZQcPNgKcjp5Z","col-lg-2-start":"R2ncBX7a2NigdYCcV1OX","col-lg-2-end":"t8vMSDVYno9k9itRwnXb","col-lg-3":"wsDuEN2GqHx6qzo8dUdk","col-lg-3-start":"cIEVPUweWtLBy3xaXnMx","col-lg-3-end":"fajUWBwu1m2B479j3jmz","col-lg-4":"YR0c7fQTgMkDdWzwSyLp","col-lg-4-start":"xlwp8BmplxkKNMI7gamo","col-lg-4-end":"_C4O1w9DUqx1m3gPf8aA","col-lg-5":"Z54F1hAErckAIrKlxnXW","col-lg-5-start":"ezSDWkRHmKSxDJXxuiOH","col-lg-5-end":"T0ChoeAjGJjkkNrYhD4g","col-lg-6":"qtMoMPF6yHvGJnWHSsde","col-lg-6-start":"gdoywN5VPiWERfIBqkph","col-lg-6-end":"wUev_VH5uf_pwFFlbnAU","col-lg-7":"egIPDFJsOpownTClq9XP","col-lg-7-start":"yGhp9yoAW7k0kQik9AB7","col-lg-7-end":"SJ43U9mR5wUg5V2qBeQA","col-lg-8":"cTuyHfMwSUJxN_HdIEgd","col-lg-8-start":"smCr8DaIagcumdvdldiK","col-lg-8-end":"T03NHzQJvzwL6wAfIiTL","col-lg-9":"pMvxM3RJGjqyNdf9qg1Y","col-lg-9-start":"iIVpNRwEnQ_JI5gpp9EN","col-lg-9-end":"ZbQ4u4vGSX5rJOje4uGL","col-lg-10":"gKb5wuIDAlKGbrjK2vxy","col-lg-10-start":"Z7pINdImE2WJiYnZBTqm","col-lg-10-end":"ZTxp6qpvwurMdOnLLSz1","col-lg-11":"NnQTlbfnxPDR6cQ7rygg","col-lg-11-start":"O137wZd6Yl0olSA9PsXR","col-lg-11-end":"zf2OJtQ2MPz6SDoh6CB0","col-lg-12":"U3H6UHW6HqRt9hdzVg3O","col-lg-12-start":"zynnNeS_ZBTxABcVpUQH","col-lg-12-end":"vI8tltFZtFUNAy9Iag9s"}},2420:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",container:"SqdhUZkXCRuIpErj1B3z",fluid:"OZC_9a1LhpWF9dv15Gdh"}},7410:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"VHYulMcpzbr10HWR0iSE","icon-wrapper":"FGpSkMCiIHQjszcV0dbn","close-button":"KoWZcCwhW13xvkEb0QON","main-content":"smrfczkC53EaFM8OJUXs",title:"IKYRWoPwt9xOVEx1wzNS","action-bar":"qM0qY6mPYp1MPN54A3Kg","is-error":"A5YkDkkXuiYgavrY6Nux",icon:"y_IPyP1wIAOhyNaqvXJq","is-warning":"cT5rwuPMZzWvi5o6shMl","is-info":"yo0O3uvNomPsYUXFCpAS","is-success":"oZdDFf1jBLkzn5ICCC6x"}},3142:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"p4qz2tkq0p9hxucJ6Qk2",table:"lbNDyXioOwvyvbALtCBm","is-viewport-large":"s2Lsn4kbm6BrS3DSndRB",card:"cLaNK_XcbTGlRQ4Tp43Q","is-primary":"CYt1X0eH1icRjhtJ28jx",header:"DAkZc1P9A3K12fjEliMg",item:"WUBuYABl8nymjs9NnCEL","last-feature":"ANtCFeb41NhA8PA3H7ZN",value:"Ql2gy_148yW8Vw5vhaKD",icon:"EAQrAnQEW1z1BfdY5gbC","icon-check":"JDSTlLoOC_4aUoH2oNM2","icon-cross":"zNdQRJ1w7BvaQOYyqzHK",popover:"lr7vbX95SKtoe7DarJcZ","popover-icon":"KRrGp2xdkeBOxLZeuQ6X",tos:"H_ZJiRVJg0LiMXPGOcmt","tos-container":"x21z_DixObRDsDaWotP1"}},3407:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"dovianZYLKhnbnh9I06o","price-container":"lljtQMhW7lq5tE5SDJEf","promo-label":"NubApIV1vQCRUNprfm6b",price:"dhFQXpZfMwVI8vuYHnwC","is-not-off-price":"eD7hzxFmdtG_MgmBtl_k",footer:"C64ZjjUAqJC1T2Sa7apS",legend:"UpZDGew6Ay1hPoP6eI7b",symbol:"TDiiPbuW1Z0_05u_pvcK"}},8325:()=>{},9634:()=>{},4495:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={reset:"WQVtrU6q0L1Igcj7wCrQ","headline-medium":"UujoBFTnQNY2cWU2SIsH","headline-small":"TeGO5V_thHw5lDAm1_2M","headline-small-regular":"WolQzb2MsSgiNmLtc7_j","title-medium":"hUB0JT8p1T2Hw28N6qC8","title-medium-semi-bold":"gKZWDv5chz3_O3Syp74H","title-small":"zY2No8Ga4b8shbOQGhnv",body:"tIj0D1t8Cc892ikmgFPZ","body-small":"KdcN0BnOaVeVhyLRKqhS","body-extra-small":"dso3Rh3tl3Xv1GumBktz","body-extra-small-bold":"mQ1UlbN9u4Mg9byO8m7v",label:"PItlW5vRExLnTj4a8eLE","m-0":"TwRpPlktzxhmFVeua7P5","mx-0":"zVfqx7gyb3o9mxfGynn1","my-0":"iSHVzNiB9iVleGljaQxy","mt-0":"xqDIp6cNVr_E6RXaiPyD","mr-0":"S8EwaXk1kyPizt6x4WH2","mb-0":"ODX5Vr1TARoLFkDDFooD","ml-0":"cphJ8dCpfimnky7P2FHg","m-1":"PFgIhNxIyiSuNvQjAIYj","mx-1":"M2jKmUzDxvJjjVEPU3zn","my-1":"io15gAh8tMTNbSEfwJKk","mt-1":"rcTN5uw9xIEeMEGL3Xi_","mr-1":"CQSkybjq2TcRM1Xo9COV","mb-1":"hfqOWgq6_MEGdFE82eOY","ml-1":"I8MxZQYTbuu595yfesWA","m-2":"kQkc6rmdpvLKPkyoJtVQ","mx-2":"j6vFPxWuu4Jan2ldoxpp","my-2":"hqr39dC4H_AbactPAkCG","mt-2":"c3dQnMi16C6J6Ecy4283","mr-2":"YNZmHOuRo6hU7zzKfPdP","mb-2":"Db8lbak1_wunpPk8NwKU","ml-2":"ftsYE5J9hLzquQ0tA5dY","m-3":"Det4MHzLUW7EeDnafPzq","mx-3":"h_8EEAztC29Vve1datb5","my-3":"YXIXJ0h1k47u6hzK8KcM","mt-3":"soADBBkcIKCBXzCTuV9_","mr-3":"zSX59ziEaEWGjnpZa4uV","mb-3":"yrVTnq_WBMbejg89c2ZQ","ml-3":"UKtHPJnI2cXBWtPDm5hM","m-4":"guexok_Tqd5Tf52hRlbT","mx-4":"oS1E2KfTBZkJ3F0tN7T6","my-4":"DN1OhhXi6AoBgEdDSbGd","mt-4":"ot2kkMcYHv53hLZ4LSn0","mr-4":"A1krOZZhlQ6Sp8Cy4bly","mb-4":"pkDbXXXL32237M0hokEh","ml-4":"XXv4kDTGvEnQeuGKOPU3","m-5":"yGqHk1a57gaISwkXwXe6","mx-5":"X8cghM358X3DkXLc9aNK","my-5":"GdfSmGwHlFnN2S6xBn1f","mt-5":"yqeuzwyGQ7zG0avrGqi_","mr-5":"g9emeCkuHvYhveiJbfXO","mb-5":"Lvk3dqcyHbZ07QCRlrUQ","ml-5":"r3yQECDQ9qX0XZzXlVAg","m-6":"aQhlPwht2Cz1X_63Miw0","mx-6":"JyHb0vK3wJgpblL9s5j8","my-6":"cY2gULL1lAv6WPNIRuf3","mt-6":"NBWQ9Lwhh_fnry3lg_p7","mr-6":"yIOniNe5E40C8fWvBm5V","mb-6":"t30usboNSyqfQWIwHvT3","ml-6":"Nm_TyFkYCMhOoghoToKJ","m-7":"C4qJKoBXpgKtpmrqtEKB","mx-7":"S93Srbu6NQ_PBr7DmTiD","my-7":"fJj8k6gGJDks3crUZxOS","mt-7":"cW6D6djs7Ppm7fD7TeoV","mr-7":"DuCnqNfcxcP3Z__Yo5Ro","mb-7":"im8407m2fw5vOg7O2zsw","ml-7":"G0fbeBgvz2sh3uTP9gNl","m-8":"kvW3sBCxRxUqz1jrVMJl","mx-8":"tOjEqjLONQdkiYx_XRnw","my-8":"op5hFSx318zgxsoZZNLN","mt-8":"c9WfNHP6TFKWIfLxv52J","mr-8":"sBA75QqcqRwwYSHJh2wc","mb-8":"GpL6idrXmSOM6jB8Ohsf","ml-8":"HbtWJoQwpgGycz8dGzeT","p-0":"uxX3khU88VQ_Ah49Ejsa","px-0":"KX0FhpBKwKzs9fOUdbNz","py-0":"PfK8vKDyN32dnimlzYjz","pt-0":"emxLHRjQuJsImnPbQIzE","pr-0":"kJ8WzlpTVgdViXt8ukP9","pb-0":"tg_UIUI11VBzrTAn2AzJ","pl-0":"uczvl8kaz84oPQJ2DB2R","p-1":"o7UHPcdVK3lt7q3lqV4o","px-1":"IDqEOxvDoYrFYxELPmtX","py-1":"DdywPW2qSYlu2pt8tpO2","pt-1":"npy3hw4A5QSkDicb2CJJ","pr-1":"LgbptTApNY5NwLQvEFAt","pb-1":"WZQy2SZuZso59bUsXXyl","pl-1":"o331apInxNunbYB3SfPE","p-2":"fMPIyD9Vqki1Lrc_yJnG","px-2":"i2pMcTcdrr10IQoiSm_L","py-2":"eA702gn32kwptiI1obXH","pt-2":"o9bGieUKcYc8o0Ij9oZX","pr-2":"SwZcFez1RDqWsOFjB5iG","pb-2":"eHpLc_idmuEqeqCTvqkN","pl-2":"vU39i2B4P1fUTMB2l6Vo","p-3":"JHWNzBnE29awhdu5BEh1","px-3":"X72lGbb56L3KFzC2xQ9N","py-3":"BzfNhRG8wXdCEB5ocQ6e","pt-3":"srV0KSDC83a2fiimSMMQ","pr-3":"lUWfkmbQjCskhcNwkyCm","pb-3":"Ts0dIlc3aTSL7V4cIHis","pl-3":"CzlqQXXhX6MvorArFZ8B","p-4":"TqMPkQtR_DdZuKb5vBoV","px-4":"a7UrjhI69Vetlcj9ZVzz","py-4":"StEhBzGs2Gi5dDEkjhAv","pt-4":"FGneZfZyvYrt1dG0zcnm","pr-4":"APEH216rpdlJWgD2fHc8","pb-4":"oGwXC3ohCic9XnAj6x69","pl-4":"U6gnT9y42ViPNOcNzBwb","p-5":"IpdRLBwnHqbqFrixgbYC","px-5":"HgNeXvkBa9o3bQ5fvFZm","py-5":"tJtFZM3XfPG9v9TSDfN1","pt-5":"PdifHW45QeXYfK568uD8","pr-5":"mbLkWTTZ0Za_BBbFZ5b2","pb-5":"vVWpZpLlWrkTt0hMk8XU","pl-5":"RxfaJj5a1Nt6IavEo5Zl","p-6":"SppJULDGdnOGcjZNCYBy","px-6":"palY2nLwdoyooPUm9Hhk","py-6":"WYw1JvZC0ppLdvSAPhr_","pt-6":"YEEJ9b90ueQaPfiU8aeN","pr-6":"QE0ssnsKvWJMqlhPbY5u","pb-6":"n8yA3jHlMRyLd5UIfoND","pl-6":"tXHmxYnHzbwtfxEaG51n","p-7":"kBTsPKkO_3g_tLkj77Um","px-7":"RyhrFx6Y1FGDrGAAyaxm","py-7":"CBwRpB0bDN3iEdQPPMJO","pt-7":"vQVSq6SvWKbOMu6r4H6b","pr-7":"oBy5__aEADMsH46mrgFX","pb-7":"KVEXoJqf1s92j0JMdNmN","pl-7":"ZMXGNrNaKW3k_3TLz0Fq","p-8":"tuiR9PhkHXhGyEgzRZRI","px-8":"U7454qyWkQNa2iaSJziu","py-8":"VLYIv2GVocjuN93e8HC8","pt-8":"X1rm9DQ1zLGLfogja5Gn","pr-8":"JS7G6kAuqJo5GIuF8S5t","pb-8":"Y8F9ga1TDCMbM1lj4gUz","pl-8":"AJuyNGrI63BOWql719H8"}},9422:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={global:"_fUXxnSp5pagKBp9gSN7"}},8170:()=>{},2980:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"jp-wrap":"EiaNctK1_P9pPqOeiaSI","jp-row":"ogHZg_sJCljylz3VJfsf","sm-col-span-1":"zv7eGvijKRkbPVakubHw","sm-col-span-2":"VoJNoiya_1ck3_kXS6_C","sm-col-span-3":"ecv0NO526NoTNbpALA1A","sm-col-span-4":"OfBdkceMzeHvRbzhqDlP","md-col-span-1":"JLb3NpEKN8pOaWd7K1bu","md-col-span-2":"fsMPGqPKE4mjMIPFwl77","md-col-span-3":"DIK_zdaGAQ09eKspBJ4E","md-col-span-4":"shXYpxPu3WCJsR8aOHtz","md-col-span-5":"s7ElrOqG_yGd5SIfwqOR","md-col-span-6":"Cxml9uzGvArAL8_RDs_p","md-col-span-7":"aANxBKDGx72eDqU0iUPj","md-col-span-8":"XxyzuTY3mnQcl9EGZadm","lg-col-span-1":"Sfo4WaSNIWInJ93Abd3w","lg-col-span-2":"tQS7SKUGrU4THhWMysbo","lg-col-span-3":"I94U7mpY4h16pcOksZNF","lg-col-span-4":"uWMb9k77kQxBdS5MTt0s","lg-col-span-5":"rKwEEZQxK9s_POMg5Jss","lg-col-span-6":"UcPXX_s06IPCkF7ZjH3D","lg-col-span-7":"CrQdtiCFkRbzY6K2dFvt","lg-col-span-8":"rEUALOmOdUBXO0Us871z","lg-col-span-9":"NqXa9TlcTEviVsB53hBV","lg-col-span-10":"OnWVeiQiwgQ9lzdGPW66","lg-col-span-11":"D2PkTcy7b8u2K9QXY6VQ","lg-col-span-12":"EcqBhzAyxo5RDc2Y6m7K","md-col-span-0":"gB1mWzHOM38d80lrhBRX","sm-col-span-0":"KNQXLP78ejczOkour3zg","jp-cut":"rBVbaVWBnBRtTMrUKZxm",modal:"gfM_DIJrVbRhmKdAphIm","jetpack-logo":"zfJfONxRAw0fHjXUS7LN",animating:"pnwbCuWbV0PNQr1LFpRh",button:"_j4GWTmW5psCHFYh6R0x",headline:"saSAjv8yulVXQDoqDJEI",paragraph:"O_hcdbeMivIhBn7ApDnS","jetpack-logo-triangles":"FCnyb_xCK7DhJ63p6TEd","video-wrap":"Qn5xayjI_jH2m1d6BEoq",videoMove:"OmAVpCQ270MqI4IsT9Ky",slidein:"Axe8f2LgqEBZHVcsRgY5","content-wrap":"iBMDoShSmqpt72YfJb36","hi-user":"eQG1KKK8jjKtQyzfv573","content-wrap-text":"l35bIyiqYJiZ6tVYvJtC","powers-wrap":"HQVDZ6J3x6SJNYFX5khS","jetpack-products":"KdvmPIjelQIFiPQGuIYf"}},9958:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"OpMBda4vebhRbW8Fm6YC","is-link":"BghJAx9hSagUdHWOUaYE","has-error":"IWsEW5nnNWUqqcT3K5L1",title:"r3UCwgwCthua6lDCvIBI",name:"vpluqUMgmwx9_f8wCVIn"}},4600:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={icon:"rV_5QyvhDnsVjCX4pb0h",link:"MO1jDNY8VPqeNS9xL8jE"}},9696:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"relative-col":"zvd4dCB_bBDiXJKKDqXm","close-link":"ly4o9lSswAGHFXqGUEIO","account-description":"u64Go3kwEZ7MD9eji0H1","account-images":"_RT41NE3LU4R0ubcij2y",wordpress:"cFGWJeRiGHjAr8D7CWJW",google:"Iz3l7a05TP6HK9S92TIL",apple:"lmQ0wFmnk4kKkGVjokPA",github:"ZSFTmY3zE3VP4w0QeaqV","all-features":"AoIs8wD92wKR8RpQj6Uc"}},7193:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"connection-status-card":"kezuOHNvu9vdvlJ86Fwg",status:"qJizORs2q_CVCj9L6XLe","avatar-wrapper":"VmtuLc2xRqmsO6cK8qjF",cloud:"MdTRfQ3eo5qZKChZlzNj",jetpack:"PbEpL02SEH9VNAlbKCfV",avatar:"TD4AUM9gcTVAB6JHB5ZR",line:"yjl73qv0VWoPP8IhGreh",error:"J0GIu2rNR7rXocQTyd8p",warning:"rAV2E93SG8WpokuGk9jh",info:"YZ7FNKEm9qpvQ4ZkbAz5","connect-action":"TYNMsILey2vUwnyZSjJU","list-item":"oH9tzGE80LnB6Og69RFz","list-item-text":"xXVEWvQllVsFGmJY8WEp",success:"q4_FOHifGawULuFBZke9"}},6225:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={title:"iG63b_J1HNfT8xEIq619","dropdown-menu":"T8UhA3lZQjpZsyaah9J6","recommendations-list":"g69ZGQc9wey1u1beD0IP"}},8870:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={icon:"hdasSNj9k3Sc5PwXK4uE",link:"eWN8Hj0SBRDq1F48n_Fg"}},4800:()=>{},9331:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"jp-wrap":"yWUvvF4WJLNDSpMgBMfm","jp-row":"ka1fVHj2HOkHjhdoEFOZ","sm-col-span-1":"JMOO4Y_9yhTO9lwLnRUx","sm-col-span-2":"PFDPAqk51qox_ChLqJwm","sm-col-span-3":"ault0jHVfWpShqOGooIP","sm-col-span-4":"GqpvdRzmzPJELtSm4FEN","md-col-span-1":"Ym4_YneEGD_iZD6W1C2o","md-col-span-2":"NbvHnnDtWw8n9BEUQ0Oy","md-col-span-3":"ElMT7rhxe5ZJKO41MnhW","md-col-span-4":"yKjnqjibn_wW_1tWWt5Q","md-col-span-5":"Pb30lOcQFpzUX57GwflS","md-col-span-6":"pC1wxc_R8y4pNILHsiiY","md-col-span-7":"pChscSCnudQoWGjMFKI_","md-col-span-8":"qw1H2gAgF3lDCI2Tbkmb","lg-col-span-1":"VzcA_rrxBK3g4ozA0oD9","lg-col-span-2":"pNAa7O2adRZD8Slgk9iR","lg-col-span-3":"tlIMLlipexblj8CeOx4B","lg-col-span-4":"Dvt0u5l2Rr1BhBmvYAzl","lg-col-span-5":"BiUsgNTc0tyc7tC5jnzE","lg-col-span-6":"ulJXAsj7G2ROJ1g3_s28","lg-col-span-7":"HsoVlyVLsXYClx9Atox0","lg-col-span-8":"oXxjRQNNj2cfIpFBqC1W","lg-col-span-9":"qXgUn4Adg9xE_JnbuDio","lg-col-span-10":"xMpqTLiLfYFEJiRPQQQq","lg-col-span-11":"IiGo3Sz2FDZN7_eGElwA","lg-col-span-12":"Om8BNCjfgqQ_wmPQjfOY","md-col-span-0":"t10ZWzP7ADjJnR4tqxRS","sm-col-span-0":"eOUlZG8Pelh_Xj0aSoHG","jp-cut":"l546LrwBEePz434NFK5Q",logo:"Q7w4fcEcemZ2nlwaYNog",wrapper:"AoNQsOaTt6gSf0H6Yasz",helper:"v13ZwGzUnecPA7Y3URAl",container:"EeDbu9pXFWTsCzfTpv2v",title:"BmSvoIi3rErkcrRiOi2W",content:"mojRoVuWdDJo0E6LEjJw"}},146:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={modal:"HeJe1crc9XaWWpLvIPit",container:"or0JUScxkJPmNsfrxkEK"}},6632:()=>{},5055:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={heading:"jErCC9oKHSM15BxzFyQK",notice:"oVoYbwbFB6U2o90Njusk","bigger-than-medium":"Snc8NEmDelsbhlH4285s",cta:"R5tvcsARTGN0A_z3DygA",message:"wBVXH4OTNwLHPRpN4nsq",nofill:"F1qvEnFfHs5nz3zFZUOV",separator:"SrQxAOBa5ZaSKP8wlut9"}},4334:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"wiobThfXJCuhGNrbFIT6","expire-date":"VgAxgahF9bC2M__FiIgV","expire-date--with-icon":"dbRwkMLqcMF67njPoAF7","actions-list-item":"Doju0RxvvN9JS12mf489"}},1208:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"pIsYsXFAJ9KX2VrS5rmY",description:"gmPKCDKZcfQt9WieTyKS",actions:"fDBaV7I4yUO6w5AWVEtr",buttons:"SelsBZT7eIWRQyl1dasZ",title:"LHYJUrOej3toDvOAiz4k","action-button":"JFjbc0JgC4qC92ehOiUr","dropdown-chevron":"NBZgqk_CGGfY3Q16OHjT",primary:"Jh6TlOGQNgBwU_fFxPrm",secondary:"VBxTkBZVxHaVoyhMRJcz","action-button-dropdown":"UZ3NDyOSbGY9NZWb3bUD","dropdown-item":"IpJGe_nvXXUiBOsAOkaV","dropdown-item-label":"SjzpxiAAVsU_xRrw55ub","active-action-checkmark":"GQy61X1G7Wv3L3erNwxR","has-additional-actions":"QSePbRSFylCvM2cX8nN_",priceContainer:"aZvwqVNw6rvImSxn0DM9",price:"R4OXFRkmlHAH8ScIgYXh",discounted:"g0_8bbVjnVh0D_pS264j",term:"nqFgW_S2jbHPu9yPq9E_",status:"f5VJYwuJmjxH8PVxEbbv",active:"ry3pxoGtmQ0ZeSwp7F_3",inactive:"LZzE3EG7m3CDR46wwwEr",warning:"TZUP7W6QYGajITiMNYas",error:"Vx_jpT02r8W6NfsRSB02","is-fetching":"PdsJCfyyjSgrNDheF2qi","blink-animation":"dWP7ypkVXudMbAa38W5Z"}},3649:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"no-backup-stats":"wI7QgVzPXvVVu6kfnTT8","main-stats":"eqyxcUmdF0s3gmmlZGyD","main-stat":"gxY6D0PeVtGk9iSB5E_u","visual-stat":"D_uE0LD5CvpfM2FNp55k","more-stats":"VTBUdi1D4DW34F0yixMk",activity:"BXQQYCO_pEmYmzBBwYxR",summary:"qdvOzzbrd3KQK7DNg8eg",description:"PFbMp_gtGLBMWbbYtO0q",time:"ZFCNMiywyFvaifoIQI5w"}},2106:()=>{},538:()=>{},1218:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"single-contextual-info":"g4lyov8aMDggdD4yOi1p","main-value":"Ys5ScZ_dYn2O2AzDE5Yi","single-contextual-info-placeholder":"sUNg_b7XteVXOrpHAkJg","contextual-percentage-change":"cF6QAJf1vXXAMuutXPcq",neutral:"coY634LconQ7gzDDNJeu",positive:"kyqpwKaL2FyQ8CtxJQ0f",negative:"aXf37lEOcjpNV8ImLaYK","change-icon":"OyGdoGzsQ48VaVVR99_H","change-values":"cKLicfMCaDSGPlX222jF",cardListTitle:"ZaPXoMGC_e8NfFoBgA95",fullStatsCard:"gb2kSZHPauLu96D9HAIg",cardlist:"qpN923qyxjI06NCgFC8j",valueSectionHeading:"hpd1bQCLIZYXpZJa22qw"}},6101:()=>{},9084:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={card:"q0T8YyQxRawhpDtvJjxI",container:"B7JDqI_vtKxSy5GjvqA1","card-header":"zj7xadmhIWeuf7ZwvVTS","product-bundle-icon":"GsioW6IsC8EMYE3U6788","product-bundle-icons":"dbz07JqxOlivjKO4vBEF","product-icon":"cfEO8udWbRGPFJzW8Jg5","plus-icon":"zlh3zbjUe4Z8cBs7uVVe","product-has-required-plan":"qoZuzG5EcDa231hC6t0P","checkout-button":"Q6uUUQCPWS6_6nLxIn68","components-spinner":"YU4iBCRze09ZP3iCsdcb","free-product-checkout-button":"OrQG7DjDd9Ha2Xj1Mx3L",features:"Q1jaYDpa2AVfJpA29wT0","highlight-last-feature":"HL4gSxsF0skYGhGuqH90",disclaimers:"sEcLfpWjo0GF7QrxD3Lt","price-container":"xgv3jRkeF39aEQELCwru",price:"twlleZ5Ehq4bB7CvKVSW","is-old":"Qg4rPEvXsqmod1s_31d8","price-description":"ApsgxIornVy_3KnciVeJ","supporting-info":"NMxcZL17aEP7v81uG3zD","tos-container":"gCTKfAPzJqZas7CaRbKN"}},1298:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"svE2cJL5t2FarzcDQYNe",imageContainer:"dvEJEDNTnmVfVxtLa4uU",aiImageContainer:"K1VY4DNP8PHMWAEVBC_h","product-interstitial__header":"nk_COGPrkBNLp7lVt4sQ","product-interstitial__license-activation-link":"ukgQ5TmLablG3svUKjdw","not-strong":"Vofm70ADXSe43GamWEaF",card:"EUcF2LKeC2GyhWD2FKCP","buttons-row":"Bm21LIBQtpRo3ZhOxXBG","product-interstitial__product-header":"jwIGzADCnBI_ai9xYYiS","product-interstitial__product-header-name":"fTbxuhh_SfMgenyWvGN0","product-interstitial__hero-section":"eR56lApoP14RIBAhO1UN","product-interstitial__hero-content":"vHnITd5JOCOgxCgXTgoD","product-interstitial__hero-heading":"vAGLpjIGi6GA8ghbumN7","product-interstitial__hero-sub-heading":"oag8YaslCEiUVu8GKKL3","product-interstitial__hero-cta":"FhH03GPt9FK1VH9NZhYA","product-interstitial__hero-side":"VUXAtah2JvUCNc4cXjPp","stats-card":"dyPAjc3M4y3Q6gJfWnjw","stats-card-icon-check":"Ll1l9bEuf5G5oh3AENep","product-interstitial__stats-card-text":"WrzTysWiqUiuEPvpFqau","product-interstitial__stats-card-value":"d4faYkf9yL7oW7pwcjmP","product-interstitial__section":"acffvOSYc5S8x4P_AYnQ","product-interstitial__section-wrapper":"M5YNmgy60Q_UtaxKgQcv","product-interstitial__section-wrapper-wide":"HJiOvun8sHkiFpNL0sl6","product-interstitial__section-heading":"mXinUJfpSTS9EVB8M8K_","product-interstitial__section-sub-heading":"QKjsnliPyLu4n08yVUUM","product-interstitial__section-emoji":"xQJJkJ4v7Jm8iSJ0z0Dj","product-interstitial__usage-videos":"VWIBGwuHqtAKg_5Hch92","product-interstitial__usage-videos-item":"mnkNhprYIatxfziERMwM","product-interstitial__usage-videos-video":"WEiaYLqJwV2IzC8LD9Fs","product-interstitial__usage-videos-content":"GJlowVsJybna1MFcIiIU","product-interstitial__usage-videos-heading":"_OeUvI9GrP00qh6Uk7Tg","product-interstitial__usage-videos-text":"C6I5jYHW2IJSDBoKvhcB","product-interstitial__usage-videos-link":"XdnAdAwkxAW5yvUx3NRr","product-interstitial__ai-notice":"MCKgMfLVZtkgWu5m5u6L","product-interstitial__new-badge":"c0SItK48SRkWfZUCECbZ"}},7899:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={container:"SWwV4Pw6OZ5vU3PqPXmr",imageContainer:"r7tUofa9Z3A5ziKVR1H7",aiImageContainer:"i_AnOR3MaQLraGvb2QU5","product-interstitial__header":"YcYvLvdvWrb1EUZoVsE8","product-interstitial__license-activation-link":"uGTTsKoIOoZdYhk6uPnl","not-strong":"NzDTsxhX8D1mlckNpewR"}},3747:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={"section-stats-highlights":"Jvb1njqMy7ML1zikhbWn","section-title":"mpr8_ygU8woV4bVR1xvw","section-description":"gwO_Q0L0jbwMARVlBezu","cards-list":"qwy7CsLeEbXvaPwgC9WV","stats-card":"Hrbg7DeSJs6gas9zdPDR","stats-card-icon":"NFpbo5AINn6I6avKFGby","stats-card-heading":"aoQZCG0JeyWmy2J6vVxF","stats-card-count":"M6ApyXg79vuXo6GwDkbO","is-pointer":"DYHb5e6QhgXejWyo9s78","stats-card-count-value":"OlInbY5YnDO06MEQHv98","stats-card-difference":"EtbKbd5m85w7oYT4stIs","stats-card-difference--positive":"Awr7zl75sfAsFPHK9kDG","stats-card-difference--negative":"QFSZbIKFdWO3HEPBZyhc","stats-card-difference-icon":"GgJAnS4gaEEGmRCP5n8y","stats-card-difference-absolute-value":"mjiNtwdbKpfo9edGVes4",actions:"pAt4v_KG9Ir19wNcEtEj"}},5225:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={banner:"jrGNTKcgeXk9HKzolut9","banner-card":"wg3mZsoPekZWlBgOvdZ6","is-mandatory":"aDxB89WgtARQqNWd4ZeK",dismiss:"sGP8lxDpRSjt0Fh7wxoR","banner-content":"z5EQSkU36nsjxHEBSfNN","banner-description":"MwBwVaEj6u_zRgfrFR9b","banner-image-evaluation":"UgPNtuFW7lTJ06k39EsK","is-selected":"ilVOud0_OCGK4HciazB_","banner-image":"EtcggGK0Bk8POQD986Og",form:"TSiu5sC6MdANROjUkUJM","form-checkbox":"iqJfpZM9IYXuFSXvuoEe","form-actions":"Vozbq8Inlk5SxoVnn2G5","form-link-action":"s_V1BM1Wtt3He4eF2TCu","banner-evaluation":"wXWt0uFLFkFT7CqgOijQ","banner-loader":"m_muvynofDds3hoh9u5m"}},4118:()=>{},4997:e=>{var t=1e3,a=60*t,n=60*a,c=24*n,r=7*c,s=365.25*c;function i(e,t,a,n){var c=t>=1.5*a;return Math.round(e/a)+" "+n+(c?"s":"")}e.exports=function(e,l){l=l||{};var o=typeof e;if("string"===o&&e.length>0)return function(e){if((e=String(e)).length>100)return;var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!i)return;var l=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*s;case"weeks":case"week":case"w":return l*r;case"days":case"day":case"d":return l*c;case"hours":case"hour":case"hrs":case"hr":case"h":return l*n;case"minutes":case"minute":case"mins":case"min":case"m":return l*a;case"seconds":case"second":case"secs":case"sec":case"s":return l*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(e);if("number"===o&&isFinite(e))return l.long?function(e){var r=Math.abs(e);if(r>=c)return i(e,r,c,"day");if(r>=n)return i(e,r,n,"hour");if(r>=a)return i(e,r,a,"minute");if(r>=t)return i(e,r,t,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=c)return Math.round(e/c)+"d";if(r>=n)return Math.round(e/n)+"h";if(r>=a)return Math.round(e/a)+"m";if(r>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},5762:(e,t,a)=>{"use strict";var n=a(3761);function c(){}function r(){}r.resetWarningCache=c,e.exports=function(){function e(e,t,a,c,r,s){if(s!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var a={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:c};return a.PropTypes=a,a}},8120:(e,t,a)=>{e.exports=a(5762)()},3761:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},3381:(e,t,a)=>{"use strict";var n=a(6142);function c(){}function r(){}r.resetWarningCache=c,e.exports=function(){function e(e,t,a,c,r,s){if(s!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:c};return a.PropTypes=a,a}},5739:(e,t,a)=>{e.exports=a(3381)()},6142:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},28:(e,t,a)=>{"use strict";a.d(t,{I9:()=>u,N_:()=>m,ok:()=>h});var n=a(1609),c=a(9539),r=a(6992);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(c[a]=e[a]);return c}function l(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,a)=>{let n=e[a];return t.concat(Array.isArray(n)?n.map((e=>[a,e])):[[a,n]])}),[]))}const o=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function u(e){let{basename:t,children:a,window:s}=e,i=n.useRef();null==i.current&&(i.current=(0,r.TM)({window:s,v5Compat:!0}));let l=i.current,[o,u]=n.useState({action:l.action,location:l.location});return n.useLayoutEffect((()=>l.listen(u)),[l]),n.createElement(c.Ix,{basename:t,children:a,location:o.location,navigationType:o.action,navigator:l})}const m=n.forwardRef((function(e,t){let{onClick:a,relative:l,reloadDocument:u,replace:m,state:d,target:p,to:h,preventScrollReset:g}=e,v=i(e,o),f=(0,c.$P)(h,{relative:l}),w=function(e,t){let{target:a,replace:s,state:i,preventScrollReset:l,relative:o}=void 0===t?{}:t,u=(0,c.Zp)(),m=(0,c.zy)(),d=(0,c.x$)(e,{relative:o});return n.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,a)){t.preventDefault();let a=void 0!==s?s:(0,r.AO)(m)===(0,r.AO)(d);u(e,{replace:a,state:i,preventScrollReset:l,relative:o})}}),[m,u,d,s,i,a,e,l,o])}(h,{replace:m,state:d,target:p,preventScrollReset:g,relative:l});return n.createElement("a",s({},v,{href:f,onClick:u?a:function(e){a&&a(e),e.defaultPrevented||w(e)},ref:t,target:p}))}));var d,p;function h(e){let t=n.useRef(l(e)),a=(0,c.zy)(),r=n.useMemo((()=>function(e,t){let a=l(e);for(let e of t.keys())a.has(e)||t.getAll(e).forEach((t=>{a.append(e,t)}));return a}(a.search,t.current)),[a.search]),s=(0,c.Zp)(),i=n.useCallback(((e,t)=>{const a=l("function"==typeof e?e(r):e);s("?"+a,t)}),[s,r]);return[r,i]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(d||(d={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(p||(p={}))},9539:(e,t,a)=>{"use strict";a.d(t,{$P:()=>E,BV:()=>H,C5:()=>L,Ix:()=>P,Zp:()=>A,g:()=>b,qh:()=>V,x$:()=>j,zy:()=>y});var n=a(6992),c=a(1609);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{c.value=n,c.getSnapshot=t,m(c)&&r({inst:c})}),[e,n,t]),l((()=>{m(c)&&r({inst:c});return e((()=>{m(c)&&r({inst:c})}))}),[e]),u(n),n};"useSyncExternalStore"in c&&c.useSyncExternalStore;const p=c.createContext(null);const h=c.createContext(null);const g=c.createContext(null);const v=c.createContext(null);const f=c.createContext({outlet:null,matches:[]});const w=c.createContext(null);function E(e,t){let{relative:a}=void 0===t?{}:t;k()||(0,n.V1)(!1);let{basename:r,navigator:s}=c.useContext(g),{hash:i,pathname:l,search:o}=j(e,{relative:a}),u=l;return"/"!==r&&(u="/"===l?r:(0,n.HS)([r,l])),s.createHref({pathname:u,search:o,hash:i})}function k(){return null!=c.useContext(v)}function y(){return k()||(0,n.V1)(!1),c.useContext(v).location}function A(){k()||(0,n.V1)(!1);let{basename:e,navigator:t}=c.useContext(g),{matches:a}=c.useContext(f),{pathname:r}=y(),s=JSON.stringify((0,n.sd)(a).map((e=>e.pathnameBase))),i=c.useRef(!1);return c.useEffect((()=>{i.current=!0})),c.useCallback((function(a,c){if(void 0===c&&(c={}),!i.current)return;if("number"==typeof a)return void t.go(a);let l=(0,n.Gh)(a,JSON.parse(s),r,"path"===c.relative);"/"!==e&&(l.pathname="/"===l.pathname?e:(0,n.HS)([e,l.pathname])),(c.replace?t.replace:t.push)(l,c.state,c)}),[e,t,s,r])}function b(){let{matches:e}=c.useContext(f),t=e[e.length-1];return t?t.params:{}}function j(e,t){let{relative:a}=void 0===t?{}:t,{matches:r}=c.useContext(f),{pathname:s}=y(),i=JSON.stringify((0,n.sd)(r).map((e=>e.pathnameBase)));return c.useMemo((()=>(0,n.Gh)(e,JSON.parse(i),s,"path"===a)),[e,i,s,a])}function R(){let e=function(){var e;let t=c.useContext(w),a=M(z.UseRouteError),n=S(z.UseRouteError);if(t)return t;return null==(e=a.errors)?void 0:e[n]}(),t=(0,n.pX)(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r};return c.createElement(c.Fragment,null,c.createElement("h2",null,"Unhandled Thrown Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),a?c.createElement("pre",{style:s},a):null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:i},"errorElement")," props on ",c.createElement("code",{style:i},"")))}class C extends c.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?c.createElement(f.Provider,{value:this.props.routeContext},c.createElement(w.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _(e){let{routeContext:t,match:a,children:n}=e,r=c.useContext(p);return r&&r.static&&r.staticContext&&a.route.errorElement&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),c.createElement(f.Provider,{value:t},n)}function x(e,t,a){if(void 0===t&&(t=[]),null==e){if(null==a||!a.errors)return null;e=a.matches}let r=e,s=null==a?void 0:a.errors;if(null!=s){let e=r.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||(0,n.V1)(!1),r=r.slice(0,Math.min(r.length,e+1))}return r.reduceRight(((e,n,i)=>{let l=n.route.id?null==s?void 0:s[n.route.id]:null,o=a?n.route.errorElement||c.createElement(R,null):null,u=t.concat(r.slice(0,i+1)),m=()=>c.createElement(_,{match:n,routeContext:{outlet:e,matches:u}},l?o:void 0!==n.route.element?n.route.element:e);return a&&(n.route.errorElement||0===i)?c.createElement(C,{location:a.location,component:o,error:l,children:m(),routeContext:{outlet:null,matches:u}}):m()}),null)}var N,z;function M(e){let t=c.useContext(h);return t||(0,n.V1)(!1),t}function S(e){let t=function(){let e=c.useContext(f);return e||(0,n.V1)(!1),e}(),a=t.matches[t.matches.length-1];return a.route.id||(0,n.V1)(!1),a.route.id}!function(e){e.UseRevalidator="useRevalidator"}(N||(N={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(z||(z={}));function L(e){let{to:t,replace:a,state:r,relative:s}=e;k()||(0,n.V1)(!1);let i=c.useContext(h),l=A();return c.useEffect((()=>{i&&"idle"!==i.navigation.state||l(t,{replace:a,state:r,relative:s})})),null}function V(e){(0,n.V1)(!1)}function P(e){let{basename:t="/",children:a=null,location:r,navigationType:s=n.rc.Pop,navigator:i,static:l=!1}=e;k()&&(0,n.V1)(!1);let o=t.replace(/^\/*/,"/"),u=c.useMemo((()=>({basename:o,navigator:i,static:l})),[o,i,l]);"string"==typeof r&&(r=(0,n.Rr)(r));let{pathname:m="/",search:d="",hash:p="",state:h=null,key:f="default"}=r,w=c.useMemo((()=>{let e=(0,n.pb)(m,o);return null==e?null:{pathname:e,search:d,hash:p,state:h,key:f}}),[o,m,d,p,h,f]);return null==w?null:c.createElement(g.Provider,{value:u},c.createElement(v.Provider,{children:a,value:{location:w,navigationType:s}}))}function H(e){let{children:t,location:a}=e,s=c.useContext(p);return function(e,t){k()||(0,n.V1)(!1);let{navigator:a}=c.useContext(g),s=c.useContext(h),{matches:i}=c.useContext(f),l=i[i.length-1],o=l?l.params:{},u=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let m,d=y();if(t){var p;let e="string"==typeof t?(0,n.Rr)(t):t;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||(0,n.V1)(!1),m=e}else m=d;let w=m.pathname||"/",E="/"===u?w:w.slice(u.length)||"/",A=(0,n.ue)(e,{pathname:E}),b=x(A&&A.map((e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:(0,n.HS)([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:(0,n.HS)([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,s||void 0);return t&&b?c.createElement(v.Provider,{value:{location:r({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:n.rc.Pop}},b):b}(s&&!t?s.router.routes:O(t),a)}var B;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(B||(B={}));new Promise((()=>{}));c.Component;function O(e,t){void 0===t&&(t=[]);let a=[];return c.Children.forEach(e,((e,r)=>{if(!c.isValidElement(e))return;if(e.type===c.Fragment)return void a.push.apply(a,O(e.props.children,t));e.type!==V&&(0,n.V1)(!1),e.props.index&&e.props.children&&(0,n.V1)(!1);let s=[...t,r],i={id:e.props.id||s.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(i.children=O(e.props.children,s)),a.push(i)})),a}},372:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6941);const c=a.n(n)()("dops:analytics");let r,s;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const i={initialize:function(e,t,a){i.setUser(e,t),i.setSuperProps(a),i.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){s={ID:e,username:t}},setSuperProps:function(e){r=e},assignSuperProps:function(e){r=Object.assign(r||{},e)},mc:{bumpStat:function(e,t){const a=function(e,t){let a="";if("object"==typeof e){for(const t in e)a+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);c("Bumping stats %o",e)}else a="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),c('Bumping stat "%s" in group "%s"',t,e);return a}(e,t);i.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+a+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const a=function(e,t){let a="";if("object"==typeof e){for(const t in e)a+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);c("Built stats %o",e)}else a="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),c('Built stat "%s" in group "%s"',t,e);return a}(e,t);i.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+a+"&t="+Math.random())}},pageView:{record:function(e,t){i.tracks.recordPageView(e),i.ga.recordPageView(e,t)}},purchase:{record:function(e,t,a,n,c,r,s){i.ga.recordPurchase(e,t,a,n,c,r,s)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(r&&(c("- Super Props: %o",r),t=Object.assign(t,r)),c('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):c('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};i.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){i.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){c("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};i.ga.initialized||(s&&(e={userId:"u-"+s.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),i.ga.initialized=!0)},recordPageView:function(e,t){i.ga.initialize(),c("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,a,n){i.ga.initialize();let r="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==a&&(r+=" [Option Label: "+a+"]"),void 0!==n&&(r+=" [Option Value: "+n+"]"),c(r),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,a,n)},recordPurchase:function(e,t,a,n,c,r,s){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:n,currency:s}),window.ga("ecommerce:addItem",{id:e,name:t,sku:a,price:c,quantity:r}),window.ga("ecommerce:send")}},identifyUser:function(){s&&window._tkq.push(["identifyUser",s.ID,s.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},l=i},5932:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>m});var n=a(6439),c=a(3832);function r(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const s=r("JsonParseError"),i=r("JsonParseAfterRedirectError"),l=r("Api404Error"),o=r("Api404AfterRedirectError"),u=r("FetchNetworkError");const m=new function(e,t){let a=e,r=e,s={"X-WP-Nonce":t},i={credentials:"same-origin",headers:s},l={method:"post",credentials:"same-origin",headers:Object.assign({},s,{"Content-type":"application/json"})},o=function(e){const t=e.split("?"),a=t.length>1?t[1]:"",n=a.length?a.split("&"):[];return n.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+n.join("&")};const u={setApiRoot(e){a=e},setWpcomOriginApiUrl(e){r=e},setApiNonce(e){s={"X-WP-Nonce":e},i={credentials:"same-origin",headers:s},l={method:"post",credentials:"same-origin",headers:Object.assign({},s,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{o=e},registerSite:(e,t,c)=>{const r={registration_nonce:e,no_iframe:!0};return(0,n.jetpackConfigHas)("consumer_slug")&&(r.plugin_slug=(0,n.jetpackConfigGet)("consumer_slug")),null!==t&&(r.redirect_uri=t),c&&(r.from=c),h(`${a}jetpack/v4/connection/register`,l,{body:JSON.stringify(r)}).then(d).then(p)},fetchAuthorizationUrl:e=>m((0,c.addQueryArgs)(`${a}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),i).then(d).then(p),fetchSiteConnectionData:()=>m(`${a}jetpack/v4/connection/data`,i).then(p),fetchSiteConnectionStatus:()=>m(`${a}jetpack/v4/connection`,i).then(p),fetchSiteConnectionTest:()=>m(`${a}jetpack/v4/connection/test`,i).then(d).then(p),fetchUserConnectionData:()=>m(`${a}jetpack/v4/connection/data`,i).then(p),fetchUserTrackingSettings:()=>m(`${a}jetpack/v4/tracking/settings`,i).then(d).then(p),updateUserTrackingSettings:e=>h(`${a}jetpack/v4/tracking/settings`,l,{body:JSON.stringify(e)}).then(d).then(p),disconnectSite:()=>h(`${a}jetpack/v4/connection`,l,{body:JSON.stringify({isActive:!1})}).then(d).then(p),fetchConnectUrl:()=>m(`${a}jetpack/v4/connection/url`,i).then(d).then(p),unlinkUser:()=>h(`${a}jetpack/v4/connection/user`,l,{body:JSON.stringify({linked:!1})}).then(d).then(p),reconnect:()=>h(`${a}jetpack/v4/connection/reconnect`,l).then(d).then(p),fetchConnectedPlugins:()=>m(`${a}jetpack/v4/connection/plugins`,i).then(d).then(p),setHasSeenWCConnectionModal:()=>h(`${a}jetpack/v4/seen-wc-connection-modal`,l).then(d).then(p),fetchModules:()=>m(`${a}jetpack/v4/module/all`,i).then(d).then(p),fetchModule:e=>m(`${a}jetpack/v4/module/${e}`,i).then(d).then(p),activateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,l,{body:JSON.stringify({active:!0})}).then(d).then(p),deactivateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,l,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${a}jetpack/v4/module/${e}`,l,{body:JSON.stringify(t)}).then(d).then(p),updateSettings:e=>h(`${a}jetpack/v4/settings`,l,{body:JSON.stringify(e)}).then(d).then(p),getProtectCount:()=>m(`${a}jetpack/v4/module/protect/data`,i).then(d).then(p),resetOptions:e=>h(`${a}jetpack/v4/options/${e}`,l,{body:JSON.stringify({reset:!0})}).then(d).then(p),activateVaultPress:()=>h(`${a}jetpack/v4/plugins`,l,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(d).then(p),getVaultPressData:()=>m(`${a}jetpack/v4/module/vaultpress/data`,i).then(d).then(p),installPlugin:(e,t)=>{const n={slug:e,status:"active"};return t&&(n.source=t),h(`${a}jetpack/v4/plugins`,l,{body:JSON.stringify(n)}).then(d).then(p)},activateAkismet:()=>h(`${a}jetpack/v4/plugins`,l,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(d).then(p),getAkismetData:()=>m(`${a}jetpack/v4/module/akismet/data`,i).then(d).then(p),checkAkismetKey:()=>m(`${a}jetpack/v4/module/akismet/key/check`,i).then(d).then(p),checkAkismetKeyTyped:e=>h(`${a}jetpack/v4/module/akismet/key/check`,l,{body:JSON.stringify({api_key:e})}).then(d).then(p),fetchStatsData:e=>m(function(e){let t=`${a}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),i).then(d).then(p).then(v),getPluginUpdates:()=>m(`${a}jetpack/v4/updates/plugins`,i).then(d).then(p),getPlans:()=>m(`${a}jetpack/v4/plans`,i).then(d).then(p),fetchSettings:()=>m(`${a}jetpack/v4/settings`,i).then(d).then(p),updateSetting:e=>h(`${a}jetpack/v4/settings`,l,{body:JSON.stringify(e)}).then(d).then(p),fetchSiteData:()=>m(`${a}jetpack/v4/site`,i).then(d).then(p).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>m(`${a}jetpack/v4/site/features`,i).then(d).then(p).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>m(`${a}jetpack/v4/site/products`,i).then(d).then(p),fetchSitePurchases:()=>m(`${a}jetpack/v4/site/purchases`,i).then(d).then(p).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>m(`${a}jetpack/v4/site/benefits`,i).then(d).then(p).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>m(`${a}jetpack/v4/site/discount`,i).then(d).then(p).then((e=>e.data)),fetchSetupQuestionnaire:()=>m(`${a}jetpack/v4/setup/questionnaire`,i).then(d).then(p),fetchRecommendationsData:()=>m(`${a}jetpack/v4/recommendations/data`,i).then(d).then(p),fetchRecommendationsProductSuggestions:()=>m(`${a}jetpack/v4/recommendations/product-suggestions`,i).then(d).then(p),fetchRecommendationsUpsell:()=>m(`${a}jetpack/v4/recommendations/upsell`,i).then(d).then(p),fetchRecommendationsConditional:()=>m(`${a}jetpack/v4/recommendations/conditional`,i).then(d).then(p),saveRecommendationsData:e=>h(`${a}jetpack/v4/recommendations/data`,l,{body:JSON.stringify({data:e})}).then(d),fetchProducts:()=>m(`${a}jetpack/v4/products`,i).then(d).then(p),fetchRewindStatus:()=>m(`${a}jetpack/v4/rewind`,i).then(d).then(p).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>m(`${a}jetpack/v4/scan`,i).then(d).then(p).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${a}jetpack/v4/notice/${e}`,l,{body:JSON.stringify({dismissed:!0})}).then(d).then(p),fetchPluginsData:()=>m(`${a}jetpack/v4/plugins`,i).then(d).then(p),fetchIntroOffers:()=>m(`${a}jetpack/v4/intro-offers`,i).then(d).then(p),fetchVerifySiteGoogleStatus:e=>m(null!==e?`${a}jetpack/v4/verify-site/google/${e}`:`${a}jetpack/v4/verify-site/google`,i).then(d).then(p),verifySiteGoogle:e=>h(`${a}jetpack/v4/verify-site/google`,l,{body:JSON.stringify({keyring_id:e})}).then(d).then(p),submitSurvey:e=>h(`${a}jetpack/v4/marketing/survey`,l,{body:JSON.stringify(e)}).then(d).then(p),saveSetupQuestionnaire:e=>h(`${a}jetpack/v4/setup/questionnaire`,l,{body:JSON.stringify(e)}).then(d).then(p),updateLicensingError:e=>h(`${a}jetpack/v4/licensing/error`,l,{body:JSON.stringify(e)}).then(d).then(p),updateLicenseKey:e=>h(`${a}jetpack/v4/licensing/set-license`,l,{body:JSON.stringify({license:e})}).then(d).then(p),getUserLicensesCounts:()=>m(`${a}jetpack/v4/licensing/user/counts`,i).then(d).then(p),getUserLicenses:()=>m(`${a}jetpack/v4/licensing/user/licenses`,i).then(d).then(p),updateLicensingActivationNoticeDismiss:e=>h(`${a}jetpack/v4/licensing/user/activation-notice-dismiss`,l,{body:JSON.stringify({last_detached_count:e})}).then(d).then(p),updateRecommendationsStep:e=>h(`${a}jetpack/v4/recommendations/step`,l,{body:JSON.stringify({step:e})}).then(d),confirmIDCSafeMode:()=>h(`${a}jetpack/v4/identity-crisis/confirm-safe-mode`,l).then(d),startIDCFresh:e=>h(`${a}jetpack/v4/identity-crisis/start-fresh`,l,{body:JSON.stringify({redirect_uri:e})}).then(d).then(p),migrateIDC:()=>h(`${a}jetpack/v4/identity-crisis/migrate`,l).then(d),attachLicenses:e=>h(`${a}jetpack/v4/licensing/attach-licenses`,l,{body:JSON.stringify({licenses:e})}).then(d).then(p),fetchSearchPlanInfo:()=>m(`${r}jetpack/v4/search/plan`,i).then(d).then(p),fetchSearchSettings:()=>m(`${r}jetpack/v4/search/settings`,i).then(d).then(p),updateSearchSettings:e=>h(`${r}jetpack/v4/search/settings`,l,{body:JSON.stringify(e)}).then(d).then(p),fetchSearchStats:()=>m(`${r}jetpack/v4/search/stats`,i).then(d).then(p),fetchWafSettings:()=>m(`${a}jetpack/v4/waf`,i).then(d).then(p),updateWafSettings:e=>h(`${a}jetpack/v4/waf`,l,{body:JSON.stringify(e)}).then(d).then(p),fetchWordAdsSettings:()=>m(`${a}jetpack/v4/wordads/settings`,i).then(d).then(p),updateWordAdsSettings:e=>h(`${a}jetpack/v4/wordads/settings`,l,{body:JSON.stringify(e)}),fetchSearchPricing:()=>m(`${r}jetpack/v4/search/pricing`,i).then(d).then(p),fetchMigrationStatus:()=>m(`${a}jetpack/v4/migration/status`,i).then(d).then(p),fetchBackupUndoEvent:()=>m(`${a}jetpack/v4/site/backup/undo-event`,i).then(d).then(p),fetchBackupPreflightStatus:()=>m(`${a}jetpack/v4/site/backup/preflight`,i).then(d).then(p)};function m(e,t){return fetch(o(e),t)}function h(e,t,a){return fetch(e,Object.assign({},t,a)).catch(g)}function v(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,u)};function d(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new o(e.redirected):new l})):e.json().catch((e=>h(e))).then((t=>{const a=new Error(`${t.message} (Status ${e.status})`);throw a.response=t,a.name="ApiError",a}))}function p(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,a){throw t?new i(a):new s}function g(){throw new u}},1197:(e,t,a)=>{"use strict";a.d(t,{h:()=>s});var n=a(7723),c=a(5289),r=a(4144);const __=n.__;class s extends Error{constructor(e,t,a){super(),this.httpCode=e,this.body=t,this.parseError=a}get message(){switch(this.httpCode){case 403:return this.getRestApiErrorMessage();case 200:if(this.parseError)return(0,n.sprintf)(/* Translators: %s refers to a browser-supplied error message (hopefully already in the right language) */ +__("Received invalid response while communicating with your WordPress site: %s","jetpack-my-jetpack"),this.parseError.message)}return(0,n.sprintf)(/* Translators: %d refers to numeric HTTP error code */ +__("HTTP %d error received while communicating with the server.","jetpack-my-jetpack"),this.httpCode)}getDisplayBody(){return(0,r.O)(this.body)?JSON.stringify(this.body,null," "):(0,c.w)(this.body,"").substring(0,1e3)}getRestApiErrorMessage(){return __("Your site's REST API does not seem to be accessible. Jetpack Boost requires access to your REST API in order to receive site performance scores. Please make sure that your site's REST API is active and accessible, and try again.","jetpack-my-jetpack")}}},5098:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(7723),c=a(1197),r=a(8882);const __=n.__;async function s(e,t,a,c=null,s){const i={method:e,mode:"cors",headers:{"X-WP-Nonce":s}};"post"!==e&&"delete"!==e||!c||(i.body=JSON.stringify(c),i.headers["Content-Type"]="application/json");const l=function(e,t){return t+r.K+r.L+e}(a,t);let o;try{o=await fetch(l,i)}catch(e){const t=i;delete t.body,delete t.headers["X-WP-Nonce"];const a={requestInitiator:window.location.href,requestUrl:l,requestArgs:t,originalErrorMessage:e.toString()};throw new Error((0,n.sprintf)(/* Translators: %s refers to a string representation of an error object containing useful debug information */ +__("An error occurred while trying to communicate with the site REST API. Extra debug info: %s","jetpack-my-jetpack"),JSON.stringify(a)))}return o}async function i(e,t,a,n=null,r){const i=await s(e,t,a,n,r);let l,o;try{l=await i.text()}catch(e){throw new c.h(i.status,null,e)}try{o=JSON.parse(l)}catch(e){throw new c.h(i.status,l,e)}if(!i.ok)throw new c.h(i.status,o,null);return o}const l={get:function(e,t,a){return i("get",e,t,null,a)},post:function(e,t,a=null,n){return i("post",e,t,a,n)}}},8882:(e,t,a)=>{"use strict";a.d(t,{K:()=>n,L:()=>c});const n="jetpack-boost/v1",c=""},8454:(e,t,a)=>{"use strict";a.d(t,{T:()=>h,US:()=>g,sE:()=>d});var n=a(7723),c=a(5098),r=a(4753),s=a(5289),i=a(4144),l=a(8991),o=a(3470);const __=n.__,u=12e4,m=5e3;async function d(e=!1,t,a,n){const r=p(await c.A.post(t,e?"/speed-scores/refresh":"/speed-scores",{url:a},n));return r.scores?r.scores:await async function(e,t,a){return(0,l.A)({timeout:u,interval:m,timeoutError:__("Timed out while waiting for speed-score.","jetpack-my-jetpack"),callback:async n=>{const r=p(await c.A.post(e,"/speed-scores",{url:t},a));r.scores&&n(r.scores)}})}(t,a,n)}function p(e){if(e.error){const t=__("An unknown error occurred while requesting metrics","jetpack-my-jetpack");throw(0,o.g)(e.error,t)}if((0,i.O)(e.scores))return{status:"success",scores:{current:(0,i.O)(e.scores.current)?{mobile:(0,r.G)(e.scores.current.mobile,0),desktop:(0,r.G)(e.scores.current.desktop,0)}:{mobile:0,desktop:0},noBoost:(0,i.O)(e.scores.noBoost)?{mobile:(0,r.G)(e.scores.noBoost.mobile,0),desktop:(0,r.G)(e.scores.noBoost.desktop,0)}:null,isStale:!!e.scores.isStale}};const t=(0,s.w)(e.status);if(!t)throw new Error(__("Invalid response while requesting metrics","jetpack-my-jetpack"));return{status:t}}function h(e,t){const a=(e+t)/2;return a>90?"A":a>75?"B":a>50?"C":a>35?"D":a>25?"E":"F"}function g(e){const t=new Date(e),a=(new Date).valueOf()-t.valueOf();return Math.floor(a/864e5)}},4753:(e,t,a)=>{"use strict";function n(e,t=void 0){if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t}a.d(t,{G:()=>n})},5289:(e,t,a)=>{"use strict";function n(e,t=void 0){return"string"==typeof e?e:e&&e.toString instanceof Function?e.toString():t}a.d(t,{w:()=>n})},4144:(e,t,a)=>{"use strict";function n(e){return!!e&&e instanceof Object&&!(e instanceof Array)}a.d(t,{O:()=>n})},8991:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(7723);const __=n.__;async function c({interval:e,callback:t,timeout:a,timeoutError:n}){let c,r;return new Promise(((s,i)=>{c=setTimeout((()=>{i(new Error(n||__("Timed out","jetpack-my-jetpack")))}),a||12e4),r=setInterval((async()=>{try{await Promise.resolve(t(s))}catch(e){i(e)}}),e)})).finally((()=>{clearTimeout(c),clearInterval(r)}))}},3470:(e,t,a)=>{"use strict";function n(e,t){return e instanceof Error?e:"string"==typeof e||e instanceof String?new Error(e.toString()):e.message?new Error(e.message):t?new Error(t):new Error(JSON.stringify(e))}a.d(t,{g:()=>n})},8089:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(6427),c=a(7723),r=a(3022),s=a(5739),i=a.n(s),l=a(1609),o=a.n(l),u=a(1112),m=a(7689);const __=c.__,d=e=>{const{label:t,onClick:a,isLoading:c=!1,loadingText:s,isDisabled:i,displayError:l=!1,errorMessage:d=__("An error occurred. Please try again.","jetpack-my-jetpack"),customClass:p}=e,h=s||o().createElement(n.Spinner,null);return o().createElement(o().Fragment,null,o().createElement(u.A,{className:(0,r.A)(m.A.button,"jp-action-button--button",p),label:t,onClick:a,variant:"primary",disabled:c||i},c?h:t),l&&o().createElement("p",{className:(0,r.A)(m.A.error,"jp-action-button__error")},d))};d.propTypes={label:i().string.isRequired,onClick:i().func,isLoading:i().bool,isDisabled:i().bool,displayError:i().bool,errorMessage:i().oneOfType([i().string,i().element])};const p=d},2947:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(7723),c=a(3022),r=a(8250),s=a(7142),i=a(8509),l=a(5918),o=a(2021);const __=n.__,u=({children:e,moduleName:t=__("Jetpack","jetpack-my-jetpack"),moduleNameHref:a,showHeader:n=!0,showFooter:u=!0,showBackground:m=!0,header:d})=>{const p=(0,c.A)(o.A["admin-page"],{[o.A.background]:m});return React.createElement("div",{className:p},n&&React.createElement(l.A,{horizontalSpacing:5},React.createElement(i.A,null,d||React.createElement(s.A,null))),React.createElement(l.A,{fluid:!0,horizontalSpacing:0},React.createElement(i.A,null,e)),u&&React.createElement(l.A,{horizontalSpacing:5},React.createElement(i.A,null,React.createElement(r.A,{moduleName:t,moduleNameHref:a}))))}},5640:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(1609),c=a.n(n),r=a(654);const s=({children:e})=>c().createElement("div",{className:r.A.section},e)},766:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(1609),c=a.n(n),r=a(6888);const s=({children:e})=>c().createElement("div",{className:r.A["section-hero"]},e)},2266:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(311),c=a(9783),r=a(3883),s=a(1113),i=a(3022),l=a(1609),o=a.n(l),u=a(6588);const m=e=>{switch(e){case"error":case"warning":default:return n.A;case"info":return c.A;case"success":return r.A}},d=({level:e="warning",children:t,showIcon:a=!0,className:n})=>{const c=(0,i.A)(u.A.container,u.A[`is-${e}`],n);return o().createElement("div",{className:c},a&&o().createElement("div",{className:u.A["icon-wrapper"]},o().createElement(s.A,{icon:m(e),className:u.A.icon})),o().createElement("div",null,t))}},8907:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(6072),c=a.n(n),r=a(7723),s=a(3022),i=a(1609),l=a.n(i);const __=r.__,o=({title:e=__("An Automattic Airline","jetpack-my-jetpack"),height:t=7,className:a,...n})=>l().createElement("svg",c()({role:"img",x:"0",y:"0",viewBox:"0 0 935 38.2",enableBackground:"new 0 0 935 38.2","aria-labelledby":"jp-automattic-byline-logo-title",height:t,className:(0,s.A)("jp-automattic-byline-logo",a)},n),l().createElement("desc",{id:"jp-automattic-byline-logo-title"},e),l().createElement("path",{d:"M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z"}),l().createElement("path",{d:"M37.5 36.7l-4.7-8.9H11.7l-4.6 8.9H0L19.4 0.8H25l19.7 35.9H37.5zM22 7.8l-7.8 15.1h15.9L22 7.8zM82.8 36.7l-23.3-24 -2.3-2.5v26.6h-6.7v-36H57l22.6 24 2.3 2.6V0.8h6.7v35.9H82.8z"}),l().createElement("path",{d:"M719.9 37l-4.8-8.9H694l-4.6 8.9h-7.1l19.5-36h5.6l19.8 36H719.9zM704.4 8l-7.8 15.1h15.9L704.4 8zM733 37V1h6.8v36H733zM781 37c-1.8 0-2.6-2.5-2.9-5.8l-0.2-3.7c-0.2-3.6-1.7-5.1-8.4-5.1h-12.8V37H750V1h19.6c10.8 0 15.7 4.3 15.7 9.9 0 3.9-2 7.7-9 9 7 0.5 8.5 3.7 8.6 7.9l0.1 3c0.1 2.5 0.5 4.3 2.2 6.1V37H781zM778.5 11.8c0-2.6-2.1-5.1-7.9-5.1h-13.8v10.8h14.4c5 0 7.3-2.4 7.3-5.2V11.8zM794.8 37V1h6.8v30.4h28.2V37H794.8zM836.7 37V1h6.8v36H836.7zM886.2 37l-23.4-24.1 -2.3-2.5V37h-6.8V1h6.5l22.7 24.1 2.3 2.6V1h6.8v36H886.2zM902.3 37V1H935v5.6h-26v9.2h20v5.5h-20v10.1h26V37H902.3z"}))},580:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(7723),c=a(3022),r=a(1883);a(6552);const __=n.__,s=({score:e,isLoading:t,showPrevScores:a,active:n,prevScore:s=0,scoreBarType:i,noBoostScoreTooltip:l})=>{if(!n)return null;const o=s/e*100,u=__("Desktop score","jetpack-my-jetpack"),m=__("Mobile score","jetpack-my-jetpack");return React.createElement("div",{className:(0,c.A)("jb-score-bar",`jb-score-bar--${i}`)},React.createElement("div",{className:"jb-score-bar__label"},"desktop"===i?React.createElement(r.A,{icon:"computer",size:24}):React.createElement(r.A,{icon:"phone",size:24}),React.createElement("div",null,"desktop"===i?u:m)),React.createElement("div",{className:"jb-score-bar__bounds"},React.createElement("div",{className:(0,c.A)("jb-score-bar__filler",t&&!e?"fill-loading":e>70?"fill-good":e>50?"fill-mediocre":"fill-bad"),style:{width:`${e}%`}},t?React.createElement("div",{className:"jb-score-bar__loading"},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 128 128"},React.createElement("g",null,React.createElement("path",{d:"M64 0a7 7 0 11-7 7 7 7 0 017-7zm29.86 12.2a2.8 2.8 0 11-3.83 1.02 2.8 2.8 0 013.83-1.02zm22.16 21.68a3.15 3.15 0 11-4.3-1.15 3.15 3.15 0 014.3 1.15zm.87 60.53a4.2 4.2 0 11-1.57-5.7 4.2 4.2 0 011.54 5.73zm7.8-30.5a3.85 3.85 0 11-3.85-3.85 3.85 3.85 0 013.85 3.84zm-30 53.2a4.55 4.55 0 111.66-6.23 4.55 4.55 0 01-1.67 6.22zM64 125.9a4.9 4.9 0 114.9-4.9 4.9 4.9 0 01-4.9 4.9zm-31.06-8.22a5.25 5.25 0 117.17-1.93 5.25 5.25 0 01-7.14 1.93zM9.9 95.1a5.6 5.6 0 117.65 2.06A5.6 5.6 0 019.9 95.1zM1.18 63.9a5.95 5.95 0 115.95 5.94 5.95 5.95 0 01-5.96-5.94zm8.1-31.6a6.3 6.3 0 112.32 8.6 6.3 6.3 0 01-2.3-8.6zM32.25 8.87a6.65 6.65 0 11-2.44 9.1 6.65 6.65 0 012.46-9.1z"}),React.createElement("animateTransform",{attributeName:"transform",type:"rotate",values:"0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64",calcMode:"discrete",dur:"1080ms",repeatCount:"indefinite"})))):React.createElement("div",{className:"jb-score-bar__score"},e),a&&!!s&&s{"use strict";a.d(t,{A:()=>h});var n=a(6072),c=a.n(n),r=a(6427),s=a(7723),i=a(1113),l=a(3512),o=a(3022),u=a(1609),m=a.n(u),d=a(2258);const __=s.__,p=(0,u.forwardRef)(((e,t)=>{const{children:a,variant:n="primary",size:s="normal",weight:u="bold",icon:p,iconSize:h,disabled:g,isDestructive:v,isLoading:f,isExternalLink:w,className:E,text:k,fullWidth:y,...A}=e,b=(0,o.A)(d.A.button,E,{[d.A.normal]:"normal"===s,[d.A.small]:"small"===s,[d.A.icon]:Boolean(p),[d.A.loading]:f,[d.A.regular]:"regular"===u,[d.A["full-width"]]:y,[d.A["is-icon-button"]]:Boolean(p)&&!a});A.ref=t;const j="normal"===s?20:16,R=w&&m().createElement(m().Fragment,null,m().createElement(i.A,{size:j,icon:l.A,className:d.A["external-icon"]}),m().createElement(r.VisuallyHidden,{as:"span"},/* translators: accessibility text */ +__("(opens in a new tab)","jetpack-my-jetpack"))),C=w?"_blank":void 0,_=a?.[0]&&null!==a[0]&&"components-tooltip"!==a?.[0]?.props?.className;return m().createElement(r.Button,c()({target:C,variant:n,className:(0,o.A)(b,{"has-text":!!p&&_}),icon:w?void 0:p,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:v,text:k},A),f&&m().createElement(r.Spinner,null),m().createElement("span",null,a),R)}));p.displayName="Button";const h=p},1883:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(7723),c=a(3022),r=a(1609);a(3689);const __=n.__;class s extends r.Component{static defaultProps={"aria-hidden":"false",focusable:"true"};needsOffset(e,t){return["gridicons-arrow-left","gridicons-arrow-right","gridicons-calendar","gridicons-cart","gridicons-folder","gridicons-info","gridicons-info-outline","gridicons-posts","gridicons-star-outline","gridicons-star"].indexOf(e)>=0&&t%18==0}getSVGDescription(e){if("description"in this.props)return this.props.description;switch(e){default:return"";case"gridicons-audio":return __("Has audio.","jetpack-my-jetpack");case"gridicons-arrow-left":return __("Arrow left","jetpack-my-jetpack");case"gridicons-arrow-right":return __("Arrow right","jetpack-my-jetpack");case"gridicons-calendar":return __("Is an event.","jetpack-my-jetpack");case"gridicons-cart":return __("Is a product.","jetpack-my-jetpack");case"chevron-down":return __("Show filters","jetpack-my-jetpack");case"gridicons-comment":return __("Matching comment.","jetpack-my-jetpack");case"gridicons-cross":return __("Close.","jetpack-my-jetpack");case"gridicons-filter":return __("Toggle search filters.","jetpack-my-jetpack");case"gridicons-folder":return __("Category","jetpack-my-jetpack");case"gridicons-info":case"gridicons-info-outline":return __("Information.","jetpack-my-jetpack");case"gridicons-image-multiple":return __("Has multiple images.","jetpack-my-jetpack");case"gridicons-image":return __("Has an image.","jetpack-my-jetpack");case"gridicons-page":return __("Page","jetpack-my-jetpack");case"gridicons-post":return __("Post","jetpack-my-jetpack");case"gridicons-jetpack-search":case"gridicons-search":return __("Magnifying Glass","jetpack-my-jetpack");case"gridicons-tag":return __("Tag","jetpack-my-jetpack");case"gridicons-video":return __("Has a video.","jetpack-my-jetpack")}}renderIcon(e){switch(e){default:return null;case"gridicons-audio":return React.createElement("g",null,React.createElement("path",{d:"M8 4v10.184C7.686 14.072 7.353 14 7 14c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V7h7v4.184c-.314-.112-.647-.184-1-.184-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V4H8z"}));case"gridicons-arrow-left":return React.createElement("g",null,React.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}));case"gridicons-arrow-right":return React.createElement("g",null,React.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"}));case"gridicons-block":return React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12c0-4.418 3.582-8 8-8 1.848 0 3.545.633 4.9 1.686L5.686 16.9C4.633 15.545 4 13.848 4 12zm8 8c-1.848 0-3.546-.633-4.9-1.686L18.314 7.1C19.367 8.455 20 10.152 20 12c0 4.418-3.582 8-8 8z"}));case"gridicons-calendar":return React.createElement("g",null,React.createElement("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.105 0-2 .896-2 2v13c0 1.104.895 2 2 2h14c1.104 0 2-.896 2-2V6c0-1.104-.896-2-2-2zm0 15H5V8h14v11z"}));case"gridicons-cart":return React.createElement("g",null,React.createElement("path",{d:"M9 20c0 1.1-.9 2-2 2s-1.99-.9-1.99-2S5.9 18 7 18s2 .9 2 2zm8-2c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm.396-5c.937 0 1.75-.65 1.952-1.566L21 5H7V4c0-1.105-.895-2-2-2H3v2h2v11c0 1.105.895 2 2 2h12c0-1.105-.895-2-2-2H7v-2h10.396z"}));case"gridicons-checkmark":return React.createElement("g",null,React.createElement("path",{d:"M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z"}));case"gridicons-chevron-left":return React.createElement("g",null,React.createElement("path",{d:"M16.443 7.41L15.0399 6L9.06934 12L15.0399 18L16.443 16.59L11.8855 12L16.443 7.41Z"}));case"gridicons-chevron-right":return React.createElement("g",null,React.createElement("path",{d:"M10.2366 6L8.8335 7.41L13.391 12L8.8335 16.59L10.2366 18L16.2072 12L10.2366 6Z"}));case"gridicons-chevron-down":return React.createElement("g",null,React.createElement("path",{d:"M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586"}));case"gridicons-comment":return React.createElement("g",null,React.createElement("path",{d:"M3 6v9c0 1.105.895 2 2 2h9v5l5.325-3.804c1.05-.75 1.675-1.963 1.675-3.254V6c0-1.105-.895-2-2-2H5c-1.105 0-2 .895-2 2z"}));case"gridicons-computer":return React.createElement("g",null,React.createElement("path",{d:"M20 2H4c-1.104 0-2 .896-2 2v12c0 1.104.896 2 2 2h6v2H7v2h10v-2h-3v-2h6c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm0 14H4V4h16v12z"}));case"gridicons-cross":return React.createElement("g",null,React.createElement("path",{d:"M18.36 19.78L12 13.41l-6.36 6.37-1.42-1.42L10.59 12 4.22 5.64l1.42-1.42L12 10.59l6.36-6.36 1.41 1.41L13.41 12l6.36 6.36z"}));case"gridicons-filter":return React.createElement("g",null,React.createElement("path",{d:"M10 19h4v-2h-4v2zm-4-6h12v-2H6v2zM3 5v2h18V5H3z"}));case"gridicons-folder":return React.createElement("g",null,React.createElement("path",{d:"M18 19H6c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2h7c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2z"}));case"gridicons-image":return React.createElement("g",null,React.createElement("path",{d:"M13 9.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5-.672 1.5-1.5 1.5-1.5-.672-1.5-1.5zM22 6v12c0 1.105-.895 2-2 2H4c-1.105 0-2-.895-2-2V6c0-1.105.895-2 2-2h16c1.105 0 2 .895 2 2zm-2 0H4v7.444L8 9l5.895 6.55 1.587-1.85c.798-.932 2.24-.932 3.037 0L20 15.426V6z"}));case"gridicons-image-multiple":return React.createElement("g",null,React.createElement("path",{d:"M15 7.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5S17.328 9 16.5 9 15 8.328 15 7.5zM4 20h14c0 1.105-.895 2-2 2H4c-1.1 0-2-.9-2-2V8c0-1.105.895-2 2-2v14zM22 4v12c0 1.105-.895 2-2 2H8c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zM8 4v6.333L11 7l4.855 5.395.656-.73c.796-.886 2.183-.886 2.977 0l.513.57V4H8z"}));case"gridicons-info":return React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}));case"gridicons-info-outline":return React.createElement("g",null,React.createElement("path",{d:"M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"}));case"gridicons-jetpack-search":return React.createElement("g",null,React.createElement("path",{d:"M0 9.257C0 4.15 4.151 0 9.257 0c5.105 0 9.256 4.151 9.256 9.257a9.218 9.218 0 01-2.251 6.045l.034.033h1.053L24 22.01l-1.986 1.989-6.664-6.662v-1.055l-.033-.033a9.218 9.218 0 01-6.06 2.264C4.15 18.513 0 14.362 0 9.257zm4.169 1.537h4.61V1.82l-4.61 8.973zm5.547-3.092v8.974l4.61-8.974h-4.61z"}));case"gridicons-phone":return React.createElement("g",null,React.createElement("path",{d:"M16 2H8c-1.104 0-2 .896-2 2v16c0 1.104.896 2 2 2h8c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm-3 19h-2v-1h2v1zm3-2H8V5h8v14z"}));case"gridicons-pages":return React.createElement("g",null,React.createElement("path",{d:"M16 8H8V6h8v2zm0 2H8v2h8v-2zm4-6v12l-6 6H6c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zm-2 10V4H6v16h6v-4c0-1.105.895-2 2-2h4z"}));case"gridicons-posts":return React.createElement("g",null,React.createElement("path",{d:"M16 19H3v-2h13v2zm5-10H3v2h18V9zM3 5v2h11V5H3zm14 0v2h4V5h-4zm-6 8v2h10v-2H11zm-8 0v2h5v-2H3z"}));case"gridicons-search":return React.createElement("g",null,React.createElement("path",{d:"M21 19l-5.154-5.154C16.574 12.742 17 11.42 17 10c0-3.866-3.134-7-7-7s-7 3.134-7 7 3.134 7 7 7c1.42 0 2.742-.426 3.846-1.154L19 21l2-2zM5 10c0-2.757 2.243-5 5-5s5 2.243 5 5-2.243 5-5 5-5-2.243-5-5z"}));case"gridicons-star-outline":return React.createElement("g",null,React.createElement("path",{d:"M12 6.308l1.176 3.167.347.936.997.042 3.374.14-2.647 2.09-.784.62.27.963.91 3.25-2.813-1.872-.83-.553-.83.552-2.814 1.87.91-3.248.27-.962-.783-.62-2.648-2.092 3.374-.14.996-.04.347-.936L12 6.308M12 2L9.418 8.953 2 9.257l5.822 4.602L5.82 21 12 16.89 18.18 21l-2.002-7.14L22 9.256l-7.418-.305L12 2z"}));case"gridicons-star":return React.createElement("g",null,React.createElement("path",{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"}));case"gridicons-tag":return React.createElement("g",null,React.createElement("path",{d:"M20 2.007h-7.087c-.53 0-1.04.21-1.414.586L2.592 11.5c-.78.78-.78 2.046 0 2.827l7.086 7.086c.78.78 2.046.78 2.827 0l8.906-8.906c.376-.374.587-.883.587-1.413V4.007c0-1.105-.895-2-2-2zM17.007 9c-1.105 0-2-.895-2-2s.895-2 2-2 2 .895 2 2-.895 2-2 2z"}));case"gridicons-video":return React.createElement("g",null,React.createElement("path",{d:"M20 4v2h-2V4H6v2H4V4c-1.105 0-2 .895-2 2v12c0 1.105.895 2 2 2v-2h2v2h12v-2h2v2c1.105 0 2-.895 2-2V6c0-1.105-.895-2-2-2zM6 16H4v-3h2v3zm0-5H4V8h2v3zm4 4V9l4.5 3-4.5 3zm10 1h-2v-3h2v3zm0-5h-2V8h2v3z"}));case"gridicons-lock":return React.createElement(React.Fragment,null,React.createElement("g",{id:"lock"},React.createElement("path",{d:"M18,8h-1V7c0-2.757-2.243-5-5-5S7,4.243,7,7v1H6c-1.105,0-2,0.895-2,2v10c0,1.105,0.895,2,2,2h12c1.105,0,2-0.895,2-2V10 C20,8.895,19.105,8,18,8z M9,7c0-1.654,1.346-3,3-3s3,1.346,3,3v1H9V7z M13,15.723V18h-2v-2.277c-0.595-0.346-1-0.984-1-1.723 c0-1.105,0.895-2,2-2s2,0.895,2,2C14,14.738,13.595,15.376,13,15.723z"})),React.createElement("g",{id:"Layer_1"}));case"gridicons-external":return React.createElement("g",null,React.createElement("path",{d:"M19 13v6c0 1.105-.895 2-2 2H5c-1.105 0-2-.895-2-2V7c0-1.105.895-2 2-2h6v2H5v12h12v-6h2zM13 3v2h4.586l-7.793 7.793 1.414 1.414L19 6.414V11h2V3h-8z"}))}}render(){const{size:e=24,className:t=""}=this.props,a=this.props.height||e,n=this.props.width||e,r=this.props.style||{height:a,width:n},s="gridicons-"+this.props.icon,i=(0,c.A)("gridicon",s,t,{"needs-offset":this.needsOffset(s,e)}),l=this.getSVGDescription(s);return React.createElement("svg",{className:i,focusable:this.props.focusable,height:a,onClick:this.props.onClick,style:r,viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg","aria-hidden":this.props["aria-hidden"]},l?React.createElement("desc",null,l):null,this.renderIcon(s))}}const i=s},597:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6427),c=a(3022),r=a(1609),s=a.n(r),i=a(1112),l=a(1883);a(4803);const o=e=>({"top-end":"top left",top:"top center","top-start":"top right","bottom-end":"bottom left",bottom:"bottom center","bottom-start":"bottom right"}[e]),u=({className:e="",iconClassName:t="",placement:a="bottom-end",animate:u=!0,iconCode:m="info-outline",iconSize:d=18,offset:p=10,title:h,children:g,popoverAnchorStyle:v="icon",forceShow:f=!1,wide:w=!1,inline:E=!0,shift:k=!1})=>{const[y,A]=(0,r.useState)(!1),b=(0,r.useCallback)((()=>A(!1)),[A]),j=(0,r.useCallback)((e=>{e.preventDefault(),A(!y)}),[y,A]),R={position:o(a),placement:a,animate:u,noArrow:!1,resize:!1,flip:!1,offset:p,focusOnMount:"container",onClose:b,className:"icon-tooltip-container",inline:E,shift:k},C="wrapper"===v,_=(0,c.A)("icon-tooltip-wrapper",e),x={left:C?0:-(62-d/2)+"px"},N=C&&f;return s().createElement("div",{className:_,"data-testid":"icon-tooltip_wrapper"},!C&&s().createElement(i.A,{variant:"link",onMouseDown:j},s().createElement(l.A,{className:t,icon:m,size:d})),s().createElement("div",{className:(0,c.A)("icon-tooltip-helper",{"is-wide":w}),style:x},(N||y)&&s().createElement(n.Popover,R,s().createElement("div",null,h&&s().createElement("div",{className:"icon-tooltip-title"},h),s().createElement("div",{className:"icon-tooltip-content"},g)))))}},8478:(e,t,a)=>{"use strict";a.d(t,{Gg:()=>o,KH:()=>d,Nr:()=>u,Wy:()=>h,sT:()=>m});var n=a(6072),c=a.n(n),r=a(6427),s=a(3022),i=(a(4705),a(2300));const l=({className:e,size:t=24,viewBox:a="0 0 24 24",opacity:n=1,color:l="#2C3338",children:o})=>{const u={className:(0,s.A)(i.A.iconWrapper,e),width:t,height:t,viewBox:a,opacity:n,fill:void 0};return l&&(u.fill=l),React.createElement(r.SVG,c()({},u,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg"}),React.createElement(r.G,{opacity:n},o))},o=({size:e,className:t=i.A["star-icon"],color:a})=>React.createElement(l,{className:t,size:e,color:a},React.createElement(r.Path,{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"})),u=({size:e,className:t=i.A["checkmark-icon"],color:a})=>React.createElement(l,{className:t,size:e,color:a},React.createElement(r.Path,{d:"M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z"})),m=({size:e,className:t=i.A.jetpack,color:a})=>React.createElement(l,{className:t,size:e,color:a,viewBox:"0 0 32 32"},React.createElement(r.Path,{className:"jetpack-logo__icon-circle",d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z"}),React.createElement(r.Polygon,{fill:"#fff",points:"15,19 7,19 15,3"}),React.createElement(r.Polygon,{fill:"#fff",points:"17,29 17,13 25,13"})),d=({size:e=24,color:t="#069e08"})=>React.createElement(l,{color:t,size:e,viewBox:"0 0 32 32"},React.createElement(r.Path,{className:"spark-first",d:"M9.33301 5.33325L10.4644 8.20188L13.333 9.33325L10.4644 10.4646L9.33301 13.3333L8.20164 10.4646L5.33301 9.33325L8.20164 8.20188L9.33301 5.33325Z"}),React.createElement(r.Path,{className:"spark-second",d:"M21.3333 5.33333L22.8418 9.15817L26.6667 10.6667L22.8418 12.1752L21.3333 16L19.8248 12.1752L16 10.6667L19.8248 9.15817L21.3333 5.33333Z"}),React.createElement(r.Path,{className:"spark-third",d:"M14.6667 13.3333L16.5523 18.1144L21.3333 20L16.5523 21.8856L14.6667 26.6667L12.781 21.8856L8 20L12.781 18.1144L14.6667 13.3333Z"})),p={...{"anti-spam":({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M21.6,12.5c0,0.6-0.3,1-0.9,1c-0.6,0-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1C21.3,11.7,21.6,12.1,21.6,12.5z"}),React.createElement(r.Path,{d:"M4.1,12.5c0,0.6-0.3,1-0.9,1s-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1S4.1,12.1,4.1,12.5z"})),backup:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M2.1,5.8c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.5,0.1-0.7c0.1-0.4,0.4-0.6,0.7-0.8l8.3-2.9c0.1-0.1,0.3-0.1,0.4-0.1l0.5,0.1 l8.3,2.9c0.3,0.2,0.5,0.4,0.7,0.7c0.2,0.2,0.2,0.4,0.2,0.7c0,0.1,0,0.1,0,0.2v0.1c-0.1,0.5-0.2,0.9-0.3,1.4 c-0.2,0.4-0.3,1.2-0.7,2.2c-0.3,1-0.7,2.1-1.1,3.1c-0.5,1-1,2.1-1.6,3.3s-1.4,2.3-2.2,3.5c-0.9,1.1-1.8,2.2-2.8,3.1 c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4c-1.2-1.1-2.4-2.4-3.5-4c-1-1.6-1.9-3-2.5-4.3c-0.6-1.3-1.1-2.7-1.6-4 C2.8,8.7,2.5,7.6,2.3,7C2.3,6.5,2.1,6.1,2.1,5.8z M2.9,5.9c0,0.2,0.1,0.4,0.1,0.8C3.1,7,3.2,7.5,3.5,8.2C3.7,9,3.9,9.7,4.2,10.6 c0.3,0.7,0.7,1.7,1.1,2.7c0.4,1,1,2,1.5,2.9c0.5,1,1.2,1.9,1.9,2.9c0.8,1,1.6,1.9,2.4,2.6c0.2,0.2,0.4,0.2,0.5,0.2 c0.2,0,0.4-0.1,0.5-0.2c1.2-1,2.2-2.3,3.2-3.8c1-1.5,1.8-2.8,2.3-4c0.6-1.3,1.1-2.5,1.5-3.9c0.4-1.3,0.7-2.2,0.9-2.8 c0.1-0.5,0.2-1,0.3-1.3c0-0.1,0-0.1,0-0.1c0-0.2,0-0.3-0.1-0.4C20.3,5.2,20.2,5.1,20,5L12,2.1c0,0-0.1,0-0.2,0s-0.1,0-0.1,0h-0.2 l-8,2.8C3.2,5,3.1,5.2,3,5.3C2.9,5.5,2.9,5.6,2.9,5.8C2.9,5.8,2.9,5.8,2.9,5.9z M5.9,6.7h3l2.8,7l2.8-7h3c-0.1,0.1-0.2,0.5-0.3,0.8 C17,7.8,17,8.2,16.8,8.4c-0.1,0.3-0.2,0.5-0.4,0.8c0,0.1-0.1,0.1-0.1,0.1s-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.2,0.1-0.2,0.2c0,0-0.1,0.1-0.1,0.1s-0.1,0.1-0.1,0.1c0,0,0,0.1-0.1,0.2c0,0.1-0.1,0.1-0.1,0.1l-0.4,1.1 c-1.3,3.3-2.1,5.2-2.3,5.8h-2.2l-1-2.4c-0.1-0.3-0.3-0.8-0.5-1.3c-0.1-0.3-0.3-0.8-0.5-1.3L8,10.8c-0.1-0.1-0.1-0.2-0.1-0.4 C7.8,10.2,7.7,10,7.7,9.8C7.6,9.7,7.5,9.5,7.4,9.4C7.3,9.3,7.3,9.3,7.3,9.3c-0.1,0-0.2,0-0.2,0s-0.1,0-0.1,0 C6.6,8.5,6.3,7.6,5.9,6.7z"})),boost:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19505 16.2545C4.47368 16.561 4.94802 16.5836 5.25451 16.3049L10.2595 11.7549L14.2842 15.2765L19 10.5607V13.75H20.5V9.5V8.75239V8.7476V8H19.7529H19.7471H19H14.75V9.5H17.9393L14.2158 13.2235L10.2405 9.74507L4.2455 15.195C3.93901 15.4737 3.91642 15.948 4.19505 16.2545Z"})),crm:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M15.5 9.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm-2.25 6v-2a2.75 2.75 0 0 0-2.75-2.75h-4A2.75 2.75 0 0 0 3.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5Zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0 1 20.25 15ZM9.5 8.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1.5 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"})),extras:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M18.5 5.5V8H20V5.5h2.5V4H20V1.5h-1.5V4H16v1.5h2.5ZM12 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-6h-1.5v6a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h6V4Z"})),protect:({opacity:e=1,size:t,className:a,color:n})=>React.createElement(l,{className:a,size:t,opacity:e,color:n},React.createElement(r.Path,{d:"M12 3.17627L18.75 6.24445V10.8183C18.75 14.7173 16.2458 18.4089 12.7147 19.5735C12.2507 19.7265 11.7493 19.7265 11.2853 19.5735C7.75416 18.4089 5.25 14.7173 5.25 10.8183V6.24445L12 3.17627ZM6.75 7.21032V10.8183C6.75 14.1312 8.89514 17.2057 11.7551 18.149C11.914 18.2014 12.086 18.2014 12.2449 18.149C15.1049 17.2057 17.25 14.1312 17.25 10.8183V7.21032L12 4.82396L6.75 7.21032Z"}),React.createElement(r.Path,{d:"M15.5291 10.0315L11.1818 14.358L8.47095 11.66L9.52907 10.5968L11.1818 12.2417L14.4709 8.96826L15.5291 10.0315Z"})),scan:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"m12 3.176 6.75 3.068v4.574c0 3.9-2.504 7.59-6.035 8.755a2.283 2.283 0 0 1-1.43 0c-3.53-1.164-6.035-4.856-6.035-8.755V6.244L12 3.176ZM6.75 7.21v3.608c0 3.313 2.145 6.388 5.005 7.33.159.053.331.053.49 0 2.86-.942 5.005-4.017 5.005-7.33V7.21L12 4.824 6.75 7.21Z"})),search:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M17.5 11.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm1.5 0a5.5 5.5 0 0 1-9.142 4.121l-3.364 2.943-.988-1.128 3.373-2.952A5.5 5.5 0 1 1 19 11.5Z"})),social:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{d:"M15.5 3.97809V18.0219L7.5 15.5977V20H6V15.1431L3.27498 14.3173C2.22086 13.9979 1.5 13.0262 1.5 11.9248V10.0752C1.5 8.97375 2.22087 8.00207 3.27498 7.68264L15.5 3.97809ZM14 16L7.5 14.0303L7.5 7.96969L14 5.99999V16ZM6 8.42423L6 13.5757L3.70999 12.8818C3.28835 12.754 3 12.3654 3 11.9248V10.0752C3 9.63462 3.28835 9.24595 3.70999 9.11818L6 8.42423ZM17.5 11.75H21.5V10.25H17.5V11.75ZM21.5 16L17.5 15V13.5L21.5 14.5V16ZM17.5 8.5L21.5 7.5V6L17.5 7V8.5Z"})),star:o,videopress:({opacity:e=1,size:t,color:a})=>React.createElement(l,{size:t,opacity:e,color:a},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3,6.2c0.8,0,1.6,0.6,1.8,1.4l2.3,7.9c0,0,0,0,0,0l2.7-9.3h1.5h4.2c2.9,0,4.9,1.9,4.9,4.7c0,2.9-2,4.7-5,4.7 h-2h-2.5l-0.5,1.5c-0.4,1.4-1.7,2.3-3.2,2.3c-1.4,0-2.7-0.9-3.2-2.3L2.5,8.7C2.1,7.4,3,6.2,4.3,6.2z M13,12.8h2.9c1.3,0,2-0.7,2-1.9 c0-1.2-0.8-1.8-2-1.8h-1.7L13,12.8z"})),jetpack:m,share:({size:e=16,className:t,color:a})=>React.createElement(l,{className:t,size:e,color:a,viewBox:"0 0 16 16"},React.createElement(r.Path,{fill:"#161722",fillRule:"evenodd",d:"M8.3 4.66C3.85 5.308.727 9.75.034 13.69l-.02.117c-.137.842.809 1.232 1.446.68 2.013-1.745 3.648-2.475 5.318-2.719a10.482 10.482 0 011.524-.103v2.792c0 .694.82 1.041 1.3.55l6.176-6.307a.79.79 0 00.012-1.088L9.614 1.004C9.14.496 8.301.84 8.301 1.542v3.117zm1.525-1.175v1.85a.773.773 0 01-.654.77l-.655.096c-2.133.311-3.987 1.732-5.295 3.672-.472.7-.854 1.44-1.143 2.18a12.32 12.32 0 011.675-.972c1.58-.75 3.048-.972 4.548-.972h.762a.77.77 0 01.762.779v1.69l4.347-4.44-4.347-4.653z",clipRule:"evenodd"})),ai:d}};function h(e){return p[e]?p[e]:null}},8250:(e,t,a)=>{"use strict";a.d(t,{A:()=>k});var n=a(6072),c=a.n(n),r=a(7143),s=a(7723),i=a(1113),l=a(3512),o=a(3022),u=a(1609),m=a.n(u),d=a(3924),p=a(4293),h=a(1069),g=a(8907),v=(a(4206),a(7142)),f=a(442);const __=s.__,_x=s._x,w=()=>m().createElement(v.A,{logoColor:"#000",showText:!1,height:16,"aria-hidden":"true"}),E=()=>m().createElement(m().Fragment,null,m().createElement(i.A,{icon:l.A,size:16}),m().createElement("span",{className:"jp-dashboard-footer__accessible-external-link"},/* translators: accessibility text */ +__("(opens in a new tab)","jetpack-my-jetpack"))),k=({moduleName:e=__("Jetpack","jetpack-my-jetpack"),className:t,moduleNameHref:a="https://jetpack.com",menu:n,onAboutClick:s,onPrivacyClick:i,onTermsClick:l,...u})=>{const[v]=(0,f.A)("sm","<="),[k]=(0,f.A)("md","<="),[y]=(0,f.A)("lg",">"),{isActive:A,connectedPlugins:b}=(0,r.useSelect)((e=>{const t=e(p.a);return{connectedPlugins:t?.getConnectedPlugins(),...t.getConnectionStatus()}}),[p.a]),j=(0,h.A)(),R=j&&A&&b?.some((({slug:e})=>"jetpack"===e));let C=[{label:_x("About","Link to learn more about Jetpack.","jetpack-my-jetpack"),title:__("About Jetpack","jetpack-my-jetpack"),href:R?new URL("admin.php?page=jetpack_about",j).href:(0,d.A)("jetpack-about"),target:R?"_self":"_blank",onClick:s},{label:_x("Privacy","Shorthand for Privacy Policy.","jetpack-my-jetpack"),title:__("Automattic's Privacy Policy","jetpack-my-jetpack"),href:R?new URL("admin.php?page=jetpack#/privacy",j).href:(0,d.A)("a8c-privacy"),target:R?"_self":"_blank",onClick:i},{label:_x("Terms","Shorthand for Terms of Service.","jetpack-my-jetpack"),title:__("WordPress.com Terms of Service","jetpack-my-jetpack"),href:(0,d.A)("wpcom-tos"),target:"_blank",onClick:l}];n&&(C=[...C,...n]);const _=m().createElement(m().Fragment,null,m().createElement(w,null),e);return m().createElement("footer",c()({className:(0,o.A)("jp-dashboard-footer",{"is-sm":v,"is-md":k,"is-lg":y},t),"aria-label":__("Jetpack","jetpack-my-jetpack")},u),m().createElement("ul",null,m().createElement("li",{className:"jp-dashboard-footer__jp-item"},a?m().createElement("a",{href:a},_):_),C.map((e=>{const t="button"===e.role,a=!t&&"_blank"===e.target;return m().createElement("li",{key:e.label},m().createElement("a",{href:e.href,title:e.title,target:e.target,onClick:e.onClick,onKeyDown:e.onKeyDown,className:(0,o.A)("jp-dashboard-footer__menu-item",{"is-external":a}),role:e.role,rel:a?"noopener noreferrer":void 0,tabIndex:t?0:void 0},e.label,a&&m().createElement(E,null)))})),m().createElement("li",{className:"jp-dashboard-footer__a8c-item"},m().createElement("a",{href:R?new URL("admin.php?page=jetpack_about",j).href:(0,d.A)("a8c-about"),"aria-label":__("An Automattic Airline","jetpack-my-jetpack")},m().createElement(g.A,{"aria-hidden":"true"})))))}},7142:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(6072),c=a.n(n),r=a(7723),s=a(3022),i=a(1609),l=a.n(i);const __=r.__,o=({logoColor:e="#069e08",showText:t=!0,className:a,height:n=32,...r})=>{const i=t?"0 0 118 32":"0 0 32 32";return l().createElement("svg",c()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:i,className:(0,s.A)("jetpack-logo",a),"aria-labelledby":"jetpack-logo-title",height:n},r,{role:"img"}),l().createElement("title",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-my-jetpack")),l().createElement("path",{fill:e,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),t&&l().createElement(l().Fragment,null,l().createElement("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),l().createElement("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),l().createElement("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),l().createElement("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),l().createElement("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z"}),l().createElement("path",{d:"M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z"}),l().createElement("path",{d:"M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z"})))}},8509:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(3022),c=a(1609),r=a(7371);const s=Number(r.A.smCols),i=Number(r.A.mdCols),l=Number(r.A.lgCols),o=e=>{const{children:t,tagName:a="div",className:o}=e,u=Math.min(s,"number"==typeof e.sm?e.sm:s),m=Math.min(s,"object"==typeof e.sm?e.sm.start:0),d=Math.min(s,"object"==typeof e.sm?e.sm.end:0),p=Math.min(i,"number"==typeof e.md?e.md:i),h=Math.min(i,"object"==typeof e.md?e.md.start:0),g=Math.min(i,"object"==typeof e.md?e.md.end:0),v=Math.min(l,"number"==typeof e.lg?e.lg:l),f=Math.min(l,"object"==typeof e.lg?e.lg.start:0),w=Math.min(l,"object"==typeof e.lg?e.lg.end:0),E=(0,n.A)(o,{[r.A[`col-sm-${u}`]]:!(m&&d),[r.A[`col-sm-${m}-start`]]:m>0,[r.A[`col-sm-${d}-end`]]:d>0,[r.A[`col-md-${p}`]]:!(h&&g),[r.A[`col-md-${h}-start`]]:h>0,[r.A[`col-md-${g}-end`]]:g>0,[r.A[`col-lg-${v}`]]:!(f&&w),[r.A[`col-lg-${f}-start`]]:f>0,[r.A[`col-lg-${w}-end`]]:w>0});return(0,c.createElement)(a,{className:E},t)}},5918:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(3022),c=a(1609),r=a(2420);const s=({children:e,fluid:t=!1,tagName:a="div",className:s,horizontalGap:i=1,horizontalSpacing:l=1})=>{const o=(0,c.useMemo)((()=>{const e=`calc( var(--horizontal-spacing) * ${l} )`;return{paddingTop:e,paddingBottom:e,rowGap:`calc( var(--horizontal-spacing) * ${i} )`}}),[i,l]),u=(0,n.A)(s,r.A.container,{[r.A.fluid]:t});return(0,c.createElement)(a,{className:u,style:o},e)}},442:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(9491),c=a(8403);const r=["sm","md","lg"],s=(e,t)=>{const a=Array.isArray(e)?e:[e],s=Array.isArray(t)?t:[t],[i,l,o]=r,u={sm:(0,n.useMediaQuery)(c.A[i]),md:(0,n.useMediaQuery)(c.A[l]),lg:(0,n.useMediaQuery)(c.A[o])};return a.map(((e,t)=>{const a=s[t];return a?((e,t,a)=>{const n=r.indexOf(e),c=n+1,s=t.includes("=");let i=[];return t.startsWith("<")&&(i=r.slice(0,s?c:n)),t.startsWith(">")&&(i=r.slice(s?n:c)),i?.length?i.some((e=>a[e])):a[e]})(e,a,u):u[e]}))}},7656:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(311),c=a(9783),r=a(3883),s=a(1113),i=a(991),l=a(3022),o=a(1609),u=a.n(o),m=a(7410);const d=e=>{switch(e){case"error":case"warning":default:return n.A;case"info":return c.A;case"success":return r.A}},p=({level:e="info",title:t,children:a,actions:n,hideCloseButton:c=!1,onClose:r})=>{const o=(0,l.A)(m.A.container,m.A[`is-${e}`]);return u().createElement("div",{className:o},u().createElement("div",{className:m.A["icon-wrapper"]},u().createElement(s.A,{icon:d(e),className:m.A.icon})),u().createElement("div",{className:m.A["main-content"]},t&&u().createElement("div",{className:m.A.title},t),a,n&&n.length>0&&u().createElement("div",{className:m.A["action-bar"]},n.map(((e,t)=>u().createElement("div",{key:t,className:m.A.action},e))))),!c&&u().createElement("button",{"aria-label":"close",className:m.A["close-button"],onClick:r},u().createElement(s.A,{icon:i.A})))}},7975:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(1437);const c=(e,t={})=>{const a=(0,n.Y)();return new Intl.NumberFormat(a,t).format(e)}},9245:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>A,N0:()=>y,eY:()=>E,i7:()=>k});var n=a(7723),c=a(1113),r=a(3883),s=a(1249),i=a(3022),l=a(1609),o=a.n(l),u=a(597),m=a(442),d=a(5879),p=a(7425),h=a(3142);const __=n.__,g=__("Included","jetpack-my-jetpack"),v=__("Not included","jetpack-my-jetpack"),f=__("Coming soon","jetpack-my-jetpack"),w=(0,l.createContext)(void 0),E=({isIncluded:e=!1,isComingSoon:t=!1,index:a=0,label:d=null,tooltipInfo:E,tooltipTitle:k,tooltipClassName:y=""})=>{const[A]=(0,m.A)("lg"),b=(0,l.useContext)(w)[a],j=t||e,R=b.name,C=b.tooltipInfo,_=b.tooltipTitle,x=E||!A&&C,N=((e,t,a)=>e?{lg:f, +// translators: Name of the current feature +default:(0,n.sprintf)(__("%s coming soon","jetpack-my-jetpack"),a)}:{lg:t?g:v,default:t?a:(0,n.sprintf)(/* translators: Name of the current feature */ +__("%s not included","jetpack-my-jetpack"),a)})(t,e,R),z=A?N.lg:N.default;return o().createElement("div",{className:(0,i.A)(h.A.item,h.A.value)},o().createElement(c.A,{className:(0,i.A)(h.A.icon,j?h.A["icon-check"]:h.A["icon-cross"]),size:32,icon:j?r.A:s.A}),o().createElement(p.Ay,{variant:"body-small"},d||z),x&&o().createElement(u.A,{title:k||_,iconClassName:h.A["popover-icon"],className:(0,i.A)(h.A.popover,y),placement:"bottom-end",iconSize:14,offset:4,wide:Boolean(k&&E)},o().createElement(p.Ay,{variant:"body-small",component:"div"},E||C)))},k=({children:e})=>o().createElement("div",{className:h.A.header},e),y=({primary:e=!1,children:t})=>{let a=0;return o().createElement("div",{className:(0,i.A)(h.A.card,{[h.A["is-primary"]]:e})},l.Children.map(t,(e=>{const t=e;return t.type===E?(a++,(0,l.cloneElement)(t,{index:a-1})):t})))},A=({title:e,items:t,children:a,showIntroOfferDisclaimer:n=!1})=>{const[c]=(0,m.A)("lg");return o().createElement(w.Provider,{value:t},o().createElement("div",{className:(0,i.A)(h.A.container,{[h.A["is-viewport-large"]]:c}),style:{"--rows":t.length+1,"--columns":l.Children.toArray(a).length+1}},o().createElement("div",{className:h.A.table},o().createElement(p.Ay,{variant:"headline-small"},e),c&&t.map(((e,a)=>o().createElement("div",{className:(0,i.A)(h.A.item,{[h.A["last-feature"]]:a===t.length-1}),key:a},o().createElement(p.Ay,{variant:"body-small"},o().createElement("strong",null,e.name)),e.tooltipInfo&&o().createElement(u.A,{title:e.tooltipTitle,iconClassName:h.A["popover-icon"],className:h.A.popover,placement:e.tooltipPlacement?e.tooltipPlacement:"bottom-end",iconSize:14,offset:4,wide:Boolean(e.tooltipTitle&&e.tooltipInfo)},o().createElement(p.Ay,{variant:"body-small"},e.tooltipInfo))))),a)),o().createElement("div",{className:h.A["tos-container"]},o().createElement("div",{className:h.A.tos},n&&o().createElement(p.Ay,{variant:"body-small"},__("Reduced pricing is a limited offer for the first year and renews at regular price.","jetpack-my-jetpack")),o().createElement(d.A,{multipleButtons:!0}))))}},489:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(7723),c=a(3022),r=a(7425),s=a(2746),i=a(3407);const __=n.__,l=({price:e,offPrice:t,currency:a="",showNotOffPrice:n=!0,hideDiscountLabel:l=!0,promoLabel:o="",legend:u=__("/month, paid yearly","jetpack-my-jetpack"),isNotConvenientPrice:m=!1,hidePriceFraction:d=!1,children:p})=>{if(null==e&&null==t||!a)return null;n=n&&null!=t;const h="number"==typeof e&&"number"==typeof t?Math.floor((e-t)/e*100):0,g=!l&&h&&h>0?h+__("% off","jetpack-my-jetpack"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:i.A.container},React.createElement("div",{className:(0,c.A)(i.A["price-container"],"product-price_container")},React.createElement(s.g,{value:t??e,currency:a,isOff:!m,hidePriceFraction:d}),n&&React.createElement(s.g,{value:e,currency:a,isOff:!1,hidePriceFraction:d}),g&&React.createElement(r.Ay,{className:(0,c.A)(i.A["promo-label"],"product-price_promo_label")},g))),React.createElement("div",{className:i.A.footer},p||React.createElement(r.Ay,{className:(0,c.A)(i.A.legend,"product-price_legend")},u),o&&React.createElement(r.Ay,{className:(0,c.A)(i.A["promo-label"],"product-price_promo_label")},o)))}},2746:(e,t,a)=>{"use strict";a.d(t,{g:()=>i});var n=a(7397),c=a(3022),r=a(7425),s=a(3407);const i=({value:e,currency:t,isOff:a,hidePriceFraction:i})=>{const l=(0,c.A)(s.A.price,"product-price_price",{[s.A["is-not-off-price"]]:!a}),{symbol:o,integer:u,fraction:m}=(0,n.vA)(e,t),d=!i||!m.endsWith("00");return React.createElement(r.Ay,{className:l,variant:"headline-medium",component:"p"},React.createElement(r.Ay,{className:s.A.symbol,component:"sup",variant:"title-medium"},o),u,d&&React.createElement(r.Ay,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,m)))}},6461:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(5739),c=a.n(n),r=a(1609),s=a.n(r);a(8325);const i=({color:e="#FFFFFF",className:t="",size:a=20})=>{const n=t+" jp-components-spinner",c={width:a,height:a,fontSize:a,borderTopColor:e},r={borderTopColor:e,borderRightColor:e};return s().createElement("div",{className:n},s().createElement("div",{className:"jp-components-spinner__outer",style:c},s().createElement("div",{className:"jp-components-spinner__inner",style:r})))};i.propTypes={color:c().string,className:c().string,size:c().number};const l=i},5879:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(6072),c=a.n(n),r=a(6087),s=a(7723),i=a(3022),l=a(3924),o=a(7425);a(9634);const __=s.__,u=({multipleButtonsLabels:e})=>Array.isArray(e)&&e.length>1?(0,r.createInterpolateElement)((0,s.sprintf)(/* translators: %1$s is button label 1 and %2$s is button label 2 */ +__("By clicking %1$s or %2$s, you agree to our Terms of Service and to sync your site‘s data with us.","jetpack-my-jetpack"),e[0],e[1]),{strong:React.createElement("strong",null),tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}):(0,r.createInterpolateElement)(__("By clicking the buttons above, you agree to our Terms of Service and to sync your site‘s data with us.","jetpack-my-jetpack"),{tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),m=({agreeButtonLabel:e})=>(0,r.createInterpolateElement)((0,s.sprintf)(/* translators: %s is a button label */ +__("By clicking %s, you agree to our Terms of Service and to sync your site‘s data with us.","jetpack-my-jetpack"),e),{strong:React.createElement("strong",null),tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),d=({slug:e,children:t})=>React.createElement("a",{className:"terms-of-service__link",href:(0,l.A)(e),rel:"noopener noreferrer",target:"_blank"},t),p=({className:e,multipleButtons:t,agreeButtonLabel:a,...n})=>React.createElement(o.Ay,c()({className:(0,i.A)(e,"terms-of-service")},n),t?React.createElement(u,{multipleButtonsLabels:t}):React.createElement(m,{agreeButtonLabel:a}))},110:(e,t,a)=>{"use strict";a.d(t,{Q:()=>n,Z:()=>c});const n={"headline-medium":"h1","headline-small":"h2","headline-small-regular":"h2","title-medium":"h3","title-medium-semi-bold":"h3","title-small":"h4",body:"p","body-small":"p","body-extra-small":"p","body-extra-small-bold":"p",label:"p"},c=["mt","mr","mb","ml","mx","my","m","pt","pr","pb","pl","px","py","p"]},7425:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>m,H3:()=>d,hE:()=>p});var n=a(6072),c=a.n(n),r=a(3022),s=a(1609),i=a.n(s),l=a(110),o=a(4495);const u=(0,s.forwardRef)((({variant:e="body",children:t,component:a,className:n,...u},m)=>{const d=a||l.Q[e]||"span",p=(0,s.useMemo)((()=>l.Z.reduce(((e,t)=>(void 0!==u[t]&&(e+=o.A[`${t}-${u[t]}`]+" ",delete u[t]),e)),"")),[u]);return u.ref=m,i().createElement(d,c()({className:(0,r.A)(o.A.reset,o.A[e],n,p)},u),t)}));u.displayName="Text";const m=u,d=({children:e,weight:t="bold",...a})=>{const n="headline-small"+("bold"===t?"":`-${t}`);return i().createElement(u,c()({variant:n,mb:3},a),e)},p=({children:e,size:t="medium",...a})=>i().createElement(u,c()({variant:`title-${t}`,mb:1},a),e)},723:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>d});var n=a(1609),c=a.n(n),r=a(9422);const s={"--font-headline-medium":"48px","--font-headline-small":"36px","--font-title-medium":"24px","--font-title-small":"20px","--font-body":"16px","--font-body-small":"14px","--font-body-extra-small":"12px","--font-title-large":"var(--font-headline-small)","--font-label":"var(--font-body-extra-small)"},i={"--jp-black":"#000000","--jp-black-80":"#2c3338","--jp-white":"#ffffff","--jp-white-off":"#f9f9f6","--jp-gray":"#dcdcde","--jp-gray-0":"#F6F7F7","--jp-gray-5":"var(--jp-gray)","--jp-gray-10":"#C3C4C7","--jp-gray-20":"#A7AAAD","--jp-gray-40":"#787C82","--jp-gray-50":"#646970","--jp-gray-60":"#50575E","--jp-gray-70":"#3C434A","--jp-gray-80":"#2C3338","--jp-gray-90":"#1d2327","--jp-gray-off":"#e2e2df","--jp-red-0":"#F7EBEC","--jp-red-5":"#FACFD2","--jp-red-40":"#E65054","--jp-red-50":"#D63638","--jp-red-60":"#B32D2E","--jp-red-70":"#8A2424","--jp-red-80":"#691C1C","--jp-red":"#d63639","--jp-yellow-5":"#F5E6B3","--jp-yellow-10":"#F2CF75","--jp-yellow-20":"#F0C930","--jp-yellow-30":"#DEB100","--jp-yellow-40":"#C08C00","--jp-yellow-50":"#9D6E00","--jp-yellow-60":"#7D5600","--jp-blue-20":"#68B3E8","--jp-blue-40":"#1689DB","--jp-pink":"#C9356E","--jp-green-0":"#f0f2eb","--jp-green-5":"#d0e6b8","--jp-green-10":"#9dd977","--jp-green-20":"#64ca43","--jp-green-30":"#2fb41f","--jp-green-40":"#069e08","--jp-green-50":"#008710","--jp-green-60":"#007117","--jp-green-70":"#005b18","--jp-green-80":"#004515","--jp-green-90":"#003010","--jp-green-100":"#001c09","--jp-green":"#069e08","--jp-green-primary":"var( --jp-green-40 )","--jp-green-secondary":"var( --jp-green-30 )"},l={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},o={"--spacing-base":"8px"},u={},m=(e,t,a)=>{const n={...s,...i,...l,...o};for(const t in n)e.style.setProperty(t,n[t]);a&&e.classList.add(r.A.global),t&&(u[t]={provided:!0,root:e})},d=({children:e=null,targetDom:t,id:a,withGlobalStyles:r=!0})=>{const s=(0,n.useRef)(),i=u?.[a]?.provided;return(0,n.useLayoutEffect)((()=>{if(!i)return t?m(t,a,r):void(s?.current&&m(s.current,a,r))}),[t,s,i,a,r]),t?c().createElement(c().Fragment,null,e):c().createElement("div",{ref:s},e)}},7506:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(1112),c=a(6427),r=a(6087),s=a(1609),i=a.n(s);a(8170);const l=e=>{const{icon:t,title:a,description:s,primaryCtaLabel:l,primaryCtaURL:o,primaryCtaIsExternalLink:u,primaryCtaOnClick:m,secondaryCtaLabel:d,secondaryCtaURL:p,secondaryCtaIsExternalLink:h,secondaryCtaOnClick:g}=e;return i().createElement(c.Card,{isRounded:!0,size:"large"},i().createElement(c.CardBody,{className:"upsell-banner",size:"large"},t&&i().createElement("div",{className:"upsell-banner--icon"},i().createElement("img",{src:t,alt:""})),i().createElement("div",{className:"upsell-banner--content"},i().createElement("div",{className:"upsell-banner--content-info"},i().createElement("h3",null,a),i().createElement("p",null,(0,r.createInterpolateElement)(s,{br:i().createElement("br",null)}))),i().createElement("div",{className:"upsell-banner--content-cta"},d&&p&&i().createElement(n.A,{className:"upsell-banner--content-cta-button secondary",href:p,onClick:g??void 0,isExternalLink:h},d),l&&o&&i().createElement(n.A,{className:"upsell-banner--content-cta-button primary",href:o,onClick:m??void 0,isExternalLink:u},l)))))}},1984:(e,t,a)=>{"use strict";a.d(t,{o:()=>n});const n="d729d42c-b547-4750-a6f6-8b30534a5f12"},8587:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(1609),c=a(1984);const r=({jwt_token:e})=>{const t=(0,n.useCallback)((()=>{"undefined"!=typeof window&&"function"==typeof window.zE&&window.zE("messenger","loginUser",(function(t){t(e)}))}),[e]);return(0,n.useEffect)((()=>{const e=document.createElement("script"),a=document.getElementById("zendesk-chat-container");e.src="https://static.zdassets.com/ekr/snippet.js?key="+encodeURIComponent(c.o),e.type="text/javascript",e.id="ze-snippet",e.onload=()=>{t()},a&&a.appendChild(e)}),[t]),React.createElement("div",{"data-testid":"zendesk-chat-container",id:"zendesk-chat-container"})}},1437:(e,t,a)=>{"use strict";a.d(t,{Y:()=>c});var n=a(8443);const c=()=>{const{l10n:{locale:e}}=(0,n.getSettings)();if(e)return(e=>{const t=e.match(/^([a-z]{2,3})(_[a-z]{2}|_[a-z][a-z0-9]{4,7})?(?:_.*)?$/i);return t?`${t[1]}${t[2]?t[2]:""}`.replace("_","-"):"en-US"})(e);return window?.window?.navigator?.language??"en-US"}},1069:(e,t,a)=>{"use strict";function n(){return window.Initial_State?.adminUrl||window.Jetpack_Editor_Initial_State?.adminUrl||window?.myJetpackInitialState?.adminUrl||null}a.d(t,{A:()=>n})},3924:(e,t,a)=>{"use strict";function n(e,t={}){const a={};let n;if("undefined"!=typeof window&&(n=window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv),0===e.search("https://")){const t=new URL(e);e=`https://${t.host}${t.pathname}`,a.url=encodeURIComponent(e)}else a.source=encodeURIComponent(e);for(const e in t)a[e]=encodeURIComponent(t[e]);!Object.keys(a).includes("site")&&"undefined"!=typeof jetpack_redirects&&Object.hasOwn(jetpack_redirects,"currentSiteRawUrl")&&(a.site=jetpack_redirects.currentBlogID??jetpack_redirects.currentSiteRawUrl),n&&(a.calypso_env=n);return"https://jetpack.com/redirect/?"+Object.keys(a).map((e=>e+"="+a[e])).join("&")}a.d(t,{A:()=>n})},6439:(e,t,a)=>{let n={};try{n=a(5990)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),n={missingConfig:!0}}const c=e=>Object.hasOwn(n,e);e.exports={jetpackConfigHas:c,jetpackConfigGet:e=>{if(!c(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return n[e]}}},3935:(e,t,a)=>{"use strict";a.d(t,{A1:()=>l,Ay:()=>A,DO:()=>i,Ij:()=>s,Kl:()=>p,LW:()=>o,MU:()=>h,XY:()=>u,ZO:()=>r,dz:()=>m,gH:()=>d,v_:()=>c});var n=a(5932);const c="SET_CONNECTION_STATUS",r="SET_CONNECTION_STATUS_IS_FETCHING",s="SET_SITE_IS_REGISTERING",i="SET_USER_IS_CONNECTING",l="SET_REGISTRATION_ERROR",o="CLEAR_REGISTRATION_ERROR",u="SET_AUTHORIZATION_URL",m="DISCONNECT_USER_SUCCESS",d="SET_CONNECTED_PLUGINS",p="SET_CONNECTION_ERRORS",h="SET_IS_OFFLINE_MODE",g=e=>({type:c,connectionStatus:e}),v=e=>({type:s,isRegistering:e}),f=e=>({type:i,isConnecting:e}),w=e=>({type:l,registrationError:e}),E=()=>({type:o}),k=e=>({type:u,authorizationUrl:e}),y=e=>({type:d,connectedPlugins:e});const A={setConnectionStatus:g,setConnectionStatusIsFetching:e=>({type:r,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:v,setUserIsConnecting:f,setRegistrationError:w,clearRegistrationError:E,setAuthorizationUrl:k,registerSite:function*({registrationNonce:e,redirectUri:t,from:a=""}){yield E(),yield v(!0);try{const n=yield{type:"REGISTER_SITE",registrationNonce:e,redirectUri:t,from:a};return yield g({isRegistered:!0}),yield k(n.authorizeUrl),yield v(!1),Promise.resolve(n)}catch(e){return yield w(e),yield v(!1),Promise.reject(e)}},connectUser:function*({from:e,redirectFunc:t,redirectUri:a}={}){yield f(!0),yield{type:"CONNECT_USER",from:e,redirectFunc:t,redirectUri:a}},disconnectUserSuccess:()=>({type:m}),setConnectedPlugins:y,refreshConnectedPlugins:()=>async({dispatch:e})=>await new Promise((t=>n.Ay.fetchConnectedPlugins().then((a=>{e(y(a)),t(a)})))),setConnectionErrors:e=>({type:p,connectionErrors:e}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})}},2494:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(5932),c=a(7143),r=a(2279);const s={FETCH_AUTHORIZATION_URL:({redirectUri:e})=>n.Ay.fetchAuthorizationUrl(e),REGISTER_SITE:({registrationNonce:e,redirectUri:t,from:a})=>n.Ay.registerSite(e,t,a),CONNECT_USER:(0,c.createRegistryControl)((({resolveSelect:e})=>({from:t,redirectFunc:a,redirectUri:n}={})=>new Promise(((c,s)=>{e(r.A).getAuthorizationUrl(n).then((e=>{const n=a||(e=>window.location.assign(e)),r=new URL(e);t&&r.searchParams.set("from",encodeURIComponent(t));const s=r.toString();n(s),c(s)})).catch((e=>{s(e)}))}))))}},5051:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(7143),c=a(3935);const r=(0,n.combineReducers)({connectionStatus:(e={},t)=>{switch(t.type){case c.v_:return{...e,...t.connectionStatus};case c.dz:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:(e=!1,t)=>t.type===c.ZO?t.isFetching:e,siteIsRegistering:(e=!1,t)=>t.type===c.Ij?t.isRegistering:e,userIsConnecting:(e=!1,t)=>t.type===c.DO?t.isConnecting:e,registrationError:(e,t)=>{switch(t.type){case c.LW:return!1;case c.A1:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===c.XY?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:(e={},t)=>t.type===c.gH?t.connectedPlugins:e,connectionErrors:(e={},t)=>t.type===c.Kl?t.connectionErrors:e,isOfflineMode:(e=!1,t)=>t.type===c.MU?t.isConnecting:e})},8019:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(7143),c=a(3935),r=a(2279);const s={...{getAuthorizationUrl:{isFulfilled:(e,...t)=>{const a=Boolean(e.authorizationUrl),c=(0,n.select)(r.A).hasFinishedResolution("getAuthorizationUrl",t);return a&&!c&&(0,n.dispatch)(r.A).finishResolution("getAuthorizationUrl",t),a},*fulfill(e){const t=yield c.Ay.fetchAuthorizationUrl(e);yield c.Ay.setAuthorizationUrl(t.authorizeUrl)}}}}},2676:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n={...{getConnectionStatus:e=>e.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionErrors:e=>e.connectionErrors||[],getIsOfflineMode:e=>e.isOfflineMode||!1,getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}}},8734:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(7143);class c{static store=null;static mayBeInit(e,t){null===c.store&&(c.store=(0,n.createReduxStore)(e,t),(0,n.register)(c.store))}}const r=c},2279:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n="jetpack-connection"},4293:(e,t,a)=>{"use strict";a.d(t,{a:()=>u.A});var n=a(7999),c=a(3935),r=a(2494),s=a(5051),i=a(8019),l=a(2676),o=a(8734),u=a(2279);const m=window.JP_CONNECTION_INITIAL_STATE||(0,n.getScriptData)()?.connection;m||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),o.A.mayBeInit(u.A,{__experimentalUseThunks:!0,reducer:s.A,actions:c.Ay,selectors:l.A,resolvers:i.A,controls:r.A,initialState:m||{}})},9534:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var n=a(372),c=a(7142),r=a(6461),s=a(6427),i=a(6087),l=a(7723),o=a(1113),u=a(311),m=a(8120),d=a.n(m),p=a(1609),h=a.n(p);const __=l.__,g=e=>{const{className:t,disabled:a,onChange:n,value:c}=e;return h().createElement(s.TextControl,{__nextHasNoMarginBottom:!0,className:t,label:__("License key","jetpack-my-jetpack"),value:c,onChange:n,disabled:a})},v=e=>{const{className:t,availableLicenses:a,disabled:n,onChange:c,value:r}=e,[i,o]=(0,p.useState)(""),u=null===a,m=(0,p.useMemo)((()=>u?[{label:__("Fetching available licenses…","jetpack-my-jetpack"),value:""}]:[...a.map((({product:e,license_key:t})=>({label:(0,l.sprintf)(/* translators: placeholder is the product name and license key */ +__("%1$s - %2$s","jetpack-my-jetpack"),e,t),value:t}))),{label:__("I want to add a license key manually","jetpack-my-jetpack"),value:""}]),[a,u]);(0,p.useEffect)((()=>{o(m?.length?m[0].value:"")}),[m]);const d=(0,p.useCallback)((e=>{o(e),c(e)}),[c]);return h().createElement(h().Fragment,null,h().createElement(s.SelectControl,{__nextHasNoMarginBottom:!0,className:t,disabled:n,label:__("Select a license key","jetpack-my-jetpack"),value:i,options:m,onChange:d}),!u&&!i&&h().createElement(s.TextControl,{__nextHasNoMarginBottom:!0,className:t,label:__("Input a license key","jetpack-my-jetpack"),value:r,onChange:c,disabled:n}))},f=e=>{const{activateLicense:t,availableLicenses:a,fetchingAvailableLicenses:l,isActivating:m,license:d,licenseError:f,onLicenseChange:w}=e,E=null!=f;(0,p.useEffect)((()=>{n.A.tracks.recordEvent("jetpack_wpa_license_key_activation_view")}),[]);const k=E?"jp-license-activation-screen-controls--license-field-with-error":"jp-license-activation-screen-controls--license-field",y=a&&a.length;return h().createElement("div",{className:"jp-license-activation-screen-controls"},h().createElement("div",{className:"jp-license-activation-screen-controls--content"},h().createElement(c.A,{showText:!1,height:48}),h().createElement("h1",null,__("Add a license key","jetpack-my-jetpack")),h().createElement("p",null,(0,i.createInterpolateElement)(__("Check your email for your license key. You should have received it after making your purchase.","jetpack-my-jetpack"),{strong:h().createElement("strong",null)})),l||y?h().createElement(v,{className:k,disabled:l||m,onChange:w,availableLicenses:l?null:a,value:d}):h().createElement(g,{className:k,disabled:m,onChange:w,value:d}),E&&h().createElement("div",{className:"jp-license-activation-screen-controls--license-field-error"},h().createElement(o.A,{icon:u.A}),h().createElement("span",null,f))),h().createElement("div",null,h().createElement(s.Button,{className:"jp-license-activation-screen-controls--button",onClick:t,disabled:!d},m?h().createElement(r.A,null):__("Activate","jetpack-my-jetpack"))))};f.propTypes={activateLicense:d().func.isRequired,availableLicenses:d().array,fetchingAvailableLicenses:d().bool,isActivating:d().bool.isRequired,license:d().string.isRequired,licenseError:d().string,onLicenseChange:d().func.isRequired,siteUrl:d().string.isRequired};const w=f},5986:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var n=a(3924),c=a(6087),r=a(7723),s=a(8120),i=a.n(s),l=a(1609),o=a.n(l);const __=r.__,u=e=>{const{imageUrl:t,showSupportLink:a=!1}=e;return o().createElement("div",{className:"jp-license-activation-screen-illustration"},o().createElement("div",{className:"jp-license-activation-screen-illustration--wrapper"},o().createElement("img",{className:"jp-license-activation-screen-illustration--img",src:t,alt:""})),a&&o().createElement("p",{className:"jp-license-activation-screen-illustration--support-link"},(0,c.createInterpolateElement)(__("Do you need help? Contact us.","jetpack-my-jetpack"),{a:o().createElement("a",{href:(0,n.A)("jetpack-support-license-activation")})})))};u.propTypes={imageUrl:i().string.isRequired,showSupportLink:i().bool};const m=u},3806:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(7142),c=a(8120),r=a.n(c),s=a(1609),i=a.n(s),l=a(8354),o=a(8560),u=a(8547);const m=e=>{const{productId:t,siteRawUrl:a,siteAdminUrl:c,currentRecommendationsStep:r}=e;return i().createElement("div",{className:"jp-license-activation-screen-success-info"},i().createElement("div",{className:"jp-license-activation-screen-success-info--content"},i().createElement(n.A,{showText:!1,height:48})),i().createElement(o.A,{siteRawUrl:a,productId:t}),i().createElement("div",{className:"jp-license-activation-screen-success-info--buttons"},i().createElement(l.F,{currentRecommendationsStep:r,siteAdminUrl:c,siteRawUrl:a,productId:t}),i().createElement(u.m,{siteRawUrl:a,productId:t})))};m.propTypes={siteRawUrl:r().string,productId:r().number,siteAdminUrl:r().string,currentRecommendationsStep:r().string};const d=m},8354:(e,t,a)=>{"use strict";a.d(t,{F:()=>p});var n=a(6461),c=a(3924),r=a(6427),s=a(7723),i=a(8120),l=a.n(i),o=a(1609),u=a.n(o),m=a(3010),d=a(1183);const __=s.__,p=e=>{const{currentRecommendationsStep:t,siteAdminUrl:a,siteRawUrl:s,productId:i}=e,[l,o]=(0,m.A)(),p=e=>l.map((e=>e.name)).includes(e),h=(0,d.p)(i),g=p("Jetpack"),v=p("Jetpack Social"),f="jetpack_social_advanced"===h||"jetpack_social_basic"===h,w=p("Jetpack Protect");if(o)return u().createElement(r.Button,{className:"jp-license-activation-screen-success-info--button"},u().createElement(n.A,null));if(f&&(g||v))return u().createElement(r.Button,{className:"jp-license-activation-screen-success-info--button",href:a+(g?"admin.php?page=jetpack#/recommendations/"+("jetpack_social_advanced"===h?"welcome-social-advanced":"welcome-social-basic"):"admin.php?page=jetpack-social")},__("Configure my site","jetpack-my-jetpack"));if("jetpack_scan"===h){const e=w?a+"admin.php?page=jetpack-protect":(0,c.A)("jetpack-license-activation-success-scan",{site:s});return u().createElement(r.Button,{className:"jp-license-activation-screen-success-info--button",href:e},__("View scan results","jetpack-my-jetpack"))}return"not-started"===t?u().createElement(r.Button,{className:"jp-license-activation-screen-success-info--button",href:a+"admin.php?page=jetpack#/recommendations"},__("Configure my site","jetpack-my-jetpack")):u().createElement(r.Button,{className:"jp-license-activation-screen-success-info--button",href:(0,c.A)("license-activation-view-my-plans",{site:s})},__("View my plans","jetpack-my-jetpack"))};p.propTypes={siteAdminUrl:l().string.isRequired,currentRecommendationsStep:l().string,siteRawUrl:l().string.isRequired}},8547:(e,t,a)=>{"use strict";a.d(t,{m:()=>m});var n=a(3924),c=a(6427),r=a(7723),s=a(8120),i=a.n(s),l=a(1609),o=a.n(l),u=a(1183);const __=r.__,m=e=>{const{productId:t,siteRawUrl:a}=e,r={jetpack_backup:{text:__("View latest backup","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-backup"},jetpack_complete:{text:__("View latest backup","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-backup"},jetpack_scan:{text:__("View my plans","jetpack-my-jetpack"),redirectSource:"license-activation-view-my-plans"},jetpack_search:{text:__("Configure search","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-search"},jetpack_security:{text:__("View latest backup","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-backup"},default:null}[(0,u.p)(t)];return o().createElement(o().Fragment,null,r&&o().createElement(c.ExternalLink,{className:"jp-license-activation-screen-success-info--external-link",href:(0,n.A)(r.redirectSource,{site:a})},r.text))};m.propTypes={siteRawUrl:i().string,productId:i().number}},9051:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var n=a(372),c=a(5932),r=a(6087),s=a(7723),i=a(8120),l=a.n(i),o=a(1609),u=a.n(o),m=a(9534),d=a(5986),p=a(3806),h=a(7129),g=a(6309),v=a(7139);const __=s.__,f=e=>{const{availableLicenses:t=[],currentRecommendationsStep:a,fetchingAvailableLicenses:s=!1,onActivationSuccess:i=()=>null,siteAdminUrl:l,siteRawUrl:f,startingLicense:w,displayName:E=""}=e,[k,y]=(0,o.useState)(w??""),[A,b]=(0,o.useState)(null),[j,R]=(0,o.useState)(!1),[C,_]=(0,o.useState)(null);(0,o.useEffect)((()=>{t&&t[0]&&y(t[0].license_key)}),[t]);const x=(0,o.useCallback)((()=>j?Promise.resolve():k.length<1?(b(__("This is not a valid license key. Please try again.","jetpack-my-jetpack")),Promise.resolve()):(b(null),R(!0),n.A.tracks.recordJetpackClick({target:"license_activation_button"}),c.Ay.attachLicenses([k]).then((e=>{const t=(e=>{let t=e;for(;Array.isArray(t)&&t.length>0;)t=t[0];if(t?.activatedProductId)return t.activatedProductId;if(t?.errors)for(const e in t.errors)if(t.errors[e].length>0)throw new Error(t.errors[e][0]);throw new Error(__("An unknown error occurred during license activation. Please try again.","jetpack-my-jetpack"))})(e);_(t),i(t),n.A.tracks.recordEvent("jetpack_wpa_license_activation_success")})).catch((e=>{n.A.tracks.recordEvent("jetpack_wpa_license_activation_error");"invalid_permission_manage_user_licenses"===e.response?.code?b((0,r.createInterpolateElement)(__("You either do not have permissions to perform this action or a user account needs to be connected. Click here to connect your user account or contact your administrator.","jetpack-my-jetpack"),{connectLink:u().createElement("a",{href:"admin.php?page=my-jetpack#/connection?returnTo=add-license"})})):b(e.message)})).finally((()=>{R(!1)})))),[j,k,i]);return null!==C&&k.startsWith("jetpack-golden-token")?u().createElement(h.A,{tokenRedeemed:!0,displayName:E}):null!==C?u().createElement("div",{className:"jp-license-activation-screen"},u().createElement(p.A,{siteRawUrl:f,productId:C,siteAdminUrl:l,currentRecommendationsStep:a}),u().createElement(d.A,{imageUrl:v,showSupportLink:!1})):u().createElement("div",{className:"jp-license-activation-screen"},u().createElement(m.A,{availableLicenses:t,activateLicense:x,fetchingAvailableLicenses:s,isActivating:j,license:k,licenseError:A,onLicenseChange:y,siteUrl:f}),u().createElement(d.A,{imageUrl:g,showSupportLink:!0}))};f.propTypes={availableLicenses:l().array,currentRecommendationsStep:l().string,fetchingAvailableLicenses:l().bool,onActivationSuccess:l().func,siteAdminUrl:l().string.isRequired,siteRawUrl:l().string.isRequired,startingLicense:l().string,displayName:l().string};const w=f},7129:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var n=a(8478),c=a(5918),r=a(8509),s=a(7142),i=a(1112),l=a(6427),o=a(7723),u=a(3022),m=a(8120),d=a.n(m),p=a(1609),h=a.n(p),g=a(2980);const __=o.__,_x=o._x,v=e=>{document.referrer.includes(window.location.host)?(e.preventDefault(),history.back()):(e.preventDefault(),window.location.href=window?.myJetpackInitialState?.myJetpackUrl)};function f({redeemClick:e,displayName:t,onModalClose:a=v,tokenRedeemed:m=!1}){const[d,f]=(0,p.useState)(!1),w=(0,p.useRef)(null);(0,p.useEffect)((()=>{setTimeout((()=>{w?.current?.play()}),500)}),[w]);const E=(0,n.Wy)("scan"),k=(0,n.Wy)("backup"),y=(0,p.useCallback)((t=>{e?.(t),f(!0),w.current.play()}),[w,e]),A=(0,p.useCallback)((()=>{d&&w.current.play()}),[d]),b=(0,u.A)(g.A.modal,{[g.A.animating]:d});return h().createElement("div",null,h().createElement(l.Modal,{className:b,onRequestClose:a,isDismissible:!1,__experimentalHideHeader:!0},h().createElement(c.A,{horizontalSpacing:3,horizontalGap:3},h().createElement(r.A,null,h().createElement(s.A,{className:g.A["jetpack-logo"]}),h().createElement("div",{className:g.A["video-wrap"],onClick:A,role:"presentation"},h().createElement("video",{ref:w,src:"https://videos.files.wordpress.com/oSlNIBQO/jetpack-golden-token.mp4",muted:"muted"})),h().createElement("div",{className:g.A["content-wrap"]},h().createElement("div",{className:g.A["content-wrap-text"]},t.length>0&&h().createElement("p",{className:g.A["hi-user"]},(0,o.sprintf)(/* Translators: %s is the user's display name. */ +__("Hey, %s","jetpack-my-jetpack"),t)),h().createElement("h2",{className:g.A.headline},__("You have been gifted a Jetpack Golden Token.","jetpack-my-jetpack")),h().createElement("p",null,m&&__("This unlocked a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience is already active.","jetpack-my-jetpack"),!m&&__("This unlocks a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience awaits.","jetpack-my-jetpack"))),h().createElement(i.A,{variant:"primary",weight:"regular",onClick:y,className:g.A.button},m&&__("Awesome!","jetpack-my-jetpack"),!m&&__("Redeem your token","jetpack-my-jetpack"))),h().createElement("div",{className:`${g.A["powers-wrap"]} ${g.A["content-wrap"]}`},h().createElement("div",{className:g.A["content-wrap-text"]},h().createElement("h2",{className:g.A.headline},__("Super powers are ready!","jetpack-my-jetpack")),h().createElement("p",{className:g.A.paragraph},__("Your Jetpack Golden Token provides a lifetime license for this website and includes the following products:","jetpack-my-jetpack"))),h().createElement("div",{className:g.A["jetpack-products"]},h().createElement("div",null,h().createElement(k,null),h().createElement("h3",null,__("VaultPress Backup","jetpack-my-jetpack")),h().createElement("p",null,__("Save every change and get back online quickly with one‑click restores.","jetpack-my-jetpack"))),h().createElement("div",null,h().createElement(E,null),h().createElement("h3",null,_x("Scan","Plugin name (noun).","jetpack-my-jetpack")),h().createElement("p",null,__("Automated scanning and one‑click fixes to keep your site ahead of security threats.","jetpack-my-jetpack")))),h().createElement(i.A,{variant:"primary",weight:"regular",onClick:y,href:window?.myJetpackInitialState?.myJetpackUrl,className:g.A.button},__("Explore your new powers","jetpack-my-jetpack")))))))}f.propTypes={redeemClick:d().func,tokenRedeemed:d().bool,displayName:d().string,onModalClose:d().func};const w=f},1040:(e,t,a)=>{"use strict";a.d(t,{_:()=>c.A,b:()=>n.A});var n=a(9051),c=a(7129)},4705:(e,t,a)=>{"use strict";a(8992),a(1135)},1135:(e,t,a)=>{"use strict";a.d(t,{$:()=>n});const n=[{name:"amazon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M13.582 8.182c-1.648.185-3.802.308-5.344.984-1.781.769-3.03 2.337-3.03 4.644 0 2.953 1.86 4.429 4.253 4.429 2.02 0 3.125-.477 4.685-2.065.516.747.685 1.109 1.629 1.894a.59.59 0 0 0 .672-.066l.006.006c.567-.505 1.599-1.401 2.18-1.888.231-.188.19-.496.009-.754-.52-.718-1.072-1.303-1.072-2.634V8.305c0-1.876.133-3.599-1.249-4.891C15.23 2.369 13.422 2 12.04 2 9.336 2 6.318 3.01 5.686 6.351c-.068.355.191.542.423.594l2.754.298c.258-.013.445-.266.494-.523.236-1.151 1.2-1.706 2.284-1.706.584 0 1.249.215 1.595.738.398.584.346 1.384.346 2.061zm-.533 5.906c-.451.8-1.169 1.291-1.967 1.291-1.09 0-1.728-.83-1.728-2.061 0-2.42 2.171-2.86 4.227-2.86v.615c.001 1.108.027 2.031-.532 3.015m7.634 5.251C18.329 21.076 14.917 22 11.979 22c-4.118 0-7.826-1.522-10.632-4.057-.22-.199-.024-.471.241-.317 3.027 1.762 6.771 2.823 10.639 2.823 2.608 0 5.476-.541 8.115-1.66.397-.169.73.262.341.55m.653 1.704c-.194.163-.379.076-.293-.139.284-.71.92-2.298.619-2.684s-1.99-.183-2.749-.092c-.23.027-.266-.173-.059-.319 1.348-.946 3.555-.673 3.811-.356.26.32-.066 2.533-1.329 3.59"})))},{name:"behance",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M7.799 5.698c.589 0 1.12.051 1.606.156q.722.155 1.241.507.516.351.804.938c.188.387.281.871.281 1.443q0 .93-.421 1.551-.424.62-1.255 1.014 1.133.328 1.689 1.146.559.822.557 1.975 0 .935-.359 1.612a3.14 3.14 0 0 1-.973 1.114q-.613.432-1.399.637A6.1 6.1 0 0 1 7.963 18H2V5.698zm-.35 4.97q.721 0 1.192-.345.465-.344.463-1.119 0-.43-.152-.707a1.1 1.1 0 0 0-.416-.427 1.7 1.7 0 0 0-.596-.216 3.6 3.6 0 0 0-.697-.06H4.709v2.874zm.151 5.237q.401.001.759-.077c.243-.053.457-.137.637-.261.182-.12.332-.283.441-.491q.164-.31.163-.798-.002-.948-.533-1.357c-.356-.27-.83-.404-1.413-.404H4.709v3.388zm8.562-.041q.552.538 1.583.538.74 0 1.277-.374c.354-.248.571-.514.654-.79h2.155c-.347 1.072-.872 1.838-1.589 2.299-.708.463-1.572.693-2.58.693q-1.05 0-1.899-.337a4 4 0 0 1-1.439-.958 4.4 4.4 0 0 1-.904-1.484 5.4 5.4 0 0 1-.32-1.899q0-1 .329-1.863a4.4 4.4 0 0 1 .933-1.492q.607-.63 1.444-.994a4.6 4.6 0 0 1 1.857-.363q1.131-.001 1.98.44a3.94 3.94 0 0 1 1.389 1.181 4.8 4.8 0 0 1 .783 1.69q.24.947.171 1.983h-6.428c-.001.706.237 1.372.604 1.73m2.811-4.68c-.291-.321-.783-.496-1.384-.496q-.585 0-.973.2a2 2 0 0 0-.621.491 1.8 1.8 0 0 0-.328.628 2.7 2.7 0 0 0-.111.587h3.98c-.058-.625-.271-1.085-.563-1.41m-3.916-3.446h4.985V6.524h-4.985z"})))},{name:"blogger-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.779 9.904h-.981l-.021.001a1.163 1.163 0 0 1-1.16-1.079l-.001-.013A5.813 5.813 0 0 0 11.803 3H8.871a5.813 5.813 0 0 0-5.813 5.813v6.375a5.813 5.813 0 0 0 5.813 5.813h6.257a5.814 5.814 0 0 0 5.813-5.813l.002-4.121a1.164 1.164 0 0 0-1.164-1.163M8.726 7.713h3.291a1.117 1.117 0 1 1 0 2.234H8.726a1.117 1.117 0 1 1 0-2.234m6.601 8.657H8.72a1.057 1.057 0 1 1 0-2.114h6.607a1.057 1.057 0 1 1 0 2.114"})))},{name:"blogger",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M14.722 14.019a.654.654 0 0 1-.654.654H9.977a.654.654 0 0 1 0-1.308h4.091c.361 0 .654.293.654.654m-4.741-3.321h2.038a.692.692 0 0 0 0-1.384H9.981a.692.692 0 0 0 0 1.384M21 5v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2m-3.456 6.39a.72.72 0 0 0-.72-.72h-.607l-.013.001a.72.72 0 0 1-.718-.668l-.001-.008a3.6 3.6 0 0 0-3.599-3.599H10.07a3.6 3.6 0 0 0-3.599 3.599v3.947a3.6 3.6 0 0 0 3.599 3.599h3.874a3.6 3.6 0 0 0 3.599-3.599z"})))},{name:"bluesky",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.2 3.3c-.5-.2-1.4-.5-3.6 1C15.4 6 12.9 9.2 12 11c-.9-1.8-3.4-5-5.7-6.7-2.2-1.6-3-1.3-3.6-1S2 4.6 2 5.1s.3 4.7.5 5.4c.7 2.3 3.1 3.1 5.3 2.8-3.3.5-6.2 1.7-2.4 5.9 4.2 4.3 5.7-.9 6.5-3.6.8 2.7 1.7 7.7 6.4 3.6 3.6-3.6 1-5.4-2.3-5.9 2.2.2 4.6-.5 5.3-2.8.4-.7.7-4.8.7-5.4 0-.5-.1-1.5-.8-1.8"})))},{name:"codepen",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m22.016 8.84-.007-.037q-.006-.037-.015-.072-.007-.022-.013-.042l-.023-.062-.02-.042a.4.4 0 0 0-.03-.057l-.025-.038-.035-.052-.03-.037q-.021-.026-.043-.045-.015-.018-.035-.035a.4.4 0 0 0-.048-.04l-.037-.03-.015-.012-9.161-6.096a.86.86 0 0 0-.955 0L2.359 8.237l-.015.012-.038.028-.048.04a.638.638 0 0 0-.078.082q-.018.018-.03.037-.018.026-.035.052l-.025.038q-.016.031-.03.059l-.02.041a1 1 0 0 0-.034.106q-.01.034-.016.071-.003.02-.006.037a1 1 0 0 0-.009.114v6.093q0 .056.008.112l.007.038q.006.035.015.072a.2.2 0 0 0 .013.04q.01.032.022.063l.02.04a.4.4 0 0 0 .055.096l.035.052.03.037.042.045.035.035q.023.02.048.04l.038.03.013.01 9.163 6.095a.858.858 0 0 0 .959.004l9.163-6.095.015-.01q.02-.015.037-.03l.048-.04q.02-.017.035-.035.025-.024.043-.045l.03-.037.035-.052.025-.038a.4.4 0 0 0 .03-.058l.02-.04.023-.063c.003-.013.01-.027.013-.04q.009-.037.015-.072l.007-.037q.006-.062.007-.117V8.954a1 1 0 0 0-.008-.114m-9.154-4.376 6.751 4.49-3.016 2.013-3.735-2.492zm-1.724 0v4.009l-3.735 2.494-3.014-2.013zm-7.439 6.098L5.853 12l-2.155 1.438zm7.439 8.974-6.749-4.491 3.015-2.011 3.735 2.492zM12 14.035 8.953 12 12 9.966 15.047 12zm.862 5.501v-4.009l3.735-2.492 3.016 2.011zm7.441-6.098L18.147 12l2.156-1.438z"})))},{name:"deezer",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20.129 3.662c.222-1.287.548-2.096.909-2.098h.001c.673.002 1.219 2.809 1.219 6.274s-.546 6.274-1.22 6.274c-.276 0-.531-.477-.736-1.276-.324 2.926-.997 4.937-1.776 4.937-.603 0-1.144-1.208-1.507-3.114-.248 3.624-.872 6.195-1.602 6.195-.458 0-.875-1.019-1.184-2.678C13.861 21.6 13.003 24 12.002 24s-1.861-2.399-2.231-5.824c-.307 1.659-.724 2.678-1.184 2.678-.73 0-1.352-2.571-1.602-6.195-.363 1.905-.903 3.114-1.507 3.114-.778 0-1.452-2.011-1.776-4.937-.204.802-.46 1.276-.736 1.276-.674 0-1.22-2.809-1.22-6.274s.546-6.274 1.22-6.274c.362 0 .685.812.91 2.098.357-2.22.94-3.662 1.6-3.662.784 0 1.463 2.04 1.784 5.002.314-2.156.791-3.53 1.325-3.53.749 0 1.385 2.703 1.621 6.474.443-1.933 1.085-3.146 1.795-3.146s1.352 1.214 1.795 3.146c.237-3.771.872-6.474 1.621-6.474.533 0 1.009 1.374 1.325 3.53.321-2.962 1-5.002 1.784-5.002.658 0 1.244 1.443 1.603 3.662M0 7.221c0-1.549.31-2.805.692-2.805s.692 1.256.692 2.805-.31 2.805-.692 2.805S0 8.77 0 7.221m22.616 0c0-1.549.31-2.805.692-2.805S24 5.672 24 7.221s-.31 2.805-.692 2.805-.692-1.256-.692-2.805"})))},{name:"discord",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20.33 4.523A20 20 0 0 0 15.379 3a14 14 0 0 0-.634 1.289 18.4 18.4 0 0 0-5.495 0A14 14 0 0 0 8.615 3 20 20 0 0 0 3.66 4.527C.527 9.163-.323 13.684.102 18.141a20 20 0 0 0 6.073 3.049 14.7 14.7 0 0 0 1.301-2.097 13 13 0 0 1-2.048-.978q.258-.189.502-.378a14.27 14.27 0 0 0 12.142 0q.247.202.502.378a13 13 0 0 1-2.052.98 14.5 14.5 0 0 0 1.301 2.095 19.9 19.9 0 0 0 6.076-3.047c.498-5.168-.851-9.648-3.568-13.62M8.013 15.4c-1.183 0-2.161-1.074-2.161-2.395S6.796 10.6 8.01 10.6s2.183 1.083 2.163 2.405S9.22 15.4 8.013 15.4m7.974 0c-1.186 0-2.16-1.074-2.16-2.395s.944-2.405 2.16-2.405 2.178 1.083 2.157 2.405-.951 2.395-2.158 2.395"})))},{name:"dribbble",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10m8.434-8.631c-.292-.092-2.644-.794-5.32-.365 1.117 3.07 1.572 5.57 1.659 6.09a8.56 8.56 0 0 0 3.661-5.725m-5.098 6.507c-.127-.749-.623-3.361-1.822-6.477l-.056.019c-4.818 1.679-6.547 5.02-6.701 5.334A8.5 8.5 0 0 0 12 20.555a8.5 8.5 0 0 0 3.336-.679m-9.682-2.152c.193-.331 2.538-4.213 6.943-5.637q.167-.054.337-.102a29 29 0 0 0-.692-1.45c-4.266 1.277-8.405 1.223-8.778 1.216a8.497 8.497 0 0 0 2.19 5.973m-2.015-7.46c.382.005 3.901.02 7.897-1.041a55 55 0 0 0-3.167-4.94 8.57 8.57 0 0 0-4.73 5.981m6.359-6.555a46 46 0 0 1 3.187 5c3.037-1.138 4.323-2.867 4.477-3.085a8.51 8.51 0 0 0-7.664-1.915m8.614 2.903c-.18.243-1.612 2.078-4.77 3.367a27 27 0 0 1 .751 1.678c2.842-.357 5.666.215 5.948.275a8.5 8.5 0 0 0-1.929-5.32"})))},{name:"dropbox",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 6.134 6.069 9.797 2 6.54l5.883-3.843zm-10 6.92 5.883 3.843L12 13.459 6.069 9.797zm10 .405 4.116 3.439L22 13.054l-4.069-3.257zM22 6.54l-5.884-3.843L12 6.134l5.931 3.663zm-9.989 7.66-4.129 3.426-1.767-1.153v1.291l5.896 3.539 5.897-3.539v-1.291l-1.769 1.153z"})))},{name:"eventbrite",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M18.041 3.931 5.959 3A2.96 2.96 0 0 0 3 5.959v12.083A2.96 2.96 0 0 0 5.959 21l12.083-.931C19.699 19.983 21 18.744 21 17.11V6.89c0-1.634-1.259-2.863-2.959-2.959M16.933 8.17c-.082.215-.192.432-.378.551-.188.122-.489.132-.799.132-1.521 0-3.062-.048-4.607-.048q-.23 1.061-.451 2.128c.932-.004 1.873.005 2.81.005.726 0 1.462-.069 1.586.525.04.189-.001.426-.052.615-.105.38-.258.676-.625.783-.185.054-.408.058-.646.058-1.145 0-2.345.017-3.493.02-.169.772-.328 1.553-.489 2.333 1.57-.005 3.067-.041 4.633-.058.627-.007 1.085.194 1.009.85a2.2 2.2 0 0 1-.211.725c-.102.208-.248.376-.488.452-.237.075-.541.064-.862.078-.304.014-.614.008-.924.016-.309.009-.619.022-.919.022-1.253 0-2.429.08-3.683.073-.603-.004-1.014-.249-1.124-.757-.059-.273-.018-.58.036-.841a3543 3543 0 0 1 1.629-7.763c.056-.265.114-.511.225-.714a1.24 1.24 0 0 1 .79-.62c.368-.099.883-.047 1.344-.047.305 0 .612.008.914.016.925.026 1.817.03 2.747.053.304.007.615.016.915.016.621 0 1.17.073 1.245.614.039.288-.051.567-.132.783"})))},{name:"facebook",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10"})))},{name:"fediverse",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 743 743"},React.createElement("g",null,React.createElement("path",{d:"M181.131 275.137a68.9 68.9 0 0 1-29.465 29.328l161.758 162.389 38.998-19.764zm213.363 214.187-38.998 19.764 81.963 82.283a68.9 68.9 0 0 1 29.471-29.332zM581.646 339.391l-91.576 46.41 6.752 43.189 103.616-52.513a68.9 68.9 0 0 1-18.792-37.086m-144.738 73.351L220.383 522.477a68.9 68.9 0 0 1 18.795 37.089L443.66 455.934zM367.275 142.438l-104.48 203.97 30.848 30.967 110.623-215.957a68.9 68.9 0 0 1-36.991-18.98M235.621 399.459l-52.922 103.314a68.9 68.9 0 0 1 36.987 18.979l46.781-91.328zM150.768 304.918a68.9 68.9 0 0 1-34.416 7.195 69 69 0 0 1-6.651-.695l30.903 197.662a68.9 68.9 0 0 1 34.416-7.195 69 69 0 0 1 6.646.695zM239.342 560.545c.707 4.589.949 9.239.72 13.877a68.9 68.9 0 0 1-7.267 27.18l197.629 31.712c-.708-4.59-.95-9.24-.723-13.878a68.9 68.9 0 0 1 7.27-27.178zM601.133 377.199l-91.219 178.082a68.9 68.9 0 0 1 36.994 18.983l91.217-178.08a68.9 68.9 0 0 1-36.992-18.985M476.723 125.33a68.9 68.9 0 0 1-29.471 29.332l141.266 141.811a68.9 68.9 0 0 1 29.468-29.332zM347.787 104.631l-178.576 90.498a68.9 68.9 0 0 1 18.793 37.086l178.574-90.502a68.9 68.9 0 0 1-18.791-37.082M446.926 154.826a68.9 68.9 0 0 1-34.983 7.483 69 69 0 0 1-6.029-.633l15.818 101.291 43.163 6.926zm-16 167.028 37.4 239.482a68.9 68.9 0 0 1 33.914-6.943q3.625.206 7.207.791L474.09 328.777zM188.131 232.975c.734 4.66.988 9.383.758 14.095a68.9 68.9 0 0 1-7.16 26.983l101.369 16.281 19.923-38.908zm173.736 27.9-19.926 38.912 239.514 38.467a69 69 0 0 1-.695-13.719 68.9 68.9 0 0 1 7.349-27.324z"}),React.createElement("path",{fillOpacity:".996",d:"M412.284 156.054c34.538 1.882 64.061-24.592 65.943-59.13s-24.592-64.062-59.131-65.943c-34.538-1.882-64.061 24.592-65.943 59.13s24.593 64.062 59.131 65.943M646.144 390.82c34.538 1.881 64.062-24.593 65.943-59.131s-24.592-64.061-59.13-65.943-64.062 24.593-65.943 59.131 24.592 64.061 59.13 65.943M495.086 685.719c34.538 1.881 64.062-24.592 65.943-59.13s-24.592-64.062-59.13-65.943-64.062 24.592-65.943 59.13 24.592 64.062 59.13 65.943M167.866 633.211c34.538 1.882 64.062-24.592 65.943-59.13s-24.592-64.062-59.13-65.943-64.062 24.592-65.943 59.13 24.592 64.062 59.13 65.943M116.692 305.86c34.538 1.882 64.062-24.592 65.943-59.13s-24.592-64.062-59.131-65.943c-34.538-1.881-64.061 24.592-65.943 59.13s24.593 64.062 59.131 65.943"})))},{name:"feed",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M2 8.667V12c5.515 0 10 4.485 10 10h3.333c0-7.363-5.97-13.333-13.333-13.333M2 2v3.333c9.19 0 16.667 7.477 16.667 16.667H22C22 10.955 13.045 2 2 2m2.5 15a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"})))},{name:"flickr",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5m11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5"})))},{name:"foursquare",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M17.573 2H6.905C5.434 2 5 3.107 5 3.805v16.948c0 .785.422 1.077.66 1.172.238.097.892.177 1.285-.275 0 0 5.035-5.843 5.122-5.93.132-.132.132-.132.262-.132h3.26c1.368 0 1.588-.977 1.732-1.552.078-.318.692-3.428 1.225-6.122l.675-3.368C19.56 2.893 19.14 2 17.573 2m-1.078 5.22c-.053.252-.372.518-.665.518h-4.157c-.467 0-.802.318-.802.787v.508c0 .467.337.798.805.798h3.528c.331 0 .655.362.583.715s-.407 2.102-.448 2.295c-.04.193-.262.523-.655.523h-2.88c-.523 0-.683.068-1.033.503-.35.437-3.505 4.223-3.505 4.223-.032.035-.063.027-.063-.015V4.852c0-.298.26-.648.648-.648h8.562c.315 0 .61.297.528.683z"})))},{name:"ghost",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M10.203 20.997H3.005v-3.599h7.198zm10.792-3.599h-7.193v3.599h7.193zm.003-7.198H3v3.599h17.998zm-7.195-7.197H3.005v3.599h10.798zm7.197 0h-3.599v3.599H21z"})))},{name:"git",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M23.519 10.947 13.053.482a1.543 1.543 0 0 0-2.183 0L8.696 2.656l2.756 2.756a1.83 1.83 0 0 1 1.886.439 1.84 1.84 0 0 1 .436 1.898l2.656 2.657a1.83 1.83 0 0 1 1.899.436 1.837 1.837 0 0 1 0 2.597 1.84 1.84 0 0 1-2.599 0 1.84 1.84 0 0 1-.4-1.998l-2.478-2.477v6.521a1.837 1.837 0 0 1 .485 2.945 1.837 1.837 0 0 1-2.597 0 1.837 1.837 0 0 1 0-2.598 1.8 1.8 0 0 1 .602-.401V8.85a1.8 1.8 0 0 1-.602-.4 1.84 1.84 0 0 1-.395-2.009L7.628 3.723.452 10.898a1.544 1.544 0 0 0 0 2.184l10.467 10.467a1.544 1.544 0 0 0 2.183 0l10.417-10.418a1.546 1.546 0 0 0 0-2.184"})))},{name:"github",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.419 2.865 8.166 6.839 9.489.5.09.682-.218.682-.484 0-.236-.009-.866-.014-1.699-2.782.602-3.369-1.34-3.369-1.34-.455-1.157-1.11-1.465-1.11-1.465-.909-.62.069-.608.069-.608 1.004.071 1.532 1.03 1.532 1.03.891 1.529 2.341 1.089 2.91.833.091-.647.349-1.086.635-1.337-2.22-.251-4.555-1.111-4.555-4.943 0-1.091.39-1.984 1.03-2.682-.103-.254-.447-1.27.097-2.646 0 0 .84-.269 2.75 1.025A9.6 9.6 0 0 1 12 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.748-1.025 2.748-1.025.546 1.376.202 2.394.1 2.646.64.699 1.026 1.591 1.026 2.682 0 3.841-2.337 4.687-4.565 4.935.359.307.679.917.679 1.852 0 1.335-.012 2.415-.012 2.741 0 .269.18.579.688.481A10 10 0 0 0 22 12c0-5.523-4.477-10-10-10"})))},{name:"google-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m-.05 16c-3.312 0-6-2.688-6-6s2.688-6 6-6c1.62 0 2.976.594 4.014 1.566L14.26 9.222c-.432-.408-1.188-.888-2.31-.888-1.986 0-3.606 1.65-3.606 3.672s1.62 3.672 3.606 3.672c2.298 0 3.144-1.59 3.3-2.532h-3.306v-2.238h5.616c.084.378.15.732.15 1.23 0 3.426-2.298 5.862-5.76 5.862"})))},{name:"google-plus-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M8 11h6.61c.06.35.11.7.11 1.16 0 4-2.68 6.84-6.72 6.84-3.87 0-7-3.13-7-7s3.13-7 7-7c1.89 0 3.47.69 4.69 1.83l-1.9 1.83c-.52-.5-1.43-1.08-2.79-1.08-2.39 0-4.34 1.98-4.34 4.42S5.61 16.42 8 16.42c2.77 0 3.81-1.99 3.97-3.02H8zm15 0h-2V9h-2v2h-2v2h2v2h2v-2h2"})))},{name:"google-plus",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m-1.919 14.05a4.051 4.051 0 0 1 0-8.1c1.094 0 2.009.401 2.709 1.057l-1.15 1.118a2.23 2.23 0 0 0-1.559-.599c-1.341 0-2.434 1.114-2.434 2.479s1.094 2.479 2.434 2.479c1.551 0 2.122-1.073 2.227-1.709h-2.232v-1.511h3.791c.057.255.101.494.101.83.001 2.312-1.55 3.956-3.887 3.956M19 12.75h-1.25V14h-1.5v-1.25H15v-1.5h1.25V10h1.5v1.25H19z"})))},{name:"google",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.02 10.18v3.73h5.51c-.26 1.57-1.67 4.22-5.5 4.22-3.31 0-6.01-2.75-6.01-6.12s2.7-6.12 6.01-6.12c1.87 0 3.13.8 3.85 1.48l2.84-2.76C16.99 2.99 14.73 2 12.03 2c-5.52 0-10 4.48-10 10s4.48 10 10 10c5.77 0 9.6-4.06 9.6-9.77 0-.83-.11-1.42-.25-2.05z"})))},{name:"instagram",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 4.622c2.403 0 2.688.009 3.637.052.877.04 1.354.187 1.671.31.42.163.72.358 1.035.673s.51.615.673 1.035c.123.317.27.794.31 1.671.043.949.052 1.234.052 3.637s-.009 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.671-.163.42-.358.72-.673 1.035s-.615.51-1.035.673c-.317.123-.794.27-1.671.31-.949.043-1.233.052-3.637.052s-2.688-.009-3.637-.052c-.877-.04-1.354-.187-1.671-.31a2.8 2.8 0 0 1-1.035-.673 2.8 2.8 0 0 1-.673-1.035c-.123-.317-.27-.794-.31-1.671-.043-.949-.052-1.234-.052-3.637s.009-2.688.052-3.637c.04-.877.187-1.354.31-1.671.163-.42.358-.72.673-1.035s.615-.51 1.035-.673c.317-.123.794-.27 1.671-.31.949-.043 1.234-.052 3.637-.052M12 3c-2.444 0-2.751.01-3.711.054-.958.044-1.612.196-2.184.418a4.4 4.4 0 0 0-1.594 1.039c-.5.5-.808 1.002-1.038 1.594-.223.572-.375 1.226-.419 2.184C3.01 9.249 3 9.556 3 12s.01 2.751.054 3.711c.044.958.196 1.612.418 2.185.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.267.054 3.711.054s2.751-.01 3.711-.054c.958-.044 1.612-.196 2.185-.418a4.4 4.4 0 0 0 1.594-1.038c.5-.5.808-1.002 1.038-1.594.222-.572.375-1.227.418-2.185.044-.96.054-1.267.054-3.711s-.01-2.751-.054-3.711c-.044-.958-.196-1.612-.418-2.185A4.4 4.4 0 0 0 19.49 4.51c-.5-.5-1.002-.808-1.594-1.038-.572-.222-1.227-.375-2.185-.418C14.751 3.01 14.444 3 12 3m0 4.378a4.622 4.622 0 1 0 0 9.244 4.622 4.622 0 0 0 0-9.244M12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6m4.804-8.884a1.08 1.08 0 1 0 .001 2.161 1.08 1.08 0 0 0-.001-2.161"})))},{name:"json-feed",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m8.522 17.424.027.027c1.076-1.076 1.854-.993 3.154.306l2.053 2.053c2.136 2.136 4.131 2.028 6.515-.356l.729-.728-1.548-1.548-.373.373c-1.349 1.349-2.293 1.366-3.585.075l-2.409-2.409c-1.242-1.242-2.475-1.366-3.659-.381l-.232-.232c1.01-1.225.911-2.368-.29-3.568l-2.16-2.162c-1.317-1.317-1.308-2.236.058-3.602l.372-.372-1.54-1.54-.728.729c-2.393 2.393-2.525 4.346-.439 6.433l1.78 1.78c1.3 1.3 1.383 2.095.315 3.163l.008.008a1.384 1.384 0 0 0 1.952 1.951"}),React.createElement("circle",{cx:"13.089",cy:"10.905",r:"1.383"}),React.createElement("circle",{cx:"16.349",cy:"7.644",r:"1.383"}),React.createElement("circle",{cx:"19.61",cy:"4.383",r:"1.383"})))},{name:"line",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M14.255 9.572v3.333c0 .084-.066.15-.15.15h-.534a.16.16 0 0 1-.122-.061l-1.528-2.063v1.978c0 .084-.066.15-.15.15h-.534a.15.15 0 0 1-.15-.15V9.576c0-.084.066-.15.15-.15h.529a.14.14 0 0 1 .122.066l1.528 2.063V9.577c0-.084.066-.15.15-.15h.534a.15.15 0 0 1 .155.145m-3.844-.15h-.534a.15.15 0 0 0-.15.15v3.333c0 .084.066.15.15.15h.534c.084 0 .15-.066.15-.15V9.572c0-.08-.066-.15-.15-.15m-1.289 2.794H7.664V9.572a.15.15 0 0 0-.15-.15H6.98a.15.15 0 0 0-.15.15v3.333q0 .062.042.103a.16.16 0 0 0 .103.042h2.142c.084 0 .15-.066.15-.15v-.534a.15.15 0 0 0-.145-.15m7.945-2.794h-2.142c-.08 0-.15.066-.15.15v3.333c0 .08.066.15.15.15h2.142c.084 0 .15-.066.15-.15v-.534a.15.15 0 0 0-.15-.15h-1.458v-.563h1.458c.084 0 .15-.066.15-.15v-.539a.15.15 0 0 0-.15-.15h-1.458v-.563h1.458c.084 0 .15-.066.15-.15v-.534c-.005-.08-.07-.15-.15-.15M22.5 5.33v13.373c-.005 2.1-1.725 3.802-3.83 3.797H5.297c-2.1-.005-3.802-1.73-3.797-3.83V5.297c.005-2.1 1.73-3.802 3.83-3.797h13.373c2.1.005 3.802 1.725 3.797 3.83m-2.888 5.747c0-3.422-3.431-6.206-7.645-6.206s-7.645 2.784-7.645 6.206c0 3.066 2.719 5.634 6.394 6.122.895.192.792.52.591 1.725-.033.192-.155.755.661.413s4.402-2.592 6.009-4.439c1.106-1.219 1.636-2.452 1.636-3.82"})))},{name:"link",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M17 13H7v-2h10zm1-6h-1c-1.631 0-3.065.792-3.977 2H18c1.103 0 2 .897 2 2v2c0 1.103-.897 2-2 2h-4.977c.913 1.208 2.347 2 3.977 2h1a4 4 0 0 0 4-4v-2a4 4 0 0 0-4-4M2 11v2a4 4 0 0 0 4 4h1c1.63 0 3.065-.792 3.977-2H6c-1.103 0-2-.897-2-2v-2c0-1.103.897-2 2-2h4.977C10.065 7.792 8.631 7 7 7H6a4 4 0 0 0-4 4"})))},{name:"linkedin",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.7 3H4.3A1.3 1.3 0 0 0 3 4.3v15.4A1.3 1.3 0 0 0 4.3 21h15.4a1.3 1.3 0 0 0 1.3-1.3V4.3A1.3 1.3 0 0 0 19.7 3M8.339 18.338H5.667v-8.59h2.672zM7.004 8.574a1.548 1.548 0 1 1-.002-3.096 1.548 1.548 0 0 1 .002 3.096m11.335 9.764H15.67v-4.177c0-.996-.017-2.278-1.387-2.278-1.389 0-1.601 1.086-1.601 2.206v4.249h-2.667v-8.59h2.559v1.174h.037c.356-.675 1.227-1.387 2.526-1.387 2.703 0 3.203 1.779 3.203 4.092v4.711z"})))},{name:"mail",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 4.236-8 4.882-8-4.882V6h16z"})))},{name:"mastodon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M11.973 2.352c-2.468.02-4.842.286-6.225.921 0 0-2.742 1.229-2.742 5.415 0 .958-.018 2.105.012 3.32.1 4.094.75 8.128 4.535 9.129 1.745.462 3.244.56 4.45.494 2.19-.122 3.417-.781 3.417-.781l-.072-1.588s-1.565.491-3.32.431c-1.74-.06-3.576-.188-3.858-2.324a4 4 0 0 1-.04-.598s1.709.416 3.874.516c1.324.06 2.563-.076 3.824-.226 2.418-.29 4.524-1.78 4.79-3.141.416-2.144.38-5.232.38-5.232 0-4.186-2.74-5.415-2.74-5.415-1.383-.635-3.76-.9-6.227-.921zM9.18 5.622c1.028 0 1.804.395 2.318 1.185l.502.84.5-.84c.514-.79 1.292-1.186 2.32-1.186.888 0 1.605.313 2.15.922q.795.915.794 2.469v5.068h-2.008V9.16c0-1.037-.438-1.562-1.31-1.562-.966 0-1.448.622-1.448 1.857v2.693h-1.996V9.455c0-1.235-.484-1.857-1.45-1.857-.872 0-1.308.525-1.308 1.562v4.92H6.236V9.012q-.001-1.554.793-2.469c.547-.609 1.263-.922 2.15-.922"})))},{name:"medium-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{fillRule:"nonzero",d:"M7.423 6c3.27 0 5.922 2.686 5.922 6s-2.651 6-5.922 6S1.5 15.313 1.5 12s2.652-6 5.923-6m9.458.351c1.635 0 2.961 2.53 2.961 5.65 0 3.118-1.325 5.648-2.96 5.648S13.92 15.119 13.92 12s1.325-5.649 2.96-5.649m4.577.589c.576 0 1.042 2.265 1.042 5.06s-.466 5.06-1.042 5.06c-.575 0-1.04-2.265-1.04-5.06s.465-5.06 1.04-5.06"})))},{name:"medium",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M3 3v18h18V3zm15 4.26-1 .93a.28.28 0 0 0-.11.27v6.8a.27.27 0 0 0 .11.27l.94.93v.2h-4.75v-.2l1-1c.09-.1.09-.12.09-.27V9.74l-2.71 6.9h-.37L8 9.74v4.62a.67.67 0 0 0 .17.54l1.27 1.54v.2H5.86v-.2l1.27-1.54a.64.64 0 0 0 .17-.54V9a.5.5 0 0 0-.16-.4L6 7.26v-.2h3.52L12.23 13l2.38-5.94H18z"})))},{name:"messenger",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.026.375C5.462.375.375 5.172.375 11.652c0 3.389 1.393 6.318 3.66 8.341.391.352.311.556.377 2.73a.934.934 0 0 0 1.307.823c2.48-1.092 2.512-1.178 2.933-1.064 7.185 1.977 14.973-2.621 14.973-10.83 0-6.48-5.035-11.277-11.599-11.277m6.996 8.678L15.6 14.47a1.75 1.75 0 0 1-2.527.465l-2.723-2.038a.7.7 0 0 0-.844 0l-3.674 2.786c-.49.372-1.133-.216-.802-.735l3.422-5.417a1.75 1.75 0 0 1 2.527-.465l2.722 2.037a.7.7 0 0 0 .844 0L18.22 8.32c.489-.374 1.132.213.801.732"})))},{name:"microblog",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.641 17.086c1.294-1.522 2.067-3.438 2.067-5.521 0-4.957-4.371-8.972-9.763-8.972s-9.763 4.015-9.763 8.972 4.371 8.972 9.763 8.972a10.5 10.5 0 0 0 3.486-.59.315.315 0 0 1 .356.112c.816 1.101 2.09 1.876 3.506 2.191a.194.194 0 0 0 .192-.309 3.82 3.82 0 0 1 .162-4.858zm-3.065-6.575-2.514 1.909.912 3.022a.286.286 0 0 1-.437.317l-2.592-1.802-2.592 1.802a.285.285 0 0 1-.436-.317l.912-3.022-2.515-1.909a.285.285 0 0 1 .167-.513l3.155-.066 1.038-2.981a.285.285 0 0 1 .539 0l1.038 2.981 3.155.066a.285.285 0 0 1 .17.513"})))},{name:"nextdoor",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",strokeMiterlimit:"10",viewBox:"0 0 130 130"},React.createElement("g",null,React.createElement("path",{d:"M64.25 3.531c-31.144.337-57.596 24.22-60.469 55.907-3.064 33.799 21.857 63.685 55.657 66.75s63.685-21.857 66.75-55.657-21.857-63.686-55.657-66.75a62 62 0 0 0-6.281-.25m3.938 34.907C82.468 38.438 93.5 48.58 93.5 61.5v27c0 .685-.565 1.25-1.25 1.25H80.906a1.267 1.267 0 0 1-1.25-1.25V63.375c0-5.58-4.309-11.937-11.469-11.937-7.47 0-11.468 6.357-11.468 11.937V88.5c0 .685-.565 1.25-1.25 1.25H44.125c-.68 0-1.219-.57-1.219-1.25V64.156c0-.74-.529-1.364-1.25-1.531-13.13-2.93-15.115-10.285-15.375-21.125-.005-.332.142-.67.375-.906.233-.237.543-.375.875-.375l11.688.062c.66.01 1.187.529 1.218 1.188.13 4.44.438 9.406 4.438 9.406.83 0 1.443-1.179 1.813-1.719 4.41-6.48 12.28-10.718 21.5-10.718"})))},{name:"patreon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20 7.408c-.003-2.299-1.746-4.182-3.79-4.862-2.54-.844-5.888-.722-8.312.453-2.939 1.425-3.862 4.545-3.896 7.656-.028 2.559.22 9.297 3.92 9.345 2.75.036 3.159-3.603 4.43-5.356.906-1.247 2.071-1.599 3.506-1.963 2.465-.627 4.146-2.626 4.142-5.273"})))},{name:"pinterest-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.289 2C6.617 2 3.606 5.648 3.606 9.622c0 1.846 1.025 4.146 2.666 4.878.25.111.381.063.439-.169.044-.175.267-1.029.365-1.428a.37.37 0 0 0-.091-.362c-.54-.63-.975-1.791-.975-2.873 0-2.777 2.194-5.464 5.933-5.464 3.23 0 5.49 2.108 5.49 5.122 0 3.407-1.794 5.768-4.13 5.768-1.291 0-2.257-1.021-1.948-2.277.372-1.495 1.089-3.112 1.089-4.191 0-.967-.542-1.775-1.663-1.775-1.319 0-2.379 1.309-2.379 3.059 0 1.115.394 1.869.394 1.869s-1.302 5.279-1.54 6.261c-.405 1.666.053 4.368.094 4.604.021.126.167.169.25.063.129-.165 1.699-2.419 2.142-4.051.158-.59.817-2.995.817-2.995.43.784 1.681 1.446 3.013 1.446 3.963 0 6.822-3.494 6.822-7.833C20.394 5.112 16.849 2 12.289 2"})))},{name:"pinterest",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.236 2.636 7.855 6.356 9.312-.087-.791-.166-2.005.035-2.869.182-.78 1.173-4.971 1.173-4.971s-.299-.599-.299-1.484c0-1.39.806-2.429 1.809-2.429.853 0 1.265.641 1.265 1.409 0 .858-.546 2.141-.828 3.329-.236.996.499 1.807 1.481 1.807 1.777 0 3.144-1.874 3.144-4.579 0-2.394-1.72-4.068-4.177-4.068-2.845 0-4.515 2.134-4.515 4.34 0 .859.331 1.781.744 2.282a.3.3 0 0 1 .069.287c-.077.316-.246.995-.279 1.134-.044.183-.145.222-.334.134-1.249-.581-2.03-2.407-2.03-3.874 0-3.154 2.292-6.051 6.607-6.051 3.469 0 6.165 2.472 6.165 5.775 0 3.446-2.173 6.22-5.189 6.22-1.013 0-1.966-.526-2.292-1.148l-.623 2.377c-.226.869-.835 1.957-1.243 2.622.936.289 1.93.445 2.961.445 5.523 0 10-4.477 10-10S17.523 2 12 2"})))},{name:"pocket",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.927 4.194A1.82 1.82 0 0 0 20.222 3H3.839a1.823 1.823 0 0 0-1.813 1.814v6.035l.069 1.2c.29 2.73 1.707 5.115 3.899 6.778l.119.089.025.018a9.9 9.9 0 0 0 3.91 1.727 10.06 10.06 0 0 0 4.049-.014.3.3 0 0 0 .064-.023 9.9 9.9 0 0 0 3.753-1.691l.025-.018q.06-.043.119-.089c2.192-1.664 3.609-4.049 3.898-6.778l.069-1.2V4.814a1.8 1.8 0 0 0-.098-.62m-4.235 6.287-4.704 4.512a1.37 1.37 0 0 1-1.898 0l-4.705-4.512a1.371 1.371 0 1 1 1.898-1.979l3.756 3.601 3.755-3.601a1.372 1.372 0 0 1 1.898 1.979"})))},{name:"polldaddy",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.487 2 2 6.487 2 12c0 5.514 4.487 10 10 10 5.514 0 10-4.486 10-10 0-5.513-4.486-10-10-10m.991 1.68c2.361.084 4.657 1.251 6.197 3.136.283.334.541.693.774 1.067a7.78 7.78 0 0 0-6.094-2.94 7.76 7.76 0 0 0-5.896 2.703q-.008.006-.016.014l-.152.159-.031.032a6.12 6.12 0 0 0-1.633 4.165 6.15 6.15 0 0 0 6.143 6.143c.57 0 1.123-.081 1.649-.227-1.849.839-4.131.747-5.926-.324-1.841-1.089-3.171-3.111-3.433-5.313A7.39 7.39 0 0 1 6.69 6.137C8.294 4.5 10.634 3.563 12.991 3.68m3.373 8.519c-.049-2.024-1.587-3.889-3.544-4.174-1.927-.343-3.917.857-4.451 2.661a3.67 3.67 0 0 0 .2 2.653c.39.8 1.067 1.451 1.894 1.759 1.664.654 3.63-.27 4.173-1.863.593-1.58-.396-3.423-1.94-3.776-1.52-.407-3.161.757-3.204 2.243a2.36 2.36 0 0 0 .753 1.879c.501.476 1.23.667 1.871.529a2.07 2.07 0 0 0 1.469-1.134 1.91 1.91 0 0 0-.087-1.767c-.297-.513-.859-.863-1.429-.881a1.7 1.7 0 0 0-1.437.679 1.53 1.53 0 0 0-.18 1.489q.006.016.016.03c.193.634.774 1.1 1.467 1.117a1.6 1.6 0 0 1-.97-.183c-.466-.244-.809-.747-.893-1.29a1.8 1.8 0 0 1 .499-1.539 2.02 2.02 0 0 1 1.58-.606c.593.04 1.159.35 1.517.859.364.496.51 1.156.383 1.773-.116.62-.529 1.174-1.093 1.514a2.52 2.52 0 0 1-1.914.286c-.65-.161-1.226-.606-1.584-1.206a2.83 2.83 0 0 1-.341-2.031c.143-.7.573-1.321 1.176-1.753 1.193-.883 3.056-.751 4.106.411 1.106 1.1 1.327 3.027.406 4.371-.877 1.376-2.74 2.086-4.374 1.594-1.639-.449-2.913-2.079-3.031-3.853-.07-.884.13-1.797.583-2.577.445-.777 1.155-1.432 1.972-1.862 1.64-.88 3.816-.743 5.349.424 1.251.924 2.083 2.42 2.236 4.009l.001.03c0 2.9-2.359 5.26-5.26 5.26a5.2 5.2 0 0 1-1.947-.376 5 5 0 0 0 2.613-.079 4.96 4.96 0 0 0 2.514-1.751c.618-.828.95-1.861.901-2.869M12 21.113c-5.024 0-9.111-4.087-9.111-9.113 0-4.789 3.713-8.723 8.411-9.081a7 7 0 0 0-.397.06c-2.644.453-5.017 2.106-6.32 4.409-1.309 2.301-1.391 5.19-.3 7.527 1.056 2.34 3.253 4.156 5.776 4.553 2.497.44 5.133-.483 6.787-2.301 1.719-1.797 2.269-4.529 1.486-6.796-.583-1.81-1.976-3.331-3.7-4.046 3.417.594 6.174 3.221 6.174 6.781 0 1.004-.241 2.02-.657 2.966-1.498 2.984-4.586 5.041-8.149 5.041"})))},{name:"print",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M9 16h6v2H9zm13 1h-3v3a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2V9a2 2 0 0 1 2-2h1V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v2h1a2 2 0 0 1 2 2zM7 7h10V5H7zm10 7H7v6h10zm3-3.5a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 20 10.5"})))},{name:"quora",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M47.736 16.521c-.41-.81-.898-1.631-1.846-1.631a1 1 0 0 0-.527.107l-.322-.644a2.93 2.93 0 0 1 1.836-.595c1.26 0 1.914.605 2.431 1.397a6.8 6.8 0 0 0 .449-2.675c0-2.773-.869-4.199-2.929-4.199-1.992 0-2.851 1.465-2.851 4.199s.859 4.17 2.851 4.17a4 4 0 0 0 .869-.107zm.498.966a6 6 0 0 1-1.367.185 5.27 5.27 0 0 1-5.263-5.204c0-3.114 2.558-5.233 5.263-5.233s5.282 2.109 5.282 5.233a5.08 5.08 0 0 1-1.992 4.072c.381.566.781.956 1.319.956.595 0 .839-.459.878-.82h.781c.049.488-.195 2.48-2.373 2.48-1.319 0-2.012-.761-2.529-1.66zm5.624-2.646v-3.563c0-.371-.146-.586-.615-.586h-.498v-.956h3.251v5.048c0 .849.459 1.231 1.161 1.231a1.56 1.56 0 0 0 1.465-.839V11.28c0-.371-.146-.586-.615-.586h-.527v-.957h3.28v5.302c0 .527.195.732.8.732h.107v.976l-2.929.468V16.21h-.057a3.12 3.12 0 0 1-2.509 1.152c-1.28 0-2.304-.644-2.304-2.558zm12.059 1.611c1.152 0 1.592-1.005 1.611-3.027.02-1.982-.459-2.929-1.611-2.929-1.005 0-1.641.956-1.641 2.929 0 2.021.625 3.027 1.641 3.027m0 .956a3.906 3.906 0 0 1-3.974-3.974c0-2.334 1.836-3.886 3.974-3.886 2.226 0 4.004 1.582 4.004 3.886a3.867 3.867 0 0 1-4.004 3.974m4.072-.146v-.956h.312c.781 0 .859-.224.859-.908v-4.121c0-.371-.215-.586-.732-.586h-.42v-.955h2.968l.146 1.553h.108c.371-1.113 1.221-1.699 2.051-1.699.693 0 1.221.39 1.221 1.181 0 .547-.264 1.093-1.005 1.093-.664 0-.8-.449-1.358-.449-.488 0-.869.468-.869 1.152v2.783c0 .673.166.908.937.908h.439v.956h-4.658zm9.901-1.093c.956 0 1.338-.898 1.338-1.797v-1.211c-.732.722-2.304.742-2.304 2.021 0 .625.371.986.966.986m1.387 0c-.39.752-1.191 1.26-2.314 1.26-1.309 0-2.148-.732-2.148-1.914 0-2.451 3.417-1.797 4.423-3.427v-.185c0-1.25-.488-1.445-1.035-1.445-1.524 0-.83 1.631-2.226 1.631-.673 0-.937-.371-.937-.859 0-.927 1.093-1.67 3.173-1.67 1.963 0 3.163.537 3.163 2.49v3.114q-.02.742.595.742a1 1 0 0 0 .449-.127l.254.615c-.205.312-.752.869-1.836.869-.908 0-1.465-.42-1.543-1.113h-.01zm-68.554 2.558c-.83-1.641-1.807-3.3-3.711-3.3a2.9 2.9 0 0 0-1.093.215l-.644-1.299a5.66 5.66 0 0 1 3.662-1.211c2.548 0 3.857 1.231 4.892 2.792q.917-2.012.908-5.38c0-5.585-1.748-8.417-5.829-8.417-4.033 0-5.76 2.87-5.76 8.417s1.738 8.397 5.76 8.397a5.9 5.9 0 0 0 1.748-.224zm.996 1.953a9.8 9.8 0 0 1-2.744.371C5.614 21.041.371 16.764.371 10.545.371 4.277 5.614 0 10.965 0c5.448 0 10.642 4.248 10.642 10.545a10.25 10.25 0 0 1-4.013 8.201c.732 1.152 1.563 1.914 2.665 1.914 1.201 0 1.689-.927 1.768-1.66h1.572c.088.966-.4 4.999-4.775 4.999-2.646 0-4.052-1.543-5.106-3.339z"})))},{name:"reddit",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M22 11.816a2.28 2.28 0 0 0-2.277-2.277c-.593 0-1.122.24-1.526.614-1.481-.965-3.455-1.594-5.647-1.69l1.171-3.702 3.18.748a1.88 1.88 0 0 0 1.876 1.862 1.88 1.88 0 0 0 1.877-1.878 1.88 1.88 0 0 0-1.877-1.877c-.769 0-1.431.466-1.72 1.13l-3.508-.826a.386.386 0 0 0-.46.261l-1.35 4.268c-2.316.038-4.411.67-5.97 1.671a2.24 2.24 0 0 0-1.492-.581A2.28 2.28 0 0 0 2 11.816c0 .814.433 1.523 1.078 1.925a4 4 0 0 0-.061.672c0 3.292 4.011 5.97 8.941 5.97s8.941-2.678 8.941-5.97q-.002-.32-.053-.632A2.26 2.26 0 0 0 22 11.816m-3.224-7.422a1.1 1.1 0 1 1-.001 2.199 1.1 1.1 0 0 1 .001-2.199M2.777 11.816c0-.827.672-1.5 1.499-1.5.313 0 .598.103.838.269-.851.676-1.477 1.479-1.812 2.36a1.48 1.48 0 0 1-.525-1.129m9.182 7.79c-4.501 0-8.164-2.329-8.164-5.193S7.457 9.22 11.959 9.22s8.164 2.329 8.164 5.193-3.663 5.193-8.164 5.193m8.677-6.605c-.326-.89-.948-1.701-1.797-2.384.248-.186.55-.301.883-.301.827 0 1.5.673 1.5 1.5.001.483-.23.911-.586 1.185m-11.64 1.703c-.76 0-1.397-.616-1.397-1.376s.637-1.397 1.397-1.397 1.376.637 1.376 1.397-.616 1.376-1.376 1.376m7.405-1.376c0 .76-.616 1.376-1.376 1.376s-1.399-.616-1.399-1.376.639-1.397 1.399-1.397 1.376.637 1.376 1.397m-1.172 3.38a.39.39 0 0 1 0 .55c-.674.674-1.727 1.002-3.219 1.002l-.011-.002-.011.002c-1.492 0-2.544-.328-3.218-1.002a.389.389 0 1 1 .55-.55c.521.521 1.394.775 2.669.775l.011.002.011-.002c1.275 0 2.148-.253 2.669-.775a.387.387 0 0 1 .549 0"})))},{name:"share",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M18 16c-.788 0-1.499.31-2.034.807L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.048 4.118A3 3 0 0 0 15 19a3 3 0 1 0 3-3"})))},{name:"skype",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m10.113 2.699.1-.02q.05.025.098.051zM2.72 10.223l-.017.103q.025.048.051.095zm18.555 3.548q.009-.053.018-.106-.025-.047-.052-.095zm-7.712 7.428q.049.027.096.053l.105-.017zM22 16.386a5.55 5.55 0 0 1-1.637 3.953 5.55 5.55 0 0 1-3.953 1.637 5.6 5.6 0 0 1-2.75-.725l.105-.017-.202-.035q.049.027.096.053a9.5 9.5 0 0 1-1.654.147 9.4 9.4 0 0 1-3.676-.743 9.4 9.4 0 0 1-3.002-2.023 9.4 9.4 0 0 1-2.023-3.002 9.4 9.4 0 0 1-.743-3.676c0-.546.049-1.093.142-1.628q.025.048.051.095l-.034-.199-.017.103A5.6 5.6 0 0 1 2 7.615c0-1.493.582-2.898 1.637-3.953A5.56 5.56 0 0 1 7.59 2.024c.915 0 1.818.228 2.622.655l-.1.02.199.031q-.049-.026-.098-.051l.004-.001a9.5 9.5 0 0 1 1.788-.169 9.41 9.41 0 0 1 6.678 2.766 9.4 9.4 0 0 1 2.024 3.002 9.4 9.4 0 0 1 .743 3.676c0 .575-.054 1.15-.157 1.712q-.025-.047-.052-.095l.034.201q.009-.053.018-.106c.461.829.707 1.767.707 2.721m-5.183-2.248c0-1.331-.613-2.743-3.033-3.282l-2.209-.49c-.84-.192-1.807-.444-1.807-1.237s.679-1.348 1.903-1.348c2.468 0 2.243 1.696 3.468 1.696.645 0 1.209-.379 1.209-1.031 0-1.521-2.435-2.663-4.5-2.663-2.242 0-4.63.952-4.63 3.488 0 1.221.436 2.521 2.839 3.123l2.984.745c.903.223 1.129.731 1.129 1.189 0 .762-.758 1.507-2.129 1.507-2.679 0-2.307-2.062-3.743-2.062-.645 0-1.113.444-1.113 1.078 0 1.236 1.501 2.886 4.856 2.886 3.195 0 4.776-1.538 4.776-3.599"})))},{name:"sms",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M17.696 4C20.069 4 22 5.973 22 8.398v4.357c0 2.04-1.368 3.783-3.261 4.266v4.427l-5.234-4.295h-7.2C3.93 17.153 2 15.18 2 12.755V8.398C2 5.973 3.931 4 6.304 4zM7.028 8.515c-.98 0-1.66.562-1.66 1.349-.009.497.322.91.985 1.178l.39.142c.242.097.305.171.305.297 0 .162-.131.251-.442.251s-.76-.135-1.004-.284l-.112.046-.215.868c.359.258.832.364 1.33.364 1.104 0 1.764-.523 1.764-1.333-.008-.574-.305-.956-.954-1.216l-.393-.146c-.266-.108-.341-.181-.341-.287 0-.152.131-.243.387-.243.274 0 .587.093.808.214l.109-.047.214-.837c-.315-.224-.741-.316-1.171-.316m10.302 0c-.98 0-1.66.562-1.66 1.349-.008.497.322.91.985 1.178l.39.142c.243.097.305.171.305.297 0 .162-.13.251-.442.251-.311 0-.76-.135-1.004-.284l-.112.046-.215.868c.359.258.832.364 1.33.364 1.104 0 1.764-.523 1.764-1.333-.008-.574-.305-.956-.954-1.216l-.393-.146c-.266-.108-.341-.181-.341-.287 0-.152.131-.243.387-.243.274 0 .587.093.808.214l.109-.047.214-.837c-.316-.224-.741-.316-1.171-.316m-3.733 0c-.297 0-.55.066-.78.202l-.144.098a2 2 0 0 0-.264.247l-.078.095-.027-.077c-.15-.34-.55-.565-1.033-.565l-.169.007a1.36 1.36 0 0 0-.896.42l-.08.09-.038-.363-.075-.067H8.994l-.075.079.024.634c.005.2.008.397.008.604v2.652l.075.075h1.178l.075-.075v-2.269q-.002-.168.042-.274c.083-.23.262-.392.496-.392.314 0 .483.267.483.753v2.182l.075.075h1.179l.075-.075v-2.277c0-.097.016-.213.043-.285.077-.224.26-.373.486-.373.33 0 .5.272.5.817v2.118l.074.075h1.179l.075-.075v-2.293c0-1.131-.537-1.763-1.39-1.763Z"})))},{name:"snapchat",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M11.989 1.728c3.221.001 5.904 2.683 5.908 5.912q.002 1.133.067 2.094a.737.737 0 0 0 .902.669l1.009-.237a.6.6 0 0 1 .129-.015c.256 0 .492.175.55.434a.74.74 0 0 1-.479.861l-1.532.618a.823.823 0 0 0-.485.98c1.229 4.543 4.661 4.071 4.661 4.662 0 .743-2.587.848-2.821 1.082s-.01 1.368-.532 1.588a1.1 1.1 0 0 1-.409.056c-.393 0-.95-.077-1.536-.077-.509 0-1.04.058-1.507.273-1.239.572-2.433 1.641-3.914 1.641S9.325 21.2 8.086 20.628c-.467-.216-.998-.273-1.507-.273-.586 0-1.143.077-1.536.077-.17 0-.31-.014-.409-.056-.522-.22-.299-1.354-.532-1.588s-2.821-.337-2.821-1.08c0-.592 3.432-.119 4.661-4.662a.824.824 0 0 0-.486-.98l-1.532-.618a.74.74 0 0 1-.479-.861.56.56 0 0 1 .679-.419l1.009.237q.086.02.169.02a.737.737 0 0 0 .733-.689q.065-.961.067-2.094c.004-3.229 2.666-5.91 5.887-5.912m0-1.281c-.961 0-1.898.194-2.784.574A7.2 7.2 0 0 0 6.93 2.572a7.2 7.2 0 0 0-1.539 2.282A7.1 7.1 0 0 0 4.82 7.64a33 33 0 0 1-.029 1.369l-.375-.088a2 2 0 0 0-.421-.049 1.86 1.86 0 0 0-1.135.389 1.84 1.84 0 0 0-.666 1.049 2.024 2.024 0 0 0 1.271 2.335l1.124.454c-.744 2.285-2.117 2.723-3.041 3.018a5 5 0 0 0-.659.246C.087 16.76 0 17.436 0 17.708c0 .521.247.996.694 1.339.223.17.499.311.844.43.47.162 1.016.265 1.459.347.021.164.053.341.106.518.22.738.684 1.069 1.034 1.217.332.14.676.156.905.156.224 0 .462-.018.713-.036.269-.02.548-.041.823-.041.426 0 .743.051.97.155.311.144.64.337.989.542.972.571 2.073 1.217 3.462 1.217s2.49-.647 3.462-1.217c.349-.205.679-.399.989-.542.226-.105.544-.155.97-.155.275 0 .554.021.823.041.251.019.488.036.713.036.229 0 .573-.016.905-.156.35-.147.814-.478 1.034-1.217.053-.178.084-.354.106-.518.443-.082.989-.185 1.459-.347.345-.119.621-.259.844-.43.448-.342.694-.818.694-1.339 0-.272-.087-.948-.891-1.347a5 5 0 0 0-.659-.246c-.924-.295-2.297-.733-3.041-3.018l1.124-.454a2.025 2.025 0 0 0 1.271-2.335 1.83 1.83 0 0 0-.666-1.049 1.86 1.86 0 0 0-1.556-.34l-.375.088a33 33 0 0 1-.029-1.369 7.1 7.1 0 0 0-.575-2.789c-.365-.853-.886-1.62-1.547-2.282s-1.428-1.182-2.28-1.547a7.1 7.1 0 0 0-2.786-.574"})))},{name:"soundcloud",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M23.587 13.923a3.303 3.303 0 0 1-3.344 3.117h-8.037a.674.674 0 0 1-.667-.67V7.717a.74.74 0 0 1 .444-.705s.739-.512 2.296-.512a5.27 5.27 0 0 1 2.702.742 5.35 5.35 0 0 1 2.516 3.485 3.1 3.1 0 0 1 .852-.116 3.217 3.217 0 0 1 3.237 3.312m-13.05-5.659c.242 2.935.419 5.612 0 8.538a.261.261 0 0 1-.519 0c-.39-2.901-.221-5.628 0-8.538a.26.26 0 0 1 .398-.25.26.26 0 0 1 .12.25zm-1.627 8.541a.273.273 0 0 1-.541 0 32.7 32.7 0 0 1 0-7.533.274.274 0 0 1 .544 0 29.4 29.4 0 0 1-.003 7.533m-1.63-7.788c.264 2.69.384 5.099-.003 7.782a.262.262 0 0 1-.522 0c-.374-2.649-.249-5.127 0-7.782a.264.264 0 0 1 .525 0m-1.631 7.792a.268.268 0 0 1-.532 0 27.6 27.6 0 0 1 0-7.034.27.27 0 1 1 .541 0 25.8 25.8 0 0 1-.01 7.034zm-1.63-5.276c.412 1.824.227 3.435-.015 5.294a.255.255 0 0 1-.504 0c-.22-1.834-.402-3.482-.015-5.295a.268.268 0 0 1 .535 0m-1.626-.277c.378 1.869.254 3.451-.01 5.325-.031.277-.506.28-.531 0-.239-1.846-.352-3.476-.01-5.325a.277.277 0 0 1 .551 0m-1.643.907c.396 1.239.261 2.246-.016 3.517a.258.258 0 0 1-.514 0c-.239-1.246-.336-2.274-.021-3.517a.276.276 0 0 1 .55 0z"})))},{name:"spotify",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424a.62.62 0 0 1-.857.207c-2.348-1.435-5.304-1.76-8.785-.964a.622.622 0 1 1-.277-1.215c3.809-.871 7.077-.496 9.713 1.115a.623.623 0 0 1 .206.857M17.81 13.7a.78.78 0 0 1-1.072.257c-2.687-1.652-6.785-2.131-9.965-1.166A.779.779 0 1 1 6.32 11.3c3.632-1.102 8.147-.568 11.234 1.328a.78.78 0 0 1 .256 1.072m.105-2.835c-3.223-1.914-8.54-2.09-11.618-1.156a.935.935 0 1 1-.542-1.79c3.532-1.072 9.404-.865 13.115 1.338a.936.936 0 1 1-.955 1.608"})))},{name:"squarespace",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M20.87 9.271a3.86 3.86 0 0 0-5.458 0l-6.141 6.141a.964.964 0 1 0 1.365 1.364l6.14-6.14a1.929 1.929 0 1 1 2.729 2.729l-6.022 6.022a1.93 1.93 0 0 0 2.729 0l4.658-4.658a3.86 3.86 0 0 0 0-5.458m-2.047 2.047a.965.965 0 0 0-1.365 0l-6.14 6.14a1.93 1.93 0 0 1-2.729 0 .964.964 0 1 0-1.364 1.364 3.86 3.86 0 0 0 5.458 0l6.14-6.14a.966.966 0 0 0 0-1.364m-2.047-6.141a3.86 3.86 0 0 0-5.458 0l-6.14 6.14a.964.964 0 1 0 1.364 1.364l6.141-6.14a1.93 1.93 0 0 1 2.729 0 .965.965 0 1 0 1.364-1.364m-2.047 2.047a.964.964 0 0 0-1.364 0l-6.14 6.141a1.929 1.929 0 1 1-2.729-2.729l6.022-6.022a1.93 1.93 0 0 0-2.729 0L3.13 9.271a3.86 3.86 0 0 0 5.458 5.458l6.14-6.141a.963.963 0 0 0 .001-1.364"})))},{name:"stackexchange",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M4 11.606h16v3.272H4zM4 7.377h16v3.272H4zM17.514 3H6.55C5.147 3 4 4.169 4 5.614v.848h16v-.85C20 4.167 18.895 3 17.514 3M4 15.813v.85c0 1.445 1.147 2.614 2.55 2.614h6.799v3.463l3.357-3.463h.744c1.402 0 2.55-1.169 2.55-2.614v-.85z"})))},{name:"stackoverflow",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M18.18 20.103V14.78h1.767v7.09H4v-7.09h1.767v5.323z"}),React.createElement("path",{d:"m7.717 14.275 8.673 1.813.367-1.744-8.673-1.813zm1.147-4.13 8.031 3.74.734-1.606-8.031-3.763zm2.226-3.946 6.815 5.667 1.124-1.354-6.815-5.667zM15.495 2l-1.423 1.055 5.277 7.113 1.423-1.055zM7.533 18.314h8.857v-1.767H7.533z"})))},{name:"stumbleupon",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 4.294a4.47 4.47 0 0 0-4.471 4.471v6.353a1.059 1.059 0 1 1-2.118 0v-2.824H2v2.941a4.471 4.471 0 0 0 8.942 0v-6.47a1.059 1.059 0 1 1 2.118 0v1.294l1.412.647 2-.647V8.765A4.473 4.473 0 0 0 12 4.294m1.059 8.059v2.882a4.471 4.471 0 0 0 8.941 0v-2.824h-3.412v2.824a1.059 1.059 0 1 1-2.118 0v-2.882l-2 .647z"})))},{name:"substack",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19.904 9.182H4.095V7.054h15.81v2.127M4.095 11.109V21L12 16.583 19.905 21v-9.891zM19.905 3H4.095v2.127h15.81z"})))},{name:"telegram",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m3.08 14.757s-.25.625-.936.325l-2.541-1.949-1.63 1.486s-.127.096-.266.036c0 0-.12-.011-.27-.486s-.911-2.972-.911-2.972L6 12.349s-.387-.137-.425-.438c-.037-.3.437-.462.437-.462l10.03-3.934s.824-.362.824.238z"})))},{name:"threads",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 192 192"},React.createElement("g",null,React.createElement("path",{d:"M141.537 88.988a67 67 0 0 0-2.518-1.143c-1.482-27.307-16.403-42.94-41.457-43.1h-.34c-14.986 0-27.449 6.396-35.12 18.036l13.779 9.452c5.73-8.695 14.724-10.548 21.348-10.548h.229c8.249.053 14.474 2.452 18.503 7.129 2.932 3.405 4.893 8.111 5.864 14.05-7.314-1.243-15.224-1.626-23.68-1.14-23.82 1.371-39.134 15.264-38.105 34.568.522 9.792 5.4 18.216 13.735 23.719 7.047 4.652 16.124 6.927 25.557 6.412 12.458-.683 22.231-5.436 29.049-14.127 5.178-6.6 8.453-15.153 9.899-25.93 5.937 3.583 10.337 8.298 12.767 13.966 4.132 9.635 4.373 25.468-8.546 38.376-11.319 11.308-24.925 16.2-45.488 16.351-22.809-.169-40.06-7.484-51.275-21.742C35.236 139.966 29.808 120.682 29.605 96c.203-24.682 5.63-43.966 16.133-57.317C56.954 24.425 74.204 17.11 97.013 16.94c22.975.17 40.526 7.52 52.171 21.847 5.71 7.026 10.015 15.86 12.853 26.162l16.147-4.308c-3.44-12.68-8.853-23.606-16.219-32.668C147.036 9.607 125.202.195 97.07 0h-.113C68.882.194 47.292 9.642 32.788 28.08 19.882 44.485 13.224 67.315 13.001 95.932L13 96v.067c.224 28.617 6.882 51.447 19.788 67.854C47.292 182.358 68.882 191.806 96.957 192h.113c24.96-.173 42.554-6.708 57.048-21.189 18.963-18.945 18.392-42.692 12.142-57.27-4.484-10.454-13.033-18.945-24.723-24.553M98.44 129.507c-10.44.588-21.286-4.098-21.82-14.135-.397-7.442 5.296-15.746 22.461-16.735q2.948-.17 5.79-.169c6.235 0 12.068.606 17.371 1.765-1.978 24.702-13.58 28.713-23.802 29.274"})))},{name:"tiktok-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M5 3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm7.531 3h2.053s-.114 2.635 2.85 2.82v2.04s-1.582.099-2.85-.87l.021 4.207a3.804 3.804 0 1 1-3.802-3.802h.533v2.082a1.73 1.73 0 0 0-1.922.648 1.727 1.727 0 0 0 1.947 2.646 1.73 1.73 0 0 0 1.19-1.642z"})))},{name:"tiktok",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.22 2h3.42s-.19 4.394 4.75 4.702v3.396s-2.636.166-4.75-1.448l.037 7.012a6.338 6.338 0 1 1-6.34-6.339h.89v3.472a2.882 2.882 0 1 0 2.024 2.752z"})))},{name:"tripadvisor",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.01 9.859c.236-1.002.985-2.003.985-2.003l-3.341-.002C16.779 6.643 14.502 6 11.979 6 9.363 6 7 6.659 5.135 7.877L2 7.88s.74.988.98 1.983a4.98 4.98 0 0 0-.977 2.961 5.01 5.01 0 0 0 5.009 5.003 5 5 0 0 0 3.904-1.875l1.065 1.592 1.076-1.606a4.96 4.96 0 0 0 1.838 1.448 4.98 4.98 0 0 0 3.831.151 5.01 5.01 0 0 0 2.963-6.431 5 5 0 0 0-.679-1.247m-13.998 6.96a4 4 0 0 1-3.998-3.995 4 4 0 0 1 3.998-3.997 4 4 0 0 1 3.996 3.997 4 4 0 0 1-3.996 3.995m4.987-4.36A5.007 5.007 0 0 0 7.11 7.821c1.434-.613 3.081-.947 4.867-.947 1.798 0 3.421.324 4.853.966a4.984 4.984 0 0 0-4.831 4.619m6.288 4.134a3.97 3.97 0 0 1-3.058-.122 3.96 3.96 0 0 1-2.075-2.245v-.001a3.97 3.97 0 0 1 .118-3.056 3.97 3.97 0 0 1 2.246-2.077 4.005 4.005 0 0 1 5.135 2.366 4.006 4.006 0 0 1-2.366 5.135"}),React.createElement("path",{d:"M6.949 10.307a2.477 2.477 0 0 0-2.475 2.472 2.48 2.48 0 0 0 2.475 2.474 2.474 2.474 0 0 0 0-4.946m0 4.094a1.626 1.626 0 0 1-1.624-1.623 1.621 1.621 0 1 1 1.624 1.623M16.981 10.307a2.477 2.477 0 0 0-2.474 2.472 2.48 2.48 0 0 0 2.474 2.474 2.476 2.476 0 0 0 2.472-2.474 2.475 2.475 0 0 0-2.472-2.472m0 4.094a1.625 1.625 0 0 1-1.622-1.623 1.622 1.622 0 1 1 1.622 1.623"}),React.createElement("path",{d:"M7.778 12.778a.832.832 0 1 1-1.664.002.832.832 0 0 1 1.664-.002M16.981 11.947a.832.832 0 1 0 .002 1.666.832.832 0 0 0-.002-1.666"})))},{name:"tumblr-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M16.749 17.396c-.357.17-1.041.319-1.551.332-1.539.041-1.837-1.081-1.85-1.896V9.847h3.861v-2.91h-3.847V2.039h-2.817c-.046 0-.127.041-.138.144-.165 1.499-.867 4.13-3.783 5.181v2.484h1.945v6.282c0 2.151 1.587 5.206 5.775 5.135 1.413-.024 2.982-.616 3.329-1.126z"})))},{name:"tumblr",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m-5.569 14.265c-2.446.042-3.372-1.742-3.372-2.998v-3.668H8.923v-1.45c1.703-.614 2.113-2.15 2.209-3.025.007-.06.054-.084.081-.084h1.645V8.9h2.246v1.7H12.85v3.495c.008.476.182 1.131 1.081 1.107.298-.008.697-.094.906-.194l.54 1.601c-.205.296-1.121.641-1.946.656"})))},{name:"twitch",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M16.499 8.089h-1.636v4.91h1.636zm-4.499 0h-1.637v4.91H12zM4.228 3.178 3 6.451v13.092h4.499V22h2.456l2.454-2.456h3.681L21 14.636V3.178zm15.136 10.638L16.5 16.681H12l-2.453 2.453V16.68H5.863V4.814h13.501z"})))},{name:"twitter-alt",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M22.23 5.924a8.2 8.2 0 0 1-2.357.646 4.12 4.12 0 0 0 1.804-2.27 8.2 8.2 0 0 1-2.606.996 4.103 4.103 0 0 0-6.991 3.742 11.65 11.65 0 0 1-8.457-4.287 4.1 4.1 0 0 0-.556 2.063 4.1 4.1 0 0 0 1.825 3.415 4.1 4.1 0 0 1-1.859-.513v.052a4.104 4.104 0 0 0 3.292 4.023 4.1 4.1 0 0 1-1.853.07 4.11 4.11 0 0 0 3.833 2.85 8.24 8.24 0 0 1-5.096 1.756 8 8 0 0 1-.979-.057 11.6 11.6 0 0 0 6.29 1.843c7.547 0 11.675-6.252 11.675-11.675q0-.267-.012-.531a8.3 8.3 0 0 0 2.047-2.123"})))},{name:"twitter",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m-2.534 6.71q.007.148.007.298c0 3.045-2.318 6.556-6.556 6.556a6.5 6.5 0 0 1-3.532-1.035q.27.032.55.032a4.63 4.63 0 0 0 2.862-.986 2.31 2.31 0 0 1-2.152-1.6 2.3 2.3 0 0 0 1.04-.04 2.306 2.306 0 0 1-1.848-2.259v-.029c.311.173.666.276 1.044.288a2.303 2.303 0 0 1-.713-3.076 6.54 6.54 0 0 0 4.749 2.407 2.305 2.305 0 0 1 3.926-2.101 4.6 4.6 0 0 0 1.463-.559 2.3 2.3 0 0 1-1.013 1.275c.466-.056.91-.18 1.323-.363-.31.461-.7.867-1.15 1.192"})))},{name:"untappd",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m11 13.299-5.824 8.133c-.298.416-.8.635-1.308.572-.578-.072-1.374-.289-2.195-.879S.392 19.849.139 19.323a1.4 1.4 0 0 1 .122-1.425l5.824-8.133a3.1 3.1 0 0 1 1.062-.927l1.146-.604c.23-.121.436-.283.608-.478.556-.631 2.049-2.284 4.696-4.957l.046-.212a.13.13 0 0 1 .096-.1l.146-.037a.135.135 0 0 0 .101-.141l-.015-.18a.13.13 0 0 1 .125-.142c.176-.005.518.046 1.001.393s.64.656.692.824a.13.13 0 0 1-.095.164l-.175.044a.13.13 0 0 0-.101.141l.012.15a.13.13 0 0 1-.063.123l-.186.112c-1.679 3.369-2.764 5.316-3.183 6.046a2.2 2.2 0 0 0-.257.73l-.205 1.281A3.1 3.1 0 0 1 11 13.3zm12.739 4.598-5.824-8.133a3.1 3.1 0 0 0-1.062-.927l-1.146-.605a2.1 2.1 0 0 1-.608-.478 51 51 0 0 0-.587-.654.09.09 0 0 0-.142.018 97 97 0 0 1-1.745 3.223 1.4 1.4 0 0 0-.171.485 3.5 3.5 0 0 0 0 1.103l.01.064c.075.471.259.918.536 1.305l5.824 8.133c.296.413.79.635 1.294.574a4.76 4.76 0 0 0 2.209-.881 4.76 4.76 0 0 0 1.533-1.802 1.4 1.4 0 0 0-.122-1.425zM8.306 3.366l.175.044a.134.134 0 0 1 .101.141l-.012.15a.13.13 0 0 0 .063.123l.186.112q.465.933.869 1.721c.026.051.091.06.129.019q.655-.703 1.585-1.668a.137.137 0 0 0 .003-.19c-.315-.322-.645-.659-1.002-1.02l-.046-.212a.13.13 0 0 0-.096-.099l-.146-.037a.135.135 0 0 1-.101-.141l.015-.18a.13.13 0 0 0-.123-.142c-.175-.005-.518.045-1.002.393-.483.347-.64.656-.692.824a.13.13 0 0 0 .095.164z"})))},{name:"vimeo",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M22.396 7.164q-.139 3.039-4.245 8.32Q13.907 21 10.97 21q-1.82 0-3.079-3.359l-1.68-6.159q-.934-3.36-2.005-3.36-.234.001-1.634.98l-.978-1.261q1.541-1.353 3.037-2.708 2.056-1.774 3.084-1.869 2.429-.234 2.99 3.321.607 3.836.841 4.769.7 3.181 1.542 3.181.653 0 1.963-2.065 1.307-2.063 1.401-3.142.187-1.781-1.401-1.782-.747.001-1.541.341 1.534-5.024 5.862-4.884 3.21.095 3.024 4.161"})))},{name:"vk",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{fillRule:"evenodd",d:"M1.687 1.687C0 3.374 0 6.09 0 11.52v.96c0 5.431 0 8.146 1.687 9.833S6.09 24 11.52 24h.96c5.431 0 8.146 0 9.833-1.687S24 17.91 24 12.48v-.96c0-5.431 0-8.146-1.687-9.833S17.91 0 12.48 0h-.96C6.09 0 3.374 0 1.687 1.687M4.05 7.3c.13 6.24 3.25 9.99 8.72 9.99h.31v-3.57c2.01.2 3.53 1.67 4.14 3.57h2.84c-.78-2.84-2.83-4.41-4.11-5.01 1.28-.74 3.08-2.54 3.51-4.98h-2.58c-.56 1.98-2.22 3.78-3.8 3.95V7.3H10.5v6.92c-1.6-.4-3.62-2.34-3.71-6.92z"})))},{name:"whatsapp",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"m2.048 22 1.406-5.136a9.9 9.9 0 0 1-1.323-4.955C2.133 6.446 6.579 2 12.042 2a9.85 9.85 0 0 1 7.011 2.906 9.85 9.85 0 0 1 2.9 7.011c-.002 5.464-4.448 9.91-9.91 9.91h-.004a9.9 9.9 0 0 1-4.736-1.206zm5.497-3.172.301.179a8.2 8.2 0 0 0 4.193 1.148h.003c4.54 0 8.235-3.695 8.237-8.237a8.2 8.2 0 0 0-2.41-5.828 8.18 8.18 0 0 0-5.824-2.416c-4.544 0-8.239 3.695-8.241 8.237a8.2 8.2 0 0 0 1.259 4.384l.196.312-.832 3.04zm9.49-4.554c-.062-.103-.227-.165-.475-.289s-1.465-.723-1.692-.806-.392-.124-.557.124-.64.806-.784.971-.289.186-.536.062-1.046-.385-1.991-1.229c-.736-.657-1.233-1.468-1.378-1.715s-.015-.382.109-.505c.111-.111.248-.289.371-.434.124-.145.165-.248.248-.413s.041-.31-.021-.434-.557-1.343-.763-1.839c-.202-.483-.407-.417-.559-.425-.144-.007-.31-.009-.475-.009a.9.9 0 0 0-.66.31c-.226.248-.866.847-.866 2.066s.887 2.396 1.011 2.562 1.746 2.666 4.23 3.739c.591.255 1.052.408 1.412.522.593.189 1.133.162 1.56.098.476-.071 1.465-.599 1.671-1.177.206-.58.206-1.075.145-1.179"})))},{name:"woocommerce",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M19 2H5C3.3 2 2 3.3 2 5v11c0 1.7 1.3 3 3 3h4l6 3-1-3h5c1.7 0 3-1.3 3-3V5c0-1.7-1.3-3-3-3m-1.6 4.5c-.4.8-.8 2.1-1 3.9-.3 1.8-.4 3.1-.3 4.1 0 .3 0 .5-.1.7s-.3.4-.6.4-.6-.1-.9-.4c-1-1-1.8-2.6-2.4-4.6-.7 1.4-1.2 2.4-1.6 3.1-.6 1.2-1.2 1.8-1.6 1.9-.3 0-.5-.2-.8-.7-.5-1.4-1.1-4.2-1.7-8.2 0-.3 0-.5.2-.7.1-.2.4-.3.7-.4.5 0 .9.2.9.8.3 2.3.7 4.2 1.1 5.7l2.4-4.5c.2-.4.4-.6.8-.6q.75 0 .9.9c.3 1.4.6 2.6 1 3.7.3-2.7.8-4.7 1.4-5.9.2-.3.4-.5.7-.5.2 0 .5.1.7.2q.3.3.3.6c0 .3 0 .4-.1.5"})))},{name:"wordpress",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M12.158 12.786 9.46 20.625a9 9 0 0 0 5.526-.144 1 1 0 0 1-.065-.124zM3.009 12a8.99 8.99 0 0 0 5.067 8.092L3.788 8.341A8.95 8.95 0 0 0 3.009 12m15.06-.454c0-1.112-.399-1.881-.741-2.48-.456-.741-.883-1.368-.883-2.109 0-.826.627-1.596 1.51-1.596q.06.002.116.007A8.96 8.96 0 0 0 12 3.009a8.98 8.98 0 0 0-7.512 4.052c.211.007.41.011.579.011.94 0 2.396-.114 2.396-.114.484-.028.541.684.057.741 0 0-.487.057-1.029.085l3.274 9.739 1.968-5.901-1.401-3.838c-.484-.028-.943-.085-.943-.085-.485-.029-.428-.769.057-.741 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.485-.028.542.684.057.741 0 0-.488.057-1.029.085l3.249 9.665.897-2.996q.684-1.753.684-2.907m1.82-3.86q.06.428.06.924c0 .912-.171 1.938-.684 3.22l-2.746 7.94a8.98 8.98 0 0 0 4.47-7.771 8.9 8.9 0 0 0-1.1-4.313M12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})))},{name:"x",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387z"})))},{name:"xanga",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M9 9h6v6H9zM3 9h6V3H3zm12 0h6V3h-6zm0 12h6v-6h-6zM3 21h6v-6H3z"})))},{name:"youtube",svg:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("g",null,React.createElement("path",{d:"M21.8 8.001s-.195-1.378-.795-1.985c-.76-.797-1.613-.801-2.004-.847-2.799-.202-6.997-.202-6.997-.202h-.009s-4.198 0-6.997.202c-.39.047-1.242.051-2.003.847-.6.607-.795 1.985-.795 1.985S2 9.62 2 11.238v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.761.797 1.76.771 2.205.855 1.6.153 6.8.201 6.8.201s4.203-.006 7.001-.209c.391-.047 1.243-.051 2.004-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517c0-1.618-.2-3.237-.2-3.237M9.935 14.594l-.001-5.62 5.404 2.82z"})))}]},8992:(e,t,a)=>{"use strict";a(6072);var n=a(5739),c=a.n(n),r=a(1609);a(1135);r.PureComponent,c().string.isRequired,c().number,c().func,c().string},1366:(e,t,a)=>{"use strict";a.d(t,{Ck:()=>s,wf:()=>r});var n=a(8767);let c=null;const r=async()=>{let e=0;return c=new Promise((t=>{const a=()=>{const c=n.parse(document.cookie).tk_ai||null;"string"!=typeof c||""===c?99<=e?t(null):(e+=1,setTimeout(a,50)):t(c)};a()})),c},s=async()=>await c},8465:(e,t,a)=>{"use strict";a.d(t,{V:()=>l,z:()=>i});var n=a(1455),c=a.n(n),r=a(3832);const s=(e=!1)=>async({experimentName:t,anonId:a})=>{if(!a)throw new Error("Tracking is disabled, can't fetch experimentAssignment");const n={experiment_name:t,anon_id:a??void 0,as_connected_user:e},s=(0,r.addQueryArgs)("jetpack/v4/explat/assignments",n);return await c()({path:s})},i=s(!1),l=s(!0)},8536:(e,t,a)=>{"use strict";a.d(t,{v:()=>c});var n=a(8343);const c=e=>{const t=e=>{n.D&&console.error("[ExPlat] Unable to send error to server:",e)};try{const{message:a,...c}=e,r={message:a,properties:{...c,context:"explat",explat_client:"jetpack"}};if(n.D)console.error("[ExPlat] ",e.message,e);else{const e=new window.FormData;e.append("error",JSON.stringify(r)),window.fetch("https://public-api.wordpress.com/rest/v1.1/js-error",{method:"POST",body:e}).catch(t)}}catch(e){t(e)}}},4082:(e,t,a)=>{"use strict";a.d(t,{Pg:()=>o,nQ:()=>m,rk:()=>p});var n=a(2226),c=a(1792),r=a(1366),s=a(8465),i=a(8536),l=a(8343);const o=()=>{(0,r.wf)().catch((e=>(0,i.v)({message:e.message})))};o();const u=(0,n.k)({fetchExperimentAssignment:s.z,getAnonId:r.Ck,logError:i.v,isDevelopmentMode:l.D}),{loadExperimentAssignment:m,dangerouslyGetExperimentAssignment:d}=u,{useExperiment:p,Experiment:h,ProvideExperimentData:g}=(0,c.A)(u),v=(0,n.k)({fetchExperimentAssignment:s.V,getAnonId:r.Ck,logError:i.v,isDevelopmentMode:l.D}),{loadExperimentAssignment:f,dangerouslyGetExperimentAssignment:w}=v,{useExperiment:E,Experiment:k,ProvideExperimentData:y}=(0,c.A)(v)},8343:(e,t,a)=>{"use strict";a.d(t,{D:()=>n});const n=!1},8848:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(2947),c=a(5918),r=a(8509),s=a(1040),i=a(1609),l=a.n(i),o=a(1504),u=a(357),m=a(8242),d=a(4526),p=a(1870),h=a(1617);function g(){const{recordEvent:e}=(0,d.A)(),{data:t=[],isLoading:a}=(0,u.A)({name:o.Md,queryFn:async e=>(await e.getUserLicenses())?.items}),{userConnectionData:g}=(0,p.A)(),[v,f]=(0,i.useState)(!1),w=g?.currentUser?.wpcomUser?.display_name||g?.currentUser?.wpcomUser?.login||g?.currentUser?.username,E=(0,i.useCallback)((()=>{e("jetpack_myjetpack_license_activation_back_link_click")}),[e]),k=(0,i.useCallback)((()=>{f(!0)}),[]),y=(0,i.useMemo)((()=>t.filter((({attached_at:e,revoked_at:t})=>null===e&&null===t))),[t]),{siteSuffix:A="",adminUrl:b=""}=(0,m.A$)();return l().createElement(n.A,{showHeader:!1,showBackground:!1},l().createElement(c.A,{horizontalSpacing:3,horizontalGap:3},l().createElement(r.A,null,l().createElement(h.A,{onClick:E,reload:v})),l().createElement(r.A,null,l().createElement(s.b,{currentRecommendationsStep:null,availableLicenses:y,fetchingAvailableLicenses:a,onActivationSuccess:k,siteAdminUrl:b,siteRawUrl:A,displayName:w}))))}},2450:(e,t,a)=>{"use strict";a.d(t,{A:()=>u,O:()=>l});var n=a(7425),c=a(3022),r=a(5739),s=a.n(r),i=a(9958);const l=e=>{const{children:t,className:a,onMouseEnter:n,onMouseLeave:r}=e,s=(0,c.A)(i.A.container,a);return React.createElement("div",{onMouseEnter:n,onMouseLeave:r,onFocus:n,onBlur:r,className:s},t)},o=e=>{const{title:t,headerRightContent:a,className:c,children:r,onMouseEnter:s,onMouseLeave:o}=e;return React.createElement(l,{className:c,onMouseEnter:s,onMouseLeave:o},React.createElement("div",{className:i.A.title},React.createElement("div",{className:i.A.name},React.createElement(n.Ay,{variant:"title-medium"},t)),a),r)};o.propTypes={children:s().node,title:s().string.isRequired,className:s().string,headerRightContent:s().node,onMouseEnter:s().func,onMouseLeave:s().func};const u=o},2191:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(1113),c=a(991),r=a(3022),s=a(1609),i=a.n(s),l=a(28),o=a(4600);const u=({className:e,accessibleName:t})=>i().createElement(l.N_,{to:"/",className:(0,r.A)(o.A.link,e),"aria-label":t||null},i().createElement(n.A,{icon:c.A,className:o.A.icon}))},6176:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(7425),c=a(7723),r=a(1609),s=a(8837),i=a(9935),l=a(4367),o=a(4923),u=a(4526),m=a(1870),d=a(3981),p=a(2434),h=a(5410);const __=c.__,g=({admin:e,recommendation:t,slug:a,children:c,isDataLoading:g,Description:v=null,additionalActions:f=null,secondaryAction:w=null,upgradeInInterstitial:E=!1,primaryActionOverride:k,onMouseEnter:y,onMouseLeave:A,customLoadTracks:b})=>{const{isRegistered:j,isUserConnected:R}=(0,m.A)(),{recordEvent:C}=(0,u.A)(),{install:_,isPending:x}=(0,l.A)(a),{activate:N,isPending:z}=(0,i.A)(a),{detail:M,refetch:S,isLoading:L}=(0,o.A)(a),{name:V,description:P,requiresUserConnection:H,status:B,manageUrl:O}=M,I=(0,d.A)(s.NM.Connection),T=(0,r.useCallback)((()=>{j&&R||!H?N({}):I()}),[N,j,R,H,I]);(0,r.useEffect)((()=>{!j||B!==s.hp.SITE_CONNECTION_ERROR&&B!==s.hp.NEEDS_FIRST_SITE_CONNECTION||S()}),[j,B,S]);const F=(0,r.useCallback)((()=>{C("jetpack_myjetpack_product_card_manage_click",{product:a})}),[a,C]);return w||B!==s.hp.CAN_UPGRADE||(w={href:O,label:__("View","jetpack-my-jetpack"),onClick:F}),React.createElement(h.A,{name:V,Description:v||(()=>{const e=(0,p.A)(P);return React.createElement(n.Ay,{variant:"body-small",style:{flexGrow:1,marginBottom:"1rem"}},e)}),status:B,admin:e,recommendation:t,isFetching:z||x||L,isDataLoading:g,isInstallingStandalone:x,additionalActions:f,primaryActionOverride:k,secondaryAction:w,slug:a,onActivate:T,onInstallStandalone:_,upgradeInInterstitial:E,onMouseEnter:y,onMouseLeave:A,customLoadTracks:b},c)}},5403:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(6072),c=a.n(n),r=a(3924),s=a(9384),i=a(6427),l=a(7723),o=a(1113),u=a(3512),m=a(8395),d=a(9696);const __=l.__,p=e=>{const{title:t}=e;return React.createElement(s.ConnectScreen,c()({buttonLabel:__("Connect your user account","jetpack-my-jetpack"),loadingLabel:__("Connecting your account…","jetpack-my-jetpack"),images:[m],from:"my-jetpack"},e,{title:t||__("Unlock all the amazing features of Jetpack by connecting now","jetpack-my-jetpack")}),React.createElement("ul",{role:"list"},React.createElement("li",null,__("Receive instant downtime alerts","jetpack-my-jetpack")),React.createElement("li",null,__("Automatically share your content on social media","jetpack-my-jetpack")),React.createElement("li",null,__("Let your subscribers know when you post","jetpack-my-jetpack")),React.createElement("li",null,__("Receive notifications about new likes and comments","jetpack-my-jetpack")),React.createElement("li",null,__("Let visitors share your content on social media","jetpack-my-jetpack")),React.createElement("li",null,__("Create better content with powerful AI tools","jetpack-my-jetpack")),React.createElement("li",null,__("And more!","jetpack-my-jetpack")," ",React.createElement("a",{href:(0,r.A)("jetpack-features"),target:"_blank",className:d.A["all-features"],rel:"noreferrer"},__("See all Jetpack features","jetpack-my-jetpack"),React.createElement(o.A,{icon:u.A}),React.createElement(i.VisuallyHidden,{as:"span"},/* translators: accessibility text */ +__("(opens in a new tab)","jetpack-my-jetpack"))))))}},5242:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(7723),c=a(2822),r=a(5975),s=a(5519),i=a(9696),l=a(6579);const __=n.__,o=()=>React.createElement(React.Fragment,null,React.createElement("div",{className:i.A["account-description"]},__("On the next screen, you can connect with an existing account from any of these services or create a new one.","jetpack-my-jetpack")),React.createElement("ul",{className:i.A["account-images"],role:"list"},React.createElement("li",null,React.createElement("img",{src:l,className:i.A.wordpress,alt:"WordPress.com"})),React.createElement("li",null,React.createElement("img",{src:s,className:i.A.google,alt:"Google"})),React.createElement("li",null,React.createElement("img",{src:c,className:i.A.apple,alt:"Apple"})),React.createElement("li",null,React.createElement("img",{src:r,className:i.A.github,alt:"GitHub"}))))},1499:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(2947),c=a(5918),r=a(8509),s=a(7723),i=a(1870),l=a(5994),o=a(2191),u=a(5403),m=a(5242),d=a(9696);const __=s.__,p=()=>{const e=(0,l.A)(),{apiRoot:t,apiNonce:a,registrationNonce:s}=(0,i.A)();return React.createElement(n.A,{showHeader:!1,showBackground:!1},React.createElement(c.A,{horizontalSpacing:8,horizontalGap:0},React.createElement(r.A,{className:d.A["relative-col"]},React.createElement(o.A,{className:d.A["close-link"],accessibleName:__("Go back to previous screen","jetpack-my-jetpack")})),React.createElement(r.A,null,React.createElement(u.A,{from:"my-jetpack",redirectUri:e,apiRoot:t,apiNonce:a,registrationNonce:s,footer:React.createElement(m.A,null)}))))}},4596:(e,t,a)=>{"use strict";a.d(t,{A:()=>_});var n=a(7425),c=a(1112),r=a(3924),s=a(9384),i=a(7143),l=a(7723),o=a(3883),u=a(9783),m=a(7827),d=a(1113),p=a(3022),h=a(1609),g=a(4923),v=a(8242),f=a(8117),w=a(4526),E=a(1870),k=a(5042),y=a(3168),A=a(7757),b=a(7319),j=a(7193);const __=l.__,R=({text:e,actionText:t,onClick:a,status:c="success"})=>{let r=o.A,s="";return"success"===c&&(r=o.A,s=j.A.success),"error"===c&&(r=u.A,s=j.A.error),"warning"===c&&(r=u.A,s=j.A.warning),"unlock"===c&&(r=m.A,s=j.A.unlock),React.createElement("div",{className:j.A["list-item"]},React.createElement(n.Ay,{className:(0,p.A)(j.A["list-item-text"],s)},React.createElement(d.A,{icon:r}),e),t&&"success"!==c&&React.createElement(C,{actionText:t,onClick:a}))},C=({actionText:e,onClick:t})=>React.createElement(c.A,{variant:"link",weight:"regular",onClick:t},e),_=({apiRoot:e,apiNonce:t,redirectUri:a=null,title:o=__("Connection","jetpack-my-jetpack"),connectionInfoText:u=__("Jetpack connects your site and user account to the WordPress.com cloud to provide more powerful features.","jetpack-my-jetpack"),onDisconnected:m,connectedPlugins:d,connectedSiteId:_,context:x,onConnectUser:N=null})=>{const{isRegistered:z,isUserConnected:M,userConnectionData:S}=(0,E.A)({redirectUri:a}),{recordEvent:L}=(0,w.A)(),[V,P]=(0,h.useState)(!1),{setConnectionStatus:H,setUserIsConnecting:B}=(0,i.useDispatch)(s.CONNECTION_STORE_ID),O=N||B,I=S.currentUser?.wpcomUser?.avatar,{lifecycleStats:T}=(0,v.A$)(),{brokenModules:F}=T||{},U=(0,g.V)(),D=(0,f.A)(U).length>0,q=F?.needs_user_connection.length>0,J=F?.needs_site_connection.length>0,G=(0,h.useMemo)((()=>({user_connection_broken_modules:F?.needs_user_connection.join(", "),site_connection_broken_modules:F?.needs_site_connection.join(", ")})),[F]),$=(0,h.useCallback)((e=>t=>{t&&t.preventDefault(),L("jetpack_myjetpack_connection_manage_dialog_click",{...G,connection_type:e}),P(!0)}),[L,P,G]),W=$("user"),Q=$("site"),K=(0,h.useCallback)((e=>{e&&e.preventDefault(),P(!1)}),[P]),Z=(0,h.useCallback)((e=>{e&&e.preventDefault(),H({isActive:!1,isRegistered:!1,isUserConnected:!1}),m?.()}),[m,H]),Y=(0,h.useCallback)((()=>{L("jetpack_myjetpack_connection_learnmore_link_click",G)}),[L,G]),X=(0,h.useCallback)((e=>{e&&e.preventDefault(),L("jetpack_myjetpack_connection_connect_user_click",G),O()}),[O,L,G]),ee=(({isRegistered:e,hasSiteConnectionBrokenModules:t,handleConnectUser:a,openManageSiteConnectionDialog:n})=>e?{onClick:n,text:__("Site connected.","jetpack-my-jetpack"),actionText:__("Manage","jetpack-my-jetpack"),status:"success"}:t?{onClick:a,text:__("Missing site connection to enable some features.","jetpack-my-jetpack"),actionText:__("Connect","jetpack-my-jetpack"),status:"error"}:{onClick:a,text:__("Start with Jetpack.","jetpack-my-jetpack"),actionText:__("Connect your site with one click","jetpack-my-jetpack"),status:"warning"})({isRegistered:z,hasSiteConnectionBrokenModules:J,handleConnectUser:X,openManageSiteConnectionDialog:Q}),te=(({hasProductsThatRequireUserConnection:e,hasUserConnectionBrokenModules:t,isUserConnected:a,userConnectionData:n,openManageUserConnectionDialog:c,handleConnectUser:r})=>{if(!e&&!t&&!a)return{onClick:r,text:__("Unlock more of Jetpack","jetpack-my-jetpack"),actionText:__("Sign in","jetpack-my-jetpack"),status:"unlock"};if(e&&!a&&!t)return{onClick:r,text:__("Some features require authentication.","jetpack-my-jetpack"),actionText:__("Sign in","jetpack-my-jetpack"),status:"warning"};if(t)return{onClick:r,text:__("Missing authentication to enable all features.","jetpack-my-jetpack"),actionText:__("Sign in","jetpack-my-jetpack"),status:"error"};let s=null;return s=n.currentUser?.isMaster?n.currentUser?.wpcomUser?.display_name?(0,l.sprintf)(/* translators: placeholder is user name */ +__("Connected as %1$s (Owner).","jetpack-my-jetpack"),n.currentUser?.wpcomUser?.display_name):__("User connected (Owner).","jetpack-my-jetpack"):n.currentUser?.wpcomUser?.display_name?(0,l.sprintf)(/* translators: placeholder is user name */ +__("Connected as %1$s.","jetpack-my-jetpack"),n.currentUser?.wpcomUser?.display_name):__("User connected.","jetpack-my-jetpack"),{onClick:c,actionText:__("Manage","jetpack-my-jetpack"),text:s,status:"success"}})({hasProductsThatRequireUserConnection:D,hasUserConnectionBrokenModules:q,isUserConnected:M,userConnectionData:S,openManageUserConnectionDialog:W,handleConnectUser:X});return React.createElement("div",{id:"dylan",className:j.A["connection-status-card"]},React.createElement(n.H3,null,o),React.createElement(n.Ay,{variant:"body",mb:3},`${u} `,React.createElement(c.A,{href:(0,r.A)("why-the-wordpress-com-connection-is-important-for-jetpack"),variant:"link",weight:"regular",isExternalLink:!0,onClick:Y},__("Learn more about connections","jetpack-my-jetpack"))),React.createElement("div",{className:j.A.status},React.createElement("img",{src:k,alt:"",className:j.A.cloud}),React.createElement("div",{className:(0,p.A)(j.A.line,z?"":J?j.A.error:j.A.warning)}),React.createElement("div",{className:j.A["avatar-wrapper"]},React.createElement("img",{src:z?b:A,alt:"",className:j.A.jetpack}),(D||q)&&React.createElement("img",{src:M&&I?I:y,alt:"",className:j.A.avatar})),"success"===ee?.status&&ee?.actionText&&React.createElement("div",{className:j.A["connect-action"]},React.createElement(C,{onClick:ee?.onClick,actionText:ee?.actionText}))),React.createElement("div",null,React.createElement(R,ee),z&&React.createElement(R,te),M&&S?.connectionOwner&&!S.currentUser?.isMaster&&React.createElement(R,{text:(0,l.sprintf)(/* translators: placeholder is the username of the Jetpack connection owner */ +__("Also connected: %s (Owner).","jetpack-my-jetpack"),S.connectionOwner)})),React.createElement(s.ManageConnectionDialog,{apiRoot:e,apiNonce:t,onDisconnected:Z,connectedPlugins:d,connectedSiteId:_,connectedUser:S,isOpen:V,onClose:K,context:x}))}},3593:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(8837),c=a(4923),r=a(8117),s=a(1870),i=a(3981),l=a(4596);function o(){const{apiRoot:e,apiNonce:t,topJetpackMenuItemUrl:a,connectedPlugins:o}=(0,s.A)(),u=(0,i.A)(n.NM.Connection),m=(0,c.V)(),d=(0,r.A)(m);return React.createElement(l.A,{apiRoot:e,apiNonce:t,redirectUri:a,onConnectUser:u,connectedPlugins:o,requiresUserConnection:d.length>0,onDisconnected:()=>document?.location?.reload(!0)})}},5167:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var n=a(5918),c=a(8509),r=a(7425),s=a(6427),i=a(7723),l=a(2778),o=a(1609),u=a(3804),m=a(4526),d=a(9674),p=a(6225);const __=i.__,_n=i._n,h=()=>{const{recordEvent:e}=(0,m.A)(),{recommendedModules:t,redoEvaluation:a,removeEvaluationResult:i}=(0,u.A)();return(0,o.useEffect)((()=>{e("jetpack_myjetpack_evaluation_recommendations_view",{modules:t})}),[t,e]),React.createElement(n.A,{horizontalGap:2,horizontalSpacing:6},React.createElement(c.A,null,React.createElement(s.Flex,null,React.createElement(s.FlexItem,null,React.createElement(r.Ay,{variant:"headline-small",className:p.A.title},_n("Our recommendation for you","Our recommendations for you",t.length,"jetpack-my-jetpack")),React.createElement(r.Ay,null,__("Here are the tools that we think will help you reach your website goals:","jetpack-my-jetpack"))),React.createElement(s.FlexItem,null,React.createElement(s.DropdownMenu,{menuProps:{className:p.A["dropdown-menu"]},popoverProps:{position:"bottom left"},icon:l.A,label:__("Recommendations menu","jetpack-my-jetpack"),controls:[{title:__("Redo","jetpack-my-jetpack"),onClick:a},{title:__("Dismiss","jetpack-my-jetpack"),onClick:i}]})))),React.createElement(c.A,null,React.createElement(n.A,{tagName:"ul",className:p.A["recommendations-list"],horizontalGap:4,horizontalSpacing:2,fluid:!0},t.map((e=>{const t=d.z[e];return t&&React.createElement(c.A,{tagName:"li",key:e,lg:4},React.createElement(t,{recommendation:!0}))})))))}},1617:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(7723),c=a(1113),r=a(7474),s=a(1609),i=a.n(s),l=a(28),o=a(8870);const __=n.__;const u=function({onClick:e=()=>{},reload:t}){const a=t?"/?reload=true":"/";return i().createElement(l.N_,{to:a,className:o.A.link,onClick:e},i().createElement(c.A,{icon:r.A,className:o.A.icon}),__("Go back","jetpack-my-jetpack"))}},1651:(e,t,a)=>{"use strict";a.d(t,{k:()=>m});var n=a(1112),c=a(8478),r=a(6427),s=a(8443),i=a(7723),l=a(3022),o=a(1609),u=a(9331);a(4800);const __=i.__;function m({productName:e,giftedDate:t}){const[a,m]=(0,o.useState)(!1),d=(0,o.useCallback)((()=>m(!0)),[m]),p={position:"top center",placement:"top",animate:!0,noArrow:!1,resize:!1,flip:!1,offset:6,focusOnMount:"container",onClose:(0,o.useCallback)((()=>m(!1)),[m]),className:u.A.container},h=(0,l.A)(u.A.wrapper,"golden-token-icon-tooltip");return React.createElement("div",{className:h},React.createElement(n.A,{variant:"link",onClick:d},React.createElement(c.sT,{className:u.A.logo})),React.createElement("div",{className:u.A.helper},a&&React.createElement(r.Popover,p,React.createElement("div",null,React.createElement("div",{className:u.A.title},e),React.createElement("div",{className:u.A.content},(0,i.sprintf)( +// translators: %1$s is a product name, %2$s is the date the product was gifted. +__("%1$s was gifted on %2$s. It gives you access to a lifetime subscription of Jetpack VaultPress Backup and Jetpack Scan.","jetpack-my-jetpack"),e,(0,s.dateI18n)("F j, Y",t)))))))}},6894:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(6427),c=a(1609),r=a.n(c),s=a(146);const i=function(){const[e,t]=(0,c.useState)(!0),a=(0,c.useCallback)((()=>t(!1)),[]);if(!e)return null;if(!Object.hasOwn(window,"JP_IDENTITY_CRISIS__INITIAL_STATE"))return null;const{containerID:i,isSafeModeConfirmed:l}=window.JP_IDENTITY_CRISIS__INITIAL_STATE;return!i||l?null:r().createElement(n.Modal,{onRequestClose:a,overlayClassName:s.A.modal},r().createElement("div",{id:i,className:s.A.container}))}},2660:(e,t,a)=>{"use strict";a.d(t,{I:()=>l});var n=a(1883),c=a(6427),r=a(9491),s=a(1609),i=a(4526);a(6632);const l=({children:e,className:t,icon:a="info-outline",iconSize:l=14,tracksEventName:o,tracksEventProps:u={}})=>{const{recordEvent:m}=(0,i.A)(),d=(0,s.useRef)(),p=(0,r.useViewportMatch)("medium","<"),[h,g]=(0,s.useState)(!1),v=(0,s.useCallback)((()=>g((e=>(!0==!e&&o&&m(`jetpack_${o}`,{page:"my-jetpack",...u}),!e)))),[m,o,u]),f=(0,s.useCallback)((()=>{d.current&&!d.current.contains(document.activeElement)&&g(!1)}),[g,d]);return React.createElement("span",{className:t},React.createElement("button",{className:"info-tooltip__button",onClick:v,ref:d},React.createElement(n.A,{icon:a,size:l})),h&&React.createElement(c.Popover,{placement:p?"top-end":"right",noArrow:!1,offset:10,focusOnMount:"container",onClose:f},React.createElement("div",{className:"info-tooltip__content"},e)))}},3449:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(7506),c=a(3924),r=a(7723),s=a(1609),i=a.n(s),l=a(4526),o=a(4576);const __=r.__,u=e=>{const{isAgencyAccount:t=!1}=e,{recordEvent:a}=(0,l.A)();(0,s.useEffect)((()=>{a("jetpack_myjetpack_manage_banner_view",{})}),[a]);const r=(0,s.useCallback)((e=>{a("jetpack_myjetpack_manage_banner_click",{target:e,feature:"manage"})}),[a]),u=(0,s.useCallback)((()=>{r("jp-agencies-register-interest")}),[r]);return i().createElement(n.A,{icon:o,title:__("Manage client sites and grow your business","jetpack-my-jetpack"),description:__("Are you an agency or freelancer? We’re working on a new partnership program bringing together the best of Jetpack, Woo, WordPress.com, and Pressable. Get bulk discounts, referral commissions, and more.","jetpack-my-jetpack"),primaryCtaLabel:__("Sign up now","jetpack-my-jetpack"),primaryCtaURL:(0,c.A)("jetpack-for-agencies-register-interest"),primaryCtaIsExternalLink:!0,primaryCtaOnClick:u})}},2912:(e,t,a)=>{"use strict";a.d(t,{A:()=>V});var n=a(6072),c=a.n(n),r=a(442),s=a(8089),i=a(7656),l=a(2947),o=a(5918),u=a(8509),m=a(5640),d=a(8587),p=a(4082),h=a(3022),g=a(1609),v=a(6007),f=a(1504),w=a(3804),E=a(280),k=a(8242),y=a(9812),A=a(4526),b=a(1870),j=a(7436),R=a(3593),C=a(5167),_=a(6894),x=a(3449),N=a(3958),z=a(5487),M=a(8388),S=a(5055);const L=({message:e,title:t,options:a})=>{const{recordEvent:n}=(0,A.A)();(0,g.useEffect)((()=>{const e=a?.tracksArgs||{};n("jetpack_myjetpack_global_notice_view",{notice_id:a.id,...e})}),[a.id,n,a?.tracksArgs]);const[l]=(0,r.A)(["md"],[">"]),o=a.actions?.map((e=>React.createElement(s.A,c()({customClass:S.A.cta},e))));return React.createElement("div",{className:(0,h.A)(S.A.notice,{[S.A["bigger-than-medium"]]:l})},React.createElement(i.A,c()({hideCloseButton:!0},a,{title:t,actions:o}),React.createElement("div",{className:S.A.message},e)))};function V(){(0,p.rk)("explat_test_jetpack_implementation_aa_test"),(0,j.A)();const{redBubbleAlerts:e}=(0,k.A$)(),{jetpackManage:t={},adminUrl:a}=(0,k.A$)(),{isWelcomeBannerVisible:n}=(0,y.A)(),{isSectionVisible:c}=(0,w.A)(),{siteIsRegistered:r}=(0,b.A)(),{currentNotice:s}=(0,g.useContext)(v.g),{message:i,title:h,options:V}=s||{},{data:P,isLoading:H}=(0,E.A)({name:f._,query:{path:f.rR}}),{data:B,isLoading:O}=(0,E.A)({name:f.nw,query:{path:f.O2}}),I=P?.is_available,T=B?.user?.jwt,F=!O&&!H&&I&&T,U="1"===(0,k.A$)("userIsNewToJetpack"),{recordEvent:D}=(0,A.A)(),[q,J]=(0,g.useState)(!1);return(0,g.useLayoutEffect)((()=>{D("jetpack_myjetpack_page_view",{red_bubble_alerts:Object.keys(e).join(",")})}),[D,e]),window.location.hash.includes("?reload=true")&&(window.history.replaceState(null,"",window.location.href.replace("?reload=true","")),window.location.reload(),J(!0)),q?null:React.createElement(l.A,{siteAdminUrl:a},React.createElement("hr",{className:S.A.separator}),React.createElement(_.A,null),!U&&React.createElement(o.A,{horizontalSpacing:0},React.createElement(u.A,null,React.createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),n?React.createElement(M.A,null,i&&r&&React.createElement(L,{message:i,title:h,options:V})):i&&React.createElement(o.A,{horizontalSpacing:3,horizontalGap:3},React.createElement(u.A,null,React.createElement(L,{message:i,title:h,options:V}))),c&&React.createElement(C.A,null),React.createElement(z.A,null),t.isEnabled&&React.createElement(o.A,{horizontalSpacing:6,horizontalGap:i?3:6},React.createElement(u.A,null,React.createElement(x.A,{isAgencyAccount:t.isAgencyAccount}))),React.createElement(m.A,null,React.createElement(o.A,{horizontalSpacing:8},React.createElement(u.A,{sm:4,md:4,lg:6},React.createElement(N.A,null)),React.createElement(u.A,{sm:4,md:4,lg:6},React.createElement(R.A,null)))),F&&React.createElement(d.A,{jwt_token:T}))}},3958:(e,t,a)=>{"use strict";a.d(t,{A:()=>b});var n=a(7425),c=a(1112),r=a(7723),s=a(1609),i=a(8837),l=a(1504),o=a(280),u=a(8242),m=a(4526),d=a(1870),p=a(3981),h=a(6256),g=a(3542),v=a(8252),f=a(1651),w=a(4334);const __=r.__,_n=r._n;function E({purchase:e={}}){const{product_name:t}=e;return React.createElement(React.Fragment,null,React.createElement(n.hE,null,t),React.createElement(k,e))}function k(e){const{expiry_message:t,product_name:a,subscribed_date:c}=e;return(0,v.b)(e)?React.createElement(n.Ay,{variant:"body",className:w.A["expire-date"]},React.createElement("span",{className:w.A["expire-date--with-icon"]},__("Never Expires","jetpack-my-jetpack")),React.createElement(f.k,{productName:a,giftedDate:c})):React.createElement(n.Ay,{variant:"body",className:w.A["expire-date"]},t)}function y({numberOfPurchases:e=0}){return React.createElement(React.Fragment,null,React.createElement(n.H3,null,_n("Your plan","Your plans",e,"jetpack-my-jetpack")),0===e&&React.createElement(n.Ay,{variant:"body"},__("Want to power up your Jetpack?","jetpack-my-jetpack")))}function A({numberOfPurchases:e}){const{recordEvent:t}=(0,m.A)(),{isUserConnected:a}=(0,d.A)();let n=__("Purchase a plan","jetpack-my-jetpack");e>=1&&(n=_n("Manage your plan","Manage your plans",e,"jetpack-my-jetpack"));const r=(0,s.useCallback)((()=>{t(e?"jetpack_myjetpack_plans_manage_click":"jetpack_myjetpack_plans_purchase_click")}),[e,t]),l=(0,p.A)(i.NM.Connection),o=(0,s.useCallback)((()=>{t("jetpack_myjetpack_activate_license_click"),a||l()}),[l,a,t]);let v=__("Activate a license","jetpack-my-jetpack");a||(v=__("Activate a license (requires a user connection)","jetpack-my-jetpack"));const{loadAddLicenseScreen:f="",adminUrl:E=""}=(0,u.A$)();return React.createElement("ul",null,React.createElement("li",{className:w.A["actions-list-item"]},React.createElement(c.A,{onClick:r,href:e?(0,h.A)():(0,g.A)(),weight:"regular",variant:"link",isExternalLink:!0},n)),f&&React.createElement("li",{className:w.A["actions-list-item"]},React.createElement(c.A,{onClick:o,href:a?`${E}admin.php?page=my-jetpack#/add-license`:void 0,variant:"link",weight:"regular"},v)))}function b(){const e=!!(0,u.A$)("userIsAdmin"),{data:t,isLoading:a,isError:n}=(0,o.A)({name:l.Ck,query:{path:l.tb}}),c=t&&!a&&!n,r=c?t.length:0;return React.createElement("div",{className:w.A.container},React.createElement(y,{numberOfPurchases:r}),React.createElement("div",{className:w.A.purchasesSection},c&&t.map((e=>React.createElement(E,{key:`purchase-${e.product_name}`,purchase:e})))),e&&React.createElement(A,{numberOfPurchases:r}))}},169:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(6072),c=a.n(n),r=a(1112),s=a(7723),i=a(1113),l=a(3512),o=a(3883),u=a(4969),m=a(3022),d=a(6941),p=a.n(d),h=a(1609),g=a(8837),v=a(4923),f=a(4526),w=a(1413),E=a(1208);const __=s.__,k=p()("my-jetpack:product-card:action-button"),y=({status:e,admin:t,name:a,slug:n,onActivate:d,additionalActions:p,primaryActionOverride:y,onManage:A,onFixConnection:b,isFetching:j,isInstallingStandalone:R,className:C,onAdd:_,onInstall:x,onLearnMore:N,upgradeInInterstitial:z,isOwned:M})=>{const[S,L]=(0,h.useState)(!1),[V,P]=(0,h.useState)({}),{detail:H}=(0,v.A)(n),{manageUrl:B,purchaseUrl:O}=H,I=!B,T=(0,h.useRef)(null),F=(0,h.useRef)(null),{recordEvent:U}=(0,f.A)();"jetpack-ai"===n&&k(n,H);const D=j||R,q=p?.length>0,J=(0,h.useMemo)((()=>({variant:D?void 0:"primary",disabled:D,size:"small",weight:"regular",className:C})),[D,C]),G=(0,h.useCallback)((()=>{switch("jetpack-ai"===n&&k(n,e),e){case g.hp.ABSENT:{const e=__("Learn more","jetpack-my-jetpack");return{...J,href:`#/add-${n}`,variant:"primary",label:e,onClick:N,...y&&g.hp.ABSENT in y&&y[g.hp.ABSENT]}}case g.hp.ABSENT_WITH_PLAN:{const e=__("Install Plugin","jetpack-my-jetpack");return{...J,variant:"primary",label:e,onClick:x,...y&&g.hp.ABSENT_WITH_PLAN in y&&y[g.hp.ABSENT_WITH_PLAN]}}case g.hp.NEEDS_FIRST_SITE_CONNECTION:return{...J,href:O||`#/add-${n}`,variant:"primary",label:__("Learn more","jetpack-my-jetpack"),onClick:_,...y&&g.hp.NEEDS_FIRST_SITE_CONNECTION in y&&y[g.hp.NEEDS_FIRST_SITE_CONNECTION]};case g.hp.NEEDS_PLAN:{const e=__("Get plan","jetpack-my-jetpack"),t=__("Learn more","jetpack-my-jetpack"),a=M?e:t;return{...J,href:O||`#/add-${n}`,variant:"primary",label:a,onClick:_,...y&&g.hp.NEEDS_PLAN in y&&y[g.hp.NEEDS_PLAN]}}case g.hp.CAN_UPGRADE:{const e=__("Upgrade","jetpack-my-jetpack"),t=__("Learn more","jetpack-my-jetpack"),a=O||z?e:t;return{...J,href:O||`#/add-${n}`,variant:"primary",label:a,onClick:_,...y&&g.hp.CAN_UPGRADE in y&&y[g.hp.CAN_UPGRADE]}}case g.hp.ACTIVE:{const e=__("View","jetpack-my-jetpack");return{...J,disabled:I||J?.disabled,href:B,variant:"secondary",label:e,onClick:A,...y&&g.hp.ACTIVE in y&&y[g.hp.ACTIVE]}}case g.hp.SITE_CONNECTION_ERROR:return{...J,href:"#/connection",variant:"primary",label:__("Connect","jetpack-my-jetpack"),onClick:b,...y&&g.hp.SITE_CONNECTION_ERROR in y&&y[g.hp.SITE_CONNECTION_ERROR]};case g.hp.USER_CONNECTION_ERROR:return{href:"#/connection",variant:"primary",label:__("Connect","jetpack-my-jetpack"),onClick:b,...y&&g.hp.USER_CONNECTION_ERROR in y&&y[g.hp.USER_CONNECTION_ERROR]};case g.hp.INACTIVE:case g.hp.MODULE_DISABLED:case g.hp.NEEDS_ACTIVATION:return{...J,variant:"secondary",label:__("Activate","jetpack-my-jetpack"),onClick:d,...y&&g.hp.INACTIVE in y&&y[g.hp.INACTIVE]};default:return null}}),[e,J,n,_,b,d,x,N,O,z,I,B,A,y,M]),$=(0,h.useMemo)((()=>q?[...p,G()]:[G()]),[p,G,q]),W=(0,h.useCallback)((()=>{U("jetpack_myjetpack_product_card_dropdown_toggle",{product:n,state:S?"closed":"open"})}),[S,U,n]),Q=(0,h.useCallback)((()=>{L(!S),W()}),[S,W]);if((0,h.useEffect)((()=>{P($[0])}),[$]),(0,w.A)(T,(e=>{F.current.contains(e.target)||(L(!1),W())})),!t)return React.createElement(r.A,c()({},J,{size:"small",variant:"link",weight:"regular"}),/* translators: placeholder is product name. */ /* translators: placeholder is product name. */ +(0,s.sprintf)(__("Learn about %s","jetpack-my-jetpack"),a));const K=q&&React.createElement("div",{ref:T,className:E.A["action-button-dropdown"]},React.createElement("ul",{className:E.A["dropdown-menu"]},[...p,G()].map((({label:e,isExternalLink:t},a)=>React.createElement("li",{key:a},React.createElement("button",{onClick:()=>{P($[a]),L(!1),U("jetpack_myjetpack_product_card_dropdown_action_click",{product:n,action:e})},className:E.A["dropdown-item"]},React.createElement("div",{className:E.A["dropdown-item-label"]},e,t&&React.createElement(i.A,{icon:l.A,size:16})),e===V.label&&React.createElement("div",{className:E.A["active-action-checkmark"]},React.createElement(i.A,{icon:o.A,size:24,fill:"white"}))))))));return React.createElement(React.Fragment,null,React.createElement("div",{className:(0,m.A)(E.A["action-button"],q?E.A["has-additional-actions"]:null)},React.createElement(r.A,c()({},J,V),V.label),q&&React.createElement("button",{className:(0,m.A)(E.A["dropdown-chevron"],"primary"===V.variant?E.A.primary:E.A.secondary),onClick:Q,ref:F},React.createElement(i.A,{icon:u.A,size:24,fill:"primary"===V.variant?"white":"black"})),S&&K))}},5410:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var n=a(6072),c=a.n(n),r=a(7723),s=a(3022),i=a(1609),l=a(8837),o=a(8242),u=a(4526),m=a(2450),d=a(169),p=a(6710),h=a(7879),g=a(1887),v=a(2854),f=a(1208);const __=r.__,w=e=>{const t={isFetching:!1,isInstallingStandalone:!1,onActivate:()=>{},...e},{name:a,Description:n,status:r,onActivate:w,isFetching:E,isDataLoading:k,isInstallingStandalone:y,slug:A,additionalActions:b,primaryActionOverride:j,secondaryAction:R,children:C,onInstallStandalone:_,onMouseEnter:x,onMouseLeave:N,recommendation:z,customLoadTracks:M}=e,{ownedProducts:S}=(0,o.A$)("lifecycleStats"),L=S?.includes(A),V=r===l.hp.SITE_CONNECTION_ERROR||r===l.hp.USER_CONNECTION_ERROR,P=r===l.hp.ABSENT||r===l.hp.ABSENT_WITH_PLAN,H=r===l.hp.NEEDS_PLAN,B=(0,s.A)({[f.A.plugin_absent]:P,[f.A["is-purchase-required"]]:H,[f.A["is-link"]]:P,[f.A["has-error"]]:V}),{recordEvent:O}=(0,u.A)(),I=(0,i.useCallback)((()=>{O("jetpack_myjetpack_product_card_activate_click",{product:A}),w()}),[A,w,O]),T=(0,i.useCallback)((()=>{O("jetpack_myjetpack_product_card_add_click",{product:A})}),[A,O]),F=(0,i.useCallback)((()=>{O("jetpack_myjetpack_product_card_manage_click",{product:A})}),[A,O]),U=(0,i.useCallback)((()=>{O("jetpack_myjetpack_product_card_fixconnection_click",{product:A})}),[A,O]),D=(0,i.useCallback)((()=>{O("jetpack_myjetpack_product_card_learnmore_click",{product:A})}),[A,O]),q=(0,i.useCallback)((()=>{O("jetpack_myjetpack_product_card_install_standalone_plugin_click",{product:A}),_({})}),[A,_,O]);return(0,i.useEffect)((()=>{O("jetpack_myjetpack_product_card_load",{product:A,status:r,...M})}),[O,A,r,M]),React.createElement(m.A,{title:a,className:(0,s.A)(f.A.container,B),headerRightContent:null,onMouseEnter:x,onMouseLeave:N},z&&React.createElement(p.A,{slug:A}),React.createElement(n,null),k?React.createElement("span",{className:f.A.loading},__("Loading…","jetpack-my-jetpack")):C,z?React.createElement(h.A,{slug:A}):React.createElement("div",{className:f.A.actions},React.createElement("div",{className:f.A.buttons},R&&R?.positionFirst&&React.createElement(g.A,R),React.createElement(d.A,c()({},t,{onActivate:I,onFixConnection:U,onManage:F,onAdd:T,onInstall:q,onLearnMore:D,className:f.A.button,additionalActions:b,primaryActionOverride:j,isOwned:L})),R&&!R?.positionFirst&&React.createElement(g.A,R)),React.createElement(v.A,{status:r,isFetching:E,isInstallingStandalone:y,isOwned:L})))}},6710:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(7397),c=a(7723),r=a(3022),s=a(1208),i=a(6147);const __=c.__,l=({slug:e})=>{const{discountPrice:t,fullPrice:a,currencyCode:c}=(0,i.A)(e);return React.createElement("div",{className:s.A.priceContainer},t&&React.createElement("span",{className:s.A.price},(0,n.Ay)(t,c)),React.createElement("span",{className:(0,r.A)(s.A.price,t&&s.A.discounted)},(0,n.Ay)(a,c)),React.createElement("span",{className:s.A.term},__("/month, billed yearly","jetpack-my-jetpack")))}},7879:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(6072),c=a.n(n),r=a(1112),s=a(3022),i=a(1208),l=a(6147);const o=({slug:e})=>{const{secondaryAction:t,purchaseAction:a,isActivating:n}=(0,l.A)(e);return React.createElement("div",{className:i.A.actions},React.createElement("div",{className:(0,s.A)(i.A.buttons,i.A.upsell)},a&&React.createElement(r.A,c()({size:"small"},a),a.label),React.createElement(r.A,c()({size:"small",variant:"secondary",disabled:n},t),t.label)))}},1887:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(1112),c=a(7723);const __=c.__,r=e=>{const{shouldShowButton:t=()=>!0,...a}={size:"small",variant:"secondary",weight:"regular",label:__("Learn more","jetpack-my-jetpack"),...e};return!!t()&&React.createElement(n.A,a,a.label)}},2854:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(7425),c=a(7723),r=a(3022),s=a(8837),i=a(1208);const __=c.__,l=({status:e,isFetching:t,isInstallingStandalone:a,isOwned:c})=>{const l=((e,t)=>{switch(e){case s.hp.ACTIVE:case s.hp.CAN_UPGRADE:return __("Active","jetpack-my-jetpack");case s.hp.INACTIVE:case s.hp.MODULE_DISABLED:case s.hp.NEEDS_ACTIVATION:case s.hp.NEEDS_FIRST_SITE_CONNECTION:case s.hp.ABSENT:return __("Inactive","jetpack-my-jetpack");case s.hp.ABSENT_WITH_PLAN:return __("Needs Plugin","jetpack-my-jetpack");case s.hp.USER_CONNECTION_ERROR:return __("Needs user account","jetpack-my-jetpack");case s.hp.SITE_CONNECTION_ERROR:return __("Needs connection","jetpack-my-jetpack");case s.hp.NEEDS_PLAN:{const e=__("Needs plan","jetpack-my-jetpack"),a=__("Inactive","jetpack-my-jetpack");return t?e:a}default:return __("Inactive","jetpack-my-jetpack")}})(e,c),o=(0,r.A)(i.A.status,((e,t)=>{switch(e){case s.hp.ACTIVE:case s.hp.CAN_UPGRADE:return i.A.active;case s.hp.ABSENT_WITH_PLAN:case s.hp.SITE_CONNECTION_ERROR:case s.hp.USER_CONNECTION_ERROR:return i.A.warning;case s.hp.INACTIVE:case s.hp.NEEDS_FIRST_SITE_CONNECTION:case s.hp.NEEDS_ACTIVATION:return i.A.inactive;case s.hp.NEEDS_PLAN:return t?i.A.warning:i.A.inactive;default:return i.A.inactive}})(e,c),{[i.A["is-fetching"]]:t||a});return React.createElement(n.Ay,{variant:"label",className:o},l)}},6147:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var n=a(9384),c=a(7723),r=a(1609),s=a(8837),i=a(9935),l=a(4923),o=a(8242),u=a(4526),m=a(1870);const __=c.__,d=(e,t)=>{const a=e.status===s.hp.ACTIVE&&(e.isUpgradableByBundle.length||e.isUpgradable),n=e.pricingForUi.fullPrice||e.pricingForUi.tiers?.upgraded?.fullPrice;return e.status===s.hp.CAN_UPGRADE||a?n?{label:__("Upgrade","jetpack-my-jetpack"),onClick:t}:null:{label:__("Purchase","jetpack-my-jetpack"),onClick:t}},p=(e,t)=>{!e.isPluginActive||e.status===s.hp.NEEDS_ACTIVATION||(e.status,s.hp.NEEDS_PLAN);return{label:__("Learn more","jetpack-my-jetpack"),href:`#/add-${e.slug}`}},h=e=>{const{recordEvent:t}=(0,u.A)(),{detail:a}=(0,l.A)(e),{wpcomProductSlug:c,wpcomFreeProductSlug:s,...h}=(e=>{const{tiers:t,wpcomFreeProductSlug:a}=e;if(e.tiers){const{discountPrice:e,fullPrice:n,currencyCode:c,wpcomProductSlug:r,quantity:s}=t.upgraded;return{wpcomFreeProductSlug:a,wpcomProductSlug:s?`${r}:-q-${s}`:r,discountPrice:e&&e!==n?e/12:null,fullPrice:n/12,currencyCode:c}}const{discountPricePerMonth:n,fullPricePerMonth:c,currencyCode:r,isIntroductoryOffer:s,wpcomProductSlug:i}=e;return{wpcomFreeProductSlug:a,wpcomProductSlug:i,discountPrice:s?n:null,fullPrice:c,currencyCode:r}})(a.pricingForUi),{isUserConnected:g}=(0,m.A)(),{myJetpackUrl:v,siteSuffix:f}=(0,o.A$)(),{activate:w,isPending:E}=(0,i.A)(e),{run:k}=(0,n.useProductCheckoutWorkflow)({from:"my-jetpack",productSlug:c,redirectUrl:v,connectAfterCheckout:!g,siteSuffix:f}),{run:y}=(0,n.useProductCheckoutWorkflow)({from:"my-jetpack",productSlug:s,redirectUrl:v,connectAfterCheckout:!g,siteSuffix:f}),A=((0,r.useCallback)((()=>{s?y():w({})}),[w,y,s]),(0,r.useCallback)((()=>{if(t("jetpack_myjetpack_evaluation_recommendations_checkout_click",{slug:e}),"crm"===e)return w({}),void window.open("https://jetpackcrm.com/pricing/","_blank");k()}),[w,t,k,e]));return{secondaryAction:p(a),purchaseAction:d(a,A),isActivating:E,...h}}},8412:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(6072),c=a.n(n),r=a(1504),s=a(6176);const i=e=>React.createElement(s.A,c()({slug:r.D_.JETPACK_AI,upgradeInInterstitial:!0},e))},9674:(e,t,a)=>{"use strict";a.d(t,{z:()=>h});var n=a(8412),c=a(6724),r=a(161),s=a(9838),i=a(3690),l=a(1686),o=a(4274),u=a(414),m=a(7769),d=a(4073),p=a(7631);const h={backup:r.A,protect:o.A,"anti-spam":c.A,boost:s.A,search:u.A,videopress:p.A,stats:d.A,crm:l.A,creator:i.A,social:m.A,ai:n.A,"jetpack-ai":n.A,extras:null,scan:null,security:null}},6724:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6072),c=a.n(n),r=a(5739),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,c()({slug:i.D_.ANTI_SPAM},e));o.propTypes={admin:s().bool.isRequired};const u=o},161:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var n=a(6072),c=a.n(n),r=a(3924),s=a(7425),i=a(6427),l=a(7723),o=a(3022),u=a(2290),m=a(5739),d=a.n(m),p=a(1609),h=a(8837),g=a(1504),v=a(4923),f=a(280),w=a(8242),E=a(4526),k=a(6581),y=a(6176),A=a(3649);const __=l.__,_n=l._n,b=g.D_.BACKUP,j=e=>{const{detail:t}=(0,v.A)(b),{status:a}=t;return a===h.hp.ACTIVE||a===h.hp.CAN_UPGRADE?React.createElement(R,c()({slug:b},e)):React.createElement(y.A,c()({slug:b},e))},R=e=>{const{data:t,isLoading:a}=(0,f.A)({name:g.Dz,query:{path:g.DB}}),n=t?.last_rewindable_event,i=n?.published,o=t?.undo_backup_id,{recordEvent:m}=(0,E.A)(),{siteSuffix:d=""}=(0,w.A$)(),p={href:(0,r.A)("jetpack-backup-undo-cta",{path:o,site:d}),size:"small",variant:"primary",weight:"regular",label:__("Undo","jetpack-my-jetpack"),onClick:()=>{m("jetpack_myjetpack_backup_card_undo_click",{product:e.slug,undo_backup_id:o})},isExternalLink:!0};return React.createElement(y.A,c()({},e,{showMenu:!0,isDataLoading:a,Description:n?()=>React.createElement(s.Ay,{variant:"body-small",className:A.A.description},React.createElement("span",null,__("Activity Detected","jetpack-my-jetpack")),React.createElement("span",{className:A.A.time},(e=>{if(!e)return"";const t=new Date-new Date(e);if(t>0){const e=Math.floor(t/864e5),a=Math.floor(t%864e5/36e5),n=Math.floor(t%36e5/6e4),c=Math.floor(t%6e4/1e3);return e>0?(0,l.sprintf)( +// translators: %s is the number of days since the last backup +_n("%s day ago","%s days ago",e,"jetpack-my-jetpack"),e):a>0?(0,l.sprintf)( +// translators: %s is the number of hours since the last backup +_n("%s hour ago","%s hours ago",a,"jetpack-my-jetpack"),a):n>0?(0,l.sprintf)( +// translators: %s is the number of minutes since the last backup +_n("%s minute ago","%s minutes ago",n,"jetpack-my-jetpack"),n):(0,l.sprintf)( +// translators: %s is the number of seconds since the last backup +_n("%s second ago","%s seconds ago",c,"jetpack-my-jetpack"),c)}})(i))):null,additionalActions:n?[p]:[]}),n?React.createElement("div",{className:A.A.activity},React.createElement(u.A,{icon:n.gridicon,size:24}),React.createElement("p",{className:A.A.summary},n.summary)):null)};j.propTypes={admin:d().bool.isRequired},(e=>{const{data:t,isLoading:a}=(0,f.A)({name:g.gw,query:{path:g.Sm}}),n=(0,p.useMemo)((()=>{const e=[];return t?(Object.keys(t).forEach((a=>{0!==t[a]&&e.push([a,t[a]])})),e.sort(((e,t)=>e[1]{const a=e[0].split("_")[1],n=e[1];return React.createElement("li",{className:(0,o.A)(A.A["main-stat"],`main-stat-${t}`),key:t+a},React.createElement(React.Fragment,null,React.createElement("span",{className:(0,o.A)(A.A["visual-stat"]),"aria-hidden":"true"},(e=>{switch(e){case"post":return React.createElement(u.A,{icon:"posts",size:24});case"page":return React.createElement(u.A,{icon:"pages",size:24});default:return React.createElement(u.A,{icon:e,size:24})}})(a),React.createElement("span",null,(0,k.A)(n))),React.createElement(i.VisuallyHidden,null,({comment:e=>(0,l.sprintf)( +// translators: %d is the number of comments +_n("%d comment","%d comments",e,"jetpack-my-jetpack"),e),post:e=>(0,l.sprintf)( +// translators: %d is the number of posts +_n("%d post","%d posts",e,"jetpack-my-jetpack"),e),page:e=>(0,l.sprintf)( +// translators: %d is the number of pages +_n("%d page","%d pages",e,"jetpack-my-jetpack"),e),image:e=>(0,l.sprintf)( +// translators: %d is the number of images +_n("%d image","%d images",e,"jetpack-my-jetpack"),e),video:e=>(0,l.sprintf)( +// translators: %d is the number of videos +_n("%d video","%d videos",e,"jetpack-my-jetpack"),e),audio:e=>(0,l.sprintf)( +// translators: %d is the number of files +_n("%d audio file","%d audio files",e,"jetpack-my-jetpack"),e)}[c=a]||(e=>`${e} ${c}`))(n))));var c})))))}).propTypes={productData:d().object};const C=j},9520:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var n=a(8454),c=a(6461),r=a(580),s=a(6427),i=a(9491),l=a(7723),o=a(1113),u=a(2510),m=a(1609),d=a(8837),p=a(4923),h=a(8242),g=a(4526),v=a(1870),f=a(6683);a(2106);const __=l.__,w=()=>{const{recordEvent:e}=(0,g.A)(),[t,a]=(0,m.useState)(!1),[l,w]=(0,m.useState)(""),[E,k]=(0,m.useState)(null),[y,A]=(0,m.useState)(null),[b,j]=(0,m.useState)(!1),[R,C]=(0,m.useState)(!1),[_,x]=(0,m.useState)(!1),N=(0,i.useViewportMatch)("medium","<"),{siteUrl:z="",latestBoostSpeedScores:M}=(0,h.A$)(),{apiRoot:S,apiNonce:L,isSiteConnected:V}=(0,v.A)(),{detail:P}=(0,p.A)("boost"),{status:H}=P,B=H===d.hp.ACTIVE||H===d.hp.CAN_UPGRADE,O=(e,t)=>{const{mobile:a,desktop:n}=t||{};var c,r;a&&n&&e((c=a,r=n,Math.round((c+r)/2)))},I=e=>{const{scores:t,previousScores:a}=e||{};O(k,t),O(A,a),(e=>{const{mobile:t,desktop:a}=e||{};t&&a&&w((0,n.T)(t,a))})(t)},T=async()=>{V?(a(!0),(0,n.sE)(!0,S,z,L).then((e=>{const t=(0,n.T)(e.current.mobile,e.current.desktop);w(t),O(k,e.current),O(A,M.scores),a(!1)})).catch((t=>{e("jetpack_boost_speed_score_error",{feature:"jetpack-boost",position:"my-jetpack",error:t}),M&&M.scores?I(M):j(!0),a(!1)}))):j(!0)},F=(0,m.useMemo)((()=>y&&E?E{C(!0)}),[C]),q=(0,m.useCallback)((()=>{C(!1)}),[C]);return(0,m.useEffect)((()=>{M?B?(0,n.US)(1e3*M.timestamp)<1?I(M):T():(0,n.US)(1e3*M.timestamp)<14?I(M):T():T()}),[]),(0,m.useEffect)((()=>{t||!R||_||(e("jetpack_boost_card_tooltip_viewed",{feature:"jetpack-boost",position:"my-jetpack"}),x(!0))}),[t,R,e,_]),!b&&React.createElement("div",{className:"mj-boost-speed-score",role:"presentation",onMouseEnter:D,onMouseLeave:q,onClick:R?q:D,onFocus:D,onBlur:q},t?React.createElement(c.A,{color:"#23282d",size:16}):React.createElement(React.Fragment,null,React.createElement("div",{className:"mj-boost-speed-score__grade"},React.createElement("span",null,__("Your website’s overall speed score:","jetpack-my-jetpack")),React.createElement("span",{className:"mj-boost-speed-score__grade--letter"},l,!t&&R&&React.createElement(s.Popover,{placement:N?"top-end":"top-start",noArrow:!1,offset:10},React.createElement("div",{className:"boost-score-tooltip__parent"},React.createElement("p",{className:"boost-score-tooltip__heading"},__("Site speed performance:","jetpack-my-jetpack")," ",l),React.createElement("p",{className:"boost-score-tooltip__content"},U))))),React.createElement("div",{className:"mj-boost-speed-score__bar"},React.createElement(r.A,{score:E,active:E>0,isLoading:t,showPrevScores:!1,scoreBarType:"desktop",noBoostScoreTooltip:null})),!!F&&React.createElement("div",{className:"mj-boost-speed-score__increase"},React.createElement(o.A,{size:18,icon:u.A}),React.createElement("span",null,F))))}},9838:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6072),c=a.n(n),r=a(7723),s=a(8837),i=a(1504),l=a(6176),o=a(9520);const __=r.__,u=e=>{const t={[s.hp.ABSENT]:{label:__("Boost your site","jetpack-my-jetpack")}};return React.createElement(l.A,c()({slug:i.D_.BOOST,primaryActionOverride:t},e),React.createElement(o.A,null))}},6683:(e,t,a)=>{"use strict";a.d(t,{R:()=>r});var n=a(7723),c=a(4923);const __=n.__;function r({speedLetterGrade:e,boostScoreIncrease:t}){const{detail:a}=(0,c.A)("boost"),{isPluginActive:r,hasPaidPlanForProduct:s}=a;if(r){if(s){if(t)return(0,n.sprintf)(/* translators: %d is the number (positive integer) of points the speed has increased */ +__("Your speed has improved by %d points! Boost is working to enhance your performance with automated tools.","jetpack-my-jetpack"),t);switch(e){case"A":return __("Your site is fast! Boost is working to enhance your performance with automated tools.","jetpack-my-jetpack");case"B":case"C":case"D":case"E":case"F":return __("Visit the Boost dashboard to view your historical speed scores and manage your product settings.","jetpack-my-jetpack");default:return __("Visit the Boost dashboard to view your site’s speed scores and manage your product settings.","jetpack-my-jetpack")}}if(t)return(0,n.sprintf)(/* translators: %d is the number (integer) of points the speed has increased */ +__("Your speed has improved by %d points! Upgrade Boost to unlock automated CSS and image optimization tools to maintain your high score.","jetpack-my-jetpack"),t);switch(e){case"A":return __("Your site is fast! But maintaining a high speed isn’t easy. Upgrade Boost to use automated CSS and image optimization tools to improve your performance on the go.","jetpack-my-jetpack");case"B":return __("You are one step away from making your site blazing fast. Upgrade Boost to use automated CSS and image optimization tools to improve your performance.","jetpack-my-jetpack");default:return __("Improve your performance with automated CSS and image optimization tools by upgrading Boost.","jetpack-my-jetpack")}}switch(e){case"A":return __("Your site is fast! But maintaining a high speed isn’t easy. Use Boost’s automated acceleration tools to optimize your performance on the go.","jetpack-my-jetpack");case"B":return __("You are one step away from making your site blazing fast. Install Boost to enhance your site’s performance like top websites, no developer needed.","jetpack-my-jetpack");default:return __("Your site needs performance improvements. Make your site blazing fast with Boost’s simple dashboard and acceleration tools.","jetpack-my-jetpack")}}},3690:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6072),c=a.n(n),r=a(5739),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,c()({slug:i.D_.CREATOR,upgradeInInterstitial:!0},e));o.propTypes={admin:s().bool.isRequired};const u=o},1686:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6072),c=a.n(n),r=a(5739),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,c()({slug:i.D_.CRM},e));o.propTypes={admin:s().bool.isRequired};const u=o},5487:(e,t,a)=>{"use strict";a.d(t,{A:()=>R});var n=a(8509),c=a(5918),r=a(766),s=a(7425),i=a(7723),l=a(1609),o=a(1504),u=a(8242),m=a(1035),d=a(8412),p=a(6724),h=a(161),g=a(9838),v=a(3690),f=a(1686),w=a(4274),E=a(414),k=a(7769),y=a(4073),A=a(1218),b=a(7631);const __=i.__,j=({slugs:e})=>{const{showFullJetpackStatsCard:t=!1}=(0,u.A$)("myJetpackFlags"),{isAtomic:a=!1,userIsAdmin:r=!1}=(0,u.A$)(),s={backup:h.A,protect:w.A,"anti-spam":p.A,boost:g.A,search:E.A,videopress:b.A,stats:y.A,crm:f.A,creator:a?null:v.A,social:k.A,"jetpack-ai":d.A},i=e.filter((e=>(e!==o.D_.STATS||!t)&&!!s[e]));return React.createElement(React.Fragment,null,e.includes("stats")&&t&&React.createElement(n.A,{className:A.A.fullStatsCard},React.createElement(m.A,null)),React.createElement(c.A,{className:A.A.cardlist,tagName:"ul",fluid:!0,horizontalSpacing:0,horizontalGap:3},i.map((e=>{const t=s[e];return React.createElement(n.A,{tagName:"li",sm:4,md:4,lg:4,key:e},React.createElement(t,{admin:"1"===r}))}))))},R=({noticeMessage:e})=>{const{ownedProducts:t=[],unownedProducts:a=[]}=(0,u.A$)("lifecycleStats"),i=(0,l.useMemo)((()=>t.length>0?__("Discover more","jetpack-my-jetpack"):__("Discover all Jetpack Products","jetpack-my-jetpack")),[t.length]),o=e=>e.filter((e=>"scan"!==e&&"security"!==e&&"extras"!==e)),m=o(t),d=o(a);return React.createElement(React.Fragment,null,m.length>0&&React.createElement(r.A,null,React.createElement(c.A,{horizontalSpacing:6,horizontalGap:e?3:6},React.createElement(n.A,null,React.createElement(n.A,{sm:4,md:8,lg:12,className:A.A.cardListTitle},React.createElement(s.Ay,{variant:"headline-small"},__("My products","jetpack-my-jetpack"))),React.createElement(j,{slugs:m})))),d.length>0&&React.createElement(c.A,{horizontalSpacing:6,horizontalGap:e?3:6},React.createElement(n.A,null,React.createElement(n.A,{sm:4,md:8,lg:12,className:A.A.cardListTitle},React.createElement(s.Ay,{variant:"headline-small"},i)),React.createElement(j,{slugs:d}))))}},3293:(e,t,a)=>{"use strict";a.d(t,{Q:()=>h});var n=a(7723),c=a(3022),r=a(4923),s=a(8242),i=a(1870),l=a(2660),o=a(1218),u=a(6068),m=a(850),d=a(4516),p=a(7915);const __=n.__,h=()=>{const{detail:e}=(0,r.A)("protect"),{isPluginActive:t=!1}=e||{},{isSiteConnected:a}=(0,i.A)(),{protect:{wafConfig:n}}=(0,s.A$)(),{jetpack_waf_automatic_rules:c}=n||{};return t&&a?c?React.createElement(g,{status:"active"}):React.createElement(g,{status:"inactive"}):React.createElement(g,{status:"off"})};function g({status:e}){const{detail:t}=(0,r.A)("protect"),{hasPaidPlanForProduct:a=!1}=t||{},n=(0,p.T)(),{autoFirewallTooltip:s}=n;return"active"===e?React.createElement(React.Fragment,null,React.createElement("div",{className:o.A.valueSectionHeading},__("Auto-Firewall","jetpack-my-jetpack")),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:d,alt:__("Shield icon - Auto-Firewall Status: On","jetpack-my-jetpack")})),React.createElement("div",{className:"value-section__status-text"},__("On","jetpack-my-jetpack")))):"inactive"===e?React.createElement(React.Fragment,null,React.createElement("div",{className:(0,c.A)(o.A.valueSectionHeading,"value-section__heading")},__("Auto-Firewall","jetpack-my-jetpack"),React.createElement(l.I,{tracksEventName:"protect_card_tooltip_open",tracksEventProps:{location:"auto-firewall",status:e,feature:"jetpack-protect",has_paid_plan:a}},React.createElement(React.Fragment,null,React.createElement("h3",null,s.title),React.createElement("p",null,s.text)))),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:u,alt:__("Shield icon - Auto-Firewall Status: Inactive","jetpack-my-jetpack")})),React.createElement("div",{className:"value-section__status-text"},__("Inactive","jetpack-my-jetpack")))):React.createElement(React.Fragment,null,React.createElement("div",{className:o.A.valueSectionHeading},__("Auto-Firewall","jetpack-my-jetpack")),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:m,alt:__("Shield icon - Auto-Firewall Status: Off","jetpack-my-jetpack")})),React.createElement("div",{className:"value-section__status-text"},__("Off","jetpack-my-jetpack"))))}},4274:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6072),c=a.n(n),r=a(1504),s=a(6176),i=a(7765);const l=e=>React.createElement(s.A,c()({},e,{slug:r.D_.PROTECT,upgradeInInterstitial:!0}),React.createElement(i.A,null))},66:(e,t,a)=>{"use strict";a.d(t,{f:()=>g});var n=a(7723),c=a(3022),r=a(4923),s=a(8242),i=a(1870),l=a(6581),o=a(3658),u=a(2660),m=a(1218),d=a(850),p=a(4538),h=a(7915);const __=n.__,g=()=>{const{detail:e}=(0,r.A)("protect"),{isPluginActive:t=!1}=e||{},{isSiteConnected:a}=(0,i.A)(),{protect:{wafConfig:n}}=(0,s.A$)(),{blocked_logins:c,brute_force_protection:l}=n||{};return(t||(0,o.w)())&&a?l?React.createElement(v,{status:"active"}):React.createElement(v,{status:"inactive"}):a&&c>0?React.createElement(v,{status:"inactive"}):React.createElement(v,{status:"off"})};function v({status:e}){const{protect:{wafConfig:t}}=(0,s.A$)(),{blocked_logins:a}=t||{},n=(0,h.T)(),{blockedLoginsTooltip:r}=n;return"active"===e?a>0?React.createElement(React.Fragment,null,React.createElement("div",{className:m.A.valueSectionHeading},__("Logins Blocked","jetpack-my-jetpack")),React.createElement("div",{className:"value-section__data"},React.createElement("div",{className:"logins_blocked__count"},(0,l.A)(a)))):React.createElement(React.Fragment,null,React.createElement("div",{className:(0,c.A)(m.A.valueSectionHeading,"value-section__heading")},__("Logins Blocked","jetpack-my-jetpack"),React.createElement(u.I,{tracksEventName:"protect_card_tooltip_open",tracksEventProps:{location:"blocked-logins",status:e,feature:"jetpack-protect",message:"no data yet"}},React.createElement(React.Fragment,null,React.createElement("h3",null,r.title),React.createElement("p",null,r.text)))),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:p,alt:__("Shield icon - Brute Force Protection Status: Active","jetpack-my-jetpack")})))):"inactive"===e?React.createElement(React.Fragment,null,React.createElement("div",{className:(0,c.A)(m.A.valueSectionHeading,"value-section__heading")},__("Logins Blocked","jetpack-my-jetpack"),React.createElement(u.I,{tracksEventName:"protect_card_tooltip_open",tracksEventProps:{location:"blocked-logins",feature:"jetpack-protect",status:e}},React.createElement(React.Fragment,null,React.createElement("h3",null,r.title),React.createElement("p",null,r.text)))),React.createElement("div",{className:"value-section__data"},a>0?React.createElement(React.Fragment,null,React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:d,alt:__("Shield icon - Brute Force Protection Status: Inactive","jetpack-my-jetpack")})),React.createElement("div",{className:"logins_blocked__count"},(0,l.A)(a))):React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:d,alt:__("Shield icon - Brute Force Protection Status: Inactive","jetpack-my-jetpack")})))):React.createElement(React.Fragment,null,React.createElement("div",{className:m.A.valueSectionHeading},__("Logins Blocked","jetpack-my-jetpack")),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:d,alt:__("Shield icon - Brute Force Protection Status: Off","jetpack-my-jetpack")})),React.createElement("div",{className:"value-section__status-text"},__("Off","jetpack-my-jetpack"))))}},7765:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(4923),c=a(2660),r=a(3293),s=a(66),i=a(1512),l=a(2584),o=a(7915);a(538);const u=()=>{const{detail:e}=(0,n.A)("protect"),{isPluginActive:t=!1}=e||{},a=(0,l.A)(),u=(0,o.T)(),{pluginsThemesTooltip:m}=u;return React.createElement(React.Fragment,null,React.createElement("div",{className:"value-section__last-scan"},a&&React.createElement("div",null,a),!t&&React.createElement(c.I,{tracksEventName:"protect_card_tooltip_open",tracksEventProps:{location:"plugins&themes",feature:"jetpack-protect",status:"inactive"}},React.createElement(React.Fragment,null,React.createElement("h3",null,m.title),React.createElement("p",null,m.text)))),React.createElement("div",{className:"value-section"},React.createElement("div",{className:"value-section__scan-threats"},React.createElement(i.v,null)),React.createElement("div",{className:"value-section__auto-firewall"},React.createElement(r.Q,null)),React.createElement("div",{className:"value-section__logins-blocked"},React.createElement(s.f,null))))}},1512:(e,t,a)=>{"use strict";a.d(t,{v:()=>E});var n=a(1883),c=a(6427),r=a(9491),s=a(7723),i=a(3022),l=a(1609),o=a(4923),u=a(8242),m=a(4526),d=a(1870),p=a(2660),h=a(1218),g=a(850),v=a(4538),f=a(4516),w=a(7915);const __=s.__,E=()=>{const{detail:e}=(0,o.A)("protect"),{isPluginActive:t=!1,hasPaidPlanForProduct:a}=e||{},{isSiteConnected:n}=(0,d.A)(),{protect:{scanData:c}}=(0,u.A$)(),{plugins:r,themes:s,num_threats:i=0}=c||{},m=(0,l.useMemo)((()=>{const{core:e,database:t,files:a,num_plugins_threats:n,num_themes_threats:i}=c||{};return[...n?r.reduce(((e,t)=>e.concat(t.threats)),[]):[],...i?s.reduce(((e,t)=>e.concat(t.threats)),[]):[],...e?.threats??[],...t,...a].reduce(((e,t)=>t.severity>=5?e+=1:e),0)}),[r,s,c]);return t&&n?a?i?React.createElement(k,{numThreats:i,criticalThreatCount:m}):React.createElement(y,{status:"success"}):i?React.createElement(k,{numThreats:i}):React.createElement(y,{status:"partial"}):React.createElement(y,{status:"off"})};function k({numThreats:e,criticalThreatCount:t}){const{recordEvent:a}=(0,m.A)(),s=(0,l.useRef)(),o=(0,r.useViewportMatch)("medium","<"),[u,d]=(0,l.useState)(!1),p=(0,w.T)(),{scanThreatsTooltip:g}=p,v=(0,l.useCallback)((()=>d((t=>(!0==!t&&a("jetpack_protect_card_tooltip_open",{page:"my-jetpack",feature:"jetpack-protect",location:"scan",has_paid_plan:!0,threats:e}),!t)))),[e,a]),f=(0,l.useCallback)((()=>{s.current&&!s.current.contains(document.activeElement)&&d(!1)}),[d,s]);return t?React.createElement(React.Fragment,null,React.createElement("div",{className:(0,i.A)(h.A.valueSectionHeading,"value-section__heading")},__("Threats","jetpack-my-jetpack"),React.createElement("div",{className:"scan-threats__critical-threat-container"},React.createElement("button",{className:"info-tooltip__button",onClick:v,ref:s},React.createElement(n.A,{className:"scan_threats__icon-critical",icon:"info",size:14}),React.createElement("span",{className:"scan-threats__critical-threat-count"},t)),u&&React.createElement(c.Popover,{placement:o?"top-end":"right",noArrow:!1,offset:10,focusOnMount:"container",onClose:f},React.createElement(React.Fragment,null,React.createElement("h3",null,g.title),React.createElement("p",null,g.text))))),React.createElement("div",{className:"value-section__data"},React.createElement("div",{className:"scan-threats__critical-threats"},React.createElement("div",{className:"scan-threats__threat-count"},e)))):React.createElement(React.Fragment,null,React.createElement("div",{className:h.A.valueSectionHeading},__("Threats","jetpack-my-jetpack")),React.createElement("div",{className:"value-section__data"},React.createElement("div",{className:"scan-threats__threat-count"},e)))}function y({status:e}){const t=(0,w.T)(),{scanThreatsTooltip:a}=t;return"success"===e?React.createElement(React.Fragment,null,React.createElement("div",{className:h.A.valueSectionHeading},__("Scan","jetpack-my-jetpack")),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:f,alt:__("Shield icon - Scan Status: Secure","jetpack-my-jetpack")})),React.createElement("div",{className:"value-section__status-text"},__("Secure","jetpack-my-jetpack")))):"partial"===e?React.createElement(React.Fragment,null,React.createElement("div",{className:(0,i.A)(h.A.valueSectionHeading,"value-section__heading")},__("Scan","jetpack-my-jetpack"),React.createElement(p.I,{tracksEventName:"protect_card_tooltip_open",tracksEventProps:{location:"scan",status:e,feature:"jetpack-protect",has_paid_plan:!1,threats:0}},React.createElement(React.Fragment,null,React.createElement("h3",null,a.title),React.createElement("p",null,a.text)))),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:v,alt:__("Shield icon - Scan Status: Partial","jetpack-my-jetpack")})),React.createElement("div",{className:"value-section__status-text"},__("Partial","jetpack-my-jetpack")))):React.createElement(React.Fragment,null,React.createElement("div",{className:h.A.valueSectionHeading},__("Scan","jetpack-my-jetpack")),React.createElement("div",{className:"value-section__data"},React.createElement("div",null,React.createElement("img",{className:"value-section__status-icon",src:g,alt:__("Shield icon - Scan Status: Off","jetpack-my-jetpack")})),React.createElement("div",{className:"value-section__status-text"},__("Off","jetpack-my-jetpack"))))}},2584:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(7723),c=a(1609),r=a(4923),s=a(8242),i=a(4542);const __=n.__,_n=n._n,l=()=>{const{detail:e}=(0,r.A)("protect"),{isPluginActive:t=!1}=e||{},{plugins:a,themes:l,protect:{scanData:o}}=(0,s.A$)(),{plugins:u,themes:m,last_checked:d=null}=o||{},p=u.length||Object.keys(a).length,h=m.length||Object.keys(l).length,g=!!d&&(0,i._)(Date.parse(d));return(0,c.useMemo)((()=>t?g?(0,n.sprintf)(/* translators: %s is how long ago since the last scan took place, i.e.- "17 hours ago" */ +__("Last scan: %s","jetpack-my-jetpack"),g):null:(0,n.sprintf)(/* translators: %d is the number of plugins installed on the site. */ +_n("%d plugin","%d plugins",p,"jetpack-my-jetpack"),p)+" "+/* translators: The ampersand symbol here (&) is meaning "and". */ +__("&","jetpack-my-jetpack")+" "+(0,n.sprintf)(/* translators: %d is the number of themes installed on the site. */ +_n("%d theme","%d themes",h,"jetpack-my-jetpack").replace(" "," "),h)),[t,g,p,h])}},7915:(e,t,a)=>{"use strict";a.d(t,{T:()=>m});var n=a(6087),c=a(7723),r=a(1609),s=a(1504),i=a(4923),l=a(8242),o=a(4526),u=a(3658);const __=c.__,_n=c._n;function m(){const e=s.D_.PROTECT,{detail:t}=(0,i.A)(e),{isPluginActive:a,hasPaidPlanForProduct:m}=t||{},{recordEvent:d}=(0,o.A)(),{plugins:p,themes:h,protect:{scanData:g,wafConfig:v}}=(0,l.A$)(),{plugins:f,themes:w,num_threats:E=0}=g||{},{jetpack_waf_automatic_rules:k,blocked_logins:y,brute_force_protection:A}=v||{},b=f.length||Object.keys(p).length,j=w.length||Object.keys(h).length,R=(0,r.useMemo)((()=>a?"admin.php?page=jetpack-protect#/firewall":(0,u.w)()?"admin.php?page=jetpack#/settings":null),[a]),C=(0,r.useCallback)((()=>{d("jetpack_protect_card_tooltip_content_link_click",{page:"my-jetpack",feature:"jetpack-protect",location:"auto-firewall-tooltip",path:R})}),[d,R]),_=a||(0,u.w)(),x=(0,r.useMemo)((()=>0===y?A?{title:__("Brute Force Protection: Active","jetpack-my-jetpack"),text:__("Brute Force Protection is actively blocking malicious login attempts. The number of blocked login attempts will display here soon!","jetpack-my-jetpack")}:{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:R?(0,n.createInterpolateElement)((0,c.sprintf)(/* translators: %s is the location/page where the settings are located. Either "firewall settings" or "Jetpack settings". */ +__("Brute Force Protection is disabled and not actively blocking malicious login attempts. Go to %s to activate it.","jetpack-my-jetpack"),a?"firewall settings":"Jetpack settings"),{a:(0,r.createElement)("a",{href:R,onClick:C})}):__("Brute Force Protection is disabled and not actively blocking malicious login attempts.","jetpack-my-jetpack")}:A?void 0:_?{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:R?(0,n.createInterpolateElement)((0,c.sprintf)(/* translators: %s is the location/page where the settings are located. Either "firewall settings" or "Jetpack settings". */ +__("Brute Force Protection is disabled and not actively blocking malicious login attempts. Go to %s to activate it.","jetpack-my-jetpack"),a?"firewall settings":"Jetpack settings"),{a:(0,r.createElement)("a",{href:R,onClick:C})}):__("Brute Force Protection is disabled and not actively blocking malicious login attempts.","jetpack-my-jetpack")}:{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:__("For Brute Force Protection, activate the Jetpack or Protect plugin and enable it in settings.","jetpack-my-jetpack")}),[y,A,_,a,R,C]);return{pluginsThemesTooltip:{title:__("Improve site safety: secure plugins & themes","jetpack-my-jetpack"),text:(0,c.sprintf)(/* translators: %1$s the singular or plural of number of plugin(s), and %2$s is the singular or plural of the number of theme(s). */ +__("Your site has %1$s and %2$s lacking security measures. Improve your site’s safety by adding protection at no cost.","jetpack-my-jetpack"),(0,c.sprintf)(/* translators: %d is the number of plugins installed on the site. */ +_n("%d plugin","%d plugins",b,"jetpack-my-jetpack"),b),(0,c.sprintf)(/* translators: %d is the number of themes installed on the site. */ +_n("%d theme","%d themes",j,"jetpack-my-jetpack"),j))},scanThreatsTooltip:m&&E?{title:__("Auto-fix threats","jetpack-my-jetpack"),text:(0,c.sprintf)(/* translators: %s is the singular or plural of number of detected critical threats on the site. */ +__("The last scan identified %s. But don’t worry, use the “Auto-fix” button in the product to automatically fix most threats.","jetpack-my-jetpack"),(0,c.sprintf)(/* translators: %d is the number of detected scan threats on the site. */ +_n("%d critical threat.","%d critical threats.",E,"jetpack-my-jetpack"),E))}:{title:__("Elevate your malware protection","jetpack-my-jetpack"),text:__("We’ve checked items against our database, and all appears well. For a more detailed, line-by-line malware scan, consider upgrading your plan.","jetpack-my-jetpack")},autoFirewallTooltip:m&&!k?{title:__("Auto-Firewall: Inactive","jetpack-my-jetpack"),text:(0,n.createInterpolateElement)(__("You have Auto-Firewall disabled, visit your Protect firewall settings to activate.","jetpack-my-jetpack"),{a:(0,r.createElement)("a",{href:R,onClick:C})})}:{title:__("Auto-Firewall: Inactive","jetpack-my-jetpack"),text:__("Upgrade required for activation. Manual rules available.","jetpack-my-jetpack")},blockedLoginsTooltip:x}}},414:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6072),c=a.n(n),r=a(5739),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,c()({slug:i.D_.SEARCH,showMenu:!0},e));o.propTypes={admin:s().bool.isRequired};const u=o},7769:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6072),c=a.n(n),r=a(5739),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,c()({slug:i.D_.SOCIAL,showMenu:!0},e));o.propTypes={admin:s().bool.isRequired};const u=o},4073:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(6072),c=a.n(n),r=a(5739),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,c()({slug:i.D_.STATS,showMenu:!0},e));o.propTypes={admin:s().bool.isRequired};const u=o},7631:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(7425),c=a(1609),r=a(8837),s=a(1504),i=a(4923),l=a(8242),o=a(6176),u=a(2660),m=a(6544),d=a(3554),p=a(7167);a(6101);const h=s.D_.VIDEOPRESS,g=({admin:e})=>{const{detail:t}=(0,i.A)(h),{status:a}=t||{},{videopress:s}=(0,l.A$)(),{activeAndNoVideos:g}=(0,m.A)(),{videoCount:v=0,featuredStats:f}=s||{},w=a===r.hp.ACTIVE||a===r.hp.CAN_UPGRADE,E=(0,d.A)({isPluginActive:w,videoCount:v}),k={stats_period:f?.period,video_count:v},y=(0,c.useCallback)((()=>React.createElement(n.Ay,{variant:"body-small",className:"description"},E||t.description,w&&!v&&React.createElement(u.I,{className:"videopress-card__no-video-tooltip",tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"description",feature:"jetpack-videopress",status:a,video_count:v}},React.createElement("h3",null,g.title),React.createElement("p",null,g.text)))),[E,t.description,v,a,g,w]);return React.createElement(o.A,{slug:h,showMenu:!0,admin:e,Description:y,customLoadTracks:k},React.createElement(p.A,{isPluginActive:w,data:s}))}},6544:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(3924),c=a(6087),r=a(7723),s=a(1609),i=a(8242),l=a(4526);const __=r.__,_n=r._n,o=()=>{const{recordEvent:e}=(0,l.A)(),{videopress:t}=(0,i.A$)(),{featuredStats:a,videoCount:o}=t||{},{period:u}=a||{},m=(0,n.A)("jetpack-videopress-my-jetpack-tooltip"),d=(0,s.useCallback)((()=>{e("jetpack_videopress_card_tooltip_content_link_click",{location:"video_count",feature:"jetpack-videopress",page:"my-jetpack",path:m})}),[e,m]),p={title:__("The finest video for WordPress","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)((0,r.sprintf)( +// translators: %d is the number of videos in the Media Library that could benefit from VideoPress. +_n("You have %d video in your Media Library that could benefit from VideoPress. Start hosting it today to unlock multiple benefits: enhanced quality add-free streaming, faster load times, customizable player controls.","You have %d videos in your Media Library that could benefit from VideoPress. Start hosting them today to unlock multiple benefits: enhanced quality add-free streaming, faster load times, customizable player controls.",o,"jetpack-my-jetpack"),o),{a:(0,s.createElement)("a",{href:m,target:"_blank",rel:"noreferrer noopener",onClick:d})})},h={title:__("The finest video for WordPress","jetpack-my-jetpack"),text:__("Give your videos a boost! 🚀 Try hosting with VideoPress for superior quality and performance.","jetpack-my-jetpack")},g={title:__("High-quality video, wherever your audience is","jetpack-my-jetpack"),text:__("Success! 🌟 Your video is live and gathering views.","jetpack-my-jetpack")},v=__("30-Day views","jetpack-my-jetpack"),f=__("Yearly views","jetpack-my-jetpack"),w=__("This metric shows your total video views over the past 30 days, compared to the previous 30 days.","jetpack-my-jetpack"),E=__("This metric shows your total video views over the past year.","jetpack-my-jetpack"),k={title:"day"===u?v:f,text:"day"===u?w:E},y=__("This metric shows your total video viewing time over the past 30 days, compared to the previous 30 days.","jetpack-my-jetpack"),A=__("This metric shows total video viewing time for the last year.","jetpack-my-jetpack");return{inactiveWithVideos:p,activeAndNoVideos:h,viewsWithoutPlan:g,viewsWithPlan:k,watchTime:{title:__("Total time watched","jetpack-my-jetpack"),text:"day"===u?y:A}}}},3554:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(7723),c=a(2434);const __=n.__,r=({isPluginActive:e,videoCount:t})=>!e&&t?(0,c.A)(__("Load your existing videos faster and without ads.","jetpack-my-jetpack")):e&&!t?(0,c.A)(__("Stunning-quality, ad-free video in the WordPress Editor. Begin by uploading your first video.","jetpack-my-jetpack")):""},7167:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var n=a(7723),c=a(1113),r=a(2510),s=a(6955),i=a(3022),l=a(1504),o=a(4923),u=a(6581),m=a(2753),d=a(2660),p=a(1218),h=a(6544);a(6101);const __=n.__,g=({value:e,previousValue:t,formattedValue:a,formattedDifference:n,period:l})=>{const o=e>t;return React.createElement("div",{className:"videopress-card__value-section__value-container"},React.createElement("span",{className:"videopress-card__value-section__value"},a),e!==t&&"day"===l&&React.createElement("div",{className:(0,i.A)("videopress-card__value-section__previous-value",o?"increase":"decrease")},React.createElement(c.A,{size:18,icon:o?r.A:s.A}),React.createElement("span",null,n)))},v=({isPluginActive:e,data:t})=>{const{detail:a}=(0,o.A)(l.D_.VIDEOPRESS),{status:n,hasPaidPlanForProduct:c}=a||{},{videoCount:r,featuredStats:s}=t||{},{inactiveWithVideos:v,viewsWithoutPlan:f,viewsWithPlan:w,watchTime:E}=(0,h.A)();if(!r)return null;const k={feature:"jetpack-videopress",has_paid_plan:c,status:n};if(!e)return React.createElement("div",{className:"videopress-card__value-section"},React.createElement("div",{className:"videopress-card__value-section__container"},React.createElement("span",{className:p.A.valueSectionHeading},__("Existing videos","jetpack-my-jetpack"),React.createElement(d.I,{className:"videopress-card__no-video-tooltip",tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"existing_videos",feature:"jetpack-videopress",status:n,video_count:r}},React.createElement("h3",null,v.title),React.createElement("p",null,v.text))),React.createElement("span",{className:"videopress-card__video-count"},r)));const y=s?.data?.views?.current,A=s?.data?.watch_time?.current,b=s?.data?.views?.previous,j=s?.data?.watch_time?.previous,R=s?.period,C=Math.abs(y-b),_=Math.abs(A-j);if(void 0===y||void 0===A)return null;const x=__("30-Day views","jetpack-my-jetpack"),N=__("Yearly views","jetpack-my-jetpack");return React.createElement("div",{className:"videopress-card__value-section"},React.createElement("div",{className:"videopress-card__value-section__container"},React.createElement("span",{className:(0,i.A)(p.A.valueSectionHeading,"videopress-card__value-section__heading")},"day"===R?x:N,React.createElement(d.I,{tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"views",current_views:y,previous_views:b,period:R,...k}},c||0===y?React.createElement(React.Fragment,null,React.createElement("h3",null,w.title),React.createElement("p",null,w.text)):React.createElement(React.Fragment,null,React.createElement("h3",null,f.title),React.createElement("p",null,f.text)))),React.createElement(g,{value:y,previousValue:b,formattedValue:(0,u.A)(y),formattedDifference:(0,u.A)(C),period:R})),React.createElement("div",{className:"videopress-card__value-section__container"},React.createElement("span",{className:(0,i.A)(p.A.valueSectionHeading,"videopress-card__value-section__heading")},__("Total time watched","jetpack-my-jetpack"),React.createElement(d.I,{tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"watch_time",current_watch_time:A,previous_watch_time:j,period:R,...k}},React.createElement("h3",null,E.title),React.createElement("p",null,E.text))),React.createElement(g,{value:A,previousValue:j,formattedValue:(0,m.A)(A),formattedDifference:(0,m.A)(_),period:R})))}},3614:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(6427),c=a(5739),r=a.n(c),s=a(1609),i=a.n(s);const l=({children:e,className:t,href:a,isLoading:c=!1,onClick:r,isPrimary:s=!0,disabled:l=!1})=>i().createElement(n.Button,{onClick:r,className:t,href:a,variant:s?"primary":"secondary",disabled:c||l},c?i().createElement(n.Spinner,null):e);l.propTypes={className:r().string,isLoading:r().bool,isPrimary:r().bool,disabled:r().bool};const o=l},4720:(e,t,a)=>{"use strict";a.d(t,{A:()=>j});var n=a(7397),c=a(7425),r=a(8478),s=a(2266),i=a(5879),l=a(9384),o=a(6427),u=a(7723),m=a(1113),d=a(5459),p=a(3883),h=a(3022),g=a(1609),v=a.n(g),f=a(4923),w=a(8242),E=a(4526),k=a(1524),y=a(3614),A=a(9084);const __=u.__;function b({value:e,currency:t,isOld:a}){if(!e||!t)return null;const r=(0,n.vA)(e,t),s=(0,h.A)(A.A.price,{[A.A["is-old"]]:a});return v().createElement(c.Ay,{className:s,variant:"headline-medium",component:"p"},v().createElement(c.Ay,{component:"sup",variant:"title-medium"},r.symbol),r.integer,v().createElement(c.Ay,{component:"sup",variant:"title-medium"},r.fraction))}const j=({slug:e,onClick:t,trackButtonClick:a=()=>{},className:n,preferProductName:j,supportingInfo:R,ctaButtonLabel:C=null,hideTOS:_=!1,quantity:x=null,highlightLastFeature:N=!1,isFetching:z=!1})=>{const{fileSystemWriteAccess:M="no",siteSuffix:S="",adminUrl:L="",myJetpackCheckoutUri:V=""}=(0,w.A$)(),{detail:P}=(0,f.A)(e),{name:H,title:B,longDescription:O,features:I,disclaimers:T,pricingForUi:F,isBundle:U,supportedProducts:D,hasPaidPlanForProduct:q,status:J,pluginSlug:G,postCheckoutUrl:$}=P,W="plugin_absent"===J&&"no"===M,{isFree:Q,trialAvailable:K,fullPricePerMonth:Z,currencyCode:Y,discountPricePerMonth:X,wpcomProductSlug:ee,wpcomFreeProductSlug:te,introductoryOffer:ae,productTerm:ne}=F,{recordEvent:ce}=(0,E.A)(),re=!Q&&!q||null!=x,se=(0,k.y)(),ie=(0,g.useCallback)((()=>$||(se||V)),[$,se,V])(),{run:le,hasCheckoutStarted:oe}=(0,l.useProductCheckoutWorkflow)({productSlug:ee,redirectUrl:ie,siteSuffix:S,adminUrl:L,connectAfterCheckout:!0,from:"my-jetpack",quantity:x,useBlogIdSuffix:!0}),{run:ue,hasCheckoutStarted:me}=(0,l.useProductCheckoutWorkflow)({productSlug:te,redirectUrl:ie,siteSuffix:S,adminUrl:L,connectAfterCheckout:!0,from:"my-jetpack",quantity:x,useBlogIdSuffix:!0}),de=U?D.join("_plus_").split("_").map(((e,t)=>{if("plus"===e)return v().createElement(m.A,{className:A.A["plus-icon"],key:`icon-plugs${t}`,icon:d.A,size:14});const a=(0,r.Wy)(e);return v().createElement(a,{key:e,size:24})})):null;let pe;pe="month"===ae?.intervalUnit&&1===ae?.intervalCount?(0,u.sprintf)( +// translators: %s is the monthly price for a product +__("trial for the first month, then $%s /month, billed yearly","jetpack-my-jetpack"),Z):"year"===ne?__("/month, paid yearly","jetpack-my-jetpack"):__("/month","jetpack-my-jetpack",0);const he=(0,g.useCallback)((t=>{ce("jetpack_myjetpack_product_card_disclaimer_click",{id:t,product:e})}),[e,ce]);function ge({slug:e}){const t=(0,r.Wy)(e);return t?v().createElement("div",{className:A.A["product-icon"]},v().createElement(t,null)):null}const ve=(!U||U&&!q)&&K,fe=H&&j?H:B,we=!U&&q?(0,u.sprintf)(/* translators: placeholder is product name. */ +__("Install %s","jetpack-my-jetpack"),fe):(0,u.sprintf)(/* translators: placeholder is product name. */ +__("Get %s","jetpack-my-jetpack"),fe),Ee=C||we,ke=(0,g.useCallback)((()=>{a({cta_text:Ee}),t?.(le,P)}),[t,a,le,P,Ee]),ye=(0,g.useCallback)((()=>{a({custom_slug:te,cta_text:"Start for free"}),t?.(ue,P)}),[t,a,ue,te,P]);return v().createElement("div",{className:(0,h.A)(A.A.card,n,{[A.A["is-bundle-card"]]:U})},U&&v().createElement("div",{className:A.A["card-header"]},v().createElement(r.Gg,{className:A.A["product-bundle-icon"],size:16}),v().createElement(c.Ay,{variant:"label"},__("Popular upgrade","jetpack-my-jetpack"))),v().createElement("div",{className:A.A.container},U&&v().createElement("div",{className:A.A["product-bundle-icons"]},de),v().createElement(ge,{slug:e}),v().createElement(c.H3,null,fe),v().createElement(c.Ay,{mb:3},O),v().createElement("ul",{className:(0,h.A)(A.A.features,{[A.A["highlight-last-feature"]]:N})},I.map(((e,t)=>v().createElement(c.Ay,{component:"li",key:`feature-${t}`,variant:"body"},v().createElement(m.A,{icon:p.A,size:24}),e)))),re&&X&&v().createElement(v().Fragment,null,v().createElement("div",{className:A.A["price-container"]},v().createElement(b,{value:X,currency:Y,isOld:!1}),X0&&v().createElement("div",{className:A.A.disclaimers},T.map(((e,t)=>{const{text:a,link_text:n=null,url:r=null}=e;return v().createElement(c.Ay,{key:`disclaimer-${t}`,component:"p",variant:"body-small"},`${a} `,r&&n&&v().createElement(o.ExternalLink,{onClick:()=>he(t),href:r,target:"_blank",rel:"noopener noreferrer"},n))}))),U&&q&&v().createElement("div",{className:A.A["product-has-required-plan"]},v().createElement(r.Nr,{size:36}),v().createElement(c.Ay,null,__("Active on your site","jetpack-my-jetpack"))),R&&v().createElement(c.Ay,{className:A.A["supporting-info"],variant:"body-extra-small"},R)))}},3574:(e,t,a)=>{"use strict";a.d(t,{A:()=>w});var n=a(9245),c=a(489),r=a(1112),s=a(7656),i=a(7425),l=a(9384),o=a(7723),u=a(5739),m=a.n(u),d=a(1609),p=a(4923),h=a(8242),g=a(1524);const __=o.__,v=({cantInstallPlugin:e,onProductButtonClick:t,detail:a,isFetching:s,tier:i,trackProductButtonClick:u,preferProductName:m,feature:p})=>{const{siteSuffix:v="",myJetpackCheckoutUri:f=""}=(0,h.A$)(),{name:w,featuresByTier:E=[],pricingForUi:{tiers:k},title:y,postCheckoutUrl:A,postCheckoutUrlsByFeature:b,isBundle:j,hasPaidPlanForProduct:R}=a,{callToAction:C,currencyCode:_,fullPrice:x,introductoryOffer:N,isFree:z,wpcomProductSlug:M,quantity:S=null}=k[i],L=(0,g.y)(),V=(0,d.useCallback)((()=>p&&b?.[p]?b[p]:A||(L||f)),[p,b,A,L,f])(),{run:P,hasCheckoutStarted:H}=(0,l.useProductCheckoutWorkflow)({from:"my-jetpack",productSlug:M,redirectUrl:V,connectAfterCheckout:!0,siteSuffix:v,useBlogIdSuffix:!0,quantity:S}),B=x?Math.round(x/12*100)/100:null,O=N?.costPerInterval?Math.round(N.costPerInterval/12*100)/100:null,I="month"===N?.intervalUnit&&1===N?.intervalCount,T=I?(0,o.sprintf)( +// translators: %s is the monthly price for a product +__("trial for the first month, then $%s /month, billed yearly","jetpack-my-jetpack"),B):__("/month, paid yearly","jetpack-my-jetpack",0),F=w&&m?w:y,U=!j&&R?(0,o.sprintf)(/* translators: placeholder is product name. */ +__("Install %s","jetpack-my-jetpack"),F):(0,o.sprintf)(/* translators: placeholder is product name. */ +__("Get %s","jetpack-my-jetpack"),F),D=C||(z?__("Start for Free","jetpack-my-jetpack"):U),q=(0,d.useCallback)((()=>{u({is_free_plan:z,cta_text:D}),t?.(P,a,i)}),[u,t,P,a,i,z,D]);return React.createElement(n.N0,{primary:!z},React.createElement(n.i7,null,z?React.createElement(c.A,{price:0,legend:"",currency:"USD",hidePriceFraction:!0}):!R&&React.createElement(c.A,{price:B,offPrice:O,legend:T,currency:_,hideDiscountLabel:I,hidePriceFraction:!0}),React.createElement(r.A,{fullWidth:!0,variant:z?"secondary":"primary",onClick:q,isLoading:H||s,disabled:H||e||s},D)),E.map(((e,t)=>{const{included:a,description:c,struck_description:r,info:s}=e.tiers[i],l=r||c?React.createElement(React.Fragment,null,r?React.createElement(React.Fragment,null,React.createElement("del",null,r)," "):null,c?React.createElement("strong",null,c):null):null;return React.createElement(n.eY,{key:t,isIncluded:a,label:l,tooltipTitle:s?.title,tooltipInfo:s?.content?React.createElement("div",{dangerouslySetInnerHTML:{__html:s?.content}}):null,tooltipClassName:s?.class})})))};v.propTypes={cantInstallPlugin:m().bool.isRequired,onProductButtonClick:m().func.isRequired,detail:m().object.isRequired,tier:m().string.isRequired,trackProductButtonClick:m().func.isRequired,preferProductName:m().bool.isRequired};const f=({slug:e,onProductButtonClick:t,trackProductButtonClick:a,isFetching:c,preferProductName:l,feature:u})=>{const{fileSystemWriteAccess:m="no"}=(0,h.A$)(),{detail:g}=(0,p.A)(e),{description:f,featuresByTier:w=[],pluginSlug:E,status:k,tiers:y=[],hasPaidPlanForProduct:A,title:b,pricingForUi:{tiers:j}}=g,R="plugin_absent"===k&&"no"===m,C=R&&React.createElement(s.A,{level:"error",hideCloseButton:!0,title:React.createElement(i.Ay,null,(0,o.sprintf)( +// translators: %s is the plugin name. +__("Due to your server settings, we can't automatically install the plugin for you. Please manually install the %s plugin.","jetpack-my-jetpack"),b)),actions:[React.createElement(r.A,{variant:"secondary",href:`https://wordpress.org/plugins/${E}`,isExternalLink:!0},__("Get plugin","jetpack-my-jetpack"))]}),_=(0,d.useMemo)((()=>w.map((e=>({name:e?.name,tooltipTitle:e?.info?.title,tooltipInfo:e?.info?.content?React.createElement("div",{dangerouslySetInnerHTML:{__html:e?.info?.content}}):null})))),[w]);return React.createElement(React.Fragment,null,C,React.createElement(n.Ay,{title:f,items:_},y.map(((e,n)=>A&&(e=>{const{isFree:t}=j[e];return t})(e)?null:React.createElement(v,{key:n,tier:e,feature:u,detail:g,isFetching:c,onProductButtonClick:t,trackProductButtonClick:a,primary:0===n,cantInstallPlugin:R,preferProductName:l})))))};f.propTypes={slug:m().string.isRequired,onProductButtonClick:m().func.isRequired,trackProductButtonClick:m().func.isRequired,isFetching:m().bool.isRequired,preferProductName:m().bool.isRequired};const w=f},6092:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>V,B8:()=>O,C:()=>D,Gf:()=>J,JM:()=>G,QX:()=>T,X7:()=>I,og:()=>U,qT:()=>F,t7:()=>q,wU:()=>P,xE:()=>H,yX:()=>B});var n=a(2947),c=a(5918),r=a(8509),s=a(7425),i=a(1112),l=a(5879),o=a(6087),u=a(7723),m=a(3022),d=a(1609),p=a.n(d),h=a(9539),g=a(8837),v=a(9935),f=a(4923),w=a(8242),E=a(4526),k=a(3588),y=a(1870),A=a(3981),b=a(1617),j=a(4720),R=a(3574),C=a(8769),_=a(5296),x=a(4660),N=a(7642),z=a(15),M=a(9409),S=a(7899),L=a(5044);const __=u.__;function V({bundle:e,existingLicenseKeyUrl:t="admin.php?page=my-jetpack#/add-license",installsPlugin:a=!1,slug:h,supportingInfo:C,preferProductName:_=!1,children:x=null,imageContainerClassName:N="",ctaButtonLabel:z=null,hideTOS:M=!1,quantity:L=null,directCheckout:V=!1,highlightLastFeature:P=!1,ctaCallback:H=null,feature:B=null}){const{detail:O}=(0,f.A)(h),{detail:I}=(0,f.A)(e),{activate:T,isPending:F}=(0,v.A)(h);let U=O?.postActivationUrl||null;B&&O?.postActivationUrlsByFeature?.[B]&&(U=O.postActivationUrlsByFeature[B]);const{isUpgradableByBundle:D,tiers:q,pricingForUi:J}=O,{recordEvent:G}=(0,E.A)(),{onClickGoBack:$}=(0,k.L)({slug:h}),{myJetpackCheckoutUri:W=""}=(0,w.A$)(),{siteIsRegistering:Q,handleRegisterSite:K}=(0,y.A)({skipUserConnection:!0,redirectUri:U}),Z=!M&&!!e,Y=O?.title,X=I?.title,ee=[/* translators: %s is the product name */ /* translators: %s is the product name */ +(0,u.sprintf)(__("Get %s","jetpack-my-jetpack"),Y),/* translators: %s is the bundled product name */ /* translators: %s is the bundled product name */ +(0,u.sprintf)(__("Get %s","jetpack-my-jetpack"),X)];(0,d.useEffect)((()=>{G("jetpack_myjetpack_product_interstitial_view",{product:h})}),[G,h]);const te=(0,d.useCallback)(((e=!1)=>e?"":"crm"===h?"jetpack-crm":J?.tiers?.upgraded?.wpcomProductSlug?J.tiers.upgraded.wpcomProductSlug:J.wpcomProductSlug),[h,J]),ae=(0,d.useCallback)((t=>{const{customSlug:a=null,isFreePlan:n=!1,ctaText:c=null}=t||{};G("jetpack_myjetpack_product_interstitial_add_link_click",{product:a||(e??h),product_slug:te(n),cta_text:c})}),[G,h,te,e]),ne=(0,A.A)(g.NM.Home),ce=(0,d.useCallback)(((e,t,a)=>{H?.({slug:h,product:t,tier:a}),t?.isBundle||V?e?.():T({productId:h},{onSettled:n=>{let c=n?.post_checkout_url||W;B&&n?.post_checkout_urls_by_feature?.[B]&&(c=n.post_checkout_urls_by_feature[B]);const r=t?.hasPaidPlanForProduct,s=a?t?.pricingForUi?.tiers?.[a]?.isFree:t?.pricingForUi?.isFree,i=!s&&!r||a&&t?.pricingForUi?.tiers?.[a]&&!s&&t?.isUpgradable;"zero-bs-crm"!==t.pluginSlug||r?i?e?.(null,c):K().then((e=>{if(!e)return ne()})):window.location.href="https://jetpackcrm.com/pricing/"}})}),[W,B,H,h,V,T,K,ne]);return p().createElement(n.A,{showHeader:!1,showBackground:!1},p().createElement(c.A,{horizontalSpacing:3,horizontalGap:3},p().createElement(r.A,{className:S.A["product-interstitial__header"]},p().createElement(b.A,{onClick:$}),t&&p().createElement(s.Ay,{variant:"body-small"},(0,o.createInterpolateElement)(__("Already have an existing plan or license key? Get started.","jetpack-my-jetpack"),{a:p().createElement(i.A,{className:S.A["product-interstitial__license-activation-link"],href:t,variant:"link"})}))),p().createElement(r.A,null,q&&q.length?p().createElement(R.A,{slug:h,clickHandler:ce,onProductButtonClick:ce,trackProductButtonClick:ae,preferProductName:_,isFetching:F||Q,feature:B}):p().createElement(c.A,{className:D?null:S.A.container,horizontalSpacing:0,horizontalGap:0,fluid:!0},p().createElement(r.A,{sm:4,md:4,lg:7},p().createElement(j.A,{slug:h,trackButtonClick:ae,onClick:a?ce:void 0,className:D?S.A.container:null,supportingInfo:C,preferProductName:_,ctaButtonLabel:z,hideTOS:M||Z,quantity:L,highlightLastFeature:P,isFetching:F||Q})),p().createElement(r.A,{sm:4,md:4,lg:5,className:(0,m.A)(S.A.imageContainer,N)},e?p().createElement(j.A,{slug:e,trackButtonClick:ae,onClick:ce,className:D?S.A.container:null,hideTOS:M||Z,quantity:L,highlightLastFeature:P,isFetching:F}):x))),p().createElement(r.A,null,Z&&p().createElement("div",{className:S.A["tos-container"]},p().createElement(l.A,{multipleButtons:ee})))))}function P(){const e="anti-spam",{detail:t}=(0,f.A)(e),{isPluginActive:a}=t;return p().createElement(V,{slug:e,installsPlugin:!0,bundle:"security",existingLicenseKeyUrl:a?"admin.php?page=akismet-key-config":null,preferProductName:!0})}function H(){return p().createElement(V,{slug:"backup",installsPlugin:!0,bundle:"security"})}function B(){return p().createElement(V,{slug:"boost",installsPlugin:!0},p().createElement("img",{src:C,alt:"Boost"}))}function O(){return p().createElement(V,{slug:"creator",installsPlugin:!0})}function I(){return p().createElement(V,{slug:"crm",installsPlugin:!0},p().createElement("img",{src:_,alt:"CRM"}))}function T(){return p().createElement(V,{slug:"extras",installsPlugin:!0},p().createElement("img",{src:x,alt:"Extras"}))}function F(){const{feature:e}=(0,h.g)();return p().createElement(V,{slug:"protect",feature:e,installsPlugin:!0})}function U(){return p().createElement(V,{slug:"scan",installsPlugin:!0,bundle:"security"})}function D(){return p().createElement(V,{slug:"social",installsPlugin:!0},p().createElement("img",{src:z,alt:__("Image displaying logos of social media platforms supported by Jetpack Social.","jetpack-my-jetpack")}))}function q(){const{detail:e}=(0,f.A)("search");return p().createElement(V,{slug:"search",installsPlugin:!0,supportingInfo:(e?.pricingForUi?.trialAvailable?__("Jetpack Search Free supports up to 5,000 records and 500 search requests per month for free. You will be asked to upgrade to a paid plan if you exceed these limits for three continuous months.","jetpack-my-jetpack"):"")+__("For the paid plan, pricing will automatically adjust based on the number of records in your search index. If you grow into a new pricing tier, we'll let you know before your next billing cycle.","jetpack-my-jetpack")},p().createElement("img",{src:N,alt:"Search"}))}function J(){return p().createElement(V,{slug:"stats",directCheckout:!0,installsPlugin:!0,ctaButtonLabel:__("Get Stats","jetpack-my-jetpack")},p().createElement("img",{src:M,alt:__("Illustration showing the Stats feature, highlighting important statistics for your site.","jetpack-my-jetpack")}))}function G(){return p().createElement(V,{slug:"videopress",installsPlugin:!0},p().createElement("img",{src:L,alt:"VideoPress"}))}},3418:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(7723),c=a(6941),r=a.n(c),s=a(1609),i=a(6092),l=a(4923),o=a(1870),u=a(9923),m=a(1298);const __=n.__,d=r()("my-jetpack:product-interstitial:jetpack-ai");function p(){const{detail:e}=(0,l.A)("jetpack-ai");d(e);const{userConnectionData:t}=(0,o.A)(),{currentUser:a}=t,{wpcomUser:n}=a,c=`jetpack_ai_optfree_${a?.id||0}_${a?.blogId||0}_${n?.ID||0}`,r=(0,s.useCallback)((({tier:e})=>{"free"===e&&localStorage.setItem(c,!0)}),[c]);return React.createElement(i.Ay,{slug:"jetpack-ai",installsPlugin:!0,imageContainerClassName:m.A.aiImageContainer,hideTOS:!0,directCheckout:!1,ctaCallback:r,ctaButtonLabel:__("Upgrade","jetpack-my-jetpack")},React.createElement("img",{src:u,alt:"Jetpack AI"}))}},8823:(e,t,a)=>{"use strict";a.d(t,{A:()=>N});var n=a(3924),c=a(2947),r=a(5918),s=a(8509),i=a(7142),l=a(8478),o=a(7656),u=a(6427),m=a(6087),d=a(7723),p=a(1113),h=a(3883),g=a(748),v=a(5459),f=a(3022),w=a(6941),E=a.n(w),k=a(1609),y=a(4923),A=a(4526),b=a(3588),j=a(1870),R=a(3981),C=a(1617),_=a(1298);const __=d.__,x=E()("my-jetpack:product-interstitial:jetpack-ai-product-page");function N(){const{onClickGoBack:e}=(0,b.L)("jetpack-ai"),{detail:t}=(0,y.A)("jetpack-ai"),{description:a,aiAssistantFeature:w}=t,[E,N]=(0,k.useState)(!1),{isRegistered:z}=(0,j.A)(),M=__("Generate and edit content faster with Jetpack AI Assistant","jetpack-my-jetpack"),S=__("Create featured images with one click","jetpack-my-jetpack"),L=__("Optimize your titles effortlessly","jetpack-my-jetpack"),V=__("Build forms using prompts","jetpack-my-jetpack"),P=__("Get feedback on posts","jetpack-my-jetpack"),H=__("Make your writing easy to read","jetpack-my-jetpack");x(w);const{requestsCount:B=0,currentTier:O,nextTier:I,usagePeriod:T,isOverLimit:F,tierPlansEnabled:U}=w||{},D=0===O?.value,q=1===O?.value,J=!D&&!q||q&&!U,G=!q&&J&&!I&&O,$=D&&20-B>=0?20-B:0,W=J&&!D&&T,Q=J||q,K=(0,n.A)("jetpack-ai-tiers-more-requests-contact"),Z=(0,n.A)("jetpack-ai-feedback"),Y=(0,n.A)("jetpack-ai-product-page-featured-image-link"),X=(0,n.A)("jetpack-ai-product-page-title-optimization-link"),ee=(0,n.A)("jetpack-ai-product-page-form-link"),te=(0,n.A)("jetpack-ai-product-page-content-feedback-link"),ae=(0,n.A)("jetpack-ai-product-page-breve"),ne=z?"post-new.php?use_ai_block=1&_wpnonce="+window?.jetpackAi?.nonce:"#/connection",ce=__("Create new post","jetpack-my-jetpack"),re=__("Connect to Jetpack to start using the AI Assistant","jetpack-my-jetpack"),se=F&&J,ie=F&&D,le=O?.limit||0,oe=T?.requestsCount||0,ue=U?le-oe>=0?le-oe:0:oe,me=__("Requests this month","jetpack-my-jetpack"),de=__("Requests for this month","jetpack-my-jetpack"),pe=__("You've reached your request limit for this month","jetpack-my-jetpack"),he=__("You've used all your free requests","jetpack-my-jetpack"),ge=(0,d.sprintf)( +// translators: %d is the number of days left in the month. +__("Wait for %d days to reset your limit, or upgrade now to a higher tier for additional requests and keep your work moving forward.","jetpack-my-jetpack"),Math.floor((new Date(T?.nextStart||null)-new Date)/864e5)),ve=(0,m.createInterpolateElement)((0,d.sprintf)( +// translators: %d is the number of days left in the month. +__("Wait for %d days to reset your limit, per our fair usage policy.","jetpack-my-jetpack"),Math.floor((new Date(T?.nextStart||null)-new Date)/864e5)),{link:React.createElement("a",{href:(0,n.A)("ai-product-page-fair-usage-policy"),target:"_blank",rel:"noreferrer"})}),fe=U?ge:ve,we=__("Reach for More with Jetpack AI! Upgrade now for additional requests and keep your momentum going.","jetpack-my-jetpack"),Ee=(0,d.sprintf)( +// translators: %s is the next upgrade value +__("Get %s requests","jetpack-my-jetpack"),I?.value||"more"),ke=__("Upgrade now","jetpack-my-jetpack"),ye=(0,R.A)("/add-jetpack-ai"),{recordEvent:Ae}=(0,A.A)(),be=(0,k.useCallback)((()=>{Ae("jetpack_ai_upgrade_contact_us",{placement:"product-page"})}),[Ae]),je=(0,k.useCallback)((()=>{Ae("jetpack_ai_upgrade_button",{placement:"product-page",context:"my-jetpack",current_tier_slug:O?.slug||"",requests_count:B}),ye()}),[Ae,B,O,ye]),Re=(0,k.useCallback)((()=>N(!1)),[]);(0,k.useEffect)((()=>{Ae("jetpack_ai_myjetpack_product_page_view",{current_tier_slug:O?.slug||"",requests_count:B})}),[B,O?.slug,Ae]),(0,k.useEffect)((()=>{N(se||ie)}),[se,ie]);const Ce=React.createElement("span",{className:_.A["product-interstitial__new-badge"]},__("New","jetpack-my-jetpack")," ");return React.createElement(c.A,{showHeader:!1,showBackground:!0},React.createElement(r.A,{fluid:!0,horizontalSpacing:3,horizontalGap:2},React.createElement(s.A,{className:(0,f.A)(_.A["product-interstitial__section"])},React.createElement("div",{className:_.A["product-interstitial__section-wrapper-wide"]},React.createElement(C.A,{onClick:e})),React.createElement("div",{className:(0,f.A)(_.A["product-interstitial__section-wrapper-wide"],_.A["product-interstitial__product-header"])},React.createElement(i.A,null),React.createElement("div",{className:_.A["product-interstitial__product-header-name"]},__("AI Assistant","jetpack-my-jetpack")))),React.createElement(s.A,{className:(0,f.A)(_.A["product-interstitial__section"])},React.createElement("div",{className:_.A["product-interstitial__hero-section"]},React.createElement("div",{className:_.A["product-interstitial__hero-content"]},React.createElement("h1",{className:_.A["product-interstitial__hero-heading"]},a),React.createElement("div",{className:_.A["product-interstitial__hero-sub-heading"]},__("Draft, transform, translate, and alter both new and existing content leveraging the capabilities of AI, inside the block editor.","jetpack-my-jetpack")),!G&&!q&&React.createElement(u.Button,{variant:"primary",onClick:je,className:_.A["product-interstitial__hero-cta"]},__("Get more requests","jetpack-my-jetpack")),G&&React.createElement(u.Button,{variant:"primary",onClick:be,href:K,className:_.A["product-interstitial__hero-cta"]},__("Contact Us","jetpack-my-jetpack"))),React.createElement("div",{className:_.A["product-interstitial__hero-side"]},W&&React.createElement(u.Card,{className:_.A["stats-card"]},React.createElement(l.KH,null),React.createElement("div",null,React.createElement("div",{className:_.A["product-interstitial__stats-card-text"]},U?de:me),React.createElement("div",{className:_.A["product-interstitial__stats-card-value"]},ue))),Q&&React.createElement(u.Card,{className:_.A["stats-card"]},React.createElement(p.A,{icon:h.A,className:_.A["stats-card-icon-check"]}),React.createElement("div",null,React.createElement("div",{className:_.A["product-interstitial__stats-card-text"]},__("All-time requests used","jetpack-my-jetpack")),React.createElement("div",{className:_.A["product-interstitial__stats-card-value"]},B))),D&&React.createElement(u.Card,{className:_.A["stats-card"]},React.createElement(p.A,{icon:h.A,className:_.A["stats-card-icon-check"]}),React.createElement("div",null,React.createElement("div",{className:_.A["product-interstitial__stats-card-text"]},__("Free requests available","jetpack-my-jetpack")),React.createElement("div",{className:_.A["product-interstitial__stats-card-value"]},$)))))),React.createElement(s.A,{className:_.A["product-interstitial__section"]},React.createElement("div",{className:_.A["product-interstitial__section-wrapper"]},E&&React.createElement("div",{className:_.A["product-interstitial__ai-notice"]},React.createElement(o.A,{actions:U?[React.createElement(u.Button,{isPrimary:!0,onClick:je},se?Ee:ke)]:{},onClose:Re,level:se?"warning":"error",title:se?pe:he},se?fe:we)),React.createElement("h2",{className:_.A["product-interstitial__section-heading"]},__("AI Features","jetpack-my-jetpack")),React.createElement("p",{className:_.A["product-interstitial__section-sub-heading"]},__("Discover all the Jetpack features powered by AI","jetpack-my-jetpack")),React.createElement("div",{className:_.A["product-interstitial__usage-videos"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-item"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-video"]},React.createElement("iframe",{width:"280",height:"157",src:"https://videopress.com/embed/2OU6GCMs?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F07%2Fjetpack-ai-breve-poster.png%3Fw%3D560",allowFullScreen:!0,allow:"clipboard-write",title:H}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:_.A["product-interstitial__usage-videos-content"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-heading"]},H,Ce),React.createElement("div",{className:_.A["product-interstitial__usage-videos-text"]},__("Simplify your writing with AI suggestions to fix long sentences and complex words and sound more confident. As you type, check your Reading grade score to make sure it suits your audience.","jetpack-my-jetpack")),React.createElement(u.Button,{className:_.A["product-interstitial__usage-videos-link"],icon:g.A,target:"_blank",href:ae},__("Learn more","jetpack-my-jetpack")))),React.createElement("div",{className:_.A["product-interstitial__usage-videos-item"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-video"]},React.createElement("iframe",{width:"280",height:"157",src:"https://videopress.com/embed/GdXmtVtW?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fimage-37.png%3Fw%3D560",allowFullScreen:!0,allow:"clipboard-write",title:M}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:_.A["product-interstitial__usage-videos-content"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-heading"]},M),React.createElement("div",{className:_.A["product-interstitial__usage-videos-text"]},__("Use the AI block to generate content, or use our AI edit options in existing blocks. Use prompts or any of our recommended actions.","jetpack-my-jetpack")),React.createElement(u.Button,{className:_.A["product-interstitial__usage-videos-link"],icon:v.A,href:ne},z?ce:re))),React.createElement("div",{className:_.A["product-interstitial__usage-videos-item"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-video"]},React.createElement("iframe",{width:"280",height:"157",src:"https://videopress.com/embed/HJCf8cXc?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fone-click-featured-images.png%3Fw%3D560",allowFullScreen:!0,allow:"clipboard-write",title:S}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:_.A["product-interstitial__usage-videos-content"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-heading"]},S),React.createElement("div",{className:_.A["product-interstitial__usage-videos-text"]},__("Create featured images to illustrate your content and make it more engaging with just one click. Use prompts to generate adjusted new featured images.","jetpack-my-jetpack")),React.createElement(u.Button,{className:_.A["product-interstitial__usage-videos-link"],icon:g.A,target:"_blank",href:Y},__("Learn about featured images","jetpack-my-jetpack")))),React.createElement("div",{className:_.A["product-interstitial__usage-videos-item"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-video"]},React.createElement("iframe",{width:"280",height:"157",src:"https://videopress.com/embed/xjy2weWj?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F06%2Fjetpack-ai-title-optimization.png%3Fw%3D560",allowFullScreen:!0,allow:"clipboard-write",title:L}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:_.A["product-interstitial__usage-videos-content"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-heading"]},L),React.createElement("div",{className:_.A["product-interstitial__usage-videos-text"]},__("Use AI to generate title suggestions based on your content, each with an explanation of why it works better. Save time and create engaging, SEO-friendly titles.","jetpack-my-jetpack")),React.createElement(u.Button,{className:_.A["product-interstitial__usage-videos-link"],icon:g.A,target:"_blank",href:X},__("Learn about Jetpack SEO tools","jetpack-my-jetpack")))),React.createElement("div",{className:_.A["product-interstitial__usage-videos-item"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-video"]},React.createElement("iframe",{width:"280",height:"157",src:"https://videopress.com/embed/OMI3zqid?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fimage-38.png%3Fw%3D560",allowFullScreen:!0,allow:"clipboard-write",title:V}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:_.A["product-interstitial__usage-videos-content"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-heading"]},V),React.createElement("div",{className:_.A["product-interstitial__usage-videos-text"]},__("Quickly build forms using the Jetpack Forms block and AI. Use prompts to describe your form and AI will generate the elements in a few seconds.","jetpack-my-jetpack")),React.createElement(u.Button,{className:_.A["product-interstitial__usage-videos-link"],icon:g.A,target:"_blank",href:ee},__("Learn about forms","jetpack-my-jetpack")))),React.createElement("div",{className:_.A["product-interstitial__usage-videos-item"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-video"]},React.createElement("iframe",{width:"280",height:"157",src:"https://videopress.com/embed/0vb0OJm7?posterUrl=https%3A%2F%2Fjetpackme.files.wordpress.com%2F2024%2F02%2Fimage-39.png%3Fw%3D560",allowFullScreen:!0,allow:"clipboard-write",title:P}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:_.A["product-interstitial__usage-videos-content"]},React.createElement("div",{className:_.A["product-interstitial__usage-videos-heading"]},P),React.createElement("div",{className:_.A["product-interstitial__usage-videos-text"]},__("Get instant feedback on your post before publishing. AI will read your post and highlight opportunities to improve your publication.","jetpack-my-jetpack")),React.createElement(u.Button,{className:_.A["product-interstitial__usage-videos-link"],icon:g.A,target:"_blank",href:te},__("Learn more","jetpack-my-jetpack"))))))),React.createElement(s.A,{className:_.A["product-interstitial__section"]},React.createElement("div",{className:_.A["product-interstitial__section-wrapper"]},React.createElement("div",{className:_.A["product-interstitial__section-emoji"]},"👋"),React.createElement("h2",{className:_.A["product-interstitial__section-heading"]},__("Do you have any feedback?","jetpack-my-jetpack")),React.createElement("p",{className:_.A["product-interstitial__section-sub-heading"]},__("Help us improving the accuracy of our results and feel free to give us ideas for future implementations and improvements.","jetpack-my-jetpack")," ",React.createElement(u.ExternalLink,{href:Z},__("Share your feedback!","jetpack-my-jetpack")))))))}},7265:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(1040),c=a(7723),r=a(1504),s=a(280),i=a(1870),l=a(8252);const __=c.__;function o(){const{userConnectionData:e}=(0,i.A)(),t=e?.currentUser?.wpcomUser?.display_name||e?.currentUser?.wpcomUser?.login||e?.currentUser?.username,{isLoading:a,data:c}=(0,s.A)({name:r.Ck,query:{path:r.tb}}),o=(0,l.M)(c);return a?React.createElement(React.Fragment,null,__("Checking gold status…","jetpack-my-jetpack")):React.createElement(React.Fragment,null,React.createElement(n._,{tokenRedeemed:o,displayName:t}))}},9654:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(7723),c=a(1113),r=a(5788),s=a(1871),i=a(6994),l=a(1609),o=a.n(l),u=a(3),m=a(3336),d=a(3747);const __=n.__,p=({counts:e,previousCounts:t})=>o().createElement("div",{className:d.A["section-stats-highlights"]},o().createElement("h3",{className:d.A["section-title"]},o().createElement("span",null,__("7-day highlights","jetpack-my-jetpack")),o().createElement("small",{className:d.A["section-description"]},__("Compared to previous period","jetpack-my-jetpack"))),o().createElement("div",{className:d.A["cards-list"]},o().createElement(u.A,{heading:__("Views","jetpack-my-jetpack"),icon:o().createElement(c.A,{icon:m.A}),count:e?.views,previousCount:t?.views}),o().createElement(u.A,{heading:__("Visitors","jetpack-my-jetpack"),icon:o().createElement(c.A,{icon:r.A}),count:e?.visitors,previousCount:t?.visitors}),o().createElement(u.A,{heading:__("Likes","jetpack-my-jetpack"),icon:o().createElement(c.A,{icon:s.A}),count:e?.likes,previousCount:t?.likes}),o().createElement(u.A,{heading:__("Comments","jetpack-my-jetpack"),icon:o().createElement(c.A,{icon:i.A}),count:e?.comments,previousCount:t?.comments})))},3:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(6427),c=a(1113),r=a(6955),s=a(2510),i=a(3022),l=a(5739),o=a.n(l),u=a(1609),m=a.n(u),d=a(6581),p=a(3747);const h=({count:e=0,previousCount:t=0,icon:a,heading:l})=>{const o=(h=t,"number"!=typeof(u=e)||"number"!=typeof h?null:u-h);var u,h;const g=Math.abs(o),v=Number.isFinite(o)?((e,t)=>{if("number"!=typeof e||"number"!=typeof t)return null;if(0===e&&0===t)return 0;const a=e/t*100;return Math.abs(a)===1/0?100:Math.round(a)})(g,t):null;return m().createElement(n.Card,{className:p.A["stats-card"]},a&&m().createElement("div",{className:p.A["stats-card-icon"]},a),l&&m().createElement("div",{className:p.A["stats-card-heading"]},l),m().createElement("div",{className:p.A["stats-card-count"]},m().createElement("span",{className:p.A["stats-card-count-value"],title:Number.isFinite(e)?String(e):void 0},(0,d.A)(e)),null!==o?m().createElement("span",{className:(0,i.A)(p.A["stats-card-difference"],{[p.A["stats-card-difference--positive"]]:o<0,[p.A["stats-card-difference--negative"]]:o>0})},m().createElement("span",{className:p.A["stats-card-difference-icon"],title:String(o)},o<0&&m().createElement(c.A,{size:18,icon:r.A}),o>0&&m().createElement(c.A,{size:18,icon:s.A})),m().createElement("span",{className:p.A["stats-card-difference-absolute-value"]},g>9999?(0,d.A)(g):(0,d.A)(g,{})),null!==v&&m().createElement("span",{className:p.A["stats-card-difference-absolute-percentage"]},"(",v,"%)")):null))};h.propTypes={count:o().number,heading:o().node,icon:o().node,previousCount:o().number};const g=h},3336:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(6427);const c=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement(n.Path,{d:"m4 13 .67.336.003-.005a2.42 2.42 0 0 1 .094-.17c.071-.122.18-.302.329-.52.298-.435.749-1.017 1.359-1.598C7.673 9.883 9.498 8.75 12 8.75s4.326 1.132 5.545 2.293c.61.581 1.061 1.163 1.36 1.599a8.29 8.29 0 0 1 .422.689l.002.005L20 13l.67-.336v-.003l-.003-.005-.008-.015-.028-.052a9.752 9.752 0 0 0-.489-.794 11.6 11.6 0 0 0-1.562-1.838C17.174 8.617 14.998 7.25 12 7.25S6.827 8.618 5.42 9.957c-.702.669-1.22 1.337-1.563 1.839a9.77 9.77 0 0 0-.516.845l-.008.015-.002.005-.001.002v.001L4 13Zm8 3a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"}))},1035:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var n=a(7723),c=a(1609),r=a(8837),s=a(1504),i=a(4923),l=a(280),o=a(8242),u=a(4526),m=a(1870),d=a(6176),p=a(9654);const __=n.__,h=()=>{const e="stats",{blogID:t}=(0,m.A)(),{detail:a}=(0,i.A)(e),{status:n}=a,h=!!(0,o.A$)("userIsAdmin"),{data:g}=(0,l.A)({name:s.MB,query:{path:(0,s.IM)(t)}}),v=g?.past_seven_days||{},f=g?.between_past_eight_and_fifteen_days||{},{recordEvent:w}=(0,u.A)(),E=(0,c.useCallback)((()=>{w("jetpack_myjetpack_stats_card_seedetailedstats_click",{product:e})}),[w]),k=(0,c.useCallback)((()=>!(n!==r.hp.CAN_UPGRADE)),[n]),y={href:"admin.php?page=stats",label:__("View detailed stats","jetpack-my-jetpack"),onClick:E,shouldShowButton:k},A={[r.hp.ACTIVE]:{label:__("View detailed stats","jetpack-my-jetpack")},[r.hp.SITE_CONNECTION_ERROR]:{label:__("Connect Jetpack to use Stats","jetpack-my-jetpack")},[r.hp.NEEDS_FIRST_SITE_CONNECTION]:{href:`#/add-${e}`}};return React.createElement(d.A,{admin:h,slug:e,primaryActionOverride:A,secondaryAction:y,showMenu:!0},React.createElement(p.A,{counts:v,previousCounts:f}))}},7881:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(8509),c=a(7425),r=a(5879),s=a(1112),i=a(4082),l=a(7723),o=a(1609),u=a(6007),m=a(1521),d=a(4526),p=a(753),h=a(5225);const __=l.__,g=({onActivateSite:e,onUpdateWelcomeFlowExperiment:t,isActivating:a})=>{const{recordEvent:l}=(0,d.A)(),{setNotice:g,resetNotice:v}=(0,o.useContext)(u.g),f=__("Activate Jetpack in one click","jetpack-my-jetpack"),w=(0,o.useCallback)((async()=>{l("jetpack_myjetpack_welcome_banner_connect_site_click"),t((e=>({...e,isLoading:!0}))),await e(),l("jetpack_myjetpack_welcome_banner_connect_site_success");try{await(0,p.A)(),(0,i.Pg)();const{variationName:e}=await(0,i.nQ)("jetpack_my_jetpack_evaluation_recommendations_202409");t((t=>({...t,variation:e})))}finally{v(),g(m.F,v),t((e=>({...e,isLoading:!1})))}}),[e,t,l,v,g]);return React.createElement(React.Fragment,null,React.createElement(n.A,{sm:6,md:8,lg:6,className:h.A["banner-description"]},React.createElement(c.Ay,{variant:"headline-small",mb:3},__("Welcome to Jetpack!","jetpack-my-jetpack")),React.createElement(c.Ay,{variant:"body",mb:2},__("Unlock the power of your WordPress site with Jetpack, the complete toolkit for enhancing your site’s security, speed, and growth.","jetpack-my-jetpack")),React.createElement(c.Ay,{variant:"body",mb:2},__("Jetpack works behind the scenes to keep your site safe, make it lightning-fast, and to help you get more traffic.","jetpack-my-jetpack")),React.createElement(r.A,{agreeButtonLabel:f,mb:4}),React.createElement(s.A,{variant:"primary",disabled:a,isLoading:a,onClick:w},a?__("Activating…","jetpack-my-jetpack"):f)),React.createElement(n.A,{sm:6,md:8,lg:6,className:h.A["banner-image"]}))}},9230:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(8509),c=a(7425),r=a(6427),s=a(7723),i=a(5225);const __=s.__,l=()=>React.createElement(n.A,{className:i.A["banner-evaluation"]},React.createElement("div",{className:i.A["banner-loader"]},React.createElement(r.Spinner,null)),React.createElement(c.Ay,{variant:"title-medium",mb:1},__("Finding the best Jetpack tools","jetpack-my-jetpack")),React.createElement(c.Ay,{variant:"body-small"},__("We‘re crunching the numbers to find the Jetpack tools that are the best match for your site.","jetpack-my-jetpack")))},6259:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(8509),c=a(7425),r=a(1112),s=a(6427),i=a(7723),l=a(3022),o=a(1609),u=a(5225);const __=i.__,m={protect:__("Protect my site","jetpack-my-jetpack"),performance:__("Improve my site‘s performance","jetpack-my-jetpack"),audience:__("Grow my audience","jetpack-my-jetpack"),content:__("Create quality content","jetpack-my-jetpack"),unsure:__("I don‘t know","jetpack-my-jetpack")},d={protect:!1,performance:!1,audience:!1,content:!1,unsure:!1},p=({onSkipOnboarding:e,onSubmitEvaluation:t})=>{const[a,i]=(0,o.useState)(d),p=(0,o.useCallback)((e=>t=>{i((a=>({...a,[e]:t})))}),[i]),h=(0,o.useCallback)((()=>t(a)),[t,a]),g=Object.values(a).some((e=>e));return React.createElement(React.Fragment,null,React.createElement(n.A,{sm:6,md:8,lg:6,className:u.A["banner-description"]},React.createElement(c.Ay,{variant:"headline-small",mb:3},__("What would you like Jetpack to do?","jetpack-my-jetpack")),React.createElement(c.Ay,{variant:"body",mb:2},__("Jetpack does a lot. Select the items that are most important to you and we‘ll find the Jetpack tools that are the best match for your site.","jetpack-my-jetpack")),React.createElement("form",{className:u.A.form},Object.entries(m).map((([e,t])=>React.createElement(s.CheckboxControl,{key:e,className:u.A["form-checkbox"],label:t,checked:a[e],onChange:p(e)}))),React.createElement("div",{className:u.A["form-actions"]},React.createElement(r.A,{variant:"primary",text:__("See solutions","jetpack-my-jetpack"),onClick:h,disabled:!g}),React.createElement(r.A,{variant:"link",className:u.A["form-link-action"],text:__("Skip onboarding","jetpack-my-jetpack"),onClick:e})))),React.createElement(n.A,{sm:6,md:8,lg:6,className:(0,l.A)(u.A["banner-image-evaluation"],{[u.A["is-selected"]]:g})}))}},8388:(e,t,a)=>{"use strict";a.d(t,{A:()=>k});var n=a(5918),c=a(8509),r=a(1112),s=a(7723),i=a(991),l=a(3022),o=a(1609),u=a(3804),m=a(4393),d=a(9812),p=a(4526),h=a(1870),g=a(2450),v=a(7881),f=a(9230),w=a(6259),E=a(5225);const __=s.__,k=({children:e})=>{const{recordEvent:t}=(0,p.A)(),{dismissWelcomeBanner:a}=(0,d.A)(),{recommendedModules:s,submitEvaluation:k,saveEvaluationResult:y}=(0,u.A)(),{siteIsRegistered:A,siteIsRegistering:b,isUserConnected:j,isSiteConnected:R,handleRegisterSite:C}=(0,h.A)({skipUserConnection:!0}),[_,x]=(0,o.useState)(!1),[N,z]=(0,o.useState)(""),[M,S]=(0,o.useState)({isLoading:!1,variation:"control"}),L=(0,o.useMemo)((()=>!A||M.isLoading?"connection":_?"evaluation-processing":s||"treatment"!==M.variation&&(0,m.A)()?"evaluation":null),[_,s,A,M.isLoading,M.variation]);(0,o.useEffect)((()=>{N!==L&&(t("jetpack_myjetpack_welcome_banner_step_view",{current_step:L}),z(L))}),[L,N,t]);const V=(0,o.useCallback)((()=>{t("jetpack_myjetpack_welcome_banner_dismiss_click",{current_step:L,is_user_connected:j,is_site_connected:R}),a()}),[t,L,j,R,a]),P=(0,o.useCallback)((()=>{t("jetpack_myjetpack_welcome_banner_skip_recommendations_click"),a()}),[a,t]),H=(0,o.useCallback)((async e=>{const n=Object.keys(e).filter((t=>e[t]));x(!0),t("jetpack_myjetpack_welcome_banner_evaluation_submit",{goals:n});try{const e=await k(n);await y(e),a()}catch(e){x(!1)}}),[a,t,y,k]);return(0,o.useEffect)((()=>{L||a()}),[L,a]),L?React.createElement(n.A,{horizontalSpacing:6,horizontalGap:2},e&&React.createElement(c.A,null,e),React.createElement(c.A,{lg:12,className:E.A.banner},React.createElement(g.O,{className:(0,l.A)(E.A["banner-card"],"connection"===L&&E.A["is-mandatory"])},React.createElement(n.A,{horizontalSpacing:0,horizontalGap:0,className:E.A["banner-content"]},"connection"===L&&React.createElement(v.A,{onActivateSite:C,onUpdateWelcomeFlowExperiment:S,isActivating:b||M.isLoading}),"evaluation"===L&&React.createElement(w.A,{onSkipOnboarding:P,onSubmitEvaluation:H}),"evaluation-processing"===L&&React.createElement(f.A,null))),React.createElement(r.A,{className:E.A.dismiss,variant:"secondary","aria-label":__("Don’t show the welcome message again","jetpack-my-jetpack"),size:"small",icon:i.A,disabled:b,onClick:V}))):null}},8837:(e,t,a)=>{"use strict";a.d(t,{ED:()=>c,NM:()=>s,OM:()=>n,hp:()=>i,mk:()=>r});const n="my-jetpack-my-plans-manage",c="my-jetpack-my-plans-purchase",r="my-jetpack-my-plans-purchase-no-site",s={Home:"/",Connection:"/connection",AddAkismet:"/add-akismet",AddAntiSpam:"/add-anti-spam",AddBackup:"/add-backup",AddBoost:"/add-boost",AddCRM:"/add-crm",AddCreator:"/add-creator",AddJetpackAI:"/add-jetpack-ai",AddExtras:"/add-extras",AddProtect:"/add-protect/:feature?",AddScan:"/add-scan",AddSocial:"/add-social",AddSearch:"/add-search",AddVideoPress:"/add-videopress",AddStats:"/add-stats",AddLicense:"/add-license",RedeemToken:"/redeem-token"},i={ACTIVE:"active",INACTIVE:"inactive",MODULE_DISABLED:"module_disabled",SITE_CONNECTION_ERROR:"site_connection_error",ABSENT:"plugin_absent",ABSENT_WITH_PLAN:"plugin_absent_with_plan",NEEDS_PLAN:"needs_plan",NEEDS_ACTIVATION:"needs_activation",NEEDS_FIRST_SITE_CONNECTION:"needs_first_site_connection",USER_CONNECTION_ERROR:"user_connection_error",CAN_UPGRADE:"can_upgrade"}},3537:(e,t,a)=>{"use strict";a.d(t,{EX:()=>c,PG:()=>n,pv:()=>r});const n=100,c=200,r=300},6007:(e,t,a)=>{"use strict";a.d(t,{A:()=>s,g:()=>r});var n=a(1609);const c={message:"",title:null,options:{level:"info",priority:0}},r=(0,n.createContext)({currentNotice:c,setNotice:null,resetNotice:null}),s=({children:e})=>{const[t,a]=(0,n.useState)(c),s=(0,n.useCallback)((()=>{a(c)}),[]),i=(0,n.useCallback)(((e,n)=>{if(!t.message||e.options.priority>t.options.priority){const t={...e.options,onClose:e.options?.onClose||(e.options?.hideCloseButton?void 0:n)};s(),a({...e,options:t})}}),[t.message,t.options.priority,s]);return React.createElement(r.Provider,{value:{currentNotice:t,setNotice:i,resetNotice:s}},e)}},1521:(e,t,a)=>{"use strict";a.d(t,{F:()=>r});var n=a(7723),c=a(3537);const r={message:(0,n.__)("Your site has been successfully connected.","jetpack-my-jetpack"),options:{id:"site-connection-success-notice",level:"success",actions:[],priority:c.pv,hideCloseButton:!1}}},6077:(e,t,a)=>{"use strict";a.d(t,{A:()=>s,_:()=>r});var n=a(1609);const c=(0,n.createContext)({state:{},setState:()=>{}}),r=(e,t)=>{const{state:a,setState:r}=(0,n.useContext)(c),{[e]:s=t}=a;(0,n.useEffect)((()=>{void 0===a[e]&&r((a=>({...a,[e]:t})))}),[t,e,r,a]);return[s,(0,n.useCallback)((t=>{r((a=>({...a,[e]:t})))}),[e,r])]},s=({children:e})=>{const[t,a]=(0,n.useState)({});return React.createElement(c.Provider,{value:{state:t,setState:a}},e)}},1504:(e,t,a)=>{"use strict";a.d(t,{AD:()=>u,Ck:()=>j,DB:()=>r,D_:()=>x,Dz:()=>k,FW:()=>g,IM:()=>p,L6:()=>m,MB:()=>A,MD:()=>C,Md:()=>f,O2:()=>l,QO:()=>b,Sm:()=>s,_:()=>w,dB:()=>R,gw:()=>y,jE:()=>v,jf:()=>o,no:()=>d,nw:()=>E,pN:()=>_,rR:()=>i,tb:()=>c,xF:()=>h});const n="my-jetpack/v1",c=`${n}/site/purchases`,r=`${n}/site/backup/undo-event`,s=`${n}/site/backup/count-items`,i=`${n}/chat/availability`,l=`${n}/chat/authentication`,o=`${n}/site/products`,u=`${n}/site/dismiss-welcome-banner`,m=`${n}/site/recommendations/evaluation`,d=`${n}/site/recommendations/evaluation/result`,p=e=>`jetpack/v4/stats-app/sites/${e}/stats/highlights`,h="product",g="activate product",v="install product",f="available licenses",w="chat availability",E="chat authentication",k="backup history",y="backup stats",A="stats counts",b="dismiss welcome banner",j="purchases",R="evaluate site recommendations",C="save site evaluation result",_="remove site evaluation result",x={ANTI_SPAM:"anti-spam",BACKUP:"backup",BOOST:"boost",CRM:"crm",CREATOR:"creator",EXTRAS:"extras",JETPACK_AI:"jetpack-ai",SCAN:"scan",SEARCH:"search",SOCIAL:"social",SECURITY:"security",PROTECT:"protect",VIDEOPRESS:"videopress",STATS:"stats"}},3804:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(7723),c=a(1609),r=a(6077),s=a(4526),i=a(1504),l=a(929),o=a(8242),u=a(4393),m=a(9812);const __=n.__,d=()=>{const{recordEvent:e}=(0,s.A)(),{isWelcomeBannerVisible:t,showWelcomeBanner:a}=(0,m.A)(),[n,d]=(0,r._)("recommendedModules",(0,o.A$)("recommendedModules").modules),p=(0,c.useMemo)((()=>{const{ownedProducts:e=[]}=(0,o.A$)("lifecycleStats");return n?.filter((t=>!e.includes(t))).slice(0,3)}),[n]),h=(0,c.useMemo)((()=>{const{dismissed:e}=(0,o.A$)("recommendedModules");return!e&&!t&&(0,u.A)()}),[t]),[g,v]=(0,r._)("recommendedModulesVisible",h&&!!p?.length),{mutate:f}=(0,l.A)({name:i.dB,query:{path:i.L6,method:"GET"},errorMessage:__("Failed to evaluate site recommendations","jetpack-my-jetpack")}),{mutate:w}=(0,l.A)({name:i.MD,query:{path:i.no,method:"POST"},errorMessage:__("Failed to save evaluation results. Please try again","jetpack-my-jetpack")}),{mutate:E}=(0,l.A)({name:i.pN,query:{path:i.no,method:"DELETE"},errorMessage:__("Failed to hide evaluation results. Please try again","jetpack-my-jetpack")});return{submitEvaluation:(0,c.useCallback)((e=>new Promise(((t,a)=>{f({queryParams:{goals:e}},{onSuccess:t,onError:a})}))),[f]),saveEvaluationResult:(0,c.useCallback)((e=>new Promise(((t,a)=>{w({data:{recommendations:e}},{onSuccess:e=>{d(e),v(!0),t()},onError:a})}))),[w,v,d]),removeEvaluationResult:(0,c.useCallback)((()=>{E({},{onSuccess:()=>{v(!1),e("jetpack_myjetpack_evaluation_recommendations_dismiss_click")}})}),[E,e,v]),redoEvaluation:(0,c.useCallback)((()=>{v(!1),a(),e("jetpack_myjetpack_evaluation_recommendations_redo_click")}),[e,v,a]),recommendedModules:p,isSectionVisible:g}}},2447:(e,t,a)=>{"use strict";a.d(t,{M:()=>o});var n=a(7723),c=a(1609),r=a(3537),s=a(6007),i=a(1504);const __=n.__,l=[i.Ck,i.FW,i.jE],o=({infoName:e,isError:t,overrideMessage:a})=>{const{setNotice:i}=(0,c.useContext)(s.g),o=a??(0,n.sprintf)( +// translators: %s is the name of the information being fetched, e.g. "site purchases". +__("There was an error fetching your %s information. Check your site connectivity and try again.","jetpack-my-jetpack"),e);(0,c.useEffect)((()=>{t&&l.includes(e)&&i({message:o,options:{id:"fetching-error-notice",level:"error",priority:r.PG}})}),[o,i,t,e])}},9935:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(7723),c=a(4526),r=a(1504),s=a(929),i=a(8242),l=a(4923);const __=n.__,o=e=>{const{detail:t,refetch:a}=(0,l.A)(e),{recordEvent:o}=(0,c.A)(),{mutate:u,isPending:m}=(0,s.A)({name:r.FW,query:{path:`${r.jf}/${e}`,method:"POST"},options:{onSuccess:()=>{(e=>{const{standalonePluginInfo:t,isPluginActive:a}=e;return t?.hasStandalonePlugin?t?.isStandaloneActive:a})(t)||(o("jetpack_myjetpack_product_activated",{product:e}),(e=>{const{items:t}=(0,i.A$)("products");t[e]?.standalone_plugin_info.has_standalone_plugin&&(window.myJetpackInitialState.products.items[e].standalone_plugin_info.is_standalone_active=!0,window.myJetpackInitialState.products.items[e].standalone_plugin_info.is_standalone_installed=!0)})(e)),a()}},errorMessage:(0,n.sprintf)( +// translators: %$1s: Jetpack Product name +__("Failed to activate %1$s. Please try again","jetpack-my-jetpack"),t.name)});return{activate:u,isPending:m}}},4367:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(7723),c=a(1504),r=a(929),s=a(4923);const __=n.__,i=e=>{const{detail:t,refetch:a}=(0,s.A)(e),{mutate:i,isPending:l}=(0,r.A)({name:c.jE,query:{path:`${c.jf}/${e}/install-standalone`,method:"POST"},options:{onSuccess:a},errorMessage:(0,n.sprintf)( +// translators: %$1s: Jetpack Product name +__("Failed to install standalone plugin for %1$s. Please try again","jetpack-my-jetpack"),t.name)});return{install:i,isPending:l}}},4923:(e,t,a)=>{"use strict";a.d(t,{A:()=>u,V:()=>l});var n=a(1609),c=a(1504),r=a(280),s=a(8242),i=a(8405);const l=()=>{const{items:e}=(0,s.A$)("products");return e?Object.entries(e).reduce(((e,[t,a])=>({...e,[t]:o(a)})),{}):{}},o=e=>{const t=(0,i.A)(e);return t.features=t.features||[],t.supportedProducts=t.supportedProducts||[],t.pricingForUi.fullPricePerMonth=(e=>"year"===e.pricingForUi.productTerm?Math.round(e.pricingForUi.fullPrice/12*100)/100:e.pricingForUi.fullPrice)(t),t.pricingForUi.discountPricePerMonth=(e=>"year"===e.pricingForUi.productTerm?Math.round(e.pricingForUi.discountPrice/12*100)/100:e.pricingForUi.discountPrice)(t),t},u=e=>{const t=l(),a=t?.[e],{refetch:s,isLoading:i}=(e=>(0,r.A)({name:`${c.xF}${e}`,query:{path:`${c.jf}/${e}`},options:{enabled:!1}}))(e);return{detail:a,refetch:(0,n.useCallback)((()=>(async(e,t)=>{const{data:a}=await t();window.myJetpackInitialState.products.items[e]=a})(e,s)),[e,s]),isLoading:i}}},357:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(5932),c=a(5104),r=a(2447),s=a(8242);const i=({name:e,queryFn:t,errorMessage:a})=>{const i=(0,c.I)({queryKey:[e],queryFn:()=>{const{apiRoot:e,apiNonce:a}=(0,s.qG)();return n.Ay.setApiRoot(e),n.Ay.setApiNonce(a),t(n.Ay)},refetchOnWindowFocus:!1,refetchIntervalInBackground:!1}),{isError:l,isLoading:o}=i;return(0,r.M)({infoName:e,isError:!o&&l,overrideMessage:a}),i}},929:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(4613),c=a(1455),r=a.n(c),s=a(3832),i=a(2447);const l=({name:e,query:t,options:a,errorMessage:c})=>{const l=(0,n.n)({mutationKey:[e],mutationFn:e=>{const a=Object.assign({},t);return e&&"queryParams"in e&&(a.path=(0,s.addQueryArgs)(a.path,e.queryParams),delete e.queryParams),r()({...a,...e})},...a}),{isError:o,isPending:u}=l;return(0,i.M)({infoName:e,isError:!u&&o,overrideMessage:c}),l}},280:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(5104),c=a(1455),r=a.n(c),s=a(2447);const i=({name:e,query:t,options:a,errorMessage:c})=>{const i=(0,n.I)({queryKey:[e],queryFn:()=>r()(t),refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,...a}),{error:l,isError:o,isLoading:u}=i;return(0,s.M)({infoName:e,isError:!u&&o&&"not_connected"!==l.code,overrideMessage:c}),i}},4:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n=e=>{if(!e)return"unknown";const{modules:t,purchases:a,jetpackPlugins:n,isSiteConnected:c,isUserConnected:r}=e;return 0===a.length&&t.length<3?r&&c||0!==t.length||1!==n.length?"new":"brand-new":1===a.length&&t.length<10?"settling-in":"established"}},8242:(e,t,a)=>{"use strict";a.d(t,{A$:()=>n,SF:()=>r,qG:()=>c});const n=e=>e?window?.myJetpackInitialState?.[e]??{}:window?.myJetpackInitialState,c=()=>window?.myJetpackRest??{},r=e=>e?window?.JP_CONNECTION_INITIAL_STATE?.[e]??{}:window?.JP_CONNECTION_INITIAL_STATE},8117:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(8837);const c=e=>Object.values(e).filter((({requiresUserConnection:e,status:t})=>e&&(t===n.hp.ACTIVE||n.hp.USER_CONNECTION_ERROR))).map((({name:e})=>e))},4393:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(4),c=a(8242);const r=()=>{const e=(0,c.A$)("lifecycleStats");return["unknown","brand-new","new"].includes((0,n.A)(e))}},8405:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const n=e=>Array.isArray(e)?e.map((e=>n(e))):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map((([e,t])=>[e.replace(/([-_][a-z])/gi,(e=>e.toUpperCase().replace(/[-_]/g,""))),n(t)]))):e,c=n},9812:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(7723),c=a(1609),r=a(6077),s=a(1504),i=a(929),l=a(8242);const __=n.__,o=()=>{const{redBubbleAlerts:e}=(0,l.A$)(),[t,a]=(0,r._)("isWelcomeBannerVisible",Object.keys(e).includes("welcome-banner-active")),{mutate:n}=(0,i.A)({name:s.QO,query:{path:s.AD,method:"POST"},errorMessage:__("Failed to dismiss the welcome banner. Please try again","jetpack-my-jetpack")});return{dismissWelcomeBanner:(0,c.useCallback)((()=>{n(null,{onSuccess:()=>a(!1)})}),[n,a]),showWelcomeBanner:(0,c.useCallback)((()=>{a(!0)}),[a]),isWelcomeBannerVisible:t}}},4526:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(372),c=a(1609),r=a(8242),s=a(1870);const i=()=>{const{isUserConnected:e,isSiteConnected:t,connectedPlugins:a,userConnectionData:i={}}=(0,s.A)(),{login:l,ID:o}=i.currentUser?.wpcomUser||{},{myJetpackVersion:u=""}=(0,r.A$)();(0,c.useEffect)((()=>{e&&o&&l&&n.A.initialize(o,l)}),[o,e,l]);const m=Object.keys(a||{}).sort().join(",").replaceAll("jetpack-","");return{recordEvent:(0,c.useCallback)(((a,c)=>{n.A.tracks.recordEvent(a,{...c,version:u,is_site_connected:t,is_user_connected:e,referring_plugins:m})}),[])}}},3588:(e,t,a)=>{"use strict";a.d(t,{L:()=>i});var n=a(1609),c=a(8837),r=a(4526),s=a(3981);function i({slug:e}){const{recordEvent:t}=(0,r.A)(),a=(0,s.A)(c.NM.Home);return{onClickGoBack:(0,n.useCallback)((n=>{e&&t("jetpack_myjetpack_product_interstitial_back_link_click",{product:e}),document.referrer.includes(window.location.host)&&(n.preventDefault(),a())}),[t,e,a])}}},1870:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(9384),c=a(8242);const r=({skipUserConnection:e=!1,redirectUri:t=""}={})=>{const{apiRoot:a,apiNonce:r}=(0,c.qG)(),{topJetpackMenuItemUrl:s,blogID:i}=(0,c.A$)(),{registrationNonce:l}=(0,c.SF)(),o=(0,n.useConnection)({apiRoot:a,apiNonce:r,registrationNonce:l,skipUserConnection:e,from:"my-jetpack",redirectUri:t,autoTrigger:!1}),u=o.isRegistered,m=o.isRegistered;return{apiNonce:r,apiRoot:a,blogID:i,registrationNonce:l,...o,isSiteConnected:u,siteIsRegistered:m,topJetpackMenuItemUrl:s}}},3981:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(1609),c=a(9539);function r(e){const t=(0,c.Zp)();return(0,n.useCallback)((a=>t(e,a)),[t,e])}},5994:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(28);const c=()=>{const[e]=(0,n.ok)(),t=e.get("returnTo");return t?`admin.php?page=my-jetpack#/${t}`:"admin.php?page=my-jetpack"}},7436:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(8242),c=a(5048),r=a(8245),s=a(3711),i=a(2963);const l=()=>{const{redBubbleAlerts:e}=(0,n.A$)();(0,c.A)(e),(0,i.A)(e),(0,r.A)(),(0,s.A)(e)}},5048:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(7723),c=a(1609),r=a(3537),s=a(6007),i=a(4526);const __=n.__,l=e=>{const{setNotice:t}=(0,c.useContext)(s.g),{recordEvent:a}=(0,i.A)();(0,c.useEffect)((()=>{const c=Object.keys(e).filter((e=>e.endsWith("-bad-installation")));if(0===c.length)return;const s=e[c[0]],{plugin:i}=s.data,l=(0,n.sprintf)( +// translators: %s is the name of the plugin that has a bad installation. +__("Your installation of %1$s is incomplete. If you installed %1$s from GitHub, please refer to the developer documentation to set up your development environment.","jetpack-my-jetpack"),i),o={id:"bad-installation-notice",level:"error",actions:[{label:__("See documentation","jetpack-my-jetpack"),onClick:()=>{window.open("https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md"),a("jetpack_my_jetpack_bad_installation_notice_cta_click",{plugin:i})},noDefaultClasses:!0}],priority:r.EX};t({message:l,options:o})}),[e,t,a])}},8245:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var n=a(8509),c=a(7425),r=a(9384),s=a(7723),i=a(1609),l=a(3537),o=a(6007),u=a(4526);const __=s.__,m=()=>{const{setNotice:e,currentNotice:t}=(0,i.useContext)(o.g),{hasConnectionError:a,connectionErrorMessage:m}=(0,r.useConnectionErrorNotice)(),{restoreConnection:d,isRestoringConnection:p,restoreConnectionError:h}=(0,r.useRestoreConnection)(),{recordEvent:g}=(0,u.A)();(0,i.useEffect)((()=>{if(!a)return;let t=m;h&&(t=React.createElement(n.A,null,React.createElement(c.Ay,{mb:2},(0,s.sprintf)(/* translators: placeholder is the error. */ +__("There was an error reconnecting Jetpack. Error: %s","jetpack-my-jetpack"),h)),React.createElement(c.Ay,{mb:2},m)));const r=__("Reconnecting Jetpack…","jetpack-my-jetpack"),i={id:"connection-error-notice",level:"error",actions:[{label:__("Restore Connection","jetpack-my-jetpack"),onClick:()=>{d(),g("jetpack_my_jetpack_connection_error_notice_reconnect_cta_click")},isLoading:p,loadingText:r,noDefaultClasses:!0}],priority:l.pv+(p?1:0)};e({message:t,options:i})}),[e,g,a,m,d,p,h,t.options.priority])}},3711:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(1609),c=a(3537),r=a(6007);const s=e=>{const{setNotice:t,resetNotice:a}=(0,n.useContext)(r.g);(0,n.useEffect)((()=>{const n=Object.keys(e).filter((e=>e.endsWith("-deprecate-feature")));if(0===n.length)return;const r=e[n[0]],{text:s,link:i,id:l}=r.data,o={id:"deprecate-feature-notice",level:"error",actions:[{label:i.label,onClick:()=>{window.open(i.url)},noDefaultClasses:!0}],hideCloseButton:!1,onClose:()=>{document.cookie=`jetpack_deprecate_dismissed[${l}]=1; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=None;`,delete e[n[0]],a()},priority:c.EX};t({message:s,options:o})}),[e,t,a])}},2963:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var n=a(8509),c=a(7425),r=a(5879),s=a(7723),i=a(1609),l=a(8837),o=a(3537),u=a(6007),m=a(1521),d=a(4923),p=a(8117),h=a(4526),g=a(1870),v=a(3981);const __=s.__,f=e=>{const{recordEvent:t}=(0,h.A)(),{setNotice:a,resetNotice:f}=(0,i.useContext)(u.g),{handleRegisterSite:w,siteIsRegistering:E}=(0,g.A)({skipUserConnection:!0}),k=(0,d.V)(),y=(0,v.A)(l.NM.Connection),A="missing-connection",b=e[A];(0,i.useEffect)((()=>{if(!b)return;const i=(0,p.A)(k),l="user"===b.type,u=(0,s.sprintf)(/* translators: placeholder is product name. */ +__("Jetpack %s needs a user connection to WordPress.com to be able to work.","jetpack-my-jetpack"),i[0]),d={message:1===i.length?u:__("Some products need a user connection to WordPress.com to be able to work.","jetpack-my-jetpack"),buttonLabel:__("Connect your user account","jetpack-my-jetpack"),title:__("Missing user connection","jetpack-my-jetpack")},h={message:__("Some products need a connection to WordPress.com to be able to work.","jetpack-my-jetpack"),buttonLabel:__("Connect your site","jetpack-my-jetpack"),title:__("Missing site connection","jetpack-my-jetpack")},g={id:A,level:b.is_error?"error":"info",actions:[{label:l?d.buttonLabel:h.buttonLabel,isLoading:E,loadingText:__("Connecting…","jetpack-my-jetpack"),onClick:()=>{l&&(t("jetpack_my_jetpack_user_connection_notice_cta_click"),y()),t("jetpack_my_jetpack_site_connection_notice_cta_click"),w().then((()=>{a(m.F,f),delete e[A],window.myJetpackInitialState.redBubbleAlerts=e}))},noDefaultClasses:!0}],priority:o.pv+(E?1:0),isRedBubble:!0,tracksArgs:{type:b.type,is_error:b.is_error}},v=l?d.message:React.createElement(n.A,null,React.createElement(c.Ay,{mb:2},h.message),React.createElement(r.A,{agreeButtonLabel:h.buttonLabel}));a({message:v,title:l?d.title:h.title,options:g})}),[w,y,k,t,e,f,a,E,b])}},1413:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(1609);const c=(e,t)=>{(0,n.useEffect)((()=>{const a=a=>{a.target instanceof Element&&e.current&&!e.current.contains(a.target)&&t(a)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}}),[e,t])}},1524:(e,t,a)=>{"use strict";function n(){const e=window.location.search;return new URLSearchParams(e).has("redirect_to_referrer","1")&&""!==document.referrer?document.referrer:null}a.d(t,{y:()=>n})},6581:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(7975);const c={maximumFractionDigits:1,notation:"compact"},r=(e,t=c)=>null!==e&&Number.isFinite(e)?(0,n.A)(e,t):"-"},2753:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n=e=>{const t=Math.floor(3600*e),a=Math.floor(t/60);e=Math.floor(e);const n=Math.floor(e/24),c=Math.floor(n/365);return c>0?`${c}y ${n%365}d`:n>0?`${n}d ${e%24}h`:e>0?`${e}h ${a%60}m`:a>0?`${a}m ${t%60}s`:`${Math.floor(t)}s`}},6256:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(3924),c=a(8837),r=a(8242);const s=()=>{const{siteSuffix:e="",blogID:t}=(0,r.A$)();return(0,n.A)(c.OM,{site:t??e})}},3542:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(3924),c=a(8837),r=a(8242);const s=()=>{const{siteSuffix:e="",blogID:t,myJetpackCheckoutUri:a,lifecycleStats:s}=(0,r.A$)(),{isSiteConnected:i,isUserConnected:l}=s,o=i&&l?c.ED:c.mk;return(0,n.A)(o,(()=>{const n=a?`redirect_to=${a}`:null;return i&&l?{site:t??e,query:n}:{query:n}})())}},3658:(e,t,a)=>{"use strict";a.d(t,{w:()=>c});var n=a(8242);const c=()=>{const{plugins:e}=(0,n.A$)()||{},t=Object.values(e).find((e=>"Jetpack"===e?.Name));return t&&t.active}},8252:(e,t,a)=>{"use strict";a.d(t,{M:()=>c,b:()=>n});const n=({partner_slug:e})=>!!e&&"goldenticket"===e;function c(e){return!!Array.isArray(e)&&e.filter((e=>n(e))).length>0}},2434:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});const n=/\s+(\S*)$/,c=(e,t=2)=>((e,t)=>{let a=0;if(e&&e.length>0){let c=e,r="";for(;a{"use strict";function n(){return window._tkq=window._tkq||[],e=`//stats.wp.com/w.js?${function(){const e=new Date,t=e.getFullYear(),a=new Date(t,0,1),n=Math.floor((e.getTime()-a.getTime())/864e5);return`${t}${Math.ceil((n+a.getDay()+1)/7).toString().padStart(2,"0")}`}()}`,new Promise(((t,a)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>{a(new Error(`Failed to load script: ${e}`))},document.head.appendChild(n)}));var e}a.d(t,{A:()=>n})},4542:(e,t,a)=>{"use strict";a.d(t,{_:()=>c});var n=a(7723);const _n=n._n,__=n.__;function c(e){const t=new Date,a=6e4*t.getTimezoneOffset(),c=Math.floor((new Date(t.getTime()+a).getTime()-e)/1e3);let r=c/31536e3;return r>1?(0,n.sprintf)( +// translators: placeholder is a number amount of years i.e. "5 years ago". +_n("%s year ago","%s years ago",Math.floor(r),"jetpack-my-jetpack"),Math.floor(r)):(r=c/2592e3,r>1?(0,n.sprintf)( +// translators: placeholder is a number amount of months i.e. "5 months ago". +_n("%s month ago","%s months ago",Math.floor(r),"jetpack-my-jetpack"),Math.floor(r)):(r=c/86400,r>1?(0,n.sprintf)( +// translators: placeholder is a number amount of days i.e. "5 days ago". +_n("%s day ago","%s days ago",Math.floor(r),"jetpack-my-jetpack"),Math.floor(r)):(r=c/3600,r>1?(0,n.sprintf)( +// translators: placeholder is a number amount of hours i.e. "5 hours ago". +_n("%s hour ago","%s hours ago",Math.floor(r),"jetpack-my-jetpack"),Math.floor(r)):(r=c/60,r>1?(0,n.sprintf)( +// translators: placeholder is a number amount of minutes i.e. "5 minutes ago". +_n("%s minute ago","%s minutes ago",Math.floor(r),"jetpack-my-jetpack"),Math.floor(r)):__("a few seconds ago","jetpack-my-jetpack")))))}},6309:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-license-activation-with-lock-cef570e11997f185e23d.png"},7139:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-license-activation-with-success-c5c132e713a79e05985f.png"},2822:(e,t,a)=>{"use strict";e.exports=a.p+"images/apple-92dacafad84e79708a74.svg"},8395:(e,t,a)=>{"use strict";e.exports=a.p+"images/connect-c399837fe1621b176d10.png"},5975:(e,t,a)=>{"use strict";e.exports=a.p+"images/github-45c648158e3e86b560f5.svg"},5519:(e,t,a)=>{"use strict";e.exports=a.p+"images/google-dec2a429bf1d8e83f9ad.svg"},6579:(e,t,a)=>{"use strict";e.exports=a.p+"images/wordpress-1fc3e0ba6c52e9707900.svg"},5042:(e,t,a)=>{"use strict";e.exports=a.p+"images/cloud-81ac85ba680343200f54.svg"},3168:(e,t,a)=>{"use strict";e.exports=a.p+"images/empty-avatar-fea23feddfa99b07c2e8.svg"},7757:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-gray-7eeb5eb060c8adea8622.svg"},7319:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-9de1caef5eb5c22da5d6.svg"},4576:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-manage-3a7ecaa604823c98c3cf.svg"},6068:(e,t,a)=>{"use strict";e.exports=a.p+"images/shield-inactive-cba3b43d918377b506e5.svg"},850:(e,t,a)=>{"use strict";e.exports=a.p+"images/shield-off-47426e7b562ef20ae513.svg"},4538:(e,t,a)=>{"use strict";e.exports=a.p+"images/shield-partial-48b279219c6389a129b9.svg"},4516:(e,t,a)=>{"use strict";e.exports=a.p+"images/shield-success-e64a26c3a6d0888fba06.svg"},8769:(e,t,a)=>{"use strict";e.exports=a.p+"images/boost-9e9a227e7e7280d0aa85.png"},5296:(e,t,a)=>{"use strict";e.exports=a.p+"images/crm-8a2b204e2c720730e928.png"},4660:(e,t,a)=>{"use strict";e.exports=a.p+"images/extras-c6bd0796750901faa7fd.png"},9923:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-ai-d29bf65dcea46074d72f.png"},7642:(e,t,a)=>{"use strict";e.exports=a.p+"images/search-d177a31292d96d5ccbc2.png"},15:(e,t,a)=>{"use strict";e.exports=a.p+"images/social-b8744a40c7c19a7bcc37.png"},9409:(e,t,a)=>{"use strict";e.exports=a.p+"images/stats-95b42796ede4f632b642.png"},5044:(e,t,a)=>{"use strict";e.exports=a.p+"images/videopress-9c064bc7b89c386e5e50.png"},5990:e=>{"use strict";if(void 0==={consumer_slug:"my_jetpack"}){var t=new Error('Cannot find module \'{"consumer_slug":"my_jetpack"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"my_jetpack"}},9384:e=>{"use strict";e.exports=window.JetpackConnection},7999:e=>{"use strict";e.exports=window.JetpackScriptDataModule},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},1455:e=>{"use strict";e.exports=window.wp.apiFetch},6427:e=>{"use strict";e.exports=window.wp.components},9491:e=>{"use strict";e.exports=window.wp.compose},7143:e=>{"use strict";e.exports=window.wp.data},8443:e=>{"use strict";e.exports=window.wp.date},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives},3832:e=>{"use strict";e.exports=window.wp.url},6072:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";a.d(t,{m:()=>r});var n=a(5530),c=a(698),r=new class extends n.Q{#e;#t;#a;constructor(){super(),this.#a=e=>{if(!c.S$&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#a=e,this.#t?.(),this.#t=e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){this.listeners.forEach((e=>{e()}))}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}}},9101:(e,t,a)=>{"use strict";a.d(t,{PL:()=>c});var n=a(698);function c(e){return{onFetch:(t,a)=>{const c=async()=>{const a=t.options,c=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],l=t.state.data?.pageParams||[],o={pages:[],pageParams:[]};let u=!1;const m=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),d=async(e,a,c)=>{if(u)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);const r={queryKey:t.queryKey,pageParam:a,direction:c?"backward":"forward",meta:t.options.meta};var s;s=r,Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",(()=>{u=!0})),t.signal)});const i=await m(r),{maxPages:l}=t.options,o=c?n.ZZ:n.y9;return{pages:o(e.pages,i,l),pageParams:o(e.pageParams,a,l)}};let p;if(c&&i.length){const e="backward"===c,t={pages:i,pageParams:l},n=(e?s:r)(a,t);p=await d(t,n,e)}else{p=await d(o,l[0]??a.initialPageParam);const t=e??i.length;for(let e=1;et.options.persister?.(c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},a):t.fetchFn=c}}}function r(e,{pages:t,pageParams:a}){const n=t.length-1;return e.getNextPageParam(t[n],t,a[n],a)}function s(e,{pages:t,pageParams:a}){return e.getPreviousPageParam?.(t[0],t,a[0],a)}},4352:(e,t,a)=>{"use strict";a.d(t,{$:()=>i,s:()=>s});var n=a(1795),c=a(1450),r=a(4610),s=class extends c.k{#n;#c;#r;#s;constructor(e){super(),this.mutationId=e.mutationId,this.#c=e.defaultOptions,this.#r=e.mutationCache,this.#n=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter((t=>t!==e)),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>(this.#s=(0,r.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.#s.promise),a="pending"===this.state.status;try{if(!a){this.#i({type:"pending",variables:e}),await(this.#r.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#i({type:"pending",context:t,variables:e})}const n=await t();return await(this.#r.config.onSuccess?.(n,e,this.state.context,this)),await(this.options.onSuccess?.(n,e,this.state.context)),await(this.#r.config.onSettled?.(n,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(n,null,e,this.state.context)),this.#i({type:"success",data:n}),n}catch(t){try{throw await(this.#r.config.onError?.(t,e,this.state.context,this)),await(this.options.onError?.(t,e,this.state.context)),await(this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,t,e,this.state.context)),t}finally{this.#i({type:"error",error:t})}}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,r.v_)(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.j.batch((()=>{this.#n.forEach((t=>{t.onMutationUpdate(e)})),this.#r.notify({mutation:this,type:"updated",action:e})}))}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},7708:(e,t,a)=>{"use strict";a.d(t,{q:()=>i});var n=a(1795),c=a(4352),r=a(698),s=a(5530),i=class extends s.Q{constructor(e={}){super(),this.config=e,this.#l=[],this.#o=0}#l;#o;#u;build(e,t,a){const n=new c.s({mutationCache:this,mutationId:++this.#o,options:e.defaultMutationOptions(t),state:a});return this.add(n),n}add(e){this.#l.push(e),this.notify({type:"added",mutation:e})}remove(e){this.#l=this.#l.filter((t=>t!==e)),this.notify({type:"removed",mutation:e})}clear(){n.j.batch((()=>{this.#l.forEach((e=>{this.remove(e)}))}))}getAll(){return this.#l}find(e){const t={exact:!0,...e};return this.#l.find((e=>(0,r.nJ)(t,e)))}findAll(e={}){return this.#l.filter((t=>(0,r.nJ)(e,t)))}notify(e){n.j.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){return this.#u=(this.#u??Promise.resolve()).then((()=>{const e=this.#l.filter((e=>e.state.isPaused));return n.j.batch((()=>e.reduce(((e,t)=>e.then((()=>t.continue().catch(r.lQ)))),Promise.resolve())))})).then((()=>{this.#u=void 0})),this.#u}}},4158:(e,t,a)=>{"use strict";a.d(t,{_:()=>i});var n=a(4352),c=a(1795),r=a(5530),s=a(698),i=class extends r.Q{#m;#d=void 0;#p;#h;constructor(e,t){super(),this.#m=e,this.setOptions(t),this.bindMethods(),this.#g()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#m.defaultMutationOptions(e),(0,s.f8)(t,this.options)||this.#m.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#p,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.EN)(t.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():this.#p?.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#p?.removeObserver(this)}onMutationUpdate(e){this.#g(),this.#v(e)}getCurrentResult(){return this.#d}reset(){this.#p?.removeObserver(this),this.#p=void 0,this.#g(),this.#v()}mutate(e,t){return this.#h=t,this.#p?.removeObserver(this),this.#p=this.#m.getMutationCache().build(this.#m,this.options),this.#p.addObserver(this),this.#p.execute(e)}#g(){const e=this.#p?.state??(0,n.$)();this.#d={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#v(e){c.j.batch((()=>{if(this.#h&&this.hasListeners()){const t=this.#d.variables,a=this.#d.context;"success"===e?.type?(this.#h.onSuccess?.(e.data,t,a),this.#h.onSettled?.(e.data,null,t,a)):"error"===e?.type&&(this.#h.onError?.(e.error,t,a),this.#h.onSettled?.(void 0,e.error,t,a))}this.listeners.forEach((e=>{e(this.#d)}))}))}}},1795:(e,t,a)=>{"use strict";a.d(t,{j:()=>n});var n=function(){let e=[],t=0,a=e=>{e()},n=e=>{e()},c=e=>setTimeout(e,0);const r=n=>{t?e.push(n):c((()=>{a(n)}))},s=()=>{const t=e;e=[],t.length&&c((()=>{n((()=>{t.forEach((e=>{a(e)}))}))}))};return{batch:e=>{let a;t++;try{a=e()}finally{t--,t||s()}return a},batchCalls:e=>(...t)=>{r((()=>{e(...t)}))},schedule:r,setNotifyFunction:e=>{a=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{c=e}}}()},5873:(e,t,a)=>{"use strict";a.d(t,{t:()=>r});var n=a(5530),c=a(698),r=new class extends n.Q{#f=!0;#t;#a;constructor(){super(),this.#a=e=>{if(!c.S$&&window.addEventListener){const t=()=>e(!0),a=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#a=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#f!==e&&(this.#f=e,this.listeners.forEach((t=>{t(e)})))}isOnline(){return this.#f}}},4135:(e,t,a)=>{"use strict";a.d(t,{X:()=>i});var n=a(698),c=a(1795),r=a(4610),s=a(1450),i=class extends s.k{#w;#E;#k;#y;#s;#n;#c;#A;constructor(e){super(),this.#A=!1,this.#c=e.defaultOptions,this.#b(e.options),this.#n=[],this.#k=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#w=e.state||function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,a=void 0!==t,n=a?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:a?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=this.#w,this.scheduleGc()}get meta(){return this.options.meta}#b(e){this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.#n.length||"idle"!==this.state.fetchStatus||this.#k.remove(this)}setData(e,t){const a=(0,n.pl)(this.state.data,e,this.options);return this.#i({data:a,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),a}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#y;return this.#s?.cancel(e),t?t.then(n.lQ).catch(n.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#w)}isActive(){return this.#n.some((e=>!1!==e.options.enabled))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.#n.some((e=>e.getCurrentResult().isStale))}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,n.j3)(this.state.dataUpdatedAt,e)}onFocus(){const e=this.#n.find((e=>e.shouldFetchOnWindowFocus()));e?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){const e=this.#n.find((e=>e.shouldFetchOnReconnect()));e?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#k.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.#n.includes(e)&&(this.#n=this.#n.filter((t=>t!==e)),this.#n.length||(this.#s&&(this.#A?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#k.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.#n.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(this.state.dataUpdatedAt&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#y)return this.#s?.continueRetry(),this.#y;if(e&&this.#b(e),!this.options.queryFn){const e=this.#n.find((e=>e.options.queryFn));e&&this.#b(e.options)}const a=new AbortController,n={queryKey:this.queryKey,meta:this.meta},c=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#A=!0,a.signal)})};c(n);const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.#A=!1,this.options.persister?this.options.persister(this.options.queryFn,n,this):this.options.queryFn(n)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`))};c(s),this.options.behavior?.onFetch(s,this),this.#E=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===s.fetchOptions?.meta||this.#i({type:"fetch",meta:s.fetchOptions?.meta});const i=e=>{(0,r.wm)(e)&&e.silent||this.#i({type:"error",error:e}),(0,r.wm)(e)||(this.#k.config.onError?.(e,this),this.#k.config.onSettled?.(this.state.data,e,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#s=(0,r.II)({fn:s.fetchFn,abort:a.abort.bind(a),onSuccess:e=>{void 0!==e?(this.setData(e),this.#k.config.onSuccess?.(e,this),this.#k.config.onSettled?.(e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):i(new Error(`${this.queryHash} data is undefined`))},onError:i,onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode}),this.#y=this.#s.promise,this.#y}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:e.meta??null,fetchStatus:(0,r.v_)(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=e.error;return(0,r.wm)(a)&&a.revert&&this.#E?{...this.#E,fetchStatus:"idle"}:{...t,error:a,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),c.j.batch((()=>{this.#n.forEach((e=>{e.onQueryUpdate()})),this.#k.notify({query:this,type:"updated",action:e})}))}}},3205:(e,t,a)=>{"use strict";a.d(t,{$:()=>i});var n=a(698),c=a(4135),r=a(1795),s=a(5530),i=class extends s.Q{constructor(e={}){super(),this.config=e,this.#j=new Map}#j;build(e,t,a){const r=t.queryKey,s=t.queryHash??(0,n.F$)(r,t);let i=this.get(s);return i||(i=new c.X({cache:this,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:a,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#j.has(e.queryHash)||(this.#j.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#j.get(e.queryHash);t&&(e.destroy(),t===e&&this.#j.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){r.j.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#j.get(e)}getAll(){return[...this.#j.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>(0,n.MK)(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>(0,n.MK)(e,t))):t}notify(e){r.j.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){r.j.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){r.j.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}}},116:(e,t,a)=>{"use strict";a.d(t,{E:()=>u});var n=a(698),c=a(3205),r=a(7708),s=a(2464),i=a(5873),l=a(1795),o=a(9101),u=class{#R;#r;#c;#C;#_;#x;#N;#z;constructor(e={}){this.#R=e.queryCache||new c.$,this.#r=e.mutationCache||new r.q,this.#c=e.defaultOptions||{},this.#C=new Map,this.#_=new Map,this.#x=0}mount(){this.#x++,1===this.#x&&(this.#N=s.m.subscribe((()=>{s.m.isFocused()&&(this.resumePausedMutations(),this.#R.onFocus())})),this.#z=i.t.subscribe((()=>{i.t.isOnline()&&(this.resumePausedMutations(),this.#R.onOnline())})))}unmount(){this.#x--,0===this.#x&&(this.#N?.(),this.#N=void 0,this.#z?.(),this.#z=void 0)}isFetching(e){return this.#R.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){return this.#R.find({queryKey:e})?.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return void 0!==t?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,a){const c=this.#R.find({queryKey:e}),r=c?.state.data,s=(0,n.Zw)(t,r);if(void 0===s)return;const i=this.defaultQueryOptions({queryKey:e});return this.#R.build(this,i).setData(s,{...a,manual:!0})}setQueriesData(e,t,a){return l.j.batch((()=>this.getQueryCache().findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,a)]))))}getQueryState(e){return this.#R.find({queryKey:e})?.state}removeQueries(e){const t=this.#R;l.j.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const a=this.#R,n={type:"active",...e};return l.j.batch((()=>(a.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries(n,t))))}cancelQueries(e={},t={}){const a={revert:!0,...t},c=l.j.batch((()=>this.#R.findAll(e).map((e=>e.cancel(a)))));return Promise.all(c).then(n.lQ).catch(n.lQ)}invalidateQueries(e={},t={}){return l.j.batch((()=>{if(this.#R.findAll(e).forEach((e=>{e.invalidate()})),"none"===e.refetchType)return Promise.resolve();const a={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(a,t)}))}refetchQueries(e={},t){const a={...t,cancelRefetch:t?.cancelRefetch??!0},c=l.j.batch((()=>this.#R.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,a);return a.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(c).then(n.lQ)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const a=this.#R.build(this,t);return a.isStaleByTime(t.staleTime)?a.fetch(t):Promise.resolve(a.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,o.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}resumePausedMutations(){return this.#r.resumePausedMutations()}getQueryCache(){return this.#R}getMutationCache(){return this.#r}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#C.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#C.values()];let a={};return t.forEach((t=>{(0,n.Cp)(e,t.queryKey)&&(a={...a,...t.defaultOptions})})),a}setMutationDefaults(e,t){this.#_.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#_.values()];let a={};return t.forEach((t=>{(0,n.Cp)(e,t.mutationKey)&&(a={...a,...t.defaultOptions})})),a}defaultQueryOptions(e){if(e?._defaulted)return e;const t={...this.#c.queries,...e?.queryKey&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),void 0===t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#R.clear(),this.#r.clear()}}},3397:(e,t,a)=>{"use strict";a.d(t,{$:()=>l});var n=a(698),c=a(1795),r=a(2464),s=a(5530),i=a(4610),l=class extends s.Q{constructor(e,t){super(),this.options=t,this.#m=e,this.#M=null,this.bindMethods(),this.setOptions(t)}#m;#S=void 0;#L=void 0;#d=void 0;#V;#P;#M;#H;#B;#O;#I;#T;#F;#U=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#S.addObserver(this),o(this.#S,this.options)?this.#D():this.updateResult(),this.#q())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return u(this.#S,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return u(this.#S,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#J(),this.#G(),this.#S.removeObserver(this)}setOptions(e,t){const a=this.options,c=this.#S;if(this.options=this.#m.defaultQueryOptions(e),(0,n.f8)(a,this.options)||this.#m.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#S,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),this.#$();const r=this.hasListeners();r&&m(this.#S,c,this.options,a)&&this.#D(),this.updateResult(t),!r||this.#S===c&&this.options.enabled===a.enabled&&this.options.staleTime===a.staleTime||this.#W();const s=this.#Q();!r||this.#S===c&&this.options.enabled===a.enabled&&s===this.#F||this.#K(s)}getOptimisticResult(e){const t=this.#m.getQueryCache().build(this.#m,e),a=this.createResult(t,e);return function(e,t){if(!(0,n.f8)(e.getCurrentResult(),t))return!0;return!1}(this,a)&&(this.#d=a,this.#P=this.options,this.#V=this.#S.state),a}getCurrentResult(){return this.#d}trackResult(e){const t={};return Object.keys(e).forEach((a=>{Object.defineProperty(t,a,{configurable:!1,enumerable:!0,get:()=>(this.#U.add(a),e[a])})})),t}getCurrentQuery(){return this.#S}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#m.defaultQueryOptions(e),a=this.#m.getQueryCache().build(this.#m,t);return a.isFetchingOptimistic=!0,a.fetch().then((()=>this.createResult(a,t)))}fetch(e){return this.#D({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#d)))}#D(e){this.#$();let t=this.#S.fetch(this.options,e);return e?.throwOnError||(t=t.catch(n.lQ)),t}#W(){if(this.#J(),n.S$||this.#d.isStale||!(0,n.gn)(this.options.staleTime))return;const e=(0,n.j3)(this.#d.dataUpdatedAt,this.options.staleTime)+1;this.#I=setTimeout((()=>{this.#d.isStale||this.updateResult()}),e)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#S):this.options.refetchInterval)??!1}#K(e){this.#G(),this.#F=e,!n.S$&&!1!==this.options.enabled&&(0,n.gn)(this.#F)&&0!==this.#F&&(this.#T=setInterval((()=>{(this.options.refetchIntervalInBackground||r.m.isFocused())&&this.#D()}),this.#F))}#q(){this.#W(),this.#K(this.#Q())}#J(){this.#I&&(clearTimeout(this.#I),this.#I=void 0)}#G(){this.#T&&(clearInterval(this.#T),this.#T=void 0)}createResult(e,t){const a=this.#S,c=this.options,r=this.#d,s=this.#V,l=this.#P,u=e!==a?e.state:this.#L,{state:p}=e;let h,{error:g,errorUpdatedAt:v,fetchStatus:f,status:w}=p,E=!1;if(t._optimisticResults){const n=this.hasListeners(),r=!n&&o(e,t),s=n&&m(e,a,t,c);(r||s)&&(f=(0,i.v_)(e.options.networkMode)?"fetching":"paused",p.dataUpdatedAt||(w="pending")),"isRestoring"===t._optimisticResults&&(f="idle")}if(t.select&&void 0!==p.data)if(r&&p.data===s?.data&&t.select===this.#H)h=this.#B;else try{this.#H=t.select,h=t.select(p.data),h=(0,n.pl)(r?.data,h,t),this.#B=h,this.#M=null}catch(e){this.#M=e}else h=p.data;if(void 0!==t.placeholderData&&void 0===h&&"pending"===w){let e;if(r?.isPlaceholderData&&t.placeholderData===l?.placeholderData)e=r.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#O?.state.data,this.#O):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#M=null}catch(e){this.#M=e}void 0!==e&&(w="success",h=(0,n.pl)(r?.data,e,t),E=!0)}this.#M&&(g=this.#M,h=this.#B,v=Date.now(),w="error");const k="fetching"===f,y="pending"===w,A="error"===w,b=y&&k;return{status:w,fetchStatus:f,isPending:y,isSuccess:"success"===w,isError:A,isInitialLoading:b,isLoading:b,data:h,dataUpdatedAt:p.dataUpdatedAt,error:g,errorUpdatedAt:v,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:k,isRefetching:k&&!y,isLoadingError:A&&0===p.dataUpdatedAt,isPaused:"paused"===f,isPlaceholderData:E,isRefetchError:A&&0!==p.dataUpdatedAt,isStale:d(e,t),refetch:this.refetch}}updateResult(e){const t=this.#d,a=this.createResult(this.#S,this.options);if(this.#V=this.#S.state,this.#P=this.options,void 0!==this.#V.data&&(this.#O=this.#S),(0,n.f8)(a,t))return;this.#d=a;const c={};!1!==e?.listeners&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,a="function"==typeof e?e():e;if("all"===a||!a&&!this.#U.size)return!0;const n=new Set(a??this.#U);return this.options.throwOnError&&n.add("error"),Object.keys(this.#d).some((e=>{const a=e;return this.#d[a]!==t[a]&&n.has(a)}))})()&&(c.listeners=!0),this.#v({...c,...e})}#$(){const e=this.#m.getQueryCache().build(this.#m,this.options);if(e===this.#S)return;const t=this.#S;this.#S=e,this.#L=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#q()}#v(e){c.j.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#d)})),this.#m.getQueryCache().notify({query:this.#S,type:"observerResultsUpdated"})}))}};function o(e,t){return function(e,t){return!(!1===t.enabled||e.state.dataUpdatedAt||"error"===e.state.status&&!1===t.retryOnMount)}(e,t)||e.state.dataUpdatedAt>0&&u(e,t,t.refetchOnMount)}function u(e,t,a){if(!1!==t.enabled){const n="function"==typeof a?a(e):a;return"always"===n||!1!==n&&d(e,t)}return!1}function m(e,t,a,n){return!1!==a.enabled&&(e!==t||!1===n.enabled)&&(!a.suspense||"error"!==e.state.status)&&d(e,a)}function d(e,t){return e.isStaleByTime(t.staleTime)}},1450:(e,t,a)=>{"use strict";a.d(t,{k:()=>c});var n=a(698),c=class{#Z;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.gn)(this.gcTime)&&(this.#Z=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.S$?1/0:3e5))}clearGcTimeout(){this.#Z&&(clearTimeout(this.#Z),this.#Z=void 0)}}},4610:(e,t,a)=>{"use strict";a.d(t,{II:()=>u,v_:()=>i,wm:()=>o});var n=a(2464),c=a(5873),r=a(698);function s(e){return Math.min(1e3*2**e,3e4)}function i(e){return"online"!==(e??"online")||c.t.isOnline()}var l=class{constructor(e){this.revert=e?.revert,this.silent=e?.silent}};function o(e){return e instanceof l}function u(e){let t,a,o,u=!1,m=0,d=!1;const p=new Promise(((e,t)=>{a=e,o=t})),h=()=>!n.m.isFocused()||"always"!==e.networkMode&&!c.t.isOnline(),g=n=>{d||(d=!0,e.onSuccess?.(n),t?.(),a(n))},v=a=>{d||(d=!0,e.onError?.(a),t?.(),o(a))},f=()=>new Promise((a=>{t=e=>{const t=d||!h();return t&&a(e),t},e.onPause?.()})).then((()=>{t=void 0,d||e.onContinue?.()})),w=()=>{if(d)return;let t;try{t=e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(g).catch((t=>{if(d)return;const a=e.retry??(r.S$?0:3),n=e.retryDelay??s,c="function"==typeof n?n(m,t):n,i=!0===a||"number"==typeof a&&m{if(h())return f()})).then((()=>{u?v(t):w()}))):v(t)}))};return i(e.networkMode)?w():f().then(w),{promise:p,cancel:t=>{d||(v(new l(t)),e.abort?.())},continue:()=>{const e=t?.();return e?p:Promise.resolve()},cancelRetry:()=>{u=!0},continueRetry:()=>{u=!1}}}},5530:(e,t,a)=>{"use strict";a.d(t,{Q:()=>n});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},698:(e,t,a)=>{"use strict";a.d(t,{Cp:()=>d,EN:()=>m,F$:()=>u,MK:()=>l,S$:()=>n,ZZ:()=>y,Zw:()=>r,f8:()=>h,gn:()=>s,j3:()=>i,lQ:()=>c,nJ:()=>o,pl:()=>E,y9:()=>k,yy:()=>w});var n="undefined"==typeof window||"Deno"in window;function c(){}function r(e,t){return"function"==typeof e?e(t):e}function s(e){return"number"==typeof e&&e>=0&&e!==1/0}function i(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){const{type:a="all",exact:n,fetchStatus:c,predicate:r,queryKey:s,stale:i}=e;if(s)if(n){if(t.queryHash!==u(s,t.options))return!1}else if(!d(t.queryKey,s))return!1;if("all"!==a){const e=t.isActive();if("active"===a&&!e)return!1;if("inactive"===a&&e)return!1}return("boolean"!=typeof i||t.isStale()===i)&&((void 0===c||c===t.state.fetchStatus)&&!(r&&!r(t)))}function o(e,t){const{exact:a,status:n,predicate:c,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(a){if(m(t.options.mutationKey)!==m(r))return!1}else if(!d(t.options.mutationKey,r))return!1}return(!n||t.state.status===n)&&!(c&&!c(t))}function u(e,t){return(t?.queryKeyHashFn||m)(e)}function m(e){return JSON.stringify(e,((e,t)=>v(t)?Object.keys(t).sort().reduce(((e,a)=>(e[a]=t[a],e)),{}):t))}function d(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((a=>!d(e[a],t[a]))))}function p(e,t){if(e===t)return e;const a=g(e)&&g(t);if(a||v(e)&&v(t)){const n=a?e:Object.keys(e),c=n.length,r=a?t:Object.keys(t),s=r.length,i=a?[]:{};let l=0;for(let c=0;c{setTimeout(t,e)}))}function E(e,t,a){return"function"==typeof a.structuralSharing?a.structuralSharing(e,t):!1!==a.structuralSharing?p(e,t):t}function k(e,t,a=0){const n=[...e,t];return a&&n.length>a?n.slice(1):n}function y(e,t,a=0){const n=[t,...e];return a&&n.length>a?n.slice(0,-1):n}},7115:(e,t,a)=>{"use strict";a.d(t,{Ht:()=>i,jE:()=>s});var n=a(1609),c=a(790),r=n.createContext(void 0),s=e=>{const t=n.useContext(r);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},i=({client:e,children:t})=>(n.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),(0,c.jsx)(r.Provider,{value:e,children:t}))},9690:(e,t,a)=>{"use strict";a.d(t,{h:()=>s});var n=a(1609);a(790);function c(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var r=n.createContext(c()),s=()=>n.useContext(r)},4804:(e,t,a)=>{"use strict";a.d(t,{$1:()=>i,LJ:()=>r,wZ:()=>s});var n=a(1609),c=a(5492),r=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},s=e=>{n.useEffect((()=>{e.clearReset()}),[e])},i=({result:e,errorResetBoundary:t,throwOnError:a,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(0,c.G)(a,[e.error,n])},4796:(e,t,a)=>{"use strict";a.d(t,{w:()=>r});var n=a(1609),c=n.createContext(!1),r=()=>n.useContext(c);c.Provider},937:(e,t,a)=>{"use strict";a.d(t,{EU:()=>c,iL:()=>r,tu:()=>n});var n=e=>{e.suspense&&"number"!=typeof e.staleTime&&(e.staleTime=1e3)},c=(e,t)=>e?.suspense&&t.isPending,r=(e,t,a)=>t.fetchOptimistic(e).catch((()=>{a.clearReset()}))},4611:(e,t,a)=>{"use strict";a.d(t,{t:()=>u});var n=a(1609),c=a(1795),r=a(9690),s=a(7115),i=a(4796),l=a(4804),o=a(937);function u(e,t,a){const u=(0,s.jE)(a),m=(0,i.w)(),d=(0,r.h)(),p=u.defaultQueryOptions(e);p._optimisticResults=m?"isRestoring":"optimistic",(0,o.tu)(p),(0,l.LJ)(p,d),(0,l.wZ)(d);const[h]=n.useState((()=>new t(u,p))),g=h.getOptimisticResult(p);if(n.useSyncExternalStore(n.useCallback((e=>{const t=m?()=>{}:h.subscribe(c.j.batchCalls(e));return h.updateResult(),t}),[h,m]),(()=>h.getCurrentResult()),(()=>h.getCurrentResult())),n.useEffect((()=>{h.setOptions(p,{listeners:!1})}),[p,h]),(0,o.EU)(p,g))throw(0,o.iL)(p,h,d);if((0,l.$1)({result:g,errorResetBoundary:d,throwOnError:p.throwOnError,query:u.getQueryCache().get(p.queryHash)}))throw g.error;return p.notifyOnChangeProps?g:h.trackResult(g)}},4613:(e,t,a)=>{"use strict";a.d(t,{n:()=>l});var n=a(1609),c=a(4158),r=a(1795),s=a(7115),i=a(5492);function l(e,t){const a=(0,s.jE)(t),[l]=n.useState((()=>new c._(a,e)));n.useEffect((()=>{l.setOptions(e)}),[l,e]);const u=n.useSyncExternalStore(n.useCallback((e=>l.subscribe(r.j.batchCalls(e))),[l]),(()=>l.getCurrentResult()),(()=>l.getCurrentResult())),m=n.useCallback(((e,t)=>{l.mutate(e,t).catch(o)}),[l]);if(u.error&&(0,i.G)(l.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:m,mutateAsync:u.mutate}}function o(){}},5104:(e,t,a)=>{"use strict";a.d(t,{I:()=>r});var n=a(3397),c=a(4611);function r(e,t){return(0,c.t)(e,n.$,t)}},5492:(e,t,a)=>{"use strict";function n(e,t){return"function"==typeof e?e(...t):!!e}a.d(t,{G:()=>n})},3022:(e,t,a)=>{"use strict";function n(e){var t,a,c="";if("string"==typeof e||"number"==typeof e)c+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;tc});const c=function(){for(var e,t,a=0,c="",r=arguments.length;a{"use strict";a.d(t,{A:()=>u});var n=a(3924),c=a(6087),r=a(7723),s=a(8120),i=a(1609),l=a(1183);const __=r.__,o=e=>{const{productId:t,siteRawUrl:a}=e,r=`https://cloud.jetpack.com/landing/${a}`,s=(0,l.p)(t),o={jetpack_anti_spam:{title:__("Jetpack Anti-spam is active!","jetpack-my-jetpack"),text:__("We'll take care of everything from here. Now you can enjoy a spam-free site!","jetpack-my-jetpack")},jetpack_backup:{title:__("Jetpack Backup is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your backups and restore your site on cloud.jetpack.com. If you ever lose access to your site, you can restore it there.","jetpack-my-jetpack"),{a:i.createElement("a",{href:r})})},jetpack_complete:{title:__("Jetpack Complete is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your backups, security scans, and restore your site on cloud.jetpack.com. If you ever lose access to your site, you can restore it there.","jetpack-my-jetpack"),{a:i.createElement("a",{href:r})})},jetpack_scan:{title:__("Jetpack Scan is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your security scans on cloud.jetpack.com.","jetpack-my-jetpack"),{a:i.createElement("a",{href:r})})},jetpack_search:{title:__("Jetpack Search is active!","jetpack-my-jetpack"),text:__("Next, we'll help you customize the Search experience for your visitors.","jetpack-my-jetpack")},jetpack_security:{title:__("Jetpack Security is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your backups, security scans, and restore your site on cloud.jetpack.com. If you ever lose access to your site, you can restore it there.","jetpack-my-jetpack"),{a:i.createElement("a",{href:r})})},jetpack_videopress:{title:__("Jetpack VideoPress is active!","jetpack-my-jetpack"),text:__("Experience high-quality, ad-free video built specifically for WordPress.","jetpack-my-jetpack")},jetpack_social_advanced:{title:__("Jetpack Social Advanced is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("Create amazing link previews for your posts using Social Image Generator. Learn more here.

Learn how to make the most out of Jetpack Social here.

","jetpack-my-jetpack"),{a:i.createElement("a",{href:(0,n.A)("jetpack-social-sig-support-page"),target:"_blank",rel:"noreferrer"}),br:i.createElement("br",null),link:i.createElement("a",{href:(0,n.A)("social-plugin-publicize-support-admin-page"),target:"_blank",rel:"noreferrer"})})},jetpack_social_basic:{title:__("Jetpack Social Basic is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("Enjoy unlimited shares with Jetpack Social Basic. Learn how to make the most out of Jetpack Social here.","jetpack-my-jetpack"),{a:i.createElement("a",{href:(0,n.A)("social-plugin-publicize-support-admin-page"),target:"_blank",rel:"noreferrer"})})},default:{title:__("Your product is active!","jetpack-my-jetpack"),text:__("You're all set!","jetpack-my-jetpack")}};return i.createElement("div",{className:"jp-license-activation-screen-success-info--product-details"},i.createElement("h1",null,o[s].title," ",String.fromCodePoint(127881)),i.createElement("p",null,o[s].text))};o.propTypes={dashboardUrl:s.string,productId:s.number};const u=o},1183:(e,t,a)=>{"use strict";a.d(t,{p:()=>c});const n={jetpack_anti_spam:[2110,2111],jetpack_backup:[2100,2101,2102,2103,2112,2113,2114,2115],jetpack_complete:[2014,2015],jetpack_scan:[2106,2107,2108,2109],jetpack_search:[2104,2105],jetpack_security:[2010,2011,2012,2013,2016,2017,2019,2020],jetpack_videopress:[2116,2117],jetpack_social_advanced:[2602,2603,2604],jetpack_social_basic:[2503,2504,2037]};function c(e){return Object.keys(n).find((t=>n[t].includes(e)))||"default"}},3010:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(1455),c=a(6087);const r=async()=>(await n({path:"wp/v2/plugins"})).filter((e=>"active"===e.status));function s(){const[e,t]=(0,c.useState)([]),[a,n]=(0,c.useState)(!0),s=(0,c.useCallback)((async()=>{try{const e=await r();t(e)}catch{t([])}finally{n(!1)}}),[]);return(0,c.useEffect)((()=>{s()}),[s]),[e,a]}}},t={};function a(n){var c=t[n];if(void 0!==c)return c.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var c=n.length-1;c>-1&&(!e||!/^http(s?):/.test(e));)e=n[c--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{"use strict";var e=a(723),t=a(116),n=a(7115),c=a(6087),r=a(1609),s=a.n(r),i=a(9539),l=a(28),o=a(8848),u=a(1499),m=a(2912),d=a(6092),p=a(3418),h=a(8823),g=a(7265),v=a(8837),f=a(6007),w=a(6077),E=a(8242);a(4118);function k(){const e=(0,i.zy)();return(0,r.useEffect)((()=>window.scrollTo(0,0)),[e]),null}const y=()=>{const a=new t.E,{loadAddLicenseScreen:c}=(0,E.A$)();return s().createElement(e.Ay,null,s().createElement(f.A,null,s().createElement(w.A,null,s().createElement(n.Ht,{client:a},s().createElement(l.I9,null,s().createElement(k,null),s().createElement(i.BV,null,s().createElement(i.qh,{path:v.NM.Home,element:s().createElement(m.A,null)}),s().createElement(i.qh,{path:v.NM.Connection,element:s().createElement(u.A,null)}),s().createElement(i.qh,{path:v.NM.AddAkismet,element:s().createElement(d.wU,null)}),s().createElement(i.qh,{path:v.NM.AddAntiSpam,element:s().createElement(i.C5,{replace:!0,to:v.NM.AddAkismet})}),s().createElement(i.qh,{path:v.NM.AddBackup,element:s().createElement(d.xE,null)}),s().createElement(i.qh,{path:v.NM.AddBoost,element:s().createElement(d.yX,null)}),s().createElement(i.qh,{path:v.NM.AddCRM,element:s().createElement(d.X7,null)}),s().createElement(i.qh,{path:v.NM.AddCreator,element:s().createElement(d.B8,null)}),s().createElement(i.qh,{path:v.NM.AddJetpackAI,element:s().createElement(p.A,null)}),s().createElement(i.qh,{path:v.NM.AddExtras,element:s().createElement(d.QX,null)}),s().createElement(i.qh,{path:v.NM.AddProtect,element:s().createElement(d.qT,null)}),s().createElement(i.qh,{path:v.NM.AddScan,element:s().createElement(d.og,null)}),s().createElement(i.qh,{path:v.NM.AddSocial,element:s().createElement(d.C,null)}),s().createElement(i.qh,{path:v.NM.AddSearch,element:s().createElement(d.t7,null)}),s().createElement(i.qh,{path:v.NM.AddVideoPress,element:s().createElement(d.JM,null)}),s().createElement(i.qh,{path:v.NM.AddStats,element:s().createElement(d.Gf,null)}),c&&s().createElement(i.qh,{path:v.NM.AddLicense,element:s().createElement(o.A,null)}),s().createElement(i.qh,{path:v.NM.RedeemToken,element:s().createElement(g.A,null)}),s().createElement(i.qh,{path:"/redeem-token",element:s().createElement(g.A,null)}),s().createElement(i.qh,{path:"/jetpack-ai",element:s().createElement(h.A,null)})))))))};!function(){const e=document.getElementById("my-jetpack-container");null!==e&&(0,c.createRoot)(e).render(s().createElement(y,null))}()})()})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js.LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js.LICENSE.txt new file mode 100644 index 00000000..7a520558 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js.LICENSE.txt @@ -0,0 +1,47 @@ +/* + * Exposes number format capability + * + * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors). + * @license See CREDITS.md + * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js + */ + +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * @remix-run/router v1.2.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ + +/** + * React Router DOM v6.6.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ + +/** + * React Router v6.6.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.rtl.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.rtl.css new file mode 100644 index 00000000..abfeeeaa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.rtl.css @@ -0,0 +1 @@ +.jp-license-activation-screen-controls{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-controls h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-controls p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-controls label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-controls{padding:64px}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error{max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field .components-input-control__label.components-input-control__label.components-input-control__label,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error .components-input-control__label.components-input-control__label.components-input-control__label{font-size:var(--font-body);font-weight:600}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field select.components-select-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border-radius:var(--jp-border-radius);font-size:18px;line-height:24px;margin:0;min-height:48px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input{border:1px solid var(--jp-gray-40)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border:1px solid var(--jp-red)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error{align-items:flex-start;color:var(--jp-red);display:flex;flex-direction:row;max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error svg{margin-left:4px;fill:var(--jp-red);min-width:24px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error span{font-size:var(--font-body)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);display:flex;font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin-top:24px;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{width:auto}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:hover,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:focus,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active[disabled],.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button .jp-components-spinner,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active .jp-components-spinner{width:100%}@keyframes rotate-spinner{to{transform:rotate(-1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid transparent;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-left-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.jp-license-activation-screen-illustration{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-illustration--wrapper{display:flex;flex:1}.jp-license-activation-screen-illustration--wrapper img{align-self:center;height:auto;max-width:100%}.jp-license-activation-screen-illustration--support-link{flex:0}.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin:0 0 20px 40px;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{width:auto}}.components-button.jp-license-activation-screen-success-info--button:active:hover,.components-button.jp-license-activation-screen-success-info--button:hover,.components-button.jp-license-activation-screen-success-info--button:visited:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:focus,.components-button.jp-license-activation-screen-success-info--button:focus,.components-button.jp-license-activation-screen-success-info--button:visited:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:disabled,.components-button.jp-license-activation-screen-success-info--button:active[disabled],.components-button.jp-license-activation-screen-success-info--button:disabled,.components-button.jp-license-activation-screen-success-info--button:visited:disabled,.components-button.jp-license-activation-screen-success-info--button:visited[disabled],.components-button.jp-license-activation-screen-success-info--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.components-button.jp-license-activation-screen-success-info--button .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:active .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:visited .jp-components-spinner{width:100%}.jp-license-activation-screen-success-info--product-details h1{line-height:52px}.jp-license-activation-screen-success-info--product-details a{color:var(--jp-black);text-decoration:underline!important}.jp-license-activation-screen-success-info--external-link{color:var(--jp-black);font-size:16px;font-style:normal;font-weight:600;text-decoration:underline!important;white-space:nowrap}.jp-license-activation-screen-success-info{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-success-info h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-success-info p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-success-info label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-success-info{padding:64px}}@media screen and (max-width:480px){.jp-license-activation-screen-success-info .jp-license-activation-screen-success-info--buttons{text-align:center}}.EiaNctK1_P9pPqOeiaSI{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ogHZg_sJCljylz3VJfsf{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.zv7eGvijKRkbPVakubHw{grid-column-end:span 1}.VoJNoiya_1ck3_kXS6_C{grid-column-end:span 2}.ecv0NO526NoTNbpALA1A{grid-column-end:span 3}.OfBdkceMzeHvRbzhqDlP{grid-column-end:span 4}@media(min-width:600px){.JLb3NpEKN8pOaWd7K1bu{grid-column-end:span 1}.fsMPGqPKE4mjMIPFwl77{grid-column-end:span 2}.DIK_zdaGAQ09eKspBJ4E{grid-column-end:span 3}.shXYpxPu3WCJsR8aOHtz{grid-column-end:span 4}.s7ElrOqG_yGd5SIfwqOR{grid-column-end:span 5}.Cxml9uzGvArAL8_RDs_p{grid-column-end:span 6}.aANxBKDGx72eDqU0iUPj{grid-column-end:span 7}.XxyzuTY3mnQcl9EGZadm{grid-column-end:span 8}}@media(min-width:960px){.Sfo4WaSNIWInJ93Abd3w{grid-column-end:span 1}.tQS7SKUGrU4THhWMysbo{grid-column-end:span 2}.I94U7mpY4h16pcOksZNF{grid-column-end:span 3}.uWMb9k77kQxBdS5MTt0s{grid-column-end:span 4}.rKwEEZQxK9s_POMg5Jss{grid-column-end:span 5}.UcPXX_s06IPCkF7ZjH3D{grid-column-end:span 6}.CrQdtiCFkRbzY6K2dFvt{grid-column-end:span 7}.rEUALOmOdUBXO0Us871z{grid-column-end:span 8}.NqXa9TlcTEviVsB53hBV{grid-column-end:span 9}.OnWVeiQiwgQ9lzdGPW66{grid-column-end:span 10}.D2PkTcy7b8u2K9QXY6VQ{grid-column-end:span 11}.EcqBhzAyxo5RDc2Y6m7K{grid-column-end:span 12}}@media(max-width:960px){.gB1mWzHOM38d80lrhBRX{display:none}}@media(max-width:600px){.KNQXLP78ejczOkour3zg{display:none}}.rBVbaVWBnBRtTMrUKZxm{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.rBVbaVWBnBRtTMrUKZxm span{display:block}.rBVbaVWBnBRtTMrUKZxm span:last-of-type{font-weight:600}.rBVbaVWBnBRtTMrUKZxm:focus span:last-of-type,.rBVbaVWBnBRtTMrUKZxm:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.rBVbaVWBnBRtTMrUKZxm:focus:after,.rBVbaVWBnBRtTMrUKZxm:hover:after{transform:translateY(-50%) translateX(-8px)}.rBVbaVWBnBRtTMrUKZxm:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.gfM_DIJrVbRhmKdAphIm{background:var(--jp-white);border-radius:var(--jp-modal-radius);box-shadow:0 12px 16px -.5px rgba(0,0,0,.15);height:max-content;margin:3rem auto;max-width:414px;overflow:hidden;position:relative;transition:height .25s cubic-bezier(.59,.37,.18,1.19) 0;width:90%;will-change:height}.gfM_DIJrVbRhmKdAphIm>div:first-child{padding:0}.gfM_DIJrVbRhmKdAphIm *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.gfM_DIJrVbRhmKdAphIm p{color:var(--jp-black)}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:none}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:614px;transition-delay:2.15s}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh h2{margin-top:0}._j4GWTmW5psCHFYh6R0x{align-self:flex-start;margin-top:var(--jp-gap)!important;padding:8px var(--jp-modal-padding-small)!important;width:100%}.saSAjv8yulVXQDoqDJEI{font-weight:500;line-height:110%;margin-bottom:8px}.O_hcdbeMivIhBn7ApDnS{line-height:140%}@media(min-width:760px){.gfM_DIJrVbRhmKdAphIm{height:740px;max-width:1360px;position:relative;width:95%}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:block;position:absolute;right:64px;top:64px;z-index:99}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path{fill:#000}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{fill:#fff}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:740px;transition-delay:0}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path{transition:fill 2s ease .5s;fill:#fff}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{transition:fill 2s ease .5s;fill:#000}}@keyframes OmAVpCQ270MqI4IsT9Ky{20%{transform:translateY(0) scale(1)}65%{transform:translateY(16%) scale(1.4)}to{transform:translateY(0) scale(1)}}.Qn5xayjI_jH2m1d6BEoq{border-radius:var(--jp-button-radius);display:flex;height:50%;justify-content:center;min-height:400px;overflow:hidden;position:relative;transition:height .55s cubic-bezier(.59,.37,.18,1) 0s;will-change:height}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{height:100%;transition-delay:.65s}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq video{animation:OmAVpCQ270MqI4IsT9Ky 1.5s ease-in-out forwards}.Qn5xayjI_jH2m1d6BEoq video{height:100%;object-fit:cover;position:absolute;right:0;top:0;transform:scale(1);transition:all .85s cubic-bezier(1,0,.39,1) 0s;width:100%;will-change:transform}@media(min-width:760px){@keyframes Axe8f2LgqEBZHVcsRgY5{0%{animation-timing-function:cubic-bezier(.86,0,.07,1);right:60%;top:32px}50%{animation-timing-function:cubic-bezier(.17,.84,.44,1);bottom:32px;right:32px;top:32px;width:100%}to{right:32px;width:40%}}.Qn5xayjI_jH2m1d6BEoq{border-radius:12px;bottom:32px;display:block;height:auto;left:32px;overflow:hidden;position:absolute;right:60%;top:32px;transition-delay:0;transition:width .55s ease 0s;z-index:3}.Qn5xayjI_jH2m1d6BEoq video{height:100%;object-fit:cover;position:absolute;right:0;top:0;width:100%}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{animation-delay:.25s;animation-duration:2s;animation-fill-mode:forwards;animation-name:Axe8f2LgqEBZHVcsRgY5;height:auto}}.iBMDoShSmqpt72YfJb36{padding:var(--jp-modal-padding)}.iBMDoShSmqpt72YfJb36 h2{font-size:clamp(1.5rem,-.7353rem + 4.7059vw,3.5rem)}.iBMDoShSmqpt72YfJb36 p{font-size:clamp(1rem,.6974rem + 1.1696vw,1.75rem)}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:none;font-size:clamp(1.25rem,1.1491rem + .3899vw,1.5rem)}@media(min-width:760px){.iBMDoShSmqpt72YfJb36{bottom:15%;display:flex;flex-direction:column;gap:64px;padding:0 0 0 var(--jp-modal-padding);position:absolute;right:64px;width:55%}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC{align-items:flex-start;display:flex;flex-direction:column;gap:16px;padding:0 0 0 32px}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC h2,.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC p{margin:0}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:block}.iBMDoShSmqpt72YfJb36 ._j4GWTmW5psCHFYh6R0x{align-self:flex-start;padding:16px var(--jp-modal-padding-large)!important;width:auto}.pnwbCuWbV0PNQr1LFpRh .iBMDoShSmqpt72YfJb36{opacity:0;right:-20px;transition:all .55s cubic-bezier(.59,.37,.18,1) .3s}}.HQVDZ6J3x6SJNYFX5khS{background:var(--jp-white);opacity:0;position:absolute;right:0;top:100%;transition:transform .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;width:100%;will-change:transform,opacity;z-index:2}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{opacity:1;transform:translateY(-100%);transition-delay:2s}@media(min-width:760px){.HQVDZ6J3x6SJNYFX5khS{align-items:flex-end;bottom:5%;container-type:inline-size;display:flex;flex-direction:column;gap:40px;left:32px;padding:0;right:45%;transform:translateY(0);transition-delay:0;transition:none;width:auto}.HQVDZ6J3x6SJNYFX5khS h2{width:100%}.HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{margin-left:var(--jp-modal-padding-large)}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{bottom:12%;left:32px;opacity:1;right:45%;top:unset;transform:translateY(0);transition:all .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;transition-delay:2s;width:auto}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS .l35bIyiqYJiZ6tVYvJtC{padding-right:32px}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{align-self:flex-end}}.KdvmPIjelQIFiPQGuIYf{background:var(--jp-gray-0);display:flex;flex-direction:column;gap:var(--jp-gap)}.KdvmPIjelQIFiPQGuIYf div{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-button-radius);box-shadow:0 0 40px 0 rgba(0,0,0,.08);flex:1;padding:var(--jp-modal-padding)}.KdvmPIjelQIFiPQGuIYf h3{font-size:24px;line-height:normal;margin:0}.KdvmPIjelQIFiPQGuIYf p{font-size:14px}@media(min-width:760px){.KdvmPIjelQIFiPQGuIYf{flex-direction:row;padding:var(--jp-modal-padding-large)}.KdvmPIjelQIFiPQGuIYf div{border:none;box-shadow:0 2px 16px rgba(0,0,0,.08),0 2px 2px rgba(0,0,0,.1)}.KdvmPIjelQIFiPQGuIYf div p{margin:8px 0}.KdvmPIjelQIFiPQGuIYf svg{margin-bottom:var(--jp-modal-padding-small)}}@container (max-width: 600px){.KdvmPIjelQIFiPQGuIYf div{padding:var(--jp-modal-padding-small)}}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aLWBKY0yRghEk7tNCgK3{fill:var(--color-bluesky)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook)}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw{fill:var(--color-nextdoor)}.cbOwD8Y4tFjwimmtchQI.n5XodNsuMfMAAvqHFmbw.social-logo{border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI{fill:var(--color-threads)}.cbOwD8Y4tFjwimmtchQI.inzgC27qxdt7hSdhTWRI.social-logo{border-radius:40%}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.51px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-left:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.51px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-right:calc(var(--spacing-base)/2)}.jp-license-activation-screen{border-radius:4px;box-shadow:0 4px 24px 0 rgba(0,0,0,.149);display:flex;flex-direction:column;min-height:540px;overflow:hidden}@media screen and (min-width:780px){.jp-license-activation-screen{flex-direction:row}}.hdasSNj9k3Sc5PwXK4uE{margin-left:4px;width:16px}.eWN8Hj0SBRDq1F48n_Fg{--gray-70:#3c434a;align-items:center;color:var(--gray-70);display:flex;font-size:14px;text-decoration:none}.jp-dashboard-footer{align-items:center;color:var(--jp-black);display:flex;flex-wrap:wrap;font-size:var(--font-body-extra-small);line-height:1.333;max-width:1128px;width:100%}.jp-dashboard-footer a{text-decoration:none}.jp-dashboard-footer a:any-link,.jp-dashboard-footer a[role=button]{color:inherit}.jp-dashboard-footer a:hover{text-decoration:underline;text-decoration-thickness:1.5px}.jp-dashboard-footer a:focus{border-radius:2px;box-shadow:none;outline:1.5px solid currentColor;outline-offset:3px}.jp-dashboard-footer.is-sm>ul{gap:.125rem}.jp-dashboard-footer.is-md,.jp-dashboard-footer.is-sm>ul{align-items:flex-start;flex-direction:column}.jp-dashboard-footer>ul{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;list-style:none;margin:0;padding:0;width:100%}.jp-dashboard-footer>ul>li{margin-bottom:0}.jp-dashboard-footer>ul>li>a{align-items:center;display:flex;gap:.25rem;min-height:44px}.jp-dashboard-footer__accessible-external-link{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px}.jp-dashboard-footer__jp-item{font-weight:600;padding-inline-end:1rem}.jp-dashboard-footer.is-sm .jp-dashboard-footer__jp-item{padding-bottom:1rem}.jp-dashboard-footer.is-lg .jp-dashboard-footer__a8c-item{margin-inline-start:auto}.jp-dashboard-footer.is-sm .jp-dashboard-footer__a8c-item{padding-top:1rem}.jp-dashboard-footer__a8c-item>a,.jp-dashboard-footer__jp-item>a{text-decoration:none}.sexr0jUxC1jVixdKiDnC{margin-right:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-right:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.rV_5QyvhDnsVjCX4pb0h{--gray-90:#1e1e1e;fill:var(--gray-90);width:24px}.MO1jDNY8VPqeNS9xL8jE{align-items:center;display:flex;text-decoration:none}.zvd4dCB_bBDiXJKKDqXm{position:relative}.ly4o9lSswAGHFXqGUEIO{left:32px;position:absolute;top:32px;z-index:1}.u64Go3kwEZ7MD9eji0H1{color:var(--jp-gray-50);font-size:13px;margin-bottom:8px;width:60%}._RT41NE3LU4R0ubcij2y{align-items:center;display:flex;gap:8px}._RT41NE3LU4R0ubcij2y li{background:none!important;margin:0!important;padding:0!important}.cFGWJeRiGHjAr8D7CWJW{max-width:110px}.Iz3l7a05TP6HK9S92TIL{width:16px}.lmQ0wFmnk4kKkGVjokPA{height:18px}.ZSFTmY3zE3VP4w0QeaqV{width:16px}.AoIs8wD92wKR8RpQj6Uc{align-items:center;display:inline-flex}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-left:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-right:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-left:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-right:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-left:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-right:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-left:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-right:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-left:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-right:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-left:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-right:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-left:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-right:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-left:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-right:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-left:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-right:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-left:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-right:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-left:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-right:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-left:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-right:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-left:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-right:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-left:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-right:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-left:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-right:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-left:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-right:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-left:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-right:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-left:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-right:calc(var( --spacing-base )*8)}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50);text-decoration:underline;white-space:nowrap}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe{align-items:center;display:flex;gap:var(--spacing-base);margin-bottom:calc(var(--spacing-base)*3)}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .VmtuLc2xRqmsO6cK8qjF{position:relative;width:54px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .MdTRfQ3eo5qZKChZlzNj,.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .PbEpL02SEH9VNAlbKCfV{width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .TD4AUM9gcTVAB6JHB5ZR{border-radius:50%;margin-right:-10px;position:absolute;width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .yjl73qv0VWoPP8IhGreh{border-top-style:solid;border-top:2px dashed var(--jp-black);height:0;width:67px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .J0GIu2rNR7rXocQTyd8p{border-color:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .rAV2E93SG8WpokuGk9jh{border-color:var(--jp-yellow-40)}.kezuOHNvu9vdvlJ86Fwg .YZ7FNKEm9qpvQ4ZkbAz5{transform:rotate(-180deg)}.kezuOHNvu9vdvlJ86Fwg .TYNMsILey2vUwnyZSjJU{align-self:flex-end;margin-bottom:2px}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz{margin-bottom:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz,.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp{align-items:center;display:flex;gap:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.J0GIu2rNR7rXocQTyd8p{color:var(--jp-red);fill:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.rAV2E93SG8WpokuGk9jh{color:var(--jp-yellow-40);fill:var(--jp-yellow-40)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.q4_FOHifGawULuFBZke9 svg{fill:var(--jp-green-50)}.OpMBda4vebhRbW8Fm6YC{background:var(--jp-white);border:1px solid var(--jp-gray-5);border-radius:var(--jp-border-radius-rna);box-shadow:0 4px 12px 0 rgba(0,0,0,.06);display:flex;flex-direction:column;height:100%;padding:calc(var(--spacing-base)*3)}.OpMBda4vebhRbW8Fm6YC.BghJAx9hSagUdHWOUaYE{background:none;background-color:var(--jp-white-off);color:var(--jp-black-80);text-decoration:none}.OpMBda4vebhRbW8Fm6YC.BghJAx9hSagUdHWOUaYE:focus{background-color:var(--jp-white);box-shadow:0 0 0 1.5px var(--jp-black);outline:3px solid transparent}.OpMBda4vebhRbW8Fm6YC.IWsEW5nnNWUqqcT3K5L1{box-shadow:0 0 0 1.5px var(--jp-red-60)}.r3UCwgwCthua6lDCvIBI{align-items:center;display:flex;gap:var(--spacing-base);justify-content:space-between;margin-bottom:var(--spacing-base);width:100%}.r3UCwgwCthua6lDCvIBI h3{font-weight:700}.vpluqUMgmwx9_f8wCVIn{align-items:center;display:flex;flex-wrap:wrap-reverse;gap:var(--spacing-base);height:100%}.pIsYsXFAJ9KX2VrS5rmY{min-height:200px;position:relative}.gmPKCDKZcfQt9WieTyKS{flex-grow:1}.fDBaV7I4yUO6w5AWVEtr{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:auto;min-height:28px;padding-top:calc(var(--spacing-base)*3);width:100%}.SelsBZT7eIWRQyl1dasZ{display:flex;gap:var(--spacing-base);justify-content:flex-start}.LHYJUrOej3toDvOAiz4k{align-items:center;display:flex;gap:var(--spacing-base);justify-content:space-between;margin-bottom:calc(var(--spacing-base)*.5);width:100%}.LHYJUrOej3toDvOAiz4k h3{font-weight:700;line-height:28px}.JFjbc0JgC4qC92ehOiUr{display:flex;position:relative}.JFjbc0JgC4qC92ehOiUr .NBZgqk_CGGfY3Q16OHjT{align-items:center;border:.5px solid var(--jp-black);border-bottom-left-radius:var(--jp-border-radius);border-top-left-radius:var(--jp-border-radius);box-shadow:inset 0 0 0 1px var(--jp-black);cursor:pointer;display:flex;justify-content:center;padding:0}.JFjbc0JgC4qC92ehOiUr .Jh6TlOGQNgBwU_fFxPrm{background-color:var(--jp-black);margin-right:.5px}.JFjbc0JgC4qC92ehOiUr .VBxTkBZVxHaVoyhMRJcz{background-color:var(--jp-white);border-right-width:0;margin-right:-.5px}.UZ3NDyOSbGY9NZWb3bUD{background:var(--jp-white);border-radius:calc(var(--jp-border-radius)/2);box-shadow:0 1px 1px 0 rgba(0,0,0,.1),0 1px 1.5px 0 rgba(0,0,0,.1),0 2px 3px -.5px rgba(0,0,0,.1);padding:var(--spacing-base);position:absolute;right:0;top:calc(100% + var(--spacing-base));z-index:1}.UZ3NDyOSbGY9NZWb3bUD .IpJGe_nvXXUiBOsAOkaV{align-items:center;background-color:var(--jp-white);border:none;cursor:pointer;display:flex;gap:calc(var(--spacing-base)*7);padding:var(--spacing-base);width:100%}.UZ3NDyOSbGY9NZWb3bUD .IpJGe_nvXXUiBOsAOkaV:hover{background-color:var(--jp-gray-0)}.UZ3NDyOSbGY9NZWb3bUD .SjzpxiAAVsU_xRrw55ub{align-items:center;display:flex;font-size:var(--font-label);gap:calc(var(--spacing-base)*.5)}.UZ3NDyOSbGY9NZWb3bUD .GQy61X1G7Wv3L3erNwxR{background-color:var(--jp-green-50);height:25px;width:25px}.QSePbRSFylCvM2cX8nN_ a,.QSePbRSFylCvM2cX8nN_ button{border-bottom-left-radius:0;border-top-left-radius:0}.aZvwqVNw6rvImSxn0DM9{align-items:baseline;display:flex;gap:calc(var(--spacing-base)*.5);margin-bottom:var(--spacing-base)}.R4OXFRkmlHAH8ScIgYXh{color:var(--jp-gray-100);font-size:var(--font-body);font-weight:600}.R4OXFRkmlHAH8ScIgYXh.g0_8bbVjnVh0D_pS264j{color:var(--jp-gray-30);text-decoration:line-through}.nqFgW_S2jbHPu9yPq9E_{color:var(--jp-gray-30);font-size:var(--font-body-extra-small)}.f5VJYwuJmjxH8PVxEbbv{align-items:center;display:flex;height:28px;white-space:nowrap}.f5VJYwuJmjxH8PVxEbbv:before{border-radius:50%;content:"";display:inline-block;height:8px;margin-left:var(--spacing-base);width:8px}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3{color:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3:before{background:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr{color:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr:before{background:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.TZUP7W6QYGajITiMNYas{color:var(--jp-yellow-40)}.f5VJYwuJmjxH8PVxEbbv.TZUP7W6QYGajITiMNYas:before{background:var(--jp-yellow-40)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02{color:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02:before{background:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.PdsJCfyyjSgrNDheF2qi:before{animation:dWP7ypkVXudMbAa38W5Z .5s linear infinite}@keyframes dWP7ypkVXudMbAa38W5Z{0%{opacity:0}50%{opacity:.5}to{opacity:0}}.wI7QgVzPXvVVu6kfnTT8{align-items:center;color:var(--jp-black);display:flex;justify-content:space-between;margin-top:1rem}.wI7QgVzPXvVVu6kfnTT8 .eqyxcUmdF0s3gmmlZGyD{display:flex;gap:1.5rem}.wI7QgVzPXvVVu6kfnTT8 .gxY6D0PeVtGk9iSB5E_u{align-items:center;display:flex;font-size:var(--font-body-small);gap:2px;margin:0}.wI7QgVzPXvVVu6kfnTT8 .D_uE0LD5CvpfM2FNp55k{align-items:center;display:flex;gap:2px}.wI7QgVzPXvVVu6kfnTT8 .VTBUdi1D4DW34F0yixMk{font-size:var(--font-body-small);margin:0}.BXQQYCO_pEmYmzBBwYxR{align-items:center;color:var(--jp-black);display:flex;gap:.25rem;margin-top:1rem}.BXQQYCO_pEmYmzBBwYxR .qdvOzzbrd3KQK7DNg8eg{font-size:var(--font-body-small);margin:0}.PFbMp_gtGLBMWbbYtO0q{display:flex;flex-grow:1;flex-wrap:wrap;gap:.25rem;justify-content:space-between}.ZFCNMiywyFvaifoIQI5w{color:var(--jp-gray-40)}.mj-boost-speed-score{margin:calc(var(--spacing-base)*-1);margin-bottom:0;padding:calc(var(--spacing-base))}.mj-boost-speed-score__grade{align-items:center;column-gap:1em;display:flex;font-size:var(--font-body-small);justify-content:space-between;line-height:24px;margin:8px 0}.mj-boost-speed-score__grade--letter{all:unset;border-radius:var(--jp-border-radius);color:var(--jp-green);cursor:pointer;font-size:var(--font-title-small);font-weight:700;line-height:24px;padding:0 5px}.mj-boost-speed-score__grade--letter:focus{outline:1px dotted var(--jp-black)}.boost-score-tooltip__heading{color:#000;font-size:var(--font-title-small);line-height:30px;margin:0}.boost-score-tooltip__content{font-size:var(--font-body);line-height:24px}.boost-score-tooltip__parent{max-width:340px;min-height:150px;padding:24px;width:calc(100vw - 64px)}@media(min-width:783px){.boost-score-tooltip__parent{width:100vw}}.boost-score-tooltip__parent p:last-child{margin-bottom:0}.mj-boost-speed-score__bar .jb-score-bar__label{display:none}.mj-boost-speed-score__bar .jb-score-bar__filler{border-radius:12px;min-width:49px}.mj-boost-speed-score__bar .jb-score-bar__bounds{border-radius:12px;height:24px;margin-right:0}.mj-boost-speed-score__bar .jb-score-bar__score{border-radius:12px;height:24px;width:30px}.mj-boost-speed-score__increase{align-items:center;color:var(--jp-green-50);display:flex;font-size:var(--font-body-small);left:24px;line-height:28px;position:absolute;top:26px;fill:var(--jp-green-50)}.gridicon{fill:currentColor;display:inline-block}.gridicon.needs-offset g{transform:translate(-1px,1px)}.gridicon.needs-offset-x g{transform:translate(-1px)}.gridicon.needs-offset-y g{transform:translateY(1px)}.jb-score-bar__label,.jb-score-bar__loading,.jb-score-bar__score{align-items:center;background-color:#fff;border:2px solid transparent;border-radius:42px;display:flex;height:42px}.jb-score-bar{color:var(--jp-gray-70);display:flex;width:100%}.jb-score-bar--mobile{margin-bottom:1.5rem}@media(max-width:767px){.jb-score-bar{flex-direction:column}.jb-score-bar__label{background-color:transparent}}.jb-score-bar__loading{align-items:center;display:flex;justify-content:center;width:42px}.jb-score-bar__label{display:grid;grid-template-columns:24px 1fr;grid-column-gap:10px;font-size:14px;justify-content:center;position:relative}@media(min-width:768px){.jb-score-bar__label{padding-left:15px;padding-right:15px;width:200px;z-index:50}}.jb-score-bar__score{border-radius:100%;font-weight:700;height:42px;justify-content:center;left:-1px;position:absolute;width:42px}.jb-score-bar__bounds{background-color:#f1f1f1;border-radius:21px;display:flex;height:42px;max-width:100%;position:relative;width:100%;z-index:40}@media(min-width:768px){.jb-score-bar__bounds{margin-right:-21px;width:calc(100% + 21px)}}.jb-score-bar__filler{border-radius:42px 0 0 42px;display:flex;justify-content:flex-end;min-width:85px;position:relative;transition:width .3s ease-in-out;width:0;will-change:width}@media(max-width:767px){.jb-score-bar__filler{border-radius:inherit;min-width:43px}}.jb-score-bar__no_boost_score{--clearance-space:74px;background:#fff;background-clip:padding-box;border:2px solid transparent;border-radius:50%;cursor:pointer;font-size:.7em;height:28px;line-height:1.625;padding:3px;position:absolute;text-align:center;top:6px;width:28px;z-index:2}.jb-score-bar__no_boost_score:hover{border:2px solid hsla(0,0%,100%,.5)}.jb-score-bar__no_boost_score:after{border-bottom:6px solid #fff;border-left:6px solid transparent;border-right:6px solid transparent;content:" ";height:0;position:absolute;right:6px;top:28px;width:0}.jb-score-bar__no_boost_score_tooltip{background:#fff;border-radius:4px;box-shadow:0 0 20px 0 hsla(0,0%,67%,.28);display:none;margin:0 16px;padding:16px;position:absolute;right:-10em;top:-62px;width:20em}.jb-score-bar__no_boost_score_tooltip:after{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;bottom:-6px;content:" ";height:0;margin:0 -10px;position:absolute;right:10em;width:0}.jb-score-bar__no_boost_score:hover .jb-score-bar__no_boost_score_tooltip{display:block}.jb-score-bar .fill-loading{background-color:var(--jp-white)}.jb-score-bar .fill-good{background-color:var(--jp-green)}.jb-score-bar .fill-mediocre{background-color:var(--jp-orange-20)}.jb-score-bar .fill-bad{background-color:var(--jp-red-50)}.info-tooltip__button{align-items:center;background:transparent;border:none;color:var(--jp-gray-50);cursor:pointer;display:flex;padding:2px}.info-tooltip__button svg{margin:0 auto}.info-tooltip__content h3{color:var(--jp-black);font-size:var(--font-title-small);font-weight:500;line-height:calc(var(--font-title-small) + 6px);margin:0 0 calc(var(--spacing-base)*2)}.info-tooltip__content p{color:var(--jp-gray-70);font-size:var(--font-body);line-height:var(--font-title-small);margin-bottom:0}.info-tooltip__content p a{color:var(--jp-black);text-decoration:underline}.info-tooltip__content p a:focus,.info-tooltip__content p a:hover{text-decoration:none}.g4lyov8aMDggdD4yOi1p{align-items:baseline;display:flex;margin-top:calc(var(--spacing-base)/2)}.g4lyov8aMDggdD4yOi1p .Ys5ScZ_dYn2O2AzDE5Yi{font-size:32px;font-weight:400;line-height:36px;margin-left:var(--spacing-base)}.sUNg_b7XteVXOrpHAkJg :last-child{margin-top:4px}.cF6QAJf1vXXAMuutXPcq{align-items:baseline;display:flex}.cF6QAJf1vXXAMuutXPcq.coY634LconQ7gzDDNJeu{color:var(--jp-gray-10);fill:var(--jp-gray-10)}.cF6QAJf1vXXAMuutXPcq.kyqpwKaL2FyQ8CtxJQ0f{color:var(--jp-green-50);fill:var(--jp-green-50)}.cF6QAJf1vXXAMuutXPcq.aXf37lEOcjpNV8ImLaYK{color:var(--jp-red-40);fill:var(--jp-red-40)}.cF6QAJf1vXXAMuutXPcq .OyGdoGzsQ48VaVVR99_H{position:relative;right:2px;top:2px}.cF6QAJf1vXXAMuutXPcq .cKLicfMCaDSGPlX222jF{font-size:14px;font-weight:600;line-height:24px}.ZaPXoMGC_e8NfFoBgA95,.gb2kSZHPauLu96D9HAIg{margin-bottom:1.5rem}.qpN923qyxjI06NCgFC8j>li{margin-bottom:0}.hpd1bQCLIZYXpZJa22qw{color:var(--jp-gray-100);font-size:var(--font-body-extra-small);font-weight:500;line-height:var(--font-title-small);margin-bottom:calc(var(--spacing-base) + 2px)}@media screen and (min-width:599px)and (max-width:1290px){ul.qpN923qyxjI06NCgFC8j{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}ul.qpN923qyxjI06NCgFC8j>li{grid-column-end:auto}}.value-section{display:flex;justify-content:space-between;margin-top:calc(var(--spacing-base)/2)}.value-section>div{align-items:flex-start;display:flex;flex-direction:column}.value-section__heading{align-items:center;display:flex;text-wrap:nowrap}.value-section__last-scan{align-items:center;column-gap:1px;display:flex;justify-content:flex-end;left:calc(var(--spacing-base)*3);margin-top:var(--spacing-base);position:absolute;width:calc(57% - var(--spacing-base)*3)}.value-section__last-scan div{color:var(--jp-gray-50);font-size:var(--font-body-extra-small);line-height:var(--font-body);text-align:left}@media(max-width:480px){.value-section__last-scan{width:calc(53% - var(--spacing-base)*3)}}.value-section__data{align-items:center;color:var(--jp-gray-50);display:flex;flex:1;font-size:var(--font-body-extra-small);font-weight:500;justify-content:center;line-height:var(--font-title-small)}.value-section__status-icon{display:block;margin-left:calc(var(--spacing-base) - 2px)}.value-section__status-text{letter-spacing:-.24px;margin-left:1px}.scan-threats__threat-count{color:var(--jp-black);font-size:calc(var(--font-title-large) - 4px);font-weight:400;line-height:var(--font-title-large)}.scan-threats__critical-threats{align-items:center;display:flex}.scan-threats__critical-threat-container{margin-right:1px}.scan-threats__critical-threat-container>button>svg{fill:var(--jp-red-50)}.scan-threats__critical-threat-count{color:var(--jp-red-50);margin-right:calc(var(--spacing-base)/4)}.logins_blocked__count{color:var(--jp-black);font-size:calc(var(--font-headline-small) - 4px);font-weight:400;line-height:var(--font-title-large)}.info-tooltip__content{max-width:340px;min-height:150px;padding:24px;width:calc(100vw - 64px)}.videopress-card__video-count{color:var(--jp-gray-90);display:flex;font-size:calc(var(--font-headline-small) - 4px);line-height:1.125;margin-top:calc(var(--spacing-base)/2)}.videopress-card__video-count .videopress-card__tooltip{height:18px}p.description{color:var(--jp-gray-70);font-size:var(--font-body-small);margin:0 0 1rem}.videopress-card__value-section{display:flex;gap:.75rem;justify-content:space-between}.videopress-card__value-section__container{align-items:flex-start;display:flex;flex-direction:column}.videopress-card__value-section__value-container{align-items:flex-end;display:flex;flex-wrap:wrap}.videopress-card__value-section__value{color:var(--jp-gray-90);font-size:calc(var(--font-headline-small) - 4px);line-height:1}.videopress-card__value-section__previous-value{align-items:center;display:flex;font-size:var(--font-body-extra-small);font-weight:600;line-height:18px}.videopress-card__value-section__previous-value.increase *{color:var(--jp-green-50);fill:var(--jp-green-50)}.videopress-card__value-section__previous-value.decrease *{color:var(--jp-red-50);fill:var(--jp-red-50)}.videopress-card__value-section__heading{align-items:center;display:flex;text-wrap:nowrap}.videopress-card__no-video-tooltip .info-tooltip__button{display:inline;vertical-align:middle}.iG63b_J1HNfT8xEIq619{margin-bottom:.75rem}.T8UhA3lZQjpZsyaah9J6{width:200px}@media screen and (min-width:599px)and (max-width:1290px){ul.g69ZGQc9wey1u1beD0IP{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}ul.g69ZGQc9wey1u1beD0IP>li{grid-column-end:auto}}.HeJe1crc9XaWWpLvIPit .components-modal__frame{border-bottom-right-radius:4px;border-right:4px solid #e68b28;border-top-right-radius:4px;max-height:100%}.HeJe1crc9XaWWpLvIPit .components-modal__content{margin-top:0;padding:0}.HeJe1crc9XaWWpLvIPit .components-modal__header{display:none}.HeJe1crc9XaWWpLvIPit .or0JUScxkJPmNsfrxkEK .jp-idc__idc-screen{border:0}.components-surface.components-card{border-radius:var(--jp-border-radius-rna)}.upsell-banner{background:#f9f9f6;background:linear-gradient(-133deg,#ced9f2,#f9f9f6 10%,#f9f9f6 80%,#f5e6b3);display:flex;flex-direction:column}@media screen and (min-width:660px){.upsell-banner{flex-direction:row}}.upsell-banner.components-card__body.components-card-body{border-radius:var(--jp-border-radius-rna);padding:36px}.upsell-banner .upsell-banner--icon{align-items:flex-start;display:flex;margin-bottom:16px;margin-left:0;margin-top:16px}@media screen and (min-width:660px){.upsell-banner .upsell-banner--icon{align-items:center;margin-bottom:0;margin-left:28px;margin-top:0}}.upsell-banner .upsell-banner--content{display:flex;flex:1;flex-direction:column;justify-content:space-between}@media screen and (min-width:660px){.upsell-banner .upsell-banner--content{flex-direction:row}}.upsell-banner .upsell-banner--content .upsell-banner--content-info{display:flex;flex-direction:column}.upsell-banner .upsell-banner--content .upsell-banner--content-info h3{font-size:1.5rem;font-weight:500;line-height:32px;margin:0}.upsell-banner .upsell-banner--content .upsell-banner--content-info p{font-size:1rem;margin:8px 0 0}.upsell-banner .upsell-banner--content .upsell-banner--content-cta{align-items:center;display:flex;flex-direction:row;margin-right:0;margin-top:16px}@media screen and (min-width:660px){.upsell-banner .upsell-banner--content .upsell-banner--content-cta{margin-right:16px;margin-top:0}}.upsell-banner .upsell-banner--content .upsell-banner--content-cta .upsell-banner--content-cta-button{box-shadow:inset 0 0 0 1.5px #000;font-weight:400;padding:8px 16px;white-space:nowrap}.upsell-banner .upsell-banner--content .upsell-banner--content-cta .upsell-banner--content-cta-button.secondary{background-color:var(--jp-white);color:var(--jp-black)}.upsell-banner .upsell-banner--content .upsell-banner--content-cta .upsell-banner--content-cta-button.primary{margin-right:8px}.yWUvvF4WJLNDSpMgBMfm{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ka1fVHj2HOkHjhdoEFOZ{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.JMOO4Y_9yhTO9lwLnRUx{grid-column-end:span 1}.PFDPAqk51qox_ChLqJwm{grid-column-end:span 2}.ault0jHVfWpShqOGooIP{grid-column-end:span 3}.GqpvdRzmzPJELtSm4FEN{grid-column-end:span 4}@media(min-width:600px){.Ym4_YneEGD_iZD6W1C2o{grid-column-end:span 1}.NbvHnnDtWw8n9BEUQ0Oy{grid-column-end:span 2}.ElMT7rhxe5ZJKO41MnhW{grid-column-end:span 3}.yKjnqjibn_wW_1tWWt5Q{grid-column-end:span 4}.Pb30lOcQFpzUX57GwflS{grid-column-end:span 5}.pC1wxc_R8y4pNILHsiiY{grid-column-end:span 6}.pChscSCnudQoWGjMFKI_{grid-column-end:span 7}.qw1H2gAgF3lDCI2Tbkmb{grid-column-end:span 8}}@media(min-width:960px){.VzcA_rrxBK3g4ozA0oD9{grid-column-end:span 1}.pNAa7O2adRZD8Slgk9iR{grid-column-end:span 2}.tlIMLlipexblj8CeOx4B{grid-column-end:span 3}.Dvt0u5l2Rr1BhBmvYAzl{grid-column-end:span 4}.BiUsgNTc0tyc7tC5jnzE{grid-column-end:span 5}.ulJXAsj7G2ROJ1g3_s28{grid-column-end:span 6}.HsoVlyVLsXYClx9Atox0{grid-column-end:span 7}.oXxjRQNNj2cfIpFBqC1W{grid-column-end:span 8}.qXgUn4Adg9xE_JnbuDio{grid-column-end:span 9}.xMpqTLiLfYFEJiRPQQQq{grid-column-end:span 10}.IiGo3Sz2FDZN7_eGElwA{grid-column-end:span 11}.Om8BNCjfgqQ_wmPQjfOY{grid-column-end:span 12}}@media(max-width:960px){.t10ZWzP7ADjJnR4tqxRS{display:none}}@media(max-width:600px){.eOUlZG8Pelh_Xj0aSoHG{display:none}}.l546LrwBEePz434NFK5Q{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.l546LrwBEePz434NFK5Q span{display:block}.l546LrwBEePz434NFK5Q span:last-of-type{font-weight:600}.l546LrwBEePz434NFK5Q:focus span:last-of-type,.l546LrwBEePz434NFK5Q:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.l546LrwBEePz434NFK5Q:focus:after,.l546LrwBEePz434NFK5Q:hover:after{transform:translateY(-50%) translateX(-8px)}.l546LrwBEePz434NFK5Q:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.Q7w4fcEcemZ2nlwaYNog{fill:var(--jp-yellow-30)!important;display:inline-block!important;width:1.1em!important}.AoNQsOaTt6gSf0H6Yasz{display:inline-block;position:relative}.v13ZwGzUnecPA7Y3URAl{height:18px;pointer-events:none;position:absolute;right:-53px;top:0;width:124px}.EeDbu9pXFWTsCzfTpv2v{pointer-events:all}.BmSvoIi3rErkcrRiOi2W{color:var(--jp-black);font-size:16px;font-weight:600;line-height:19px}.BmSvoIi3rErkcrRiOi2W:not(:last-child){margin-bottom:8px}.mojRoVuWdDJo0E6LEjJw{font-size:14px;font-weight:400;line-height:24px}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-left:-62px}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-right:-62px}.golden-token-icon-tooltip .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.golden-token-icon-tooltip .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.golden-token-icon-tooltip .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;outline:none;padding:24px;white-space:normal;width:304px}.golden-token-icon-tooltip .components-button.is-link:focus:not(:disabled){box-shadow:none}.wiobThfXJCuhGNrbFIT6 a,.wiobThfXJCuhGNrbFIT6 a:active,.wiobThfXJCuhGNrbFIT6 a:hover{color:var(--jp-black)}.VgAxgahF9bC2M__FiIgV{display:flex;margin-bottom:calc(var(--spacing-base)*3)}.dbRwkMLqcMF67njPoAF7{margin-left:8px}.Doju0RxvvN9JS12mf489{line-height:calc(var(--spacing-base)*3);margin:0 0 var(--spacing-base) 0}.Jvb1njqMy7ML1zikhbWn{margin-top:1rem}.mpr8_ygU8woV4bVR1xvw{align-items:center;display:flex;font-size:var(--font-title-small);font-weight:500;line-height:1.5;margin-bottom:.5rem;margin-top:0}.gwO_Q0L0jbwMARVlBezu{color:var(--jp-gray-60);font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:var(--font-body-small);font-weight:400;letter-spacing:-.15px;line-height:20px;margin-right:.75rem}.qwy7CsLeEbXvaPwgC9WV{display:flex;flex-flow:row nowrap;max-width:100%;overflow-x:scroll;padding:1px;scrollbar-width:none}.qwy7CsLeEbXvaPwgC9WV::-webkit-scrollbar{display:none}.qwy7CsLeEbXvaPwgC9WV .Hrbg7DeSJs6gas9zdPDR{border-color:var(--jp-gray-5);border-radius:5px;margin-bottom:0;margin-left:1.5rem;min-width:180px;padding:1rem 1.5rem;width:100%}@media only screen and (min-width:960px){.qwy7CsLeEbXvaPwgC9WV .Hrbg7DeSJs6gas9zdPDR{min-width:220px}}.qwy7CsLeEbXvaPwgC9WV .Hrbg7DeSJs6gas9zdPDR:last-child{margin-left:0}.NFpbo5AINn6I6avKFGby{margin-bottom:1.5rem}.aoQZCG0JeyWmy2J6vVxF{font-weight:500;line-height:20px;margin-bottom:.25rem}.M6ApyXg79vuXo6GwDkbO{align-items:flex-end;display:flex;flex-wrap:wrap;font-size:36px;font-weight:400;line-height:40px}.M6ApyXg79vuXo6GwDkbO.DYHb5e6QhgXejWyo9s78{cursor:pointer}.OlInbY5YnDO06MEQHv98{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:1;margin-left:.5rem}.EtbKbd5m85w7oYT4stIs{color:var(--jp-gray-20);display:none;font-size:var(--font-body-small);font-weight:600;line-height:24px;fill:var(--jp-gray-20)}@media screen and (min-width:960px){.EtbKbd5m85w7oYT4stIs{align-items:center;display:flex}}.EtbKbd5m85w7oYT4stIs.Awr7zl75sfAsFPHK9kDG{color:var(--jp-red-50);fill:var(--jp-red-50)}.EtbKbd5m85w7oYT4stIs.QFSZbIKFdWO3HEPBZyhc{color:var(--jp-green-50);fill:var(--jp-green-50)}.GgJAnS4gaEEGmRCP5n8y{align-content:flex-end;display:flex}.mjiNtwdbKpfo9edGVes4{margin-left:2px}.pAt4v_KG9Ir19wNcEtEj{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:calc(var(--spacing-base)*2.5);min-height:28px;width:100%}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}.jrGNTKcgeXk9HKzolut9{position:relative}.jrGNTKcgeXk9HKzolut9>.wg3mZsoPekZWlBgOvdZ6{overflow:hidden;padding:0}.jrGNTKcgeXk9HKzolut9>.wg3mZsoPekZWlBgOvdZ6.aDxB89WgtARQqNWd4ZeK:before{background-color:var(--jp-red-50);border:2px solid var(--jp-white-off);border-radius:50%;content:"";height:18px;position:absolute;right:-11px;top:-11px;width:18px}.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR{background-color:var(--jp-white);border-radius:50%;box-shadow:0 0 5px 1px rgba(0,0,0,.1);left:16px;padding:8px;position:absolute;top:16px;transform:scale(.75)}.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR:focus,.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR:hover{background-color:var(--jp-white)}.jrGNTKcgeXk9HKzolut9>.sGP8lxDpRSjt0Fh7wxoR:disabled{pointer-events:none}.z5EQSkU36nsjxHEBSfNN{padding:0}.MwBwVaEj6u_zRgfrFR9b{padding:24px 16px}@media screen and (min-width:600){.MwBwVaEj6u_zRgfrFR9b{padding:32px 24px}}@media screen and (min-width:960px){.MwBwVaEj6u_zRgfrFR9b{padding:48px 48px 48px 12px}}.UgPNtuFW7lTJ06k39EsK{background-image:url(images/evaluation-blank-fbbfbcd75b50ade0f092.png),radial-gradient(circle at 40% 70%,rgba(206,217,242,.75) 0,hsla(0,0%,100%,0) 40%),radial-gradient(circle at 80% 80%,rgba(6,158,8,.15) 5%,hsla(0,0%,100%,0) 50%),radial-gradient(circle at 80% 20%,hsla(46,77%,83%,.75) 0,hsla(0,0%,100%,0) 50%);background-position:25%;background-repeat:no-repeat;background-size:393px,cover,cover,cover}.UgPNtuFW7lTJ06k39EsK.ilVOud0_OCGK4HciazB_{background-image:url(images/evaluation-selected-196d1790b76830f9b73a.png),radial-gradient(circle at 40% 70%,rgba(206,217,242,.75) 0,hsla(0,0%,100%,0) 40%),radial-gradient(circle at 80% 80%,rgba(6,158,8,.15) 5%,hsla(0,0%,100%,0) 50%),radial-gradient(circle at 80% 20%,hsla(46,77%,83%,.75) 0,hsla(0,0%,100%,0) 50%)}.EtcggGK0Bk8POQD986Og{background-image:url(images/site-cards-29522f090d5422fd7afd.png),radial-gradient(circle at 90% 30%,rgba(6,158,8,.15) 0,hsla(0,0%,100%,0) 35%),radial-gradient(circle at 75% 65%,rgba(206,217,242,.5) 5%,hsla(0,0%,100%,0) 15%),radial-gradient(circle at 90% 90%,hsla(46,77%,83%,.5) 0,hsla(0,0%,100%,0) 25%);background-repeat:no-repeat;background-size:cover}@media screen and (max-width:960px){.EtcggGK0Bk8POQD986Og{background-image:url(images/site-cards-29522f090d5422fd7afd.png),radial-gradient(circle at 55% 30%,rgba(6,158,8,.15) 0,hsla(0,0%,100%,0) 100%),radial-gradient(circle at 25% 40%,rgba(206,217,242,.5) 5%,hsla(0,0%,100%,0) 50%),radial-gradient(circle at 50% 85%,hsla(46,77%,83%,.3) 0,hsla(0,0%,100%,0) 35%);min-height:160px;order:-1}}.TSiu5sC6MdANROjUkUJM{margin-top:24px}.iqJfpZM9IYXuFSXvuoEe{font-size:16px!important;margin-top:16px}.Vozbq8Inlk5SxoVnn2G5{column-gap:40px;display:flex;flex-direction:row;margin-top:64px}.s_V1BM1Wtt3He4eF2TCu{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3);text-decoration:none!important}.wXWt0uFLFkFT7CqgOijQ{align-items:center;background-image:radial-gradient(circle at 80% 80%,rgba(6,158,8,.15) 5%,hsla(0,0%,100%,0) 50%);background-position:0 80%;background-repeat:no-repeat;background-size:cover;display:flex;flex-direction:column;justify-content:center;padding:144px 0}.m_muvynofDds3hoh9u5m{margin-bottom:24px}.m_muvynofDds3hoh9u5m svg{color:var(--jp-green-40);height:48px;width:48px}.m_muvynofDds3hoh9u5m svg circle{stroke:var(--jp-green-5)}.m_muvynofDds3hoh9u5m svg circle,.m_muvynofDds3hoh9u5m svg path{stroke-width:4px}.jErCC9oKHSM15BxzFyQK{margin-bottom:0}.oVoYbwbFB6U2o90Njusk>div{background-color:var(--jp-white);font-size:16px;line-height:22px;margin:0;position:relative}.oVoYbwbFB6U2o90Njusk>div .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}@media screen and (min-width:960px){.oVoYbwbFB6U2o90Njusk>div .components-notice__content{gap:6rem}}.oVoYbwbFB6U2o90Njusk>div .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.oVoYbwbFB6U2o90Njusk>div .components-notice__dismiss{align-self:center}.oVoYbwbFB6U2o90Njusk>div .components-notice__action{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;height:auto;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-right:0;margin-top:24px;padding:8px 24px;text-decoration:none}@media screen and (min-width:960px){.oVoYbwbFB6U2o90Njusk>div .components-notice__action{margin-right:calc(var(--spacing-base)*2 + 24px)}}.oVoYbwbFB6U2o90Njusk>div.Snc8NEmDelsbhlH4285s .components-notice__action{margin-right:0;margin-top:0;white-space:nowrap}.oVoYbwbFB6U2o90Njusk>div.Snc8NEmDelsbhlH4285s .components-notice__content{align-items:center;flex-direction:row}.oVoYbwbFB6U2o90Njusk .R5tvcsARTGN0A_z3DygA{min-width:auto}.wBVXH4OTNwLHPRpN4nsq{display:flex;flex-grow:1;margin-left:var(--spacing-base)}.wBVXH4OTNwLHPRpN4nsq .terms-of-service{color:var(--jp-gray-70);font-size:var(--font-body-small)}.wBVXH4OTNwLHPRpN4nsq>svg{fill:var(--jp-red-60);align-self:flex-start;flex-shrink:0;margin-left:calc(var(--spacing-base)*2)}.wBVXH4OTNwLHPRpN4nsq>svg.F1qvEnFfHs5nz3zFZUOV{fill:none}.SrQxAOBa5ZaSKP8wlut9{border-bottom:none;margin:0}.TcCZnGE6mad8Dvz9pCZi{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+PHBhdGggc3Ryb2tlPSIjRDYzNjM5IiBzdHJva2Utd2lkdGg9IjEuNSIgZD0iTTEyIDIwYTggOCAwIDEgMCAwLTE2IDggOCAwIDAgMCAwIDE2WiIvPjxwYXRoIGZpbGw9IiNENjM2MzkiIGQ9Ik0xMyA3aC0ydjZoMnpNMTMgMTVoLTJ2MmgyeiIvPjwvc3ZnPg==) no-repeat 100% 0;color:var(--jp-red);line-height:25px;padding-right:25px}._mn6o2Dtm5pfFWc8_A1K{--spacing-base:8px;min-width:264px}.VHYulMcpzbr10HWR0iSE{align-items:flex-start;border:1px solid var(--jp-black);border-color:var(--jp-gray-5);border-radius:4px;border-right-width:6px;display:flex;font-size:var(--font-body);padding:24px 18px 27px 31px}.FGpSkMCiIHQjszcV0dbn{margin-left:20px}.FGpSkMCiIHQjszcV0dbn,.KoWZcCwhW13xvkEb0QON{height:calc(var(--spacing-base)*3);width:calc(var(--spacing-base)*3)}.KoWZcCwhW13xvkEb0QON{background-color:transparent;border:none;cursor:pointer;outline:none}@media screen and (max-width:600px){.VHYulMcpzbr10HWR0iSE{box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);padding-top:68px;position:relative}.FGpSkMCiIHQjszcV0dbn{position:absolute;right:24px;top:24px}.KoWZcCwhW13xvkEb0QON{left:24px;position:absolute;top:24px}}.smrfczkC53EaFM8OJUXs{flex-grow:1}.IKYRWoPwt9xOVEx1wzNS{font-weight:600;margin-bottom:8px}.qM0qY6mPYp1MPN54A3Kg{align-items:center;display:flex;margin-top:20px}.qM0qY6mPYp1MPN54A3Kg a,.qM0qY6mPYp1MPN54A3Kg a:active,.qM0qY6mPYp1MPN54A3Kg a:focus,.qM0qY6mPYp1MPN54A3Kg a:hover{color:var(--jp-black)}.qM0qY6mPYp1MPN54A3Kg>*{margin-left:24px}.A5YkDkkXuiYgavrY6Nux{border-right-color:var(--jp-red)}.A5YkDkkXuiYgavrY6Nux .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-red)}.cT5rwuPMZzWvi5o6shMl{border-right-color:var(--jp-yellow-20)}.cT5rwuPMZzWvi5o6shMl .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-yellow-20)}.yo0O3uvNomPsYUXFCpAS{border-right-color:var(--black)}.yo0O3uvNomPsYUXFCpAS .y_IPyP1wIAOhyNaqvXJq{fill:var(--black)}.oZdDFf1jBLkzn5ICCC6x{border-right-color:var(--jp-green)}.oZdDFf1jBLkzn5ICCC6x .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-green)}.cAbGtJDGgLubucBnz7vM,.q0T8YyQxRawhpDtvJjxI{background-color:var(--jp-white)}.q0T8YyQxRawhpDtvJjxI{height:100%;padding:calc(var(--spacing-base)*8);position:relative}.B7JDqI_vtKxSy5GjvqA1{display:flex;flex-direction:column;height:100%}.zj7xadmhIWeuf7ZwvVTS{align-items:center;background:var(--jp-black);border-radius:var(--jp-border-radius) var(--jp-border-radius) 0 0;color:var(--jp-white);display:flex;height:calc(var(--spacing-base)*4);padding:0 var(--spacing-base);position:absolute;right:0;top:0;width:100%}.GsioW6IsC8EMYE3U6788{fill:var(--jp-white);margin-left:var(--spacing-base)}.cfEO8udWbRGPFJzW8Jg5,.dbz07JqxOlivjKO4vBEF{align-items:center;display:flex;height:calc(var(--spacing-base)*4);margin-bottom:calc(var(--spacing-base)*4)}.zlh3zbjUe4Z8cBs7uVVe{fill:#8c8f94;height:24px;line-height:24px}.qoZuzG5EcDa231hC6t0P{align-items:center;display:flex;justify-content:center}.qoZuzG5EcDa231hC6t0P svg{margin-left:var(--spacing-base)}.Q6uUUQCPWS6_6nLxIn68{display:inline-block;min-height:42px;padding:.5em 2em;text-align:center;width:100%}.Q6uUUQCPWS6_6nLxIn68 .YU4iBCRze09ZP3iCsdcb{margin:0}.Q6uUUQCPWS6_6nLxIn68.components-button.is-primary{height:auto;white-space:normal}.Q6uUUQCPWS6_6nLxIn68.is-secondary:hover:not(:disabled){background-color:var(--jp-black);color:var(--jp-white)}.OrQG7DjDd9Ha2Xj1Mx3L{margin-top:calc(var(--spacing-base)*2)}.Q1jaYDpa2AVfJpA29wT0{flex-grow:1;margin:0;margin-bottom:calc(var(--spacing-base)*2);padding:0}.Q1jaYDpa2AVfJpA29wT0 li{align-items:flex-start;display:flex;list-style:none;margin-bottom:var(--spacing-base)}.Q1jaYDpa2AVfJpA29wT0 svg{fill:var(--jp-green-primary);flex-shrink:0;margin-left:var(--spacing-base)}.HL4gSxsF0skYGhGuqH90 li:last-of-type{font-weight:700}.sEcLfpWjo0GF7QrxD3Lt{margin-top:calc(var(--spacing-base)*2)}.xgv3jRkeF39aEQELCwru{align-items:flex-end;color:var(--jp-black);display:flex;flex-wrap:wrap}.twlleZ5Ehq4bB7CvKVSW{position:relative}.twlleZ5Ehq4bB7CvKVSW:first-child{margin-left:calc(var(--spacing-base)*2)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8{color:var(--jp-gray-20)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.ApsgxIornVy_3KnciVeJ{color:var(--jp-gray-40);margin-bottom:calc(var(--spacing-base)*3)}.NMxcZL17aEP7v81uG3zD{margin-top:calc(var(--spacing-base)*5)}.gCTKfAPzJqZas7CaRbKN{margin-bottom:calc(var(--spacing-base)*4)}.demNsMJjhi7BLY7xhjU5{align-items:center;display:flex;font-size:var(--font-body);line-height:calc(var(--spacing-base)*3);margin:calc(var(--spacing-base)*2) 0;min-height:calc(var(--spacing-base)*3)}.QiUjdjJSkqh6nH7YMG5A{align-self:flex-start;height:calc(var(--spacing-base)*3);margin-left:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*3)}.Q080AHcq29J2fc68Hhk5{color:var(--jp-red)}.Q080AHcq29J2fc68Hhk5 .hYWbIwhppukXmGnsiT9H{fill:var(--jp-red)}.JjHuxWly0HI9C60gorbq{color:var(--jp-yellow-40)}.JjHuxWly0HI9C60gorbq .hYWbIwhppukXmGnsiT9H{fill:var(--jp-yellow-40)}.Cm8ZFHi3mngl4cj9Gatx{color:var(--jp-blue-40)}.Cm8ZFHi3mngl4cj9Gatx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-blue-40)}.ytGBsU015p3LGwOPwFDx{color:var(--jp-green)}.ytGBsU015p3LGwOPwFDx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-green)}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-5:#f5e6b3;--jp-yellow-10:#f2cf75;--jp-yellow-40:#c08c00;--jp-orange-20:#faa754;--jp-blue-5:#ced9f2;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-border-radius-rna:8px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px;--jp-highlight:#3858e9}:where(body){font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(-8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-left:-62px}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-right:-62px}.icon-tooltip-helper .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.icon-tooltip-helper .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.icon-tooltip-helper.is-wide .components-popover__content{width:440px}.icon-tooltip-wrapper{color:var(--jp-black);display:inline-block;position:relative}.icon-tooltip-wrapper .components-button.is-link:focus:not(:disabled){box-shadow:none}.icon-tooltip-helper{height:18px;pointer-events:none;position:absolute;right:-53px;top:0;width:124px}.icon-tooltip-container{pointer-events:all}.icon-tooltip-container .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;margin:0 10px;max-width:90vw;outline:none;padding:24px;white-space:normal;width:304px}.icon-tooltip-title{font-size:16px;font-weight:600;line-height:19px}.icon-tooltip-title:not(:last-child){margin-bottom:8px}.icon-tooltip-content{font-size:14px;font-weight:400;line-height:24px}.icon-tooltip-content ul{list-style-type:disc;margin:0 1rem 0 0}.icon-tooltip-content ul li:last-child{margin-bottom:0}.p4qz2tkq0p9hxucJ6Qk2{--padding:calc(var(--spacing-base)*4);color:var(--jp-black)}.lbNDyXioOwvyvbALtCBm{--gap:calc(var(--spacing-base)*3);padding:var(--padding) 0;position:relative}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm{column-gap:var(--gap);display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--columns),1fr);grid-template-rows:repeat(var(--rows),minmax(min-content,max-content))}.cLaNK_XcbTGlRQ4Tp43Q{margin-top:var(--padding)}.s2Lsn4kbm6BrS3DSndRB .cLaNK_XcbTGlRQ4Tp43Q{display:contents}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>*{background:var(--jp-white);position:relative}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>:after{bottom:0;box-shadow:0 4px 24px rgba(0,0,0,.05);content:"";left:0;position:absolute;right:0;top:0;z-index:-1}.cLaNK_XcbTGlRQ4Tp43Q>:first-child{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius);border-width:1px 1px 0}.cLaNK_XcbTGlRQ4Tp43Q>:last-child{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius);border-width:0 1px 1px}.DAkZc1P9A3K12fjEliMg{display:flex;flex-direction:column;justify-content:space-between;padding:var(--padding)}.WUBuYABl8nymjs9NnCEL{align-items:center;display:flex;padding-bottom:calc(var(--spacing-base)*2);position:relative}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)){padding-top:calc(var(--spacing-base)*2)}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{background-color:var(--jp-gray);content:"";height:1px;left:var(--padding);position:absolute;right:var(--padding);top:0;z-index:5}.s2Lsn4kbm6BrS3DSndRB .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{left:unset;right:0;width:calc(100% + var(--gap))}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm>:last-child .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{width:100%}.ANtCFeb41NhA8PA3H7ZN,.WUBuYABl8nymjs9NnCEL:last-of-type{padding-bottom:var(--padding)}.Ql2gy_148yW8Vw5vhaKD{padding-left:var(--padding);padding-right:var(--padding)}.EAQrAnQEW1z1BfdY5gbC{margin:0 var(--spacing-base);fill:var(--jp-gray);flex-shrink:0}.EAQrAnQEW1z1BfdY5gbC.JDSTlLoOC_4aUoH2oNM2{fill:var(--jp-green-40)}.EAQrAnQEW1z1BfdY5gbC.zNdQRJ1w7BvaQOYyqzHK{fill:var(--jp-red-50)}.lr7vbX95SKtoe7DarJcZ{margin-right:auto}.s2Lsn4kbm6BrS3DSndRB .lr7vbX95SKtoe7DarJcZ{margin:0 var(--spacing-base);top:1px}.WUBuYABl8nymjs9NnCEL .KRrGp2xdkeBOxLZeuQ6X{fill:var(--jp-gray-20);flex-shrink:0}.H_ZJiRVJg0LiMXPGOcmt{text-align:center;width:fit-content}.H_ZJiRVJg0LiMXPGOcmt>a{color:#000}.s2Lsn4kbm6BrS3DSndRB .H_ZJiRVJg0LiMXPGOcmt{grid-column:2;overflow:hidden;padding-left:var(--padding);padding-right:var(--padding);white-space:nowrap}.x21z_DixObRDsDaWotP1{align-items:right;display:flex;justify-content:right;margin:0 calc(var(--spacing-base)*4)}.dovianZYLKhnbnh9I06o{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-end}.lljtQMhW7lq5tE5SDJEf{align-items:flex-start;display:flex;flex-basis:0;flex-grow:2}.lljtQMhW7lq5tE5SDJEf .NubApIV1vQCRUNprfm6b{margin-right:auto}.dhFQXpZfMwVI8vuYHnwC{align-items:flex-start;display:inline-flex;flex:0 0 auto;position:relative}.dhFQXpZfMwVI8vuYHnwC:first-child{margin-left:calc(var(--spacing-base)*2)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k{color:var(--jp-gray-20)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.C64ZjjUAqJC1T2Sa7apS{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start;margin-bottom:calc(var(--spacing-base)*3)}.UpZDGew6Ay1hPoP6eI7b{color:var(--jp-gray-40);font-size:var(--font-body-small);line-height:20px}.UpZDGew6Ay1hPoP6eI7b:after{content:"​"}.NubApIV1vQCRUNprfm6b{background-color:var(--jp-yellow-10);border-radius:4px;font-size:13px;font-weight:600;margin-right:var(--spacing-base);padding-left:var(--spacing-base);padding-right:var(--spacing-base)}.TDiiPbuW1Z0_05u_pvcK{font-weight:400}.SWwV4Pw6OZ5vU3PqPXmr{--product-card-shadow:rgb(0 0 0/3%);background-color:var(--jp-white);border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);box-shadow:0 2px 6px var(--product-card-shadow),0 1px 2px var(--product-card-shadow)}.r7tUofa9Z3A5ziKVR1H7{align-items:center;display:flex}.r7tUofa9Z3A5ziKVR1H7 img{object-fit:cover;width:100%}.i_AnOR3MaQLraGvb2QU5{background-color:#f9f9f6}.YcYvLvdvWrb1EUZoVsE8{display:flex;flex-wrap:wrap;gap:calc(var(--horizontal-spacing)*2);justify-content:space-between}.uGTTsKoIOoZdYhk6uPnl{white-space:nowrap}.uGTTsKoIOoZdYhk6uPnl>span{font-size:var(--font-body-small)}.NzDTsxhX8D1mlckNpewR{font-weight:400!important}.svE2cJL5t2FarzcDQYNe{--product-card-shadow:rgb(0 0 0/3%);background-color:var(--jp-white);border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);box-shadow:0 2px 6px var(--product-card-shadow),0 1px 2px var(--product-card-shadow)}.dvEJEDNTnmVfVxtLa4uU{align-items:center;display:flex}.dvEJEDNTnmVfVxtLa4uU img{object-fit:cover;width:100%}.K1VY4DNP8PHMWAEVBC_h{background-color:#f9f9f6}.nk_COGPrkBNLp7lVt4sQ{display:flex;flex-wrap:wrap;gap:calc(var(--horizontal-spacing)*2);justify-content:space-between}.ukgQ5TmLablG3svUKjdw{white-space:nowrap}.ukgQ5TmLablG3svUKjdw>span{font-size:var(--font-body-small)}.Vofm70ADXSe43GamWEaF{font-weight:400!important}.EUcF2LKeC2GyhWD2FKCP{background-color:var(--jp-white);height:100%;padding:calc(var(--spacing-base)*8);position:relative}.Bm21LIBQtpRo3ZhOxXBG{display:flex;gap:calc(var(--spacing-base)*2)}.jwIGzADCnBI_ai9xYYiS{align-items:center;display:flex;flex-wrap:nowrap;font-size:22px;padding-bottom:calc(var(--spacing-base)*3);padding-top:calc(var(--spacing-base)*3)}.jwIGzADCnBI_ai9xYYiS .fTbxuhh_SfMgenyWvGN0{padding-bottom:calc(var(--spacing-base)/3);padding-right:var(--spacing-base)}.eR56lApoP14RIBAhO1UN{display:flex;flex-wrap:wrap;gap:calc(var(--spacing-base)*6);justify-content:space-between;margin:0 auto;max-width:1128px}@media only screen and (max-width:1366px){.eR56lApoP14RIBAhO1UN{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3)}}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD{display:flex;flex:1;flex-direction:column;justify-content:center}@media screen and (min-width:960px){.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD{max-width:70%}}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD .vAGLpjIGi6GA8ghbumN7{font-size:36px;font-weight:700;line-height:40px}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD .oag8YaslCEiUVu8GKKL3{font-weight:400;margin:calc(var(--spacing-base)*3) 0}.eR56lApoP14RIBAhO1UN .vHnITd5JOCOgxCgXTgoD .FhH03GPt9FK1VH9NZhYA{align-self:flex-start;font-size:16px;font-weight:500;letter-spacing:-.01em;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.eR56lApoP14RIBAhO1UN .VUXAtah2JvUCNc4cXjPp{align-items:center;display:flex;flex-wrap:wrap;gap:calc(var(--spacing-base)*3);justify-content:flex-end}@media only screen and (max-width:430px){.eR56lApoP14RIBAhO1UN .VUXAtah2JvUCNc4cXjPp{flex:1}}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw{border-color:var(--jp-gray-5);border-radius:5px;flex-grow:0;height:168px;margin-bottom:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);width:168px}@media only screen and (max-width:960px){.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw{width:30vw}}@media only screen and (max-width:430px){.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw{min-width:168px;width:100%}}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw>div:first-child{display:flex;flex-direction:column;justify-content:space-between}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw .Ll1l9bEuf5G5oh3AENep{fill:var(--jp-green)}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw .WrzTysWiqUiuEPvpFqau{margin-bottom:var(--spacing-base)}.eR56lApoP14RIBAhO1UN .dyPAjc3M4y3Q6gJfWnjw .d4faYkf9yL7oW7pwcjmP{font-size:36px;font-weight:700}.acffvOSYc5S8x4P_AYnQ{font-size:16px;line-height:24px;padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6)}.acffvOSYc5S8x4P_AYnQ:first-child{padding-bottom:0;padding-top:0}.acffvOSYc5S8x4P_AYnQ:nth-child(2n){background-color:var(--jp-white-off);padding-bottom:calc(var(--spacing-base)*8);padding-top:calc(var(--spacing-base)*8)}@media only screen and (max-width:960px){.acffvOSYc5S8x4P_AYnQ:nth-child(2n){padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6)}}.acffvOSYc5S8x4P_AYnQ a{color:inherit}.acffvOSYc5S8x4P_AYnQ .M5YNmgy60Q_UtaxKgQcv{margin:0 auto;max-width:744px}@media only screen and (max-width:1366px){.acffvOSYc5S8x4P_AYnQ .M5YNmgy60Q_UtaxKgQcv{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3)}}.acffvOSYc5S8x4P_AYnQ .HJiOvun8sHkiFpNL0sl6{margin:0 auto;max-width:1128px}@media only screen and (max-width:1366px){.acffvOSYc5S8x4P_AYnQ .HJiOvun8sHkiFpNL0sl6{padding-left:calc(var(--spacing-base)*3);padding-right:calc(var(--spacing-base)*3)}}.acffvOSYc5S8x4P_AYnQ .mXinUJfpSTS9EVB8M8K_{font-size:34px;font-weight:400;line-height:40px;margin:0}.acffvOSYc5S8x4P_AYnQ .QKjsnliPyLu4n08yVUUM{font-size:16px}.acffvOSYc5S8x4P_AYnQ .xQJJkJ4v7Jm8iSJ0z0Dj{font-size:48px;line-height:24px;margin-bottom:calc(var(--spacing-base)*6)}.VWIBGwuHqtAKg_5Hch92{flex-direction:column}.VWIBGwuHqtAKg_5Hch92,.VWIBGwuHqtAKg_5Hch92 .mnkNhprYIatxfziERMwM{display:flex;gap:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2) 0}.VWIBGwuHqtAKg_5Hch92 .mnkNhprYIatxfziERMwM{flex-wrap:wrap;min-height:190px}.VWIBGwuHqtAKg_5Hch92 .WEiaYLqJwV2IzC8LD9Fs{background-color:var(--jp-white-off);border-radius:calc(var(--spacing-base)/2);height:157.5px;width:280px}.VWIBGwuHqtAKg_5Hch92 .WEiaYLqJwV2IzC8LD9Fs iframe{border-radius:inherit}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU{display:flex;flex:1;flex-direction:column;gap:var(--spacing-base);min-width:280px}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU ._OeUvI9GrP00qh6Uk7Tg{font-size:20px;font-weight:500;line-height:22px}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU .C6I5jYHW2IJSDBoKvhcB{color:var(--jp-gray-60);flex-grow:1;font-size:16px;font-weight:300;line-height:24px}.VWIBGwuHqtAKg_5Hch92 .GJlowVsJybna1MFcIiIU .XdnAdAwkxAW5yvUx3NRr{font-size:15px;padding-right:0;text-decoration:underline}.MCKgMfLVZtkgWu5m5u6L{margin-bottom:calc(var(--spacing-base)*8)}.c0SItK48SRkWfZUCECbZ{border:1px solid var(--jp-green-40);border-radius:4px;color:var(--jp-green-40);font-size:12px;font-weight:500;height:22px;margin-right:5px;padding:2px 8px;position:relative;text-transform:uppercase;top:-2px}#my-jetpack-container{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);height:100%}#my-jetpack-container .jp-dashboard-footer__jetpack-symbol{height:16px}#wpbody-content>.notice{display:none!important}#wpwrap{background-color:var(--jp-white-off)}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/composer.json new file mode 100644 index 00000000..1ee21482 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/composer.json @@ -0,0 +1,91 @@ +{ + "name": "automattic/jetpack-my-jetpack", + "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-admin-ui": "^0.4.5", + "automattic/jetpack-assets": "^2.3.7", + "automattic/jetpack-boost-speed-score": "^0.3.12", + "automattic/jetpack-connection": "^4.0.1", + "automattic/jetpack-explat": "^0.1.7", + "automattic/jetpack-jitm": "^3.1.21", + "automattic/jetpack-licensing": "^2.0.9", + "automattic/jetpack-plugins-installer": "^0.4.3", + "automattic/jetpack-redirect": "^2.0.4", + "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-plans": "^0.4.10", + "automattic/jetpack-status": "^4.0.1", + "automattic/jetpack-sync": "^3.10.0", + "automattic/jetpack-protect-status": "^0.1.5" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/", + "src/products" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "test-js": [ + "pnpm run test" + ], + "test-js-watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run test --watch" + ], + "build-development": [ + "pnpm run build" + ], + "build-production": [ + "NODE_ENV=production pnpm run build" + ], + "watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run watch" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-my-jetpack", + "textdomain": "jetpack-my-jetpack", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "4.35.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-initializer.php" + }, + "dependencies": { + "test-only": [ + "packages/search", + "packages/videopress" + ] + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/global.d.ts b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/global.d.ts new file mode 100644 index 00000000..2484b4a5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/global.d.ts @@ -0,0 +1,430 @@ +declare module '*.png'; +declare module '*.svg'; +declare module '*.jpeg'; +declare module '*.jpg'; +declare module '*.scss'; + +// These libraries don't have types, this suppresses the TypeScript errors +declare module '@wordpress/components'; +declare module '@wordpress/compose'; +declare module '@wordpress/icons'; +declare module '@automattic/jetpack-connection'; +declare module '@wordpress/url'; + +type ProductStatus = + | 'active' + | 'inactive' + | 'module_disabled' + | 'site_connection_error' + | 'plugin_absent' + | 'plugin_absent_with_plan' + | 'needs_plan' + | 'needs_activation' + | 'needs_first_site_connection' + | 'user_connection_error' + | 'can_upgrade'; + +type JetpackModule = + | 'anti-spam' + | 'backup' + | 'boost' + | 'crm' + | 'creator' + | 'extras' + | 'ai' + | 'jetpack-ai' + | 'scan' + | 'search' + | 'social' + | 'security' + | 'protect' + | 'videopress' + | 'stats'; + +type ThreatItem = { + // Protect API properties (free plan) + id: string; + title: string; + fixed_in: string; + description: string | null; + source: string | null; + // Scan API properties (paid plan) + context: string | null; + filename: string | null; + first_detected: string | null; + fixable: boolean | null; + severity: number | null; + signature: string | null; + status: number | null; +}; + +type ScanItem = { + checked: boolean; + name: string; + slug: string; + threats: ThreatItem[]; + type: string; + version: string; +}; + +interface Window { + myJetpackInitialState?: { + siteSuffix: string; + siteUrl: string; + latestBoostSpeedScores: { + previousScores: { + desktop: number; + mobile: number; + }; + scores: { + desktop: number; + mobile: number; + }; + theme: string; + timestamp: number; + }; + IDCContainerID: string; + adminUrl: string; + blogID: string; + fileSystemWriteAccess: 'yes' | 'no'; + isStatsModuleActive: string; + isUserFromKnownHost: string; + jetpackManage: { + isAgencyAccount: boolean; + isEnabled: boolean; + }; + loadAddLicenseScreen: string; + myJetpackCheckoutUri: string; + myJetpackFlags: { + showFullJetpackStatsCard: boolean; + videoPressStats: boolean; + }; + lifecycleStats: { + historicallyActiveModules: JetpackModule[]; + brokenModules: { + needs_site_connection: JetpackModule[]; + needs_user_connection: JetpackModule[]; + }; + isSiteConnected: boolean; + isUserConnected: boolean; + jetpackPlugins: Array< string >; + ownedProducts: JetpackModule[]; + unownedProducts: JetpackModule[]; + modules: Array< string >; + purchases: Array< string >; + }; + myJetpackUrl: string; + myJetpackVersion: string; + plugins: { + [ key: string ]: { + Name: string; + PluginURI: string; + Version: string; + Title: string; + Description: string; + Author: string; + AuthorName: string; + AuthorURI: string; + DomainPath: string; + textDomain: string; + RequiresPHP: string; + RequiresWP: string; + UpdateURI: string; + Network: boolean; + active: boolean; + }; + }; + products: { + items: { + [ key: string ]: { + class: string; + description: string; + disclaimers: Array< string[] >; + features: string[]; + has_free_offering: boolean; + has_paid_plan_for_product: boolean; + features_by_tier: Array< string >; + is_bundle: boolean; + is_plugin_active: boolean; + is_upgradable: boolean; + is_upgradable_by_bundle: string[]; + long_description: string; + manage_url: string; + name: string; + plugin_slug: string; + post_activation_url: string; + post_checkout_url?: string; + pricing_for_ui?: { + available: boolean; + wpcom_product_slug: string; + wpcom_free_product_slug?: string; + product_term: string; + currency_code: string; + full_price: number; + discount_price: number; + coupon_discount: number; + is_introductory_offer: boolean; + introductory_offer?: { + cost_per_interval: number; + interval_count: number; + interval_unit: string; + should_prorate_when_offer_ends: boolean; + transition_after_renewal_count: number; + usage_limit?: number; + }; + tiers?: { + [ key: string ]: { + available: boolean; + currencyCode: string; + discountPrice: number; + fullPrice: number; + introductoryOffer?: { + costPerInterval: number; + intervalCount: number; + intervalUnit: string; + shouldProrateWhenOfferEnds: boolean; + transitionAfterRenewalCount: number; + usageLimit?: number; + }; + isIntroductoryOffer: boolean; + productTerm: string; + wpcomProductSlug: string; + quantity: number; + }; + }; + }; + purchase_url?: string; + requires_user_connection: boolean; + slug: string; + standalone_plugin_info: { + has_standalone_plugin: boolean; + is_standalone_installed: boolean; + is_standalone_active: boolean; + }; + status: ProductStatus; + supported_products: string[]; + tiers: string[]; + title: string; + wpcom_product_slug: string; + }; + }; + }; + protect: { + scanData: { + core: ScanItem; + current_progress?: string; + data_source: string; + database: string[]; + error: boolean; + error_code?: string; + error_message?: string; + files: string[]; + has_unchecked_items: boolean; + last_checked: string; + num_plugins_threats: number; + num_themes_threats: number; + num_threats: number; + plugins: ScanItem[]; + status: string; + themes: ScanItem[]; + }; + wafConfig: { + automatic_rules_available: boolean; + blocked_logins: number; + bootstrap_path: string; + brute_force_protection: boolean; + jetpack_waf_automatic_rules: '1' | ''; + jetpack_waf_ip_allow_list: '1' | ''; + jetpack_waf_ip_block_list: boolean; + jetpack_waf_ip_list: boolean; + jetpack_waf_share_data: '1' | ''; + jetpack_waf_share_debug_data: boolean; + standalone_mode: boolean; + }; + }; + videopress: { + featuredStats?: { + label: string; + period: 'day' | 'year'; + data: { + views: { + current: number; + previous: number; + }; + impressions: { + current: number; + previous: number; + }; + watch_time: { + current: number; + previous: number; + }; + }; + }; + videoCount: number; + }; + purchases: { + items: Array< { + ID: string; + user_id: string; + blog_id: string; + product_id: string; + subscribed_date: string; + renew: string; + auto_renew: string; + renew_date: string; + inactive_date: string | null; + active: string; + meta: string | object; + ownership_id: string; + most_recent_renew_date: string; + amount: number; + expiry_date: string; + expiry_message: string; + expiry_sub_message: string; + expiry_status: string; + partner_name: string | null; + partner_slug: string | null; + partner_key_id: string | null; + subscription_status: string; + product_name: string; + product_slug: string; + product_type: string; + blog_created_date: string; + blogname: string; + domain: string; + description: string; + attached_to_purchase_id: string | null; + included_domain: string; + included_domain_purchase_amount: number; + currency_code: string; + currency_symbol: string; + renewal_price_tier_slug: string | null; + renewal_price_tier_usage_quantity: number | null; + current_price_tier_slug: string | null; + current_price_tier_usage_quantity: number | null; + price_tier_list: Array< object >; + price_text: string; + bill_period_label: string; + bill_period_days: number; + regular_price_text: string; + regular_price_integer: number; + product_display_price: string; + price_integer: number; + is_cancelable: boolean; + can_explicit_renew: boolean; + can_disable_auto_renew: boolean; + can_reenable_auto_renewal: boolean; + iap_purchase_management_link: string | null; + is_iap_purchase: boolean; + is_locked: boolean; + is_refundable: boolean; + refund_period_in_days: number; + is_renewable: boolean; + is_renewal: boolean; + has_private_registration: boolean; + refund_amount: number; + refund_integer: number; + refund_currency_symbol: string; + refund_text: string; + refund_options: object | null; + total_refund_amount: number; + total_refund_integer: number; + total_refund_currency: string; + total_refund_text: string; + check_dns: boolean; + } >; + }; + redBubbleAlerts: { + 'missing-connection'?: { + type: string; + is_error: boolean; + }; + 'welcome-banner-active'?: null; + [ key: `${ string }-bad-installation` ]: { + data: { + plugin: string; + }; + }; + }; + recommendedModules: { + modules: JetpackModule[] | null; + dismissed: boolean; + }; + themes: { + [ key: string ]: { + Author: string; + Name: string; + RequiresPHP: string; + RequiresWP: string; + Status: string; + Template: string; + TextDomain: string; + ThemeURI: string; + Version: string; + active: boolean; + is_block_theme: boolean; + }; + }; + topJetpackMenuItemUrl: string; + isAtomic: boolean; + userIsAdmin: string; + userIsNewToJetpack: string; + }; + JP_CONNECTION_INITIAL_STATE: { + apiRoot: string; + apiNonce: string; + registrationNonce: string; + connectionStatus: { + isActive: boolean; + isStaging: boolean; + isRegistered: boolean; + isUserConnected: boolean; + hasConnectedOwner: boolean; + offlineMode: { + isActive: boolean; + constant: boolean; + url: boolean; + filter: boolean; + wpLocalConstant: boolean; + }; + isPublic: boolean; + }; + userConnectionData: { + currentUser: { + isConnected: boolean; + isMaster: boolean; + username: string; + id: number; + blogId: number; + wpcomUser: { + avatar: boolean; + }; + gravatar: string; + permissions: { + admin_page?: boolean; + connect: boolean; + connect_user: boolean; + disconnect: boolean; + edit_posts?: boolean; + manage_modules?: boolean; + manage_options?: boolean; + manage_plugins?: boolean; + network_admin?: boolean; + network_sites_page?: boolean; + publish_posts?: boolean; + view_stats?: boolean; + }; + }; + connectionOwner: null; + }; + connectedPlugins: object; + wpVersion: string; + siteSuffix: string; + connectionErrors: Array< string | object >; + }; + myJetpackRest?: { + apiRoot: string; + apiNonce: string; + }; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php new file mode 100644 index 00000000..4de90c07 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php @@ -0,0 +1,57 @@ +is_user_connected() ) { + return; + } + + // Do not display the menu on Multisite. + if ( is_multisite() ) { + return; + } + + $args = array(); + + $blog_id = Connection_Manager::get_site_id( true ); + if ( $blog_id ) { + $args = array( 'site' => $blog_id ); + } + + return Admin_Menu::add_menu( + __( 'Activity Log', 'jetpack-my-jetpack' ), + _x( 'Activity Log', 'product name shown in menu', 'jetpack-my-jetpack' ) . ' ', + 'manage_options', + esc_url( Redirect::get_url( 'cloud-activity-log-wp-menu', $args ) ), + null, + 8 + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php new file mode 100644 index 00000000..f6763bec --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php @@ -0,0 +1,960 @@ +initialize(); + } + + // Initialize Boost Speed Score + new Speed_Score( array(), 'jetpack-my-jetpack' ); + + // Add custom WP REST API endoints. + add_action( 'rest_api_init', array( __CLASS__, 'register_rest_endpoints' ) ); + + $page_suffix = Admin_Menu::add_menu( + __( 'My Jetpack', 'jetpack-my-jetpack' ), + __( 'My Jetpack', 'jetpack-my-jetpack' ), + 'edit_posts', + 'my-jetpack', + array( __CLASS__, 'admin_page' ), + -1 + ); + + add_action( 'load-' . $page_suffix, array( __CLASS__, 'admin_init' ) ); + add_action( 'admin_init', array( __CLASS__, 'setup_historically_active_jetpack_modules_sync' ) ); + // This is later than the admin-ui package, which runs on 1000 + add_action( 'admin_init', array( __CLASS__, 'maybe_show_red_bubble' ), 1001 ); + + //  Set up the ExPlat package endpoints + ExPlat::init(); + + // Sets up JITMS. + JITM::configure(); + + // Add "Activity Log" menu item. + Activitylog::init(); + + // Add "Jetpack Manage" menu item. + Jetpack_Manage::init(); + + /** + * Fires after the My Jetpack package is initialized + * + * @since 0.1.0 + */ + do_action( 'my_jetpack_init' ); + } + + /** + * Acts as a feature flag, returning a boolean for whether we should show the licensing UI. + * + * @since 1.2.0 + * + * @return boolean + */ + public static function is_licensing_ui_enabled() { + // Default changed to true in 1.5.0. + $is_enabled = true; + + /* + * Bail if My Jetpack is not enabled, + * and thus the licensing UI shouldn't be enabled either. + */ + if ( ! self::should_initialize() ) { + $is_enabled = false; + } + + /** + * Acts as a feature flag, returning a boolean for whether we should show the licensing UI. + * + * @param bool $is_enabled Defaults to true. + * + * @since 1.2.0 + * @since 1.5.0 Update default value to true. + */ + return apply_filters( + 'jetpack_my_jetpack_should_enable_add_license_screen', + $is_enabled + ); + } + + /** + * Callback for the load my jetpack page hook. + * + * @return void + */ + public static function admin_init() { + self::$site_info = self::get_site_info(); + add_filter( 'identity_crisis_container_id', array( static::class, 'get_idc_container_id' ) ); + add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); + // Product statuses are constantly changing, so we never want to cache the page. + header( 'Cache-Control: no-cache, no-store, must-revalidate' ); + header( 'Pragma: no-cache' ); + header( 'Expires: 0' ); + } + + /** + * Returns whether we are in condition to track to use + * Analytics functionality like Tracks, MC, or GA. + */ + public static function can_use_analytics() { + $status = new Status(); + $connection = new Connection_Manager(); + $tracking = new Tracking( 'jetpack', $connection ); + + return $tracking->should_enable_tracking( new Terms_Of_Service(), $status ); + } + /** + * Enqueue admin page assets. + * + * @return void + */ + public static function enqueue_scripts() { + Assets::register_script( + 'my_jetpack_main_app', + '../build/index.js', + __FILE__, + array( + 'enqueue' => true, + 'in_footer' => true, + 'textdomain' => 'jetpack-my-jetpack', + ) + ); + $modules = new Modules(); + $connection = new Connection_Manager(); + $speed_score_history = new Speed_Score_History( get_site_url() ); + $latest_score = $speed_score_history->latest(); + $previous_score = array(); + if ( $speed_score_history->count() > 1 ) { + $previous_score = $speed_score_history->latest( 1 ); + } + $latest_score['previousScores'] = $previous_score['scores'] ?? array(); + $scan_data = Protect_Status::get_status(); + self::update_historically_active_jetpack_modules(); + + $waf_config = array(); + if ( class_exists( 'Automattic\Jetpack\Waf\Waf_Runner' ) ) { + $waf_config = Waf_Runner::get_config(); + } + + wp_localize_script( + 'my_jetpack_main_app', + 'myJetpackInitialState', + array( + 'products' => array( + 'items' => Products::get_products(), + ), + 'purchases' => array( + 'items' => array(), + ), + 'plugins' => Plugins_Installer::get_plugins(), + 'themes' => Sync_Functions::get_themes(), + 'myJetpackUrl' => admin_url( 'admin.php?page=my-jetpack' ), + 'myJetpackCheckoutUri' => admin_url( 'admin.php?page=my-jetpack' ), + 'topJetpackMenuItemUrl' => Admin_Menu::get_top_level_menu_item_url(), + 'siteSuffix' => ( new Status() )->get_site_suffix(), + 'siteUrl' => esc_url( get_site_url() ), + 'blogID' => Connection_Manager::get_site_id( true ), + 'myJetpackVersion' => self::PACKAGE_VERSION, + 'myJetpackFlags' => self::get_my_jetpack_flags(), + 'fileSystemWriteAccess' => self::has_file_system_write_access(), + 'loadAddLicenseScreen' => self::is_licensing_ui_enabled(), + 'adminUrl' => esc_url( admin_url() ), + 'IDCContainerID' => static::get_idc_container_id(), + 'userIsAdmin' => current_user_can( 'manage_options' ), + 'userIsNewToJetpack' => self::is_jetpack_user_new(), + 'lifecycleStats' => array( + 'jetpackPlugins' => self::get_installed_jetpack_plugins(), + 'historicallyActiveModules' => \Jetpack_Options::get_option( 'historically_active_modules', array() ), + 'ownedProducts' => Products::get_products_by_ownership( 'owned' ), + 'unownedProducts' => Products::get_products_by_ownership( 'unowned' ), + 'brokenModules' => self::check_for_broken_modules(), + 'isSiteConnected' => $connection->is_connected(), + 'isUserConnected' => $connection->is_user_connected(), + 'purchases' => self::get_purchases(), + 'modules' => self::get_active_modules(), + ), + 'redBubbleAlerts' => self::get_red_bubble_alerts(), + 'recommendedModules' => array( + 'modules' => self::get_recommended_modules(), + 'dismissed' => \Jetpack_Options::get_option( 'dismissed_recommendations', false ), + ), + 'isStatsModuleActive' => $modules->is_active( 'stats' ), + 'isUserFromKnownHost' => self::is_user_from_known_host(), + 'isCommercial' => self::is_commercial_site(), + 'isAtomic' => ( new Status_Host() )->is_woa_site(), + 'jetpackManage' => array( + 'isEnabled' => Jetpack_Manage::could_use_jp_manage(), + 'isAgencyAccount' => Jetpack_Manage::is_agency_account(), + ), + 'latestBoostSpeedScores' => $latest_score, + 'protect' => array( + 'scanData' => $scan_data, + 'wafConfig' => array_merge( + $waf_config, + array( 'blocked_logins' => (int) get_site_option( 'jetpack_protect_blocked_attempts', 0 ) ) + ), + ), + 'videopress' => self::get_videopress_stats(), + ) + ); + + wp_localize_script( + 'my_jetpack_main_app', + 'myJetpackRest', + array( + 'apiRoot' => esc_url_raw( rest_url() ), + 'apiNonce' => wp_create_nonce( 'wp_rest' ), + ) + ); + + // Connection Initial State. + Connection_Initial_State::render_script( 'my_jetpack_main_app' ); + + // Required for Analytics. + if ( self::can_use_analytics() ) { + Tracking::register_tracks_functions_scripts( true ); + } + } + + /** + * Get stats for VideoPress + * + * @return array|WP_Error + */ + public static function get_videopress_stats() { + $video_count = array_sum( (array) wp_count_attachments( 'video' ) ); + + if ( ! class_exists( 'Automattic\Jetpack\VideoPress\Stats' ) ) { + return array( + 'videoCount' => $video_count, + ); + } + + $featured_stats = get_transient( self::VIDEOPRESS_STATS_KEY ); + + if ( $featured_stats ) { + return array( + 'featuredStats' => $featured_stats, + 'videoCount' => $video_count, + ); + } + + $stats_period = get_transient( self::VIDEOPRESS_PERIOD_KEY ); + $videopress_stats = new VideoPress_Stats(); + + // If the stats period exists, retrieve that information without checking the view count. + // If it does not, check the view count of monthly stats and determine if we want to show yearly or monthly stats. + if ( $stats_period ) { + if ( $stats_period === 'day' ) { + $featured_stats = $videopress_stats->get_featured_stats( 60, 'day' ); + } else { + $featured_stats = $videopress_stats->get_featured_stats( 2, 'year' ); + } + } else { + $featured_stats = $videopress_stats->get_featured_stats( 60, 'day' ); + + if ( + ! is_wp_error( $featured_stats ) && + $featured_stats && + ( $featured_stats['data']['views']['current'] < 500 || $featured_stats['data']['views']['previous'] < 500 ) + ) { + $featured_stats = $videopress_stats->get_featured_stats( 2, 'year' ); + } + } + + if ( is_wp_error( $featured_stats ) || ! $featured_stats ) { + return array( + 'videoCount' => $video_count, + ); + } + + set_transient( self::VIDEOPRESS_PERIOD_KEY, $featured_stats['period'], WEEK_IN_SECONDS ); + set_transient( self::VIDEOPRESS_STATS_KEY, $featured_stats, DAY_IN_SECONDS ); + + return array( + 'featuredStats' => $featured_stats, + 'videoCount' => $video_count, + ); + } + + /** + * Get product slugs of the active purchases + * + * @return array + */ + public static function get_purchases() { + $purchases = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases ) ) { + return array(); + } + + return array_map( + function ( $purchase ) { + return $purchase->product_slug; + }, + (array) $purchases + ); + } + + /** + * Get installed Jetpack plugins + * + * @return array + */ + public static function get_installed_jetpack_plugins() { + $plugin_slugs = array_keys( Plugins_Installer::get_plugins() ); + $plugin_slugs = array_map( + static function ( $slug ) { + $parts = explode( '/', $slug ); + if ( empty( $parts ) ) { + return ''; + } + // Return the last segment of the filepath without the PHP extension + return str_replace( '.php', '', $parts[ count( $parts ) - 1 ] ); + }, + $plugin_slugs + ); + + return array_values( array_intersect( self::JETPACK_PLUGIN_SLUGS, $plugin_slugs ) ); + } + + /** + * Get active modules (except ones enabled by default) + * + * @return array + */ + public static function get_active_modules() { + $modules = new Modules(); + $active_modules = $modules->get_active(); + + // if the Jetpack plugin is active, filter out the modules that are active by default + if ( class_exists( 'Jetpack' ) && ! empty( $active_modules ) ) { + $active_modules = array_diff( $active_modules, Jetpack::get_default_modules() ); + } + return array_values( $active_modules ); + } + + /** + * Determine if the current user is "new" to Jetpack + * This is used to vary some messaging in My Jetpack + * + * On the front-end, purchases are also taken into account + * + * @return bool + */ + public static function is_jetpack_user_new() { + // is the user connected? + $connection = new Connection_Manager(); + if ( $connection->is_user_connected() ) { + return false; + } + + // TODO: add a data point for the last known connection/ disconnection time + + // are any modules active? + $active_modules = self::get_active_modules(); + if ( ! empty( $active_modules ) ) { + return false; + } + + // check for other Jetpack plugins that are installed on the site (active or not) + // If there's more than one Jetpack plugin active, this user is not "new" + $plugin_slugs = array_keys( Plugins_Installer::get_plugins() ); + $plugin_slugs = array_map( + static function ( $slug ) { + $parts = explode( '/', $slug ); + if ( empty( $parts ) ) { + return ''; + } + // Return the last segment of the filepath without the PHP extension + return str_replace( '.php', '', $parts[ count( $parts ) - 1 ] ); + }, + $plugin_slugs + ); + $installed_jetpack_plugins = array_intersect( self::JETPACK_PLUGIN_SLUGS, $plugin_slugs ); + if ( is_countable( $installed_jetpack_plugins ) && count( $installed_jetpack_plugins ) >= 2 ) { + return false; + } + + // Does the site have any purchases? + $purchases = Wpcom_Products::get_site_current_purchases(); + if ( ! empty( $purchases ) && ! is_wp_error( $purchases ) ) { + return false; + } + + return true; + } + + /** + * Determines whether the user has come from a host we can recognize. + * + * @return string + */ + public static function is_user_from_known_host() { + // Known (external) host is the one that has been determined and is not dotcom. + return ! in_array( ( new Status_Host() )->get_known_host_guess(), array( 'unknown', 'wpcom' ), true ); + } + + /** + * Build flags for My Jetpack UI + * + * @return array + */ + public static function get_my_jetpack_flags() { + $flags = array( + 'videoPressStats' => Jetpack_Constants::is_true( 'JETPACK_MY_JETPACK_VIDEOPRESS_STATS_ENABLED' ), + 'showFullJetpackStatsCard' => class_exists( 'Jetpack' ), + ); + + return $flags; + } + + /** + * Echoes the admin page content. + * + * @return void + */ + public static function admin_page() { + echo '

'; + } + + /** + * Register the REST API routes. + * + * @return void + */ + public static function register_rest_endpoints() { + new REST_Products(); + new REST_Purchases(); + new REST_Zendesk_Chat(); + new REST_Product_Data(); + new REST_AI(); + new REST_Recommendations_Evaluation(); + + register_rest_route( + 'my-jetpack/v1', + 'site', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_site', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ) + ); + + register_rest_route( + 'my-jetpack/v1', + 'site/dismiss-welcome-banner', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::dismiss_welcome_banner', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ) + ); + } + + /** + * Check user capability to access the endpoint. + * + * @access public + * @static + * + * @return true|WP_Error + */ + public static function permissions_callback() { + return current_user_can( 'manage_options' ); + } + + /** + * Return true if we should initialize the My Jetpack admin page. + */ + public static function should_initialize() { + $should = true; + + if ( is_multisite() ) { + $should = false; + } + + // All options presented in My Jetpack require a connection to WordPress.com. + if ( ( new Status() )->is_offline_mode() ) { + $should = false; + } + + /** + * Allows filtering whether My Jetpack should be initialized. + * + * @since 0.5.0-alpha + * + * @param bool $shoud_initialize Should we initialize My Jetpack? + */ + return apply_filters( 'jetpack_my_jetpack_should_initialize', $should ); + } + + /** + * Set transient to queue an update to the historically active Jetpack modules on the next wp-admin load + * + * @param string $plugin The plugin that triggered the update. This will be present if the function was queued by a plugin activation. + * + * @return void + */ + public static function queue_historically_active_jetpack_modules_update( $plugin = null ) { + $plugin_filenames = Products::get_all_plugin_filenames(); + + if ( ! $plugin || in_array( $plugin, $plugin_filenames, true ) ) { + set_transient( self::UPDATE_HISTORICALLY_ACTIVE_JETPACK_MODULES_KEY, true ); + } + } + + /** + * Hook into several connection-based actions to update the historically active Jetpack modules + * If the transient that indicates the list needs to be synced, update it and delete the transient + * + * @return void + */ + public static function setup_historically_active_jetpack_modules_sync() { + if ( get_transient( self::UPDATE_HISTORICALLY_ACTIVE_JETPACK_MODULES_KEY ) && ! wp_doing_ajax() ) { + self::update_historically_active_jetpack_modules(); + delete_transient( self::UPDATE_HISTORICALLY_ACTIVE_JETPACK_MODULES_KEY ); + } + + $actions = array( + 'jetpack_site_registered', + 'jetpack_user_authorized', + 'activated_plugin', + ); + + foreach ( $actions as $action ) { + add_action( $action, array( __CLASS__, 'queue_historically_active_jetpack_modules_update' ), 5 ); + } + + // Modules are often updated async, so we need to update them right away as there will sometimes be no page reload. + add_action( 'jetpack_activate_module', array( __CLASS__, 'update_historically_active_jetpack_modules' ), 5 ); + } + + /** + * Update historically active Jetpack plugins + * Historically active is defined as the Jetpack plugins that are installed and active with the required connections + * This array will consist of any plugins that were active at one point in time and are still enabled on the site + * + * @return void + */ + public static function update_historically_active_jetpack_modules() { + $historically_active_modules = \Jetpack_Options::get_option( 'historically_active_modules', array() ); + $products = Products::get_products(); + + foreach ( $products as $product ) { + $status = $product['status']; + $product_slug = $product['slug']; + // We want to leave modules in the array if they've been active in the past + // and were not manually disabled by the user. + if ( in_array( $status, Products::$broken_module_statuses, true ) ) { + continue; + } + + // If the module is active and not already in the array, add it + if ( + in_array( $status, Products::$active_module_statuses, true ) && + ! in_array( $product_slug, $historically_active_modules, true ) + ) { + $historically_active_modules[] = $product_slug; + } + + // If the module has been disabled due to a manual user action, + // or because of a missing plan error, remove it from the array + if ( in_array( $status, Products::$disabled_module_statuses, true ) ) { + $historically_active_modules = array_values( array_diff( $historically_active_modules, array( $product_slug ) ) ); + } + } + + \Jetpack_Options::update_option( 'historically_active_modules', array_unique( $historically_active_modules ) ); + } + + /** + * Site full-data endpoint. + * + * @return object Site data. + */ + public static function get_site() { + $site_id = \Jetpack_Options::get_option( 'id' ); + $wpcom_endpoint = sprintf( '/sites/%d?force=wpcom', $site_id ); + $wpcom_api_version = '1.1'; + $response = Client::wpcom_json_api_request_as_blog( $wpcom_endpoint, $wpcom_api_version ); + $response_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $response ) || empty( $response['body'] ) ) { + return new WP_Error( 'site_data_fetch_failed', 'Site data fetch failed', array( 'status' => $response_code ) ); + } + + return rest_ensure_response( $body ); + } + + /** + * Populates the self::$site_info var with site data from the /sites/%d endpoint + * + * @return object|WP_Error + */ + public static function get_site_info() { + static $site_info = null; + + if ( $site_info !== null ) { + return $site_info; + } + + // Check for a cached value before doing lookup + $stored_site_info = get_transient( self::MY_JETPACK_SITE_INFO_TRANSIENT_KEY ); + if ( $stored_site_info !== false ) { + return $stored_site_info; + } + + $response = self::get_site(); + if ( is_wp_error( $response ) ) { + return $response; + } + $site_info = $response->data; + set_transient( self::MY_JETPACK_SITE_INFO_TRANSIENT_KEY, $site_info, DAY_IN_SECONDS ); + + return $site_info; + } + + /** + * Returns whether a site has been determined "commercial" or not. + * + * @return bool|null + */ + public static function is_commercial_site() { + if ( is_wp_error( self::$site_info ) ) { + return null; + } + + return empty( self::$site_info->options->is_commercial ) ? false : self::$site_info->options->is_commercial; + } + + /** + * Check if site is registered (has been connected before). + * + * @return bool + */ + public static function is_registered() { + return (bool) \Jetpack_Options::get_option( 'id' ); + } + + /** + * Dismiss the welcome banner. + * + * @return \WP_REST_Response + */ + public static function dismiss_welcome_banner() { + \Jetpack_Options::update_option( 'dismissed_welcome_banner', true ); + return rest_ensure_response( array( 'success' => true ) ); + } + + /** + * Returns true if the site has file write access to the plugins folder, false otherwise. + * + * @return string + **/ + public static function has_file_system_write_access() { + + $cache = get_transient( 'my_jetpack_write_access' ); + + if ( false !== $cache ) { + return $cache; + } + + if ( ! function_exists( 'get_filesystem_method' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + require_once ABSPATH . 'wp-admin/includes/template.php'; + + $write_access = 'no'; + + $filesystem_method = get_filesystem_method( array(), WP_PLUGIN_DIR ); + if ( 'direct' === $filesystem_method ) { + $write_access = 'yes'; + } + + if ( ! $write_access ) { + ob_start(); + $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); + ob_end_clean(); + + if ( $filesystem_credentials_are_stored ) { + $write_access = 'yes'; + } + } + + set_transient( 'my_jetpack_write_access', $write_access, 30 * MINUTE_IN_SECONDS ); + + return $write_access; + } + + /** + * Get container IDC for the IDC screen. + * + * @return string + */ + public static function get_idc_container_id() { + return static::IDC_CONTAINER_ID; + } + + /** + * Conditionally append the red bubble notification to the "Jetpack" menu item if there are alerts to show + * + * @return void + */ + public static function maybe_show_red_bubble() { + global $menu; + // filters for the items in this file + add_filter( 'my_jetpack_red_bubble_notification_slugs', array( __CLASS__, 'add_red_bubble_alerts' ) ); + $red_bubble_alerts = array_filter( + self::get_red_bubble_alerts(), + function ( $alert ) { + // We don't want to show silent alerts + return empty( $alert['is_silent'] ); + } + ); + + // The Jetpack menu item should be on index 3 + if ( + ! empty( $red_bubble_alerts ) && + is_countable( $red_bubble_alerts ) && + isset( $menu[3] ) && + $menu[3][0] === 'Jetpack' + ) { + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + $menu[3][0] .= sprintf( ' %d', count( $red_bubble_alerts ) ); + } + } + + /** + * Collect all possible alerts that we might use a red bubble notification for + * + * @return array + */ + public static function get_red_bubble_alerts() { + static $red_bubble_alerts = array(); + + // using a static cache since we call this function more than once in the class + if ( ! empty( $red_bubble_alerts ) ) { + return $red_bubble_alerts; + } + // go find the alerts + $red_bubble_alerts = apply_filters( 'my_jetpack_red_bubble_notification_slugs', $red_bubble_alerts ); + + return $red_bubble_alerts; + } + + /** + * Get list of module names sorted by their recommendation score + * + * @return array|null + */ + public static function get_recommended_modules() { + $recommendations_evaluation = \Jetpack_Options::get_option( 'recommendations_evaluation', null ); + + if ( ! $recommendations_evaluation ) { + return null; + } + + arsort( $recommendations_evaluation ); // Sort by scores in descending order + + return array_keys( $recommendations_evaluation ); // Get only module names + } + + /** + * Check for features broken by a disconnected user or site + * + * @return array + */ + public static function check_for_broken_modules() { + $connection = new Connection_Manager(); + $is_user_connected = $connection->is_user_connected() || $connection->has_connected_owner(); + $is_site_connected = $connection->is_connected(); + $broken_modules = array( + 'needs_site_connection' => array(), + 'needs_user_connection' => array(), + ); + + if ( $is_user_connected && $is_site_connected ) { + return $broken_modules; + } + + $products = Products::get_products_classes(); + $historically_active_modules = \Jetpack_Options::get_option( 'historically_active_modules', array() ); + + foreach ( $products as $product ) { + if ( ! in_array( $product::$slug, $historically_active_modules, true ) ) { + continue; + } + + if ( $product::$requires_user_connection && ! $is_user_connected ) { + if ( ! in_array( $product::$slug, $broken_modules['needs_user_connection'], true ) ) { + $broken_modules['needs_user_connection'][] = $product::$slug; + } + } elseif ( ! $is_site_connected ) { + if ( ! in_array( $product::$slug, $broken_modules['needs_site_connection'], true ) ) { + $broken_modules['needs_site_connection'][] = $product::$slug; + } + } + } + + return $broken_modules; + } + + /** + * Add relevant red bubble notifications + * + * @param array $red_bubble_slugs - slugs that describe the reasons the red bubble is showing. + * @return array + */ + public static function add_red_bubble_alerts( array $red_bubble_slugs ) { + if ( wp_doing_ajax() ) { + return array(); + } + $connection = new Connection_Manager(); + $welcome_banner_dismissed = \Jetpack_Options::get_option( 'dismissed_welcome_banner', false ); + if ( self::is_jetpack_user_new() && ! $welcome_banner_dismissed ) { + $red_bubble_slugs['welcome-banner-active'] = array( + 'is_silent' => $connection->is_connected(), // we don't display the red bubble if the user is connected + ); + return $red_bubble_slugs; + } else { + return self::alert_if_missing_connection( $red_bubble_slugs ); + } + } + + /** + * Add an alert slug if the site is missing a site connection + * + * @param array $red_bubble_slugs - slugs that describe the reasons the red bubble is showing. + * @return array + */ + public static function alert_if_missing_connection( array $red_bubble_slugs ) { + $broken_modules = self::check_for_broken_modules(); + $connection = new Connection_Manager(); + + if ( ! empty( $broken_modules['needs_user_connection'] ) ) { + $red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array( + 'type' => 'user', + 'is_error' => true, + ); + return $red_bubble_slugs; + } + + if ( ! empty( $broken_modules['needs_site_connection'] ) ) { + $red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array( + 'type' => 'site', + 'is_error' => true, + ); + return $red_bubble_slugs; + } + + if ( ! $connection->is_user_connected() && ! $connection->has_connected_owner() ) { + $red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array( + 'type' => 'user', + 'is_error' => false, + ); + return $red_bubble_slugs; + } + + if ( ! $connection->is_connected() ) { + $red_bubble_slugs[ self::MISSING_CONNECTION_NOTIFICATION_KEY ] = array( + 'type' => 'site', + 'is_error' => false, + ); + return $red_bubble_slugs; + } + + return $red_bubble_slugs; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php new file mode 100644 index 00000000..3a732192 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php @@ -0,0 +1,124 @@ + $blog_id ); + } + + return Admin_Menu::add_menu( + __( 'Jetpack Manage', 'jetpack-my-jetpack' ), + _x( 'Jetpack Manage', 'product name shown in menu', 'jetpack-my-jetpack' ) . ' ', + 'manage_options', + esc_url( Redirect::get_url( 'cloud-manage-dashboard-wp-menu', $args ) ), + null, + 15 + ); + } + + /** + * Check if the user has enough sites to be able to use Jetpack Manage. + * + * @param int $min_sites Minimum number of sites to be able to use Jetpack Manage. + * + * @return bool Return true if the user has enough sites to be able to use Jetpack Manage. + */ + public static function could_use_jp_manage( $min_sites = 2 ) { + // Only proceed if the user is connected to WordPress.com. + if ( ! ( new Connection_Manager() )->is_user_connected() ) { + return false; + } + + // Do not display the menu if Jetpack plugin is not installed. + if ( ! class_exists( 'Jetpack' ) ) { + return false; + } + + // Do not display the menu on Multisite. + if ( is_multisite() ) { + return false; + } + + // Check if the user has the minimum number of sites. + $user_data = ( new Connection_Manager() )->get_connected_user_data( get_current_user_id() ); + if ( ! isset( $user_data['site_count'] ) || $user_data['site_count'] < $min_sites ) { + return false; + } + + return true; + } + + /** + * Check if the user is a partner/agency. + * + * @return bool Return true if the user is a partner/agency, otherwise false. + */ + public static function is_agency_account() { + // Only proceed if the user is connected to WordPress.com. + if ( ! ( new Connection_Manager() )->is_user_connected() ) { + return false; + } + + // Get the cached partner data. + $partner = get_transient( 'jetpack_partner_data' ); + + if ( $partner === false ) { + $wpcom_response = Client::wpcom_json_api_request_as_user( '/jetpack-partners' ); + + if ( 200 !== wp_remote_retrieve_response_code( $wpcom_response ) || is_wp_error( $wpcom_response ) ) { + return false; + } + + $partner_data = json_decode( wp_remote_retrieve_body( $wpcom_response ) ); + + // The jetpack-partners endpoint will return only one partner data into an array, it uses Jetpack_Partner::find_by_owner. + if ( ! is_array( $partner_data ) || count( $partner_data ) !== 1 || ! is_object( $partner_data[0] ) ) { + return false; + } + + $partner = $partner_data[0]; + + // Cache the partner data for 1 hour. + set_transient( 'jetpack_partner_data', $partner, HOUR_IN_SECONDS ); + } + + return $partner->partner_type === 'agency'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php new file mode 100644 index 00000000..dcd3fcc2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php @@ -0,0 +1,356 @@ + Products\Anti_Spam::class, + 'backup' => Products\Backup::class, + 'boost' => Products\Boost::class, + 'crm' => Products\Crm::class, + 'creator' => Products\Creator::class, + 'extras' => Products\Extras::class, + 'jetpack-ai' => Products\Jetpack_Ai::class, + 'scan' => Products\Scan::class, + 'search' => Products\Search::class, + 'social' => Products\Social::class, + 'security' => Products\Security::class, + 'protect' => Products\Protect::class, + 'videopress' => Products\Videopress::class, + 'stats' => Products\Stats::class, + 'ai' => Products\Jetpack_Ai::class, + ); + + /** + * This filter allows plugin to override the Product class of a given product. The new class must be a child class of the default one declared in My Jetpack + * + * For example, a stand-alone plugin could overwrite its product class to control specific behavior of the product in the My Jetpack page after it is active without having to commit changes to the My Jetpack package: + * + * add_filter( 'my_jetpack_products_classes', function( $classes ) { + * $classes['my_plugin'] = 'My_Plugin'; // a class that extends the original one declared in the My Jetpack package. + * return $classes + * } ); + * + * @param array $classes An array where the keys are the product slugs and the values are the class names. + */ + $final_classes = apply_filters( 'my_jetpack_products_classes', $classes ); + + // Check that the classes are still child of the same original classes. + foreach ( (array) $final_classes as $slug => $final_class ) { + if ( $final_class === $classes[ $slug ] ) { + continue; + } + if ( ! class_exists( $final_class ) || ! is_subclass_of( $final_class, $classes[ $slug ] ) ) { + throw new \Exception( 'You can only overwrite a Product class with a child of the original class.' ); + } + } + + return $final_classes; + } + + /** + * Product data + * + * @return array Jetpack products on the site and their availability. + */ + public static function get_products() { + $products = array(); + foreach ( self::get_products_classes() as $class ) { + $product_slug = $class::$slug; + $products[ $product_slug ] = $class::get_info(); + } + return $products; + } + + /** + * Get a list of products sorted by whether or not the user owns them + * An owned product is defined as a product that is any of the following + * - Active + * - Has historically been active + * - The user has a plan that includes the product + * - The user has the standalone plugin for the product installed + * + * @param string $type The type of ownership to return ('owned' or 'unowned'). + * + * @return array + */ + public static function get_products_by_ownership( $type ) { + $owned_active_products = array(); + $owned_warning_products = array(); + $owned_inactive_products = array(); + $unowned_products = array(); + + foreach ( self::get_products_classes() as $class ) { + $product_slug = $class::$slug; + $status = $class::get_status(); + + if ( $class::is_owned() ) { + // This sorts the the products in the order of active -> warning -> inactive. + // This enables the frontend to display them in that order. + // This is not needed for unowned products as those will always have a status of 'inactive' + if ( in_array( $status, self::$active_module_statuses, true ) ) { + array_push( $owned_active_products, $product_slug ); + } elseif ( in_array( $status, self::$warning_module_statuses, true ) ) { + array_push( $owned_warning_products, $product_slug ); + } else { + array_push( $owned_inactive_products, $product_slug ); + } + continue; + } + + array_push( $unowned_products, $product_slug ); + } + + $data = array( + 'owned' => array_values( + array_unique( + array_merge( + $owned_active_products, + $owned_warning_products, + $owned_inactive_products + ) + ) + ), + 'unowned' => array_values( + array_unique( $unowned_products ) + ), + ); + + return $data[ $type ]; + } + + /** + * Get all plugin filenames associated with the products. + * + * @return array + */ + public static function get_all_plugin_filenames() { + $filenames = array(); + foreach ( self::get_products_classes() as $class ) { + if ( ! isset( $class::$plugin_filename ) ) { + continue; + } + + if ( is_array( $class::$plugin_filename ) ) { + $filenames = array_merge( $filenames, $class::$plugin_filename ); + } else { + $filenames[] = $class::$plugin_filename; + } + } + return $filenames; + } + + /** + * Get one product data by its slug + * + * @param string $product_slug The product slug. + * + * @return ?array + */ + public static function get_product( $product_slug ) { + $classes = self::get_products_classes(); + if ( isset( $classes[ $product_slug ] ) ) { + return $classes[ $product_slug ]::get_info(); + } + } + + /** + * Get one product Class name + * + * @param string $product_slug The product slug. + * + * @return ?string + */ + public static function get_product_class( $product_slug ) { + $classes = self::get_products_classes(); + if ( isset( $classes[ $product_slug ] ) ) { + return $classes[ $product_slug ]; + } + } + + /** + * Return product slugs list. + * + * @return array Product slugs array. + */ + public static function get_products_slugs() { + return array_keys( self::get_products_classes() ); + } + + /** + * Gets the json schema for the product data + * + * @return array + */ + public static function get_product_data_schema() { + return array( + 'title' => 'The requested product data', + 'type' => 'object', + 'properties' => array( + 'product' => array( + 'description' => __( 'Product slug', 'jetpack-my-jetpack' ), + 'type' => 'string', + 'enum' => __CLASS__ . '::get_product_slugs', + 'required' => false, + 'validate_callback' => __CLASS__ . '::check_product_argument', + ), + 'action' => array( + 'description' => __( 'Production action to execute', 'jetpack-my-jetpack' ), + 'type' => 'string', + 'enum' => array( 'activate', 'deactivate' ), + 'required' => false, + 'validate_callback' => __CLASS__ . '::check_product_argument', + ), + 'slug' => array( + 'title' => 'The product slug', + 'type' => 'string', + ), + 'name' => array( + 'title' => 'The product name', + 'type' => 'string', + ), + 'description' => array( + 'title' => 'The product description', + 'type' => 'string', + ), + 'status' => array( + 'title' => 'The product status', + 'type' => 'string', + 'enum' => self::$all_statuses, + ), + 'class' => array( + 'title' => 'The product class handler', + 'type' => 'string', + ), + ), + ); + } + + /** + * Extend actions links for plugins + * tied to the Products. + */ + public static function extend_plugins_action_links() { + $products = array( + 'backup', + 'boost', + 'crm', + 'videopress', + 'social', + 'protect', + 'crm', + 'search', + 'ai', + ); + + // Add plugin action links for the core Jetpack plugin. + Product::extend_core_plugin_action_links(); + + // Add plugin action links to standalone products. + foreach ( $products as $product ) { + $class_name = self::get_product_class( $product ); + $class_name::extend_plugin_action_links(); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php new file mode 100644 index 00000000..39698107 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php @@ -0,0 +1,90 @@ + \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::get_openai_jwt', + 'permission_callback' => function () { + return ( new Connection_Manager( 'jetpack' ) )->is_user_connected() && current_user_can( 'edit_posts' ); + }, + ) + ); + } + } + + /** + * Check if a specific REST endpoint is registered. + * + * @param string $namespace - The namespace of the endpoint. + * @param string $route - The route of the endpoint. + * @return bool True if the endpoint is registered, false otherwise. + */ + public static function is_rest_endpoint_registered( $namespace, $route ) { + $server = rest_get_server(); + $routes = $server->get_routes(); + $full_endpoint = '/' . trim( $namespace, '/' ) . $route; + return isset( $routes[ $full_endpoint ] ); + } + + /** + * Ask WPCOM for a JWT token to use for OpenAI completion. + */ + public static function get_openai_jwt() { + $blog_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_user( + "/sites/$blog_id/jetpack-openai-query/jwt", + '2', + array( + 'method' => 'POST', + 'headers' => array( 'Content-Type' => 'application/json; charset=utf-8' ), + ), + wp_json_encode( array() ), + 'wpcom' + ); + + if ( is_wp_error( $response ) ) { + return $response; + } + + $json = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( ! isset( $json->token ) ) { + return new WP_Error( 'no-token', 'No token returned from WPCOM' ); + } + + return array( + 'token' => $json->token, + 'blog_id' => $blog_id, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php new file mode 100644 index 00000000..15530adb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php @@ -0,0 +1,147 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_site_backup_undo_event', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ) + ); + + register_rest_route( + 'my-jetpack/v1', + '/site/backup/count-items', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::count_things_that_can_be_backed_up', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ) + ); + } + + /** + * Checks if the user has the correct permissions + */ + public static function permissions_callback() { + return current_user_can( 'manage_options' ); + } + + /** + * This will fetch the last rewindable event from the Activity Log and + * the last rewind_id prior to that. + * + * @return array|WP_Error|null + */ + public static function get_site_backup_undo_event() { + $blog_id = \Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_user( + '/sites/' . $blog_id . '/activity/rewindable?force=wpcom', + 'v2', + array(), + null, + 'wpcom' + ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return null; + } + + $body = json_decode( $response['body'], true ); + + if ( ! isset( $body['current'] ) ) { + return null; + } + + // Preparing the response structure + $undo_event = array( + 'last_rewindable_event' => null, + 'undo_backup_id' => null, + ); + + // List of events that will not be considered to be undo. + // Basically we should not `undo` a full backup event, but we could + // use them to undo any other action like plugin updates. + $last_event_exceptions = array( + 'rewind__backup_only_complete_full', + 'rewind__backup_only_complete_initial', + 'rewind__backup_only_complete', + 'rewind__backup_complete_full', + 'rewind__backup_complete_initial', + 'rewind__backup_complete', + ); + + // Looping through the events to find the last rewindable event and the last backup_id. + // The idea is to find the last rewindable event and then the last rewind_id before that. + $found_last_event = false; + foreach ( $body['current']['orderedItems'] as $event ) { + if ( $event['is_rewindable'] ) { + if ( ! $found_last_event && ! in_array( $event['name'], $last_event_exceptions, true ) ) { + $undo_event['last_rewindable_event'] = $event; + $found_last_event = true; + } elseif ( $found_last_event ) { + $undo_event['undo_backup_id'] = $event['rewind_id']; + break; + } + } + } + + return rest_ensure_response( $undo_event ); + } + + /** + * This will collect a count of all the items that could be backed up + * This is used to show what backup could be doing if it is not enabled + * + * @return WP_Error|\WP_REST_Response + */ + public static function count_things_that_can_be_backed_up() { + $image_mime_type = 'image'; + $video_mime_type = 'video'; + $audio_mime_type = 'audio'; + + $data = array(); + + // Add all post types together to get the total post count + $data['total_post_count'] = array_sum( (array) wp_count_posts( 'post' ) ); + + // Add all page types together to get the total page count + $data['total_page_count'] = array_sum( (array) wp_count_posts( 'page' ) ); + + // Add all comments together to get the total comment count + $comments = (array) wp_count_comments(); + $data['total_comment_count'] = $comments ? $comments['total_comments'] : 0; + + // Add all image attachments together to get the total image count + $data['total_image_count'] = array_sum( (array) wp_count_attachments( $image_mime_type ) ); + + // Add all video attachments together to get the total video count + $data['total_video_count'] = array_sum( (array) wp_count_attachments( $video_mime_type ) ); + + // Add all audio attachments together to get the total audio count + $data['total_audio_count'] = array_sum( (array) wp_count_attachments( $audio_mime_type ) ); + + return rest_ensure_response( $data ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php new file mode 100644 index 00000000..cb253ce1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php @@ -0,0 +1,249 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_products', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ), + 'schema' => array( $this, 'get_products_schema' ), + ) + ); + + $product_arg = array( + 'description' => __( 'Product slug', 'jetpack-my-jetpack' ), + 'type' => 'string', + 'enum' => Products::get_products_slugs(), + 'required' => true, + 'validate_callback' => __CLASS__ . '::check_product_argument', + ); + + register_rest_route( + 'my-jetpack/v1', + 'site/products/(?P[a-z\-]+)', + array( + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_product', + 'permission_callback' => __CLASS__ . '::permissions_callback', + 'args' => array( + 'product' => $product_arg, + ), + ), + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::activate_product', + 'permission_callback' => __CLASS__ . '::edit_permissions_callback', + 'args' => array( + 'product' => $product_arg, + ), + ), + array( + 'methods' => \WP_REST_Server::DELETABLE, + 'callback' => __CLASS__ . '::deactivate_product', + 'permission_callback' => __CLASS__ . '::edit_permissions_callback', + 'args' => array( + 'product' => $product_arg, + ), + ), + ) + ); + + register_rest_route( + 'my-jetpack/v1', + 'site/products/(?P[a-z\-]+)/install-standalone', + array( + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::install_standalone', + 'permission_callback' => __CLASS__ . '::edit_permissions_callback', + 'args' => array( + 'product' => $product_arg, + ), + ), + ) + ); + } + + /** + * Get the schema for the products endpoint + * + * @return array + */ + public function get_products_schema() { + return array( + '$schema' => 'http://json-schema.org/draft-04/schema#', + 'title' => 'products', + 'type' => 'object', + 'properties' => Products::get_product_data_schema(), + ); + } + + /** + * Check user capability to access the endpoint. + * + * @access public + * @static + * + * @return true|WP_Error + */ + public static function permissions_callback() { + return current_user_can( 'manage_options' ); + } + + /** + * Check Product arguments. + * + * @access public + * @static + * + * @param mixed $value - Value of the 'product' argument. + * @return true|WP_Error True if the value is valid, WP_Error otherwise. + */ + public static function check_product_argument( $value ) { + if ( ! is_string( $value ) ) { + return new WP_Error( + 'rest_invalid_param', + esc_html__( 'The product argument must be a string.', 'jetpack-my-jetpack' ), + array( 'status' => 400 ) + ); + } + + return true; + } + + /** + * Site products endpoint. + * + * @return array of site products list. + */ + public static function get_products() { + $response = Products::get_products(); + return rest_ensure_response( $response, 200 ); + } + + /** + * Site single product endpoint. + * + * @param \WP_REST_Request $request The request object. + * @return array of site products list. + */ + public static function get_product( $request ) { + $product_slug = $request->get_param( 'product' ); + return rest_ensure_response( Products::get_product( $product_slug ), 200 ); + } + + /** + * Check permission to edit product + * + * @return bool + */ + public static function edit_permissions_callback() { + if ( ! current_user_can( 'activate_plugins' ) ) { + return false; + } + if ( is_multisite() && ! current_user_can( 'manage_network' ) ) { + return false; + } + return true; + } + + /** + * Callback for activating a product + * + * @param \WP_REST_Request $request The request object. + * @return \WP_REST_Response + */ + public static function activate_product( $request ) { + $product_slug = $request->get_param( 'product' ); + $product = Products::get_product( $product_slug ); + if ( ! isset( $product['class'] ) ) { + return new \WP_Error( + 'not_implemented', + esc_html__( 'The product class handler is not implemented', 'jetpack-my-jetpack' ), + array( 'status' => 501 ) + ); + } + + $activate_product_result = call_user_func( array( $product['class'], 'activate' ) ); + if ( is_wp_error( $activate_product_result ) ) { + $activate_product_result->add_data( array( 'status' => 400 ) ); + return $activate_product_result; + } + set_transient( 'my_jetpack_product_activated', $product_slug, 10 ); + + return rest_ensure_response( Products::get_product( $product_slug ), 200 ); + } + + /** + * Callback for deactivating a product + * + * @param \WP_REST_Request $request The request object. + * @return \WP_REST_Response + */ + public static function deactivate_product( $request ) { + $product_slug = $request->get_param( 'product' ); + $product = Products::get_product( $product_slug ); + if ( ! isset( $product['class'] ) ) { + return new \WP_Error( + 'not_implemented', + esc_html__( 'The product class handler is not implemented', 'jetpack-my-jetpack' ), + array( 'status' => 501 ) + ); + } + + $deactivate_product_result = call_user_func( array( $product['class'], 'deactivate' ) ); + if ( is_wp_error( $deactivate_product_result ) ) { + $deactivate_product_result->add_data( array( 'status' => 400 ) ); + return $deactivate_product_result; + } + + return rest_ensure_response( Products::get_product( $product_slug ), 200 ); + } + + /** + * Callback for installing the standalone plugin on a Hybrid Product. + * + * @param \WP_REST_Request $request The request object. + * @return \WP_REST_Response + */ + public static function install_standalone( $request ) { + $product_slug = $request->get_param( 'product' ); + $product = Products::get_product( $product_slug ); + if ( ! isset( $product['class'] ) ) { + return new \WP_Error( + 'not_implemented', + __( 'The product class handler is not implemented', 'jetpack-my-jetpack' ), + array( 'status' => 501 ) + ); + } + + $install_product_result = call_user_func( array( $product['class'], 'install_and_activate_standalone' ) ); + if ( is_wp_error( $install_product_result ) ) { + $install_product_result->add_data( array( 'status' => 400 ) ); + return $install_product_result; + } + + return rest_ensure_response( Products::get_product( $product_slug ), 200 ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php new file mode 100644 index 00000000..ead44934 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php @@ -0,0 +1,77 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_site_current_purchases', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ) + ); + } + + /** + * Check user capability to access the endpoint. + * + * @access public + * @static + * + * @return true|WP_Error + */ + public static function permissions_callback() { + $connection = new Connection_Manager(); + $is_site_connected = $connection->is_connected(); + + if ( ! $is_site_connected ) { + return new WP_Error( + 'not_connected', + __( 'Your site is not connected to Jetpack.', 'jetpack-my-jetpack' ), + array( + 'status' => 400, + ) + ); + } + + return current_user_can( 'edit_posts' ); + } + + /** + * Site purchases endpoint. + * + * @return array of site purchases. + */ + public static function get_site_current_purchases() { + $site_id = \Jetpack_Options::get_option( 'id' ); + $wpcom_endpoint = sprintf( '/sites/%1$d/purchases?locale=%2$s', $site_id, get_user_locale() ); + $wpcom_api_version = '1.1'; + $response = Client::wpcom_json_api_request_as_blog( $wpcom_endpoint, $wpcom_api_version ); + $response_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $response ) || empty( $response['body'] ) || 200 !== $response_code ) { + return new WP_Error( 'site_data_fetch_failed', 'Site data fetch failed', array( 'status' => $response_code ? $response_code : 400 ) ); + } + + return rest_ensure_response( $body, 200 ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-recommendations-evaluation.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-recommendations-evaluation.php new file mode 100644 index 00000000..ae03c873 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-recommendations-evaluation.php @@ -0,0 +1,149 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::evaluate_site_recommendations', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ), + ) + ); + + register_rest_route( + 'my-jetpack/v1', + '/site/recommendations/evaluation/result/', + array( + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::save_evaluation_recommendations', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ), + ) + ); + + register_rest_route( + 'my-jetpack/v1', + '/site/recommendations/evaluation/result/', + array( + array( + 'methods' => \WP_REST_Server::DELETABLE, + 'callback' => __CLASS__ . '::dismiss_evaluation_recommendations', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ), + ) + ); + } + + /** + * Check user capability to access the endpoint. + * + * @access public + * @static + * + * @return true|WP_Error + */ + public static function permissions_callback() { + $connection = new Connection_Manager(); + $is_site_connected = $connection->is_connected(); + + if ( ! $is_site_connected ) { + return new WP_Error( + 'not_connected', + __( 'Your site is not connected to Jetpack.', 'jetpack-my-jetpack' ), + array( + 'status' => 400, + ) + ); + } + + return true; // We require site to be connected. + } + + /** + * Recommendations Evaluation endpoint. + * + * @param \WP_REST_Request $request Query request. + * + * @return \WP_REST_Response|WP_Error of 3 product slugs (recommendations). + */ + public static function evaluate_site_recommendations( $request ) { + $goals = $request->get_param( 'goals' ); + + if ( ! isset( $goals ) ) { + return new WP_Error( 'missing_goals', 'Goals are required', array( 'status' => 400 ) ); + } + + $site_id = \Jetpack_Options::get_option( 'id' ); + $wpcom_endpoint = sprintf( '/sites/%1$d/jetpack-recommendations/evaluation?goals=%2$s', $site_id, implode( ',', $goals ) ); + $response = Client::wpcom_json_api_request_as_blog( $wpcom_endpoint, '2', array(), null, 'wpcom' ); + $response_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $response ) || empty( $body ) || 200 !== $response_code ) { + return new WP_Error( 'recommendations_evaluation_fetch_failed', 'Evaluation processing failed', array( 'status' => $response_code ? $response_code : 400 ) ); + } + + return rest_ensure_response( $body ); + } + + /** + * Endpoint to save recommendations results. + * + * @param \WP_REST_Request $request Query request. + * + * @return \WP_REST_Response|WP_Error success response. + */ + public static function save_evaluation_recommendations( $request ) { + $json = $request->get_json_params(); + + if ( ! isset( $json['recommendations'] ) ) { + return new WP_Error( 'missing_recommendations', 'Recommendations are required', array( 'status' => 400 ) ); + } + + \Jetpack_Options::update_option( 'recommendations_evaluation', $json['recommendations'] ); + \Jetpack_Options::delete_option( 'dismissed_recommendations' ); + + return rest_ensure_response( Initializer::get_recommended_modules() ); + } + + /** + * Endpoint to dismiss the recommendation section + * + * @param \WP_REST_Request $request Query request. + * + * @return \WP_REST_Response|WP_Error success response. + */ + public static function dismiss_evaluation_recommendations( $request ) { + $show_welcome_banner = $request->get_param( 'showWelcomeBanner' ); + + \Jetpack_Options::update_option( 'dismissed_recommendations', true ); + + if ( isset( $show_welcome_banner ) && $show_welcome_banner === 'true' ) { + \Jetpack_Options::delete_option( 'dismissed_welcome_banner' ); + } + + return rest_ensure_response( array() ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php new file mode 100644 index 00000000..f852433b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php @@ -0,0 +1,122 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_chat_availability', + 'permission_callback' => __CLASS__ . '::chat_authentication_permissions_callback', + ) + ); + + register_rest_route( + 'my-jetpack/v1', + 'chat/authentication', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_chat_authentication', + 'args' => array( + 'type' => array( + 'required' => false, + 'type' => 'string', + ), + 'test_mode' => array( + 'required' => false, + 'type' => 'boolean', + ), + ), + 'permission_callback' => __CLASS__ . '::chat_authentication_permissions_callback', + ) + ); + } + + /** + * Ensure user is logged in if making an authentication request + * + * @access public + * @static + * + * @return WP_Error|true + */ + public static function chat_authentication_permissions_callback() { + if ( ! get_current_user_id() ) { + return new WP_Error( 'unauthorized', 'You must be logged in to access this resource.', array( 'status' => 401 ) ); + } + + return true; + } + + /** + * Gets the chat authentication token. + * + * @return WP_Error|WP_REST_Response { token: string } + */ + public static function get_chat_authentication() { + $authentication = get_transient( self::ZENDESK_AUTH_TOKEN ); + if ( $authentication ) { + return rest_ensure_response( $authentication, 200 ); + } + + $proxied = function_exists( 'wpcom_is_proxied_request' ) ? wpcom_is_proxied_request() : false; + $wpcom_endpoint = 'help/authenticate/chat'; + $wpcom_api_version = '2'; + + $body = array( + 'type' => 'zendesk', + 'test_mode' => $proxied ? true : false, + ); + + $response = Client::wpcom_json_api_request_as_user( $wpcom_endpoint, $wpcom_api_version, array( 'method' => 'POST' ), $body ); + $response_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $response ) || empty( $response['body'] ) ) { + return new WP_Error( 'chat_authentication_failed', 'Chat authentication failed', array( 'status' => $response_code ) ); + } + + set_transient( self::ZENDESK_AUTH_TOKEN, $body, self::TRANSIENT_EXPIRY ); + return rest_ensure_response( $body, 200 ); + } + + /** + * Calls `wpcom/v2/presales/chat?group=jp_presales` endpoint. + * This endpoint returns whether or not the Jetpack presales chat group is available + * + * @return WP_Error|WP_REST_Response { is_available: bool } + */ + public static function get_chat_availability() { + $wpcom_endpoint = '/presales/chat?group=jp_presales'; + $wpcom_api_version = '2'; + $response = Client::wpcom_json_api_request_as_user( $wpcom_endpoint, $wpcom_api_version ); + $response_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $response ) || empty( $response['body'] ) ) { + return new WP_Error( 'chat_config_data_fetch_failed', 'Chat config data fetch failed', array( 'status' => $response_code ) ); + } + + return rest_ensure_response( $body, 200 ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php new file mode 100644 index 00000000..3f3ea12c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php @@ -0,0 +1,387 @@ +get_ip( true ); + $headers = array( + 'X-Forwarded-For' => $ip, + ); + + if ( $blog_id ) { + $request_label = 'get_products_from_wpcom_blog_' . $blog_id; + $request_failure = static::get_request_failure( $request_label ); + if ( null !== $request_failure ) { + return $request_failure; + } + + // If has a blog id, use connected endpoint. + $endpoint = sprintf( '/sites/%d/products/?_locale=%s&type=jetpack', $blog_id, get_user_locale() ); + + // If available in the user data, set the user's currency as one of the params + if ( $connection->is_user_connected() ) { + $user_details = $connection->get_connected_user_data(); + if ( ! empty( $user_details['user_currency'] ) && $user_details['user_currency'] !== 'USD' ) { + $endpoint .= sprintf( '¤cy=%s', $user_details['user_currency'] ); + } + } + + $wpcom_request = Client::wpcom_json_api_request_as_blog( + $endpoint, + '1.1', + array( + 'method' => 'GET', + 'headers' => $headers, + ) + ); + } else { + $request_label = 'get_products_from_wpcom'; + $request_failure = static::get_request_failure( $request_label ); + if ( null !== $request_failure ) { + return $request_failure; + } + + $endpoint = 'https://public-api.wordpress.com/rest/v1.1/products?locale=' . get_user_locale() . '&type=jetpack'; + + $wpcom_request = wp_remote_get( + esc_url_raw( $endpoint ), + array( + 'headers' => $headers, + ) + ); + } + + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + + if ( 200 === $response_code ) { + return json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + } else { + $error = new WP_Error( + 'failed_to_fetch_wpcom_products', + esc_html__( 'Unable to fetch the products list from WordPress.com', 'jetpack-my-jetpack' ), + array( 'status' => $response_code ) + ); + static::set_request_failure( $request_label, $error ); + return $error; + } + } + + /** + * Super unintelligent hash string that can help us reset the cache after connection changes + * This is important because the currency can change after a user connects depending on what is set in their profile + * + * @return string + */ + private static function build_check_hash() { + static $has_user_data_fetch_error = false; + + $hash_string = 'check_hash_'; + $connection = new Connection_Manager(); + + if ( $connection->is_connected() ) { + $hash_string .= 'site_connected_'; + } + + if ( $connection->is_user_connected() ) { + $hash_string .= 'user_connected'; + // Add the user's currency + $user_details = $has_user_data_fetch_error ? false : $connection->get_connected_user_data(); + + if ( $user_details === false ) { + $has_user_data_fetch_error = true; + } elseif ( ! empty( $user_details['user_currency'] ) ) { + $hash_string .= '_' . $user_details['user_currency']; + } + } + + return md5( $hash_string ); + } + + /** + * Update the cache with new information retrieved from WPCOM + * + * We store one cache for each user, as the information is internationalized based on user preferences + * Also, the currency is based on the user IP address + * + * @param Object $products_list The products list as received from WPCOM. + * @return bool + */ + private static function update_cache( $products_list ) { + update_user_meta( get_current_user_id(), self::CACHE_DATE_META_NAME, time() ); + update_user_meta( get_current_user_id(), self::CACHE_CHECK_HASH_NAME, self::build_check_hash() ); + return update_user_meta( get_current_user_id(), self::CACHE_META_NAME, $products_list ); + } + + /** + * Checks if the cache is old, meaning we need to fetch new data from WPCOM + */ + private static function is_cache_old() { + if ( empty( self::get_products_from_cache() ) ) { + return true; + } + + // This allows the cache to reset after the site or user connects/ disconnects + $check_hash = get_user_meta( get_current_user_id(), self::CACHE_CHECK_HASH_NAME, true ); + if ( $check_hash !== self::build_check_hash() ) { + return true; + } + + $cache_date = get_user_meta( get_current_user_id(), self::CACHE_DATE_META_NAME, true ); + return time() - (int) $cache_date > DAY_IN_SECONDS; + } + + /** + * Gets the product list from the user cache + */ + private static function get_products_from_cache() { + return get_user_meta( get_current_user_id(), self::CACHE_META_NAME, true ); + } + + /** + * Gets the product list + * + * Attempts to retrieve the products list from the user cache if cache is not too old. + * If cache is old, it will attempt to fetch information from WPCOM. If it fails, we return what we have in cache, if anything, otherwise we return an error. + * + * @param bool $skip_cache If true it will ignore the cache and attempt to fetch fresh information from WPCOM. + * + * @return Object|WP_Error + */ + public static function get_products( $skip_cache = false ) { + // This is only available for logged in users. + if ( ! get_current_user_id() ) { + return null; + } + if ( ! self::is_cache_old() && ! $skip_cache ) { + return self::get_products_from_cache(); + } + + $products = self::get_products_from_wpcom(); + if ( is_wp_error( $products ) ) { + // Let's see if we have it cached. + $cached = self::get_products_from_cache(); + if ( ! empty( $cached ) ) { + return $cached; + } else { + return $products; + } + } + + self::update_cache( $products ); + return $products; + } + + /** + * Get one product + * + * @param string $product_slug The product slug. + * @param bool $renew_cache A flag to force the cache to be renewed. + * + * @return ?Object The product details if found + */ + public static function get_product( $product_slug, $renew_cache = false ) { + $products = self::get_products( $renew_cache ); + if ( ! empty( $products->$product_slug ) ) { + return $products->$product_slug; + } + } + + /** + * Get only the product currency code and price in an array + * + * @param string $product_slug The product slug. + * + * @return array An array with currency_code and full_price. Empty array if product not found. + */ + public static function get_product_pricing( $product_slug ) { + $product = self::get_product( $product_slug ); + if ( empty( $product ) ) { + return array(); + } + + $cost = $product->cost; + $discount_price = $cost; + $is_introductory_offer = false; + $introductory_offer = null; + + // Get/compute the discounted price. + if ( isset( $product->introductory_offer->cost_per_interval ) ) { + $discount_price = $product->introductory_offer->cost_per_interval; + $is_introductory_offer = true; + $introductory_offer = $product->introductory_offer; + } + + $pricing = array( + 'currency_code' => $product->currency_code, + 'full_price' => $cost, + 'discount_price' => $discount_price, + 'is_introductory_offer' => $is_introductory_offer, + 'introductory_offer' => $introductory_offer, + 'product_term' => $product->product_term, + ); + + return self::populate_with_discount( $product, $pricing, $discount_price ); + } + + /** + * Populate the pricing array with the discount information. + * + * @param object $product - The product object. + * @param array $pricing - The pricing array. + * @param float $price - The price to be discounted. + * @return array The pricing array with the discount information. + */ + public static function populate_with_discount( $product, $pricing, $price ) { + // Check whether the product has a coupon. + if ( ! isset( $product->sale_coupon ) ) { + return $pricing; + } + + // Check whether it is still valid. + $coupon = $product->sale_coupon; + $coupon_start_date = strtotime( $coupon->start_date ); + $coupon_expires = strtotime( $coupon->expires ); + if ( $coupon_start_date > time() || $coupon_expires < time() ) { + return $pricing; + } + + $coupon_discount = intval( $coupon->discount ); + + // Populate response with coupon discount. + $pricing['coupon_discount'] = $coupon_discount; + + // Apply coupon discount to the price. + $pricing['discount_price'] = $price * ( 100 - $coupon_discount ) / 100; + + return $pricing; + } + + /** + * Gets the site purchases from WPCOM. + * + * @return Object|WP_Error + */ + public static function get_site_current_purchases() { + static $purchases = null; + + if ( $purchases !== null ) { + return $purchases; + } + + // Check for a cached value before doing lookup + $stored_purchases = get_transient( self::MY_JETPACK_PURCHASES_TRANSIENT_KEY ); + if ( $stored_purchases !== false ) { + return $stored_purchases; + } + + $request_failure = static::get_request_failure( 'get_site_current_purchases' ); + if ( null !== $request_failure ) { + return $request_failure; + } + + $site_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%d/purchases', $site_id ), + '1.1', + array( + 'method' => 'GET', + ) + ); + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $error = new WP_Error( 'purchases_state_fetch_failed' ); + static::set_request_failure( 'get_site_current_purchases', $error ); + return $error; + } + + $body = wp_remote_retrieve_body( $response ); + $purchases = json_decode( $body ); + // Set short transient to help with repeated lookups on the same page load + set_transient( self::MY_JETPACK_PURCHASES_TRANSIENT_KEY, $purchases, 5 ); + + return $purchases; + } + + /** + * Reset the request failures to retry the API requests. + * + * @return void + */ + public static function reset_request_failures() { + static::$wpcom_request_failures = array(); + } + + /** + * Record the request failure to prevent repeated requests. + * + * @param string $request_label The request label. + * @param WP_Error $error The error. + * + * @return void + */ + private static function set_request_failure( $request_label, WP_Error $error ) { + static::$wpcom_request_failures[ $request_label ] = $error; + } + + /** + * Get the pre-saved request failure if exists. + * + * @param string $request_label The request label. + * + * @return null|WP_Error + */ + private static function get_request_failure( $request_label ) { + if ( array_key_exists( $request_label, static::$wpcom_request_failures ) ) { + return static::$wpcom_request_failures[ $request_label ]; + } + + return null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php new file mode 100644 index 00000000..88d212f0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php @@ -0,0 +1,189 @@ +product_slug, $product ) !== false ) { + return true; + } + } + } + } + + return $fallback; + } + + /** + * Get the product princing details + * + * @return array Pricing details + */ + public static function get_pricing_for_ui() { + return array_merge( + array( + 'available' => true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_anti_spam'; + } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'security' ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=akismet-key-config' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php new file mode 100644 index 00000000..296a590d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php @@ -0,0 +1,242 @@ + _x( '* Subject to your usage and storage limit.', 'Backup Product Disclaimer', 'jetpack-my-jetpack' ), + 'link_text' => _x( 'Learn more', 'Backup Product Disclaimer', 'jetpack-my-jetpack' ), + 'url' => Redirect::get_url( 'jetpack-faq-backup-disclaimer' ), + ), + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_backup_t1_yearly'; + } + + /** + * Get the URL where the user should be redirected after checkout + */ + public static function get_post_checkout_url() { + return self::get_manage_url(); + } + + /** + * Get the product princing details + * + * @return array Pricing details + */ + public static function get_pricing_for_ui() { + return array_merge( + array( + 'available' => true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Hits the wpcom api to check rewind status. + * + * @todo Maybe add caching. + * + * @return Object|WP_Error + */ + private static function get_state_from_wpcom() { + static $status = null; + + if ( $status !== null ) { + return $status; + } + + $site_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( sprintf( '/sites/%d/rewind', $site_id ) . '?force=wpcom', '2', array( 'timeout' => 2 ), null, 'wpcom' ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $status = new WP_Error( 'rewind_state_fetch_failed' ); + return $status; + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $rewind_data = static::get_state_from_wpcom(); + if ( is_wp_error( $rewind_data ) ) { + return false; + } + return is_object( $rewind_data ) && isset( $rewind_data->state ) && 'unavailable' !== $rewind_data->state; + } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'security' ); + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page or continue the purchase flow if needed. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + // check standalone first + if ( static::is_standalone_plugin_active() ) { + return admin_url( 'admin.php?page=jetpack-backup' ); + // otherwise, check for the main Jetpack plugin + } elseif ( static::is_jetpack_plugin_active() ) { + return Redirect::get_url( 'my-jetpack-manage-backup' ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php new file mode 100644 index 00000000..a9f9b0f5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php @@ -0,0 +1,337 @@ + __( 'Optimize CSS Loading', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Move important styling information to the start of the page, which helps pages display your content sooner, so your users don’t have to wait for the entire page to load. Commonly referred to as Critical CSS.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'included' => true, + 'description' => __( 'Must be done manually', 'jetpack-my-jetpack' ), + 'info' => array( + 'title' => __( 'Manual Critical CSS regeneration', 'jetpack-my-jetpack' ), + 'content' => __( + '

To enhance the speed of your site, with this plan you will need to optimize CSS by using the Manual Critical CSS generation feature whenever you:

+
    +
  • Make theme changes.
  • +
  • Write a new post/page.
  • +
  • Edit a post/page.
  • +
  • Activate, deactivate, or update plugins that impact your site layout or HTML structure.
  • +
  • Change settings of plugins that impact your site layout or HTML structure.
  • +
  • Upgrade your WordPress version if the new release includes core CSS changes.
  • +
', + 'jetpack-my-jetpack' + ), + ), + ), + self::UPGRADED_TIER_SLUG => array( + 'included' => true, + 'description' => __( 'Automatically updated', 'jetpack-my-jetpack' ), + 'info' => array( + 'title' => __( 'Automatic Critical CSS regeneration', 'jetpack-my-jetpack' ), + 'content' => __( + '

It’s essential to regenerate Critical CSS to optimize your site speed whenever your HTML or CSS structure changes. Being on top of this can be tedious and time-consuming.

+

Boost’s cloud service can automatically detect when your site needs the Critical CSS regenerated, and perform this function behind the scenes without requiring you to monitor it manually.

', + 'jetpack-my-jetpack' + ), + ), + ), + ), + ), + array( + 'name' => __( 'Defer non-essential JavaScript', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Run non-essential JavaScript after the page has loaded so that styles and images can load more quickly.', + 'jetpack-my-jetpack' + ), + 'link' => array( + 'id' => 'jetpack-boost-defer-js', + 'title' => 'web.dev', + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Lazy image loading', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Improve page loading speed by only loading images when they are required.', + 'jetpack-my-jetpack' + ), + 'link' => array( + 'id' => 'jetpack-boost-lazy-load', + 'title' => 'web.dev', + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Image guide', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Discover and fix images with a suboptimal resolution, aspect ratio, or file size, improving user experience and page speed.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Image CDN', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Deliver images from Jetpack\'s Content Delivery Network. Automatically resizes your images to an appropriate size, converts them to modern efficient formats like WebP, and serves them from a worldwide network of servers.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Dedicated email support', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + '

Paid customers get dedicated email support from our world-class Happiness Engineers to help with any issue.

+

All other questions are handled by our team as quickly as we are able to go through the WordPress support forum.

', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + ); + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout + * + * @return ?string + */ + public static function get_post_checkout_url() { + return self::get_manage_url(); + } + + /** + * Get the product princing details + * + * @return array Pricing details + */ + public static function get_pricing_for_ui() { + return array( + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'available' => true, + 'is_free' => true, + ), + self::UPGRADED_TIER_SLUG => array_merge( + array( + 'available' => true, + 'wpcom_product_slug' => self::UPGRADED_TIER_PRODUCT_SLUG, + ), + Wpcom_Products::get_product_pricing( self::UPGRADED_TIER_PRODUCT_SLUG ) + ), + ), + ); + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + // Boost is available as standalone bundle and as part of the Complete plan. + if ( strpos( $purchase->product_slug, 'jetpack_boost' ) !== false || str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + return true; + } + } + } + return false; + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack-boost' ); + } + + /** + * Activates the product by installing and activating its plugin + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return boolean|WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + + $product_activation = parent::do_product_specific_activation( $current_result ); + + if ( is_wp_error( $product_activation ) && 'module_activation_failed' === $product_activation->get_error_code() ) { + // A bundle is not a module. There's nothing in the plugin to be activated, so it's ok to fail to activate the module. + $product_activation = true; + } + + // We just "got started" in My Jetpack, so skip the in-plugin experience. + update_option( 'jb_get_started', false ); + + return $product_activation; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php new file mode 100644 index 00000000..1dc5ac1d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php @@ -0,0 +1,350 @@ + __( 'Import subscribers', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Import a CSV file of your existing subscribers to be sent your Newsletter.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'included' => true, + 'description' => __( '100 subscribers', 'jetpack-my-jetpack' ), + ), + self::UPGRADED_TIER_SLUG => array( + 'included' => true, + 'description' => __( 'Unlimited subscribers', 'jetpack-my-jetpack' ), + ), + ), + ), + array( + 'name' => __( 'Transaction fees', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + '

Fees are only collected when you accept payments.

+

Fees are based on the Jetpack plan you have and are calculated as a percentage of your revenue from 10% on the Free plan to 2% on the Creator plan (plus Stripe fees).

', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'included' => true, + 'description' => __( '10%', 'jetpack-my-jetpack' ), + ), + self::UPGRADED_TIER_SLUG => array( + 'included' => true, + 'description' => __( '2%', 'jetpack-my-jetpack' ), + ), + ), + ), + array( + 'name' => __( 'Jetpack Blocks', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Jetpack has over 40 Gutenberg blocks to help you with your content creation, such as displaying your podcasts, showing different content to repeat visitors, creating contact forms and many more.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Paid content gating', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Lock your content behind a paid content block. To access the content, readers will need to pay a one-time fee or a recurring subscription.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Paywall access', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Add a Paywall to your content which lets your visitors read a section of your content before being asked to subscribe to continue reading.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Newsletter', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Start a Newsletter by sending your content as an email newsletter direct to your fans email inboxes.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Pay with PayPal', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + 'Accept payment with PayPal for simple payments like eBooks, courses and more.', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'WordAds', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + '

WordAds adds advertisements to your website. Start earning from your website traffic.

+

Over 50 internet advertisers — including Google AdSense & Adx, AppNexus, Amazon A9, AOL Marketplace, Yahoo, Criteo, and more — bid to display ads in WordAds spots.

', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Dedicated email support', 'jetpack-my-jetpack' ), + 'info' => array( + 'content' => __( + '

Paid customers get dedicated email support from our world-class Happiness Engineers to help with any issue.

+

All other questions are handled by our team as quickly as we are able to go through the WordPress support forum.

', + 'jetpack-my-jetpack' + ), + ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + ); + } + + /** + * Get the product princing details + * + * @return array Pricing details + */ + public static function get_pricing_for_ui() { + return array( + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'available' => true, + 'is_free' => true, + ), + self::UPGRADED_TIER_SLUG => array_merge( + array( + 'available' => true, + 'wpcom_product_slug' => self::UPGRADED_TIER_PRODUCT_SLUG, + ), + Wpcom_Products::get_product_pricing( self::UPGRADED_TIER_PRODUCT_SLUG ) + ), + ), + ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack#/settings?term=creator' ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_creator_yearly'; + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_biyearly_product_slug() { + return 'jetpack_creator_bi_yearly'; + } + + /** + * Get the WPCOM monthly product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_monthly_product_slug() { + return 'jetpack_creator_monthly'; + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + // Creator is available as standalone bundle and as part of the Complete plan. + if ( strpos( $purchase->product_slug, 'jetpack_creator' ) !== false || str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + return true; + } + } + } + return false; + } + + /** + * Checks whether the product can be upgraded - i.e. this shows the /#add-creator interstitial + * + * @return boolean + */ + public static function is_upgradable() { + return ! self::has_paid_plan_for_product(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php new file mode 100644 index 00000000..27d9197c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php @@ -0,0 +1,175 @@ + true, + 'is_free' => false, + 'full_price' => 132, + 'discount_price' => 132, + 'is_introductory_offer' => false, + 'product_term' => 'year', + 'introductory_offer' => null, + // CRM is only sold in USD + 'currency_code' => 'USD', + ); + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return admin_url( 'admin.php?page=zerobscrm-plugin' ); // Welcome page. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=zerobscrm-dash' ); + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * CRM is available as part of Jetpack Complete + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + + // TODO: check if CRM has a separate plan + + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + return true; + } + } + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php new file mode 100644 index 00000000..51f02232 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php @@ -0,0 +1,140 @@ + true, + 'is_free' => true, + ); + } + + /** + * Checks whether the Product is active. + * If Jetpack plugin is active, then Extras will be inactive. + * + * @return boolean + */ + public static function is_active() { + return static::is_jetpack_plugin_active(); + } + + /** + * Checks whether the plugin is installed + * If Jetpack plugin is installed, then Extras will be inactive. + * + * @return boolean + */ + public static function is_plugin_installed() { + return static::is_jetpack_plugin_installed(); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack' ); + } + + /** + * Activates the Jetpack plugin + * + * @return null|WP_Error Null on success, WP_Error on invalid file. + */ + public static function activate_plugin() { + return activate_plugin( static::get_installed_plugin_filename( 'jetpack' ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php new file mode 100644 index 00000000..0fb93d67 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php @@ -0,0 +1,153 @@ +get_error_code() ) { + $product_activation = Plugins_Installer::install_plugin( self::JETPACK_PLUGIN_SLUG ); + if ( ! is_wp_error( $product_activation ) ) { + $product_activation = static::activate_plugin(); + } + } + if ( is_wp_error( $product_activation ) ) { + return $product_activation; + } + } + + if ( ! empty( static::$module_name ) ) { + // Only activate the module if the plan supports it + // We don't want to throw an error for a missing plan here since we try activation before purchase + if ( static::$requires_plan && ! static::has_any_plan_for_product() ) { + return true; + } + + $module_activation = ( new Modules() )->activate( static::$module_name, false, false ); + + if ( ! $module_activation ) { + return new WP_Error( 'module_activation_failed', __( 'Error activating Jetpack module', 'jetpack-my-jetpack' ) ); + } + + return $module_activation; + } + + return true; + } + + /** + * Install and activate the standalone plugin in the case it's missing. + * + * @return boolean|WP_Error + */ + public static function install_and_activate_standalone() { + $result = parent::install_and_activate_standalone(); + + if ( is_wp_error( $result ) ) { + return $result; + } + + /** + * Activate the module as well, if the user has a plan + * or the product does not require a plan to work + */ + if ( static::has_any_plan_for_product() && isset( static::$module_name ) ) { + $module_activation = ( new Modules() )->activate( static::$module_name, false, false ); + + if ( ! $module_activation ) { + return new WP_Error( 'module_activation_failed', __( 'Error activating Jetpack module', 'jetpack-my-jetpack' ) ); + } + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php new file mode 100644 index 00000000..dc3ddce2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php @@ -0,0 +1,661 @@ + __( 'Number of requests', 'jetpack-my-jetpack' ), + 'info' => array( + 'title' => __( 'Requests', 'jetpack-my-jetpack' ), + 'content' => __( 'Increase your monthly request limit. Upgrade now and have the option to further increase your requests with additional upgrades.', 'jetpack-my-jetpack' ), + ), + 'tiers' => array( + self::CURRENT_TIER_SLUG => array( + 'included' => true, + 'description' => $current_description, + ), + self::UPGRADED_TIER_SLUG => array( + 'included' => true, + 'description' => $next_description, + ), + ), + ), + array( + 'name' => __( 'Generate and edit content', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::CURRENT_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Build forms from prompts', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::CURRENT_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Get feedback on posts', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::CURRENT_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Generate featured images', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::CURRENT_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + ); + } + + /** + * Get the current usage tier + * + * @return int + */ + public static function get_current_usage_tier() { + if ( ! self::is_site_connected() ) { + return 0; + } + + $info = self::get_ai_assistant_feature(); + + // Bail early if it's not possible to fetch the feature data. + if ( is_wp_error( $info ) ) { + return 0; + } + + $current_tier = isset( $info['current-tier']['value'] ) ? $info['current-tier']['value'] : null; + + return $current_tier; + } + + /** + * Get the next usage tier + * + * @return int + */ + public static function get_next_usage_tier() { + if ( ! self::is_site_connected() || ! self::has_paid_plan_for_product() ) { + // without site connection we can't know if tiers are enabled or not, + // hence we can't know if the next tier is 100 or 1 (unlimited). + return 100; + } + + $info = self::get_ai_assistant_feature(); + + // Bail early if it's not possible to fetch the feature data or if it's included in a plan. + if ( is_wp_error( $info ) || empty( $info ) ) { + return null; + } + + // Trust the next tier provided by the feature data. + $next_tier = isset( $info['next-tier']['value'] ) ? $info['next-tier']['value'] : null; + + return $next_tier; + } + + /** + * Get the internationalized product description + * + * @return string + */ + public static function get_description() { + return __( 'Enhance your writing and productivity with our AI suite', 'jetpack-my-jetpack' ); + } + + /** + * Get the internationalized usage tier long description by tier + * + * @param int $tier The usage tier. + * @return string + */ + public static function get_long_description_by_usage_tier( $tier ) { + $long_descriptions = array( + 1 => __( 'Jetpack AI Assistant brings the power of AI right into your WordPress editor, letting your content creation soar to new heights.', 'jetpack-my-jetpack' ), + 100 => __( 'The most advanced AI technology Jetpack has to offer.', 'jetpack-my-jetpack' ), + ); + $tiered_description = __( 'Upgrade and increase the amount of your available monthly requests to continue using the most advanced AI technology Jetpack has to offer.', 'jetpack-my-jetpack' ); + + return isset( $long_descriptions[ $tier ] ) ? $long_descriptions[ $tier ] : $tiered_description; + } + + /** + * Get the internationalized product long description + * + * @return string + */ + public static function get_long_description() { + $next_tier = self::get_next_usage_tier(); + + return self::get_long_description_by_usage_tier( $next_tier ); + } + + /** + * Get the internationalized usage tier features by tier + * + * @param int $tier The usage tier. + * @return string + */ + public static function get_features_by_usage_tier( $tier ) { + $is_tier_plan = $tier && intval( $tier ) > 1; + + if ( $tier === 100 && ( ! self::is_site_connected() || ! self::has_paid_plan_for_product() ) ) { + // in these cases, get_next_usage_tier() will return 100 + // 100 is fine as default when tiered plans are enabled, but not otherwise + $is_tier_plan = false; + } + + $features = array( + __( 'Generate text, tables, lists, and forms', 'jetpack-my-jetpack' ), + __( 'Easily refine content to your liking', 'jetpack-my-jetpack' ), + __( 'Make your content easier to read', 'jetpack-my-jetpack' ), + __( 'Generate images with one-click', 'jetpack-my-jetpack' ), + __( 'Optimize your titles for better performance', 'jetpack-my-jetpack' ), + __( 'Priority support', 'jetpack-my-jetpack' ), + ); + + $tiered_features = array( + __( 'Prompt based content generation', 'jetpack-my-jetpack' ), + __( 'Generate text, tables, and lists', 'jetpack-my-jetpack' ), + __( 'Adaptive tone adjustment', 'jetpack-my-jetpack' ), + __( 'Superior spelling and grammar correction', 'jetpack-my-jetpack' ), + __( 'Title & summary generation', 'jetpack-my-jetpack' ), + __( 'Priority support', 'jetpack-my-jetpack' ), + /* translators: %d is the number of requests. */ + sprintf( __( 'Up to %d requests per month', 'jetpack-my-jetpack' ), $tier ), + ); + + return $is_tier_plan ? $tiered_features : $features; + } + + /** + * Get the internationalized features list + * + * @return array Jetpack AI features list + */ + public static function get_features() { + $next_tier = self::get_next_usage_tier(); + + return self::get_features_by_usage_tier( $next_tier ); + } + + /** + * Get the product pricing details by tier + * + * @param int|null $tier The usage tier. + * @return array Pricing details + */ + public static function get_pricing_for_ui_by_usage_tier( $tier ) { + if ( $tier === null ) { + return array(); + } + + $product = Wpcom_Products::get_product( static::get_wpcom_product_slug() ); + + if ( empty( $product ) ) { + return array(); + } + + $tier_plans_enabled = self::are_tier_plans_enabled(); + + /* + * when tiers are enabled and the price tier list is empty, + * we may need to renew the cache for the product data so + * we get the new price tier list. + * + * if the list is still empty after the fresh data, we will + * default to empty pricing (by returning an empty array). + */ + if ( empty( $product->price_tier_list ) && $tier_plans_enabled ) { + $product = Wpcom_Products::get_product( static::get_wpcom_product_slug(), true ); + } + + // get the base pricing for the unlimited plan, for compatibility + $base_pricing = Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ); + + $price_tier_list = $product->price_tier_list; + $yearly_prices = array(); + + foreach ( $price_tier_list as $price_tier ) { + if ( isset( $price_tier->maximum_units ) && isset( $price_tier->maximum_price ) ) { + // The prices are in cents + $yearly_prices[ $price_tier->maximum_units ] = $price_tier->maximum_price / 100; + } + } + + // add the base pricing to the list + $prices = array( 1 => $base_pricing ); + + foreach ( $yearly_prices as $units => $price ) { + $prices[ $units ] = array_merge( + $base_pricing, + array( + 'full_price' => $price, + 'discount_price' => $price, + 'is_introductory_offer' => false, + 'introductory_offer' => null, + ) + ); + } + + return isset( $prices[ $tier ] ) ? $prices[ $tier ] : array(); + } + + /** + * Get the product pricing details + * + * @return array Pricing details + */ + public static function get_pricing_for_ui() { + // no tiers + if ( ! self::are_tier_plans_enabled() ) { + return array_merge( + array( + 'available' => true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + // hardcoding 1 as next tier if tiers are not enabled + self::get_pricing_for_ui_by_usage_tier( 1 ) + ); + } + + $next_tier = self::get_next_usage_tier(); + $current_tier = self::get_current_usage_tier(); + $current_call_to_action = $current_tier === 0 + ? __( 'Continue for free', 'jetpack-my-jetpack' ) + : __( 'I\'m fine with my plan, thanks', 'jetpack-my-jetpack' ); + $next_call_to_action = $next_tier === null + ? __( 'Contact Us', 'jetpack-my-jetpack' ) + : __( 'Upgrade', 'jetpack-my-jetpack' ); + + return array( + 'tiers' => array( + self::CURRENT_TIER_SLUG => array_merge( + self::get_pricing_for_ui_by_usage_tier( $current_tier ), + array( + 'available' => true, + 'is_free' => true, + 'call_to_action' => $current_call_to_action, + ) + ), + self::UPGRADED_TIER_SLUG => array_merge( + self::get_pricing_for_ui_by_usage_tier( $next_tier ), + array( + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + 'quantity' => $next_tier, + 'call_to_action' => $next_call_to_action, + ) + ), + ), + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_ai_yearly'; + } + + /** + * Get the WPCOM monthly product slug used to make the purchase + * + * @return string + */ + public static function get_wpcom_monthly_product_slug() { + return 'jetpack_ai_monthly'; + } + + /** + * Get the WPCOM bi-yearly product slug used to make the purchase + * + * @return string + */ + public static function get_wpcom_bi_yearly_product_slug() { + return 'jetpack_ai_bi_yearly'; + } + + /** + * Checks whether the site has a paid plan for this product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( str_contains( $purchase->product_slug, 'jetpack_ai' ) ) { + return true; + } + } + } + return false; + } + + /** + * Checks whether the product can be upgraded to a different product. + * + * @return boolean + */ + public static function is_upgradable() { + $has_ai_feature = static::does_site_have_feature( 'ai-assistant' ); + $tier_plans_enabled = self::are_tier_plans_enabled(); + $current_tier = self::get_current_usage_tier(); + + if ( $has_ai_feature && ! $tier_plans_enabled && $current_tier >= 1 ) { + return false; + } + + $next_tier = self::get_next_usage_tier(); + + // The check below is debatable, not having the feature should not flag as not upgradable. + // If user is free (tier = 0), not unlimited (tier = 1) and has a next tier, then it's upgradable. + if ( $current_tier !== null && $current_tier !== 1 && $next_tier ) { + return true; + } + + // Mark as not upgradable if user is on unlimited tier or does not have any plan. + if ( ! $has_ai_feature || null === $current_tier || 1 === $current_tier ) { + return false; + } + + return true; + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout + * + * @return ?string + */ + public static function get_post_checkout_url() { + return 'admin.php?page=my-jetpack#/jetpack-ai'; + } + + /** + * Get the URL the user is taken after activating the product through the checkout + * + * @return ?string + */ + public static function get_post_activation_url() { + return '/wp-admin/admin.php?page=my-jetpack#/jetpack-ai'; + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return '/wp-admin/admin.php?page=my-jetpack#/jetpack-ai'; + } + + /** + * Checks whether the plugin is installed + * + * @return boolean + */ + public static function is_plugin_installed() { + return self::is_jetpack_plugin_installed(); + } + + /** + * Checks whether the plugin is active + * + * @return boolean + */ + public static function is_plugin_active() { + return (bool) static::is_jetpack_plugin_active(); + } + + /** + * Get data about the AI Assistant feature + * + * @return array + */ + public static function get_ai_assistant_feature() { + // Bail early if the plugin is not active. + if ( ! self::is_jetpack_plugin_installed() ) { + return array(); + } + + // Check if the global constant is defined. + if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) { + return array(); + } + + // Bail early if the site is not connected. + if ( ! self::is_site_connected() ) { + return array(); + } + + // Check if class exists. If not, try to require it once. + if ( ! class_exists( 'Jetpack_AI_Helper' ) ) { + $class_file_path = JETPACK__PLUGIN_DIR . '_inc/lib/class-jetpack-ai-helper.php'; + + // Check whether the file exists + if ( ! file_exists( $class_file_path ) ) { + return array(); + } + + require_once $class_file_path; + } + + return \Jetpack_AI_Helper::get_ai_assistance_feature(); + } + + /** + * Get the AI Assistant tiered plans status + * + * @return boolean + */ + public static function are_tier_plans_enabled() { + $info = self::get_ai_assistant_feature(); + if ( is_wp_error( $info ) ) { + // this is another faulty default value, we'll assume disabled while + // production is enabled + return false; + } + + if ( ! empty( $info ) && isset( $info['tier-plans-enabled'] ) ) { + return boolval( $info['tier-plans-enabled'] ); + } + return false; + } + + /** + * Checks whether the site is connected to WordPress.com. + * + * @return boolean + */ + private static function is_site_connected() { + return ( new Connection_Manager() )->is_connected(); + } + + /** + * Get the URL where the user manages the product + * + * NOTE: this method is the only thing that resembles an initialization for the product. + * + * @return void + */ + public static function extend_plugin_action_links() { + add_action( 'admin_enqueue_scripts', array( static::class, 'admin_enqueue_scripts' ) ); + add_filter( 'default_content', array( static::class, 'add_ai_block' ), 10, 2 ); + } + + /** + * Enqueue the AI Assistant script + * + * The script is just a global variable used for the nonce, needed for the create post link. + * + * @return void + */ + public static function admin_enqueue_scripts() { + wp_register_script( + 'my_jetpack_ai_app', + false, + array(), + Initializer::PACKAGE_VERSION, + array( 'in_footer' => true ) + ); + wp_localize_script( + 'my_jetpack_ai_app', + 'jetpackAi', + array( + 'nonce' => wp_create_nonce( 'ai-assistant-content-nonce' ), + ) + ); + wp_enqueue_script( 'my_jetpack_ai_app' ); + } + + /** + * Add AI block to the post content + * + * Used only from the link on the product page, the filter will insert an AI Assistant block in the post content. + * + * @param string $content The post content. + * @param WP_Post $post The post object. + * @return string + */ + public static function add_ai_block( $content, WP_Post $post ) { + if ( isset( $_GET['use_ai_block'] ) && isset( $_GET['_wpnonce'] ) + && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'ai-assistant-content-nonce' ) + && current_user_can( 'edit_post', $post->ID ) + && '' === $content + ) { + return ''; + } + return $content; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php new file mode 100644 index 00000000..5472cfec --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php @@ -0,0 +1,133 @@ + static::$slug, + 'plugin_slug' => static::$plugin_slug, + 'name' => static::get_name(), + 'title' => static::get_title(), + 'description' => static::get_description(), + 'long_description' => static::get_long_description(), + 'tiers' => static::get_tiers(), + 'features' => static::get_features(), + 'features_by_tier' => static::get_features_by_tier(), + 'disclaimers' => static::get_disclaimers(), + 'status' => static::get_status(), + 'pricing_for_ui' => static::get_pricing_for_ui(), + 'is_bundle' => static::is_bundle_product(), + 'is_plugin_active' => static::is_plugin_active(), + 'is_upgradable' => static::is_upgradable(), + 'is_upgradable_by_bundle' => static::is_upgradable_by_bundle(), + 'supported_products' => static::get_supported_products(), + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + 'requires_user_connection' => static::$requires_user_connection, + 'has_any_plan_for_product' => static::has_any_plan_for_product(), + 'has_free_plan_for_product' => static::has_free_plan_for_product(), + 'has_paid_plan_for_product' => static::has_paid_plan_for_product(), + 'has_free_offering' => static::$has_free_offering, + 'manage_url' => static::get_manage_url(), + 'purchase_url' => static::get_purchase_url(), + 'post_activation_url' => static::get_post_activation_url(), + 'post_activation_urls_by_feature' => static::get_manage_urls_by_feature(), + 'standalone_plugin_info' => static::get_standalone_info(), + 'class' => static::class, + 'post_checkout_url' => static::get_post_checkout_url(), + 'post_checkout_urls_by_feature' => static::get_post_checkout_urls_by_feature(), + ); + } + + /** + * Collect the site's active features + * + * @return WP_Error|array + */ + private static function get_site_features_from_wpcom() { + static $features = null; + + if ( $features !== null ) { + return $features; + } + + $site_id = Jetpack_Options::get_option( 'id' ); + $response = Client::wpcom_json_api_request_as_blog( sprintf( '/sites/%d/features', $site_id ), '1.1' ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $features = new WP_Error( 'site_features_fetch_failed' ); + return $features; + } + + $body = wp_remote_retrieve_body( $response ); + $feature_return = json_decode( $body ); + $features = $feature_return->active; + + return $features; + } + + /** + * Check to see if the site has a feature + * This will check the features provided by the site plans and products (including free ones) + * + * @param string $feature - the feature to check for. + * @return bool + */ + public static function does_site_have_feature( $feature ) { + if ( ! $feature ) { + return false; + } + + $features = self::get_site_features_from_wpcom(); + if ( is_wp_error( $features ) ) { + return false; + } + + return in_array( $feature, $features, true ); + } + + /** + * Get the product name + * + * @return string + */ + abstract public static function get_name(); + + /** + * Get the product title + * + * @return string + */ + abstract public static function get_title(); + + /** + * Get the internationalized product description + * + * @return string + */ + abstract public static function get_description(); + + /** + * Get the internationalized product long description + * + * @return string + */ + abstract public static function get_long_description(); + + /** + * Get the tiers for the product + * + * @return boolean|string[] The slugs of the tiers (i.e. [ "free", "basic", "advanced" ]), or False if the product has no tiers. + */ + public static function get_tiers() { + return array(); + } + + /** + * Get the internationalized features list + * + * @return array + */ + abstract public static function get_features(); + + /** + * Get the internationalized comparison of features grouped by each tier + * + * @return array + */ + public static function get_features_by_tier() { + return array(); + } + + /** + * Get the product pricing + * + * @return array + */ + abstract public static function get_pricing_for_ui(); + + /** + * Get the URL where the user can purchase the product iff it doesn't have an interstitial page in My Jetpack. + * + * @return ?string + */ + public static function get_purchase_url() { + // Declare as concrete method as most Jetpack products use an interstitial page within My Jetpack. + return null; + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + abstract public static function get_manage_url(); + + /** + * Get the URL where the user manages the product for each product feature + * + * @return ?array + */ + public static function get_manage_urls_by_feature() { + return null; + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return static::get_manage_url(); + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout + * + * @return ?string + */ + public static function get_post_checkout_url() { + return null; + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout for each product feature + * + * @return ?array + */ + public static function get_post_checkout_urls_by_feature() { + return null; + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return null; + } + + /** + * Get the disclaimers corresponding to a feature + * + * @return ?array + */ + public static function get_disclaimers() { + return array(); + } + + /** + * Get the standalone plugin related info + * + * @return array + */ + public static function get_standalone_info() { + $is_standalone_installed = static::$has_standalone_plugin && self::is_plugin_installed(); + $is_standalone_active = static::$has_standalone_plugin && self::is_plugin_active(); + + return array( + 'has_standalone_plugin' => static::$has_standalone_plugin, + 'is_standalone_installed' => $is_standalone_installed, + 'is_standalone_active' => $is_standalone_active, + ); + } + + /** + * Checks whether the site has a paid plan for the product + * This ignores free products, it only checks if there is a purchase that supports the product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + return false; + } + + /** + * Checks whether the site has a free plan for the product + * Note, this should not return true if a product does not have a WPCOM plan (ex: search free, Akismet Free, stats free) + * + * @return false + */ + public static function has_free_plan_for_product() { + return false; + } + + /** + * Checks whether the site has any WPCOM plan for a product (paid or free) + * + * @return bool + */ + public static function has_any_plan_for_product() { + return static::has_paid_plan_for_product() || static::has_free_plan_for_product(); + } + + /** + * Checks whether the product supports trial or not + * + * Returns true if it supports. Return false otherwise. + * + * Free products will always return false. + * + * @return boolean + */ + public static function has_trial_support() { + return false; + } + + /** + * Checks whether the product can be upgraded to a different product. + * + * @return boolean + */ + public static function is_upgradable() { + return false; + } + + /** + * Checks whether product is a bundle. + * + * @return boolean True if product is a bundle. Otherwise, False. + */ + public static function is_bundle_product() { + return false; + } + + /** + * Check whether the product is upgradable + * by a product bundle. + * + * @return boolean|array Bundles list or False if not upgradable by a bundle. + */ + public static function is_upgradable_by_bundle() { + return false; + } + + /** + * In case it's a bundle product, + * return all the products it contains. + * Empty array by default. + * + * @return array Product slugs + */ + public static function get_supported_products() { + return array(); + } + + /** + * Determine if the product is owned or not + * An owned product is defined as a product that is any of the following + * - Active + * - Has historically been active + * - The user has a plan that includes the product + * - The user has the standalone plugin for the product installed + * + * @return boolean + */ + public static function is_owned() { + $historically_active_modules = Jetpack_Options::get_option( 'historically_active_modules', array() ); + $standalone_info = static::get_standalone_info(); + if ( ( static::is_active() && Jetpack_Options::get_option( 'id' ) ) || + $standalone_info['is_standalone_installed'] || + in_array( static::$slug, $historically_active_modules, true ) || + static::has_any_plan_for_product() + ) { + return true; + } + + return false; + } + + /** + * Undocumented function + * + * @return string + */ + public static function get_status() { + if ( ! static::is_plugin_installed() ) { + $status = Products::STATUS_PLUGIN_ABSENT; + if ( static::has_paid_plan_for_product() ) { + $status = Products::STATUS_PLUGIN_ABSENT_WITH_PLAN; + } + } elseif ( static::is_active() ) { + $status = Products::STATUS_ACTIVE; + // We only consider missing site & user connection an error when the Product is active. + if ( static::$requires_site_connection && ! ( new Connection_Manager() )->is_connected() ) { + // Site has never been connected before + if ( ! Jetpack_Options::get_option( 'id' ) && ! static::is_owned() ) { + $status = Products::STATUS_NEEDS_FIRST_SITE_CONNECTION; + } else { + $status = Products::STATUS_SITE_CONNECTION_ERROR; + } + } elseif ( static::$requires_user_connection && ! ( new Connection_Manager() )->has_connected_owner() ) { + $status = Products::STATUS_USER_CONNECTION_ERROR; + } elseif ( static::is_upgradable() ) { + $status = Products::STATUS_CAN_UPGRADE; + } + // Check specifically for inactive modules, which will prevent a product from being active + } elseif ( static::$module_name && ! static::is_module_active() ) { + $status = Products::STATUS_MODULE_DISABLED; + // If there is not a plan associated with the disabled module, encourage a plan first + // Getting a plan set up should help resolve any connection issues + // However if the standalone plugin for this product is active, then we will defer to showing errors that prevent the module from being active + // This is because if a standalone plugin is installed, we expect the product to not show as "inactive" on My Jetpack + if ( static::$requires_plan || ( ! static::has_any_plan_for_product() && static::$has_standalone_plugin && ! self::is_plugin_active() ) ) { + $status = static::is_owned() && static::$has_free_offering && ! static::$requires_plan ? Products::STATUS_NEEDS_ACTIVATION : Products::STATUS_NEEDS_PLAN; + } elseif ( static::$requires_site_connection && ! ( new Connection_Manager() )->is_connected() ) { + // Site has never been connected before and product is not owned + if ( ! Jetpack_Options::get_option( 'id' ) && ! static::is_owned() ) { + $status = Products::STATUS_NEEDS_FIRST_SITE_CONNECTION; + } else { + $status = Products::STATUS_SITE_CONNECTION_ERROR; + } + } elseif ( static::$requires_user_connection && ! ( new Connection_Manager() )->has_connected_owner() ) { + $status = Products::STATUS_USER_CONNECTION_ERROR; + } + } elseif ( ! static::has_any_plan_for_product() ) { + $status = static::is_owned() && static::$has_free_offering && ! static::$requires_plan ? Products::STATUS_NEEDS_ACTIVATION : Products::STATUS_NEEDS_PLAN; + } else { + $status = Products::STATUS_INACTIVE; + } + return $status; + } + + /** + * Checks whether the Product is active + * + * @return boolean + */ + public static function is_active() { + return static::is_plugin_active() && ( static::has_any_plan_for_product() || ( ! static::$requires_plan && static::$has_free_offering ) ); + } + + /** + * Checks whether the plugin is installed + * + * @return boolean + */ + public static function is_plugin_installed() { + return (bool) static::get_installed_plugin_filename(); + } + + /** + * Checks whether the plugin is active + * + * @return boolean + */ + public static function is_plugin_active() { + return Plugins_Installer::is_plugin_active( static::get_installed_plugin_filename() ); + } + + /** + * Checks whether the Jetpack plugin is installed + * + * @return boolean + */ + public static function is_jetpack_plugin_installed() { + return (bool) static::get_installed_plugin_filename( 'jetpack' ); + } + + /** + * Checks whether the Jetpack plugin is active + * + * @return boolean + */ + public static function is_jetpack_plugin_active() { + return Plugins_Installer::is_plugin_active( static::get_installed_plugin_filename( 'jetpack' ) ); + } + + /** + * Checks whether the Jetpack module is active only if a module_name is defined + * + * @return bool + */ + public static function is_module_active() { + if ( static::$module_name ) { + return ( new Modules() )->is_active( static::$module_name ); + } + return true; + } + + /** + * Activates the plugin + * + * @return null|WP_Error Null on success, WP_Error on invalid file. + */ + public static function activate_plugin() { + return activate_plugin( static::get_installed_plugin_filename() ); + } + + /** + * Perform the top level activation routines, which is installing and activating the required plugin + * + * @return bool|WP_Error + */ + private static function do_activation() { + if ( static::is_active() ) { + return true; + } + + // Default to installing the standalone plugin for the product + if ( ! self::is_plugin_installed() ) { + $installed = Plugins_Installer::install_plugin( static::get_plugin_slug() ); + if ( is_wp_error( $installed ) ) { + return $installed; + } + } + + if ( ! current_user_can( 'activate_plugins' ) ) { + return new WP_Error( 'not_allowed', __( 'You are not allowed to activate plugins on this site.', 'jetpack-my-jetpack' ) ); + } + + $result = static::activate_plugin(); + if ( is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Activates the product by installing and activating its plugin + * + * @return boolean|WP_Error + */ + final public static function activate() { + + $result = self::do_activation(); + + $result = static::do_product_specific_activation( $result ); + + $product_slug = static::$slug; + + /** + * Fires after My Jetpack activates a product and filters the result + * Use this filter to run additional routines for a product activation on stand-alone plugins + * + * @param bool|WP_Error $result The result of the previous steps of activation. + */ + $result = apply_filters( "my_jetpack_{$product_slug}_activation", $result ); + + return $result; + } + + /** + * Override this method to perform product specific activation routines. + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return bool|WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + return $current_result; + } + + /** + * Deactivate the product + * + * @return boolean + */ + public static function deactivate() { + deactivate_plugins( static::get_installed_plugin_filename() ); + return true; + } + + /** + * Returns filtered Jetpack plugin actions links. + * + * @param array $actions - Jetpack plugin action links. + * @return array Filtered Jetpack plugin actions links. + */ + public static function get_plugin_actions_links( $actions ) { + // My Jetpack action link. + $my_jetpack_home_link = array( + 'jetpack-home' => sprintf( + '%2$s', + admin_url( 'admin.php?page=my-jetpack' ), + __( 'My Jetpack', 'jetpack-my-jetpack' ), + __( 'My Jetpack dashboard', 'jetpack-my-jetpack' ) + ), + ); + + // Otherwise, add it to the beginning of the array. + return array_merge( $my_jetpack_home_link, $actions ); + } + + /** + * Filter the action links for the plugins specified. + * + * @param string|string[] $filenames The plugin filename(s) to filter the action links for. + */ + private static function filter_action_links( $filenames ) { + foreach ( $filenames as $filename ) { + $hook = 'plugin_action_links_' . $filename; + $callback = array( static::class, 'get_plugin_actions_links' ); + if ( ! has_filter( $hook, $callback ) ) { + add_filter( $hook, $callback, 20, 2 ); + } + } + } + + /** + * Extend the plugin action links. + */ + public static function extend_plugin_action_links() { + $filenames = static::get_plugin_filename(); + if ( ! is_array( $filenames ) ) { + $filenames = array( $filenames ); + } + + self::filter_action_links( $filenames ); + } + + /** + * Extend the Jetpack plugin action links. + */ + public static function extend_core_plugin_action_links() { + $filenames = self::JETPACK_PLUGIN_FILENAME; + + self::filter_action_links( $filenames ); + } + + /** + * Install and activate the standalone plugin in the case it's missing. + * + * @return boolean|WP_Error + */ + public static function install_and_activate_standalone() { + /** + * Check for the presence of the standalone plugin, ignoring Jetpack presence. + * + * If the standalone plugin is not installed and the user can install plugins, proceed with the installation. + */ + if ( ! static::is_plugin_installed() ) { + /** + * Check for permissions + */ + if ( ! current_user_can( 'install_plugins' ) ) { + return new WP_Error( 'not_allowed', __( 'You are not allowed to install plugins on this site.', 'jetpack-my-jetpack' ) ); + } + + /** + * Install the plugin + */ + $installed = Plugins_Installer::install_plugin( static::get_plugin_slug() ); + if ( is_wp_error( $installed ) ) { + return $installed; + } + } + + /** + * Activate the installed plugin + */ + $result = static::activate_plugin(); + + if ( is_wp_error( $result ) ) { + return $result; + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php new file mode 100644 index 00000000..a7638c2d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php @@ -0,0 +1,357 @@ + 2 ), null, 'wpcom' ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'scan_state_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Get the product's available tiers + * + * @return string[] Slugs of the available tiers + */ + public static function get_tiers() { + return array( + self::UPGRADED_TIER_SLUG, + self::FREE_TIER_SLUG, + ); + } + + /** + * Get the internationalized comparison of free vs upgraded features + * + * @return array[] Protect features comparison + */ + public static function get_features_by_tier() { + return array( + array( + 'name' => __( 'Scan for threats and vulnerabilities', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'included' => true, + 'description' => __( 'Check items against database', 'jetpack-my-jetpack' ), + ), + self::UPGRADED_TIER_SLUG => array( + 'included' => true, + 'description' => __( 'Line by line malware scanning', 'jetpack-my-jetpack' ), + ), + ), + ), + array( + 'name' => __( 'Daily automated scans', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( + 'included' => true, + 'description' => __( 'Plus on-demand manual scans', 'jetpack-my-jetpack' ), + ), + ), + ), + array( + 'name' => __( 'Web Application Firewall', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'included' => false, + 'description' => __( 'Manual rules only', 'jetpack-my-jetpack' ), + ), + self::UPGRADED_TIER_SLUG => array( + 'included' => true, + 'description' => __( 'Automatic protection and rule updates', 'jetpack-my-jetpack' ), + ), + ), + ), + array( + 'name' => __( 'Brute force protection', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => true ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Access to scan on Cloud', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'One-click auto fixes', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Notifications', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + array( + 'name' => __( 'Severity labels', 'jetpack-my-jetpack' ), + 'tiers' => array( + self::FREE_TIER_SLUG => array( 'included' => false ), + self::UPGRADED_TIER_SLUG => array( 'included' => true ), + ), + ), + ); + } + + /** + * Get the product pricing details + * + * @return array Pricing details + */ + public static function get_pricing_for_ui() { + return array( + 'tiers' => array( + self::FREE_TIER_SLUG => array( + 'available' => true, + 'is_free' => true, + ), + self::UPGRADED_TIER_SLUG => array_merge( + array( + 'available' => true, + 'wpcom_product_slug' => self::UPGRADED_TIER_PRODUCT_SLUG, + ), + Wpcom_Products::get_product_pricing( self::UPGRADED_TIER_PRODUCT_SLUG ) + ), + ), + ); + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $plans_with_scan = array( + 'jetpack_scan', + 'jetpack_security', + 'jetpack_complete', + 'jetpack_premium', + 'jetpack_business', + ); + + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + foreach ( $plans_with_scan as $plan ) { + if ( strpos( $purchase->product_slug, $plan ) !== false ) { + return true; + } + } + } + } + return false; + } + + /** + * Checks whether the product can be upgraded - i.e. this shows the /#add-protect interstitial + * + * @return boolean + */ + public static function is_upgradable() { + return ! self::has_paid_plan_for_product(); + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout + * + * @return ?string + */ + public static function get_post_checkout_url() { + return self::get_manage_url(); + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout for each product feature + * + * @return ?array + */ + public static function get_post_checkout_urls_by_feature() { + return array( + self::SCAN_FEATURE_SLUG => self::get_post_checkout_url(), + self::FIREWALL_FEATURE_SLUG => admin_url( 'admin.php?page=jetpack-protect#/firewall' ), + ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack-protect' ); + } + + /** + * Get the URL where the user manages the product for each product feature + * + * @return ?array + */ + public static function get_manage_urls_by_feature() { + return array( + self::SCAN_FEATURE_SLUG => self::get_manage_url(), + self::FIREWALL_FEATURE_SLUG => admin_url( 'admin.php?page=jetpack-protect#/firewall' ), + ); + } + + /** + * Return product bundles list + * that supports the product. + * + * @return array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'security', 'complete' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php new file mode 100644 index 00000000..8da0ccaf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php @@ -0,0 +1,232 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_scan'; + } + + /** + * Hits the wpcom api to check scan status. + * + * @todo Maybe add caching. + * + * @return Object|WP_Error + */ + private static function get_state_from_wpcom() { + static $status = null; + + if ( $status !== null ) { + return $status; + } + + $site_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( sprintf( '/sites/%d/scan', $site_id ) . '?force=wpcom', '2', array( 'timeout' => 2 ), null, 'wpcom' ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $status = new WP_Error( 'scan_state_fetch_failed' ); + return $status; + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_required_plan() { + $scan_data = static::get_state_from_wpcom(); + if ( is_wp_error( $scan_data ) ) { + return false; + } + return is_object( $scan_data ) && isset( $scan_data->state ) && 'unavailable' !== $scan_data->state; + } + + /** + * Checks whether the Product is active + * + * Scan is not actually a module. Activation takes place on WPCOM. So lets consider it active if jetpack is active and has the plan. + * + * @return boolean + */ + public static function is_active() { + return static::is_jetpack_plugin_active() && static::has_required_plan(); + } + + /** + * Activates the product by installing and activating its plugin + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return boolean|\WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + + $product_activation = parent::do_product_specific_activation( $current_result ); + + if ( is_wp_error( $product_activation ) && 'module_activation_failed' === $product_activation->get_error_code() ) { + // Scan is not a module. There's nothing in the plugin to be activated, so it's ok to fail to activate the module. + $product_activation = true; + } + + return $product_activation; + } + + /** + * Checks whether the Jetpack module is active + * + * Scan is not a module. Nothing needs to be active. Let's always consider it active. + * + * @return bool + */ + public static function is_module_active() { + return true; + } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'security' ); + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return Redirect::get_url( 'my-jetpack-manage-scan' ); + } + + /** + * Get the URL where the user should be redirected after checkout + */ + public static function get_post_checkout_url() { + if ( static::is_jetpack_plugin_active() ) { + return 'admin.php?page=jetpack#/recommendations'; + } + + // If Jetpack is not active, it means that the user has another standalone plugin active + // and it follows the `Protect` plugin flow instead of `Scan` so for now it would be safe + // to return null and let the user go back to the My Jetpack page. + return null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php new file mode 100644 index 00000000..8d363a3b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php @@ -0,0 +1,150 @@ + true, + 'exclude_from_search' => false, + ) + ); + $indexable_status_array = get_post_stati( + array( + 'public' => true, + 'exclude_from_search' => false, + ) + ); + $raw_posts_counts = static::get_raw_post_type_breakdown(); + if ( ! $raw_posts_counts || is_wp_error( $raw_posts_counts ) ) { + return array(); + } + $posts_counts = static::get_post_type_breakdown_with( $raw_posts_counts, $indexable_post_types, $indexable_status_array ); + + return $posts_counts; + } + + /** + * Calculate breakdown of post types with passed in indexable post types and statuses. + * The function is going to be used from WPCOM as well for consistency. + * + * @param array $raw_posts_counts Array of post types with counts as value. + * @param array $indexable_post_types Array of indexable post types. + * @param array $indexable_status_array Array of indexable post statuses. + */ + public static function get_post_type_breakdown_with( $raw_posts_counts, $indexable_post_types, $indexable_status_array ) { + $posts_counts = array(); + foreach ( $raw_posts_counts as $row ) { + // ignore if status is not public. + if ( ! in_array( $row['post_status'], $indexable_status_array, true ) ) { + continue; + } + // ignore if post type is in excluded post types. + if ( in_array( $row['post_type'], self::EXCLUDED_POST_TYPES, true ) ) { + continue; + } + // ignore if post type is not public and is not explicitly included. + if ( ! in_array( $row['post_type'], $indexable_post_types, true ) && + ! in_array( $row['post_type'], self::DO_NOT_EXCLUDE_POST_TYPES, true ) + ) { + continue; + } + // add up post type counts of potentially multiple post_status. + if ( ! isset( $posts_counts[ $row['post_type'] ] ) ) { + $posts_counts[ $row['post_type'] ] = 0; + } + $posts_counts[ $row['post_type'] ] += intval( $row['num_posts'] ); + } + + arsort( $posts_counts, SORT_NUMERIC ); + return $posts_counts; + } + + /** + * Get raw post type breakdown from the database. + */ + protected static function get_raw_post_type_breakdown() { + global $wpdb; + + $results = wp_cache_get( self::POST_TYPE_BREAKDOWN_CACHE_KEY, self::CACHE_GROUP ); + if ( false !== $results ) { + return $results; + } + + $query = "SELECT post_type, post_status, COUNT( * ) AS num_posts + FROM {$wpdb->posts} + WHERE post_password = '' + GROUP BY post_type, post_status"; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery + $results = $wpdb->get_results( $query, ARRAY_A ); + wp_cache_set( self::POST_TYPE_BREAKDOWN_CACHE_KEY, $results, self::CACHE_GROUP, self::CACHE_EXPIRY ); + return $results; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php new file mode 100644 index 00000000..703c8fd8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php @@ -0,0 +1,394 @@ + true, + 'trial_available' => static::has_trial_support(), + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + 'wpcom_free_product_slug' => static::get_wpcom_free_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + + $record_count = intval( Search_Stats::estimate_count() ); + $search_pricing = static::get_pricing_from_wpcom( $record_count ); + + if ( is_wp_error( $search_pricing ) ) { + return $pricing; + } + + $pricing['estimated_record_count'] = $record_count; + + return array_merge( $pricing, $search_pricing ); + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout + * + * @return ?string + */ + public static function get_post_checkout_url() { + return self::get_manage_url(); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_search'; + } + + /** + * Get the WPCOM free product slug + * + * @return ?string + */ + public static function get_wpcom_free_product_slug() { + return 'jetpack_search_free'; + } + + /** + * Returns true if the new_pricing_202208 is set to not empty in URL for testing purpose, or it's active. + */ + public static function is_new_pricing_202208() { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash + if ( isset( $_GET['new_pricing_202208'] ) && $_GET['new_pricing_202208'] ) { + return true; + } + + $record_count = intval( Search_Stats::estimate_count() ); + $search_pricing = static::get_pricing_from_wpcom( $record_count ); + if ( is_wp_error( $search_pricing ) ) { + return false; + } + + return '202208' === $search_pricing['pricing_version']; + } + + /** + * Override status to `needs_activation` when status is `needs_plan`. + */ + public static function get_status() { + $status = parent::get_status(); + return $status; + } + + /** + * Use centralized Search pricing API. + * + * The function is also used by the search package, as a result it could be called before site connection - i.e. blog token might not be available. + * + * @param int $record_count Record count to estimate pricing. + * + * @return array|WP_Error + */ + public static function get_pricing_from_wpcom( $record_count ) { + static $pricings = array(); + $connection = new Connection_Manager(); + $blog_id = \Jetpack_Options::get_option( 'id' ); + + if ( isset( $pricings[ $record_count ] ) ) { + return $pricings[ $record_count ]; + } + + // If the site is connected, request pricing with the blog token + if ( $blog_id ) { + $endpoint = sprintf( '/jetpack-search/pricing?record_count=%1$d&locale=%2$s', $record_count, get_user_locale() ); + + // If available in the user data, set the user's currency as one of the params + if ( $connection->is_user_connected() ) { + $user_details = $connection->get_connected_user_data(); + if ( ! empty( $user_details['user_currency'] ) && $user_details['user_currency'] !== 'USD' ) { + $endpoint .= sprintf( '¤cy=%s', $user_details['user_currency'] ); + } + } + + $response = Client::wpcom_json_api_request_as_blog( + $endpoint, + '2', + array( 'timeout' => 5 ), + null, + 'wpcom' + ); + } else { + $response = wp_remote_get( + sprintf( Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ) . '/wpcom/v2/jetpack-search/pricing?record_count=%1$d&locale=%2$s', $record_count, get_user_locale() ), + array( 'timeout' => 5 ) + ); + } + + if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'search_pricing_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $pricings[ $record_count ] = json_decode( $body, true ); + return $pricings[ $record_count ]; + } + + /** + * Hits the wpcom api to check Search status. + * + * @todo Maybe add caching. + * + * @return Object|WP_Error + */ + private static function get_state_from_wpcom() { + static $status = null; + + if ( $status !== null ) { + return $status; + } + + $blog_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( + '/sites/' . $blog_id . '/jetpack-search/plan', + '2', + array( 'timeout' => 5 ), + null, + 'wpcom' + ); + + if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'search_state_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Checks whether the product supports trial or not + * + * Returns true if it supports. Return false otherwise. + * + * Free products will always return false. + * + * @return boolean + */ + public static function has_trial_support() { + return static::is_new_pricing_202208(); + } + + /** + * Checks if the site purchases contain a paid search plan + * + * @return bool + */ + public static function has_paid_plan_for_product() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + // Search is available as standalone product and as part of the Complete plan. + if ( + ( str_contains( $purchase->product_slug, 'jetpack_search' ) && ! str_contains( $purchase->product_slug, 'jetpack_search_free' ) ) || + str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + return true; + } + } + } + return false; + } + + /** + * Checks if the site purchases contain a free search plan + * + * @return bool + */ + public static function has_free_plan_for_product() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( str_contains( $purchase->product_slug, 'jetpack_search_free' ) ) { + return true; + } + } + } + return false; + } + + /** + * Activates the product. Try to enable instant search after the Search module was enabled. + * + * @param bool|WP_Error $product_activation Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return bool|WP_Error + */ + public static function do_product_specific_activation( $product_activation ) { + $product_activation = parent::do_product_specific_activation( $product_activation ); + if ( is_wp_error( $product_activation ) ) { + return $product_activation; + } + + if ( class_exists( 'Automattic\Jetpack\Search\Module_Control' ) ) { + ( new Search_Module_Control() )->enable_instant_search(); + } + + // we don't want to change the success of the activation if we fail to activate instant search. That's not mandatory. + return $product_activation; + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page or continue the purchase flow if needed. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack-search' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php new file mode 100644 index 00000000..866899cb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php @@ -0,0 +1,212 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_security_t1_yearly'; + } + + /** + * Checks whether the Jetpack module is active + * + * This is a bundle and not a product. We should not use this information for anything + * + * @return bool + */ + public static function is_module_active() { + return false; + } + + /** + * Activates the product by installing and activating its plugin + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return boolean|\WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + + $product_activation = parent::do_product_specific_activation( $current_result ); + + if ( is_wp_error( $product_activation ) && 'module_activation_failed' === $product_activation->get_error_code() ) { + // A bundle is not a module. There's nothing in the plugin to be activated, so it's ok to fail to activate the module. + $product_activation = true; + } + + // At this point, Jetpack plugin is installed. Let's activate each individual product. + $activation = Anti_Spam::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + $activation = Backup::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + $activation = Scan::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + return $activation; + } + + /** + * Checks whether the Product is active + * + * Security is a bundle and not a module. Activation takes place on WPCOM. So lets consider it active if jetpack is active and has the plan. + * + * @return boolean + */ + public static function is_active() { + return static::is_jetpack_plugin_active() && static::has_required_plan(); + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_required_plan() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( + str_starts_with( $purchase->product_slug, 'jetpack_security' ) || + str_starts_with( $purchase->product_slug, 'jetpack_complete' ) + ) { + return true; + } + } + } + return false; + } + + /** + * Checks whether product is a bundle. + * + * @return boolean True + */ + public static function is_bundle_product() { + return true; + } + + /** + * Return all the products it contains. + * + * @return Array Product slugs + */ + public static function get_supported_products() { + return array( 'backup', 'scan', 'anti-spam' ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return ''; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php new file mode 100644 index 00000000..80913a97 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php @@ -0,0 +1,199 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout + * + * @return ?string + */ + public static function get_post_checkout_url() { + return self::get_manage_url(); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_social_v1_yearly'; + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $plans_with_social = array( + 'jetpack_social', + 'jetpack_complete', + 'jetpack_business', + 'jetpack_premium', + 'jetpack_personal', + ); + // For atomic sites, do a feature check to see if the republicize feature is available + // This feature is available by default on all Jetpack sites + if ( ( new Host() )->is_woa_site() ) { + return static::does_site_have_feature( 'republicize' ); + } + + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + foreach ( $plans_with_social as $plan ) { + if ( strpos( $purchase->product_slug, $plan ) !== false ) { + return true; + } + } + } + } + return false; + } + + /** + * Get the URL where the user manages the product. + * + * If the standalone plugin is active, + * it will redirect to the standalone plugin settings page. + * Otherwise, it will redirect to the Jetpack settings page. + * + * @return string + */ + public static function get_manage_url() { + if ( static::is_standalone_plugin_active() ) { + return admin_url( 'admin.php?page=jetpack-social' ); + } + + return admin_url( 'admin.php?page=jetpack#/settings?term=publicize' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php new file mode 100644 index 00000000..700a07c2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php @@ -0,0 +1,203 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_starter_yearly'; + } + + /** + * Checks whether the Jetpack module is active + * + * This is a bundle and not a product. We should not use this information for anything + * + * @return bool + */ + public static function is_module_active() { + return false; + } + + /** + * Activates the product by installing and activating its plugin + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return boolean|\WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + + $product_activation = parent::do_product_specific_activation( $current_result ); + + if ( is_wp_error( $product_activation ) && 'module_activation_failed' === $product_activation->get_error_code() ) { + // A bundle is not a module. There's nothing in the plugin to be activated, so it's ok to fail to activate the module. + $product_activation = true; + } + + // At this point, Jetpack plugin is installed. Let's activate each individual product. + $activation = Anti_Spam::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + $activation = Backup::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + return $activation; + } + + /** + * Checks whether the Product is active + * + * Jetpack Starter is a bundle and not a module. Activation takes place on WPCOM. So lets consider it active if jetpack is active and has the plan. + * + * @return boolean + */ + public static function is_active() { + return static::is_jetpack_plugin_active() && static::has_required_plan(); + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_required_plan() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( str_starts_with( $purchase->product_slug, 'jetpack_starter' ) ) { + return true; + } + } + } + return false; + } + + /** + * Checks whether product is a bundle. + * + * @return boolean True + */ + public static function is_bundle_product() { + return true; + } + + /** + * Return all the products it contains. + * + * @return Array Product slugs + */ + public static function get_supported_products() { + return array( 'backup', 'anti-spam' ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return ''; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php new file mode 100644 index 00000000..6f1118cf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php @@ -0,0 +1,310 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_stats_yearly'; + } + + /** + * Get the WPCOM Pay Whatever You Want product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_pwyw_product_slug() { + return 'jetpack_stats_pwyw_yearly'; + } + + /** + * Get the WPCOM free product slug + * + * @return ?string + */ + public static function get_wpcom_free_product_slug() { + return 'jetpack_stats_free_yearly'; + } + + /** + * Gets the 'status' of the Stats product + * + * @return string + */ + public static function get_status() { + $status = parent::get_status(); + if ( Products::STATUS_MODULE_DISABLED === $status && ! Initializer::is_registered() ) { + // If the site has never been connected before, show the "Learn more" CTA, + // that points to the add Stats product interstitial. + $status = Products::STATUS_NEEDS_FIRST_SITE_CONNECTION; + } + return $status; + } + /** + * Checks whether the product can be upgraded to a different product. + * Stats Commercial plan (highest tier) & Jetpack Complete are not upgradable. + * Also we don't push PWYW users to upgrade. + * + * @return boolean + */ + public static function is_upgradable() { + // For now, atomic sites with stats are not in a position to upgrade + if ( ( new Host() )->is_woa_site() ) { + return false; + } + + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( ! is_wp_error( $purchases_data ) && is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + // Jetpack complete includes Stats commercial & cannot be upgraded + if ( str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + return false; + } elseif ( + // Stats commercial purchased with highest tier cannot be upgraded. + in_array( + $purchase->product_slug, + array( 'jetpack_stats_yearly', 'jetpack_stats_monthly', 'jetpack_stats_bi_yearly' ), + true + ) && $purchase->current_price_tier_slug === 'more_than_1m_views' + ) { + return false; + } elseif ( + // If user already has Stats PWYW, we won't push them to upgrade. + $purchase->product_slug === 'jetpack_stats_pwyw_yearly' + ) { + return false; + } + } + } + return true; + } + + /** + * Checks if the site has a paid plan that supports this product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + // Stats is available as standalone product and as part of the Complete plan. + if ( strpos( $purchase->product_slug, 'jetpack_stats' ) !== false || str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { + return true; + } + } + } + return false; + } + + /** + * Returns a productType parameter for an upgrade URL, determining whether + * to show the PWYW upgrade interstitial or commercial upgrade interstitial. + * + * @return string + */ + public static function get_url_product_type() { + $purchases_data = Wpcom_Products::get_site_current_purchases(); + $is_commercial_site = Initializer::is_commercial_site(); + if ( is_wp_error( $purchases_data ) ) { + return $is_commercial_site ? '&productType=commercial' : ''; + } + if ( $is_commercial_site ) { + return '&productType=commercial'; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( + str_starts_with( $purchase->product_slug, static::get_wpcom_free_product_slug() ) + ) { + return '&productType=personal'; + } elseif ( + in_array( + $purchase->product_slug, + array( 'jetpack_stats_yearly', 'jetpack_stats_monthly', 'jetpack_stats_bi_yearly' ), + true + ) && + ! empty( $purchase->current_price_tier_slug ) + ) { + return '&productType=commercial'; + } + } + } + return ''; + } + + /** + * Checks whether the product supports trial or not. + * Since Jetpack Stats has been widely available as a free product in the past, it "supports" a trial. + * + * @return boolean + */ + public static function has_trial_support() { + return true; + } + + /** + * Get the WordPress.com URL for purchasing Jetpack Stats for the current site. + * + * @return ?string + */ + public static function get_purchase_url() { + // The returning URL could be customized by changing the `redirect_uri` param with relative path. + return sprintf( + '%s#!/stats/purchase/%d?from=jetpack-my-jetpack%s&redirect_uri=%s', + admin_url( 'admin.php?page=stats' ), + Jetpack_Options::get_option( 'id' ), + static::get_url_product_type(), + rawurlencode( 'admin.php?page=stats' ) + ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=stats' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php new file mode 100644 index 00000000..1ee6b122 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php @@ -0,0 +1,203 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the URL the user is taken after purchasing the product through the checkout + * + * @return ?string + */ + public static function get_post_checkout_url() { + return self::get_manage_url(); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_videopress'; + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + if ( method_exists( 'Automattic\Jetpack\VideoPress\Initializer', 'should_initialize_admin_ui' ) && \Automattic\Jetpack\VideoPress\Initializer::should_initialize_admin_ui() ) { + return \Automattic\Jetpack\VideoPress\Admin_UI::get_admin_page_url(); + } else { + return admin_url( 'admin.php?page=jetpack#/settings?term=videopress' ); + } + } + + /** + * Checks whether the site has a paid plan for this product + * + * @return boolean + */ + public static function has_paid_plan_for_product() { + $plans_with_videopress = array( + 'jetpack_videopress', + 'jetpack_complete', + 'jetpack_business', + 'jetpack_premium', + ); + $purchases_data = Wpcom_Products::get_site_current_purchases(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + foreach ( $plans_with_videopress as $plan ) { + if ( strpos( $purchase->product_slug, $plan ) !== false ) { + return true; + } + } + } + } + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md new file mode 100644 index 00000000..3a071dac --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md @@ -0,0 +1,148 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.3.2] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [0.3.1] - 2024-03-14 +### Changed +- Internal updates. + +## [0.3.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [0.2.14] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [0.2.13] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.2.12] - 2023-03-20 +### Changed +- Updated package dependencies. [#29480] + +## [0.2.11] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.2.10] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [0.2.9] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [0.2.8] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [0.2.7] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [0.2.6] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.2.5] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [0.2.4] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [0.2.3] - 2022-03-29 +### Changed +- Microperformance: Use === null instead of is_null + +## [0.2.2] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [0.2.1] - 2022-01-18 +### Changed +- Updated package dependencies. + +## [0.2.0] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies +- Updated package textdomain from `jetpack` to `jetpack-password-checker`. + +## [0.1.8] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [0.1.7] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [0.1.6] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [0.1.5] - 2021-10-12 +### Changed +- Updated package dependencies + +## [0.1.4] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [0.1.3] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +## [0.1.2] - 2021-05-25 +### Fixed +- Avoid checking in vendor directory. + +## [0.1.1] - 2021-04-27 +### Changed +- Updated package dependencies. + +## 0.1.0 - 2021-03-30 +### Added +- Initial release. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +[0.3.2]: https://github.com/Automattic/jetpack-password-checker/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/Automattic/jetpack-password-checker/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.14...v0.3.0 +[0.2.14]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.13...v0.2.14 +[0.2.13]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.12...v0.2.13 +[0.2.12]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.11...v0.2.12 +[0.2.11]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.10...v0.2.11 +[0.2.10]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.9...v0.2.10 +[0.2.9]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.8...v0.2.9 +[0.2.8]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.7...v0.2.8 +[0.2.7]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.6...v0.2.7 +[0.2.6]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.5...v0.2.6 +[0.2.5]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.4...v0.2.5 +[0.2.4]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.3...v0.2.4 +[0.2.3]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.8...v0.2.0 +[0.1.8]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.7...v0.1.8 +[0.1.7]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.6...v0.1.7 +[0.1.6]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/composer.json new file mode 100644 index 00000000..a1ee9e62 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/composer.json @@ -0,0 +1,50 @@ +{ + "name": "automattic/jetpack-password-checker", + "description": "Password Checker.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-password-checker", + "textdomain": "jetpack-password-checker", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-password-checker/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.3.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php new file mode 100644 index 00000000..79c369c2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php @@ -0,0 +1,1313 @@ +user_id = get_current_user_id(); + } elseif ( is_object( $user ) && isset( $user->ID ) ) { + // Existing user, using their ID. + $this->user_id = $user->ID; + } elseif ( is_object( $user ) ) { + // Newly created user, using existing data. + $this->user = $user; + $this->user_id = 'new_user'; + } else { + $this->user_id = $user; + } + + /** + * Filters the password strength enforcement settings. + * + * You can supply your own passwords that should not be used for authenticating in addition to weak and easy + * to guess strings for each user. For example, you can add passwords from known password databases to avoid + * compromised password usage. + * + * @param array $common_passwords strings that are forbidden for use as passwords. + */ + $this->common_passwords = apply_filters( 'password_checker_common_passwords', $this->common_passwords ); + + /** + * Filters the password strength enforcement settings. + * + * You can modify the minimum password length using this filter. + * + * @param int $minimum_password_length minimum password length. + */ + $this->minimum_password_length = apply_filters( 'password_checker_minimum_password_length', $this->minimum_password_length ); + + /** + * Filters the password strength enforcement settings. + * + * You can modify the minimum entropy bits requirement using this filter. + * + * @param int $minimum_entropy_bits minimum entropy bits requirement. + */ + $this->minimum_entropy_bits = apply_filters( 'password_checker_minimum_entropy_bits', $this->minimum_entropy_bits ); + } + + /** + * Run tests against a password. + * + * @param string $password the password. + * @param bool $required_only only test against required conditions, defaults to false. + * + * @return array an array containing failed and passed test results. + */ + public function test( $password, $required_only = false ) { + // Run the tests. + $results = $this->run_tests( $password, $this->get_tests(), $required_only ); + + // If we've failed on the required tests, return now. + if ( ! empty( $results['failed'] ) ) { + return array( + 'passed' => false, + 'test_results' => $results, + ); + } + + $entropy_bits = $this->calculate_entropy_bits( $password ); + + // If we have failed the entropy bits test, run the regex tests so we can suggest improvements. + if ( $entropy_bits < $this->minimum_entropy_bits ) { + $results['failed']['entropy_bits'] = $entropy_bits; + // Run the tests. + $results = array_merge( $results, $this->run_tests( $password, $this->get_tests( 'preg_match' ) ) ); + } + + return ( array( + 'passed' => empty( $results['failed'] ), + 'test_results' => $results, + ) ); + } + + /** + * Run the tests using the currently set up object values. + * + * @param string $password the password. + * @param array $tests tests to run. + * @param bool $required_only whether to run only required tests. + * + * @return array test results. + */ + public function run_tests( $password, $tests, $required_only = false ) { + $results = array( + 'passed' => array(), + 'failed' => array(), + ); + + foreach ( $tests as $test_type => $section_tests ) { + foreach ( $section_tests as $test_name => $test_data ) { + // Skip non-required tests if required_only param is set. + if ( $required_only && ! $test_data['required'] ) { + continue; + } + + $result = call_user_func_array( array( $this, 'test_' . $test_type ), array( $password, $test_data ) ); + if ( $result ) { + $results['passed'][] = array( 'test_name' => $test_name ); + } else { + $results['failed'][] = array( + 'test_name' => $test_name, + 'explanation' => $test_data['error'], + ); + + if ( isset( $test_data['fail_immediately'] ) ) { + return $results; + } + } + } + } + + return $results; + } + + /** + * Returns an array of tests that need to be run on password strings. + * + * @param array $sections only return specific sections with the passed keys, defaults to all. + * + * @return array test descriptions. + */ + public function get_tests( $sections = false ) { + // Note: these should be in order of priority. + $tests = array( + 'preg_match' => array( + 'no_backslashes' => array( + 'pattern' => '/^[^\\\\]*$/u', + 'error' => __( 'Passwords may not contain the character "\".', 'jetpack-password-checker' ), + 'required' => true, + 'fail_immediately' => true, + ), + 'minimum_length' => array( + 'pattern' => '/^.{' . $this->minimum_password_length . ',}/u', + /* translators: %d is a number of characters in the password. */ + 'error' => sprintf( __( 'Password must be at least %d characters.', 'jetpack-password-checker' ), $this->minimum_password_length ), + 'required' => true, + 'fail_immediately' => true, + ), + 'has_mixed_case' => array( + 'pattern' => '/([a-z].*?[A-Z]|[A-Z].*?[a-z])/u', + 'error' => __( 'This password is too easy to guess: you can improve it by adding additional uppercase letters, lowercase letters, or numbers.', 'jetpack-password-checker' ), + 'required' => false, + ), + 'has_digit' => array( + 'pattern' => '/\d/u', + 'error' => __( 'This password is too easy to guess: you can improve it by mixing both letters and numbers.', 'jetpack-password-checker' ), + 'required' => false, + ), + 'has_special_char' => array( + 'pattern' => '/[^a-zA-Z\d]/u', + 'error' => __( 'This password is too easy to guess: you can improve it by including special characters such as !#=?*&.', 'jetpack-password-checker' ), + 'required' => false, + ), + ), + 'compare_to_list' => array( + 'not_a_common_password' => array( + 'list_callback' => 'get_common_passwords', + 'compare_callback' => 'negative_in_array', + 'error' => __( 'This is a very common password. Choose something that will be harder for others to guess.', 'jetpack-password-checker' ), + 'required' => true, + ), + 'not_same_as_other_user_data' => array( + 'list_callback' => 'get_other_user_data', + 'compare_callback' => 'test_not_same_as_other_user_data', + 'error' => __( 'Your password is too weak: Looks like you are including easy to guess information about yourself. Try something a little more unique.', 'jetpack-password-checker' ), + 'required' => true, + ), + ), + ); + + /** + * Filters the password strength enforcement settings. + * + * You can determine the tests run and their order based on whatever criteria you wish to specify. + * + * @param array $tests tests to run. + */ + $tests = apply_filters( 'password_checker_tests', $tests ); + + if ( ! $sections ) { + return $tests; + } + + $sections = (array) $sections; + + return array_intersect_key( $tests, array_flip( $sections ) ); + } + + /** + * Provides the regular expression tester functionality. + * + * @param string $password the password. + * @param array $test_data the current test data. + * + * @return bool does the test pass? + */ + protected function test_preg_match( $password, $test_data ) { + return preg_match( $test_data['pattern'], $password ); + } + + /** + * Provides the comparison tester functionality. + * + * @param string $password the password. + * @param array $test_data the current test data. + * + * @return bool does the test pass? + */ + protected function test_compare_to_list( $password, $test_data ) { + if ( + ! is_callable( array( $this, $test_data['list_callback'] ) ) + || ! is_callable( array( $this, $test_data['compare_callback'] ) ) + ) { + return false; + } + + return call_user_func( + array( + $this, + $test_data['compare_callback'], + ), + $password, + call_user_func( array( $this, $test_data['list_callback'] ) ) + ); + } + + /** + * Getter for the common password list. + * + * @return array common passwords. + */ + protected function get_common_passwords() { + return $this->common_passwords; + } + + /** + * Returns the widely known user data that can not be used in the password to avoid + * predictable strings. + * + * @return array user data. + */ + protected function get_other_user_data() { + if ( empty( $this->user_id ) ) { + return array(); + } + + $user_data = get_userdata( $this->user_id ); + if ( ! $user_data ) { + return array(); + } + + if ( isset( $user_data->ID ) ) { + $this->add_user_strings_to_test( get_user_meta( $user_data->ID, 'first_name', true ) ); + $this->add_user_strings_to_test( get_user_meta( $user_data->ID, 'last_name', true ) ); + $this->add_user_strings_to_test( get_user_meta( $user_data->ID, 'nickname', true ) ); + } + + if ( isset( $user_data->user_nicename ) ) { + $this->add_user_strings_to_test( $user_data->user_nicename ); + } + + if ( isset( $user_data->display_name ) ) { + $this->add_user_strings_to_test( $user_data->display_name ); + } + + if ( isset( $user_data->first_name ) ) { + $this->add_user_strings_to_test( $user_data->first_name ); + } + + if ( isset( $user_data->last_name ) ) { + $this->add_user_strings_to_test( $user_data->last_name ); + } + + if ( isset( $user_data->user_email ) ) { + $email_username = substr( $user_data->user_email, 0, strpos( $user_data->user_email, '@' ) ); + $this->add_user_strings_to_test( $email_username, '.' ); + $this->add_user_strings_to_test( $user_data->user_email ); + } + + return $this->get_user_strings_to_test(); + } + + /** + * Compare the password for matches with known user data. + * + * @param string $password the password. + * @param array $strings_to_test known user data. + * + * @return bool does the test pass? + */ + protected function test_not_same_as_other_user_data( $password, $strings_to_test ) { + if ( empty( $strings_to_test ) ) { + return false; + } + + $password_lowercase = strtolower( $password ); + + foreach ( $strings_to_test as $string ) { + $string = strtolower( $string ); + $string_reversed = strrev( $string ); + + if ( $password_lowercase === $string || $password_lowercase === $string_reversed ) { + return false; + } + + // Also check for the string or reversed string with any numbers just stuck to the end to catch things like bob123 as passwords. + if ( + preg_match( '/^' . preg_quote( $string, '/' ) . '\d+$/', $password_lowercase ) + || preg_match( '/^' . preg_quote( $string_reversed, '/' ) . '\d+$/', $password_lowercase ) + ) { + return false; + } + } + + return true; + } + + /** + * A shorthand for the not in array construct. + * + * @param mixed $needle the needle. + * @param array $haystack the haystack. + * + * @return bool is the needle not in the haystack? + */ + protected function negative_in_array( $needle, $haystack ) { + return ! in_array( $needle, $haystack, true ); + } + + /** + * A helper function used to break a single string into its constituents so + * that both the full string and its constituents and any variants thereof + * can be tested against the password. + * + * @param string $string the string to be broken down. + * @param string $explode_delimiter delimiter. + * + * @return bool + */ + protected function add_user_strings_to_test( $string, $explode_delimiter = ' ' ) { + // Don't check against empty strings. + if ( empty( $string ) ) { + return false; + } + + $strings = explode( $explode_delimiter, $string ); + + // Remove any non alpha numeric characters from the strings to check against. + foreach ( $strings as $key => $_string ) { + $_string = trim( preg_replace( '/[^a-zA-Z0-9]/', '', $_string ) ); + if ( empty( $_string ) ) { + continue; + } + + $strings[ $key ] = $_string; + } + + // Check the original too. + $strings[] = trim( $string ); + + // Check the original minus non alpha numeric characters. + $strings[] = trim( preg_replace( '/[^a-zA-Z0-9]/', '', $string ) ); + + // Remove any empty strings. + // Note: This will also filter out '0'. + $strings = array_filter( $strings ); + if ( empty( $strings ) ) { + return false; + } + + $this->user_strings_to_test = array_unique( array_merge( $this->user_strings_to_test, $strings ) ); + + return true; + } + + /** + * Getter for the user strings array. + * + * @return array user strings. + */ + protected function get_user_strings_to_test() { + return $this->user_strings_to_test; + } + + /** + * Return a character set size that is used in the string. + * + * @param string $password the password. + * + * @return int number of different character sets in use. + */ + protected function get_charset_size( $password ) { + $size = 0; + + // Lowercase a-z. + if ( preg_match( '/[a-z]/', $password ) ) { + $size += 26; + } + + // Uppercase A-Z. + if ( preg_match( '/[A-Z]/', substr( $password, 1, - 1 ) ) ) { + $size += 26; + } + + // Digits. + if ( preg_match( '/\d/', substr( $password, 1, - 1 ) ) ) { + $size += 10; + } + + // Over digits symbols. + if ( preg_match( '/[!|@|#|$|%|^|&|*|(|)]/', $password ) ) { + $size += 10; + } + + // Other symbols. + if ( preg_match( '#[`|~|-|_|=|+|\[|{|\]|}|\\|\|;:\'",<\.>/\?]#', $password ) ) { + $size += 20; + } + + // Spaces. + if ( strpos( $password, ' ' ) ) { + ++$size; + } + + return $size; + } + + /** + * Shorthand for getting a character index. + * + * @param string $char character. + * + * @return int the character code. + */ + protected function get_char_index( $char ) { + $char = strtolower( $char[0] ); + if ( $char < 'a' || $char > 'z' ) { + return 0; + } else { + return ord( $char[0] ) - ord( 'a' ) + 1; + } + } + + /** + * This is the password strength calculation algorithm, based on the formula H = L(logN/log2). + * + * H = Entropy + * L = String length (the for iterator) + * N = Our charset size, via get_charset_size() + * + * @see https://en.wikipedia.org/wiki/Password_strength#Random_passwords + * + * On top of the base formula, we're also multiplying the bits of entropy for every char + * by 1 - (the probabily of it following the previous char) + * i.e.: the probablity of U following Q is ~0.84. If our password contains this pair of characters, + * the u char will only add ( 0.16^2 * charset_score ) to our total of entropy bits. + * + * @param string $password the password. + * + * @return float|int + */ + protected function calculate_entropy_bits( $password ) { + $bits = 0; + // Calculate the score. + $charset_score = log( $this->get_charset_size( $password ) ) / log( 2 ); + + $aidx = $this->get_char_index( $password[0] ); + $length = strlen( $password ); + + for ( $b = 1; $b < $length; $b++ ) { + $bidx = $this->get_char_index( $password[ $b ] ); + + // 27 = number of chars in the index (a-z,' '). + $c = 1.0 - $this->frequency_table[ $aidx * 27 + $bidx ]; + + // Increment the bits. + $bits += $charset_score * $c * $c; + + // Move on to next pair. + $aidx = $bidx; + } + + return $bits; + } + + /** + * A frequency table of character pairs, starting with ' ' then ' a', ' b' [...] , 'a ', 'aa' etc. + * + * @see http://rumkin.com/tools/password/passchk.php + * + * @var array + */ + public $frequency_table = array( + 0.23653710453418866, + 0.04577693541332556, + 0.03449832337075375, + 0.042918209651552706, + 0.037390873305146524, + 0.028509112115468728, + 0.02350896632162123, + 0.022188657238664526, + 0.028429800262428927, + 0.04357019973757107, + 0.00913602565971716, + 0.03223093745443942, + 0.02235311269864412, + 0.04438081352966905, + 0.04512377897652719, + 0.020055401662049863, + 0.055903192885260244, + 0.0024388394809739026, + 0.035207464644991984, + 0.07355941099285611, + 0.036905671380667734, + 0.026134421927394666, + 0.023787724158040528, + 0.011352092141711621, + 0.0032354570637119114, + 0.005986878553725033, + 0.008861933226417843, + 0.11511532293337222, + 0.027556203528211108, + 0.024331243621519172, + 0.039266365359381834, + 0.031599941682461, + 0.014403265782183991, + 0.015480973902901297, + 0.027770812071730572, + 0.00942761335471643, + 0.039872867764980315, + 0.0078122175244204695, + 0.02808456043154979, + 0.08429100451960927, + 0.04688963405744277, + 0.13831170724595424, + 0.002540311998833649, + 0.025211838460416972, + 0.001543082081936142, + 0.09519638431258201, + 0.061845750109345385, + 0.08907071001603732, + 0.02137571074500656, + 0.027093162268552268, + 0.005521504592506197, + 0.003023181221752442, + 0.007086747339262283, + 0.010262720513194342, + 0.08785070710016038, + 0.14617757690625455, + 0.03417291150313457, + 0.0059635515381250915, + 0.006146668610584633, + 0.195202799241872, + 0.002774748505613063, + 0.004715556203528212, + 0.0044776206444088066, + 0.11205481848665985, + 0.005654468581425864, + 0.0028820527773727946, + 0.07383000437381543, + 0.005516839189386207, + 0.006496573844583759, + 0.09843067502551392, + 0.0027140982650532145, + 0.0006893133109782768, + 0.08425368129464937, + 0.021325557661466685, + 0.006493074792243767, + 0.07023414491908442, + 0.002077270739174807, + 0.0024633328473538415, + 0.0007744569179180639, + 0.015413325557661468, + 0.0011990086018370024, + 0.13162851727657093, + 0.10115993585070711, + 0.0026989357049132527, + 0.03319317684793702, + 0.002946202070272634, + 0.0783216212275842, + 0.0018358361277154103, + 0.00258813238081353, + 0.2141688292754046, + 0.09853681294649366, + 0.0032482869222918796, + 0.04359352675317102, + 0.01993526753171016, + 0.0036880011663507797, + 0.008011663507799971, + 0.12014696019827964, + 0.0029846916460125384, + 0.0017553579238956116, + 0.029470185158186325, + 0.010413179763813967, + 0.030699518880303252, + 0.03508499781309229, + 0.002021285901734947, + 0.0010613792097973467, + 0.0005295232541186761, + 0.009677212421635807, + 0.010585799679253535, + 0.17101734946785244, + 0.07968625164018078, + 0.007839043592360402, + 0.005438693687126403, + 0.0183606939787141, + 0.2732701559994168, + 0.004953491762647616, + 0.007259367254701851, + 0.008104971570199739, + 0.13274588132380813, + 0.004210526315789474, + 0.004997813092287506, + 0.017006560723137484, + 0.007442484327161393, + 0.016789619478058026, + 0.08477737279486806, + 0.005106283714827234, + 0.0005026971861787433, + 0.04040355736987899, + 0.037535500801866156, + 0.00885960052485785, + 0.0336410555474559, + 0.007066919376002332, + 0.005344219273946639, + 0.0006333284735384167, + 0.010684939495553289, + 0.0063064586674442345, + 0.15386849394955532, + 0.015049424114302375, + 0.012162705933809595, + 0.020425134859308938, + 0.037366379938766583, + 0.02157165767604607, + 0.009373961218836564, + 0.0173214754337367, + 0.009616562181075958, + 0.029522670943286193, + 0.010154249890654615, + 0.018600962239393497, + 0.06362210234728094, + 0.03157078291296107, + 0.151603440734801, + 0.0062329785683044175, + 0.014775331681003062, + 0.0020854351946347867, + 0.1826342032366234, + 0.0878017203674005, + 0.054190989940224525, + 0.010329202507654177, + 0.012763376585508092, + 0.0064872430383437815, + 0.006381105117364048, + 0.005388540603586529, + 0.0090800408222773, + 0.09611196967487973, + 0.09940691062837148, + 0.01033969966467415, + 0.004034407348009914, + 0.008826942703017933, + 0.11474675608689314, + 0.07132584924916169, + 0.012388977985129028, + 0.005435194634786413, + 0.1417174515235457, + 0.0037066627788307337, + 0.0045802595130485495, + 0.060800699810468, + 0.005341886572386646, + 0.005683627350925791, + 0.12434932205860913, + 0.004596588423968508, + 0.0007534626038781163, + 0.07107041842834232, + 0.022361277154104096, + 0.04784720804782038, + 0.06277533168100306, + 0.003441901151771395, + 0.005828254847645429, + 0.0009669047966175828, + 0.009470768333576322, + 0.002077270739174807, + 0.12797667298440007, + 0.08797783933518005, + 0.005388540603586529, + 0.0024913252660737715, + 0.007550954949701123, + 0.2786866890217233, + 0.002509986878553725, + 0.029002478495407494, + 0.0303204548768042, + 0.07576614666861058, + 0.00246799825047383, + 0.00592389561160519, + 0.039574281965301064, + 0.00706808572678233, + 0.03304505029887739, + 0.05474150750838315, + 0.0028633911648928414, + 0.0005073625892987316, + 0.07293541332555767, + 0.053528502697186175, + 0.022566554891383584, + 0.038151334013704616, + 0.002716430966613209, + 0.005049132526607377, + 0.0009902318122175246, + 0.008997229916897508, + 0.0011861787432570347, + 0.1666377022889634, + 0.14414462749671964, + 0.003374252806531564, + 0.005169266656947077, + 0.008468873013558828, + 0.16337541915731155, + 0.002873888321912815, + 0.004305000728969237, + 0.0031141565825922144, + 0.1241172182533897, + 0.0052800699810468, + 0.008969237498177577, + 0.024094474413179766, + 0.017029887738737422, + 0.01722700102055693, + 0.10618457501093455, + 0.006147834961364631, + 0.0008269427030179326, + 0.03303571949263741, + 0.024188948826359528, + 0.05213937891820965, + 0.04505846333284735, + 0.0035270447587111824, + 0.006799825047383001, + 0.0008199445983379502, + 0.02206735675754483, + 0.001010059775477475, + 0.11971191135734072, + 0.04656538854060359, + 0.011243621519171892, + 0.06513019390581717, + 0.032375564951159064, + 0.06347047674588133, + 0.013678961947805804, + 0.03309870243475726, + 0.006982942119842543, + 0.009726199154395685, + 0.010121592068814697, + 0.032514360693978714, + 0.04986032949409535, + 0.039734072022160664, + 0.15690683773144773, + 0.03949963551538125, + 0.014790494241143023, + 0.002722262720513194, + 0.02614375273363464, + 0.10753637556495116, + 0.06764834523983088, + 0.006221315060504448, + 0.021317393206006705, + 0.0030826651115322934, + 0.002399183554454002, + 0.0019069835252952323, + 0.015595276279341012, + 0.0925126111678087, + 0.18437906400349907, + 0.006538562472663654, + 0.008719638431258201, + 0.02116693395538708, + 0.18241376293920394, + 0.007290858725761773, + 0.005976381396705059, + 0.005629975215045925, + 0.09721300481119698, + 0.004810030616707975, + 0.024303251202799244, + 0.012954658113427612, + 0.011057005394372358, + 0.02733459688001166, + 0.10135121737862662, + 0.012016912086309959, + 0.001055547455897361, + 0.009027555037177431, + 0.07162326869806095, + 0.01007143898527482, + 0.07297623560285756, + 0.006741507508383147, + 0.0036891675171307776, + 0.0008409389123778977, + 0.011272780288671819, + 0.007020265344802449, + 0.1030389269572824, + 0.15350809155853623, + 0.004232686980609419, + 0.004353987461729115, + 0.0023385333138941536, + 0.14450386353695874, + 0.002546143752733635, + 0.0024470039364338824, + 0.01200758128006998, + 0.0981227584195947, + 0.003161976964572095, + 0.040695145064878264, + 0.03460446129173349, + 0.003908441463770229, + 0.01598483743986004, + 0.13107216795451232, + 0.003129319142732177, + 0.00032307916605919226, + 0.04050386353695874, + 0.05452689896486368, + 0.03589677795597026, + 0.07087097244496282, + 0.006143169558244642, + 0.008684647907858289, + 0.0004607085580988482, + 0.022010205569324977, + 0.0009097536083977258, + 0.07328765126111678, + 0.14751421490013122, + 0.008015162560139961, + 0.006601545414783497, + 0.025279486805656802, + 0.1682449336637994, + 0.008313748359819215, + 0.007010934538562473, + 0.005886572386645284, + 0.16889575739903775, + 0.004123050007289692, + 0.011925936725470185, + 0.10007289692374982, + 0.013380376148126549, + 0.009021723283277445, + 0.08650823735238372, + 0.007756232686980609, + 0.0007243038343781893, + 0.0026791077416533026, + 0.02797492345823006, + 0.032384895757399036, + 0.04187432570345531, + 0.00882461000145794, + 0.0032401224668318998, + 0.00033357632307916605, + 0.027878116343490307, + 0.0022277299897944304, + 0.14333518005540166, + 0.1725534334451086, + 0.02781629975215046, + 0.006909462020702727, + 0.005264907420906838, + 0.16661437527336345, + 0.004325995043009185, + 0.003334596880011664, + 0.005312727802886718, + 0.14024668318996938, + 0.0013261408368566844, + 0.003504884093891238, + 0.006375273363464061, + 0.04964922000291588, + 0.008290421344219274, + 0.09536783787724158, + 0.05394372357486515, + 0.005505175681586237, + 0.005339553870826651, + 0.01782067356757545, + 0.006710016037323225, + 0.05105933809593235, + 0.002983525295232541, + 0.002940370316372649, + 0.0004548768041988629, + 0.01208456043154979, + 0.000915585362297711, + 0.20146260387811635, + 0.067196967487972, + 0.006158332118384605, + 0.025438110511736407, + 0.07753783350342616, + 0.1273876658405015, + 0.009337804344656656, + 0.07683452398308792, + 0.0070412596588423975, + 0.08747164309666132, + 0.0038827817466102928, + 0.018116926665694706, + 0.005017641055547455, + 0.004567429654468581, + 0.028277008310249308, + 0.05271555620352821, + 0.004394809739029013, + 0.0013343052923166642, + 0.00411605190260971, + 0.059621519171890944, + 0.09073859163143316, + 0.01446858142586383, + 0.006770666277883074, + 0.003425572240851436, + 0.0004455459979588861, + 0.010401516256013998, + 0.005825922146085436, + 0.10833882490158916, + 0.007584779122321038, + 0.016903921854497742, + 0.02719580113719201, + 0.0304814112844438, + 0.02206385770520484, + 0.013064295086747339, + 0.02696369733197259, + 0.009581571657676046, + 0.026761918647033093, + 0.006510570053943724, + 0.021941390873305145, + 0.07042659279778393, + 0.05437410701268406, + 0.1425175681586237, + 0.027802303542790494, + 0.037690625455605774, + 0.0019606356611750987, + 0.1095623268698061, + 0.06157748942994606, + 0.044618749088788455, + 0.04955124653739612, + 0.03608689313310978, + 0.018381688292754043, + 0.003404577926811489, + 0.015036594255722409, + 0.009600233270156, + 0.10794693103951014, + 0.12447528794284882, + 0.0031981338387520046, + 0.0074716430966613205, + 0.003202799241871993, + 0.13437643971424407, + 0.006655197550663361, + 0.0036693395538708266, + 0.049338970695436656, + 0.09486863974340283, + 0.0015990669193760023, + 0.0026604461291733486, + 0.051775477474850555, + 0.0041347135150896636, + 0.005450357194926374, + 0.12030325120279925, + 0.04581309228750547, + 0.0004537104534188657, + 0.12425601399620935, + 0.025981629975215047, + 0.023926519900860182, + 0.04423385333138941, + 0.0017950138504155123, + 0.002661612479953346, + 0.0006333284735384167, + 0.008449045050298877, + 0.000653156436798367, + 0.04816678816153958, + 0.008625164018078437, + 0.0039037760606502403, + 0.005228750546726928, + 0.004531272780288672, + 0.0056672984400058316, + 0.00359585945473101, + 0.0032179618020119548, + 0.0038093016474704767, + 0.011452398308791368, + 0.002519317684793702, + 0.00280390727511299, + 0.005572824026826068, + 0.004554599795888614, + 0.004531272780288672, + 0.0035841959469310393, + 0.004400641492928998, + 0.0036670068523108326, + 0.004839189386207902, + 0.006258638285464354, + 0.004897506925207757, + 0.840776789619478, + 0.004968654322787578, + 0.002886718180492783, + 0.0019757982213150604, + 0.0018568304417553576, + 0.001691208630995772, + 0.09009243329931477, + 0.14030150167662925, + 0.013242746756086894, + 0.013746610293045632, + 0.027342761335471644, + 0.16938912377897652, + 0.006607377168683481, + 0.01661933226417845, + 0.008173786266219566, + 0.13297448607668758, + 0.0034675608689313307, + 0.016641492928998396, + 0.011722991689750693, + 0.021493512173786266, + 0.03430820819361423, + 0.10099548039072752, + 0.00873596734217816, + 0.0018323370753754193, + 0.020103222044029742, + 0.047197550663362, + 0.040833940807697915, + 0.03361189677795597, + 0.010844729552412887, + 0.005544831608106138, + 0.0007522962530981193, + 0.01525120279924187, + 0.00815512465373961, + 0.2109648636827526, + 0.058258055110074355, + 0.007181221752442048, + 0.043560868931331105, + 0.004058900714389853, + 0.10618107595859454, + 0.0062399766729844, + 0.004835690333867911, + 0.02679224376731302, + 0.08414637702288964, + 0.0030698352529523252, + 0.03637498177576906, + 0.01592885260242018, + 0.017413617145356466, + 0.008430383437818923, + 0.037231083248286924, + 0.03290275550371775, + 0.007538125091121154, + 0.004500947660008748, + 0.05932409972299169, + 0.16006764834523984, + 0.03309636973319726, + 0.007766729844000583, + 0.005225251494386936, + 0.0006321621227584196, + 0.012989648636827526, + 0.005274238227146815, + 0.1254503571949264, + 0.12852719055255868, + 0.0035433736696311416, + 0.005203090829566993, + 0.0019314768916751715, + 0.20520775623268697, + 0.002509986878553725, + 0.00343606939787141, + 0.027138649948972155, + 0.13926578218399185, + 0.004565096952908587, + 0.005614812654905963, + 0.00874413179763814, + 0.004109053797929727, + 0.008300918501239247, + 0.08270943286193323, + 0.002912377897652719, + 0.0037066627788307337, + 0.06909578655780726, + 0.03242805073625893, + 0.05237614812654906, + 0.04723487388832191, + 0.0038991106575302524, + 0.006299460562764251, + 0.00043388249015891526, + 0.020029741944889927, + 0.005311561452106721, + 0.09334072022160665, + 0.022940953491762648, + 0.024658988190698353, + 0.02901297565242747, + 0.03531593526753171, + 0.0758023035427905, + 0.013711619769645722, + 0.021597317393206007, + 0.009670214316955824, + 0.044728386062108175, + 0.010596296836273509, + 0.03264382563055839, + 0.0604822860475288, + 0.05489546581134276, + 0.11501851581863246, + 0.01837585653885406, + 0.026237060796034405, + 0.0011255285026971862, + 0.08704125965884241, + 0.10156349322058608, + 0.06660562764251349, + 0.023434319871701415, + 0.010777081207173057, + 0.005409534917626476, + 0.003123487388832191, + 0.0028762210234728096, + 0.0089995626184575, + 0.07518297127861205, + 0.2314868056568013, + 0.002226563639014434, + 0.003285610147251786, + 0.0027455897361131363, + 0.2724537104534189, + 0.0016655489138358362, + 0.0019209797346551977, + 0.0022137337804344656, + 0.17690392185449774, + 0.0014532730718763668, + 0.0024994897215337513, + 0.015302522233561744, + 0.003441901151771395, + 0.015303688584341741, + 0.09314593964134713, + 0.0017833503426155418, + 0.0005108616416387229, + 0.017828838023035427, + 0.010385187345094037, + 0.003168975069252078, + 0.01902901297565243, + 0.005525003644846187, + 0.0010088934246974776, + 0.0009272488700976819, + 0.036282840064149294, + 0.0022977110365942554, + 0.0766805656801283, + 0.22270418428342326, + 0.005283569033386791, + 0.007155562035282111, + 0.01173582154833066, + 0.1715620352821111, + 0.003925936725470185, + 0.004425134859308937, + 0.020040239101909902, + 0.14243242455168392, + 0.0016737133692958156, + 0.0066808572678232975, + 0.011980755212130047, + 0.012638577052048404, + 0.07206065024055984, + 0.08115701997375711, + 0.00710424260096224, + 0.0007278028867181805, + 0.02347630849978131, + 0.04595538708266512, + 0.01481965301064295, + 0.013925061962385188, + 0.0018125091121154687, + 0.00529173348884677, + 0.0016340574427759146, + 0.03072401224668319, + 0.0023746901880740633, + 0.25174165330223064, + 0.06673392622831317, + 0.00878378772415804, + 0.03956261845750109, + 0.010077270739174807, + 0.0844787869951888, + 0.00985216503863537, + 0.004973319725907567, + 0.01893220586091267, + 0.11200583175389998, + 0.0028715556203528212, + 0.004095057588569762, + 0.01202391019098994, + 0.01756757544831608, + 0.014825484764542934, + 0.05312961073042717, + 0.06746872721971132, + 0.003845458521650386, + 0.0210806239976673, + 0.019443067502551394, + 0.08017028721387957, + 0.01825572240851436, + 0.005365213587986587, + 0.01959702580551101, + 0.026184575010934536, + 0.02474879720075813, + 0.002171745152354571, + 0.25827321767021433, + 0.048050153083539875, + 0.01043184137629392, + 0.03930485493512174, + 0.027640180784370902, + 0.03294007872867765, + 0.006474413179763814, + 0.018314039947514214, + 0.015119405161102202, + 0.014706516984983233, + 0.005494678524566263, + 0.03309870243475726, + 0.043864120134130345, + 0.058996355153812505, + 0.06265986295378335, + 0.04633328473538417, + 0.03790756670068523, + 0.0004642076104388394, + 0.037849249161685375, + 0.08369966467415076, + 0.04999679253535501, + 0.02392768625164018, + 0.010998687855372504, + 0.009881323808135296, + 0.003867619186470331, + 0.012434465665548913, + 0.007253535500801866, + 0.11106225397288234, + 0.17624726636535937, + 0.008209943140399476, + 0.008390727511299025, + 0.012682898381688294, + 0.1825653885406036, + 0.001538416678816154, + 0.004590756670068524, + 0.008710307625018223, + 0.1299513048549351, + 0.002677941390873305, + 0.012309666132089225, + 0.014087184720804781, + 0.01199941682461, + 0.031246537396121883, + 0.07206648199445984, + 0.008254264470039366, + 0.0007033095203382417, + 0.007034261554162415, + 0.006599212713223502, + 0.013906400349905234, + 0.050098265053214755, + 0.007133401370462167, + 0.017750692520775622, + 0.0008257763522379356, + 0.03918821985712203, + 0.06015454147834961, + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/CHANGELOG.md new file mode 100644 index 00000000..0ea536bb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/CHANGELOG.md @@ -0,0 +1,121 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.4.3] - 2024-09-05 +### Changed +- Update dependencies. + +## [0.4.2] - 2024-08-26 +### Changed +- Updated package dependencies. [#39004] + +## [0.4.1] - 2024-08-15 +### Fixed +- Fix incorrect next-version tokens in php `@since` and/or `@deprecated` docs. [#38869] + +## [0.4.0] - 2024-05-20 +### Deprecated +- Extract the 'is_current_request_activating_plugin_from_plugins_screen' method into Status package. [#37430] + +## [0.3.5] - 2024-05-06 +### Changed +- Internal updates. + +## [0.3.4] - 2024-04-08 +### Changed +- Internal updates. + +## [0.3.3] - 2024-03-25 +### Changed +- Internal updates. + +## [0.3.2] - 2024-03-14 +### Changed +- Internal updates. + +## [0.3.1] - 2024-01-02 +### Fixed +- Ensured that language packs are installed after installing a new plugin. [#34763] + +## [0.3.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [0.2.6] - 2023-11-14 + +## [0.2.5] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [0.2.4] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.2.3] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.2.2] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [0.2.1] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [0.2.0] - 2022-08-23 +### Added +- Add method to check plugin activation context. [#25422] + +## [0.1.4] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.1.3] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [0.1.2] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [0.1.1] - 2022-03-29 +### Added +- Set composer package type to "jetpack-library" so i18n will work. + +## 0.1.0 - 2022-02-02 +### Added +- First version +- New functions to safely check plugin statuses + +### Changed +- Build: add missing mirror repo details, so package can be deployed. + +### Fixed +- Fix method logic + +[0.4.3]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.4.2...v0.4.3 +[0.4.2]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.4.1...v0.4.2 +[0.4.1]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.4.0...v0.4.1 +[0.4.0]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.3.5...v0.4.0 +[0.3.5]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.3.4...v0.3.5 +[0.3.4]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.3.3...v0.3.4 +[0.3.3]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.6...v0.3.0 +[0.2.6]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.5...v0.2.6 +[0.2.5]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.4...v0.2.5 +[0.2.4]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.3...v0.2.4 +[0.2.3]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.4...v0.2.0 +[0.1.4]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/composer.json new file mode 100644 index 00000000..f8954ee7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/composer.json @@ -0,0 +1,44 @@ +{ + "name": "automattic/jetpack-plugins-installer", + "description": "Handle installation of plugins from WP.org", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-a8c-mc-stats": "^2.0.2", + "automattic/jetpack-status": "^4.0.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "branch-alias": { + "dev-trunk": "0.4.x-dev" + }, + "mirror-repo": "Automattic/jetpack-plugins-installer", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plugins-installer/compare/v${old}...v${new}" + }, + "autotagger": true, + "textdomain": "jetpack-plugins-installer" + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php new file mode 100644 index 00000000..f68a526e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php @@ -0,0 +1,157 @@ +fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); + if ( ! $result ) { + // set the string here since they are not available just yet. + $upgrader->generic_strings(); + $this->feedback( 'fs_unavailable' ); + } + } + + /** + * Overwrites the error function + * + * @param WP_Error|mixed $error The error object. + */ + public function error( $error ) { + if ( is_wp_error( $error ) ) { + $this->feedback( $error ); + } + } + + /** + * Set the main error code. + * + * Don't set the process_failed as code since it is not that helpful unless we don't have one already set + * + * @param string $code The error code. + * @return void + */ + private function set_main_error_code( $code ) { + $this->main_error_code = ( 'process_failed' === $code && $this->main_error_code ? $this->main_error_code : $code ); + } + + /** + * Set the main error message. + * + * Don't set the process_failed as message since it is not that helpful unless we don't have one already set + * + * @param string $message The error message. + * @param string $code The error code. + * @return void + */ + private function set_main_error_message( $message, $code ) { + $this->main_error_message = ( 'process_failed' === $code && $this->main_error_message ? $this->main_error_message : $message ); + } + + /** + * Get the main error code + * + * @return string + */ + public function get_main_error_code() { + return $this->main_error_code; + } + + /** + * Get the main error message + * + * @return string + */ + public function get_main_error_message() { + return $this->main_error_message; + } + + /** + * Overwrites the feedback function + * + * @param string|array|WP_Error $data Data. + * @param mixed ...$args Optional text replacements. + */ + public function feedback( $data, ...$args ) { + + $current_error = null; + if ( is_wp_error( $data ) ) { + $this->set_main_error_code( $data->get_error_code() ); + $string = $data->get_error_message(); + } elseif ( is_array( $data ) ) { + return; + } else { + $string = $data; + } + + if ( ! empty( $this->upgrader->strings[ $string ] ) ) { + $this->set_main_error_code( $string ); + + $current_error = $string; + $string = $this->upgrader->strings[ $string ]; + } + + if ( strpos( $string, '%' ) !== false ) { + if ( ! empty( $args ) ) { + $string = vsprintf( $string, $args ); + } + } + + $string = trim( $string ); + $string = wp_kses( + $string, + array( + 'a' => array( + 'href' => true, + ), + 'br' => true, + 'em' => true, + 'strong' => true, + ) + ); + + $this->set_main_error_message( $string, $current_error ); + $this->messages[] = $string; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php new file mode 100644 index 00000000..c86537aa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php @@ -0,0 +1,255 @@ +install( $zip_url ); + + if ( is_wp_error( $result ) ) { + $mc_stats->add( 'install-plugin', "fail-$slug" ); + return $result; + } + + $plugin = self::get_plugin_id_by_slug( $slug ); + $error_code = 'install_error'; + if ( ! $plugin ) { + $error = __( 'There was an error installing your plugin', 'jetpack-plugins-installer' ); + } + + if ( ! $result ) { + $error_code = $skin->get_main_error_code(); + $message = $skin->get_main_error_message(); + $error = $message ? $message : __( 'An unknown error occurred during installation', 'jetpack-plugins-installer' ); + } + + if ( ! empty( $error ) ) { + if ( 'download_failed' === $error_code ) { + // For backwards compatibility: versions prior to 3.9 would return no_package instead of download_failed. + $error_code = 'no_package'; + } + + $mc_stats->add( 'install-plugin', "fail-$slug" ); + return new WP_Error( $error_code, $error, 400 ); + } + + $mc_stats->add( 'install-plugin', "success-$slug" ); + return (array) $upgrader->skin->get_upgrade_messages(); + } + + /** + * Get WordPress.org zip download link from a plugin slug + * + * @param string $plugin_slug Plugin slug. + */ + protected static function generate_wordpress_org_plugin_download_link( $plugin_slug ) { + return "https://downloads.wordpress.org/plugin/$plugin_slug.latest-stable.zip"; + } + + /** + * Get the plugin ID (composed of the plugin slug and the name of the main plugin file) from a plugin slug. + * + * @param string $slug Plugin slug. + */ + public static function get_plugin_id_by_slug( $slug ) { + // Check if get_plugins() function exists. This is required on the front end of the + // site, since it is in a file that is normally only loaded in the admin. + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ + $plugins = apply_filters( 'all_plugins', get_plugins() ); + if ( ! is_array( $plugins ) ) { + return false; + } + + foreach ( $plugins as $plugin_file => $plugin_data ) { + if ( self::get_slug_from_file_path( $plugin_file ) === $slug ) { + return $plugin_file; + } + } + + return false; + } + + /** + * Get the plugin slug from the plugin ID (composed of the plugin slug and the name of the main plugin file) + * + * @param string $plugin_file Plugin file (ID -- e.g. hello-dolly/hello.php). + */ + protected static function get_slug_from_file_path( $plugin_file ) { + // Similar to get_plugin_slug() method. + $slug = dirname( $plugin_file ); + if ( '.' === $slug ) { + $slug = preg_replace( '/(.+)\.php$/', '$1', $plugin_file ); + } + + return $slug; + } + + /** + * Get the activation status for a plugin. + * + * @since-jetpack 8.9.0 + * + * @param string $plugin_file The plugin file to check. + * @return string Either 'network-active', 'active' or 'inactive'. + */ + public static function get_plugin_status( $plugin_file ) { + if ( self::is_plugin_active_for_network( $plugin_file ) ) { + return 'network-active'; + } + + if ( self::is_plugin_active( $plugin_file ) ) { + return 'active'; + } + + return 'inactive'; + } + + /** + * Safely checks if the plugin is active + * + * @since 0.1.0 + * + * @param string $plugin_file The plugin file to check. + * @return bool + */ + public static function is_plugin_active( $plugin_file ) { + self::ensure_plugin_functions_are_loaded(); + return is_plugin_active( $plugin_file ); + } + + /** + * Safely checks if the plugin is active for network + * + * @since 0.1.0 + * + * @param string $plugin_file The plugin file to check. + * @return bool + */ + public static function is_plugin_active_for_network( $plugin_file ) { + self::ensure_plugin_functions_are_loaded(); + return is_plugin_active_for_network( $plugin_file ); + } + + /** + * Returns a list of all plugins in the site. + * + * @since-jetpack 8.9.0 + * @uses get_plugins() + * + * @return array + */ + public static function get_plugins() { + self::ensure_plugin_functions_are_loaded(); + /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ + $plugins = apply_filters( 'all_plugins', get_plugins() ); + + if ( is_array( $plugins ) && ! empty( $plugins ) ) { + foreach ( $plugins as $plugin_slug => $plugin_data ) { + $plugins[ $plugin_slug ]['active'] = in_array( + self::get_plugin_status( $plugin_slug ), + array( 'active', 'network-active' ), + true + ); + } + return $plugins; + } + + return array(); + } + + /** + * Determine if the current request is activating a plugin from the plugins page. + * + * @deprecated 0.4.0 + * @see Paths::is_current_request_activating_plugin_from_plugins_screen() + * + * @param string $plugin Plugin file path to check. + * @return bool + */ + public static function is_current_request_activating_plugin_from_plugins_screen( $plugin ) { + _deprecated_function( __METHOD__, '0.4.0', 'Automattic\\Jetpack\\Paths::is_current_request_activating_plugin_from_plugins_screen()' ); + return ( new Paths() )->is_current_request_activating_plugin_from_plugins_screen( $plugin ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/CHANGELOG.md new file mode 100644 index 00000000..b40f798b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.1] - 2024-08-26 +### Changed +- Updated package dependencies. [#39004] + +## [0.2.0] - 2024-08-09 +### Added +- Add Scan History model. [#38117] + +## 0.1.0 - 2024-07-15 +### Added +- Initial version. [#37864] + +[0.2.1]: https://github.com/Automattic/jetpack-protect-models/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-protect-models/compare/v0.1.0...v0.2.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/composer.json new file mode 100644 index 00000000..b30bde7e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/composer.json @@ -0,0 +1,55 @@ +{ + "name": "automattic/jetpack-protect-models", + "description": "This package contains the models used in Protect. ", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "0.4.2" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-development": "echo 'Add your build step to composer.json, please!'", + "build-production": "echo 'Add your build step to composer.json, please!'", + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-protect-models/compare/v${old}...v${new}" + }, + "mirror-repo": "Automattic/jetpack-protect-models", + "textdomain": "jetpack-protect-models", + "version-constants": { + "::PACKAGE_VERSION": "src/class-protect-models.php" + } + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-extension-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-extension-model.php new file mode 100644 index 00000000..95a49c8e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-extension-model.php @@ -0,0 +1,110 @@ + + */ + public $threats = array(); + + /** + * Whether the extension has been checked for threats. + * + * @var null|bool + */ + public $checked; + + /** + * The type of extension ("plugins", "themes", or "core"). + * + * @var null|string + */ + public $type; + + /** + * Extension Model Constructor + * + * @param array|object $extension Extension data to load into the model instance. + */ + public function __construct( $extension = array() ) { + if ( is_object( $extension ) ) { + $extension = (array) $extension; + } + + foreach ( $extension as $property => $value ) { + if ( property_exists( $this, $property ) ) { + // use the property's setter method when possible + if ( method_exists( $this, "set_$property" ) ) { + $this->{ "set_$property" }( $value ); + continue; + } + + // otherwise, map the value directly into the class property + $this->$property = $value; + } + } + } + + /** + * Set Threats + * + * @param array $threats An array of threat data to add to the extension. + */ + public function set_threats( $threats ) { + if ( ! is_array( $threats ) ) { + $this->threats = array(); + return; + } + + // convert each provided threat item into an instance of Threat_Model + $threats = array_map( + function ( $threat ) { + if ( is_a( $threat, 'Threat_Model' ) ) { + return $threat; + } + + if ( is_object( $threat ) ) { + $threat = (array) $threat; + } + + return new Threat_Model( $threat ); + }, + $threats + ); + + $this->threats = $threats; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-history-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-history-model.php new file mode 100644 index 00000000..ff10ae4b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-history-model.php @@ -0,0 +1,117 @@ + + */ + public $core = array(); + + /** + * Status themes. + * + * @var array + */ + public $themes = array(); + + /** + * Status plugins. + * + * @var array + */ + public $plugins = array(); + + /** + * File threats. + * + * @var array + */ + public $files = array(); + + /** + * Database threats. + * + * @var array + */ + public $database = array(); + + /** + * Whether there was an error loading the history. + * + * @var bool + */ + public $error = false; + + /** + * The error code thrown when loading the history. + * + * @var string + */ + public $error_code; + + /** + * The error message thrown when loading the history. + * + * @var string + */ + public $error_message; + + /** + * Status constructor. + * + * @param array $history The history data to load into the class instance. + */ + public function __construct( $history = array() ) { + foreach ( $history as $property => $value ) { + if ( property_exists( $this, $property ) ) { + $this->$property = $value; + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-protect-models.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-protect-models.php new file mode 100644 index 00000000..a479f90a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-protect-models.php @@ -0,0 +1,16 @@ + + */ + public $themes = array(); + + /** + * Status plugins. + * + * @var array + */ + public $plugins = array(); + + /** + * File threats. + * + * @var array + */ + public $files = array(); + + /** + * Database threats. + * + * @var array + */ + public $database = array(); + + /** + * Whether the site includes items that have not been checked. + * + * @var boolean + */ + public $has_unchecked_items; + + /** + * The estimated percentage of the current scan. + * + * @var int + */ + public $current_progress; + + /** + * Whether there was an error loading the status. + * + * @var bool + */ + public $error = false; + + /** + * The error code thrown when loading the status. + * + * @var string + */ + public $error_code; + + /** + * The error message thrown when loading the status. + * + * @var string + */ + public $error_message; + + /** + * Status constructor. + * + * @param array $status The status data to load into the class instance. + */ + public function __construct( $status = array() ) { + // set status defaults + $this->core = new \stdClass(); + + foreach ( $status as $property => $value ) { + if ( property_exists( $this, $property ) ) { + $this->$property = $value; + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-threat-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-threat-model.php new file mode 100644 index 00000000..d85e1b97 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-models/src/class-threat-model.php @@ -0,0 +1,122 @@ + $value ) { + if ( property_exists( $this, $property ) ) { + $this->$property = $value; + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/CHANGELOG.md new file mode 100644 index 00000000..277db26f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/CHANGELOG.md @@ -0,0 +1,39 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.5] - 2024-09-05 +### Changed +- Update dependencies. + +## [0.1.4] - 2024-09-05 +### Changed +- Update dependencies. + +## [0.1.3] - 2024-08-26 +### Changed +- Updated package dependencies. [#39004] + +## [0.1.2] - 2024-08-19 +### Changed +- Internal updates. + +## [0.1.1] - 2024-08-09 +### Changed +- Update dependencies. + +## 0.1.0 - 2024-07-15 +### Added +- Initial version. [#37894] + +### Changed +- Updated package dependencies. [#37894] + +[0.1.5]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/Automattic/jetpack-protect-status/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/composer.json new file mode 100644 index 00000000..42ba1d65 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/composer.json @@ -0,0 +1,60 @@ +{ + "name": "automattic/jetpack-protect-status", + "description": "This package contains the Protect Status API functionality to retrieve a site's scan status (WordPress, Themes, and Plugins threats).", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-plugins-installer": "^0.4.3", + "automattic/jetpack-sync": "^3.10.0", + "automattic/jetpack-protect-models": "^0.2.1", + "automattic/jetpack-plans": "^0.4.10" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "dev-master" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-development": "echo 'Add your build step to composer.json, please!'", + "build-production": "echo 'Add your build step to composer.json, please!'", + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + }, + "extra": { + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-protect-status/compare/v${old}...v${new}" + }, + "mirror-repo": "Automattic/jetpack-protect-status", + "textdomain": "jetpack-protect-status", + "version-constants": { + "::PACKAGE_VERSION": "src/class-status.php" + } + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-plan.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-plan.php new file mode 100644 index 00000000..67d5cf0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-plan.php @@ -0,0 +1,111 @@ + ( self::CACHE_VALIDITY_PERIOD ); + } + + /** + * Gets the product list from the user cache + */ + private static function get_product_from_cache() { + return get_user_meta( get_current_user_id(), self::CACHE_META_NAME, true ); + } + + /** + * Gets the product data + * + * @param string $wpcom_product The product slug. + * @return array + */ + public static function get_product( $wpcom_product = 'jetpack_scan' ) { + if ( ! self::is_cache_old() ) { + return self::get_product_from_cache(); + } + + $request_url = 'https://public-api.wordpress.com/rest/v1.1/products?locale=' . get_user_locale() . '&type=jetpack'; + $wpcom_request = wp_remote_get( esc_url_raw( $request_url ) ); + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + + if ( 200 === $response_code ) { + $products = json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + + // Pick the desired product... + $product = $products->{$wpcom_product}; + + // ... and store it into the cache. + update_user_meta( get_current_user_id(), self::CACHE_DATE_META_NAME, time() ); + update_user_meta( get_current_user_id(), self::CACHE_META_NAME, $product ); + + return $product; + } + + return new \WP_Error( + 'failed_to_fetch_data', + esc_html__( 'Unable to fetch the requested data.', 'jetpack-protect-status' ), + array( + 'status' => $response_code, + 'request' => $wpcom_request, + ) + ); + } + + /** + * Has Required Plan + * + * @param bool $force_refresh Refresh the local plan cache from wpcom. + * @return bool True when the site has a plan or product that supports the paid Protect tier. + */ + public static function has_required_plan( $force_refresh = false ) { + static $has_scan = null; + if ( null === $has_scan || $force_refresh ) { + $products = array_column( Current_Plan::get_products(), 'product_slug' ); + + // Check for a plan or product that enables scan. + $plan_supports_scan = Current_Plan::supports( 'scan', true ); + $has_scan_product = count( array_intersect( array( 'jetpack_scan', 'jetpack_scan_monthly' ), $products ) ) > 0; + $has_scan = $plan_supports_scan || $has_scan_product; + } + + return $has_scan; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-protect-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-protect-status.php new file mode 100644 index 00000000..832b1cde --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-protect-status.php @@ -0,0 +1,261 @@ + true, + 'error_code' => $status->get_error_code(), + 'error_message' => $status->get_error_message(), + ) + ); + } else { + $status = self::normalize_protect_report_data( $status ); + } + + self::$status = $status; + return $status; + } + + /** + * Gets the WPCOM API endpoint + * + * @return WP_Error|string + */ + public static function get_api_url() { + $blog_id = Jetpack_Options::get_option( 'id' ); + $is_connected = ( new Connection_Manager() )->is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return new WP_Error( 'site_not_connected' ); + } + + $api_url = sprintf( self::REST_API_BASE, $blog_id ); + + return $api_url; + } + + /** + * Fetches the status from WPCOM servers + * + * @return WP_Error|array + */ + public static function fetch_from_server() { + $api_url = self::get_api_url(); + if ( is_wp_error( $api_url ) ) { + return $api_url; + } + + $response = Client::wpcom_json_api_request_as_blog( + self::get_api_url(), + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code || empty( $response['body'] ) ) { + return new WP_Error( 'failed_fetching_status', 'Failed to fetch Protect Status data from server', array( 'status' => $response_code ) ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + self::update_status_option( $body ); + return $body; + } + + /** + * Normalize data from the Protect Report data source. + * + * @param object $report_data Data from the Protect Report. + * @return Status_Model + */ + protected static function normalize_protect_report_data( $report_data ) { + $status = new Status_Model(); + $status->data_source = 'protect_report'; + + // map report data properties directly into the Status_Model + $status->status = isset( $report_data->status ) ? $report_data->status : null; + $status->last_checked = isset( $report_data->last_checked ) ? $report_data->last_checked : null; + $status->num_threats = isset( $report_data->num_vulnerabilities ) ? $report_data->num_vulnerabilities : null; + $status->num_themes_threats = isset( $report_data->num_themes_vulnerabilities ) ? $report_data->num_themes_vulnerabilities : null; + $status->num_plugins_threats = isset( $report_data->num_plugins_vulnerabilities ) ? $report_data->num_plugins_vulnerabilities : null; + + // merge plugins from report with all installed plugins before mapping into the Status_Model + $installed_plugins = Plugins_Installer::get_plugins(); + $last_report_plugins = isset( $report_data->plugins ) ? $report_data->plugins : new \stdClass(); + $status->plugins = self::merge_installed_and_checked_lists( $installed_plugins, $last_report_plugins, array( 'type' => 'plugins' ) ); + + // merge themes from report with all installed plugins before mapping into the Status_Model + $installed_themes = Sync_Functions::get_themes(); + $last_report_themes = isset( $report_data->themes ) ? $report_data->themes : new \stdClass(); + $status->themes = self::merge_installed_and_checked_lists( $installed_themes, $last_report_themes, array( 'type' => 'themes' ) ); + + // normalize WordPress core report data and map into Status_Model + $status->core = self::normalize_core_information( isset( $report_data->core ) ? $report_data->core : new \stdClass() ); + + // check if any installed items (themes, plugins, or core) have not been checked in the report + $all_items = array_merge( $status->plugins, $status->themes, array( $status->core ) ); + $unchecked_items = array_filter( + $all_items, + function ( $item ) { + return ! isset( $item->checked ) || ! $item->checked; + } + ); + $status->has_unchecked_items = ! empty( $unchecked_items ); + + return $status; + } + + /** + * Merges the list of installed extensions with the list of extensions that were checked for known vulnerabilities and return a normalized list to be used in the UI + * + * @param array $installed The list of installed extensions, where each attribute key is the extension slug. + * @param object $checked The list of checked extensions. + * @param array $append Additional data to append to each result in the list. + * @return array Normalized list of extensions. + */ + protected static function merge_installed_and_checked_lists( $installed, $checked, $append ) { + $new_list = array(); + foreach ( array_keys( $installed ) as $slug ) { + + $checked = (object) $checked; + + $extension = new Extension_Model( + array_merge( + array( + 'name' => $installed[ $slug ]['Name'], + 'version' => $installed[ $slug ]['Version'], + 'slug' => $slug, + 'threats' => array(), + 'checked' => false, + ), + $append + ) + ); + + if ( isset( $checked->{ $slug } ) && $checked->{ $slug }->version === $installed[ $slug ]['Version'] ) { + $extension->version = $checked->{ $slug }->version; + $extension->checked = true; + + if ( is_array( $checked->{ $slug }->vulnerabilities ) ) { + foreach ( $checked->{ $slug }->vulnerabilities as $threat ) { + $extension->threats[] = new Threat_Model( + array( + 'id' => $threat->id, + 'title' => $threat->title, + 'fixed_in' => $threat->fixed_in, + 'description' => isset( $threat->description ) ? $threat->description : null, + 'source' => isset( $threat->id ) ? Redirect::get_url( 'jetpack-protect-vul-info', array( 'path' => $threat->id ) ) : null, + ) + ); + } + } + } + + $new_list[] = $extension; + + } + + $new_list = parent::sort_threats( $new_list ); + + return $new_list; + } + + /** + * Check if the WordPress version that was checked matches the current installed version. + * + * @param object $core_check The object returned by Protect wpcom endpoint. + * @return object The object representing the current status of core checks. + */ + protected static function normalize_core_information( $core_check ) { + global $wp_version; + + $core = new Extension_Model( + array( + 'type' => 'core', + 'name' => 'WordPress', + 'version' => $wp_version, + 'checked' => false, + ) + ); + + if ( isset( $core_check->version ) && $core_check->version === $wp_version ) { + if ( is_array( $core_check->vulnerabilities ) ) { + $core->checked = true; + $core->set_threats( + array_map( + function ( $vulnerability ) { + $vulnerability->source = isset( $vulnerability->id ) ? Redirect::get_url( 'jetpack-protect-vul-info', array( 'path' => $vulnerability->id ) ) : null; + return $vulnerability; + }, + $core_check->vulnerabilities + ) + ); + } + } + + return $core; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-rest-controller.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-rest-controller.php new file mode 100644 index 00000000..9faa1545 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-rest-controller.php @@ -0,0 +1,112 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_check_plan', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'status', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'clear-scan-cache', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_clear_scan_cache', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + } + + /** + * Return site plan data for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_check_plan() { + $has_required_plan = Plan::has_required_plan(); + + return rest_ensure_response( $has_required_plan, 200 ); + } + + /** + * Return Protect Status for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_get_status( $request ) { + $status = Status::get_status( $request['hard_refresh'] ); + return rest_ensure_response( $status, 200 ); + } + + /** + * Clear the Scan_Status cache for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_clear_scan_cache() { + $cache_cleared = Scan_Status::delete_option(); + + if ( ! $cache_cleared ) { + return new WP_REST_Response( 'An error occured while attempting to clear the Jetpack Scan cache.', 500 ); + } + + return new WP_REST_Response( 'Jetpack Scan cache cleared.' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-scan-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-scan-status.php new file mode 100644 index 00000000..d0f3d58e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-scan-status.php @@ -0,0 +1,362 @@ + true, + 'error_code' => $status->get_error_code(), + 'error_message' => $status->get_error_message(), + ) + ); + } else { + $status = self::normalize_api_data( $status ); + } + + self::$status = $status; + return $status; + } + + /** + * Gets the Scan API endpoint + * + * @return WP_Error|string + */ + public static function get_api_url() { + $blog_id = Jetpack_Options::get_option( 'id' ); + $is_connected = ( new Connection_Manager() )->is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return new WP_Error( 'site_not_connected' ); + } + + $api_url = sprintf( self::SCAN_API_BASE, $blog_id ); + + return $api_url; + } + + /** + * Fetches the status data from the Scan API + * + * @return WP_Error|array + */ + public static function fetch_from_api() { + $api_url = self::get_api_url(); + if ( is_wp_error( $api_url ) ) { + return $api_url; + } + + $response = Client::wpcom_json_api_request_as_blog( + self::get_api_url(), + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code || empty( $response['body'] ) ) { + return new WP_Error( 'failed_fetching_status', 'Failed to fetch Scan data from the server', array( 'status' => $response_code ) ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + self::update_status_option( $body ); + return $body; + } + + /** + * Normalize API Data + * Formats the payload from the Scan API into an instance of Status_Model. + * + * @param object $scan_data The data returned by the scan API. + * + * @return Status_Model + */ + private static function normalize_api_data( $scan_data ) { + global $wp_version; + + $status = new Status_Model(); + $status->data_source = 'scan_api'; + $status->status = isset( $scan_data->state ) ? $scan_data->state : null; + $status->num_threats = 0; + $status->num_themes_threats = 0; + $status->num_plugins_threats = 0; + $status->has_unchecked_items = false; + $status->current_progress = isset( $scan_data->current->progress ) ? $scan_data->current->progress : null; + + if ( ! empty( $scan_data->most_recent->timestamp ) ) { + $date = new \DateTime( $scan_data->most_recent->timestamp ); + if ( $date ) { + $status->last_checked = $date->format( 'Y-m-d H:i:s' ); + } + } + + $status->core = new Extension_Model( + array( + 'type' => 'core', + 'name' => 'WordPress', + 'version' => $wp_version, + 'checked' => true, // to do: default to false once Scan API has manifest + ) + ); + + if ( isset( $scan_data->threats ) && is_array( $scan_data->threats ) ) { + foreach ( $scan_data->threats as $threat ) { + if ( isset( $threat->extension->type ) ) { + if ( 'plugin' === $threat->extension->type ) { + // add the extension if it does not yet exist in the status + if ( ! isset( $status->plugins[ $threat->extension->slug ] ) ) { + $status->plugins[ $threat->extension->slug ] = new Extension_Model( + array( + 'name' => isset( $threat->extension->name ) ? $threat->extension->name : null, + 'slug' => isset( $threat->extension->slug ) ? $threat->extension->slug : null, + 'version' => isset( $threat->extension->version ) ? $threat->extension->version : null, + 'type' => 'plugin', + 'checked' => true, + 'threats' => array(), + ) + ); + } + + $status->plugins[ $threat->extension->slug ]->threats[] = new Threat_Model( + array( + 'id' => isset( $threat->id ) ? $threat->id : null, + 'signature' => isset( $threat->signature ) ? $threat->signature : null, + 'title' => isset( $threat->title ) ? $threat->title : null, + 'description' => isset( $threat->description ) ? $threat->description : null, + 'vulnerability_description' => isset( $threat->vulnerability_description ) ? $threat->vulnerability_description : null, + 'fix_description' => isset( $threat->fix_description ) ? $threat->fix_description : null, + 'payload_subtitle' => isset( $threat->payload_subtitle ) ? $threat->payload_subtitle : null, + 'payload_description' => isset( $threat->payload_description ) ? $threat->payload_description : null, + 'first_detected' => isset( $threat->first_detected ) ? $threat->first_detected : null, + 'fixed_in' => isset( $threat->fixer->fixer ) && 'update' === $threat->fixer->fixer ? $threat->fixer->target : null, + 'severity' => isset( $threat->severity ) ? $threat->severity : null, + 'fixable' => isset( $threat->fixer ) ? $threat->fixer : null, + 'status' => isset( $threat->status ) ? $threat->status : null, + 'filename' => isset( $threat->filename ) ? $threat->filename : null, + 'context' => isset( $threat->context ) ? $threat->context : null, + 'source' => isset( $threat->source ) ? $threat->source : null, + ) + ); + ++$status->num_threats; + ++$status->num_plugins_threats; + continue; + } + + if ( 'theme' === $threat->extension->type ) { + // add the extension if it does not yet exist in the status + if ( ! isset( $status->themes[ $threat->extension->slug ] ) ) { + $status->themes[ $threat->extension->slug ] = new Extension_Model( + array( + 'name' => isset( $threat->extension->name ) ? $threat->extension->name : null, + 'slug' => isset( $threat->extension->slug ) ? $threat->extension->slug : null, + 'version' => isset( $threat->extension->version ) ? $threat->extension->version : null, + 'type' => 'theme', + 'checked' => true, + 'threats' => array(), + ) + ); + } + + $status->themes[ $threat->extension->slug ]->threats[] = new Threat_Model( + array( + 'id' => isset( $threat->id ) ? $threat->id : null, + 'signature' => isset( $threat->signature ) ? $threat->signature : null, + 'title' => isset( $threat->title ) ? $threat->title : null, + 'description' => isset( $threat->description ) ? $threat->description : null, + 'vulnerability_description' => isset( $threat->vulnerability_description ) ? $threat->vulnerability_description : null, + 'fix_description' => isset( $threat->fix_description ) ? $threat->fix_description : null, + 'payload_subtitle' => isset( $threat->payload_subtitle ) ? $threat->payload_subtitle : null, + 'payload_description' => isset( $threat->payload_description ) ? $threat->payload_description : null, + 'first_detected' => isset( $threat->first_detected ) ? $threat->first_detected : null, + 'fixed_in' => isset( $threat->fixer->fixer ) && 'update' === $threat->fixer->fixer ? $threat->fixer->target : null, + 'severity' => isset( $threat->severity ) ? $threat->severity : null, + 'fixable' => isset( $threat->fixer ) ? $threat->fixer : null, + 'status' => isset( $threat->status ) ? $threat->status : null, + 'filename' => isset( $threat->filename ) ? $threat->filename : null, + 'context' => isset( $threat->context ) ? $threat->context : null, + 'source' => isset( $threat->source ) ? $threat->source : null, + ) + ); + ++$status->num_threats; + ++$status->num_themes_threats; + continue; + } + } + + if ( isset( $threat->signature ) && 'Vulnerable.WP.Core' === $threat->signature ) { + if ( $threat->version !== $wp_version ) { + continue; + } + + $status->core->threats[] = new Threat_Model( + array( + 'id' => $threat->id, + 'signature' => $threat->signature, + 'title' => $threat->title, + 'description' => $threat->description, + 'first_detected' => $threat->first_detected, + 'severity' => $threat->severity, + ) + ); + ++$status->num_threats; + + continue; + } + + if ( ! empty( $threat->filename ) ) { + $status->files[] = new Threat_Model( $threat ); + ++$status->num_threats; + continue; + } + + if ( ! empty( $threat->table ) ) { + $status->database[] = new Threat_Model( $threat ); + ++$status->num_threats; + continue; + } + } + } + + $installed_plugins = Plugins_Installer::get_plugins(); + $status->plugins = self::merge_installed_and_checked_lists( $installed_plugins, $status->plugins, array( 'type' => 'plugins' ), true ); + + $installed_themes = Sync_Functions::get_themes(); + $status->themes = self::merge_installed_and_checked_lists( $installed_themes, $status->themes, array( 'type' => 'themes' ), true ); + + foreach ( array_merge( $status->themes, $status->plugins ) as $extension ) { + if ( ! $extension->checked ) { + $status->has_unchecked_items = true; + break; + } + } + + return $status; + } + + /** + * Merges the list of installed extensions with the list of extensions that were checked for known vulnerabilities and return a normalized list to be used in the UI + * + * @param array $installed The list of installed extensions, where each attribute key is the extension slug. + * @param object $checked The list of checked extensions. + * @param array $append Additional data to append to each result in the list. + * @return array Normalized list of extensions. + */ + protected static function merge_installed_and_checked_lists( $installed, $checked, $append ) { + $new_list = array(); + $checked = (object) $checked; + + foreach ( array_keys( $installed ) as $slug ) { + /** + * Extension Type Map + * + * @var array $extension_type_map Key value pairs of extension types and their corresponding + * identifier used by the Scan API data source. + */ + $extension_type_map = array( + 'themes' => 'r1', + 'plugins' => 'r2', + ); + + $version = $installed[ $slug ]['Version']; + $short_slug = str_replace( '.php', '', explode( '/', $slug )[0] ); + $scanifest_slug = $extension_type_map[ $append['type'] ] . ":$short_slug@$version"; + + $extension = new Extension_Model( + array_merge( + array( + 'name' => $installed[ $slug ]['Name'], + 'version' => $version, + 'slug' => $slug, + 'threats' => array(), + 'checked' => false, + ), + $append + ) + ); + + if ( ! isset( $checked->extensions ) // no extension data available from Scan API + || is_array( $checked->extensions ) && in_array( $scanifest_slug, $checked->extensions, true ) // extension data matches Scan API + ) { + $extension->checked = true; + if ( isset( $checked->{ $short_slug }->threats ) ) { + $extension->threats = $checked->{ $short_slug }->threats; + } + } + + $new_list[] = $extension; + + } + + $new_list = parent::sort_threats( $new_list ); + + return $new_list; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-status.php new file mode 100644 index 00000000..184f546c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-protect-status/src/class-status.php @@ -0,0 +1,311 @@ + (int) $option_timestamp; + } + + /** + * Checks if we should consider the stored cache or bypass it + * + * @return boolean + */ + public static function should_use_cache() { + return defined( 'JETPACK_PROTECT_DEV__BYPASS_CACHE' ) && JETPACK_PROTECT_DEV__BYPASS_CACHE ? false : true; + } + + /** + * Gets the current cached status + * + * @return bool|array False if value is not found. Array with values if cache is found. + */ + public static function get_from_options() { + return maybe_unserialize( get_option( static::OPTION_NAME ) ); + } + + /** + * Updated the cached status and its timestamp + * + * @param array $status The new status to be cached. + * @return void + */ + public static function update_status_option( $status ) { + // TODO: Sanitize $status. + update_option( static::OPTION_NAME, maybe_serialize( $status ) ); + $end_date = self::get_cache_end_date_by_status( $status ); + update_option( static::OPTION_TIMESTAMP_NAME, $end_date ); + } + + /** + * Returns the timestamp the cache should expire depending on the current status + * + * Initial empty status, which are returned before the first check was performed, should be cache for less time + * + * @param object $status The response from the server being cached. + * @return int The timestamp when the cache should expire. + */ + public static function get_cache_end_date_by_status( $status ) { + if ( ! is_object( $status ) || empty( $status->last_checked ) ) { + return time() + static::INITIAL_OPTION_EXPIRES_AFTER; + } + return time() + static::OPTION_EXPIRES_AFTER; + } + + /** + * Delete the cached status and its timestamp + * + * @return bool Whether all related status options were successfully deleted. + */ + public static function delete_option() { + $option_deleted = delete_option( static::OPTION_NAME ); + $option_timestamp_deleted = delete_option( static::OPTION_TIMESTAMP_NAME ); + + return $option_deleted && $option_timestamp_deleted; + } + + /** + * Checks the current status to see if there are any threats found + * + * @return boolean + */ + public static function has_threats() { + return 0 < self::get_total_threats(); + } + + /** + * Gets the total number of threats found + * + * @return integer + */ + public static function get_total_threats() { + $status = static::get_status(); + return isset( $status->num_threats ) && is_int( $status->num_threats ) ? $status->num_threats : 0; + } + + /** + * Get all threats combined + * + * @return array + */ + public static function get_all_threats() { + return array_merge( + self::get_wordpress_threats(), + self::get_themes_threats(), + self::get_plugins_threats(), + self::get_files_threats(), + self::get_database_threats() + ); + } + + /** + * Get threats found for WordPress core + * + * @return array + */ + public static function get_wordpress_threats() { + return self::get_threats( 'core' ); + } + + /** + * Get threats found for themes + * + * @return array + */ + public static function get_themes_threats() { + return self::get_threats( 'themes' ); + } + + /** + * Get threats found for plugins + * + * @return array + */ + public static function get_plugins_threats() { + return self::get_threats( 'plugins' ); + } + + /** + * Get threats found for files + * + * @return array + */ + public static function get_files_threats() { + return self::get_threats( 'files' ); + } + + /** + * Get threats found for plugins + * + * @return array + */ + public static function get_database_threats() { + return self::get_threats( 'database' ); + } + + /** + * Get the threats for one type of extension or core + * + * @param string $type What threats you want to get. Possible values are 'core', 'themes' and 'plugins'. + * + * @return array + */ + public static function get_threats( $type ) { + $status = static::get_status(); + + if ( 'core' === $type ) { + return isset( $status->$type ) && ! empty( $status->$type->threats ) ? $status->$type->threats : array(); + } + + if ( 'files' === $type || 'database' === $type ) { + return isset( $status->$type ) && ! empty( $status->$type ) ? $status->$type : array(); + } + + $threats = array(); + if ( isset( $status->$type ) ) { + foreach ( (array) $status->$type as $item ) { + if ( ! empty( $item->threats ) ) { + $threats = array_merge( $threats, $item->threats ); + } + } + } + return $threats; + } + + /** + * Check if the WordPress version that was checked matches the current installed version. + * + * @param object $core_check The object returned by Protect wpcom endpoint. + * @return object The object representing the current status of core checks. + */ + protected static function normalize_core_information( $core_check ) { + global $wp_version; + + $core = new Extension_Model( + array( + 'type' => 'core', + 'name' => 'WordPress', + 'version' => $wp_version, + 'checked' => false, + ) + ); + + if ( isset( $core_check->version ) && $core_check->version === $wp_version ) { + if ( is_array( $core_check->vulnerabilities ) ) { + $core->checked = true; + $core->set_threats( $core_check->vulnerabilities ); + } + } + + return $core; + } + + /** + * Sort By Threats + * + * @param array $threats Array of threats to sort. + * + * @return array The sorted $threats array. + */ + protected static function sort_threats( $threats ) { + usort( + $threats, + function ( $a, $b ) { + // sort primarily based on the presence of threats + $ret = empty( $a->threats ) <=> empty( $b->threats ); + + // sort secondarily on whether the item has been checked + if ( ! $ret ) { + $ret = $a->checked <=> $b->checked; + } + + return $ret; + } + ); + + return $threats; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md new file mode 100644 index 00000000..27729362 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md @@ -0,0 +1,257 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.0.4] - 2024-09-05 +### Changed +- Update dependencies. + +## [2.0.3] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [2.0.2] - 2024-04-25 +### Changed +- Update dependencies. + +## [2.0.1] - 2024-03-12 +### Changed +- Internal updates. + +## [2.0.0] - 2023-11-20 +### Changed +- Replaced usage of strpos() with str_starts_with(). [#34135] +- Updated required PHP version to >= 7.0. [#34192] + +## [1.7.27] - 2023-09-19 + +- Minor internal updates. + +## [1.7.26] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.7.25] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.7.24] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.7.23] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.7.22] - 2022-12-19 +### Changed +- Updated package dependencies. + +## [1.7.21] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.7.20] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.7.19] - 2022-11-07 +### Changed +- Updated package dependencies. [#27278] + +## [1.7.18] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.7.17] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.7.16] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [1.7.15] - 2022-05-10 + +## [1.7.14] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.7.13] - 2022-04-05 +### Changed +- Updated package dependencies. + +## [1.7.12] - 2022-03-02 +### Changed +- Updated package dependencies. + +## [1.7.11] - 2022-02-22 +### Changed +- Updated package dependencies. + +## [1.7.10] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.7.9] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.7.8] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.7.7] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.7.6] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.7.5] - 2021-10-26 +### Changed +- Updated package dependencies. + +## [1.7.4] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.7.3] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.7.2] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.7.1] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +## [1.7.0] - 2021-06-29 +### Changed +- Allow any argument to be passed. +- Improve documentation. + +## [1.6.1] - 2021-06-15 +### Changed +- Updated package dependencies. + +## [1.6.0] - 2021-05-25 +### Removed +- Removed filter from the final Redirect URL + +## [1.5.5] - 2021-04-27 +### Changed +- Updated package dependencies. + +## [1.5.4] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. +- Userless Connection: Redirect "userless" users to the "Plans" page + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.5.3] - 2021-02-23 + +- CI: Make tests more generic + +## [1.5.2] - 2021-01-26 + +- Update dependencies to latest stable + +## [1.5.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.5.0] - 2021-01-05 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing +- Pin dependency brain/monkey to 2.5.0 + +## [1.4.1] - 2020-11-24 + +- Status: Introduce get_site_suffix method + +## [1.4.0] - 2020-10-27 + +- Masterbar: Add Admin Menu endpoint + +## [1.3.0] - 2020-08-14 + +- Packages: Update filenames after #16810 +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.2.0] - 2020-06-16 + +- Add a trailing / to jetpack.com/redirect URLs. + +## [1.1.0] - 2020-05-22 + +- add filter to Redirect::get_url + +## 1.0.0 - 2020-04-24 + +- Create Jetpack Redirect package + +[2.0.4]: https://github.com/Automattic/jetpack-redirect/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-redirect/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-redirect/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-redirect/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.27...v2.0.0 +[1.7.27]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.26...v1.7.27 +[1.7.26]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.25...v1.7.26 +[1.7.25]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.24...v1.7.25 +[1.7.24]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.23...v1.7.24 +[1.7.23]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.22...v1.7.23 +[1.7.22]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.21...v1.7.22 +[1.7.21]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.20...v1.7.21 +[1.7.20]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.19...v1.7.20 +[1.7.19]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.18...v1.7.19 +[1.7.18]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.17...v1.7.18 +[1.7.17]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.16...v1.7.17 +[1.7.16]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.15...v1.7.16 +[1.7.15]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.14...v1.7.15 +[1.7.14]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.13...v1.7.14 +[1.7.13]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.12...v1.7.13 +[1.7.12]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.11...v1.7.12 +[1.7.11]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.10...v1.7.11 +[1.7.10]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.9...v1.7.10 +[1.7.9]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.8...v1.7.9 +[1.7.8]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.7...v1.7.8 +[1.7.7]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.6...v1.7.7 +[1.7.6]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.6.1...v1.7.0 +[1.6.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.5...v1.6.0 +[1.5.5]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.4...v1.5.5 +[1.5.4]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.4.1...v1.5.0 +[1.4.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/composer.json new file mode 100644 index 00000000..75409539 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/composer.json @@ -0,0 +1,43 @@ +{ + "name": "automattic/jetpack-redirect", + "description": "Utilities to build URLs to the jetpack.com/redirect/ service", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-status": "^4.0.0" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-redirect", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-redirect/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php new file mode 100644 index 00000000..7e1ee79e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php @@ -0,0 +1,79 @@ +get_site_suffix(); + $args = wp_parse_args( $args, array( 'site' => $site_suffix ) ); + + $source_key = 'source'; + + if ( \str_starts_with( $source, 'https://' ) ) { + $source_key = 'url'; + $source_url = \wp_parse_url( $source ); + + // discard any query and fragments. + $source = 'https://' . $source_url['host'] . ( isset( $source_url['path'] ) ? $source_url['path'] : '' ); + } + + $to_be_added = array( + $source_key => rawurlencode( $source ), + ); + + foreach ( $args as $arg_name => $arg_value ) { + + if ( empty( $arg_value ) ) { + continue; + } + + $to_be_added[ $arg_name ] = rawurlencode( $arg_value ); + + } + + if ( ! empty( $to_be_added ) ) { + $url = add_query_arg( $to_be_added, $url ); + } + + return $url; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/CHANGELOG.md new file mode 100644 index 00000000..71a54688 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/CHANGELOG.md @@ -0,0 +1,210 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.0.3] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [2.0.2] - 2024-04-22 +### Changed +- Internal updates. + +## [2.0.1] - 2024-03-12 +### Changed +- Internal updates. + +## [2.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [1.4.25] - 2023-09-19 + +- Minor internal updates. + +## [1.4.24] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.4.23] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.4.22] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.4.21] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.4.20] - 2022-12-19 +### Changed +- Updated package dependencies. + +## [1.4.19] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.4.18] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.4.17] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.4.16] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.4.15] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.4.14] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.4.13] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.4.12] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.4.11] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.4.10] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.4.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.4.8] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.4.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.4.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +## [1.4.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.4.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.4.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.4.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.4.1] - 2021-01-20 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.4.0] - 2020-12-14 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.3.1] - 2020-10-28 + +- Updated PHPCS: Packages and Debugger + +## [1.3.0] - 2020-08-13 + +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.2.0] - 2020-07-01 + +- Package Unit tests: update test file names to make sure they runs in Travis + +## [1.1.0] - 2020-06-22 + +- PHPCS: Clean up the packages +- PHPCS Updates after WPCS 2.3 + +## [1.0.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.2] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.0.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## 1.0.0 - 2019-09-14 + +- Jetpack DNA: Introduce a Roles package + +[2.0.3]: https://github.com/Automattic/jetpack-roles/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-roles/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-roles/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-roles/compare/v1.4.25...v2.0.0 +[1.4.25]: https://github.com/Automattic/jetpack-roles/compare/v1.4.24...v1.4.25 +[1.4.24]: https://github.com/Automattic/jetpack-roles/compare/v1.4.23...v1.4.24 +[1.4.23]: https://github.com/Automattic/jetpack-roles/compare/v1.4.22...v1.4.23 +[1.4.22]: https://github.com/Automattic/jetpack-roles/compare/v1.4.21...v1.4.22 +[1.4.21]: https://github.com/Automattic/jetpack-roles/compare/v1.4.20...v1.4.21 +[1.4.20]: https://github.com/Automattic/jetpack-roles/compare/v1.4.19...v1.4.20 +[1.4.19]: https://github.com/Automattic/jetpack-roles/compare/v1.4.18...v1.4.19 +[1.4.18]: https://github.com/Automattic/jetpack-roles/compare/v1.4.17...v1.4.18 +[1.4.17]: https://github.com/Automattic/jetpack-roles/compare/v1.4.16...v1.4.17 +[1.4.16]: https://github.com/Automattic/jetpack-roles/compare/v1.4.15...v1.4.16 +[1.4.15]: https://github.com/Automattic/jetpack-roles/compare/v1.4.14...v1.4.15 +[1.4.14]: https://github.com/Automattic/jetpack-roles/compare/v1.4.13...v1.4.14 +[1.4.13]: https://github.com/Automattic/jetpack-roles/compare/v1.4.12...v1.4.13 +[1.4.12]: https://github.com/Automattic/jetpack-roles/compare/v1.4.11...v1.4.12 +[1.4.11]: https://github.com/Automattic/jetpack-roles/compare/v1.4.10...v1.4.11 +[1.4.10]: https://github.com/Automattic/jetpack-roles/compare/v1.4.9...v1.4.10 +[1.4.9]: https://github.com/Automattic/jetpack-roles/compare/v1.4.8...v1.4.9 +[1.4.8]: https://github.com/Automattic/jetpack-roles/compare/v1.4.7...v1.4.8 +[1.4.7]: https://github.com/Automattic/jetpack-roles/compare/v1.4.6...v1.4.7 +[1.4.6]: https://github.com/Automattic/jetpack-roles/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/Automattic/jetpack-roles/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/Automattic/jetpack-roles/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/Automattic/jetpack-roles/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-roles/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-roles/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-roles/compare/v1.3.1...v1.4.0 +[1.3.1]: https://github.com/Automattic/jetpack-roles/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-roles/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-roles/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-roles/compare/v1.0.4...v1.1.0 +[1.0.4]: https://github.com/Automattic/jetpack-roles/compare/v1.0.2...v1.0.4 +[1.0.2]: https://github.com/Automattic/jetpack-roles/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-roles/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/composer.json new file mode 100644 index 00000000..731689e7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/composer.json @@ -0,0 +1,42 @@ +{ + "name": "automattic/jetpack-roles", + "description": "Utilities, related with user roles and capabilities.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-roles", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-roles/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php new file mode 100644 index 00000000..7bce3462 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php @@ -0,0 +1,81 @@ + 'manage_options', + 'editor' => 'edit_others_posts', + 'author' => 'publish_posts', + 'contributor' => 'edit_posts', + 'subscriber' => 'read', + ); + + /** + * Get the role of the current user. + * + * @access public + * + * @return string|boolean Current user's role, false if not enough capabilities for any of the roles. + */ + public function translate_current_user_to_role() { + foreach ( $this->capability_translations as $role => $cap ) { + if ( current_user_can( $role ) || current_user_can( $cap ) ) { + return $role; + } + } + + return false; + } + + /** + * Get the role of a particular user. + * + * @access public + * + * @param \WP_User $user User object. + * @return string|boolean User's role, false if not enough capabilities for any of the roles. + */ + public function translate_user_to_role( $user ) { + foreach ( $this->capability_translations as $role => $cap ) { + if ( user_can( $user, $role ) || user_can( $user, $cap ) ) { + return $role; + } + } + + return false; + } + + /** + * Get the minimum capability for a role. + * + * @access public + * + * @param string $role Role name. + * @return string|boolean Capability, false if role isn't mapped to any capabilities. + */ + public function translate_role_to_cap( $role ) { + if ( ! isset( $this->capability_translations[ $role ] ) ) { + return false; + } + + return $this->capability_translations[ $role ]; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/CHANGELOG.md new file mode 100644 index 00000000..a7143dd6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/CHANGELOG.md @@ -0,0 +1,490 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [4.0.1] - 2024-09-06 +### Removed +- Removed usage of _deprecated_function when deprecating Status::is_onboarding [#39272] + +## [4.0.0] - 2024-09-05 +### Deprecated +- Deprecated Jetpack Onboarding system. [#39229] + +## [3.3.4] - 2024-08-23 +### Changed +- Updated package dependencies. [#39004] + +## [3.3.3] - 2024-08-19 +### Changed +- Internal updates. + +## [3.3.2] - 2024-06-24 +### Changed +- Internal updates. + +## [3.3.1] - 2024-06-21 +### Added +- Check for active modules among the unavailable ones. [#37358] + +## [3.3.0] - 2024-06-10 +### Deprecated +- Deprecated is_staging_site [#37023] + +## [3.2.3] - 2024-06-03 +### Removed +- Remove the Identity Crisis dev dependency. [#37654] + +## [3.2.2] - 2024-05-29 +### Changed +- Phab baseline file update. [#36968] + +## [3.2.1] - 2024-05-28 +### Changed +- Internal updates. + +## [3.2.0] - 2024-05-22 +### Deprecated +- Jetpack: Deprecated Errors class. [#37451] + +## [3.1.0] - 2024-05-20 +### Added +- Add the 'is_current_request_activating_plugin_from_plugins_screen' method extracted from the Plugin Install package. [#37430] + +## [3.0.3] - 2024-05-08 +### Fixed +- Status: Added check for compatibility reasons [#37256] + +## [3.0.2] - 2024-05-06 +### Added +- Add new method used to track allowed domains for API access. [#36924] + +## [3.0.1] - 2024-04-30 +### Changed +- Internal updates. + +## [3.0.0] - 2024-04-25 +### Added +- Add is_automattician_feature_flags_only on Jetpack sites as an alternative to is_automattician present on simple sites. [#34798] + +### Removed +- Remove methods deprecated long ago. [#36985] + +## [2.2.2] - 2024-04-22 +### Changed +- Internal updates. + +## [2.2.1] - 2024-04-08 +### Changed +- Internal updates. + +## [2.2.0] - 2024-03-22 +### Added +- Add support for A8C for Agencies source parameter. [#36491] + +## [2.1.3] - 2024-03-20 +### Changed +- Internal updates. + +## [2.1.2] - 2024-03-12 +### Changed +- Internal updates. + +## [2.1.1] - 2024-03-01 +### Fixed +- Avoid issues when the dns_get_record function is not defined [#36019] + +## [2.1.0] - 2024-01-18 +### Added +- Add hosting provider check. [#34864] + +## [2.0.2] - 2023-12-03 +### Fixed +- Module active checks should always be true on WordPress.com simple sites. [#34248] + +## [2.0.1] - 2023-11-21 +### Changed +- Added a note of non-usage of PHP8+ functions yet. [#34137] +- Replaced usage of substr() with str_starts_with() and str_ends_with(). [#34207] + +## [2.0.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [1.19.0] - 2023-11-13 +### Added +- Added Host::get_source_query() to return the 'source' query param from the current URL. [#33984] + +## [1.18.5] - 2023-09-25 +### Changed +- Add 127.0.0.1 into the list of known local domains. [#32898] +- WP.com Compatibility: Abort out early checking if Protect is active. WP.com's protection is not site option based. [#33196] + +## [1.18.4] - 2023-09-19 + +- Minor internal updates. + +## [1.18.3] - 2023-09-11 +### Changed +- General: remove backwards-compatibility function checks now that the package supports WP 6.2. [#32772] + +## [1.18.2] - 2023-09-04 +### Fixed +- Exclude domains starting with live from known Pantheon staging domains [#32789] + +## [1.18.1] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.18.0] - 2023-07-18 +### Added +- Transferred 'get_calypso_env()' method from Jetpack plugin. [#31906] + +## [1.17.2] - 2023-06-19 +### Changed +- Use Plans package to detect feature support. [#31213] + +## [1.17.1] - 2023-05-11 +### Changed +- PHP 8.1 compatibility updates [#30517] + +## [1.17.0] - 2023-04-17 +### Changed +- When Jetpack is available, `Modules::get()` no longer translates `module_tags`. Use Jetpack's `jetpack_get_module_i18n_tag()` function if you need translations. [#30067] + +## [1.16.4] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.16.3] - 2023-03-28 +### Changed +- Move brute force protection into WAF package. [#28401] + +## [1.16.2] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.16.1] - 2023-01-23 +### Added +- Add new filters for the latest status methods [#28328] + +## [1.16.0] - 2023-01-16 +### Added +- Add 2 new methods to detect whether a site is private or not. [#28322] + +## [1.15.4] - 2023-01-11 +### Changed +- Modules: Allow for deactivating multiple plugins when activating a module. [#28181] + +## [1.15.3] - 2022-12-19 +### Changed +- Updated package dependencies. + +## [1.15.2] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.15.1] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.15.0] - 2022-11-07 +### Added +- WordPress.com: add checks for Simple or either Simple/WoA. [#27278] + +## [1.14.3] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.14.2] - 2022-07-19 +### Changed +- Update logic in `is_woa_site` function for host changes [#25067] + +## [1.14.1] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.14.0] - 2022-06-14 +### Fixed +- Moved the connection_url_redirect action handling to the connection package. [#24529] + +## [1.13.6] - 2022-05-24 +### Added +- Allow plugins to filter the list of available modules. Only activate and consider active modules that are available [#24454] + +## [1.13.5] - 2022-05-20 +### Changed +- Modules: Make activate() method Jetpack plugin agnostic. Allowing standalone plugins to use it without Jetpack. + +## [1.13.4] - 2022-05-19 +### Added +- PHPCS updates. [#24418] + +## [1.13.3] - 2022-05-10 + +## [1.13.2] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.13.1] - 2022-04-19 +### Changed +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` + +## [1.13.0] - 2022-04-05 +### Added +- Created Modules and File modules for managing those resources + +## [1.12.0] - 2022-03-02 +### Added +- Cache return values (per blog) from various status methods. + +## [1.11.2] - 2022-02-28 +### Fixed +- Re-doing 1.11.1 to fixup a bad release. + +## [1.11.1] - 2022-02-28 +### Fixed +- Remove trailing semicolor form site suffix. + +## [1.11.0] - 2022-02-22 +### Added +- Add methods to distinguish Newspack and VIP sites. + +## [1.10.0] - 2022-01-25 +### Added +- Added Visitor class for status regarding the site visitor. + +## [1.9.5] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.9.4] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.9.3] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.9.2] - 2021-11-16 +### Changed +- Add a function_exists check before calling wp_get_environment_type + +## [1.9.1] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.9.0] - 2021-10-26 +### Added +- Added Host class for reporting known hosting environment information. + +## [1.8.4] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.8.3] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.8.2] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.8.1] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- update annotations versions + +## [1.8.0] - 2021-06-15 +### Changed +- Update callback to Jetpack to new Identity_Crisis class. + +## [1.7.6] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.7.5] - 2021-04-27 +### Deprecated +- Deprecates is_no_user_testing_mode + +## [1.7.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.7.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.7.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.7.1] - 2021-01-20 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.7.0] - 2020-12-14 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.6.0] - 2020-11-23 + +- Status: Introduce get_site_suffix method +- Status: Fix test failure +- Status: Improve the staging site detection +- General: update minimum required version to WordPress 5.5 +- Add the no_user_testing mode +- Status: Add a couple of test cases for staging site detection +- Update dependency brain/monkey to v2.5.0 +- Updated PHPCS: Packages and Debugger + +## [1.5.0] - 2020-10-13 + +- Also use Core `wp_get_environment_type` for local + +## [1.4.0] - 2020-08-13 + +- CI: Try collect js coverage + +## [1.3.0] - 2020-07-28 + +- Core Compat: Site Environment + +## [1.2.0] - 2020-06-22 + +- PHPCS: Clean up the packages +- Staging Sites: add newspack staging to the list of known providers + +## [1.1.1] - 2020-01-27 + +- Pin dependency brain/monkey to 2.4.0 + +## [1.1.0] - 2020-01-14 + +- Packages: Various improvements for wp.com or self-contained consumers + +## [1.0.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.3] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.0.2] - 2019-10-23 + +- Use spread operator instead of func_get_args + +## [1.0.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## 1.0.0 - 2019-09-14 + +- Packages: Introduce a status package + +[4.0.1]: https://github.com/Automattic/jetpack-status/compare/v4.0.0...v4.0.1 +[4.0.0]: https://github.com/Automattic/jetpack-status/compare/v3.3.4...v4.0.0 +[3.3.4]: https://github.com/Automattic/jetpack-status/compare/v3.3.3...v3.3.4 +[3.3.3]: https://github.com/Automattic/jetpack-status/compare/v3.3.2...v3.3.3 +[3.3.2]: https://github.com/Automattic/jetpack-status/compare/v3.3.1...v3.3.2 +[3.3.1]: https://github.com/Automattic/jetpack-status/compare/v3.3.0...v3.3.1 +[3.3.0]: https://github.com/Automattic/jetpack-status/compare/v3.2.3...v3.3.0 +[3.2.3]: https://github.com/Automattic/jetpack-status/compare/v3.2.2...v3.2.3 +[3.2.2]: https://github.com/Automattic/jetpack-status/compare/v3.2.1...v3.2.2 +[3.2.1]: https://github.com/Automattic/jetpack-status/compare/v3.2.0...v3.2.1 +[3.2.0]: https://github.com/Automattic/jetpack-status/compare/v3.1.0...v3.2.0 +[3.1.0]: https://github.com/Automattic/jetpack-status/compare/v3.0.3...v3.1.0 +[3.0.3]: https://github.com/Automattic/jetpack-status/compare/v3.0.2...v3.0.3 +[3.0.2]: https://github.com/Automattic/jetpack-status/compare/v3.0.1...v3.0.2 +[3.0.1]: https://github.com/Automattic/jetpack-status/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/Automattic/jetpack-status/compare/v2.2.2...v3.0.0 +[2.2.2]: https://github.com/Automattic/jetpack-status/compare/v2.2.1...v2.2.2 +[2.2.1]: https://github.com/Automattic/jetpack-status/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/Automattic/jetpack-status/compare/v2.1.3...v2.2.0 +[2.1.3]: https://github.com/Automattic/jetpack-status/compare/v2.1.2...v2.1.3 +[2.1.2]: https://github.com/Automattic/jetpack-status/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/Automattic/jetpack-status/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-status/compare/v2.0.2...v2.1.0 +[2.0.2]: https://github.com/Automattic/jetpack-status/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-status/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-status/compare/v1.19.0...v2.0.0 +[1.19.0]: https://github.com/Automattic/jetpack-status/compare/v1.18.5...v1.19.0 +[1.18.5]: https://github.com/Automattic/jetpack-status/compare/v1.18.4...v1.18.5 +[1.18.4]: https://github.com/Automattic/jetpack-status/compare/v1.18.3...v1.18.4 +[1.18.3]: https://github.com/Automattic/jetpack-status/compare/v1.18.2...v1.18.3 +[1.18.2]: https://github.com/Automattic/jetpack-status/compare/v1.18.1...v1.18.2 +[1.18.1]: https://github.com/Automattic/jetpack-status/compare/v1.18.0...v1.18.1 +[1.18.0]: https://github.com/Automattic/jetpack-status/compare/v1.17.2...v1.18.0 +[1.17.2]: https://github.com/Automattic/jetpack-status/compare/v1.17.1...v1.17.2 +[1.17.1]: https://github.com/Automattic/jetpack-status/compare/v1.17.0...v1.17.1 +[1.17.0]: https://github.com/Automattic/jetpack-status/compare/v1.16.4...v1.17.0 +[1.16.4]: https://github.com/Automattic/jetpack-status/compare/v1.16.3...v1.16.4 +[1.16.3]: https://github.com/Automattic/jetpack-status/compare/v1.16.2...v1.16.3 +[1.16.2]: https://github.com/Automattic/jetpack-status/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-status/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-status/compare/v1.15.4...v1.16.0 +[1.15.4]: https://github.com/Automattic/jetpack-status/compare/v1.15.3...v1.15.4 +[1.15.3]: https://github.com/Automattic/jetpack-status/compare/v1.15.2...v1.15.3 +[1.15.2]: https://github.com/Automattic/jetpack-status/compare/v1.15.1...v1.15.2 +[1.15.1]: https://github.com/Automattic/jetpack-status/compare/v1.15.0...v1.15.1 +[1.15.0]: https://github.com/Automattic/jetpack-status/compare/v1.14.3...v1.15.0 +[1.14.3]: https://github.com/Automattic/jetpack-status/compare/v1.14.2...v1.14.3 +[1.14.2]: https://github.com/Automattic/jetpack-status/compare/v1.14.1...v1.14.2 +[1.14.1]: https://github.com/Automattic/jetpack-status/compare/v1.14.0...v1.14.1 +[1.14.0]: https://github.com/Automattic/jetpack-status/compare/v1.13.6...v1.14.0 +[1.13.6]: https://github.com/Automattic/jetpack-status/compare/v1.13.5...v1.13.6 +[1.13.5]: https://github.com/Automattic/jetpack-status/compare/v1.13.4...v1.13.5 +[1.13.4]: https://github.com/Automattic/jetpack-status/compare/v1.13.3...v1.13.4 +[1.13.3]: https://github.com/Automattic/jetpack-status/compare/v1.13.2...v1.13.3 +[1.13.2]: https://github.com/Automattic/jetpack-status/compare/v1.13.1...v1.13.2 +[1.13.1]: https://github.com/Automattic/jetpack-status/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-status/compare/v1.12.0...v1.13.0 +[1.12.0]: https://github.com/Automattic/jetpack-status/compare/v1.11.2...v1.12.0 +[1.11.2]: https://github.com/Automattic/jetpack-status/compare/v1.11.1...v1.11.2 +[1.11.1]: https://github.com/Automattic/jetpack-status/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/Automattic/jetpack-status/compare/v1.10.0...v1.11.0 +[1.10.0]: https://github.com/Automattic/jetpack-status/compare/v1.9.5...v1.10.0 +[1.9.5]: https://github.com/Automattic/jetpack-status/compare/v1.9.4...v1.9.5 +[1.9.4]: https://github.com/Automattic/jetpack-status/compare/v1.9.3...v1.9.4 +[1.9.3]: https://github.com/Automattic/jetpack-status/compare/v1.9.2...v1.9.3 +[1.9.2]: https://github.com/Automattic/jetpack-status/compare/v1.9.1...v1.9.2 +[1.9.1]: https://github.com/Automattic/jetpack-status/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/Automattic/jetpack-status/compare/v1.8.4...v1.9.0 +[1.8.4]: https://github.com/Automattic/jetpack-status/compare/v1.8.3...v1.8.4 +[1.8.3]: https://github.com/Automattic/jetpack-status/compare/v1.8.2...v1.8.3 +[1.8.2]: https://github.com/Automattic/jetpack-status/compare/v1.8.1...v1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-status/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-status/compare/v1.7.6...v1.8.0 +[1.7.6]: https://github.com/Automattic/jetpack-status/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-status/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/Automattic/jetpack-status/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-status/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-status/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-status/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-status/compare/v1.6.0...v1.7.0 +[1.6.0]: https://github.com/Automattic/jetpack-status/compare/v1.5.0...v1.6.0 +[1.5.0]: https://github.com/Automattic/jetpack-status/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-status/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-status/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-status/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-status/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-status/compare/v1.0.4...v1.1.0 +[1.0.4]: https://github.com/Automattic/jetpack-status/compare/v1.0.3...v1.0.4 +[1.0.3]: https://github.com/Automattic/jetpack-status/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/Automattic/jetpack-status/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-status/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/composer.json new file mode 100644 index 00000000..64e96393 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/composer.json @@ -0,0 +1,52 @@ +{ + "name": "automattic/jetpack-status", + "description": "Used to retrieve information about the current status of Jetpack and the site overall.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-constants": "^2.0.4" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-connection": "@dev", + "automattic/jetpack-plans": "@dev", + "automattic/jetpack-ip": "^0.2.3" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-status", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "4.0.x-dev" + }, + "dependencies": { + "test-only": [ + "packages/connection", + "packages/plans" + ] + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-cache.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-cache.php new file mode 100644 index 00000000..e28f69f5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-cache.php @@ -0,0 +1,54 @@ +admin_url(); + $bits = wp_parse_url( $admin_url ); + + if ( is_array( $bits ) ) { + $path = ( isset( $bits['path'] ) ) ? dirname( $bits['path'] ) : null; + $domain = ( isset( $bits['host'] ) ) ? $bits['host'] : null; + } else { + $path = null; + $domain = null; + } + } + + // Extract state from cookies and delete cookies. + if ( isset( $_COOKIE['jetpackState'] ) && is_array( $_COOKIE['jetpackState'] ) ) { + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- User should sanitize if necessary. + $yum = wp_unslash( $_COOKIE['jetpackState'] ); + unset( $_COOKIE['jetpackState'] ); + foreach ( $yum as $k => $v ) { + if ( strlen( $v ) ) { + $state[ $k ] = $v; + } + setcookie( "jetpackState[$k]", false, 0, $path, $domain, is_ssl(), true ); + } + } + + if ( $restate ) { + foreach ( $state as $k => $v ) { + setcookie( "jetpackState[$k]", $v, 0, $path, $domain, is_ssl(), true ); + } + return; + } + + // Get a state variable. + if ( isset( $key ) && ! isset( $value ) ) { + if ( array_key_exists( $key, $state ) ) { + return $state[ $key ]; + } + return null; + } + + // Set a state variable. + if ( isset( $key ) && isset( $value ) ) { + if ( is_array( $value ) && isset( $value[0] ) ) { + $value = $value[0]; + } + $state[ $key ] = $value; + if ( ! headers_sent() ) { + if ( $this->should_set_cookie( $key ) ) { + setcookie( "jetpackState[$key]", $value, 0, $path, $domain, is_ssl(), true ); + } + } + } + } + + /** + * Determines whether the jetpackState[$key] value should be added to the + * cookie. + * + * @param string $key The state key. + * + * @return boolean Whether the value should be added to the cookie. + */ + public function should_set_cookie( $key ) { + global $current_screen; + $page = isset( $current_screen->base ) ? $current_screen->base : null; + + if ( 'toplevel_page_jetpack' === $page && 'display_update_modal' === $key ) { + return false; + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-errors.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-errors.php new file mode 100644 index 00000000..d2208017 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-errors.php @@ -0,0 +1,49 @@ +is_atomic_platform() && Constants::is_true( 'WPCOMSH__PLUGIN_FILE' ); + Cache::set( 'is_woa_site', $ret ); + } + return $ret; + } + + /** + * Determine if the site is hosted on the Atomic hosting platform. + * + * @since 1.9.0 + * + * @return bool + */ + public function is_atomic_platform() { + return Constants::is_true( 'ATOMIC_SITE_ID' ) && Constants::is_true( 'ATOMIC_CLIENT_ID' ); + } + + /** + * Determine if this is a Newspack site. + * + * @return bool + */ + public function is_newspack_site() { + return Constants::is_defined( 'NEWSPACK_PLUGIN_FILE' ); + } + + /** + * Determine if this is a VIP-hosted site. + * + * @return bool + */ + public function is_vip_site() { + return Constants::is_defined( 'WPCOM_IS_VIP_ENV' ) && true === Constants::get_constant( 'WPCOM_IS_VIP_ENV' ); + } + + /** + * Determine if this is a Simple platform site. + * + * @return bool + */ + public function is_wpcom_simple() { + return Constants::is_defined( 'IS_WPCOM' ) && true === Constants::get_constant( 'IS_WPCOM' ); + } + + /** + * Determine if this is a WordPress.com site. + * + * Includes both Simple and WoA platforms. + * + * @return bool + */ + public function is_wpcom_platform() { + return $this->is_wpcom_simple() || $this->is_woa_site(); + } + + /** + * Add all wordpress.com environments to the safe redirect allowed list. + * + * To be used with a filter of allowed domains for a redirect. + * + * @param array $domains Allowed WP.com Environments. + */ + public static function allow_wpcom_environments( $domains ) { + $domains[] = 'wordpress.com'; + $domains[] = 'jetpack.wordpress.com'; + $domains[] = 'wpcalypso.wordpress.com'; + $domains[] = 'horizon.wordpress.com'; + $domains[] = 'calypso.localhost'; + return $domains; + } + + /** + * Return Calypso environment value; used for developing Jetpack and pairing + * it with different Calypso environments, such as localhost. + * + * @since 1.18.0 + * + * @return string Calypso environment + */ + public function get_calypso_env() { + // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Nonce is not required; only used for changing environments. + if ( isset( $_GET['calypso_env'] ) ) { + return sanitize_key( $_GET['calypso_env'] ); + } + // phpcs:enable WordPress.Security.NonceVerification.Recommended + + if ( getenv( 'CALYPSO_ENV' ) ) { + return sanitize_key( getenv( 'CALYPSO_ENV' ) ); + } + + if ( defined( 'CALYPSO_ENV' ) && CALYPSO_ENV ) { + return sanitize_key( CALYPSO_ENV ); + } + + return ''; + } + + /** + * Return source query param value from the URL if exists in the allowed sources list. + * + * @return string "source" query param value + */ + public function get_source_query() { + // phpcs:disable WordPress.Security.NonceVerification.Recommended + $allowed_sources = array( 'jetpack-manage', 'a8c-for-agencies' ); + if ( isset( $_GET['source'] ) && in_array( $_GET['source'], $allowed_sources, true ) ) { + return sanitize_key( $_GET['source'] ); + } + + return ''; + } + + /** + * Returns an array of nameservers for the current site. + * + * @param string $domain The domain of the site to check. + * @return array + */ + public function get_nameserver_dns_records( $domain ) { + if ( ! function_exists( 'dns_get_record' ) ) { + return array(); + } + + $dns_records = dns_get_record( $domain, DNS_NS ); // Fetches the DNS records of type NS (Name Server) + $nameservers = array(); + foreach ( $dns_records as $record ) { + if ( isset( $record['target'] ) ) { + $nameservers[] = $record['target']; // Adds the nameserver to the array + } + } + + return $nameservers; // Returns an array of nameserver names + } + + /** + * Given a DNS entry, will return a hosting provider if one can be determined. Otherwise, will return 'unknown'. + * Sourced from: fbhepr%2Skers%2Sjcpbz%2Sjc%2Qpbagrag%2Syvo%2Subfgvat%2Qcebivqre%2Sanzrfreiref.cuc-og + * + * @param string $domain The domain of the site to check. + * @return string The hosting provider of 'unknown'. + */ + public function get_hosting_provider_by_nameserver( $domain ) { + $known_nameservers = array( + 'bluehost' => array( + '.bluehost.com', + ), + 'dreamhost' => array( + '.dreamhost.com', + ), + 'mediatemple' => array( + '.mediatemple.net', + ), + 'xserver' => array( + '.xserver.jp', + ), + 'namecheap' => array( + '.namecheaphosting.com', + ), + 'hostmonster' => array( + '.hostmonster.com', + ), + 'justhost' => array( + '.justhost.com', + ), + 'digitalocean' => array( + '.digitalocean.com', + ), + 'one' => array( + '.one.com', + ), + 'hostpapa' => array( + '.hostpapa.com', + ), + 'siteground' => array( + '.sgcloud.net', + '.sgedu.site', + '.sgsrv1.com', + '.sgvps.net', + '.siteground.biz', + '.siteground.net', + '.siteground.eu', + ), + 'inmotion' => array( + '.inmotionhosting.com', + ), + 'ionos' => array( + '.ui-dns.org', + '.ui-dns.de', + '.ui-dns.biz', + '.ui-dns.com', + ), + ); + + $dns_records = $this->get_nameserver_dns_records( $domain ); + $dns_records = array_map( 'strtolower', $dns_records ); + + foreach ( $known_nameservers as $host => $ns_patterns ) { + foreach ( $ns_patterns as $ns_pattern ) { + foreach ( $dns_records as $record ) { + if ( false !== strpos( $record, $ns_pattern ) ) { + return $host; + } + } + } + } + + return 'unknown'; + } + + /** + * Returns a guess of the hosting provider for the current site based on various checks. + * + * @return string + */ + public function get_known_host_guess() { + $host = Cache::get( 'host_guess' ); + + if ( null !== $host ) { + return $host; + } + + // First, let's check if we can recognize provider manually: + switch ( true ) { + case $this->is_woa_site(): + $provider = 'woa'; + break; + case $this->is_atomic_platform(): + $provider = 'atomic'; + break; + case $this->is_newspack_site(): + $provider = 'newspack'; + break; + case $this->is_vip_site(): + $provider = 'vip'; + break; + case $this->is_wpcom_simple(): + case $this->is_wpcom_platform(): + $provider = 'wpcom'; + break; + default: + $provider = 'unknown'; + break; + } + + // Second, let's check if we can recognize provider by nameservers: + $domain = isset( $_SERVER['SERVER_NAME'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : ''; + if ( $provider === 'unknown' && ! empty( $domain ) ) { + $provider = $this->get_hosting_provider_by_nameserver( $domain ); + } + + Cache::set( 'host_guess', $provider ); + return $provider; + } + + /** + * Add public-api.wordpress.com to the safe redirect allowed list - only added when someone allows API access. + * + * @since 3.0.2 Ported from Jetpack to the Status package. + * + * To be used with a filter of allowed domains for a redirect. + * + * @param array $domains Allowed WP.com Environments. + * + * @return array + */ + public static function allow_wpcom_public_api_domain( $domains ) { + $domains[] = 'public-api.wordpress.com'; + return $domains; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-modules.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-modules.php new file mode 100644 index 00000000..e5d49f33 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-modules.php @@ -0,0 +1,609 @@ +get_path( $this->get_slug( $module ) ); + + if ( isset( $modules_details[ $module ] ) ) { + $mod = $modules_details[ $module ]; + } else { + $mod = jetpack_get_module_info( $module ); + + if ( null === $mod ) { + // Try to get the module info from the file as a fallback. + $mod = $this->get_file_data( $file, jetpack_get_all_module_header_names() ); + + if ( empty( $mod['name'] ) ) { + // No info for this module. + return false; + } + } + + $mod['sort'] = empty( $mod['sort'] ) ? 10 : (int) $mod['sort']; + $mod['recommendation_order'] = empty( $mod['recommendation_order'] ) ? 20 : (int) $mod['recommendation_order']; + $mod['deactivate'] = empty( $mod['deactivate'] ); + $mod['free'] = empty( $mod['free'] ); + $mod['requires_connection'] = ( ! empty( $mod['requires_connection'] ) && 'No' === $mod['requires_connection'] ) ? false : true; + $mod['requires_user_connection'] = ( empty( $mod['requires_user_connection'] ) || 'No' === $mod['requires_user_connection'] ) ? false : true; + + if ( empty( $mod['auto_activate'] ) || ! in_array( strtolower( $mod['auto_activate'] ), array( 'yes', 'no', 'public' ), true ) ) { + $mod['auto_activate'] = 'No'; + } else { + $mod['auto_activate'] = (string) $mod['auto_activate']; + } + + if ( $mod['module_tags'] ) { + $mod['module_tags'] = explode( ',', $mod['module_tags'] ); + $mod['module_tags'] = array_map( 'trim', $mod['module_tags'] ); + } else { + $mod['module_tags'] = array( 'Other' ); + } + + if ( $mod['plan_classes'] ) { + $mod['plan_classes'] = explode( ',', $mod['plan_classes'] ); + $mod['plan_classes'] = array_map( 'strtolower', array_map( 'trim', $mod['plan_classes'] ) ); + } else { + $mod['plan_classes'] = array( 'free' ); + } + + if ( $mod['feature'] ) { + $mod['feature'] = explode( ',', $mod['feature'] ); + $mod['feature'] = array_map( 'trim', $mod['feature'] ); + } else { + $mod['feature'] = array( 'Other' ); + } + + $modules_details[ $module ] = $mod; + + } + + /** + * Filters the feature array on a module. + * + * This filter allows you to control where each module is filtered: Recommended, + * and the default "Other" listing. + * + * @since-jetpack 3.5.0 + * + * @param array $mod['feature'] The areas to feature this module: + * 'Recommended' shows on the main Jetpack admin screen. + * 'Other' should be the default if no other value is in the array. + * @param string $module The slug of the module, e.g. sharedaddy. + * @param array $mod All the currently assembled module data. + */ + $mod['feature'] = apply_filters( 'jetpack_module_feature', $mod['feature'], $module, $mod ); + + /** + * Filter the returned data about a module. + * + * This filter allows overriding any info about Jetpack modules. It is dangerous, + * so please be careful. + * + * @since-jetpack 3.6.0 + * + * @param array $mod The details of the requested module. + * @param string $module The slug of the module, e.g. sharedaddy + * @param string $file The path to the module source file. + */ + return apply_filters( 'jetpack_get_module', $mod, $module, $file ); + } + + /** + * Like core's get_file_data implementation, but caches the result. + * + * @param string $file Absolute path to the file. + * @param array $headers List of headers, in the format array( 'HeaderKey' => 'Header Name' ). + */ + public function get_file_data( $file, $headers ) { + // Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated. + $file_name = basename( $file ); + + if ( ! Constants::is_defined( 'JETPACK__VERSION' ) ) { + return get_file_data( $file, $headers ); + } + + $cache_key = 'jetpack_file_data_' . JETPACK__VERSION; + + $file_data_option = get_transient( $cache_key ); + + if ( ! is_array( $file_data_option ) ) { + delete_transient( $cache_key ); + $file_data_option = false; + } + + if ( false === $file_data_option ) { + $file_data_option = array(); + } + + $key = md5( $file_name . maybe_serialize( $headers ) ); + $refresh_cache = is_admin() && isset( $_GET['page'] ) && is_string( $_GET['page'] ) && str_starts_with( $_GET['page'], 'jetpack' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput + + // If we don't need to refresh the cache, and already have the value, short-circuit! + if ( ! $refresh_cache && isset( $file_data_option[ $key ] ) ) { + return $file_data_option[ $key ]; + } + + $data = get_file_data( $file, $headers ); + + $file_data_option[ $key ] = $data; + + set_transient( $cache_key, $file_data_option, 29 * DAY_IN_SECONDS ); + + return $data; + } + + /** + * Get a list of activated modules as an array of module slugs. + * + * @param bool $available_only Filter out the unavailable (deleted) modules. + * + * @return array + */ + public function get_active( $available_only = true ) { + $active = \Jetpack_Options::get_option( 'active_modules' ); + + if ( ! is_array( $active ) ) { + $active = array(); + } + + if ( class_exists( 'VaultPress' ) || function_exists( 'vaultpress_contact_service' ) ) { + $active[] = 'vaultpress'; + } else { + $active = array_diff( $active, array( 'vaultpress' ) ); + } + + // If protect is active on the main site of a multisite, it should be active on all sites. Doesn't apply to WP.com. + if ( ! in_array( 'protect', $active, true ) + && ! ( new Host() )->is_wpcom_simple() + && is_multisite() + && get_site_option( 'jetpack_protect_active' ) ) { + $active[] = 'protect'; + } + + if ( $available_only ) { + // If it's not available, it shouldn't be active. + // We don't delete it from the options though, as it will be active again when a plugin gets reactivated. + $active = array_intersect( $active, $this->get_available() ); + } + + /** + * Allow filtering of the active modules. + * + * Gives theme and plugin developers the power to alter the modules that + * are activated on the fly. + * + * @since-jetpack 5.8.0 + * + * @param array $active Array of active module slugs. + */ + $active = apply_filters( 'jetpack_active_modules', $active ); + + return array_unique( $active ); + } + + /** + * Extract a module's slug from its full path. + * + * @param string $file Full path to a file. + * + * @return string Module slug. + */ + public function get_slug( $file ) { + return str_replace( '.php', '', basename( $file ) ); + } + + /** + * List available Jetpack modules. Simply lists .php files in /modules/. + * Make sure to tuck away module "library" files in a sub-directory. + * + * @param bool|string $min_version Only return modules introduced in this version or later. Default is false, do not filter. + * @param bool|string $max_version Only return modules introduced before this version. Default is false, do not filter. + * @param bool|null $requires_connection Pass a boolean value to only return modules that require (or do not require) a connection. + * @param bool|null $requires_user_connection Pass a boolean value to only return modules that require (or do not require) a user connection. + * + * @return array $modules Array of module slugs + */ + public function get_available( $min_version = false, $max_version = false, $requires_connection = null, $requires_user_connection = null ) { + static $modules = null; + + if ( ! class_exists( 'Jetpack' ) || ! Constants::is_defined( 'JETPACK__VERSION' ) || ! Constants::is_defined( 'JETPACK__PLUGIN_DIR' ) ) { + return array_unique( + /** + * Stand alone plugins need to use this filter to register the modules they interact with. + * This will allow them to activate and deactivate these modules even when Jetpack is not present. + * Note: Standalone plugins can only interact with modules that also exist in the Jetpack plugin, otherwise they'll lose the ability to control it if Jetpack is activated. + * + * @since 1.13.6 + * + * @param array $modules The list of available modules as an array of slugs. + * @param bool $requires_connection Whether to list only modules that require a connection to work. + * @param bool $requires_user_connection Whether to list only modules that require a user connection to work. + */ + apply_filters( 'jetpack_get_available_standalone_modules', array(), $requires_connection, $requires_user_connection ) + ); + } + + if ( ! isset( $modules ) ) { + $available_modules_option = \Jetpack_Options::get_option( 'available_modules', array() ); + // Use the cache if we're on the front-end and it's available... + if ( ! is_admin() && ! empty( $available_modules_option[ JETPACK__VERSION ] ) ) { + $modules = $available_modules_option[ JETPACK__VERSION ]; + } else { + $files = ( new Files() )->glob_php( JETPACK__PLUGIN_DIR . 'modules' ); + + $modules = array(); + + foreach ( $files as $file ) { + $slug = $this->get_slug( $file ); + $headers = $this->get( $slug ); + + if ( ! $headers ) { + continue; + } + + $modules[ $slug ] = $headers['introduced']; + } + + \Jetpack_Options::update_option( + 'available_modules', + array( + JETPACK__VERSION => $modules, + ) + ); + } + } + + /** + * Filters the array of modules available to be activated. + * + * @since 2.4.0 + * + * @param array $modules Array of available modules. + * @param string $min_version Minimum version number required to use modules. + * @param string $max_version Maximum version number required to use modules. + * @param bool|null $requires_connection Value of the Requires Connection filter. + * @param bool|null $requires_user_connection Value of the Requires User Connection filter. + */ + $mods = apply_filters( 'jetpack_get_available_modules', $modules, $min_version, $max_version, $requires_connection, $requires_user_connection ); + + if ( ! $min_version && ! $max_version && $requires_connection === null && $requires_user_connection === null ) { + return array_keys( $mods ); + } + + $r = array(); + foreach ( $mods as $slug => $introduced ) { + if ( $min_version && version_compare( $min_version, $introduced, '>=' ) ) { + continue; + } + + if ( $max_version && version_compare( $max_version, $introduced, '<' ) ) { + continue; + } + + $mod_details = $this->get( $slug ); + + if ( null !== $requires_connection && (bool) $requires_connection !== $mod_details['requires_connection'] ) { + continue; + } + + if ( null !== $requires_user_connection && (bool) $requires_user_connection !== $mod_details['requires_user_connection'] ) { + continue; + } + + $r[] = $slug; + } + + return $r; + } + + /** + * Is slug a valid module. + * + * @param string $module Module slug. + * + * @return bool + */ + public function is_module( $module ) { + return ! empty( $module ) && ! validate_file( $module, $this->get_available() ); + } + + /** + * Update module status. + * + * @param string $module - module slug. + * @param boolean $active - true to activate, false to deactivate. + * @param bool $exit Should exit be called after deactivation. + * @param bool $redirect Should there be a redirection after activation. + */ + public function update_status( $module, $active, $exit = true, $redirect = true ) { + return $active ? $this->activate( $module, $exit, $redirect ) : $this->deactivate( $module ); + } + + /** + * Activate a module. + * + * @param string $module Module slug. + * @param bool $exit Should exit be called after deactivation. + * @param bool $redirect Should there be a redirection after activation. + * + * @return bool|void + */ + public function activate( $module, $exit = true, $redirect = true ) { + /** + * Fires before a module is activated. + * + * @since 2.6.0 + * + * @param string $module Module slug. + * @param bool $exit Should we exit after the module has been activated. Default to true. + * @param bool $redirect Should the user be redirected after module activation? Default to true. + */ + do_action( 'jetpack_pre_activate_module', $module, $exit, $redirect ); + + if ( ! strlen( $module ) ) { + return false; + } + + // If it's already active, then don't do it again. + $active = $this->get_active(); + foreach ( $active as $act ) { + if ( $act === $module ) { + return true; + } + } + + if ( ! $this->is_module( $module ) ) { + return false; + } + + // Jetpack plugin only + if ( class_exists( 'Jetpack' ) ) { + + $module_data = $this->get( $module ); + + $status = new Status(); + $state = new CookieState(); + + if ( ! \Jetpack::is_connection_ready() ) { + if ( ! $status->is_offline_mode() ) { + return false; + } + + // If we're not connected but in offline mode, make sure the module doesn't require a connection. + if ( $status->is_offline_mode() && $module_data['requires_connection'] ) { + return false; + } + } + + if ( class_exists( 'Jetpack_Client_Server' ) ) { + $jetpack = \Jetpack::init(); + + // Check and see if the old plugin is active. + if ( isset( $jetpack->plugins_to_deactivate[ $module ] ) ) { + // Deactivate the old plugins. + $deactivated = array(); + foreach ( $jetpack->plugins_to_deactivate[ $module ] as $idx => $deactivate_me ) { + if ( \Jetpack_Client_Server::deactivate_plugin( $deactivate_me[0], $deactivate_me[1] ) ) { + // If we deactivated the old plugin, remembere that with ::state() and redirect back to this page to activate the module + // We can't activate the module on this page load since the newly deactivated old plugin is still loaded on this page load. + $deactivated[] = "$module:$idx"; + } + } + if ( $deactivated ) { + $state->state( 'deactivated_plugins', implode( ',', $deactivated ) ); + wp_safe_redirect( add_query_arg( 'jetpack_restate', 1 ) ); + exit; + } + } + } + + // Protect won't work with mis-configured IPs. + if ( 'protect' === $module ) { + if ( ! IP_Utils::get_ip() ) { + $state->state( 'message', 'protect_misconfigured_ip' ); + return false; + } + } + + if ( ! Jetpack_Plan::supports( $module ) ) { + return false; + } + + // Check the file for fatal errors, a la wp-admin/plugins.php::activate. + $state->state( 'module', $module ); + $state->state( 'error', 'module_activation_failed' ); // we'll override this later if the plugin can be included without fatal error. + + ob_start(); + $module_path = $this->get_path( $module ); + if ( file_exists( $module_path ) ) { + require $this->get_path( $module ); // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.NotAbsolutePath + } + + $active[] = $module; + $this->update_active( $active ); + + $state->state( 'error', false ); // the override. + ob_end_clean(); + } else { // Not a Jetpack plugin. + $active[] = $module; + $this->update_active( $active ); + } + + if ( $redirect ) { + wp_safe_redirect( ( new Paths() )->admin_url( 'page=jetpack' ) ); + } + if ( $exit ) { + exit; + } + return true; + } + + /** + * Deactivate module. + * + * @param string $module Module slug. + * + * @return bool + */ + public function deactivate( $module ) { + /** + * Fires when a module is deactivated. + * + * @since 1.9.0 + * + * @param string $module Module slug. + */ + do_action( 'jetpack_pre_deactivate_module', $module ); + + $active = $this->get_active(); + $new = array_filter( array_diff( $active, (array) $module ) ); + + return $this->update_active( $new ); + } + + /** + * Generate a module's path from its slug. + * + * @param string $slug Module slug. + */ + public function get_path( $slug ) { + if ( ! Constants::is_defined( 'JETPACK__PLUGIN_DIR' ) ) { + return ''; + } + /** + * Filters the path of a modules. + * + * @since 7.4.0 + * + * @param array $return The absolute path to a module's root php file + * @param string $slug The module slug + */ + return apply_filters( 'jetpack_get_module_path', JETPACK__PLUGIN_DIR . "modules/$slug.php", $slug ); + } + + /** + * Saves all the currently active modules to options. + * Also fires Action hooks for each newly activated and deactivated module. + * + * @param array $modules Array of active modules to be saved in options. + * + * @return bool $success true for success, false for failure. + */ + public function update_active( $modules ) { + $current_modules = \Jetpack_Options::get_option( 'active_modules', array() ); + $active_modules = $this->get_active(); + $new_active_modules = array_diff( $modules, $current_modules ); + $new_inactive_modules = array_diff( $active_modules, $modules ); + $new_current_modules = array_diff( array_merge( $current_modules, $new_active_modules ), $new_inactive_modules ); + $reindexed_modules = array_values( $new_current_modules ); + $success = \Jetpack_Options::update_option( 'active_modules', array_unique( $reindexed_modules ) ); + // Let's take `pre_update_option_jetpack_active_modules` filter into account + // and actually decide for which modules we need to fire hooks by comparing + // the 'active_modules' option before and after the update. + $current_modules_post_update = \Jetpack_Options::get_option( 'active_modules', array() ); + + $new_inactive_modules = array_diff( $current_modules, $current_modules_post_update ); + $new_inactive_modules = array_unique( $new_inactive_modules ); + $new_inactive_modules = array_values( $new_inactive_modules ); + + $new_active_modules = array_diff( $current_modules_post_update, $current_modules ); + $new_active_modules = array_unique( $new_active_modules ); + $new_active_modules = array_values( $new_active_modules ); + + foreach ( $new_active_modules as $module ) { + /** + * Fires when a specific module is activated. + * + * @since 1.9.0 + * + * @param string $module Module slug. + * @param boolean $success whether the module was activated. @since 4.2 + */ + do_action( 'jetpack_activate_module', $module, $success ); + /** + * Fires when a module is activated. + * The dynamic part of the filter, $module, is the module slug. + * + * @since 1.9.0 + * + * @param string $module Module slug. + */ + do_action( "jetpack_activate_module_$module", $module ); + } + + foreach ( $new_inactive_modules as $module ) { + /** + * Fired after a module has been deactivated. + * + * @since 4.2.0 + * + * @param string $module Module slug. + * @param boolean $success whether the module was deactivated. + */ + do_action( 'jetpack_deactivate_module', $module, $success ); + /** + * Fires when a module is deactivated. + * The dynamic part of the filter, $module, is the module slug. + * + * @since 1.9.0 + * + * @param string $module Module slug. + */ + do_action( "jetpack_deactivate_module_$module", $module ); + } + + return $success; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-paths.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-paths.php new file mode 100644 index 00000000..7ef200b4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-paths.php @@ -0,0 +1,81 @@ + 'jetpack' ) ); + $url = add_query_arg( $args, admin_url( 'admin.php' ) ); + return $url; + } + + /** + * Determine if the current request is activating a plugin from the plugins page. + * + * @param string $plugin Plugin file path to check. + * @return bool + */ + public function is_current_request_activating_plugin_from_plugins_screen( $plugin ) { + // Filter out common async request contexts + if ( + wp_doing_ajax() || + ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || + ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST ) || + ( defined( 'WP_CLI' ) && WP_CLI ) + ) { + return false; + } + + if ( isset( $_SERVER['SCRIPT_NAME'] ) ) { + $request_file = esc_url_raw( wp_unslash( $_SERVER['SCRIPT_NAME'] ) ); + } elseif ( isset( $_SERVER['REQUEST_URI'] ) ) { + list( $request_file ) = explode( '?', esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); + } else { + return false; + } + + // Not the plugins page + if ( strpos( $request_file, 'wp-admin/plugins.php' ) === false ) { + return false; + } + + // Same method to get the action as used by plugins.php + $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); + $action = $wp_list_table->current_action(); + + // Not a singular activation + // This also means that if the plugin is activated as part of a group ( bulk activation ), this function will return false here. + if ( 'activate' !== $action ) { + return false; + } + + // Check the nonce associated with the plugin activation + // We are not changing any data here, so this is not super necessary, it's just a best practice before using the form data from $_REQUEST. + check_admin_referer( 'activate-plugin_' . $plugin ); + + // Not the right plugin + $requested_plugin = isset( $_REQUEST['plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['plugin'] ) ) : null; + if ( $requested_plugin !== $plugin ) { + return false; + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-status.php new file mode 100644 index 00000000..472157f2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-status.php @@ -0,0 +1,435 @@ +is_local_site() ) { + $offline_mode = true; + } + + /** + * Filters Jetpack's offline mode. + * + * @see https://jetpack.com/support/development-mode/ + * @todo Update documentation ^^. + * + * @since 1.3.0 + * + * @param bool $offline_mode Is Jetpack's offline mode active. + */ + $offline_mode = (bool) apply_filters( 'jetpack_offline_mode', $offline_mode ); + + Cache::set( 'is_offline_mode', $offline_mode ); + return $offline_mode; + } + + /** + * Whether this is a system with a multiple networks. + * Implemented since there is no core is_multi_network function. + * Right now there is no way to tell which network is the dominant network on the system. + * + * @return boolean + */ + public function is_multi_network() { + global $wpdb; + + $cached = Cache::get( 'is_multi_network' ); + if ( null !== $cached ) { + return $cached; + } + + // If we don't have a multi site setup no need to do any more. + if ( ! is_multisite() ) { + Cache::set( 'is_multi_network', false ); + return false; + } + + $num_sites = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->site}" ); + if ( $num_sites > 1 ) { + Cache::set( 'is_multi_network', true ); + return true; + } + + Cache::set( 'is_multi_network', false ); + return false; + } + + /** + * Whether the current site is single user site. + * + * @return bool + */ + public function is_single_user_site() { + global $wpdb; + + $ret = Cache::get( 'is_single_user_site' ); + if ( null === $ret ) { + $some_users = get_transient( 'jetpack_is_single_user' ); + if ( false === $some_users ) { + $some_users = $wpdb->get_var( "SELECT COUNT(*) FROM (SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}capabilities' LIMIT 2) AS someusers" ); + set_transient( 'jetpack_is_single_user', (int) $some_users, 12 * HOUR_IN_SECONDS ); + } + $ret = 1 === (int) $some_users; + Cache::set( 'is_single_user_site', $ret ); + } + return $ret; + } + + /** + * If the site is a local site. + * + * @since 1.3.0 + * + * @return bool + */ + public function is_local_site() { + $cached = Cache::get( 'is_local_site' ); + if ( null !== $cached ) { + return $cached; + } + + $site_url = site_url(); + + // Check for localhost and sites using an IP only first. + // Note: str_contains() is not used here, as wp-includes/compat.php is not loaded in this file. + $is_local = $site_url && false === strpos( $site_url, '.' ); + + // Use Core's environment check, if available. + if ( 'local' === wp_get_environment_type() ) { + $is_local = true; + } + + // Then check for usual usual domains used by local dev tools. + $known_local = array( + '#\.local$#i', + '#\.localhost$#i', + '#\.test$#i', + '#\.docksal$#i', // Docksal. + '#\.docksal\.site$#i', // Docksal. + '#\.dev\.cc$#i', // ServerPress. + '#\.lndo\.site$#i', // Lando. + '#^https?://127\.0\.0\.1$#', + ); + + if ( ! $is_local ) { + foreach ( $known_local as $url ) { + if ( preg_match( $url, $site_url ) ) { + $is_local = true; + break; + } + } + } + + /** + * Filters is_local_site check. + * + * @since 1.3.0 + * + * @param bool $is_local If the current site is a local site. + */ + $is_local = apply_filters( 'jetpack_is_local_site', $is_local ); + + Cache::set( 'is_local_site', $is_local ); + return $is_local; + } + + /** + * If is a staging site. + * + * @deprecated since 3.3.0 + * + * @return bool + */ + public function is_staging_site() { + _deprecated_function( __FUNCTION__, '3.3.0', 'in_safe_mode' ); + $cached = Cache::get( 'is_staging_site' ); + if ( null !== $cached ) { + return $cached; + } + + /* + * Core's wp_get_environment_type allows for a few specific options. + * We should default to bowing out gracefully for anything other than production or local. + */ + $is_staging = ! in_array( wp_get_environment_type(), array( 'production', 'local' ), true ); + + $known_staging = array( + 'urls' => array( + '#\.staging\.wpengine\.com$#i', // WP Engine. This is their legacy staging URL structure. Their new platform does not have a common URL. https://github.com/Automattic/jetpack/issues/21504 + '#\.staging\.kinsta\.com$#i', // Kinsta.com. + '#\.kinsta\.cloud$#i', // Kinsta.com. + '#\.stage\.site$#i', // DreamPress. + '#\.newspackstaging\.com$#i', // Newspack. + '#^(?!live-)([a-zA-Z0-9-]+)\.pantheonsite\.io$#i', // Pantheon. + '#\.flywheelsites\.com$#i', // Flywheel. + '#\.flywheelstaging\.com$#i', // Flywheel. + '#\.cloudwaysapps\.com$#i', // Cloudways. + '#\.azurewebsites\.net$#i', // Azure. + '#\.wpserveur\.net$#i', // WPServeur. + '#\-liquidwebsites\.com$#i', // Liquidweb. + ), + 'constants' => array( + 'IS_WPE_SNAPSHOT', // WP Engine. This is used on their legacy staging environment. Their new platform does not have a constant. https://github.com/Automattic/jetpack/issues/21504 + 'KINSTA_DEV_ENV', // Kinsta.com. + 'WPSTAGECOACH_STAGING', // WP Stagecoach. + 'JETPACK_STAGING_MODE', // Generic. + 'WP_LOCAL_DEV', // Generic. + ), + ); + /** + * Filters the flags of known staging sites. + * + * @since 1.1.1 + * @since-jetpack 3.9.0 + * + * @param array $known_staging { + * An array of arrays that each are used to check if the current site is staging. + * @type array $urls URLs of staging sites in regex to check against site_url. + * @type array $constants PHP constants of known staging/developement environments. + * } + */ + $known_staging = apply_filters( 'jetpack_known_staging', $known_staging ); + + if ( isset( $known_staging['urls'] ) ) { + $site_url = site_url(); + foreach ( $known_staging['urls'] as $url ) { + if ( preg_match( $url, wp_parse_url( $site_url, PHP_URL_HOST ) ) ) { + $is_staging = true; + break; + } + } + } + + if ( isset( $known_staging['constants'] ) ) { + foreach ( $known_staging['constants'] as $constant ) { + if ( defined( $constant ) && constant( $constant ) ) { + $is_staging = true; + } + } + } + + // Last, let's check if sync is erroring due to an IDC. If so, set the site to staging mode. + if ( ! $is_staging && method_exists( 'Automattic\\Jetpack\\Identity_Crisis', 'validate_sync_error_idc_option' ) && \Automattic\Jetpack\Identity_Crisis::validate_sync_error_idc_option() ) { + $is_staging = true; + } + + /** + * Filters is_staging_site check. + * + * @since 1.1.1 + * @since-jetpack 3.9.0 + * + * @param bool $is_staging If the current site is a staging site. + */ + $is_staging = apply_filters( 'jetpack_is_staging_site', $is_staging ); + + Cache::set( 'is_staging_site', $is_staging ); + return $is_staging; + } + + /** + * If the site is in safe mode. + * + * @since 3.3.0 + * + * @return bool + */ + public function in_safe_mode() { + $cached = Cache::get( 'in_safe_mode' ); + if ( null !== $cached ) { + return $cached; + } + $in_safe_mode = false; + if ( method_exists( 'Automattic\\Jetpack\\Identity_Crisis', 'validate_sync_error_idc_option' ) && \Automattic\Jetpack\Identity_Crisis::validate_sync_error_idc_option() ) { + $in_safe_mode = true; + } + /** + * Filters in_safe_mode check. + * + * @since 3.3.0 + * + * @param bool $in_safe_mode If the current site is in safe mode. + */ + $in_safe_mode = apply_filters( 'jetpack_is_in_safe_mode', $in_safe_mode ); + + Cache::set( 'in_safe_mode', $in_safe_mode ); + return $in_safe_mode; + } + + /** + * If the site is a development/staging site. + * This is a new version of is_staging_site added to separate safe mode from the legacy staging mode. + * This method checks for core WP_ENVIRONMENT_TYPE setting + * Using the jetpack_is_development_site filter. + * + * @since 3.3.0 + * + * @return bool + */ + public static function is_development_site() { + $cached = Cache::get( 'is_development_site' ); + if ( null !== $cached ) { + return $cached; + } + $is_dev_site = ! in_array( wp_get_environment_type(), array( 'production', 'local' ), true ); + /** + * Filters is_development_site check. + * + * @since 3.3.0 + * + * @param bool $is_dev_site If the current site is a staging or dev site. + */ + $is_dev_site = apply_filters( 'jetpack_is_development_site', $is_dev_site ); + + Cache::set( 'is_development_site', $is_dev_site ); + return $is_dev_site; + } + + /** + * Whether the site is currently onboarding or not. + * A site is considered as being onboarded if it currently has an onboarding token. + * + * @since-jetpack 5.8 + * + * @deprecated since 4.0.0 + * + * @access public + * @static + * + * @return bool True if the site is currently onboarding, false otherwise + */ + public function is_onboarding() { + return \Jetpack_Options::get_option( 'onboarding' ) !== false; + } + + /** + * Whether the site is currently private or not. + * On WordPress.com and WoA, sites can be marked as private + * + * @since 1.16.0 + * + * @return bool True if the site is private. + */ + public function is_private_site() { + $ret = Cache::get( 'is_private_site' ); + if ( null === $ret ) { + $is_private_site = '-1' === get_option( 'blog_public' ); + + /** + * Filters the is_private_site check. + * + * @since 1.16.1 + * + * @param bool $is_private_site True if the site is private. + */ + $is_private_site = apply_filters( 'jetpack_is_private_site', $is_private_site ); + + Cache::set( 'is_private_site', $is_private_site ); + return $is_private_site; + } + return $ret; + } + + /** + * Whether the site is currently unlaunched or not. + * On WordPress.com and WoA, sites can be marked as "coming soon", aka unlaunched + * + * @since 1.16.0 + * + * @return bool True if the site is not launched. + */ + public function is_coming_soon() { + $ret = Cache::get( 'is_coming_soon' ); + if ( null === $ret ) { + $is_coming_soon = (bool) ( function_exists( 'site_is_coming_soon' ) && \site_is_coming_soon() ) + || get_option( 'wpcom_public_coming_soon' ); + + /** + * Filters the is_coming_soon check. + * + * @since 1.16.1 + * + * @param bool $is_coming_soon True if the site is coming soon (i.e. unlaunched). + */ + $is_coming_soon = apply_filters( 'jetpack_is_coming_soon', $is_coming_soon ); + + Cache::set( 'is_coming_soon', $is_coming_soon ); + return $is_coming_soon; + } + return $ret; + } + + /** + * Returns the site slug suffix to be used as part of Calypso URLs. + * + * Strips http:// or https:// from a url, replaces forward slash with ::. + * + * @since 1.6.0 + * + * @param string $url Optional. URL to build the site suffix from. Default: Home URL. + * + * @return string + */ + public function get_site_suffix( $url = '' ) { + // On WordPress.com, site suffixes are a bit different. + if ( method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { + return WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); + } + + // Grab the 'site_url' option for WoA sites to avoid plugins to interfere with the site + // identifier (e.g. i18n plugins may change the main url to '/', but we + // want to exclude the locale since it's not part of the site suffix). + if ( ( new Host() )->is_woa_site() ) { + $url = \site_url(); + } + + if ( empty( $url ) ) { + // WordPress can be installed in subdirectories (e.g. make.wordpress.org/plugins) + // where the 'site_url' option points to the root domain (e.g. make.wordpress.org) + // which could collide with another site in the same domain but with WordPress + // installed in a different subdirectory (e.g. make.wordpress.org/core). To avoid + // such collision, we identify the site with the 'home_url' option. + $url = \home_url(); + } + + $url = preg_replace( '#^.*?://#', '', $url ); + $url = str_replace( '/', '::', $url ); + + return rtrim( $url, ':' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php new file mode 100644 index 00000000..fae08755 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php @@ -0,0 +1,56 @@ += 7.0. [#34192] + +## [1.60.1] - 2023-10-31 + +## [1.60.0] - 2023-10-26 +### Removed +- Remove Jetpack option jetpack-memberships-connected-account-id. [#32354] + +## [1.59.2] - 2023-10-24 +### Changed +- Update sync version. + +## [1.59.1] - 2023-10-24 +### Added +- Sync: Add missing support for supplying additional columns to do checksum on. [#33440] + +## [1.59.0] - 2023-10-23 +### Changed +- Dedicated Sync: Update 'init' hook priority on Dedicated Sync requests to 0, in order to start sending Sync actions to WPCOM and exit as early as possible. [#33594] + +## [1.58.1] - 2023-10-18 +### Fixed +- Update dependencies. + +## [1.58.0] - 2023-10-16 +### Changed +- Migrated 'jetpack_sync_before_send*' actions for Sync queue to 'jetpack_sync_before_enqueue' instead. [#33384] + +## [1.57.4] - 2023-10-10 + +- Minor internal updates. + +## [1.57.3] - 2023-09-28 +### Removed +- Remove compatibility code for PHP <5.5. [#33288] + +## [1.57.2] - 2023-09-25 +### Added +- Site Settings Endpoint: Allow for updating and retrieving of the wpcom_newsletter_categories site option. [#33234] + +## [1.57.1] - 2023-09-20 +### Added +- Adds legacy contact and locked mode options for 100-year plan [#33081] + +## [1.57.0] - 2023-09-19 +### Added +- Added a definition of a WooCommerce HPOS table to Jetpack Sync. [#32774] +- Jetpack Sync: Drop Sync custom queue table when Jetpack is disconnected [#32940] +- Woo: add HPOS (custom order tables) events to sync module. [#32530] + +## [1.56.0] - 2023-09-04 +### Added +- Add wpcom_newsletter_categories_enabled site option [#32569] +- Whitelist the blog option for auto conversion settings. [#32693] + +## [1.55.2] - 2023-08-28 +### Fixed +- Re-adds the jetpack-memberships-connected-account-id option to whitelist. [#32632] + +## [1.55.1] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [1.55.0] - 2023-08-21 +### Removed +- Remove Jetpack option jetpack-memberships-connected-account-id [#32125] + +## [1.54.0] - 2023-08-15 +### Added +- Extract Sync Queue storage handling to an external class to prepare for Custom Table migration [#32275] + +## [1.53.0] - 2023-08-09 +### Added +- Jetpack Sync: Custom table initialization and migration functionality [#32135] +- Jetpack Sync: Drop custom table on sender uninstall [#32335] + +## [1.52.0] - 2023-08-01 +### Added +- Add support for a custom database table for Sync Queue. [#32111] +- Extract Sync Queue storage handling to an external class to prepare for Custom Table migration. [#32089] +- Sync: Add feature flag for enabling custom queue table. [#31681] + +## [1.51.0] - 2023-07-17 +### Added +- Jetpack & Jetpack Sync: Added cache check when trying to spawn dedicated sync or update JETPACK__VERSION to avoid additional requests to the DB if external cache is available. [#31645] +- Newsletters: Add option to enable subscribe modal. [#31393] +- Sync: Add support for additional guest and note meta fields [#31810] + +## [1.50.2] - 2023-07-05 +### Added +- Sync wpcom_site_setup site option [#31662] + +## [1.50.1] - 2023-07-04 +### Changed +- Revert dedicated hook endpoint to later in the 'init' hook, as it broke existing code that registers post statuses and such during 'init'. [#31685] + +## [1.50.0] - 2023-06-26 +### Added +- Added a new callable to the whitelist for get_loaded_extensions(). [#31333] +- CPT Exclusion: do not sync Jetpack Inspect Log entries. [#31535] + +### Fixed +- Initialize dedicated hook endpoint earlier in the 'init' hook to avoid cookie conflicts. [#31423] + +## [1.49.0] - 2023-05-29 +### Added +- Added `wpcom_reader_views_enabled` option to default sync list [#30800] + +### Changed +- FSE: remove usage of `gutenberg_is_fse_theme` for modern `wp_is_block_theme` [#30806] + +## [1.48.1] - 2023-05-15 +### Changed +- PHP 8 compatibility updates. [#30599] +- PHP 8.1 compatibility updates [#30523] + +## [1.48.0] - 2023-05-08 +### Changed +- Use Jetpack Constants to check the value of REST_API_REQUEST in Settings:is_syncing function so we're able to overwrite the value and render some jetpack blocks via the rest api endpoint [#30400] + +## [1.47.9] - 2023-05-02 +### Changed +- Internal updates. + +## [1.47.8] - 2023-05-01 +### Changed +- Internal updates. + +## [1.47.7] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.47.6] - 2023-04-04 +### Changed +- Sync: Lowered priority to sync so that the hook is run at the end. [#29804] + +## [1.47.5] - 2023-04-03 +### Changed +- Minor internal updates. + +## [1.47.4] - 2023-03-28 +### Changed +- Move brute force protection into WAF package. [#28401] + +## [1.47.3] - 2023-03-20 +### Changed +- Updated package dependencies. [#29480] + +## [1.47.2] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.47.1] - 2023-01-23 +### Added +- Close PHP Session if it's active when running a Dedicated Sync request. [#28515] + +### Fixed +- Jetpack Sync: prevent syncing user update when corresponding flags are not set. [#28385] + +## [1.47.0] - 2023-01-18 +### Removed +- Removed the deprecated option jetpack_blogging_prompts_enabled from defaults [#28387] + +## [1.46.1] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.46.0] - 2022-12-27 +### Added +- Added woocommerce_cod_settings to the options whitelist. [#27988] + +## [1.45.0] - 2022-12-19 +### Added +- Adding new boolean site option of 'wpcom-subscription-emails-use-excerpt'. [#27908] +- Sync Launchpad-related options: `launchpad_screen` and `launchpad_checklist_tasks_statuses`. [#27843] + +### Changed +- Option: Update featured_image_email_enabled option name to wpcom_featured_image_in_email. [#27955] + +### Fixed +- Improve PHP 8.2 compatibility. [#27968] + +## [1.44.2] - 2022-12-06 +### Changed +- Updated package dependencies. + +## [1.44.1] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.44.0] - 2022-11-30 +### Added +- Added full response logging for failed Sync data requests. [#27644] + +### Fixed +- Make sure Dedicated Sync can revert back to Default Sync if it stops sending events for one reason or another. [#27632] + +## [1.43.2] - 2022-11-28 +### Changed +- Sync: Limit next_sync_time lock to be at most 1 hour in the future [#27606] + +## [1.43.1] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.43.0] - 2022-11-17 +### Added +- Added new sync option for launch-status [#27434] +- Jetpack Sync: Add new endpoint for resetting Sync locks. [#27446] + +## [1.42.0] - 2022-11-14 +### Changed +- Save attached media to post meta [#26930] + +## [1.41.0] - 2022-11-07 +### Changed +- Jetpack Sync: add Updates module in required Sync modules. [#27182] +- Updated package dependencies. [#27278] + +## [1.40.3] - 2022-11-01 +### Added +- Adds wpcom_gifting_subscription option for syncing [#27116] + +## [1.40.2] - 2022-10-27 +### Fixed +- Check $action_links is still array after plugin_action_links filter has been applied. [#27076] + +## [1.40.1] - 2022-10-25 +### Added +- Added featured_image_email_enabled option for syncing [#27009] + +### Changed +- Search Sync Settings :: Add Marketplace product extra fields meta to allow list [#26927] +- Updated package dependencies. [#26705] + +## [1.40.0] - 2022-10-17 +### Added +- Adding the `sl-insta-media` post type to the Sync blacklist as the post type data isn't relevant to Sync and takes up non-trivial resources. [#26826] + +## [1.39.0] - 2022-10-11 +### Added +- Added some taxonomies to be indexed by Search. [#26683] + +## [1.38.4] - 2022-09-20 +### Added +- Gutenberg Support: add additional theme_supports items to our synced allowlist. [#26239] + +### Changed +- Default Theme Support: Add support for new feature added in WP 6.1 [#26236] +- Theme Supports: updated allowed values list to align with a Core change r54159-core [#26220] + +## [1.38.3] - 2022-09-08 +### Changed +- Updated package dependencies. + +## [1.38.2] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [1.38.1] - 2022-08-25 +### Changed +- Search Sync Settings :: Add Marketplace related meta fields and taxonomies to allow list [#25376] + +## [1.38.0] - 2022-08-23 +### Added +- Search: add product-brand to taxonomy sync list to support WooCommerce Brands plugin. [#25665] + +### Changed +- Updated package dependencies. [#25628] + +## [1.37.1] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [1.37.0] - 2022-07-26 +### Changed +- Jetpack Sync: Add Sync lock related info in Sync debug details. [#25140] +- Updated package dependencies. [#25158] + +### Fixed +- Dedicated Sync: Enable sending of callables outside of admin context, since Dedicated Sync requests always work outside of admin scope. [#25143] + +## [1.36.1] - 2022-07-06 +### Added +- Add new WordPress core `block-templates` theme feature to `Defaults::$default_theme_support_whitelist` [#24960] + +## [1.36.0] - 2022-06-28 +### Added +- Posts: added a Sync call to make sure post content is up to date before publishing. [#24827] + +### Changed +- Minimum Sync Config: Update required modules and options [#24831] + +### Fixed +- Sync Table Checksums: Table checksum should be enabled depending on corresponding Sync modulee [#24772] + +## [1.35.2] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [1.35.1] - 2022-06-14 +### Added +- Add a request lock to prevent multiple requests being spawned at once [#24734] + +### Changed +- Updated package dependencies. [#24529] + +## [1.35.0] - 2022-05-30 +### Changed +- Sync: Add '_jetpack_blogging_prompt_key' to default post meta whitelist + +## [1.34.0] - 2022-05-24 +### Changed +- Dedicated Sync - Introduce custom endpoint for spawning Sync requests [#24468] +- Sync: Add 'active_modules' to default whitelisted callables. [#24453] + +## [1.33.1] - 2022-05-19 +### Removed +- Removed dedicated sync custom endpoints pending error investigation [#24419] + +## [1.33.0] - 2022-05-18 +### Changed +- Dedicated Sync: Introduce custom endpoint for spawning Sync requests [#24344] + +## [1.32.0] - 2022-05-10 +### Added +- Search: add search options to option whitelist [#24167] + +## [1.31.1] - 2022-05-04 +### Changed +- Updated package dependencies. [#24095] +- WordPress 6.1 Compatibilty [#24083] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [1.31.0] - 2022-04-26 +### Added +- Adds filter to get_themes callable + +### Deprecated +- Removed Heartbeat by hoisting it into Connection. + +## [1.30.8] - 2022-04-19 +### Added +- Added get_themes Callable to sync the list of installed themes on a site +- Added get_themes to Sync defaults + +### Changed +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` +- Updated package dependencies. + +## [1.30.7] - 2022-04-12 +### Added +- Adding new site option to be synced. + +## [1.30.6] - 2022-04-06 +### Changed +- Updated package dependencies. + +### Fixed +- Dedicated Sync: Only try to run the sender once if Dedicated Sync is enabled as it has its own requeueing mechanism. + +## [1.30.5] - 2022-03-29 +### Changed +- Microperformance: Use === null instead of is_null + +## [1.30.4] - 2022-03-23 +### Changed +- Enable syncing of dedicated_sync_enabled Sync setting + +### Fixed +- Dedicated Sync: Allow spawning request with expired Retry-After + +## [1.30.3] - 2022-03-15 +### Changed +- Search Sync Settings :: Add ETB taxonomy to allow list. + +## [1.30.2] - 2022-03-08 +### Changed +- Disallow syncing of _term_meta post_type + +## [1.30.1] - 2022-03-02 +### Added +- Dedicated Sync flow: Allow enabling or disabling via WPCOM response header + +## [1.30.0] - 2022-02-22 +### Added +- Add Sync dedicated request flow. + +### Changed +- Updated package dependencies. + +## [1.29.2] - 2022-02-09 +### Added +- Allow sync package consumers to provide custom data settings. + +### Fixed +- Fixed some new PHPCS warnings. + +## [1.29.1] - 2022-02-02 +### Changed +- Updated package dependencies. + +## [1.29.0] - 2022-01-25 +### Added +- Jetpack Search: update the allowed post meta when search is active to include all indexable meta. + +## [1.28.2] - 2022-01-18 +### Changed +- Updated package dependencies. + +## [1.28.1] - 2022-01-13 +### Changed +- Updated package dependencies. + +## [1.28.0] - 2022-01-04 +### Changed +- Listener: Do not enqueue actions when the site is disconnected +- Switch to pcov for code coverage. +- Theme deletions: rely on Core WP hook now that the package requires WP 5.8. +- Updated package dependencies +- Updated package textdomain from `jetpack` to `jetpack-sync`. + +## [1.27.6] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.27.5] - 2021-11-30 +### Changed +- Updated package dependencies. + +## [1.27.4] - 2021-11-23 +### Changed +- Updated package dependencies. + +## [1.27.3] - 2021-11-16 +### Changed +- Actions: add the do_only_first_initial_sync method which starts an initial sync only when one hasn't already been done + +## [1.27.2] - 2021-11-09 +### Added +- Constants: Now syncing Atomic platform constant + +### Changed +- Full Sync : limit included users to contributors and above (based on wp_user_limit) +- Updated package dependencies. +- User Checksums - limit scope to users with wp_user_level > 0 + +### Fixed +- Fix PHP 8.1 deprecation warnings. + +## [1.27.1] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.27.0] - 2021-10-26 +### Added +- Added the _wpas_feature_enabled meta key to the sync list +- Sync Error Log to capture failed sync requests. + +### Fixed +- Check the return value of get_comment() before to use it. +- Increase send timeout to 20 seconds allowing capture of WP.com 408 responses. + +## [1.26.4] - 2021-10-13 +### Changed +- Sync Checksums: Convert text fields to latin1 before generating checksum. +- Updated package dependencies. + +### Fixed +- Sync Checksums - Update distinct clause to use $wpdb-> table names to accouunt for differences in prefixes. + +## [1.26.3] - 2021-10-12 +### Changed +- Updated package dependencies + +### Removed +- Remove initialization of the identity-crisis package. That will be handled by the Config package. + +### Fixed +- Reduce transient expiration for how often we check the state of the queue. +- Sync Checksums - exclude locale from checksum if same as site setting +- Sync Checksums - use distinct query when calculating count of Term Relationships + +## [1.26.2] - 2021-09-28 +### Added +- Add support for checksumming user-related tabled: wp_users and wp_usermeta + +### Changed +- Update annotations versions. +- Updated package dependencies. + +### Fixed +- Resolve indirect modification notice. +- Sync Checksums: utilize distinct clause in term counts. +- Sync Queue: better handling of serialization issues and empty actions. + +## [1.26.1] - 2021-09-03 +### Fixed +- Add better checks if the WooCommerce tables should be enabled for checksum/fix. +- Prevent PHP notices on queue_pull if all args are not set. + +## [1.26.0] - 2021-08-30 +### Added +- Add support for WooCommerce table to the checksum/fix process. +- Enable support for utf8 conversion during checksum calculation. + +### Changed +- Don't run composer install on regular phpunit script +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +### Fixed +- Sync Checksums - ensure last object is included in histogram + +## [1.25.0] - 2021-08-12 +### Added +- Add package version tracking. +- Add `wpcom_is_fse_activated` to sync list +- Made /sync/object endpoint accessible over POST, not only GET, to allow fetching more items in a single request. + +## [1.24.2] - 2021-08-02 + +- Reverted: Sync option for the Carousel to display colorized slide background. + +## [1.24.1] - 2021-07-29 +### Changed +- Utilize an import for WP_Error in all instances. + +### Fixed +- Fixed unqualified WP_Error use in the Rest_Sender class. + +## [1.24.0] - 2021-07-27 +### Added +- Add a package version constant. +- Add Full Site Editing support to callback options. +- Sync option for the Carousel to display colorized slide background. + +### Fixed +- Update Sender so it adheres to max upload bytes when not encoding items. + +## [1.23.3] - 2021-07-16 +### Fixed +- Update Options module to return jetpack_sync_settings_* values from the Settings class vs direct option lookup. + +## [1.23.2] - 2021-07-13 +### Changed +- Updated package dependencies. + +### Fixed +- Performance of Sync checksums degraded with the update to correlated subquery. This restricts its usage to term_taxonomy joins only." + +## [1.23.1] - 2021-07-01 +### Changed +- Checksum parent_table joins need distinct selection to account for possibility of multiple rows. + +### Fixed +- Update term_taxonomy checksum query to an allowed list vs disallowed + +## [1.23.0] - 2021-06-29 +### Added +- Add jetpack_idc_disonnect action to clear Sync options on disconnect. +- Add support to callables to sync/object endpoint. +- Enable sync/object endpoint support for theme-info. +- Enhance updates module to support get_objects_by_id. +- Expand sync/object to support constants. +- Extend sync/object to support callables. +- Implement v4 REST endpoints. +- Initialize the IDC package in the Sync package. + +### Removed +- Remove product_cat from blocked taxonomies + +## [1.22.0] - 2021-06-15 +### Changed +- Sync: Adding the Identity_Crisis package. +- Updated package dependencies. + +### Deprecated +- Deprecated URL methods in `Automattic\Jetpack\Sync\Functions` in favor of `Automattic\Jetpack\Connection\Urls`. + +## [1.21.3] - 2021-05-25 +### Changed +- Performance: If no Full Sync is in process early return before we update options. + +### Fixed +- Janitorial: avoid PHP notices in some edge-cases +- Update Meta Module so get_object_by_id returns all meta values. + +## [1.21.2] - 2021-04-27 +### Added +- Added the password-checker package the the Sync package composer.json file. + +### Changed +- Updated package dependencies. + +### Fixed +- Sync: removed references to the JETPACK__PLUGIN_DIR constant. +- Sync Checksums : updated postmeta range query performance #19337. + +## [1.21.1] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies +- Implement a 60 second back-off for non-200 respones, if no retry-after header is present in the response. +- Impose a max limit of 2MB on post meta values that are synced. +- Impose a max limit of 5MB on post_content that can be synced. + +### Changed +- Sync: Use the new Password_Checker package instead of Jetpack_Password_Checker. +- Update package dependencies. +- Use the Heartbeat package to generate the stats array + +### Fixed +- Migrate locks to update_option to avaoid memcache inconsistencies that can be introduced by delete_option usage. +- Update Sync Queue so that serialize is wrapped to catch errors + +## [1.21.0] - 2021-02-23 + +- General: update WordPress version requirements to WP 5.6 +- Update Checksums to support blacklisted taxonomies. +- Refactor Jetpack callables into the plugin using existing filter jetpack_sync_callable_whitelist +- Wrap call_user_func in is_callable so that we don't trigger warnings for callables that don't exist. +- Sync: Trigger initial sync on jetpack_site_registered +- Update Comments checksum field to comment_date_gmt. We cannot use comment_content directly due to charset/filters. +- Deprecate jetpack_json_wrap +- Remove Sync's usage of wp_startswith + +## [1.20.2] - 2021-02-08 + +- Update dependencies to latest stable + +## [1.20.1] - 2021-01-28 + +- Update dependencies to latest stable + +## [1.20.0] - 2021-01-26 + +- Sync Concurrency / Race Conditions +- Sync: Prevent an PHP warning +- Jetpack Sync: Checksums: Use a better way to fetch and validate fields against table +- Add mirror-repo information to all current composer packages +- Full Sync :: Reduce Concurrency. +- Monorepo: Reorganize all projects +- Various PHPCS and Cleanup + +## [1.19.4] - 2021-01-18 + +- Update dependencies to latest stable + +## [1.19.3] - 2021-01-18 + +- Full Sync :: Reduce Concurrency. + +## [1.19.2] - 2020-12-21 + +- Update the do_full_sync function to early return if we are in SYNC READ ONLY mode. +- Return an empty array if the specified range is empty. (It was returning the checksum for the WHOLE dataset). + +## [1.19.1] - 2020-12-17 + +## [1.19.0] - 2020-12-17 + +- sync: Improve sync checksum algorithm and endpoints +- wp_get_environment_type as callable. +- Disallow amp_validated_url as it is not site content but instead validation errors for amp mark-up. +- Whitelist (allow) jetpack_sync_settings_* options to be synced +- Re-order Sync default option whitelist (allowlist) + +## [1.18.1] - 2020-11-24 + +- Version packages for release + +## [1.18.0] - 2020-11-24 + +- Migrate jetpack_published_post to wp_after_insert_post hook +- Check value to determine if we should enable sync after an action enqueuement. +- General: update minimum required version to WordPress 5.5 +- Fix remaining phpcs warnings in most of requirelist +- Update access of comment_status_to_approval_value to allow extension. +- Update get_term Replicastore function to handle term_taxonomy_id option +- Update get_terms to utilize ensure_taxonomy so that the Taxonomy is registered. +- Addtion of note on explict return of null instead of false if option not found. +- Alignment of comment_status_to_approval_value function. Addition of post-trashed status and cleanup of cases. +- Alignment with implemenations. Call ensure_taxonomy to ensure Taxonomies have been initialized. +- Call ensure_taxonomy within get_object_terms so that the taxonomy is registered before action is performed. +- Updated PHPCS: Packages and Debugger + +## [1.17.2] - 2020-11-05 + +- Update dependencies to latest stable + +## [1.17.1] - 2020-10-29 + +- Update dependencies to latest stable + +## [1.17.0] - 2020-10-27 + +- WPCOM Block Editor: Update meta key name +- Resolve PHP Warning with array_filter usage in sync of action_links. +- Sync: Seperate theme data ( name, version, slug and uri) from theme support data +- Replaced intval() with (int) as part of issue #17432. +- Replaced strval() with type casting (string) as part of issue #17432. +- Replaced floatval() with type cast (float) as part of issue #17432. +- Make XMLRPC methods available for blog token + +## [1.16.4] - 2020-10-14 + +- Update dependencies to latest stable + +## [1.16.3] - 2020-10-09 + +- Update dependencies to latest stable + +## [1.16.2] - 2020-10-06 + +- Update dependencies to latest stable + +## [1.16.1] - 2020-10-01 + +- Update dependencies to latest stable + +## [1.16.0] - 2020-09-29 + +- Publicize: Allow publishing a post as a Twitter thread. +- props @jmdodd - filter out set_object_terms actions that don't perform any update. Includes unit tests. +- Sort Arrays by keys before generating callable checksums +- Packages: avoid PHPCS warnings +- Adding 'review' to whitelisted comment types +- Disable Sync sending on Backup API Requests +- Sync: stop trying to check for edit_comment capability +- Added options to sync wc whitelist +- Sync: Improve theme support syncing + +## [1.15.1] - 2020-09-09 + +- Update dependencies to latest stable + +## [1.15.0] - 2020-08-26 + +- Sync: add Creative Mail configuration option to synced options +- Extend sync_status endpoint with optional debug_details field +- REST API endpoints: expand management endpoints +- Sync: Fix nonce action string in theme edit sync +- WP 5.5 Compat: Align Jetpack and Core's plugin autoupdates +- use current user token to updateRole request +- Resolve Sync Errors from empty edge case and WP.com returning concurrent_request_error +- Rework Sender to properly return state during do_full_sync + +## [1.14.4] - 2020-08-10 + +- WP 5.5 Compat: Align Jetpack and Core's plugin autoupdates + +## [1.14.3] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.14.2] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.14.1] - 2020-08-10 + +- Resolve Sync Errors from empty edge case and WP.com returning concurrent_request_error + +## [1.14.0] - 2020-07-28 + +- Core Compat: Site Environment +- Unit Tests: fix tests according to changes in Core +- Utilize the blog token vs master user token to send sync actions. + +## [1.13.2] - 2020-07-06 + +- Update dependencies to latest stable + +## [1.13.1] - 2020-07-01 + +- Update dependencies to latest stable + +## [1.13.0] - 2020-06-30 + +- Block Flamingo Plugin post types in Jetpack Sync +- Explicit single execution of do_full_sync from cron +- Update to reference the property defined in the Jetpack Connection Manager class +- PHPCS: Clean up the packages +- WordAds: Add consent support for California Consumer Privacy Act (CCPA) +- Sync: Add additional support for theme_support_whitelist + +## [1.12.4] - 2020-06-02 + +- Revert "Fix `jetpack sync start` CLI command (#16010)" + +## [1.12.3] - 2020-06-01 + +- Update dependencies to latest stable + +## [1.12.2] - 2020-06-01 + +- Fix `jetpack sync start` CLI command + +## [1.12.1] - 2020-05-29 + +- Sync: Add additional support for theme_support_whitelist + +## [1.12.0] - 2020-05-26 + +- Update ReplicaStore to call clean_comment_cache when comments are upserted or a reset is perofrmed. +- Store the list of active plugins that uses connection in an option +- Jetpack Sync :: Alternate non-blocking flow +- Settings - Writing: add a toggle to Carousel so users can hide comment area +- Sender needs to load consistently utilizing logic +- Always delete items from the queue even if the buffer is no longer checked out. +- Update the hook of Sync's Comment module to not send meta actions when the comment_type is not whitelisted. +- Sync Comments apply whitelist to all actions + +## [1.11.0] - 2020-04-28 + +- Correct inline documentation "Array" type +- Filter out blacklisted post_types for deleted_post actions. +- Publicize: Add jetpack_publicize_options +- Blacklisting Post Types from Sync +- Comments: update default comment type +- Jetpack Sync: Split `jetpack_post_meta_batch_delete` in action to be called in chunks of 100 items, compared to all at once. +- Update Sync limits based on analysis of data loss events. + +## [1.10.0] - 2020-03-31 + +- Update dependencies to latest stable + +## [1.9.0] - 2020-03-31 + +- Debugger: Add sync health progress bar +- Add main network WPCOM blog ID to sync functions +- Masterbar: send wpcom user ID to wpcom when attempting to log… +- Sync: a better readme + +## [1.8.0] - 2020-02-25 + +- Minileven: add options back as they still exist on sites +- Sync: add queue size to actions +- Mobile Theme: remove feature + +## [1.7.6] - 2020-02-14 + +- get_sync_status does not properly account for unexpected states. + +## [1.7.5] - 2020-02-14 + +- Empty Helper function for checkin handler +- Sync Health: fix excessive data loss reports +- Initial Sync Health Status Class and Data Loss Handler +- Stop REST API Log entries from being synced + +## [1.7.4+vip] - 2020-02-14 + +- Empty Helper function for checkin handler + +## [1.7.4] - 2020-01-23 + +- Sync Chunk Keys need to be unique + +## [1.7.3] - 2020-01-20 + +- Sync: ensure we run the initial sync on new connections + +## [1.7.2] - 2020-01-17 + +- Sync Package: use Full_Sync_Immediately by default +- Adding new managed WordPress hosts to be identified in class-functions.php. + +## [1.7.1] - 2020-01-14 + +- Packages: Various improvements for wp.com or self-contained consumers + +## [1.7.0] - 2020-01-14 + +- Trying to add deterministic initialization. + +## [1.6.3] - 2020-01-07 + +- Fix git history. + +## [1.6.2] - 2019-12-31 + +- Sync: Remove DEFAULT_SYNC_MODULES legacy map +- Connection: Loose Comparison for Port Number in Signatures + +## [1.6.1] - 2019-12-13 + +- tweak default sync settings + +## [1.6.0] - 2019-12-02 + +- Sync: Full Sync: Send immediately. + +## [1.5.1] - 2019-11-26 + +- Marked the xmlrpc_api_url method as deprecated. + +## [1.5.0] - 2019-11-25 + +- Remove sync settings cache + +## [1.4.0] - 2019-11-19 + +- Full Sync: Don't allow more than one request to enqueue +- Sync: Update Max Int + +## [1.3.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.3.3] - 2019-11-08 + +- Deprecate Jetpack::is_development_mode() in favor of the packaged Status()->is_development_mode() + +## [1.3.2] - 2019-11-01 + +- Full Sync updates to allow full enqueuing of chunks. + +## [1.3.1] - 2019-10-29 + +- PHPCS: Rest of the packages + +## [1.3.0] - 2019-10-29 + +- Sync: Checkout Endpoint: Add `pop` argument 😱 + +## [1.2.1] - 2019-10-28 + +- Sync: Add Settings to enable/disable the sender for a particular queue + +## [1.2.0] - 2019-10-24 + +- Sync: Fix how we enqueue term_relationships on full sync 🏝 +- WP 5.3: Use modern wp_timezone +- Check for last_error when enqueuing IDs + +## [1.1.1] - 2019-10-23 + +- Use spread operator instead of func_get_args + +## [1.1.0] - 2019-10-07 + +- Sync: Ensure a post object is returned +- PHPCS: Sync Functions +- Sync: Bail initial sync if there is an ongoing full sync + +## [1.0.2] - 2019-09-25 + +- Sync: Only allow white listed comment types to be inserted. +- Sync: Move sync_object XML-RPC method from connection to sync +- Sync: do not sync comments made via Action Scheduler +- Docs: Unify usage of @package phpdoc tags + +## [1.0.1] - 2019-09-14 + +## 1.0.0 - 2019-09-14 + +- Packages: Move sync to a classmapped package + +[3.10.0]: https://github.com/Automattic/jetpack-sync/compare/v3.9.1...v3.10.0 +[3.9.1]: https://github.com/Automattic/jetpack-sync/compare/v3.9.0...v3.9.1 +[3.9.0]: https://github.com/Automattic/jetpack-sync/compare/v3.8.1...v3.9.0 +[3.8.1]: https://github.com/Automattic/jetpack-sync/compare/v3.8.0...v3.8.1 +[3.8.0]: https://github.com/Automattic/jetpack-sync/compare/v3.7.1...v3.8.0 +[3.7.1]: https://github.com/Automattic/jetpack-sync/compare/v3.7.0...v3.7.1 +[3.7.0]: https://github.com/Automattic/jetpack-sync/compare/v3.6.0...v3.7.0 +[3.6.0]: https://github.com/Automattic/jetpack-sync/compare/v3.5.1...v3.6.0 +[3.5.1]: https://github.com/Automattic/jetpack-sync/compare/v3.5.0...v3.5.1 +[3.5.0]: https://github.com/Automattic/jetpack-sync/compare/v3.4.1...v3.5.0 +[3.4.1]: https://github.com/Automattic/jetpack-sync/compare/v3.4.0...v3.4.1 +[3.4.0]: https://github.com/Automattic/jetpack-sync/compare/v3.3.1...v3.4.0 +[3.3.1]: https://github.com/Automattic/jetpack-sync/compare/v3.3.0...v3.3.1 +[3.3.0]: https://github.com/Automattic/jetpack-sync/compare/v3.2.1...v3.3.0 +[3.2.1]: https://github.com/Automattic/jetpack-sync/compare/v3.2.0...v3.2.1 +[3.2.0]: https://github.com/Automattic/jetpack-sync/compare/v3.1.4...v3.2.0 +[3.1.4]: https://github.com/Automattic/jetpack-sync/compare/v3.1.3...v3.1.4 +[3.1.3]: https://github.com/Automattic/jetpack-sync/compare/v3.1.2...v3.1.3 +[3.1.2]: https://github.com/Automattic/jetpack-sync/compare/v3.1.1...v3.1.2 +[3.1.1]: https://github.com/Automattic/jetpack-sync/compare/v3.1.0...v3.1.1 +[3.1.0]: https://github.com/Automattic/jetpack-sync/compare/v3.0.2...v3.1.0 +[3.0.2]: https://github.com/Automattic/jetpack-sync/compare/v3.0.1...v3.0.2 +[3.0.1]: https://github.com/Automattic/jetpack-sync/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/Automattic/jetpack-sync/compare/v2.16.6...v3.0.0 +[2.16.6]: https://github.com/Automattic/jetpack-sync/compare/v2.16.5...v2.16.6 +[2.16.5]: https://github.com/Automattic/jetpack-sync/compare/v2.16.4...v2.16.5 +[2.16.4]: https://github.com/Automattic/jetpack-sync/compare/v2.16.3...v2.16.4 +[2.16.3]: https://github.com/Automattic/jetpack-sync/compare/v2.16.2...v2.16.3 +[2.16.2]: https://github.com/Automattic/jetpack-sync/compare/v2.16.1...v2.16.2 +[2.16.1]: https://github.com/Automattic/jetpack-sync/compare/v2.16.0...v2.16.1 +[2.16.0]: https://github.com/Automattic/jetpack-sync/compare/v2.15.1...v2.16.0 +[2.15.1]: https://github.com/Automattic/jetpack-sync/compare/v2.15.0...v2.15.1 +[2.15.0]: https://github.com/Automattic/jetpack-sync/compare/v2.14.0...v2.15.0 +[2.14.0]: https://github.com/Automattic/jetpack-sync/compare/v2.13.1...v2.14.0 +[2.13.1]: https://github.com/Automattic/jetpack-sync/compare/v2.13.0...v2.13.1 +[2.13.0]: https://github.com/Automattic/jetpack-sync/compare/v2.12.0...v2.13.0 +[2.12.0]: https://github.com/Automattic/jetpack-sync/compare/v2.11.1...v2.12.0 +[2.11.1]: https://github.com/Automattic/jetpack-sync/compare/v2.11.0...v2.11.1 +[2.11.0]: https://github.com/Automattic/jetpack-sync/compare/v2.10.5...v2.11.0 +[2.10.5]: https://github.com/Automattic/jetpack-sync/compare/v2.10.4...v2.10.5 +[2.10.4]: https://github.com/Automattic/jetpack-sync/compare/v2.10.3...v2.10.4 +[2.10.3]: https://github.com/Automattic/jetpack-sync/compare/v2.10.2...v2.10.3 +[2.10.2]: https://github.com/Automattic/jetpack-sync/compare/v2.10.1...v2.10.2 +[2.10.1]: https://github.com/Automattic/jetpack-sync/compare/v2.10.0...v2.10.1 +[2.10.0]: https://github.com/Automattic/jetpack-sync/compare/v2.9.0...v2.10.0 +[2.9.0]: https://github.com/Automattic/jetpack-sync/compare/v2.8.1...v2.9.0 +[2.8.1]: https://github.com/Automattic/jetpack-sync/compare/v2.8.0...v2.8.1 +[2.8.0]: https://github.com/Automattic/jetpack-sync/compare/v2.7.0...v2.8.0 +[2.7.0]: https://github.com/Automattic/jetpack-sync/compare/v2.6.1...v2.7.0 +[2.6.1]: https://github.com/Automattic/jetpack-sync/compare/v2.6.0...v2.6.1 +[2.6.0]: https://github.com/Automattic/jetpack-sync/compare/v2.5.1...v2.6.0 +[2.5.1]: https://github.com/Automattic/jetpack-sync/compare/v2.5.0...v2.5.1 +[2.5.0]: https://github.com/Automattic/jetpack-sync/compare/v2.4.2...v2.5.0 +[2.4.2]: https://github.com/Automattic/jetpack-sync/compare/v2.4.1...v2.4.2 +[2.4.1]: https://github.com/Automattic/jetpack-sync/compare/v2.4.0...v2.4.1 +[2.4.0]: https://github.com/Automattic/jetpack-sync/compare/v2.3.0...v2.4.0 +[2.3.0]: https://github.com/Automattic/jetpack-sync/compare/v2.2.1...v2.3.0 +[2.2.1]: https://github.com/Automattic/jetpack-sync/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/Automattic/jetpack-sync/compare/v2.1.2...v2.2.0 +[2.1.2]: https://github.com/Automattic/jetpack-sync/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/Automattic/jetpack-sync/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-sync/compare/v2.0.2...v2.1.0 +[2.0.2]: https://github.com/Automattic/jetpack-sync/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-sync/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-sync/compare/v1.60.1...v2.0.0 +[1.60.1]: https://github.com/Automattic/jetpack-sync/compare/v1.60.0...v1.60.1 +[1.60.0]: https://github.com/Automattic/jetpack-sync/compare/v1.59.2...v1.60.0 +[1.59.2]: https://github.com/Automattic/jetpack-sync/compare/v1.59.1...v1.59.2 +[1.59.1]: https://github.com/Automattic/jetpack-sync/compare/v1.59.0...v1.59.1 +[1.59.0]: https://github.com/Automattic/jetpack-sync/compare/v1.58.1...v1.59.0 +[1.58.1]: https://github.com/Automattic/jetpack-sync/compare/v1.58.0...v1.58.1 +[1.58.0]: https://github.com/Automattic/jetpack-sync/compare/v1.57.4...v1.58.0 +[1.57.4]: https://github.com/Automattic/jetpack-sync/compare/v1.57.3...v1.57.4 +[1.57.3]: https://github.com/Automattic/jetpack-sync/compare/v1.57.2...v1.57.3 +[1.57.2]: https://github.com/Automattic/jetpack-sync/compare/v1.57.1...v1.57.2 +[1.57.1]: https://github.com/Automattic/jetpack-sync/compare/v1.57.0...v1.57.1 +[1.57.0]: https://github.com/Automattic/jetpack-sync/compare/v1.56.0...v1.57.0 +[1.56.0]: https://github.com/Automattic/jetpack-sync/compare/v1.55.2...v1.56.0 +[1.55.2]: https://github.com/Automattic/jetpack-sync/compare/v1.55.1...v1.55.2 +[1.55.1]: https://github.com/Automattic/jetpack-sync/compare/v1.55.0...v1.55.1 +[1.55.0]: https://github.com/Automattic/jetpack-sync/compare/v1.54.0...v1.55.0 +[1.54.0]: https://github.com/Automattic/jetpack-sync/compare/v1.53.0...v1.54.0 +[1.53.0]: https://github.com/Automattic/jetpack-sync/compare/v1.52.0...v1.53.0 +[1.52.0]: https://github.com/Automattic/jetpack-sync/compare/v1.51.0...v1.52.0 +[1.51.0]: https://github.com/Automattic/jetpack-sync/compare/v1.50.2...v1.51.0 +[1.50.2]: https://github.com/Automattic/jetpack-sync/compare/v1.50.1...v1.50.2 +[1.50.1]: https://github.com/Automattic/jetpack-sync/compare/v1.50.0...v1.50.1 +[1.50.0]: https://github.com/Automattic/jetpack-sync/compare/v1.49.0...v1.50.0 +[1.49.0]: https://github.com/Automattic/jetpack-sync/compare/v1.48.1...v1.49.0 +[1.48.1]: https://github.com/Automattic/jetpack-sync/compare/v1.48.0...v1.48.1 +[1.48.0]: https://github.com/Automattic/jetpack-sync/compare/v1.47.9...v1.48.0 +[1.47.9]: https://github.com/Automattic/jetpack-sync/compare/v1.47.8...v1.47.9 +[1.47.8]: https://github.com/Automattic/jetpack-sync/compare/v1.47.7...v1.47.8 +[1.47.7]: https://github.com/Automattic/jetpack-sync/compare/v1.47.6...v1.47.7 +[1.47.6]: https://github.com/Automattic/jetpack-sync/compare/v1.47.5...v1.47.6 +[1.47.5]: https://github.com/Automattic/jetpack-sync/compare/v1.47.4...v1.47.5 +[1.47.4]: https://github.com/Automattic/jetpack-sync/compare/v1.47.3...v1.47.4 +[1.47.3]: https://github.com/Automattic/jetpack-sync/compare/v1.47.2...v1.47.3 +[1.47.2]: https://github.com/Automattic/jetpack-sync/compare/v1.47.1...v1.47.2 +[1.47.1]: https://github.com/Automattic/jetpack-sync/compare/v1.47.0...v1.47.1 +[1.47.0]: https://github.com/Automattic/jetpack-sync/compare/v1.46.1...v1.47.0 +[1.46.1]: https://github.com/Automattic/jetpack-sync/compare/v1.46.0...v1.46.1 +[1.46.0]: https://github.com/Automattic/jetpack-sync/compare/v1.45.0...v1.46.0 +[1.45.0]: https://github.com/Automattic/jetpack-sync/compare/v1.44.2...v1.45.0 +[1.44.2]: https://github.com/Automattic/jetpack-sync/compare/v1.44.1...v1.44.2 +[1.44.1]: https://github.com/Automattic/jetpack-sync/compare/v1.44.0...v1.44.1 +[1.44.0]: https://github.com/Automattic/jetpack-sync/compare/v1.43.2...v1.44.0 +[1.43.2]: https://github.com/Automattic/jetpack-sync/compare/v1.43.1...v1.43.2 +[1.43.1]: https://github.com/Automattic/jetpack-sync/compare/v1.43.0...v1.43.1 +[1.43.0]: https://github.com/Automattic/jetpack-sync/compare/v1.42.0...v1.43.0 +[1.42.0]: https://github.com/Automattic/jetpack-sync/compare/v1.41.0...v1.42.0 +[1.41.0]: https://github.com/Automattic/jetpack-sync/compare/v1.40.3...v1.41.0 +[1.40.3]: https://github.com/Automattic/jetpack-sync/compare/v1.40.2...v1.40.3 +[1.40.2]: https://github.com/Automattic/jetpack-sync/compare/v1.40.1...v1.40.2 +[1.40.1]: https://github.com/Automattic/jetpack-sync/compare/v1.40.0...v1.40.1 +[1.40.0]: https://github.com/Automattic/jetpack-sync/compare/v1.39.0...v1.40.0 +[1.39.0]: https://github.com/Automattic/jetpack-sync/compare/v1.38.4...v1.39.0 +[1.38.4]: https://github.com/Automattic/jetpack-sync/compare/v1.38.3...v1.38.4 +[1.38.3]: https://github.com/Automattic/jetpack-sync/compare/v1.38.2...v1.38.3 +[1.38.2]: https://github.com/Automattic/jetpack-sync/compare/v1.38.1...v1.38.2 +[1.38.1]: https://github.com/Automattic/jetpack-sync/compare/v1.38.0...v1.38.1 +[1.38.0]: https://github.com/Automattic/jetpack-sync/compare/v1.37.1...v1.38.0 +[1.37.1]: https://github.com/Automattic/jetpack-sync/compare/v1.37.0...v1.37.1 +[1.37.0]: https://github.com/Automattic/jetpack-sync/compare/v1.36.1...v1.37.0 +[1.36.1]: https://github.com/Automattic/jetpack-sync/compare/v1.36.0...v1.36.1 +[1.36.0]: https://github.com/Automattic/jetpack-sync/compare/v1.35.2...v1.36.0 +[1.35.2]: https://github.com/Automattic/jetpack-sync/compare/v1.35.1...v1.35.2 +[1.35.1]: https://github.com/Automattic/jetpack-sync/compare/v1.35.0...v1.35.1 +[1.35.0]: https://github.com/Automattic/jetpack-sync/compare/v1.34.0...v1.35.0 +[1.34.0]: https://github.com/Automattic/jetpack-sync/compare/v1.33.1...v1.34.0 +[1.33.1]: https://github.com/Automattic/jetpack-sync/compare/v1.33.0...v1.33.1 +[1.33.0]: https://github.com/Automattic/jetpack-sync/compare/v1.32.0...v1.33.0 +[1.32.0]: https://github.com/Automattic/jetpack-sync/compare/v1.31.1...v1.32.0 +[1.31.1]: https://github.com/Automattic/jetpack-sync/compare/v1.31.0...v1.31.1 +[1.31.0]: https://github.com/Automattic/jetpack-sync/compare/v1.30.8...v1.31.0 +[1.30.8]: https://github.com/Automattic/jetpack-sync/compare/v1.30.7...v1.30.8 +[1.30.7]: https://github.com/Automattic/jetpack-sync/compare/v1.30.6...v1.30.7 +[1.30.6]: https://github.com/Automattic/jetpack-sync/compare/v1.30.5...v1.30.6 +[1.30.5]: https://github.com/Automattic/jetpack-sync/compare/v1.30.4...v1.30.5 +[1.30.4]: https://github.com/Automattic/jetpack-sync/compare/v1.30.3...v1.30.4 +[1.30.3]: https://github.com/Automattic/jetpack-sync/compare/v1.30.2...v1.30.3 +[1.30.2]: https://github.com/Automattic/jetpack-sync/compare/v1.30.1...v1.30.2 +[1.30.1]: https://github.com/Automattic/jetpack-sync/compare/v1.30.0...v1.30.1 +[1.30.0]: https://github.com/Automattic/jetpack-sync/compare/v1.29.2...v1.30.0 +[1.29.2]: https://github.com/Automattic/jetpack-sync/compare/v1.29.1...v1.29.2 +[1.29.1]: https://github.com/Automattic/jetpack-sync/compare/v1.29.0...v1.29.1 +[1.29.0]: https://github.com/Automattic/jetpack-sync/compare/v1.28.2...v1.29.0 +[1.28.2]: https://github.com/Automattic/jetpack-sync/compare/v1.28.1...v1.28.2 +[1.28.1]: https://github.com/Automattic/jetpack-sync/compare/v1.28.0...v1.28.1 +[1.28.0]: https://github.com/Automattic/jetpack-sync/compare/v1.27.6...v1.28.0 +[1.27.6]: https://github.com/Automattic/jetpack-sync/compare/v1.27.5...v1.27.6 +[1.27.5]: https://github.com/Automattic/jetpack-sync/compare/v1.27.4...v1.27.5 +[1.27.4]: https://github.com/Automattic/jetpack-sync/compare/v1.27.3...v1.27.4 +[1.27.3]: https://github.com/Automattic/jetpack-sync/compare/v1.27.2...v1.27.3 +[1.27.2]: https://github.com/Automattic/jetpack-sync/compare/v1.27.1...v1.27.2 +[1.27.1]: https://github.com/Automattic/jetpack-sync/compare/v1.27.0...v1.27.1 +[1.27.0]: https://github.com/Automattic/jetpack-sync/compare/v1.26.4...v1.27.0 +[1.26.4]: https://github.com/Automattic/jetpack-sync/compare/v1.26.3...v1.26.4 +[1.26.3]: https://github.com/Automattic/jetpack-sync/compare/v1.26.2...v1.26.3 +[1.26.2]: https://github.com/Automattic/jetpack-sync/compare/v1.26.1...v1.26.2 +[1.26.1]: https://github.com/Automattic/jetpack-sync/compare/v1.26.0...v1.26.1 +[1.26.0]: https://github.com/Automattic/jetpack-sync/compare/v1.25.0...v1.26.0 +[1.25.0]: https://github.com/Automattic/jetpack-sync/compare/v1.24.2...v1.25.0 +[1.24.2]: https://github.com/Automattic/jetpack-sync/compare/v1.24.1...v1.24.2 +[1.24.1]: https://github.com/Automattic/jetpack-sync/compare/v1.24.0...v1.24.1 +[1.24.0]: https://github.com/Automattic/jetpack-sync/compare/v1.23.3...v1.24.0 +[1.23.3]: https://github.com/Automattic/jetpack-sync/compare/v1.23.2...v1.23.3 +[1.23.2]: https://github.com/Automattic/jetpack-sync/compare/v1.23.1...v1.23.2 +[1.23.1]: https://github.com/Automattic/jetpack-sync/compare/v1.23.0...v1.23.1 +[1.23.0]: https://github.com/Automattic/jetpack-sync/compare/v1.22.0...v1.23.0 +[1.22.0]: https://github.com/Automattic/jetpack-sync/compare/v1.21.3...v1.22.0 +[1.21.3]: https://github.com/Automattic/jetpack-sync/compare/v1.21.2...v1.21.3 +[1.21.2]: https://github.com/Automattic/jetpack-sync/compare/v1.21.1...v1.21.2 +[1.21.1]: https://github.com/Automattic/jetpack-sync/compare/v1.21.0...v1.21.1 +[1.21.0]: https://github.com/Automattic/jetpack-sync/compare/v1.20.2...v1.21.0 +[1.20.2]: https://github.com/Automattic/jetpack-sync/compare/v1.20.1...v1.20.2 +[1.20.1]: https://github.com/Automattic/jetpack-sync/compare/v1.20.0...v1.20.1 +[1.20.0]: https://github.com/Automattic/jetpack-sync/compare/v1.19.4...v1.20.0 +[1.19.4]: https://github.com/Automattic/jetpack-sync/compare/v1.19.3...v1.19.4 +[1.19.3]: https://github.com/Automattic/jetpack-sync/compare/v1.19.2...v1.19.3 +[1.19.2]: https://github.com/Automattic/jetpack-sync/compare/v1.19.1...v1.19.2 +[1.19.1]: https://github.com/Automattic/jetpack-sync/compare/v1.19.0...v1.19.1 +[1.19.0]: https://github.com/Automattic/jetpack-sync/compare/v1.18.1...v1.19.0 +[1.18.1]: https://github.com/Automattic/jetpack-sync/compare/v1.18.0...v1.18.1 +[1.18.0]: https://github.com/Automattic/jetpack-sync/compare/v1.17.2...v1.18.0 +[1.17.2]: https://github.com/Automattic/jetpack-sync/compare/v1.17.1...v1.17.2 +[1.17.1]: https://github.com/Automattic/jetpack-sync/compare/v1.17.0...v1.17.1 +[1.17.0]: https://github.com/Automattic/jetpack-sync/compare/v1.16.4...v1.17.0 +[1.16.4]: https://github.com/Automattic/jetpack-sync/compare/v1.16.3...v1.16.4 +[1.16.3]: https://github.com/Automattic/jetpack-sync/compare/v1.16.2...v1.16.3 +[1.16.2]: https://github.com/Automattic/jetpack-sync/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-sync/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-sync/compare/v1.15.1...v1.16.0 +[1.15.1]: https://github.com/Automattic/jetpack-sync/compare/v1.15.0...v1.15.1 +[1.15.0]: https://github.com/Automattic/jetpack-sync/compare/v1.14.4...v1.15.0 +[1.14.4]: https://github.com/Automattic/jetpack-sync/compare/v1.14.3...v1.14.4 +[1.14.3]: https://github.com/Automattic/jetpack-sync/compare/v1.14.2...v1.14.3 +[1.14.2]: https://github.com/Automattic/jetpack-sync/compare/v1.14.1...v1.14.2 +[1.14.1]: https://github.com/Automattic/jetpack-sync/compare/v1.14.0...v1.14.1 +[1.14.0]: https://github.com/Automattic/jetpack-sync/compare/v1.13.2...v1.14.0 +[1.13.2]: https://github.com/Automattic/jetpack-sync/compare/v1.13.1...v1.13.2 +[1.13.1]: https://github.com/Automattic/jetpack-sync/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-sync/compare/v1.12.4...v1.13.0 +[1.12.4]: https://github.com/Automattic/jetpack-sync/compare/v1.12.3...v1.12.4 +[1.12.3]: https://github.com/Automattic/jetpack-sync/compare/v1.12.2...v1.12.3 +[1.12.2]: https://github.com/Automattic/jetpack-sync/compare/v1.12.1...v1.12.2 +[1.12.1]: https://github.com/Automattic/jetpack-sync/compare/v1.12.0...v1.12.1 +[1.12.0]: https://github.com/Automattic/jetpack-sync/compare/v1.11.0...v1.12.0 +[1.11.0]: https://github.com/Automattic/jetpack-sync/compare/v1.10.0...v1.11.0 +[1.10.0]: https://github.com/Automattic/jetpack-sync/compare/v1.9.0...v1.10.0 +[1.9.0]: https://github.com/Automattic/jetpack-sync/compare/v1.8.0...v1.9.0 +[1.8.0]: https://github.com/Automattic/jetpack-sync/compare/v1.7.6...v1.8.0 +[1.7.6]: https://github.com/Automattic/jetpack-sync/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-sync/compare/v1.7.4+vip...v1.7.5 +[1.7.4+vip]: https://github.com/Automattic/jetpack-sync/compare/v1.7.4...v1.7.4+vip +[1.7.4]: https://github.com/Automattic/jetpack-sync/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-sync/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-sync/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-sync/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-sync/compare/v1.6.3...v1.7.0 +[1.6.3]: https://github.com/Automattic/jetpack-sync/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-sync/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-sync/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-sync/compare/v1.5.1...v1.6.0 +[1.5.1]: https://github.com/Automattic/jetpack-sync/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-sync/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-sync/compare/v1.3.4...v1.4.0 +[1.3.4]: https://github.com/Automattic/jetpack-sync/compare/v1.3.3...v1.3.4 +[1.3.3]: https://github.com/Automattic/jetpack-sync/compare/v1.3.2...v1.3.3 +[1.3.2]: https://github.com/Automattic/jetpack-sync/compare/v1.3.1...v1.3.2 +[1.3.1]: https://github.com/Automattic/jetpack-sync/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-sync/compare/v1.2.1...v1.3.0 +[1.2.1]: https://github.com/Automattic/jetpack-sync/compare/v1.2.0...v1.2.1 +[1.2.0]: https://github.com/Automattic/jetpack-sync/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-sync/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-sync/compare/v1.0.2...v1.1.0 +[1.0.2]: https://github.com/Automattic/jetpack-sync/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-sync/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/composer.json new file mode 100644 index 00000000..257be9f3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/composer.json @@ -0,0 +1,67 @@ +{ + "name": "automattic/jetpack-sync", + "description": "Everything needed to allow syncing to the WP.com infrastructure.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-password-checker": "^0.3.2", + "automattic/jetpack-ip": "^0.2.3", + "automattic/jetpack-roles": "^2.0.3", + "automattic/jetpack-status": "^4.0.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-search": "@dev", + "automattic/jetpack-waf": "@dev", + "automattic/wordbless": "@dev" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-sync", + "textdomain": "jetpack-sync", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-sync/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "3.10.x-dev" + }, + "dependencies": { + "test-only": [ + "packages/search", + "packages/waf" + ] + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php new file mode 100644 index 00000000..f3535cb2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php @@ -0,0 +1,1194 @@ +do_dedicated_sync_and_exit(); + } + } + + /** + * Define JETPACK_SYNC_READ_ONLY constant if not defined. + * This notifies sync to not run in shutdown if it was initialized during init. + * + * @access public + * @static + */ + public static function mark_sync_read_only() { + Constants::set_constant( 'JETPACK_SYNC_READ_ONLY', true ); + } + + /** + * Decides if the sender should run on shutdown for this request. + * + * @access public + * @static + * + * @return bool + */ + public static function should_initialize_sender() { + + // Allow for explicit disable of Sync from request param jetpack_sync_read_only. + if ( isset( $_REQUEST['jetpack_sync_read_only'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification + self::mark_sync_read_only(); + return false; + } + + if ( Constants::is_true( 'DOING_CRON' ) ) { + return self::sync_via_cron_allowed(); + } + + /** + * For now, if dedicated Sync is enabled we will always initialize send, even for GET and unauthenticated requests. + */ + if ( Settings::is_dedicated_sync_enabled() ) { + return true; + } + + if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' === $_SERVER['REQUEST_METHOD'] ) { + return true; + } + + if ( current_user_can( 'manage_options' ) ) { + return true; + } + + if ( is_admin() ) { + return true; + } + + if ( defined( 'PHPUNIT_JETPACK_TESTSUITE' ) ) { + return true; + } + + if ( Constants::get_constant( 'WP_CLI' ) ) { + return true; + } + + return false; + } + + /** + * Decides if the sender should run on shutdown when actions are queued. + * + * @access public + * @static + * + * @param bool $enable Should we initilize sender. + * @return bool + */ + public static function should_initialize_sender_enqueue( $enable ) { + + // If $enabled is false don't modify it, only check cron if enabled. + if ( false === $enable ) { + return $enable; + } + + if ( Constants::is_true( 'DOING_CRON' ) ) { + return self::sync_via_cron_allowed(); + } + + return true; + } + + /** + * Decides if sync should run at all during this request. + * + * @access public + * @static + * + * @return bool + */ + public static function sync_allowed() { + if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { + return false; + } + + if ( defined( 'PHPUNIT_JETPACK_TESTSUITE' ) ) { + return true; + } + + if ( ! Settings::is_sync_enabled() ) { + return false; + } + + if ( ( new Status() )->is_offline_mode() ) { + return false; + } + + $connection = new Jetpack_Connection(); + if ( ! $connection->is_connected() ) { + if ( ! doing_action( 'jetpack_site_registered' ) ) { + return false; + } + } + + // By now, we know the site is connected, so we can return false if in safe mode. + if ( ( new Status() )->in_safe_mode() ) { + return false; + } + + return true; + } + + /** + * Helper function to get details as to why sync is not allowed, if it is not allowed. + * + * @return array + */ + public static function get_debug_details() { + $debug = array(); + $debug['debug_details']['sync_allowed'] = self::sync_allowed(); + $debug['debug_details']['sync_health'] = Health::get_status(); + if ( false === $debug['debug_details']['sync_allowed'] ) { + if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { + $debug['debug_details']['is_wpcom'] = true; + } + if ( defined( 'PHPUNIT_JETPACK_TESTSUITE' ) ) { + $debug['debug_details']['PHPUNIT_JETPACK_TESTSUITE'] = true; + } + if ( ! Settings::is_sync_enabled() ) { + $debug['debug_details']['is_sync_enabled'] = false; + $debug['debug_details']['jetpack_sync_disable'] = Settings::get_setting( 'disable' ); + $debug['debug_details']['jetpack_sync_network_disable'] = Settings::get_setting( 'network_disable' ); + } + if ( ( new Status() )->is_offline_mode() ) { + $debug['debug_details']['is_offline_mode'] = true; + } + if ( ( new Status() )->in_safe_mode() ) { + $debug['debug_details']['in_safe_mode'] = true; + } + $connection = new Jetpack_Connection(); + if ( ! $connection->is_connected() ) { + $debug['debug_details']['active_connection'] = false; + } + } + + // Sync locks. + $debug['debug_details']['dedicated_sync_enabled'] = Settings::is_dedicated_sync_enabled(); + + $queue = self::$sender->get_sync_queue(); + $full_queue = self::$sender->get_full_sync_queue(); + + $debug['debug_details']['sync_locks'] = array( + 'retry_time_sync' => get_option( self::RETRY_AFTER_PREFIX . 'sync' ), + 'retry_time_full_sync' => get_option( self::RETRY_AFTER_PREFIX . 'full_sync' ), + 'next_sync_time_sync' => self::$sender->get_next_sync_time( 'sync' ), + 'next_sync_time_full_sync' => self::$sender->get_next_sync_time( 'full_sync' ), + 'queue_locked_sync' => $queue->is_locked(), + 'queue_locked_full_sync' => $full_queue->is_locked(), + 'dedicated_sync_request_lock' => \Jetpack_Options::get_raw_option( Dedicated_Sender::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ), + 'dedicated_sync_temporary_disable_flag' => get_transient( Dedicated_Sender::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG ), + ); + + // Sync Logs. + $debug['debug_details']['last_succesful_sync'] = get_option( self::LAST_SUCCESS_PREFIX . 'sync', '' ); + $debug['debug_details']['sync_error_log'] = get_option( self::ERROR_LOG_PREFIX . 'sync', '' ); + + return $debug; + } + + /** + * Determines if syncing during a cron job is allowed. + * + * @access public + * @static + * + * @return bool|int + */ + public static function sync_via_cron_allowed() { + return ( Settings::get_setting( 'sync_via_cron' ) ); + } + + /** + * Decides if the given post should be Publicized based on its type. + * + * @access public + * @static + * + * @param bool $should_publicize Publicize status prior to this filter running. + * @param \WP_Post $post The post to test for Publicizability. + * @return bool + */ + public static function prevent_publicize_blacklisted_posts( $should_publicize, $post ) { + if ( in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ) ) { + return false; + } + + return $should_publicize; + } + + /** + * Set an importing flag to `true` in sync settings. + * + * @access public + * @static + */ + public static function set_is_importing_true() { + Settings::set_importing( true ); + } + + /** + * Sends data to WordPress.com via an XMLRPC or a REST API request based on the settings. + * + * @access public + * @static + * + * @param object $data Data relating to a sync action. + * @param string $codec_name The name of the codec that encodes the data. + * @param float $sent_timestamp Current server time so we can compensate for clock differences. + * @param string $queue_id The queue the action belongs to, sync or full_sync. + * @param float $checkout_duration Time spent retrieving queue items from the DB. + * @param float $preprocess_duration Time spent converting queue items into data to send. + * @param int $queue_size The size of the sync queue at the time of processing. + * @param string $buffer_id The ID of the Queue buffer checked out for processing. + * @return mixed|WP_Error The result of the sending request. + */ + public static function send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration, $queue_size = null, $buffer_id = null ) { + + $query_args = array( + + 'sync' => '1', // Add an extra parameter to the URL so we can tell it's a sync action. + 'codec' => $codec_name, + 'timestamp' => $sent_timestamp, + 'queue' => $queue_id, + 'cd' => sprintf( '%.4f', $checkout_duration ), + 'pd' => sprintf( '%.4f', $preprocess_duration ), + 'queue_size' => $queue_size, + 'buffer_id' => $buffer_id, + // TODO this will be extended in the future. Might be good to extract in a separate method to support future entries too. + 'sync_flow_type' => Settings::is_dedicated_sync_enabled() ? 'dedicated' : 'default', + 'storage_type' => Settings::is_custom_queue_table_enabled() ? 'custom' : 'options', + ); + + $query_args['timeout'] = Settings::is_doing_cron() ? 30 : 20; + + if ( 'immediate-send' === $queue_id ) { + $query_args['timeout'] = 30; + } + + /** + * Filters query parameters appended to the Sync request URL sent to WordPress.com. + * + * @since 1.6.3 + * @since-jetpack 4.7.0 + * + * @param array $query_args associative array of query parameters. + */ + $query_args = apply_filters( 'jetpack_sync_send_data_query_args', $query_args ); + + $retry_after_header = false; + $dedicated_sync_header = false; + + // If REST API is enabled, use it. + if ( Settings::is_wpcom_rest_api_enabled() ) { + $jsonl_data = self::prepare_jsonl_data( $data ); + $url = '/sites/' . \Jetpack_Options::get_option( 'id' ) . '/jetpack-sync-actions'; + $url = add_query_arg( $query_args, $url ); + $args = array( + 'method' => 'POST', + 'format' => 'jsonl', + 'timeout' => $query_args['timeout'], + ); + + $response = Client::wpcom_json_api_request_as_blog( $url, '2', $args, $jsonl_data, 'wpcom' ); + $retry_after_header = wp_remote_retrieve_header( $response, 'Retry-After' ) ? wp_remote_retrieve_header( $response, 'Retry-After' ) : false; + $dedicated_sync_header = wp_remote_retrieve_header( $response, 'Jetpack-Dedicated-Sync' ) ? wp_remote_retrieve_header( $response, 'Jetpack-Dedicated-Sync' ) : false; + $response = self::process_rest_api_response( $response ); + } else { // Use XML-RPC. + $connection = new Jetpack_Connection(); + $url = add_query_arg( $query_args, $connection->xmlrpc_api_url() ); + + // If we're currently updating to Jetpack 7.7, the IXR client may be missing briefly + // because since 7.7 it's being autoloaded with Composer. + if ( ! class_exists( '\\Jetpack_IXR_Client' ) ) { + return new WP_Error( + 'ixr_client_missing', + esc_html__( 'Sync has been aborted because the IXR client is missing.', 'jetpack-sync' ) + ); + } + + $rpc = new \Jetpack_IXR_Client( + array( + 'url' => $url, + 'timeout' => $query_args['timeout'], + ) + ); + $result = $rpc->query( 'jetpack.syncActions', $data ); + $retry_after_header = $rpc->get_response_header( 'Retry-After' ); + $dedicated_sync_header = $rpc->get_response_header( 'Jetpack-Dedicated-Sync' ); + if ( $result ) { + $response = $rpc->getResponse(); + } else { + $response = $rpc->get_jetpack_error(); + } + } + + // Adhere to Retry-After headers. + if ( false !== $retry_after_header ) { + if ( (int) $retry_after_header > 0 ) { + update_option( self::RETRY_AFTER_PREFIX . $queue_id, microtime( true ) + (int) $retry_after_header, false ); + } else { + // if unexpected value default to 3 minutes. + update_option( self::RETRY_AFTER_PREFIX . $queue_id, microtime( true ) + 180, false ); + } + } + + // Enable/Disable Dedicated Sync flow via response headers. + if ( false !== $dedicated_sync_header ) { + Dedicated_Sender::maybe_change_dedicated_sync_status_from_wpcom_header( $dedicated_sync_header ); + } + + if ( is_wp_error( $response ) ) { + $error = $response; + if ( false === $retry_after_header ) { + // We received a non standard response from WP.com, lets backoff from sending requests for 1 minute. + update_option( self::RETRY_AFTER_PREFIX . $queue_id, microtime( true ) + 60, false ); + } + // Record Sync Errors. + $error_log = get_option( self::ERROR_LOG_PREFIX . $queue_id, array() ); + if ( ! is_array( $error_log ) ) { + $error_log = array(); + } + // Trim existing array to last 4 entries. + if ( 5 <= count( $error_log ) ) { + $error_log = array_slice( $error_log, -4, null, true ); + } + // Add new error indexed to time. + if ( isset( $rpc ) && ! empty( $rpc->get_last_response() ) ) { + $error_with_last_response = clone $error; + $error_with_last_response->add_data( $rpc->get_last_response() ); + $error_log[ (string) microtime( true ) ] = $error_with_last_response; + } else { + $error_log[ (string) microtime( true ) ] = $error; + } + + // Update the error log. + update_option( self::ERROR_LOG_PREFIX . $queue_id, $error_log ); + return $error; + } + + // Check if WordPress.com IDC mitigation blocked the sync request. + if ( Identity_Crisis::init()->check_response_for_idc( $response ) ) { + return new WP_Error( + 'sync_error_idc', + esc_html__( 'Sync has been blocked from WordPress.com because it would cause an identity crisis', 'jetpack-sync' ) + ); + } + + if ( isset( $response['processed_items'] ) ) { // Return only processed items. + $response = $response['processed_items']; + } + + // Record last successful sync. + update_option( self::LAST_SUCCESS_PREFIX . $queue_id, microtime( true ), false ); + + return $response; + } + + /** + * Kicks off the initial sync. + * + * @access public + * @static + * + * @return bool|null False if sync is not allowed. + */ + public static function do_initial_sync() { + // Let's not sync if we are not supposed to. + if ( ! self::sync_allowed() ) { + return false; + } + + // Don't start new sync if a full sync is in process. + $full_sync_module = Modules::get_module( 'full-sync' ); + '@phan-var Modules\Full_Sync_Immediately|Modules\Full_Sync $full_sync_module'; + if ( $full_sync_module && $full_sync_module->is_started() && ! $full_sync_module->is_finished() ) { + return false; + } + + $initial_sync_config = array( + 'options' => true, + 'functions' => true, + 'constants' => true, + 'users' => array( get_current_user_id() ), + 'network_options' => true, + ); + + self::do_full_sync( $initial_sync_config ); + } + + /** + * Do an initial full sync only if one has not already been started. + * + * @return bool|null False if the initial full sync was already started, otherwise null. + */ + public static function do_only_first_initial_sync() { + $full_sync_module = Modules::get_module( 'full-sync' ); + '@phan-var Modules\Full_Sync_Immediately|Modules\Full_Sync $full_sync_module'; + if ( $full_sync_module && $full_sync_module->is_started() ) { + return false; + } + + static::do_initial_sync(); + } + + /** + * Kicks off a full sync. + * + * @access public + * @static + * + * @param array $modules The sync modules should be included in this full sync. All will be included if null. + * @return bool True if full sync was successfully started. + */ + public static function do_full_sync( $modules = null ) { + if ( ! self::sync_allowed() ) { + return false; + } + + $full_sync_module = Modules::get_module( 'full-sync' ); + '@phan-var Modules\Full_Sync_Immediately|Modules\Full_Sync $full_sync_module'; + + if ( ! $full_sync_module ) { + return false; + } + + self::initialize_listener(); + + $full_sync_module->start( $modules ); + + return true; + } + + /** + * Adds a cron schedule for regular syncing via cron, unless the schedule already exists. + * + * @access public + * @static + * + * @param array $schedules The list of WordPress cron schedules prior to this filter. + * @return array A list of WordPress cron schedules with the Jetpack sync interval added. + */ + public static function jetpack_cron_schedule( $schedules ) { + if ( ! isset( $schedules[ self::DEFAULT_SYNC_CRON_INTERVAL_NAME ] ) ) { + $minutes = (int) ( self::DEFAULT_SYNC_CRON_INTERVAL_VALUE / 60 ); + $display = ( 1 === $minutes ) ? + __( 'Every minute', 'jetpack-sync' ) : + /* translators: %d is an integer indicating the number of minutes. */ + sprintf( __( 'Every %d minutes', 'jetpack-sync' ), $minutes ); + $schedules[ self::DEFAULT_SYNC_CRON_INTERVAL_NAME ] = array( + 'interval' => self::DEFAULT_SYNC_CRON_INTERVAL_VALUE, + 'display' => $display, + ); + } + return $schedules; + } + + /** + * Starts an incremental sync via cron. + * + * @access public + * @static + */ + public static function do_cron_sync() { + self::do_cron_sync_by_type( 'sync' ); + } + + /** + * Starts a full sync via cron. + * + * @access public + * @static + */ + public static function do_cron_full_sync() { + self::do_cron_sync_by_type( 'full_sync' ); + } + + /** + * Try to send actions until we run out of things to send, + * or have to wait more than 15s before sending again, + * or we hit a lock or some other sending issue + * + * @access public + * @static + * + * @param string $type Sync type. Can be `sync` or `full_sync`. + */ + public static function do_cron_sync_by_type( $type ) { + if ( ! self::sync_allowed() || ( 'sync' !== $type && 'full_sync' !== $type ) ) { + return; + } + + self::initialize_sender(); + + $time_limit = Settings::get_setting( 'cron_sync_time_limit' ); + $start_time = time(); + $executions = 0; + + do { + $next_sync_time = self::$sender->get_next_sync_time( $type ); + + if ( $next_sync_time ) { + $delay = $next_sync_time - time() + 1; + if ( $delay > 15 ) { + break; + } elseif ( $delay > 0 ) { + sleep( $delay ); + } + } + + // Explicitly only allow 1 do_full_sync call until issue with Immediate Full Sync is resolved. + // For more context see p1HpG7-9pe-p2. + if ( 'full_sync' === $type && $executions >= 1 ) { + break; + } + + /** + * Only try to sync once if Dedicated Sync is enabled. Dedicated Sync has its own requeueing mechanism + * that will re-run it if there are items in the queue at the end. + */ + if ( 'sync' === $type && $executions >= 1 && Settings::is_dedicated_sync_enabled() ) { + break; + } + + $result = 'full_sync' === $type ? self::$sender->do_full_sync() : self::$sender->do_sync(); + + // # of send actions performed. + ++$executions; + + } while ( $result && ! is_wp_error( $result ) && ( $start_time + $time_limit ) > time() ); + + return $executions; + } + + /** + * Initialize the sync listener. + * + * @access public + * @static + */ + public static function initialize_listener() { + self::$listener = Listener::get_instance(); + } + + /** + * Initializes the sync sender. + * + * @access public + * @static + */ + public static function initialize_sender() { + self::$sender = Sender::get_instance(); + add_filter( 'jetpack_sync_send_data', array( __CLASS__, 'send_data' ), 10, 8 ); + } + + /** + * Initializes sync for WooCommerce. + * + * @access public + * @static + */ + public static function initialize_woocommerce() { + if ( false === class_exists( 'WooCommerce' ) ) { + return; + } + add_filter( 'jetpack_sync_modules', array( __CLASS__, 'add_woocommerce_sync_module' ) ); + + if ( ! class_exists( CustomOrdersTableController::class ) ) { + return; + } + $cot_controller = wc_get_container()->get( CustomOrdersTableController::class ); + if ( $cot_controller->custom_orders_table_usage_is_enabled() ) { + add_filter( 'jetpack_sync_modules', array( __CLASS__, 'add_woocommerce_hpos_order_sync_module' ) ); + } + } + + /** + * Initializes sync for Instant Search. + * + * @access public + * @static + */ + public static function initialize_search() { + if ( false === class_exists( 'Automattic\\Jetpack\\Search\\Module_Control' ) ) { + return; + } + $search_module = new \Automattic\Jetpack\Search\Module_Control(); + if ( $search_module->is_instant_search_enabled() ) { + add_filter( 'jetpack_sync_modules', array( __CLASS__, 'add_search_sync_module' ) ); + } + } + + /** + * Add Search updates to Sync Filters. + * + * @access public + * @static + * + * @param array $sync_modules The list of sync modules declared prior to this filter. + * @return array A list of sync modules that now includes Search's modules. + */ + public static function add_search_sync_module( $sync_modules ) { + $sync_modules[] = 'Automattic\\Jetpack\\Sync\\Modules\\Search'; + return $sync_modules; + } + + /** + * Adds Woo's sync modules to existing modules for sending. + * + * @access public + * @static + * + * @param array $sync_modules The list of sync modules declared prior to this filter. + * @return array A list of sync modules that now includes Woo's modules. + */ + public static function add_woocommerce_sync_module( $sync_modules ) { + $sync_modules[] = 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce'; + return $sync_modules; + } + + /** + * Adds Woo's HPOS sync modules to existing modules for sending. + * + * @param array $sync_modules The list of sync modules declared prior to this filter. + * + * @access public + * @static + * + * @return array A list of sync modules that now includes Woo's HPOS modules. + */ + public static function add_woocommerce_hpos_order_sync_module( $sync_modules ) { + $sync_modules[] = WooCommerce_HPOS_Orders::class; + return $sync_modules; + } + + /** + * Initializes sync for WP Super Cache. + * + * @access public + * @static + */ + public static function initialize_wp_super_cache() { + if ( false === function_exists( 'wp_cache_is_enabled' ) ) { + return; + } + add_filter( 'jetpack_sync_modules', array( __CLASS__, 'add_wp_super_cache_sync_module' ) ); + } + + /** + * Adds WP Super Cache's sync modules to existing modules for sending. + * + * @access public + * @static + * + * @param array $sync_modules The list of sync modules declared prior to this filer. + * @return array A list of sync modules that now includes WP Super Cache's modules. + */ + public static function add_wp_super_cache_sync_module( $sync_modules ) { + $sync_modules[] = 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache'; + return $sync_modules; + } + + /** + * Sanitizes the name of sync's cron schedule. + * + * @access public + * @static + * + * @param string $schedule The name of a WordPress cron schedule. + * @return string The sanitized name of sync's cron schedule. + */ + public static function sanitize_filtered_sync_cron_schedule( $schedule ) { + $schedule = sanitize_key( $schedule ); + $schedules = wp_get_schedules(); + + // Make sure that the schedule has actually been registered using the `cron_intervals` filter. + if ( isset( $schedules[ $schedule ] ) ) { + return $schedule; + } + + return self::DEFAULT_SYNC_CRON_INTERVAL_NAME; + } + + /** + * Allows offsetting of start times for sync cron jobs. + * + * @access public + * @static + * + * @param string $schedule The name of a cron schedule. + * @param string $hook The hook that this method is responding to. + * @return int The offset for the sync cron schedule. + */ + public static function get_start_time_offset( $schedule = '', $hook = '' ) { + $start_time_offset = is_multisite() + ? wp_rand( 0, ( 2 * self::DEFAULT_SYNC_CRON_INTERVAL_VALUE ) ) + : 0; + + /** + * Allows overriding the offset that the sync cron jobs will first run. This can be useful when scheduling + * cron jobs across multiple sites in a network. + * + * @since 1.6.3 + * @since-jetpack 4.5.0 + * + * @param int $start_time_offset + * @param string $hook + * @param string $schedule + */ + return (int) apply_filters( + 'jetpack_sync_cron_start_time_offset', + $start_time_offset, + $hook, + $schedule + ); + } + + /** + * Decides if a sync cron should be scheduled. + * + * @access public + * @static + * + * @param string $schedule The name of a cron schedule. + * @param string $hook The hook that this method is responding to. + */ + public static function maybe_schedule_sync_cron( $schedule, $hook ) { + if ( ! $hook ) { + return; + } + $schedule = self::sanitize_filtered_sync_cron_schedule( $schedule ); + + $start_time = time() + self::get_start_time_offset( $schedule, $hook ); + if ( ! wp_next_scheduled( $hook ) ) { + // Schedule a job to send pending queue items once a minute. + wp_schedule_event( $start_time, $schedule, $hook ); + } elseif ( wp_get_schedule( $hook ) !== $schedule ) { + // If the schedule has changed, update the schedule. + wp_clear_scheduled_hook( $hook ); + wp_schedule_event( $start_time, $schedule, $hook ); + } + } + + /** + * Clears Jetpack sync cron jobs. + * + * @access public + * @static + */ + public static function clear_sync_cron_jobs() { + wp_clear_scheduled_hook( 'jetpack_sync_cron' ); + wp_clear_scheduled_hook( 'jetpack_sync_full_cron' ); + } + + /** + * Initializes Jetpack sync cron jobs. + * + * @access public + * @static + */ + public static function init_sync_cron_jobs() { + add_filter( 'cron_schedules', array( __CLASS__, 'jetpack_cron_schedule' ) ); // phpcs:ignore WordPress.WP.CronInterval.ChangeDetected + + add_action( 'jetpack_sync_cron', array( __CLASS__, 'do_cron_sync' ) ); + add_action( 'jetpack_sync_full_cron', array( __CLASS__, 'do_cron_full_sync' ) ); + + /** + * Allows overriding of the default incremental sync cron schedule which defaults to once every 5 minutes. + * + * @since 1.6.3 + * @since-jetpack 4.3.2 + * + * @param string self::DEFAULT_SYNC_CRON_INTERVAL_NAME + */ + $incremental_sync_cron_schedule = apply_filters( 'jetpack_sync_incremental_sync_interval', self::DEFAULT_SYNC_CRON_INTERVAL_NAME ); + self::maybe_schedule_sync_cron( $incremental_sync_cron_schedule, 'jetpack_sync_cron' ); + + /** + * Allows overriding of the full sync cron schedule which defaults to once every 5 minutes. + * + * @since 1.6.3 + * @since-jetpack 4.3.2 + * + * @param string self::DEFAULT_SYNC_CRON_INTERVAL_NAME + */ + $full_sync_cron_schedule = apply_filters( 'jetpack_sync_full_sync_interval', self::DEFAULT_SYNC_CRON_INTERVAL_NAME ); + self::maybe_schedule_sync_cron( $full_sync_cron_schedule, 'jetpack_sync_full_cron' ); + } + + /** + * Perform maintenance when a plugin upgrade occurs. + * + * @access public + * @static + * + * @param string $new_version New version of the plugin. + * @param string $old_version Old version of the plugin. + */ + public static function cleanup_on_upgrade( $new_version = '', $old_version = '' ) { + if ( wp_next_scheduled( 'jetpack_sync_send_db_checksum' ) ) { + wp_clear_scheduled_hook( 'jetpack_sync_send_db_checksum' ); + } + + $is_new_sync_upgrade = version_compare( $old_version, '4.2', '>=' ); + if ( ! empty( $old_version ) && $is_new_sync_upgrade && version_compare( $old_version, '4.5', '<' ) ) { + self::clear_sync_cron_jobs(); + Settings::update_settings( + array( + 'render_filtered_content' => Defaults::$default_render_filtered_content, + ) + ); + } + + Health::on_jetpack_upgraded(); + } + + /** + * Get syncing status for the given fields. + * + * @access public + * @static + * + * @param string|null $fields A comma-separated string of the fields to include in the array from the JSON response. + * @return array An associative array with the status report. + */ + public static function get_sync_status( $fields = null ) { + self::initialize_sender(); + + $sync_module = Modules::get_module( 'full-sync' ); + '@phan-var Modules\Full_Sync_Immediately|Modules\Full_Sync $sync_module'; + $queue = self::$sender->get_sync_queue(); + + // _get_cron_array can be false + $cron_timestamps = ( _get_cron_array() ) ? array_keys( _get_cron_array() ) : array(); + $next_cron = ( ! empty( $cron_timestamps ) ) ? $cron_timestamps[0] - time() : ''; + + $checksums = array(); + $debug = array(); + + if ( ! empty( $fields ) ) { + $store = new Replicastore(); + $fields_params = array_map( 'trim', explode( ',', $fields ) ); + + if ( in_array( 'posts_checksum', $fields_params, true ) ) { + $checksums['posts_checksum'] = $store->posts_checksum(); + } + if ( in_array( 'comments_checksum', $fields_params, true ) ) { + $checksums['comments_checksum'] = $store->comments_checksum(); + } + if ( in_array( 'post_meta_checksum', $fields_params, true ) ) { + $checksums['post_meta_checksum'] = $store->post_meta_checksum(); + } + if ( in_array( 'comment_meta_checksum', $fields_params, true ) ) { + $checksums['comment_meta_checksum'] = $store->comment_meta_checksum(); + } + + if ( in_array( 'debug_details', $fields_params, true ) ) { + $debug = self::get_debug_details(); + } + } + + $full_sync_status = ( $sync_module ) ? $sync_module->get_status() : array(); + + $full_queue = self::$sender->get_full_sync_queue(); + + $result = array_merge( + $full_sync_status, + $checksums, + $debug, + array( + 'cron_size' => count( $cron_timestamps ), + 'next_cron' => $next_cron, + 'queue_size' => $queue->size(), + 'queue_lag' => $queue->lag(), + 'queue_next_sync' => ( self::$sender->get_next_sync_time( 'sync' ) - microtime( true ) ), + 'full_queue_next_sync' => ( self::$sender->get_next_sync_time( 'full_sync' ) - microtime( true ) ), + ) + ); + + // Verify $sync_module is not false. + if ( $sync_module && ! $sync_module instanceof Modules\Full_Sync_Immediately ) { + $result['full_queue_size'] = $full_queue->size(); + $result['full_queue_lag'] = $full_queue->lag(); + } + return $result; + } + + /** + * Reset Sync locks. + * + * @access public + * @static + * @since 1.43.0 + * + * @param bool $unlock_queues Whether to unlock Sync queues. Defaults to true. + */ + public static function reset_sync_locks( $unlock_queues = true ) { + // Next sync locks. + delete_option( Sender::NEXT_SYNC_TIME_OPTION_NAME . '_sync' ); + delete_option( Sender::NEXT_SYNC_TIME_OPTION_NAME . '_full_sync' ); + delete_option( Sender::NEXT_SYNC_TIME_OPTION_NAME . '_full-sync-enqueue' ); + // Retry after locks. + delete_option( self::RETRY_AFTER_PREFIX . 'sync' ); + delete_option( self::RETRY_AFTER_PREFIX . 'full_sync' ); + // Dedicated sync locks. + \Jetpack_Options::delete_raw_option( Dedicated_Sender::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME ); + delete_transient( Dedicated_Sender::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG ); + // Lock for disabling Sync sending temporarily. + delete_transient( Sender::TEMP_SYNC_DISABLE_TRANSIENT_NAME ); + + // Queue locks. + // Note that we are just unlocking the queues here, not reseting them. + if ( $unlock_queues ) { + $sync_queue = new Queue( 'sync' ); + $sync_queue->unlock(); + + $full_sync_queue = new Queue( 'full_sync' ); + $full_sync_queue->unlock(); + } + } + + /** + * Prepare JSONL data. + * + * @param mixed $data The data to be prepared. + * + * @return string The prepared JSONL data. + */ + private static function prepare_jsonl_data( $data ) { + $jsonl_data = implode( + "\n", + array_map( + function ( $key, $value ) { + return wp_json_encode( array( $key => $value ) ); + }, + array_keys( (array) $data ), + array_values( (array) $data ) + ) + ); + return $jsonl_data; + } + + /** + * Helper method to process the API response. + * + * @param mixed $response The response from the API. + * @return array|Wp_Error Array for successful response or a WP_Error object. + */ + private static function process_rest_api_response( $response ) { + + $response_code = wp_remote_retrieve_response_code( $response ); + $response_body = wp_remote_retrieve_body( $response ); + if ( is_wp_error( $response ) ) { + return $response; + } + $decoded_response = json_decode( $response_body, true ); + + if ( false === is_array( $decoded_response ) ) { + return new WP_Error( 'sync_rest_api_response_decoding_failed', 'Sync REST API response decoding failed', $response_body ); + } + + if ( $response_code !== 200 || false === isset( $decoded_response['processed_items'] ) ) { + if ( is_array( $decoded_response ) && isset( $decoded_response['code'] ) && isset( $decoded_response['message'] ) ) { + return new WP_Error( + 'jetpack_sync_send_error_' . $decoded_response['code'], + $decoded_response['message'], + $decoded_response['data'] ?? null + ); + } else { + return new WP_Error( $response_code, 'Sync REST API request failed', $response_body ); + } + } else { + return $decoded_response; + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php new file mode 100644 index 00000000..9fb90681 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php @@ -0,0 +1,421 @@ + array( + 'Automattic\\Jetpack\\Sync\\Modules\\Callables', + 'Automattic\\Jetpack\\Sync\\Modules\\Constants', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately', // enable Initial Sync on Site Connection. + 'Automattic\\Jetpack\\Sync\\Modules\\Options', + 'Automattic\\Jetpack\\Sync\\Modules\\Updates', + 'Automattic\\Jetpack\\Sync\\Modules\\Stats', // Daily heartbeat data. + ), + 'jetpack_sync_callable_whitelist' => array( + 'site_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'site_url' ), + 'home_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'home_url' ), + 'get_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), + 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), + 'jetpack_connection_active_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_jetpack_connection_active_plugins' ), + 'paused_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_plugins' ), + 'paused_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_themes' ), + 'timezone' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_timezone' ), + 'wp_get_environment_type' => 'wp_get_environment_type', + 'wp_max_upload_size' => 'wp_max_upload_size', + 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), + ), + 'jetpack_sync_constants_whitelist' => array( + 'ABSPATH', + 'ALTERNATE_WP_CRON', + 'ATOMIC_CLIENT_ID', + 'AUTOMATIC_UPDATER_DISABLED', + 'DISABLE_WP_CRON', + 'DISALLOW_FILE_EDIT', + 'DISALLOW_FILE_MODS', + 'EMPTY_TRASH_DAYS', + 'FS_METHOD', + 'IS_PRESSABLE', + 'PHP_VERSION', + 'WP_ACCESSIBLE_HOSTS', + 'WP_AUTO_UPDATE_CORE', + 'WP_CONTENT_DIR', + 'WP_CRON_LOCK_TIMEOUT', + 'WP_DEBUG', + 'WP_HTTP_BLOCK_EXTERNAL', + 'WP_MAX_MEMORY_LIMIT', + 'WP_MEMORY_LIMIT', + 'WP_POST_REVISIONS', + ), + 'jetpack_sync_options_whitelist' => array( + /** + * Sync related options + */ + 'jetpack_sync_non_blocking', + 'jetpack_sync_non_public_post_stati', + 'jetpack_sync_settings_comment_meta_whitelist', + 'jetpack_sync_settings_post_meta_whitelist', + 'jetpack_sync_settings_post_types_blacklist', + 'jetpack_sync_settings_taxonomies_blacklist', + 'jetpack_sync_settings_dedicated_sync_enabled', + 'jetpack_sync_settings_custom_queue_table_enabled', + 'jetpack_sync_settings_wpcom_rest_api_enabled', + /** + * Connection related options + */ + 'jetpack_package_versions', + /** + * Generic site options + */ + 'blog_charset', + 'blog_public', + 'blogdescription', + 'blogname', + 'permalink_structure', + 'stylesheet', + 'time_format', + 'timezone_string', + 'active_plugins', + ), + ); + + const MODULE_FILTER_MAPPING = array( + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => array( + 'jetpack_sync_options_whitelist', + 'jetpack_sync_options_contentless', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => array( + 'jetpack_sync_constants_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => array( + 'jetpack_sync_callable_whitelist', + 'jetpack_sync_multisite_callable_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => array( + 'jetpack_sync_post_meta_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => array( + 'jetpack_sync_comment_meta_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => array( + 'jetpack_sync_capabilities_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => array( + 'jetpack_sync_known_importers', + ), + ); + + const MODULES_FILTER_NAME = 'jetpack_sync_modules'; + + /** + * The static data settings array which contains the aggregated data settings for + * each sync filter. + * + * @var array + */ + private static $data_settings = array(); + + /** + * The static array which contains the list of filter hooks that have already been set up. + * + * @var array + */ + private static $set_filter_hooks = array(); + + /** + * Adds the data settings provided by a plugin to the Sync data settings. + * + * @param array $plugin_settings The array provided by the plugin. The array must use filters + * from the DATA_FILTER_DEFAULTS list as keys. + */ + public function add_settings_list( $plugin_settings = array() ) { + if ( empty( $plugin_settings ) || ! is_array( $plugin_settings ) ) { + /* + * No custom plugin settings, so use defaults for everything and bail early. + */ + $this->set_all_defaults(); + return; + } + + $this->add_filters_custom_settings_and_hooks( $plugin_settings ); + + if ( ! did_action( 'jetpack_sync_add_required_data_settings' ) ) { + $this->add_required_settings(); + /** + * Fires when the required settings have been adding to the static + * data_settings array. + * + * @since 1.29.2 + * + * @module sync + */ + do_action( 'jetpack_sync_add_required_data_settings' ); + } + } + + /** + * Sets the default values for sync modules and all sync data filters. + */ + private function set_all_defaults() { + $this->add_sync_filter_setting( self::MODULES_FILTER_NAME, Modules::DEFAULT_SYNC_MODULES ); + + foreach ( array_keys( Default_Filter_Settings::DATA_FILTER_DEFAULTS ) as $filter ) { + $this->add_sync_filter_setting( $filter, $this->get_default_setting_for_filter( $filter ) ); + } + } + + /** + * Returns the default settings for the given filter. + * + * @param string $filter The filter name. + * + * @return array The filter's default settings array. + */ + private function get_default_setting_for_filter( $filter ) { + if ( self::MODULES_FILTER_NAME === $filter ) { + return Modules::DEFAULT_SYNC_MODULES; + } + + return ( new Default_Filter_Settings() )->get_default_settings( $filter ); + } + + /** + * Adds the custom settings and sets up the necessary filter hooks. + * + * @param array $filters_settings The custom settings. + */ + private function add_filters_custom_settings_and_hooks( $filters_settings ) { + if ( isset( $filters_settings[ self::MODULES_FILTER_NAME ] ) && is_array( $filters_settings[ self::MODULES_FILTER_NAME ] ) ) { + $this->add_custom_filter_setting( self::MODULES_FILTER_NAME, $filters_settings[ self::MODULES_FILTER_NAME ] ); + $enabled_modules = $filters_settings[ self::MODULES_FILTER_NAME ]; + } else { + $this->add_sync_filter_setting( self::MODULES_FILTER_NAME, Modules::DEFAULT_SYNC_MODULES ); + $enabled_modules = Modules::DEFAULT_SYNC_MODULES; + } + + $all_modules = Modules::DEFAULT_SYNC_MODULES; + + foreach ( $all_modules as $module ) { + if ( in_array( $module, $enabled_modules, true ) || in_array( $module, self::MUST_SYNC_DATA_SETTINGS['jetpack_sync_modules'], true ) ) { + $this->add_filters_for_enabled_module( $module, $filters_settings ); + } else { + $this->add_filters_for_disabled_module( $module ); + } + } + } + + /** + * Adds the filters for the provided enabled module. If the settings provided custom filter settings + * for the module's filters, those are used. Otherwise, the filter's default settings are used. + * + * @param string $module The module name. + * @param array $filters_settings The settings for the filters. + */ + private function add_filters_for_enabled_module( $module, $filters_settings ) { + $module_mapping = self::MODULE_FILTER_MAPPING; + $filters_for_module = isset( $module_mapping[ $module ] ) ? $module_mapping[ $module ] : array(); + + foreach ( $filters_for_module as $filter ) { + if ( isset( $filters_settings[ $filter ] ) ) { + $this->add_custom_filter_setting( $filter, $filters_settings[ $filter ] ); + } else { + $this->add_sync_filter_setting( $filter, $this->get_default_setting_for_filter( $filter ) ); + } + } + } + + /** + * Adds the filters for the provided disabled module. The disabled module's associated filter settings are + * set to an empty array. + * + * @param string $module The module name. + */ + private function add_filters_for_disabled_module( $module ) { + $module_mapping = self::MODULE_FILTER_MAPPING; + $filters_for_module = isset( $module_mapping[ $module ] ) ? $module_mapping[ $module ] : array(); + + foreach ( $filters_for_module as $filter ) { + $this->add_custom_filter_setting( $filter, array() ); + } + } + + /** + * Adds the provided custom setting for a filter. If the filter setting isn't valid, the default + * value is used. + * + * If the filter's hook hasn't already been set up, it gets set up. + * + * @param string $filter The filter. + * @param array $setting The filter setting. + */ + private function add_custom_filter_setting( $filter, $setting ) { + if ( ! $this->is_valid_filter_setting( $filter, $setting ) ) { + /* + * The provided setting isn't valid, so use the default for this filter. + * We're using the default values so there's no need to set the filter hook. + */ + $this->add_sync_filter_setting( $filter, $this->get_default_setting_for_filter( $filter ) ); + return; + } + + if ( ! isset( static::$set_filter_hooks[ $filter ] ) ) { + // First time a custom modules setting is provided, so set the filter hook. + add_filter( $filter, array( $this, 'sync_data_filter_hook' ) ); + static::$set_filter_hooks[ $filter ] = 1; + } + + $this->add_sync_filter_setting( $filter, $setting ); + } + + /** + * Determines whether the filter setting is valid. The setting array is in the correct format (associative or indexed). + * + * @param string $filter The filter to check. + * @param array $filter_settings The filter settings. + * + * @return bool Whether the filter settings can be used. + */ + private function is_valid_filter_setting( $filter, $filter_settings ) { + if ( ! is_array( $filter_settings ) ) { + // The settings for each filter must be an array. + return false; + } + + if ( empty( $filter_settings ) ) { + // Empty settings are allowed. + return true; + } + + $indexed_array = isset( $filter_settings[0] ); + if ( in_array( $filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) && ! $indexed_array ) { + return true; + } elseif ( ! in_array( $filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) && $indexed_array ) { + return true; + } + + return false; + } + + /** + * Adds the data settings that are always required for every plugin that uses Sync. + */ + private function add_required_settings() { + foreach ( self::MUST_SYNC_DATA_SETTINGS as $filter => $setting ) { + // If the corresponding setting is already set and matches the default one, no need to proceed. + if ( isset( static::$data_settings[ $filter ] ) && static::$data_settings[ $filter ] === $this->get_default_setting_for_filter( $filter ) ) { + continue; + } + $this->add_custom_filter_setting( $filter, $setting ); + } + } + + /** + * Adds the provided data setting for the provided filter. + * + * @param string $filter The filter name. + * @param array $value The data setting. + */ + private function add_sync_filter_setting( $filter, $value ) { + if ( ! isset( static::$data_settings[ $filter ] ) ) { + static::$data_settings[ $filter ] = $value; + return; + } + + if ( in_array( $filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) ) { + $this->add_associative_filter_setting( $filter, $value ); + } else { + $this->add_indexed_filter_setting( $filter, $value ); + } + } + + /** + * Adds the provided data setting for the provided filter. This method handles + * adding settings to data that is stored as an associative array. + * + * @param string $filter The filter name. + * @param array $settings The data settings. + */ + private function add_associative_filter_setting( $filter, $settings ) { + foreach ( $settings as $key => $item ) { + if ( ! array_key_exists( $key, static::$data_settings[ $filter ] ) ) { + static::$data_settings[ $filter ][ $key ] = $item; + } + } + } + + /** + * Adds the provided data setting for the provided filter. This method handles + * adding settings to data that is stored as an indexed array. + * + * @param string $filter The filter name. + * @param array $settings The data settings. + */ + private function add_indexed_filter_setting( $filter, $settings ) { + static::$data_settings[ $filter ] = array_unique( + array_merge( + static::$data_settings[ $filter ], + $settings + ) + ); + } + + /** + * The callback function added to the sync data filters. Combines the list in the $data_settings property + * with any non-default values from the received array. + * + * @param array $filtered_values The data revieved from the filter. + * + * @return array The data settings for the filter. + */ + public function sync_data_filter_hook( $filtered_values ) { + if ( ! is_array( $filtered_values ) ) { + // Something is wrong with the input, so set it to an empty array. + $filtered_values = array(); + } + + $current_filter = current_filter(); + + if ( ! isset( static::$data_settings[ $current_filter ] ) ) { + return $filtered_values; + } + + if ( in_array( $current_filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) ) { + $extra_filters = array_diff_key( $filtered_values, $this->get_default_setting_for_filter( $current_filter ) ); + $this->add_associative_filter_setting( $current_filter, $extra_filters ); + return static::$data_settings[ $current_filter ]; + } + + $extra_filters = array_diff( $filtered_values, $this->get_default_setting_for_filter( $current_filter ) ); + $this->add_indexed_filter_setting( $current_filter, $extra_filters ); + return static::$data_settings[ $current_filter ]; + } + + /** + * Sets the $data_settings property to an empty array. This is useful for testing. + */ + public function empty_data_settings_and_hooks() { + static::$data_settings = array(); + static::$set_filter_hooks = array(); + } + + /** + * Returns the $data_settings property. + * + * @return array The data_settings property. + */ + public function get_data_settings() { + return static::$data_settings; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php new file mode 100644 index 00000000..02cf7739 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php @@ -0,0 +1,408 @@ +is_locked() ) { + return new WP_Error( 'locked_queue_' . $queue->id ); + } + + if ( $queue->size() === 0 ) { + return new WP_Error( 'empty_queue_' . $queue->id ); + } + + // Return early if we've gotten a retry-after header response that is not expired. + $retry_time = get_option( Actions::RETRY_AFTER_PREFIX . $queue->id ); + if ( $retry_time && $retry_time >= microtime( true ) ) { + return new WP_Error( 'retry_after_' . $queue->id ); + } + + // Don't sync if we are throttled. + $sync_next_time = Sender::get_instance()->get_next_sync_time( $queue->id ); + if ( $sync_next_time > microtime( true ) ) { + return new WP_Error( 'sync_throttled_' . $queue->id ); + } + /** + * How much time to wait before we start suspecting Dedicated Sync is in trouble. + */ + $queue_send_time_threshold = 30 * MINUTE_IN_SECONDS; + + $queue_lag = $queue->lag(); + + /** + * Try to acquire a request lock, so we don't spawn multiple requests at the same time. + * This should prevent cases where sites might have limits on the amount of simultaneous requests. + */ + $request_lock = self::try_lock_spawn_request(); + if ( ! $request_lock ) { + return new WP_Error( 'dedicated_request_lock', 'Unable to acquire request lock' ); + } + + /** + * If the queue lag is bigger than the threshold, we want to check if Dedicated Sync is working correctly. + * We will do by sending a test request and disabling Dedicated Sync if it's not working. We will also exit early + * in case we send the test request since it is a blocking request. + */ + if ( $queue_lag > $queue_send_time_threshold ) { + if ( false === get_transient( self::DEDICATED_SYNC_CHECK_TRANSIENT ) ) { + if ( ! self::can_spawn_dedicated_sync_request() ) { + self::on_dedicated_sync_lag_not_sending_threshold_reached(); + return new WP_Error( 'dedicated_sync_not_sending', 'Dedicated Sync is not successfully sending events' ); + } + return true; + } + } + + $url = rest_url( 'jetpack/v4/sync/spawn-sync' ); + $url = add_query_arg( 'time', time(), $url ); // Enforce Cache busting. + $url = add_query_arg( self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME, $request_lock, $url ); + + $args = array( + 'cookies' => $_COOKIE, + 'blocking' => false, + 'timeout' => 0.01, + /** This filter is documented in wp-includes/class-wp-http-streams.php */ + 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), + ); + + $result = wp_remote_get( $url, $args ); + if ( is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Attempt to acquire a request lock. + * + * To avoid spawning multiple requests at the same time, we need to have a quick lock that will + * allow only a single request to continue if we try to spawn multiple at the same time. + * + * @return false|mixed|string + */ + public static function try_lock_spawn_request() { + $current_microtime = (string) microtime( true ); + + if ( wp_using_ext_object_cache() ) { + if ( true !== wp_cache_add( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, $current_microtime, 'jetpack', self::DEDICATED_SYNC_REQUEST_LOCK_TIMEOUT ) ) { + // Cache lock has been claimed already. + return false; + } + } + + $current_lock_value = \Jetpack_Options::get_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ); + + if ( ! empty( $current_lock_value ) ) { + // Check if time has passed to overwrite the lock - min 5s? + if ( is_numeric( $current_lock_value ) && ( ( $current_microtime - $current_lock_value ) < self::DEDICATED_SYNC_REQUEST_LOCK_TIMEOUT ) ) { + // Still in previous lock, quit + return false; + } + + // If the value is not numeric (float/current time), we want to just overwrite it and continue. + } + + // Update. We don't want it to autoload, as we want to fetch it right before the checks. + \Jetpack_Options::update_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, $current_microtime, false ); + // Give some time for the update to happen + usleep( wp_rand( 1000, 3000 ) ); + + $updated_value = \Jetpack_Options::get_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ); + + if ( $updated_value === $current_microtime ) { + return $current_microtime; + } + + return false; + } + + /** + * Attempt to release the request lock. + * + * @param string $lock_id The request lock that's currently being held. + * + * @return bool|WP_Error + */ + public static function try_release_lock_spawn_request( $lock_id = '' ) { + // Try to get the lock_id from the current request if it's not supplied. + if ( empty( $lock_id ) ) { + $lock_id = self::get_request_lock_id_from_request(); + } + + // If it's still not a valid lock_id, throw an error and let the lock process figure it out. + if ( empty( $lock_id ) || ! is_numeric( $lock_id ) ) { + return new WP_Error( 'dedicated_request_lock_invalid', 'Invalid lock_id supplied for unlock' ); + } + + if ( wp_using_ext_object_cache() ) { + if ( (string) $lock_id === wp_cache_get( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, 'jetpack', true ) ) { + wp_cache_delete( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, 'jetpack' ); + } + } + + // If this is the flow that has the lock, let's release it so we can spawn other requests afterwards + $current_lock_value = \Jetpack_Options::get_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ); + if ( (string) $lock_id === $current_lock_value ) { + \Jetpack_Options::delete_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME ); + return true; + } + + return false; + } + + /** + * Try to get the request lock id from the current request. + * + * @return array|string|string[]|null + */ + public static function get_request_lock_id_from_request() { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET[ self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME ] ) || ! is_numeric( $_GET[ self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME ] ) ) { + return null; + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + return wp_unslash( $_GET[ self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME ] ); + } + + /** + * Test Sync spawning functionality by making a request to the + * Sync spawning endpoint and storing the result (status code) in a transient. + * + * @since 1.34.0 + * + * @return bool True if we got a successful response, false otherwise. + */ + public static function can_spawn_dedicated_sync_request() { + $dedicated_sync_check_transient = self::DEDICATED_SYNC_CHECK_TRANSIENT; + + $dedicated_sync_response_body = get_transient( $dedicated_sync_check_transient ); + + if ( false === $dedicated_sync_response_body ) { + $url = rest_url( 'jetpack/v4/sync/spawn-sync' ); + $url = add_query_arg( 'time', time(), $url ); // Enforce Cache busting. + $args = array( + 'cookies' => $_COOKIE, + 'timeout' => 30, + /** This filter is documented in wp-includes/class-wp-http-streams.php */ + 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), + ); + + $response = wp_remote_get( $url, $args ); + $dedicated_sync_response_code = wp_remote_retrieve_response_code( $response ); + $dedicated_sync_response_body = trim( wp_remote_retrieve_body( $response ) ); + + /** + * Limit the size of the body that we save in the transient to avoid cases where an error + * occurs and a whole generated HTML page is returned. We don't need to store the whole thing. + * + * The regexp check is done to make sure we can detect the string even if the body returns some additional + * output, like some caching plugins do when they try to pad the request. + */ + $regexp = '!' . preg_quote( self::DEDICATED_SYNC_VALIDATION_STRING, '!' ) . '!uis'; + if ( preg_match( $regexp, $dedicated_sync_response_body ) ) { + $saved_response_body = self::DEDICATED_SYNC_VALIDATION_STRING; + } else { + $saved_response_body = time(); + } + + set_transient( $dedicated_sync_check_transient, $saved_response_body, HOUR_IN_SECONDS ); + + // Send a bit more information to WordPress.com to help debugging issues. + if ( $saved_response_body !== self::DEDICATED_SYNC_VALIDATION_STRING ) { + $data = array( + 'timestamp' => microtime( true ), + 'response_code' => $dedicated_sync_response_code, + 'response_body' => $dedicated_sync_response_body, + + // Send the flow type that was attempted. + 'sync_flow_type' => 'dedicated', + ); + + $sender = Sender::get_instance(); + + $sender->send_action( 'jetpack_sync_flow_error_enable', $data ); + } + } + return self::DEDICATED_SYNC_VALIDATION_STRING === $dedicated_sync_response_body; + } + + /** + * Disable dedicated sync and set a transient to prevent re-enabling it for some time. + * + * @return void + */ + public static function on_dedicated_sync_lag_not_sending_threshold_reached() { + set_transient( self::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG, true, 6 * HOUR_IN_SECONDS ); + + Settings::update_settings( + array( + 'dedicated_sync_enabled' => 0, + ) + ); + + // Inform that we had to temporarily disable Dedicated Sync + $data = array( + 'timestamp' => microtime( true ), + + // Send the flow type that was attempted. + 'sync_flow_type' => 'dedicated', + ); + + $sender = Sender::get_instance(); + + $sender->send_action( 'jetpack_sync_flow_error_temp_disable', $data ); + } + + /** + * Disable or enable Dedicated Sync sender based on the header value returned from WordPress.com + * + * @param string $dedicated_sync_header The Dedicated Sync header value - `on` or `off`. + * + * @return bool Whether Dedicated Sync is going to be enabled or not. + */ + public static function maybe_change_dedicated_sync_status_from_wpcom_header( $dedicated_sync_header ) { + $dedicated_sync_enabled = 'on' === $dedicated_sync_header ? 1 : 0; + + // Prevent enabling of Dedicated sync via header flag if we're in an autoheal timeout. + if ( $dedicated_sync_enabled ) { + $check_transient = get_transient( self::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG ); + + if ( $check_transient ) { + // Something happened and Dedicated Sync should not be automatically re-enabled. + return false; + } + } + + Settings::update_settings( + array( + 'dedicated_sync_enabled' => $dedicated_sync_enabled, + ) + ); + + return Settings::is_dedicated_sync_enabled(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php new file mode 100644 index 00000000..81946fe8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php @@ -0,0 +1,80 @@ + 'default_options_whitelist', + 'jetpack_sync_options_contentless' => 'default_options_contentless', + 'jetpack_sync_constants_whitelist' => 'default_constants_whitelist', + 'jetpack_sync_callable_whitelist' => 'default_callable_whitelist', + 'jetpack_sync_multisite_callable_whitelist' => 'default_multisite_callable_whitelist', + 'jetpack_sync_post_meta_whitelist' => 'post_meta_whitelist', + 'jetpack_sync_comment_meta_whitelist' => 'comment_meta_whitelist', + 'jetpack_sync_capabilities_whitelist' => 'default_capabilities_whitelist', + 'jetpack_sync_known_importers' => 'default_known_importers', + ); + + /** + * The data associated with these filters are stored as associative arrays. + * (All other filters store data as indexed arrays.) + */ + const ASSOCIATIVE_FILTERS = array( + 'jetpack_sync_callable_whitelist', + 'jetpack_sync_multisite_callable_whitelist', + 'jetpack_sync_known_importers', + ); + + /** + * Returns the default data settings list for the provided filter. + * + * @param string $filter The filter name. + * + * @return array|false The default list of data settings. Returns false if the provided + * filter doesn't not have an array of default settings. + */ + public function get_default_settings( $filter ) { + if ( ! is_string( $filter ) || ! array_key_exists( $filter, self::DATA_FILTER_DEFAULTS ) ) { + return false; + } + + $property = self::DATA_FILTER_DEFAULTS[ $filter ]; + $class = self::DEFAULT_FILTER_CLASS; + return $class::$$property; + } + + /** + * Returns an array containing the default values for all of the filters shown + * in DATA_FILTER_DEFAULTS. + * + * @return array The array containing all sync data filters and their default values. + */ + public function get_all_filters_default_settings() { + $defaults = array(); + + foreach ( self::DATA_FILTER_DEFAULTS as $filter => $default_location ) { + $defaults[ $filter ] = $this->get_default_settings( $filter ); + } + return $defaults; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php new file mode 100644 index 00000000..56c97597 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php @@ -0,0 +1,1354 @@ + array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_loaded_extensions' ), + 'get_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), + 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), + 'get_plugins_action_links' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins_action_links' ), + 'has_file_system_write_access' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'file_system_write_access' ), + 'home_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'home_url' ), + 'hosting_provider' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_hosting_provider' ), + 'is_fse_theme' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_is_fse_theme' ), + 'is_main_network' => array( __CLASS__, 'is_multi_network' ), + 'is_multi_site' => 'is_multisite', + 'is_version_controlled' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'is_version_controlled' ), + 'locale' => 'get_locale', + 'main_network_site' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'main_network_site_url' ), + 'main_network_site_wpcom_id' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'main_network_site_wpcom_id' ), + 'paused_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_plugins' ), + 'paused_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_themes' ), + 'post_type_features' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_type_features' ), + 'post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_types' ), + 'rest_api_allowed_post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_post_types' ), + 'rest_api_allowed_public_metadata' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_public_metadata' ), + 'roles' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'roles' ), + 'shortcodes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_shortcodes' ), + 'site_icon_url' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'site_icon_url' ), + 'site_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'site_url' ), + 'taxonomies' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_taxonomies' ), + 'theme_support' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_theme_support' ), + 'timezone' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_timezone' ), + 'wp_get_environment_type' => 'wp_get_environment_type', + 'wp_max_upload_size' => 'wp_max_upload_size', + 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), + 'active_modules' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_active_modules' ), + 'jetpack_connection_active_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_jetpack_connection_active_plugins' ), + 'jetpack_sync_active_modules' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_jetpack_sync_active_modules' ), + ); + + /** + * Array of post type attributes synced. + * + * @var array Default post type attributes. + */ + public static $default_post_type_attributes = array( + '_builtin' => false, + '_edit_link' => 'post.php?post=%d', + 'can_export' => true, + 'cap' => array(), + 'capabilities' => array(), + 'capability_type' => 'post', + 'delete_with_user' => null, + 'description' => '', + 'exclude_from_search' => true, + 'has_archive' => false, + 'hierarchical' => false, + 'label' => '', + 'labels' => array(), + 'map_meta_cap' => true, + 'menu_icon' => null, + 'menu_position' => null, + 'name' => '', + 'public' => false, + 'publicly_queryable' => null, + 'query_var' => true, + 'rest_base' => false, + 'rewrite' => true, + 'show_in_admin_bar' => false, + 'show_in_menu' => null, + 'show_in_nav_menus' => null, + 'show_in_rest' => false, + 'show_ui' => false, + 'supports' => array(), + 'taxonomies' => array(), + ); + + /** + * Get the whitelist of callables allowed to be managed via the JSON API. + * + * @return array Whitelist of callables allowed to be managed via the JSON API. + */ + public static function get_callable_whitelist() { + /** + * Filter the list of callables that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 4.8.0 + * + * @param array The default list of callables. + */ + return apply_filters( 'jetpack_sync_callable_whitelist', self::$default_callable_whitelist ); + } + + /** + * Post types that will not be synced. + * + * These are usually automated post types (sitemaps, logs, etc). + * + * @var array Blacklisted post types. + */ + public static $blacklisted_post_types = array( + '_term_meta', + 'ai1ec_event', + 'ai_log', // Logger - https://github.com/alleyinteractive/logger. + 'amp_validated_url', // AMP Validation Errors. + 'bwg_album', + 'bwg_gallery', + 'customize_changeset', // WP built-in post type for Customizer changesets. + 'dn_wp_yt_log', + 'flamingo_contact', // https://wordpress.org/plugins/flamingo/. + 'flamingo_inbound', + 'flamingo_outbound', + 'http', + 'idx_page', + 'jetpack_inspect_log', // Jetpack Inspect dev tool. p1HpG7-nkd-p2 + 'jetpack_migration', + 'jp_img_sitemap', + 'jp_img_sitemap_index', + 'jp_sitemap', + 'jp_sitemap_index', + 'jp_sitemap_master', + 'jp_vid_sitemap', + 'jp_vid_sitemap_index', + 'msm_sitemap', // Metro Sitemap Plugin. + 'postman_sent_mail', + 'rssap-feed', + 'rssmi_feed_item', + 'scheduled-action', // Action Scheduler - Job Queue for WordPress https://github.com/woocommerce/woocommerce/tree/e7762627c37ec1f7590e6cac4218ba0c6a20024d/includes/libraries/action-scheduler . + 'secupress_log_action', + 'sg_optimizer_jobs', + 'sl-insta-media', + 'snitch', + 'vip-legacy-redirect', + 'wp-rest-api-log', // https://wordpress.org/plugins/wp-rest-api-log/. + 'wp_automatic', + 'wp_log', // WP Logging Plugin. + 'wpephpcompat_jobs', + 'wprss_feed_item', + 'memberships_coupon', + 'memberships_gift', + ); + + /** + * Taxonomies that we're not syncing by default. + * + * The list is compiled by auditing the dynamic filters and actions that contain taxonomy slugs + * and could conflict with other existing filters/actions in WP core, Jetpack and WooCommerce. + * + * @var array + */ + public static $blacklisted_taxonomies = array( + 'ancestors', + 'archives_link', + 'attached_file', + 'attached_media', + 'attached_media_args', + 'attachment', + 'available_languages', + 'avatar', + 'avatar_comment_types', + 'avatar_data', + 'avatar_url', + 'bloginfo_rss', + 'blogs_of_user', + 'bookmark_link', + 'bookmarks', + 'calendar', + 'canonical_url', + 'categories_per_page', + 'categories_taxonomy', + 'category_form', + 'category_form_fields', + 'category_form_pre', + 'comment', + 'comment_ID', + 'comment_author', + 'comment_author_IP', + 'comment_author_email', + 'comment_author_link', + 'comment_author_url', + 'comment_author_url_link', + 'comment_date', + 'comment_excerpt', + 'comment_link', + 'comment_misc_actions', + 'comment_text', + 'comment_time', + 'comment_type', + 'comments_link', + 'comments_number', + 'comments_pagenum_link', + 'custom_logo', + 'date_sql', + 'default_comment_status', + 'delete_post_link', + 'edit_bookmark_link', + 'edit_comment_link', + 'edit_post_link', + 'edit_tag_link', + 'edit_term_link', + 'edit_user_link', + 'enclosed', + 'feed_build_date', + 'form_advanced', + 'form_after_editor', + 'form_after_title', + 'form_before_permalink', + 'form_top', + 'handle_product_cat', + 'header_image_tag', + 'header_video_url', + 'image_tag', + 'image_tag_class', + 'lastpostdate', + 'lastpostmodified', + 'link', + 'link_category_form', + 'link_category_form_fields', + 'link_category_form_pre', + 'main_network_id', + 'media', + 'media_item_args', + 'ms_user', + 'network', + 'object_terms', + 'option', + 'page', + 'page_form', + 'page_of_comment', + 'page_uri', + 'pagenum_link', + 'pages', + 'plugin', + 'post', + 'post_galleries', + 'post_gallery', + 'post_link', + 'post_modified_time', + 'post_status', + 'post_time', + 'postmeta', + 'posts_per_page', + 'product_search_form', + 'profile_url', + 'pung', + 'role_list', + 'sample_permalink', + 'sample_permalink_html', + 'schedule', + 'search_form', + 'search_query', + 'shortlink', + 'site', + 'site_email_content', + 'site_icon_url', + 'site_option', + 'space_allowed', + 'tag', + 'tag_form', + 'tag_form_fields', + 'tag_form_pre', + 'tag_link', + 'tags', + 'tags_per_page', + 'term', + 'term_link', + 'term_relationships', + 'term_taxonomies', + 'term_taxonomy', + 'terms', + 'terms_args', + 'terms_defaults', + 'terms_fields', + 'terms_orderby', + 'the_archive_description', + 'the_archive_title', + 'the_categories', + 'the_date', + 'the_excerpt', + 'the_guid', + 'the_modified_date', + 'the_modified_time', + 'the_post_type_description', + 'the_tags', + 'the_terms', + 'the_time', + 'theme_starter_content', + 'to_ping', + 'user', + 'user_created_user', + 'user_form', + 'user_profile', + 'user_profile_update', + 'usermeta', + 'usernumposts', + 'users_drafts', + 'webhook', + 'widget', + 'woocommerce_archive', + 'wp_title_rss', + ); + + /** + * Default array of post table columns. + * + * @var array Post table columns. + */ + public static $default_post_checksum_columns = array( + 'ID', + 'post_modified', + ); + + /** + * Default array of post meta table columns. + * + * @var array Post meta table columns. + */ + public static $default_post_meta_checksum_columns = array( + 'meta_id', + 'meta_value', + ); + + /** + * Default array of comment table columns. + * + * @var array Default comment table columns. + */ + public static $default_comment_checksum_columns = array( + 'comment_ID', + 'comment_content', + ); + + /** + * Default array of comment meta columns. + * + * @var array Comment meta table columns. + */ + public static $default_comment_meta_checksum_columns = array( + 'meta_id', + 'meta_value', + ); + + /** + * Default array of option table columns. + * + * @var array Default array of option columns. + */ + public static $default_option_checksum_columns = array( + 'option_name', + 'option_value', + ); + + /** + * Default array of term columns. + * + * @var array array of term columns. + */ + public static $default_term_checksum_columns = array( + 'name', + 'slug', + 'term_id', + ); + + /** + * Default array of term taxonomy columns. + * + * @var array Array of term taxonomy columns. + */ + public static $default_term_taxonomy_checksum_columns = array( + 'count', + 'parent', + 'taxonomy', + 'term_id', + 'term_taxonomy_id', + ); + + /** + * Default term relationship columns. + * + * @var array Array of term relationship columns. + */ + public static $default_term_relationships_checksum_columns = array( + 'object_id', + 'term_order', + 'term_taxonomy_id', + ); + + /** + * Default multisite callables able to be managed via JSON API. + * + * @var array multsite callables whitelisted + */ + public static $default_multisite_callable_whitelist = array(); + + /** + * Get array of multisite callables whitelisted. + * + * @return array Multisite callables managable via JSON API. + */ + public static function get_multisite_callable_whitelist() { + /** + * Filter the list of multisite callables that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 4.8.0 + * + * @param array The default list of multisite callables. + */ + return apply_filters( 'jetpack_sync_multisite_callable_whitelist', self::$default_multisite_callable_whitelist ); + } + + /** + * Array of post meta keys whitelisted. + * + * @var array Post meta whitelist. + */ + public static $post_meta_whitelist = array( + '_feedback_akismet_values', + '_feedback_email', + '_feedback_extra_fields', + '_g_feedback_shortcode', + '_jetpack_post_thumbnail', + '_last_editor_used_jetpack', + '_menu_item_classes', + '_menu_item_menu_item_parent', + '_menu_item_object', + '_menu_item_object_id', + '_menu_item_orphaned', + '_menu_item_type', + '_menu_item_xfn', + '_publicize_facebook_user', + '_publicize_twitter_user', + '_thumbnail_id', + '_wp_attached_file', + '_wp_attachment_backup_sizes', + '_wp_attachment_context', + '_wp_attachment_image_alt', + '_wp_attachment_is_custom_background', + '_wp_attachment_is_custom_header', + '_wp_attachment_metadata', + '_wp_page_template', + '_wp_trash_meta_comments_status', + '_wpas_feature_enabled', + '_wpas_mess', + '_wpas_options', + 'advanced_seo_description', // Jetpack_SEO_Posts::DESCRIPTION_META_KEY. + 'content_width', + 'custom_css_add', + 'custom_css_preprocessor', + 'enclosure', + 'imagedata', + 'nova_price', + 'publicize_results', + 'sharing_disabled', + 'switch_like_status', + 'videopress_guid', + 'vimeo_poster_image', + '_jetpack_blogging_prompt_key', + 'footnotes', // Core footnotes block + ); + + /** + * Get the post meta key whitelist. + * + * @return array Post meta whitelist. + */ + public static function get_post_meta_whitelist() { + /** + * Filter the list of post meta data that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 4.8.0 + * + * @param array The default list of meta data keys. + */ + return apply_filters( 'jetpack_sync_post_meta_whitelist', self::$post_meta_whitelist ); + } + + /** + * Comment meta whitelist. + * + * @var array Comment meta whitelist. + */ + public static $comment_meta_whitelist = array( + 'hc_avatar', + 'hc_foreign_user_id', + 'hc_post_as', + 'hc_wpcom_id_sig', + ); + + /** + * Get the comment meta whitelist. + * + * @return array + */ + public static function get_comment_meta_whitelist() { + /** + * Filter the list of comment meta data that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 5.7.0 + * + * @param array The default list of comment meta data keys. + */ + return apply_filters( 'jetpack_sync_comment_meta_whitelist', self::$comment_meta_whitelist ); + } + + /** + * Default theme support whitelist. + * + * @todo move this to server? - these are theme support values + * that should be synced as jetpack_current_theme_supports_foo option values + * + * @var array Default theme support whitelist. + */ + public static $default_theme_support_whitelist = array( + 'align-wide', + 'appearance-tools', // In Gutenberg. + 'automatic-feed-links', + 'block-templates', + 'block-template-parts', // WP 6.1. Added via https://core.trac.wordpress.org/changeset/54176 + 'custom-background', + 'custom-header', + 'custom-logo', + 'customize-selective-refresh-widgets', + 'dark-editor-style', + 'default-color-palette', // In Gutenberg. + 'default-gradient-presets', // In Gutenberg. + 'disable-custom-colors', + 'disable-custom-font-sizes', + 'disable-custom-gradients', + 'disable-layout-styles', // WP 6.1. Added via https://core.trac.wordpress.org/changeset/54159 + 'editor-color-palette', + 'editor-font-sizes', + 'editor-gradient-presets', + 'editor-spacing-sizes', + 'editor-style', // deprecated. + 'editor-styles', + 'html5', + 'infinite-scroll', + 'jetpack-responsive-videos', + 'jetpack-social-menu', + 'menus', + 'post-formats', + 'post-thumbnails', + 'responsive-embeds', + 'site-logo', + 'title-tag', + 'widgets', + 'wp-block-styles', + ); + + /** + * Is an option whitelisted? + * + * @param string $option Option name. + * @return bool If option is on the whitelist. + */ + public static function is_whitelisted_option( $option ) { + $whitelisted_options = self::get_options_whitelist(); + foreach ( $whitelisted_options as $whitelisted_option ) { + if ( '/' === $whitelisted_option[0] && preg_match( $whitelisted_option, $option ) ) { + return true; + } elseif ( $whitelisted_option === $option ) { + return true; + } + } + + return false; + } + + /** + * Default whitelist of capabilities to sync. + * + * @var array Array of WordPress capabilities. + */ + public static $default_capabilities_whitelist = array( + 'activate_plugins', + 'add_users', + 'create_users', + 'customize', + 'delete_others_pages', + 'delete_others_posts', + 'delete_pages', + 'delete_plugins', + 'delete_posts', + 'delete_private_pages', + 'delete_private_posts', + 'delete_published_pages', + 'delete_published_posts', + 'delete_site', + 'delete_themes', + 'delete_users', + 'edit_dashboard', + 'edit_files', + 'edit_others_pages', + 'edit_others_posts', + 'edit_pages', + 'edit_plugins', + 'edit_posts', + 'edit_private_pages', + 'edit_private_posts', + 'edit_published_pages', + 'edit_published_posts', + 'edit_theme_options', + 'edit_themes', + 'edit_users', + 'export', + 'import', + 'install_plugins', + 'install_themes', + 'list_users', + 'manage_categories', + 'manage_links', + 'manage_options', + 'moderate_comments', + 'promote_users', + 'publish_pages', + 'publish_posts', + 'read', + 'read_private_pages', + 'read_private_posts', + 'remove_users', + 'switch_themes', + 'unfiltered_html', + 'unfiltered_upload', + 'update_core', + 'update_plugins', + 'update_themes', + 'upload_files', + 'upload_plugins', + 'upload_themes', + ); + + /** + * Get default capabilities whitelist. + * + * @return array + */ + public static function get_capabilities_whitelist() { + /** + * Filter the list of capabilities that we care about + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 5.5.0 + * + * @param array The default list of capabilities. + */ + return apply_filters( 'jetpack_sync_capabilities_whitelist', self::$default_capabilities_whitelist ); + } + + /** + * Get max execution sync time. + * + * @return float Number of seconds. + */ + public static function get_max_sync_execution_time() { + $max_exec_time = (int) ini_get( 'max_execution_time' ); + if ( 0 === $max_exec_time ) { + // 0 actually means "unlimited", but let's not treat it that way. + $max_exec_time = 60; + } + return floor( $max_exec_time / 3 ); + } + + /** + * Get default for a given setting. + * + * @param string $setting Setting to get. + * @return mixed Value will be a string, int, array, based on the particular setting requested. + */ + public static function get_default_setting( $setting ) { + $default_name = "default_$setting"; // e.g. default_dequeue_max_bytes. + return self::$$default_name; + } + + /** + * Default list of network options. + * + * @var array network options + */ + public static $default_network_options_whitelist = array( + 'active_sitewide_plugins', + 'auto_update_plugins', // WordPress 5.5+ auto-updates. + 'jetpack_protect_global_whitelist', + 'jetpack_protect_key', + 'site_name', + ); + + /** + * A mapping of known importers to friendly names. + * + * Keys are the class name of the known importer. + * Values are the friendly name. + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @var array + */ + public static $default_known_importers = array( + 'Blogger_Importer' => 'blogger', + 'LJ_API_Import' => 'livejournal', + 'MT_Import' => 'mt', + 'RSS_Import' => 'rss', + 'WC_Tax_Rate_Importer' => 'woo-tax-rate', + 'WP_Import' => 'wordpress', + ); + + /** + * Returns a list of known importers. + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @return array Known importers with importer class names as keys and friendly names as values. + */ + public static function get_known_importers() { + /** + * Filter the list of known importers. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @param array The default list of known importers. + */ + return apply_filters( 'jetpack_sync_known_importers', self::$default_known_importers ); + } + + /** + * Whether this is a system with a multiple networks. + * We currently need this static wrapper because we statically define our default list of callables. + * + * @since 1.6.3 + * @since-jetpack 7.6.0 + * + * @uses Automattic\Jetpack\Status::is_multi_network + * + * @return boolean + */ + public static function is_multi_network() { + $status = new Status(); + return $status->is_multi_network(); + } + + /** + * Default bytes to dequeue. + * + * @var int Bytes. + */ + public static $default_dequeue_max_bytes = 500000; // very conservative value, 1/2 MB. + + /** + * Default upload bytes. + * + * This value is a little bigger than the upload limit to account for serialization. + * + * @var int Bytes. + */ + public static $default_upload_max_bytes = 600000; + + /** + * Default number of rows uploaded. + * + * @var int Number of rows. + */ + public static $default_upload_max_rows = 500; + + /** + * Default sync wait time. + * + * @var int Number of seconds. + */ + public static $default_sync_wait_time = 10; // seconds, between syncs. + + /** + * Only wait before next send if the current send took more than this number of seconds. + * + * @var int Number of seconds. + */ + public static $default_sync_wait_threshold = 10; + + /** + * Default wait between attempting to continue a full sync via requests. + * + * @var int Number of seconds. + */ + public static $default_enqueue_wait_time = 1; + + /** + * Maximum queue size. + * + * Each item is represented with a new row in the wp_options table. + * + * @var int Number of queue items. + */ + public static $default_max_queue_size = 5000; + + /** + * Default maximum lag allowed in the queue. + * + * @var int Number of seconds + */ + public static $default_max_queue_lag = 7200; // 2 hours. + + /** + * Default for default writes per sec. + * + * @var int Rows per second. + */ + public static $default_queue_max_writes_sec = 100; // 100 rows a second. + + /** + * Default for post types blacklist. + * + * @var array Empty array. + */ + public static $default_post_types_blacklist = array(); + + /** + * Default for taxonomies blacklist. + * + * @var array Empty array. + */ + public static $default_taxonomies_blacklist = array(); + + /** + * Default for taxonomies whitelist. + * + * @var array Empty array. + */ + public static $default_taxonomy_whitelist = array(); + + /** + * Default for post meta whitelist. + * + * @var array Empty array. + */ + public static $default_post_meta_whitelist = array(); + + /** + * Default for comment meta whitelist. + * + * @var array Empty array. + */ + public static $default_comment_meta_whitelist = array(); + + /** + * Default for disabling sync across the site. + * + * @var int Bool-ish. Default to 0. + */ + public static $default_disable = 0; // completely disable sending data to wpcom. + + /** + * Default for disabling sync across the entire network on multisite. + * + * @var int Bool-ish. Default 0. + */ + public static $default_network_disable = 0; + + /** + * Default for disabling checksums. + * + * @var int Bool-ish. Default 0. + */ + public static $default_checksum_disable = 0; + + /** + * Should Sync use cron? + * + * @var int Bool-ish value. Default 1. + */ + public static $default_sync_via_cron = 1; + + /** + * Default if Sync should render content. + * + * @var int Bool-ish value. Default is 0. + */ + public static $default_render_filtered_content = 0; + + /** + * Default number of items to enqueue at a time when running full sync. + * + * @var int Number of items. + */ + public static $default_max_enqueue_full_sync = 100; + + /** + * Default for maximum queue size during a full sync. + * + * Each item will represent a value in the wp_options table. + * + * @var int Number of items. + */ + public static $default_max_queue_size_full_sync = 1000; // max number of total items in the full sync queue. + + /** + * Default max time for sending in immediate mode. + * + * @var float Number of Seconds + */ + public static $default_full_sync_send_duration = 9; + + /** + * Defaul for time between syncing callables. + * + * @var int Number of seconds. + */ + public static $default_sync_callables_wait_time = MINUTE_IN_SECONDS; // seconds before sending callables again. + + /** + * Default for time between syncing constants. + * + * @var int Number of seconds. + */ + public static $default_sync_constants_wait_time = HOUR_IN_SECONDS; // seconds before sending constants again. + /** + * Default for sync queue lock timeout time. + * + * @var int Number of seconds. + */ + public static $default_sync_queue_lock_timeout = 120; // 2 minutes. + + /** + * Default for cron sync time limit. + * + * @var int Number of seconds. + */ + public static $default_cron_sync_time_limit = 4 * MINUTE_IN_SECONDS; + + /** + * Default for number of term relationship items sent in an full sync item. + * + * @var int Number of items. + */ + public static $default_term_relationships_full_sync_item_size = 100; + + /** + * Default for enabling incremental sync. + * + * @var int 1 for true. + */ + public static $default_sync_sender_enabled = 1; // Should send incremental sync items. + + /** + * Default for enabling Full Sync. + * + * @var int 1 for true. + */ + public static $default_full_sync_sender_enabled = 1; // Should send full sync items. + + /** + * Default Full Sync config + * + * @var array list of module names. + */ + public static $default_full_sync_config = array( + 'comments' => 1, + 'constants' => 1, + 'functions' => 1, + 'options' => 1, + 'posts' => 1, + 'term_relationships' => 1, + 'terms' => 1, + 'themes' => 1, + 'updates' => 1, + 'users' => 1, + ); + + /** + * Default Full Sync max objects to send on a single request. + * + * @var array list of module => max. + */ + public static $default_full_sync_limits = array( + 'comments' => array( + 'chunk_size' => 100, + 'max_chunks' => 10, + ), + 'posts' => array( + 'chunk_size' => 100, + 'max_chunks' => 1, + ), + 'term_relationships' => array( + 'chunk_size' => 1000, + 'max_chunks' => 10, + ), + 'terms' => array( + 'chunk_size' => 1000, + 'max_chunks' => 10, + ), + 'users' => array( + 'chunk_size' => 100, + 'max_chunks' => 10, + ), + ); + + /** + * Default for enabling dedicated Sync flow. + * + * @var int Bool-ish. Default 0. + */ + public static $default_dedicated_sync_enabled = 0; + + /** + * Default for enabling custom queue table for Sync. + * + * @var int Bool-ish. Default 0. + */ + public static $default_custom_queue_table_enabled = 0; + + /** + * Default for enabling wpcom rest api for Sync. + * + * @var int Bool-ish. Default 0. + */ + public static $default_wpcom_rest_api_enabled = 0; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php new file mode 100644 index 00000000..d6435a97 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php @@ -0,0 +1,740 @@ +get_modules(); + } + + return array(); + } + + /** + * Return array of taxonomies registered on the site. + * + * @return array + */ + public static function get_taxonomies() { + global $wp_taxonomies; + $wp_taxonomies_without_callbacks = array(); + foreach ( $wp_taxonomies as $taxonomy_name => $taxonomy ) { + $sanitized_taxonomy = self::sanitize_taxonomy( $taxonomy ); + if ( ! empty( $sanitized_taxonomy ) ) { + $wp_taxonomies_without_callbacks[ $taxonomy_name ] = $sanitized_taxonomy; + } + } + return $wp_taxonomies_without_callbacks; + } + + /** + * Return array of registered shortcodes. + * + * @return array + */ + public static function get_shortcodes() { + global $shortcode_tags; + return array_keys( $shortcode_tags ); + } + + /** + * Removes any callback data since we will not be able to process it on our side anyways. + * + * @param \WP_Taxonomy $taxonomy \WP_Taxonomy item. + * + * @return mixed|null + */ + public static function sanitize_taxonomy( $taxonomy ) { + + // Lets clone the taxonomy object instead of modifing the global one. + $cloned_taxonomy = json_decode( wp_json_encode( $taxonomy ) ); + + // recursive taxonomies are no fun. + if ( $cloned_taxonomy === null ) { + return null; + } + // Remove any meta_box_cb if they are not the default wp ones. + if ( isset( $cloned_taxonomy->meta_box_cb ) && + ! in_array( $cloned_taxonomy->meta_box_cb, array( 'post_tags_meta_box', 'post_categories_meta_box' ), true ) ) { + $cloned_taxonomy->meta_box_cb = null; + } + // Remove update call back. + if ( isset( $cloned_taxonomy->update_count_callback ) && + $cloned_taxonomy->update_count_callback !== null ) { + $cloned_taxonomy->update_count_callback = null; + } + // Remove rest_controller_class if it something other then the default. + if ( isset( $cloned_taxonomy->rest_controller_class ) && + 'WP_REST_Terms_Controller' !== $cloned_taxonomy->rest_controller_class ) { + $cloned_taxonomy->rest_controller_class = null; + } + return $cloned_taxonomy; + } + + /** + * Return array of registered post types. + * + * @return array + */ + public static function get_post_types() { + global $wp_post_types; + + $post_types_without_callbacks = array(); + foreach ( $wp_post_types as $post_type_name => $post_type ) { + $sanitized_post_type = self::sanitize_post_type( $post_type ); + if ( ! empty( $sanitized_post_type ) ) { + $post_types_without_callbacks[ $post_type_name ] = $sanitized_post_type; + } + } + return $post_types_without_callbacks; + } + + /** + * Sanitizes by cloning post type object. + * + * @param object $post_type \WP_Post_Type. + * + * @return object + */ + public static function sanitize_post_type( $post_type ) { + // Lets clone the post type object instead of modifing the global one. + $sanitized_post_type = array(); + foreach ( Defaults::$default_post_type_attributes as $attribute_key => $default_value ) { + if ( isset( $post_type->{ $attribute_key } ) ) { + $sanitized_post_type[ $attribute_key ] = $post_type->{ $attribute_key }; + } + } + return (object) $sanitized_post_type; + } + + /** + * Return information about a synced post type. + * + * @param array $sanitized_post_type Array of args used in constructing \WP_Post_Type. + * @param string $post_type Post type name. + * + * @return object \WP_Post_Type + */ + public static function expand_synced_post_type( $sanitized_post_type, $post_type ) { + $post_type = sanitize_key( $post_type ); + $post_type_object = new \WP_Post_Type( $post_type, $sanitized_post_type ); + $post_type_object->add_supports(); + $post_type_object->add_rewrite_rules(); + $post_type_object->add_hooks(); + $post_type_object->register_taxonomies(); + return (object) $post_type_object; + } + + /** + * Returns site's post_type_features. + * + * @return array + */ + public static function get_post_type_features() { + global $_wp_post_type_features; + + return $_wp_post_type_features; + } + + /** + * Return hosting provider. + * + * Uses a set of known constants, classes, or functions to help determine the hosting platform. + * + * @return string Hosting provider. + */ + public static function get_hosting_provider() { + $hosting_provider_detection_methods = array( + 'get_hosting_provider_by_known_constant', + 'get_hosting_provider_by_known_class', + 'get_hosting_provider_by_known_function', + ); + + $functions = new Functions(); + foreach ( $hosting_provider_detection_methods as $method ) { + $hosting_provider = call_user_func( array( $functions, $method ) ); + if ( false !== $hosting_provider ) { + return $hosting_provider; + } + } + + return 'unknown'; + } + + /** + * Return a hosting provider using a set of known constants. + * + * @return mixed A host identifier string or false. + */ + public function get_hosting_provider_by_known_constant() { + $hosting_provider_constants = array( + 'GD_SYSTEM_PLUGIN_DIR' => 'gd-managed-wp', + 'MM_BASE_DIR' => 'bh', + 'PAGELYBIN' => 'pagely', + 'KINSTAMU_VERSION' => 'kinsta', + 'FLYWHEEL_CONFIG_DIR' => 'flywheel', + 'IS_PRESSABLE' => 'pressable', + 'VIP_GO_ENV' => 'vip-go', + ); + + foreach ( $hosting_provider_constants as $constant => $constant_value ) { + if ( Constants::is_defined( $constant ) ) { + if ( 'VIP_GO_ENV' === $constant && false === Constants::get_constant( 'VIP_GO_ENV' ) ) { + continue; + } + return $constant_value; + } + } + + return false; + } + + /** + * Return a hosting provider using a set of known classes. + * + * @return mixed A host identifier string or false. + */ + public function get_hosting_provider_by_known_class() { + $hosting_provider = false; + + switch ( true ) { + case ( class_exists( '\\WPaaS\\Plugin' ) ): + $hosting_provider = 'gd-managed-wp'; + break; + } + + return $hosting_provider; + } + + /** + * Return a hosting provider using a set of known functions. + * + * @return mixed A host identifier string or false. + */ + public function get_hosting_provider_by_known_function() { + $hosting_provider = false; + + switch ( true ) { + case ( function_exists( 'is_wpe' ) || function_exists( 'is_wpe_snapshot' ) ): + $hosting_provider = 'wpe'; + break; + } + + return $hosting_provider; + } + + /** + * Return array of allowed REST API post types. + * + * @return array Array of allowed post types. + */ + public static function rest_api_allowed_post_types() { + /** This filter is already documented in class.json-api-endpoints.php */ + return apply_filters( 'rest_api_allowed_post_types', array( 'post', 'page', 'revision' ) ); + } + + /** + * Return array of allowed REST API public metadata. + * + * @return array Array of allowed metadata. + */ + public static function rest_api_allowed_public_metadata() { + /** + * Filters the meta keys accessible by the REST API. + * + * @see https://developer.wordpress.com/2013/04/26/custom-post-type-and-metadata-support-in-the-rest-api/ + * + * @module json-api + * + * @since 1.6.3 + * @since-jetpack 2.2.3 + * + * @param array $whitelisted_meta Array of metadata that is accessible by the REST API. + */ + return apply_filters( 'rest_api_allowed_public_metadata', array() ); + } + + /** + * Finds out if a site is using a version control system. + * + * @return bool + **/ + public static function is_version_controlled() { + + if ( ! class_exists( 'WP_Automatic_Updater' ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + $updater = new \WP_Automatic_Updater(); + + return (bool) (string) $updater->is_vcs_checkout( ABSPATH ); + } + + /** + * Returns true if the site has file write access false otherwise. + * + * @return bool + **/ + public static function file_system_write_access() { + if ( ! function_exists( 'get_filesystem_method' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + require_once ABSPATH . 'wp-admin/includes/template.php'; + + $filesystem_method = get_filesystem_method(); + if ( 'direct' === $filesystem_method ) { + return true; + } + + ob_start(); + + if ( ! function_exists( 'request_filesystem_credentials' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); + ob_end_clean(); + if ( $filesystem_credentials_are_stored ) { + return true; + } + + return false; + } + + /** + * Helper function that is used when getting home or siteurl values. Decides + * whether to get the raw or filtered value. + * + * @deprecated 1.23.1 + * + * @param string $url_type URL to get, home or siteurl. + * @return string + */ + public static function get_raw_or_filtered_url( $url_type ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::get_raw_or_filtered_url' ); + return Urls::get_raw_or_filtered_url( $url_type ); + } + + /** + * Return the escaped home_url. + * + * @deprecated 1.23.1 + * + * @return string + */ + public static function home_url() { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::home_url' ); + return Urls::home_url(); + } + + /** + * Return the escaped siteurl. + * + * @deprecated 1.23.1 + * + * @return string + */ + public static function site_url() { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::site_url' ); + return Urls::site_url(); + } + + /** + * Return main site URL with a normalized protocol. + * + * @deprecated 1.23.1 + * + * @return string + */ + public static function main_network_site_url() { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::main_network_site_url' ); + return Urls::main_network_site_url(); + } + + /** + * Return main site WordPress.com site ID. + * + * @return string + */ + public static function main_network_site_wpcom_id() { + /** + * Return the current site WPCOM ID for single site installs + */ + if ( ! is_multisite() ) { + return \Jetpack_Options::get_option( 'id' ); + } + + /** + * Return the main network site WPCOM ID for multi-site installs + */ + $current_network = get_network(); + switch_to_blog( $current_network->blog_id ); + $wpcom_blog_id = \Jetpack_Options::get_option( 'id' ); + restore_current_blog(); + return $wpcom_blog_id; + } + + /** + * Return URL with a normalized protocol. + * + * @deprecated 1.23.1 + * + * @param string $callable Function name that was used to retrieve URL option. + * @param string $new_value URL Protocol to set URLs to. + * @return string Normalized URL. + */ + public static function get_protocol_normalized_url( $callable, $new_value ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::get_protocol_normalized_url' ); + return Urls::get_protocol_normalized_url( $callable, $new_value ); + } + + /** + * Return URL from option or PHP constant. + * + * @deprecated 1.23.1 + * + * @param string $option_name (e.g. 'home'). + * + * @return mixed|null URL. + */ + public static function get_raw_url( $option_name ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::get_raw_url' ); + return Urls::get_raw_url( $option_name ); + } + + /** + * Normalize domains by removing www unless declared in the site's option. + * + * @deprecated 1.23.1 + * + * @param string $option Option value from the site. + * @param callable $url_function Function retrieving the URL to normalize. + * @return mixed|string URL. + */ + public static function normalize_www_in_url( $option, $url_function ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::normalize_www_in_url' ); + return Urls::normalize_www_in_url( $option, $url_function ); + } + + /** + * Return filtered value of get_plugins. + * + * @return mixed|void + */ + public static function get_plugins() { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ + return apply_filters( 'all_plugins', get_plugins() ); + } + + /** + * Get custom action link tags that the plugin is using + * Ref: https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name) + * + * @param string $plugin_file_singular Particular plugin. + * @return array of plugin action links (key: link name value: url) + */ + public static function get_plugins_action_links( $plugin_file_singular = null ) { + // Some sites may have DOM disabled in PHP fail early. + if ( ! class_exists( 'DOMDocument' ) ) { + return array(); + } + $plugins_action_links = get_option( 'jetpack_plugin_api_action_links', array() ); + if ( ! empty( $plugins_action_links ) ) { + if ( $plugin_file_singular === null ) { + return $plugins_action_links; + } + return ( isset( $plugins_action_links[ $plugin_file_singular ] ) ? $plugins_action_links[ $plugin_file_singular ] : null ); + } + return array(); + } + + /** + * Return the WP version as defined in the $wp_version global. + * + * @return string + */ + public static function wp_version() { + global $wp_version; + return $wp_version; + } + + /** + * Return site icon url used on the site. + * + * @param int $size Size of requested icon in pixels. + * @return mixed|string|void + */ + public static function site_icon_url( $size = 512 ) { + $site_icon = get_site_icon_url( $size ); + return $site_icon ? $site_icon : get_option( 'jetpack_site_icon_url' ); + } + + /** + * Return roles registered on the site. + * + * @return array + */ + public static function roles() { + $wp_roles = wp_roles(); + return $wp_roles->roles; + } + + /** + * Determine time zone from WordPress' options "timezone_string" + * and "gmt_offset". + * + * 1. Check if `timezone_string` is set and return it. + * 2. Check if `gmt_offset` is set, formats UTC-offset from it and return it. + * 3. Default to "UTC+0" if nothing is set. + * + * Note: This function is specifically not using wp_timezone() to keep consistency with + * the existing formatting of the timezone string. + * + * @return string + */ + public static function get_timezone() { + $timezone_string = get_option( 'timezone_string' ); + + if ( ! empty( $timezone_string ) ) { + return str_replace( '_', ' ', $timezone_string ); + } + + $gmt_offset = get_option( 'gmt_offset', 0 ); + + $formatted_gmt_offset = sprintf( '%+g', (float) $gmt_offset ); + + $formatted_gmt_offset = str_replace( + array( '.25', '.5', '.75' ), + array( ':15', ':30', ':45' ), + (string) $formatted_gmt_offset + ); + + /* translators: %s is UTC offset, e.g. "+1" */ + return sprintf( __( 'UTC%s', 'jetpack-sync' ), $formatted_gmt_offset ); + } + + /** + * Return list of paused themes. + * + * @return array|bool Array of paused themes or false if unsupported. + */ + public static function get_paused_themes() { + $paused_themes = wp_paused_themes(); + return $paused_themes->get_all(); + } + + /** + * Return list of paused plugins. + * + * @return array|bool Array of paused plugins or false if unsupported. + */ + public static function get_paused_plugins() { + $paused_plugins = wp_paused_plugins(); + return $paused_plugins->get_all(); + } + + /** + * Return the theme's supported features. + * Used for syncing the supported feature that we care about. + * + * @return array List of features that the theme supports. + */ + public static function get_theme_support() { + global $_wp_theme_features; + + $theme_support = array(); + foreach ( Defaults::$default_theme_support_whitelist as $theme_feature ) { + $has_support = current_theme_supports( $theme_feature ); + if ( $has_support ) { + $theme_support[ $theme_feature ] = $_wp_theme_features[ $theme_feature ]; + } + } + + return $theme_support; + } + + /** + * Returns if the current theme is a Full Site Editing theme. + * + * @since 1.49.0 Uses wp_is_block_theme() instead of deprecated gutenberg_is_fse_theme(). + * + * @return bool Theme is a Full Site Editing theme. + */ + public static function get_is_fse_theme() { + return wp_is_block_theme(); + } + + /** + * Wraps data in a way so that we can distinguish between objects and array and also prevent object recursion. + * + * @since 1.21.0 + * + * @param mixed $any Source data to be cleaned up. + * @param array $seen_nodes Built array of nodes. + * + * @return array + */ + public static function json_wrap( &$any, $seen_nodes = array() ) { + if ( is_object( $any ) ) { + $input = get_object_vars( $any ); + $input['__o'] = 1; + } else { + $input = &$any; + } + + if ( is_array( $input ) ) { + $seen_nodes[] = &$any; + + $return = array(); + + foreach ( $input as $k => &$v ) { + if ( ( is_array( $v ) || is_object( $v ) ) ) { + if ( in_array( $v, $seen_nodes, true ) ) { + continue; + } + $return[ $k ] = self::json_wrap( $v, $seen_nodes ); + } else { + $return[ $k ] = $v; + } + } + + return $return; + } + + return $any; + } + + /** + * Return the list of installed themes + * + * @since 1.31.0 + * + * @return array + */ + public static function get_themes() { + $current_stylesheet = get_stylesheet(); + $installed_themes = wp_get_themes(); + $synced_headers = array( 'Name', 'ThemeURI', 'Author', 'Version', 'Template', 'Status', 'TextDomain', 'RequiresWP', 'RequiresPHP' ); + $themes = array(); + foreach ( $installed_themes as $stylesheet => $theme ) { + $themes[ $stylesheet ] = array(); + foreach ( $synced_headers as $header ) { + $themes[ $stylesheet ][ $header ] = $theme->get( $header ); + } + $themes[ $stylesheet ]['active'] = $stylesheet === $current_stylesheet; + if ( method_exists( $theme, 'is_block_theme' ) ) { + $themes[ $stylesheet ]['is_block_theme'] = $theme->is_block_theme(); + } + } + /** + * Filters the output of Sync's get_theme callable + * + * @since 1.31.0 + * + * @param array $themes The list of installed themes formatted in an array with a collection of information extracted from the Theme's headers + */ + return apply_filters( 'jetpack_sync_get_themes_callable', $themes ); + } + + /** + * Return the list of active Jetpack modules. + * + * @since 1.34.0 + * + * @return array + */ + public static function get_active_modules() { + return ( new Jetpack_Modules() )->get_active(); + } + + /** + * Return a list of PHP modules that we want to track. + * + * @since 1.50.0 + * + * @return array + */ + public static function get_loaded_extensions() { + if ( function_exists( 'get_loaded_extensions' ) ) { + return get_loaded_extensions(); + } + + // If a hosting provider has blocked get_loaded_extensions for any reason, + // we check extensions manually. + + $extensions_to_check = array( + 'libxml' => array( 'class' => 'libXMLError' ), + 'xml' => array( 'function' => 'xml_parse' ), + 'dom' => array( 'class' => 'DOMDocument' ), + 'xdebug' => array( 'function' => 'xdebug_break' ), + ); + + $enabled_extensions = array(); + foreach ( $extensions_to_check as $extension_name => $extension ) { + if ( + ( isset( $extension['function'] ) + && function_exists( $extension['function'] ) ) + || class_exists( $extension['class'] ) + ) { + $enabled_extensions[] = $extension_name; + } + } + + return $enabled_extensions; + } + + /** + * Return the list of active connected Jetpack plugins. + * + * @since 3.2.0 + * + * @return array + */ + public static function get_jetpack_connection_active_plugins() { + return ( new Manager() )->get_connected_plugins(); + } + + /** + * Return the list of active sync modules. + * + * @since 3.6.0 + * + * @return array + */ + public static function get_jetpack_sync_active_modules() { + + /** This filter is documented in projects/packages/sync/src/class-modules.php */ + $modules = apply_filters( 'jetpack_sync_modules', Modules::DEFAULT_SYNC_MODULES ); + $modules = array_unique( $modules ); + $modules = array_map( 'wp_normalize_path', $modules ); + return $modules; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-health.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-health.php new file mode 100644 index 00000000..41d7f788 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-health.php @@ -0,0 +1,188 @@ + self::STATUS_UNKNOWN, + self::OPTION_TIMESTAMP_KEY => microtime( true ), + ); + + switch ( $status ) { + case self::STATUS_DISABLED: + case self::STATUS_OUT_OF_SYNC: + case self::STATUS_IN_SYNC: + $new_status[ self::OPTION_STATUS_KEY ] = $status; + break; + } + + \Jetpack_Options::update_option( self::STATUS_OPTION, $new_status ); + return true; + } + + /** + * Check if Status has been previously set. + * + * @return bool is a Status defined + */ + public static function is_status_defined() { + $status = \Jetpack_Options::get_option( self::STATUS_OPTION ); + + if ( false === $status || ! is_array( $status ) || empty( $status[ self::OPTION_STATUS_KEY ] ) ) { + return false; + } else { + return true; + } + } + + /** + * Update Sync Status if Full Sync ended of Posts + * + * @param string $checksum The checksum that's currently being processed. + * @param array $range The ranges of object types being processed. + */ + public static function full_sync_end_update_status( $checksum, $range ) { + if ( isset( $range['posts'] ) ) { + self::update_status( self::STATUS_IN_SYNC ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php new file mode 100644 index 00000000..a2f443af --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php @@ -0,0 +1,96 @@ +json_serialize( $object ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + } + + /** + * Decode compressed serialized value. + * + * @param string $input Item to decode. + * @return array|mixed|object + */ + public function decode( $input ) { + $decoded = base64_decode( $input ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + $inflated = @gzinflate( $decoded ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + + return is_string( $inflated ) ? $this->json_unserialize( $inflated ) : null; + } + + /** + * Serialize JSON + * + * @see https://gist.github.com/muhqu/820694 + * + * @param mixed $any Value to serialize and wrap. + * + * @return false|string + */ + protected function json_serialize( $any ) { + return wp_json_encode( Functions::json_wrap( $any ) ); + } + + /** + * Unserialize JSON + * + * @param string $str JSON string. + * @return array|object Unwrapped JSON. + */ + protected function json_unserialize( $str ) { + return $this->json_unwrap( json_decode( $str, true ) ); + } + + /** + * Unwraps a json_decode return. + * + * @param array|object $any json_decode object. + * @return array|object + */ + private function json_unwrap( $any ) { + if ( is_array( $any ) ) { + foreach ( $any as $k => $v ) { + if ( '__o' === $k ) { + continue; + } + $any[ $k ] = $this->json_unwrap( $v ); + } + + if ( isset( $any['__o'] ) ) { + unset( $any['__o'] ); + $any = (object) $any; + } + } + + return $any; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php new file mode 100644 index 00000000..c2789c17 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php @@ -0,0 +1,485 @@ +:( + */ + protected function __construct() { + $this->set_defaults(); + $this->init(); + } + + /** + * Sync Listener init. + */ + private function init() { + $handler = array( $this, 'action_handler' ); + $full_sync_handler = array( $this, 'full_sync_action_handler' ); + + foreach ( Modules::get_modules() as $module ) { + $module->init_listeners( $handler ); + $module->init_full_sync_listeners( $full_sync_handler ); + } + + // Module Activation. + add_action( 'jetpack_activate_module', $handler ); + add_action( 'jetpack_deactivate_module', $handler ); + + // Jetpack Upgrade. + add_action( 'updating_jetpack_version', $handler, 10, 2 ); + + // Send periodic checksum. + add_action( 'jetpack_sync_checksum', $handler ); + } + + /** + * Get incremental sync queue. + */ + public function get_sync_queue() { + return $this->sync_queue; + } + + /** + * Gets the full sync queue. + */ + public function get_full_sync_queue() { + return $this->full_sync_queue; + } + + /** + * Sets queue size limit. + * + * @param int $limit Queue size limit. + */ + public function set_queue_size_limit( $limit ) { + $this->sync_queue_size_limit = $limit; + } + + /** + * Get queue size limit. + */ + public function get_queue_size_limit() { + return $this->sync_queue_size_limit; + } + + /** + * Sets the queue lag limit. + * + * @param int $age Queue lag limit. + */ + public function set_queue_lag_limit( $age ) { + $this->sync_queue_lag_limit = $age; + } + + /** + * Return value of queue lag limit. + */ + public function get_queue_lag_limit() { + return $this->sync_queue_lag_limit; + } + + /** + * Force a recheck of the queue limit. + */ + public function force_recheck_queue_limit() { + delete_transient( self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $this->sync_queue->id ); + delete_transient( self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $this->full_sync_queue->id ); + } + + /** + * Determine if an item can be added to the queue. + * + * Prevent adding items to the queue if it hasn't sent an item for 15 mins + * AND the queue is over 1000 items long (by default). + * + * @param object $queue Sync queue. + * @return bool + */ + public function can_add_to_queue( $queue ) { + if ( ! Settings::is_sync_enabled() ) { + return false; + } + + $state_transient_name = self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $queue->id; + + $queue_state = get_transient( $state_transient_name ); + + if ( false === $queue_state ) { + $queue_state = array( $queue->size(), $queue->lag() ); + set_transient( $state_transient_name, $queue_state, self::QUEUE_STATE_CHECK_TIMEOUT ); + } + + list( $queue_size, $queue_age ) = $queue_state; + + return ( $queue_age < $this->sync_queue_lag_limit ) + || + ( ( $queue_size + 1 ) < $this->sync_queue_size_limit ); + } + + /** + * Full sync action handler. + * + * @param mixed ...$args Args passed to the action. + */ + public function full_sync_action_handler( ...$args ) { + $this->enqueue_action( current_filter(), $args, $this->full_sync_queue ); + } + + /** + * Action handler. + * + * @param mixed ...$args Args passed to the action. + */ + public function action_handler( ...$args ) { + $this->enqueue_action( current_filter(), $args, $this->sync_queue ); + } + + // add many actions to the queue directly, without invoking them. + + /** + * Bulk add action to the queue. + * + * @param string $action_name The name the full sync action. + * @param array $args_array Array of chunked arguments. + */ + public function bulk_enqueue_full_sync_actions( $action_name, $args_array ) { + $queue = $this->get_full_sync_queue(); + + /* + * If we add any items to the queue, we should try to ensure that our script + * can't be killed before they are sent. + */ + // https://plugins.trac.wordpress.org/ticket/2041 + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + $data_to_enqueue = array(); + $user_id = get_current_user_id(); + $currtime = microtime( true ); + $is_importing = Settings::is_importing(); + + foreach ( $args_array as $args ) { + $previous_end = isset( $args['previous_end'] ) ? $args['previous_end'] : null; + $args = isset( $args['ids'] ) ? $args['ids'] : $args; + + /** + * Modify or reject the data within an action before it is enqueued locally. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @module sync + * + * @param array The action parameters + */ + $args = apply_filters( "jetpack_sync_before_enqueue_$action_name", $args ); + $action_data = array( $args ); + if ( $previous_end !== null ) { + $action_data[] = $previous_end; + } + // allow listeners to abort. + if ( false === $args ) { + continue; + } + + $data_to_enqueue[] = array( + $action_name, + $action_data, + $user_id, + $currtime, + $is_importing, + ); + } + + $queue->add_all( $data_to_enqueue ); + } + + /** + * Enqueue the action. + * + * @param string $current_filter Current WordPress filter. + * @param object $args Sync args. + * @param string $queue Sync queue. + */ + public function enqueue_action( $current_filter, $args, $queue ) { + // don't enqueue an action during the outbound http request - this prevents recursion. + if ( Settings::is_sending() ) { + return; + } + + if ( ! ( new Connection_Manager() )->is_connected() ) { + // Don't enqueue an action if the site is disconnected. + return; + } + + /** + * Add an action hook to execute when anything on the whitelist gets sent to the queue to sync. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 5.9.0 + */ + do_action( 'jetpack_sync_action_before_enqueue' ); + + /** + * Modify or reject the data within an action before it is enqueued locally. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array The action parameters + */ + $args = apply_filters( "jetpack_sync_before_enqueue_$current_filter", $args ); + + // allow listeners to abort. + if ( false === $args ) { + return; + } + + /* + * Periodically check the size of the queue, and disable adding to it if + * it exceeds some limit AND the oldest item exceeds the age limit (i.e. sending has stopped). + */ + if ( ! $this->can_add_to_queue( $queue ) ) { + if ( 'sync' === $queue->id ) { + $this->sync_data_loss( $queue ); + } + return; + } + + /* + * If we add any items to the queue, we should try to ensure that our script + * can't be killed before they are sent. + */ + // https://plugins.trac.wordpress.org/ticket/2041 + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + if ( + 'sync' === $queue->id || + in_array( + $current_filter, + array( + 'jetpack_full_sync_start', + 'jetpack_full_sync_end', + 'jetpack_full_sync_cancel', + ), + true + ) + ) { + $queue->add( + array( + $current_filter, + $args, + get_current_user_id(), + microtime( true ), + Settings::is_importing(), + $this->get_actor( $current_filter, $args ), + ) + ); + } else { + $queue->add( + array( + $current_filter, + $args, + get_current_user_id(), + microtime( true ), + Settings::is_importing(), + ) + ); + } + + // since we've added some items, let's try to load the sender so we can send them as quickly as possible. + if ( ! Actions::$sender ) { + add_filter( 'jetpack_sync_sender_should_load', __NAMESPACE__ . '\Actions::should_initialize_sender_enqueue', 10, 1 ); + if ( did_action( 'init' ) ) { + Actions::add_sender_shutdown(); + } + } + } + + /** + * Sync Data Loss Handler + * + * @param Queue $queue Sync queue. + * @return boolean was send successful + */ + public function sync_data_loss( $queue ) { + if ( ! Settings::is_sync_enabled() ) { + return; + } + $updated = Health::update_status( Health::STATUS_OUT_OF_SYNC ); + + if ( ! $updated ) { + return; + } + + $data = array( + 'timestamp' => microtime( true ), + 'queue_size' => $queue->size(), + 'queue_lag' => $queue->lag(), + ); + + $sender = Sender::get_instance(); + return $sender->send_action( 'jetpack_sync_data_loss', $data ); + } + + /** + * Get the event's actor. + * + * @param string $current_filter Current wp-admin page. + * @param object $args Sync event. + * @return array Actor information. + */ + public function get_actor( $current_filter, $args ) { + if ( 'wp_login' === $current_filter ) { + $user = get_user_by( 'ID', $args[1]->data->ID ); + } else { + $user = wp_get_current_user(); + } + + $roles = new Roles(); + $translated_role = $roles->translate_user_to_role( $user ); + + $actor = array( + 'wpcom_user_id' => null, + 'external_user_id' => isset( $user->ID ) ? $user->ID : null, + 'display_name' => isset( $user->display_name ) ? $user->display_name : null, + 'user_email' => isset( $user->user_email ) ? $user->user_email : null, + 'user_roles' => isset( $user->roles ) ? $user->roles : null, + 'translated_role' => $translated_role ? $translated_role : null, + 'is_cron' => defined( 'DOING_CRON' ) ? DOING_CRON : false, + 'is_rest' => defined( 'REST_API_REQUEST' ) ? REST_API_REQUEST : false, + 'is_xmlrpc' => defined( 'XMLRPC_REQUEST' ) ? XMLRPC_REQUEST : false, + 'is_wp_rest' => defined( 'REST_REQUEST' ) ? REST_REQUEST : false, + 'is_ajax' => defined( 'DOING_AJAX' ) ? DOING_AJAX : false, + 'is_wp_admin' => is_admin(), + 'is_cli' => defined( 'WP_CLI' ) ? WP_CLI : false, + 'from_url' => $this->get_request_url(), + ); + + if ( $this->should_send_user_data_with_actor( $current_filter ) ) { + $ip = IP_Utils::get_ip(); + + $actor['ip'] = $ip ? $ip : ''; + $actor['user_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : 'unknown'; + } + + return $actor; + } + + /** + * Should user data be sent as the actor? + * + * @param string $current_filter The current WordPress filter being executed. + * @return bool + */ + public function should_send_user_data_with_actor( $current_filter ) { + $should_send = in_array( $current_filter, array( 'jetpack_wp_login', 'wp_logout', 'jetpack_valid_failed_login_attempt' ), true ); + /** + * Allow or deny sending actor's user data ( IP and UA ) during a sync event + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param bool True if we should send user data + * @param string The current filter that is performing the sync action + */ + return apply_filters( 'jetpack_sync_actor_user_data', $should_send, $current_filter ); + } + + /** + * Sets Listener defaults. + */ + public function set_defaults() { + $this->sync_queue = new Queue( 'sync' ); + $this->full_sync_queue = new Queue( 'full_sync' ); + $this->set_queue_size_limit( Settings::get_setting( 'max_queue_size' ) ); + $this->set_queue_lag_limit( Settings::get_setting( 'max_queue_lag' ) ); + } + + /** + * Get the request URL. + * + * @return string Request URL, if known. Otherwise, wp-admin or home_url. + */ + public function get_request_url() { + if ( isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_URI'] ) ) { + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- False positive, sniff misses the call to esc_url_raw. + return esc_url_raw( 'http' . ( isset( $_SERVER['HTTPS'] ) ? 's' : '' ) . '://' . wp_unslash( "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) ); + } + return is_admin() ? get_admin_url( get_current_blog_id() ) : home_url(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php new file mode 100644 index 00000000..61b89a1c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php @@ -0,0 +1,77 @@ + $locked_time ) { + update_option( $lock_name, false, false ); + } + return false; + } + + $locked_time = microtime( true ) + $expiry; + update_option( $lock_name, $locked_time, false ); + return $locked_time; + } + + /** + * Remove the lock. + * + * @access public + * + * @param string $name lock name. + * @param bool|float $lock_expiration lock expiration. + */ + public function remove( $name, $lock_expiration = false ) { + $lock_name = self::LOCK_PREFIX . $name; + + // Only remove lock if current value matches our lock. + if ( true === $lock_expiration || (string) get_option( $lock_name ) === (string) $lock_expiration ) { + update_option( $lock_name, false, false ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-main.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-main.php new file mode 100644 index 00000000..f48e2c66 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-main.php @@ -0,0 +1,135 @@ +uninstall(); + } + + /** + * Sync cleanup on shutdown. + */ + public static function on_jetpack_site_disconnected() { + add_action( 'shutdown', array( __CLASS__, 'sync_cleanup' ), 10000 ); + } + + /** + * Delete all sync related data on Site disconnect / clean up custom table. + * Needs to happen on shutdown to prevent fatals. + */ + public static function sync_cleanup() { + Sender::get_instance()->uninstall(); + + $table_storage = new Queue_Storage_Table( 'test_queue' ); + $table_storage->drop_table(); + } + + /** + * Sets the Sync data settings. + * + * @param array $data_settings An array containing the Sync data options. An empty array indicates that the default + * values will be used for all Sync data. + */ + public static function set_sync_data_options( $data_settings = array() ) { + ( new Data_Settings() )->add_settings_list( $data_settings ); + } + + /** + * Initialize the main sync actions. + * + * @action plugins_loaded + */ + public static function on_plugins_loaded_early() { + /** + * Additional Sync modules can be carried out into their own packages and they + * will get their own config settings. + * + * For now additional modules are enabled based on whether the third party plugin + * class exists or not. + */ + Sync_Actions::initialize_search(); + Sync_Actions::initialize_woocommerce(); + Sync_Actions::initialize_wp_super_cache(); + + // We need to define this here so that it's hooked before `updating_jetpack_version` is called. + add_action( 'updating_jetpack_version', array( 'Automattic\\Jetpack\\Sync\\Actions', 'cleanup_on_upgrade' ), 10, 2 ); + } + + /** + * Runs after most of plugins_loaded hook functions have been run. + * + * @action plugins_loaded + */ + public static function on_plugins_loaded_late() { + /* + * Init after plugins loaded and before the `init` action. This helps with issues where plugins init + * with a high priority or sites that use alternate cron. + */ + Sync_Actions::init(); + + // Enable non-blocking Jetpack Sync flow. + $non_block_enabled = (bool) get_option( 'jetpack_sync_non_blocking', false ); + + /** + * Filters the option to enable non-blocking sync. + * + * Default value is false, filter to true to enable non-blocking mode which will have + * WP.com return early and use the sync/close endpoint to check-in processed items. + * + * @since 1.12.3 + * + * @param bool $enabled Should non-blocking flow be enabled. + */ + $filtered = (bool) apply_filters( 'jetpack_sync_non_blocking', $non_block_enabled ); + + if ( $non_block_enabled !== $filtered ) { + update_option( 'jetpack_sync_non_blocking', $filtered, false ); + } + + // Initialize health-related hooks after plugins have loaded. + Health::init(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php new file mode 100644 index 00000000..4f2481f4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php @@ -0,0 +1,165 @@ +set_defaults(); + } + } + + /** + * Gets the name of an initialized module. Returns false if given module has not been initialized. + * + * @access public + * @static + * + * @param string $module_name A module name. + * + * @return bool|\Automattic\Jetpack\Sync\Modules\Module + */ + public static function get_module( $module_name ) { + // @todo Better type hinting for Phan if https://github.com/phan/phan/issues/3842 gets fixed. Then clean up the `@phan-var` on all the callers. + + foreach ( self::get_modules() as $module ) { + if ( $module->name() === $module_name ) { + return $module; + } + } + + return false; + } + + /** + * Loads and sets defaults for all declared modules. + * + * @access public + * @static + * + * @return array + */ + public static function initialize_modules() { + + /** + * Filters the list of class names of sync modules. + * If you add to this list, make sure any classes implement the + * Jetpack_Sync_Module interface. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + $modules = apply_filters( 'jetpack_sync_modules', self::DEFAULT_SYNC_MODULES ); + + $modules = array_unique( $modules ); + + $modules = array_map( array( __CLASS__, 'load_module' ), $modules ); + return array_map( array( __CLASS__, 'set_module_defaults' ), $modules ); + } + + /** + * Returns an instance of the given module class. + * + * @access public + * @static + * + * @param string $module_class The classname of a Jetpack sync module. + * + * @return \Automattic\Jetpack\Sync\Modules\Module + */ + public static function load_module( $module_class ) { + return new $module_class(); + } + + /** + * Sets defaults for the given instance of a Jetpack sync module. + * + * @access public + * @static + * + * @param \Automattic\Jetpack\Sync\Modules\Module $module Instance of a Jetpack sync module. + * + * @return \Automattic\Jetpack\Sync\Modules\Module + */ + public static function set_module_defaults( $module ) { + $module->set_defaults(); + if ( method_exists( $module, 'set_late_default' ) ) { + // @phan-suppress-next-line PhanUndeclaredMethodInCallable -- https://github.com/phan/phan/issues/1204 + add_action( 'init', array( $module, 'set_late_default' ), 90 ); + } + return $module; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php new file mode 100644 index 00000000..87ff65b5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php @@ -0,0 +1,30 @@ +id = $id; + $this->items_with_ids = $items_with_ids; + } + + /** + * Retrieve the sync items in the buffer, in an ID => value form. + * + * @access public + * + * @return bool|array Sync items in the buffer. + */ + public function get_items() { + return array_combine( $this->get_item_ids(), $this->get_item_values() ); + } + + /** + * Retrieve the values of the sync items in the buffer. + * + * @access public + * + * @return array Sync items values. + */ + public function get_item_values() { + return Utils::get_item_values( $this->items_with_ids ); + } + + /** + * Retrieve the IDs of the sync items in the buffer. + * + * @access public + * + * @return array Sync items IDs. + */ + public function get_item_ids() { + return Utils::get_item_ids( $this->items_with_ids ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php new file mode 100644 index 00000000..094e72d1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php @@ -0,0 +1,678 @@ +id = str_replace( '-', '_', $id ); // Necessary to ensure we don't have ID collisions in the SQL. + $this->row_iterator = 0; + $this->random_int = wp_rand( 1, 1000000 ); + + /** + * If the Custom queue table is enabled - let's use it as a backend. Otherwise, fall back to the Options table. + */ + if ( Settings::is_custom_queue_table_enabled() ) { + $this->queue_storage = new Queue_Storage_Table( $this->id ); + } else { + // Initialize the storage with the Options table backend. To be changed in subsequent updates to include the logic to switch to Custom Table. + $this->queue_storage = new Queue_Storage_Options( $this->id ); + } + } + + /** + * Add a single item to the queue. + * + * @param object $item Event object to add to queue. + * + * @return bool|WP_Error + */ + public function add( $item ) { + $added = false; + + // If empty, don't add. + if ( empty( $item ) ) { + return false; + } + + // Attempt to serialize data, if an exception (closures) return early. + try { + $item = serialize( $item ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + } catch ( \Exception $ex ) { + return new WP_Error( 'queue_unable_to_serialize', 'Unable to serialize item' ); + } + + // This basically tries to add the option until enough time has elapsed that + // it has a unique (microtime-based) option key. + while ( ! $added ) { + $added = $this->queue_storage->insert_item( $this->get_next_data_row_option_name(), $item ); + } + + return $added; + } + + /** + * Insert all the items in a single SQL query. May be subject to query size limits! + * + * @param array $items Array of events to add to the queue. + * + * @return bool|\WP_Error + */ + public function add_all( $items ) { + // TODO check and figure out if it's used at all and if we can optimize it. + $base_option_name = $this->get_next_data_row_option_name(); + + $rows_added = $this->queue_storage->add_all( $items, $base_option_name ); + + if ( count( $items ) !== $rows_added ) { + return new WP_Error( 'row_count_mismatch', "The number of rows inserted didn't match the size of the input array" ); + } + + return true; + } + + /** + * Get the front-most item on the queue without checking it out. + * + * @param int $count Number of items to return when looking at the items. + * + * @return array + */ + public function peek( $count = 1 ) { + $items = $this->fetch_items( $count ); + if ( $items ) { + return Utils::get_item_values( $items ); + } + + return array(); + } + + /** + * Gets items with particular IDs. + * + * @param array $item_ids Array of item IDs to retrieve. + * + * @return array + */ + public function peek_by_id( $item_ids ) { + $items = $this->fetch_items_by_id( $item_ids ); + if ( $items ) { + return Utils::get_item_values( $items ); + } + + return array(); + } + + /** + * Gets the queue lag. + * Lag is the difference in time between the age of the oldest item + * (aka first or frontmost item) and the current time. + * + * @param float $now The current time in microtime. + * + * @return float + */ + public function lag( $now = null ) { + return (float) $this->queue_storage->get_lag( $now ); + } + + /** + * Resets the queue. + */ + public function reset() { + $this->delete_checkout_id(); + + $this->queue_storage->clear_queue(); + } + + /** + * Return the size of the queue. + * + * @return int + */ + public function size() { + return $this->queue_storage->get_item_count(); + } + + /** + * Lets you know if there is any items in the queue. + * + * We use this peculiar implementation because it's much faster than count(*). + * + * @return bool + */ + public function has_any_items() { + return $this->size() > 0; + } + + /** + * Used to checkout the queue. + * + * @param int $buffer_size Size of the buffer to checkout. + * + * @return \Automattic\Jetpack\Sync\Queue_Buffer|bool|int|\WP_Error + */ + public function checkout( $buffer_size ) { + if ( $this->get_checkout_id() ) { + return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' ); + } + + // TODO check if adding a prefix is going to be a problem + $buffer_id = uniqid( '', true ); + + $result = $this->set_checkout_id( $buffer_id ); + + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + $items = $this->fetch_items( $buffer_size ); + + if ( ! is_countable( $items ) ) { + return false; + } + + if ( count( $items ) === 0 ) { + return false; + } + + return new Queue_Buffer( $buffer_id, array_slice( $items, 0, $buffer_size ) ); + } + + /** + * Given a list of items return the items ids. + * + * @param array $items List of item objects. + * + * @return array Ids of the items. + */ + public function get_ids( $items ) { + return array_map( + function ( $item ) { + return $item->id; + }, + $items + ); + } + + /** + * Pop elements from the queue. + * + * @param int $limit Number of items to pop from the queue. + * + * @return array|object|null + */ + public function pop( $limit ) { + $items = $this->fetch_items( $limit ); + + $ids = $this->get_ids( $items ); + + $this->delete( $ids ); + + return $items; + } + + /** + * Get the items from the queue with a memory limit. + * + * This checks out rows until it either empties the queue or hits a certain memory limit + * it loads the sizes from the DB first so that it doesn't accidentally + * load more data into memory than it needs to. + * The only way it will load more items than $max_size is if a single queue item + * exceeds the memory limit, but in that case it will send that item by itself. + * + * @param int $max_memory (bytes) Maximum memory threshold. + * @param int $max_buffer_size Maximum buffer size (number of items). + * + * @return \Automattic\Jetpack\Sync\Queue_Buffer|bool|int|\WP_Error + */ + public function checkout_with_memory_limit( $max_memory, $max_buffer_size = 500 ) { + if ( $this->get_checkout_id() ) { + return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' ); + } + + $buffer_id = uniqid( '', true ); + + $result = $this->set_checkout_id( $buffer_id ); + + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + // How much memory is currently being used by the items. + $total_memory = 0; + + // Store the items to return + $items = array(); + + $current_items_ids = $this->queue_storage->get_items_ids_with_size( $max_buffer_size - count( $items ) ); + + // If no valid items are returned or no items are returned, continue. + if ( ! is_countable( $current_items_ids ) || count( $current_items_ids ) === 0 ) { + return false; + } + + $item_ids_to_fetch = array(); + + foreach ( $current_items_ids as $id => $item_with_size ) { + $total_memory += $item_with_size->value_size; + + // If this is the first item and it exceeds memory, allow loop to continue + // we will exit on the next iteration instead. + if ( $total_memory > $max_memory && $id > 0 ) { + break; + } + + $item_ids_to_fetch[] = $item_with_size->id; + } + + $current_items = $this->queue_storage->fetch_items_by_ids( $item_ids_to_fetch ); + + $items_count = is_countable( $current_items ) ? count( $current_items ) : 0; + + if ( $items_count > 0 ) { + /** + * Save some memory by moving things one by one to the array of items being returned, instead of + * unserializing all and then merging them with other items. + * + * PHPCS ignore is because this is the expected behavior - we're assigning a variable in the condition part of the loop. + */ + // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition + while ( ( $current_item = array_shift( $current_items ) ) !== null ) { + // @codingStandardsIgnoreStart + $current_item->value = unserialize( $current_item->value ); + // @codingStandardsIgnoreEnd + + $items[] = $current_item; + } + } + + if ( count( $items ) === 0 ) { + $this->delete_checkout_id(); + + return false; + } + + return new Queue_Buffer( $buffer_id, $items ); + } + + /** + * Check in the queue. + * + * @param \Automattic\Jetpack\Sync\Queue_Buffer $buffer Queue_Buffer object. + * + * @return bool|\WP_Error + */ + public function checkin( $buffer ) { + $is_valid = $this->validate_checkout( $buffer ); + + if ( is_wp_error( $is_valid ) ) { + return $is_valid; + } + + $this->delete_checkout_id(); + + return true; + } + + /** + * Close the buffer. + * + * @param \Automattic\Jetpack\Sync\Queue_Buffer $buffer Queue_Buffer object. + * @param null|array $ids_to_remove Ids to remove from the queue. + * + * @return bool|\WP_Error + */ + public function close( $buffer, $ids_to_remove = null ) { + $is_valid = $this->validate_checkout( $buffer ); + + if ( is_wp_error( $is_valid ) ) { + // Always delete ids_to_remove even when buffer is no longer checked-out. + // They were processed by WP.com so safe to remove from queue. + if ( $ids_to_remove !== null ) { + $this->delete( $ids_to_remove ); + } + return $is_valid; + } + + $this->delete_checkout_id(); + + // By default clear all items in the buffer. + if ( $ids_to_remove === null ) { + $ids_to_remove = $buffer->get_item_ids(); + } + + $this->delete( $ids_to_remove ); + + return true; + } + + /** + * Delete elements from the queue. + * + * @param array $ids Ids to delete. + * + * @return bool|int + */ + private function delete( $ids ) { + if ( array() === $ids ) { + return 0; + } + + $this->queue_storage->delete_items_by_ids( $ids ); + + return true; + } + + /** + * Flushes all items from the queue. + * + * @return array + */ + public function flush_all() { + $items = Utils::get_item_values( $this->fetch_items() ); + $this->reset(); + + return $items; + } + + /** + * Get all the items from the queue. + * + * @return array|object|null + */ + public function get_all() { + return $this->fetch_items(); + } + + /** + * Forces Checkin of the queue. + * Use with caution, this could allow multiple processes to delete + * and send from the queue at the same time + */ + public function force_checkin() { + $this->delete_checkout_id(); + } + + /** + * Checks if the queue is locked. + * + * @return bool + */ + public function is_locked() { + return (bool) $this->get_checkout_id(); + } + + /** + * Locks checkouts from the queue + * tries to wait up to $timeout seconds for the queue to be empty. + * + * @param int $timeout The wait time in seconds for the queue to be empty. + * + * @return bool|int|\WP_Error + */ + public function lock( $timeout = 30 ) { + $tries = 0; + + while ( $this->has_any_items() && $tries < $timeout ) { + sleep( 1 ); + ++$tries; + } + + if ( 30 === $tries ) { + return new WP_Error( 'lock_timeout', 'Timeout waiting for sync queue to empty' ); + } + + if ( $this->get_checkout_id() ) { + return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' ); + } + + // Hopefully this means we can acquire a checkout? + $result = $this->set_checkout_id( 'lock' ); + + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Unlocks the queue. + * + * @return bool|int + */ + public function unlock() { + return $this->delete_checkout_id(); + } + + /** + * This option is specifically chosen to, as much as possible, preserve time order + * and minimise the possibility of collisions between multiple processes working + * at the same time. + * + * @return string + */ + protected function generate_option_name_timestamp() { + return sprintf( '%.6f', microtime( true ) ); + } + + /** + * Gets the checkout ID. + * + * @return bool|string + */ + private function get_checkout_id() { + global $wpdb; + $checkout_value = $wpdb->get_var( + $wpdb->prepare( + "SELECT option_value FROM $wpdb->options WHERE option_name = %s", + $this->get_lock_option_name() + ) + ); + + if ( $checkout_value ) { + list( $checkout_id, $timestamp ) = explode( ':', $checkout_value ); + if ( (int) $timestamp > time() ) { + return $checkout_id; + } + } + + return false; + } + + /** + * Sets the checkout id. + * + * @param string $checkout_id The ID of the checkout. + * + * @return bool|int + */ + private function set_checkout_id( $checkout_id ) { + global $wpdb; + + $expires = time() + Defaults::$default_sync_queue_lock_timeout; + $updated_num = $wpdb->query( + $wpdb->prepare( + "UPDATE $wpdb->options SET option_value = %s WHERE option_name = %s", + "$checkout_id:$expires", + $this->get_lock_option_name() + ) + ); + + if ( ! $updated_num ) { + $updated_num = $wpdb->query( + $wpdb->prepare( + "INSERT INTO $wpdb->options ( option_name, option_value, autoload ) VALUES ( %s, %s, 'no' )", + $this->get_lock_option_name(), + "$checkout_id:$expires" + ) + ); + } + + return $updated_num; + } + + /** + * Deletes the checkout ID. + * + * @return bool|int + */ + private function delete_checkout_id() { + global $wpdb; + // Rather than delete, which causes fragmentation, we update in place. + return $wpdb->query( + $wpdb->prepare( + "UPDATE $wpdb->options SET option_value = %s WHERE option_name = %s", + '0:0', + $this->get_lock_option_name() + ) + ); + } + + /** + * Return the lock option name. + * + * @return string + */ + private function get_lock_option_name() { + return "jpsq_{$this->id}_checkout"; + } + + /** + * Return the next data row option name. + * + * @return string + */ + private function get_next_data_row_option_name() { + $timestamp = $this->generate_option_name_timestamp(); + + // Row iterator is used to avoid collisions where we're writing data waaay fast in a single process. + if ( PHP_INT_MAX === $this->row_iterator ) { + $this->row_iterator = 0; + } else { + $this->row_iterator += 1; + } + + return 'jpsq_' . $this->id . '-' . $timestamp . '-' . $this->random_int . '-' . $this->row_iterator; + } + + /** + * Return the items in the queue. + * + * @param null|int $limit Limit to the number of items we fetch at once. + * + * @return array|object|null + */ + private function fetch_items( $limit = null ) { + $items = $this->queue_storage->fetch_items( $limit ); + + return $this->unserialize_values( $items ); + } + + /** + * Return items with specific ids. + * + * @param array $items_ids Array of event ids. + * + * @return array|object|null + */ + private function fetch_items_by_id( $items_ids ) { + return $this->unserialize_values( $this->queue_storage->fetch_items_by_ids( $items_ids ) ); + } + + /** + * Unserialize item values. + * + * @param array $items Events from the Queue to be unserialized. + * + * @return mixed + */ + private function unserialize_values( $items ) { + array_walk( + $items, + function ( $item ) { + // @codingStandardsIgnoreStart + $item->value = @unserialize( $item->value ); + // @codingStandardsIgnoreEnd + } + ); + + return $items; + } + + /** + * Return true if the buffer is still valid or an Error other wise. + * + * @param \Automattic\Jetpack\Sync\Queue_Buffer $buffer The Queue_Buffer. + * + * @return bool|WP_Error + */ + private function validate_checkout( $buffer ) { + if ( ! $buffer instanceof Queue_Buffer ) { + return new WP_Error( 'not_a_buffer', 'You must checkin an instance of Automattic\\Jetpack\\Sync\\Queue_Buffer' ); + } + + $checkout_id = $this->get_checkout_id(); + + if ( ! $checkout_id ) { + return new WP_Error( 'buffer_not_checked_out', 'There are no checked out buffers' ); + } + + // TODO: change to strict comparison. + if ( $checkout_id != $buffer->id ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual + return new WP_Error( 'buffer_mismatch', 'The buffer you checked in was not checked out' ); + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php new file mode 100644 index 00000000..06c0188a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php @@ -0,0 +1,1479 @@ +query( "DELETE FROM $wpdb->posts" ); + + // Delete comments from cache. + $comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments" ); + if ( ! empty( $comment_ids ) ) { + clean_comment_cache( $comment_ids ); + } + $wpdb->query( "DELETE FROM $wpdb->comments" ); + + // Also need to delete terms from cache. + $term_ids = $wpdb->get_col( "SELECT term_id FROM $wpdb->terms" ); + foreach ( $term_ids as $term_id ) { + wp_cache_delete( $term_id, 'terms' ); + } + + $wpdb->query( "DELETE FROM $wpdb->terms" ); + + $wpdb->query( "DELETE FROM $wpdb->term_taxonomy" ); + $wpdb->query( "DELETE FROM $wpdb->term_relationships" ); + + // Callables and constants. + $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'jetpack_%'" ); + $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key NOT LIKE '\_%'" ); + } + + /** + * Ran when full sync has just started. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + */ + public function full_sync_start( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->reset(); + } + + /** + * Ran when full sync has just finished. + * + * @access public + * + * @param string $checksum Deprecated since 7.3.0. + */ + public function full_sync_end( $checksum ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // Noop right now. + } + + /** + * Retrieve the number of terms. + * + * @access public + * + * @return int Number of terms. + */ + public function term_count() { + global $wpdb; + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + return (int) $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->terms" ); + } + + /** + * Retrieve the number of rows in the `term_taxonomy` table. + * + * @access public + * + * @return int Number of terms. + */ + public function term_taxonomy_count() { + global $wpdb; + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + return (int) $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->term_taxonomy" ); + } + + /** + * Retrieve the number of term relationships. + * + * @access public + * + * @return int Number of rows in the term relationships table. + */ + public function term_relationship_count() { + global $wpdb; + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + return (int) $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->term_relationships" ); + } + + /** + * Retrieve the number of posts with a particular post status within a certain range. + * + * @access public + * + * @todo Prepare the SQL query before executing it. + * + * @param string $status Post status. + * @param int $min_id Minimum post ID. + * @param int $max_id Maximum post ID. + * @return int Number of posts. + */ + public function post_count( $status = null, $min_id = null, $max_id = null ) { + global $wpdb; + + $where = ''; + + if ( $status ) { + $where = "post_status = '" . esc_sql( $status ) . "'"; + } else { + $where = '1=1'; + } + + if ( ! empty( $min_id ) ) { + $where .= ' AND ID >= ' . (int) $min_id; + } + + if ( ! empty( $max_id ) ) { + $where .= ' AND ID <= ' . (int) $max_id; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + return (int) $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE $where" ); + } + + /** + * Retrieve the posts with a particular post status. + * + * @access public + * + * @todo Implement range and actually use max_id/min_id arguments. + * + * @param string $status Post status. + * @param int $min_id Minimum post ID. + * @param int $max_id Maximum post ID. + * @return array Array of posts. + */ + public function get_posts( $status = null, $min_id = null, $max_id = null ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $args = array( + 'orderby' => 'ID', + 'posts_per_page' => -1, + ); + + if ( $status ) { + $args['post_status'] = $status; + } else { + $args['post_status'] = 'any'; + } + + return get_posts( $args ); + } + + /** + * Retrieve a post object by the post ID. + * + * @access public + * + * @param int $id Post ID. + * @return \WP_Post Post object. + */ + public function get_post( $id ) { + return get_post( $id ); + } + + /** + * Update or insert a post. + * + * @access public + * + * @param \WP_Post $post Post object. + * @param bool $silent Whether to perform a silent action. Not used in this implementation. + */ + public function upsert_post( $post, $silent = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + global $wpdb; + + // Reject the post if it's not a \WP_Post. + if ( ! $post instanceof \WP_Post ) { + return; + } + + $post = $post->to_array(); + + // Reject posts without an ID. + if ( ! isset( $post['ID'] ) ) { + return; + } + + $now = current_time( 'mysql' ); + $now_gmt = get_gmt_from_date( $now ); + + $defaults = array( + 'ID' => 0, + 'post_author' => '0', + 'post_content' => '', + 'post_content_filtered' => '', + 'post_title' => '', + 'post_name' => '', + 'post_excerpt' => '', + 'post_status' => 'draft', + 'post_type' => 'post', + 'comment_status' => 'closed', + 'comment_count' => '0', + 'ping_status' => '', + 'post_password' => '', + 'to_ping' => '', + 'pinged' => '', + 'post_parent' => 0, + 'menu_order' => 0, + 'guid' => '', + 'post_date' => $now, + 'post_date_gmt' => $now_gmt, + 'post_modified' => $now, + 'post_modified_gmt' => $now_gmt, + ); + + $post = array_intersect_key( $post, $defaults ); + + $post = sanitize_post( $post, 'db' ); + + unset( $post['filter'] ); + + $exists = $wpdb->get_var( $wpdb->prepare( "SELECT EXISTS( SELECT 1 FROM $wpdb->posts WHERE ID = %d )", $post['ID'] ) ); + + if ( $exists ) { + $wpdb->update( $wpdb->posts, $post, array( 'ID' => $post['ID'] ) ); + } else { + $wpdb->insert( $wpdb->posts, $post ); + } + + clean_post_cache( $post['ID'] ); + } + + /** + * Delete a post by the post ID. + * + * @access public + * + * @param int $post_id Post ID. + */ + public function delete_post( $post_id ) { + wp_delete_post( $post_id, true ); + } + + /** + * Retrieve the checksum for posts within a range. + * + * @access public + * + * @param int $min_id Minimum post ID. + * @param int $max_id Maximum post ID. + * @return int The checksum. + */ + public function posts_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'posts', null, $min_id, $max_id ) ); + } + + /** + * Retrieve the checksum for post meta within a range. + * + * @access public + * + * @param int $min_id Minimum post meta ID. + * @param int $max_id Maximum post meta ID. + * @return int The checksum. + */ + public function post_meta_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'postmeta', null, $min_id, $max_id ) ); + } + + /** + * Retrieve the number of comments with a particular comment status within a certain range. + * + * @access public + * + * @todo Prepare the SQL query before executing it. + * + * @param string $status Comment status. + * @param int $min_id Minimum comment ID. + * @param int $max_id Maximum comment ID. + * @return int Number of comments. + */ + public function comment_count( $status = null, $min_id = null, $max_id = null ) { + global $wpdb; + + $comment_approved = $this->comment_status_to_approval_value( $status ); + + if ( false !== $comment_approved ) { + $where = "comment_approved = '" . esc_sql( $comment_approved ) . "'"; + } else { + $where = '1=1'; + } + + if ( ! empty( $min_id ) ) { + $where .= ' AND comment_ID >= ' . (int) $min_id; + } + + if ( ! empty( $max_id ) ) { + $where .= ' AND comment_ID <= ' . (int) $max_id; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + return (int) $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE $where" ); + } + + /** + * Translate a comment status to a value of the comment_approved field. + * + * @access protected + * + * @param string $status Comment status. + * @return string|bool New comment_approved value, false if the status doesn't affect it. + */ + protected function comment_status_to_approval_value( $status ) { + switch ( (string) $status ) { + case 'approve': + case '1': + return '1'; + case 'hold': + case '0': + return '0'; + case 'spam': + return 'spam'; + case 'trash': + return 'trash'; + case 'post-trashed': + return 'post-trashed'; + case 'any': + case 'all': + default: + return false; + } + } + + /** + * Retrieve the comments with a particular comment status. + * + * @access public + * + * @todo Implement range and actually use max_id/min_id arguments. + * + * @param string $status Comment status. + * @param int $min_id Minimum comment ID. + * @param int $max_id Maximum comment ID. + * @return array Array of comments. + */ + public function get_comments( $status = null, $min_id = null, $max_id = null ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $args = array( + 'orderby' => 'ID', + 'status' => 'all', + ); + + if ( $status ) { + $args['status'] = $status; + } + + return get_comments( $args ); + } + + /** + * Retrieve a comment object by the comment ID. + * + * @access public + * + * @param int $id Comment ID. + * @return \WP_Comment Comment object. + */ + public function get_comment( $id ) { + return \WP_Comment::get_instance( $id ); + } + + /** + * Update or insert a comment. + * + * @access public + * + * @param \WP_Comment $comment Comment object. + */ + public function upsert_comment( $comment ) { + global $wpdb; + + $comment = $comment->to_array(); + + // Filter by fields on comment table. + $comment_fields_whitelist = array( + 'comment_ID', + 'comment_post_ID', + 'comment_author', + 'comment_author_email', + 'comment_author_url', + 'comment_author_IP', + 'comment_date', + 'comment_date_gmt', + 'comment_content', + 'comment_karma', + 'comment_approved', + 'comment_agent', + 'comment_type', + 'comment_parent', + 'user_id', + ); + + foreach ( $comment as $key => $value ) { + if ( ! in_array( $key, $comment_fields_whitelist, true ) ) { + unset( $comment[ $key ] ); + } + } + + $exists = $wpdb->get_var( + $wpdb->prepare( + "SELECT EXISTS( SELECT 1 FROM $wpdb->comments WHERE comment_ID = %d )", + $comment['comment_ID'] + ) + ); + + if ( $exists ) { + $wpdb->update( $wpdb->comments, $comment, array( 'comment_ID' => $comment['comment_ID'] ) ); + } else { + $wpdb->insert( $wpdb->comments, $comment ); + } + // Remove comment from cache. + clean_comment_cache( $comment['comment_ID'] ); + + wp_update_comment_count( $comment['comment_post_ID'] ); + } + + /** + * Trash a comment by the comment ID. + * + * @access public + * + * @param int $comment_id Comment ID. + */ + public function trash_comment( $comment_id ) { + wp_delete_comment( $comment_id ); + } + + /** + * Delete a comment by the comment ID. + * + * @access public + * + * @param int $comment_id Comment ID. + */ + public function delete_comment( $comment_id ) { + wp_delete_comment( $comment_id, true ); + } + + /** + * Mark a comment by the comment ID as spam. + * + * @access public + * + * @param int $comment_id Comment ID. + */ + public function spam_comment( $comment_id ) { + wp_spam_comment( $comment_id ); + } + + /** + * Trash the comments of a post. + * + * @access public + * + * @param int $post_id Post ID. + * @param array $statuses Post statuses. Not used in this implementation. + */ + public function trashed_post_comments( $post_id, $statuses ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + wp_trash_post_comments( $post_id ); + } + + /** + * Untrash the comments of a post. + * + * @access public + * + * @param int $post_id Post ID. + */ + public function untrashed_post_comments( $post_id ) { + wp_untrash_post_comments( $post_id ); + } + + /** + * Retrieve the checksum for comments within a range. + * + * @access public + * + * @param int $min_id Minimum comment ID. + * @param int $max_id Maximum comment ID. + * @return int The checksum. + */ + public function comments_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'comments', null, $min_id, $max_id ) ); + } + + /** + * Retrieve the checksum for comment meta within a range. + * + * @access public + * + * @param int $min_id Minimum comment meta ID. + * @param int $max_id Maximum comment meta ID. + * @return int The checksum. + */ + public function comment_meta_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'commentmeta', null, $min_id, $max_id ) ); + } + + /** + * Update the value of an option. + * + * @access public + * + * @param string $option Option name. + * @param mixed $value Option value. + * @return bool False if value was not updated and true if value was updated. + */ + public function update_option( $option, $value ) { + return update_option( $option, $value ); + } + + /** + * Retrieve an option value based on an option name. + * + * @access public + * + * @param string $option Name of option to retrieve. + * @param mixed $default Optional. Default value to return if the option does not exist. + * @return mixed Value set for the option. + */ + public function get_option( $option, $default = false ) { + return get_option( $option, $default ); + } + + /** + * Remove an option by name. + * + * @access public + * + * @param string $option Name of option to remove. + * @return bool True, if option is successfully deleted. False on failure. + */ + public function delete_option( $option ) { + return delete_option( $option ); + } + + /** + * Change the info of the current theme. + * + * @access public + * + * @param array $theme_info Theme info array. + */ + public function set_theme_info( $theme_info ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // Noop. + } + + /** + * Whether the current theme supports a certain feature. + * + * @access public + * + * @param string $feature Name of the feature. + */ + public function current_theme_supports( $feature ) { + return current_theme_supports( $feature ); + } + + /** + * Retrieve metadata for the specified object. + * + * @access public + * + * @param string $type Meta type. + * @param int $object_id ID of the object. + * @param string $meta_key Meta key. + * @param bool $single If true, return only the first value of the specified meta_key. + * + * @return mixed Single metadata value, or array of values. + */ + public function get_metadata( $type, $object_id, $meta_key = '', $single = false ) { + return get_metadata( $type, $object_id, $meta_key, $single ); + } + + /** + * Stores remote meta key/values alongside an ID mapping key. + * + * @access public + * + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param string $type Meta type. + * @param int $object_id ID of the object. + * @param string $meta_key Meta key. + * @param mixed $meta_value Meta value. + * @param int $meta_id ID of the meta. + * + * @return bool False if meta table does not exist, true otherwise. + */ + public function upsert_metadata( $type, $object_id, $meta_key, $meta_value, $meta_id ) { + $table = _get_meta_table( $type ); + if ( ! $table ) { + return false; + } + + global $wpdb; + + $exists = $wpdb->get_var( + $wpdb->prepare( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT EXISTS( SELECT 1 FROM $table WHERE meta_id = %d )", + $meta_id + ) + ); + + if ( $exists ) { + $wpdb->update( + $table, + array( + 'meta_key' => $meta_key, + 'meta_value' => maybe_serialize( $meta_value ), + ), + array( 'meta_id' => $meta_id ) + ); + } else { + $object_id_field = $type . '_id'; + $wpdb->insert( + $table, + array( + 'meta_id' => $meta_id, + $object_id_field => $object_id, + 'meta_key' => $meta_key, + 'meta_value' => maybe_serialize( $meta_value ), + ) + ); + } + + wp_cache_delete( $object_id, $type . '_meta' ); + + return true; + } + + /** + * Delete metadata for the specified object. + * + * @access public + * + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param string $type Meta type. + * @param int $object_id ID of the object. + * @param array $meta_ids IDs of the meta objects to delete. + */ + public function delete_metadata( $type, $object_id, $meta_ids ) { + global $wpdb; + + $table = _get_meta_table( $type ); + if ( ! $table ) { + return false; + } + + foreach ( $meta_ids as $meta_id ) { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE meta_id = %d", $meta_id ) ); + } + + // If we don't have an object ID what do we do - invalidate ALL meta? + if ( $object_id ) { + wp_cache_delete( $object_id, $type . '_meta' ); + } + } + + /** + * Delete metadata with a certain key for the specified objects. + * + * @access public + * + * @todo Test this out to make sure it works as expected. + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param string $type Meta type. + * @param array $object_ids IDs of the objects. + * @param string $meta_key Meta key. + */ + public function delete_batch_metadata( $type, $object_ids, $meta_key ) { + global $wpdb; + + $table = _get_meta_table( $type ); + if ( ! $table ) { + return false; + } + $column = sanitize_key( $type . '_id' ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE $column IN (%s) && meta_key = %s", implode( ',', $object_ids ), $meta_key ) ); + + // If we don't have an object ID what do we do - invalidate ALL meta? + foreach ( $object_ids as $object_id ) { + wp_cache_delete( $object_id, $type . '_meta' ); + } + } + + /** + * Retrieve value of a constant based on the constant name. + * + * We explicitly return null instead of false if the constant doesn't exist. + * + * @access public + * + * @param string $constant Name of constant to retrieve. + * @return mixed Value set for the constant. + */ + public function get_constant( $constant ) { + $value = get_option( 'jetpack_constant_' . $constant ); + + if ( $value ) { + return $value; + } + + return null; + } + + /** + * Set the value of a constant. + * + * @access public + * + * @param string $constant Name of constant to retrieve. + * @param mixed $value Value set for the constant. + */ + public function set_constant( $constant, $value ) { + update_option( 'jetpack_constant_' . $constant, $value ); + } + + /** + * Retrieve the number of the available updates of a certain type. + * Type is one of: `plugins`, `themes`, `wordpress`, `translations`, `total`, `wp_update_version`. + * + * @access public + * + * @param string $type Type of updates to retrieve. + * @return int|null Number of updates available, `null` if type is invalid or missing. + */ + public function get_updates( $type ) { + $all_updates = get_option( 'jetpack_updates', array() ); + + if ( isset( $all_updates[ $type ] ) ) { + return $all_updates[ $type ]; + } else { + return null; + } + } + + /** + * Set the available updates of a certain type. + * Type is one of: `plugins`, `themes`, `wordpress`, `translations`, `total`, `wp_update_version`. + * + * @access public + * + * @param string $type Type of updates to set. + * @param int $updates Total number of updates. + */ + public function set_updates( $type, $updates ) { + $all_updates = get_option( 'jetpack_updates', array() ); + $all_updates[ $type ] = $updates; + update_option( 'jetpack_updates', $all_updates ); + } + + /** + * Retrieve a callable value based on its name. + * + * @access public + * + * @param string $name Name of the callable to retrieve. + * @return mixed Value of the callable. + */ + public function get_callable( $name ) { + $value = get_option( 'jetpack_' . $name ); + + if ( $value ) { + return $value; + } + + return null; + } + + /** + * Update the value of a callable. + * + * @access public + * + * @param string $name Callable name. + * @param mixed $value Callable value. + */ + public function set_callable( $name, $value ) { + update_option( 'jetpack_' . $name, $value ); + } + + /** + * Retrieve a network option value based on a network option name. + * + * @access public + * + * @param string $option Name of network option to retrieve. + * @return mixed Value set for the network option. + */ + public function get_site_option( $option ) { + return get_option( 'jetpack_network_' . $option ); + } + + /** + * Update the value of a network option. + * + * @access public + * + * @param string $option Network option name. + * @param mixed $value Network option value. + * @return bool False if value was not updated and true if value was updated. + */ + public function update_site_option( $option, $value ) { + return update_option( 'jetpack_network_' . $option, $value ); + } + + /** + * Remove a network option by name. + * + * @access public + * + * @param string $option Name of option to remove. + * @return bool True, if option is successfully deleted. False on failure. + */ + public function delete_site_option( $option ) { + return delete_option( 'jetpack_network_' . $option ); + } + + /** + * Retrieve the terms from a particular taxonomy. + * + * @access public + * + * @param string $taxonomy Taxonomy slug. + * + * @return array|WP_Error Array of terms or WP_Error object on failure. + */ + public function get_terms( $taxonomy ) { + $t = $this->ensure_taxonomy( $taxonomy ); + if ( ! $t || is_wp_error( $t ) ) { + return $t; + } + return get_terms( $taxonomy ); + } + + /** + * Retrieve a particular term. + * + * @access public + * + * @param string|false $taxonomy Taxonomy slug. + * @param int $term_id ID of the term. + * @param string $term_key ID Field `term_id` or `term_taxonomy_id`. + * + * @return \WP_Term|WP_Error Term object on success, \WP_Error object on failure. + */ + public function get_term( $taxonomy, $term_id, $term_key = 'term_id' ) { + + // Full Sync will pass false for the $taxonomy so a check for term_taxonomy_id is needed before ensure_taxonomy. + if ( 'term_taxonomy_id' === $term_key ) { + return get_term_by( 'term_taxonomy_id', $term_id ); + } + + $t = $this->ensure_taxonomy( $taxonomy ); + if ( ! $t || is_wp_error( $t ) ) { + return $t; + } + + return get_term( $term_id, $taxonomy ); + } + + /** + * Verify a taxonomy is legitimate and register it if necessary. + * + * @access private + * + * @param string $taxonomy Taxonomy slug. + * + * @return bool|void|WP_Error True if already exists; void if it was registered; \WP_Error on error. + */ + private function ensure_taxonomy( $taxonomy ) { + if ( ! taxonomy_exists( $taxonomy ) ) { + // Try re-registering synced taxonomies. + $taxonomies = $this->get_callable( 'taxonomies' ); + if ( ! isset( $taxonomies[ $taxonomy ] ) ) { + // Doesn't exist, or somehow hasn't been synced. + return new WP_Error( 'invalid_taxonomy', "The taxonomy '$taxonomy' doesn't exist" ); + } + $t = $taxonomies[ $taxonomy ]; + + return register_taxonomy( + $taxonomy, + $t->object_type, + (array) $t + ); + } + + return true; + } + + /** + * Retrieve all terms from a taxonomy that are related to an object with a particular ID. + * + * @access public + * + * @param int $object_id Object ID. + * @param string $taxonomy Taxonomy slug. + * + * @return array|bool|WP_Error Array of terms on success, `false` if no terms or post doesn't exist, \WP_Error on failure. + */ + public function get_the_terms( $object_id, $taxonomy ) { + return get_the_terms( $object_id, $taxonomy ); + } + + /** + * Insert or update a term. + * + * @access public + * + * @param \WP_Term $term_object Term object. + * + * @return array|bool|WP_Error Array of term_id and term_taxonomy_id if updated, true if inserted, \WP_Error on failure. + */ + public function update_term( $term_object ) { + $taxonomy = $term_object->taxonomy; + global $wpdb; + $exists = $wpdb->get_var( + $wpdb->prepare( + "SELECT EXISTS( SELECT 1 FROM $wpdb->terms WHERE term_id = %d )", + $term_object->term_id + ) + ); + if ( ! $exists ) { + $term_object = sanitize_term( clone $term_object, $taxonomy, 'db' ); + $term = array( + 'term_id' => $term_object->term_id, + 'name' => $term_object->name, + 'slug' => $term_object->slug, + 'term_group' => $term_object->term_group, + ); + $term_taxonomy = array( + 'term_taxonomy_id' => $term_object->term_taxonomy_id, + 'term_id' => $term_object->term_id, + 'taxonomy' => $term_object->taxonomy, + 'description' => $term_object->description, + 'parent' => (int) $term_object->parent, + 'count' => (int) $term_object->count, + ); + $wpdb->insert( $wpdb->terms, $term ); + $wpdb->insert( $wpdb->term_taxonomy, $term_taxonomy ); + + return true; + } + + return wp_update_term( $term_object->term_id, $taxonomy, (array) $term_object ); + } + + /** + * Delete a term by the term ID and its corresponding taxonomy. + * + * @access public + * + * @param int $term_id Term ID. + * @param string $taxonomy Taxonomy slug. + * + * @return bool|int|WP_Error True on success, false if term doesn't exist. Zero if trying with default category. \WP_Error on invalid taxonomy. + */ + public function delete_term( $term_id, $taxonomy ) { + $this->ensure_taxonomy( $taxonomy ); + return wp_delete_term( $term_id, $taxonomy ); + } + + /** + * Add/update terms of a particular taxonomy of an object with the specified ID. + * + * @access public + * + * @param int $object_id The object to relate to. + * @param string $taxonomy The context in which to relate the term to the object. + * @param string|int|array $terms A single term slug, single term id, or array of either term slugs or ids. + * @param bool $append Optional. If false will delete difference of terms. Default false. + */ + public function update_object_terms( $object_id, $taxonomy, $terms, $append ) { + $this->ensure_taxonomy( $taxonomy ); + wp_set_object_terms( $object_id, $terms, $taxonomy, $append ); + } + + /** + * Remove certain term relationships from the specified object. + * + * @access public + * + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param int $object_id ID of the object. + * @param array $tt_ids Term taxonomy IDs. + * @return bool True on success, false on failure. + */ + public function delete_object_terms( $object_id, $tt_ids ) { + global $wpdb; + + if ( is_array( $tt_ids ) && ! empty( $tt_ids ) ) { + // Escape. + $tt_ids_sanitized = array_map( 'intval', $tt_ids ); + + $taxonomies = array(); + foreach ( $tt_ids_sanitized as $tt_id ) { + $term = get_term_by( 'term_taxonomy_id', $tt_id ); + $taxonomies[ $term->taxonomy ][] = $tt_id; + } + $in_tt_ids = implode( ', ', $tt_ids_sanitized ); + + /** + * Fires immediately before an object-term relationship is deleted. + * + * @since 1.6.3 + * @since-jetpack 2.9.0 + * + * @param int $object_id Object ID. + * @param array $tt_ids An array of term taxonomy IDs. + */ + do_action( 'delete_term_relationships', $object_id, $tt_ids_sanitized ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) ); + foreach ( $taxonomies as $taxonomy => $taxonomy_tt_ids ) { + $this->ensure_taxonomy( $taxonomy ); + wp_cache_delete( $object_id, $taxonomy . '_relationships' ); + /** + * Fires immediately after an object-term relationship is deleted. + * + * @since 1.6.3 + * @since-jetpack 2.9.0 + * + * @param int $object_id Object ID. + * @param array $tt_ids An array of term taxonomy IDs. + */ + do_action( 'deleted_term_relationships', $object_id, $taxonomy_tt_ids ); + wp_update_term_count( $taxonomy_tt_ids, $taxonomy ); + } + + return (bool) $deleted; + } + + return false; + } + + /** + * Retrieve the number of users. + * Not supported in this replicastore. + * + * @access public + */ + public function user_count() { + // Noop. + } + + /** + * Retrieve a user object by the user ID. + * + * @access public + * + * @param int $user_id User ID. + * @return \WP_User|null User object, or `null` if user invalid/not found. + */ + public function get_user( $user_id ) { + $user = get_user_by( 'id', $user_id ); + return $user instanceof \WP_User ? $user : null; + } + + /** + * Insert or update a user. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param \WP_User $user User object. + */ + public function upsert_user( $user ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Delete a user. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param int $user_id User ID. + */ + public function delete_user( $user_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Update/insert user locale. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param int $user_id User ID. + * @param string $local The user locale. + */ + public function upsert_user_locale( $user_id, $local ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Delete user locale. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param int $user_id User ID. + */ + public function delete_user_locale( $user_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Retrieve the user locale. + * + * @access public + * + * @param int $user_id User ID. + * @return string The user locale. + */ + public function get_user_locale( $user_id ) { + return get_user_locale( $user_id ); + } + + /** + * Retrieve the allowed mime types for the user. + * Not supported in this replicastore. + * + * @access public + * + * @param int $user_id User ID. + */ + public function get_allowed_mime_types( $user_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // Noop. + } + + /** + * Retrieve all the checksums we are interested in. + * + * @access public + * + * @param boolean $perform_text_conversion If text fields should be latin1 converted. + * + * @return array Checksums. + */ + public function checksum_all( $perform_text_conversion = false ) { + $post_checksum = $this->checksum_histogram( 'posts', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $comments_checksum = $this->checksum_histogram( 'comments', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $post_meta_checksum = $this->checksum_histogram( 'postmeta', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $comment_meta_checksum = $this->checksum_histogram( 'commentmeta', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $terms_checksum = $this->checksum_histogram( 'terms', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $term_relationships_checksum = $this->checksum_histogram( 'term_relationships', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $term_taxonomy_checksum = $this->checksum_histogram( 'term_taxonomy', null, null, null, null, true, '', false, false, $perform_text_conversion ); + + $result = array( + 'posts' => $this->summarize_checksum_histogram( $post_checksum ), + 'comments' => $this->summarize_checksum_histogram( $comments_checksum ), + 'post_meta' => $this->summarize_checksum_histogram( $post_meta_checksum ), + 'comment_meta' => $this->summarize_checksum_histogram( $comment_meta_checksum ), + 'terms' => $this->summarize_checksum_histogram( $terms_checksum ), + 'term_relationships' => $this->summarize_checksum_histogram( $term_relationships_checksum ), + 'term_taxonomy' => $this->summarize_checksum_histogram( $term_taxonomy_checksum ), + ); + + /** + * WooCommerce tables + */ + + /** + * On WordPress.com, we can't directly check if the site has support for WooCommerce. + * Having the option to override the functionality here helps with syncing WooCommerce tables. + * + * @since 10.1 + * + * @param bool If we should we force-enable WooCommerce tables support. + */ + $force_woocommerce_support = apply_filters( 'jetpack_table_checksum_force_enable_woocommerce', false ); + + if ( $force_woocommerce_support || class_exists( 'WooCommerce' ) ) { + /** + * Guard in Try/Catch as it's possible for the WooCommerce class to exist, but + * the tables to not. If we don't do this, the response will be just the exception, without + * returning any valid data. This will prevent us from ever performing a checksum/fix + * for sites like this. + * It's better to just skip the tables in the response, instead of completely failing. + */ + + try { + $woocommerce_order_items_checksum = $this->checksum_histogram( 'woocommerce_order_items' ); + $result['woocommerce_order_items'] = $this->summarize_checksum_histogram( $woocommerce_order_items_checksum ); + } catch ( Exception $ex ) { + $result['woocommerce_order_items'] = null; + } + + try { + $woocommerce_order_itemmeta_checksum = $this->checksum_histogram( 'woocommerce_order_itemmeta' ); + $result['woocommerce_order_itemmeta'] = $this->summarize_checksum_histogram( $woocommerce_order_itemmeta_checksum ); + } catch ( Exception $ex ) { + $result['woocommerce_order_itemmeta'] = null; + } + + if ( Table_Checksum::enable_woocommerce_hpos_tables() ) { + try { + $woocommerce_hpos_orders_checksum = $this->checksum_histogram( 'wc_orders' ); + $result['wc_orders'] = $this->summarize_checksum_histogram( $woocommerce_hpos_orders_checksum ); + } catch ( Exception $ex ) { + $result['wc_orders'] = null; + } + + try { + $woocommerce_hpos_order_addresses_checksum = $this->checksum_histogram( 'wc_order_addresses' ); + $result['wc_order_addresses'] = $this->summarize_checksum_histogram( $woocommerce_hpos_order_addresses_checksum ); + } catch ( Exception $ex ) { + $result['wc_order_addresses'] = null; + } + + try { + $woocommerce_hpos_order_operational_data_checksum = $this->checksum_histogram( 'wc_order_operational_data' ); + $result['wc_order_operational_data'] = $this->summarize_checksum_histogram( $woocommerce_hpos_order_operational_data_checksum ); + } catch ( Exception $ex ) { + $result['wc_order_operational_data'] = null; + } + } + } + + return $result; + } + + /** + * Return the summarized checksum from buckets or the WP_Error. + * + * @param array $histogram checksum_histogram result. + * + * @return int|WP_Error checksum or Error. + */ + protected function summarize_checksum_histogram( $histogram ) { + if ( is_wp_error( $histogram ) ) { + return $histogram; + } else { + return array_sum( $histogram ); + } + } + + /** + * Grabs the minimum and maximum object ids for the given parameters. + * + * @access public + * + * @param string $id_field The id column in the table to query. + * @param string $object_table The table to query. + * @param string $where A sql where clause without 'WHERE'. + * @param int $bucket_size The maximum amount of objects to include in the query. + * For `term_relationships` table, the bucket size will refer to the amount + * of distinct object ids. This will likely include more database rows than + * the bucket size implies. + * + * @return object An object with min_id and max_id properties. + */ + public function get_min_max_object_id( $id_field, $object_table, $where, $bucket_size ) { + global $wpdb; + + // The term relationship table's unique key is a combination of 2 columns. `DISTINCT` helps us get a more acurate query. + $distinct_sql = ( $wpdb->term_relationships === $object_table ) ? 'DISTINCT' : ''; + $where_sql = $where ? "WHERE $where" : ''; + + // Since MIN() and MAX() do not work with LIMIT, we'll need to adjust the dataset we query if a limit is present. + // With a limit present, we'll look at a dataset consisting of object_ids that meet the constructs of the $where clause. + // Without a limit, we can use the actual table as a dataset. + $from = $bucket_size ? + "( SELECT $distinct_sql $id_field FROM $object_table $where_sql ORDER BY $id_field ASC LIMIT " . ( (int) $bucket_size ) . ' ) as ids' : + "$object_table $where_sql ORDER BY $id_field ASC"; + + return $wpdb->get_row( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT MIN($id_field) as min, MAX($id_field) as max FROM $from" + ); + } + + /** + * Retrieve the checksum histogram for a specific object type. + * + * @access public + * + * @param string $table Object type. + * @param null $buckets Number of buckets to split the objects to. + * @param null $start_id Minimum object ID. + * @param null $end_id Maximum object ID. + * @param null $columns Table columns to calculate the checksum from. + * @param bool $strip_non_ascii Whether to strip non-ASCII characters. + * @param string $salt Salt, used for $wpdb->prepare()'s args. + * @param bool $only_range_edges Only return the range edges and not the actual checksums. + * @param bool $detailed_drilldown If the call should return a detailed drilldown for the checksum or only the checksum. + * @param bool $perform_text_conversion If text fields should be converted to latin1 during the checksum calculation. + * + * @return array|WP_Error The checksum histogram. + */ + public function checksum_histogram( $table, $buckets = null, $start_id = null, $end_id = null, $columns = null, $strip_non_ascii = true, $salt = '', $only_range_edges = false, $detailed_drilldown = false, $perform_text_conversion = false ) { + global $wpdb; + + $wpdb->queries = array(); + try { + $checksum_table = $this->get_table_checksum_instance( $table, $salt, $perform_text_conversion, $columns ); + } catch ( Exception $ex ) { + return new WP_Error( 'checksum_disabled', $ex->getMessage() ); + } + + try { + $range_edges = $checksum_table->get_range_edges( $start_id, $end_id ); + } catch ( Exception $ex ) { + return new WP_Error( 'invalid_range_edges', '[' . $start_id . '-' . $end_id . ']: ' . $ex->getMessage() ); + } + + if ( $only_range_edges ) { + return $range_edges; + } + + $object_count = (int) $range_edges['item_count']; + + if ( 0 === $object_count ) { + return array(); + } + + // Validate / Determine Buckets. + if ( $buckets === null || $buckets < 1 ) { + $buckets = $this->calculate_buckets( $table, $object_count ); + } + + $bucket_size = (int) ceil( $object_count / $buckets ); + $previous_max_id = max( 0, $range_edges['min_range'] ); + $histogram = array(); + + do { + try { + $ids_range = $checksum_table->get_range_edges( $previous_max_id, null, $bucket_size ); + } catch ( Exception $ex ) { + return new WP_Error( 'invalid_range_edges', '[' . $previous_max_id . '- ]: ' . $ex->getMessage() ); + } + + if ( empty( $ids_range['min_range'] ) || empty( $ids_range['max_range'] ) ) { + // Nothing to checksum here... + break; + } + + // Get the checksum value. + $batch_checksum = $checksum_table->calculate_checksum( $ids_range['min_range'], $ids_range['max_range'], null, $detailed_drilldown ); + + if ( is_wp_error( $batch_checksum ) ) { + return $batch_checksum; + } + + if ( $ids_range['min_range'] === $ids_range['max_range'] ) { + $histogram[ $ids_range['min_range'] ] = $batch_checksum; + } else { + $histogram[ "{$ids_range[ 'min_range' ]}-{$ids_range[ 'max_range' ]}" ] = $batch_checksum; + } + + $previous_max_id = $ids_range['max_range'] + 1; + // If we've reached the max_range lets bail out. + if ( $previous_max_id > $range_edges['max_range'] ) { + break; + } + } while ( true ); + + return $histogram; + } + + /** + * Retrieve the type of the checksum. + * + * @access public + * + * @return string Type of the checksum. + */ + public function get_checksum_type() { + return 'sum'; + } + + /** + * Used in methods that are not implemented and shouldn't be invoked. + * + * @access private + * @return never + * @throws Exception If this method is invoked. + */ + private function invalid_call() { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + $backtrace = debug_backtrace(); + $caller = $backtrace[1]['function']; + throw new Exception( "This function $caller is not supported on the WP Replicastore" ); + } + + /** + * Determine number of buckets to use in full table checksum. + * + * @param string $table Object Type. + * @param int $object_count Object count. + * @return int Number of Buckets to use. + */ + private function calculate_buckets( $table, $object_count ) { + // Ensure no division by 0. + if ( 0 === (int) $object_count ) { + return 1; + } + + // Default Bucket sizes. + $bucket_size = 10000; // Default bucket size is 10,000 items. + switch ( $table ) { + case 'postmeta': + case 'commentmeta': + case 'order_itemmeta': + $bucket_size = 1000; // Meta bucket size is restricted to 1000 items. + } + + return (int) ceil( $object_count / $bucket_size ); + } + + /** + * Return an instance for `Table_Checksum`, depending on the table. + * + * Some tables require custom instances, due to different checksum logic. + * + * @param string $table The table that we want to get the instance for. + * @param string $salt Salt to be used when generating the checksums. + * @param bool $perform_text_conversion Should we perform text encoding conversion when calculating the checksum. + * @param array $additional_columns Additional columns to add to the checksum calculation. + * + * @return Table_Checksum|Table_Checksum_Usermeta + * @throws Exception Might throw an exception if any of the input parameters were invalid. + */ + public function get_table_checksum_instance( $table, $salt = null, $perform_text_conversion = false, $additional_columns = null ) { + if ( 'users' === $table ) { + return new Table_Checksum_Users( $table, $salt, $perform_text_conversion, $additional_columns ); + } + if ( 'usermeta' === $table ) { + return new Table_Checksum_Usermeta( $table, $salt, $perform_text_conversion, $additional_columns ); + } + + return new Table_Checksum( $table, $salt, $perform_text_conversion, $additional_columns ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php new file mode 100644 index 00000000..22261e96 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php @@ -0,0 +1,881 @@ + WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::full_sync_start', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'modules' => array( + 'description' => __( 'Data Modules that should be included in Full Sync', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + 'users' => array( + 'description' => __( 'User IDs to include in Full Sync or "initial"', 'jetpack-sync' ), + 'required' => false, + ), + 'posts' => array( + 'description' => __( 'Post IDs to include in Full Sync', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + 'comments' => array( + 'description' => __( 'Comment IDs to include in Full Sync', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + ), + ) + ); + + // Obtain Sync status. + register_rest_route( + 'jetpack/v4', + '/sync/status', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::sync_status', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'fields' => array( + 'description' => __( 'Comma seperated list of additional fields that should be included in status.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + ), + ) + ); + + // Update Sync health status. + register_rest_route( + 'jetpack/v4', + '/sync/health', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::sync_health', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'status' => array( + 'description' => __( 'New Sync health status', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Obtain Sync settings. + register_rest_route( + 'jetpack/v4', + '/sync/settings', + array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_sync_settings', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ), + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_sync_settings', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ), + ) + ); + + // Retrieve Sync Object(s). + register_rest_route( + 'jetpack/v4', + '/sync/object', + array( + 'methods' => WP_REST_Server::ALLMETHODS, + 'callback' => __CLASS__ . '::get_sync_objects', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'module_name' => array( + 'description' => __( 'Name of Sync module', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'object_type' => array( + 'description' => __( 'Object Type', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'object_ids' => array( + 'description' => __( 'Objects Identifiers', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + ), + ) + ); + + // Retrieve Sync Object(s). + register_rest_route( + 'jetpack/v4', + '/sync/now', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::do_sync', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'queue' => array( + 'description' => __( 'Name of Sync queue.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Checkout Sync Objects. + register_rest_route( + 'jetpack/v4', + '/sync/checkout', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::checkout', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ) + ); + + // Checkin Sync Objects. + register_rest_route( + 'jetpack/v4', + '/sync/close', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::close', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ) + ); + + // Unlock Sync Queue. + register_rest_route( + 'jetpack/v4', + '/sync/unlock', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::unlock_queue', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'queue' => array( + 'description' => __( 'Name of Sync queue.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Retrieve range of Object Ids. + register_rest_route( + 'jetpack/v4', + '/sync/object-id-range', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_object_id_range', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'sync_module' => array( + 'description' => __( 'Name of Sync module.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + 'batch_size' => array( + 'description' => __( 'Size of batches', 'jetpack-sync' ), + 'type' => 'int', + 'required' => true, + ), + ), + ) + ); + + // Obtain table checksums. + register_rest_route( + 'jetpack/v4', + '/sync/data-check', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::data_check', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'perform_text_conversion' => array( + 'description' => __( 'If text fields should be converted to latin1 in checksum calculation.', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + ), + ) + ); + + // Obtain histogram. + register_rest_route( + 'jetpack/v4', + '/sync/data-histogram', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::data_histogram', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'columns' => array( + 'description' => __( 'Column mappings', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + 'object_type' => array( + 'description' => __( 'Object Type', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'buckets' => array( + 'description' => __( 'Number of histogram buckets.', 'jetpack-sync' ), + 'type' => 'int', + 'required' => false, + ), + 'start_id' => array( + 'description' => __( 'Start ID for the histogram', 'jetpack-sync' ), + 'type' => 'int', + 'required' => false, + ), + 'end_id' => array( + 'description' => __( 'End ID for the histogram', 'jetpack-sync' ), + 'type' => 'int', + 'required' => false, + ), + 'strip_non_ascii' => array( + 'description' => __( 'Strip non-ascii characters?', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + 'shared_salt' => array( + 'description' => __( 'Shared Salt to use when generating checksum', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'only_range_edges' => array( + 'description' => __( 'Should only range edges be returned', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + 'detailed_drilldown' => array( + 'description' => __( 'Do we want the checksum or object ids.', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + 'perform_text_conversion' => array( + 'description' => __( 'If text fields should be converted to latin1 in checksum calculation.', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + ), + ) + ); + + // Trigger Dedicated Sync request. + register_rest_route( + 'jetpack/v4', + '/sync/spawn-sync', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::spawn_sync', + 'permission_callback' => '__return_true', + ) + ); + + // Reset Sync locks. + register_rest_route( + 'jetpack/v4', + '/sync/locks', + array( + 'methods' => WP_REST_Server::DELETABLE, + 'callback' => __CLASS__ . '::reset_locks', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ) + ); + } + + /** + * Trigger a Full Sync of specified modules. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function full_sync_start( $request ) { + + $modules = $request->get_param( 'modules' ); + + // convert list of modules into array format of "$modulename => true". + if ( ! empty( $modules ) ) { + $modules = array_map( '__return_true', array_flip( $modules ) ); + } + + // Process additional options. + foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) { + if ( 'users' === $module_name && 'initial' === $request->get_param( 'users' ) ) { + $modules['users'] = 'initial'; + } elseif ( is_array( $request->get_param( $module_name ) ) ) { + $ids = $request->get_param( $module_name ); + if ( array() !== $ids ) { + $modules[ $module_name ] = $ids; + } + } + } + + if ( empty( $modules ) ) { + $modules = null; + } + + return rest_ensure_response( + array( + 'scheduled' => Actions::do_full_sync( $modules ), + ) + ); + } + + /** + * Return Sync's status. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function sync_status( $request ) { + $fields = $request->get_param( 'fields' ); + return rest_ensure_response( Actions::get_sync_status( $fields ) ); + } + + /** + * Return table checksums. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function data_check( $request ) { + // Disable Sync during this call, so we can resolve faster. + Actions::mark_sync_read_only(); + $store = new Replicastore(); + + $perform_text_conversion = false; + if ( true === $request->get_param( 'perform_text_conversion' ) ) { + $perform_text_conversion = true; + } + + return rest_ensure_response( $store->checksum_all( $perform_text_conversion ) ); + } + + /** + * Return Histogram. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function data_histogram( $request ) { + + // Disable Sync during this call, so we can resolve faster. + Actions::mark_sync_read_only(); + + $args = $request->get_params(); + + if ( empty( $args['columns'] ) ) { + $args['columns'] = null; // go with defaults. + } + + if ( false !== $args['strip_non_ascii'] ) { + $args['strip_non_ascii'] = true; + } + + if ( true !== $args['perform_text_conversion'] ) { + $args['perform_text_conversion'] = false; + } + + /** + * Hack: nullify the values of `start_id` and `end_id` if we're only requesting ranges. + * + * The endpoint doesn't support nullable values :( + */ + if ( true === $args['only_range_edges'] ) { + if ( 0 === $args['start_id'] ) { + $args['start_id'] = null; + } + + if ( 0 === $args['end_id'] ) { + $args['end_id'] = null; + } + } + + $store = new Replicastore(); + $histogram = $store->checksum_histogram( $args['object_type'], $args['buckets'], $args['start_id'], $args['end_id'], $args['columns'], $args['strip_non_ascii'], $args['shared_salt'], $args['only_range_edges'], $args['detailed_drilldown'], $args['perform_text_conversion'] ); + + return rest_ensure_response( + array( + 'histogram' => $histogram, + 'type' => $store->get_checksum_type(), + ) + ); + } + + /** + * Update Sync health. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function sync_health( $request ) { + + switch ( $request->get_param( 'status' ) ) { + case Health::STATUS_IN_SYNC: + case Health::STATUS_OUT_OF_SYNC: + Health::update_status( $request->get_param( 'status' ) ); + break; + default: + return new WP_Error( 'invalid_status', 'Invalid Sync Status Provided.' ); + } + + // re-fetch so we see what's really being stored. + return rest_ensure_response( + array( + 'success' => Health::get_status(), + ) + ); + } + + /** + * Obtain Sync settings. + * + * @since 1.23.1 + * + * @return \WP_REST_Response + */ + public static function get_sync_settings() { + return rest_ensure_response( Settings::get_settings() ); + } + + /** + * Update Sync settings. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function update_sync_settings( $request ) { + $args = $request->get_params(); + $sync_settings = Settings::get_settings(); + + foreach ( $args as $key => $value ) { + if ( false !== $value ) { + if ( is_numeric( $value ) ) { + $value = (int) $value; + } + + // special case for sending empty arrays - a string with value 'empty'. + if ( 'empty' === $value ) { + $value = array(); + } + + $sync_settings[ $key ] = $value; + } + } + + Settings::update_settings( $sync_settings ); + + // re-fetch so we see what's really being stored. + return rest_ensure_response( Settings::get_settings() ); + } + + /** + * Retrieve Sync Objects. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function get_sync_objects( $request ) { + $args = $request->get_params(); + + $module_name = $args['module_name']; + // Verify valid Sync Module. + $sync_module = Modules::get_module( $module_name ); + if ( ! $sync_module ) { + return new WP_Error( 'invalid_module', 'You specified an invalid sync module' ); + } + + Actions::mark_sync_read_only(); + + $codec = Sender::get_instance()->get_codec(); + Settings::set_is_syncing( true ); + $objects = $codec->encode( $sync_module->get_objects_by_id( $args['object_type'], $args['object_ids'] ) ); + Settings::set_is_syncing( false ); + + return rest_ensure_response( + array( + 'objects' => $objects, + 'codec' => $codec->name(), + ) + ); + } + + /** + * Request Sync processing. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function do_sync( $request ) { + + $queue_name = self::validate_queue( $request->get_param( 'queue' ) ); + if ( is_wp_error( $queue_name ) ) { + return $queue_name; + } + + $sender = Sender::get_instance(); + $response = $sender->do_sync_for_queue( new Queue( $queue_name ) ); + + return rest_ensure_response( + array( + 'response' => $response, + ) + ); + } + + /** + * Request sync data from specified queue. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function checkout( $request ) { + $args = $request->get_params(); + $queue_name = self::validate_queue( $args['queue'] ); + + if ( is_wp_error( $queue_name ) ) { + return $queue_name; + } + + $number_of_items = $args['number_of_items']; + if ( $number_of_items < 1 || $number_of_items > 100 ) { + return new WP_Error( 'invalid_number_of_items', 'Number of items needs to be an integer that is larger than 0 and less then 100', 400 ); + } + + // REST Sender. + $sender = new REST_Sender(); + + if ( 'immediate' === $queue_name ) { + return rest_ensure_response( $sender->immediate_full_sync_pull( $number_of_items ) ); + } + + $response = $sender->queue_pull( $queue_name, $number_of_items, $args ); + // Disable sending while pulling. + if ( ! is_wp_error( $response ) ) { + set_transient( Sender::TEMP_SYNC_DISABLE_TRANSIENT_NAME, time(), Sender::TEMP_SYNC_DISABLE_TRANSIENT_EXPIRY ); + } elseif ( 'queue_size' === $response->get_error_code() ) { + // Re-enable sending if the queue is empty. + delete_transient( Sender::TEMP_SYNC_DISABLE_TRANSIENT_NAME ); + } + + return rest_ensure_response( $response ); + } + + /** + * Unlock a Sync queue. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function unlock_queue( $request ) { + + $queue_name = $request->get_param( 'queue' ); + + if ( ! in_array( $queue_name, array( 'sync', 'full_sync' ), true ) ) { + return new WP_Error( 'invalid_queue', 'Queue name should be sync or full_sync', 400 ); + } + $queue = new Queue( $queue_name ); + + // False means that there was no lock to delete. + $response = $queue->unlock(); + return rest_ensure_response( + array( + 'success' => $response, + ) + ); + } + + /** + * Checkin Sync actions. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function close( $request ) { + + $request_body = $request->get_params(); + $queue_name = self::validate_queue( $request_body['queue'] ); + + if ( is_wp_error( $queue_name ) ) { + return $queue_name; + } + + if ( empty( $request_body['buffer_id'] ) ) { + return new WP_Error( 'missing_buffer_id', 'Please provide a buffer id', 400 ); + } + + if ( ! is_array( $request_body['item_ids'] ) ) { + return new WP_Error( 'missing_item_ids', 'Please provide a list of item ids in the item_ids argument', 400 ); + } + + // Limit to A-Z,a-z,0-9,_,- . + $request_body['buffer_id'] = preg_replace( '/[^A-Za-z0-9\-_\.]/', '', $request_body['buffer_id'] ); + $request_body['item_ids'] = array_filter( array_map( array( 'Automattic\Jetpack\Sync\REST_Endpoints', 'sanitize_item_ids' ), $request_body['item_ids'] ) ); + + $queue = new Queue( $queue_name ); + + $items = $queue->peek_by_id( $request_body['item_ids'] ); + + // Update Full Sync Status if queue is "full_sync". + if ( 'full_sync' === $queue_name ) { + $full_sync_module = Modules::get_module( 'full-sync' ); + '@phan-var Modules\Full_Sync_Immediately|Modules\Full_Sync $full_sync_module'; + $full_sync_module->update_sent_progress_action( $items ); + } + + $buffer = new Queue_Buffer( $request_body['buffer_id'], $request_body['item_ids'] ); + $response = $queue->close( $buffer, $request_body['item_ids'] ); + + // Perform another checkout? + if ( isset( $request_body['continue'] ) && $request_body['continue'] ) { + if ( in_array( $queue_name, array( 'full_sync', 'immediate' ), true ) ) { + // Send Full Sync Actions. + Sender::get_instance()->do_full_sync(); + } elseif ( $queue->has_any_items() ) { + // Send Incremental Sync Actions. + Sender::get_instance()->do_sync(); + } + } + + if ( is_wp_error( $response ) ) { + return $response; + } + + return rest_ensure_response( + array( + 'success' => $response, + 'status' => Actions::get_sync_status(), + ) + ); + } + + /** + * Retrieve range of Object Ids for a specified Sync module. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function get_object_id_range( $request ) { + + $module_name = $request->get_param( 'sync_module' ); + $batch_size = $request->get_param( 'batch_size' ); + + if ( ! self::is_valid_sync_module( $module_name ) ) { + return new WP_Error( 'invalid_module', 'This sync module cannot be used to calculate a range.', 400 ); + } + $module = Modules::get_module( $module_name ); + + return rest_ensure_response( + array( + 'ranges' => $module->get_min_max_object_ids_for_batches( $batch_size ), + ) + ); + } + + /** + * This endpoint is used by Sync to spawn a + * dedicated Sync request which will trigger Sync to run. + * + * If Dedicated Sync is enabled, this callback should never run as + * processing of Sync actions will occur earlier and exit. + * + * @see Actions::init + * @see Sender::do_dedicated_sync_and_exit + * + * @since 1.34.0 + * + * @return \WP_REST_Response + */ + public static function spawn_sync() { + nocache_headers(); + + if ( ! Settings::is_dedicated_sync_enabled() ) { + return new WP_Error( + 'dedicated_sync_disabled', + 'Dedicated Sync flow is disabled.', + array( 'status' => 422 ) + ); + } + + return new WP_Error( + 'dedicated_sync_failed', + 'Failed to process Dedicated Sync request', + array( 'status' => 500 ) + ); + } + + /** + * Reset Sync locks. + * + * @since 1.43.0 + * + * @return \WP_REST_Response + */ + public static function reset_locks() { + Actions::reset_sync_locks(); + + return rest_ensure_response( + array( + 'success' => true, + ) + ); + } + + /** + * Verify that request has default permissions to perform sync actions. + * + * @since 1.23.1 + * + * @return bool Whether user has capability 'manage_options' or a blog token is used. + */ + public static function verify_default_permissions() { + if ( current_user_can( 'manage_options' ) || Rest_Authentication::is_signed_with_blog_token() ) { + return true; + } + + $error_msg = esc_html__( + 'You do not have the correct user permissions to perform this action. + Please contact your site admin if you think this is a mistake.', + 'jetpack-sync' + ); + + return new WP_Error( 'invalid_user_permission_sync', $error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Validate Queue name. + * + * @param string $value Queue Name. + * + * @return WP_Error + */ + protected static function validate_queue( $value ) { + if ( ! isset( $value ) ) { + return new WP_Error( 'invalid_queue', 'Queue name is required', 400 ); + } + + if ( ! in_array( $value, array( 'sync', 'full_sync', 'immediate' ), true ) ) { + return new WP_Error( 'invalid_queue', 'Queue name should be sync, full_sync or immediate', 400 ); + } + return $value; + } + + /** + * Validate name is a valid Sync module. + * + * @param string $module_name Name of Sync Module. + * + * @return bool + */ + protected static function is_valid_sync_module( $module_name ) { + return in_array( + $module_name, + array( + 'comments', + 'posts', + 'terms', + 'term_relationships', + 'users', + ), + true + ); + } + + /** + * Sanitize Item Ids. + * + * @param string $item Sync item identifier. + * + * @return string|string[]|null + */ + protected static function sanitize_item_ids( $item ) { + // lets not delete any options that don't start with jpsq_sync- . + if ( ! is_string( $item ) || ! str_starts_with( $item, 'jpsq_' ) ) { + return null; + } + // Limit to A-Z,a-z,0-9,_,-,. . + return preg_replace( '/[^A-Za-z0-9-_.]/', '', $item ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php new file mode 100644 index 00000000..2221b850 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php @@ -0,0 +1,144 @@ +size() ) { + return new WP_Error( 'queue_size', 'The queue is empty and there is nothing to send', 400 ); + } + + $sender = Sender::get_instance(); + + // try to give ourselves as much time as possible. + set_time_limit( 0 ); + + if ( ! empty( $args['pop'] ) ) { + $buffer = new Queue_Buffer( 'pop', $queue->pop( $number_of_items ) ); + } else { + // let's delete the checkin state. + if ( $args['force'] ) { + $queue->unlock(); + } + $buffer = $this->get_buffer( $queue, $number_of_items ); + } + // Check that the $buffer is not checkout out already. + if ( is_wp_error( $buffer ) ) { + return new WP_Error( 'buffer_open', "We couldn't get the buffer it is currently checked out", 400 ); + } + + if ( ! is_object( $buffer ) ) { + return new WP_Error( 'buffer_non-object', 'Buffer is not an object', 400 ); + } + + $encode = isset( $args['encode'] ) ? $args['encode'] : true; + + Settings::set_is_syncing( true ); + list( $items_to_send, $skipped_items_ids ) = $sender->get_items_to_send( $buffer, $encode ); + Settings::set_is_syncing( false ); + + return array( + 'buffer_id' => $buffer->id, + 'items' => $items_to_send, + 'skipped_items' => $skipped_items_ids, + 'codec' => $encode ? $sender->get_codec()->name() : null, + 'sent_timestamp' => time(), + 'queue_size' => $queue->size(), + ); + } + + /** + * Adds Sync items to local property. + */ + public function jetpack_sync_send_data_listener() { + foreach ( func_get_args()[0] as $key => $item ) { + $this->items[ $key ] = $item; + } + } + + /** + * Check out a buffer of full sync actions. + * + * @return array Sync Actions to be returned to requestor + */ + public function immediate_full_sync_pull() { + // try to give ourselves as much time as possible. + set_time_limit( 0 ); + + $original_send_data_cb = array( 'Automattic\Jetpack\Sync\Actions', 'send_data' ); + $temp_send_data_cb = array( $this, 'jetpack_sync_send_data_listener' ); + + Sender::get_instance()->set_enqueue_wait_time( 0 ); + remove_filter( 'jetpack_sync_send_data', $original_send_data_cb ); + add_filter( 'jetpack_sync_send_data', $temp_send_data_cb, 10, 6 ); + Sender::get_instance()->do_full_sync(); + remove_filter( 'jetpack_sync_send_data', $temp_send_data_cb ); + add_filter( 'jetpack_sync_send_data', $original_send_data_cb, 10, 6 ); + + return array( + 'items' => $this->items, + 'codec' => Sender::get_instance()->get_codec()->name(), + 'sent_timestamp' => time(), + 'status' => Actions::get_sync_status(), + ); + } + + /** + * Checkout items out of the sync queue. + * + * @param Queue $queue Sync Queue. + * @param int $number_of_items Number of items to checkout. + * + * @return WP_Error + */ + protected function get_buffer( $queue, $number_of_items ) { + $start = time(); + $max_duration = 5; // this will try to get the buffer. + + $buffer = $queue->checkout( $number_of_items ); + $duration = time() - $start; + + while ( is_wp_error( $buffer ) && $duration < $max_duration ) { + sleep( 2 ); + $duration = time() - $start; + $buffer = $queue->checkout( $number_of_items ); + } + + if ( false === $buffer ) { + return new WP_Error( 'queue_size', 'The queue is empty and there is nothing to send', 400 ); + } + + return $buffer; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php new file mode 100644 index 00000000..c36179ba --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php @@ -0,0 +1,1032 @@ +:( + * + * @access protected + * @static + */ + protected function __construct() { + $this->set_defaults(); + $this->init(); + } + + /** + * Initialize the sender. + * Prepares the current user and initializes all sync modules. + * + * @access private + */ + private function init() { + add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_set_user_from_token' ), 1 ); + add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_clear_user_from_token' ), 20 ); + add_filter( 'jetpack_xmlrpc_unauthenticated_methods', array( $this, 'register_jetpack_xmlrpc_methods' ) ); + foreach ( Modules::get_modules() as $module ) { + $module->init_before_send(); + } + } + + /** + * Detect if this is a XMLRPC request with a valid signature. + * If so, changes the user to the new one. + * + * @access public + */ + public function maybe_set_user_from_token() { + $connection = new Manager(); + $verified_user = $connection->verify_xml_rpc_signature(); + if ( Constants::is_true( 'XMLRPC_REQUEST' ) && + ! is_wp_error( $verified_user ) + && $verified_user + ) { + $old_user = wp_get_current_user(); + $this->old_user = isset( $old_user->ID ) ? $old_user->ID : 0; + wp_set_current_user( $verified_user['user_id'] ); + } + } + + /** + * If we used to have a previous current user, revert back to it. + * + * @access public + */ + public function maybe_clear_user_from_token() { + if ( isset( $this->old_user ) ) { + wp_set_current_user( $this->old_user ); + } + } + + /** + * Retrieve the next sync time. + * + * Update @since 1.43.2 + * Sometimes when we process Sync requests in Jetpack, the server clock can be a + * bit in the future and this can lock Sync to not send stuff for a while. + * We are introducing an extra check, to make sure to limit the next_sync_time + * to be at most one hour in the future from the current time. + * + * @access public + * + * @param string $queue_name Name of the queue. + * @return float Timestamp of the next sync. + */ + public function get_next_sync_time( $queue_name ) { + $option_name = self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name; + $next_sync_time = (float) get_option( $option_name, 0 ); + + $is_more_than_one_hour = ( $next_sync_time - microtime( true ) ) >= HOUR_IN_SECONDS; + + if ( $is_more_than_one_hour ) { + delete_option( $option_name ); + $next_sync_time = 0; + } + + return $next_sync_time; + } + + /** + * Set the next sync time. + * + * @access public + * + * @param int $time Timestamp of the next sync. + * @param string $queue_name Name of the queue. + * @return boolean True if update was successful, false otherwise. + */ + public function set_next_sync_time( $time, $queue_name ) { + return update_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, $time, true ); + } + + /** + * Trigger a full sync. + * + * @access public + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_full_sync() { + $sync_module = Modules::get_module( 'full-sync' ); + '@phan-var Modules\Full_Sync_Immediately|Modules\Full_Sync $sync_module'; + if ( ! $sync_module ) { + return; + } + // Full Sync Disabled. + if ( ! Settings::get_setting( 'full_sync_sender_enabled' ) ) { + return; + } + + // Don't sync if request is marked as read only. + if ( Constants::is_true( 'JETPACK_SYNC_READ_ONLY' ) ) { + return new WP_Error( 'jetpack_sync_read_only' ); + } + + // Sync not started or Sync finished. + $status = $sync_module->get_status(); + if ( false === $status['started'] || ( ! empty( $status['started'] ) && ! empty( $status['finished'] ) ) ) { + return false; + } + + $this->continue_full_sync_enqueue(); + // immediate full sync sends data in continue_full_sync_enqueue. + if ( ! $sync_module instanceof Modules\Full_Sync_Immediately ) { + return $this->do_sync_and_set_delays( $this->full_sync_queue ); + } else { + $status = $sync_module->get_status(); + // Sync not started or Sync finished. + if ( false === $status['started'] || ( ! empty( $status['started'] ) && ! empty( $status['finished'] ) ) ) { + return false; + } else { + return true; + } + } + } + + /** + * Enqueue the next sync items for sending. + * Will not be done if the current request is a WP import one. + * Will be delayed until the next sync time comes. + * + * @access private + */ + private function continue_full_sync_enqueue() { + if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { + return false; + } + + if ( $this->get_next_sync_time( 'full-sync-enqueue' ) > microtime( true ) ) { + return false; + } + + $full_sync_module = Modules::get_module( 'full-sync' ); + '@phan-var Modules\Full_Sync_Immediately|Modules\Full_Sync $full_sync_module'; + $full_sync_module->continue_enqueuing(); + + $this->set_next_sync_time( time() + $this->get_enqueue_wait_time(), 'full-sync-enqueue' ); + } + + /** + * Trigger incremental sync. + * + * @access public + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_sync() { + if ( ! Settings::is_dedicated_sync_enabled() ) { + $result = $this->do_sync_and_set_delays( $this->sync_queue ); + } else { + $result = Dedicated_Sender::spawn_sync( $this->sync_queue ); + } + + return $result; + } + + /** + * Trigger incremental sync and early exit on Dedicated Sync request. + * + * @access public + * + * @param bool $do_real_exit If we should exit at the end of the request. We should by default. + * In the context of running this in the REST API, we actually want to return an error. + * + * @return void|WP_Error + */ + public function do_dedicated_sync_and_exit( $do_real_exit = true ) { + nocache_headers(); + + if ( ! Settings::is_dedicated_sync_enabled() ) { + return new WP_Error( 'dedicated_sync_disabled', 'Dedicated Sync flow is disabled.' ); + } + + if ( ! Dedicated_Sender::is_dedicated_sync_request() ) { + return new WP_Error( 'non_dedicated_sync_request', 'Not a Dedicated Sync request.' ); + } + + /** + * Output an `OK` to show that Dedicated Sync is enabled and we can process events. + * This is used to test the feature is working. + * + * @see \Automattic\Jetpack\Sync\Dedicated_Sender::can_spawn_dedicated_sync_request + */ + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is just a constant string used for Validation. + echo Dedicated_Sender::DEDICATED_SYNC_VALIDATION_STRING; + + // Try to disconnect the request as quickly as possible and process things in the background. + $this->fastcgi_finish_request(); + + /** + * Close the PHP session to free up the server threads to handle other requests while we + * send sync data with Dedicated Sync. + * + * When we spawn Dedicated Sync, we send `$_COOKIES` with the request to help out with any + * firewall and/or caching functionality that might prevent us to ping the site directly. + * + * This will cause Dedicated Sync to reuse the visitor's PHP session and lock it until the + * request finishes, which can take anywhere from 1 to 30+ seconds, depending on the server + * `max_execution_time` configuration. + * + * By closing the session we're freeing up the session, so other requests can acquire the + * lock and proceed with their own tasks. + */ + if ( session_status() === PHP_SESSION_ACTIVE ) { + session_write_close(); + } + + // Output not used right now. Try to release dedicated sync lock + Dedicated_Sender::try_release_lock_spawn_request(); + + // Actually try to send Sync events. + $result = $this->do_sync_and_set_delays( $this->sync_queue ); + + // If no errors occurred, re-spawn a dedicated Sync request. + if ( true === $result ) { + Dedicated_Sender::spawn_sync( $this->sync_queue ); + } + + if ( $do_real_exit ) { + exit; + } + } + + /** + * Trigger sync for a certain sync queue. + * Responsible for setting next sync time. + * Will not be delayed if the current request is a WP import one. + * Will be delayed until the next sync time comes. + * + * @access public + * + * @param \Automattic\Jetpack\Sync\Queue $queue Queue object. + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_sync_and_set_delays( $queue ) { + // Don't sync if importing. + if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { + return new WP_Error( 'is_importing' ); + } + + // Don't sync if request is marked as read only. + if ( Constants::is_true( 'JETPACK_SYNC_READ_ONLY' ) ) { + return new WP_Error( 'jetpack_sync_read_only' ); + } + + if ( ! Settings::is_sender_enabled( $queue->id ) ) { + return new WP_Error( 'sender_disabled_for_queue_' . $queue->id ); + } + + if ( get_transient( self::TEMP_SYNC_DISABLE_TRANSIENT_NAME ) ) { + return new WP_Error( 'sender_temporarily_disabled_while_pulling' ); + } + + // Return early if we've gotten a retry-after header response. + $retry_time = get_option( Actions::RETRY_AFTER_PREFIX . $queue->id ); + if ( $retry_time ) { + // If expired update to false but don't send. Send will occurr in new request to avoid race conditions. + if ( microtime( true ) > $retry_time ) { + update_option( Actions::RETRY_AFTER_PREFIX . $queue->id, false, false ); + } + return new WP_Error( 'retry_after' ); + } + + // Don't sync if we are throttled. + if ( $this->get_next_sync_time( $queue->id ) > microtime( true ) ) { + return new WP_Error( 'sync_throttled' ); + } + + $start_time = microtime( true ); + + Settings::set_is_syncing( true ); + + $sync_result = $this->do_sync_for_queue( $queue ); + + Settings::set_is_syncing( false ); + + $exceeded_sync_wait_threshold = ( microtime( true ) - $start_time ) > (float) $this->get_sync_wait_threshold(); + + if ( is_wp_error( $sync_result ) ) { + if ( 'unclosed_buffer' === $sync_result->get_error_code() ) { + $this->set_next_sync_time( time() + self::QUEUE_LOCKED_SYNC_DELAY, $queue->id ); + } + if ( 'wpcom_error' === $sync_result->get_error_code() ) { + $this->set_next_sync_time( time() + self::WPCOM_ERROR_SYNC_DELAY, $queue->id ); + } + } elseif ( $exceeded_sync_wait_threshold ) { + // If we actually sent data and it took a while, wait before sending again. + $this->set_next_sync_time( time() + $this->get_sync_wait_time(), $queue->id ); + } + + return $sync_result; + } + + /** + * Retrieve the next sync items to send. + * + * @access public + * + * @param (array|\Automattic\Jetpack\Sync\Queue_Buffer) $buffer_or_items Queue buffer or array of objects. + * @param boolean $encode Whether to encode the items. + * @return array Sync items to send. + */ + public function get_items_to_send( $buffer_or_items, $encode = true ) { + // Track how long we've been processing so we can avoid request timeouts. + $start_time = microtime( true ); + $upload_size = 0; + $items_to_send = array(); + $items = is_array( $buffer_or_items ) ? $buffer_or_items : $buffer_or_items->get_items(); + if ( ! is_array( $items ) ) { + $items = array(); + } + + // Set up current screen to avoid errors rendering content. + require_once ABSPATH . 'wp-admin/includes/class-wp-screen.php'; + require_once ABSPATH . 'wp-admin/includes/screen.php'; + set_current_screen( 'sync' ); + $skipped_items_ids = array(); + /** + * We estimate the total encoded size as we go by encoding each item individually. + * This is expensive, but the only way to really know :/ + */ + foreach ( $items as $key => $item ) { + if ( ! is_array( $item ) ) { + $skipped_items_ids[] = $key; + continue; + } + + // Suspending cache addition help prevent overloading in memory cache of large sites. + wp_suspend_cache_addition( true ); + /** + * Modify the data within an action before it is serialized and sent to the server + * For example, during full sync this expands Post ID's into full Post objects, + * so that we don't have to serialize the whole object into the queue. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array The action parameters + * @param int The ID of the user who triggered the action + */ + $item[1] = apply_filters( 'jetpack_sync_before_send_' . $item[0], $item[1], $item[2] ); + wp_suspend_cache_addition( false ); + // Serialization usage can lead to empty, null or false action_name. Lets skip as there is no information to send. + if ( empty( $item[0] ) || false === $item[1] ) { + $skipped_items_ids[] = $key; + continue; + } + $encoded_item = $this->codec->encode( $item ); + $upload_size += strlen( $encoded_item ); + if ( $upload_size > $this->upload_max_bytes && array() !== $items_to_send ) { + break; + } + $items_to_send[ $key ] = $encode ? $encoded_item : $item; + if ( microtime( true ) - $start_time > $this->max_dequeue_time ) { + break; + } + } + + return array( $items_to_send, $skipped_items_ids, $items, microtime( true ) - $start_time ); + } + + /** + * If supported, flush all response data to the client and finish the request. + * This allows for time consuming tasks to be performed without leaving the connection open. + * + * @access private + */ + private function fastcgi_finish_request() { + if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) { + fastcgi_finish_request(); + } + } + + /** + * Perform sync for a certain sync queue. + * + * @access public + * + * @param \Automattic\Jetpack\Sync\Queue $queue Queue object. + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_sync_for_queue( $queue ) { + do_action( 'jetpack_sync_before_send_queue_' . $queue->id ); + if ( $queue->size() === 0 ) { + return new WP_Error( 'empty_queue_' . $queue->id ); + } + + /** + * Now that we're sure we are about to sync, try to ignore user abort + * so we can avoid getting into a bad state. + */ + // https://plugins.trac.wordpress.org/ticket/2041 + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + /* Don't make the request block till we finish, if possible. */ + if ( Constants::is_true( 'REST_REQUEST' ) || Constants::is_true( 'XMLRPC_REQUEST' ) ) { + $this->fastcgi_finish_request(); + } + + $checkout_start_time = microtime( true ); + + $buffer = $queue->checkout_with_memory_limit( $this->dequeue_max_bytes, $this->upload_max_rows ); + + if ( ! $buffer ) { + // Buffer has no items. + return new WP_Error( 'empty_buffer' ); + } + + if ( is_wp_error( $buffer ) ) { + return $buffer; + } + + $checkout_duration = microtime( true ) - $checkout_start_time; + + list( $items_to_send, $skipped_items_ids, $items, $preprocess_duration ) = $this->get_items_to_send( $buffer, true ); + if ( ! empty( $items_to_send ) ) { + /** + * Fires when data is ready to send to the server. + * Return false or WP_Error to abort the sync (e.g. if there's an error) + * The items will be automatically re-sent later + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array $data The action buffer + * @param string $codec The codec name used to encode the data + * @param double $time The current time + * @param string $queue The queue used to send ('sync' or 'full_sync') + * @param float $checkout_duration The duration of the checkout operation. + * @param float $preprocess_duration The duration of the pre-process operation. + * @param int $queue_size The size of the sync queue at the time of processing. + */ + Settings::set_is_sending( true ); + $processed_item_ids = apply_filters( 'jetpack_sync_send_data', $items_to_send, $this->codec->name(), microtime( true ), $queue->id, $checkout_duration, $preprocess_duration, $queue->size(), $buffer->id ); + Settings::set_is_sending( false ); + } else { + $processed_item_ids = $skipped_items_ids; + $skipped_items_ids = array(); + } + + if ( 'non-blocking' !== $processed_item_ids ) { + if ( ! $processed_item_ids || is_wp_error( $processed_item_ids ) ) { + $checked_in_item_ids = $queue->checkin( $buffer ); + if ( is_wp_error( $checked_in_item_ids ) ) { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + error_log( 'Error checking in buffer: ' . $checked_in_item_ids->get_error_message() ); + $queue->force_checkin(); + } + if ( is_wp_error( $processed_item_ids ) ) { + return new WP_Error( 'wpcom_error', $processed_item_ids->get_error_code() ); + } + + // Returning a wpcom_error is a sign to the caller that we should wait a while before syncing again. + return new WP_Error( 'wpcom_error', 'jetpack_sync_send_data_false' ); + } else { + // Detect if the last item ID was an error. + $had_wp_error = is_wp_error( end( $processed_item_ids ) ); + $wp_error = $had_wp_error ? array_pop( $processed_item_ids ) : null; + // Also checkin any items that were skipped. + if ( array() !== $skipped_items_ids ) { + $processed_item_ids = array_merge( $processed_item_ids, $skipped_items_ids ); + } + $processed_items = array_intersect_key( $items, array_flip( $processed_item_ids ) ); + /** + * Allows us to keep track of all the actions that have been sent. + * Allows us to calculate the progress of specific actions. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array $processed_actions The actions that we send successfully. + */ + do_action( 'jetpack_sync_processed_actions', $processed_items ); + $queue->close( $buffer, $processed_item_ids ); + // Returning a WP_Error is a sign to the caller that we should wait a while before syncing again. + if ( $had_wp_error ) { + return new WP_Error( 'wpcom_error', $wp_error->get_error_code() ); + } + } + } + + return true; + } + + /** + * Immediately sends a single item without firing or enqueuing it + * + * @param string $action_name The action. + * @param array $data The data associated with the action. + * + * @return array Items processed. TODO: this doesn't make much sense anymore, it should probably be just a bool. + */ + public function send_action( $action_name, $data = null ) { + if ( ! Settings::is_sender_enabled( 'full_sync' ) ) { + return array(); + } + + // Compose the data to be sent. + $action_to_send = $this->create_action_to_send( $action_name, $data ); + + list( $items_to_send, $skipped_items_ids, $items, $preprocess_duration ) = $this->get_items_to_send( $action_to_send, true ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + Settings::set_is_sending( true ); + $processed_item_ids = apply_filters( 'jetpack_sync_send_data', $items_to_send, $this->get_codec()->name(), microtime( true ), 'immediate-send', 0, $preprocess_duration ); + Settings::set_is_sending( false ); + + /** + * Allows us to keep track of all the actions that have been sent. + * Allows us to calculate the progress of specific actions. + * + * @param array $processed_actions The actions that we send successfully. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_sync_processed_actions', $action_to_send ); + + return $processed_item_ids; + } + + /** + * Create an synthetic action for direct sending to WPCOM during full sync (for example) + * + * @access private + * + * @param string $action_name The action. + * @param array $data The data associated with the action. + * @return array An array of synthetic sync actions keyed by current microtime(true) + */ + private function create_action_to_send( $action_name, $data ) { + return array( + (string) microtime( true ) => array( + $action_name, + $data, + get_current_user_id(), + microtime( true ), + Settings::is_importing(), + ), + ); + } + + /** + * Returns any object that is able to be synced. + * + * @access public + * + * @param array $args the synchronized object parameters. + * @return string Encoded sync object. + */ + public function sync_object( $args ) { + // For example: posts, post, 5. + list( $module_name, $object_type, $id ) = $args; + + $sync_module = Modules::get_module( $module_name ); + $codec = $this->get_codec(); + + return $codec->encode( $sync_module->get_object_by_id( $object_type, $id ) ); + } + + /** + * Register additional sync XML-RPC methods available to Jetpack for authenticated users. + * + * @access public + * @since 1.6.3 + * @since-jetpack 7.8.0 + * + * @param array $jetpack_methods XML-RPC methods available to the Jetpack Server. + * @return array Filtered XML-RPC methods. + */ + public function register_jetpack_xmlrpc_methods( $jetpack_methods ) { + $jetpack_methods['jetpack.syncObject'] = array( $this, 'sync_object' ); + return $jetpack_methods; + } + + /** + * Get the incremental sync queue object. + * + * @access public + * + * @return \Automattic\Jetpack\Sync\Queue Queue object. + */ + public function get_sync_queue() { + return $this->sync_queue; + } + + /** + * Get the full sync queue object. + * + * @access public + * + * @return \Automattic\Jetpack\Sync\Queue Queue object. + */ + public function get_full_sync_queue() { + return $this->full_sync_queue; + } + + /** + * Get the codec object. + * + * @access public + * + * @return \Automattic\Jetpack\Sync\Codec_Interface Codec object. + */ + public function get_codec() { + return $this->codec; + } + + /** + * Determine the codec object. + * Use gzip deflate if supported. + * + * @access public + */ + public function set_codec() { + if ( function_exists( 'gzinflate' ) ) { + $this->codec = new JSON_Deflate_Array_Codec(); + } else { + $this->codec = new Simple_Codec(); + } + } + + /** + * Compute and send all the checksums. + * + * @access public + */ + public function send_checksum() { + $store = new Replicastore(); + do_action( 'jetpack_sync_checksum', $store->checksum_all() ); + } + + /** + * Reset the incremental sync queue. + * + * @access public + */ + public function reset_sync_queue() { + $this->sync_queue->reset(); + } + + /** + * Reset the full sync queue. + * + * @access public + */ + public function reset_full_sync_queue() { + $this->full_sync_queue->reset(); + } + + /** + * Set the maximum bytes to checkout without exceeding the memory limit. + * + * @access public + * + * @param int $size Maximum bytes to checkout. + */ + public function set_dequeue_max_bytes( $size ) { + $this->dequeue_max_bytes = $size; + } + + /** + * Set the maximum bytes in a single encoded item. + * + * @access public + * + * @param int $max_bytes Maximum bytes in a single encoded item. + */ + public function set_upload_max_bytes( $max_bytes ) { + $this->upload_max_bytes = $max_bytes; + } + + /** + * Set the maximum number of sync items in a single action. + * + * @access public + * + * @param int $max_rows Maximum number of sync items. + */ + public function set_upload_max_rows( $max_rows ) { + $this->upload_max_rows = $max_rows; + } + + /** + * Set the sync wait time (in seconds). + * + * @access public + * + * @param int $seconds Sync wait time. + */ + public function set_sync_wait_time( $seconds ) { + $this->sync_wait_time = $seconds; + } + + /** + * Get current sync wait time (in seconds). + * + * @access public + * + * @return int Sync wait time. + */ + public function get_sync_wait_time() { + return $this->sync_wait_time; + } + + /** + * Set the enqueue wait time (in seconds). + * + * @access public + * + * @param int $seconds Enqueue wait time. + */ + public function set_enqueue_wait_time( $seconds ) { + $this->enqueue_wait_time = $seconds; + } + + /** + * Get current enqueue wait time (in seconds). + * + * @access public + * + * @return int Enqueue wait time. + */ + public function get_enqueue_wait_time() { + return $this->enqueue_wait_time; + } + + /** + * Set the sync wait threshold (in seconds). + * + * @access public + * + * @param int $seconds Sync wait threshold. + */ + public function set_sync_wait_threshold( $seconds ) { + $this->sync_wait_threshold = $seconds; + } + + /** + * Get current sync wait threshold (in seconds). + * + * @access public + * + * @return int Sync wait threshold. + */ + public function get_sync_wait_threshold() { + return $this->sync_wait_threshold; + } + + /** + * Set the maximum time for perfirming a checkout of items from the queue (in seconds). + * + * @access public + * + * @param int $seconds Maximum dequeue time. + */ + public function set_max_dequeue_time( $seconds ) { + $this->max_dequeue_time = $seconds; + } + + /** + * Initialize the sync queues, codec and set the default settings. + * + * @access public + */ + public function set_defaults() { + $this->sync_queue = new Queue( 'sync' ); + $this->full_sync_queue = new Queue( 'full_sync' ); + $this->set_codec(); + + // Saved settings. + Settings::set_importing( null ); + $settings = Settings::get_settings(); + $this->set_dequeue_max_bytes( $settings['dequeue_max_bytes'] ); + $this->set_upload_max_bytes( $settings['upload_max_bytes'] ); + $this->set_upload_max_rows( $settings['upload_max_rows'] ); + $this->set_sync_wait_time( $settings['sync_wait_time'] ); + $this->set_enqueue_wait_time( $settings['enqueue_wait_time'] ); + $this->set_sync_wait_threshold( $settings['sync_wait_threshold'] ); + $this->set_max_dequeue_time( Defaults::get_max_sync_execution_time() ); + } + + /** + * Reset sync queues, modules and settings. + * + * @access public + */ + public function reset_data() { + $this->reset_sync_queue(); + $this->reset_full_sync_queue(); + + foreach ( Modules::get_modules() as $module ) { + $module->reset_data(); + } + // Reset Sync locks without unlocking queues since we already reset those. + Actions::reset_sync_locks( false ); + + Settings::reset_data(); + } + + /** + * Perform cleanup at the event of plugin uninstallation. + * + * @access public + */ + public function uninstall() { + // Lets delete all the other fun stuff like transient and option and the sync queue. + $this->reset_data(); + + // Delete the full sync status. + delete_option( 'jetpack_full_sync_status' ); + + // Clear the sync cron. + wp_clear_scheduled_hook( 'jetpack_sync_cron' ); + wp_clear_scheduled_hook( 'jetpack_sync_full_cron' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-server.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-server.php new file mode 100644 index 00000000..d0a0bb3a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-server.php @@ -0,0 +1,195 @@ +:( + * + * @access public + */ + public function __construct() { + $this->codec = new JSON_Deflate_Array_Codec(); + } + + /** + * Set the codec instance. + * + * @access public + * + * @param Automattic\Jetpack\Sync\Codec_Interface $codec Codec instance. + */ + public function set_codec( Codec_Interface $codec ) { + $this->codec = $codec; + } + + /** + * Attempt to lock the request when the server receives concurrent requests from the same blog. + * + * @access public + * + * @param int $blog_id ID of the blog. + * @param int $expiry Blog lock transient lifetime. + * @return boolean True if succeeded, false otherwise. + */ + public function attempt_request_lock( $blog_id, $expiry = self::BLOG_LOCK_TRANSIENT_EXPIRY ) { + $transient_name = $this->get_concurrent_request_transient_name( $blog_id ); + $locked_time = get_site_transient( $transient_name ); + if ( $locked_time ) { + return false; + } + set_site_transient( $transient_name, microtime( true ), $expiry ); + + return true; + } + + /** + * Retrieve the blog lock transient name for a particular blog. + * + * @access public + * + * @param int $blog_id ID of the blog. + * @return string Name of the blog lock transient. + */ + private function get_concurrent_request_transient_name( $blog_id ) { + return self::BLOG_LOCK_TRANSIENT_PREFIX . $blog_id; + } + + /** + * Remove the request lock from a particular blog ID. + * + * @access public + * + * @param int $blog_id ID of the blog. + */ + public function remove_request_lock( $blog_id ) { + delete_site_transient( $this->get_concurrent_request_transient_name( $blog_id ) ); + } + + /** + * Receive and process sync events. + * + * @access public + * + * @param array $data Sync events. + * @param object $token The auth token used to invoke the API. + * @param int $sent_timestamp Timestamp (in seconds) when the actions were transmitted. + * @param string $queue_id ID of the queue from which the event was sent (`sync` or `full_sync`). + * @return array Processed sync events. + */ + public function receive( $data, $token = null, $sent_timestamp = null, $queue_id = null ) { + $start_time = microtime( true ); + if ( ! is_array( $data ) ) { + return new WP_Error( 'action_decoder_error', 'Events must be an array' ); + } + + if ( $token && ! $this->attempt_request_lock( $token->blog_id ) ) { + /** + * Fires when the server receives two concurrent requests from the same blog + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param token The token object of the misbehaving site + */ + do_action( 'jetpack_sync_multi_request_fail', $token ); + + return new WP_Error( 'concurrent_request_error', 'There is another request running for the same blog ID' ); + } + + $events = wp_unslash( array_map( array( $this->codec, 'decode' ), $data ) ); + $events_processed = array(); + + /** + * Fires when an array of actions are received from a remote Jetpack site + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array Array of actions received from the remote site + */ + do_action( 'jetpack_sync_remote_actions', $events, $token ); + + foreach ( $events as $key => $event ) { + list( $action_name, $args, $user_id, $timestamp, $silent ) = $event; + + /** + * Fires when an action is received from a remote Jetpack site + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param string $action_name The name of the action executed on the remote site + * @param array $args The arguments passed to the action + * @param int $user_id The external_user_id who did the action + * @param bool $silent Whether the item was created via import + * @param double $timestamp Timestamp (in seconds) when the action occurred + * @param double $sent_timestamp Timestamp (in seconds) when the action was transmitted + * @param string $queue_id ID of the queue from which the event was sent (sync or full_sync) + * @param array $token The auth token used to invoke the API + */ + do_action( 'jetpack_sync_remote_action', $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token ); + + $events_processed[] = $key; + + if ( microtime( true ) - $start_time > self::MAX_TIME_PER_REQUEST_IN_SECONDS ) { + break; + } + } + + if ( $token ) { + $this->remove_request_lock( $token->blog_id ); + } + + return $events_processed; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php new file mode 100644 index 00000000..862e71e6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php @@ -0,0 +1,717 @@ + true, + 'upload_max_bytes' => true, + 'upload_max_rows' => true, + 'sync_wait_time' => true, + 'sync_wait_threshold' => true, + 'enqueue_wait_time' => true, + 'max_queue_size' => true, + 'max_queue_lag' => true, + 'queue_max_writes_sec' => true, + 'post_types_blacklist' => true, + 'taxonomies_blacklist' => true, + 'disable' => true, + 'network_disable' => true, + 'render_filtered_content' => true, + 'post_meta_whitelist' => true, + 'comment_meta_whitelist' => true, + 'max_enqueue_full_sync' => true, + 'max_queue_size_full_sync' => true, + 'sync_via_cron' => true, + 'cron_sync_time_limit' => true, + 'known_importers' => true, + 'term_relationships_full_sync_item_size' => true, + 'sync_sender_enabled' => true, + 'full_sync_sender_enabled' => true, + 'full_sync_send_duration' => true, + 'full_sync_limits' => true, + 'checksum_disable' => true, + 'dedicated_sync_enabled' => true, + 'custom_queue_table_enabled' => true, + 'wpcom_rest_api_enabled' => true, + ); + + /** + * Whether WordPress is currently running an import. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_importing; + + /** + * Whether WordPress is currently running a WP cron request. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_doing_cron; + + /** + * Whether we're currently syncing. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_syncing; + + /** + * Whether we're currently sending sync items. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_sending; + + /** + * Retrieve all settings with their current values. + * + * @access public + * @static + * + * @return array All current settings. + */ + public static function get_settings() { + $settings = array(); + foreach ( array_keys( self::$valid_settings ) as $setting ) { + $settings[ $setting ] = self::get_setting( $setting ); + } + + return $settings; + } + + /** + * Fetches the setting. It saves it if the setting doesn't exist, so that it gets + * autoloaded on page load rather than re-queried every time. + * + * @access public + * @static + * + * @param string $setting The setting name. + * @return mixed The setting value. + */ + public static function get_setting( $setting ) { + if ( ! isset( self::$valid_settings[ $setting ] ) ) { + return false; + } + + if ( self::is_network_setting( $setting ) ) { + if ( is_multisite() ) { + $value = get_site_option( self::SETTINGS_OPTION_PREFIX . $setting ); + } else { + // On single sites just return the default setting. + return Defaults::get_default_setting( $setting ); + } + } else { + $value = get_option( self::SETTINGS_OPTION_PREFIX . $setting ); + } + + if ( false === $value ) { // No default value is set. + $value = Defaults::get_default_setting( $setting ); + if ( self::is_network_setting( $setting ) ) { + update_site_option( self::SETTINGS_OPTION_PREFIX . $setting, $value ); + } else { + // We set one so that it gets autoloaded. + update_option( self::SETTINGS_OPTION_PREFIX . $setting, $value, true ); + } + } + + if ( is_numeric( $value ) ) { + $value = (int) $value; + } + $default_array_value = null; + switch ( $setting ) { + case 'post_types_blacklist': + $default_array_value = Defaults::$blacklisted_post_types; + break; + case 'taxonomies_blacklist': + $default_array_value = Defaults::$blacklisted_taxonomies; + break; + case 'post_meta_whitelist': + $default_array_value = Defaults::get_post_meta_whitelist(); + break; + case 'comment_meta_whitelist': + $default_array_value = Defaults::get_comment_meta_whitelist(); + break; + case 'known_importers': + $default_array_value = Defaults::get_known_importers(); + break; + } + + if ( $default_array_value ) { + if ( is_array( $value ) ) { + $value = array_unique( array_merge( $value, $default_array_value ) ); + } else { + $value = $default_array_value; + } + } + + return $value; + } + + /** + * Change multiple settings in the same time. + * + * @access public + * @static + * + * @param array $new_settings The new settings. + */ + public static function update_settings( $new_settings ) { + $validated_settings = array_intersect_key( $new_settings, self::$valid_settings ); + foreach ( $validated_settings as $setting => $value ) { + + /** + * Custom table migration logic. + * + * This needs to happen before the option is updated, to avoid race conditions where we update the option, + * but haven't yet created the table or can't create it. + * + * On high-traffic sites this can lead to Sync trying to write in a non-existent table. + * + * So to avoid this, we're going to first try to initialize everything and then update the option. + */ + if ( 'custom_queue_table_enabled' === $setting ) { + // Need to check the current value in the database to make sure we're not doing anything weird. + $old_value = get_option( self::SETTINGS_OPTION_PREFIX . $setting, null ); + + if ( ! $old_value && $value ) { + /** + * The custom table has been enabled. + * + * - Initialize the custom table + * - Migrate the data + * + * If something fails, migrate back to the options table and clean up everything about the custom table. + */ + $init_result = Queue_Storage_Table::initialize_custom_sync_table(); + + /** + * Check if there was a problem when initializing the table. + */ + if ( is_wp_error( $init_result ) ) { + /** + * Unable to initialize the table properly. Set the value to `false` as we can't enable it. + */ + $value = false; + + /** + * Send error to WPCOM, so we can track and take an appropriate action. + */ + $data = array( + 'timestamp' => microtime( true ), + 'error_code' => $init_result->get_error_code(), + 'response_body' => $init_result->get_error_message(), + ); + + $sender = Sender::get_instance(); + $sender->send_action( 'jetpack_sync_storage_error_custom_init', $data ); + + } elseif ( ! Queue_Storage_Table::migrate_from_options_table_to_custom_table() ) { + /** + * If the migration fails, do a reverse migration and set the value to `false` as we can't + * safely enable the table. + */ + Queue_Storage_Table::migrate_from_custom_table_to_options_table(); + + // Set $value to `false` as we couldn't do the migration, and we can't continue enabling the table. + $value = false; + + /** + * Send error to WPCOM, so we can track and take an appropriate action. + */ + $data = array( + 'timestamp' => microtime( true ), + // TODO: Maybe add more details here for the migration, i.e. how many items where in the queue? + ); + + $sender = Sender::get_instance(); + $sender->send_action( 'jetpack_sync_storage_error_custom_migrate', $data ); + } + } elseif ( $old_value && ! $value ) { + if ( ! get_transient( Queue_Storage_Table::CUSTOM_QUEUE_TABLE_DISABLE_WPDB_ERROR_NOT_EXIST_FLAG ) ) { + /** + * The custom table has been disabled, migrate what we can from the custom table to the options table unless + * the custom table doesn't exist in the DB. + */ + Queue_Storage_Table::migrate_from_custom_table_to_options_table(); + } + } + } + + /** + * Regular option update and handling + */ + if ( self::is_network_setting( $setting ) ) { + if ( is_multisite() && is_main_site() ) { + $updated = update_site_option( self::SETTINGS_OPTION_PREFIX . $setting, $value ); + } + } else { + $updated = update_option( self::SETTINGS_OPTION_PREFIX . $setting, $value, true ); + } + + // If we set the disabled option to true, clear the queues. + if ( ( 'disable' === $setting || 'network_disable' === $setting ) && (bool) $value ) { + $listener = Listener::get_instance(); + $listener->get_sync_queue()->reset(); + $listener->get_full_sync_queue()->reset(); + } + + // Do not enable Dedicated Sync if we cannot spawn a Dedicated Sync request. + if ( 'dedicated_sync_enabled' === $setting && $updated && (bool) $value ) { + if ( ! Dedicated_Sender::can_spawn_dedicated_sync_request() ) { + update_option( self::SETTINGS_OPTION_PREFIX . $setting, 0, true ); + } + } + + // Do not enable wpcom rest api if we cannot send a test request. + + if ( 'wpcom_rest_api_enabled' === $setting && $updated && (bool) $value ) { + $sender = Sender::get_instance(); + $data = array( + 'timestamp' => microtime( true ), + ); + $items = $sender->send_action( 'jetpack_sync_wpcom_rest_api_enable_test', $data ); + // If we can't send a test request, disable the setting and send action tolog the error. + if ( is_wp_error( $items ) ) { + update_option( self::SETTINGS_OPTION_PREFIX . $setting, 0, true ); + $data = array( + 'timestamp' => microtime( true ), + 'response_code' => $items->get_error_code(), + 'response_body' => $items->get_error_message() ?? '', + ); + $sender->send_action( 'jetpack_sync_wpcom_rest_api_enable_error', $data ); + } + } + } + } + + /** + * Whether the specified setting is a network setting. + * + * @access public + * @static + * + * @param string $setting Setting name. + * @return boolean Whether the setting is a network setting. + */ + public static function is_network_setting( $setting ) { + return str_starts_with( $setting, 'network_' ); + } + + /** + * Returns escaped SQL for blacklisted post types. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_blacklisted_post_types_sql() { + return 'post_type NOT IN (\'' . implode( '\', \'', array_map( 'esc_sql', self::get_setting( 'post_types_blacklist' ) ) ) . '\')'; + } + + /** + * Returns escaped values for disallowed post types. + * + * @access public + * @static + * + * @return array Post type filter values + */ + public static function get_disallowed_post_types_structured() { + return array( + 'post_type' => array( + 'operator' => 'NOT IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'post_types_blacklist' ) ), + ), + ); + } + + /** + * Returns escaped SQL for blacklisted taxonomies. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_blacklisted_taxonomies_sql() { + return "taxonomy NOT IN ('" . implode( "', '", array_map( 'esc_sql', self::get_setting( 'taxonomies_blacklist' ) ) ) . "')"; + } + + /** + * Returns escaped SQL for blacklisted post meta. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_whitelisted_post_meta_sql() { + return 'meta_key IN (\'' . implode( '\', \'', array_map( 'esc_sql', self::get_setting( 'post_meta_whitelist' ) ) ) . '\')'; + } + + /** + * Returns escaped SQL for allowed post meta keys. + * + * @access public + * @static + * + * @return array Meta keys filter values + */ + public static function get_allowed_post_meta_structured() { + return array( + 'meta_key' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'post_meta_whitelist' ) ), + ), + ); + } + + /** + * Returns structured SQL clause for blacklisted taxonomies. + * + * @access public + * @static + * + * @return array taxonomies filter values + */ + public static function get_blacklisted_taxonomies_structured() { + return array( + 'taxonomy' => array( + 'operator' => 'NOT IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'taxonomies_blacklist' ) ), + ), + ); + } + + /** + * Returns structured SQL clause for allowed taxonomies. + * + * @access public + * @static + * + * @return array taxonomies filter values + */ + public static function get_allowed_taxonomies_structured() { + global $wp_taxonomies; + + $allowed_taxonomies = array_keys( $wp_taxonomies ); + $allowed_taxonomies = array_diff( $allowed_taxonomies, self::get_setting( 'taxonomies_blacklist' ) ); + return array( + 'taxonomy' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', $allowed_taxonomies ), + ), + ); + } + + /** + * Returns escaped SQL for blacklisted comment meta. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_whitelisted_comment_meta_sql() { + return 'meta_key IN (\'' . implode( '\', \'', array_map( 'esc_sql', self::get_setting( 'comment_meta_whitelist' ) ) ) . '\')'; + } + + /** + * Returns SQL-escaped values for allowed post meta keys. + * + * @access public + * @static + * + * @return array Meta keys filter values + */ + public static function get_allowed_comment_meta_structured() { + return array( + 'meta_key' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'comment_meta_whitelist' ) ), + ), + ); + } + + /** + * Returns SQL-escaped values for allowed order_item meta keys. + * + * @access public + * @static + * + * @return array Meta keys filter values + */ + public static function get_allowed_order_itemmeta_structured() { + // Make sure that we only try to add the properties when the class exists. + if ( ! class_exists( '\Automattic\Jetpack\Sync\Modules\WooCommerce' ) ) { + return array(); + } + + $values = \Automattic\Jetpack\Sync\Modules\WooCommerce::$order_item_meta_whitelist; + + return array( + 'meta_key' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', $values ), + ), + ); + } + + /** + * Returns escaped SQL for comments, excluding any spam comments. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_comments_filter_sql() { + return "comment_approved <> 'spam'"; + } + + /** + * Delete any settings options and clean up the current settings state. + * + * @access public + * @static + */ + public static function reset_data() { + $valid_settings = self::$valid_settings; + foreach ( $valid_settings as $option => $value ) { + delete_option( self::SETTINGS_OPTION_PREFIX . $option ); + } + self::set_importing( null ); + self::set_doing_cron( null ); + self::set_is_syncing( null ); + self::set_is_sending( null ); + } + + /** + * Set the importing state. + * + * @access public + * @static + * + * @param boolean $is_importing Whether WordPress is currently importing. + */ + public static function set_importing( $is_importing ) { + // Set to NULL to revert to WP_IMPORTING, the standard behavior. + self::$is_importing = $is_importing; + } + + /** + * Whether WordPress is currently importing. + * + * @access public + * @static + * + * @return boolean Whether WordPress is currently importing. + */ + public static function is_importing() { + if ( self::$is_importing !== null ) { + return self::$is_importing; + } + + return defined( 'WP_IMPORTING' ) && WP_IMPORTING; + } + + /** + * Whether sync is enabled. + * + * @access public + * @static + * + * @return boolean Whether sync is enabled. + */ + public static function is_sync_enabled() { + return ! ( self::get_setting( 'disable' ) || self::get_setting( 'network_disable' ) ); + } + + /** + * Set the WP cron state. + * + * @access public + * @static + * + * @param boolean $is_doing_cron Whether WordPress is currently doing WP cron. + */ + public static function set_doing_cron( $is_doing_cron ) { + // Set to NULL to revert to WP_IMPORTING, the standard behavior. + self::$is_doing_cron = $is_doing_cron; + } + + /** + * Whether WordPress is currently doing WP cron. + * + * @access public + * @static + * + * @return boolean Whether WordPress is currently doing WP cron. + */ + public static function is_doing_cron() { + if ( self::$is_doing_cron !== null ) { + return self::$is_doing_cron; + } + + return defined( 'DOING_CRON' ) && DOING_CRON; + } + + /** + * Whether we are currently syncing. + * + * @access public + * @static + * + * @return boolean Whether we are currently syncing. + */ + public static function is_syncing() { + return (bool) self::$is_syncing || Constants::is_true( 'REST_API_REQUEST' ); + } + + /** + * Set the syncing state. + * + * @access public + * @static + * + * @param boolean $is_syncing Whether we are currently syncing. + */ + public static function set_is_syncing( $is_syncing ) { + self::$is_syncing = $is_syncing; + } + + /** + * Whether we are currently sending sync items. + * + * @access public + * @static + * + * @return boolean Whether we are currently sending sync items. + */ + public static function is_sending() { + return (bool) self::$is_sending; + } + + /** + * Set the sending state. + * + * @access public + * @static + * + * @param boolean $is_sending Whether we are currently sending sync items. + */ + public static function set_is_sending( $is_sending ) { + self::$is_sending = $is_sending; + } + + /** + * Whether should send from the queue + * + * @access public + * @static + * + * @param string $queue_id The queue identifier. + * + * @return boolean Whether sync is enabled. + */ + public static function is_sender_enabled( $queue_id ) { + return (bool) self::get_setting( $queue_id . '_sender_enabled' ); + } + + /** + * Whether checksums are enabled. + * + * @access public + * @static + * + * @return boolean Whether sync is enabled. + */ + public static function is_checksum_enabled() { + return ! (bool) self::get_setting( 'checksum_disable' ); + } + + /** + * Whether dedicated Sync flow is enabled. + * + * @access public + * @static + * + * @return boolean Whether dedicated Sync flow is enabled. + */ + public static function is_dedicated_sync_enabled() { + return (bool) self::get_setting( 'dedicated_sync_enabled' ); + } + + /** + * Whether custom queue table is enabled. + * + * @access public + * @static + * + * @return boolean Whether custom queue table is enabled. + */ + public static function is_custom_queue_table_enabled() { + return (bool) self::get_setting( 'custom_queue_table_enabled' ); + } + + /** + * Whether wpcom rest api is enabled. + * + * @access public + * @static + * + * @return boolean Whether wpcom rest api is enabled. + */ + public static function is_wpcom_rest_api_enabled() { + return (bool) self::get_setting( 'wpcom_rest_api_enabled' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php new file mode 100644 index 00000000..cd6f2c37 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php @@ -0,0 +1,62 @@ +json_serialize( $object ) ); + } + + /** + * Encode a sync object. + * + * @access public + * + * @param string $input Encoded sync object to decode. + * @return mixed Decoded sync object. + */ + public function decode( $input ) { + // This is intentionally using base64_decode(). + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + return $this->json_unserialize( base64_decode( $input ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-users.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-users.php new file mode 100644 index 00000000..316df9ce --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-users.php @@ -0,0 +1,152 @@ +has_connected_user() ) { + // Kick off synchronization of user role when it changes. + add_action( 'set_user_role', array( __CLASS__, 'user_role_change' ) ); + } + } + + /** + * Synchronize connected user role changes. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + */ + public static function user_role_change( $user_id ) { + $connection = new Jetpack_Connection(); + if ( $connection->is_user_connected( $user_id ) ) { + self::update_role_on_com( $user_id ); + // Try to choose a new master if we're demoting the current one. + self::maybe_demote_master_user( $user_id ); + } + } + + /** + * Retrieve the role of a user by their ID. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + * @return string Role of the user. + */ + public static function get_role( $user_id ) { + if ( isset( self::$user_roles[ $user_id ] ) ) { + return self::$user_roles[ $user_id ]; + } + + $current_user_id = get_current_user_id(); + wp_set_current_user( $user_id ); + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + wp_set_current_user( $current_user_id ); + self::$user_roles[ $user_id ] = $role; + + return $role; + } + + /** + * Retrieve the signed role of a user by their ID. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + * @return string Signed role of the user. + */ + public static function get_signed_role( $user_id ) { + $connection = new Jetpack_Connection(); + return $connection->sign_role( self::get_role( $user_id ), $user_id ); + } + + /** + * Retrieve the signed role and update it in WP.com for that user. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + */ + public static function update_role_on_com( $user_id ) { + $signed_role = self::get_signed_role( $user_id ); + XMLRPC_Async_Call::add_call( 'jetpack.updateRole', get_current_user_id(), $user_id, $signed_role ); + } + + /** + * Choose a new master user if we're demoting the current one. + * + * @access public + * @static + * @todo Disconnect if there is no user with enough capabilities to be the master user. + * @uses \WP_User_Query + * + * @param int $user_id ID of the user. + */ + public static function maybe_demote_master_user( $user_id ) { + $master_user_id = (int) \Jetpack_Options::get_option( 'master_user' ); + $role = self::get_role( $user_id ); + if ( $user_id === $master_user_id && 'administrator' !== $role ) { + $query = new \WP_User_Query( + array( + 'fields' => array( 'ID' ), + 'role' => 'administrator', + 'orderby' => 'ID', + 'exclude' => array( $master_user_id ), + ) + ); + $new_master = false; + $connection = new Jetpack_Connection(); + foreach ( $query->results as $result ) { + $found_user_id = absint( $result->ID ); + if ( $found_user_id && $connection->is_user_connected( $found_user_id ) ) { + $new_master = $found_user_id; + break; + } + } + + if ( $new_master ) { + \Jetpack_Options::update_option( 'master_user', $new_master ); + } + // TODO: else disconnect..? + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php new file mode 100644 index 00000000..23f24e95 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php @@ -0,0 +1,65 @@ +value; + } + + /** + * Get the ID of a sync item. + * + * @access private + * @static + * + * @param array $item Sync item. + * @return int Sync item ID. + */ + private static function get_item_id( $item ) { + return $item->id; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php new file mode 100644 index 00000000..7653f26d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php @@ -0,0 +1,44 @@ +post_parent && 0 !== $attachment_after->post_parent ) { + /** + * Fires when an existing attachment is added to a post for the first time + * + * @since 1.6.3 + * @since-jetpack 6.6.0 + * + * @param int $attachment_id Attachment ID. + * @param \WP_Post $attachment_after Attachment post object after the update. + */ + do_action( 'jetpack_sync_save_attach_attachment', $attachment_id, $attachment_after ); + } else { + /** + * Fires when the client needs to sync an updated attachment + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param int $attachment_id Attachment ID. + * @param \WP_Post $attachment_after Attachment post object after the update. + * + * Previously this action was synced using jetpack_sync_save_add_attachment action. + */ + do_action( 'jetpack_sync_save_update_attachment', $attachment_id, $attachment_after ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php new file mode 100644 index 00000000..6aceead8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php @@ -0,0 +1,666 @@ + 'home_url', + 'siteurl' => 'site_url', + 'jetpack_active_modules' => 'active_modules', + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'functions'; + } + + /** + * Set module defaults. + * Define the callable whitelist based on whether this is a single site or a multisite installation. + * + * @access public + */ + public function set_defaults() { + if ( is_multisite() ) { + $this->callable_whitelist = array_merge( Defaults::get_callable_whitelist(), Defaults::get_multisite_callable_whitelist() ); + } else { + $this->callable_whitelist = Defaults::get_callable_whitelist(); + } + $this->force_send_callables_on_next_tick = false; // Resets here as well mostly for tests. + } + + /** + * Set module defaults at a later time. + * Reset the callable whitelist if needed to account for plugins adding the 'jetpack_sync_callable_whitelist' + * and 'jetpack_sync_multisite_callable_whitelist' filters late. + * + * @see Automattic\Jetpack\Sync\Modules::set_module_defaults + * @access public + */ + public function set_late_default() { + if ( is_multisite() ) { + $late_callables = array_merge( + apply_filters( 'jetpack_sync_callable_whitelist', array() ), + apply_filters( 'jetpack_sync_multisite_callable_whitelist', array() ) + ); + } else { + $late_callables = apply_filters( 'jetpack_sync_callable_whitelist', array() ); + } + if ( ! empty( $late_callables ) && is_array( $late_callables ) ) { + $this->callable_whitelist = array_merge( $this->callable_whitelist, $late_callables ); + } + } + + /** + * Initialize callables action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'jetpack_sync_callable', $callable, 10, 2 ); + add_action( 'current_screen', array( $this, 'set_plugin_action_links' ), 9999 ); // Should happen very late. + + foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS as $option ) { + add_action( "update_option_{$option}", array( $this, 'unlock_sync_callable' ) ); + add_action( "delete_option_{$option}", array( $this, 'unlock_sync_callable' ) ); + } + + foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS_NEXT_TICK as $option ) { + add_action( "update_option_{$option}", array( $this, 'unlock_sync_callable_next_tick' ) ); + add_action( "delete_option_{$option}", array( $this, 'unlock_sync_callable_next_tick' ) ); + } + + // Provide a hook so that hosts can send changes to certain callables right away. + // Especially useful when a host uses constants to change home and siteurl. + add_action( 'jetpack_sync_unlock_sync_callable', array( $this, 'unlock_sync_callable' ) ); + + // get_plugins and wp_version + // gets fired when new code gets installed, updates etc. + add_action( 'upgrader_process_complete', array( $this, 'unlock_plugin_action_link_and_callables' ) ); + add_action( 'update_option_active_plugins', array( $this, 'unlock_plugin_action_link_and_callables' ) ); + } + + /** + * Initialize callables action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_callables', $callable ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_sync_callables' ) ); + + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_callables', array( $this, 'expand_callables' ) ); + } + + /** + * Perform module cleanup. + * Deletes any transients and options that this module uses. + * Usually triggered when uninstalling the plugin. + * + * @access public + */ + public function reset_data() { + delete_option( self::CALLABLES_CHECKSUM_OPTION_NAME ); + delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ); + + $url_callables = array( 'home_url', 'site_url', 'main_network_site_url' ); + foreach ( $url_callables as $callable ) { + delete_option( Functions::HTTPS_CHECK_OPTION_PREFIX . $callable ); + } + } + + /** + * Set the callable whitelist. + * + * @access public + * + * @param array $callables The new callables whitelist. + */ + public function set_callable_whitelist( $callables ) { + $this->callable_whitelist = $callables; + } + + /** + * Get the callable whitelist. + * + * @access public + * + * @return array The callables whitelist. + */ + public function get_callable_whitelist() { + return $this->callable_whitelist; + } + + /** + * Retrieve all callables as per the current callables whitelist. + * + * @access public + * + * @return array All callables. + */ + public function get_all_callables() { + // get_all_callables should run as the master user always. + $current_user_id = get_current_user_id(); + wp_set_current_user( \Jetpack_Options::get_option( 'master_user' ) ); + $callables = array_combine( + array_keys( $this->get_callable_whitelist() ), + array_map( array( $this, 'get_callable' ), array_values( $this->get_callable_whitelist() ) ) + ); + wp_set_current_user( $current_user_id ); + return $callables; + } + + /** + * Invoke a particular callable. + * Used as a wrapper to standartize invocation. + * + * @access private + * + * @param callable $callable Callable to invoke. + * @return mixed Return value of the callable, null if not callable. + */ + private function get_callable( $callable ) { + if ( is_callable( $callable ) ) { + return call_user_func( $callable ); + } else { + return null; + } + } + + /** + * Enqueue the callable actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all callables to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand callables (should always be true) + */ + do_action( 'jetpack_full_sync_callables', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the callable actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $status This Module Full Sync Status. + * + * @return array This Module Full Sync Status. + */ + public function send_full_sync_actions( $config, $send_until, $status ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_callables', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_callables' ); + } + + /** + * Unlock callables so they would be available for syncing again. + * + * @access public + */ + public function unlock_sync_callable() { + delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ); + } + + /** + * Unlock callables on the next tick. + * Sometime the true callable values are only present on the next tick. + * When switching themes for example. + * + * @access public + */ + public function unlock_sync_callable_next_tick() { + $this->force_send_callables_on_next_tick = true; + } + + /** + * Unlock callables and plugin action links. + * + * @access public + */ + public function unlock_plugin_action_link_and_callables() { + delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ); + delete_transient( 'jetpack_plugin_api_action_links_refresh' ); + add_filter( 'jetpack_check_and_send_callables', '__return_true' ); + } + + /** + * Parse and store the plugin action links if on the plugins page. + * + * @uses \DOMDocument + * @uses libxml_use_internal_errors + * @uses mb_convert_encoding + * + * @access public + */ + public function set_plugin_action_links() { + if ( + ! class_exists( '\DOMDocument' ) || + ! function_exists( 'mb_convert_encoding' ) + ) { + return; + } + + $current_screeen = get_current_screen(); + + $plugins_action_links = array(); + // Is the transient lock in place? + $plugins_lock = get_transient( 'jetpack_plugin_api_action_links_refresh', false ); + if ( ! empty( $plugins_lock ) && ( isset( $current_screeen->id ) && 'plugins' !== $current_screeen->id ) ) { + return; + } + $plugins = array_keys( Functions::get_plugins() ); + foreach ( $plugins as $plugin_file ) { + /** + * Plugins often like to unset things but things break if they are not able to. + */ + $action_links = array( + 'deactivate' => '', + 'activate' => '', + 'details' => '', + 'delete' => '', + 'edit' => '', + ); + /** This filter is documented in src/wp-admin/includes/class-wp-plugins-list-table.php */ + $action_links = apply_filters( 'plugin_action_links', $action_links, $plugin_file, null, 'all' ); + // Verify $action_links is still an array. + if ( ! is_array( $action_links ) ) { + $action_links = array(); + } + /** This filter is documented in src/wp-admin/includes/class-wp-plugins-list-table.php */ + $action_links = apply_filters( "plugin_action_links_{$plugin_file}", $action_links, $plugin_file, null, 'all' ); + // Verify $action_links is still an array to resolve warnings from filters not returning an array. + if ( is_array( $action_links ) ) { + $action_links = array_filter( $action_links ); + } else { + $action_links = array(); + } + $formatted_action_links = null; + if ( $action_links ) { + $dom_doc = new \DOMDocument(); + foreach ( $action_links as $action_link ) { + // The @ is not enough to suppress errors when dealing with libxml, + // we have to tell it directly how we want to handle errors. + libxml_use_internal_errors( true ); + $dom_doc->loadHTML( '' . $action_link ); + libxml_use_internal_errors( false ); + + $link_elements = $dom_doc->getElementsByTagName( 'a' ); + if ( 0 === $link_elements->length ) { + continue; + } + + $link_element = $link_elements->item( 0 ); + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + if ( $link_element instanceof \DOMElement && $link_element->hasAttribute( 'href' ) && $link_element->nodeValue ) { + $link_url = trim( $link_element->getAttribute( 'href' ) ); + + // Add the full admin path to the url if the plugin did not provide it. + $link_url_scheme = wp_parse_url( $link_url, PHP_URL_SCHEME ); + if ( empty( $link_url_scheme ) ) { + $link_url = admin_url( $link_url ); + } + + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + $formatted_action_links[ $link_element->nodeValue ] = $link_url; + } + } + } + if ( $formatted_action_links ) { + $plugins_action_links[ $plugin_file ] = $formatted_action_links; + } + } + // Cache things for a long time. + set_transient( 'jetpack_plugin_api_action_links_refresh', time(), DAY_IN_SECONDS ); + update_option( 'jetpack_plugin_api_action_links', $plugins_action_links ); + } + + /** + * Whether a certain callable should be sent. + * + * @access public + * + * @param array $callable_checksums Callable checksums. + * @param string $name Name of the callable. + * @param string $checksum A checksum of the callable. + * @return boolean Whether to send the callable. + */ + public function should_send_callable( $callable_checksums, $name, $checksum ) { + $idc_override_callables = array( + 'main_network_site', + 'home_url', + 'site_url', + ); + if ( in_array( $name, $idc_override_callables, true ) && \Jetpack_Options::get_option( 'migrate_for_idc' ) ) { + return true; + } + + return ! $this->still_valid_checksum( $callable_checksums, $name, $checksum ); + } + + /** + * Sync the callables if we're supposed to. + * + * @access public + */ + public function maybe_sync_callables() { + $callables = $this->get_all_callables(); + if ( ! apply_filters( 'jetpack_check_and_send_callables', false ) ) { + /** + * Treating Dedicated Sync requests a bit differently from normal. We want to send callables + * normally with all Sync actions, no matter if they were with admin action origin or not, + * since Dedicated Sync runs out of bound and the requests are never coming from an admin. + */ + if ( ! is_admin() && ! Dedicated_Sender::is_dedicated_sync_request() ) { + // If we're not an admin and we're not doing cron and this isn't WP_CLI, don't sync anything. + if ( ! Settings::is_doing_cron() && ! Jetpack_Constants::get_constant( 'WP_CLI' ) ) { + return; + } + // If we're not an admin and we are doing cron, sync the Callables that are always supposed to sync ( See https://github.com/Automattic/jetpack/issues/12924 ). + $callables = $this->get_always_sent_callables(); + } + if ( get_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ) ) { + if ( $this->force_send_callables_on_next_tick ) { + $this->unlock_sync_callable(); + } + return; + } + } + + if ( empty( $callables ) ) { + return; + } + // No need to set the transiant we are trying to remove it anyways. + if ( ! $this->force_send_callables_on_next_tick ) { + set_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME, microtime( true ), Defaults::$default_sync_callables_wait_time ); + } + + $callable_checksums = (array) \Jetpack_Options::get_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, array() ); + $has_changed = false; + // Only send the callables that have changed. + foreach ( $callables as $name => $value ) { + $checksum = $this->get_check_sum( $value ); + + // Explicitly not using Identical comparison as get_option returns a string. + if ( $value !== null && $this->should_send_callable( $callable_checksums, $name, $checksum ) ) { + + // Only send callable if the non sorted checksum also does not match. + if ( $this->should_send_callable( $callable_checksums, $name, $this->get_check_sum( $value, false ) ) ) { + + /** + * Tells the client to sync a callable (aka function) to the server + * + * @param string The name of the callable + * @param mixed The value of the callable + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_sync_callable', $name, $value ); + } + + $callable_checksums[ $name ] = $checksum; + $has_changed = true; + } else { + $callable_checksums[ $name ] = $checksum; + } + } + if ( $has_changed ) { + \Jetpack_Options::update_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, $callable_checksums ); + } + + if ( $this->force_send_callables_on_next_tick ) { + $this->unlock_sync_callable(); + } + } + + /** + * Get the callables that should always be sent, e.g. on cron. + * + * @return array Callables that should always be sent + */ + protected function get_always_sent_callables() { + $callables = $this->get_all_callables(); + $cron_callables = array(); + foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS as $option_name ) { + if ( array_key_exists( $option_name, $callables ) ) { + $cron_callables[ $option_name ] = $callables[ $option_name ]; + continue; + } + + // Check for the Callable name/key for the option, if different from option name. + if ( array_key_exists( $option_name, self::OPTION_NAMES_TO_CALLABLE_NAMES ) ) { + $callable_name = self::OPTION_NAMES_TO_CALLABLE_NAMES[ $option_name ]; + if ( array_key_exists( $callable_name, $callables ) ) { + $cron_callables[ $callable_name ] = $callables[ $callable_name ]; + } + } + } + return $cron_callables; + } + + /** + * Expand the callables within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_callables( $args ) { + if ( $args[0] ) { + $callables = $this->get_all_callables(); + $callables_checksums = array(); + foreach ( $callables as $name => $value ) { + $callables_checksums[ $name ] = $this->get_check_sum( $value ); + } + \Jetpack_Options::update_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, $callables_checksums ); + return $callables; + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( $this->get_callable_whitelist() ); + } + + /** + * Retrieve a set of callables by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'callable' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + if ( 'CALLABLE-DOES-NOT-EXIST' !== $object ) { + if ( 'all' === $id ) { + // If all was requested it contains all options and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + } + + return $objects; + } + + /** + * Retrieve a callable by its name. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Callable. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'callable' === $object_type ) { + + // Only whitelisted options can be returned. + if ( array_key_exists( $id, $this->get_callable_whitelist() ) ) { + // requires master user to be in context. + $current_user_id = get_current_user_id(); + wp_set_current_user( \Jetpack_Options::get_option( 'master_user' ) ); + $callable = $this->get_callable( $this->callable_whitelist[ $id ] ); + wp_set_current_user( $current_user_id ); + return $callable; + } elseif ( 'all' === $id ) { + return $this->get_all_callables(); + } + } + + return 'CALLABLE-DOES-NOT-EXIST'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php new file mode 100644 index 00000000..1fcf7c8b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php @@ -0,0 +1,504 @@ +filter_comment( $comment ); + } + } + + return false; + } + + /** + * Initialize comments action listeners. + * Also responsible for initializing comment meta listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'wp_insert_comment', $callable, 10, 2 ); + add_action( 'deleted_comment', $callable ); + add_action( 'trashed_comment', $callable ); + add_action( 'spammed_comment', $callable ); + add_action( 'trashed_post_comments', $callable, 10, 2 ); + add_action( 'untrash_post_comments', $callable ); + add_action( 'comment_approved_to_unapproved', $callable ); + add_action( 'comment_unapproved_to_approved', $callable ); + add_action( 'jetpack_modified_comment_contents', $callable, 10, 2 ); + add_action( 'untrashed_comment', $callable, 10, 2 ); + add_action( 'unspammed_comment', $callable, 10, 2 ); + add_filter( 'wp_update_comment_data', array( $this, 'handle_comment_contents_modification' ), 10, 3 ); + + // comment actions. + add_filter( 'jetpack_sync_before_enqueue_wp_insert_comment', array( $this, 'filter_jetpack_sync_before_enqueue_wp_insert_comment' ) ); + add_filter( 'jetpack_sync_before_enqueue_deleted_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_trashed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_untrashed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_spammed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_unspammed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + + // comment status transitions. + add_filter( 'jetpack_sync_before_enqueue_comment_approved_to_unapproved', array( $this, 'only_allow_white_listed_comment_type_transitions' ) ); + add_filter( 'jetpack_sync_before_enqueue_comment_unapproved_to_approved', array( $this, 'only_allow_white_listed_comment_type_transitions' ) ); + + // Post Actions. + add_filter( 'jetpack_sync_before_enqueue_trashed_post_comments', array( $this, 'filter_blacklisted_post_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_untrash_post_comments', array( $this, 'filter_blacklisted_post_types' ) ); + + /** + * Even though it's messy, we implement these hooks because + * the edit_comment hook doesn't include the data + * so this saves us a DB read for every comment event. + */ + foreach ( $this->get_whitelisted_comment_types() as $comment_type ) { + foreach ( array( 'unapproved', 'approved' ) as $comment_status ) { + $comment_action_name = "comment_{$comment_status}_{$comment_type}"; + add_action( $comment_action_name, $callable, 10, 2 ); + add_filter( + 'jetpack_sync_before_enqueue_' . $comment_action_name, + array( + $this, + 'expand_wp_insert_comment', + ) + ); + } + } + + // Listen for meta changes. + $this->init_listeners_for_meta_type( 'comment', $callable ); + $this->init_meta_whitelist_handler( 'comment', array( $this, 'filter_meta' ) ); + } + + /** + * Handler for any comment content updates. + * + * @access public + * + * @param array $new_comment The new, processed comment data. + * @param array $old_comment The old, unslashed comment data. + * @param array $new_comment_with_slashes The new, raw comment data. + * @return array The new, processed comment data. + */ + public function handle_comment_contents_modification( $new_comment, $old_comment, $new_comment_with_slashes ) { + $changes = array(); + $content_fields = array( + 'comment_author', + 'comment_author_email', + 'comment_author_url', + 'comment_content', + ); + foreach ( $content_fields as $field ) { + if ( $new_comment_with_slashes[ $field ] !== $old_comment[ $field ] ) { + $changes[ $field ] = array( $new_comment[ $field ], $old_comment[ $field ] ); + } + } + + if ( ! empty( $changes ) ) { + /** + * Signals to the sync listener that this comment's contents were modified and a sync action + * reflecting the change(s) to the content should be sent + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param int $new_comment['comment_ID'] ID of comment whose content was modified + * @param mixed $changes Array of changed comment fields with before and after values + */ + do_action( 'jetpack_modified_comment_contents', $new_comment['comment_ID'], $changes ); + } + return $new_comment; + } + + /** + * Initialize comments action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_comments', $callable ); // Also send comments meta. + } + + /** + * Gets a filtered list of comment types that sync can hook into. + * + * @access public + * + * @return array Defaults to [ '', 'trackback', 'pingback' ]. + */ + public function get_whitelisted_comment_types() { + /** + * Comment types present in this list will sync their status changes to WordPress.com. + * + * @since 1.6.3 + * @since-jetpack 7.6.0 + * + * @param array A list of comment types. + */ + return apply_filters( + 'jetpack_sync_whitelisted_comment_types', + array( '', 'comment', 'trackback', 'pingback', 'review' ) + ); + } + + /** + * Prevents any comment types that are not in the whitelist from being enqueued and sent to WordPress.com. + * + * @param array $args Arguments passed to wp_insert_comment, deleted_comment, spammed_comment, etc. + * + * @return bool or array $args Arguments passed to wp_insert_comment, deleted_comment, spammed_comment, etc. + */ + public function only_allow_white_listed_comment_types( $args ) { + $comment = false; + + if ( isset( $args[1] ) ) { + // comment object is available. + $comment = $args[1]; + } elseif ( is_numeric( $args[0] ) ) { + // comment_id is available. + $comment = get_comment( $args[0] ); + } + + if ( + isset( $comment->comment_type ) + && ! in_array( $comment->comment_type, $this->get_whitelisted_comment_types(), true ) + ) { + return false; + } + + return $args; + } + + /** + * Filter all blacklisted post types. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if the post type is a blacklisted one. + */ + public function filter_blacklisted_post_types( $args ) { + $post_id = $args[0]; + $posts_module = Modules::get_module( 'posts' ); + '@phan-var Posts $posts_module'; + + if ( false !== $posts_module && ! $posts_module->is_post_type_allowed( $post_id ) ) { + return false; + } + + return $args; + } + + /** + * Prevents any comment types that are not in the whitelist from being enqueued and sent to WordPress.com. + * + * @param array $args Arguments passed to wp_{old_status}_to_{new_status}. + * + * @return bool or array $args Arguments passed to wp_{old_status}_to_{new_status} + */ + public function only_allow_white_listed_comment_type_transitions( $args ) { + $comment = $args[0]; + + if ( ! in_array( $comment->comment_type, $this->get_whitelisted_comment_types(), true ) ) { + return false; + } + + return $args; + } + + /** + * Prevents any comment types that are not in the whitelist from being enqueued and sent to WordPress.com. + * Also expands comment data before being enqueued. + * + * @param array $args Arguments passed to wp_insert_comment. + * + * @return false or array $args Arguments passed to wp_insert_comment or false if the comment type is a blacklisted one. + */ + public function filter_jetpack_sync_before_enqueue_wp_insert_comment( $args ) { + if ( false === $this->only_allow_white_listed_comment_types( $args ) ) { + return false; + } + + return $this->expand_wp_insert_comment( $args ); + } + + /** + * Whether a comment type is allowed. + * A comment type is allowed if it's present in the comment type whitelist. + * + * @param int $comment_id ID of the comment. + * @return boolean Whether the comment type is allowed. + */ + public function is_comment_type_allowed( $comment_id ) { + $comment = get_comment( $comment_id ); + + if ( isset( $comment->comment_type ) ) { + return in_array( $comment->comment_type, $this->get_whitelisted_comment_types(), true ); + } + return false; + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_comments', array( $this, 'expand_comment_ids' ) ); + } + + /** + * Enqueue the comments actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_comments', $wpdb->comments, 'comment_ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->comments"; + + $where_sql = $this->get_where_sql( $config ); + if ( $where_sql ) { + $query .= ' WHERE ' . $where_sql; + } + + // TODO: Call $wpdb->prepare on the following query. + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + $count = (int) $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + if ( is_array( $config ) ) { + return 'comment_ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return '1=1'; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_comments' ); + } + + /** + * Count all the actions that are going to be sent. + * + * @access public + * + * @param array $action_names Names of all the actions that will be sent. + * @return int Number of actions. + */ + public function count_full_sync_actions( $action_names ) { + return $this->count_actions( $action_names, array( 'jetpack_full_sync_comments' ) ); + } + + /** + * Expand the comment status change before the data is serialized and sent to the server. + * + * @access public + * @todo This is not used currently - let's implement it. + * + * @param array $args The hook parameters. + * @return array The expanded hook parameters. + */ + public function expand_wp_comment_status_change( $args ) { + return array( $args[0], $this->filter_comment( $args[1] ) ); + } + + /** + * Expand the comment creation before the data is added to the Sync queue. + * + * @access public + * + * @param array $args The hook parameters. + * @return array The expanded hook parameters. + */ + public function expand_wp_insert_comment( $args ) { + return array( $args[0], $this->filter_comment( $args[1] ) ); + } + + /** + * Filter a comment object to the fields we need. + * + * @access public + * + * @param \WP_Comment $comment The unfiltered comment object. + * @return \WP_Comment Filtered comment object. + */ + public function filter_comment( $comment ) { + /** + * Filters whether to prevent sending comment data to .com + * + * Passing true to the filter will prevent the comment data from being sent + * to the WordPress.com. + * Instead we pass data that will still enable us to do a checksum against the + * Jetpacks data but will prevent us from displaying the data on in the API as well as + * other services. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean false prevent post data from bing synced to WordPress.com + * @param mixed $comment WP_COMMENT object + */ + if ( apply_filters( 'jetpack_sync_prevent_sending_comment_data', false, $comment ) ) { + $blocked_comment = new \stdClass(); + $blocked_comment->comment_ID = $comment->comment_ID; + $blocked_comment->comment_date = $comment->comment_date; + $blocked_comment->comment_date_gmt = $comment->comment_date_gmt; + $blocked_comment->comment_approved = 'jetpack_sync_blocked'; + return $blocked_comment; + } + + return $comment; + } + + /** + * Whether a certain comment meta key is whitelisted for sync. + * + * @access public + * + * @param string $meta_key Comment meta key. + * @return boolean Whether the meta key is whitelisted. + */ + public function is_whitelisted_comment_meta( $meta_key ) { + return in_array( $meta_key, Settings::get_setting( 'comment_meta_whitelist' ), true ); + } + + /** + * Handler for filtering out non-whitelisted comment meta. + * + * @access public + * + * @param array $args Hook args. + * @return array|boolean False if not whitelisted, the original hook args otherwise. + */ + public function filter_meta( $args ) { + if ( $this->is_comment_type_allowed( $args[1] ) && $this->is_whitelisted_comment_meta( $args[2] ) ) { + return $args; + } + + return false; + } + + /** + * Expand the comment IDs to comment objects and meta before being serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array The expanded hook parameters. + */ + public function expand_comment_ids( $args ) { + list( $comment_ids, $previous_interval_end ) = $args; + $comments = get_comments( + array( + 'include_unapproved' => true, + 'comment__in' => $comment_ids, + 'orderby' => 'comment_ID', + 'order' => 'DESC', + ) + ); + + return array( + $comments, + $this->get_metadata( $comment_ids, 'comment', Settings::get_setting( 'comment_meta_whitelist' ) ), + $previous_interval_end, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php new file mode 100644 index 00000000..ec913477 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php @@ -0,0 +1,338 @@ +constants_whitelist = $constants; + } + + /** + * Get the constants whitelist. + * + * @access public + * + * @return array The constants whitelist. + */ + public function get_constants_whitelist() { + return Defaults::get_constants_whitelist(); + } + + /** + * Enqueue the constants actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all constants to the server + * + * @param boolean Whether to expand constants (should always be true) + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_full_sync_constants', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the constants actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_constants', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_constants' ); + } + + /** + * Sync the constants if we're supposed to. + * + * @access public + */ + public function maybe_sync_constants() { + if ( get_transient( self::CONSTANTS_AWAIT_TRANSIENT_NAME ) ) { + return; + } + + set_transient( self::CONSTANTS_AWAIT_TRANSIENT_NAME, microtime( true ), Defaults::$default_sync_constants_wait_time ); + + $constants = $this->get_all_constants(); + if ( empty( $constants ) ) { + return; + } + + $constants_checksums = (array) get_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, array() ); + + foreach ( $constants as $name => $value ) { + $checksum = $this->get_check_sum( $value ); + // Explicitly not using Identical comparison as get_option returns a string. + if ( ! $this->still_valid_checksum( $constants_checksums, $name, $checksum ) && $value !== null ) { + /** + * Tells the client to sync a constant to the server + * + * @param string The name of the constant + * @param mixed The value of the constant + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_sync_constant', $name, $value ); + $constants_checksums[ $name ] = $checksum; + } else { + $constants_checksums[ $name ] = $checksum; + } + } + update_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, $constants_checksums ); + } + + /** + * Retrieve all constants as per the current constants whitelist. + * Public so that we don't have to store an option for each constant. + * + * @access public + * + * @return array All constants. + */ + public function get_all_constants() { + $constants_whitelist = $this->get_constants_whitelist(); + + return array_combine( + $constants_whitelist, + array_map( array( $this, 'get_constant' ), $constants_whitelist ) + ); + } + + /** + * Retrieve the value of a constant. + * Used as a wrapper to standartize access to constants. + * + * @access private + * + * @param string $constant Constant name. + * + * @return mixed Return value of the constant. + */ + private function get_constant( $constant ) { + return ( defined( $constant ) ) ? + constant( $constant ) + : null; + } + + /** + * Expand the constants within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * + * @return array $args The hook parameters. + */ + public function expand_constants( $args ) { + if ( $args[0] ) { + $constants = $this->get_all_constants(); + $constants_checksums = array(); + foreach ( $constants as $name => $value ) { + $constants_checksums[ $name ] = $this->get_check_sum( $value ); + } + update_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, $constants_checksums ); + + return $constants; + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( $this->get_constants_whitelist() ); + } + + /** + * Retrieve a set of constants by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'constant' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + if ( 'all' === $id ) { + // If all was requested it contains all options and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + + return $objects; + } + + /** + * Retrieve a constant by its name. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Constant. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'constant' === $object_type ) { + + // Only whitelisted constants can be returned. + if ( in_array( $id, $this->get_constants_whitelist(), true ) ) { + return $this->get_constant( $id ); + } elseif ( 'all' === $id ) { + return $this->get_all_constants(); + } + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php new file mode 100644 index 00000000..72fa43f6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php @@ -0,0 +1,478 @@ +is_started() && ! $this->is_finished() ) { + /** + * Fires when a full sync is cancelled. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_full_sync_cancelled' ); + $this->send_action( 'jetpack_full_sync_cancelled' ); + } + + // Remove all evidence of previous full sync items and status. + $this->reset_data(); + + if ( ! is_array( $full_sync_config ) ) { + /* + * Filter default sync config to allow injecting custom configuration. + * + * @param array $full_sync_config Sync configuration for all sync modules. + * + * @since 3.10.0 + */ + $full_sync_config = apply_filters( 'jetpack_full_sync_config', Defaults::$default_full_sync_config ); + if ( is_multisite() ) { + $full_sync_config['network_options'] = 1; + } + } + + if ( isset( $full_sync_config['users'] ) && 'initial' === $full_sync_config['users'] ) { + $users_module = Modules::get_module( 'users' ); + '@phan-var Users $users_module'; + $full_sync_config['users'] = $users_module->get_initial_sync_user_config(); + } + + $this->update_status( + array( + 'started' => time(), + 'config' => $full_sync_config, + 'progress' => $this->get_initial_progress( $full_sync_config ), + ) + ); + + $range = $this->get_content_range(); + /** + * Fires when a full sync begins. This action is serialized + * and sent to the server so that it knows a full sync is coming. + * + * @param array $full_sync_config Sync configuration for all sync modules. + * @param array $range Range of the sync items, containing min and max IDs for some item types. + * @param array $empty The modules with no items to sync during a full sync. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + * @since-jetpack 7.4.0 Added $empty arg. + */ + do_action( 'jetpack_full_sync_start', $full_sync_config, $range ); + $this->send_action( 'jetpack_full_sync_start', array( $full_sync_config, $range ) ); + + return true; + } + + /** + * Whether full sync has started. + * + * @access public + * + * @return boolean + */ + public function is_started() { + return (bool) $this->get_status()['started']; + } + + /** + * Retrieve the status of the current full sync. + * + * @access public + * + * @return array Full sync status. + */ + public function get_status() { + $default = array( + 'started' => false, + 'finished' => false, + 'progress' => array(), + 'config' => array(), + ); + + return wp_parse_args( \Jetpack_Options::get_raw_option( self::STATUS_OPTION ), $default ); + } + + /** + * Returns the progress percentage of a full sync. + * + * @access public + * + * @return int|null + */ + public function get_sync_progress_percentage() { + if ( ! $this->is_started() || $this->is_finished() ) { + return null; + } + $status = $this->get_status(); + if ( empty( $status['progress'] ) ) { + return null; + } + $total_items = array_reduce( + array_values( $status['progress'] ), + function ( $sum, $sync_item ) { + return isset( $sync_item['total'] ) ? ( $sum + (int) $sync_item['total'] ) : $sum; + }, + 0 + ); + $total_sent = array_reduce( + array_values( $status['progress'] ), + function ( $sum, $sync_item ) { + return isset( $sync_item['sent'] ) ? ( $sum + (int) $sync_item['sent'] ) : $sum; + }, + 0 + ); + return floor( ( $total_sent / $total_items ) * 100 ); + } + + /** + * Whether full sync has finished. + * + * @access public + * + * @return boolean + */ + public function is_finished() { + return (bool) $this->get_status()['finished']; + } + + /** + * Clear all the full sync data. + * + * @access public + */ + public function reset_data() { + $this->clear_status(); + ( new Lock() )->remove( self::LOCK_NAME, true ); + } + + /** + * Clear all the full sync status options. + * + * @access public + */ + public function clear_status() { + \Jetpack_Options::delete_raw_option( self::STATUS_OPTION ); + } + + /** + * Updates the status of the current full sync. + * + * @access public + * + * @param array $values New values to set. + * + * @return bool True if success. + */ + public function update_status( $values ) { + return $this->set_status( wp_parse_args( $values, $this->get_status() ) ); + } + + /** + * Retrieve the status of the current full sync. + * + * @param array $values New values to set. + * + * @access public + * + * @return boolean Full sync status. + */ + public function set_status( $values ) { + return \Jetpack_Options::update_raw_option( self::STATUS_OPTION, $values ); + } + + /** + * Given an initial Full Sync configuration get the initial status. + * + * @param array $full_sync_config Full sync configuration. + * + * @return array Initial Sent status. + */ + public function get_initial_progress( $full_sync_config ) { + // Set default configuration, calculate totals, and save configuration if totals > 0. + $status = array(); + foreach ( $full_sync_config as $name => $config ) { + $module = Modules::get_module( $name ); + if ( ! $module ) { + continue; + } + $status[ $name ] = array( + 'total' => $module->total( $config ), + 'sent' => 0, + 'finished' => false, + ); + } + + return $status; + } + + /** + * Get the range for content (posts and comments) to sync. + * + * @access private + * + * @return array Array of range (min ID, max ID, total items) for all content types. + */ + private function get_content_range() { + $range = array(); + $config = $this->get_status()['config']; + // Add range only when syncing all objects. + if ( true === isset( $config['posts'] ) && $config['posts'] ) { + $range['posts'] = $this->get_range( 'posts' ); + } + + if ( true === isset( $config['comments'] ) && $config['comments'] ) { + $range['comments'] = $this->get_range( 'comments' ); + } + + return $range; + } + + /** + * Get the range (min ID, max ID and total items) of items to sync. + * + * @access public + * + * @param string $type Type of sync item to get the range for. + * + * @return array Array of min ID, max ID and total items in the range. + */ + public function get_range( $type ) { + global $wpdb; + if ( ! in_array( $type, array( 'comments', 'posts' ), true ) ) { + return array(); + } + + switch ( $type ) { + case 'posts': + $table = $wpdb->posts; + $id = 'ID'; + $where_sql = Settings::get_blacklisted_post_types_sql(); + + break; + case 'comments': + $table = $wpdb->comments; + $id = 'comment_ID'; + $where_sql = Settings::get_comments_filter_sql(); + break; + } + + // TODO: Call $wpdb->prepare on the following query. + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $results = $wpdb->get_results( "SELECT MAX({$id}) as max, MIN({$id}) as min, COUNT({$id}) as count FROM {$table} WHERE {$where_sql}" ); + if ( isset( $results[0] ) ) { + return $results[0]; + } + + return array(); + } + + /** + * Continue sending instead of enqueueing. + * + * @access public + */ + public function continue_enqueuing() { + $this->continue_sending(); + } + + /** + * Continue sending. + * + * @access public + */ + public function continue_sending() { + // Return early if Full Sync is not running. + if ( ! $this->is_started() || $this->get_status()['finished'] ) { + return; + } + + // Return early if we've gotten a retry-after header response. + $retry_time = get_option( Actions::RETRY_AFTER_PREFIX . 'immediate-send' ); + if ( $retry_time ) { + // If expired delete but don't send. Send will occurr in new request to avoid race conditions. + if ( microtime( true ) > $retry_time ) { + update_option( Actions::RETRY_AFTER_PREFIX . 'immediate-send', false, false ); + } + return false; + } + + // Obtain send Lock. + $lock = new Lock(); + $lock_expiration = $lock->attempt( self::LOCK_NAME ); + + // Return if unable to obtain lock. + if ( false === $lock_expiration ) { + return; + } + + // Send Full Sync actions. + $success = $this->send(); + + // Remove lock. + if ( $success ) { + $lock->remove( self::LOCK_NAME, $lock_expiration ); + } + } + + /** + * Immediately send the next items to full sync. + * + * @access public + */ + public function send() { + $config = $this->get_status()['config']; + + $max_duration = Settings::get_setting( 'full_sync_send_duration' ); + $send_until = microtime( true ) + $max_duration; + + $progress = $this->get_status()['progress']; + + foreach ( $this->get_remaining_modules_to_send() as $module ) { + $progress[ $module->name() ] = $module->send_full_sync_actions( $config[ $module->name() ], $progress[ $module->name() ], $send_until ); + if ( isset( $progress[ $module->name() ]['error'] ) ) { + unset( $progress[ $module->name() ]['error'] ); + $this->update_status( array( 'progress' => $progress ) ); + return false; + } elseif ( ! $progress[ $module->name() ]['finished'] ) { + $this->update_status( array( 'progress' => $progress ) ); + return true; + } + } + + $this->send_full_sync_end(); + $this->update_status( array( 'progress' => $progress ) ); + return true; + } + + /** + * Get Modules that are configured to Full Sync and haven't finished sending + * + * @return array + */ + public function get_remaining_modules_to_send() { + $status = $this->get_status(); + + return array_filter( + Modules::get_modules(), + /** + * Select configured and not finished modules. + * + * @param Module $module + * @return bool + */ + function ( $module ) use ( $status ) { + // Skip module if not configured for this sync or module is done. + if ( ! isset( $status['config'][ $module->name() ] ) ) { + return false; + } + if ( ! $status['config'][ $module->name() ] ) { + return false; + } + if ( isset( $status['progress'][ $module->name() ]['finished'] ) ) { + if ( true === $status['progress'][ $module->name() ]['finished'] ) { + return false; + } + } + + return true; + } + ); + } + + /** + * Send 'jetpack_full_sync_end' and update 'finished' status. + * + * @access public + */ + public function send_full_sync_end() { + $range = $this->get_content_range(); + + /** + * Fires when a full sync ends. This action is serialized + * and sent to the server. + * + * @param string $checksum Deprecated since 7.3.0 - @see https://github.com/Automattic/jetpack/pull/11945/ + * @param array $range Range of the sync items, containing min and max IDs for some item types. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + */ + do_action( 'jetpack_full_sync_end', '', $range ); + $this->send_action( 'jetpack_full_sync_end', array( '', $range ) ); + + // Setting autoload to true means that it's faster to check whether we should continue enqueuing. + $this->update_status( array( 'finished' => time() ) ); + } + + /** + * Empty Function as we don't close buffers on Immediate Full Sync. + * + * @param array $actions an array of actions, ignored for queueless sync. + */ + public function update_sent_progress_action( $actions ) { } // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php new file mode 100644 index 00000000..c7b5501d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php @@ -0,0 +1,730 @@ +is_started() && ! $this->is_finished(); + + // Remove all evidence of previous full sync items and status. + $this->reset_data(); + + if ( $was_already_running ) { + /** + * Fires when a full sync is cancelled. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_full_sync_cancelled' ); + } + + $this->update_status_option( 'started', time() ); + $this->update_status_option( 'params', $module_configs ); + + $enqueue_status = array(); + $full_sync_config = array(); + $include_empty = false; + $empty = array(); + + // Default value is full sync. + if ( ! is_array( $module_configs ) ) { + $module_configs = array(); + $include_empty = true; + foreach ( Modules::get_modules() as $module ) { + $module_configs[ $module->name() ] = true; + } + } + + // Set default configuration, calculate totals, and save configuration if totals > 0. + foreach ( Modules::get_modules() as $module ) { + $module_name = $module->name(); + $module_config = isset( $module_configs[ $module_name ] ) ? $module_configs[ $module_name ] : false; + + if ( ! $module_config ) { + continue; + } + + if ( 'users' === $module_name && 'initial' === $module_config ) { + '@phan-var Users $module'; + $module_config = $module->get_initial_sync_user_config(); + } + + $enqueue_status[ $module_name ] = false; + + $total_items = $module->estimate_full_sync_actions( $module_config ); + + // If there's information to process, configure this module. + if ( $total_items !== null && $total_items > 0 ) { + $full_sync_config[ $module_name ] = $module_config; + $enqueue_status[ $module_name ] = array( + $total_items, // Total. + 0, // Queued. + false, // Current state. + ); + } elseif ( $include_empty && 0 === $total_items ) { + $empty[ $module_name ] = true; + } + } + + $this->set_config( $full_sync_config ); + $this->set_enqueue_status( $enqueue_status ); + + $range = $this->get_content_range( $full_sync_config ); + /** + * Fires when a full sync begins. This action is serialized + * and sent to the server so that it knows a full sync is coming. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + * @since-jetpack 7.4.0 Added $empty arg. + * + * @param array $full_sync_config Sync configuration for all sync modules. + * @param array $range Range of the sync items, containing min and max IDs for some item types. + * @param array $empty The modules with no items to sync during a full sync. + */ + do_action( 'jetpack_full_sync_start', $full_sync_config, $range, $empty ); + + $this->continue_enqueuing( $full_sync_config ); + + return true; + } + + /** + * Enqueue the next items to sync. + * + * @access public + * + * @param array $configs Full sync configuration for all sync modules. + */ + public function continue_enqueuing( $configs = null ) { + // Return early if not in progress. + if ( ! $this->get_status_option( 'started' ) || $this->get_status_option( 'queue_finished' ) ) { + return; + } + + // Attempt to obtain lock. + $lock = new Lock(); + $lock_expiration = $lock->attempt( self::ENQUEUE_LOCK_NAME ); + + // Return if unable to obtain lock. + if ( false === $lock_expiration ) { + return; + } + + // enqueue full sync actions. + $this->enqueue( $configs ); + + // Remove lock. + $lock->remove( self::ENQUEUE_LOCK_NAME, $lock_expiration ); + } + + /** + * Get Modules that are configured to Full Sync and haven't finished enqueuing + * + * @param array $configs Full sync configuration for all sync modules. + * + * @return array + */ + public function get_remaining_modules_to_enqueue( $configs ) { + $enqueue_status = $this->get_enqueue_status(); + return array_filter( + Modules::get_modules(), + /** + * Select configured and not finished modules. + * + * @param Module $module + * @return bool + */ + function ( $module ) use ( $configs, $enqueue_status ) { + // Skip module if not configured for this sync or module is done. + if ( ! isset( $configs[ $module->name() ] ) ) { + return false; + } + if ( ! $configs[ $module->name() ] ) { + return false; + } + if ( isset( $enqueue_status[ $module->name() ][2] ) ) { + if ( true === $enqueue_status[ $module->name() ][2] ) { + return false; + } + } + + return true; + } + ); + } + + /** + * Enqueue the next items to sync. + * + * @access public + * + * @param array $configs Full sync configuration for all sync modules. + */ + public function enqueue( $configs = null ) { + if ( ! $configs ) { + $configs = $this->get_config(); + } + + $enqueue_status = $this->get_enqueue_status(); + $full_sync_queue = new Queue( 'full_sync' ); + $available_queue_slots = Settings::get_setting( 'max_queue_size_full_sync' ) - $full_sync_queue->size(); + + if ( $available_queue_slots <= 0 ) { + return; + } + + $remaining_items_to_enqueue = min( Settings::get_setting( 'max_enqueue_full_sync' ), $available_queue_slots ); + + /** + * If a module exits early (e.g. because it ran out of full sync queue slots, or we ran out of request time) + * then it should exit early + */ + foreach ( $this->get_remaining_modules_to_enqueue( $configs ) as $module ) { + list( $items_enqueued, $next_enqueue_state ) = $module->enqueue_full_sync_actions( $configs[ $module->name() ], $remaining_items_to_enqueue, $enqueue_status[ $module->name() ][2] ); + + $enqueue_status[ $module->name() ][2] = $next_enqueue_state; + + // If items were processed, subtract them from the limit. + if ( $items_enqueued !== null && $items_enqueued > 0 ) { + $enqueue_status[ $module->name() ][1] += $items_enqueued; + $remaining_items_to_enqueue -= $items_enqueued; + } + + if ( 0 >= $remaining_items_to_enqueue || true !== $next_enqueue_state ) { + $this->set_enqueue_status( $enqueue_status ); + return; + } + } + + $this->queue_full_sync_end( $configs ); + $this->set_enqueue_status( $enqueue_status ); + } + + /** + * Enqueue 'jetpack_full_sync_end' and update 'queue_finished' status. + * + * @access public + * + * @param array $configs Full sync configuration for all sync modules. + */ + public function queue_full_sync_end( $configs ) { + $range = $this->get_content_range( $configs ); + + /** + * Fires when a full sync ends. This action is serialized + * and sent to the server. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + * + * @param string $checksum Deprecated since 7.3.0 - @see https://github.com/Automattic/jetpack/pull/11945/ + * @param array $range Range of the sync items, containing min and max IDs for some item types. + */ + do_action( 'jetpack_full_sync_end', '', $range ); + + // Setting autoload to true means that it's faster to check whether we should continue enqueuing. + $this->update_status_option( 'queue_finished', time(), true ); + } + + /** + * Get the range (min ID, max ID and total items) of items to sync. + * + * @access public + * + * @param string $type Type of sync item to get the range for. + * @return array Array of min ID, max ID and total items in the range. + */ + public function get_range( $type ) { + global $wpdb; + if ( ! in_array( $type, array( 'comments', 'posts' ), true ) ) { + return array(); + } + + switch ( $type ) { + case 'posts': + $table = $wpdb->posts; + $id = 'ID'; + $where_sql = Settings::get_blacklisted_post_types_sql(); + + break; + case 'comments': + $table = $wpdb->comments; + $id = 'comment_ID'; + $where_sql = Settings::get_comments_filter_sql(); + break; + } + + // TODO: Call $wpdb->prepare on the following query. + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $results = $wpdb->get_results( "SELECT MAX({$id}) as max, MIN({$id}) as min, COUNT({$id}) as count FROM {$table} WHERE {$where_sql}" ); + if ( isset( $results[0] ) ) { + return $results[0]; + } + + return array(); + } + + /** + * Get the range for content (posts and comments) to sync. + * + * @access private + * + * @param array $config Full sync configuration for this all sync modules. + * @return array Array of range (min ID, max ID, total items) for all content types. + */ + private function get_content_range( $config ) { + $range = array(); + // Only when we are sending the whole range do we want to send also the range. + if ( true === isset( $config['posts'] ) && $config['posts'] ) { + $range['posts'] = $this->get_range( 'posts' ); + } + + if ( true === isset( $config['comments'] ) && $config['comments'] ) { + $range['comments'] = $this->get_range( 'comments' ); + } + return $range; + } + + /** + * Update the progress after sync modules actions have been processed on the server. + * + * @access public + * + * @param array $actions Actions that have been processed on the server. + */ + public function update_sent_progress_action( $actions ) { + // Quick way to map to first items with an array of arrays. + $actions_with_counts = array_count_values( array_filter( array_map( array( $this, 'get_action_name' ), $actions ) ) ); + + // Total item counts for each action. + $actions_with_total_counts = $this->get_actions_totals( $actions ); + + if ( ! $this->is_started() || $this->is_finished() ) { + return; + } + + if ( isset( $actions_with_counts['jetpack_full_sync_start'] ) ) { + $this->update_status_option( 'send_started', time() ); + } + + foreach ( Modules::get_modules() as $module ) { + $module_actions = $module->get_full_sync_actions(); + $status_option_name = "{$module->name()}_sent"; + $total_option_name = "{$status_option_name}_total"; + $items_sent = $this->get_status_option( $status_option_name, 0 ); + $items_sent_total = $this->get_status_option( $total_option_name, 0 ); + + foreach ( $module_actions as $module_action ) { + if ( isset( $actions_with_counts[ $module_action ] ) ) { + $items_sent += $actions_with_counts[ $module_action ]; + } + + if ( ! empty( $actions_with_total_counts[ $module_action ] ) ) { + $items_sent_total += $actions_with_total_counts[ $module_action ]; + } + } + + if ( $items_sent > 0 ) { + $this->update_status_option( $status_option_name, $items_sent ); + } + + if ( 0 !== $items_sent_total ) { + $this->update_status_option( $total_option_name, $items_sent_total ); + } + } + + if ( isset( $actions_with_counts['jetpack_full_sync_end'] ) ) { + $this->update_status_option( 'finished', time() ); + } + } + + /** + * Returns the progress percentage of a full sync. + * + * @access public + * + * @return int|null + */ + public function get_sync_progress_percentage() { + if ( ! $this->is_started() || $this->is_finished() ) { + return null; + } + $status = $this->get_status(); + if ( ! $status['queue'] || ! $status['sent'] || ! $status['total'] ) { + return null; + } + $queued_multiplier = 0.1; + $sent_multiplier = 0.9; + $count_queued = array_reduce( + $status['queue'], + function ( $sum, $value ) { + return $sum + $value; + }, + 0 + ); + $count_sent = array_reduce( + $status['sent'], + function ( $sum, $value ) { + return $sum + $value; + }, + 0 + ); + $count_total = array_reduce( + $status['total'], + function ( $sum, $value ) { + return $sum + $value; + }, + 0 + ); + $percent_queued = ( $count_queued / $count_total ) * $queued_multiplier * 100; + $percent_sent = ( $count_sent / $count_total ) * $sent_multiplier * 100; + return ceil( $percent_queued + $percent_sent ); + } + + /** + * Get the name of the action for an item in the sync queue. + * + * @access public + * + * @param array $queue_item Item of the sync queue. + * @return string|boolean Name of the action, false if queue item is invalid. + */ + public function get_action_name( $queue_item ) { + if ( is_array( $queue_item ) && isset( $queue_item[0] ) ) { + return $queue_item[0]; + } + return false; + } + + /** + * Retrieve the total number of items we're syncing in a particular queue item (action). + * `$queue_item[1]` is expected to contain chunks of items, and `$queue_item[1][0]` + * represents the first (and only) chunk of items to sync in that action. + * + * @access public + * + * @param array $queue_item Item of the sync queue that corresponds to a particular action. + * @return int Total number of items in the action. + */ + public function get_action_totals( $queue_item ) { + if ( is_array( $queue_item ) && isset( $queue_item[1][0] ) ) { + if ( is_array( $queue_item[1][0] ) ) { + // Let's count the items we sync in this action. + return count( $queue_item[1][0] ); + } + // -1 indicates that this action syncs all items by design. + return -1; + } + return 0; + } + + /** + * Retrieve the total number of items for a set of actions, grouped by action name. + * + * @access public + * + * @param array $actions An array of actions. + * @return array An array, representing the total number of items, grouped per action. + */ + public function get_actions_totals( $actions ) { + $totals = array(); + + foreach ( $actions as $action ) { + $name = $this->get_action_name( $action ); + $action_totals = $this->get_action_totals( $action ); + if ( ! isset( $totals[ $name ] ) ) { + $totals[ $name ] = 0; + } + $totals[ $name ] += $action_totals; + } + + return $totals; + } + + /** + * Whether full sync has started. + * + * @access public + * + * @return boolean + */ + public function is_started() { + return (bool) $this->get_status_option( 'started' ); + } + + /** + * Whether full sync has finished. + * + * @access public + * + * @return boolean + */ + public function is_finished() { + return (bool) $this->get_status_option( 'finished' ); + } + + /** + * Retrieve the status of the current full sync. + * + * @access public + * + * @return array Full sync status. + */ + public function get_status() { + $status = array( + 'started' => $this->get_status_option( 'started' ), + 'queue_finished' => $this->get_status_option( 'queue_finished' ), + 'send_started' => $this->get_status_option( 'send_started' ), + 'finished' => $this->get_status_option( 'finished' ), + 'sent' => array(), + 'sent_total' => array(), + 'queue' => array(), + 'config' => $this->get_status_option( 'params' ), + 'total' => array(), + ); + + $enqueue_status = $this->get_enqueue_status(); + + foreach ( Modules::get_modules() as $module ) { + $name = $module->name(); + + if ( ! isset( $enqueue_status[ $name ] ) ) { + continue; + } + + list( $total, $queued ) = $enqueue_status[ $name ]; + + if ( $total ) { + $status['total'][ $name ] = $total; + } + + if ( $queued ) { + $status['queue'][ $name ] = $queued; + } + + $sent = $this->get_status_option( "{$name}_sent" ); + if ( $sent ) { + $status['sent'][ $name ] = $sent; + } + + $sent_total = $this->get_status_option( "{$name}_sent_total" ); + if ( $sent_total ) { + $status['sent_total'][ $name ] = $sent_total; + } + } + + return $status; + } + + /** + * Clear all the full sync status options. + * + * @access public + */ + public function clear_status() { + $prefix = self::STATUS_OPTION_PREFIX; + \Jetpack_Options::delete_raw_option( "{$prefix}_started" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_params" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_queue_finished" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_send_started" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_finished" ); + + $this->delete_enqueue_status(); + + foreach ( Modules::get_modules() as $module ) { + \Jetpack_Options::delete_raw_option( "{$prefix}_{$module->name()}_sent" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_{$module->name()}_sent_total" ); + } + } + + /** + * Clear all the full sync data. + * + * @access public + */ + public function reset_data() { + $this->clear_status(); + $this->delete_config(); + ( new Lock() )->remove( self::ENQUEUE_LOCK_NAME, true ); + + $listener = Listener::get_instance(); + $listener->get_full_sync_queue()->reset(); + } + + /** + * Get the value of a full sync status option. + * + * @access private + * + * @param string $name Name of the option. + * @param mixed $default Default value of the option. + * @return mixed Option value. + */ + private function get_status_option( $name, $default = null ) { + $value = \Jetpack_Options::get_raw_option( self::STATUS_OPTION_PREFIX . "_$name", $default ); + + return is_numeric( $value ) ? (int) $value : $value; + } + + /** + * Update the value of a full sync status option. + * + * @access private + * + * @param string $name Name of the option. + * @param mixed $value Value of the option. + * @param boolean $autoload Whether the option should be autoloaded at the beginning of the request. + */ + private function update_status_option( $name, $value, $autoload = false ) { + \Jetpack_Options::update_raw_option( self::STATUS_OPTION_PREFIX . "_$name", $value, $autoload ); + } + + /** + * Set the full sync enqueue status. + * + * @access private + * + * @param array $new_status The new full sync enqueue status. + */ + private function set_enqueue_status( $new_status ) { + \Jetpack_Options::update_raw_option( 'jetpack_sync_full_enqueue_status', $new_status ); + } + + /** + * Delete full sync enqueue status. + * + * @access private + * + * @return boolean Whether the status was deleted. + */ + private function delete_enqueue_status() { + return \Jetpack_Options::delete_raw_option( 'jetpack_sync_full_enqueue_status' ); + } + + /** + * Retrieve the current full sync enqueue status. + * + * @access private + * + * @return array Full sync enqueue status. + */ + public function get_enqueue_status() { + return \Jetpack_Options::get_raw_option( 'jetpack_sync_full_enqueue_status' ); + } + + /** + * Set the full sync enqueue configuration. + * + * @access private + * + * @param array $config The new full sync enqueue configuration. + */ + private function set_config( $config ) { + \Jetpack_Options::update_raw_option( 'jetpack_sync_full_config', $config ); + } + + /** + * Delete full sync configuration. + * + * @access private + * + * @return boolean Whether the configuration was deleted. + */ + private function delete_config() { + return \Jetpack_Options::delete_raw_option( 'jetpack_sync_full_config' ); + } + + /** + * Retrieve the current full sync enqueue config. + * + * @access private + * + * @return array Full sync enqueue config. + */ + private function get_config() { + return \Jetpack_Options::get_raw_option( 'jetpack_sync_full_config' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php new file mode 100644 index 00000000..f5f8543a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php @@ -0,0 +1,220 @@ + 'jetpack_sync_import_start', + 'import_done' => 'jetpack_sync_import_end', + 'import_end' => 'jetpack_sync_import_end', + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'import'; + } + + /** + * Initialize imports action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'export_wp', $callable ); + add_action( 'jetpack_sync_import_start', $callable, 10, 2 ); + add_action( 'jetpack_sync_import_end', $callable, 10, 2 ); + + // WordPress. + add_action( 'import_start', array( $this, 'sync_import_action' ) ); + + // Movable type, RSS, Livejournal. + add_action( 'import_done', array( $this, 'sync_import_action' ) ); + + // WordPress, Blogger, Livejournal, woo tax rate. + add_action( 'import_end', array( $this, 'sync_import_action' ) ); + } + + /** + * Set module defaults. + * Define an empty list of synced actions for us to fill later. + * + * @access public + */ + public function set_defaults() { + $this->synced_actions = array(); + } + + /** + * Generic handler for import actions. + * + * @access public + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + */ + public function sync_import_action( $importer ) { + $import_action = current_filter(); + // Map action to event name. + $sync_action = self::$import_sync_action_map[ $import_action ]; + + // Only sync each action once per import. + if ( array_key_exists( $sync_action, $this->synced_actions ) && $this->synced_actions[ $sync_action ] ) { + return; + } + + // Mark this action as synced. + $this->synced_actions[ $sync_action ] = true; + + // Prefer self-reported $importer value. + if ( ! $importer ) { + // Fall back to inferring by calling class name. + $importer = self::get_calling_importer_class(); + } + + // Get $importer from known_importers. + $known_importers = Settings::get_setting( 'known_importers' ); + if ( is_string( $importer ) && isset( $known_importers[ $importer ] ) ) { + $importer = $known_importers[ $importer ]; + } + + $importer_name = $this->get_importer_name( $importer ); + + switch ( $sync_action ) { + case 'jetpack_sync_import_start': + /** + * Used for syncing the start of an import + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @module sync + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + * @param string $importer_name The name reported by the importer, or 'Unknown Importer'. + */ + do_action( 'jetpack_sync_import_start', $importer, $importer_name ); + break; + + case 'jetpack_sync_import_end': + /** + * Used for syncing the end of an import + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @module sync + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + * @param string $importer_name The name reported by the importer, or 'Unknown Importer'. + */ + do_action( 'jetpack_sync_import_end', $importer, $importer_name ); + break; + } + } + + /** + * Retrieve the name of the importer. + * + * @access private + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + * @return string Name of the importer, or "Unknown Importer" if importer is unknown. + */ + private function get_importer_name( $importer ) { + $importers = get_importers(); + return isset( $importers[ $importer ] ) ? $importers[ $importer ][0] : 'Unknown Importer'; + } + + /** + * Determine the class that extends `WP_Importer` which is responsible for + * the current action. Designed to be used within an action handler. + * + * @access private + * @static + * + * @return string The name of the calling class, or 'unknown'. + */ + private static function get_calling_importer_class() { + // If WP_Importer doesn't exist, neither will any importer that extends it. + if ( ! class_exists( 'WP_Importer', false ) ) { + return 'unknown'; + } + + $action = current_filter(); + $backtrace = debug_backtrace( false ); //phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + + $do_action_pos = -1; + $backtrace_len = count( $backtrace ); + for ( $i = 0; $i < $backtrace_len; $i++ ) { + // Find the location in the stack of the calling action. + if ( 'do_action' === $backtrace[ $i ]['function'] && $action === $backtrace[ $i ]['args'][0] ) { + $do_action_pos = $i; + break; + } + } + + // If the action wasn't called, the calling class is unknown. + if ( -1 === $do_action_pos ) { + return 'unknown'; + } + + // Continue iterating the stack looking for a caller that extends WP_Importer. + for ( $i = $do_action_pos + 1; $i < $backtrace_len; $i++ ) { + // If there is no class on the trace, continue. + if ( ! isset( $backtrace[ $i ]['class'] ) ) { + continue; + } + + $class_name = $backtrace[ $i ]['class']; + + // Check if the class extends WP_Importer. + if ( class_exists( $class_name, false ) ) { + $parents = class_parents( $class_name, false ); + if ( $parents && in_array( 'WP_Importer', $parents, true ) ) { + return $class_name; + } + } + } + + // If we've exhausted the stack without a match, the calling class is unknown. + return 'unknown'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php new file mode 100644 index 00000000..bf6c5620 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php @@ -0,0 +1,146 @@ +nav_items_just_added[] = $nav_item_id; + /** + * Helps sync log that a new menu item was added. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param int $menu_id ID of the menu. + * @param array $menu_data An array of menu data. + * @param int $nav_item_id ID of the new menu item. + * @param array $nav_item_args Arguments used to add the menu item. + */ + do_action( 'jetpack_sync_updated_nav_menu_add_item', $menu_id, $menu_data, $nav_item_id, $nav_item_args ); + } + + /** + * Nav menu item update handler. + * + * @access public + * + * @param int $menu_id ID of the menu. + * @param int $nav_item_id ID of the new menu item. + * @param array $nav_item_args Arguments used to update the menu item. + */ + public function update_nav_menu_update_item( $menu_id, $nav_item_id, $nav_item_args ) { + if ( in_array( $nav_item_id, $this->nav_items_just_added, true ) ) { + return; + } + $menu_data = wp_get_nav_menu_object( $menu_id ); + /** + * Helps sync log that an update to the menu item happened. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param int $menu_id ID of the menu. + * @param array $menu_data An array of menu data. + * @param int $nav_item_id ID of the new menu item. + * @param array $nav_item_args Arguments used to update the menu item. + */ + do_action( 'jetpack_sync_updated_nav_menu_update_item', $menu_id, $menu_data, $nav_item_id, $nav_item_args ); + } + + /** + * Remove menu items that have already been saved from the "just added" list. + * + * @access public + * + * @param int $nav_item_id ID of the new menu item. + * @param \WP_Post $post_after Nav menu item post object after the update. + */ + public function remove_just_added_menu_item( $nav_item_id, $post_after ) { + if ( 'nav_menu_item' !== $post_after->post_type ) { + return; + } + $this->nav_items_just_added = array_diff( $this->nav_items_just_added, array( $nav_item_id ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php new file mode 100644 index 00000000..de293a9b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php @@ -0,0 +1,112 @@ +prepare call to use placeholders. + * + * @param string $object_type The type of object for which we retrieve meta. Either 'post' or 'comment'. + * @param array $config Must include 'meta_key' and 'ids' keys. + * + * @return array + */ + public function get_objects_by_id( $object_type, $config ) { + $table = _get_meta_table( $object_type ); + + if ( ! $table ) { + return array(); + } + + if ( ! is_array( $config ) ) { + return array(); + } + + $meta_objects = array(); + foreach ( $config as $item ) { + $meta = null; + if ( isset( $item['id'] ) && isset( $item['meta_key'] ) ) { + $meta = $this->get_object_by_id( $object_type, (int) $item['id'], (string) $item['meta_key'] ); + } + $meta_objects[ $item['id'] . '-' . $item['meta_key'] ] = $meta; + } + + return $meta_objects; + } + + /** + * Get a single Meta Result. + * + * @param string $object_type post, comment, term, user. + * @param null $id Object ID. + * @param null $meta_key Meta Key. + * + * @return mixed|null + */ + public function get_object_by_id( $object_type, $id = null, $meta_key = null ) { + global $wpdb; + + if ( ! is_int( $id ) || ! is_string( $meta_key ) ) { + return null; + } + + $table = _get_meta_table( $object_type ); + $object_id_column = $object_type . '_id'; + + // Sanitize so that the array only has integer values. + $meta = $wpdb->get_results( + $wpdb->prepare( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT * FROM {$table} WHERE {$object_id_column} = %d AND meta_key = %s", + $id, + $meta_key + ), + ARRAY_A + ); + + $meta_objects = null; + + if ( ! is_wp_error( $meta ) && ! empty( $meta ) ) { + foreach ( $meta as $meta_entry ) { + if ( 'post' === $object_type && strlen( $meta_entry['meta_value'] ) >= Posts::MAX_POST_META_LENGTH ) { + $meta_entry['meta_value'] = ''; + } + $meta_objects[] = array( + 'meta_type' => $object_type, + 'meta_id' => $meta_entry['meta_id'], + 'meta_key' => $meta_key, + 'meta_value' => $meta_entry['meta_value'], + 'object_id' => $meta_entry[ $object_id_column ], + ); + } + } + + return $meta_objects; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php new file mode 100644 index 00000000..008443ab --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php @@ -0,0 +1,649 @@ +recursive_ksort( $values ); + } + return crc32( wp_json_encode( Functions::json_wrap( $values ) ) ); + } + + /** + * Recursively call ksort on an Array + * + * @param array $values Array. + */ + private function recursive_ksort( &$values ) { + ksort( $values ); + foreach ( $values as &$value ) { + if ( is_array( $value ) ) { + $this->recursive_ksort( $value ); + } + } + } + + /** + * Whether a particular checksum in a set of checksums is valid. + * + * @access protected + * + * @param array $sums_to_check Array of checksums. + * @param string $name Name of the checksum. + * @param int $new_sum Checksum to compare against. + * @return boolean Whether the checksum is valid. + */ + protected function still_valid_checksum( $sums_to_check, $name, $new_sum ) { + if ( isset( $sums_to_check[ $name ] ) && $sums_to_check[ $name ] === $new_sum ) { + return true; + } + + return false; + } + + /** + * Enqueue all items of a sync type as an action. + * + * @access protected + * + * @param string $action_name Name of the action. + * @param string $table_name Name of the database table. + * @param string $id_field Name of the ID field in the database. + * @param string $where_sql The SQL WHERE clause to filter to the desired items. + * @param int $max_items_to_enqueue Maximum number of items to enqueue in the same time. + * @param boolean $state Whether enqueueing has finished. + * @return array Array, containing the number of chunks and TRUE, indicating enqueueing has finished. + */ + protected function enqueue_all_ids_as_action( $action_name, $table_name, $id_field, $where_sql, $max_items_to_enqueue, $state ) { + global $wpdb; + + if ( ! $where_sql ) { + $where_sql = '1 = 1'; + } + + $items_per_page = 1000; + $page = 1; + $chunk_count = 0; + $previous_interval_end = $state ? $state : '~0'; + $listener = Listener::get_instance(); + + // Count down from max_id to min_id so we get newest posts/comments/etc first. + // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition, WordPress.DB.PreparedSQL.InterpolatedNotPrepared + while ( $ids = $wpdb->get_col( "SELECT {$id_field} FROM {$table_name} WHERE {$where_sql} AND {$id_field} < {$previous_interval_end} ORDER BY {$id_field} DESC LIMIT {$items_per_page}" ) ) { + // Request posts in groups of N for efficiency. + $chunked_ids = array_chunk( $ids, self::ARRAY_CHUNK_SIZE ); + + // If we hit our row limit, process and return. + if ( $chunk_count + count( $chunked_ids ) >= $max_items_to_enqueue ) { + $remaining_items_count = $max_items_to_enqueue - $chunk_count; + $remaining_items = array_slice( $chunked_ids, 0, $remaining_items_count ); + $remaining_items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $remaining_items, $previous_interval_end ); + $listener->bulk_enqueue_full_sync_actions( $action_name, $remaining_items_with_previous_interval_end ); + + $last_chunk = end( $remaining_items ); + return array( $remaining_items_count + $chunk_count, end( $last_chunk ) ); + } + $chunked_ids_with_previous_end = $this->get_chunks_with_preceding_end( $chunked_ids, $previous_interval_end ); + + $listener->bulk_enqueue_full_sync_actions( $action_name, $chunked_ids_with_previous_end ); + + $chunk_count += count( $chunked_ids ); + ++$page; + // The $ids are ordered in descending order. + $previous_interval_end = end( $ids ); + } + + if ( $wpdb->last_error ) { + // return the values that were passed in so all these chunks get retried. + return array( $max_items_to_enqueue, $state ); + } + + return array( $chunk_count, true ); + } + + /** + * Given the Module Full Sync Configuration and Status return the next chunk of items to send. + * + * @param array $config This module Full Sync configuration. + * @param array $status This module Full Sync status. + * @param int $chunk_size Chunk size. + * + * @return array|object|null + */ + public function get_next_chunk( $config, $status, $chunk_size ) { + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery + global $wpdb; + return $wpdb->get_col( + " + SELECT {$this->id_field()} + FROM {$wpdb->{$this->table_name()}} + WHERE {$this->get_where_sql( $config )} + AND {$this->id_field()} < {$status['last_sent']} + ORDER BY {$this->id_field()} + DESC LIMIT {$chunk_size} + " + ); + // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery + } + + /** + * Return last_item to send for Module Full Sync Configuration. + * + * @param array $config This module Full Sync configuration. + * + * @return array|object|null + */ + public function get_last_item( $config ) { + global $wpdb; + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + return $wpdb->get_var( + " + SELECT {$this->id_field()} + FROM {$wpdb->{$this->table_name()}} + WHERE {$this->get_where_sql( $config )} + ORDER BY {$this->id_field()} + LIMIT 1 + " + ); + // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + } + + /** + * Return the initial last sent object. + * + * @return string|array initial status. + */ + public function get_initial_last_sent() { + return '~0'; + } + + /** + * Immediately send all items of a sync type as an action. + * + * @access protected + * + * @param string $config Full sync configuration for this module. + * @param array $status the current module full sync status. + * @param float $send_until timestamp until we want this request to send full sync events. + * + * @return array Status, the module full sync status updated. + */ + public function send_full_sync_actions( $config, $status, $send_until ) { + global $wpdb; + + if ( empty( $status['last_sent'] ) ) { + $status['last_sent'] = $this->get_initial_last_sent(); + } + + $limits = Settings::get_setting( 'full_sync_limits' )[ $this->name() ]; + + $chunks_sent = 0; + + $last_item = $this->get_last_item( $config ); + + while ( $chunks_sent < $limits['max_chunks'] && microtime( true ) < $send_until ) { + $objects = $this->get_next_chunk( $config, $status, $limits['chunk_size'] ); + + if ( $wpdb->last_error ) { + $status['error'] = true; + return $status; + } + + if ( empty( $objects ) ) { + $status['finished'] = true; + return $status; + } + $result = $this->send_action( 'jetpack_full_sync_' . $this->name(), array( $objects, $status['last_sent'] ) ); + if ( is_wp_error( $result ) || $wpdb->last_error ) { + $status['error'] = true; + return $status; + } + // Updated the sent and last_sent status. + $status = $this->set_send_full_sync_actions_status( $status, $objects ); + if ( $last_item === $status['last_sent'] ) { + $status['finished'] = true; + return $status; + } + ++$chunks_sent; + } + + return $status; + } + + /** + * Set the status of the full sync action based on the objects that were sent. + * + * @access protected + * + * @param array $status This module Full Sync status. + * @param array $objects This module Full Sync objects. + * + * @return array The updated status. + */ + protected function set_send_full_sync_actions_status( $status, $objects ) { + $status['last_sent'] = end( $objects ); + $status['sent'] += count( $objects ); + return $status; + } + + /** + * Immediately sends a single item without firing or enqueuing it + * + * @param string $action_name The action. + * @param array $data The data associated with the action. + */ + public function send_action( $action_name, $data = null ) { + $sender = Sender::get_instance(); + return $sender->send_action( $action_name, $data ); + } + + /** + * Retrieve chunk IDs with previous interval end. + * + * @access protected + * + * @param array $chunks All remaining items. + * @param int $previous_interval_end The last item from the previous interval. + * @return array Chunk IDs with the previous interval end. + */ + protected function get_chunks_with_preceding_end( $chunks, $previous_interval_end ) { + $chunks_with_ends = array(); + foreach ( $chunks as $chunk ) { + $chunks_with_ends[] = array( + 'ids' => $chunk, + 'previous_end' => $previous_interval_end, + ); + // Chunks are ordered in descending order. + $previous_interval_end = end( $chunk ); + } + return $chunks_with_ends; + } + + /** + * Get metadata of a particular object type within the designated meta key whitelist. + * + * @access protected + * + * @todo Refactor to use $wpdb->prepare() on the SQL query. + * + * @param array $ids Object IDs. + * @param string $meta_type Meta type. + * @param array $meta_key_whitelist Meta key whitelist. + * @return array Unserialized meta values. + */ + protected function get_metadata( $ids, $meta_type, $meta_key_whitelist ) { + global $wpdb; + $table = _get_meta_table( $meta_type ); + $id = $meta_type . '_id'; + if ( ! $table ) { + return array(); + } + + $private_meta_whitelist_sql = "'" . implode( "','", array_map( 'esc_sql', $meta_key_whitelist ) ) . "'"; + + return array_map( + array( $this, 'unserialize_meta' ), + $wpdb->get_results( + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared + "SELECT $id, meta_key, meta_value, meta_id FROM $table WHERE $id IN ( " . implode( ',', wp_parse_id_list( $ids ) ) . ' )' . + " AND meta_key IN ( $private_meta_whitelist_sql ) ", + // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared + OBJECT + ) + ); + } + + /** + * Initialize listeners for the particular meta type. + * + * @access public + * + * @param string $meta_type Meta type. + * @param callable $callable Action handler callable. + */ + public function init_listeners_for_meta_type( $meta_type, $callable ) { + add_action( "added_{$meta_type}_meta", $callable, 10, 4 ); + add_action( "updated_{$meta_type}_meta", $callable, 10, 4 ); + add_action( "deleted_{$meta_type}_meta", $callable, 10, 4 ); + } + + /** + * Initialize meta whitelist handler for the particular meta type. + * + * @access public + * + * @param string $meta_type Meta type. + * @param callable $whitelist_handler Action handler callable. + */ + public function init_meta_whitelist_handler( $meta_type, $whitelist_handler ) { + add_filter( "jetpack_sync_before_enqueue_added_{$meta_type}_meta", $whitelist_handler ); + add_filter( "jetpack_sync_before_enqueue_updated_{$meta_type}_meta", $whitelist_handler ); + add_filter( "jetpack_sync_before_enqueue_deleted_{$meta_type}_meta", $whitelist_handler ); + } + + /** + * Retrieve the term relationships for the specified object IDs. + * + * @access protected + * + * @todo This feels too specific to be in the abstract sync Module class. Move it? + * + * @param array $ids Object IDs. + * @return array Term relationships - object ID and term taxonomy ID pairs. + */ + protected function get_term_relationships( $ids ) { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + return $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id IN ( " . implode( ',', wp_parse_id_list( $ids ) ) . ' )', OBJECT ); + } + + /** + * Unserialize the value of a meta object, if necessary. + * + * @access public + * + * @param object $meta Meta object. + * @return object Meta object with possibly unserialized value. + */ + public function unserialize_meta( $meta ) { + $meta->meta_value = maybe_unserialize( $meta->meta_value ); + return $meta; + } + + /** + * Retrieve a set of objects by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + // Only add object if we have the object. + if ( $object ) { + $objects[ $id ] = $object; + } + } + + return $objects; + } + + /** + * Gets a list of minimum and maximum object ids for each batch based on the given batch size. + * + * @access public + * + * @param int $batch_size The batch size for objects. + * @param string|bool $where_sql The sql where clause minus 'WHERE', or false if no where clause is needed. + * + * @return array|bool An array of min and max ids for each batch. FALSE if no table can be found. + */ + public function get_min_max_object_ids_for_batches( $batch_size, $where_sql = false ) { + global $wpdb; + + if ( ! $this->table_name() ) { + return false; + } + + $results = array(); + $table = $wpdb->{$this->table_name()}; + $current_max = 0; + $current_min = 1; + $id_field = $this->id_field(); + $replicastore = new Replicastore(); + + $total = $replicastore->get_min_max_object_id( + $id_field, + $table, + $where_sql, + false + ); + + while ( $total->max > $current_max ) { + $where = $where_sql ? + $where_sql . " AND $id_field > $current_max" : + "$id_field > $current_max"; + $result = $replicastore->get_min_max_object_id( + $id_field, + $table, + $where, + $batch_size + ); + if ( empty( $result->min ) && empty( $result->max ) ) { + // Our query produced no min and max. We can assume the min from the previous query, + // and the total max we found in the initial query. + $current_max = (int) $total->max; + $result = (object) array( + 'min' => $current_min, + 'max' => $current_max, + ); + } else { + $current_min = (int) $result->min; + $current_max = (int) $result->max; + } + $results[] = $result; + } + + return $results; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { + global $wpdb; + $table = $wpdb->{$this->table_name()}; + $where = $this->get_where_sql( $config ); + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + return (int) $wpdb->get_var( "SELECT COUNT(*) FROM $table WHERE $where" ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return '1=1'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php new file mode 100644 index 00000000..4fbfa3be --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php @@ -0,0 +1,251 @@ +network_options_whitelist = Defaults::$default_network_options_whitelist; + } + + /** + * Enqueue the network options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all options to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand options (should always be true) + */ + do_action( 'jetpack_full_sync_network_options', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the network options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_network_options', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_network_options' ); + } + + /** + * Retrieve all network options as per the current network options whitelist. + * + * @access public + * + * @return array All network options. + */ + public function get_all_network_options() { + $options = array(); + foreach ( $this->network_options_whitelist as $option ) { + $options[ $option ] = get_site_option( $option ); + } + + return $options; + } + + /** + * Set the network options whitelist. + * + * @access public + * + * @param array $options The new network options whitelist. + */ + public function set_network_options_whitelist( $options ) { + $this->network_options_whitelist = $options; + } + + /** + * Get the network options whitelist. + * + * @access public + * + * @return array The network options whitelist. + */ + public function get_network_options_whitelist() { + return $this->network_options_whitelist; + } + + /** + * Reject non-whitelisted network options. + * + * @access public + * + * @param array $args The hook parameters. + * @return array|false $args The hook parameters, false if not a whitelisted network option. + */ + public function whitelist_network_options( $args ) { + if ( ! $this->is_whitelisted_network_option( $args[0] ) ) { + return false; + } + + return $args; + } + + /** + * Whether the option is a whitelisted network option. + * + * @access public + * + * @param string $option Option name. + * @return boolean True if this is a whitelisted network option. + */ + public function is_whitelisted_network_option( $option ) { + return in_array( $option, $this->network_options_whitelist, true ); + } + + /** + * Expand the network options within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_network_options( $args ) { + if ( $args[0] ) { + return $this->get_all_network_options(); + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( (array) $this->network_options_whitelist ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php new file mode 100644 index 00000000..d21dee9b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php @@ -0,0 +1,480 @@ +update_options_whitelist(); + $this->update_options_contentless(); + } + + /** + * Set module defaults at a later time. + * + * @access public + */ + public function set_late_default() { + /** This filter is already documented in json-endpoints/jetpack/class.wpcom-json-api-get-option-endpoint.php */ + $late_options = apply_filters( 'jetpack_options_whitelist', array() ); + if ( ! empty( $late_options ) && is_array( $late_options ) ) { + $this->options_whitelist = array_merge( $this->options_whitelist, $late_options ); + } + } + + /** + * Add old deprecated options to the list of options to keep in sync. + * + * @since 1.14.0 + * + * @access public + * + * @param array $options The default list of site options. + */ + public function add_deprecated_options( $options ) { + global $wp_version; + + $deprecated_options = array( + 'blacklist_keys' => '5.5-alpha', // Replaced by disallowed_keys. + 'comment_whitelist' => '5.5-alpha', // Replaced by comment_previously_approved. + ); + + foreach ( $deprecated_options as $option => $version ) { + if ( version_compare( $wp_version, $version, '<=' ) ) { + $options[] = $option; + } + } + + return $options; + } + + /** + * Enqueue the options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all options to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand options (should always be true) + */ + do_action( 'jetpack_full_sync_options', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_options', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_options' ); + } + + /** + * Retrieve all options as per the current options whitelist. + * Public so that we don't have to store so much data all the options twice. + * + * @access public + * + * @return array All options. + */ + public function get_all_options() { + $options = array(); + $random_string = wp_generate_password(); + foreach ( $this->options_whitelist as $option ) { + if ( str_starts_with( $option, Settings::SETTINGS_OPTION_PREFIX ) ) { + $option_value = Settings::get_setting( str_replace( Settings::SETTINGS_OPTION_PREFIX, '', $option ) ); + $options[ $option ] = $option_value; + } else { + $option_value = get_option( $option, $random_string ); + if ( $option_value !== $random_string ) { + $options[ $option ] = $option_value; + } + } + } + + // Add theme mods. + $theme_mods_option = 'theme_mods_' . get_option( 'stylesheet' ); + $theme_mods_value = get_option( $theme_mods_option, $random_string ); + if ( $theme_mods_value === $random_string ) { + return $options; + } + $this->filter_theme_mods( $theme_mods_value ); + $options[ $theme_mods_option ] = $theme_mods_value; + return $options; + } + + /** + * Update the options whitelist to the default one. + * + * @access public + */ + public function update_options_whitelist() { + $this->options_whitelist = Defaults::get_options_whitelist(); + } + + /** + * Set the options whitelist. + * + * @access public + * + * @param array $options The new options whitelist. + */ + public function set_options_whitelist( $options ) { + $this->options_whitelist = $options; + } + + /** + * Get the options whitelist. + * + * @access public + * + * @return array The options whitelist. + */ + public function get_options_whitelist() { + return $this->options_whitelist; + } + + /** + * Update the contentless options to the defaults. + * + * @access public + */ + public function update_options_contentless() { + $this->options_contentless = Defaults::get_options_contentless(); + } + + /** + * Get the contentless options. + * + * @access public + * + * @return array Array of the contentless options. + */ + public function get_options_contentless() { + return $this->options_contentless; + } + + /** + * Reject any options that aren't whitelisted or contentless. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function whitelist_options( $args ) { + // Reject non-whitelisted options. + if ( ! $this->is_whitelisted_option( $args[0] ) ) { + return false; + } + + // Filter our weird array( false ) value for theme_mods_*. + if ( str_starts_with( $args[0], 'theme_mods_' ) ) { + $this->filter_theme_mods( $args[1] ); + if ( isset( $args[2] ) ) { + $this->filter_theme_mods( $args[2] ); + } + } + + // Set value(s) of contentless option to empty string(s). + if ( $this->is_contentless_option( $args[0] ) ) { + // Create a new array matching length of $args, containing empty strings. + $empty = array_fill( 0, count( $args ), '' ); + $empty[0] = $args[0]; + return $empty; + } + + return $args; + } + + /** + * Whether a certain option is whitelisted for sync. + * + * @access public + * + * @param string $option Option name. + * @return boolean Whether the option is whitelisted. + */ + public function is_whitelisted_option( $option ) { + return in_array( $option, $this->options_whitelist, true ) || str_starts_with( $option, 'theme_mods_' ); + } + + /** + * Whether a certain option is a contentless one. + * + * @access private + * + * @param string $option Option name. + * @return boolean Whether the option is contentless. + */ + private function is_contentless_option( $option ) { + return in_array( $option, $this->options_contentless, true ); + } + + /** + * Filters out falsy values from theme mod options. + * + * @access private + * + * @param array $value Option value. + */ + private function filter_theme_mods( &$value ) { + if ( is_array( $value ) && isset( $value[0] ) ) { + unset( $value[0] ); + } + } + + /** + * Handle changes in the core site icon and sync them. + * + * @access public + */ + public function jetpack_sync_core_icon() { + $url = get_site_icon_url(); + + $jetpack_url = \Jetpack_Options::get_option( 'site_icon_url' ); + if ( defined( 'JETPACK__PLUGIN_DIR' ) ) { + if ( ! function_exists( 'jetpack_site_icon_url' ) ) { + require_once JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php'; + } + $jetpack_url = jetpack_site_icon_url(); + } + + // If there's a core icon, maybe update the option. If not, fall back to Jetpack's. + if ( ! empty( $url ) && $jetpack_url !== $url ) { + // This is the option that is synced with dotcom. + \Jetpack_Options::update_option( 'site_icon_url', $url ); + } elseif ( empty( $url ) ) { + \Jetpack_Options::delete_option( 'site_icon_url' ); + } + } + + /** + * Expand all options within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_options( $args ) { + if ( $args[0] ) { + return $this->get_all_options(); + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( Defaults::get_options_whitelist() ); + } + + /** + * Retrieve a set of options by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'option' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + // Only add object if we have the object. + if ( 'OPTION-DOES-NOT-EXIST' !== $object ) { + if ( 'all' === $id ) { + // If all was requested it contains all options and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + } + + return $objects; + } + + /** + * Retrieve an option by its name. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Option or 'OPTION-DOES-NOT-EXIST' if not found. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'option' === $object_type ) { + // Utilize Random string as default value to distinguish between false and not exist. + $random_string = wp_generate_password(); + // Only whitelisted options can be returned. + if ( in_array( $id, $this->options_whitelist, true ) ) { + if ( str_starts_with( $id, Settings::SETTINGS_OPTION_PREFIX ) ) { + $option_value = Settings::get_setting( str_replace( Settings::SETTINGS_OPTION_PREFIX, '', $id ) ); + return $option_value; + } else { + $option_value = get_option( $id, $random_string ); + if ( $option_value !== $random_string ) { + return $option_value; + } + } + } elseif ( 'all' === $id ) { + return $this->get_all_options(); + } + } + + return 'OPTION-DOES-NOT-EXIST'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php new file mode 100644 index 00000000..5a9e907a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php @@ -0,0 +1,382 @@ +action_handler = $callable; + + add_action( 'deleted_plugin', array( $this, 'deleted_plugin' ), 10, 2 ); + add_action( 'activated_plugin', $callable, 10, 2 ); + add_action( 'deactivated_plugin', $callable, 10, 2 ); + add_action( 'delete_plugin', array( $this, 'delete_plugin' ) ); + add_filter( 'upgrader_pre_install', array( $this, 'populate_plugins' ), 10, 1 ); + add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_completion' ), 10, 2 ); + add_action( 'jetpack_plugin_installed', $callable, 10, 1 ); + add_action( 'jetpack_plugin_update_failed', $callable, 10, 4 ); + add_action( 'jetpack_plugins_updated', $callable, 10, 2 ); + add_action( 'jetpack_edited_plugin', $callable, 10, 2 ); + add_action( 'wp_ajax_edit-theme-plugin-file', array( $this, 'plugin_edit_ajax' ), 0 ); + + // Note that we don't simply 'expand_plugin_data' on the 'delete_plugin' action here because the plugin file is deleted when that action finishes. + add_filter( 'jetpack_sync_before_enqueue_activated_plugin', array( $this, 'expand_plugin_data' ) ); + add_filter( 'jetpack_sync_before_enqueue_deactivated_plugin', array( $this, 'expand_plugin_data' ) ); + } + + /** + * Fetch and populate all current plugins before upgrader installation. + * + * @access public + * + * @param bool|WP_Error $response Install response, true if successful, WP_Error if not. + */ + public function populate_plugins( $response ) { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $this->plugins = get_plugins(); + return $response; + } + + /** + * Handler for the upgrader success finishes. + * + * @access public + * + * @param \WP_Upgrader $upgrader Upgrader instance. + * @param array $details Array of bulk item update data. + */ + public function on_upgrader_completion( $upgrader, $details ) { + if ( ! isset( $details['type'] ) ) { + return; + } + if ( 'plugin' !== $details['type'] ) { + return; + } + + if ( ! isset( $details['action'] ) ) { + return; + } + + $plugins = ( isset( $details['plugins'] ) ? $details['plugins'] : null ); + if ( empty( $plugins ) ) { + $plugins = ( isset( $details['plugin'] ) ? array( $details['plugin'] ) : null ); + } + + // For plugin installer. + if ( empty( $plugins ) && method_exists( $upgrader, 'plugin_info' ) ) { + // @phan-suppress-next-line PhanUndeclaredMethod -- Checked above. See also https://github.com/phan/phan/issues/1204. + $plugins = array( $upgrader->plugin_info() ); + } + + if ( empty( $plugins ) ) { + return; // We shouldn't be here. + } + + switch ( $details['action'] ) { + case 'update': + $state = array( + 'is_autoupdate' => Jetpack_Constants::is_true( 'JETPACK_PLUGIN_AUTOUPDATE' ), + ); + $errors = $this->get_errors( $upgrader->skin ); + if ( $errors ) { + foreach ( $plugins as $slug ) { + /** + * Sync that a plugin update failed + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param string $plugin , Plugin slug + * @param string Error code + * @param string Error message + */ + do_action( 'jetpack_plugin_update_failed', $this->get_plugin_info( $slug ), $errors['code'], $errors['message'], $state ); + } + + return; + } + /** + * Sync that a plugin update + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param array () $plugin, Plugin Data + */ + do_action( 'jetpack_plugins_updated', array_map( array( $this, 'get_plugin_info' ), $plugins ), $state ); + break; + case 'install': + } + + if ( 'install' === $details['action'] ) { + /** + * Signals to the sync listener that a plugin was installed and a sync action + * reflecting the installation and the plugin info should be sent + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param array () $plugin, Plugin Data + */ + do_action( 'jetpack_plugin_installed', array_map( array( $this, 'get_plugin_info' ), $plugins ) ); + + return; + } + } + + /** + * Retrieve the plugin information by a plugin slug. + * + * @access private + * + * @param string $slug Plugin slug. + * @return array Plugin information. + */ + private function get_plugin_info( $slug ) { + $plugins = get_plugins(); // Get the most up to date info. + if ( isset( $plugins[ $slug ] ) ) { + return array_merge( array( 'slug' => $slug ), $plugins[ $slug ] ); + } + // Try grabbing the info from before the update. + return isset( $this->plugins[ $slug ] ) ? array_merge( array( 'slug' => $slug ), $this->plugins[ $slug ] ) : array( 'slug' => $slug ); + } + + /** + * Retrieve upgrade errors. + * + * @access private + * + * @param \Automatic_Upgrader_Skin|\WP_Upgrader_Skin $skin The upgrader skin being used. + * @return array|boolean Error on error, false otherwise. + */ + private function get_errors( $skin ) { + // @phan-suppress-next-line PhanUndeclaredMethod -- Checked before being called. See also https://github.com/phan/phan/issues/1204. + $errors = method_exists( $skin, 'get_errors' ) ? $skin->get_errors() : null; + if ( is_wp_error( $errors ) ) { + $error_code = $errors->get_error_code(); + if ( ! empty( $error_code ) ) { + return array( + 'code' => $error_code, + 'message' => $errors->get_error_message(), + ); + } + } + + if ( isset( $skin->result ) ) { + $errors = $skin->result; + if ( is_wp_error( $errors ) ) { + return array( + 'code' => $errors->get_error_code(), + 'message' => $errors->get_error_message(), + ); + } + + if ( empty( $skin->result ) ) { + return array( + 'code' => 'unknown', + 'message' => __( 'Unknown Plugin Update Failure', 'jetpack-sync' ), + ); + } + } + return false; + } + + /** + * Handle plugin ajax edit in the administration. + * + * @access public + * + * @todo Update this method to use WP_Filesystem instead of fopen/fclose. + */ + public function plugin_edit_ajax() { + // This validation is based on wp_edit_theme_plugin_file(). + if ( empty( $_POST['file'] ) ) { + return; + } + + $file = wp_unslash( $_POST['file'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated manually just after. + if ( 0 !== validate_file( $file ) ) { + return; + } + + if ( ! isset( $_POST['newcontent'] ) ) { + return; + } + + if ( ! isset( $_POST['nonce'] ) ) { + return; + } + + if ( empty( $_POST['plugin'] ) ) { + return; + } + + $plugin = wp_unslash( $_POST['plugin'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated manually just after. + if ( ! current_user_can( 'edit_plugins' ) ) { + return; + } + + if ( ! wp_verify_nonce( $_POST['nonce'], 'edit-plugin_' . $file ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WP core doesn't pre-sanitize nonces either. + return; + } + $plugins = get_plugins(); + if ( ! array_key_exists( $plugin, $plugins ) ) { + return; + } + + if ( 0 !== validate_file( $file, get_plugin_files( $plugin ) ) ) { + return; + } + + $real_file = WP_PLUGIN_DIR . '/' . $file; + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_is_writable + if ( ! is_writable( $real_file ) ) { + return; + } + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen + $file_pointer = fopen( $real_file, 'w+' ); + if ( false === $file_pointer ) { + return; + } + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose + fclose( $file_pointer ); + /** + * This action is documented already in this file + */ + do_action( 'jetpack_edited_plugin', $plugin, $plugins[ $plugin ] ); + } + + /** + * Handle plugin deletion. + * + * @access public + * + * @param string $plugin_path Path to the plugin main file. + */ + public function delete_plugin( $plugin_path ) { + $full_plugin_path = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_path; + + // Checking for file existence because some sync plugin module tests simulate plugin installation and deletion without putting file on disk. + if ( file_exists( $full_plugin_path ) ) { + $all_plugin_data = get_plugin_data( $full_plugin_path ); + $data = array( + 'name' => $all_plugin_data['Name'], + 'version' => $all_plugin_data['Version'], + ); + } else { + $data = array( + 'name' => $plugin_path, + 'version' => 'unknown', + ); + } + + $this->plugin_info[ $plugin_path ] = $data; + } + + /** + * Invoked after plugin deletion. + * + * @access public + * + * @param string $plugin_path Path to the plugin main file. + * @param boolean $is_deleted Whether the plugin was deleted successfully. + */ + public function deleted_plugin( $plugin_path, $is_deleted ) { + call_user_func( $this->action_handler, $plugin_path, $is_deleted, $this->plugin_info[ $plugin_path ] ); + unset( $this->plugin_info[ $plugin_path ] ); + } + + /** + * Expand the plugins within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_plugin_data( $args ) { + $plugin_path = $args[0]; + $plugin_data = array(); + + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $all_plugins = get_plugins(); + if ( isset( $all_plugins[ $plugin_path ] ) ) { + $all_plugin_data = $all_plugins[ $plugin_path ]; + $plugin_data['name'] = $all_plugin_data['Name']; + $plugin_data['version'] = $all_plugin_data['Version']; + } + + return array( + $args[0], + $args[1], + $plugin_data, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php new file mode 100644 index 00000000..0c087cee --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php @@ -0,0 +1,957 @@ + length. + * Current Setting : 5MB. + * + * @access public + * + * @var int + */ + const MAX_POST_CONTENT_LENGTH = 5000000; + + /** + * Max bytes allowed for post meta_value => length. + * Current Setting : 2MB. + * + * @access public + * + * @var int + */ + const MAX_POST_META_LENGTH = 2000000; + + /** + * Max bytes allowed for full sync upload. + * Current Setting : 7MB. + * + * @access public + * + * @var int + */ + const MAX_SIZE_FULL_SYNC = 7000000; + + /** + * Default previous post state. + * Used for default previous post status. + * + * @access public + * + * @var string + */ + const DEFAULT_PREVIOUS_STATE = 'new'; + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'posts'; + } + + /** + * The table in the database. + * + * @access public + * + * @return string + */ + public function table_name() { + return 'posts'; + } + + /** + * Retrieve a post by its ID. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param int $id ID of the sync object. + * @return \WP_Post|bool Filtered \WP_Post object, or false if the object is not a post. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'post' === $object_type ) { + $post = get_post( (int) $id ); + if ( $post ) { + return $this->filter_post_content_and_add_links( $post ); + } + } + + return false; + } + + /** + * Initialize posts action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + $this->action_handler = $callable; + + add_action( 'wp_insert_post', array( $this, 'wp_insert_post' ), 11, 3 ); + add_action( 'wp_after_insert_post', array( $this, 'wp_after_insert_post' ), 11, 2 ); + add_action( 'jetpack_sync_save_post', $callable, 10, 4 ); + + add_action( 'deleted_post', $callable, 10 ); + add_action( 'jetpack_published_post', $callable, 10, 3 ); + add_filter( 'jetpack_sync_before_enqueue_deleted_post', array( $this, 'filter_blacklisted_post_types_deleted' ) ); + + add_action( 'transition_post_status', array( $this, 'save_published' ), 10, 3 ); + + // Listen for meta changes. + $this->init_listeners_for_meta_type( 'post', $callable ); + $this->init_meta_whitelist_handler( 'post', array( $this, 'filter_meta' ) ); + + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_save_post', array( $this, 'filter_jetpack_sync_before_enqueue_jetpack_sync_save_post' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_published_post', array( $this, 'filter_jetpack_sync_before_enqueue_jetpack_published_post' ) ); + + add_action( 'jetpack_daily_akismet_meta_cleanup_before', array( $this, 'daily_akismet_meta_cleanup_before' ) ); + add_action( 'jetpack_daily_akismet_meta_cleanup_after', array( $this, 'daily_akismet_meta_cleanup_after' ) ); + add_action( 'jetpack_post_meta_batch_delete', $callable, 10, 2 ); + } + + /** + * Before Akismet's daily cleanup of spam detection metadata. + * + * @access public + * + * @param array $feedback_ids IDs of feedback posts. + */ + public function daily_akismet_meta_cleanup_before( $feedback_ids ) { + remove_action( 'deleted_post_meta', $this->action_handler ); + + if ( ! is_array( $feedback_ids ) || count( $feedback_ids ) < 1 ) { + return; + } + + $ids_chunks = array_chunk( $feedback_ids, 100, false ); + foreach ( $ids_chunks as $chunk ) { + /** + * Used for syncing deletion of batch post meta + * + * @since 1.6.3 + * @since-jetpack 6.1.0 + * + * @module sync + * + * @param array $feedback_ids feedback post IDs + * @param string $meta_key to be deleted + */ + do_action( 'jetpack_post_meta_batch_delete', $chunk, '_feedback_akismet_values' ); + } + } + + /** + * After Akismet's daily cleanup of spam detection metadata. + * + * @access public + * + * @param array $feedback_ids IDs of feedback posts. + */ + public function daily_akismet_meta_cleanup_after( $feedback_ids ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + add_action( 'deleted_post_meta', $this->action_handler ); + } + + /** + * Initialize posts action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_posts', $callable ); // Also sends post meta. + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + // meta. + add_filter( 'jetpack_sync_before_send_added_post_meta', array( $this, 'trim_post_meta' ) ); + add_filter( 'jetpack_sync_before_send_updated_post_meta', array( $this, 'trim_post_meta' ) ); + add_filter( 'jetpack_sync_before_send_deleted_post_meta', array( $this, 'trim_post_meta' ) ); + // Full sync. + $sync_module = Modules::get_module( 'full-sync' ); + if ( $sync_module instanceof Full_Sync_Immediately ) { + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_posts', array( $this, 'add_term_relationships' ) ); + } else { + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_posts', array( $this, 'expand_posts_with_metadata_and_terms' ) ); + } + } + + /** + * Enqueue the posts actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @todo Use $wpdb->prepare for the SQL query. + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + $count = (int) $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + $where_sql = Settings::get_blacklisted_post_types_sql(); + + // Config is a list of post IDs to sync. + if ( is_array( $config ) ) { + $where_sql .= ' AND ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return $where_sql; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_posts' ); + } + + /** + * Filter meta arguments so that we don't sync meta_values over MAX_POST_META_LENGTH. + * + * @param array $args action arguments. + * + * @return array filtered action arguments. + */ + public function trim_post_meta( $args ) { + list( $meta_id, $object_id, $meta_key, $meta_value ) = $args; + // Explicitly truncate meta_value when it exceeds limit. + // Large content will cause OOM issues and break Sync. + $serialized_value = maybe_serialize( $meta_value ); + if ( strlen( $serialized_value ) >= self::MAX_POST_META_LENGTH ) { + $meta_value = ''; + } + return array( $meta_id, $object_id, $meta_key, $meta_value ); + } + + /** + * Process content before send. + * + * @param array $args Arguments of the `wp_insert_post` hook. + * + * @return array + */ + public function expand_jetpack_sync_save_post( $args ) { + list( $post_id, $post, $update, $previous_state ) = $args; + return array( $post_id, $this->filter_post_content_and_add_links( $post ), $update, $previous_state ); + } + + /** + * Filter all blacklisted post types and add filtered post content. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if the post type is a blacklisted one. + */ + public function filter_jetpack_sync_before_enqueue_jetpack_sync_save_post( $args ) { + list( $post_id, $post, $update, $previous_state ) = $args; + + if ( in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ) ) { + return false; + } + + return array( $post_id, $this->filter_post_content_and_add_links( $post ), $update, $previous_state ); + } + + /** + * Add filtered post content. + * + * @param array $args Hook arguments. + * @return array Hook arguments. + */ + public function filter_jetpack_sync_before_enqueue_jetpack_published_post( $args ) { + list( $post_id, $flags, $post ) = $args; + + return array( $post_id, $flags, $this->filter_post_content_and_add_links( $post ) ); + } + + /** + * Filter all blacklisted post types. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if the post type is a blacklisted one. + */ + public function filter_blacklisted_post_types_deleted( $args ) { + + // deleted_post is called after the SQL delete but before cache cleanup. + // There is the potential we can't detect post_type at this point. + if ( ! $this->is_post_type_allowed( $args[0] ) ) { + return false; + } + + return $args; + } + + /** + * Filter all meta that is not blacklisted, or is stored for a disallowed post type. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if meta was filtered. + */ + public function filter_meta( $args ) { + if ( $this->is_post_type_allowed( $args[1] ) && $this->is_whitelisted_post_meta( $args[2] ) ) { + return $args; + } + + return false; + } + + /** + * Whether a post meta key is whitelisted. + * + * @param string $meta_key Meta key. + * @return boolean Whether the post meta key is whitelisted. + */ + public function is_whitelisted_post_meta( $meta_key ) { + // The _wpas_skip_ meta key is used by Publicize. + return in_array( $meta_key, Settings::get_setting( 'post_meta_whitelist' ), true ) || str_starts_with( $meta_key, '_wpas_skip_' ); + } + + /** + * Whether a post type is allowed. + * A post type will be disallowed if it's present in the post type blacklist. + * + * @param int $post_id ID of the post. + * @return boolean Whether the post type is allowed. + */ + public function is_post_type_allowed( $post_id ) { + $post = get_post( (int) $post_id ); + + if ( isset( $post->post_type ) ) { + return ! in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ); + } + return false; + } + + /** + * Remove the embed shortcode. + * + * @global $wp_embed + */ + public function remove_embed() { + global $wp_embed; + remove_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); + // remove the embed shortcode since we would do the part later. + remove_shortcode( 'embed' ); + // Attempts to embed all URLs in a post. + remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); + } + + /** + * Add the embed shortcode. + * + * @global $wp_embed + */ + public function add_embed() { + global $wp_embed; + add_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); + // Shortcode placeholder for strip_shortcodes(). + add_shortcode( 'embed', '__return_false' ); + // Attempts to embed all URLs in a post. + add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); + } + + /** + * Expands wp_insert_post to include filtered content + * + * @param \WP_Post $post_object Post object. + */ + public function filter_post_content_and_add_links( $post_object ) { + global $post; + + // Used to restore the post global. + $current_post = $post; + + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + $post = $post_object; + + // Return non existant post. + $post_type = get_post_type_object( $post->post_type ); + if ( empty( $post_type ) || ! is_object( $post_type ) ) { + $non_existant_post = new \stdClass(); + $non_existant_post->ID = $post->ID; + $non_existant_post->post_modified = $post->post_modified; + $non_existant_post->post_modified_gmt = $post->post_modified_gmt; + $non_existant_post->post_status = 'jetpack_sync_non_registered_post_type'; + $non_existant_post->post_type = $post->post_type; + // Restore global post. + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + $post = $current_post; + + return $non_existant_post; + } + /** + * Filters whether to prevent sending post data to .com + * + * Passing true to the filter will prevent the post data from being sent + * to the WordPress.com. + * Instead we pass data that will still enable us to do a checksum against the + * Jetpacks data but will prevent us from displaying the data on in the API as well as + * other services. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean false prevent post data from being synced to WordPress.com + * @param mixed $post \WP_Post object + */ + if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) { + // We only send the bare necessary object to be able to create a checksum. + $blocked_post = new \stdClass(); + $blocked_post->ID = $post->ID; + $blocked_post->post_modified = $post->post_modified; + $blocked_post->post_modified_gmt = $post->post_modified_gmt; + $blocked_post->post_status = 'jetpack_sync_blocked'; + $blocked_post->post_type = $post->post_type; + + // Restore global post. + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + $post = $current_post; + + return $blocked_post; + } + + // lets not do oembed just yet. + $this->remove_embed(); + + if ( 0 < strlen( $post->post_password ) ) { + $post->post_password = 'auto-' . wp_generate_password( 10, false ); + } + + // Explicitly omit post_content when it exceeds limit. + // Large content will cause OOM issues and break Sync. + if ( strlen( $post->post_content ) >= self::MAX_POST_CONTENT_LENGTH ) { + $post->post_content = ''; + } + + /** This filter is already documented in core. wp-includes/post-template.php */ + if ( Settings::get_setting( 'render_filtered_content' ) && $post_type->public ) { + global $shortcode_tags; + /** + * Filter prevents some shortcodes from expanding. + * + * Since we can can expand some type of shortcode better on the .com side and make the + * expansion more relevant to contexts. For example [galleries] and subscription emails + * + * @since 1.6.3 + * @since-jetpack 4.5.0 + * + * @param array of shortcode tags to remove. + */ + $shortcodes_to_remove = apply_filters( + 'jetpack_sync_do_not_expand_shortcodes', + array( + 'gallery', + 'slideshow', + ) + ); + $removed_shortcode_callbacks = array(); + foreach ( $shortcodes_to_remove as $shortcode ) { + if ( isset( $shortcode_tags[ $shortcode ] ) ) { + $removed_shortcode_callbacks[ $shortcode ] = $shortcode_tags[ $shortcode ]; + } + } + + array_map( 'remove_shortcode', array_keys( $removed_shortcode_callbacks ) ); + /** + * Certain modules such as Likes, Related Posts and Sharedaddy are using `Settings::is_syncing` + * in order to NOT get rendered in filtered post content. + * Since the current method runs now before enqueueing instead of before sending, + * we are setting `is_syncing` flag to true in order to preserve the existing functionality. + */ + + $is_syncing_current = Settings::is_syncing(); + Settings::set_is_syncing( true ); + $post->post_content_filtered = apply_filters( 'the_content', $post->post_content ); + $post->post_excerpt_filtered = apply_filters( 'the_excerpt', $post->post_excerpt ); + Settings::set_is_syncing( $is_syncing_current ); + + foreach ( $removed_shortcode_callbacks as $shortcode => $callback ) { + add_shortcode( $shortcode, $callback ); + } + } + + $this->add_embed(); + + if ( has_post_thumbnail( $post->ID ) ) { + $image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); + if ( is_array( $image_attributes ) && isset( $image_attributes[0] ) ) { + $post->featured_image = $image_attributes[0]; + } + } + + $post->permalink = get_permalink( $post->ID ); + $post->shortlink = wp_get_shortlink( $post->ID ); + + if ( function_exists( 'amp_get_permalink' ) ) { + $post->amp_permalink = amp_get_permalink( $post->ID ); + } + + $filtered_post = $post; + + // Restore global post. + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + $post = $current_post; + + return $filtered_post; + } + + /** + * Handle transition from another post status to a published one. + * + * @param string $new_status New post status. + * @param string $old_status Old post status. + * @param \WP_Post $post Post object. + */ + public function save_published( $new_status, $old_status, $post ) { + if ( 'publish' === $new_status && 'publish' !== $old_status ) { + $this->just_published[ $post->ID ] = true; + } + + $this->previous_status[ $post->ID ] = $old_status; + } + + /** + * When publishing or updating a post, the Gutenberg editor sends two requests: + * 1. sent to WP REST API endpoint `wp-json/wp/v2/posts/$id` + * 2. sent to wp-admin/post.php `?post=$id&action=edit&classic-editor=1&meta_box=1` + * + * The 2nd request is to update post meta, which is not supported on WP REST API. + * When syncing post data, we will include if this was a meta box update. + * + * @return boolean Whether this is a Gutenberg meta box update. + */ + private function is_gutenberg_meta_box_update() { + // phpcs:disable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended -- We only check the request to determine if this is a Gutenberg meta box update, and we only use the result to set a boolean logged in the sync event. If anyone anywhere else gets the flag and does something CSRF-able with it, they should ensure that a nonce has been checked. + return ( + isset( $_POST['action'], $_GET['classic-editor'], $_GET['meta_box'] ) && + 'editpost' === $_POST['action'] && + '1' === $_GET['classic-editor'] && + '1' === $_GET['meta_box'] + // phpcs:enable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended + ); + } + + /** + * Handler for the wp_insert_post hook. + * Called upon creation of a new post. + * + * @param int $post_ID Post ID. + * @param \WP_Post $post Post object. + * @param boolean $update Whether this is an existing post being updated or not. + */ + public function wp_insert_post( $post_ID, $post = null, $update = null ) { + if ( ! is_numeric( $post_ID ) || $post === null ) { + return; + } + + // Workaround for https://github.com/woocommerce/woocommerce/issues/18007. + if ( $post && 'shop_order' === $post->post_type ) { + $post = get_post( $post_ID ); + } + + $previous_status = isset( $this->previous_status[ $post_ID ] ) ? $this->previous_status[ $post_ID ] : self::DEFAULT_PREVIOUS_STATE; + + $just_published = isset( $this->just_published[ $post_ID ] ) ? $this->just_published[ $post_ID ] : false; + + $state = array( + 'is_auto_save' => (bool) Jetpack_Constants::get_constant( 'DOING_AUTOSAVE' ), + 'previous_status' => $previous_status, + 'just_published' => $just_published, + 'is_gutenberg_meta_box_update' => $this->is_gutenberg_meta_box_update(), + ); + /** + * Filter that is used to add to the post flags ( meta data ) when a post gets published + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @param int $post_ID the post ID + * @param mixed $post \WP_Post object + * @param bool $update Whether this is an existing post being updated or not. + * @param mixed $state state + * + * @module sync + */ + do_action( 'jetpack_sync_save_post', $post_ID, $post, $update, $state ); + unset( $this->previous_status[ $post_ID ] ); + } + + /** + * Handler for the wp_after_insert_post hook. + * Called after creation/update of a new post. + * + * @param int $post_ID Post ID. + * @param \WP_Post $post Post object. + **/ + public function wp_after_insert_post( $post_ID, $post ) { + if ( ! is_numeric( $post_ID ) || $post === null ) { + return; + } + + // Workaround for https://github.com/woocommerce/woocommerce/issues/18007. + if ( $post && 'shop_order' === $post->post_type ) { + $post = get_post( $post_ID ); + } + + $this->send_published( $post_ID, $post ); + } + + /** + * Send a published post for sync. + * + * @param int $post_ID Post ID. + * @param \WP_Post $post Post object. + */ + public function send_published( $post_ID, $post ) { + if ( ! isset( $this->just_published[ $post_ID ] ) ) { + return; + } + + // Post revisions cause race conditions where this send_published add the action before the actual post gets synced. + if ( wp_is_post_autosave( $post ) || wp_is_post_revision( $post ) ) { + return; + } + + $post_flags = array( + 'post_type' => $post->post_type, + ); + + $author_user_object = get_user_by( 'id', $post->post_author ); + if ( $author_user_object ) { + $roles = new Roles(); + + $post_flags['author'] = array( + 'id' => $post->post_author, + 'wpcom_user_id' => get_user_meta( $post->post_author, 'wpcom_user_id', true ), + 'display_name' => $author_user_object->display_name, + 'email' => $author_user_object->user_email, + 'translated_role' => $roles->translate_user_to_role( $author_user_object ), + ); + } + + /** + * Filter that is used to add to the post flags ( meta data ) when a post gets published + * + * @since 1.6.3 + * @since-jetpack 4.4.0 + * + * @param mixed array post flags that are added to the post + * @param mixed $post \WP_Post object + */ + $flags = apply_filters( 'jetpack_published_post_flags', $post_flags, $post ); + + // Only Send Pulished Post event if post_type is not blacklisted. + if ( ! in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ) ) { + + /** + * Action that gets synced when a post type gets published. + * + * @since 1.6.3 + * @since-jetpack 4.4.0 + * + * @param int $post_ID + * @param mixed array $flags post flags that are added to the post + * @param WP_Post $post The post object + */ + do_action( 'jetpack_published_post', $post_ID, $flags, $post ); + } + unset( $this->just_published[ $post_ID ] ); + + /** + * Send additional sync action for Activity Log when post is a Customizer publish + */ + if ( 'customize_changeset' === $post->post_type ) { + $post_content = json_decode( $post->post_content, true ); + foreach ( $post_content as $key => $value ) { + // Skip if it isn't a widget. + if ( 'widget_' !== substr( $key, 0, strlen( 'widget_' ) ) ) { + continue; + } + // Change key from "widget_archives[2]" to "archives-2". + $key = str_replace( 'widget_', '', $key ); + $key = str_replace( '[', '-', $key ); + $key = str_replace( ']', '', $key ); + + global $wp_registered_widgets; + if ( isset( $wp_registered_widgets[ $key ] ) ) { + $widget_data = array( + 'name' => $wp_registered_widgets[ $key ]['name'], + 'id' => $key, + 'title' => $value['value']['title'], + ); + do_action( 'jetpack_widget_edited', $widget_data ); + } + } + } + } + + /** + * Add term relationships to post objects within a hook before they are serialized and sent to the server. + * This is used in Full Sync Immediately + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function add_term_relationships( $args ) { + list( $filtered_posts, $previous_interval_end ) = $args; + list( $filtered_post_ids, $filtered_posts, $filtered_posts_metadata ) = $filtered_posts; + + return array( + $filtered_posts, + $filtered_posts_metadata, + $this->get_term_relationships( $filtered_post_ids ), + $previous_interval_end, + ); + } + + /** + * Expand post IDs to post objects within a hook before they are serialized and sent to the server. + * This is used in Legacy Full Sync + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_posts_with_metadata_and_terms( $args ) { + list( $post_ids, $previous_interval_end ) = $args; + + $posts = $this->expand_posts( $post_ids ); + $posts_metadata = $this->get_metadata( $post_ids, 'post', Settings::get_setting( 'post_meta_whitelist' ) ); + $term_relationships = $this->get_term_relationships( $post_ids ); + + return array( + $posts, + $posts_metadata, + $term_relationships, + $previous_interval_end, + ); + } + + /** + * Gets a list of minimum and maximum object ids for each batch based on the given batch size. + * + * @access public + * + * @param int $batch_size The batch size for objects. + * @param string|bool $where_sql The sql where clause minus 'WHERE', or false if no where clause is needed. + * + * @return array|bool An array of min and max ids for each batch. FALSE if no table can be found. + */ + public function get_min_max_object_ids_for_batches( $batch_size, $where_sql = false ) { + return parent::get_min_max_object_ids_for_batches( $batch_size, $this->get_where_sql( $where_sql ) ); + } + + /** + * Given the Module Configuration and Status return the next chunk of items to send. + * This function also expands the posts and metadata and filters them based on the maximum size constraints. + * + * @param array $config This module Full Sync configuration. + * @param array $status This module Full Sync status. + * @param int $chunk_size Chunk size. + * + * @return array + */ + public function get_next_chunk( $config, $status, $chunk_size ) { + + $post_ids = parent::get_next_chunk( $config, $status, $chunk_size ); + + if ( empty( $post_ids ) ) { + return array(); + } + + $posts = $this->expand_posts( $post_ids ); + $posts_metadata = $this->get_metadata( $post_ids, 'post', Settings::get_setting( 'post_meta_whitelist' ) ); + + // Filter posts and metadata based on maximum size constraints. + list( $filtered_post_ids, $filtered_posts, $filtered_posts_metadata ) = $this->filter_posts_and_metadata_max_size( $posts, $posts_metadata ); + return array( + $filtered_post_ids, + $filtered_posts, + $filtered_posts_metadata, + ); + } + + /** + * Expand posts. + * + * @param array $post_ids Post IDs. + * + * @return array Expanded posts. + */ + private function expand_posts( $post_ids ) { + $posts = array_filter( array_map( array( 'WP_Post', 'get_instance' ), $post_ids ) ); + $posts = array_map( array( $this, 'filter_post_content_and_add_links' ), $posts ); + $posts = array_values( $posts ); // Reindex in case posts were deleted. + return $posts; + } + + /** + * Filters posts and metadata based on maximum size constraints. + * It always allows the first post with its metadata even if they exceed the limit, otherwise they will never be synced. + * + * @access public + * + * @param array $posts The array of posts to filter. + * @param array $metadata The array of metadata to filter. + * @return array An array containing the filtered post IDs, filtered posts, and filtered metadata. + */ + public function filter_posts_and_metadata_max_size( $posts, $metadata ) { + $filtered_posts = array(); + $filtered_metadata = array(); + $filtered_post_ids = array(); + $current_size = 0; + foreach ( $posts as $post ) { + $post_content_size = isset( $post->post_content ) ? strlen( $post->post_content ) : 0; + $current_metadata = array(); + $metadata_size = 0; + foreach ( $metadata as $key => $metadata_item ) { + if ( (int) $metadata_item->post_id === $post->ID ) { + // Trimming metadata if it exceeds limit. Similar to trim_post_meta. + $metadata_item_size = strlen( maybe_serialize( $metadata_item->meta_value ) ); + if ( $metadata_item_size >= self::MAX_POST_META_LENGTH ) { + $metadata_item->meta_value = ''; + } + $current_metadata[] = $metadata_item; + $metadata_size += $metadata_item_size >= self::MAX_POST_META_LENGTH ? 0 : $metadata_item_size; + if ( ! empty( $filtered_post_ids ) && ( $current_size + $post_content_size + $metadata_size ) > ( self::MAX_SIZE_FULL_SYNC ) ) { + break 2; // Break both foreach loops. + } + unset( $metadata[ $key ] ); + } + } + // Always allow the first post with its metadata. + if ( empty( $filtered_post_ids ) || ( $current_size + $post_content_size + $metadata_size ) <= ( self::MAX_SIZE_FULL_SYNC ) ) { + $filtered_post_ids[] = strval( $post->ID ); + $filtered_posts[] = $post; + $filtered_metadata = array_merge( $filtered_metadata, $current_metadata ); + $current_size += $post_content_size + $metadata_size; + } else { + break; + } + } + return array( + $filtered_post_ids, + $filtered_posts, + $filtered_metadata, + ); + } + + /** + * Set the status of the full sync action based on the objects that were sent. + * + * @access public + * + * @param array $status This module Full Sync status. + * @param array $objects This module Full Sync objects. + * + * @return array The updated status. + */ + public function set_send_full_sync_actions_status( $status, $objects ) { + $status['last_sent'] = end( $objects[0] ); + $status['sent'] += count( $objects[0] ); + return $status; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php new file mode 100644 index 00000000..95e1efb1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php @@ -0,0 +1,83 @@ +has_login_ability(); + } + + // If the login ability can not be determined, the feature is not active, + // or something is wrong, default to not syncing failed login attempts. + return false; + } + + /** + * Maybe log a failed login attempt. + * + * @access public + * + * @param array $failed_attempt Failed attempt data. + */ + public function maybe_log_failed_login_attempt( $failed_attempt ) { + /** + * Filter which provides Jetpack's decision as to whether the current requestor can attempt logging in. + * + * Example: When Jetpack's Brute Force Login Protection is active, this filter will return false if the user is currently locked out. + * + * @since 3.5.1 + * + * @package sync + * + * @return bool True if the user should be allowed to attempt logging in, false otherwise. + */ + $has_login_ability = apply_filters( 'jetpack_has_login_ability', $this->has_login_ability_fallback() ); + + if ( $has_login_ability && ! Jetpack_Constants::is_true( 'XMLRPC_REQUEST' ) ) { + do_action( 'jetpack_valid_failed_login_attempt', $failed_attempt ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php new file mode 100644 index 00000000..16db3d73 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php @@ -0,0 +1,1875 @@ + [ 'searchable_in_all_content' => true ], + * Field will be included in the all_content fields + * + * 'metakey' => [ 'available' => false, 'alternatives' => [ 'metakey_processed' ] ], + * Field not in meta.* but has data in an alternative field(s) name that + * should work similarly. For instance, woocommerce total_sales does not go into + * the index, but the percentage of sales does. + * + * @static + * @access private + * @var array + */ + private static $postmeta_to_sync = array( + // jetpack. + 'jetpack-search-meta0' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta1' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta2' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta3' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta4' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta5' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta6' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta7' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta8' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta9' => array( 'searchable_in_all_content' => true ), + + // woocommerce. + 'exclude_product_categories' => array(), + 'exclude_product_ids' => array(), + 'free_shipping' => array(), + 'id_field' => array(), + 'individual_use' => array(), + 'limit_usage_to_x_items' => array(), + 'maximum_amount' => array(), + 'minimum_amount' => array(), + 'post_id' => array(), + 'product_categories' => array( 'searchable_in_all_content' => true ), + 'product_ids' => array(), + 'total_sales' => array( + 'available' => false, + 'alternatives' => array( + 'wc.percent_of_sales', + ), + ), + 'usage_limit' => array(), + 'usage_limit_per_user' => array(), + '_crosssell_ids' => array(), + '_downloadable' => array(), + '_featured' => array(), + '_height' => array(), + '_length' => array(), + '_price' => array( + 'alternatives' => array( + 'wc.price', + 'wc.min_price', + 'wc.max_price', + ), + ), + '_prices_include_tax' => array(), + '_product_attributes' => array(), + '_product_version' => array(), + '_regular_price' => array( + 'alternatives' => array( + 'wc.regular_price', + ), + ), + '_sale_price' => array( + 'alternatives' => array( + 'wc.sale_price', + ), + ), + '_sale_price_dates_from' => array(), + '_sale_price_dates_to' => array(), + '_sku' => array( 'searchable_in_all_content' => true ), + '_stock_status' => array(), + '_wc_average_rating' => array( + 'alternatives' => array( + 'wc.ave_rating_score', + ), + ), + '_wc_rating_count' => array( + 'alternatives' => array( + 'wc.rating', // wc.rating.count_1, wc.rating.count_2, ... + ), + ), + '_wc_review_count' => array(), + '_weight' => array(), + '_width' => array(), + + // co-authors plus. + 'cap-description' => array( 'searchable_in_all_content' => true ), + 'cap-user_login' => array( 'searchable_in_all_content' => true ), + 'cap-user_email' => array(), + 'cap-last_name' => array( 'searchable_in_all_content' => true ), + 'cap-first_name' => array( 'searchable_in_all_content' => true ), + 'cap-display_name' => array( 'searchable_in_all_content' => true ), + 'cap-website' => array(), + 'cap-jabber' => array(), + 'cap-aim' => array(), + 'cap-twitter' => array(), + 'cap-facebook' => array(), + 'cap-google_plus' => array(), + 'cap-job_title' => array( 'searchable_in_all_content' => true ), + + // bbpress. + 'bbpl_like' => array(), + 'bbpress_discussion_comments_copied' => array(), + 'bbpress_discussion_tags_copied' => array(), + 'bbpress_discussion_topic_id' => array(), + 'bbpress_discussion_use_defaults' => array(), + 'bbpress_page_header_bg' => array(), + 'bbpress_title_bg' => array(), + 'use_bbpress_discussion_topic' => array(), + + // wpml. + 'tm_meta_wpml' => array(), + 'wpml_language' => array(), + 'wpml_media_lang' => array(), + 'wpml_media_processed' => array(), + + // blogger import. + 'blogger_author' => array( 'searchable_in_all_content' => true ), + 'blogger_blog' => array( 'searchable_in_all_content' => true ), + 'blogger_permalink' => array( 'searchable_in_all_content' => true ), + + // geo. + 'geo_address' => array( 'searchable_in_all_content' => true ), + 'geo_latitude' => array(), + 'geo_longitude' => array(), + 'geo_public' => array(), + 'geolocated' => array(), + 'geolocation_city' => array( 'searchable_in_all_content' => true ), + 'geolocation_country_long' => array( 'searchable_in_all_content' => true ), + 'geolocation_country_short' => array( 'searchable_in_all_content' => true ), + 'geolocation_formatted_address' => array( 'searchable_in_all_content' => true ), + 'geolocation_lat' => array(), + 'geolocation_long' => array(), + 'geolocation_postcode' => array( 'searchable_in_all_content' => true ), + 'geolocation_state_long' => array( 'searchable_in_all_content' => true ), + 'geolocation_state_short' => array( 'searchable_in_all_content' => true ), + + // wp-ultimate-recipe. + 'recipe_alternate_image' => array(), + 'recipe_cook_time' => array(), + 'recipe_cook_time_text' => array(), + 'recipe_description' => array( 'searchable_in_all_content' => true ), + 'recipe_ingredients' => array( 'searchable_in_all_content' => true ), + 'recipe_instructions' => array( 'searchable_in_all_content' => true ), + 'recipe_notes' => array( 'searchable_in_all_content' => true ), + 'recipe_nutritional' => array( 'searchable_in_all_content' => true ), + 'recipe_passive_time' => array(), + 'recipe_passive_time_text' => array(), + 'recipe_prep_time' => array(), + 'recipe_prep_time_text' => array(), + 'recipe_rating' => array(), + 'recipe_servings' => array(), + 'recipe_servings_normalized' => array(), + 'recipe_servings_type' => array(), + 'recipe_terms' => array( 'searchable_in_all_content' => true ), + 'recipe_terms_with_parents' => array(), + 'recipe_title' => array( 'searchable_in_all_content' => true ), + 'recipe_user_ratings' => array(), + 'recipe_user_ratings_rating' => array(), + + // generic fields. + // from advanced-custom-fields and metabox.io . + 'Link' => array(), + 'Location' => array(), + 'Title' => array( 'searchable_in_all_content' => true ), + 'ad_code' => array(), + 'address' => array(), + 'admin_mail' => array(), + 'admin_only' => array(), + 'advertisers' => array( 'searchable_in_all_content' => true ), + 'age' => array(), + 'aliases' => array(), + 'alternate_title' => array(), + 'ama_content' => array(), + 'amazon' => array(), + 'answer' => array( 'searchable_in_all_content' => true ), + 'area' => array(), + 'attention' => array(), + 'attr' => array(), + 'author' => array( 'searchable_in_all_content' => true ), + 'author_name' => array( 'searchable_in_all_content' => true ), + 'blog' => array(), + 'blog_id' => array(), + 'call_to_action' => array(), + 'campaign_preview' => array(), + 'canonical_url' => array(), + 'catch_text' => array(), + 'category' => array( 'searchable_in_all_content' => true ), + 'classificacao' => array(), + 'classification' => array(), + 'code' => array(), + 'codigo' => array(), + 'company' => array( 'searchable_in_all_content' => true ), + 'company_website' => array(), + 'config' => array(), + 'construction' => array(), + 'container_ids' => array(), + 'content' => array( 'searchable_in_all_content' => true ), + 'content_body-full_content' => array( 'searchable_in_all_content' => true ), + 'copyright' => array(), + 'custom_page_title' => array( 'searchable_in_all_content' => true ), + 'custom_permalink' => array(), + 'customize' => array(), + 'data' => array(), + 'date' => array(), + 'day' => array(), + 'descripcion' => array( 'searchable_in_all_content' => true ), + 'description' => array( 'searchable_in_all_content' => true ), + 'display_settings' => array(), + 'display_type' => array(), + 'duration' => array(), + 'embed' => array(), + 'entity_ids' => array(), + 'entity_types' => array(), + 'event_subtitle' => array( 'searchable_in_all_content' => true ), + 'excluded_container_ids' => array(), + 'exclusions' => array(), + 'experience' => array(), + 'external_url' => array(), + 'featured' => array(), + 'featured_image' => array(), + 'featured_post' => array(), + 'featured_story' => array(), + 'fee' => array(), + 'filter' => array(), + 'follow' => array(), + 'footer_text' => array(), + 'from_header' => array(), + 'fullscreen_view' => array(), + 'gallery' => array(), + 'genre' => array( 'searchable_in_all_content' => true ), + 'guest_bio' => array(), + 'guest_name' => array(), + 'guests' => array( 'searchable_in_all_content' => true ), + 'has_variations' => array(), + 'hashtag' => array(), + 'header_image' => array(), + 'hidden_from_ui' => array(), + 'hide_on_screen' => array(), + 'homepage_order' => array(), + 'hours' => array(), + 'i18n' => array(), + 'id' => array(), + 'image' => array(), + 'image_size' => array(), + 'image_source' => array(), + 'index' => array(), + 'intro_text' => array( 'searchable_in_all_content' => true ), + 'job_mention' => array( 'searchable_in_all_content' => true ), + 'keywords' => array( 'searchable_in_all_content' => true ), + 'latest_news' => array(), + 'layout' => array(), + 'link' => array(), + 'link_dump' => array( 'searchable_in_all_content' => true ), + 'link_url' => array(), + 'location' => array(), + 'logo' => array(), + 'main_title' => array( 'searchable_in_all_content' => true ), + 'maximum_entity_count' => array(), + 'media' => array(), + 'mentions' => array(), + 'messages' => array(), + 'meta_description' => array( 'searchable_in_all_content' => true ), + 'meta_id' => array(), + 'meta_index' => array(), + 'meta_key' => array(), + 'meta_value' => array(), + 'modal-dialog-id' => array(), + 'name' => array( 'searchable_in_all_content' => true ), + 'nombre' => array( 'searchable_in_all_content' => true ), + 'notes' => array( 'searchable_in_all_content' => true ), + 'options' => array(), + 'order_by' => array(), + 'order_direction' => array(), + 'original_cats' => array(), + 'original_headers' => array(), + 'original_link' => array(), + 'original_message' => array(), + 'original_subject' => array(), + 'original_title' => array(), + 'original_to' => array(), + 'other_setting' => array(), + 'page_canonical' => array(), + 'page_layout' => array(), + 'page_sidebar' => array(), + 'page_tags' => array(), + 'panels_data' => array(), + 'parking' => array(), + 'pdf_upload' => array(), + 'people_mentioned' => array(), + 'photo' => array(), + 'play_time' => array(), + 'position' => array(), + 'post-rating' => array(), + 'post_background' => array(), + 'post_color' => array(), + 'post_sidebar' => array(), + 'post_subtitle' => array( 'searchable_in_all_content' => true ), + 'price' => array(), + 'publication' => array(), + 'rating' => array(), + 'ratings_average' => array(), + 'ratings_score' => array(), + 'ratings_users' => array(), + 'relation' => array(), + 'reply_to_header' => array(), + 'required' => array(), + 'returns' => array(), + 'review_post' => array(), + 'rule' => array(), + 'section' => array( 'searchable_in_all_content' => true ), + 'selected_links' => array(), + 'session_transcript' => array(), + 'settings' => array(), + 'sex' => array(), + 'shares_count' => array(), + 'show_description' => array( 'searchable_in_all_content' => true ), + 'show_page_title' => array(), + 'show_notes' => array(), + 'show_notes_preview' => array(), + 'side' => array(), + 'sidebar' => array(), + 'site' => array(), + 'situation' => array(), + 'slide_template' => array(), + 'slug' => array(), + 'sortorder' => array(), + 'source' => array(), + 'start_date' => array(), + 'status' => array(), + 'styles' => array(), + 'subtitle' => array( 'searchable_in_all_content' => true ), + 'subtitulo' => array(), + 'success' => array(), + 'summary' => array( 'searchable_in_all_content' => true ), + 'synopsis' => array( 'searchable_in_all_content' => true ), + 'tel' => array(), + 'tema' => array(), + 'testimonial' => array(), + 'testimonial_author' => array(), + 'text_already_subscribed' => array(), + 'text_error' => array(), + 'text_invalid_email' => array(), + 'text_not_subscribed' => array(), + 'text_required_field_missing' => array(), + 'text_subscribed' => array(), + 'text_unsubscribed' => array(), + 'thumbnail' => array(), + 'time' => array(), + 'time_jump_list' => array( 'searchable_in_all_content' => true ), + 'title' => array( 'searchable_in_all_content' => true ), + 'title_view' => array(), + 'titre' => array( 'searchable_in_all_content' => true ), + 'titulo' => array( 'searchable_in_all_content' => true ), + 'to_header' => array(), + 'toc' => array(), + 'transcript' => array( 'searchable_in_all_content' => true ), + 'transport_uri' => array(), + 'type' => array(), + 'url' => array(), + 'validation' => array(), + 'value' => array(), + 'values' => array(), + 'variation' => array(), + 'video' => array(), + 'video_type' => array(), + 'video_url' => array(), + 'videopress_guid' => array(), + 'website' => array(), + 'weight' => array(), + 'year' => array(), + + // wp.com martketplace search - @see https://wp.me/pdh6GB-Ax#comment-2104 + '_app_icon' => array(), + '_featured_product_video' => array(), + 'wpcom_marketplace_org_slug' => array(), + '_wc_general_product_dependency_theme' => array(), + '_wc_general_product_dependency_plugin' => array(), + 'wpcom_marketplace_product_extra_fields' => array(), + + ); // end indexed post meta. + + /** + * Postmeta being considered for indexing + * but currently not in the index + * this list is really only for documentation. + * + * @static + * @access private + * @var array + */ + private static $unindexed_postmeta = array( + + // Core. + '_wp_attached_file' => array(), + '_wp_attachment_context' => array(), + '_wp_attachment_image_alt' => array(), + '_wp_attachment_is_custom_header' => array(), + '_wp_attachment_metadata' => array(), + '_wp_desired_post_slug' => array(), + '_wp_old_date' => array(), + '_wp_old_slug' => array(), + '_wp_page_template' => array(), + + // WooCommerce products. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-product-data-store-cpt.php#L21 . + '_backorders' => array(), + '_default_attributes' => array(), + '_download_expiry' => array(), + '_download_limit' => array(), + '_download_permissions_granted' => array(), + '_downloadable_files' => array(), + '_file_paths' => array(), + '_manage_stock' => array(), + '_product_image_gallery' => array(), + '_purchase_note' => array(), + '_recorded_sales' => array(), + '_sold_individually' => array(), + '_stock' => array(), + '_tax_class' => array(), + '_tax_status' => array(), + '_thumbnail_id' => array(), + '_upsell_ids' => array(), + '_variation_description' => array(), + '_virtual' => array(), + '_visibility' => array(), + 'coupon_amount' => array(), + 'default_source' => array(), + 'discount_type' => array(), + 'exclude_sale_items' => array(), + 'expiry_date' => array(), + + // Woocommerce orders and refunds. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L27 . + // See https://github.com/woocommerce/woocommerce/blob/b8a2815ae546c836467008739e7ff5150cb08e93/includes/data-stores/class-wc-order-refund-data-store-cpt.php#L20 . + '_billing_address_1' => array(), + '_billing_address_2' => array(), + '_billing_address_index' => array(), + '_billing_city' => array(), + '_billing_company' => array(), + '_billing_country' => array(), + '_billing_email' => array(), + '_billing_first_name' => array(), + '_billing_last_name' => array(), + '_billing_phone' => array(), + '_billing_postcode' => array(), + '_billing_state' => array(), + '_cart_discount' => array(), + '_cart_discount_tax' => array(), + '_completed_date' => array(), + '_created_via' => array(), + '_customer_ip_address' => array(), + '_customer_user_agent' => array(), + '_date_completed' => array(), + '_date_paid' => array(), + '_order_currency' => array(), + '_order_key' => array(), + '_order_shipping' => array(), + '_order_shipping_tax' => array(), + '_order_stock_reduced' => array(), + '_order_tax' => array(), + '_order_total' => array(), + '_order_version' => array(), + '_paid_date' => array(), + '_payment_method' => array(), + '_payment_method_title' => array(), + '_payment_tokens' => array(), + '_recorded_coupon_usage_counts' => array(), + '_refund_amount' => array(), + '_refund_reason' => array(), + '_refunded_by' => array(), + '_shipping_address_1' => array(), + '_shipping_address_2' => array(), + '_shipping_address_index' => array(), + '_shipping_city' => array(), + '_shipping_company' => array(), + '_shipping_country' => array(), + '_shipping_first_name' => array(), + '_shipping_last_name' => array(), + '_shipping_postcode' => array(), + '_shipping_state' => array(), + '_transaction_id' => array(), + + // aioseop. + '_aioseop_description' => array(), + '_aioseop_keywords' => array(), + '_aioseop_title' => array(), + + // yoast. + '_yoast_wpseo_authorship' => array(), + '_yoast_wpseo_bctitle' => array(), + '_yoast_wpseo_canonical' => array(), + '_yoast_wpseo_content_score' => array(), + '_yoast_wpseo_focuskw' => array(), + '_yoast_wpseo_focuskw_text_input' => array(), + '_yoast_wpseo_google-plus-description' => array(), + '_yoast_wpseo_google-plus-image' => array(), + '_yoast_wpseo_linkdex' => array(), + '_yoast_wpseo_meta-robots-adv' => array(), + '_yoast_wpseo_meta-robots-nofollow' => array(), + '_yoast_wpseo_meta-robots-noindex' => array(), + '_yoast_wpseo_metadesc' => array(), + '_yoast_wpseo_metakeywords' => array(), + '_yoast_wpseo_opengraph-description' => array(), + '_yoast_wpseo_opengraph-image' => array(), + '_yoast_wpseo_opengraph-title' => array(), + '_yoast_wpseo_primary_byline' => array(), + '_yoast_wpseo_primary_category' => array(), + '_yoast_wpseo_primary_product_cat' => array(), + '_yoast_wpseo_primary_sponsor-type' => array(), + '_yoast_wpseo_primary_tema_category' => array(), + '_yoast_wpseo_primary_wpdmcategory' => array(), + '_yoast_wpseo_primary_wt_portfolio_category' => array(), + '_yoast_wpseo_redirect' => array(), + '_yoast_wpseo_sitemap-include' => array(), + '_yoast_wpseo_sitemap-prio' => array(), + '_yoast_wpseo_title' => array(), + '_yoast_wpseo_twitter-description' => array(), + '_yoast_wpseo_twitter-image' => array(), + + // bbpress. + 'bbppu_read_by' => array(), + '_bbp_activity_id' => array(), + '_bbp_attachment' => array(), + '_bbp_attachment_upload_error' => array(), + '_bbp_forum_id' => array(), + '_bbp_forum_parent_id' => array(), + '_bbp_forum_subforum_count' => array(), + '_bbp_forum_type' => array(), + '_bbp_group_ids' => array(), + '_bbp_last_active_id' => array(), + '_bbp_last_active_time' => array(), + '_bbp_last_reply_id' => array(), + '_bbp_last_topic_id' => array(), + '_bbp_old_forum_id' => array(), + '_bbp_old_sticky_status' => array(), + '_bbp_old_topic_id' => array(), + '_bbp_post_id' => array(), + '_bbp_reply_count' => array(), + '_bbp_reply_is_private' => array(), + '_bbp_reply_to' => array(), + '_bbp_revision_log' => array(), + '_bbp_status' => array(), + '_bbp_sticky_topics' => array(), + '_bbp_topic_count' => array(), + '_bbp_topic_id' => array(), + '_bbp_total_reply_count' => array(), + '_bbp_total_topic_count' => array(), + '_bbp_voice_count' => array(), + + // ??? + '_locale' => array(), + + // wp-job-manager. + '_job_title' => array(), + '_job_description' => array(), + + // wpml. + '_wpml_media_duplicate' => array(), + '_wpml_media_featured' => array(), + + // generic fields. + 'ad_clicks_count' => array(), + 'email' => array(), + 'usage_count' => array(), + 'user_mail' => array(), + 'views' => array(), + '_EventAllDay' => array(), + '_EventCost' => array(), + '_EventCurrencyPosition' => array(), + '_EventCurrencySymbol' => array(), + '_EventDuration' => array(), + '_EventEndDate' => array(), + '_EventEndDateUTC' => array(), + '_EventOrganizerID' => array(), + '_EventOrigin' => array(), + '_EventShowMap' => array(), + '_EventShowMapLink' => array(), + '_EventStartDate' => array(), + '_EventStartDateUTC' => array(), + '_EventTimezone' => array(), + '_EventTimezoneAbbr' => array(), + '_EventURL' => array(), + '_EventVenueID' => array(), + '_OrganizerEmail' => array(), + '_OrganizerOrganizer' => array(), + '_OrganizerOrigin' => array(), + '_OrganizerPhone' => array(), + '_OrganizerWebsite' => array(), + '_VenueAddress' => array(), + '_VenueCity' => array(), + '_VenueCountry' => array(), + '_VenueOrigin' => array(), + '_VenuePhone' => array(), + '_VenueProvince' => array(), + '_VenueShowMap' => array(), + '_VenueShowMapLink' => array(), + '_VenueState' => array(), + '_VenueStateProvince' => array(), + '_VenueURL' => array(), + '_VenueVenue' => array(), + '_VenueVenueID' => array(), + '_VenueZip' => array(), + '_description' => array(), + '_edit_last' => array(), + '_feedback_all_fields' => array(), + '_feedback_author' => array(), + '_feedback_author_email' => array(), + '_feedback_author_url' => array(), + '_feedback_contact_form_url' => array(), + '_feedback_ip' => array(), + '_feedback_subject' => array(), + '_layout' => array(), + '_links_to' => array(), + '_links_to_target' => array(), + '_mail' => array(), + '_mail_2' => array(), + '_messages' => array(), + '_numero' => array(), + '_post_restored_from' => array(), + '_video_url' => array(), + '_website' => array(), + + ); // end unindexed post meta. + + /** + * List of indexed taxonomy slugs - VARCHAR(32) + * + * @access private + * @static + * + * @var array + */ + private static $taxonomies_to_sync = array( + + // Core. + 'link_category', + 'nav_menu', + 'post_format', // Special, limited to certain values. + + // bbpress. + 'topic', + 'topic-tag', + 'topics', + + // buddypress. + 'bp-email-type', + 'bp-email-type', + 'bp_docs_access', + 'bp_docs_associated_item', + 'bp_docs_comment_access', + 'bp_docs_doc_in_folder', + 'bp_docs_folder_in_group', + 'bp_docs_tag', + 'bp_member_type', + + // co-authors plus. + 'author', + + // events calendar plus. + // the events calendar. + 'event-categories', + 'event-category', + 'event-tag', + 'event-tags', + 'event-type', + 'event-venue', + 'event_category', + 'event_location', + 'event_organizer', + 'event_tag', + 'event_type', + 'event_type_2', + 'event_users', + 'events_categories', + 'events_category', + 'events_feeds', + 'events_tags', + 'tribe_events_cat', + + // jetpack. + 'jetpack-portfolio-tag', + 'jetpack-portfolio-type', + 'jetpack-search-tag0', + 'jetpack-search-tag1', + 'jetpack-search-tag2', + 'jetpack-search-tag3', + 'jetpack-search-tag4', + 'jetpack-search-tag5', + 'jetpack-search-tag6', + 'jetpack-search-tag7', + 'jetpack-search-tag8', + 'jetpack-search-tag9', + + // nextgen gallery. + 'ngg_tag', + + // polylang. + // wpml. + 'language', + 'post_translations', + 'term_language', + 'term_translations', + 'translation_priority', + + // woocommerce. + 'pa_accessory-type', + 'pa_actor', + 'pa_age', + 'pa_ambulance', + 'pa_amount', + 'pa_arm-roll', + 'pa_aspectratio', + 'pa_audiencerating', + 'pa_author', + 'pa_axle', + 'pa_battery', + 'pa_belakang', + 'pa_binding', + 'pa_body-type', + 'pa_bore-x-stroke-mm', + 'pa_box-cargo', + 'pa_brakes', + 'pa_brand', + 'pa_brands', + 'pa_bus', + 'pa_c', + 'pa_cabin-to-end', + 'pa_capacity', + 'pa_catalognumberlist', + 'pa_ce-keurmerk', + 'pa_chassis-front', + 'pa_chassis-rear', + 'pa_chassis-weight-kg', + 'pa_chip-log', + 'pa_clothing-size', + 'pa_clutch', + 'pa_clutch-type', + 'pa_collection', + 'pa_color', + 'pa_colors', + 'pa_colour', + 'pa_compactor', + 'pa_condition', + 'pa_cor', + 'pa_couleur', + 'pa_country', + 'pa_countryregion-of-manufacture', + 'pa_crane', + 'pa_creator', + 'pa_culoare', + 'pa_customerpackagetype', + 'pa_depan', + 'pa_depan-belakang', + 'pa_department', + 'pa_design', + 'pa_diameter', + 'pa_diameter-cakram', + 'pa_dimension-mm', + 'pa_dimensions', + 'pa_director', + 'pa_disc-diameter', + 'pa_drive-system', + 'pa_dump', + 'pa_ean', + 'pa_eanlist', + 'pa_edition', + 'pa_electric-battery', + 'pa_engine-model', + 'pa_engine-size', + 'pa_ethnicity', + 'pa_exhaust-brake', + 'pa_fabric', + 'pa_farbe', + 'pa_farg', + 'pa_farge', + 'pa_features', + 'pa_final-gear-ratio', + 'pa_finish', + 'pa_fire-fighting', + 'pa_fits', + 'pa_flat-bed', + 'pa_flavour', + 'pa_format', + 'pa_fragrance', + 'pa_frame', + 'pa_front', + 'pa_front-overhang', + 'pa_front-rear', + 'pa_front-tread', + 'pa_fuel-tank', + 'pa_fuel-type', + 'pa_garantie', + 'pa_geadviseerd-accu-type', + 'pa_gear-ratio', + 'pa_gender', + 'pa_genre', + 'pa_gewicht-exclusief-accu', + 'pa_gift-card-amount', + 'pa_grade-ability-tan-o', + 'pa_groesse', + 'pa_gtin', + 'pa_gvwr-gcwr', + 'pa_hardwareplatform', + 'pa_hazardousmaterialtype', + 'pa_height', + 'pa_hekmotor-of-boegmotor', + 'pa_helmet-size', + 'pa_hersteller', + 'pa_high-blow-tank', + 'pa_hoehe', + 'pa_inhoud', + 'pa_isadultproduct', + 'pa_isbn', + 'pa_iseligiblefortradein', + 'pa_itemdimensions', + 'pa_itempartnumber', + 'pa_kemudi-tipe', + 'pa_kleur', + 'pa_kopling-tipe', + 'pa_label', + 'pa_languages', + 'pa_lbs', + 'pa_legaldisclaimer', + 'pa_lengte-aansluitkabel', + 'pa_length', + 'pa_liquid-tank', + 'pa_location', + 'pa_losse-motor-complete-set', + 'pa_maat', + 'pa_main-brake', + 'pa_make', + 'pa_manufacturer', + 'pa_manufacturer-part-number', + 'pa_manufacturermaximumage', + 'pa_manufacturerminimumage', + 'pa_manufacturerpartswarrantydesc', + 'pa_masseinheit', + 'pa_material', + 'pa_mau-sac', + 'pa_maximum-power-ps-rpm', + 'pa_maximum-speed', + 'pa_maximum-torque-kgm-rpm', + 'pa_mediatype', + 'pa_megethos', + 'pa_merk', + 'pa_metal-type', + 'pa_min-turning-circle', + 'pa_mixer', + 'pa_model', + 'pa_model-tipe', + 'pa_model-type', + 'pa_modelo', + 'pa_mount', + 'pa_mpn', + 'pa_nicotine-strength', + 'pa_nos-of-cylinder', + 'pa_nos-of-tire', + 'pa_numberofdiscs', + 'pa_numberofitems', + 'pa_numberofpages', + 'pa_offset', + 'pa_open-cargo', + 'pa_operatingsystem', + 'pa_options', + 'pa_other-part-number', + 'pa_overall-height', + 'pa_overall-length', + 'pa_overall-width', + 'pa_overview', + 'pa_packagedimensions', + 'pa_packagequantity', + 'pa_pages', + 'pa_parking-brake', + 'pa_part-number', + 'pa_partnumber', + 'pa_pattern', + 'pa_pattern2', + 'pa_performa', + 'pa_pictureformat', + 'pa_pin-size', + 'pa_piston-displacement-cc', + 'pa_ploshhad', + 'pa_plug-type', + 'pa_power', + 'pa_product', + 'pa_productgroup', + 'pa_producttypename', + 'pa_publicationdate', + 'pa_publisher', + 'pa_quantity', + 'pa_rear', + 'pa_rear-overhang', + 'pa_rear-tread', + 'pa_refrigerated-box', + 'pa_region', + 'pa_regioncode', + 'pa_releasedate', + 'pa_rem-parkir', + 'pa_rem-pelambat', + 'pa_rem-utama', + 'pa_reverse', + 'pa_runningtime', + 'pa_scent', + 'pa_schachtlengte', + 'pa_seeds', + 'pa_series', + 'pa_setting', + 'pa_sex', + 'pa_shape', + 'pa_shirt-size', + 'pa_size', + 'pa_sizes', + 'pa_sku', + 'pa_sky-lift', + 'pa_sleeve-length', + 'pa_snelheidsregeling', + 'pa_staart', + 'pa_steering', + 'pa_steering-type', + 'pa_storlek', + 'pa_studio', + 'pa_stuwkracht-lbs', + 'pa_style', + 'pa_suspensions', + 'pa_taille', + 'pa_talla', + 'pa_tamanho', + 'pa_tamano', + 'pa_taxi', + 'pa_ticket-type', + 'pa_tire-size', + 'pa_total-chassis-weight', + 'pa_towing-truck', + 'pa_tradeinvalue', + 'pa_trailer-t-head', + 'pa_transmisi-tipe', + 'pa_transmission', + 'pa_transmission-type', + 'pa_types', + 'pa_ukuran', + 'pa_upc', + 'pa_upclist', + 'pa_variation', + 'pa_vehicle-carrier', + 'pa_vergelijkbaar-stuwkracht', + 'pa_vermogen', + 'pa_voltage', + 'pa_volume', + 'pa_warranty', + 'pa_weight', + 'pa_wheel-base', + 'pa_wheel-configuration', + 'pa_wheel-disc-size', + 'pa_width', + 'pa_zout-water-geschikt', + 'product', + 'product-brand', + 'product_brand', + 'product-category', + 'product_cat', + 'product_delivery_time', + 'product_delivery_times', + 'product_price_label', + 'product_sale_labels', + 'product_shipping_class', + 'product_tag', + 'product_type', + 'product_unit', + 'product_visibility', + 'products', + + // wp-job-manager. + 'job-category', + 'job-location', + 'job-type', + 'job_cat', + 'job_category', + 'job_listing_category', + 'job_listing_label', + 'job_listing_region', + 'job_listing_tag', + 'job_listing_type', + 'job_salary', + 'job_tag', + 'job_type', + 'jobman_category', + 'jobpost_category', + 'jobpost_job_type', + 'jobpost_location', + 'resume_category', + 'resume_groups', + 'resume_job_type', + 'resume_job_type', + 'resume_languages', + 'resume_region', + 'resume_skill', + 'resume_specialities', + + // generic. + '_resource', + 'acadp_categories', + 'acadp_locations', + 'action-group', + 'activity', + 'actor', + 'actors', + 'ad-group', + 'adace-ad-group', + 'adace-sponsor', + 'additional_features', + 'adv_location', + 'advanced_ads_groups', + 'advert_category', + 'affcoups_coupon_category', + 'affcoups_coupon_type', + 'ai_log_context', + 'ai_log_level', + 'al_product-cat', + 'aol_ad_category', + 'aol_ad_location', + 'aol_ad_type', + 'aol_application_status', + 'area', + 'article-slug', + 'asgarosforum-category', + 'asgarosforum-usergroup', + 'attachment_category', + 'attachment_tag', + 'atum_location', + 'audience_type', + 'avhec_catgroup', + 'bartype', + 'baths', + 'beds', + 'bepro_listing_types', + 'blog_category', + 'booked_custom_calendars', + 'brand', + 'brands', + 'business', + 'business_cat', + 'business_category', + 'bwg_tag', + 'byline', + 'calendar_category', + 'calendar_feed', + 'calendar_type', + 'campaign_category', + 'campaign_tag', + 'carousel_cat', + 'carousels_category', + 'case27_job_listing_tags', + 'categories', + 'category_media', + 'category_portfolio', + 'celebrity_cat', + 'chapters', + 'chronosly_category', + 'city', + 'classified_listing_type', + 'client-types', + 'clients_groups', + 'cm-business-category', + 'cmdm_category', + 'cn_log_type', + 'coderevolution_post_source', + 'collection', + 'community', + 'companies', + 'company', + 'cont_category', + 'content_audit', + 'country', + 'course', + 'course-cat', + 'course-category', + 'course_cat', + 'course_category', + 'course_difficulty', + 'course_tag', + 'courses_type', + 'cp_campaign', + 'cp_recipe_category', + 'csco_post_featured', + 'ct_status', + 'ctl-stories', + 'cuisine', + 'dc_vendor_shop', + 'ddownload_category', + 'ddownload_tag', + 'dealstore', + 'department', + 'departments', + 'department-company', + 'developed-by', + 'dfads_group', + 'dgfw_gift_categories', + 'director', + 'district', + 'dlm_download_category', + 'dlm_download_tag', + 'doc_tag', + 'document-category', + 'document-type', + 'download_artist', + 'download_category', + 'download_tag', + 'downloads_filter', + 'dps_book', + 'dt_gallery_category', + 'dt_logos_category', + 'dt_portfolio_category', + 'dt_team_category', + 'dt_testimonials_category', + 'dtcast', + 'dtcreator', + 'dtdirector', + 'dtnetworks', + 'dtstudio', + 'dtyear', + 'dvteamtaxonomy', + 'dwqa-question_category', + 'dwqa-question_tag', + 'eafl_category', + 'easy-testimonial-category', + 'ecwd_event_category', + 'edd_log_type', + 'edition', + 'ef_editorial_meta', + 'ef_usergroup', + 'element_category', + 'elementor_library_type', + 'employees_category', + 'encyclopedia-tag', + 'envira-tag', + 'epkb_post_type_1_category', + 'espresso_event_categories', + 'espresso_event_type', + 'essential_grid_category', + 'et_post_format', + 'faq-group', + 'faq-tags', + 'faq-topic', + 'faq_cat', + 'faq_categories', + 'faq_category', + 'faqs-category', + 'fdm-menu-section', + 'feature', + 'featured_item_category', + 'featured_item_tag', + 'feedback_type', + 'feeds', + 'fl-builder-template-type', + 'flamingo_inbound_channel', + 'follow_up_email_campaign', + 'follow_up_email_type', + 'following_users', + 'football-team-taxo', + 'fpd_design_category', + 'gallery-category', + 'gallery_cat', + 'gallery_categories', + 'gallery_category', + 'gallery_entries', + 'gallerycat', + 'gd_event_tags', + 'gd_eventcategory', + 'gd_place_tags', + 'gd_placecategory', + 'genre', + 'genres', + 'gg_connect_hub', + 'give_log_type', + 'gn-genre', + 'gn-location-1', + 'gn-location-2', + 'gn-location-3', + 'gp_hubs', + 'gp_portfolios', + 'gp_videos', + 'group', + 'group-documents-category', + 'groups', + 'hashtags', + 'hotel_facility', + 'ia_invited_groups', + 'ia_invitees', + 'incsub_wiki_category', + 'industry', + 'ingredient', + 'insight-type', + 'issue', + 'issuem_issue', + 'issuem_issue_tags', + 'jbp_category', + 'karma-slider-category', + 'klaviyo_shop_cart_status', + 'kwlogos-carousel', + 'layout_category', + 'layout_type', + 'ld_course_category', + 'ld_course_tag', + 'ld_lesson_category', + 'ld_lesson_tag', + 'ld_topic_tag', + 'lesson-tag', + 'level', + 'lingotek_hash', + 'lingotek_profile', + 'link_library_category', + 'linkage', + 'list-tags', + 'listing-category', + 'listing_amenities', + 'listing_category', + 'liveblog', + 'llms_access_plan_visibility', + 'llms_product_visibility', + 'localisation', + 'location', + 'location-tag', + 'locations', + 'magazine', + 'map_location_categories', + 'masonry_gallery_category', + 'mc-event-category', + 'mec_category', + 'mec_location', + 'mec_organizer', + 'media-category', + 'media-tags', + 'media_category', + 'media_folder', + 'member_cat', + 'mentions', + 'mesh_template_types', + 'ml-slider', + 'module', + 'module-tag', + 'module_width', + 'movie_cat', + 'mpp-component', + 'mpp-status', + 'mpp-type', + 'muvicast', + 'muvicountry', + 'muvidirector', + 'muviindex', + 'muviquality', + 'muviyear', + 'news-category', + 'news-tag', + 'news-type', + 'news_type_cat', + 'news_category', + 'nova_menu', + 'nova_menu_item_label', + 'offer-types', + 'organization', + 'our_team_category', + 'page_category', + 'parisrestaurant', + 'parissauna', + 'partner_category', + 'partners', + 'paswdestinatari', + 'paypal_ipn_type', + 'pdf_lv_tag', + 'pec_events_category', + 'people', + 'people-department', + 'people-expertise', + 'people-location', + 'perfect_quotes_category', + 'performer', + 'person', + 'personnal-category', + 'pexcontentslider_category', + 'pexfullslider_category', + 'pexnivoslider_category', + 'pexpricing_category', + 'pexservice_category', + 'pextestimonial_category', + 'pf_feed_item_tag', + 'pg_sas_type', + 'photo_tag', + 'phototype', + 'pj-categs', + 'pj-tags', + 'pl-categs', + 'placement', + 'plan_status', + 'platform', + 'player', + 'plugins_categories', + 'podcast', + 'pojo_sidebars', + 'popup_category', + 'pornstars', + 'portada', + 'portcat', + 'portfolio-category', + 'portfolio-gallery', + 'portfolio-status', + 'portfolio-skills', + 'portfolio-tag', + 'portfolio-tags', + 'portfolio-type', + 'portfolio-types', + 'portfolio_cat', + 'portfolio_categories', + 'portfolio_category', + 'portfolio_cats', + 'portfolio_client', + 'portfolio_entries', + 'portfolio_filter', + 'portfolio_in', + 'portfolio_label', + 'portfolio_skills', + 'portfolio_tag', + 'portfolio_tags', + 'portfolio_type', + 'posicao', + 'post-type', + 'post_format', + 'post_series', + 'pp_editorial_meta', + 'pp_notify_role', + 'pp_usergroup', + 'pricingcats', + 'print_section', + 'print_status', + 'product_asset_class', + 'product_name', + 'programs', + 'project-attributes', + 'project-cat', + 'project-category', + 'project-type', + 'project_category', + 'project_tag', + 'projects_category', + 'projects_tag', + 'prominence', + 'promotion-categories', + 'property-city', + 'property-feature', + 'property-status', + 'property-type', + 'property-types', + 'property_action_category', + 'property_area', + 'property_category', + 'property_city', + 'property_feature', + 'property_status', + 'property_type', + 'province', + 'provinces', + 'publisher', + 'pwb-brand', + 'qmn_log_type', + 'qualification', + 'qualifications', + 'quality', + 'question-category', + 'question-tag', + 'question-type', + 'question_cat', + 'question_category', + 'question_tag', + 'quiz', + 'quiz-type', + 'quote_status', + 'rating', + 'reaction', + 'recipe-category', + 'recipe_category', + 'recipe_type', + 'region', + 'registrant-event', + 'related_keywords', + 'release-date', + 'resource-type', + 'resource_category', + 'resource_type', + 'resourcetype', + 'review-type', + 'review_category', + 'rodzaj', + 'role', + 'room_category', + 'room_tag', + 'roomtype', + 'rubriek_categorie', + 'savedreply', + 'schools', + 'scope', + 'scores_cat', + 'sdm_categories', + 'sdm_tags', + 'season', + 'secondary_html_features', + 'section', + 'sector', + 'series', + 'series_of_posts', + 'services_group', + 'serving', + 'shop_cart_status', + 'shop_cat', + 'shop_order_status', + 'shop_vendor', + 'shop_warranty_status', + 'shopp_category', + 'shopr_category', + 'show', + 'simple_link_category', + 'site-review-category', + 'sizes', + 'skill', + 'skill_level', + 'skills', + 'sld_cat', + 'slide-page', + 'slide-types', + 'slide_categories', + 'slide_type', + 'slider', + 'slider-locations', + 'slider_category', + 'slides_category', + 'slideshow', + 'sm-category', + 'snax_format', + 'sngg_media_tags', + 'solution_channel', + 'source_domain', + 'source_id', + 'sp_league', + 'sp_position', + 'sp_role', + 'sp_season', + 'sp_venue', + 'speaker', + 'speakers', + 'special-feature', + 'specialty', + 'spnl_log_type', + 'sponsor_categories', + 'sponsor_category', + 'sponsor_type', + 'spot_tag', + 'st_af_category', + 'st_af_tags', + 'staff', + 'staff-member-category', + 'staff-member-group', + 'staff_category', + 'staffgroups', + 'state', + 'status', + 'store', + 'stores', + 'studio', + 'study_level', + 'style', + 'style_category', + 'sub_transaction_action', + 'sub_transaction_result', + 'subcategory', + 'subject', + 'subscription_status', + 'swift-slider-category', + 'syn_sitegroup', + 'szbl-content-tag', + 'task-queue', + 'tax_feature', + 'tcb_symbols_tax', + 'tcp_product_category', + 'team', + 'team-category', + 'team_cat', + 'team_categories', + 'team_category', + 'team_cats', + 'team_department', + 'team_designation', + 'team_group', + 'team_member_position', + 'team_mfcategory', + 'teams', + 'tenant_categories', + 'tenant_location', + 'tender-category', + 'test-type', + 'testimonial-category', + 'testimonial-group', + 'testimonial-types', + 'testimonial_categories', + 'testimonial_category', + 'testimonials-category', + 'testimonials_category', + 'th_events_cat', + 'th_galleries_cat', + 'thegem_clients_sets', + 'thegem_news_sets', + 'thegem_portfolios', + 'thegem_quickfinders', + 'thegem_teams', + 'thegem_testimonials_sets', + 'theme', + 'themefusion_es_groups', + 'themes_categories', + 'themo_cpt_group', + 'themo_project_type', + 'themo_room_type', + 'thirstylink-category', + 'ticket_channel', + 'ticket_priority', + 'timeline_post_tag', + 'tipo', + 'tipologie', + 'tips', + 'tm-testimonials_category', + 'tm_testimonial_group', + 'tooltips_categories', + 'tour_category', + 'tour_destination', + 'tour_facility', + 'tour_phys', + 'tour_type', + 'tp_event_category', + 'transmission', + 'treatment-type', + 'tribe_events_cat', + 'truethemes-gallery-category', + 'tsas-category', + 'tshowcase-categories', + 'tsml_region', + 'ttshowcase_groups', + 'tvo_tags', + 'type', + 'types', + 'u_course_cat', + 'u_department', + 'u_event_cat', + 'ufaq-category', + 'ufaq-tag', + 'um_hashtag', + 'um_user_tag', + 'uncodeblock_category', + 'upg_cate', + 'urp-review-category', + 'us_portfolio_category', + 'us_testimonial_category', + 'user-group', + 'user_category', + 'user_status', + 'vendor', + 'venue', + 'video-category', + 'video-series', + 'video-tag', + 'video_category', + 'video_tag', + 'videos', + 'videos_categories', + 'voice_category', + 'vtmin_rule_category', + 'vtprd_rule_category', + 'w2dc-category', + 'w2dc-location', + 'w2dc-tag', + 'wcb_sponsor_level', + 'wcb_track', + 'wccf_checkout_field_field_type', + 'wccf_checkout_field_status', + 'wccf_order_field_field_type', + 'wccf_order_field_status', + 'wccf_product_field_field_type', + 'wccf_product_field_status', + 'wccf_product_prop_field_type', + 'wccf_product_prop_status', + 'wccf_user_field_field_type', + 'wccf_user_field_status', + 'wcfm_knowledgebase_category', + 'wcm_task_category', + 'wcpv_product_vendors', + 'wcs-instructor', + 'wcs-room', + 'wcs-type', + 'wdca_ad_categories', + 'webinar_type_cat', + 'where', + 'who', + 'wiki-category', + 'wiki_cats', + 'wl_entity_type', + 'workout_entries', + 'works-category', + 'wp-rest-api-log-method', + 'wp-rest-api-log-source', + 'wp-rest-api-log-status', + 'wp-type-activity-types', + 'wp-type-contacts-subtype', + 'wp-type-group', + 'wp_bannerize_tax', + 'wp_log_type', + 'wp_super_faq_category', + 'wpbdm-region', + 'wpbdp_category', + 'wpbdp_tag', + 'wpcm_make_model', + 'wpdmcategory', + 'wpfb_file_category', + 'wpfcas-category', + 'wpfd-category', + 'wplead_list_category', + 'wplss_logo_showcase_cat', + 'wpm-testimonial-category', + 'wpmf-category', + 'wpostahs-slider-category', + 'wprm_course', + 'wprm_cuisine', + 'wprm_ingredient', + 'wprm_keyword', + 'wprss_category', + 'wps_forum', + 'wpsc-variation', + 'wpsc_log_type', + 'wpsc_product_category', + 'wpseo_locations_category', + 'wpsisac_slider-category', + 'wpsl_store_category', + 'wpt_category', + 'wpt_result', + 'wpt_scale', + 'wpv_sermons_category', + 'wpvqgr_tag', + 'writer', + 'wyz_business_category', + 'wyz_business_rating_category', + 'wyz_business_tag', + 'wzkb_category', + 'year', + 'years', + 'yith_product_brand', + 'yith_shop_vendor', + 'yst_prominent_words', + 'zipcode', + 'zoninator_zones', + 'zrf_field_group', + + // End The Backlog @see https://wp.me/p9MPsk-X0. + 'bill-status', + 'etb-audience', + 'etb-state', + 'etb-target', + 'etb-topic', + 'etb-year', + 'foia-response-status', + 'target-type', + 'timeline-pillar', + 'timeline-type', + + // wp.com martketplace search - @see https://wp.me/pdh6GB-Ax#comment-2104 + 'wpcom_marketplace_categories', + + ); // end taxonomies. + + /** + * List of options to sync + * + * @access private + * @static + * + * @var array + */ + private static $options_to_sync = array( + 'jetpack_search_ai_prompt_override', + 'jetpack_search_color_theme', + 'jetpack_search_result_format', + 'jetpack_search_default_sort', + 'jetpack_search_overlay_trigger', + 'jetpack_search_excluded_post_types', + 'jetpack_search_highlight_color', + 'jetpack_search_enable_sort', + 'jetpack_search_inf_scroll', + 'jetpack_search_show_powered_by', + 'instant_search_enabled', + ); // end options. + + /* + * Taxonomies we know don't sync. + * See also sync/src/class-defaults.php + * + * 'network' + * 'post_status' + * 'product_cat' + * 'tags' + * + */ + + // + // Hooks into sync. + + /** + * Add Search post meta to the post meta whitelist. + * + * @param array $list Existing post meta whitelist. + * @return array Updated post meta whitelist. + */ + public function add_search_post_meta_whitelist( $list ) { + return array_merge( $list, static::get_all_postmeta_keys() ); + } + + /** + * Add Search options to the options whitelist. + * + * @param array $list Existing options whitelist. + * @return array Updated options whitelist. + */ + public function add_search_options_whitelist( $list ) { + return array_merge( $list, static::get_all_option_keys() ); + } + + // + // Indexing functions for wp.com. + + /** + * + * Check whether a postmeta or taxonomy 'key' is in the indexable + * list. This is called by the indexing code on wp.com to decide + * whether to include something in the index. + * + * @static + * @access public + * + * @param string $type Either 'postmeta' or 'taxonomy'. + * @param string $key The postmeta key or taxonomy name. + * @return boolean + */ + public static function is_indexable( $type, $key ) { + switch ( $type ) { + case 'postmeta': + return isset( self::$postmeta_to_sync[ $key ] ); + case 'taxonomy': + return in_array( $key, self::$taxonomies_to_sync, true ); + } + return false; + } + + /** + * + * Get the indexing spec for a postmeta key. + * + * @static + * @access public + * + * @param string $key The postmeta key. + * @return array The spec. + */ + public static function get_postmeta_spec( $key ) { + return self::$postmeta_to_sync[ $key ]; + } + + /** + * Get all post meta keys that get synced. + * + * @access public + * + * @return array List of post meta keys that get synced. + */ + public static function get_all_postmeta_keys() { + return array_keys( self::$postmeta_to_sync ); + } + + /** + * Get all option keys that get synced. + * + * @access public + * + * @return array List of option keys that get synced. + */ + public static function get_all_option_keys() { + return self::$options_to_sync; + } + + /** + * Get all unindexed postmeta. + * This is mostly for testing. + * + * @access public + * + * @return array List of postmeta that are not synced. + */ + public static function get_all_unindexed_postmeta_keys() { + return array_keys( self::$unindexed_postmeta ); + } + + /** + * Get all taxonomies that get synced. + * This is mostly for testing. + * + * @access public + * + * @return array List of taxonomies that get synced. + */ + public static function get_all_taxonomies() { + return self::$taxonomies_to_sync; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php new file mode 100644 index 00000000..83479d1d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php @@ -0,0 +1,68 @@ + self::MAX_INT, + 'term_taxonomy_id' => self::MAX_INT, + ); + + while ( $limit > 0 ) { + /* + * SELECT object_id, term_taxonomy_id + * FROM $wpdb->term_relationships + * WHERE ( object_id = 11 AND term_taxonomy_id < 14 ) OR ( object_id < 11 ) + * ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT 1000 + */ + $objects = $wpdb->get_results( $wpdb->prepare( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT %d", $last_object_enqueued['object_id'], $last_object_enqueued['term_taxonomy_id'], $last_object_enqueued['object_id'], $limit ), ARRAY_A ); + // Request term relationships in groups of N for efficiency. + if ( ! is_countable( $objects ) || count( $objects ) === 0 ) { + return array( $items_enqueued_count, true ); + } + $objects_count = count( $objects ); + $items = array_chunk( $objects, $term_relationships_full_sync_item_size ); + $last_object_enqueued = $this->bulk_enqueue_full_sync_term_relationships( $items, $last_object_enqueued ); + $items_enqueued_count += count( $items ); + $limit = min( $limit - $objects_count, self::QUERY_LIMIT ); + } + + // We need to do this extra check in case $max_items_to_enqueue * $term_relationships_full_sync_item_size == relationships objects left. + $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT %d", $last_object_enqueued['object_id'], $last_object_enqueued['term_taxonomy_id'], $last_object_enqueued['object_id'], 1 ) ); + if ( 0 === (int) $count ) { + return array( $items_enqueued_count, true ); + } + + return array( $items_enqueued_count, $last_object_enqueued ); + } + + /** + * Return the initial last sent object. + * + * @return string|array initial status. + */ + public function get_initial_last_sent() { + return array( + 'object_id' => self::MAX_INT, + 'term_taxonomy_id' => self::MAX_INT, + ); + } + + /** + * Given the Module Full Sync Configuration and Status return the next chunk of items to send. + * + * @param array $config This module Full Sync configuration. + * @param array $status This module Full Sync status. + * @param int $chunk_size Chunk size. + * + * @return array|object|null + */ + public function get_next_chunk( $config, $status, $chunk_size ) { + global $wpdb; + + return $wpdb->get_results( + $wpdb->prepare( + "SELECT object_id, term_taxonomy_id + FROM $wpdb->term_relationships + WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) + ORDER BY object_id DESC, term_taxonomy_id + DESC LIMIT %d", + $status['last_sent']['object_id'], + $status['last_sent']['term_taxonomy_id'], + $status['last_sent']['object_id'], + $chunk_size + ), + ARRAY_A + ); + } + + /** + * Return last_item to send for Module Full Sync Configuration. + * + * @param array $config This module Full Sync configuration. + * + * @return array|object|null + */ + public function get_last_item( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + global $wpdb; + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + return $wpdb->get_results( + "SELECT object_id, term_taxonomy_id + FROM $wpdb->term_relationships + ORDER BY object_id , term_taxonomy_id + LIMIT 1", + ARRAY_A + ); + } + + /** + * + * Enqueue all $items within `jetpack_full_sync_term_relationships` actions. + * + * @param array $items Groups of objects to sync. + * @param array $previous_interval_end Last item enqueued. + * + * @return array Last enqueued object. + */ + public function bulk_enqueue_full_sync_term_relationships( $items, $previous_interval_end ) { + $listener = Listener::get_instance(); + $items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $items, $previous_interval_end ); + $listener->bulk_enqueue_full_sync_actions( 'jetpack_full_sync_term_relationships', $items_with_previous_interval_end ); + $last_item = end( $items ); + return end( $last_item ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + global $wpdb; + + $query = "SELECT COUNT(*) FROM $wpdb->term_relationships"; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + $count = (int) $wpdb->get_var( $query ); + + return (int) ceil( $count / Settings::get_setting( 'term_relationships_full_sync_item_size' ) ); + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_term_relationships' ); + } + + /** + * Expand the term relationships within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_term_relationships( $args ) { + list( $term_relationships, $previous_end ) = $args; + + return array( + 'term_relationships' => $term_relationships, + 'previous_end' => $previous_end, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php new file mode 100644 index 00000000..55c11be2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php @@ -0,0 +1,313 @@ +get_error_code() === 'invalid_taxonomy' ) { + // Fetch raw term. + $columns = implode( ', ', array_unique( array_merge( Defaults::$default_term_checksum_columns, array( 'term_group' ) ) ) ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $object = $wpdb->get_row( $wpdb->prepare( "SELECT $columns FROM $wpdb->terms WHERE term_id = %d", $id ) ); + } + } + + if ( 'term_taxonomy' === $object_type ) { + $columns = implode( ', ', array_unique( array_merge( Defaults::$default_term_taxonomy_checksum_columns, array( 'description' ) ) ) ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $object = $wpdb->get_row( $wpdb->prepare( "SELECT $columns FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $id ) ); + } + + if ( 'term_relationships' === $object_type ) { + $columns = implode( ', ', Defaults::$default_term_relationships_checksum_columns ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $objects = $wpdb->get_results( $wpdb->prepare( "SELECT $columns FROM $wpdb->term_relationships WHERE object_id = %d", $id ) ); + $object = (object) array( + 'object_id' => $id, + 'relationships' => array_map( array( $this, 'expand_terms_for_relationship' ), $objects ), + ); + } + + return $object ? $object : false; + } + + /** + * Initialize terms action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'created_term', array( $this, 'save_term_handler' ), 10, 3 ); + add_action( 'edited_term', array( $this, 'save_term_handler' ), 10, 3 ); + add_action( 'jetpack_sync_save_term', $callable ); + add_action( 'jetpack_sync_add_term', $callable ); + add_action( 'delete_term', $callable, 10, 4 ); + add_action( 'set_object_terms', $callable, 10, 6 ); + add_action( 'deleted_term_relationships', $callable, 10, 2 ); + add_filter( 'jetpack_sync_before_enqueue_set_object_terms', array( $this, 'filter_set_object_terms_no_update' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_save_term', array( $this, 'filter_blacklisted_taxonomies' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_add_term', array( $this, 'filter_blacklisted_taxonomies' ) ); + } + + /** + * Initialize terms action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_terms', $callable, 10, 2 ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_terms', array( $this, 'expand_term_taxonomy_id' ) ); + } + + /** + * Enqueue the terms actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_terms', $wpdb->term_taxonomy, 'term_taxonomy_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + $where_sql = Settings::get_blacklisted_taxonomies_sql(); + + if ( is_array( $config ) ) { + $where_sql .= ' AND term_taxonomy_id IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return $where_sql; + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->term_taxonomy"; + + $where_sql = $this->get_where_sql( $config ); + if ( $where_sql ) { + $query .= ' WHERE ' . $where_sql; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + $count = (int) $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_terms' ); + } + + /** + * Handler for creating and updating terms. + * + * @access public + * + * @param int $term_id Term ID. + * @param int $tt_id Term taxonomy ID. + * @param string $taxonomy Taxonomy slug. + */ + public function save_term_handler( $term_id, $tt_id, $taxonomy ) { + if ( class_exists( '\\WP_Term' ) ) { + $term_object = \WP_Term::get_instance( $term_id, $taxonomy ); + } else { + $term_object = get_term_by( 'id', $term_id, $taxonomy ); + } + + $current_filter = current_filter(); + + if ( 'created_term' === $current_filter ) { + /** + * Fires when the client needs to add a new term + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param object the Term object + */ + do_action( 'jetpack_sync_add_term', $term_object ); + return; + } + + /** + * Fires when the client needs to update a term + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param object the Term object + */ + do_action( 'jetpack_sync_save_term', $term_object ); + } + + /** + * Filter blacklisted taxonomies. + * + * @access public + * + * @param array $args Hook args. + * @return array|boolean False if not whitelisted, the original hook args otherwise. + */ + public function filter_blacklisted_taxonomies( $args ) { + $term = $args[0]; + + if ( in_array( $term->taxonomy, Settings::get_setting( 'taxonomies_blacklist' ), true ) ) { + return false; + } + + return $args; + } + + /** + * Filter out set_object_terms actions where the terms have not changed. + * + * @param array $args Hook args. + * @return array|boolean False if no change in terms, the original hook args otherwise. + */ + public function filter_set_object_terms_no_update( $args ) { + // There is potential for other plugins to modify args, therefore lets validate # of and types. + // $args[2] is $tt_ids, $args[5] is $old_tt_ids see wp-includes/taxonomy.php L2740. + if ( 6 === count( $args ) && is_array( $args[2] ) && is_array( $args[5] ) ) { + if ( empty( array_diff( $args[2], $args[5] ) ) && empty( array_diff( $args[5], $args[2] ) ) ) { + return false; + } + } + return $args; + } + + /** + * Expand the term taxonomy IDs to terms within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_term_taxonomy_id( $args ) { + list( $term_taxonomy_ids, $previous_end ) = $args; + + return array( + 'terms' => get_terms( + array( + 'hide_empty' => false, + 'term_taxonomy_id' => $term_taxonomy_ids, + 'orderby' => 'term_taxonomy_id', + 'order' => 'DESC', + ) + ), + 'previous_end' => $previous_end, + ); + } + + /** + * Gets a term object based on a given row from the term_relationships database table. + * + * @access public + * + * @param object $relationship A row object from the term_relationships table. + * @return object|bool A term object, or false if term taxonomy doesn't exist. + */ + public function expand_terms_for_relationship( $relationship ) { + return get_term_by( 'term_taxonomy_id', $relationship->term_taxonomy_id ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php new file mode 100644 index 00000000..01b5ebf9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php @@ -0,0 +1,874 @@ + $widget_object->name, + 'id' => $widget_object->id, + 'title' => isset( $new_instance['title'] ) ? $new_instance['title'] : '', + ); + /** + * Trigger action to alert $callable sync listener that a widget was edited. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $widget_name , Name of edited widget + */ + do_action( 'jetpack_widget_edited', $widget ); + + return $instance; + } + + /** + * Sync handler for network allowed themes change. + * + * @access public + * + * @param string $option Name of the network option. + * @param mixed $value Current value of the network option. + * @param mixed $old_value Old value of the network option. + * @param int $network_id ID of the network. + */ + public function sync_network_allowed_themes_change( $option, $value, $old_value, $network_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $all_enabled_theme_slugs = array_keys( $value ); + $old_value_count = is_countable( $old_value ) ? count( $old_value ) : 0; + $value_count = is_countable( $value ) ? count( $value ) : 0; + + if ( $old_value_count > $value_count ) { + // Suppress jetpack_network_disabled_themes sync action when theme is deleted. + $delete_theme_call = $this->get_delete_theme_call(); + if ( ! empty( $delete_theme_call ) ) { + return; + } + + $newly_disabled_theme_names = array_keys( array_diff_key( $old_value, $value ) ); + $newly_disabled_themes = $this->get_theme_details_for_slugs( $newly_disabled_theme_names ); + /** + * Trigger action to alert $callable sync listener that network themes were disabled. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param mixed $newly_disabled_themes, Array of info about network disabled themes + * @param mixed $all_enabled_theme_slugs, Array of slugs of all enabled themes + */ + do_action( 'jetpack_network_disabled_themes', $newly_disabled_themes, $all_enabled_theme_slugs ); + return; + } + + $newly_enabled_theme_names = array_keys( array_diff_key( $value, $old_value ) ); + $newly_enabled_themes = $this->get_theme_details_for_slugs( $newly_enabled_theme_names ); + /** + * Trigger action to alert $callable sync listener that network themes were enabled + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param mixed $newly_enabled_themes , Array of info about network enabled themes + * @param mixed $all_enabled_theme_slugs, Array of slugs of all enabled themes + */ + do_action( 'jetpack_network_enabled_themes', $newly_enabled_themes, $all_enabled_theme_slugs ); + } + + /** + * Retrieve details for one or more themes by their slugs. + * + * @access private + * + * @param array $theme_slugs Theme slugs. + * @return array Details for the themes. + */ + private function get_theme_details_for_slugs( $theme_slugs ) { + $theme_data = array(); + foreach ( $theme_slugs as $slug ) { + $theme = wp_get_theme( $slug ); + $theme_data[ $slug ] = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + 'slug' => $slug, + ); + } + return $theme_data; + } + + /** + * Detect a theme edit during a redirect. + * + * @access public + * + * @param string $redirect_url Redirect URL. + * @return string Redirect URL. + */ + public function detect_theme_edit( $redirect_url ) { + $url = wp_parse_url( admin_url( $redirect_url ) ); + $theme_editor_url = wp_parse_url( admin_url( 'theme-editor.php' ) ); + + if ( $theme_editor_url['path'] !== $url['path'] ) { + return $redirect_url; + } + + $query_params = array(); + wp_parse_str( $url['query'], $query_params ); + if ( + ! isset( $_POST['newcontent'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Missing -- 'wp_redirect' gets fired for a lot of things. We're only using $_POST['newcontent'] to limit action to redirects from theme edits, we're not doing anything with or in response to the post itself. + ! isset( $query_params['file'] ) || + ! isset( $query_params['theme'] ) || + ! isset( $query_params['updated'] ) + ) { + return $redirect_url; + } + $theme = wp_get_theme( $query_params['theme'] ); + $theme_data = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + ); + + /** + * Trigger action to alert $callable sync listener that a theme was edited. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $query_params['theme'], Slug of edited theme + * @param string $theme_data, Information about edited them + */ + do_action( 'jetpack_edited_theme', $query_params['theme'], $theme_data ); + + return $redirect_url; + } + + /** + * Handler for AJAX theme editing. + * + * @todo Refactor to use WP_Filesystem instead of fopen()/fclose(). + */ + public function theme_edit_ajax() { + // This validation is based on wp_edit_theme_plugin_file(). + if ( empty( $_POST['theme'] ) ) { + return; + } + + if ( empty( $_POST['file'] ) ) { + return; + } + $file = wp_unslash( $_POST['file'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated manually just after. + if ( 0 !== validate_file( $file ) ) { + return; + } + + if ( ! isset( $_POST['newcontent'] ) ) { + return; + } + + if ( ! isset( $_POST['nonce'] ) ) { + return; + } + + $stylesheet = wp_unslash( $_POST['theme'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated manually just after. + if ( 0 !== validate_file( $stylesheet ) ) { + return; + } + + if ( ! current_user_can( 'edit_themes' ) ) { + return; + } + + $theme = wp_get_theme( $stylesheet ); + if ( ! $theme->exists() ) { + return; + } + + if ( ! wp_verify_nonce( $_POST['nonce'], 'edit-theme_' . $stylesheet . '_' . $file ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WP core doesn't pre-sanitize nonces either. + return; + } + + if ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_code() ) { + return; + } + + $editable_extensions = wp_get_theme_file_editable_extensions( $theme ); + + $allowed_files = array(); + foreach ( $editable_extensions as $type ) { + switch ( $type ) { + case 'php': + $allowed_files = array_merge( $allowed_files, $theme->get_files( 'php', -1 ) ); + break; + case 'css': + $style_files = $theme->get_files( 'css', -1 ); + $allowed_files['style.css'] = $style_files['style.css']; + $allowed_files = array_merge( $allowed_files, $style_files ); + break; + default: + $allowed_files = array_merge( $allowed_files, $theme->get_files( $type, -1 ) ); + break; + } + } + + $real_file = $theme->get_stylesheet_directory() . '/' . $file; + if ( 0 !== validate_file( $real_file, $allowed_files ) ) { + return; + } + + // Ensure file is real. + if ( ! is_file( $real_file ) ) { + return; + } + + // Ensure file extension is allowed. + $extension = null; + if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) { + $extension = strtolower( $matches[1] ); + if ( ! in_array( $extension, $editable_extensions, true ) ) { + return; + } + } + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_is_writable + if ( ! is_writable( $real_file ) ) { + return; + } + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen + $file_pointer = fopen( $real_file, 'w+' ); + if ( false === $file_pointer ) { + return; + } + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose + fclose( $file_pointer ); + + $theme_data = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + ); + + /** + * This action is documented already in this file. + */ + do_action( 'jetpack_edited_theme', $stylesheet, $theme_data ); + } + + /** + * Detect a theme deletion. + * + * @access public + * + * @param string $stylesheet Stylesheet of the theme to delete. + * @param bool $deleted Whether the theme deletion was successful. + */ + public function detect_theme_deletion( $stylesheet, $deleted ) { + $theme = wp_get_theme( $stylesheet ); + $theme_data = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + 'slug' => $stylesheet, + ); + + if ( $deleted ) { + /** + * Signals to the sync listener that a theme was deleted and a sync action + * reflecting the deletion and theme slug should be sent + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $stylesheet Theme slug + * @param array $theme_data Theme info Since 5.3 + */ + do_action( 'jetpack_deleted_theme', $stylesheet, $theme_data ); + } + } + + /** + * Handle an upgrader completion action. + * + * @access public + * + * @param \WP_Upgrader $upgrader The upgrader instance. + * @param array $details Array of bulk item update data. + */ + public function check_upgrader( $upgrader, $details ) { + if ( ! isset( $details['type'] ) || + 'theme' !== $details['type'] || + is_wp_error( $upgrader->skin->result ) || + ! method_exists( $upgrader, 'theme_info' ) + ) { + return; + } + + if ( 'install' === $details['action'] ) { + // @phan-suppress-next-line PhanUndeclaredMethod -- Checked above. See also https://github.com/phan/phan/issues/1204. + $theme = $upgrader->theme_info(); + if ( ! $theme instanceof \WP_Theme ) { + return; + } + $theme_info = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + ); + + /** + * Signals to the sync listener that a theme was installed and a sync action + * reflecting the installation and the theme info should be sent + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $theme->theme_root Text domain of the theme + * @param mixed $theme_info Array of abbreviated theme info + */ + do_action( 'jetpack_installed_theme', $theme->stylesheet, $theme_info ); + } + + if ( 'update' === $details['action'] ) { + $themes = array(); + + if ( empty( $details['themes'] ) && isset( $details['theme'] ) ) { + $details['themes'] = array( $details['theme'] ); + } + + foreach ( $details['themes'] as $theme_slug ) { + $theme = wp_get_theme( $theme_slug ); + + if ( ! $theme instanceof \WP_Theme ) { + continue; + } + + $themes[ $theme_slug ] = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + 'stylesheet' => $theme->stylesheet, + ); + } + + if ( empty( $themes ) ) { + return; + } + + /** + * Signals to the sync listener that one or more themes was updated and a sync action + * reflecting the update and the theme info should be sent + * + * @since 1.6.3 + * @since-jetpack 6.2.0 + * + * @param mixed $themes Array of abbreviated theme info + */ + do_action( 'jetpack_updated_themes', $themes ); + } + } + + /** + * Initialize themes action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_theme_data', $callable ); + } + + /** + * Handle a theme switch. + * + * @access public + * + * @param string $new_name Name of the new theme. + * @param \WP_Theme $new_theme The new theme. + * @param \WP_Theme $old_theme The previous theme. + */ + public function sync_theme_support( $new_name, $new_theme = null, $old_theme = null ) { + $previous_theme = $this->get_theme_info( $old_theme ); + + /** + * Fires when the client needs to sync theme support info + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array the theme support array + * @param array the previous theme since Jetpack 6.5.0 + */ + do_action( 'jetpack_sync_current_theme_support', $this->get_theme_info(), $previous_theme ); + } + + /** + * Enqueue the themes actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all theme data to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand theme data (should always be true) + */ + do_action( 'jetpack_full_sync_theme_data', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the themes actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_theme_data', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_theme_data', array( $this, 'expand_theme_data' ) ); + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_theme_data' ); + } + + /** + * Expand the theme within a hook before it is serialized and sent to the server. + * + * @access public + * + * @return array Theme data. + */ + public function expand_theme_data() { + return array( $this->get_theme_info() ); + } + + /** + * Retrieve the name of the widget by the widget ID. + * + * @access public + * @global $wp_registered_widgets + * + * @param string $widget_id Widget ID. + * @return string Name of the widget, or null if not found. + */ + public function get_widget_name( $widget_id ) { + global $wp_registered_widgets; + return ( isset( $wp_registered_widgets[ $widget_id ] ) ? $wp_registered_widgets[ $widget_id ]['name'] : null ); + } + + /** + * Retrieve the name of the sidebar by the sidebar ID. + * + * @access public + * @global $wp_registered_sidebars + * + * @param string $sidebar_id Sidebar ID. + * @return string Name of the sidebar, or null if not found. + */ + public function get_sidebar_name( $sidebar_id ) { + global $wp_registered_sidebars; + return ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ? $wp_registered_sidebars[ $sidebar_id ]['name'] : null ); + } + + /** + * Sync addition of widgets to a sidebar. + * + * @access public + * + * @param array $new_widgets New widgets. + * @param array $old_widgets Old widgets. + * @param string $sidebar Sidebar ID. + * @return array All widgets that have been moved to the sidebar. + */ + public function sync_add_widgets_to_sidebar( $new_widgets, $old_widgets, $sidebar ) { + $added_widgets = array_diff( $new_widgets, $old_widgets ); + if ( empty( $added_widgets ) ) { + return array(); + } + $moved_to_sidebar = array(); + $sidebar_name = $this->get_sidebar_name( $sidebar ); + + // Don't sync jetpack_widget_added if theme was switched. + if ( $this->is_theme_switch() ) { + return array(); + } + + foreach ( $added_widgets as $added_widget ) { + $moved_to_sidebar[] = $added_widget; + $added_widget_name = $this->get_widget_name( $added_widget ); + /** + * Helps Sync log that a widget got added + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $sidebar, Sidebar id got changed + * @param string $added_widget, Widget id got added + * @param string $sidebar_name, Sidebar id got changed Since 5.0.0 + * @param string $added_widget_name, Widget id got added Since 5.0.0 + */ + do_action( 'jetpack_widget_added', $sidebar, $added_widget, $sidebar_name, $added_widget_name ); + } + return $moved_to_sidebar; + } + + /** + * Sync removal of widgets from a sidebar. + * + * @access public + * + * @param array $new_widgets New widgets. + * @param array $old_widgets Old widgets. + * @param string $sidebar Sidebar ID. + * @param array $inactive_widgets Current inactive widgets. + * @return array All widgets that have been moved to inactive. + */ + public function sync_remove_widgets_from_sidebar( $new_widgets, $old_widgets, $sidebar, $inactive_widgets ) { + $removed_widgets = array_diff( $old_widgets, $new_widgets ); + + if ( empty( $removed_widgets ) ) { + return array(); + } + + $moved_to_inactive = array(); + $sidebar_name = $this->get_sidebar_name( $sidebar ); + + foreach ( $removed_widgets as $removed_widget ) { + // Lets check if we didn't move the widget to in_active_widgets. + if ( isset( $inactive_widgets ) && ! in_array( $removed_widget, $inactive_widgets, true ) ) { + $removed_widget_name = $this->get_widget_name( $removed_widget ); + /** + * Helps Sync log that a widgte got removed + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $sidebar, Sidebar id got changed + * @param string $removed_widget, Widget id got removed + * @param string $sidebar_name, Name of the sidebar that changed Since 5.0.0 + * @param string $removed_widget_name, Name of the widget that got removed Since 5.0.0 + */ + do_action( 'jetpack_widget_removed', $sidebar, $removed_widget, $sidebar_name, $removed_widget_name ); + } else { + $moved_to_inactive[] = $removed_widget; + } + } + return $moved_to_inactive; + } + + /** + * Sync a reorder of widgets within a sidebar. + * + * @access public + * + * @todo Refactor serialize() to a json_encode(). + * + * @param array $new_widgets New widgets. + * @param array $old_widgets Old widgets. + * @param string $sidebar Sidebar ID. + */ + public function sync_widgets_reordered( $new_widgets, $old_widgets, $sidebar ) { + $added_widgets = array_diff( $new_widgets, $old_widgets ); + if ( ! empty( $added_widgets ) ) { + return; + } + $removed_widgets = array_diff( $old_widgets, $new_widgets ); + if ( ! empty( $removed_widgets ) ) { + return; + } + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + if ( serialize( $old_widgets ) !== serialize( $new_widgets ) ) { + $sidebar_name = $this->get_sidebar_name( $sidebar ); + /** + * Helps Sync log that a sidebar id got reordered + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $sidebar, Sidebar id got changed + * @param string $sidebar_name, Name of the sidebar that changed Since 5.0.0 + */ + do_action( 'jetpack_widget_reordered', $sidebar, $sidebar_name ); + } + } + + /** + * Handle the update of the sidebars and widgets mapping option. + * + * @access public + * + * @param mixed $old_value The old option value. + * @param mixed $new_value The new option value. + */ + public function sync_sidebar_widgets_actions( $old_value, $new_value ) { + // Don't really know how to deal with different array_values yet. + if ( + ( isset( $old_value['array_version'] ) && 3 !== $old_value['array_version'] ) || + ( isset( $new_value['array_version'] ) && 3 !== $new_value['array_version'] ) + ) { + return; + } + + $moved_to_inactive_ids = array(); + $moved_to_sidebar = array(); + + foreach ( $new_value as $sidebar => $new_widgets ) { + if ( in_array( $sidebar, array( 'array_version', 'wp_inactive_widgets' ), true ) ) { + continue; + } + $old_widgets = isset( $old_value[ $sidebar ] ) + ? $old_value[ $sidebar ] + : array(); + + if ( ! is_array( $new_widgets ) ) { + $new_widgets = array(); + } + + $moved_to_inactive_recently = $this->sync_remove_widgets_from_sidebar( $new_widgets, $old_widgets, $sidebar, $new_value['wp_inactive_widgets'] ); + $moved_to_inactive_ids = array_merge( $moved_to_inactive_ids, $moved_to_inactive_recently ); + + $moved_to_sidebar_recently = $this->sync_add_widgets_to_sidebar( $new_widgets, $old_widgets, $sidebar ); + $moved_to_sidebar = array_merge( $moved_to_sidebar, $moved_to_sidebar_recently ); + + $this->sync_widgets_reordered( $new_widgets, $old_widgets, $sidebar ); + + } + + // Don't sync either jetpack_widget_moved_to_inactive or jetpack_cleared_inactive_widgets if theme was switched. + if ( $this->is_theme_switch() ) { + return; + } + + // Treat inactive sidebar a bit differently. + if ( ! empty( $moved_to_inactive_ids ) ) { + $moved_to_inactive_name = array_map( array( $this, 'get_widget_name' ), $moved_to_inactive_ids ); + /** + * Helps Sync log that a widgets IDs got moved to in active + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param array $moved_to_inactive_ids, Array of widgets id that moved to inactive id got changed + * @param array $moved_to_inactive_names, Array of widgets names that moved to inactive id got changed Since 5.0.0 + */ + do_action( 'jetpack_widget_moved_to_inactive', $moved_to_inactive_ids, $moved_to_inactive_name ); + } elseif ( empty( $moved_to_sidebar ) && empty( $new_value['wp_inactive_widgets'] ) && ! empty( $old_value['wp_inactive_widgets'] ) ) { + /** + * Helps Sync log that a got cleared from inactive. + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + */ + do_action( 'jetpack_cleared_inactive_widgets' ); + } + } + + /** + * Retrieve the theme data for the current or a specific theme. + * + * @access private + * + * @param \WP_Theme $theme Theme object. Optional, will default to the current theme. + * + * @return array Theme data. + */ + private function get_theme_info( $theme = null ) { + $theme_support = array(); + + // We are trying to get the current theme info. + if ( null === $theme ) { + $theme = wp_get_theme(); + } + + $theme_support['name'] = $theme->get( 'Name' ); + $theme_support['version'] = $theme->get( 'Version' ); + $theme_support['slug'] = $theme->get_stylesheet(); + $theme_support['uri'] = $theme->get( 'ThemeURI' ); + + return $theme_support; + } + + /** + * Whether we've deleted a theme in the current request. + * + * @access private + * + * @return boolean True if this is a theme deletion request, false otherwise. + */ + private function get_delete_theme_call() { + // Intentional usage of `debug_backtrace()` for production needs. + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + $backtrace = debug_backtrace(); + $delete_theme_call = null; + foreach ( $backtrace as $call ) { + if ( isset( $call['function'] ) && 'delete_theme' === $call['function'] ) { + $delete_theme_call = $call; + break; + } + } + return $delete_theme_call; + } + + /** + * Whether we've switched to another theme in the current request. + * + * @access private + * + * @return boolean True if this is a theme switch request, false otherwise. + */ + private function is_theme_switch() { + return did_action( 'after_switch_theme' ); + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve a set of constants by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + if ( 'theme-info' !== $object_type ) { + return array(); + } + + return array( $this->get_theme_info() ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php new file mode 100644 index 00000000..570e24a4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php @@ -0,0 +1,589 @@ +updates = array(); + } + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'updates'; + } + + /** + * Initialize updates action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + global $wp_version; + $this->old_wp_version = $wp_version; + add_action( 'set_site_transient_update_plugins', array( $this, 'validate_update_change' ), 10, 3 ); + add_action( 'set_site_transient_update_themes', array( $this, 'validate_update_change' ), 10, 3 ); + add_action( 'set_site_transient_update_core', array( $this, 'validate_update_change' ), 10, 3 ); + + add_action( 'jetpack_update_plugins_change', $callable ); + add_action( 'jetpack_update_themes_change', $callable ); + add_action( 'jetpack_update_core_change', $callable ); + + add_filter( + 'jetpack_sync_before_enqueue_jetpack_update_themes_change', + array( + $this, + 'expand_themes', + ) + ); + + add_filter( + 'jetpack_sync_before_enqueue_jetpack_update_plugins_change', + array( + $this, + 'filter_update_keys', + ), + 10, + 2 + ); + add_filter( + 'jetpack_sync_before_enqueue_upgrader_process_complete', + array( + $this, + 'filter_upgrader_process_complete', + ), + 10, + 2 + ); + + add_action( 'automatic_updates_complete', $callable ); + + if ( is_multisite() ) { + add_filter( 'pre_update_site_option_wpmu_upgrade_site', array( $this, 'update_core_network_event' ), 10, 2 ); + add_action( 'jetpack_sync_core_update_network', $callable, 10, 3 ); + } + + // Send data when update completes. + add_action( '_core_updated_successfully', array( $this, 'update_core' ) ); + add_action( 'jetpack_sync_core_reinstalled_successfully', $callable ); + add_action( 'jetpack_sync_core_autoupdated_successfully', $callable, 10, 2 ); + add_action( 'jetpack_sync_core_updated_successfully', $callable, 10, 2 ); + } + + /** + * Initialize updates action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_updates', $callable ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_updates', array( $this, 'expand_updates' ) ); + } + + /** + * Handle a core network update. + * + * @access public + * + * @param int $wp_db_version Current version of the WordPress database. + * @param int $old_wp_db_version Old version of the WordPress database. + * @return int Current version of the WordPress database. + */ + public function update_core_network_event( $wp_db_version, $old_wp_db_version ) { + global $wp_version; + /** + * Sync event for when core wp network updates to a new db version + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param int $wp_db_version the latest wp_db_version + * @param int $old_wp_db_version previous wp_db_version + * @param string $wp_version the latest wp_version + */ + do_action( 'jetpack_sync_core_update_network', $wp_db_version, $old_wp_db_version, $wp_version ); + return $wp_db_version; + } + + /** + * Handle a core update. + * + * @access public + * + * @todo Implement nonce or refactor to use `admin_post_{$action}` hooks instead. + * + * @param string $new_wp_version The new WP core version. + */ + public function update_core( $new_wp_version ) { + global $pagenow; + + // // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( isset( $_GET['action'] ) && 'do-core-reinstall' === $_GET['action'] ) { + /** + * Sync event that fires when core reinstall was successful + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $new_wp_version the updated WordPress version + */ + do_action( 'jetpack_sync_core_reinstalled_successfully', $new_wp_version ); + return; + } + + // Core was autoupdated. + if ( + 'update-core.php' !== $pagenow && + ! Jetpack_Constants::is_true( 'REST_API_REQUEST' ) // WP.com rest api calls should never be marked as a core autoupdate. + ) { + /** + * Sync event that fires when core autoupdate was successful + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $new_wp_version the updated WordPress version + * @param string $old_wp_version the previous WordPress version + */ + do_action( 'jetpack_sync_core_autoupdated_successfully', $new_wp_version, $this->old_wp_version ); + return; + } + /** + * Sync event that fires when core update was successful + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $new_wp_version the updated WordPress version + * @param string $old_wp_version the previous WordPress version + */ + do_action( 'jetpack_sync_core_updated_successfully', $new_wp_version, $this->old_wp_version ); + } + + /** + * Retrieve the checksum for an update. + * + * @access public + * + * @param object $update The update object. + * @param string $transient The transient we're retrieving a checksum for. + * @return int The checksum. + */ + public function get_update_checksum( $update, $transient ) { + $updates = array(); + $no_updated = array(); + switch ( $transient ) { + case 'update_plugins': + if ( ! empty( $update->response ) && is_array( $update->response ) ) { + foreach ( $update->response as $plugin_slug => $response ) { + if ( ! empty( $plugin_slug ) && isset( $response->new_version ) ) { + $updates[] = array( $plugin_slug => $response->new_version ); + } + } + } + if ( ! empty( $update->no_update ) ) { + $no_updated = array_keys( $update->no_update ); + } + + if ( ! isset( $no_updated['jetpack/jetpack.php'] ) && isset( $updates['jetpack/jetpack.php'] ) ) { + return false; + } + + break; + case 'update_themes': + if ( ! empty( $update->response ) && is_array( $update->response ) ) { + foreach ( $update->response as $theme_slug => $response ) { + if ( ! empty( $theme_slug ) && isset( $response['new_version'] ) ) { + $updates[] = array( $theme_slug => $response['new_version'] ); + } + } + } + + if ( ! empty( $update->checked ) ) { + $no_updated = $update->checked; + } + + break; + case 'update_core': + if ( ! empty( $update->updates ) && is_array( $update->updates ) ) { + foreach ( $update->updates as $response ) { + if ( ! empty( $response->response ) && 'latest' === $response->response ) { + continue; + } + if ( ! empty( $response->response ) && isset( $response->packages->full ) ) { + $updates[] = array( $response->response => $response->packages->full ); + } + } + } + + if ( ! empty( $update->version_checked ) ) { + $no_updated = $update->version_checked; + } + + if ( empty( $updates ) ) { + return false; + } + break; + + } + if ( empty( $updates ) && empty( $no_updated ) ) { + return false; + } + return $this->get_check_sum( array( $no_updated, $updates ) ); + } + + /** + * Validate a change coming from an update before sending for sync. + * + * @access public + * + * @param mixed $value Site transient value. + * @param int $expiration Time until transient expiration in seconds. + * @param string $transient Transient name. + */ + public function validate_update_change( $value, $expiration, $transient ) { + $new_checksum = $this->get_update_checksum( $value, $transient ); + + if ( false === $new_checksum ) { + return; + } + + $checksums = get_option( self::UPDATES_CHECKSUM_OPTION_NAME, array() ); + + if ( isset( $checksums[ $transient ] ) && $checksums[ $transient ] === $new_checksum ) { + return; + } + + $checksums[ $transient ] = $new_checksum; + + update_option( self::UPDATES_CHECKSUM_OPTION_NAME, $checksums ); + if ( 'update_core' === $transient ) { + /** + * Trigger a change to core update that we want to sync. + * + * @since 1.6.3 + * @since-jetpack 5.1.0 + * + * @param array $value Contains info that tells us what needs updating. + */ + do_action( 'jetpack_update_core_change', $value ); + return; + } + if ( empty( $this->updates ) ) { + // Lets add the shutdown method once and only when the updates move from empty to filled with something. + add_action( 'shutdown', array( $this, 'sync_last_event' ), 9 ); + } + if ( ! isset( $this->updates[ $transient ] ) ) { + $this->updates[ $transient ] = array(); + } + $this->updates[ $transient ][] = $value; + } + + /** + * Sync the last update only. + * + * @access public + */ + public function sync_last_event() { + foreach ( $this->updates as $transient => $values ) { + $value = end( $values ); // Only send over the last value. + /** + * Trigger a change to a specific update that we want to sync. + * Triggers one of the following actions: + * - jetpack_{$transient}_change + * - jetpack_update_plugins_change + * - jetpack_update_themes_change + * + * @since 1.6.3 + * @since-jetpack 5.1.0 + * + * @param array $value Contains info that tells us what needs updating. + */ + do_action( "jetpack_{$transient}_change", $value ); + } + } + + /** + * Enqueue the updates actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all updates to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand updates (should always be true) + */ + do_action( 'jetpack_full_sync_updates', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the updates actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_updates', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_updates' ); + } + + /** + * Retrieve all updates that we're interested in. + * + * @access public + * + * @return array All updates. + */ + public function get_all_updates() { + return array( + 'core' => get_site_transient( 'update_core' ), + 'plugins' => get_site_transient( 'update_plugins' ), + 'themes' => get_site_transient( 'update_themes' ), + ); + } + + /** + * Remove unnecessary keys from synced updates data. + * + * @access public + * + * @param array $args Hook arguments. + * @return array $args Hook arguments. + */ + public function filter_update_keys( $args ) { + $updates = $args[0]; + + if ( isset( $updates->no_update ) ) { + unset( $updates->no_update ); + } + + return $args; + } + + /** + * Filter out upgrader object from the completed upgrader action args. + * + * @access public + * + * @param array $args Hook arguments. + * @return array $args Filtered hook arguments. + */ + public function filter_upgrader_process_complete( $args ) { + array_shift( $args ); + + return $args; + } + + /** + * Expand the updates within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_updates( $args ) { + if ( $args[0] ) { + return $this->get_all_updates(); + } + + return $args; + } + + /** + * Expand the themes within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_themes( $args ) { + if ( ! isset( $args[0]->response ) ) { + return $args; + } + if ( ! is_array( $args[0]->response ) ) { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + trigger_error( 'Warning: Not an Array as expected but -> ' . wp_json_encode( $args[0]->response ) . ' instead', E_USER_WARNING ); + return $args; + } + foreach ( $args[0]->response as $stylesheet => &$theme_data ) { + $theme = wp_get_theme( $stylesheet ); + $theme_data['name'] = $theme->name; + } + return $args; + } + + /** + * Perform module cleanup. + * Deletes any transients and options that this module uses. + * Usually triggered when uninstalling the plugin. + * + * @access public + */ + public function reset_data() { + delete_option( self::UPDATES_CHECKSUM_OPTION_NAME ); + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 3; + } + + /** + * Retrieve a set of updates by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'update' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + if ( 'all' === $id ) { + // If all was requested it contains all updates and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + + return $objects; + } + + /** + * Retrieve a update by its id. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Update. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'update' === $object_type ) { + + // Only whitelisted constants can be returned. + if ( in_array( $id, array( 'core', 'plugins', 'themes' ), true ) ) { + return get_site_transient( 'update_' . $id ); + } elseif ( 'all' === $id ) { + return $this->get_all_updates(); + } + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php new file mode 100644 index 00000000..a85510b7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php @@ -0,0 +1,934 @@ + 'password_changed', + 'user_email' => 'email_changed', + 'user_nicename' => 'nicename_changed', + 'user_url' => 'url_changed', + 'user_registered' => 'registration_date_changed', + 'user_activation_key' => 'activation_key_changed', + 'display_name' => 'display_name_changed', + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'users'; + } + + /** + * The table in the database. + * + * @access public + * + * @return string + */ + public function table_name() { + return 'usermeta'; + } + + /** + * The id field in the database. + * + * @access public + * + * @return string + */ + public function id_field() { + return 'user_id'; + } + + /** + * Retrieve a user by its ID. + * This is here to support the backfill API. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param int $id ID of the sync object. + * @return \WP_User|bool Filtered \WP_User object, or false if the object is not a user. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'user' === $object_type ) { + $user = get_user_by( 'id', (int) $id ); + if ( $user ) { + return $this->sanitize_user_and_expand( $user ); + } + } + + return false; + } + + /** + * Initialize users action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + // Users. + add_action( 'user_register', array( $this, 'user_register_handler' ) ); + add_action( 'profile_update', array( $this, 'save_user_handler' ), 10, 2 ); + + add_action( 'add_user_to_blog', array( $this, 'add_user_to_blog_handler' ) ); + add_action( 'jetpack_sync_add_user', $callable, 10, 2 ); + + add_action( 'jetpack_sync_register_user', $callable, 10, 2 ); + add_action( 'jetpack_sync_save_user', $callable, 10, 2 ); + + add_action( 'jetpack_sync_user_locale', $callable, 10, 2 ); + add_action( 'jetpack_sync_user_locale_delete', $callable, 10, 1 ); + + add_action( 'deleted_user', array( $this, 'deleted_user_handler' ), 10, 2 ); + add_action( 'jetpack_deleted_user', $callable, 10, 3 ); + add_action( 'remove_user_from_blog', array( $this, 'remove_user_from_blog_handler' ), 10, 2 ); + add_action( 'jetpack_removed_user_from_blog', $callable, 10, 2 ); + + // User roles. + add_action( 'add_user_role', array( $this, 'add_user_role_handler' ), 10, 2 ); + add_action( 'set_user_role', array( $this, 'save_user_role_handler' ), 10, 3 ); + add_action( 'remove_user_role', array( $this, 'remove_user_role_handler' ), 10, 2 ); + + // User capabilities. + add_action( 'added_user_meta', array( $this, 'maybe_save_user_meta' ), 10, 4 ); + add_action( 'updated_user_meta', array( $this, 'maybe_save_user_meta' ), 10, 4 ); + add_action( 'deleted_user_meta', array( $this, 'maybe_save_user_meta' ), 10, 4 ); + + // User authentication. + add_filter( 'authenticate', array( $this, 'authenticate_handler' ), 1000, 3 ); + add_action( 'wp_login', array( $this, 'wp_login_handler' ), 10, 2 ); + + add_action( 'jetpack_wp_login', $callable, 10, 3 ); + + add_action( 'wp_logout', $callable, 10, 1 ); + add_action( 'wp_masterbar_logout', $callable, 10, 1 ); + + // Add on init. + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_add_user', array( $this, 'expand_action' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_register_user', array( $this, 'expand_action' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_save_user', array( $this, 'expand_action' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_wp_login', array( $this, 'expand_login_username' ), 10, 1 ); + add_filter( 'jetpack_sync_before_enqueue_wp_logout', array( $this, 'expand_logout_username' ), 10, 1 ); + } + + /** + * Initialize users action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_users', $callable ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_users', array( $this, 'expand_users' ) ); + } + + /** + * Retrieve a user by a user ID or object. + * + * @access private + * + * @param mixed $user User object or ID. + * @return \WP_User|null User object, or `null` if user invalid/not found. + */ + private function get_user( $user ) { + if ( is_numeric( $user ) ) { + $user = get_user_by( 'id', $user ); + } + if ( $user instanceof \WP_User ) { + return $user; + } + return null; + } + + /** + * Sanitize a user object. + * Removes the password from the user object because we don't want to sync it. + * + * @access public + * + * @todo Refactor `serialize`/`unserialize` to `wp_json_encode`/`wp_json_decode`. + * + * @param \WP_User $user User object. + * @return \WP_User Sanitized user object. + */ + public function sanitize_user( $user ) { + $user = $this->get_user( $user ); + // This creates a new user object and stops the passing of the object by reference. + // // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize, WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize + $user = unserialize( serialize( $user ) ); + + if ( is_object( $user ) && is_object( $user->data ) ) { + unset( $user->data->user_pass ); + } + return $user; + } + + /** + * Expand a particular user. + * + * @access public + * + * @param \WP_User $user User object. + * @return \WP_User Expanded user object. + */ + public function expand_user( $user ) { + if ( ! is_object( $user ) ) { + return null; + } + $user->allowed_mime_types = get_allowed_mime_types( $user ); + $user->allcaps = $this->get_real_user_capabilities( $user ); + + // Only set the user locale if it is different from the site locale. + if ( get_locale() !== get_user_locale( $user->ID ) ) { + $user->locale = get_user_locale( $user->ID ); + } + + return $user; + } + + /** + * Retrieve capabilities we care about for a particular user. + * + * @access public + * + * @param \WP_User $user User object. + * @return array User capabilities. + */ + public function get_real_user_capabilities( $user ) { + $user_capabilities = array(); + if ( is_wp_error( $user ) ) { + return $user_capabilities; + } + foreach ( Defaults::get_capabilities_whitelist() as $capability ) { + if ( user_can( $user, $capability ) ) { + $user_capabilities[ $capability ] = true; + } + } + return $user_capabilities; + } + + /** + * Retrieve, expand and sanitize a user. + * Can be directly used in the sync user action handlers. + * + * @access public + * + * @param mixed $user User ID or user object. + * @return \WP_User Expanded and sanitized user object. + */ + public function sanitize_user_and_expand( $user ) { + $user = $this->get_user( $user ); + $user = $this->expand_user( $user ); + return $this->sanitize_user( $user ); + } + + /** + * Expand the user within a hook before it is serialized and sent to the server. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args The hook arguments. + */ + public function expand_action( $args ) { + // The first argument is always the user. + list( $user ) = $args; + if ( $user ) { + $args[0] = $this->sanitize_user_and_expand( $user ); + return $args; + } + + return false; + } + + /** + * Expand the user username at login before enqueuing. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args Expanded hook arguments. + */ + public function expand_login_username( $args ) { + list( $login, $user, $flags ) = $args; + $user = $this->sanitize_user( $user ); + + return array( $login, $user, $flags ); + } + + /** + * Expand the user username at logout before enqueuing. + * + * @access public + * + * @param array $args The hook arguments. + * @return false|array $args Expanded hook arguments or false if we don't have a user. + */ + public function expand_logout_username( $args ) { + list( $user_id ) = $args; + + $user = get_userdata( $user_id ); + $user = $this->sanitize_user( $user ); + + $login = ''; + if ( is_object( $user ) && is_object( $user->data ) ) { + $login = $user->data->user_login; + } + + // If we don't have a user here lets not enqueue anything. + if ( empty( $login ) ) { + return false; + } + + return array( $login, $user ); + } + + /** + * Additional processing is needed for wp_login so we introduce this wrapper handler. + * + * @access public + * + * @param string $user_login The user login. + * @param \WP_User $user The user object. + */ + public function wp_login_handler( $user_login, $user ) { + /** + * Fires when a user is logged into a site. + * + * @since 1.6.3 + * @since-jetpack 7.2.0 + * + * @param int $user_id The user ID. + * @param \WP_User $user The User Object of the user that currently logged in. + * @param array $params Any Flags that have been added during login. + */ + do_action( 'jetpack_wp_login', $user->ID, $user, $this->get_flags( $user->ID ) ); + $this->clear_flags( $user->ID ); + } + + /** + * A hook for the authenticate event that checks the password strength. + * + * @access public + * + * @param \WP_Error|\WP_User $user The user object, or an error. + * @param string $username The username. + * @param string $password The password used to authenticate. + * @return \WP_Error|\WP_User the same object that was passed into the function. + */ + public function authenticate_handler( $user, $username, $password ) { + // In case of cookie authentication we don't do anything here. + if ( empty( $password ) ) { + return $user; + } + + // We are only interested in successful authentication events. + if ( is_wp_error( $user ) || ! ( $user instanceof \WP_User ) ) { + return $user; + } + + $password_checker = new Password_Checker( $user->ID ); + + $test_results = $password_checker->test( $password, true ); + + // If the password passes tests, we don't do anything. + if ( empty( $test_results['test_results']['failed'] ) ) { + return $user; + } + + $this->add_flags( + $user->ID, + array( + 'warning' => 'The password failed at least one strength test.', + 'failures' => $test_results['test_results']['failed'], + ) + ); + + return $user; + } + + /** + * Handler for after the user is deleted. + * + * @access public + * + * @param int $deleted_user_id ID of the deleted user. + * @param int $reassigned_user_id ID of the user the deleted user's posts are reassigned to (if any). + */ + public function deleted_user_handler( $deleted_user_id, $reassigned_user_id = '' ) { + $is_multisite = is_multisite(); + /** + * Fires when a user is deleted on a site + * + * @since 1.6.3 + * @since-jetpack 5.4.0 + * + * @param int $deleted_user_id - ID of the deleted user. + * @param int $reassigned_user_id - ID of the user the deleted user's posts are reassigned to (if any). + * @param bool $is_multisite - Whether this site is a multisite installation. + */ + do_action( 'jetpack_deleted_user', $deleted_user_id, $reassigned_user_id, $is_multisite ); + } + + /** + * Handler for user registration. + * + * @access public + * + * @param int $user_id ID of the deleted user. + */ + public function user_register_handler( $user_id ) { + // Ensure we only sync users who are members of the current blog. + if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { + return; + } + + if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { + $this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); + } + /** + * Fires when a new user is registered on a site + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param object The WP_User object + */ + do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + + /** + * Handler for user addition to the current blog. + * + * @access public + * + * @param int $user_id ID of the user. + */ + public function add_user_to_blog_handler( $user_id ) { + // Ensure we only sync users who are members of the current blog. + if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { + return; + } + + if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { + $this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); + } + + /** + * Fires when a user is added on a site + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param object The WP_User object + */ + do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + + /** + * Handler for user save. + * + * @access public + * + * @param int $user_id ID of the user. + * @param \WP_User $old_user_data User object before the changes. + */ + public function save_user_handler( $user_id, $old_user_data = null ) { + // Ensure we only sync users who are members of the current blog. + if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { + return; + } + + $user = get_user_by( 'id', $user_id ); + + // Older versions of WP don't pass the old_user_data in ->data. + if ( isset( $old_user_data->data ) ) { + $old_user = $old_user_data->data; + } else { + $old_user = $old_user_data; + } + + if ( ! is_object( $old_user ) ) { + return; + } + + $old_user_array = get_object_vars( $old_user ); + + foreach ( $old_user_array as $user_field => $field_value ) { + if ( false === $user->has_prop( $user_field ) ) { + continue; + } + if ( 'ID' === $user_field ) { + continue; + } + if ( $user->$user_field !== $field_value ) { + if ( 'user_email' === $user_field ) { + /** + * The '_new_email' user meta is deleted right after the call to wp_update_user + * that got us to this point so if it's still set then this was a user confirming + * their new email address. + */ + if ( 1 === (int) get_user_meta( $user->ID, '_new_email', true ) ) { + $this->flags[ $user_id ]['email_changed'] = true; + } + continue; + } + + $flag = isset( $this->user_fields_to_flags_mapping[ $user_field ] ) ? $this->user_fields_to_flags_mapping[ $user_field ] : 'unknown_field_changed'; + + $this->flags[ $user_id ][ $flag ] = true; + } + } + + if ( isset( $this->flags[ $user_id ] ) ) { + + /** + * Fires when the client needs to sync an updated user. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param \WP_User The WP_User object + * @param array State - New since 5.8.0 + */ + do_action( 'jetpack_sync_save_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + } + + /** + * Handler for add user role change. + * + * @access public + * + * @param int $user_id ID of the user. + * @param string $role New user role. + */ + public function add_user_role_handler( $user_id, $role ) { + $this->add_flags( + $user_id, + array( + 'role_added' => $role, + ) + ); + + $this->save_user_role_handler( $user_id, $role ); + } + + /** + * Handler for remove user role change. + * + * @access public + * + * @param int $user_id ID of the user. + * @param string $role Removed user role. + */ + public function remove_user_role_handler( $user_id, $role ) { + $this->add_flags( + $user_id, + array( + 'role_removed' => $role, + ) + ); + + $this->save_user_role_handler( $user_id, $role ); + } + + /** + * Handler for user role change. + * + * @access public + * + * @param int $user_id ID of the user. + * @param string $role New user role. + * @param array $old_roles Previous user roles. + */ + public function save_user_role_handler( $user_id, $role, $old_roles = null ) { + $this->add_flags( + $user_id, + array( + 'role_changed' => true, + 'previous_role' => $old_roles, + ) + ); + + // The jetpack_sync_register_user payload is identical to jetpack_sync_save_user, don't send both. + if ( $this->is_create_user() || $this->is_add_user_to_blog() ) { + return; + } + /** + * This action is documented already in this file + */ + do_action( 'jetpack_sync_save_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + + /** + * Retrieve current flags for a particular user. + * + * @access public + * + * @param int $user_id ID of the user. + * @return array Current flags of the user. + */ + public function get_flags( $user_id ) { + if ( isset( $this->flags[ $user_id ] ) ) { + return $this->flags[ $user_id ]; + } + return array(); + } + + /** + * Clear the flags of a particular user. + * + * @access public + * + * @param int $user_id ID of the user. + */ + public function clear_flags( $user_id ) { + if ( isset( $this->flags[ $user_id ] ) ) { + unset( $this->flags[ $user_id ] ); + } + } + + /** + * Add flags to a particular user. + * + * @access public + * + * @param int $user_id ID of the user. + * @param array $flags New flags to add for the user. + */ + public function add_flags( $user_id, $flags ) { + $this->flags[ $user_id ] = wp_parse_args( $flags, $this->get_flags( $user_id ) ); + } + + /** + * Save the user meta, if we're interested in it. + * Also uses the time to add flags for the user. + * + * @access public + * + * @param int $meta_id ID of the meta object. + * @param int $user_id ID of the user. + * @param string $meta_key Meta key. + * @param mixed $value Meta value. + */ + public function maybe_save_user_meta( $meta_id, $user_id, $meta_key, $value ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + if ( 'locale' === $meta_key ) { + $this->add_flags( $user_id, array( 'locale_changed' => true ) ); + } + + $user = get_user_by( 'id', $user_id ); + if ( isset( $user->cap_key ) && $meta_key === $user->cap_key ) { + $this->add_flags( $user_id, array( 'capabilities_changed' => true ) ); + } + + if ( $this->is_create_user() || $this->is_add_user_to_blog() || $this->is_delete_user() ) { + return; + } + + if ( isset( $this->flags[ $user_id ] ) ) { + /** + * This action is documented already in this file + */ + do_action( 'jetpack_sync_save_user', $user_id, $this->get_flags( $user_id ) ); + } + } + + /** + * Enqueue the users actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_users', $wpdb->usermeta, 'user_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @todo Refactor to prepare the SQL query before executing it. + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->usermeta"; + + $where_sql = $this->get_where_sql( $config ); + if ( $where_sql ) { + $query .= ' WHERE ' . $where_sql; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + $count = (int) $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + global $wpdb; + + $query = "meta_key = '{$wpdb->prefix}user_level' AND meta_value > 0"; + + // The $config variable is a list of user IDs to sync. + if ( is_array( $config ) ) { + $query .= ' AND user_id IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return $query; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_users' ); + } + + /** + * Retrieve initial sync user config. + * + * @access public + * + * @todo Refactor the SQL query to call $wpdb->prepare() before execution. + * + * @return array|boolean IDs of users to initially sync, or false if tbe number of users exceed the maximum. + */ + public function get_initial_sync_user_config() { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $user_ids = $wpdb->get_col( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}user_level' AND meta_value > 0 LIMIT " . ( self::MAX_INITIAL_SYNC_USERS + 1 ) ); + $user_ids_count = is_countable( $user_ids ) ? count( $user_ids ) : 0; + + if ( $user_ids_count <= self::MAX_INITIAL_SYNC_USERS ) { + return $user_ids; + } else { + return false; + } + } + + /** + * Expand the users within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args The hook arguments. + */ + public function expand_users( $args ) { + list( $user_ids, $previous_end ) = $args; + + return array( + 'users' => array_map( + array( $this, 'sanitize_user_and_expand' ), + get_users( + array( + 'include' => $user_ids, + 'orderby' => 'ID', + 'order' => 'DESC', + ) + ) + ), + 'previous_end' => $previous_end, + ); + } + + /** + * Handler for user removal from a particular blog. + * + * @access public + * + * @param int $user_id ID of the user. + * @param int $blog_id ID of the blog. + */ + public function remove_user_from_blog_handler( $user_id, $blog_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // User is removed on add, see https://github.com/WordPress/WordPress/blob/0401cee8b36df3def8e807dd766adc02b359dfaf/wp-includes/ms-functions.php#L2114. + if ( $this->is_add_new_user_to_blog() ) { + return; + } + + $reassigned_user_id = $this->get_reassigned_network_user_id(); + + // Note that we are in the context of the blog the user is removed from, see https://github.com/WordPress/WordPress/blob/473e1ba73bc5c18c72d7f288447503713d518790/wp-includes/ms-functions.php#L233. + /** + * Fires when a user is removed from a blog on a multisite installation + * + * @since 1.6.3 + * @since-jetpack 5.4.0 + * + * @param int $user_id - ID of the removed user + * @param int $reassigned_user_id - ID of the user the removed user's posts are reassigned to (if any). + */ + do_action( 'jetpack_removed_user_from_blog', $user_id, $reassigned_user_id ); + } + + /** + * Whether we're adding a new user to a blog in this request. + * + * @access protected + * + * @return boolean + */ + protected function is_add_new_user_to_blog() { + return $this->is_function_in_backtrace( 'add_new_user_to_blog' ); + } + + /** + * Whether we're adding an existing user to a blog in this request. + * + * @access protected + * + * @return boolean + */ + protected function is_add_user_to_blog() { + return $this->is_function_in_backtrace( 'add_user_to_blog' ); + } + + /** + * Whether we're removing a user from a blog in this request. + * + * @access protected + * + * @return boolean + */ + protected function is_delete_user() { + return $this->is_function_in_backtrace( array( 'wp_delete_user', 'remove_user_from_blog' ) ); + } + + /** + * Whether we're creating a user or adding a new user to a blog. + * + * @access protected + * + * @return boolean + */ + protected function is_create_user() { + $functions = array( + 'add_new_user_to_blog', // Used to suppress jetpack_sync_save_user in save_user_cap_handler when user registered on multi site. + 'wp_create_user', // Used to suppress jetpack_sync_save_user in save_user_role_handler when user registered on multi site. + 'wp_insert_user', // Used to suppress jetpack_sync_save_user in save_user_cap_handler and save_user_role_handler when user registered on single site. + ); + + return $this->is_function_in_backtrace( $functions ); + } + + /** + * Retrieve the ID of the user the removed user's posts are reassigned to (if any). + * + * @return int ID of the user that got reassigned as the author of the posts. + */ + protected function get_reassigned_network_user_id() { + $backtrace = debug_backtrace( false ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + foreach ( $backtrace as $call ) { + if ( + 'remove_user_from_blog' === $call['function'] && + 3 === count( $call['args'] ) + ) { + return $call['args'][2]; + } + } + + return false; + } + + /** + * Checks if one or more function names is in debug_backtrace. + * + * @access protected + * + * @param array|string $names Mixed string name of function or array of string names of functions. + * @return bool + */ + protected function is_function_in_backtrace( $names ) { + $backtrace = debug_backtrace( false ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + if ( ! is_array( $names ) ) { + $names = array( $names ); + } + $names_as_keys = array_flip( $names ); + + $backtrace_functions = array_column( $backtrace, 'function' ); + $backtrace_functions_as_keys = array_flip( $backtrace_functions ); + $intersection = array_intersect_key( $backtrace_functions_as_keys, $names_as_keys ); + return ! empty( $intersection ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php new file mode 100644 index 00000000..90a7a101 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php @@ -0,0 +1,445 @@ +order_table_name; + } + + /** + * Initialize order table data store, returns if the class don't exist (pre WC 6.x) + * + * @access public + */ + public function __construct() { + if ( ! class_exists( OrdersTableDataStore::class ) ) { + return; + } + $this->order_table_name = OrdersTableDataStore::get_orders_table_name(); + } + + /** + * Get order types that we want to sync. Adding a new type here is not enough, we would also need to add its prop in filter_order_data method. + * + * @param bool $prefixed Whether to return prefixed types with shop_ or not. + * + * @return array Order types to sync. + */ + public static function get_order_types_to_sync( $prefixed = false ) { + $types = array( 'order', 'order_refund' ); + + if ( is_plugin_active( self::WOOCOMMERCE_SUBSCRIPTIONS_PATH ) ) { + $types[] = 'subscription'; + } + + if ( $prefixed ) { + $types = array_map( + function ( $type ) { + return "shop_{$type}"; + }, + $types + ); + } + return $types; + } + + /** + * Hooks sync listners on order modify events. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + foreach ( self::get_order_types_to_sync() as $type ) { + add_action( "woocommerce_after_{$type}_object_save", $callable ); + add_filter( "jetpack_sync_before_enqueue_woocommerce_after_{$type}_object_save", array( $this, 'expand_order_object' ) ); + } + add_action( 'woocommerce_delete_order', $callable ); + add_filter( 'jetpack_sync_before_enqueue_woocommerce_delete_order', array( $this, 'expand_order_object' ) ); + add_action( 'woocommerce_trash_order', $callable ); + add_filter( 'jetpack_sync_before_enqueue_woocommerce_trash_order', array( $this, 'expand_order_object' ) ); + } + + /** + * Hooks the full sync listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_orders', $callable ); + add_filter( 'jetpack_sync_before_enqueue_full_sync_orders', array( $this, 'expand_order_objects' ) ); + } + + /** + * Returns the ID field from wc_orders table. + * + * @access public + * + * @return string + */ + public function id_field() { + return 'id'; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_orders' ); + } + + /** + * Retrieve order data by its ID. + * + * @access public + * + * @param string $object_type Type of object to retrieve. Should be `order`. + * @param int $id Order ID. + * + * @return array + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'order' !== $object_type ) { + return $id; + } + $order_objects = $this->get_objects_by_id( $object_type, array( $id ) ); + return isset( $order_objects[ $id ] ) ? $order_objects[ $id ] : false; + } + + /** + * Retrieves multiple orders data by their ID. + * + * @access public + * + * @param string $object_type Type of object to retrieve. Should be `order`. + * @param array $ids List of order IDs. + * + * @return array + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( 'order' !== $object_type || empty( $ids ) || ! is_array( $ids ) ) { + return array(); + } + + $orders = wc_get_orders( + array( + 'post__in' => $ids, + 'type' => self::get_order_types_to_sync( true ), + 'post_status' => self::get_all_possible_order_status_keys(), + 'limit' => -1, + ) + ); + + $orders_data = array(); + foreach ( $orders as $order ) { + $orders_data[ $order->get_id() ] = $this->filter_order_data( $order ); + } + + return $orders_data; + } + + /** + * Retrieves multiple orders data by their ID. + * + * @access public + * + * @param array $args List of order IDs. + * + * @return array + */ + public function expand_order_objects( $args ) { + $order_ids = $args; + + return $this->get_objects_by_id( 'order', $order_ids ); + } + + /** + * Retrieve order data by its ID. + * + * @access public + * + * @param array $args Order ID. + * + * @return array + */ + public function expand_order_object( $args ) { + if ( ! is_array( $args ) || ! isset( $args[0] ) ) { + return false; + } + $order_object = $args[0]; + + if ( is_int( $order_object ) ) { + $order_object = wc_get_order( $order_object ); + } + + if ( ! $order_object instanceof \WC_Abstract_Order ) { + return false; + } + + return $this->filter_order_data( $order_object ); + } + + /** + * Filters only allowed keys from order data. No PII etc information is allowed to be synced. + * + * @access private + * + * @param \WC_Abstract_Order $order_object Order object. + * + * @return array Filtered order data. + */ + private function filter_order_data( $order_object ) { + // Filter with allowlist. + $allowed_data_keys = WooCommerce::$wc_post_meta_whitelist; + $core_table_keys = array( + 'id', + 'status', + 'date_created', + 'date_modified', + 'parent_id', + ); + $allowed_data_keys = array_merge( $allowed_data_keys, $core_table_keys ); + $filtered_order_data = array( 'type' => $order_object->get_type() ); + $order_data = $order_object->get_data(); + foreach ( $allowed_data_keys as $key ) { + $key = trim( $key, '_' ); + $key_parts = explode( '_', $key ); + + if ( in_array( $key_parts[0], array( 'order', 'refund' ), true ) ) { + if ( isset( $order_data[ $key_parts[1] ] ) && ! is_array( $order_data[ $key_parts[1] ] ) ) { + $filtered_order_data[ $key ] = $order_data[ $key_parts[1] ]; + continue; + } + } + + if ( in_array( $key_parts[0], array( 'billing', 'shipping' ), true ) && 2 === count( $key_parts ) ) { + if ( isset( $order_data[ $key_parts[0] ][ $key_parts[1] ] ) ) { + $filtered_order_data[ $key ] = $order_data[ $key_parts[0] ][ $key_parts[1] ]; + continue; + } + } + + /** + * We need to convert the WC_DateTime objects to stdClass objects to ensure they are properly encoded. + * + * @see Automattic\Jetpack\Sync\Functions::json_wrap as the return value of get_object_vars can vary depending on PHP version. + */ + if ( in_array( $key, array( 'date_created', 'date_modified', 'date_paid', 'date_completed' ), true ) && isset( $order_data[ $key ] ) ) { + if ( is_a( $order_data[ $key ], 'WC_DateTime' ) ) { + $filtered_order_data[ $key ] = (object) (array) $order_data[ $key ]; + continue; + } + } + + if ( isset( $order_data[ $key ] ) ) { + $filtered_order_data[ $key ] = $order_data[ $key ]; + continue; + } + + switch ( $key ) { + case 'cart_discount': + $filtered_order_data[ $key ] = isset( $order_data['discount_total'] ) ? $order_data['discount_total'] : ''; + break; + case 'cart_discount_tax': + $filtered_order_data[ $key ] = isset( $order_data['discount_tax'] ) ? $order_data['discount_tax'] : ''; + break; + case 'order_shipping': + $filtered_order_data[ $key ] = isset( $order_data['shipping_total'] ) ? $order_data['shipping_total'] : ''; + break; + case 'order_shipping_tax': + $filtered_order_data[ $key ] = isset( $order_data['shipping_tax'] ) ? $order_data['shipping_tax'] : ''; + break; + case 'order_tax': + $filtered_order_data[ $key ] = isset( $order_data['cart_tax'] ) ? $order_data['cart_tax'] : ''; + break; + case 'order_total': + $filtered_order_data[ $key ] = isset( $order_data['total'] ) ? $order_data['total'] : ''; + break; + } + } + if ( '' === $filtered_order_data['status'] ) { + $filtered_order_data['status'] = 'pending'; + } + $filtered_order_data['status'] = self::get_wc_order_status_with_prefix( $filtered_order_data['status'] ); + + /** + * Filter the order data before syncing. + * + * @since 3.7.0 + * + * @param array $filtered_order_data The Filtered order data. + * @param \WC_Abstract_Order $order_object The Order object. + */ + return apply_filters( 'jetpack_sync_filtered_hpos_order_data', $filtered_order_data, $order_object ); + } + + /** + * Returns all possible order status keys, including 'auto-draft' and 'trash'. + * + * @access public + * + * @return array An array of all possible status keys, including 'auto-draft' and 'trash'. + */ + public static function get_all_possible_order_status_keys() { + $order_statuses = array( 'auto-draft', 'trash' ); + $wc_order_statuses = self::wc_get_order_status_keys(); + + return array_unique( array_merge( $wc_order_statuses, $order_statuses ) ); + } + + /** + * Add the 'wc-' order status to WC related order statuses. + * + * @param string $status The WC order status without the 'wc-' prefix. + * + * @return string The WC order status with the 'wc-' prefix if it's a valid order status, initial $status otherwise. + */ + protected static function get_wc_order_status_with_prefix( string $status ) { + return in_array( 'wc-' . $status, self::wc_get_order_status_keys(), true ) ? 'wc-' . $status : $status; + } + + /** + * Returns order status keys using 'wc_get_order_statuses', if possible. + * + * @see wc_get_order_statuses + * + * @return array Filtered order metadata. + */ + private static function wc_get_order_status_keys() { + $wc_order_statuses = array(); + if ( function_exists( 'wc_get_order_statuses' ) ) { + $wc_order_statuses = array_keys( wc_get_order_statuses() ); + $wc_order_statuses[] = 'wc-checkout-draft'; // Temp till Woo fixes a bug where this order status is missing. + } else { + $wc_order_statuses = array( + 'wc-pending', + 'wc-processing', + 'wc-on-hold', + 'wc-completed', + 'wc-cancelled', + 'wc-refunded', + 'wc-failed', + 'wc-checkout-draft', + ); + } + + return array_unique( $wc_order_statuses ); + } + + /** + * Returns metadata for order object. + * + * @access protected + * + * @param array $ids List of order IDs. + * @param string $meta_type Meta type. + * @param array $meta_key_whitelist List of allowed meta keys. + * + * @return array Filtered order metadata. + */ + protected function get_metadata( $ids, $meta_type, $meta_key_whitelist ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- returning empty meta is intentional. + return array(); // don't sync metadata, all allow-listed core data is available in the order object. + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- We return all order count for full sync, so confit is not required. + global $wpdb; + + $query = "SELECT count(*) FROM {$this->table_name()} WHERE {$this->get_where_sql( $config ) }"; + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Hardcoded query, no user variable + $count = (int) $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Enqueue the WooCommerce HPOS orders actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + return $this->enqueue_all_ids_as_action( 'full_sync_orders', $this->table_name(), 'id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Get where SQL for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + global $wpdb; + $parent_where = parent::get_where_sql( $config ); + $order_types = self::get_order_types_to_sync( true ); + $order_type_placeholder = implode( ', ', array_fill( 0, count( $order_types ), '%s' ) ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare -- Query is prepared. + $where_sql = $wpdb->prepare( "type IN ( $order_type_placeholder )", $order_types ); + return "{$parent_where} AND {$where_sql}"; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php new file mode 100644 index 00000000..37d7d72c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php @@ -0,0 +1,639 @@ +order_item_table_name; + } + + /** + * Constructor. + * + * @global $wpdb + * + * @todo Should we refactor this to use $this->set_defaults() instead? + */ + public function __construct() { + global $wpdb; + $this->order_item_table_name = $wpdb->prefix . 'woocommerce_order_items'; + + // Options, constants and post meta whitelists. + add_filter( 'jetpack_sync_options_whitelist', array( $this, 'add_woocommerce_options_whitelist' ), 10 ); + add_filter( 'jetpack_sync_constants_whitelist', array( $this, 'add_woocommerce_constants_whitelist' ), 10 ); + add_filter( 'jetpack_sync_post_meta_whitelist', array( $this, 'add_woocommerce_post_meta_whitelist' ), 10 ); + add_filter( 'jetpack_sync_comment_meta_whitelist', array( $this, 'add_woocommerce_comment_meta_whitelist' ), 10 ); + + add_filter( 'jetpack_sync_before_enqueue_woocommerce_new_order_item', array( $this, 'filter_order_item' ) ); + add_filter( 'jetpack_sync_before_enqueue_woocommerce_update_order_item', array( $this, 'filter_order_item' ) ); + add_filter( 'jetpack_sync_whitelisted_comment_types', array( $this, 'add_review_comment_types' ) ); + + // Blacklist Action Scheduler comment types. + add_filter( 'jetpack_sync_prevent_sending_comment_data', array( $this, 'filter_action_scheduler_comments' ), 10, 2 ); + + // Preprocess action to be sent by Jetpack sync. + add_action( 'woocommerce_remove_order_items', array( $this, 'action_woocommerce_remove_order_items' ), 10, 2 ); + } + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'woocommerce'; + } + + /** + * Initialize WooCommerce action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + // Attributes. + add_action( 'woocommerce_attribute_added', $callable, 10, 2 ); + add_action( 'woocommerce_attribute_updated', $callable, 10, 3 ); + add_action( 'woocommerce_attribute_deleted', $callable, 10, 3 ); + + // Orders. + add_action( 'woocommerce_new_order', $callable, 10, 1 ); + add_action( 'woocommerce_order_status_changed', $callable, 10, 3 ); + add_action( 'woocommerce_payment_complete', $callable, 10, 1 ); + + // Order items. + add_action( 'woocommerce_new_order_item', $callable, 10, 4 ); + add_action( 'woocommerce_update_order_item', $callable, 10, 4 ); + add_action( 'woocommerce_delete_order_item', $callable, 10, 1 ); + add_action( 'woocommerce_remove_order_item_ids', $callable, 10, 1 ); + $this->init_listeners_for_meta_type( 'order_item', $callable ); + + // Payment tokens. + add_action( 'woocommerce_new_payment_token', $callable, 10, 1 ); + add_action( 'woocommerce_payment_token_deleted', $callable, 10, 2 ); + add_action( 'woocommerce_payment_token_updated', $callable, 10, 1 ); + $this->init_listeners_for_meta_type( 'payment_token', $callable ); + + // Product downloads. + add_action( 'woocommerce_downloadable_product_download_log_insert', $callable, 10, 1 ); + add_action( 'woocommerce_grant_product_download_access', $callable, 10, 1 ); + + // Tax rates. + add_action( 'woocommerce_tax_rate_added', $callable, 10, 2 ); + add_action( 'woocommerce_tax_rate_updated', $callable, 10, 2 ); + add_action( 'woocommerce_tax_rate_deleted', $callable, 10, 1 ); + + // Webhooks. + add_action( 'woocommerce_new_webhook', $callable, 10, 1 ); + add_action( 'woocommerce_webhook_deleted', $callable, 10, 2 ); + add_action( 'woocommerce_webhook_updated', $callable, 10, 1 ); + } + + /** + * Initialize WooCommerce action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_woocommerce_order_items', $callable ); // Also sends post meta. + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_woocommerce_order_items' ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_woocommerce_order_items', array( $this, 'expand_order_item_ids' ) ); + } + + /** + * Expand the order items properly. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args The hook arguments. + */ + public function filter_order_item( $args ) { + // Make sure we always have all the data - prior to WooCommerce 3.0 we only have the user supplied data in the second argument and not the full details. + $args[1] = $this->build_order_item( $args[0] ); + return $args; + } + + /** + * Retrieve the order item ids to be removed and send them as one action + * + * @param WC_Order $order The order argument. + * @param string $type Order item type. + */ + public function action_woocommerce_remove_order_items( WC_Order $order, $type ) { + if ( $type ) { + $order_items = $order->get_items( $type ); + } else { + $order_items = $order->get_items(); + } + $order_item_ids = array_keys( $order_items ); + + if ( $order_item_ids ) { + do_action( 'woocommerce_remove_order_item_ids', $order_item_ids ); + } + } + + /** + * Expand order item IDs to order items and their meta. + * + * @access public + * + * @todo Refactor table name to use a $wpdb->prepare placeholder. + * + * @param array $args The hook arguments. + * @return array $args Expanded order items with meta. + */ + public function expand_order_item_ids( $args ) { + $order_item_ids = $args[0]; + + global $wpdb; + + $order_item_ids_sql = implode( ', ', array_map( 'intval', $order_item_ids ) ); + + $order_items = $wpdb->get_results( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT * FROM $this->order_item_table_name WHERE order_item_id IN ( $order_item_ids_sql )" + ); + + return array( + $order_items, + $this->get_metadata( $order_item_ids, 'order_item', static::$order_item_meta_whitelist ), + ); + } + + /** + * Extract the full order item from the database by its ID. + * + * @access public + * + * @todo Refactor table name to use a $wpdb->prepare placeholder. + * + * @param int $order_item_id Order item ID. + * @return object Order item. + */ + public function build_order_item( $order_item_id ) { + global $wpdb; + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->order_item_table_name WHERE order_item_id = %d", $order_item_id ) ); + } + + /** + * Enqueue the WooCommerce actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_woocommerce_order_items', $this->order_item_table_name, 'order_item_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @todo Refactor the SQL query to use $wpdb->prepare(). + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + $count = (int) $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access private + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause. + */ + public function get_where_sql( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return '1=1'; + } + + /** + * Add WooCommerce options to the options whitelist. + * + * @param array $list Existing options whitelist. + * @return array Updated options whitelist. + */ + public function add_woocommerce_options_whitelist( $list ) { + return array_merge( $list, self::$wc_options_whitelist ); + } + + /** + * Add WooCommerce constants to the constants whitelist. + * + * @param array $list Existing constants whitelist. + * @return array Updated constants whitelist. + */ + public function add_woocommerce_constants_whitelist( $list ) { + return array_merge( $list, self::$wc_constants_whitelist ); + } + + /** + * Add WooCommerce post meta to the post meta whitelist. + * + * @param array $list Existing post meta whitelist. + * @return array Updated post meta whitelist. + */ + public function add_woocommerce_post_meta_whitelist( $list ) { + return array_merge( $list, self::$wc_post_meta_whitelist ); + } + + /** + * Add WooCommerce comment meta to the comment meta whitelist. + * + * @param array $list Existing comment meta whitelist. + * @return array Updated comment meta whitelist. + */ + public function add_woocommerce_comment_meta_whitelist( $list ) { + return array_merge( $list, self::$wc_comment_meta_whitelist ); + } + + /** + * Adds 'revew' to the list of comment types so Sync will listen for status changes on 'reviews'. + * + * @access public + * + * @param array $comment_types The list of comment types prior to this filter. + * return array The list of comment types with 'review' added. + */ + public function add_review_comment_types( $comment_types ) { + if ( is_array( $comment_types ) ) { + $comment_types[] = 'review'; + } + return $comment_types; + } + + /** + * Stop comments from the Action Scheduler from being synced. + * https://github.com/woocommerce/woocommerce/tree/e7762627c37ec1f7590e6cac4218ba0c6a20024d/includes/libraries/action-scheduler + * + * @since 1.6.3 + * @since-jetpack 7.7.0 + * + * @param boolean $can_sync Should we prevent comment data from bing synced to WordPress.com. + * @param mixed $comment WP_COMMENT object. + * + * @return bool + */ + public function filter_action_scheduler_comments( $can_sync, $comment ) { + if ( isset( $comment->comment_agent ) && 'ActionScheduler' === $comment->comment_agent ) { + return true; + } + return $can_sync; + } + + /** + * Whitelist for options we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + private static $wc_options_whitelist = array( + 'woocommerce_currency', + 'woocommerce_db_version', + 'woocommerce_weight_unit', + 'woocommerce_version', + 'woocommerce_unforce_ssl_checkout', + 'woocommerce_tax_total_display', + 'woocommerce_tax_round_at_subtotal', + 'woocommerce_tax_display_shop', + 'woocommerce_tax_display_cart', + 'woocommerce_prices_include_tax', + 'woocommerce_price_thousand_sep', + 'woocommerce_price_num_decimals', + 'woocommerce_price_decimal_sep', + 'woocommerce_notify_low_stock', + 'woocommerce_notify_low_stock_amount', + 'woocommerce_notify_no_stock', + 'woocommerce_notify_no_stock_amount', + 'woocommerce_manage_stock', + 'woocommerce_force_ssl_checkout', + 'woocommerce_hide_out_of_stock_items', + 'woocommerce_file_download_method', + 'woocommerce_enable_signup_and_login_from_checkout', + 'woocommerce_enable_shipping_calc', + 'woocommerce_enable_review_rating', + 'woocommerce_enable_guest_checkout', + 'woocommerce_enable_coupons', + 'woocommerce_enable_checkout_login_reminder', + 'woocommerce_enable_ajax_add_to_cart', + 'woocommerce_dimension_unit', + 'woocommerce_default_country', + 'woocommerce_default_customer_address', + 'woocommerce_currency_pos', + 'woocommerce_api_enabled', + 'woocommerce_allow_tracking', + 'woocommerce_task_list_hidden', + 'woocommerce_onboarding_profile', + 'woocommerce_cod_settings', + ); + + /** + * Whitelist for constants we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + private static $wc_constants_whitelist = array( + // WooCommerce constants. + 'WC_PLUGIN_FILE', + 'WC_ABSPATH', + 'WC_PLUGIN_BASENAME', + 'WC_VERSION', + 'WOOCOMMERCE_VERSION', + 'WC_ROUNDING_PRECISION', + 'WC_DISCOUNT_ROUNDING_MODE', + 'WC_TAX_ROUNDING_MODE', + 'WC_DELIMITER', + 'WC_LOG_DIR', + 'WC_SESSION_CACHE_GROUP', + 'WC_TEMPLATE_DEBUG_MODE', + ); + + /** + * Whitelist for post meta we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + public static $wc_post_meta_whitelist = array( + // WooCommerce products. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-product-data-store-cpt.php#L21 . + '_visibility', + '_sku', + '_price', + '_regular_price', + '_sale_price', + '_sale_price_dates_from', + '_sale_price_dates_to', + 'total_sales', + '_tax_status', + '_tax_class', + '_manage_stock', + '_backorders', + '_sold_individually', + '_weight', + '_length', + '_width', + '_height', + '_upsell_ids', + '_crosssell_ids', + '_purchase_note', + '_default_attributes', + '_product_attributes', + '_virtual', + '_downloadable', + '_download_limit', + '_download_expiry', + '_featured', + '_downloadable_files', + '_wc_rating_count', + '_wc_average_rating', + '_wc_review_count', + '_variation_description', + '_thumbnail_id', + '_file_paths', + '_product_image_gallery', + '_product_version', + '_wp_old_slug', + + // Woocommerce orders. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L27 . + '_order_key', + '_order_currency', + // '_billing_first_name', do not sync these as they contain personal data + // '_billing_last_name', + // '_billing_company', + // '_billing_address_1', + // '_billing_address_2', + '_billing_city', + '_billing_state', + '_billing_postcode', + '_billing_country', + // '_billing_email', do not sync these as they contain personal data. + // '_billing_phone', + // '_shipping_first_name', + // '_shipping_last_name', + // '_shipping_company', + // '_shipping_address_1', + // '_shipping_address_2', + '_shipping_city', + '_shipping_state', + '_shipping_postcode', + '_shipping_country', + '_completed_date', + '_paid_date', + '_cart_discount', + '_cart_discount_tax', + '_order_shipping', + '_order_shipping_tax', + '_order_tax', + '_order_total', + '_payment_method', + '_payment_method_title', + // '_transaction_id', do not sync these as they contain personal data. + // '_customer_ip_address', + // '_customer_user_agent', + '_created_via', + '_order_version', + '_prices_include_tax', + '_date_completed', + '_date_paid', + '_payment_tokens', + // '_billing_address_index', do not sync these as they contain personal data. + // '_shipping_address_index', + '_recorded_sales', + '_recorded_coupon_usage_counts', + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L539 . + '_download_permissions_granted', + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L594 . + '_order_stock_reduced', + '_cart_hash', + + // Woocommerce order refunds. + // See https://github.com/woocommerce/woocommerce/blob/b8a2815ae546c836467008739e7ff5150cb08e93/includes/data-stores/class-wc-order-refund-data-store-cpt.php#L20 . + '_order_currency', + '_refund_amount', + '_refunded_by', + '_refund_reason', + '_order_shipping', + '_order_shipping_tax', + '_order_tax', + '_order_total', + '_order_version', + '_prices_include_tax', + '_payment_tokens', + ); + + /** + * Whitelist for comment meta we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + private static $wc_comment_meta_whitelist = array( + 'rating', + ); + + /** + * Return a list of objects by their type and IDs + * + * @param string $object_type Object type. + * @param array $ids IDs of objects to return. + * + * @access public + * + * @return array|object|WP_Error|null + */ + public function get_objects_by_id( $object_type, $ids ) { + switch ( $object_type ) { + case 'order_item': + return $this->get_order_item_by_ids( $ids ); + } + + return new WP_Error( 'unsupported_object_type', 'Unsupported object type' ); + } + + /** + * Returns a list of order_item objects by their IDs. + * + * @param array $ids List of order_item IDs to fetch. + * + * @access public + * + * @return array|object|null + */ + public function get_order_item_by_ids( $ids ) { + global $wpdb; + + if ( ! is_array( $ids ) ) { + return array(); + } + + // Make sure the IDs are numeric and are non-zero. + $ids = array_filter( array_map( 'intval', $ids ) ); + + if ( empty( $ids ) ) { + return array(); + } + + // Prepare the placeholders for the prepared query below. + $placeholders = implode( ',', array_fill( 0, count( $ids ), '%d' ) ); + + $query = "SELECT * FROM {$this->order_item_table_name} WHERE order_item_id IN ( $placeholders )"; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + return $wpdb->get_results( $wpdb->prepare( $query, $ids ), ARRAY_A ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php new file mode 100644 index 00000000..af4aec41 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php @@ -0,0 +1,156 @@ +set_defaults() instead? + */ + public function __construct() { + add_filter( 'jetpack_sync_constants_whitelist', array( $this, 'add_wp_super_cache_constants_whitelist' ), 10 ); + add_filter( 'jetpack_sync_callable_whitelist', array( $this, 'add_wp_super_cache_callable_whitelist' ), 10 ); + } + + /** + * Whitelist for constants we are interested to sync. + * + * @access public + * @static + * + * @var array + */ + public static $wp_super_cache_constants = array( + 'WPLOCKDOWN', + 'WPSC_DISABLE_COMPRESSION', + 'WPSC_DISABLE_LOCKING', + 'WPSC_DISABLE_HTACCESS_UPDATE', + 'ADVANCEDCACHEPROBLEM', + ); + + /** + * Container for the whitelist for WP_Super_Cache callables we are interested to sync. + * + * @access public + * @static + * + * @var array + */ + public static $wp_super_cache_callables = array( + 'wp_super_cache_globals' => array( __CLASS__, 'get_wp_super_cache_globals' ), + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'wp-super-cache'; + } + + /** + * Retrieve all WP_Super_Cache callables we are interested to sync. + * + * @access public + * + * @global $wp_cache_mod_rewrite; + * @global $cache_enabled; + * @global $super_cache_enabled; + * @global $ossdlcdn; + * @global $cache_rebuild_files; + * @global $wp_cache_mobile; + * @global $wp_super_cache_late_init; + * @global $wp_cache_anon_only; + * @global $wp_cache_not_logged_in; + * @global $wp_cache_clear_on_post_edit; + * @global $wp_cache_mobile_enabled; + * @global $wp_super_cache_debug; + * @global $cache_max_time; + * @global $wp_cache_refresh_single_only; + * @global $wp_cache_mfunc_enabled; + * @global $wp_supercache_304; + * @global $wp_cache_no_cache_for_get; + * @global $wp_cache_mutex_disabled; + * @global $cache_jetpack; + * @global $cache_domain_mapping; + * + * @return array All WP_Super_Cache callables. + */ + public static function get_wp_super_cache_globals() { + global $wp_cache_mod_rewrite; + global $cache_enabled; + global $super_cache_enabled; + global $ossdlcdn; + global $cache_rebuild_files; + global $wp_cache_mobile; + global $wp_super_cache_late_init; + global $wp_cache_anon_only; + global $wp_cache_not_logged_in; + global $wp_cache_clear_on_post_edit; + global $wp_cache_mobile_enabled; + global $wp_super_cache_debug; + global $cache_max_time; + global $wp_cache_refresh_single_only; + global $wp_cache_mfunc_enabled; + global $wp_supercache_304; + global $wp_cache_no_cache_for_get; + global $wp_cache_mutex_disabled; + global $cache_jetpack; + global $cache_domain_mapping; + + return array( + 'wp_cache_mod_rewrite' => $wp_cache_mod_rewrite, + 'cache_enabled' => $cache_enabled, + 'super_cache_enabled' => $super_cache_enabled, + 'ossdlcdn' => $ossdlcdn, + 'cache_rebuild_files' => $cache_rebuild_files, + 'wp_cache_mobile' => $wp_cache_mobile, + 'wp_super_cache_late_init' => $wp_super_cache_late_init, + 'wp_cache_anon_only' => $wp_cache_anon_only, + 'wp_cache_not_logged_in' => $wp_cache_not_logged_in, + 'wp_cache_clear_on_post_edit' => $wp_cache_clear_on_post_edit, + 'wp_cache_mobile_enabled' => $wp_cache_mobile_enabled, + 'wp_super_cache_debug' => $wp_super_cache_debug, + 'cache_max_time' => $cache_max_time, + 'wp_cache_refresh_single_only' => $wp_cache_refresh_single_only, + 'wp_cache_mfunc_enabled' => $wp_cache_mfunc_enabled, + 'wp_supercache_304' => $wp_supercache_304, + 'wp_cache_no_cache_for_get' => $wp_cache_no_cache_for_get, + 'wp_cache_mutex_disabled' => $wp_cache_mutex_disabled, + 'cache_jetpack' => $cache_jetpack, + 'cache_domain_mapping' => $cache_domain_mapping, + ); + } + + /** + * Add WP_Super_Cache constants to the constants whitelist. + * + * @param array $list Existing constants whitelist. + * @return array Updated constants whitelist. + */ + public function add_wp_super_cache_constants_whitelist( $list ) { + return array_merge( $list, self::$wp_super_cache_constants ); + } + + /** + * Add WP_Super_Cache callables to the callables whitelist. + * + * @param array $list Existing callables whitelist. + * @return array Updated callables whitelist. + */ + public function add_wp_super_cache_callable_whitelist( $list ) { + return array_merge( $list, self::$wp_super_cache_callables ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php new file mode 100644 index 00000000..c880a4ee --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php @@ -0,0 +1,209 @@ +build_filter_statement( $range_from, $range_to ); + + $query = " + SELECT + DISTINCT {$this->table}.{$this->range_field} + FROM + {$this->table} + JOIN {$wpdb->usermeta} as um_table ON um_table.user_id = {$this->table}.ID + WHERE + {$range_filter_statement} + AND um_table.meta_key = '{$wpdb->prefix}user_level' + AND um_table.meta_value > 0 + "; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $user_ids = $wpdb->get_col( $query ); + + // Chunk the array down to make sure we don't overload the database with queries that are too large. + $chunked_user_ids = array_chunk( $user_ids, 500 ); + + $checksum_entries = array(); + + foreach ( $chunked_user_ids as $user_ids_chunk ) { + $user_objects = $this->get_user_objects_by_ids( $user_ids_chunk ); + + foreach ( $user_objects as $user_object ) { + // expand and sanitize desired meta based on WP.com logic. + $user_object = $this->expand_and_sanitize_user_meta( $user_object ); + + // Generate checksum entry based on the serialized value if not empty. + $checksum_entry = 0; + if ( ! empty( $user_object->roles ) ) { + $checksum_entry = crc32( implode( '#', array( $this->salt, 'roles', maybe_serialize( $user_object->roles ) ) ) ); + } + + // Meta only persisted if user is connected to WP.com. + if ( ( new Manager( 'jetpack' ) )->is_user_connected( $user_object->ID ) ) { + if ( ! empty( $user_object->allcaps ) ) { + $checksum_entry += crc32( + implode( + '#', + array( + $this->salt, + 'capabilities', + maybe_serialize( $user_object->allcaps ), + ) + ) + ); + } + // Explicitly check that locale is not same as site locale. + if ( ! empty( $user_object->locale ) && get_locale() !== $user_object->locale ) { + $checksum_entry += crc32( + implode( + '#', + array( + $this->salt, + 'locale', + maybe_serialize( $user_object->locale ), + ) + ) + ); + } + if ( ! empty( $user_object->allowed_mime_types ) ) { + $checksum_entry += crc32( + implode( + '#', + array( + $this->salt, + 'allowed_mime_types', + maybe_serialize( $user_object->allowed_mime_types ), + ) + ) + ); + } + } + + $checksum_entries[ $user_object->ID ] = '' . $checksum_entry; + } + } + + // Non-granular results need only to sum the different entries. + if ( ! $granular_result ) { + $checksum_sum = 0; + foreach ( $checksum_entries as $entry ) { + $checksum_sum += intval( $entry ); + } + + if ( $simple_return_value ) { + return '' . $checksum_sum; + } + + return array( + 'range' => $range_from . '-' . $range_to, + 'checksum' => '' . $checksum_sum, + ); + + } + + // Granular results. + $response = $checksum_entries; + + // Sort the return value for easier comparisons and code flows further down the line. + ksort( $response ); + + return $response; + } + + /** + * Expand the User Object with additional meta santized by WP.com logic. + * + * @param mixed $user_object User Object from WP_User_Query. + * + * @return mixed $user_object expanded User Object. + */ + protected function expand_and_sanitize_user_meta( $user_object ) { + $user_module = Modules::get_module( 'users' ); + '@phan-var \Automattic\Jetpack\Sync\Modules\Users $user_module'; + // Expand User Objects based on Sync logic. + $user_object = $user_module->expand_user( $user_object ); + + // Sanitize location. + if ( ! empty( $user_object->locale ) ) { + $user_object->locale = wp_strip_all_tags( $user_object->locale, true ); + } + + // Sanitize allcaps. + if ( ! empty( $user_object->allcaps ) ) { + $user_object->allcaps = array_map( + function ( $cap ) { + return (bool) $cap; + }, + $user_object->allcaps + ); + } + + // Sanitize allowed_mime_types. + $allowed_mime_types = $user_object->allowed_mime_types; + foreach ( $allowed_mime_types as $allowed_mime_type_short => $allowed_mime_type_long ) { + $allowed_mime_type_short = wp_strip_all_tags( (string) $allowed_mime_type_short, true ); + $allowed_mime_type_long = wp_strip_all_tags( (string) $allowed_mime_type_long, true ); + $allowed_mime_types[ $allowed_mime_type_short ] = $allowed_mime_type_long; + } + $user_object->allowed_mime_types = $allowed_mime_types; + + // Sanitize roles. + if ( is_array( $user_object->roles ) ) { + $user_object->roles = array_map( 'sanitize_text_field', $user_object->roles ); + } + return $user_object; + } + + /** + * Gets a list of `WP_User` objects by their IDs + * + * @param array $ids List of IDs to fetch. + * + * @return array + */ + protected function get_user_objects_by_ids( $ids ) { + $user_query = new WP_User_Query( array( 'include' => $ids ) ); + + return $user_query->get_results(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php new file mode 100644 index 00000000..c36b0e3d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php @@ -0,0 +1,185 @@ +prepare( '%s', $this->salt ); + + // Prepare the compound key. + $key_fields = array(); + + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->key_fields as $field ) { + $key_fields[] = $this->table . '.' . $field; + } + + $key_fields = implode( ',', $key_fields ); + + // Prepare the checksum fields. + $checksum_fields = array(); + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->checksum_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + // Apply latin1 conversion if enabled. + if ( $this->perform_text_conversion ) { + // Convert text fields to allow for encoding discrepancies as WP.com is latin1. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = 'CONVERT(' . $this->table . '.' . $field . ' using latin1 )'; + } + } else { + // Conversion disabled, default to table prefixing. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + } + + $checksum_fields_string = implode( ',', array_merge( $checksum_fields, array( $salt ) ) ); + + $additional_fields = ''; + if ( $granular_result ) { + // TODO uniq the fields as sometimes(most) range_index is the key and there's no need to select the same field twice. + $additional_fields = " + {$this->table}.{$this->range_field} as range_index, + {$key_fields}, + "; + } + + $filter_stamenet = $this->build_filter_statement( $range_from, $range_to, $filter_values ); + + // usermeta join to limit on user_level. + $join_statement = "JOIN {$wpdb->usermeta} as um_table ON um_table.user_id = {$this->table}.ID"; + + $query = " + SELECT + {$additional_fields} + SUM( + CRC32( + CONCAT_WS( '#', {$salt}, {$checksum_fields_string} ) + ) + ) AS checksum + FROM + {$this->table} + {$join_statement} + WHERE + {$filter_stamenet} + AND um_table.meta_key = '{$wpdb->prefix}user_level' + AND um_table.meta_value > 0 + "; + + /** + * We need the GROUP BY only for compound keys. + */ + if ( $granular_result ) { + $query .= " + GROUP BY {$key_fields} + LIMIT 9999999 + "; + } + + return $query; + } + + /** + * Obtain the min-max values (edges) of the range. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param int|null $limit How many values to return. + * + * @return array|object|void + * @throws Exception Throws an exception if validation fails on the internal function calls. + */ + public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) { + global $wpdb; + + $this->validate_fields( array( $this->range_field ) ); + + // `trim()` to make sure we don't add the statement if it's empty. + $filters = trim( $this->build_filter_statement( $range_from, $range_to ) ); + + $filter_statement = ''; + if ( ! empty( $filters ) ) { + $filter_statement = " + JOIN {$wpdb->usermeta} as um_table ON um_table.user_id = {$this->table}.ID + WHERE + {$filters} + AND um_table.meta_key = '{$wpdb->prefix}user_level' + AND um_table.meta_value > 0 + "; + } + + $query = " + SELECT + MIN({$this->range_field}) as min_range, + MAX({$this->range_field}) as max_range, + COUNT( {$this->range_field} ) as item_count + FROM + "; + + /** + * If `$limit` is not specified, we can directly use the table. + */ + if ( ! $limit ) { + $query .= " + {$this->table} + {$filter_statement} + "; + } else { + /** + * If there is `$limit` specified, we can't directly use `MIN/MAX()` as they don't work with `LIMIT`. + * That's why we will alter the query for this case. + */ + $limit = intval( $limit ); + + $query .= " + ( + SELECT + {$this->range_field} + FROM + {$this->table} + {$filter_statement} + ORDER BY + {$this->range_field} ASC + LIMIT {$limit} + ) as ids_query + "; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_row( $query, ARRAY_A ); + + if ( ! $result || ! is_array( $result ) ) { + throw new Exception( 'Unable to get range edges' ); + } + + return $result; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php new file mode 100644 index 00000000..30d0bc1c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php @@ -0,0 +1,976 @@ +salt = $salt; + + $this->default_tables = $this->get_default_tables(); + + $this->perform_text_conversion = $perform_text_conversion; + + // TODO change filters to allow the array format. + // TODO add get_fields or similar method to get things out of the table. + // TODO extract this configuration in a better way, still make it work with `$wpdb` names. + // TODO take over the replicastore functions and move them over to this class. + // TODO make the API work. + + $this->allowed_tables = apply_filters( 'jetpack_sync_checksum_allowed_tables', $this->default_tables ); + + $this->table = $this->validate_table_name( $table ); + $this->table_configuration = $this->allowed_tables[ $table ]; + + $this->prepare_fields( $this->table_configuration ); + + $this->prepare_additional_columns( $additional_columns ); + + // Run any callbacks to check if a table is enabled or not. + if ( + is_callable( $this->is_table_enabled_callback ) + && ! call_user_func( $this->is_table_enabled_callback, $table ) + ) { + throw new Exception( "Unable to use table name: $table" ); + } + } + + /** + * Get Default Table configurations. + * + * @return array + */ + protected function get_default_tables() { + global $wpdb; + + return array( + 'posts' => array( + 'table' => $wpdb->posts, + 'range_field' => 'ID', + 'key_fields' => array( 'ID' ), + 'checksum_fields' => array( 'post_modified_gmt' ), + 'filter_values' => Sync\Settings::get_disallowed_post_types_structured(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'posts' ); + }, + ), + 'postmeta' => array( + 'table' => $wpdb->postmeta, + 'range_field' => 'post_id', + 'key_fields' => array( 'post_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'filter_values' => Sync\Settings::get_allowed_post_meta_structured(), + 'parent_table' => 'posts', + 'parent_join_field' => 'ID', + 'table_join_field' => 'post_id', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'posts' ); + }, + ), + 'comments' => array( + 'table' => $wpdb->comments, + 'range_field' => 'comment_ID', + 'key_fields' => array( 'comment_ID' ), + 'checksum_fields' => array( 'comment_date_gmt' ), + 'filter_values' => array( + 'comment_type' => array( + 'operator' => 'IN', + 'values' => apply_filters( + 'jetpack_sync_whitelisted_comment_types', + array( '', 'comment', 'trackback', 'pingback', 'review' ) + ), + ), + 'comment_approved' => array( + 'operator' => 'NOT IN', + 'values' => array( 'spam' ), + ), + ), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'comments' ); + }, + ), + 'commentmeta' => array( + 'table' => $wpdb->commentmeta, + 'range_field' => 'comment_id', + 'key_fields' => array( 'comment_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'filter_values' => Sync\Settings::get_allowed_comment_meta_structured(), + 'parent_table' => 'comments', + 'parent_join_field' => 'comment_ID', + 'table_join_field' => 'comment_id', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'comments' ); + }, + ), + 'terms' => array( + 'table' => $wpdb->terms, + 'range_field' => 'term_id', + 'key_fields' => array( 'term_id' ), + 'checksum_fields' => array( 'term_id' ), + 'checksum_text_fields' => array( 'name', 'slug' ), + 'parent_table' => 'term_taxonomy', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'termmeta' => array( + 'table' => $wpdb->termmeta, + 'range_field' => 'term_id', + 'key_fields' => array( 'term_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'parent_table' => 'term_taxonomy', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'term_relationships' => array( + 'table' => $wpdb->term_relationships, + 'range_field' => 'object_id', + 'key_fields' => array( 'object_id' ), + 'checksum_fields' => array( 'object_id', 'term_taxonomy_id' ), + 'parent_table' => 'term_taxonomy', + 'parent_join_field' => 'term_taxonomy_id', + 'table_join_field' => 'term_taxonomy_id', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'term_taxonomy' => array( + 'table' => $wpdb->term_taxonomy, + 'range_field' => 'term_taxonomy_id', + 'key_fields' => array( 'term_taxonomy_id' ), + 'checksum_fields' => array( 'term_taxonomy_id', 'term_id', 'parent' ), + 'checksum_text_fields' => array( 'taxonomy', 'description' ), + 'filter_values' => Sync\Settings::get_allowed_taxonomies_structured(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'links' => $wpdb->links, // TODO describe in the array format or add exceptions. + 'options' => $wpdb->options, // TODO describe in the array format or add exceptions. + 'woocommerce_order_items' => array( + 'table' => "{$wpdb->prefix}woocommerce_order_items", + 'range_field' => 'order_item_id', + 'key_fields' => array( 'order_item_id' ), + 'checksum_fields' => array( 'order_id' ), + 'checksum_text_fields' => array( 'order_item_name', 'order_item_type' ), + 'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ), + ), + 'woocommerce_order_itemmeta' => array( + 'table' => "{$wpdb->prefix}woocommerce_order_itemmeta", + 'range_field' => 'order_item_id', + 'key_fields' => array( 'order_item_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'filter_values' => Sync\Settings::get_allowed_order_itemmeta_structured(), + 'parent_table' => 'woocommerce_order_items', + 'parent_join_field' => 'order_item_id', + 'table_join_field' => 'order_item_id', + 'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ), + ), + 'wc_orders' => array( + 'table' => "{$wpdb->prefix}wc_orders", + 'range_field' => 'id', + 'key_fields' => array( 'id' ), + 'checksum_fields' => array( 'date_updated_gmt', 'total_amount' ), + 'checksum_text_fields' => array( 'type', 'status' ), + 'filter_values' => array( + 'type' => array( + 'operator' => 'IN', + 'values' => WooCommerce_HPOS_Orders::get_order_types_to_sync( true ), + ), + 'status' => array( + 'operator' => 'IN', + 'values' => WooCommerce_HPOS_Orders::get_all_possible_order_status_keys(), + ), + ), + 'is_table_enabled_callback' => 'Automattic\Jetpack\Sync\Replicastore\Table_Checksum::enable_woocommerce_hpos_tables', + ), + 'wc_order_addresses' => array( + 'table' => "{$wpdb->prefix}wc_order_addresses", + 'range_field' => 'order_id', + 'key_fields' => array( 'order_id', 'address_type' ), + 'checksum_text_fields' => array( 'address_type' ), + 'parent_table' => 'wc_orders', + 'parent_join_field' => 'id', + 'table_join_field' => 'order_id', + 'filter_values' => array(), + 'is_table_enabled_callback' => 'Automattic\Jetpack\Sync\Replicastore\Table_Checksum::enable_woocommerce_hpos_tables', + ), + 'wc_order_operational_data' => array( + 'table' => "{$wpdb->prefix}wc_order_operational_data", + 'range_field' => 'order_id', + 'key_fields' => array( 'order_id' ), + 'checksum_fields' => array( 'date_paid_gmt', 'date_completed_gmt' ), + 'checksum_text_fields' => array( 'order_key' ), + 'parent_table' => 'wc_orders', + 'parent_join_field' => 'id', + 'table_join_field' => 'order_id', + 'filter_values' => array(), + 'is_table_enabled_callback' => 'Automattic\Jetpack\Sync\Replicastore\Table_Checksum::enable_woocommerce_hpos_tables', + ), + 'users' => array( + 'table' => $wpdb->users, + 'range_field' => 'ID', + 'key_fields' => array( 'ID' ), + 'checksum_text_fields' => array( 'user_login', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_status', 'display_name' ), + 'filter_values' => array(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'users' ); + }, + ), + + /** + * Usermeta is a special table, as it needs to use a custom override flow, + * as the user roles, capabilities, locale, mime types can be filtered by plugins. + * This prevents us from doing a direct comparison in the database. + */ + 'usermeta' => array( + 'table' => $wpdb->users, + /** + * Range field points to ID, which in this case is the `WP_User` ID, + * since we're querying the whole WP_User objects, instead of meta entries in the DB. + */ + 'range_field' => 'ID', + 'key_fields' => array(), + 'checksum_fields' => array(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'users' ); + }, + ), + ); + } + + /** + * Prepare field params based off provided configuration. + * + * @param array $table_configuration The table configuration array. + */ + protected function prepare_fields( $table_configuration ) { + $this->key_fields = $table_configuration['key_fields']; + $this->range_field = $table_configuration['range_field']; + $this->checksum_fields = isset( $table_configuration['checksum_fields'] ) ? $table_configuration['checksum_fields'] : array(); + $this->checksum_text_fields = isset( $table_configuration['checksum_text_fields'] ) ? $table_configuration['checksum_text_fields'] : array(); + $this->filter_values = isset( $table_configuration['filter_values'] ) ? $table_configuration['filter_values'] : null; + $this->additional_filter_sql = ! empty( $table_configuration['filter_sql'] ) ? $table_configuration['filter_sql'] : ''; + $this->parent_table = isset( $table_configuration['parent_table'] ) ? $table_configuration['parent_table'] : null; + $this->parent_join_field = isset( $table_configuration['parent_join_field'] ) ? $table_configuration['parent_join_field'] : $table_configuration['range_field']; + $this->table_join_field = isset( $table_configuration['table_join_field'] ) ? $table_configuration['table_join_field'] : $table_configuration['range_field']; + $this->is_table_enabled_callback = isset( $table_configuration['is_table_enabled_callback'] ) ? $table_configuration['is_table_enabled_callback'] : false; + } + + /** + * Verify provided table name is valid for checksum processing. + * + * @param string $table Table name to validate. + * + * @return mixed|string + * @throws Exception Throw an exception on validation failure. + */ + protected function validate_table_name( $table ) { + if ( empty( $table ) ) { + throw new Exception( 'Invalid table name: empty' ); + } + + if ( ! array_key_exists( $table, $this->allowed_tables ) ) { + throw new Exception( "Invalid table name: $table not allowed" ); + } + + return $this->allowed_tables[ $table ]['table']; + } + + /** + * Verify provided fields are proper names. + * + * @param array $fields Array of field names to validate. + * + * @throws Exception Throw an exception on failure to validate. + */ + protected function validate_fields( $fields ) { + foreach ( $fields as $field ) { + if ( ! preg_match( '/^[0-9,a-z,A-Z$_]+$/i', $field ) ) { + throw new Exception( "Invalid field name: $field is not allowed" ); + } + + // TODO other verifications of the field names. + } + } + + /** + * Verify the fields exist in the table. + * + * @param array $fields Array of fields to validate. + * + * @return bool + * @throws Exception Throw an exception on failure to validate. + */ + protected function validate_fields_against_table( $fields ) { + global $wpdb; + + $valid_fields = array(); + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $result = $wpdb->get_results( "SHOW COLUMNS FROM {$this->table}", ARRAY_A ); + + foreach ( $result as $result_row ) { + $valid_fields[] = $result_row['Field']; + } + + // Check if the fields are actually contained in the table. + foreach ( $fields as $field_to_check ) { + if ( ! in_array( $field_to_check, $valid_fields, true ) ) { + throw new Exception( "Invalid field name: field '{$field_to_check}' doesn't exist in table {$this->table}" ); + } + } + + return true; + } + + /** + * Verify the configured fields. + * + * @throws Exception Throw an exception on failure to validate in the internal functions. + */ + protected function validate_input() { + $fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields, $this->checksum_text_fields ); + + $this->validate_fields( $fields ); + $this->validate_fields_against_table( $fields ); + } + + /** + * Prepare filter values as SQL statements to be added to the other filters. + * + * @param array $filter_values The filter values array. + * @param string $table_prefix If the values are going to be used in a sub-query, add a prefix with the table alias. + * + * @return array|null + */ + protected function prepare_filter_values_as_sql( $filter_values = array(), $table_prefix = '' ) { + global $wpdb; + + if ( ! is_array( $filter_values ) ) { + return null; + } + + $result = array(); + + foreach ( $filter_values as $field => $filter ) { + $key = ( ! empty( $table_prefix ) ? $table_prefix : $this->table ) . '.' . $field; + + switch ( $filter['operator'] ) { + case 'IN': + case 'NOT IN': + $filter_values_count = is_countable( $filter['values'] ) ? count( $filter['values'] ) : 0; + $values_placeholders = implode( ',', array_fill( 0, $filter_values_count, '%s' ) ); + $statement = "{$key} {$filter['operator']} ( $values_placeholders )"; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $prepared_statement = $wpdb->prepare( $statement, $filter['values'] ); + + $result[] = $prepared_statement; + break; + } + } + + return $result; + } + + /** + * Build the filter query baased off range fields and values and the additional sql. + * + * @param int|null $range_from Start of the range. + * @param int|null $range_to End of the range. + * @param array|null $filter_values Additional filter values. Not used at the moment. + * @param string $table_prefix Table name to be prefixed to the columns. Used in sub-queries where columns can clash. + * + * @return string + */ + public function build_filter_statement( $range_from = null, $range_to = null, $filter_values = null, $table_prefix = '' ) { + global $wpdb; + + // If there is a field prefix that we want to use with table aliases. + $parent_prefix = ( ! empty( $table_prefix ) ? $table_prefix : $this->table ) . '.'; + + /** + * Prepare the ranges. + */ + + $filter_array = array( '1 = 1' ); + if ( null !== $range_from ) { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $filter_array[] = $wpdb->prepare( "{$parent_prefix}{$this->range_field} >= %d", array( intval( $range_from ) ) ); + } + if ( null !== $range_to ) { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $filter_array[] = $wpdb->prepare( "{$parent_prefix}{$this->range_field} <= %d", array( intval( $range_to ) ) ); + } + + /** + * End prepare the ranges. + */ + + /** + * Prepare data filters. + */ + + // Default filters. + if ( $this->filter_values ) { + $prepared_values_statements = $this->prepare_filter_values_as_sql( $this->filter_values, $table_prefix ); + if ( $prepared_values_statements ) { + $filter_array = array_merge( $filter_array, $prepared_values_statements ); + } + } + + // Additional filters. + if ( ! empty( $filter_values ) ) { + // Prepare filtering. + $prepared_values_statements = $this->prepare_filter_values_as_sql( $filter_values, $table_prefix ); + if ( $prepared_values_statements ) { + $filter_array = array_merge( $filter_array, $prepared_values_statements ); + } + } + + // Add any additional filters via direct SQL statement. + // Currently used only because we haven't converted all filtering to happen via `filter_values`. + // This SQL is NOT prefixed and column clashes can occur when used in sub-queries. + if ( $this->additional_filter_sql ) { + $filter_array[] = $this->additional_filter_sql; + } + + /** + * End prepare data filters. + */ + return implode( ' AND ', $filter_array ); + } + + /** + * Returns the checksum query. All validation of fields and configurations are expected to occur prior to usage. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param array|null $filter_values Additional filter values. Not used at the moment. + * @param bool $granular_result If the function should return a granular result. + * + * @return string + * + * @throws Exception Throws an exception if validation fails in the internal function calls. + */ + protected function build_checksum_query( $range_from = null, $range_to = null, $filter_values = null, $granular_result = false ) { + global $wpdb; + + // Escape the salt. + $salt = $wpdb->prepare( '%s', $this->salt ); + + // Prepare the compound key. + $key_fields = array(); + + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->key_fields as $field ) { + $key_fields[] = $this->table . '.' . $field; + } + + $key_fields = implode( ',', $key_fields ); + + // Prepare the checksum fields. + $checksum_fields = array(); + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->checksum_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + // Apply latin1 conversion if enabled. + if ( $this->perform_text_conversion ) { + // Convert text fields to allow for encoding discrepancies as WP.com is latin1. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = 'CONVERT(' . $this->table . '.' . $field . ' using latin1 )'; + } + } else { + // Conversion disabled, default to table prefixing. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + } + + $checksum_fields_string = implode( ',', array_merge( $checksum_fields, array( $salt ) ) ); + + $additional_fields = ''; + if ( $granular_result ) { + // TODO uniq the fields as sometimes(most) range_index is the key and there's no need to select the same field twice. + $additional_fields = " + {$this->table}.{$this->range_field} as range_index, + {$key_fields}, + "; + } + + $filter_stamenet = $this->build_filter_statement( $range_from, $range_to, $filter_values ); + + $join_statement = ''; + if ( $this->parent_table ) { + $parent_table_obj = new Table_Checksum( $this->parent_table ); + $parent_filter_query = $parent_table_obj->build_filter_statement( null, null, null, 'parent_table' ); + + // It is possible to have the GROUP By cause multiple rows to be returned for the same row for term_taxonomy. + // To get distinct entries we use a correlatd subquery back on the parent table using the primary key. + $additional_unique_clause = ''; + if ( 'term_taxonomy' === $this->parent_table ) { + $additional_unique_clause = " + AND parent_table.{$parent_table_obj->range_field} = ( + SELECT min( parent_table_cs.{$parent_table_obj->range_field} ) + FROM {$parent_table_obj->table} as parent_table_cs + WHERE parent_table_cs.{$this->parent_join_field} = {$this->table}.{$this->table_join_field} + ) + "; + } + + $join_statement = " + INNER JOIN {$parent_table_obj->table} as parent_table + ON ( + {$this->table}.{$this->table_join_field} = parent_table.{$this->parent_join_field} + AND {$parent_filter_query} + $additional_unique_clause + ) + "; + } + + $query = " + SELECT + {$additional_fields} + SUM( + CRC32( + CONCAT_WS( '#', {$salt}, {$checksum_fields_string} ) + ) + ) AS checksum + FROM + {$this->table} + {$join_statement} + WHERE + {$filter_stamenet} + "; + + /** + * We need the GROUP BY only for compound keys. + */ + if ( $granular_result ) { + $query .= " + GROUP BY {$key_fields} + LIMIT 9999999 + "; + } + + return $query; + } + + /** + * Obtain the min-max values (edges) of the range. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param int|null $limit How many values to return. + * + * @return array|object|void + * @throws Exception Throws an exception if validation fails on the internal function calls. + */ + public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) { + global $wpdb; + + $this->validate_fields( array( $this->range_field ) ); + + // Performance :: When getting the postmeta range we do not want to filter by the whitelist. + // The reason for this is that it leads to a non-performant query that can timeout. + // Instead lets get the range based on posts regardless of meta. + $filter_values = $this->filter_values; + if ( $wpdb->postmeta === $this->table ) { + $this->filter_values = null; + } + + // `trim()` to make sure we don't add the statement if it's empty. + $filters = trim( $this->build_filter_statement( $range_from, $range_to ) ); + + // Reset Post meta filter. + if ( $wpdb->postmeta === $this->table ) { + $this->filter_values = $filter_values; + } + + $filter_statement = ''; + if ( ! empty( $filters ) ) { + $filter_statement = " + WHERE + {$filters} + "; + } + + // Only make the distinct count when we know there can be multiple entries for the range column. + $distinct_count = ''; + if ( count( $this->key_fields ) > 1 || $wpdb->terms === $this->table || $wpdb->term_relationships === $this->table ) { + $distinct_count = 'DISTINCT'; + } + + $query = " + SELECT + MIN({$this->range_field}) as min_range, + MAX({$this->range_field}) as max_range, + COUNT( {$distinct_count} {$this->range_field}) as item_count + FROM + "; + + /** + * If `$limit` is not specified, we can directly use the table. + */ + if ( ! $limit ) { + $query .= " + {$this->table} + {$filter_statement} + "; + } else { + /** + * If there is `$limit` specified, we can't directly use `MIN/MAX()` as they don't work with `LIMIT`. + * That's why we will alter the query for this case. + */ + $limit = intval( $limit ); + + $query .= " + ( + SELECT + {$distinct_count} {$this->range_field} + FROM + {$this->table} + {$filter_statement} + ORDER BY + {$this->range_field} ASC + LIMIT {$limit} + ) as ids_query + "; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_row( $query, ARRAY_A ); + + if ( ! $result || ! is_array( $result ) ) { + throw new Exception( 'Unable to get range edges' ); + } + + return $result; + } + + /** + * Update the results to have key/checksum format. + * + * @param array $results Prepare the results for output of granular results. + */ + protected function prepare_results_for_output( &$results ) { + // get the compound key. + // only return range and compound key for granular results. + + $return_value = array(); + + foreach ( $results as &$result ) { + // Working on reference to save memory here. + + $key = array(); + foreach ( $this->key_fields as $field ) { + $key[] = $result[ $field ]; + } + + $return_value[ implode( '-', $key ) ] = $result['checksum']; + } + + return $return_value; + } + + /** + * Calculate the checksum based on provided range and filters. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param array|null $filter_values Additional filter values. Not used at the moment. + * @param bool $granular_result If the returned result should be granular or only the checksum. + * @param bool $simple_return_value If we want to use a simple return value for non-granular results (return only the checksum, without wrappers). + * + * @return array|mixed|object|WP_Error|null + */ + public function calculate_checksum( $range_from = null, $range_to = null, $filter_values = null, $granular_result = false, $simple_return_value = true ) { + + if ( ! Sync\Settings::is_checksum_enabled() ) { + return new WP_Error( 'checksum_disabled', 'Checksums are currently disabled.' ); + } + + try { + $this->validate_input(); + } catch ( Exception $ex ) { + return new WP_Error( 'invalid_input', $ex->getMessage() ); + } + + $query = $this->build_checksum_query( $range_from, $range_to, $filter_values, $granular_result ); + + global $wpdb; + + if ( ! $granular_result ) { + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_row( $query, ARRAY_A ); + + if ( ! is_array( $result ) ) { + return new WP_Error( 'invalid_query', "Result wasn't an array" ); + } + + if ( $simple_return_value ) { + return $result['checksum']; + } + + return array( + 'range' => $range_from . '-' . $range_to, + 'checksum' => $result['checksum'], + ); + } else { + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_results( $query, ARRAY_A ); + return $this->prepare_results_for_output( $result ); + } + } + + /** + * Make sure the WooCommerce tables should be enabled for Checksum/Fix. + * + * @return bool + */ + protected function enable_woocommerce_tables() { + /** + * On WordPress.com, we can't directly check if the site has support for WooCommerce. + * Having the option to override the functionality here helps with syncing WooCommerce tables. + * + * @since 10.1 + * + * @param bool If we should we force-enable WooCommerce tables support. + */ + $force_woocommerce_support = apply_filters( 'jetpack_table_checksum_force_enable_woocommerce', false ); + + // If we're forcing WooCommerce tables support, there's no need to check further. + // This is used on WordPress.com. + if ( $force_woocommerce_support ) { + return true; + } + + // No need to proceed if WooCommerce is not available. + if ( ! class_exists( 'WooCommerce' ) ) { + return false; + } + + // TODO more checks if needed. Probably query the DB to make sure the tables exist. + + return true; + } + + /** + * Make sure the WooCommerce HPOS tables should be enabled for Checksum/Fix. + * + * @see Automattic\Jetpack\SyncActions::initialize_woocommerce + * + * @since 3.3.0 + * + * @return bool + */ + public static function enable_woocommerce_hpos_tables() { + /** + * On WordPress.com, we can't directly check if the site has support for WooCommerce HPOS tables. + * Having the option to override the functionality here helps with syncing WooCommerce HPOS tables. + * + * @since 3.3.0 + * + * @param bool If we should we force-enable WooCommerce HPOS tables support. + */ + $force_woocommerce_hpos_support = apply_filters( 'jetpack_table_checksum_force_enable_woocommerce_hpos', false ); + + // If we're forcing WooCommerce HPOS tables support, there's no need to check further. + // This is used on WordPress.com. + if ( $force_woocommerce_hpos_support ) { + return true; + } + + // If the 'woocommerce_hpos_orders' module is enabled, this means that WooCommerce class exists + // and HPOS is enabled too. + return false !== Sync\Modules::get_module( 'woocommerce_hpos_orders' ); + } + + /** + * Prepare and append custom columns to the list of columns that we run the checksum on. + * + * @param string|array $additional_columns List of additional columns. + * + * @return void + * @throws Exception When field validation fails. + */ + protected function prepare_additional_columns( $additional_columns ) { + /** + * No need to do anything if the parameter is not provided or empty. + */ + if ( empty( $additional_columns ) ) { + return; + } + + if ( ! is_array( $additional_columns ) ) { + if ( ! is_string( $additional_columns ) ) { + throw new Exception( 'Invalid value for additional fields' ); + } + + $additional_columns = explode( ',', $additional_columns ); + } + + /** + * Validate the fields. If any don't conform to the required norms, we will throw an exception and + * halt code here. + */ + $this->validate_fields( $additional_columns ); + + /** + * Assign the fields to the checksum_fields to be used in the checksum later. + * + * We're adding the fields to the rest of the `checksum_fields`, so we don't need + * to implement extra logic just for the additional fields. + */ + $this->checksum_fields = array_unique( + array_merge( + $this->checksum_fields, + $additional_columns + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-options.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-options.php new file mode 100644 index 00000000..865d6b3b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-options.php @@ -0,0 +1,291 @@ +queue_id = $queue_id; + } + + /** + * Insert an item in the queue. + * + * @param string $item_id The item ID. + * @param string $item Serialized item data. + * + * @return bool If the item was added. + */ + public function insert_item( $item_id, $item ) { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + $rows_added = $wpdb->query( + $wpdb->prepare( + "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES (%s, %s,%s)", + $item_id, + $item, + 'no' + ) + ); + + return ( 0 !== $rows_added ); + } + + /** + * Fetch items from the queue. + * + * @param int|null $item_count How many items to fetch from the queue. + * The parameter is null-able, if no limit on the amount of items. + * + * @return array|object|\stdClass[]|null + */ + public function fetch_items( $item_count ) { + global $wpdb; + + // TODO make it more simple for the $item_count + if ( $item_count ) { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + $items = $wpdb->get_results( + $wpdb->prepare( + "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT %d", + "jpsq_{$this->queue_id}-%", + $item_count + ), + OBJECT + ); + } else { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + $items = $wpdb->get_results( + $wpdb->prepare( + "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC", + "jpsq_{$this->queue_id}-%" + ), + OBJECT + ); + } + + return $items; + } + + /** + * Fetches items with specific IDs from the Queue. + * + * @param array $items_ids Items IDs to fetch from the queue. + * + * @return \stdClass[]|null + */ + public function fetch_items_by_ids( $items_ids ) { + global $wpdb; + + // return early if $items_ids is empty or not an array. + if ( empty( $items_ids ) || ! is_array( $items_ids ) ) { + return array(); + } + + $ids_placeholders = implode( ', ', array_fill( 0, count( $items_ids ), '%s' ) ); + + $query_with_placeholders = "SELECT option_name AS id, option_value AS value + FROM $wpdb->options + WHERE option_name IN ( $ids_placeholders )"; + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + $items = $wpdb->get_results( + $wpdb->prepare( + $query_with_placeholders, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $items_ids + ), + OBJECT + ); + + return $items; + } + + /** + * Clear out the queue. + * + * @return bool|int|\mysqli_result|resource|null + */ + public function clear_queue() { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + return $wpdb->query( + $wpdb->prepare( + "DELETE FROM $wpdb->options WHERE option_name LIKE %s", + "jpsq_{$this->queue_id}-%" + ) + ); + } + + /** + * Check how many items are in the queue. + * + * @return int + */ + public function get_item_count() { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + return (int) $wpdb->get_var( + $wpdb->prepare( + "SELECT count(*) FROM $wpdb->options WHERE option_name LIKE %s", + "jpsq_{$this->queue_id}-%" + ) + ); + } + + /** + * Return the lag amount for the queue. + * + * @param float|int|null $now A timestamp to use as starting point when calculating the lag. + * + * @return float|int The lag amount. + */ + public function get_lag( $now = null ) { + global $wpdb; + + // TODO replace with peek and a flag to fetch only the name. + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + $first_item_name = $wpdb->get_var( + $wpdb->prepare( + "SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT 1", + "jpsq_{$this->queue_id}-%" + ) + ); + + if ( ! $first_item_name ) { + return 0; + } + + if ( null === $now ) { + $now = microtime( true ); + } + + // Break apart the item name to get the timestamp. + $matches = null; + if ( preg_match( '/^jpsq_' . $this->queue_id . '-(\d+\.\d+)-/', $first_item_name, $matches ) ) { + return $now - (float) $matches[1]; + } else { + return 0; + } + } + + /** + * Add multiple items to the queue at once. + * + * @param array $items Array of items to add. + * @param string $id_prefix Prefix to use for all the items. + * + * @return bool|int|\mysqli_result|resource|null + */ + public function add_all( $items, $id_prefix ) { + global $wpdb; + + $query = "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES "; + + $rows = array(); + $count_items = count( $items ); + for ( $i = 0; $i < $count_items; ++$i ) { + // skip empty items. + if ( empty( $items[ $i ] ) ) { + continue; + } + try { + $option_name = esc_sql( $id_prefix . '-' . $i ); + $option_value = esc_sql( serialize( $items[ $i ] ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + $rows[] = "('$option_name', '$option_value', 'no')"; + } catch ( \Exception $e ) { + // Item cannot be serialized so skip. + continue; + } + } + + $rows_added = $wpdb->query( $query . implode( ',', $rows ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + + return $rows_added; + } + + /** + * Return $max_count items from the queue, including their value string length. + * + * @param int $max_count How many items to fetch from the queue. + * + * @return object[]|null + */ + public function get_items_ids_with_size( $max_count ) { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + return $wpdb->get_results( + $wpdb->prepare( + "SELECT option_name AS id, LENGTH(option_value) AS value_size FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT %d", + "jpsq_{$this->queue_id}-%", + $max_count + ), + OBJECT + ); + } + + /** + * Delete items with specific IDs from the queue. + * + * @param array $ids IDs of the items to remove from the queue. + * + * @return bool|int|\mysqli_result|resource|null + */ + public function delete_items_by_ids( $ids ) { + global $wpdb; + + if ( ! is_array( $ids ) || empty( $ids ) ) { + return false; + } + + // TODO check if it's working properly - no need to delete all options in the table if the params are not right + $ids_placeholders = implode( ', ', array_fill( 0, count( $ids ), '%s' ) ); + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + return $wpdb->query( + $wpdb->prepare( + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$ids_placeholders`, as we're preparing them above and are a dynamic count. + */ + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare + "DELETE FROM {$wpdb->options} WHERE option_name IN ( $ids_placeholders )", + $ids + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php new file mode 100644 index 00000000..7fd459b9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php @@ -0,0 +1,691 @@ +queue_id = $queue_id; + + // Initialize the `table_name` property with the correct prefix for easier usage in the class. + $this->table_name = $wpdb->prefix . $this->table_name_no_prefix; + } + + /** + * Creates the new table and updates the options to work with + * the new table if it was created successfully. + * + * @return void + */ + protected function create_table() { + global $wpdb; + + require_once ABSPATH . '/wp-admin/includes/upgrade.php'; + + $charset_collate = $wpdb->get_charset_collate(); + + $table_definition = "CREATE TABLE {$this->table_name} ( + `ID` bigint(20) NOT NULL AUTO_INCREMENT, + `queue_id` varchar(50) NOT NULL, + `event_id` varchar(100) NOT NULL, + `event_payload` longtext NOT NULL, + `timestamp` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`ID`), + KEY `event_id` (`event_id`), + KEY `queue_id` (`queue_id`), + KEY `queue_id_event_id` (queue_id, event_id), + KEY `timestamp` (`timestamp`) + ) $charset_collate;"; + + /** + * The function dbDelta will only return the differences. If the table exists, the result will be empty, + * so let's run a check afterward to see if the table exists and is healthy. + */ + \dbDelta( $table_definition ); + } + + /** + * Check if the Custom table actually exists. + * + * @return bool + */ + protected function custom_table_exists() { + global $wpdb; + + // Check if the table exists + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $result = $wpdb->get_row( + $wpdb->prepare( 'SHOW TABLES LIKE %s', $this->table_name ), + ARRAY_N + ); + + if ( empty( $result ) || count( $result ) !== 1 || $result[0] !== $this->table_name ) { + return false; + } + + return true; + } + /** + * Check if the table is healthy, and we can read and write from/to it. + * + * @return true|\WP_Error If the custom table is available, and we can read and write from/to it. + */ + protected function is_custom_table_healthy() { + global $wpdb; + + if ( ! $this->custom_table_exists() ) { + return new \WP_Error( 'custom_table_not_exist', 'Jetpack Sync Custom table: Table does not exist' ); + } + + // Try to read from the table + + // Ignore the interpolated table name + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $query = $wpdb->query( "SELECT count(`ID`) FROM {$this->table_name}" ); + + if ( $query === false ) { + // The query failed to select anything from the table, so there must be an issue reading from it. + return new \WP_Error( 'custom_table_unable_to_read', 'Jetpack Sync Custom table: Unable to read from table' ); + } + + if ( $wpdb->last_error ) { + // There was an error reading, that's not necessarily failing the query. + // TODO check if we need this error check. + // TODO add more information about the erorr in the return value. + return new \WP_Error( 'custom_table_unable_to_read_sql_error', 'Jetpack Sync Custom table: Unable to read from table - SQL error' ); + } + + // Check if we can write in the table + if ( ! $this->insert_item( 'test', 'test' ) ) { + return new \WP_Error( 'custom_table_unable_to_writeread', 'Jetpack Sync Custom table: Unable to write into table' ); + } + + // See if we can read the item back + $items = $this->fetch_items_by_ids( array( 'test' ) ); + if ( empty( $items ) || ! is_object( $items[0] ) || $items[0]->value !== 'test' ) { + return new \WP_Error( 'custom_table_unable_to_writeread', 'Jetpack Sync Custom table: Unable to read item after writing' ); + } + + // Try to insert an item, read it back and then delete it. + $this->delete_items_by_ids( array( 'test' ) ); + + // Try to fetch the item back. It should not exist. + $items = $this->fetch_items_by_ids( array( 'test' ) ); + if ( ! empty( $items ) ) { + return new \WP_Error( 'custom_table_unable_to_writeread', 'Jetpack Sync Custom table: Unable to delete from table' ); + } + + return true; + } + + /** + * Drop the custom table as part of cleanup. + * + * @return bool If the table is cleared. + */ + public function drop_table() { + global $wpdb; + + if ( $this->custom_table_exists() ) { + // Ignoring the linting warning, as there's still no placeholder replacement for DB field name. + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.SchemaChange + return (bool) $wpdb->query( "DROP TABLE {$this->table_name}" ); + } + } + + /** + * Queue API implementation + */ + + /** + * Insert an item in the queue. + * + * @param string $item_id The item ID. + * @param string $item Serialized item data. + * + * @return bool If the item was added. + */ + public function insert_item( $item_id, $item ) { + global $wpdb; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $rows_added = $wpdb->query( + $wpdb->prepare( + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$this->table_name` + */ + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "INSERT INTO {$this->table_name} (queue_id, event_id, event_payload) VALUES (%s, %s,%s)", + $this->queue_id, + $item_id, + $item + ) + ); + + return ( 0 !== $rows_added ); + } + + /** + * Fetch items from the queue. + * + * @param int|null $item_count How many items to fetch from the queue. + * The parameter is null-able, if no limit on the amount of items. + * + * @return object[]|null + */ + public function fetch_items( $item_count ) { + global $wpdb; + + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$this->table_name` + */ + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared + + // TODO make it more simple for the $item_count + if ( $item_count ) { + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $items = $wpdb->get_results( + $wpdb->prepare( + " + SELECT + event_id AS id, + event_payload AS value + FROM {$this->table_name} + WHERE queue_id LIKE %s + ORDER BY event_id ASC + LIMIT %d + ", + $this->queue_id, + $item_count + ) + ); + } else { + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $items = $wpdb->get_results( + $wpdb->prepare( + " + SELECT + event_id AS id, + event_payload AS value + FROM {$this->table_name} + WHERE queue_id LIKE %s + ORDER BY event_id ASC + ", + $this->queue_id + ) + ); + } + + // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared + + return $items; + } + + /** + * Fetches items with specific IDs from the Queue. + * + * @param array $items_ids Items IDs to fetch from the queue. + * + * @return object[]|null + */ + public function fetch_items_by_ids( $items_ids ) { + global $wpdb; + + // return early if $items_ids is empty or not an array. + if ( empty( $items_ids ) || ! is_array( $items_ids ) ) { + return array(); + } + + $ids_placeholders = implode( ', ', array_fill( 0, count( $items_ids ), '%s' ) ); + $query_with_placeholders = "SELECT event_id AS id, event_payload AS value + FROM {$this->table_name} + WHERE queue_id = %s AND event_id IN ( $ids_placeholders )"; + + $replacement_values = array_merge( array( $this->queue_id ), $items_ids ); + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $items = $wpdb->get_results( + $wpdb->prepare( + $query_with_placeholders, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $replacement_values + ), + OBJECT + ); + + return $items; + } + + /** + * Check how many items are in the queue. + * + * @return int + */ + public function get_item_count() { + global $wpdb; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $items_count = (int) $wpdb->get_var( + $wpdb->prepare( + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$this->table_name` + */ + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT COUNT(*) FROM {$this->table_name} WHERE queue_id = %s", + $this->queue_id + ) + ); + // If the table does not exist, disable the custom queue table and send an error. + if ( ! empty( $wpdb->last_error ) + && str_contains( $wpdb->last_error, $this->table_name_no_prefix . "' doesn't exist" ) + && ! get_transient( self::CUSTOM_QUEUE_TABLE_DISABLE_WPDB_ERROR_NOT_EXIST_FLAG ) + ) { + set_transient( self::CUSTOM_QUEUE_TABLE_DISABLE_WPDB_ERROR_NOT_EXIST_FLAG, true, 6 * HOUR_IN_SECONDS ); + Settings::update_settings( array( 'custom_queue_table_enabled' => 0 ) ); + $data = array( + 'timestamp' => microtime( true ), + 'error' => $wpdb->last_error, + ); + $sender = Sender::get_instance(); + $sender->send_action( 'jetpack_sync_storage_error_custom_table_not_exist', $data ); + } + + return $items_count; + } + + /** + * Clear out the queue. + * + * @return bool|int|\mysqli_result|resource|null + */ + public function clear_queue() { + global $wpdb; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->query( + $wpdb->prepare( + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$this->table_name` + */ + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "DELETE FROM {$this->table_name} WHERE queue_id = %s", + $this->queue_id + ) + ); + } + + /** + * Return the lag amount for the queue. + * + * @param float|int|null $now A timestamp to use as starting point when calculating the lag. + * + * @return float|int The lag amount. + */ + public function get_lag( $now = null ) { + global $wpdb; + + // TODO replace with peek and a flag to fetch only the name. + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $first_item_name = $wpdb->get_var( + $wpdb->prepare( + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$this->table_name` + */ + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT event_id FROM {$this->table_name} WHERE queue_id = %s ORDER BY event_id ASC LIMIT 1", + $this->queue_id + ) + ); + + if ( ! $first_item_name ) { + return 0; + } + + if ( null === $now ) { + $now = microtime( true ); + } + + // Break apart the item name to get the timestamp. + $matches = null; + if ( preg_match( '/^jpsq_' . $this->queue_id . '-(\d+\.\d+)-/', $first_item_name, $matches ) ) { + return $now - (float) $matches[1]; + } else { + return 0; + } + } + + /** + * Add multiple items to the queue at once. + * + * @param array $items Array of items to add. + * @param string $id_prefix Prefix to use for all the items. + * + * @return bool|int|\mysqli_result|resource|null + */ + public function add_all( $items, $id_prefix ) { + global $wpdb; + + $query = "INSERT INTO {$this->table_name} (queue_id, event_id, event_payload ) VALUES "; + + $rows = array(); + $count_items = count( $items ); + for ( $i = 0; $i < $count_items; ++$i ) { + // skip empty items. + if ( empty( $items[ $i ] ) ) { + continue; + } + try { + $event_id = esc_sql( $id_prefix . '-' . $i ); + $event_payload = esc_sql( serialize( $items[ $i ] ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + $rows[] = "('{$this->queue_id}', '$event_id','$event_payload')"; + } catch ( \Exception $e ) { + // Item cannot be serialized so skip. + continue; + } + } + + $rows_added = $wpdb->query( $query . implode( ',', $rows ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + + return $rows_added; + } + + /** + * Return $max_count items from the queue, including their value string length. + * + * @param int $max_count How many items to fetch from the queue. + * + * @return object[]|null + */ + public function get_items_ids_with_size( $max_count ) { + global $wpdb; + + // TODO optimize the fetch to happen by queue name not by the IDs as it can be issue cross-queues. + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->get_results( + $wpdb->prepare( + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$this->table_name` + */ + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT event_id AS id, LENGTH( event_payload ) AS value_size FROM {$this->table_name} WHERE queue_id = %s ORDER BY event_id ASC LIMIT %d", + $this->queue_id, + $max_count + ), + OBJECT + ); + } + + /** + * Delete items with specific IDs from the queue. + * + * @param array $ids IDs of the items to remove from the queue. + * + * @return bool|int|\mysqli_result|resource|null + */ + public function delete_items_by_ids( $ids ) { + global $wpdb; + $ids_placeholders = implode( ', ', array_fill( 0, count( $ids ), '%s' ) ); + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->query( + $wpdb->prepare( + /** + * Ignoring the linting warning, as there's still no placeholder replacement for DB field name, + * in this case this is `$this->table_name` + */ + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "DELETE FROM {$this->table_name} WHERE queue_id = %s AND event_id IN ( $ids_placeholders )", + array_merge( array( $this->queue_id ), $ids ) + ) + ); + } + + /** + * Table initialization + */ + public static function initialize_custom_sync_table() { + /** + * Initialize an instance of the class with a test name, so we can use table prefix and then test if the table is healthy. + */ + $custom_table_instance = new Queue_Storage_Table( 'test_queue' ); + + // Check if the table exists + if ( ! $custom_table_instance->custom_table_exists() ) { + $custom_table_instance->create_table(); + } + + return $custom_table_instance->is_custom_table_healthy(); + } + + /** + * Migrates the existing Sync events from the options table to the Custom table + * + * @return bool + */ + public static function migrate_from_options_table_to_custom_table() { + global $wpdb; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching + $count_result = $wpdb->get_row( + " + SELECT + COUNT(*) as item_count + FROM + {$wpdb->options} + WHERE + option_name LIKE 'jpsq_%' + " + ); + + $item_count = $count_result->item_count; + + $limit = 100; + $offset = 0; + + do { + // get all the records from the options table + $query = " + SELECT + option_name as event_id, + option_value as event_payload + FROM + {$wpdb->options} + WHERE + option_name LIKE 'jpsq_%' + ORDER BY + option_name ASC + LIMIT $offset, $limit + "; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.NotPrepared + $rows = $wpdb->get_results( $query ); + + $insert_rows = array(); + + foreach ( $rows as $event ) { + $event_id = $event->event_id; + + // Parse the event + if ( + preg_match( + '!jpsq_(?P[^-]+)-(?P[^-]+)-.+!', + $event_id, + $events_matches + ) + ) { + $queue_id = $events_matches['queue_id']; + $timestamp = $events_matches['timestamp']; + + $insert_rows[] = $wpdb->prepare( + '(%s, %s, %s, %s)', + array( + $queue_id, + $event_id, + $event->event_payload, + (int) $timestamp, + ) + ); + } + } + + // Instantiate table storage, so we can get the table name. Queue ID is just a placeholder here. + $queue_table_storage = new Queue_Storage_Table( 'test_queue' ); + + if ( ! empty( $insert_rows ) ) { + $insert_query = 'INSERT INTO ' . $queue_table_storage->table_name . ' (queue_id, event_id, event_payload, timestamp) VALUES '; + + $insert_query .= implode( ',', $insert_rows ); + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.NotPrepared + $wpdb->query( $insert_query ); + } + + $offset += $limit; + } while ( $offset < $item_count ); + + // Clear out the options queue + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.NotPrepared + $wpdb->query( + $wpdb->prepare( + "DELETE FROM $wpdb->options WHERE option_name LIKE %s", + 'jpsq_%-%' + ) + ); + + return true; + } + + /** + * Migrates the existing Sync events from the Custom table to the Options table + * + * @return void + */ + public static function migrate_from_custom_table_to_options_table() { + global $wpdb; + + // Instantiate table storage, so we can get the table name. Queue ID is just a placeholder here. + $queue_table_storage = new Queue_Storage_Table( 'test_queue' ); + $custom_table_name = $queue_table_storage->table_name; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $count_result = $wpdb->get_row( "SELECT COUNT(*) as item_count FROM {$custom_table_name}" ); + + if ( $wpdb->last_error ) { + return; + } + + $item_count = $count_result->item_count; + + $limit = 100; + $offset = 0; + + do { + // get all the records from the options table + $query = " + SELECT + event_id, + event_payload + FROM + {$custom_table_name} + ORDER BY + event_id ASC + LIMIT $offset, $limit + "; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.NotPrepared + $rows = $wpdb->get_results( $query ); + + $insert_rows = array(); + + foreach ( $rows as $event ) { + $insert_rows[] = $wpdb->prepare( + '(%s, %s, "no")', + array( + $event->event_id, + $event->event_payload, + ) + ); + } + + if ( ! empty( $insert_rows ) ) { + $insert_query = "INSERT INTO {$wpdb->options} (option_name, option_value, autoload) VALUES "; + + $insert_query .= implode( ',', $insert_rows ); + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.NotPrepared + $wpdb->query( $insert_query ); + } + + $offset += $limit; + } while ( $offset < $item_count ); + + // Clear the custom table + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $wpdb->query( "DELETE FROM {$custom_table_name}" ); + + // TODO should we drop the table here instead? + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/CHANGELOG.md new file mode 100644 index 00000000..f9ea0635 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/CHANGELOG.md @@ -0,0 +1,80 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.4] - 2024-09-06 +### Changed +- Updated package dependencies. [#39004] + +## [0.2.3] - 2024-05-24 +### Fixed +- Backup: Change error messages to not trigger security scanners. [#36496] + +## [0.2.2] - 2024-03-19 +### Fixed +- Handle upgrades from plugins embedding version 0.2.0 of the package. [#36440] + +## [0.2.1] - 2024-03-14 +### Added +- Increasing backup version for new endpoint [#35649] + +### Fixed +- Write helper script to ABSPATH by default, just like we did before [#35508] + +## [0.2.0] - 2024-01-18 +### Changed +- The package now requires PHP >= 7.0. [#34192] + +### Fixed +- Backup: Add namespace versioning to Helper_Script_Manager and other classes. [#34739] +- Backup: Bug fixes in helper script installation class. [#34297] + +## [0.1.6] - 2023-10-19 +### Changed +- Updated package dependencies. [#32605] + +### Fixed +- Fix helper script upload for sites without direct file system access. [#32102] + +## [0.1.5] - 2023-07-06 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.1.4] - 2023-03-29 +### Changed +- Minor internal updates. + +## [0.1.3] - 2023-01-25 +### Changed +- Use `WP_Filesystem` more consistently in `Helper_Script_Manager`. [#28198] + +## [0.1.2] - 2022-12-05 +### Changed +- Updated package dependencies. [#27688] + +## [0.1.1] - 2022-11-30 +### Changed +- Updated package dependencies. [#27043] + +## 0.1.0 - 2022-11-01 +### Added +- Adding the initial empty package +- Duplicate helper script code to a dedicated package + +### Changed +- Updated package dependencies. + +[0.2.4]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.2.3...v0.2.4 +[0.2.3]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.6...v0.2.0 +[0.1.6]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/actions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/actions.php new file mode 100644 index 00000000..9621437e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/actions.php @@ -0,0 +1,32 @@ + $accepted_args, + 'function' => $cb, + ); + }; + $add_action = $add_filter; +} + +// Clean up expired Jetpack Helper Scripts from a scheduled event. +$add_action( 'jetpack_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) ); + +// Register REST routes. +$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\V0004\\REST_Controller', 'register_rest_routes' ) ); + +// Set up package version hook. +$add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Transport_Helper\\Package_Version::send_package_version_to_tracker' ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/composer.json new file mode 100644 index 00000000..bcdb758b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/composer.json @@ -0,0 +1,60 @@ +{ + "name": "automattic/jetpack-transport-helper", + "description": "Package to help transport server communication", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-backup-helper-script-manager": "^0.2.7", + "automattic/jetpack-connection": "^4.0.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "dev-master" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "build-production": "echo 'Add your build step to composer.json, please!'", + "build-development": "echo 'Add your build step to composer.json, please!'", + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "mirror-repo": "Automattic/jetpack-transport-helper", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-transport-helper/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "textdomain": "jetpack-transport-helper" + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version-compat.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version-compat.php new file mode 100644 index 00000000..c14ec470 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version-compat.php @@ -0,0 +1,25 @@ + WP_REST_Server::CREATABLE, + 'callback' => __CLASS__ . '::install_helper_script', + 'permission_callback' => __CLASS__ . '::helper_script_permissions_callback', + 'args' => array( + 'helper' => array( + 'description' => __( 'base64 encoded Helper Script body.', 'jetpack-transport-helper' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Delete a Helper Script. + register_rest_route( + 'jetpack/v4', + // This route can be generalized once we no longer depend on the backup package + '/backup-helper-script', + array( + 'methods' => WP_REST_Server::DELETABLE, + 'callback' => __CLASS__ . '::delete_helper_script', + 'permission_callback' => __CLASS__ . '::helper_script_permissions_callback', + 'args' => array( + 'path' => array( + 'description' => __( 'Path to Helper Script', 'jetpack-transport-helper' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + } + + /** + * The Jetpack endpoints should only be available via site-level authentication. + * This means that the corresponding endpoints can only be accessible from WPCOM. + * + * @access public + * @static + * + * @return bool|WP_Error True if a blog token was used to sign the request, WP_Error otherwise. + */ + public static function helper_script_permissions_callback() { + if ( Rest_Authentication::is_signed_with_blog_token() ) { + return true; + } + + $error_msg = esc_html__( + 'You are not allowed to perform this action.', + 'jetpack-transport-helper' + ); + + return new WP_Error( 'rest_forbidden', $error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Install the Helper Script. + * + * @access public + * @static + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return array|WP_Error An array with installation info on success: + * + * 'path' (string) Helper script installation path on the filesystem. + * 'url' (string) URL to the helper script. + * 'abspath' (string) WordPress root. + * + * or an instance of WP_Error on failure. + */ + public static function install_helper_script( $request ) { + $helper_script = $request->get_param( 'helper' ); + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + $helper_script = base64_decode( $helper_script ); + if ( ! $helper_script ) { + return new WP_Error( 'invalid_args', __( 'Helper Script body must be base64 encoded', 'jetpack-transport-helper' ), 400 ); + } + + $installation_info = Helper_Script_Manager::install_helper_script( $helper_script ); + Helper_Script_Manager::cleanup_expired_helper_scripts(); + + return rest_ensure_response( $installation_info ); + } + + /** + * Delete a Helper Script. + * + * @access public + * @static + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return array|WP_Error An array with 'success' key indicating the result of the delete operation. + */ + public static function delete_helper_script( $request ) { + $path_to_helper_script = $request->get_param( 'path' ); + + $delete_result = Helper_Script_Manager::delete_helper_script( $path_to_helper_script ); + Helper_Script_Manager::cleanup_expired_helper_scripts(); + + if ( is_wp_error( $delete_result ) ) { + return $delete_result; + } + + return rest_ensure_response( array( 'success' => true ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/CHANGELOG.md new file mode 100644 index 00000000..20f92677 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/CHANGELOG.md @@ -0,0 +1,445 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.18.5] - 2024-09-06 +### Changed +- Updated package dependencies. [#39253] + +### Fixed +- Ensure that request body is parsed correctly [#39262] + +## [0.18.4] - 2024-08-26 +### Changed +- Updated package dependencies. [#39004] + +## [0.18.3] - 2024-08-19 +### Changed +- Internal updates. + +## [0.18.2] - 2024-08-15 +### Fixed +- Fix incorrect next-version tokens in php `@since` and/or `@deprecated` docs. [#38869] + +## [0.18.1] - 2024-08-08 +### Security +- Parse request body when method used is not POST [#38621] + +### Added +- Brute Force Protection: Add `jetpack_has_login_ability` hook. [#38518] + +## [0.18.0] - 2024-08-01 +### Added +- Adds global statistics [#38388] + +### Fixed +- Fix global stats type check [#38634] + +## [0.17.0] - 2024-07-22 +### Added +- Added the ability to toggle IP block and allow lists individually. [#38184] + +## [0.16.10] - 2024-06-26 +### Changed +- Internal updates. + +## [0.16.9] - 2024-06-03 +### Changed +- Phab baseline file update. [#36968] + +## [0.16.8] - 2024-05-20 +### Changed +- Internal updates. + +## [0.16.7] - 2024-05-06 +### Changed +- Internal updates. + +## [0.16.6] - 2024-04-29 +### Changed +- Internal updates. + +## [0.16.5] - 2024-04-25 +### Changed +- Internal updates. + +## [0.16.4] - 2024-04-22 +### Changed +- Internal updates. + +## [0.16.3] - 2024-04-15 +### Security +- Improves handling of REQUEST_URI. [#36833] + +## [0.16.2] - 2024-04-08 +### Changed +- Internal updates. + +## [0.16.1] - 2024-03-25 +### Changed +- Internal updates. + +## [0.16.0] - 2024-03-22 +### Added +- Add data to WAF logs and add toggle for users to opt-in to share more data with us if needed. [#36377] + +## [0.15.2] - 2024-03-18 +### Changed +- Internal updates. + +## [0.15.1] - 2024-03-14 +### Changed +- Internal updates. + +## [0.15.0] - 2024-03-12 +### Added +- Add JSON parameter support to the Web Application Firewall. [#36169] + +## [0.14.2] - 2024-03-04 +### Fixed +- Fixed base64 transforms to better conform with the modsecurity runtime [#35693] + +## [0.14.1] - 2024-02-27 +### Changed +- Internal updates. + +## [0.14.0] - 2024-02-12 +### Added +- Add standalone mode status to WAF config [#34840] + +## [0.13.0] - 2024-02-05 +### Added +- Run the WAF on JN environments [#35341] + +## [0.12.4] - 2024-01-18 +### Fixed +- Optimize how the web application firewall checks for updates on admin screens. [#34820] + +## [0.12.3] - 2024-01-02 +### Changed +- Internal updates. + +## [0.12.2] - 2023-12-25 +### Changed +- Improve top-level WP-CLI command description [#34745] + +## [0.12.1] - 2023-11-21 + +## [0.12.0] - 2023-11-20 +### Changed +- Updated required PHP version to >= 7.0. [#34192] + +## [0.11.15] - 2023-11-14 + +## [0.11.14] - 2023-10-30 + +## [0.11.13] - 2023-10-10 +### Fixed +- Escape email address when output in HTML. [#33536] + +## [0.11.12] - 2023-09-28 +### Changed +- Minor internal updates. + +## [0.11.11] - 2023-09-19 + +- Minor internal updates. + +## [0.11.10] - 2023-09-11 +### Changed +- General: remove backwards-compatible functions now that package relies on WordPress 6.2. [#32772] + +## [0.11.9] - 2023-08-28 +### Changed +- Updated package dependencies. [#32605] + +## [0.11.8] - 2023-07-18 +### Changed +- Add support for running brute force protection in environments that otherwise do not support the WAF. [#31761] +- Minor performance improvements. [#31684] + +## [0.11.7] - 2023-07-17 +### Changed +- Add support for non-empty server https values. [#31688] + +## [0.11.6] - 2023-05-22 +### Added +- Add integration tests for unsupported environments [#30544] + +### Fixed +- Fix Brute force protection activation when WAF unset [#30544] +- Fix unavailable endpoint when WAF module is disabled [#30487] +- Multisite: avoid errors when the package is used in the Protect plugin instead of the Jetpack plugin. [#30767] + +## [0.11.5] - 2023-05-15 +### Changed +- Internal updates. + +## [0.11.4] - 2023-04-27 +### Added +- Fix hardblock issue if user only has Protect installed [#30278] + +## [0.11.3] - 2023-04-17 +### Fixed +- Fix brute force protection not initializing on atomic. [#30113] + +## [0.11.2] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.11.1] - 2023-04-03 +### Fixed +- Return early if we detect the older BFP implementation from the main plugin [#29794] + +## [0.11.0] - 2023-03-28 +### Added +- Added brute force protection to the WAF configuration REST API endpoints [#28401] +- Move the brute force protection module into the package. [#28401] + +### Changed +- Change "whitelist" to "allow list". [#28401] +- Move the brute force protection transient cleanup and shared functions to dedicated namespaced classes. [#28401] +- Use WAF IP allow list option in brute force protection feature. [#28401] + +## [0.10.2] - 2023-03-20 +### Changed +- Updated package dependencies. [#29480] + +## [0.10.1] - 2023-03-08 +### Changed +- Minor internal updates. + +## [0.10.0] - 2023-02-28 +### Added +- Added support for IP ranges in allow and block lists. [#29131] + +## [0.9.3] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.9.2] - 2023-02-15 +### Changed +- Minor internal updates. + +## [0.9.1] - 2023-02-13 +### Fixed +- Fix an update error that impacted sites using the WAF in standalone mode. [#28844] + +## [0.9.0] - 2023-01-25 +### Changed +- Change the web application firewall to run automatic and manual rules independently. [#27726] + +## [0.8.3] - 2023-01-11 +### Fixed +- Fixed the WAF package's PHP tests and Composer requirements [#28185] + +## [0.8.2] - 2023-01-09 +### Fixed +- Fix firewall activation hooks on first option updates. [#28234] + +## [0.8.1] - 2023-01-07 +### Changed +- Change directory location that stores firewall rules. [#28049] + +## [0.8.0] - 2022-12-27 +### Added +- Add file existance checks before requiring rule files in the WAF. [#28050] +- Disable Jetpack Firewall on unsupported environments. [#27939] + +## [0.7.2] - 2022-12-19 +### Fixed +- Fix the initialization of the firewall. [#27846] + +## [0.7.1] - 2022-12-06 +### Changed +- html_entity_decode filter now decodes single-quotes too, and uses a Unicode Replacement Character instead of returning empty string on invalid characters. [#27753] + +## [0.7.0] - 2022-12-05 +### Added +- Prepare package for use in the Jetpack Protect standalone plugin. [#27528] + +### Changed +- Updated package dependencies. [#27688] + +### Removed +- Remove has_rules_access plan check in favor of external alternatives [#27600] + +## [0.6.10] - 2022-11-28 +### Changed +- Updated package dependencies. [#27043] + +## [0.6.9] - 2022-11-01 +### Fixed +- Fix bug for cron event not generating IP rules. [#27215] + +## [0.6.8] - 2022-10-27 +### Fixed +- Fixes several invalid action callbacks. [#27106] + +## [0.6.7] - 2022-09-20 +### Changed +- Changing how we load and run the package to avoid actions.php [#24730] + +## [0.6.6] - 2022-09-08 +### Fixed +- Fixed exception namespace. [#25663] + +## [0.6.5] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.6.4] - 2022-07-12 +### Fixed +- Correct namespacing error. [#24993] + +## [0.6.3] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [0.6.2] - 2022-06-06 +### Fixed +- Fix the hook we're using for run.php. + +## [0.6.1] - 2022-06-02 +### Removed +- Disable the WAF module on Atomic + +## [0.6.0] - 2022-05-18 +### Added +- Add checks for a killswitch define [#24247] +- Added endpoint to update rules on demand [#24327] +- handle share data option to decide if we should write to log file [#24218] + +### Fixed +- Allow the rules API to return 401 responses without throwing an exception. [#24153] +- fix bootstrap generation in cases file.php is not required yet [#24153] + +## [0.5.1] - 2022-05-04 +### Added +- Added a check to only run the firewall when the Jetpack module is enabled, a method to provide the bootstrap.php path, and a REST API endpoint to provide the firewall settings. [#23769] +- Connected the WAF UI to actually updating the IP block and allow lists when saving the settings. [#24124] + +### Fixed +- Fixed database logging [#24070] +- Fixed issue where code for the waf package was executed if the module was disabled [#24217] +- Fixed writing rules php files if the API request for getting up-to-date rules failes so that the internal functionality is kept in tact. [#24181] +- We now sanitize the output generated by blocked requests, and only report the rule ID in the header response. [#24058] + +## [0.5.0] - 2022-04-26 +### Added +- added cron to update rules +- Added WAF IP allow list and block list functionality. + +### Changed +- Added comment to ignore failing phpcs check +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` +- Updated package dependencies. + +## [0.4.0] - 2022-04-19 +### Added +- added logs when a request is blocked +- Generating rules now fetches them from the API. Also adds a few CLI commands. + +## [0.3.0] - 2022-04-12 +### Added +- Added hooks for generating the rules.php file, and improved functionality and class names. + +## [0.2.0] - 2022-04-06 +### Added +- Added Jetpack WAF standalone mode. + +### Fixed +- Fix normalizing nested array targets, like with query strings. + +## [0.1.1] - 2022-03-29 +### Fixed +- Fixed instance of normalizeHeaderName that wasn't renamed; fixed header parsing; removed unused compiler file. + +## 0.1.0 - 2022-02-16 +### Added +- Added executing the WAF as part of the Jetpack plugin. +- Added Initial version + +### Changed +- Core: do not ship .phpcs.dir.xml in production builds. + +[0.18.5]: https://github.com/Automattic/jetpack-waf/compare/v0.18.4...v0.18.5 +[0.18.4]: https://github.com/Automattic/jetpack-waf/compare/v0.18.3...v0.18.4 +[0.18.3]: https://github.com/Automattic/jetpack-waf/compare/v0.18.2...v0.18.3 +[0.18.2]: https://github.com/Automattic/jetpack-waf/compare/v0.18.1...v0.18.2 +[0.18.1]: https://github.com/Automattic/jetpack-waf/compare/v0.18.0...v0.18.1 +[0.18.0]: https://github.com/Automattic/jetpack-waf/compare/v0.17.0...v0.18.0 +[0.17.0]: https://github.com/Automattic/jetpack-waf/compare/v0.16.10...v0.17.0 +[0.16.10]: https://github.com/Automattic/jetpack-waf/compare/v0.16.9...v0.16.10 +[0.16.9]: https://github.com/Automattic/jetpack-waf/compare/v0.16.8...v0.16.9 +[0.16.8]: https://github.com/Automattic/jetpack-waf/compare/v0.16.7...v0.16.8 +[0.16.7]: https://github.com/Automattic/jetpack-waf/compare/v0.16.6...v0.16.7 +[0.16.6]: https://github.com/Automattic/jetpack-waf/compare/v0.16.5...v0.16.6 +[0.16.5]: https://github.com/Automattic/jetpack-waf/compare/v0.16.4...v0.16.5 +[0.16.4]: https://github.com/Automattic/jetpack-waf/compare/v0.16.3...v0.16.4 +[0.16.3]: https://github.com/Automattic/jetpack-waf/compare/v0.16.2...v0.16.3 +[0.16.2]: https://github.com/Automattic/jetpack-waf/compare/v0.16.1...v0.16.2 +[0.16.1]: https://github.com/Automattic/jetpack-waf/compare/v0.16.0...v0.16.1 +[0.16.0]: https://github.com/Automattic/jetpack-waf/compare/v0.15.1...v0.16.0 +[0.15.2]: https://github.com/Automattic/jetpack-waf/compare/v0.15.1...v0.15.2 +[0.15.1]: https://github.com/Automattic/jetpack-waf/compare/v0.15.0...v0.15.1 +[0.15.0]: https://github.com/Automattic/jetpack-waf/compare/v0.14.2...v0.15.0 +[0.14.2]: https://github.com/Automattic/jetpack-waf/compare/v0.14.1...v0.14.2 +[0.14.1]: https://github.com/Automattic/jetpack-waf/compare/v0.14.0...v0.14.1 +[0.14.0]: https://github.com/Automattic/jetpack-waf/compare/v0.13.0...v0.14.0 +[0.13.0]: https://github.com/Automattic/jetpack-waf/compare/v0.12.4...v0.13.0 +[0.12.4]: https://github.com/Automattic/jetpack-waf/compare/v0.12.3...v0.12.4 +[0.12.3]: https://github.com/Automattic/jetpack-waf/compare/v0.12.2...v0.12.3 +[0.12.2]: https://github.com/Automattic/jetpack-waf/compare/v0.12.1...v0.12.2 +[0.12.1]: https://github.com/Automattic/jetpack-waf/compare/v0.12.0...v0.12.1 +[0.12.0]: https://github.com/Automattic/jetpack-waf/compare/v0.11.15...v0.12.0 +[0.11.15]: https://github.com/Automattic/jetpack-waf/compare/v0.11.14...v0.11.15 +[0.11.14]: https://github.com/Automattic/jetpack-waf/compare/v0.11.13...v0.11.14 +[0.11.13]: https://github.com/Automattic/jetpack-waf/compare/v0.11.12...v0.11.13 +[0.11.12]: https://github.com/Automattic/jetpack-waf/compare/v0.11.11...v0.11.12 +[0.11.11]: https://github.com/Automattic/jetpack-waf/compare/v0.11.10...v0.11.11 +[0.11.10]: https://github.com/Automattic/jetpack-waf/compare/v0.11.9...v0.11.10 +[0.11.9]: https://github.com/Automattic/jetpack-waf/compare/v0.11.8...v0.11.9 +[0.11.8]: https://github.com/Automattic/jetpack-waf/compare/v0.11.7...v0.11.8 +[0.11.7]: https://github.com/Automattic/jetpack-waf/compare/v0.11.6...v0.11.7 +[0.11.6]: https://github.com/Automattic/jetpack-waf/compare/v0.11.5...v0.11.6 +[0.11.5]: https://github.com/Automattic/jetpack-waf/compare/v0.11.4...v0.11.5 +[0.11.4]: https://github.com/Automattic/jetpack-waf/compare/v0.11.3...v0.11.4 +[0.11.3]: https://github.com/Automattic/jetpack-waf/compare/v0.11.2...v0.11.3 +[0.11.2]: https://github.com/Automattic/jetpack-waf/compare/v0.11.1...v0.11.2 +[0.11.1]: https://github.com/Automattic/jetpack-waf/compare/v0.11.0...v0.11.1 +[0.11.0]: https://github.com/Automattic/jetpack-waf/compare/v0.10.2...v0.11.0 +[0.10.2]: https://github.com/Automattic/jetpack-waf/compare/v0.10.1...v0.10.2 +[0.10.1]: https://github.com/Automattic/jetpack-waf/compare/v0.10.0...v0.10.1 +[0.10.0]: https://github.com/Automattic/jetpack-waf/compare/v0.9.3...v0.10.0 +[0.9.3]: https://github.com/Automattic/jetpack-waf/compare/v0.9.2...v0.9.3 +[0.9.2]: https://github.com/Automattic/jetpack-waf/compare/v0.9.1...v0.9.2 +[0.9.1]: https://github.com/Automattic/jetpack-waf/compare/v0.9.0...v0.9.1 +[0.9.0]: https://github.com/Automattic/jetpack-waf/compare/v0.8.3...v0.9.0 +[0.8.3]: https://github.com/Automattic/jetpack-waf/compare/v0.8.2...v0.8.3 +[0.8.2]: https://github.com/Automattic/jetpack-waf/compare/v0.8.1...v0.8.2 +[0.8.1]: https://github.com/Automattic/jetpack-waf/compare/v0.8.0...v0.8.1 +[0.8.0]: https://github.com/Automattic/jetpack-waf/compare/v0.7.2...v0.8.0 +[0.7.2]: https://github.com/Automattic/jetpack-waf/compare/v0.7.1...v0.7.2 +[0.7.1]: https://github.com/Automattic/jetpack-waf/compare/v0.7.0...v0.7.1 +[0.7.0]: https://github.com/Automattic/jetpack-waf/compare/v0.6.10...v0.7.0 +[0.6.10]: https://github.com/Automattic/jetpack-waf/compare/v0.6.9...v0.6.10 +[0.6.9]: https://github.com/Automattic/jetpack-waf/compare/v0.6.8...v0.6.9 +[0.6.8]: https://github.com/Automattic/jetpack-waf/compare/v0.6.7...v0.6.8 +[0.6.7]: https://github.com/Automattic/jetpack-waf/compare/v0.6.6...v0.6.7 +[0.6.6]: https://github.com/Automattic/jetpack-waf/compare/v0.6.5...v0.6.6 +[0.6.5]: https://github.com/Automattic/jetpack-waf/compare/v0.6.4...v0.6.5 +[0.6.4]: https://github.com/Automattic/jetpack-waf/compare/v0.6.3...v0.6.4 +[0.6.3]: https://github.com/Automattic/jetpack-waf/compare/v0.6.2...v0.6.3 +[0.6.2]: https://github.com/Automattic/jetpack-waf/compare/v0.6.1...v0.6.2 +[0.6.1]: https://github.com/Automattic/jetpack-waf/compare/v0.6.0...v0.6.1 +[0.6.0]: https://github.com/Automattic/jetpack-waf/compare/v0.5.1...v0.6.0 +[0.5.1]: https://github.com/Automattic/jetpack-waf/compare/v0.5.0...v0.5.1 +[0.5.0]: https://github.com/Automattic/jetpack-waf/compare/v0.4.0...v0.5.0 +[0.4.0]: https://github.com/Automattic/jetpack-waf/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/Automattic/jetpack-waf/compare/v0.2.0...v0.3.0 +[0.2.0]: https://github.com/Automattic/jetpack-waf/compare/v0.1.1...v0.2.0 +[0.1.1]: https://github.com/Automattic/jetpack-waf/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/cli.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/cli.php new file mode 100644 index 00000000..54b71688 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/cli.php @@ -0,0 +1,13 @@ +=7.0", + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-ip": "^0.2.3", + "automattic/jetpack-status": "^4.0.0", + "wikimedia/aho-corasick": "^1.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "files": [ + "cli.php" + ], + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --configuration tests/php/integration/phpunit.xml.dist --colors=always", + "./vendor/phpunit/phpunit/phpunit --configuration tests/php/unit/phpunit.xml.dist --colors=always" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "test-coverage-html": [ + "php -dpcov.directory=. ./vendor/bin/phpunit --coverage-html ./coverage --configuration tests/php/integration/phpunit.xml.dist", + "php -dpcov.directory=. ./vendor/bin/phpunit --coverage-html ./coverage --configuration tests/php/unit/phpunit.xml.dist" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-waf", + "textdomain": "jetpack-waf", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-waf/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.18.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php new file mode 100644 index 00000000..90976bbd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php @@ -0,0 +1,774 @@ +can_send_recovery_emails = apply_filters( 'jetpack_protect_can_send_recovery_emails', true ); + $this->ip_address = $ip_address; + + add_filter( 'wp_authenticate_user', array( $this, 'check_valid_blocked_user' ), 10, 1 ); + add_filter( 'site_url', array( $this, 'add_args_to_login_post_url' ), 10, 3 ); + add_filter( 'network_site_url', array( $this, 'add_args_to_login_post_url' ), 10, 3 ); + add_filter( 'lostpassword_url', array( $this, 'add_args_to_lostpassword_url' ), 10, 2 ); + add_filter( 'login_url', array( $this, 'add_args_to_login_url' ), 10, 3 ); + add_filter( 'lostpassword_redirect', array( $this, 'add_args_to_lostpassword_redirect_url' ), 10, 1 ); + } + + /** + * Gets the URL that redirects to the support page on unblocking + * + * @since 8.5.0 + * + * @return string + */ + public static function get_help_url() { + return Redirect::get_url( 'jetpack-support-protect', array( 'anchor' => 'troubleshooting' ) ); + } + + /** + * Add arguments to lost password redirect url. + * + * @param string $url - the URL. + */ + public function add_args_to_lostpassword_redirect_url( $url ) { + if ( $this->valid_blocked_user_id ) { + $url = empty( $url ) ? wp_login_url() : $url; + $url = add_query_arg( + array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'checkemail' => 'confirm', + ), + $url + ); + } + + return $url; + } + + /** + * Add arguments to lost password redirect url. + * + * @param string $url - the URL. + * @param string $redirect - where to redirect to. + */ + public function add_args_to_lostpassword_url( $url, $redirect ) { + if ( $this->valid_blocked_user_id ) { + $args = array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'action' => 'lostpassword', + ); + if ( ! empty( $redirect ) ) { + $args['redirect_to'] = $redirect; + } + $url = add_query_arg( $args, $url ); + } + + return $url; + } + + /** + * Add arguments to login post url. + * + * @param string $url - the URL. + * @param string $path - the path. + * @param string $scheme -the scheme(?). + */ + public function add_args_to_login_post_url( $url, $path, $scheme ) { + if ( $this->valid_blocked_user_id && ( 'login_post' === $scheme || 'login' === $scheme ) ) { + $url = add_query_arg( + array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + ), + $url + ); + + } + + return $url; + } + + /** + * Add arguments to login post url. + * + * @param string $url - the URL. + * @param string $redirect - where we want to redirect to. + * @param string $force_reauth -if we're forcing reauthorization. + */ + public function add_args_to_login_url( $url, $redirect, $force_reauth ) { + if ( $this->valid_blocked_user_id ) { + $args = array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + ); + + if ( ! empty( $redirect ) ) { + $args['redirect_to'] = $redirect; + } + + if ( ! empty( $force_reauth ) ) { + $args['reauth'] = '1'; + } + $url = add_query_arg( $args, $url ); + } + + return $url; + } + + /** + * Check if user is blocked. + * + * @param string $user - the user. + */ + public function check_valid_blocked_user( $user ) { + if ( $this->valid_blocked_user_id && $this->valid_blocked_user_id != $user->ID ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual + return new WP_Error( 'invalid_recovery_token', __( 'The recovery token is not valid for this user.', 'jetpack-waf' ) ); + } + + return $user; + } + + /** + * Check if user is valid. + */ + public function is_blocked_user_valid() { + if ( ! $this->can_send_recovery_emails ) { + return false; + } + + if ( $this->valid_blocked_user_id ) { + return true; + } + + if ( ! isset( $_GET['validate_jetpack_protect_recovery'] ) || ! isset( $_GET['user_id'] ) ) { // phpcs:ignore: WordPress.Security.NonceVerification.Recommended -- no changes made if this isn't set. + return false; + } + + if ( ! $this->is_valid_protect_recovery_key( filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ), (int) $_GET['user_id'] ) ) { // phpcs:ignore: WordPress.Security.NonceVerification.Recommended -- no changes made if this isn't set. + return false; + } + + $this->valid_blocked_user_id = (int) $_GET['user_id']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + + return true; + } + + /** + * Checks if recovery key is valid. + * + * @param string $key - they recovery key. + * @param string $user_id - the User ID. + */ + public function is_valid_protect_recovery_key( $key, $user_id ) { + + $path = sprintf( '/sites/%d/protect/recovery/confirm', Jetpack_Options::get_option( 'id' ) ); + $response = Client::wpcom_json_api_request_as_blog( + $path, + '1.1', + array( + 'method' => 'post', + ), + array( + 'token' => $key, + 'user_id' => $user_id, + 'ip' => $this->ip_address, + ) + ); + + $result = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $result ) || empty( $result ) || isset( $result->error ) ) { + return false; + } + + return true; + } + + /** + * Check if we should render the recovery form. + */ + public function render_and_die() { + if ( ! $this->can_send_recovery_emails ) { + $this->render_blocked_login_message(); + + return; + } + + if ( isset( $_GET['validate_jetpack_protect_recovery'] ) && ! empty( $_GET['user_id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes, just throws invalid token error. + $error = new WP_Error( 'invalid_token', __( "Oops, we couldn't validate the recovery token.", 'jetpack-waf' ) ); + $this->protect_die( $error ); + + return; + } + + if ( + isset( $_GET['jetpack-protect-recovery'] ) && + isset( $_POST['_wpnonce'] ) && + wp_verify_nonce( $_POST['_wpnonce'], 'bypass-protect' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WP Core doesn't unstrip or sanitize nonces either. + ) { + $this->process_recovery_email(); + + return; + } + + if ( isset( $_GET['loggedout'] ) && 'true' === $_GET['loggedout'] ) { + $this->protect_die( __( 'You successfully logged out.', 'jetpack-waf' ) ); + } + + $this->render_recovery_form(); + } + + /** + * Render the blocked login message. + */ + public function render_blocked_login_message() { + $this->protect_die( $this->get_html_blocked_login_message() ); + } + + /** + * Process sending a recovery email. + */ + public function process_recovery_email() { + $sent = $this->send_recovery_email(); + $show_recovery_form = true; + if ( is_wp_error( $sent ) ) { + if ( 'email_already_sent' === $sent->get_error_code() ) { + $show_recovery_form = false; + } + $this->protect_die( $sent, null, true, $show_recovery_form ); + } else { + $this->render_recovery_success(); + } + } + + /** + * Send the recovery form. + */ + public function send_recovery_email() { + $email = isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- only triggered after bypass-protect nonce check is done, and sanitization is checked on the next line. + if ( sanitize_email( $email ) !== $email || ! is_email( $email ) ) { + return new WP_Error( 'invalid_email', __( "Oops, looks like that's not the right email address. Please try again!", 'jetpack-waf' ) ); + } + $user = get_user_by( 'email', trim( $email ) ); + + if ( ! $user ) { + return new WP_Error( 'invalid_user', __( "Oops, we couldn't find a user with that email. Please try again!", 'jetpack-waf' ) ); + } + $this->email_address = $email; + $path = sprintf( '/sites/%d/protect/recovery/request', Jetpack_Options::get_option( 'id' ) ); + + $response = Client::wpcom_json_api_request_as_blog( + $path, + '1.1', + array( + 'method' => 'post', + ), + array( + 'user_id' => $user->ID, + 'ip' => $this->ip_address, + ) + ); + + $code = wp_remote_retrieve_response_code( $response ); + $result = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( self::HTTP_STATUS_CODE_TOO_MANY_REQUESTS === $code ) { + // translators: email address the recovery instructions were sent to. + return new WP_Error( 'email_already_sent', sprintf( __( 'Recovery instructions were sent to %s. Check your inbox!', 'jetpack-waf' ), esc_html( $this->email_address ) ) ); + } elseif ( is_wp_error( $result ) || empty( $result ) || isset( $result->error ) ) { + return new WP_Error( 'email_send_error', __( 'Oops, we were unable to send a recovery email. Try again.', 'jetpack-waf' ) ); + } + + return true; + } + + /** + * Prevent login by locking the login page. + * + * @param string $content - the content of the page. + * @param string $title - the page title. + * @param string $back_link - the back link. + * @param string $recovery_form - the recovery form. + */ + public function protect_die( $content, $title = null, $back_link = false, $recovery_form = false ) { + if ( empty( $title ) ) { + $title = __( 'Jetpack has locked your site\'s login page.', 'jetpack-waf' ); + } + if ( is_wp_error( $content ) ) { + $svg = ''; + $content = ' ' . $svg . $content->get_error_message() . ''; + } + $content = '

' . $content . '

'; + + // If for some reason the login pop up box show up in the wp-admin. + if ( isset( $_GET['interim-login'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no changes to the site itself, just rendering an error message. + $content = '' . $content; + } + $this->display_page( $title, $content, $back_link, $recovery_form ); + } + + /** + * Render the recovery form. + */ + public function render_recovery_form() { + $content = $this->get_html_blocked_login_message(); + $this->protect_die( $content, null, null, true ); + } + + /** + * Render the recovery instructions. + */ + public function render_recovery_success() { + // translators: the email address the recovery email was sent to. + $this->protect_die( sprintf( __( 'Recovery instructions were sent to %s. Check your inbox!', 'jetpack-waf' ), $this->email_address ) ); + } + + /** + * Get the HTML for the blocked login message. + */ + public function get_html_blocked_login_message() { + $icon = ''; + $ip = str_replace( 'http://', '', esc_url( 'http://' . $this->ip_address ) ); + return sprintf( + // translators: the IP address that was flagged. + __( '

Your IP address %2$s has been flagged for potential security violations. You can unlock your login by sending yourself a special link via email. Learn More

', 'jetpack-waf' ), // phpcs:ignore WordPress.WP.I18n.NoHtmlWrappedStrings + $icon, + $ip, + esc_url( self::get_help_url() ) + ); + } + + /** + * Get the HTML recovery form. + */ + public function get_html_recovery_form() { + ob_start(); ?> +
+
+ +

+ + +

+
+
+ + + + + > + + + + \n"; + } else { + echo "\n"; + } + ?> + <?php echo esc_html( $title ); ?> + + + > +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + get_html_recovery_form(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- content is escaped in the function. + } + ?> +
+ + + + get_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + + if ( ! $transient || $transient < 1 ) { + self::generate_math_page(); + } + return true; + } + + $ans = isset( $_POST['jetpack_protect_num'] ) ? (int) $_POST['jetpack_protect_num'] : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- answers are salted. + $correct_ans = isset( $_POST['jetpack_protect_answer'] ) ? sanitize_key( $_POST['jetpack_protect_answer'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing + + $time_window = self::time_window(); + $salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|'; + $salted_ans_1 = hash_hmac( 'sha1', $ans, $salt . $time_window ); + $salted_ans_2 = hash_hmac( 'sha1', $ans, $salt . ( $time_window - 1 ) ); + + if ( ! $correct_ans || ! $ans ) { + self::generate_math_page(); + } elseif ( ! hash_equals( $salted_ans_1, $correct_ans ) && ! hash_equals( $salted_ans_2, $correct_ans ) ) { + wp_die( + wp_kses( + __( + 'You failed to correctly answer the math problem. This is used to combat spam when Jetpack’s Brute Force Attack Protection API is unavailable. Please use your browser’s back button to return to the login form, press the "refresh" button to generate a new math problem, and try to log in again.', + 'jetpack-waf' + ), + array( 'strong' => array() ) + ), + '', + array( 'response' => 401 ) + ); + } else { + return true; + } + } + + /** + * Creates an interim page to collect answers to a math captcha + * + * @param string $error - the error message. + * @return never + */ + public static function generate_math_page( $error = false ) { + ob_start(); + ?> +

+ +

+ + +
+ + +

+
+ 401 ) + ); + } + + /** + * Generates the math page. + */ + public function process_generate_math_page() { + $ans = isset( $_POST['jetpack_protect_num'] ) ? (int) $_POST['jetpack_protect_num'] : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- answers are salted. + $correct_ans = isset( $_POST['jetpack_protect_answer'] ) ? sanitize_key( $_POST['jetpack_protect_answer'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing + + $time_window = self::time_window(); + $salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|'; + $salted_ans_1 = hash_hmac( 'sha1', $ans, $salt . $time_window ); + $salted_ans_2 = hash_hmac( 'sha1', $ans, $salt . ( $time_window - 1 ) ); + + if ( ! hash_equals( $salted_ans_1, $correct_ans ) && ! hash_equals( $salted_ans_2, $correct_ans ) ) { + self::generate_math_page( true ); + } else { + $temp_pass = substr( hash_hmac( 'sha1', wp_rand( 1, 100000000 ), get_site_option( 'jetpack_protect_key' ) ), 5, 25 ); + + $brute_force_protection = Brute_Force_Protection::instance(); + $brute_force_protection->set_transient( 'jpp_math_pass_' . $temp_pass, 3, DAY_IN_SECONDS ); + setcookie( 'jpp_math_pass', $temp_pass, time() + DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, false, true ); + remove_action( 'login_form', array( $this, 'math_form' ) ); + return true; + } + } + + /** + * Requires a user to solve a simple equation. Added to any WordPress login form. + * + * @return VOID outputs html + */ + public static function math_form() { + // Check if jpp_math_pass cookie is set and it matches valid transient. + if ( isset( $_COOKIE['jpp_math_pass'] ) ) { + $brute_force_protection = Brute_Force_Protection::instance(); + $transient = $brute_force_protection->get_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + + if ( $transient && $transient > 0 ) { + return ''; + } + } + + $num1 = wp_rand( 0, 10 ); + $num2 = wp_rand( 1, 10 ); + $ans = $num1 + $num2; + + $time_window = self::time_window(); + $salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|'; + $salted_ans = hash_hmac( 'sha1', $ans, $salt . $time_window ); + ?> +
+

+ +

+
+ + + +
+ array(), + ); + foreach ( $local_allow_list as $item ) { + if ( $item->range ) { + $formatted['local'][] = $item->range_low . ' - ' . $item->range_high; + } else { + $formatted['local'][] = $item->ip_address; + } + } + if ( is_multisite() && current_user_can( 'manage_network' ) ) { + $formatted['global'] = array(); + $global_allow_list = self::get_global_allow_list(); + if ( false === $global_allow_list ) { + // If the global allow list has never been set, check for a legacy option set prior to 3.6. + $global_allow_list = get_site_option( 'jetpack_protect_whitelist', array() ); + } + foreach ( $global_allow_list as $item ) { + if ( $item->range ) { + $formatted['global'][] = $item->range_low . ' - ' . $item->range_high; + } else { + $formatted['global'][] = $item->ip_address; + } + } + } + return $formatted; + } + + /** + * Gets the local Brute force protection allow list. + * + * @deprecated 0.11.0 Use get_local_allow_list() + */ + public static function get_local_whitelist() { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::get_local_allow_list' ); + return self::get_local_allow_list(); + } + + /** + * Gets the local Brute force protection allow list. + * + * The 'local' part of the allow list only really applies to multisite installs, + * which can have a network wide allow list, as well as a local list that applies + * only to the current site. On single site installs, there will only be a local + * allow list. + * + * @return array A list of IP Address objects or an empty array + */ + public static function get_local_allow_list() { + $allow_list = get_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ); + if ( false === $allow_list ) { + // The local allow list has never been set. + if ( is_multisite() ) { + // On a multisite, we can check for a legacy site_option that existed prior to v 3.6, or default to an empty array. + $allow_list = get_site_option( 'jetpack_protect_whitelist', array() ); + } else { + // On a single site, we can just use an empty array. + $allow_list = array(); + } + } else { + $allow_list = IP_Utils::get_ip_addresses_from_string( $allow_list ); + $allow_list = array_map( + function ( $ip_address ) { + return self::create_ip_object( $ip_address ); + }, + $allow_list + ); + } + return $allow_list; + } + + /** + * Get the global, network-wide allow list. + * + * @deprecated 0.11.0 Use get_global_allow_list() + */ + public static function get_global_whitelist() { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::get_global_allow_list' ); + return self::get_global_allow_list(); + } + + /** + * Get the global, network-wide allow list. + * + * It will revert to the legacy site_option if jetpack_protect_global_whitelist has never been set. + * + * @return array + */ + public static function get_global_allow_list() { + $allow_list = get_site_option( 'jetpack_protect_global_whitelist' ); + if ( false === $allow_list ) { + // The global allow list has never been set. Check for legacy site_option, or default to an empty array. + $allow_list = get_site_option( 'jetpack_protect_whitelist', array() ); + } + return $allow_list; + } + + /** + * Convert a string into an IP Address object. + * + * @param string $ip_address The IP Address to convert. + * @return object An IP Address object. + */ + private static function create_ip_object( $ip_address ) { + $range = false; + if ( strpos( $ip_address, '-' ) ) { + $ip_address = explode( '-', $ip_address ); + $range = true; + } + $new_item = new \stdClass(); + $new_item->range = $range; + if ( $range ) { + $new_item->range_low = trim( $ip_address[0] ); + $new_item->range_high = trim( $ip_address[1] ); + } else { + $new_item->ip_address = $ip_address; + } + return $new_item; + } + + /** + * Save IP allow list. + * + * @deprecated 0.11.0 Use save_allow_list() + * + * @param mixed $allow_list IP allow list. + * @param bool $global (default: false) Global. + */ + public static function save_whitelist( $allow_list, $global = false ) { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::save_allow_list' ); + return self::save_allow_list( $allow_list, $global ); + } + + /** + * Save IP allow list. + * + * @access public + * @param mixed $allow_list IP allow list. + * @param bool $global (default: false) Global. + * @return bool + */ + public static function save_allow_list( $allow_list, $global = false ) { + $allow_list_error = false; + $new_items = array(); + if ( ! is_array( $allow_list ) ) { + return new WP_Error( 'invalid_parameters', __( 'Expecting an array', 'jetpack-waf' ) ); + } + if ( $global && ! is_multisite() ) { + return new WP_Error( 'invalid_parameters', __( 'Cannot use global flag on non-multisites', 'jetpack-waf' ) ); + } + if ( $global && ! current_user_can( 'manage_network' ) ) { + return new WP_Error( 'permission_denied', __( 'Only super admins can edit the global allow list', 'jetpack-waf' ) ); + } + // Validate each item. + foreach ( $allow_list as $item ) { + $item = trim( $item ); + if ( empty( $item ) ) { + continue; + } + $new_item = self::create_ip_object( $item ); + if ( $new_item->range ) { + if ( ! filter_var( $new_item->range_low, FILTER_VALIDATE_IP ) || ! filter_var( $new_item->range_high, FILTER_VALIDATE_IP ) ) { + $allow_list_error = true; + break; + } + if ( ! IP_Utils::convert_ip_address( $new_item->range_low ) || ! IP_Utils::convert_ip_address( $new_item->range_high ) ) { + $allow_list_error = true; + break; + } + } else { + if ( ! filter_var( $new_item->ip_address, FILTER_VALIDATE_IP ) ) { + $allow_list_error = true; + break; + } + if ( ! IP_Utils::convert_ip_address( $new_item->ip_address ) ) { + $allow_list_error = true; + break; + } + } + $new_items[] = $new_item; + } // End item loop. + if ( ! empty( $allow_list_error ) ) { + return new WP_Error( 'invalid_ip', __( 'One of your IP addresses was not valid.', 'jetpack-waf' ) ); + } + if ( $global ) { + update_site_option( 'jetpack_protect_global_whitelist', $new_items ); + // Once a user has saved their global allow list, we can permanently remove the legacy option. + delete_site_option( 'jetpack_protect_whitelist' ); + } else { + $new_items = array_map( + function ( $item ) { + if ( $item->range ) { + return $item->range_low . '-' . $item->range_high; + } + return $item->ip_address; + }, + $new_items + ); + update_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME, implode( ' ', $new_items ) ); + } + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php new file mode 100644 index 00000000..ebd79e03 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php @@ -0,0 +1,63 @@ + time() || $older_than_time < 1 ) { + return false; + } + $sql = $wpdb->prepare( + // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.LikeWildcardsInQuery + "SELECT REPLACE(option_name, '_transient_timeout_jpp_', '') AS transient_name FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_timeout\_jpp\__%%' AND option_value < %d", + $older_than_time + ); + $transients = $wpdb->get_col( $sql ); // phpcs:ignore WordPress.DB -- $sql is prepared above. + $options_names = array(); + foreach ( $transients as $transient ) { + $options_names[] = '_transient_jpp_' . $transient; + $options_names[] = '_transient_timeout_jpp_' . $transient; + } + if ( $options_names ) { + $option_names_string = implode( ', ', array_fill( 0, count( $options_names ), '%s' ) ); + $result = $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery + $wpdb->prepare( + "DELETE FROM {$wpdb->options} WHERE option_name IN ($option_names_string)", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare -- the placeholders are set above. + $options_names + ) + ); + if ( ! $result ) { + return false; + } + } + } + + /** + * Jetpack Purge Transients Activation. + * + * @access public + * @return void + */ + public static function jp_purge_transients_activation() { + if ( ! wp_next_scheduled( 'jp_purge_transients_cron' ) ) { + wp_schedule_event( time(), 'daily', 'jp_purge_transients_cron' ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php new file mode 100644 index 00000000..b91161d3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php @@ -0,0 +1,1175 @@ +is_connected() ) { + global $pagenow; + $brute_force_protection = self::instance(); + + if ( isset( $pagenow ) && 'wp-login.php' === $pagenow ) { + $brute_force_protection->check_login_ability(); + } + } + } + + /** + * On module activation, try to get an api key + */ + public function on_activation() { + if ( is_multisite() && is_main_site() && get_site_option( 'jetpack_protect_active', 0 ) == 0 ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual + update_site_option( 'jetpack_protect_active', 1 ); + } + + update_site_option( 'jetpack_protect_activating', 'activating' ); + + // Get BruteProtect's counter number. + $this->protect_call( 'check_key' ); + } + + /** + * On module deactivation, unset protect_active + */ + public function on_deactivation() { + if ( is_multisite() && is_main_site() ) { + update_site_option( 'jetpack_protect_active', 0 ); + } + } + + /** + * Determines if the brute force protection module is enabled on the site. + * + * @return bool + */ + public static function is_enabled() { + return ( new Modules() )->is_active( 'protect' ); + } + + /** + * Enables the brute force protection module. + * + * @return bool + */ + public static function enable() { + // Return true if already enabled. + if ( self::is_enabled() ) { + return true; + } + return ( new Modules() )->activate( 'protect', false, false ); + } + + /** + * Disables the brute force protection module. + * + * @return bool + */ + public static function disable() { + // Return true if already disabled. + if ( ! self::is_enabled() ) { + return true; + } + return ( new Modules() )->deactivate( 'protect' ); + } + + /** + * Get the protect key, + */ + public function maybe_get_protect_key() { + if ( get_site_option( 'jetpack_protect_activating', false ) && ! get_site_option( 'jetpack_protect_key', false ) ) { + $key = $this->get_protect_key(); + delete_site_option( 'jetpack_protect_activating' ); + return $key; + } + + return get_site_option( 'jetpack_protect_key' ); + } + + /** + * Sends a "check_key" API call once a day. This call allows us to track IP-related + * headers for this server via the Protect API, in order to better identify the source + * IP for login attempts + * + * @param bool $force - if we're forcing the request. + */ + public function maybe_update_headers( $force = false ) { + $updated_recently = $this->get_transient( 'jpp_headers_updated_recently' ); + + if ( ! $force ) { + if ( isset( $_GET['protect_update_headers'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- this doesn't change anything, just forces the once-a-day check to run via force if set. + $force = true; + } + } + + // check that current user is admin so we prevent a lower level user from adding + // a trusted header, allowing them to brute force an admin account. + if ( ( $updated_recently && ! $force ) || ! current_user_can( 'update_plugins' ) ) { + return; + } + + $response = self::protect_call( 'check_key' ); + $this->set_transient( 'jpp_headers_updated_recently', 1, DAY_IN_SECONDS ); + + if ( isset( $response['msg'] ) && $response['msg'] ) { + update_site_option( 'trusted_ip_header', json_decode( $response['msg'] ) ); + } + } + + /** + * Handle displaying a security warning. + */ + public function maybe_display_security_warning() { + if ( is_multisite() && current_user_can( 'manage_network' ) ) { + if ( ! function_exists( 'is_plugin_active_for_network' ) ) { + require_once ABSPATH . '/wp-admin/includes/plugin.php'; + } + + // This warning is only relevant if either Jetpack or Jetpack Protect is active. + if ( defined( 'JETPACK__PLUGIN_FILE' ) ) { + $plugin_root_file = JETPACK__PLUGIN_FILE; + } elseif ( defined( 'JETPACK_PROTECT_ROOT_FILE' ) ) { + $plugin_root_file = JETPACK_PROTECT_ROOT_FILE; + } else { + return; + } + + if ( ! is_plugin_active_for_network( plugin_basename( $plugin_root_file ) ) ) { + add_action( 'load-index.php', array( $this, 'prepare_jetpack_protect_multisite_notice' ) ); + add_action( 'wp_ajax_jetpack-protect-dismiss-multisite-banner', array( $this, 'ajax_dismiss_handler' ) ); + } + } + } + + /** + * Handles preparing the multisite notice. + */ + public function prepare_jetpack_protect_multisite_notice() { + $dismissed = get_site_option( 'jetpack_dismissed_protect_multisite_banner' ); + if ( $dismissed ) { + return; + } + + add_action( 'admin_notices', array( $this, 'admin_jetpack_manage_notice' ) ); + } + + /** + * Handle dismissing the multisite banner. + */ + public function ajax_dismiss_handler() { + check_ajax_referer( 'jetpack_protect_multisite_banner_opt_out' ); + + if ( ! current_user_can( 'manage_network' ) ) { + wp_send_json_error( new WP_Error( 'insufficient_permissions' ) ); + } + + update_site_option( 'jetpack_dismissed_protect_multisite_banner', true ); + + wp_send_json_success(); + } + + /** + * Displays a warning about Brute Force Protection's network activation requirement. + * Attaches some custom JS to Core's `is-dismissible` UI to save the dismissed state. + */ + public function admin_jetpack_manage_notice() { + ?> +
+

+ +

+ +

+ +

+ + + + + + +

+
+ + api_key_error = __( 'Your main blog is not connected to WordPress.com. Please connect to get an API key.', 'jetpack-waf' ); + + return false; + } + + $request = array( + 'jetpack_blog_id' => $protect_blog_id, + 'bruteprotect_api_key' => get_site_option( 'bruteprotect_api_key' ), + 'multisite' => '0', + ); + + // Send the number of blogs on the network if we are on multisite. + if ( is_multisite() ) { + $request['multisite'] = get_blog_count(); + if ( ! $request['multisite'] ) { + global $wpdb; + $request['multisite'] = $wpdb->get_var( "SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE spam = '0' AND deleted = '0' and archived = '0'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery + } + } + + // Request the key. + $xml = new Jetpack_IXR_Client(); + $xml->query( 'jetpack.protect.requestKey', $request ); + + // Hmm, can't talk to wordpress.com. + if ( $xml->isError() ) { + $code = $xml->getErrorCode(); + $message = $xml->getErrorMessage(); + // Translators: The xml error code, and the xml error message. + $this->api_key_error = sprintf( __( 'Error connecting to WordPress.com. Code: %1$s, %2$s', 'jetpack-waf' ), $code, $message ); + + return false; + } + + $response = $xml->getResponse(); + + // Hmm, can't talk to the protect servers ( api.bruteprotect.com ). + if ( ! isset( $response['data'] ) ) { + $this->api_key_error = __( 'No reply from Jetpack servers', 'jetpack-waf' ); + + return false; + } + + // There was an issue generating the key. + if ( empty( $response['success'] ) ) { + $this->api_key_error = $response['data']; + + return false; + } + + // Key generation successful! + $active_plugins = self::get_active_plugins(); + + // We only want to deactivate BruteProtect if we successfully get a key. + if ( in_array( 'bruteprotect/bruteprotect.php', $active_plugins, true ) ) { + self::deactivate_plugin( 'bruteprotect/bruteprotect.php', 'BruteProtect' ); + } + + $key = $response['data']; + update_site_option( 'jetpack_protect_key', $key ); + + return $key; + } + + /** + * Called via WP action wp_login_failed to log failed attempt with the api + * + * Fires custom, plugable action jpp_log_failed_attempt with the IP + * + * @param string $login_user - the user attempting to log in. + * @return void + */ + public function log_failed_attempt( $login_user = null ) { + + /** + * Fires before every failed login attempt. + * + * @module protect + * + * @since 3.4.0 + * + * @param array Information about failed login attempt + * [ + * 'login' => (string) Username or email used in failed login attempt + * ] + */ + do_action( 'jpp_log_failed_attempt', array( 'login' => $login_user ) ); + + if ( isset( $_COOKIE['jpp_math_pass'] ) ) { + + $transient = $this->get_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + --$transient; + + if ( ! $transient || $transient < 1 ) { + $this->delete_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + setcookie( 'jpp_math_pass', 0, time() - DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, false, true ); + } else { + $this->set_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ), $transient, DAY_IN_SECONDS ); + } + } + $this->protect_call( 'failed_attempt' ); + } + + /** + * Set up the Brute Force Protection configuration page + */ + public function modules_loaded() { + add_filter( 'jetpack_module_configurable_protect', '__return_true' ); + } + + /** + * Logs a successful login back to our servers, this allows us to make sure we're not blocking + * a busy IP that has a lot of good logins along with some forgotten passwords. Also saves current user's ip + * to the ip address allow list + * + * @param string $user_login - the user loggign in. + * @param string $user - the user. + */ + public function log_successful_login( $user_login, $user = null ) { + if ( ! $user ) { // For do_action( 'wp_login' ) calls that lacked passing the 2nd arg. + $user = get_user_by( 'login', $user_login ); + } + + $this->protect_call( 'successful_login', array( 'roles' => $user->roles ) ); + } + + /** + * Checks for loginability BEFORE authentication so that bots don't get to go around the log in form. + * + * If we are using our math fallback, authenticate via math-fallback.php + * + * @param string $user - the user. + * @param string $username - the username. + * @param string $password - the password. + * + * @return string $user + */ + public function check_preauth( $user = 'Not Used By Protect', $username = 'Not Used By Protect', $password = 'Not Used By Protect' ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $allow_login = $this->check_login_ability( true ); + $use_math = $this->get_transient( 'brute_use_math' ); + + if ( ! $allow_login ) { + $this->block_with_math(); + } + + if ( ( 1 == $use_math || 1 == $this->block_login_with_math ) && isset( $_POST['log'] ) ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual, WordPress.Security.NonceVerification.Missing -- POST request just determines if we use math authentication. + + Brute_Force_Protection_Math_Authenticate::math_authenticate(); + } + + return $user; + } + + /** + * Get all IP headers so that we can process on our server... + * + * @return array + */ + public function get_headers() { + $output = array(); + $ip_related_headers = array( + 'GD_PHP_HANDLER', + 'HTTP_AKAMAI_ORIGIN_HOP', + 'HTTP_CF_CONNECTING_IP', + 'HTTP_CLIENT_IP', + 'HTTP_FASTLY_CLIENT_IP', + 'HTTP_FORWARDED', + 'HTTP_FORWARDED_FOR', + 'HTTP_INCAP_CLIENT_IP', + 'HTTP_TRUE_CLIENT_IP', + 'HTTP_X_CLIENTIP', + 'HTTP_X_CLUSTER_CLIENT_IP', + 'HTTP_X_FORWARDED', + 'HTTP_X_FORWARDED_FOR', + 'HTTP_X_IP_TRAIL', + 'HTTP_X_REAL_IP', + 'HTTP_X_VARNISH', + 'REMOTE_ADDR', + ); + + foreach ( $ip_related_headers as $header ) { + if ( ! empty( $_SERVER[ $header ] ) ) { + $output[ $header ] = wp_unslash( $_SERVER[ $header ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + } + } + + return $output; + } + + /** + * Whether or not the IP allow list is enabled. + * + * @return bool + */ + public static function ip_allow_list_enabled() { + return get_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, true ); + } + + /** + * Checks if the IP address is in the allow list. + * + * @deprecated 0.11.0 Use ip_is_allowed() + * + * @param string $ip - the IP address. + */ + public static function ip_is_whitelisted( $ip ) { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::ip_is_allowed' ); + return self::ip_is_allowed( $ip ); + } + + /** + * Checks if the IP address is in the allow list. + * + * @param string $ip - the IP address. + * + * @return bool + */ + public function ip_is_allowed( $ip ) { + // If we found an exact match in wp-config. + if ( defined( 'JETPACK_IP_ADDRESS_OK' ) && JETPACK_IP_ADDRESS_OK === $ip ) { + return true; + } + + // Allow list must be enabled. + if ( ! $this->ip_allow_list_enabled() ) { + return false; + } + + $allow_list = Brute_Force_Protection_Shared_Functions::get_local_allow_list(); + + if ( is_multisite() ) { + $allow_list = array_merge( $allow_list, get_site_option( 'jetpack_protect_global_whitelist', array() ) ); + } + + if ( ! empty( $allow_list ) ) : + foreach ( $allow_list as $item ) : + // If the IPs are an exact match. + if ( ! $item->range && isset( $item->ip_address ) && $item->ip_address === $ip ) { + return true; + } + + if ( $item->range && isset( $item->range_low ) && isset( $item->range_high ) ) { + if ( IP_Utils::ip_address_is_in_range( $ip, $item->range_low, $item->range_high ) ) { + return true; + } + } + endforeach; + endif; + + return false; + } + + /** + * Checks the status for a given IP. API results are cached as transients + * + * @param bool $preauth - Whether or not we are checking prior to authorization. + * + * @return bool Either returns true, fires $this->kill_login, or includes a math fallback and returns false + */ + public function check_login_ability( $preauth = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + + /** + * JETPACK_ALWAYS_PROTECT_LOGIN will always disable the login page, and use a page provided by Jetpack. + */ + if ( Constants::is_true( 'JETPACK_ALWAYS_PROTECT_LOGIN' ) ) { + $this->kill_login(); + } + + if ( $this->is_current_ip_allowed() ) { + return true; + } + + $status = $this->get_cached_status(); + + if ( empty( $status ) ) { + // If we've reached this point, this means that the IP isn't cached. + // Now we check with the Protect API to see if we should allow login. + $response = $this->protect_call( $action = 'check_ip' ); // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found + + if ( isset( $response['math'] ) && ! function_exists( 'brute_math_authenticate' ) ) { + new Brute_Force_Protection_Math_Authenticate(); + + return false; + } + + $status = $response['status']; + } + + if ( 'blocked' === $status ) { + $this->block_with_math(); + } + + if ( 'blocked-hard' === $status ) { + $this->kill_login(); + } + + return true; + } + + /** + * Check if the user's IP is in the allow list. + * + * @deprecated 0.11.0 Use is_current_ip_allowed() + */ + public static function is_current_ip_whitelisted() { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::is_current_ip_allowed' ); + return self::is_current_ip_allowed(); + } + + /** + * Check if the user's IP is in the allow list. + */ + public function is_current_ip_allowed() { + $ip = IP_Utils::get_ip(); + + // Server is misconfigured and we can't get an IP. + if ( ! $ip ) { + self::disable(); + ob_start(); + ( new CookieState() )->state( 'message', 'protect_misconfigured_ip' ); + ob_end_clean(); + return true; + } + + /** + * Short-circuit check_login_ability. + * + * If there is an alternate way to validate the current IP such as + * a hard-coded list of IP addresses, we can short-circuit the rest + * of the login ability checks and return true here. + * + * @module protect + * + * @since 4.4.0 + * + * @param bool false Should we allow all logins for the current ip? Default: false + */ + if ( apply_filters( 'jpp_allow_login', false, $ip ) ) { + return true; + } + + if ( IP_Utils::ip_is_private( $ip ) ) { + return true; + } + + if ( $this->ip_is_allowed( $ip ) ) { + return true; + } + } + + /** + * Check if someone is able to login based on IP. + */ + public function has_login_ability() { + if ( $this->is_current_ip_allowed() ) { + return true; + } + $status = $this->get_cached_status(); + if ( empty( $status ) || 'ok' === $status ) { + return true; + } + return false; + } + + /** + * Check the status of the cached transient. + */ + public function get_cached_status() { + $transient_name = $this->get_transient_name(); + $value = $this->get_transient( $transient_name ); + if ( isset( $value['status'] ) ) { + return $value['status']; + } + return ''; + } + + /** + * Check if we need to block with a math question to continue logging in. + */ + public function block_with_math() { + /** + * By default, Protect will allow a user who has been blocked for too + * many failed logins to start answering math questions to continue logging in + * + * For added security, you can disable this. + * + * @module protect + * + * @since 3.6.0 + * + * @param bool Whether to allow math for blocked users or not. + */ + + $this->block_login_with_math = 1; + /** + * Allow Math fallback for blocked IPs. + * + * @module protect + * + * @since 3.6.0 + * + * @param bool true Should we fallback to the Math questions when an IP is blocked. Default to true. + */ + $allow_math_fallback_on_fail = apply_filters( 'jpp_use_captcha_when_blocked', true ); + if ( ! $allow_math_fallback_on_fail ) { + $this->kill_login(); + } + + new Brute_Force_Protection_Math_Authenticate(); + + return false; + } + + /** + * Kill a login attempt + */ + public function kill_login() { + if ( + isset( $_GET['action'] ) && isset( $_GET['_wpnonce'] ) && + 'logout' === $_GET['action'] && + wp_verify_nonce( $_GET['_wpnonce'], 'log-out' ) && // phpcs:ignore WordPress.Security.ValidatedSanitizedInput + wp_get_current_user() + + ) { + // Allow users to logout. + return; + } + + $ip = IP_Utils::get_ip(); + /** + * Fires before every killed login. + * + * @module protect + * + * @since 3.4.0 + * + * @param string $ip IP flagged by Protect. + */ + do_action( 'jpp_kill_login', $ip ); + + if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { + // translators: variable is the IP address that was flagged. + $die_string = sprintf( __( 'Your IP (%1$s) has been flagged for potential security violations.', 'jetpack-waf' ), str_replace( 'http://', '', esc_url( 'http://' . $ip ) ) ); + wp_die( + $die_string, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_url used when forming string. + esc_html__( 'Login Blocked by Jetpack', 'jetpack-waf' ), + array( 'response' => 403 ) + ); + } + + $blocked_login_page = Brute_Force_Protection_Blocked_Login_Page::instance( $ip ); + + if ( $blocked_login_page->is_blocked_user_valid() ) { + return; + } + + $blocked_login_page->render_and_die(); + } + + /** + * Checks if the protect API call has failed, and if so initiates the math captcha fallback. + */ + public function check_use_math() { + $use_math = $this->get_transient( 'brute_use_math' ); + if ( $use_math ) { + new Brute_Force_Protection_Math_Authenticate(); + } + } + + /** + * If we're in a multisite network, return the blog ID of the primary blog + * + * @return int + */ + public function get_main_blog_id() { + if ( ! is_multisite() ) { + return false; + } + + global $current_site; + $primary_blog_id = $current_site->blog_id; + + return $primary_blog_id; + } + + /** + * Get jetpack blog id, or the jetpack blog id of the main blog in the main network + * + * @return int + */ + public function get_main_blog_jetpack_id() { + if ( ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $id = Jetpack_Options::get_option( 'id', false ); + restore_current_blog(); + } else { + $id = Jetpack_Options::get_option( 'id' ); + } + + return $id; + } + + /** + * Checks the API key. + */ + public function check_api_key() { + $response = $this->protect_call( 'check_key' ); + + if ( isset( $response['ckval'] ) ) { + return true; + } + + if ( isset( $response['error'] ) ) { + + if ( 'Invalid API Key' === $response['error'] ) { + $this->api_key_error = __( 'Your API key is invalid', 'jetpack-waf' ); + } + + if ( 'API Key Required' === $response['error'] ) { + $this->api_key_error = __( 'No API key', 'jetpack-waf' ); + } + } + + $this->api_key_error = __( 'There was an error contacting Jetpack servers.', 'jetpack-waf' ); + + return false; + } + + /** + * Calls over to the api using wp_remote_post + * + * @param string $action - 'check_ip', 'check_key', or 'failed_attempt'. + * @param array $request - Any custom data to post to the api. + * + * @return array + */ + public function protect_call( $action = 'check_ip', $request = array() ) { + global $wp_version; + + $api_key = $this->maybe_get_protect_key(); + + $user_agent = "WordPress/{$wp_version}"; + + $request['action'] = $action; + $request['ip'] = IP_Utils::get_ip(); + $request['host'] = $this->get_local_host(); + $request['headers'] = wp_json_encode( $this->get_headers() ); + $request['jetpack_version'] = null; + $request['wordpress_version'] = (string) $wp_version; + $request['api_key'] = $api_key; + $request['multisite'] = '0'; + + if ( defined( 'JETPACK__VERSION' ) ) { + $request['jetpack_version'] = constant( 'JETPACK__VERSION' ); + $user_agent .= ' | Jetpack/' . constant( 'JETPACK__VERSION' ); + } + + if ( defined( 'JETPACK_PROTECT_VERSION' ) && ! defined( 'JETPACK__VERSION' ) ) { + $request['jetpack_version'] = '12.1'; + $user_agent .= ' | JetpackProtect/' . constant( 'JETPACK_PROTECT_VERSION' ); + } + + if ( is_multisite() ) { + $request['multisite'] = get_blog_count(); + } + + /** + * Filter controls maximum timeout in waiting for reponse from Protect servers. + * + * @module protect + * + * @since 4.0.4 + * + * @param int $timeout Max time (in seconds) to wait for a response. + */ + $timeout = apply_filters( 'jetpack_protect_connect_timeout', 30 ); + + $args = array( + 'body' => $request, + 'user-agent' => $user_agent, + 'httpversion' => '1.0', + 'timeout' => absint( $timeout ), + ); + + Waf_Constants::define_brute_force_api_host(); + + $response_json = wp_remote_post( JETPACK_PROTECT__API_HOST, $args ); + $this->last_response_raw = $response_json; + + $transient_name = $this->get_transient_name(); + $this->delete_transient( $transient_name ); + + if ( is_array( $response_json ) ) { + $response = json_decode( $response_json['body'], true ); + } + + if ( isset( $response['blocked_attempts'] ) && $response['blocked_attempts'] ) { + update_site_option( 'jetpack_protect_blocked_attempts', $response['blocked_attempts'] ); + } + + if ( isset( $response['status'] ) && ! isset( $response['error'] ) ) { + $response['expire'] = time() + $response['seconds_remaining']; + $this->set_transient( $transient_name, $response, $response['seconds_remaining'] ); + $this->delete_transient( 'brute_use_math' ); + } else { // Fallback to Math Captcha if no response from API host. + $this->set_transient( 'brute_use_math', 1, 600 ); + $response['status'] = 'ok'; + $response['math'] = true; + } + + if ( isset( $response['error'] ) ) { + update_site_option( 'jetpack_protect_error', $response['error'] ); + } else { + delete_site_option( 'jetpack_protect_error' ); + } + + return $response; + } + + /** + * Gets the transient name. + */ + public function get_transient_name() { + $headers = $this->get_headers(); + $header_hash = md5( wp_json_encode( $headers ) ); + + return 'jpp_li_' . $header_hash; + } + + /** + * Wrapper for WordPress set_transient function, our version sets + * the transient on the main site in the network if this is a multisite network + * + * We do it this way (instead of set_site_transient) because of an issue where + * sitewide transients are always autoloaded + * https://core.trac.wordpress.org/ticket/22846 + * + * @param string $transient Transient name. Expected to not be SQL-escaped. Must be + * 45 characters or fewer in length. + * @param mixed $value Transient value. Must be serializable if non-scalar. + * Expected to not be SQL-escaped. + * @param int $expiration Optional. Time until expiration in seconds. Default 0. + * + * @return bool False if value was not set and true if value was set. + */ + public function set_transient( $transient, $value, $expiration ) { + if ( is_multisite() && ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $return = set_transient( $transient, $value, $expiration ); + restore_current_blog(); + + return $return; + } + + return set_transient( $transient, $value, $expiration ); + } + + /** + * Wrapper for WordPress delete_transient function, our version deletes + * the transient on the main site in the network if this is a multisite network + * + * @param string $transient Transient name. Expected to not be SQL-escaped. + * + * @return bool true if successful, false otherwise + */ + public function delete_transient( $transient ) { + if ( is_multisite() && ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $return = delete_transient( $transient ); + restore_current_blog(); + + return $return; + } + + return delete_transient( $transient ); + } + + /** + * Wrapper for WordPress get_transient function, our version gets + * the transient on the main site in the network if this is a multisite network + * + * @param string $transient Transient name. Expected to not be SQL-escaped. + * + * @return mixed Value of transient. + */ + public function get_transient( $transient ) { + if ( is_multisite() && ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $return = get_transient( $transient ); + restore_current_blog(); + + return $return; + } + + return get_transient( $transient ); + } + + /** + * Returns the local host. + */ + public function get_local_host() { + if ( isset( $this->local_host ) ) { + return $this->local_host; + } + + $uri = 'http://' . strtolower( isset( $_SERVER['HTTP_HOST'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '' ); + + if ( is_multisite() ) { + $uri = network_home_url(); + } + + $uridata = wp_parse_url( $uri ); + + $domain = $uridata['host']; + + // If we still don't have the site_url, get it. + if ( ! $domain ) { + $uri = get_site_url( 1 ); + $uridata = wp_parse_url( $uri ); + $domain = $uridata['host']; + } + + $this->local_host = $domain; + + return $this->local_host; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php new file mode 100644 index 00000000..8f3e6d56 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php @@ -0,0 +1,288 @@ +range ) ) { + return $ip_object->range_low . '-' . $ip_object->range_high; + } + + return $ip_object->ip_address; + }, + $brute_force_allow_list + ); + + $brute_force_allow_list_string = implode( "\n", $brute_force_allow_list ); + + if ( empty( $waf_allow_list ) ) { + return $brute_force_allow_list_string; + } + + // Return the lists merged into a single string. + return "$waf_allow_list\n$brute_force_allow_list_string"; + } + + /** + * Migrate the brute force protection IP allow list option to the WAF option. + * + * @since 0.11.0 + * + * @return void + */ + public static function migrate_brute_force_protection_ip_allow_list() { + // Get the allow list values directly from the database to avoid filters. + $brute_force_allow_list = Jetpack_Options::get_raw_option( 'jetpack_protect_whitelist' ); + $waf_allow_list = Jetpack_Options::get_raw_option( 'jetpack_waf_ip_allow_list' ); + + if ( ! empty( $brute_force_allow_list ) ) { + + if ( empty( $waf_allow_list ) ) { + $waf_allow_list = ''; + } + + // Merge the two allow lists. + $merged_allow_list = self::merge_ip_allow_lists( $waf_allow_list, $brute_force_allow_list ); + + // Update the WAF IP allow list with the merged list. + Jetpack_Options::update_raw_option( 'jetpack_waf_ip_allow_list', $merged_allow_list ); + + // Delete the old option if the update was successful. + // Check the values directly as `update_raw_option()` returns false if the value hasn't changed. + if ( Jetpack_Options::get_raw_option( 'jetpack_waf_ip_allow_list' ) === $merged_allow_list ) { + delete_option( 'jetpack_protect_whitelist' ); + } + } + } + + /** + * Filter for Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME's option value. + * Merges the deprecated IP allow list from the brute force protection module + * with the existing option value, and flags that the WAF needs to be updated. + * + * @since 0.11.0 + * + * @param array $waf_allow_list The current value of the option. + * + * @return array The merged IP allow list. + */ + public static function filter_option_waf_ip_allow_list( $waf_allow_list ) { + $brute_force_allow_list = Jetpack_Options::get_raw_option( 'jetpack_protect_whitelist', false ); + if ( false !== $brute_force_allow_list ) { + $waf_allow_list = self::merge_ip_allow_lists( $waf_allow_list, $brute_force_allow_list ); + update_option( Waf_Initializer::NEEDS_UPDATE_OPTION_NAME, true ); + } + + return $waf_allow_list; + } + + /** + * Default option for when the Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME option is not set. + * + * @param mixed $default The default value to return if the option does not exist in the database. + * @param string $option Option name. + * @param bool $passed_default Was get_option() passed a default value. + * + * @return mixed The default value to return if the option does not exist in the database. + */ + public static function default_option_waf_ip_allow_list( $default, $option, $passed_default ) { + // Allow get_option() to override this default value + if ( $passed_default ) { + return $default; + } + + $waf_allow_list = ''; + + // If the brute force option exists, use that and flag that the WAF needs to be updated. + $brute_force_allow_list = Jetpack_Options::get_raw_option( 'jetpack_protect_whitelist', false ); + if ( false !== $brute_force_allow_list ) { + $waf_allow_list = self::merge_ip_allow_lists( $waf_allow_list, $brute_force_allow_list ); + update_option( Waf_Initializer::NEEDS_UPDATE_OPTION_NAME, true ); + } + + return $waf_allow_list; + } + + /** + * Check if the brute force protection code is being run by an older version of Jetpack (< 12.0). + * + * @since 0.11.1 + * + * @return bool + */ + public static function is_brute_force_running_in_jetpack() { + return defined( 'JETPACK__VERSION' ) && version_compare( JETPACK__VERSION, '12', '<' ); + } + + /** + * Default the allow list enabled option to the value of the generic IP lists enabled option it replaced. + * + * @since 0.17.0 + * + * @param mixed $default The default value to return if the option does not exist in the database. + * @param string $option Option name. + * @param bool $passed_default Was get_option() passed a default value. + * + * @return mixed The default value to return if the option does not exist in the database. + */ + public static function default_option_waf_ip_allow_list_enabled( $default, $option, $passed_default ) { + // Allow get_option() to override this default value + if ( $passed_default ) { + return $default; + } + + // If the deprecated IP lists option was set to false, disable the allow list. + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. + $deprecated_option = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, true ); + if ( ! $deprecated_option ) { + return false; + } + + // If the allow list is empty, disable the allow list. + if ( ! Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ) ) { + return false; + } + + // Default to enabling the allow list. + return true; + } + + /** + * Default the block list enabled option to the value of the generic IP lists enabled option it replaced. + * + * @since 0.17.0 + * + * @param mixed $default The default value to return if the option does not exist in the database. + * @param string $option Option name. + * @param bool $passed_default Was get_option() passed a default value. + * + * @return mixed The default value to return if the option does not exist in the database. + */ + public static function default_option_waf_ip_block_list_enabled( $default, $option, $passed_default ) { + // Allow get_option() to override this default value + if ( $passed_default ) { + return $default; + } + + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. + return Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php new file mode 100644 index 00000000..8a036c11 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php @@ -0,0 +1,204 @@ + WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::waf', + 'permission_callback' => __CLASS__ . '::waf_permissions_callback', + ) + ); + + register_rest_route( + 'jetpack/v4', + '/waf', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_waf', + 'permission_callback' => __CLASS__ . '::waf_permissions_callback', + ) + ); + + register_rest_route( + 'jetpack/v4', + '/waf/update-rules', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_rules', + 'permission_callback' => __CLASS__ . '::waf_permissions_callback', + ) + ); + + $routes_registered = true; + } + + /** + * Update rules endpoint + * + * @return WP_REST_Response|WP_Error + */ + public static function update_rules() { + try { + Waf_Rules_Manager::generate_automatic_rules(); + Waf_Rules_Manager::generate_rules(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + return rest_ensure_response( + array( + 'success' => true, + 'message' => __( 'Rules updated succesfully', 'jetpack-waf' ), + ) + ); + } + + /** + * WAF Endpoint + * + * @return WP_REST_Response + */ + public static function waf() { + return rest_ensure_response( Waf_Runner::get_config() ); + } + + /** + * Update WAF Endpoint + * + * @param WP_REST_Request $request The API request. + * + * @return WP_REST_Response|WP_Error + */ + public static function update_waf( $request ) { + // Automatic Rules Enabled + if ( isset( $request[ Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME, $request->get_param( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME ) ? '1' : '' ); + } + + /** + * IP Lists Enabled + * + * @deprecated 0.17.0 This is a legacy option maintained here for backwards compatibility. + */ + if ( isset( $request['jetpack_waf_ip_list'] ) ) { + update_option( Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME, $request['jetpack_waf_ip_list'] ? '1' : '' ); + update_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, $request['jetpack_waf_ip_list'] ? '1' : '' ); + } + + // IP Block List + if ( isset( $request[ Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME, $request[ Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME ] ); + } + if ( isset( $request[ Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME, $request[ Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME ] ? '1' : '' ); + } + + // IP Allow List + if ( isset( $request[ Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME, $request[ Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ] ); + } + if ( isset( $request[ Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, $request[ Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME ] ? '1' : '' ); + } + + // Share Data + if ( isset( $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ) ) { + // If a user disabled the regular share we should disable the debug share data option. + if ( ! $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ) { + update_option( Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME, '' ); + } + + update_option( Waf_Runner::SHARE_DATA_OPTION_NAME, $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ? '1' : '' ); + } + + // Share Debug Data + if ( isset( $request[ Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME ] ) ) { + // If a user toggles the debug share we should enable the regular share data option. + if ( $request[ Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME ] ) { + update_option( Waf_Runner::SHARE_DATA_OPTION_NAME, 1 ); + } + + update_option( Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME, $request[ Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME ] ? '1' : '' ); + } + + // Brute Force Protection + if ( isset( $request['brute_force_protection'] ) ) { + $enable_brute_force = (bool) $request['brute_force_protection']; + $brute_force_protection_toggled = + $enable_brute_force + ? Brute_Force_Protection::enable() + : Brute_Force_Protection::disable(); + + if ( ! $brute_force_protection_toggled ) { + return new WP_Error( + $enable_brute_force + ? 'brute_force_protection_activation_failed' + : 'brute_force_protection_deactivation_failed', + $enable_brute_force + ? __( 'Brute force protection could not be activated.', 'jetpack-waf' ) + : __( 'Brute force protection could not be deactivated.', 'jetpack-waf' ), + array( 'status' => 500 ) + ); + } + } + + // Only attempt to update the WAF if the module is supported + if ( Waf_Runner::is_supported_environment() ) { + try { + Waf_Runner::update_waf(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + } + + return self::waf(); + } + + /** + * WAF Endpoint Permissions Callback + * + * @return bool|WP_Error True if user can view the Jetpack admin page. + */ + public static function waf_permissions_callback() { + if ( current_user_can( 'manage_options' ) ) { + return true; + } + + return new WP_Error( + 'invalid_user_permission_manage_options', + REST_Connector::get_user_permissions_error_msg(), + array( 'status' => rest_authorization_required_code() ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php new file mode 100644 index 00000000..e7e2c01a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php @@ -0,0 +1,166 @@ +] + * : The new mode to be set. + * --- + * options: + * - silent + * - normal + * --- + * + * @param array $args Arguments passed to CLI. + * @return void|null + * @throws WP_CLI\ExitException If there is an error switching the mode. + */ + public function mode( $args ) { + if ( count( $args ) > 1 ) { + + return WP_CLI::error( __( 'Only one mode may be specified.', 'jetpack-waf' ) ); + } + if ( count( $args ) === 1 ) { + if ( ! Waf_Runner::is_allowed_mode( $args[0] ) ) { + + return WP_CLI::error( + sprintf( + /* translators: %1$s is the mode that was actually found. Also note that the expected "silent" and "normal" are hard-coded strings and must therefore stay the same in any translation. */ + __( 'Invalid mode: %1$s. Expected "silent" or "normal".', 'jetpack-waf' ), + $args[0] + ) + ); + } + + update_option( Waf_Runner::MODE_OPTION_NAME, $args[0] ); + + try { + ( new Waf_Standalone_Bootstrap() )->generate(); + } catch ( \Exception $e ) { + WP_CLI::warning( + sprintf( + /* translators: %1$s is the unexpected error message. */ + __( 'Unable to generate waf bootstrap - standalone mode may not work properly: %1$s', 'jetpack-waf' ), + $e->getMessage() + ) + ); + } + + return WP_CLI::success( + sprintf( + /* translators: %1$s is the name of the mode that was just switched to. */ + __( 'Jetpack WAF mode switched to "%1$s".', 'jetpack-waf' ), + get_option( Waf_Runner::MODE_OPTION_NAME ) + ) + ); + } + WP_CLI::line( + sprintf( + /* translators: %1$s is the name of the mode that the waf is currently running in. */ + __( 'Jetpack WAF is running in "%1$s" mode.', 'jetpack-waf' ), + get_option( Waf_Runner::MODE_OPTION_NAME ) + ) + ); + } + + /** + * Setup the WAF to run. + * ## OPTIONS + * + * [] + * : The new mode to be set. + * --- + * options: + * - silent + * - normal + * --- + * + * @param array $args Arguments passed to CLI. + * @return void|null + * @throws WP_CLI\ExitException If there is an error switching the mode. + */ + public function setup( $args ) { + // Let is_allowed_mode know we are running from the CLI + define( 'WAF_CLI_MODE', $args[0] ); + + // Set the mode and generate the bootstrap + $this->mode( array( $args[0] ) ); + + try { + // Add relevant options and generate the rules.php file + Waf_Runner::activate(); + } catch ( \Exception $e ) { + + return WP_CLI::error( + sprintf( + /* translators: %1$s is the unexpected error message. */ + __( 'Jetpack WAF rules file failed to generate: %1$s', 'jetpack-waf' ), + $e->getMessage() + ) + ); + } + + return WP_CLI::success( __( 'Jetpack WAF has successfully been setup.', 'jetpack-waf' ) ); + } + + /** + * Delete the WAF options. + * + * @return void|null + * @throws WP_CLI\ExitException If deactivating has failures. + */ + public function teardown() { + try { + Waf_Runner::deactivate(); + } catch ( \Exception $e ) { + WP_CLI::error( __( 'Jetpack WAF failed to fully deactivate.', 'jetpack-waf' ) ); + } + + return WP_CLI::success( __( 'Jetpack WAF has been deactivated.', 'jetpack-waf' ) ); + } + + /** + * Generate the rules.php file with latest rules for the WAF. + * + * @return void|null + * @throws WP_CLI\ExitException If there is an error switching the mode. + */ + public function generate_rules() { + try { + Waf_Rules_Manager::generate_automatic_rules(); + Waf_Rules_Manager::generate_rules(); + } catch ( \Exception $e ) { + + return WP_CLI::error( + sprintf( + /* translators: %1$s is the unexpected error message. */ + __( 'Jetpack WAF rules file failed to generate: %1$s', 'jetpack-waf' ), + $e->getMessage() + ) + ); + } + + return WP_CLI::success( + sprintf( + /* translators: %1$s is the name of the mode that was just switched to. */ + __( 'Jetpack WAF rules successfully created to: "%1$s".', 'jetpack-waf' ), + Waf_Runner::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ) + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php new file mode 100644 index 00000000..b4c368bb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php @@ -0,0 +1,117 @@ +is_atomic_platform(); + $is_atomic_on_jn = defined( 'IS_ATOMIC_JN' ) ?? IS_ATOMIC_JN; + define( 'DISABLE_JETPACK_WAF', $is_wpcom || ( $is_atomic && ! $is_atomic_on_jn ) ); + } + } + + /** + * Set the mode definition if it has not been set. + * + * @return void + */ + public static function define_mode() { + if ( ! defined( 'JETPACK_WAF_MODE' ) ) { + $mode_option = get_option( Waf_Runner::MODE_OPTION_NAME ); + define( 'JETPACK_WAF_MODE', $mode_option ); + } + } + + /** + * Set the share data definition if it has not been set. + * + * @return void + */ + public static function define_share_data() { + if ( ! defined( 'JETPACK_WAF_SHARE_DATA' ) ) { + $share_data_option = false; + if ( function_exists( 'get_option' ) ) { + $share_data_option = get_option( Waf_Runner::SHARE_DATA_OPTION_NAME, false ); + } + + define( 'JETPACK_WAF_SHARE_DATA', $share_data_option ); + } + if ( ! defined( 'JETPACK_WAF_SHARE_DEBUG_DATA' ) ) { + $share_debug_data_option = false; + if ( function_exists( 'get_option' ) ) { + $share_debug_data_option = get_option( Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME, false ); + } + + define( 'JETPACK_WAF_SHARE_DEBUG_DATA', $share_debug_data_option ); + } + } + + /** + * Set the brute force protection's API host definition if it has not been set. + * + * @return void + */ + public static function define_brute_force_api_host() { + if ( ! defined( 'JETPACK_PROTECT__API_HOST' ) ) { + define( 'JETPACK_PROTECT__API_HOST', 'https://api.bruteprotect.com/' ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php new file mode 100644 index 00000000..c2720f83 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php @@ -0,0 +1,240 @@ +generate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + return true; + } + + /** + * Activate the Brute force protection on module activation. + * + * @return bool True if the Brute force protection activation is successful + */ + public static function on_brute_force_protection_activation() { + $brute_force_protection = Brute_Force_Protection::instance(); + $brute_force_protection->on_activation(); + + return true; + } + + /** + * Deactivate the WAF on module deactivation. + * + * @return bool|WP_Error True if the WAF deactivation is successful, WP_Error otherwise. + */ + public static function on_waf_deactivation() { + try { + Waf_Runner::deactivate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + return true; + } + + /** + * Deactivate the Brute force protection on module deactivation. + * + * @return bool True if the Brute force protection deactivation is successful. + */ + public static function on_brute_force_protection_deactivation() { + $brute_force_protection = Brute_Force_Protection::instance(); + $brute_force_protection->on_deactivation(); + + return true; + } + + /** + * Updates the WAF after upgrader process is complete. + * + * @param WP_Upgrader $upgrader WP_Upgrader instance. In other contexts this might be a Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. + * @param array $hook_extra Array of bulk item update data. + * + * @return void + */ + public static function update_waf_after_plugin_upgrade( $upgrader, $hook_extra ) { + $jetpack_text_domains_with_waf = array( 'jetpack', 'jetpack-protect' ); + $jetpack_plugins_with_waf = array( 'jetpack/jetpack.php', 'jetpack-protect/jetpack-protect.php' ); + + // Only run on upgrades affecting plugins + if ( 'plugin' !== $hook_extra['type'] ) { + return; + } + + // Only run on updates and installations + if ( 'update' !== $hook_extra['action'] && 'install' !== $hook_extra['action'] ) { + return; + } + + // Only run when Jetpack plugins were affected + if ( 'update' === $hook_extra['action'] && + ! empty( $hook_extra['plugins'] ) && + empty( array_intersect( $jetpack_plugins_with_waf, $hook_extra['plugins'] ) ) + ) { + return; + } + if ( 'install' === $hook_extra['action'] && + ! empty( $upgrader->new_plugin_data['TextDomain'] ) && + empty( in_array( $upgrader->new_plugin_data['TextDomain'], $jetpack_text_domains_with_waf, true ) ) + ) { + return; + } + + update_option( self::NEEDS_UPDATE_OPTION_NAME, true ); + } + + /** + * Check for WAF update + * + * Updates the WAF when the "needs update" option is enabled. + * + * @return bool|WP_Error True if the WAF is up-to-date or was sucessfully updated, WP_Error if the update failed. + */ + public static function check_for_updates() { + if ( get_option( self::NEEDS_UPDATE_OPTION_NAME ) ) { + if ( Waf_Runner::is_supported_environment() ) { + // Compatiblity patch for cases where an outdated WAF_Constants class has been + // autoloaded by the standalone bootstrap execution at the beginning of the current request. + if ( ! method_exists( Waf_Constants::class, 'define_mode' ) ) { + try { + ( new Waf_Standalone_Bootstrap() )->generate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + } + + Waf_Compatibility::run_compatibility_migrations(); + + try { + Waf_Rules_Manager::generate_ip_rules(); + Waf_Rules_Manager::generate_rules(); + ( new Waf_Standalone_Bootstrap() )->generate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + } else { + // If the site doesn't support the request firewall, + // just migrate the IP allow list used by brute force protection. + Waf_Compatibility::migrate_brute_force_protection_ip_allow_list(); + } + + update_option( self::NEEDS_UPDATE_OPTION_NAME, false ); + } + + return true; + } + + /** + * Disables the WAF module when on an unsupported platform in Jetpack. + * + * @param array $modules Filterable value for `jetpack_get_available_modules`. + * + * @return array Array of module slugs. + */ + public static function remove_module_on_unsupported_environments( $modules ) { + if ( ! Waf_Runner::is_supported_environment() ) { + // WAF should never be available on unsupported platforms. + unset( $modules['waf'] ); + } + + return $modules; + } + + /** + * Disables the WAF module when on an unsupported platform in a standalone plugin. + * + * @param array $modules Filterable value for `jetpack_get_available_standalone_modules`. + * + * @return array Array of module slugs. + */ + public static function remove_standalone_module_on_unsupported_environments( $modules ) { + if ( ! Waf_Runner::is_supported_environment() ) { + // WAF should never be available on unsupported platforms. + $modules = array_filter( + $modules, + function ( $module ) { + return $module !== 'waf'; + } + ); + + } + + return $modules; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php new file mode 100644 index 00000000..6e2bdceb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php @@ -0,0 +1,286 @@ += intval( $test ) + ? $input + : false; + } + + /** + * Returns true if the input value is greater than the test value. + * If either value cannot be converted to an int it will be treated as 0. + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return int|false + */ + public function gt( $input, $test ) { + return intval( $input ) > intval( $test ) + ? $input + : false; + } + + /** + * Returns true if the input value is less than or equal to the test value. + * If either value cannot be converted to an int it will be treated as 0. + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return int|false + */ + public function le( $input, $test ) { + return intval( $input ) <= intval( $test ) + ? $input + : false; + } + + /** + * Returns true if the input value is less than the test value. + * If either value cannot be converted to an int it will be treated as 0. + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return int|false + */ + public function lt( $input, $test ) { + return intval( $input ) < intval( $test ) + ? $input + : false; + } + + /** + * Returns false. + * + * @return false + */ + public function no_match() { + return false; + } + + /** + * Uses a multi-string matching algorithm to search through $input for a number of given $words. + * + * @param string $input Input. + * @param string[] $words \AhoCorasick\MultiStringMatcher $matcher. + * @return string[]|false Returns the words that were found in $input, or FALSE if no words were found. + */ + public function pm( $input, $words ) { + $results = $this->get_multi_string_matcher( $words )->searchIn( $input ); + + return isset( $results[0] ) + ? array_map( + function ( $r ) { + return $r[1]; }, + $results + ) + : false; + } + + /** + * The last-used pattern-matching algorithm. + * + * @var array + */ + private $last_multi_string_matcher = array( null, null ); + + /** + * Creates a matcher that uses the Aho-Corasick algorithm to efficiently find a number of words in an input string. + * Caches the last-used matcher so that the same word list doesn't have to be compiled multiple times. + * + * @param string[] $words Words. + * @return \AhoCorasick\MultiStringMatcher + */ + private function get_multi_string_matcher( $words ) { + // only create a new matcher entity if we don't have one already for this word list. + if ( $this->last_multi_string_matcher[0] !== $words ) { + $this->last_multi_string_matcher = array( $words, new \AhoCorasick\MultiStringMatcher( $words ) ); + } + + return $this->last_multi_string_matcher[1]; + } + + /** + * Performs a regular expression match on the input subject using the given pattern. + * Returns false if the pattern does not match, or the substring(s) of the input + * that were matched by the pattern. + * + * @param string $subject Subject. + * @param string $pattern Pattern. + * @return string[]|false + */ + public function rx( $subject, $pattern ) { + $matched = preg_match( $pattern, $subject, $matches ); + return 1 === $matched + ? $matches + : false; + } + + /** + * Returns true if the given input string matches the test string. + * + * @param string $input Input. + * @param string $test Test. + * @return string|false + */ + public function streq( $input, $test ) { + return $input === $test + ? $test + : false; + } + + /** + * Returns true. + * + * @param string $input Input. + * @return bool + */ + public function unconditional_match( $input ) { + return $input; + } + + /** + * Checks to see if the input string only contains characters within the given byte range + * + * @param string $input Input. + * @param array $valid_range Valid range. + * @return string + */ + public function validate_byte_range( $input, $valid_range ) { + if ( '' === $input ) { + // an empty string is considered "valid". + return false; + } + $i = 0; + while ( isset( $input[ $i ] ) ) { + $n = ord( $input[ $i ] ); + if ( $n < $valid_range['min'] || $n > $valid_range['max'] ) { + return $input[ $i ]; + } + $valid = false; + foreach ( $valid_range['range'] as $b ) { + if ( $n === $b || is_array( $b ) && $n >= $b[0] && $n <= $b[1] ) { + $valid = true; + break; + } + } + if ( ! $valid ) { + return $input[ $i ]; + } + ++$i; + } + + // if there weren't any invalid bytes, return false. + return false; + } + + /** + * Returns true if the input value is found anywhere inside the test value + * (i.e. the inverse of @contains) + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return string|false + */ + public function within( $input, $test ) { + if ( '' === $input || '' === $test ) { + return false; + } + + return strpos( $test, $input ) !== false + ? $input + : false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php new file mode 100644 index 00000000..5017a2e2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php @@ -0,0 +1,382 @@ +url = [ 'https://wordpress.com', '/index.php', '?myvar=red' ] + * @var array{0: string, 1: string, 2: string}|null + */ + protected $url = null; + + /** + * Trusted proxies. + * + * @var array List of trusted proxy IP addresses. + */ + private $trusted_proxies = array(); + + /** + * Trusted headers. + * + * @var array List of headers to trust from the trusted proxies. + */ + private $trusted_headers = array(); + + /** + * Sets the list of IP addresses for the proxies to trust. Trusted headers will only be accepted as the + * user IP address from these IP adresses. + * + * Popular choices include: + * - 192.168.0.1 + * - 10.0.0.1 + * + * @param array $proxies List of proxy IP addresses. + * @return void + */ + public function set_trusted_proxies( $proxies ) { + $this->trusted_proxies = (array) $proxies; + } + + /** + * Sets the list of headers to be trusted from the proxies. These headers will only be taken into account + * if the request comes from a trusted proxy as configured with set_trusted_proxies(). + * + * Popular choices include: + * - HTTP_CLIENT_IP + * - HTTP_X_FORWARDED_FOR + * - HTTP_X_FORWARDED + * - HTTP_X_CLUSTER_CLIENT_IP + * - HTTP_FORWARDED_FOR + * - HTTP_FORWARDED + * + * @param array $headers List of HTTP header strings. + * @return void + */ + public function set_trusted_headers( $headers ) { + $this->trusted_headers = (array) $headers; + } + + /** + * Determines the users real IP address based on the settings passed to set_trusted_proxies() and + * set_trusted_headers() before. On CLI, this will be null. + * + * @return string|null + */ + public function get_real_user_ip_address() { + $remote_addr = ! empty( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + + if ( in_array( $remote_addr, $this->trusted_proxies, true ) ) { + $ip_by_header = $this->get_ip_by_header( array_merge( $this->trusted_headers, array( 'REMOTE_ADDR' ) ) ); + if ( ! empty( $ip_by_header ) ) { + return $ip_by_header; + } + } + + return $remote_addr; + } + + /** + * Iterates through a given list of HTTP headers and attempts to get the IP address from the header that + * a proxy sends along. Make sure you trust the IP address before calling this method. + * + * @param array $headers The list of headers to check. + * @return string|null + */ + private function get_ip_by_header( $headers ) { + foreach ( $headers as $key ) { + if ( isset( $_SERVER[ $key ] ) ) { + foreach ( explode( ',', wp_unslash( $_SERVER[ $key ] ) ) as $ip ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- filter_var is applied below. + $ip = trim( $ip ); + + if ( filter_var( $ip, FILTER_VALIDATE_IP ) !== false ) { + return $ip; + } + } + } + } + + return null; + } + + /** + * Returns the headers that were sent with this request + * + * @return array{0: string, 1: scalar}[] + */ + public function get_headers() { + $value = array(); + $has_content_type = false; + $has_content_length = false; + foreach ( $_SERVER as $k => $v ) { + $k = strtolower( $k ); + if ( 'http_' === substr( $k, 0, 5 ) ) { + $value[] = array( $this->normalize_header_name( substr( $k, 5 ) ), $v ); + } elseif ( 'content_type' === $k && '' !== $v ) { + $has_content_type = true; + $value[] = array( 'content-type', $v ); + } elseif ( 'content_length' === $k && '' !== $v ) { + $has_content_length = true; + $value[] = array( 'content-length', $v ); + } + } + if ( ! $has_content_type ) { + // default Content-Type per RFC 7231 section 3.1.5.5. + $value[] = array( 'content-type', 'application/octet-stream' ); + } + if ( ! $has_content_length ) { + $value[] = array( 'content-length', '0' ); + } + + return $value; + } + + /** + * Returns the value of a specific header that was sent with this request + * + * @param string $name The name of the header to retrieve. + * @return string + */ + public function get_header( $name ) { + $name = $this->normalize_header_name( $name ); + foreach ( $this->get_headers() as list( $header_name, $header_value ) ) { + if ( $header_name === $name ) { + return $header_value; + } + } + return ''; + } + + /** + * Change a header name to all-lowercase and replace spaces and underscores with dashes. + * + * @param string $name The header name to normalize. + * @return string + */ + public function normalize_header_name( $name ) { + return str_replace( array( ' ', '_' ), '-', strtolower( $name ) ); + } + + /** + * Get the method for this request (GET, POST, etc). + * + * @return string + */ + public function get_method() { + return isset( $_SERVER['REQUEST_METHOD'] ) + ? filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ), FILTER_DEFAULT ) + : ''; + } + + /** + * Get the protocol for this request (HTTP, HTTPS, etc) + * + * @return string + */ + public function get_protocol() { + return isset( $_SERVER['SERVER_PROTOCOL'] ) + ? filter_var( wp_unslash( $_SERVER['SERVER_PROTOCOL'] ), FILTER_DEFAULT ) + : ''; + } + + /** + * Returns the URL parts for this request. + * + * @see $this->url + * @return array{0: string, 1: string, 2: string} + */ + protected function get_url() { + if ( null !== $this->url ) { + return $this->url; + } + + $uri = isset( $_SERVER['REQUEST_URI'] ) ? filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ), FILTER_DEFAULT ) : '/'; + if ( false !== strpos( $uri, '?' ) ) { + // remove the query string (we'll pull it from elsewhere later) + $uri = urldecode( substr( $uri, 0, strpos( $uri, '?' ) ) ); + } else { + $uri = urldecode( $uri ); + } + $query_string = isset( $_SERVER['QUERY_STRING'] ) ? '?' . filter_var( wp_unslash( $_SERVER['QUERY_STRING'] ), FILTER_DEFAULT ) : ''; + if ( 1 === preg_match( '/^https?:\/\//', $uri ) ) { + // sometimes $_SERVER[REQUEST_URI] already includes the full domain name + $uri_host = substr( $uri, 0, strpos( $uri, '/', 8 ) ); + $uri_path = substr( $uri, strlen( $uri_host ) ); + $this->url = array( $uri_host, $uri_path, $query_string ); + } else { + // otherwise build the URI manually + $uri_scheme = ( ! empty( $_SERVER['HTTPS'] ) && 'off' !== $_SERVER['HTTPS'] ) + ? 'https' + : 'http'; + $uri_host = isset( $_SERVER['HTTP_HOST'] ) + ? filter_var( wp_unslash( $_SERVER['HTTP_HOST'] ), FILTER_DEFAULT ) + : ( + isset( $_SERVER['SERVER_NAME'] ) + ? filter_var( wp_unslash( $_SERVER['SERVER_NAME'] ), FILTER_DEFAULT ) + : '' + ); + $uri_port = isset( $_SERVER['SERVER_PORT'] ) + ? filter_var( wp_unslash( $_SERVER['SERVER_PORT'] ), FILTER_SANITIZE_NUMBER_INT ) + : ''; + // we only need to include the port if it's non-standard + if ( $uri_port && ( 'http' === $uri_scheme && '80' !== $uri_port || 'https' === $uri_scheme && '443' !== $uri_port ) ) { + $uri_port = ':' . $uri_port; + } else { + $uri_port = ''; + } + $this->url = array( + $uri_scheme . '://' . $uri_host . $uri_port, + $uri, + $query_string, + ); + } + return $this->url; + } + + /** + * Get the requested URI + * + * @param boolean $include_host If true, the scheme and domain will be included in the returned string (i.e. 'https://wordpress.com/index.php). + * If false, only the requested URI path will be returned (i.e. '/index.php'). + * @return string + */ + public function get_uri( $include_host = false ) { + list( $host, $file, $query ) = $this->get_url(); + + return ( $include_host ? $host : '' ) . $file . $query; + } + + /** + * Return the filename part of the request + * + * @example for 'https://wordpress.com/some/page?id=5', return '/some/page' + * @return string + */ + public function get_filename() { + return $this->get_url()[1]; + } + + /** + * Return the basename part of the request + * + * @example for 'https://wordpress.com/some/page.php?id=5', return 'page.php' + * @return string + */ + public function get_basename() { + // Get the filename part of the request + $filename = $this->get_filename(); + // Normalize slashes + $filename = str_replace( '\\', '/', $filename ); + // Remove trailing slashes + $filename = rtrim( $filename, '/' ); + // Return the basename + $offset = strrpos( $filename, '/' ); + return $offset !== false ? substr( $filename, $offset + 1 ) : $filename; + } + + /** + * Return the query string. If present, it will be prefixed with '?'. Otherwise, it will be an empty string. + * + * @return string + */ + public function get_query_string() { + return $this->get_url()[2]; + } + + /** + * Returns the request body. + * + * @return string + */ + public function get_body() { + $body = file_get_contents( 'php://input' ); + return false === $body ? '' : $body; + } + + /** + * Returns the cookies + * + * @return array{string, scalar}[] + */ + public function get_cookies() { + return flatten_array( $_COOKIE ); + } + + /** + * Returns the GET variables + * + * @return array{string, scalar}[] + */ + public function get_get_vars() { + return flatten_array( $_GET ); + } + + /** + * Returns the POST variables + * + * @return array{string, scalar}[] + */ + public function get_post_vars() { + $content_type = $this->get_header( 'content-type' ); + if ( ! empty( $_POST ) ) { + // If $_POST is populated, use it. + return flatten_array( $_POST ); + } elseif ( strpos( $content_type, 'application/json' ) !== false ) { + // Attempt to decode JSON requests. + $decoded_json = json_decode( $this->get_body(), true ) ?? array(); + return flatten_array( $decoded_json, 'json', true ); + } elseif ( strpos( $content_type, 'application/x-www-form-urlencoded' ) !== false ) { + // Attempt to decode url-encoded data + parse_str( $this->get_body(), $params ); + return flatten_array( $params ); + } else { + // Don't try to parse any other content types + return array(); + } + } + + /** + * Returns the files that were uploaded with this request (i.e. what's in the $_FILES superglobal) + * + * @return RequestFile[] + */ + public function get_files() { + $files = array(); + foreach ( $_FILES as $field_name => $arr ) { + // flatten the values in case we were given inputs with brackets + foreach ( flatten_array( $arr ) as list( $arr_key, $arr_value ) ) { + if ( $arr_key === 'name' ) { + // if this file was a simple (non-nested) name and unique, then just add it. + $files[] = array( + 'name' => $field_name, + 'filename' => $arr_value, + ); + } elseif ( 'name[' === substr( $arr_key, 0, 5 ) ) { + // otherwise this was a file with a nested name and/or multiple files with the same name + $files[] = array( + 'name' => $field_name . substr( $arr_key, 4 ), + 'filename' => $arr_value, + ); + } + } + } + return $files; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php new file mode 100644 index 00000000..89bf220f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php @@ -0,0 +1,355 @@ +get_wp_error(); + } + + update_option( self::RULE_LAST_UPDATED_OPTION_NAME, time() ); + return true; + } + + /** + * Re-activate the WAF any time an option is added or updated. + * + * @return bool|WP_Error True if re-activation is successful, WP_Error on failure. + */ + public static function reactivate_on_rules_option_change() { + try { + Waf_Runner::activate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + return true; + } + + /** + * Updates the rule set if rules version has changed + * + * @throws Waf_Exception If the firewall mode is invalid. + * @throws Waf_Exception If the rules update fails. + * + * @return void + */ + public static function update_rules_if_changed() { + $version = get_option( self::VERSION_OPTION_NAME ); + if ( self::RULES_VERSION !== $version ) { + self::generate_automatic_rules(); + self::generate_ip_rules(); + self::generate_rules(); + + update_option( self::VERSION_OPTION_NAME, self::RULES_VERSION ); + } + } + + /** + * Retrieve rules from the API + * + * @throws Waf_Exception If site is not registered. + * @throws Rules_API_Exception If API did not respond 200. + * @throws Rules_API_Exception If data is missing from response. + * + * @return array + */ + public static function get_rules_from_api() { + $blog_id = Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + throw new Waf_Exception( 'Site is not registered' ); + } + + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%s/waf-rules', $blog_id ), + '2', + array(), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( 200 !== $response_code ) { + throw new Rules_API_Exception( 'API connection failed.', (int) $response_code ); + } + + $rules_json = wp_remote_retrieve_body( $response ); + $rules = json_decode( $rules_json, true ); + + if ( empty( $rules['data'] ) ) { + throw new Rules_API_Exception( 'Data missing from response.' ); + } + + return $rules['data']; + } + + /** + * Wraps a require statement in a file_exists check. + * + * @param string $required_file The file to check if exists and require. + * @param string $return_code The PHP code to execute if the file require returns true. Defaults to 'return;'. + * + * @return string The wrapped require statement. + */ + private static function wrap_require( $required_file, $return_code = 'return;' ) { + return "if ( file_exists( '$required_file' ) ) { if ( require( '$required_file' ) ) { $return_code } }"; + } + + /** + * Generates the rules.php script + * + * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction. + * + * @throws File_System_Exception If file writing fails initializing rule files. + * @throws File_System_Exception If file writing fails writing to the rules entrypoint file. + * + * @return void + */ + public static function generate_rules() { + global $wp_filesystem; + Waf_Runner::initialize_filesystem(); + + $rules = "is_dir( dirname( $entrypoint_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $entrypoint_file_path ) ); + } + + // Ensure all potentially required rule files exist + $rule_files = array( self::RULES_ENTRYPOINT_FILE, self::AUTOMATIC_RULES_FILE, self::IP_ALLOW_RULES_FILE, self::IP_BLOCK_RULES_FILE ); + foreach ( $rule_files as $rule_file ) { + $rule_file = Waf_Runner::get_waf_file_path( $rule_file ); + if ( ! $wp_filesystem->is_file( $rule_file ) ) { + if ( ! $wp_filesystem->put_contents( $rule_file, "block( 'block', -1, 'ip block list' );" ) . "\n"; + } + + // Add automatic rules + if ( self::automatic_rules_enabled() ) { + $rules .= self::wrap_require( Waf_Runner::get_waf_file_path( self::AUTOMATIC_RULES_FILE ) ) . "\n"; + } + + // Update the rules file + if ( ! $wp_filesystem->put_contents( $entrypoint_file_path, $rules ) ) { + throw new File_System_Exception( 'Failed writing rules file to: ' . $entrypoint_file_path ); + } + } + + /** + * Generates the automatic-rules.php script + * + * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction. + * + * @throws Waf_Exception If rules cannot be fetched from the API. + * @throws File_System_Exception If file writing fails. + * + * @return void + */ + public static function generate_automatic_rules() { + global $wp_filesystem; + Waf_Runner::initialize_filesystem(); + + $automatic_rules_file_path = Waf_Runner::get_waf_file_path( self::AUTOMATIC_RULES_FILE ); + + // Ensure that the folder exists. + if ( ! $wp_filesystem->is_dir( dirname( $automatic_rules_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $automatic_rules_file_path ) ); + } + + try { + $rules = self::get_rules_from_api(); + } catch ( Waf_Exception $e ) { + // Do not throw API exceptions for users who do not have access + if ( 401 !== $e->getCode() ) { + throw $e; + } + } + + // If there are no rules available, don't overwrite the existing file. + if ( empty( $rules ) ) { + return; + } + + if ( ! $wp_filesystem->put_contents( $automatic_rules_file_path, $rules ) ) { + throw new File_System_Exception( 'Failed writing automatic rules file to: ' . $automatic_rules_file_path ); + } + + update_option( self::AUTOMATIC_RULES_LAST_UPDATED_OPTION_NAME, time() ); + } + + /** + * Generates the rules.php script + * + * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction. + * + * @throws File_System_Exception If writing to IP allow list file fails. + * @throws File_System_Exception If writing to IP block list file fails. + * + * @return void + */ + public static function generate_ip_rules() { + global $wp_filesystem; + Waf_Runner::initialize_filesystem(); + + $allow_ip_file_path = Waf_Runner::get_waf_file_path( self::IP_ALLOW_RULES_FILE ); + $block_ip_file_path = Waf_Runner::get_waf_file_path( self::IP_BLOCK_RULES_FILE ); + + // Ensure that the folders exists. + if ( ! $wp_filesystem->is_dir( dirname( $allow_ip_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $allow_ip_file_path ) ); + } + if ( ! $wp_filesystem->is_dir( dirname( $block_ip_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $block_ip_file_path ) ); + } + + $allow_list = IP_Utils::get_ip_addresses_from_string( get_option( self::IP_ALLOW_LIST_OPTION_NAME ) ); + $block_list = IP_Utils::get_ip_addresses_from_string( get_option( self::IP_BLOCK_LIST_OPTION_NAME ) ); + + $allow_rules_content = ''; + // phpcs:disable WordPress.PHP.DevelopmentFunctions + $allow_rules_content .= '$waf_allow_list = ' . var_export( $allow_list, true ) . ";\n"; + // phpcs:enable + $allow_rules_content .= 'return $waf->is_ip_in_array( $waf_allow_list );' . "\n"; + + if ( ! $wp_filesystem->put_contents( $allow_ip_file_path, "is_ip_in_array( $waf_block_list );' . "\n"; + + if ( ! $wp_filesystem->put_contents( $block_ip_file_path, "is_wpcom_simple() ) { + return false; + } + + // Do not run on the Atomic platform + if ( ( new Host() )->is_atomic_platform() ) { + return false; + } + + // Do not run on the VIP platform + if ( ( new Host() )->is_vip_site() ) { + return false; + } + + return true; + } + + /** + * Determines if the WAF module is enabled on the site. + * + * @return bool + */ + public static function is_enabled() { + // if ABSPATH is defined, then WordPress has already been instantiated, + // so we can check to see if the waf module is activated. + if ( defined( 'ABSPATH' ) ) { + return ( new Modules() )->is_active( self::WAF_MODULE_NAME ); + } + + return true; + } + + /** + * Enables the WAF module on the site. + * + * @return bool + */ + public static function enable() { + return ( new Modules() )->activate( self::WAF_MODULE_NAME, false, false ); + } + + /** + * Disabled the WAF module on the site. + * + * @return bool + */ + public static function disable() { + return ( new Modules() )->deactivate( self::WAF_MODULE_NAME ); + } + + /** + * Get Config + * + * @return array The WAF settings and current configuration data. + */ + public static function get_config() { + return array( + Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME => Waf_Rules_Manager::automatic_rules_enabled(), + Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME => get_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ), + Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME => Waf_Rules_Manager::ip_allow_list_enabled(), + Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME => get_option( Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME ), + Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME => Waf_Rules_Manager::ip_block_list_enabled(), + self::SHARE_DATA_OPTION_NAME => get_option( self::SHARE_DATA_OPTION_NAME ), + self::SHARE_DEBUG_DATA_OPTION_NAME => get_option( self::SHARE_DEBUG_DATA_OPTION_NAME ), + 'bootstrap_path' => self::get_bootstrap_file_path(), + 'standalone_mode' => self::get_standalone_mode_status(), + 'automatic_rules_available' => (bool) self::automatic_rules_available(), + 'brute_force_protection' => (bool) Brute_Force_Protection::is_enabled(), + + /** + * Provide the deprecated IP lists options for backwards compatibility with older versions of the Jetpack and Protect plugins. + * i.e. If one plugin is updated and the other is not, the latest version of this package will be used by both plugins. + * + * @deprecated 0.17.0 + */ + // @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility. + Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME => Waf_Rules_Manager::ip_allow_list_enabled() || Waf_Rules_Manager::ip_block_list_enabled(), + ); + } + + /** + * Get Bootstrap File Path + * + * @return string The path to the Jetpack Firewall's bootstrap.php file. + */ + private static function get_bootstrap_file_path() { + $bootstrap = new Waf_Standalone_Bootstrap(); + return $bootstrap->get_bootstrap_file_path(); + } + + /** + * Get WAF standalone mode status + * + * @return bool|array True if WAF standalone mode is enabled, false otherwise. + */ + public static function get_standalone_mode_status() { + return defined( 'JETPACK_WAF_RUN' ) && JETPACK_WAF_RUN === 'preload'; + } + + /** + * Get WAF File Path + * + * @param string $file The file path starting in the WAF directory. + * @return string The full file path to the provided file in the WAF directory. + */ + public static function get_waf_file_path( $file ) { + Waf_Constants::define_waf_directory(); + + // Ensure the file path starts with a slash. + if ( '/' !== substr( $file, 0, 1 ) ) { + $file = "/$file"; + } + + return JETPACK_WAF_DIR . $file; + } + + /** + * Runs the WAF and potentially stops the request if a problem is found. + * + * @return void + */ + public static function run() { + // Make double-sure we are only running once. + if ( self::did_run() ) { + return; + } + + Waf_Constants::initialize_constants(); + + // if ABSPATH is defined, then WordPress has already been instantiated, + // and we're running as a plugin (meh). Otherwise, we're running via something + // like PHP's prepend_file setting (yay!). + define( 'JETPACK_WAF_RUN', defined( 'ABSPATH' ) ? 'plugin' : 'preload' ); + + // if the WAF is being run before a command line script, don't try to execute rules (there's no request). + if ( PHP_SAPI === 'cli' ) { + return; + } + + // if something terrible happens during the WAF running, we don't want to interfere with the rest of the site, + // so we intercept errors ONLY while the WAF is running, then we remove our handler after the WAF finishes. + $display_errors = ini_get( 'display_errors' ); + + ini_set( 'display_errors', 'Off' ); // phpcs:ignore WordPress.PHP.IniSet.display_errors_Disallowed -- We only customize error reporting while the WAF is running, and remove our handler afterwards. + + set_error_handler( array( self::class, 'errorHandler' ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler -- We only customize error reporting while the WAF is running, and remove our handler afterwards. + + try { + + // phpcs:ignore + $waf = new Waf_Runtime( new Waf_Transforms(), new Waf_Operators() ); + + // execute waf rules. + $rules_file_path = self::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ); + if ( file_exists( $rules_file_path ) ) { + // phpcs:ignore + include $rules_file_path; + } + } catch ( \Exception $err ) { // phpcs:ignore + // Intentionally doing nothing. + } + + // remove the custom error handler, so we don't interfere with the site. + restore_error_handler(); + + // Restore the original value. + ini_set( 'display_errors', $display_errors ); // phpcs:ignore WordPress.PHP.IniSet.display_errors_Disallowed -- We only customize error reporting while the WAF is running, and remove our handler afterwards. + } + + /** + * Error handler to be used while the WAF is being executed. + * + * @param int $code The error code. + * @param string $message The error message. + * @param string $file File with the error. + * @param string $line Line of the error. + * @return void + */ + public static function errorHandler( $code, $message, $file, $line ) { // phpcs:ignore + // Intentionally doing nothing for now. + } + + /** + * Initializes the WP filesystem and WAF directory structure. + * + * @throws File_System_Exception If filesystem is unavailable. + * + * @return void + */ + public static function initialize_filesystem() { + if ( ! function_exists( '\\WP_Filesystem' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + if ( ! \WP_Filesystem() ) { + throw new File_System_Exception( 'No filesystem available.' ); + } + + self::initialize_waf_directory(); + } + + /** + * Activates the WAF by generating the rules script and setting the version + * + * @throws Waf_Exception If the firewall mode is invalid. + * @throws Waf_Exception If the activation fails. + * + * @return void + */ + public static function activate() { + $version = get_option( Waf_Rules_Manager::VERSION_OPTION_NAME ); + if ( ! $version ) { + add_option( Waf_Rules_Manager::VERSION_OPTION_NAME, Waf_Rules_Manager::RULES_VERSION ); + } + + add_option( self::SHARE_DATA_OPTION_NAME, true ); + + self::initialize_filesystem(); + + Waf_Rules_Manager::generate_automatic_rules(); + Waf_Rules_Manager::generate_ip_rules(); + Waf_Rules_Manager::generate_rules(); + + self::create_blocklog_table(); + } + + /** + * Ensures that the waf directory is created. + * + * @throws File_System_Exception If filesystem is unavailable. + * @throws File_System_Exception If creating the directory fails. + * + * @return void + */ + public static function initialize_waf_directory() { + WP_Filesystem(); + Waf_Constants::define_waf_directory(); + + global $wp_filesystem; + if ( ! $wp_filesystem ) { + throw new File_System_Exception( 'Can not work without the file system being initialized.' ); + } + + if ( ! $wp_filesystem->is_dir( JETPACK_WAF_DIR ) ) { + if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) { + throw new File_System_Exception( 'Failed creating WAF file directory: ' . JETPACK_WAF_DIR ); + } + } + } + + /** + * Create the log table when plugin is activated. + * + * @return void + */ + public static function create_blocklog_table() { + global $wpdb; + + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; + + $sql = " + CREATE TABLE {$wpdb->prefix}jetpack_waf_blocklog ( + log_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + timestamp datetime NOT NULL, + rule_id BIGINT NOT NULL, + reason longtext NOT NULL, + PRIMARY KEY (log_id), + KEY timestamp (timestamp) + ) + "; + + dbDelta( $sql ); + } + + /** + * Deactivates the WAF by deleting the relevant options and emptying rules file. + * + * @throws File_System_Exception If file writing fails. + * + * @return void + */ + public static function deactivate() { + delete_option( self::MODE_OPTION_NAME ); + delete_option( Waf_Rules_Manager::VERSION_OPTION_NAME ); + + global $wp_filesystem; + self::initialize_filesystem(); + + // If the rules file doesn't exist, there's nothing else to do. + if ( ! $wp_filesystem->exists( self::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ) ) ) { + return; + } + + // Empty the rules entrypoint file. + if ( ! $wp_filesystem->put_contents( self::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ), "generate(); + } + + /** + * Check if an automatic rules file is available + * + * @return bool False if an automatic rules file is not available, true otherwise + */ + public static function automatic_rules_available() { + $automatic_rules_last_updated = get_option( Waf_Rules_Manager::AUTOMATIC_RULES_LAST_UPDATED_OPTION_NAME ); + + // If we do not have a automatic rules last updated timestamp cached, return false. + if ( ! $automatic_rules_last_updated ) { + return false; + } + + // Validate that the automatic rules file exists and is not empty. + global $wp_filesystem; + + try { + self::initialize_filesystem(); + } catch ( Waf_Exception $e ) { + return false; + } + + $automatic_rules_file_contents = $wp_filesystem->get_contents( self::get_waf_file_path( Waf_Rules_Manager::AUTOMATIC_RULES_FILE ) ); + + // If the automatic rules file was removed or is now empty, return false. + if ( ! $automatic_rules_file_contents || " +PHAN; + +/** + * Waf_Runtime class + */ +class Waf_Runtime { + /** + * If used, normalize_array_targets() will just return the number of matching values, instead of the values themselves. + */ + const NORMALIZE_ARRAY_COUNT = 1; + /** + * If used, normalize_array_targets() will apply "only" and "except" filters to the values of the source array, instead of the keys. + */ + const NORMALIZE_ARRAY_MATCH_VALUES = 2; + + /** + * Last rule. + * + * @var string + */ + public $last_rule = ''; + /** + * Matched vars. + * + * @var array + */ + public $matched_vars = array(); + /** + * Matched var. + * + * @var string + */ + public $matched_var = ''; + /** + * Matched var names. + * + * @var array + */ + public $matched_var_names = array(); + /** + * Matched var name. + * + * @var string + */ + public $matched_var_name = ''; + + /** + * State. + * + * @var array + */ + private $state = array(); + /** + * Metadata. + * + * @var array + */ + private $metadata = array(); + + /** + * Transforms. + * + * @var Waf_Transforms + */ + private $transforms; + /** + * Operators. + * + * @var Waf_Operators + */ + private $operators; + + /** + * The request + * + * @var Waf_Request + */ + private $request; + + /** + * Rules to remove. + * + * @var array[] + */ + private $rules_to_remove = array( + 'id' => array(), + 'tag' => array(), + ); + + /** + * Targets to remove. + * + * @var array[] + */ + private $targets_to_remove = array( + 'id' => array(), + 'tag' => array(), + ); + + /** + * Constructor method. + * + * @param Waf_Transforms $transforms Transforms. + * @param Waf_Operators $operators Operators. + * @param ?Waf_Request $request Information about the request. + */ + public function __construct( $transforms, $operators, $request = null ) { + $this->transforms = $transforms; + $this->operators = $operators; + $this->request = null === $request + ? new Waf_Request() + : $request; + } + + /** + * Rule removed method. + * + * @param string $id Ids. + * @param string[] $tags Tags. + */ + public function rule_removed( $id, $tags ) { + if ( isset( $this->rules_to_remove['id'][ $id ] ) ) { + return true; + } + foreach ( $tags as $tag ) { + if ( isset( $this->rules_to_remove['tag'][ $tag ] ) ) { + return true; + } + } + return false; + } + + /** + * Update Targets. + * + * @param array $targets Targets. + * @param string $rule_id Rule id. + * @param string[] $rule_tags Rule tags. + */ + public function update_targets( $targets, $rule_id, $rule_tags ) { + $updates = array(); + // look for target updates based on the rule's ID. + if ( isset( $this->targets_to_remove['id'][ $rule_id ] ) ) { + foreach ( $this->targets_to_remove['id'][ $rule_id ] as $name => $props ) { + $updates[] = array( $name, $props ); + } + } + // look for target updates based on the rule's tags. + foreach ( $rule_tags as $tag ) { + if ( isset( $this->targets_to_remove['tag'][ $tag ] ) ) { + foreach ( $this->targets_to_remove['tag'][ $tag ] as $name => $props ) { + $updates[] = array( $name, $props ); + } + } + } + // apply any found target updates. + + foreach ( $updates as list( $name, $props ) ) { + if ( isset( $targets[ $name ] ) ) { + // we only need to remove targets that exist. + if ( true === $props ) { + // if the entire target is being removed, remove it. + unset( $targets[ $name ] ); + } else { + // otherwise just mark single props to ignore. + $targets[ $name ]['except'] = array_merge( + isset( $targets[ $name ]['except'] ) ? $targets[ $name ]['except'] : array(), + $props + ); + } + } + } + return $targets; + } + + /** + * Return TRUE if at least one of the targets matches the rule. + * + * @param string[] $transforms One of the transform methods defined in the Jetpack Waf_Transforms class. + * @param TargetBag $targets Targets. + * @param string $match_operator Match operator. + * @param mixed $match_value Match value. + * @param bool $match_not Match not. + * @param bool $capture Capture. + * @return bool + */ + public function match_targets( $transforms, $targets, $match_operator, $match_value, $match_not, $capture = false ) { + $this->matched_vars = array(); + $this->matched_var_names = array(); + $this->matched_var = ''; + $this->matched_var_name = ''; + $match_found = false; + + // get values. + $values = $this->normalize_targets( $targets ); + + // apply transforms. + foreach ( $transforms as $t ) { + foreach ( $values as &$v ) { + $v['value'] = $this->transforms->$t( $v['value'] ); + } + } + unset( $v ); + // pass each target value to the operator to find any that match. + $matched = array(); + $captures = array(); + foreach ( $values as $v ) { + $match = $this->operators->{$match_operator}( $v['value'], $match_value ); + $did_match = false !== $match; + if ( $match_not !== $did_match ) { + // If either: + // - rule is negated ("not" flag set) and the target was not matched + // - rule not negated and the target was matched + // then this is considered a match. + $match_found = true; + $this->matched_var_names[] = $v['source']; + $this->matched_vars[] = $v['value']; + $this->matched_var_name = end( $this->matched_var_names ); + $this->matched_var = end( $this->matched_vars ); + $matched[] = array( $v, $match ); + // Set any captured matches into state if the rule has the "capture" flag. + if ( $capture ) { + $captures = is_array( $match ) ? $match : array( $match ); + foreach ( array_slice( $captures, 0, 10 ) as $i => $c ) { + $this->set_var( "tx.$i", $c ); + } + } + } + } + + return $match_found; + } + + /** + * Block. + * + * @param string $action Action. + * @param string $rule_id Rule id. + * @param string $reason Block reason. + * @param int $status_code Http status code. + */ + public function block( $action, $rule_id, $reason, $status_code = 403 ) { + if ( ! $reason ) { + $reason = "rule $rule_id"; + } else { + $reason = $this->sanitize_output( $reason ); + } + + $this->write_blocklog( $rule_id, $reason ); + error_log( "Jetpack WAF Blocked Request\t$action\t$rule_id\t$status_code\t$reason" ); + header( "X-JetpackWAF-Blocked: $status_code - rule $rule_id" ); + if ( defined( 'JETPACK_WAF_MODE' ) && 'normal' === JETPACK_WAF_MODE ) { + $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? wp_unslash( $_SERVER['SERVER_PROTOCOL'] ) : 'HTTP'; + header( $protocol . ' 403 Forbidden', true, $status_code ); + die( "rule $rule_id - reason $reason" ); + } + } + + /** + * Get the headers for logging purposes. + */ + public function get_request_headers() { + $all_headers = getallheaders(); + $exclude_headers = array( 'Authorization', 'Cookie', 'Proxy-Authorization', 'Set-Cookie' ); + + foreach ( $exclude_headers as $header ) { + unset( $all_headers[ $header ] ); + } + + return $all_headers; + } + + /** + * Write block logs. We won't write to the file if it exceeds 100 mb. + * + * @param string $rule_id Rule id. + * @param string $reason Block reason. + */ + public function write_blocklog( $rule_id, $reason ) { + $log_data = array(); + $log_data['rule_id'] = $rule_id; + $log_data['reason'] = $reason; + $log_data['timestamp'] = gmdate( 'Y-m-d H:i:s' ); + $log_data['request_uri'] = isset( $_SERVER['REQUEST_URI'] ) ? \stripslashes( $_SERVER['REQUEST_URI'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash + $log_data['user_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? \stripslashes( $_SERVER['HTTP_USER_AGENT'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash + $log_data['referer'] = isset( $_SERVER['HTTP_REFERER'] ) ? \stripslashes( $_SERVER['HTTP_REFERER'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash + $log_data['content_type'] = isset( $_SERVER['CONTENT_TYPE'] ) ? \stripslashes( $_SERVER['CONTENT_TYPE'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash + $log_data['get_params'] = json_encode( $_GET ); + + if ( defined( 'JETPACK_WAF_SHARE_DEBUG_DATA' ) && JETPACK_WAF_SHARE_DEBUG_DATA ) { + $log_data['post_params'] = json_encode( $_POST ); + $log_data['headers'] = $this->get_request_headers(); + } + + if ( defined( 'JETPACK_WAF_SHARE_DATA' ) && JETPACK_WAF_SHARE_DATA ) { + $file_path = JETPACK_WAF_DIR . '/waf-blocklog'; + $file_exists = file_exists( $file_path ); + + if ( ! $file_exists || filesize( $file_path ) < ( 100 * 1024 * 1024 ) ) { + $fp = fopen( $file_path, 'a+' ); + + if ( $fp ) { + try { + fwrite( $fp, json_encode( $log_data ) . "\n" ); + } finally { + fclose( $fp ); + } + } + } + } + + $this->write_blocklog_row( $log_data ); + } + + /** + * Write block logs to database. + * + * @param array $log_data Log data. + */ + private function write_blocklog_row( $log_data ) { + $conn = $this->connect_to_wordpress_db(); + + if ( ! $conn ) { + return; + } + + global $table_prefix; + + $statement = $conn->prepare( "INSERT INTO {$table_prefix}jetpack_waf_blocklog(reason,rule_id, timestamp) VALUES (?, ?, ?)" ); + if ( false !== $statement ) { + $statement->bind_param( 'sis', $log_data['reason'], $log_data['rule_id'], $log_data['timestamp'] ); + $statement->execute(); + + if ( $conn->insert_id > 100 ) { + $conn->query( "DELETE FROM {$table_prefix}jetpack_waf_blocklog ORDER BY log_id LIMIT 1" ); + } + } + } + + /** + * Connect to WordPress database. + */ + private function connect_to_wordpress_db() { + if ( ! file_exists( JETPACK_WAF_WPCONFIG ) ) { + return; + } + + require_once JETPACK_WAF_WPCONFIG; + $conn = new \mysqli( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME ); // phpcs:ignore WordPress.DB.RestrictedClasses.mysql__mysqli + + if ( $conn->connect_error ) { + error_log( 'Could not connect to the database:' . $conn->connect_error ); + return null; + } + + return $conn; + } + + /** + * Redirect. + * + * @param string $rule_id Rule id. + * @param string $url Url. + * @return never + */ + public function redirect( $rule_id, $url ) { + error_log( "Jetpack WAF Redirected Request.\tRule:$rule_id\t$url" ); + header( "Location: $url" ); + exit; + } + + /** + * Flag rule for removal. + * + * @param string $prop Prop. + * @param string $value Value. + */ + public function flag_rule_for_removal( $prop, $value ) { + if ( 'id' === $prop ) { + $this->rules_to_remove['id'][ $value ] = true; + } else { + $this->rules_to_remove['tag'][ $value ] = true; + } + } + + /** + * Flag target for removal. + * + * @param string $id_or_tag Id or tag. + * @param string $id_or_tag_value Id or tag value. + * @param string $name Name. + * @param string $prop Prop. + */ + public function flag_target_for_removal( $id_or_tag, $id_or_tag_value, $name, $prop = null ) { + if ( null === $prop ) { + $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] = true; + } elseif ( + ! isset( $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] ) + // if the entire target is already being removed then it would be redundant to remove a single property. + || true !== $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] + ) { + $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ][] = $prop; + } + } + + /** + * Get variable value. + * + * @param string $key Key. + */ + public function get_var( $key ) { + return isset( $this->state[ $key ] ) + ? $this->state[ $key ] + : ''; + } + + /** + * Set variable value. + * + * @param string $key Key. + * @param string $value Value. + */ + public function set_var( $key, $value ) { + $this->state[ $key ] = $value; + } + + /** + * Increment variable. + * + * @param string $key Key. + * @param mixed $value Value. + */ + public function inc_var( $key, $value ) { + if ( ! isset( $this->state[ $key ] ) ) { + $this->state[ $key ] = 0; + } + $this->state[ $key ] += floatval( $value ); + } + + /** + * Decrement variable. + * + * @param string $key Key. + * @param mixed $value Value. + */ + public function dec_var( $key, $value ) { + if ( ! isset( $this->state[ $key ] ) ) { + $this->state[ $key ] = 0; + } + $this->state[ $key ] -= floatval( $value ); + } + + /** + * Unset variable. + * + * @param string $key Key. + */ + public function unset_var( $key ) { + unset( $this->state[ $key ] ); + } + + /** + * A cache of metadata about the incoming request. + * + * @param string $key The type of metadata to request ('headers', 'request_method', etc.). + */ + public function meta( $key ) { + if ( ! isset( $this->metadata[ $key ] ) ) { + $value = null; + switch ( $key ) { + case 'headers': + $value = $this->request->get_headers(); + break; + case 'headers_names': + $value = $this->args_names( $this->meta( 'headers' ) ); + break; + case 'request_method': + $value = $this->request->get_method(); + break; + case 'request_protocol': + $value = $this->request->get_protocol(); + break; + case 'request_uri': + $value = $this->request->get_uri( false ); + break; + case 'request_uri_raw': + $value = $this->request->get_uri( true ); + break; + case 'request_filename': + $value = $this->request->get_filename(); + break; + case 'request_line': + $value = sprintf( + '%s %s %s', + $this->request->get_method(), + $this->request->get_uri( false ), + $this->request->get_protocol() + ); + break; + case 'request_basename': + $value = $this->request->get_basename(); + break; + case 'request_body': + $value = $this->request->get_body(); + break; + case 'query_string': + $value = $this->request->get_query_string(); + break; + case 'args_get': + $value = $this->request->get_get_vars(); + break; + case 'args_get_names': + $value = $this->args_names( $this->meta( 'args_get' ) ); + break; + case 'args_post': + $value = $this->request->get_post_vars(); + break; + case 'args_post_names': + $value = $this->args_names( $this->meta( 'args_post' ) ); + break; + case 'args': + $value = array_merge( $this->meta( 'args_get' ), $this->meta( 'args_post' ) ); + break; + case 'args_names': + $value = $this->args_names( $this->meta( 'args' ) ); + break; + case 'request_cookies': + $value = $this->request->get_cookies(); + break; + case 'request_cookies_names': + $value = $this->args_names( $this->meta( 'request_cookies' ) ); + break; + case 'files': + $value = array(); + foreach ( $this->request->get_files() as $f ) { + $value[] = array( $f['name'], $f['filename'] ); + } + break; + case 'files_names': + $value = $this->args_names( $this->meta( 'files' ) ); + break; + } + $this->metadata[ $key ] = $value; + } + + return $this->metadata[ $key ]; + } + + /** + * State values. + * + * @param string $prefix Prefix. + */ + private function state_values( $prefix ) { + $output = array(); + $len = strlen( $prefix ); + foreach ( $this->state as $k => $v ) { + if ( 0 === stripos( $k, $prefix ) ) { + $output[ substr( $k, $len ) ] = $v; + } + } + + return $output; + } + + /** + * Change a string to all lowercase and replace spaces and underscores with dashes. + * + * @param string $name Name. + * @return string + */ + public function normalize_header_name( $name ) { + return str_replace( array( ' ', '_' ), '-', strtolower( $name ) ); + } + + /** + * Get match-able values from a collection of targets. + * + * This function expects an associative array of target items, and returns an array of possible values from those targets that can be used to match against. + * The key is the lowercase target name (i.e. `args`, `request_headers`, etc) - see https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#Variables + * The value is an associative array of options that define how to narrow down the returned values for that target if it's an array (ARGS, for example). The possible options are: + * count: If `true`, then the returned value will a count of how many matched targets were found, rather then the actual values of those targets. + * For example, &ARGS_GET will return the number of keys the query string. + * only: If specified, then only values in that target that match the given key will be returned. + * For example, ARGS_GET:id|ARGS_GET:/^name/ will only return the values for `$_GET['id']` and any key in `$_GET` that starts with `name` + * except: If specified, then values in that target will be left out from the returned values (even if they were included in an `only` option) + * For example, ARGS_GET|!ARGS_GET:z will return every value from `$_GET` except for `$_GET['z']`. + * + * This function will return an array of associative arrays. Each with: + * name: The target name that this value came from (i.e. the key in the input `$targets` argument ) + * source: For targets that are associative arrays (like ARGS), this will be the target name AND the key in that target (i.e. "args:z" for ARGS:z) + * value: The value that was found in the associated target. + * + * @param TargetBag $targets An assoc. array with keys that are target name(s) and values are options for how to process that target (include/exclude rules, whether to return values or counts). + * @return array{name: string, source: string, value: mixed}[] + */ + public function normalize_targets( $targets ) { + $return = array(); + foreach ( $targets as $k => $v ) { + $count_only = isset( $v['count'] ) ? self::NORMALIZE_ARRAY_COUNT : 0; + $only = isset( $v['only'] ) ? $v['only'] : array(); + $except = isset( $v['except'] ) ? $v['except'] : array(); + $_k = strtolower( $k ); + switch ( $_k ) { + case 'request_headers': + $this->normalize_array_target( + // get the headers that came in with this request + $this->meta( 'headers' ), + // ensure only and exclude filters are normalized + array_map( array( $this->request, 'normalize_header_name' ), $only ), + array_map( array( $this->request, 'normalize_header_name' ), $except ), + $k, + $return, + // flags + $count_only + ); + continue 2; + case 'request_headers_names': + $this->normalize_array_target( $this->meta( 'headers_names' ), $only, $except, $k, $return, $count_only | self::NORMALIZE_ARRAY_MATCH_VALUES ); + continue 2; + case 'request_method': + case 'request_protocol': + case 'request_uri': + case 'request_uri_raw': + case 'request_filename': + case 'request_basename': + case 'request_body': + case 'query_string': + case 'request_line': + $v = $this->meta( $_k ); + break; + case 'tx': + case 'ip': + $this->normalize_array_target( $this->state_values( "$k." ), $only, $except, $k, $return, $count_only ); + continue 2; + case 'request_cookies': + case 'args': + case 'args_get': + case 'args_post': + case 'files': + $this->normalize_array_target( $this->meta( $_k ), $only, $except, $k, $return, $count_only ); + continue 2; + case 'request_cookies_names': + case 'args_names': + case 'args_get_names': + case 'args_post_names': + case 'files_names': + // get the "full" data (for 'args_names' get data for 'args') and stripe it down to just the key names + $data = array_map( + function ( $item ) { + return $item[0]; }, + $this->meta( substr( $_k, 0, -6 ) ) + ); + $this->normalize_array_target( $data, $only, $except, $k, $return, $count_only | self::NORMALIZE_ARRAY_MATCH_VALUES ); + continue 2; + default: + var_dump( 'Unknown target', $k, $v ); + exit; + } + $return[] = array( + 'name' => $k, + 'value' => $v, + 'source' => $k, + ); + } + + return $return; + } + + /** + * Verifies if the IP from the current request is in an array. + * + * @param array $array Array of IP addresses to verify the request IP against. + * @return bool + */ + public function is_ip_in_array( $array ) { + $real_ip = $this->request->get_real_user_ip_address(); + $array_length = count( $array ); + + for ( $i = 0; $i < $array_length; $i++ ) { + // Check if the IP matches a provided range. + $range = explode( '-', $array[ $i ] ); + if ( count( $range ) === 2 ) { + if ( IP_Utils::ip_address_is_in_range( $real_ip, $range[0], $range[1] ) ) { + return true; + } + continue; + } + + // Check if the IP is an exact match. + if ( $real_ip === $array[ $i ] ) { + return true; + } + } + + return false; + } + + /** + * Extract values from an associative array, potentially applying filters and/or counting results. + * + * @param array{0: string, 1: scalar}|scalar[] $source The source assoc. array of values (i.e. $_GET, $_SERVER, etc.). + * @param string[] $only Only include the values for these keys in the output. + * @param string[] $excl Never include the values for these keys in the output. + * @param string $name The name of this target (see https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#Variables). + * @param array $results Array to add output values to, will be modified by this method. + * @param int $flags Any of the NORMALIZE_ARRAY_* constants defined at the top of the class. + */ + private function normalize_array_target( $source, $only, $excl, $name, &$results, $flags = 0 ) { + $output = array(); + $has_only = isset( $only[0] ); + $has_excl = isset( $excl[0] ); + + foreach ( $source as $source_key => $source_val ) { + if ( is_array( $source_val ) ) { + // if $source_val looks like a tuple from flatten_array(), then use the tuple as the key and value + $source_key = $source_val[0]; + $source_val = $source_val[1]; + } + $filter_match = ( $flags & self::NORMALIZE_ARRAY_MATCH_VALUES ) > 0 ? $source_val : $source_key; + // if this key is on the "exclude" list, skip it + if ( $has_excl && $this->key_matches( $filter_match, $excl ) ) { + continue; + } + // if this key isn't in our "only" list, then skip it + if ( $has_only && ! $this->key_matches( $filter_match, $only ) ) { + continue; + } + // otherwise add this key/value to our output + $output[] = array( $source_key, $source_val ); + } + + if ( ( $flags & self::NORMALIZE_ARRAY_COUNT ) > 0 ) { + // If we've been told to just count the values, then just count them. + $results[] = array( + 'name' => (string) $name, + 'value' => count( $output ), + 'source' => '&' . $name, + ); + } else { + foreach ( $output as list( $item_name, $item_value ) ) { + $results[] = array( + 'name' => (string) $item_name, + 'value' => $item_value, + 'source' => "$name:$item_name", + ); + } + } + + return $results; + } + + /** + * Given an array of tuples - probably from flatten_array() - return a new array + * consisting of only the first value (the key name) from each tuple. + * + * @param array{0:string, 1:scalar}[] $flat_array An array of tuples. + * @return string[] + */ + private function args_names( $flat_array ) { + $names = array_map( + function ( $tuple ) { + return $tuple[0]; + }, + $flat_array + ); + return array_unique( $names ); + } + + /** + * Return whether or not a given $input key matches one of the given $patterns. + * + * @param string $input Key name to test against patterns. + * @param string[] $patterns Patterns to test key name with. + * @return bool + */ + private function key_matches( $input, $patterns ) { + foreach ( $patterns as $p ) { + if ( '/' === $p[0] ) { + if ( 1 === preg_match( $p, $input ) ) { + return true; + } + } elseif ( 0 === strcasecmp( $p, $input ) ) { + return true; + } + } + + return false; + } + + /** + * Sanitize output generated from the request that was blocked. + * + * @param string $output Output to sanitize. + */ + public function sanitize_output( $output ) { + $url_decoded_output = rawurldecode( $output ); + $html_entities_output = htmlentities( $url_decoded_output, ENT_QUOTES, 'UTF-8' ); + // @phpcs:disable Squiz.Strings.DoubleQuoteUsage.NotRequired + $escapers = array( "\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c" ); + $replacements = array( "\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b" ); + // @phpcs:enable Squiz.Strings.DoubleQuoteUsage.NotRequired + + return( str_replace( $escapers, $replacements, $html_entities_output ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php new file mode 100644 index 00000000..355ac508 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php @@ -0,0 +1,173 @@ +guard_against_missing_abspath(); + $this->initialize_constants(); + } + + /** + * Ensures that this class is not used unless we are in the right context. + * + * @throws Waf_Exception If we are outside of WordPress. + * + * @return void + */ + private function guard_against_missing_abspath() { + + if ( ! defined( 'ABSPATH' ) ) { + throw new Waf_Exception( 'Cannot generate the WAF bootstrap if we are not running in WordPress context.' ); + } + } + + /** + * Initializes the constants required for generating the bootstrap, if they have not been initialized yet. + * + * @return void + */ + private function initialize_constants() { + Waf_Constants::initialize_constants(); + } + + /** + * Initialized the WP filesystem and serves as a mocking hook for tests. + * + * Should only be implemented after the wp_loaded action hook: + * + * @link https://developer.wordpress.org/reference/functions/wp_filesystem/#more-information + * + * @return void + */ + protected function initialize_filesystem() { + if ( ! function_exists( '\\WP_Filesystem' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + WP_Filesystem(); + } + + /** + * Finds the path to the autoloader, which can then be used to require the autoloader in the generated boostrap file. + * + * @throws Waf_Exception In case the autoloader file can not be found. + * + * @return string|null + */ + private function locate_autoloader_file() { + global $jetpack_autoloader_loader; + + $autoload_file = null; + + // Try the Jetpack autoloader. + if ( isset( $jetpack_autoloader_loader ) ) { + $class_file = $jetpack_autoloader_loader->find_class_file( Waf_Runner::class ); + if ( $class_file ) { + $autoload_file = dirname( $class_file, 5 ) . '/vendor/autoload.php'; + } + } + + // Try Composer's autoloader. + if ( null === $autoload_file + && is_callable( array( InstalledVersions::class, 'getInstallPath' ) ) + && InstalledVersions::isInstalled( 'automattic/jetpack-waf' ) + ) { + $package_file = InstalledVersions::getInstallPath( 'automattic/jetpack-waf' ); + if ( substr( $package_file, -23 ) === '/automattic/jetpack-waf' ) { + $autoload_file = dirname( $package_file, 3 ) . '/vendor/autoload.php'; + } + } + + // Guess. First look for being in a `vendor/automattic/jetpack-waf/src/', then see if we're standalone with our own vendor dir. + if ( null === $autoload_file ) { + $autoload_file = dirname( __DIR__, 4 ) . '/vendor/autoload.php'; + if ( ! file_exists( $autoload_file ) ) { + $autoload_file = dirname( __DIR__ ) . '/vendor/autoload.php'; + } + } + + // Check that the determined file actually exists. + if ( ! file_exists( $autoload_file ) ) { + throw new Waf_Exception( 'Can not find autoloader, and the WAF standalone boostrap will not work without it.' ); + } + + return $autoload_file; + } + + /** + * Gets the path to the bootstrap.php file. + * + * @return string The bootstrap.php file path. + */ + public function get_bootstrap_file_path() { + return trailingslashit( JETPACK_WAF_DIR ) . 'bootstrap.php'; + } + + /** + * Generates the bootstrap file. + * + * @throws File_System_Exception If the filesystem is not available. + * @throws File_System_Exception If the WAF directory can not be created. + * @throws File_System_Exception If the bootstrap file can not be created. + * + * @return string Absolute path to the bootstrap file. + */ + public function generate() { + + $this->initialize_filesystem(); + + global $wp_filesystem; + if ( ! $wp_filesystem ) { + throw new File_System_Exception( 'Can not work without the file system being initialized.' ); + } + + $autoloader_file = $this->locate_autoloader_file(); + + $bootstrap_file = $this->get_bootstrap_file_path(); + $mode_option = get_option( Waf_Runner::MODE_OPTION_NAME, false ); + $share_data_option = get_option( Waf_Runner::SHARE_DATA_OPTION_NAME, false ); + $share_debug_data_option = get_option( Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME, false ); + + // phpcs:disable WordPress.PHP.DevelopmentFunctions + $code = "is_dir( JETPACK_WAF_DIR ) ) { + if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) { + throw new File_System_Exception( 'Failed creating WAF standalone bootstrap file directory: ' . JETPACK_WAF_DIR ); + } + } + + if ( ! $wp_filesystem->put_contents( $bootstrap_file, $code ) ) { + throw new File_System_Exception( 'Failed writing WAF standalone bootstrap file to: ' . $bootstrap_file ); + } + + return $bootstrap_file; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php new file mode 100644 index 00000000..f3b4122a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php @@ -0,0 +1,160 @@ + (int) $option_timestamp; + } + + /** + * Checks if we should consider the stored cache or bypass it + * + * @return boolean + */ + public static function should_use_global_stats_cache() { + return ! ( defined( 'JETPACK_PROTECT_DEV__BYPASS_CACHE' ) && JETPACK_PROTECT_DEV__BYPASS_CACHE ); + } + + /** + * Get the global stats from the API endpoint + */ + public static function fetch_global_stats_from_api() { + $url = esc_url_raw( 'https://public-api.wordpress.com/wpcom/v2/jetpack-protect-global-stats' ); + $response = wp_remote_get( $url ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code || empty( $response['body'] ) ) { + return new \WP_Error( 'failed_fetching_global_stats', 'Failed to fetch global stats data from the server', array( 'status' => $response_code ) ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + update_option( 'jetpack_protect_global_stats', maybe_serialize( $body ) ); + update_option( 'jetpack_protect_global_stats_timestamp', time() + 86400 ); // Caches expires after 24 hours. + + return $body; + } + + /** + * Gets the current cached global stats + * + * @return bool|array False if value is not found. Array with values if cache is found. + */ + public static function get_global_stats_from_options() { + return maybe_unserialize( get_option( 'jetpack_protect_global_stats' ) ); + } + + /** + * Get the global stats + * If the cache is expired, it will fetch the data from the API + * If the cache is not expired, it will return the cached data + * + * @param bool $refresh_from_wpcom Whether to refresh the data from the API. + * @return array|\WP_Error + */ + public static function get_global_stats( $refresh_from_wpcom = false ) { + if ( self::$global_stats !== null ) { + return self::$global_stats; + } + + if ( $refresh_from_wpcom || ! self::should_use_global_stats_cache() || self::is_global_stats_cache_expired() ) { + $global_stats = self::fetch_global_stats_from_api(); + } else { + $global_stats = self::get_global_stats_from_options(); + } + + // Ensure that $global_stats is of the correct type + if ( ( ! is_object( $global_stats ) && ! ( $global_stats instanceof \WP_Error ) ) ) { + return new \WP_Error( 'unexpected_type', 'Unexpected type or null returned for global stats' ); + } + + return $global_stats; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php new file mode 100644 index 00000000..e2160997 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php @@ -0,0 +1,403 @@ +normalize_path( str_replace( '\\', '/', $value ) ); + } + + /** + * Removes all NUL bytes from input. + * + * @param string $value value to be filtered. + * @return string + */ + public function remove_nulls( $value ) { + return str_replace( "\x0", '', $value ); + } + + /** + * Remove all whitespace characters from input. + * + * @param string $value value to be filtered. + * @return string + */ + public function remove_whitespace( $value ) { + return preg_replace( '/\s/', '', $value ); + } + + /** + * Replaces each occurrence of a C-style comment (/ * ... * /) with a single space. + * Unterminated comments will also be replaced with a space. However, a standalone termination of a comment (* /) will not be acted upon. + * + * @param string $value value to be filtered. + * @return string + */ + public function replace_comments( $value ) { + $value = preg_replace( '~/\*.*?\*/|/\*.*?$~Ds', ' ', $value ); + return explode( '/*', $value, 2 )[0]; + } + + /** + * Removes common comments chars (/ *, * /, --, #). + * + * @param string $value value to be filtered. + * @return string + */ + public function remove_comments_char( $value ) { + return preg_replace( '~/*|*/|--|#|//~', '', $value ); + } + + /** + * Replaces each NUL byte in input with a space. + * + * @param string $value value to be filtered. + * @return string + */ + public function replace_nulls( $value ) { + return str_replace( "\x0", ' ', $value ); + } + + /** + * Decode a URL-encoded input string. + * + * @param string $value value to be decoded. + * @return string + */ + public function url_decode( $value ) { + return urldecode( $value ); + } + + /** + * Decode a URL-encoded input string. + * + * @param string $value value to be decoded. + * @return string + */ + public function url_decode_uni( $value ) { + error_log( 'JETPACKWAF TRANSFORM NOT IMPLEMENTED: urlDecodeUni' ); + return $value; + } + + /** + * Decode a json encoded input string. + * + * @param string $value value to be decoded. + * @return string + */ + public function js_decode( $value ) { + error_log( 'JETPACKWAF TRANSFORM NOT IMPLEMENTED: jsDecode' ); + return $value; + } + + /** + * Convert all characters to uppercase. + * + * @param string $value value to be encoded. + * @return string + */ + public function uppercase( $value ) { + return strtoupper( $value ); + } + + /** + * Calculate a SHA1 hash from the input string. + * + * @param mixed $value value to be hashed. + * @return string + */ + public function sha1( $value ) { + return sha1( $value, true ); + } + + /** + * Remove whitespace from the left side of the input string. + * + * @param string $value value to be trimmed. + * @return string + */ + public function trim_left( $value ) { + return ltrim( $value, self::TRIM_CHARS ); + } + + /** + * Remove whitespace from the right side of the input string. + * + * @param string $value value to be trimmed. + * @return string + */ + public function trim_right( $value ) { + return rtrim( $value, self::TRIM_CHARS ); + } + + /** + * Remove whitespace from both sides of the input string. + * + * @param string $value value to be trimmed. + * @return string + */ + public function trim( $value ) { + return trim( $value, self::TRIM_CHARS ); + } + + /** + * Convert UTF-8 characters to Unicode characters. + * + * This function iterates through each character of the input string, checks the ASCII value, + * and converts it to its corresponding Unicode representation. It handles characters that are + * represented with 1 to 4 bytes in UTF-8. + * + * @param string $str The string value to be encoded from UTF-8 to Unicode. + * @return string The converted string with Unicode representation. + */ + public function utf8_to_unicode( $str ) { + $unicodeStr = ''; + $strLen = strlen( $str ); + $i = 0; + + // Iterate through each character of the input string. + while ( $i < $strLen ) { + // Get the ASCII value of the current character. + $value = ord( $str[ $i ] ); + + if ( $value < 128 ) { + // If the character is in the ASCII range (0-127), directly add it to the Unicode string. + $unicodeStr .= chr( $value ); + ++$i; + } else { + // For characters outside the ASCII range, determine the number of bytes in the UTF-8 representation. + $unicodeValue = ''; + if ( $value >= 192 && $value <= 223 ) { + // For characters represented with 2 bytes in UTF-8. + $unicodeValue = ( ord( $str[ $i ] ) & 0x1F ) << 6 | ( ord( $str[ $i + 1 ] ) & 0x3F ); + $i += 2; + } elseif ( $value >= 224 && $value <= 239 ) { + // For characters represented with 3 bytes in UTF-8. + $unicodeValue = ( ord( $str[ $i ] ) & 0x0F ) << 12 | ( ord( $str[ $i + 1 ] ) & 0x3F ) << 6 | ( ord( $str[ $i + 2 ] ) & 0x3F ); + $i += 3; + } elseif ( $value >= 240 && $value <= 247 ) { + // For characters represented with 4 bytes in UTF-8. + $unicodeValue = ( ord( $str[ $i ] ) & 0x07 ) << 18 | ( ord( $str[ $i + 1 ] ) & 0x3F ) << 12 | ( ord( $str[ $i + 2 ] ) & 0x3F ) << 6 | ( ord( $str[ $i + 3 ] ) & 0x3F ); + $i += 4; + } else { + // If the sequence does not match any known UTF-8 pattern, skip to the next character. + ++$i; + continue; + } + // Convert the Unicode value to a formatted string and append it to the Unicode string. + $unicodeStr .= sprintf( '%%u%04X', $unicodeValue ); + } + } + + return strtolower( $unicodeStr ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php new file mode 100644 index 00000000..59631e8c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php @@ -0,0 +1,23 @@ +getMessage() ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/functions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/functions.php new file mode 100644 index 00000000..7d60cd28 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/functions.php @@ -0,0 +1,72 @@ + [ "x" => [ "y" => "..." ] ] ] + * However, modsecurity (and thus our WAF rules) expect the original (non-nested) names. + * + * Therefore, this method takes an array of any depth and returns a single-depth array with nested + * keys translated back to a single string with brackets. + * + * Because there might be multiple items with the same name, this function will return an array of tuples, + * with the first item in the tuple the re-created original field name, and the second item the value. + * + * @example + * flatten_array( [ "field1" => "abc", "field2" => [ "d", "e", "f" ] ] ) + * => [ + * [ "field1", "abc" ], + * [ "field2[0]", "d" ], + * [ "field2[1]", "e" ], + * [ "field2[2]", "f" ], + * ] + * + * @param array $array An array that resembles one of the PHP superglobals like $_GET or $_POST. + * @param string $key_prefix String that should be prepended to the keys output by this function. + * Usually only used internally as part of recursion when flattening a nested array. + * @param bool|null $dot_notation Whether to use dot notation instead of bracket notation. + * + * @return array{0: string, 1: scalar}[] $key_prefix An array of key/value tuples, one for each distinct value in the input array. + */ +function flatten_array( $array, $key_prefix = '', $dot_notation = null ) { + $return = array(); + foreach ( $array as $source_key => $source_value ) { + $key = $source_key; + if ( ! empty( $key_prefix ) ) { + $key = $dot_notation ? "$key_prefix.$source_key" : $key_prefix . "[$source_key]"; + } + + if ( ! is_array( $source_value ) ) { + $return[] = array( $key, $source_value ); + } else { + $return = array_merge( $return, flatten_array( $source_value, $key, $dot_notation ) ); + } + } + return $return; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/i18n-map.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/i18n-map.php new file mode 100644 index 00000000..e4af8a34 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/i18n-map.php @@ -0,0 +1,80 @@ + 'jetpack-protect', + 'type' => 'plugins', + 'packages' => array( + 'jetpack-admin-ui' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-admin-ui', + 'ver' => '0.4.5', + ), + 'jetpack-assets' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-assets', + 'ver' => '2.3.7', + ), + 'jetpack-boost-core' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-boost-core', + 'ver' => '0.2.11', + ), + 'jetpack-boost-speed-score' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-boost-speed-score', + 'ver' => '0.3.12', + ), + 'jetpack-config' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-config', + 'ver' => '2.0.4', + ), + 'jetpack-connection' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-connection', + 'ver' => '4.0.1', + ), + 'jetpack-explat' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-explat', + 'ver' => '0.1.7', + ), + 'jetpack-ip' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-ip', + 'ver' => '0.2.3', + ), + 'jetpack-jitm' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-jitm', + 'ver' => '3.1.21', + ), + 'jetpack-licensing' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-licensing', + 'ver' => '2.0.9', + ), + 'jetpack-my-jetpack' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-my-jetpack', + 'ver' => '4.35.3', + ), + 'jetpack-password-checker' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-password-checker', + 'ver' => '0.3.2', + ), + 'jetpack-plugins-installer' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-plugins-installer', + 'ver' => '0.4.3', + ), + 'jetpack-protect-models' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-protect-models', + 'ver' => '0.2.1', + ), + 'jetpack-protect-status' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-protect-status', + 'ver' => '0.1.5', + ), + 'jetpack-sync' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-sync', + 'ver' => '3.10.0', + ), + 'jetpack-transport-helper' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-transport-helper', + 'ver' => '0.2.4', + ), + 'jetpack-waf' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-waf', + 'ver' => '0.18.5', + ), + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt new file mode 100644 index 00000000..f4fe58ab --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt @@ -0,0 +1,184 @@ +=== Jetpack Protect === +Contributors: automattic, retrofox, leogermani, renatoagds, bjorsch, ebinnion, fgiannar, zinigor, miguelxavierpenha, dsmart, jeherve, manzoorwanijk, njweller, oskosk, samiff, siddarthan, wpkaren, arsihasi, kraftbj, kev, sermitr, kangzj, pabline, dkmyta +Tags: jetpack, protect, security, malware, scan +Requires at least: 6.5 +Requires PHP: 7.0 +Tested up to: 6.6 +Stable tag: 3.0.2 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +Free daily malware scanning and WordPress site security. Jetpack Protect leverages the extensive database of WPScan, an Automattic brand, that has over 25,000 registered malware and vulnerabilities. No configuration required! + +== Description == + +== TOTAL SITE SECURITY FROM WORDPRESS EXPERTS == + +Jetpack Protect is a free and essential WordPress security plugin that scans your site and warns you about vulnerabilities, keeping your site one step ahead of security threats. It’s easy to use; setup requires just a few clicks! + +By upgrading Protect, you also unlock malware scanning with one-click fixes for most issues and instant notifications when threats are detected. Our automated Web Application Firewall (WAF) also protects your site from bad actors around the clock. + +Jetpack Protect is created by WordPress experts; our parent company Automattic is behind Jetpack, WordPress.com, WooCommerce, WPScan, and much more. There is no better company to understand the security needs of WordPress sites. + +== WHAT DOES JETPACK PROTECT (FREE) CHECK FOR? == + +Jetpack Protect scans your site on a daily basis and warns you about: +- The version of WordPress installed, and any associated vulnerabilities +- What plugins are installed, and any related vulnerabilities +- What themes are installed, and any associated vulnerabilities + += What are vulnerabilities? Why do I need to scan my site regularly? = +Site vulnerabilities are flaws in a website's code that weaken the site's overall security. These can be introduced to a site in various ways, in most cases unintentionally. + +Some of the ways vulnerabilities can be introduced to a site are: +- Poorly written site code +- Plugin and theme bugs +- WordPress version bugs +- System misconfigurations + +If a bad actor detects a vulnerability on your site, they can exploit it to access sensitive information, update your site, and more to damage your business or brand. + +That’s why it’s essential to use a reputable and reliable vulnerability & malware site scanner like Jetpack Protect to safeguard your site. + += Can I use Jetpack Scan to fix a site that is already infected? = + +Jetpack Protect (Scan) detects and prevents attacks, but is not designed to fully clean up sites infected before it was active. If your site has malware, take immediate action to clean it up and remove the malicious code. + +To clean up your site, we suggest using a malware removal tool, or if possible restore from a backup taken before the infection. We recommend using Jetpack VaultPress Backup in conjunction with Jetpack Scan to secure your website. + +[Learn more about cleaning your site](https://jetpack.com/support/scan/how-to-clean-your-hacked-wordpress-site/) + +== BRUTE FORCE ATTACK PROTECTION == + +Jetpack Protect blocks unwanted login attempts from malicious botnets and distributed attacks. + += Is my site under attack? = +Brute force attacks are the most common form of hacking — and hackers don’t discriminate. As the most commonly used Content Management System on the web, WordPress sites make an attractive target for hackers looking to exploit code vulnerabilities unique to WordPress. + +Using large networks of computers known as botnets, hackers can try to gain access to your site by using thousands of different combinations of usernames and passwords until they find the right one. + +Recently, attackers have found a way to “amplify” these attacks against the WordPress XML-RPC file – making it easier for attackers to try and break into your site. + +WordPress brute force attacks can: +- Slow down your site (or cause it to stop responding) because of repeated server requests. +- Allow unauthorized access to your site for hackers to modify your code or insert spammy links. +- Put your site content and data at risk. + +That’s where Jetpack Protect comes in. Our state-of-the-art security tools automatically block these attacks, protecting your WordPress site from unauthorized access. + +On average, Jetpack blocks 5,193 WordPress brute force attacks over a site’s lifetime. It allows you to protect yourself against both traditional brute force attacks and distributed brute force attacks that use many servers against your site. + +== UPGRADE PROTECT TO REMOVE MALWARE IN ONE CLICK AND BE PROTECTED BY OUR WAF == +By upgrading Protect, you unlock total site security from WordPress experts: +- Automated daily malware scanning in addition to vulnerability checks +- One-click fixes for most issues +- Web Application Firewall (WAF) with automatic rule updates +- Instant email notifications when threats are detected +- Priority support from WordPress experts + += What is malware? Why do I need to protect against it? = +Malware is malicious code or software that has been created by bad actors to disrupt, damage, or gain access to your site. There are many ways that malware can get onto your WordPress site. The most common method is through attackers using vulnerable plugins or themes to install malware. + +Similar to the vulnerabilities listed above, bad actors can use malware to capture sensitive information, damage your site, and harm your business or brand. + +Jetpack Protect instantly notifies you of any threats detected, with one-click fixes for most issues. + += What is a Web Application Firewall (WAF)? = +A web application firewall blocks traffic and malicious requests to your site from known bad actors. + +As threats are detected, new rules are added to Jetpack Protect’s firewall, which provides around-the-clock protection for your WordPress site. + +== OVER 53,500 REGISTERED VULNERABILITIES IN OUR DATABASE == + +WordPress security is something that evolves over time. Jetpack Protect leverages the extensive database of WPScan, an Automattic brand. All vulnerabilities are entered into our database by dedicated WordPress security professionals and updated constantly as new information becomes available. + +== JETPACK PROTECT IS EASY TO SETUP AND USE == + +There’s nothing to configure – the setup process is as easy as: +1. Install and activate the plugin +2. Set up it with one click. + +After you activate the plugin, Jetpack Protect will run daily automatic malware scans on your WordPress site and update you on vulnerabilities associated with your installed plugins, themes, and WordPress core. + +== WITH 💚 BY JETPACK == + +This is just the start! + +We are working hard to bring more features and improvements to Jetpack Protect. Let us know your thoughts and ideas! + +== FURTHER READING == + +- [Jetpack: Security, performance, and growth tools made for WordPress sites by the WordPress experts.](https://jetpack.com/) +- You can follow the [Jetpack Twitter](https://twitter.com/jetpack?lang=en) account to catch up on our latest WordPress security recommendations and updates. +- [WordPress Security: How to Protect Your Site From Hackers](https://jetpack.com/blog/category/security/page/3/) +- [Should You Use Jetpack for WordPress Security?](https://jetpack.com/blog/should-you-use-jetpack-for-wordpress-security/) +- [Jetpack Acquires WordPress Vulnerability Database WPScan](https://jetpack.com/blog/jetpack-acquires-wordpress-vulnerability-database-wpscan/#more-139339) + +== FAQ == + += How does Jetpack Protect help your WordPress Site security? = + +Protect is a free WordPress security and malware scanner plugin that scans your site and lets you know possible malware and security threats on your installed plugins, themes, and core files. + +The free plan scans your site for WordPress version, plugin, and theme vulnerabilities from our extensive vulnerability database (53,500) that is powered by WPScan. + +By upgrading Protect, you gain access to WordPress malware scanning with one-click fixes, instant threat notifications, and our Web application Firewall (WAF) that protects your site around the clock. + += Does this plugin require the Jetpack plugin to work? = + +Jetpack Protect does not require the Jetpack plugin to run and secure your site. + += What are the differences between Jetpack Protect, Jetpack Scan, and WPScan plugins? = + +Jetpack Protect is a new WordPress security plugin from Jetpack containing our security features only. You can start with Jetpack Protect’s free vulnerability scanning features and upgrade Jetpack Protect to access automated malware scanning and our web application firewall. By upgrading Protect, you are enabling Jetpack Scan to the plugin. + +Jetpack Scan is a product that can be purchased for use in conjunction with the main Jetpack plugin or Jetpack Protect. Jetpack Scan includes automated malware scanning and our web application firewall but does not contain the vulnerability scanning feature from the Protect plugin. If you purchase Jetpack Security or Jetpack Complete, Jetpack Scan is also included in those bundles. + +If you are already a Jetpack Scan, Jetpack Security, or Jetpack Complete customer, you can also take advantage of Jetpack Protect’s vulnerability scanning feature by installing the Jetpack Protect plugin. + +WPScan is an enterprise vulnerability scanning solution. It is not recommended for small to medium-sized businesses. If you are an enterprise company looking for custom WordPress site protection solutions, please visit: https://wpscan.com/ + +For small to medium-sized businesses, you can access our vulnerability scanning solution in the Jetpack Protect plugin. + += Will Jetpack Protect work on my local site? + +Jetpack Protect requires a publicly accessible site to perform the vulnerability scan. + += How will I know if Jetpack Protect has found WordPress security vulnerabilities and malware? = + +You can visit Jetpack Protect dashboard in your WordPress admin panel to see the security threats and malware found by the integrated malware scanner. + += What do I do if Jetpack Protect finds a security threat? = + +When the vulnerability scanner finds a security threat, you can view the recommended actions on the Jetpack Protect dashboard to secure your sites. + +If you have upgraded Protect, your site will also be automatically scanned for malware each day, and you will be notified instantly via email if any threats are detected. You will be able to fix most issues in one click. + += Can I set the time of the daily security scan? = + +It is not possible to set a time for the automated daily scans run by the integrated malware scanner. + += Why do I need WordPress security and malware scan? = + +A hacked WordPress site can cause serious damage to your business revenue and reputation. Jetpack Protect scans your site and lets you know possible malware and security threats on your installed plugins, themes, and core files. + += Where can I learn more about WordPress security and malware threats? = + +To learn how to achieve better WordPress security, [see this guide](https://jetpack.com/blog/guide-to-wordpress-security/). On the [Jetpack Blog](https://jetpack.com/blog/category/security/), you can find many more articles written by the top WordPress security experts. + += Is Jetpack Protect the same thing as the Protect feature in the Jetpack plugin? + +The new Jetpack Protect plugin is different from the Jetpack feature formerly known as [Protect](https://jetpack.com/support/protect/) (now renamed [Brute Force Attack Protection](https://jetpack.com/support/protect/)). + +== Screenshots == + +1. Focus on running your business while Jetpack Protect automatically scans your site. +2. Keep your site one step ahead of security threats and malware. +3. View all the found vulnerabilities in your site and learn how to fix them. +4. The Jetpack Firewall is a web application firewall (known as WAF) designed to protect your WordPress site from malicious requests. + +== Changelog == +### 3.0.2 - 2024-09-06 +#### Changed +- Internal updates. + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-credentials.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-credentials.php new file mode 100644 index 00000000..1e72b467 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-credentials.php @@ -0,0 +1,55 @@ +is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return false; + } + + $api_url = sprintf( '/sites/%d/scan', $blog_id ); + + $response = Client::wpcom_json_api_request_as_blog( + $api_url, + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + $parsed_response = json_decode( $response['body'] ); + + if ( ! $parsed_response ) { + return false; + } + + return isset( $parsed_response->credentials ) ? $parsed_response->credentials : array(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-jetpack-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-jetpack-protect.php new file mode 100644 index 00000000..b2db8472 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-jetpack-protect.php @@ -0,0 +1,466 @@ +ensure( + 'connection', + array( + 'slug' => JETPACK_PROTECT_SLUG, + 'name' => JETPACK_PROTECT_NAME, + 'url_info' => JETPACK_PROTECT_URI, + ) + ); + // Sync package. + $config->ensure( + 'sync', + array( + 'jetpack_sync_modules' => array( + 'Automattic\\Jetpack\\Sync\\Modules\\Options', + 'Automattic\\Jetpack\\Sync\\Modules\\Callables', + 'Automattic\\Jetpack\\Sync\\Modules\\Users', + ), + 'jetpack_sync_callable_whitelist' => array( + 'main_network_site' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'main_network_site_url' ), + 'get_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), + 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), + 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), + ), + 'jetpack_sync_options_contentless' => array(), + 'jetpack_sync_options_whitelist' => array( + 'active_plugins', + 'stylesheet', + ), + ) + ); + + // Identity crisis package. + $config->ensure( 'identity_crisis' ); + + // Web application firewall package. + $config->ensure( 'waf' ); + }, + 1 + ); + + add_filter( 'jetpack_connection_user_has_license', array( $this, 'jetpack_check_user_licenses' ), 10, 3 ); + + add_filter( 'jetpack_get_available_standalone_modules', array( $this, 'protect_filter_available_modules' ), 10, 1 ); + } + + /** + * Initialize the plugin + * + * @return void + */ + public function init() { + add_action( 'admin_bar_menu', array( $this, 'admin_bar' ), 65 ); + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) ); + + REST_Controller::init(); + My_Jetpack_Initializer::init(); + Site_Health::init(); + + // Sets up JITMS. + JITM::configure(); + } + + /** + * Initialize the admin page resources. + */ + public function admin_page_init() { + $total_threats = Status::get_total_threats(); + $menu_label = _x( 'Protect', 'The Jetpack Protect product name, without the Jetpack prefix', 'jetpack-protect' ); + if ( $total_threats ) { + $menu_label .= sprintf( ' %d', $total_threats ); + } + + $page_suffix = Admin_Menu::add_menu( + __( 'Jetpack Protect', 'jetpack-protect' ), + $menu_label, + 'manage_options', + 'jetpack-protect', + array( $this, 'plugin_settings_page' ), + 5 + ); + + add_action( 'load-' . $page_suffix, array( $this, 'enqueue_admin_scripts' ) ); + } + + /** + * Enqueues the wp-admin styles (used outside the React app) + */ + public function enqueue_admin_styles() { + wp_enqueue_style( 'jetpack-protect-wpadmin', JETPACK_PROTECT_BASE_PLUGIN_URL . '/assets/jetpack-protect.css', array(), JETPACK_PROTECT_VERSION ); + } + + /** + * Enqueue plugin admin scripts and styles. + */ + public function enqueue_admin_scripts() { + + Assets::register_script( + 'jetpack-protect', + 'build/index.js', + JETPACK_PROTECT_ROOT_FILE, + array( + 'in_footer' => true, + 'textdomain' => 'jetpack-protect', + ) + ); + Assets::enqueue_script( 'jetpack-protect' ); + // Required for Analytics. + wp_enqueue_script( 'jp-tracks', '//stats.wp.com/w.js', array(), gmdate( 'YW' ), true ); + // Initial JS state including JP Connection data. + Connection_Initial_State::render_script( 'jetpack-protect' ); + wp_add_inline_script( 'jetpack-protect', $this->render_initial_state(), 'before' ); + } + + /** + * Render the initial state into a JavaScript variable. + * + * @return string + */ + public function render_initial_state() { + return 'var jetpackProtectInitialState=JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( $this->initial_state() ) ) . '"));'; + } + + /** + * Get the initial state data for hydrating the React UI. + * + * @return array + */ + public function initial_state() { + global $wp_version; + // phpcs:disable WordPress.Security.NonceVerification.Recommended + $refresh_status_from_wpcom = isset( $_GET['checkPlan'] ); + $initial_state = array( + 'apiRoot' => esc_url_raw( rest_url() ), + 'apiNonce' => wp_create_nonce( 'wp_rest' ), + 'registrationNonce' => wp_create_nonce( 'jetpack-registration-nonce' ), + 'status' => Status::get_status( $refresh_status_from_wpcom ), + 'scanHistory' => Scan_History::get_scan_history( $refresh_status_from_wpcom ), + 'installedPlugins' => Plugins_Installer::get_plugins(), + 'installedThemes' => Sync_Functions::get_themes(), + 'wpVersion' => $wp_version, + 'adminUrl' => 'admin.php?page=jetpack-protect', + 'siteSuffix' => ( new Jetpack_Status() )->get_site_suffix(), + 'blogID' => Connection_Manager::get_site_id( true ), + 'jetpackScan' => My_Jetpack_Products::get_product( 'scan' ), + 'hasRequiredPlan' => Plan::has_required_plan(), + 'onboardingProgress' => Onboarding::get_current_user_progress(), + 'waf' => array( + 'wafSupported' => Waf_Runner::is_supported_environment(), + 'currentIp' => IP_Utils::get_ip(), + 'isSeen' => self::get_waf_seen_status(), + 'upgradeIsSeen' => self::get_waf_upgrade_seen_status(), + 'displayUpgradeBadge' => self::get_waf_upgrade_badge_display_status(), + 'isEnabled' => Waf_Runner::is_enabled(), + 'isToggling' => false, + 'isUpdating' => false, + 'config' => Waf_Runner::get_config(), + 'stats' => self::get_waf_stats(), + 'globalStats' => Waf_Stats::get_global_stats(), + ), + ); + + $initial_state['jetpackScan']['pricingForUi'] = Plan::get_product( 'jetpack_scan' ); + + return $initial_state; + } + /** + * Main plugin settings page. + */ + public function plugin_settings_page() { + ?> +
+ is_connected() ) { + self::activate_modules(); + } + } + + /** + * Activates the waf and brute force protection modules and disables the activation option + */ + public static function activate_modules() { + delete_option( self::JETPACK_PROTECT_ACTIVATION_OPTION ); + ( new Modules() )->activate( self::JETPACK_WAF_MODULE_SLUG, false, false ); + ( new Modules() )->activate( self::JETPACK_BRUTE_FORCE_PROTECTION_MODULE_SLUG, false, false ); + } + + /** + * Removes plugin from the connection manager + * If it's the last plugin using the connection, the site will be disconnected. + * + * @access public + * @static + */ + public static function plugin_deactivation() { + + // Clear Sync data. + Sender::get_instance()->uninstall(); + + $manager = new Connection_Manager( 'jetpack-protect' ); + $manager->remove_connection(); + + Protect_Status::delete_option(); + Scan_Status::delete_option(); + Scan_History::delete_option(); + } + + /** + * Create a shortcut on Admin Bar to show the total of threats found. + * + * @param object $wp_admin_bar The Admin Bar object. + * @return void + */ + public function admin_bar( $wp_admin_bar ) { + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $total = Status::get_total_threats(); + + if ( $total > 0 ) { + $args = array( + 'id' => 'jetpack-protect', + 'title' => '' . $total . '', + 'href' => admin_url( 'admin.php?page=jetpack-protect' ), + 'meta' => array( + // translators: %d is the number of threats found. + 'title' => sprintf( _n( '%d threat found by Jetpack Protect', '%d threats found by Jetpack Protect', $total, 'jetpack-protect' ), $total ), + ), + ); + + $wp_admin_bar->add_node( $args ); + } + } + + /** + * Adds modules to the list of available modules + * + * @param array $modules The available modules. + * @return array + */ + public function protect_filter_available_modules( $modules ) { + return array_merge( array( self::JETPACK_WAF_MODULE_SLUG, self::JETPACK_BRUTE_FORCE_PROTECTION_MODULE_SLUG ), $modules ); + } + + /** + * Check if the user has an available license that includes Jetpack Scan. + * + * @param boolean $has_license Whether a license was already found. + * @param object[] $licenses Unattached licenses belonging to the user. + * @param string $plugin_slug Slug of the plugin that initiated the flow. + * + * @return boolean + */ + public static function jetpack_check_user_licenses( $has_license, $licenses, $plugin_slug ) { + if ( $plugin_slug !== JETPACK_PROTECT_SLUG || $has_license ) { + return $has_license; + } + + $license_found = false; + + foreach ( $licenses as $license ) { + if ( $license->attached_at || $license->revoked_at ) { + continue; + } + + if ( in_array( $license->product_id, self::JETPACK_SCAN_PRODUCT_IDS, true ) ) { + $license_found = true; + break; + } + } + + return $license_found; + } + + /** + * Get WAF "Seen" Status + * + * @return bool Whether the current user has viewed the WAF screen. + */ + public static function get_waf_seen_status() { + return (bool) get_user_meta( get_current_user_id(), 'jetpack_protect_waf_seen', true ); + } + + /** + * Set WAF "Seen" Status + * + * @return bool True if seen status updated to true, false on failure. + */ + public static function set_waf_seen_status() { + return (bool) update_user_meta( get_current_user_id(), 'jetpack_protect_waf_seen', true ); + } + + /** + * Get WAF Upgrade "Seen" Status + * + * @return bool Whether the current user has dismissed the upgrade popover or enabled the automatic rules feature. + */ + public static function get_waf_upgrade_seen_status() { + return (bool) get_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_seen', true ); + } + + /** + * Set WAF Upgrade "Seen" Status + * + * @return bool True if upgrade seen status updated to true, false on failure. + */ + public static function set_waf_upgrade_seen_status() { + self::set_waf_upgrade_badge_timestamp(); + return (bool) update_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_seen', true ); + } + + /** + * Get WAF Upgrade Badge Timestamp + * + * @return integer The timestamp for the when the upgrade seen status was first set to true. + */ + public static function get_waf_upgrade_badge_timestamp() { + return (int) get_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_badge_timestamp', true ); + } + + /** + * Set WAF Upgrade Badge Timestamp + * + * @return bool True if upgrade badge timestamp to set to the current time, false on failure. + */ + public static function set_waf_upgrade_badge_timestamp() { + return (bool) update_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_badge_timestamp', time() ); + } + + /** + * Get WAF Upgrade Badge Display Status + * + * @return bool True if upgrade badge timestamp is set and less than 7 days ago, otherwise false. + */ + public static function get_waf_upgrade_badge_display_status() { + $badge_timestamp_exists = metadata_exists( 'user', get_current_user_id(), 'jetpack_protect_waf_upgrade_badge_timestamp' ); + if ( ! $badge_timestamp_exists ) { + return true; + } + + $badge_timestamp = self::get_waf_upgrade_badge_timestamp(); + $seven_days = strtotime( '-7 days' ); + if ( $badge_timestamp > $seven_days ) { + return true; + } + + return false; + } + + /** + * Get WAF stats + * + * @return bool|array False if WAF is not enabled, otherwise an array of stats. + */ + public static function get_waf_stats() { + if ( ! Waf_Runner::is_enabled() ) { + return false; + } + + return array( + 'ipAllowListCount' => Waf_Stats::get_ip_allow_list_count(), + 'ipBlockListCount' => Waf_Stats::get_ip_block_list_count(), + 'automaticRulesLastUpdated' => Waf_Stats::get_automatic_rules_last_updated(), + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-onboarding.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-onboarding.php new file mode 100644 index 00000000..cacd4768 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-onboarding.php @@ -0,0 +1,80 @@ + + */ + private static $current_user_progress; + + /** + * Onboarding Init + * + * @return void + */ + private static function init() { + self::$user_id = get_current_user_id(); + + $current_user_progress = get_user_meta( self::$user_id, self::OPTION_NAME, true ); + self::$current_user_progress = $current_user_progress ? $current_user_progress : array(); + } + + /** + * Set Onboarding Items As Completed + * + * @param array $step_ids The IDs of the steps to complete. + * @return bool True if the update was successful, false otherwise. + */ + public static function complete_steps( $step_ids ) { + self::init(); + + if ( empty( self::$current_user_progress ) ) { + self::$current_user_progress = $step_ids; + } else { + // Find step IDs that are not already in the current user progress + $new_steps = array_diff( $step_ids, self::$current_user_progress ); + + // Merge new steps with current progress + self::$current_user_progress = array_merge( self::$current_user_progress, $new_steps ); + } + + // Update the user meta only once + return (bool) update_user_meta( + self::$user_id, + self::OPTION_NAME, + self::$current_user_progress + ); + } + + /** + * Get Current User's Onboarding Progress + * + * @return array + */ + public static function get_current_user_progress() { + self::init(); + + return self::$current_user_progress; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php new file mode 100644 index 00000000..2f89144f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php @@ -0,0 +1,467 @@ + \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_ignore_threat', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'unignore-threat', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_unignore_threat', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'fix-threats', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_fix_threats', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'fix-threats-status', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_fix_threats_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'check-credentials', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_check_credentials', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'scan', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_scan', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'toggle-waf', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_toggle_waf', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_waf', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-seen', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_waf_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-seen', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_set_waf_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-upgrade-seen', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_waf_upgrade_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-upgrade-seen', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_set_waf_upgrade_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'onboarding-progress', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_onboarding_progress', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'onboarding-progress', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_complete_onboarding_steps', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'scan-history', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_scan_history', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + } + + /** + * Ignores a threat for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_ignore_threat( $request ) { + if ( ! $request['threat_id'] ) { + return new WP_REST_Response( 'Missing threat ID.', 400 ); + } + + $threat_ignored = Threats::ignore_threat( $request['threat_id'] ); + + if ( ! $threat_ignored ) { + return new WP_REST_Response( 'An error occured while attempting to ignore the threat.', 500 ); + } + + return new WP_REST_Response( 'Threat ignored.' ); + } + + /** + * Unignores a threat for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_unignore_threat( $request ) { + if ( ! $request['threat_id'] ) { + return new WP_REST_Response( 'Missing threat ID.', 400 ); + } + + $threat_ignored = Threats::unignore_threat( $request['threat_id'] ); + + if ( ! $threat_ignored ) { + return new WP_REST_Response( 'An error occured while attempting to unignore the threat.', 500 ); + } + + return new WP_REST_Response( 'Threat unignored.' ); + } + + /** + * Fixes threats for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_fix_threats( $request ) { + if ( empty( $request['threat_ids'] ) ) { + return new WP_REST_Response( 'Missing threat IDs.', 400 ); + } + + $threats_fixed = Threats::fix_threats( $request['threat_ids'] ); + + if ( ! $threats_fixed ) { + return new WP_REST_Response( 'An error occured while attempting to fix the threat.', 500 ); + } + + return new WP_REST_Response( $threats_fixed ); + } + + /** + * Fixes threats for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_fix_threats_status( $request ) { + if ( empty( $request['threat_ids'] ) ) { + return new WP_REST_Response( 'Missing threat IDs.', 400 ); + } + + $threats_fixed = Threats::fix_threats_status( $request['threat_ids'] ); + + if ( ! $threats_fixed ) { + return new WP_REST_Response( 'An error occured while attempting to get the fixer status of the threats.', 500 ); + } + + return new WP_REST_Response( $threats_fixed ); + } + + /** + * Checks if the site has credentials configured + * + * @return WP_REST_Response + */ + public static function api_check_credentials() { + $credential_array = Credentials::get_credential_array(); + + if ( ! isset( $credential_array ) ) { + return new WP_REST_Response( 'An error occured while attempting to fetch the credentials array', 500 ); + } + + return new WP_REST_Response( $credential_array ); + } + + /** + * Enqueues a scan for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_scan() { + $scan_enqueued = Threats::scan(); + + if ( ! $scan_enqueued ) { + return new WP_REST_Response( 'An error occured while attempting to enqueue the scan.', 500 ); + } + + return new WP_REST_Response( 'Scan enqueued.' ); + } + + /** + * Toggles the WAF module on or off for the API endpoint + * + * @return WP_REST_Response|WP_Error + */ + public static function api_toggle_waf() { + if ( Waf_Runner::is_enabled() ) { + $disabled = Waf_Runner::disable(); + if ( ! $disabled ) { + return new WP_Error( + 'waf_disable_failed', + __( 'An error occured disabling the firewall.', 'jetpack-protect' ), + array( 'status' => 500 ) + ); + } + + return rest_ensure_response( true ); + } + + $enabled = Waf_Runner::enable(); + if ( ! $enabled ) { + return new WP_Error( + 'waf_enable_failed', + __( 'An error occured enabling the firewall.', 'jetpack-protect' ), + array( 'status' => 500 ) + ); + } + + return rest_ensure_response( true ); + } + + /** + * Get WAF data for the API endpoint + * + * @return WP_Rest_Response + */ + public static function api_get_waf() { + // Ensure plugin activation has been performed so WAF module is available. + Jetpack_Protect::do_plugin_activation_activities(); + + return new WP_REST_Response( + array( + 'is_seen' => Jetpack_Protect::get_waf_seen_status(), + 'is_enabled' => Waf_Runner::is_enabled(), + 'config' => Waf_Runner::get_config(), + 'stats' => Jetpack_Protect::get_waf_stats(), + ) + ); + } + + /** + * Get WAF "Seen" status for the API endpoint + * + * @return bool Whether the current user has viewed the WAF screen. + */ + public static function api_get_waf_seen_status() { + return Jetpack_Protect::get_waf_seen_status(); + } + + /** + * Set WAF "Seen" status for the API endpoint + * + * @return bool True if seen status updated to true, false on failure. + */ + public static function api_set_waf_seen_status() { + return Jetpack_Protect::set_waf_seen_status(); + } + + /** + * Get WAF Upgrade "Seen" Status for the API endpoint + * + * @return bool Whether the current user has dismissed the upgrade popover or enabled the automatic rules feature. + */ + public static function api_get_waf_upgrade_seen_status() { + return Jetpack_Protect::get_waf_upgrade_seen_status(); + } + + /** + * Set WAF Upgrade "Seen" Status for the API endpoint + * + * @return bool True if upgrade seen status updated to true, false on failure. + */ + public static function api_set_waf_upgrade_seen_status() { + return Jetpack_Protect::set_waf_upgrade_seen_status(); + } + + /** + * Gets the current user's onboarding progress for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_get_onboarding_progress() { + $progress = Onboarding::get_current_user_progress(); + return rest_ensure_response( $progress, 200 ); + } + + /** + * Set an onboarding step as completed for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_complete_onboarding_steps( $request ) { + if ( empty( $request['step_ids'] ) || ! is_array( $request['step_ids'] ) ) { + return new WP_REST_Response( 'Missing or invalid onboarding step IDs.', 400 ); + } + + $completed = Onboarding::complete_steps( $request['step_ids'] ); + + if ( ! $completed ) { + return new WP_REST_Response( 'An error occured completing the onboarding step(s).', 500 ); + } + + return new WP_REST_Response( 'Onboarding step(s) completed.' ); + } + + /** + * Return Scan History for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_get_scan_history() { + $scan_history = Scan_History::get_scan_history( false ); + return rest_ensure_response( $scan_history, 200 ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-history.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-history.php new file mode 100644 index 00000000..1533402e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-history.php @@ -0,0 +1,351 @@ + (int) $option_timestamp; + } + + /** + * Checks if we should consider the stored cache or bypass it + * + * @return boolean + */ + public static function should_use_cache() { + return ! ( ( defined( 'JETPACK_PROTECT_DEV__BYPASS_CACHE' ) && JETPACK_PROTECT_DEV__BYPASS_CACHE ) ); + } + + /** + * Gets the current cached history + * + * @return bool|array False if value is not found. Array with values if cache is found. + */ + public static function get_from_options() { + return maybe_unserialize( get_option( static::OPTION_NAME ) ); + } + + /** + * Updated the cached history and its timestamp + * + * @param array $history The new history to be cached. + * @return void + */ + public static function update_history_option( $history ) { + // TODO: Sanitize $history. + update_option( static::OPTION_NAME, maybe_serialize( $history ) ); + update_option( static::OPTION_TIMESTAMP_NAME, time() + static::OPTION_EXPIRES_AFTER ); + } + + /** + * Delete the cached history and its timestamp + * + * @return bool Whether all related history options were successfully deleted. + */ + public static function delete_option() { + $option_deleted = delete_option( static::OPTION_NAME ); + $option_timestamp_deleted = delete_option( static::OPTION_TIMESTAMP_NAME ); + + return $option_deleted && $option_timestamp_deleted; + } + + /** + * Gets the current history of the Jetpack Protect checks + * + * @param bool $refresh_from_wpcom Refresh the local plan and history cache from wpcom. + * @return History_Model|bool + */ + public static function get_scan_history( $refresh_from_wpcom = false ) { + $has_required_plan = Plan::has_required_plan(); + if ( ! $has_required_plan ) { + return false; + } + + if ( self::$history !== null ) { + return self::$history; + } + + if ( $refresh_from_wpcom || ! self::should_use_cache() || self::is_cache_expired() ) { + $history = self::fetch_from_api(); + } else { + $history = self::get_from_options(); + } + + if ( is_wp_error( $history ) ) { + $history = new History_Model( + array( + 'error' => true, + 'error_code' => $history->get_error_code(), + 'error_message' => $history->get_error_message(), + ) + ); + } else { + $history = self::normalize_api_data( $history ); + } + + self::$history = $history; + return $history; + } + + /** + * Gets the Scan API endpoint + * + * @return WP_Error|string + */ + public static function get_api_url() { + $blog_id = Jetpack_Options::get_option( 'id' ); + $is_connected = ( new Connection_Manager() )->is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return new WP_Error( 'site_not_connected' ); + } + + $api_url = sprintf( self::SCAN_HISTORY_API_BASE, $blog_id ); + + return $api_url; + } + + /** + * Fetches the history data from the Scan API + * + * @return WP_Error|array + */ + public static function fetch_from_api() { + $api_url = self::get_api_url(); + if ( is_wp_error( $api_url ) ) { + return $api_url; + } + + $response = Client::wpcom_json_api_request_as_blog( + $api_url, + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code || empty( $response['body'] ) ) { + return new WP_Error( 'failed_fetching_status', 'Failed to fetch Scan history from the server', array( 'status' => $response_code ) ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + $body->last_checked = ( new \DateTime() )->format( 'Y-m-d H:i:s' ); + self::update_history_option( $body ); + + return $body; + } + + /** + * Normalize API Data + * Formats the payload from the Scan API into an instance of History_Model. + * + * @param object $scan_data The data returned by the scan API. + * @return History_Model + */ + private static function normalize_api_data( $scan_data ) { + $history = new History_Model(); + $history->num_threats = 0; + $history->num_core_threats = 0; + $history->num_plugins_threats = 0; + $history->num_themes_threats = 0; + + $history->last_checked = $scan_data->last_checked; + + if ( empty( $scan_data->threats ) || ! is_array( $scan_data->threats ) ) { + return $history; + } + + foreach ( $scan_data->threats as $threat ) { + if ( isset( $threat->extension->type ) ) { + if ( 'plugin' === $threat->extension->type ) { + self::handle_extension_threats( $threat, $history, 'plugin' ); + continue; + } + + if ( 'theme' === $threat->extension->type ) { + self::handle_extension_threats( $threat, $history, 'theme' ); + continue; + } + } + + if ( 'Vulnerable.WP.Core' === $threat->signature ) { + self::handle_core_threats( $threat, $history ); + continue; + } + + self::handle_additional_threats( $threat, $history ); + } + + return $history; + } + + /** + * Handles threats for extensions such as plugins or themes. + * + * @param object $threat The threat object. + * @param object $history The history object. + * @param string $type The type of extension ('plugin' or 'theme'). + * @return void + */ + private static function handle_extension_threats( $threat, $history, $type ) { + $extension_list = $type === 'plugin' ? 'plugins' : 'themes'; + $extensions = &$history->{ $extension_list}; + $found_index = null; + + // Check if the extension does not exist in the array + foreach ( $extensions as $index => $extension ) { + if ( $extension->slug === $threat->extension->slug ) { + $found_index = $index; + break; + } + } + + // Add the extension if it does not yet exist in the history + if ( $found_index === null ) { + $new_extension = new Extension_Model( + array( + 'name' => $threat->extension->name ?? null, + 'slug' => $threat->extension->slug ?? null, + 'version' => $threat->extension->version ?? null, + 'type' => $type, + 'checked' => true, + 'threats' => array(), + ) + ); + $extensions[] = $new_extension; + $found_index = array_key_last( $extensions ); + } + + // Add the threat to the found extension + $extensions[ $found_index ]->threats[] = new Threat_Model( $threat ); + + // Increment the threat counts + ++$history->num_threats; + if ( $type === 'plugin' ) { + ++$history->num_plugins_threats; + } elseif ( $type === 'theme' ) { + ++$history->num_themes_threats; + } + } + + /** + * Handles core threats + * + * @param object $threat The threat object. + * @param object $history The history object. + * @return void + */ + private static function handle_core_threats( $threat, $history ) { + // Check if the core version does not exist in the array + $found_index = null; + foreach ( $history->core as $index => $core ) { + if ( $core->version === $threat->version ) { + $found_index = $index; + break; + } + } + + // Add the extension if it does not yet exist in the history + if ( null === $found_index ) { + $new_core = new Extension_Model( + array( + 'name' => 'WordPress', + 'version' => $threat->version, + 'type' => 'core', + 'checked' => true, + 'threats' => array(), + ) + ); + $history->core[] = $new_core; + $found_index = array_key_last( $history->core ); + } + + // Add the threat to the found core + $history->core[ $found_index ]->threats[] = new Threat_Model( $threat ); + + ++$history->num_threats; + ++$history->num_core_threats; + } + + /** + * Handles additional threats that are not core, plugin or theme + * + * @param object $threat The threat object. + * @param object $history The history object. + * @return void + */ + private static function handle_additional_threats( $threat, $history ) { + if ( ! empty( $threat->filename ) ) { + $history->files[] = new Threat_Model( $threat ); + ++$history->num_threats; + } elseif ( ! empty( $threat->table ) ) { + $history->database[] = new Threat_Model( $threat ); + ++$history->num_threats; + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php new file mode 100644 index 00000000..840aeafb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php @@ -0,0 +1,113 @@ + __( 'Jetpack Protect checks', 'jetpack-protect' ), + 'test' => array( __CLASS__, 'do_checks' ), + ); + + return $checks; + } + + /** + * Do site-health page checks + * + * @access public + * @return array + */ + public static function do_checks() { + $total_threats = Status::get_total_threats(); + $threats = Status::get_all_threats(); + $threats = array_map( + function ( $v ) { + return $v->title; + }, + $threats + ); + + /** + * Default, no threats found + */ + $result = array( + 'label' => __( 'No known threats found', 'jetpack-protect' ), + 'status' => 'good', + 'badge' => array( + 'label' => __( 'Security', 'jetpack-protect' ), + 'color' => 'gray', + ), + 'description' => sprintf( + '

%s

', + __( 'Jetpack Protect did not find any known threats in your site. Threats can be exploited by hackers and cause harm to your website.', 'jetpack-protect' ) + ), + 'actions' => '', + 'test' => 'jetpack_protect_checks', + ); + + /** + * If threats found. + */ + if ( $total_threats ) { + $result['status'] = 'critical'; + /* translators: $d is the number of threats found. */ + $result['label'] = sprintf( _n( 'Your site is affected by %d security threat', 'Your site is affected by %d security threats', $total_threats, 'jetpack-protect' ), $total_threats ); + $result['description'] = __( 'Jetpack Protect detected the following security threats in your site:', 'jetpack-protect' ); + + foreach ( $threats as $threat ) { + $result['description'] .= '

'; + $result['description'] .= "  "; + $result['description'] .= wp_kses( $threat, array( 'a' => array( 'href' => array() ) ) ); // Only allow a href HTML tags. + $result['description'] .= '

'; + } + $result['description'] .= '

'; + $result['description'] .= sprintf( + wp_kses( + /* translators: Link to Jetpack Protect. */ + __( 'See Protect overview page for more information.', 'jetpack-protect' ), + array( + 'a' => array( 'href' => array() ), + ) + ), + esc_url( admin_url( 'admin.php?page=jetpack-protect' ) ) + ); + $result['description'] .= '

'; + } + + return $result; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php new file mode 100644 index 00000000..db71aaa7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php @@ -0,0 +1,218 @@ +is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return new WP_Error( 'site_not_connected' ); + } + + $api_url = sprintf( '/sites/%d/alerts', $blog_id ); + + return $api_url; + } + + /** + * Update Threat + * + * @param string $threat_id The threat ID. + * @param array $updates The keys/values to update. + * + * @return bool + */ + public static function update_threat( $threat_id, $updates ) { + $api_base = self::get_api_base(); + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_user( + "$api_base/$threat_id", + '2', + array( 'method' => 'POST' ), + wp_json_encode( $updates ), + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + // clear the now out-of-date cache + Scan_Status::delete_option(); + Scan_History::delete_option(); + + return true; + } + + /** + * Ignore Threat + * + * @param string $threat_id The threat ID. + * + * @return bool + */ + public static function ignore_threat( $threat_id ) { + return self::update_threat( $threat_id, array( 'ignore' => true ) ); + } + + /** + * Unignore Threat + * + * @param string $threat_id The threat ID. + * + * @return bool + */ + public static function unignore_threat( $threat_id ) { + return self::update_threat( $threat_id, array( 'unignore' => true ) ); + } + + /** + * Fix Threats + * + * @param array $threat_ids Threat IDs. + * + * @return bool|array + */ + public static function fix_threats( $threat_ids ) { + $api_base = self::get_api_base(); + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_user( + "$api_base/fix", + '2', + array( 'method' => 'POST' ), + wp_json_encode( + array( + 'threat_ids' => $threat_ids, + ) + ), + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + // clear the now out-of-date cache + Scan_Status::delete_option(); + Scan_History::delete_option(); + + $parsed_response = json_decode( $response['body'] ); + + if ( ! $parsed_response ) { + return false; + } + + return $parsed_response; + } + + /** + * Fix Threats Status + * + * @param array $threat_ids Threat IDs. + * + * @return bool|array + */ + public static function fix_threats_status( $threat_ids ) { + $api_base = self::get_api_base(); + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_user( + add_query_arg( 'threat_ids', $threat_ids, "$api_base/fix" ), + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + $parsed_response = json_decode( $response['body'] ); + + if ( ! $parsed_response ) { + return false; + } + + // clear the potentially out-of-date cache + Scan_Status::delete_option(); + Scan_History::delete_option(); + + return $parsed_response; + } + + /** + * Scan enqueue + * + * @return bool + */ + public static function scan() { + $blog_id = Jetpack_Options::get_option( 'id' ); + $is_connected = ( new Connection_Manager() )->is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return false; + } + + $api_base = sprintf( '/sites/%d/scan', $blog_id ); + + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_blog( + "$api_base/enqueue", + '2', + array( 'method' => 'POST' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + // clear the now out-of-date cache + Scan_Status::delete_option(); + Scan_History::delete_option(); + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/autoload.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/autoload.php new file mode 100644 index 00000000..ae93f550 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/autoload.php @@ -0,0 +1,25 @@ += 7.0. [#34192] + +## [0.3.5] - 2023-10-24 + +- Updated package dependencies. + +## [0.3.4] - 2023-08-23 +### Changed +- Updated package dependencies. [#32605] + +## [0.3.3] - 2023-06-19 +### Added +- Add the Advanced SEO feature to the list of free features. [#31213] + +## [0.3.2] - 2023-06-12 +### Changed +- Remove Jetpack-the-plugin dependencies from Current Plan class. [#31207] + +## [0.3.1] - 2023-06-05 +### Fixed +- Revert gating removal for simple payments [#31067] + +## [0.3.0] - 2023-05-11 +### Changed +- Make Earn products free for all Jetpack plans [#30432] + +## [0.2.12] - 2023-05-08 +### Changed +- Make Premium Content accessible on Free plans. [#30398] + +## [0.2.11] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.2.10] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.2.9] - 2023-01-25 +### Changed +- Minor internal updates. + +## [0.2.8] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [0.2.7] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [0.2.6] - 2022-11-07 +### Changed +- Updated package dependencies. [#27278] + +## [0.2.5] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [0.2.4] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [0.2.3] - 2022-09-08 +### Changed +- Updated package dependencies. + +## [0.2.2] - 2022-08-30 +### Changed +- Updated package dependencies. [#25694] + +## [0.2.1] - 2022-08-23 +### Changed +- Updated package dependencies. [#25628] + +## [0.2.0] - 2022-08-16 +### Added +- Tweaked the supports method of the plans package to refresh the plan data. [#25347] + +## [0.1.3] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [0.1.2] - 2022-07-26 +### Changed +- Add mirror repository information to package info. [#25142] +- Updated package dependencies. [#25158] + +## 0.1.1 - 2022-07-19 +### Changed +- Updated package dependencies. + +## 0.1.0 - 2022-07-06 +### Added +- Add support for WordPress.com Starter plan. [#24496] +- Package created. [#23503] + +### Changed +- Renaming master to trunk. [#24661] +- Updated package dependencies. + +### Deprecated +- Moved the options class into Connection. [#24095] + +[0.4.10]: https://github.com/Automattic/jetpack-plans/compare/v0.4.9...v0.4.10 +[0.4.9]: https://github.com/Automattic/jetpack-plans/compare/v0.4.8...v0.4.9 +[0.4.8]: https://github.com/Automattic/jetpack-plans/compare/v0.4.7...v0.4.8 +[0.4.7]: https://github.com/Automattic/jetpack-plans/compare/v0.4.6...v0.4.7 +[0.4.6]: https://github.com/Automattic/jetpack-plans/compare/v0.4.5...v0.4.6 +[0.4.5]: https://github.com/Automattic/jetpack-plans/compare/v0.4.4...v0.4.5 +[0.4.4]: https://github.com/Automattic/jetpack-plans/compare/v0.4.3...v0.4.4 +[0.4.3]: https://github.com/Automattic/jetpack-plans/compare/v0.4.2...v0.4.3 +[0.4.2]: https://github.com/Automattic/jetpack-plans/compare/v0.4.1...v0.4.2 +[0.4.1]: https://github.com/Automattic/jetpack-plans/compare/v0.4.0...v0.4.1 +[0.4.0]: https://github.com/Automattic/jetpack-plans/compare/v0.3.5...v0.4.0 +[0.3.5]: https://github.com/Automattic/jetpack-plans/compare/v0.3.4...v0.3.5 +[0.3.4]: https://github.com/Automattic/jetpack-plans/compare/v0.3.3...v0.3.4 +[0.3.3]: https://github.com/Automattic/jetpack-plans/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/Automattic/jetpack-plans/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/Automattic/jetpack-plans/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/Automattic/jetpack-plans/compare/v0.2.12...v0.3.0 +[0.2.12]: https://github.com/Automattic/jetpack-plans/compare/v0.2.11...v0.2.12 +[0.2.11]: https://github.com/Automattic/jetpack-plans/compare/v0.2.10...v0.2.11 +[0.2.10]: https://github.com/Automattic/jetpack-plans/compare/v0.2.9...v0.2.10 +[0.2.9]: https://github.com/Automattic/jetpack-plans/compare/v0.2.8...v0.2.9 +[0.2.8]: https://github.com/Automattic/jetpack-plans/compare/v0.2.7...v0.2.8 +[0.2.7]: https://github.com/Automattic/jetpack-plans/compare/v0.2.6...v0.2.7 +[0.2.6]: https://github.com/Automattic/jetpack-plans/compare/v0.2.5...v0.2.6 +[0.2.5]: https://github.com/Automattic/jetpack-plans/compare/v0.2.4...v0.2.5 +[0.2.4]: https://github.com/Automattic/jetpack-plans/compare/v0.2.3...v0.2.4 +[0.2.3]: https://github.com/Automattic/jetpack-plans/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-plans/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-plans/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-plans/compare/v0.1.3...v0.2.0 +[0.1.3]: https://github.com/Automattic/jetpack-plans/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-plans/compare/v0.1.1...v0.1.2 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/LICENSE.txt @@ -0,0 +1,357 @@ +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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +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. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/SECURITY.md new file mode 100644 index 00000000..98f48dd1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/SECURITY.md @@ -0,0 +1,47 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack and its associated plugins have continued support. If a critical vulnerability is found in the current version of a plugin, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +Our HackerOne program covers the below plugin software, as well as a variety of related projects and infrastructure: + +* [Jetpack](https://jetpack.com/) +* Jetpack Backup +* Jetpack Boost +* Jetpack CRM +* Jetpack Protect +* Jetpack Search +* Jetpack Social +* Jetpack VideoPress + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/composer.json new file mode 100644 index 00000000..ac086e0f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/composer.json @@ -0,0 +1,53 @@ +{ + "name": "automattic/jetpack-plans", + "description": "Fetch information about Jetpack Plans from wpcom", + "type": "library", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=7.0", + "automattic/jetpack-connection": "^4.0.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "^1.1.1", + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-status": "^4.0.0", + "automattic/wordbless": "@dev" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "build-production": "echo 'Add your build step to composer.json, please!'", + "build-development": "echo 'Add your build step to composer.json, please!'" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-plans", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plans/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.4.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-current-plan.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-current-plan.php new file mode 100644 index 00000000..f6e7c6e3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-current-plan.php @@ -0,0 +1,393 @@ + array( + 'plans' => array( + 'jetpack_free', + ), + 'supports' => array( + 'advanced-seo', + 'opentable', + 'calendly', + 'send-a-message', + 'sharing-block', + 'whatsapp-button', + 'social-previews', + 'videopress', + 'videopress/video', + 'v6-video-frame-poster', + + 'core/video', + 'core/cover', + 'core/audio', + ), + ), + 'personal' => array( + 'plans' => array( + 'jetpack_personal', + 'jetpack_personal_monthly', + 'personal-bundle', + 'personal-bundle-monthly', + 'personal-bundle-2y', + 'personal-bundle-3y', + 'starter-plan', + ), + 'supports' => array( + 'akismet', + 'payments', + 'videopress', + ), + ), + 'premium' => array( + 'plans' => array( + 'jetpack_premium', + 'jetpack_premium_monthly', + 'value_bundle', + 'value_bundle-monthly', + 'value_bundle-2y', + 'value_bundle-3y', + 'jetpack_creator_yearly', + 'jetpack_creator_bi_yearly', + 'jetpack_creator_monthly', + ), + 'supports' => array( + 'simple-payments', + 'vaultpress', + 'videopress', + 'republicize', + ), + ), + 'security' => array( + 'plans' => array( + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'supports' => array(), + ), + 'business' => array( + 'plans' => array( + 'jetpack_business', + 'jetpack_business_monthly', + 'business-bundle', + 'business-bundle-monthly', + 'business-bundle-2y', + 'business-bundle-3y', + 'ecommerce-bundle', + 'ecommerce-bundle-monthly', + 'ecommerce-bundle-2y', + 'ecommerce-bundle-3y', + 'pro-plan', + 'wp_bundle_migration_trial_monthly', + 'wp_bundle_hosting_trial_monthly', + 'ecommerce-trial-bundle-monthly', + 'wooexpress-small-bundle-yearly', + 'wooexpress-small-bundle-monthly', + 'wooexpress-medium-bundle-yearly', + 'wooexpress-medium-bundle-monthly', + 'wp_com_hundred_year_bundle_centennially', + ), + 'supports' => array(), + ), + + 'complete' => array( + 'plans' => array( + 'jetpack_complete', + 'jetpack_complete_monthly', + 'vip', + ), + 'supports' => array(), + ), + ); + + /** + * Given a response to the `/sites/%d` endpoint, will parse the response and attempt to set the + * site's plan and products from the response. + * + * @param array $response The response from `/sites/%d`. + * @return bool Was the plan successfully updated? + */ + public static function update_from_sites_response( $response ) { + // Bail if there was an error or malformed response. + if ( is_wp_error( $response ) || ! is_array( $response ) || ! isset( $response['body'] ) ) { + return false; + } + + $body = wp_remote_retrieve_body( $response ); + if ( is_wp_error( $body ) ) { + return false; + } + + // Decode the results. + $results = json_decode( $body, true ); + + if ( ! is_array( $results ) ) { + return false; + } + + if ( isset( $results['products'] ) ) { + // Store the site's products in an option and return true if updated. + self::store_data_in_option( self::SITE_PRODUCTS_OPTION, $results['products'] ); + } + + if ( ! isset( $results['plan'] ) ) { + return false; + } + + $current_plan = get_option( self::PLAN_OPTION, array() ); + + if ( ! empty( $current_plan ) && $current_plan === $results['plan'] ) { + // Bail if the plans array hasn't changed. + return false; + } + + // Store the new plan in an option and return true if updated. + $result = self::store_data_in_option( self::PLAN_OPTION, $results['plan'] ); + + if ( $result ) { + // Reset the cache since we've just updated the plan. + self::$active_plan_cache = null; + } + + return $result; + } + + /** + * Store data in an option. + * + * @param string $option The name of the option that will store the data. + * @param array $data Data to be store in an option. + * @return bool Were the subscriptions successfully updated? + */ + private static function store_data_in_option( $option, $data ) { + $result = update_option( $option, $data, true ); + + // If something goes wrong with the update, so delete the current option and then update it. + if ( ! $result ) { + delete_option( $option ); + $result = update_option( $option, $data, true ); + } + + return $result; + } + + /** + * Make an API call to WordPress.com for plan status + * + * @uses Jetpack_Options::get_option() + * @uses Client::wpcom_json_api_request_as_blog() + * @uses update_option() + * + * @access public + * @static + * + * @return bool True if plan is updated, false if no update + */ + public static function refresh_from_wpcom() { + $site_id = Manager::get_site_id(); + if ( is_wp_error( $site_id ) ) { + return false; + } + + // Make the API request. + + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%d?force=wpcom', $site_id ), + '1.1' + ); + + return self::update_from_sites_response( $response ); + } + + /** + * Get the plan that this Jetpack site is currently using. + * + * @uses get_option() + * + * @access public + * @static + * + * @return array Active Jetpack plan details + */ + public static function get() { + // this can be expensive to compute so we cache for the duration of a request. + if ( is_array( self::$active_plan_cache ) && ! empty( self::$active_plan_cache ) ) { + return self::$active_plan_cache; + } + + $plan = get_option( self::PLAN_OPTION, array() ); + + // Set the default options. + $plan = wp_parse_args( + $plan, + array( + 'product_slug' => 'jetpack_free', + 'class' => 'free', + 'features' => array( + 'active' => array(), + ), + ) + ); + + list( $plan['class'], $supports ) = self::get_class_and_features( $plan['product_slug'] ); + + $modules = new Modules(); + foreach ( $modules->get_available() as $module_slug ) { + $module = $modules->get( $module_slug ); + if ( ! isset( $module ) || ! is_array( $module ) ) { + continue; + } + if ( in_array( 'free', $module['plan_classes'], true ) || in_array( $plan['class'], $module['plan_classes'], true ) ) { + $supports[] = $module_slug; + } + } + + $plan['supports'] = $supports; + + self::$active_plan_cache = $plan; + + return $plan; + } + + /** + * Get the site's products. + * + * @uses get_option() + * + * @access public + * @static + * + * @return array Active Jetpack products + */ + public static function get_products() { + return get_option( self::SITE_PRODUCTS_OPTION, array() ); + } + + /** + * Get the class of plan and a list of features it supports + * + * @param string $plan_slug The plan that we're interested in. + * @return array Two item array, the plan class and the an array of features. + */ + private static function get_class_and_features( $plan_slug ) { + $features = array(); + foreach ( self::PLAN_DATA as $class => $details ) { + $features = array_merge( $features, $details['supports'] ); + if ( in_array( $plan_slug, $details['plans'], true ) ) { + return array( $class, $features ); + } + } + return array( 'free', self::PLAN_DATA['free']['supports'] ); + } + + /** + * Gets the minimum plan slug that supports the given feature + * + * @param string $feature The name of the feature. + * @return string|bool The slug for the minimum plan that supports. + * the feature or false if not found + */ + public static function get_minimum_plan_for_feature( $feature ) { + foreach ( self::PLAN_DATA as $details ) { + if ( in_array( $feature, $details['supports'], true ) ) { + return $details['plans'][0]; + } + } + return false; + } + + /** + * Determine whether the active plan supports a particular feature + * + * @uses self::get() + * + * @access public + * @static + * + * @param string $feature The module or feature to check. + * @param bool $refresh_from_wpcom Refresh the local plan cache from wpcom. + * + * @return bool True if plan supports feature, false if not + */ + public static function supports( $feature, $refresh_from_wpcom = false ) { + if ( $refresh_from_wpcom ) { + self::refresh_from_wpcom(); + } + + // Hijack the feature eligibility check on WordPress.com sites since they are gated differently. + $should_wpcom_gate_feature = ( + function_exists( 'wpcom_site_has_feature' ) && + function_exists( 'wpcom_feature_exists' ) && + wpcom_feature_exists( $feature ) + ); + if ( $should_wpcom_gate_feature ) { + return wpcom_site_has_feature( $feature ); + } + + // Search product bypasses plan feature check. + if ( 'search' === $feature && (bool) get_option( 'has_jetpack_search_product' ) ) { + return true; + } + + // As of Q3 2021 - a videopress free tier is available to all plans. + if ( 'videopress' === $feature ) { + return true; + } + + // As of 05 2023 - all plans support Earn features (minus 'simple-payments') + if ( in_array( $feature, array( 'donations', 'recurring-payments', 'premium-content/container' ), true ) ) { + return true; + } + + $plan = self::get(); + + if ( + in_array( $feature, $plan['supports'], true ) + || in_array( $feature, $plan['features']['active'], true ) + ) { + return true; + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-plans.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-plans.php new file mode 100644 index 00000000..130cf09b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-plans.php @@ -0,0 +1,82 @@ + 'GET', + 'headers' => array( + 'X-Forwarded-For' => ( new \Automattic\Jetpack\Status\Visitor() )->get_ip( true ), + ), + ), + null, + 'rest' + ); + + $body = wp_remote_retrieve_body( $request ); + if ( 200 === wp_remote_retrieve_response_code( $request ) ) { + return json_decode( $body ); + } else { + return $body; + } + } + + /** + * Get plan information for a plan given its slug + * + * @since-jetpack 7.7.0 + * + * @param string $plan_slug Plan slug. + * + * @return object The plan object + */ + public static function get_plan( $plan_slug ) { + $plans = self::get_plans(); + if ( ! is_array( $plans ) ) { + return; + } + + foreach ( $plans as $plan ) { + if ( $plan_slug === $plan->product_slug ) { + return $plan; + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/ClassLoader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/ClassLoader.php new file mode 100644 index 00000000..7824d8f7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/ClassLoader.php @@ -0,0 +1,579 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + + // PSR-4 + /** + * @var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var list + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ + private $prefixesPsr0 = array(); + /** + * @var list + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var array + */ + private $missingClasses = array(); + + /** @var string|null */ + private $apcuPrefix; + + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return list + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return list + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return array Array of classname => path + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + $includeFile = self::$includeFile; + $includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } + + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/InstalledVersions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..51e734a7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/LICENSE b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_classmap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..136048da --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_classmap.php @@ -0,0 +1,243 @@ + $vendorDir . '/wikimedia/aho-corasick/src/MultiStringMatcher.php', + 'AhoCorasick\\MultiStringReplacer' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringReplacer.php', + 'Automattic\\Jetpack\\A8c_Mc_Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php', + 'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => $baseDir . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php', + 'Automattic\\Jetpack\\Assets' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php', + 'Automattic\\Jetpack\\Assets\\Logo' => $baseDir . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php', + 'Automattic\\Jetpack\\Assets\\Script_Data' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-script-data.php', + 'Automattic\\Jetpack\\Assets\\Semver' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php', + 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php', + 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php', + 'Automattic\\Jetpack\\Automatic_Install_Skin' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php', + 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager' => $baseDir . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-helper-script-manager.php', + 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager_Impl' => $baseDir . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-helper-script-manager-impl.php', + 'Automattic\\Jetpack\\Backup\\V0004\\Throw_On_Errors' => $baseDir . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-throw-on-errors.php', + 'Automattic\\Jetpack\\Boost_Core\\Contracts\\Boost_API_Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/contracts/boost-api-client.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Boost_API' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-boost-api.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Cacheable' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-cacheable.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Transient' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-transient.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Url' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-url.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Utils' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-utils.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\WPCOM_Boost_API_Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-wpcom-boost-api-client.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Jetpack_Boost_Modules' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-jetpack-boost-modules.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_Graph_History_Request' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-graph-history-request.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_History' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-history.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_Request' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-request.php', + 'Automattic\\Jetpack\\Composer\\Manager' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-manager.php', + 'Automattic\\Jetpack\\Composer\\Plugin' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-plugin.php', + 'Automattic\\Jetpack\\Config' => $baseDir . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php', + 'Automattic\\Jetpack\\Connection\\Authorize_Json_Api' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-authorize-json-api.php', + 'Automattic\\Jetpack\\Connection\\Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php', + 'Automattic\\Jetpack\\Connection\\Connection_Assets' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-assets.php', + 'Automattic\\Jetpack\\Connection\\Connection_Notice' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php', + 'Automattic\\Jetpack\\Connection\\Error_Handler' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php', + 'Automattic\\Jetpack\\Connection\\Initial_State' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php', + 'Automattic\\Jetpack\\Connection\\Manager' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php', + 'Automattic\\Jetpack\\Connection\\Manager_Interface' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php', + 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php', + 'Automattic\\Jetpack\\Connection\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php', + 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php', + 'Automattic\\Jetpack\\Connection\\Plugin' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php', + 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php', + 'Automattic\\Jetpack\\Connection\\REST_Connector' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php', + 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php', + 'Automattic\\Jetpack\\Connection\\SSO' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php', + 'Automattic\\Jetpack\\Connection\\SSO\\Force_2FA' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-force-2fa.php', + 'Automattic\\Jetpack\\Connection\\SSO\\Helpers' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php', + 'Automattic\\Jetpack\\Connection\\SSO\\Notices' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php', + 'Automattic\\Jetpack\\Connection\\SSO\\User_Admin' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php', + 'Automattic\\Jetpack\\Connection\\Secrets' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php', + 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php', + 'Automattic\\Jetpack\\Connection\\Tokens' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php', + 'Automattic\\Jetpack\\Connection\\Tokens_Locks' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php', + 'Automattic\\Jetpack\\Connection\\Urls' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php', + 'Automattic\\Jetpack\\Connection\\Utils' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php', + 'Automattic\\Jetpack\\Connection\\Webhooks' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php', + 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php', + 'Automattic\\Jetpack\\Constants' => $baseDir . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php', + 'Automattic\\Jetpack\\CookieState' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php', + 'Automattic\\Jetpack\\Current_Plan' => $vendorDir . '/automattic/jetpack-plans/src/class-current-plan.php', + 'Automattic\\Jetpack\\Device_Detection' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php', + 'Automattic\\Jetpack\\Device_Detection\\User_Agent_Info' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php', + 'Automattic\\Jetpack\\Errors' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php', + 'Automattic\\Jetpack\\ExPlat' => $baseDir . '/jetpack_vendor/automattic/jetpack-explat/src/class-explat.php', + 'Automattic\\Jetpack\\ExPlat\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-explat/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Files' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php', + 'Automattic\\Jetpack\\Heartbeat' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php', + 'Automattic\\Jetpack\\IP\\Utils' => $baseDir . '/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php', + 'Automattic\\Jetpack\\IdentityCrisis\\Exception' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-exception.php', + 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-rest-endpoints.php', + 'Automattic\\Jetpack\\IdentityCrisis\\UI' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-ui.php', + 'Automattic\\Jetpack\\IdentityCrisis\\URL_Secret' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-url-secret.php', + 'Automattic\\Jetpack\\Identity_Crisis' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-identity-crisis.php', + 'Automattic\\Jetpack\\JITMS\\JITM' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php', + 'Automattic\\Jetpack\\Licensing' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php', + 'Automattic\\Jetpack\\Licensing\\Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php', + 'Automattic\\Jetpack\\Modules' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php', + 'Automattic\\Jetpack\\My_Jetpack\\Activitylog' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php', + 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Initializer' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php', + 'Automattic\\Jetpack\\My_Jetpack\\Jetpack_Manage' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php', + 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Product' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Creator' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Jetpack_Ai' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Starter' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_AI' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Product_Data' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Recommendations_Evaluation' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-recommendations-evaluation.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Zendesk_Chat' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php', + 'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php', + 'Automattic\\Jetpack\\Partner' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php', + 'Automattic\\Jetpack\\Partner_Coupon' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner-coupon.php', + 'Automattic\\Jetpack\\Password_Checker' => $baseDir . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php', + 'Automattic\\Jetpack\\Paths' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php', + 'Automattic\\Jetpack\\Plans' => $vendorDir . '/automattic/jetpack-plans/src/class-plans.php', + 'Automattic\\Jetpack\\Plugins_Installer' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php', + 'Automattic\\Jetpack\\Protect\\Credentials' => $baseDir . '/src/class-credentials.php', + 'Automattic\\Jetpack\\Protect\\Onboarding' => $baseDir . '/src/class-onboarding.php', + 'Automattic\\Jetpack\\Protect\\REST_Controller' => $baseDir . '/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Protect\\Scan_History' => $baseDir . '/src/class-scan-history.php', + 'Automattic\\Jetpack\\Protect\\Site_Health' => $baseDir . '/src/class-site-health.php', + 'Automattic\\Jetpack\\Protect\\Threats' => $baseDir . '/src/class-threats.php', + 'Automattic\\Jetpack\\Protect_Models' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-protect-models.php', + 'Automattic\\Jetpack\\Protect_Models\\Extension_Model' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-extension-model.php', + 'Automattic\\Jetpack\\Protect_Models\\History_Model' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-history-model.php', + 'Automattic\\Jetpack\\Protect_Models\\Status_Model' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-status-model.php', + 'Automattic\\Jetpack\\Protect_Models\\Threat_Model' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-threat-model.php', + 'Automattic\\Jetpack\\Protect_Status\\Plan' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-plan.php', + 'Automattic\\Jetpack\\Protect_Status\\Protect_Status' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-protect-status.php', + 'Automattic\\Jetpack\\Protect_Status\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Protect_Status\\Scan_Status' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-scan-status.php', + 'Automattic\\Jetpack\\Protect_Status\\Status' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-status.php', + 'Automattic\\Jetpack\\Redirect' => $baseDir . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php', + 'Automattic\\Jetpack\\Roles' => $baseDir . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php', + 'Automattic\\Jetpack\\Status' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php', + 'Automattic\\Jetpack\\Status\\Cache' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php', + 'Automattic\\Jetpack\\Status\\Host' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php', + 'Automattic\\Jetpack\\Status\\Visitor' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php', + 'Automattic\\Jetpack\\Sync\\Actions' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php', + 'Automattic\\Jetpack\\Sync\\Codec_Interface' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php', + 'Automattic\\Jetpack\\Sync\\Data_Settings' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php', + 'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php', + 'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php', + 'Automattic\\Jetpack\\Sync\\Defaults' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php', + 'Automattic\\Jetpack\\Sync\\Functions' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php', + 'Automattic\\Jetpack\\Sync\\Health' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php', + 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php', + 'Automattic\\Jetpack\\Sync\\Listener' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php', + 'Automattic\\Jetpack\\Sync\\Lock' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php', + 'Automattic\\Jetpack\\Sync\\Main' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php', + 'Automattic\\Jetpack\\Sync\\Modules' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Menus' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Meta' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Module' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Protect' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Search' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Terms' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Themes' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Updates' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce_HPOS_Orders' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php', + 'Automattic\\Jetpack\\Sync\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php', + 'Automattic\\Jetpack\\Sync\\Queue' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php', + 'Automattic\\Jetpack\\Sync\\Queue\\Queue_Storage_Options' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-options.php', + 'Automattic\\Jetpack\\Sync\\Queue\\Queue_Storage_Table' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php', + 'Automattic\\Jetpack\\Sync\\Queue_Buffer' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php', + 'Automattic\\Jetpack\\Sync\\REST_Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php', + 'Automattic\\Jetpack\\Sync\\REST_Sender' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php', + 'Automattic\\Jetpack\\Sync\\Replicastore' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php', + 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Sender' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php', + 'Automattic\\Jetpack\\Sync\\Server' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php', + 'Automattic\\Jetpack\\Sync\\Settings' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php', + 'Automattic\\Jetpack\\Sync\\Simple_Codec' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php', + 'Automattic\\Jetpack\\Sync\\Users' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php', + 'Automattic\\Jetpack\\Sync\\Utils' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php', + 'Automattic\\Jetpack\\Terms_Of_Service' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php', + 'Automattic\\Jetpack\\Tracking' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php', + 'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php', + 'Automattic\\Jetpack\\Transport_Helper\\V0001\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version-compat.php', + 'Automattic\\Jetpack\\Transport_Helper\\V0004\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Blocked_Login_Page' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Math_Authenticate' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-math-fallback.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Shared_Functions' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-shared-functions.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Transient_Cleanup' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php', + 'Automattic\\Jetpack\\Waf\\CLI' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php', + 'Automattic\\Jetpack\\Waf\\File_System_Exception' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php', + 'Automattic\\Jetpack\\Waf\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Rules_API_Exception' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-rules-api-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php', + 'Automattic\\Jetpack\\Waf\\Waf_Constants' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php', + 'Automattic\\Jetpack\\Waf\\Waf_Exception' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Initializer' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php', + 'Automattic\\Jetpack\\Waf\\Waf_Operators' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php', + 'Automattic\\Jetpack\\Waf\\Waf_Request' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php', + 'Automattic\\Jetpack\\Waf\\Waf_Rules_Manager' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runner' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runtime' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php', + 'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php', + 'Automattic\\Jetpack\\Waf\\Waf_Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php', + 'Automattic\\Jetpack\\Waf\\Waf_Transforms' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Jetpack_IXR_Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php', + 'Jetpack_IXR_ClientMulticall' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php', + 'Jetpack_Options' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php', + 'Jetpack_Protect' => $baseDir . '/src/class-jetpack-protect.php', + 'Jetpack_Signature' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php', + 'Jetpack_Tracks_Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php', + 'Jetpack_Tracks_Event' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php', + 'Jetpack_XMLRPC_Server' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php', +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_files.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_files.php new file mode 100644 index 00000000..cc9498e8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_files.php @@ -0,0 +1,13 @@ + $baseDir . '/jetpack_vendor/automattic/jetpack-assets/actions.php', + '7372b7fb88a9723cf5b76d456eb0b738' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/actions.php', + '590147edb63acb03b2852d5c4db13ce8' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php', + '3d45c7e6a7f0e71849e33afe4b3b3ede' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/cli.php', +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_namespaces.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..15a2ff3a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/automattic/jetpack-autoloader/src'), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_real.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_real.php new file mode 100644 index 00000000..b08f5ccd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_real.php @@ -0,0 +1,51 @@ +setClassMapAuthoritative(true); + $loader->register(true); + + $filesToLoad = \Composer\Autoload\ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ3_0_2::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); + } + + return $loader; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_static.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_static.php new file mode 100644 index 00000000..6904807c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_static.php @@ -0,0 +1,276 @@ + __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/actions.php', + '7372b7fb88a9723cf5b76d456eb0b738' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/actions.php', + '590147edb63acb03b2852d5c4db13ce8' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php', + '3d45c7e6a7f0e71849e33afe4b3b3ede' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/cli.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'A' => + array ( + 'Automattic\\Jetpack\\Autoloader\\' => 30, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Automattic\\Jetpack\\Autoloader\\' => + array ( + 0 => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src', + ), + ); + + public static $classMap = array ( + 'AhoCorasick\\MultiStringMatcher' => __DIR__ . '/..' . '/wikimedia/aho-corasick/src/MultiStringMatcher.php', + 'AhoCorasick\\MultiStringReplacer' => __DIR__ . '/..' . '/wikimedia/aho-corasick/src/MultiStringReplacer.php', + 'Automattic\\Jetpack\\A8c_Mc_Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php', + 'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php', + 'Automattic\\Jetpack\\Assets' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php', + 'Automattic\\Jetpack\\Assets\\Logo' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php', + 'Automattic\\Jetpack\\Assets\\Script_Data' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/src/class-script-data.php', + 'Automattic\\Jetpack\\Assets\\Semver' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php', + 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php', + 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/ManifestGenerator.php', + 'Automattic\\Jetpack\\Automatic_Install_Skin' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php', + 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-helper-script-manager.php', + 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager_Impl' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-helper-script-manager-impl.php', + 'Automattic\\Jetpack\\Backup\\V0004\\Throw_On_Errors' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-throw-on-errors.php', + 'Automattic\\Jetpack\\Boost_Core\\Contracts\\Boost_API_Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-core/src/contracts/boost-api-client.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Boost_API' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-boost-api.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Cacheable' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-cacheable.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Transient' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-transient.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Url' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-url.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Utils' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-utils.php', + 'Automattic\\Jetpack\\Boost_Core\\Lib\\WPCOM_Boost_API_Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-wpcom-boost-api-client.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Jetpack_Boost_Modules' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-jetpack-boost-modules.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_Graph_History_Request' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-graph-history-request.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_History' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-history.php', + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_Request' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-request.php', + 'Automattic\\Jetpack\\Composer\\Manager' => __DIR__ . '/..' . '/automattic/jetpack-composer-plugin/src/class-manager.php', + 'Automattic\\Jetpack\\Composer\\Plugin' => __DIR__ . '/..' . '/automattic/jetpack-composer-plugin/src/class-plugin.php', + 'Automattic\\Jetpack\\Config' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php', + 'Automattic\\Jetpack\\Connection\\Authorize_Json_Api' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-authorize-json-api.php', + 'Automattic\\Jetpack\\Connection\\Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php', + 'Automattic\\Jetpack\\Connection\\Connection_Assets' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-assets.php', + 'Automattic\\Jetpack\\Connection\\Connection_Notice' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php', + 'Automattic\\Jetpack\\Connection\\Error_Handler' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php', + 'Automattic\\Jetpack\\Connection\\Initial_State' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php', + 'Automattic\\Jetpack\\Connection\\Manager' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php', + 'Automattic\\Jetpack\\Connection\\Manager_Interface' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php', + 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php', + 'Automattic\\Jetpack\\Connection\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php', + 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php', + 'Automattic\\Jetpack\\Connection\\Plugin' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php', + 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php', + 'Automattic\\Jetpack\\Connection\\REST_Connector' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php', + 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php', + 'Automattic\\Jetpack\\Connection\\SSO' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php', + 'Automattic\\Jetpack\\Connection\\SSO\\Force_2FA' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-force-2fa.php', + 'Automattic\\Jetpack\\Connection\\SSO\\Helpers' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php', + 'Automattic\\Jetpack\\Connection\\SSO\\Notices' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php', + 'Automattic\\Jetpack\\Connection\\SSO\\User_Admin' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php', + 'Automattic\\Jetpack\\Connection\\Secrets' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php', + 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php', + 'Automattic\\Jetpack\\Connection\\Tokens' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php', + 'Automattic\\Jetpack\\Connection\\Tokens_Locks' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php', + 'Automattic\\Jetpack\\Connection\\Urls' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php', + 'Automattic\\Jetpack\\Connection\\Utils' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php', + 'Automattic\\Jetpack\\Connection\\Webhooks' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php', + 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php', + 'Automattic\\Jetpack\\Constants' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php', + 'Automattic\\Jetpack\\CookieState' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php', + 'Automattic\\Jetpack\\Current_Plan' => __DIR__ . '/..' . '/automattic/jetpack-plans/src/class-current-plan.php', + 'Automattic\\Jetpack\\Device_Detection' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php', + 'Automattic\\Jetpack\\Device_Detection\\User_Agent_Info' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php', + 'Automattic\\Jetpack\\Errors' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php', + 'Automattic\\Jetpack\\ExPlat' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-explat/src/class-explat.php', + 'Automattic\\Jetpack\\ExPlat\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-explat/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Files' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php', + 'Automattic\\Jetpack\\Heartbeat' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php', + 'Automattic\\Jetpack\\IP\\Utils' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php', + 'Automattic\\Jetpack\\IdentityCrisis\\Exception' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-exception.php', + 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-rest-endpoints.php', + 'Automattic\\Jetpack\\IdentityCrisis\\UI' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-ui.php', + 'Automattic\\Jetpack\\IdentityCrisis\\URL_Secret' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-url-secret.php', + 'Automattic\\Jetpack\\Identity_Crisis' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-identity-crisis.php', + 'Automattic\\Jetpack\\JITMS\\JITM' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php', + 'Automattic\\Jetpack\\Licensing' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php', + 'Automattic\\Jetpack\\Licensing\\Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php', + 'Automattic\\Jetpack\\Modules' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php', + 'Automattic\\Jetpack\\My_Jetpack\\Activitylog' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php', + 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Initializer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php', + 'Automattic\\Jetpack\\My_Jetpack\\Jetpack_Manage' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php', + 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Product' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Creator' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Jetpack_Ai' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Starter' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_AI' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Product_Data' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Recommendations_Evaluation' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-recommendations-evaluation.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Zendesk_Chat' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php', + 'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php', + 'Automattic\\Jetpack\\Partner' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php', + 'Automattic\\Jetpack\\Partner_Coupon' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner-coupon.php', + 'Automattic\\Jetpack\\Password_Checker' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php', + 'Automattic\\Jetpack\\Paths' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php', + 'Automattic\\Jetpack\\Plans' => __DIR__ . '/..' . '/automattic/jetpack-plans/src/class-plans.php', + 'Automattic\\Jetpack\\Plugins_Installer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php', + 'Automattic\\Jetpack\\Protect\\Credentials' => __DIR__ . '/../..' . '/src/class-credentials.php', + 'Automattic\\Jetpack\\Protect\\Onboarding' => __DIR__ . '/../..' . '/src/class-onboarding.php', + 'Automattic\\Jetpack\\Protect\\REST_Controller' => __DIR__ . '/../..' . '/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Protect\\Scan_History' => __DIR__ . '/../..' . '/src/class-scan-history.php', + 'Automattic\\Jetpack\\Protect\\Site_Health' => __DIR__ . '/../..' . '/src/class-site-health.php', + 'Automattic\\Jetpack\\Protect\\Threats' => __DIR__ . '/../..' . '/src/class-threats.php', + 'Automattic\\Jetpack\\Protect_Models' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-protect-models.php', + 'Automattic\\Jetpack\\Protect_Models\\Extension_Model' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-extension-model.php', + 'Automattic\\Jetpack\\Protect_Models\\History_Model' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-history-model.php', + 'Automattic\\Jetpack\\Protect_Models\\Status_Model' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-status-model.php', + 'Automattic\\Jetpack\\Protect_Models\\Threat_Model' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-threat-model.php', + 'Automattic\\Jetpack\\Protect_Status\\Plan' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-plan.php', + 'Automattic\\Jetpack\\Protect_Status\\Protect_Status' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-protect-status.php', + 'Automattic\\Jetpack\\Protect_Status\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Protect_Status\\Scan_Status' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-scan-status.php', + 'Automattic\\Jetpack\\Protect_Status\\Status' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-status.php', + 'Automattic\\Jetpack\\Redirect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php', + 'Automattic\\Jetpack\\Roles' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php', + 'Automattic\\Jetpack\\Status' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php', + 'Automattic\\Jetpack\\Status\\Cache' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php', + 'Automattic\\Jetpack\\Status\\Host' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php', + 'Automattic\\Jetpack\\Status\\Visitor' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php', + 'Automattic\\Jetpack\\Sync\\Actions' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php', + 'Automattic\\Jetpack\\Sync\\Codec_Interface' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php', + 'Automattic\\Jetpack\\Sync\\Data_Settings' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php', + 'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php', + 'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php', + 'Automattic\\Jetpack\\Sync\\Defaults' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php', + 'Automattic\\Jetpack\\Sync\\Functions' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php', + 'Automattic\\Jetpack\\Sync\\Health' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php', + 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php', + 'Automattic\\Jetpack\\Sync\\Listener' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php', + 'Automattic\\Jetpack\\Sync\\Lock' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php', + 'Automattic\\Jetpack\\Sync\\Main' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php', + 'Automattic\\Jetpack\\Sync\\Modules' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Menus' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Meta' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Module' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Protect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Search' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Terms' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Themes' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Updates' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce_HPOS_Orders' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php', + 'Automattic\\Jetpack\\Sync\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php', + 'Automattic\\Jetpack\\Sync\\Queue' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php', + 'Automattic\\Jetpack\\Sync\\Queue\\Queue_Storage_Options' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-options.php', + 'Automattic\\Jetpack\\Sync\\Queue\\Queue_Storage_Table' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php', + 'Automattic\\Jetpack\\Sync\\Queue_Buffer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php', + 'Automattic\\Jetpack\\Sync\\REST_Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php', + 'Automattic\\Jetpack\\Sync\\REST_Sender' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php', + 'Automattic\\Jetpack\\Sync\\Replicastore' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php', + 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Sender' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php', + 'Automattic\\Jetpack\\Sync\\Server' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php', + 'Automattic\\Jetpack\\Sync\\Settings' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php', + 'Automattic\\Jetpack\\Sync\\Simple_Codec' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php', + 'Automattic\\Jetpack\\Sync\\Users' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php', + 'Automattic\\Jetpack\\Sync\\Utils' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php', + 'Automattic\\Jetpack\\Terms_Of_Service' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php', + 'Automattic\\Jetpack\\Tracking' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php', + 'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php', + 'Automattic\\Jetpack\\Transport_Helper\\V0001\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version-compat.php', + 'Automattic\\Jetpack\\Transport_Helper\\V0004\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Blocked_Login_Page' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Math_Authenticate' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-math-fallback.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Shared_Functions' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-shared-functions.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Transient_Cleanup' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php', + 'Automattic\\Jetpack\\Waf\\CLI' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php', + 'Automattic\\Jetpack\\Waf\\File_System_Exception' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php', + 'Automattic\\Jetpack\\Waf\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Rules_API_Exception' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-rules-api-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php', + 'Automattic\\Jetpack\\Waf\\Waf_Constants' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php', + 'Automattic\\Jetpack\\Waf\\Waf_Exception' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Initializer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php', + 'Automattic\\Jetpack\\Waf\\Waf_Operators' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php', + 'Automattic\\Jetpack\\Waf\\Waf_Request' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php', + 'Automattic\\Jetpack\\Waf\\Waf_Rules_Manager' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runner' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runtime' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php', + 'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php', + 'Automattic\\Jetpack\\Waf\\Waf_Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php', + 'Automattic\\Jetpack\\Waf\\Waf_Transforms' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Jetpack_IXR_Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php', + 'Jetpack_IXR_ClientMulticall' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php', + 'Jetpack_Options' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php', + 'Jetpack_Protect' => __DIR__ . '/../..' . '/src/class-jetpack-protect.php', + 'Jetpack_Signature' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php', + 'Jetpack_Tracks_Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php', + 'Jetpack_Tracks_Event' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php', + 'Jetpack_XMLRPC_Server' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ3_0_2::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ3_0_2::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ3_0_2::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.json new file mode 100644 index 00000000..f59c6c78 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.json @@ -0,0 +1,1824 @@ +{ + "packages": [ + { + "name": "automattic/jetpack-a8c-mc-stats", + "version": "v2.0.2", + "version_normalized": "2.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-a8c-mc-stats.git", + "reference": "5753860f28e1a8629b3c6ab481c1ab75e38a244f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-a8c-mc-stats/zipball/5753860f28e1a8629b3c6ab481c1ab75e38a244f", + "reference": "5753860f28e1a8629b3c6ab481c1ab75e38a244f", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-23T14:28:10+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-a8c-mc-stats", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Used to record internal usage stats for Automattic. Not visible to site owners.", + "support": { + "source": "https://github.com/Automattic/jetpack-a8c-mc-stats/tree/v2.0.2" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-a8c-mc-stats" + }, + { + "name": "automattic/jetpack-admin-ui", + "version": "v0.4.5", + "version_normalized": "0.4.5.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-admin-ui.git", + "reference": "7d5b8485ebe5984774375468ae52efe5c2849369" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-admin-ui/zipball/7d5b8485ebe5984774375468ae52efe5c2849369", + "reference": "7d5b8485ebe5984774375468ae52efe5c2849369", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-logo": "^2.0.4", + "automattic/wordbless": "dev-master", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T12:38:36+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-admin-ui", + "textdomain": "jetpack-admin-ui", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-admin-ui/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "0.4.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-admin-menu.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Generic Jetpack wp-admin UI elements", + "support": { + "source": "https://github.com/Automattic/jetpack-admin-ui/tree/v0.4.5" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-admin-ui" + }, + { + "name": "automattic/jetpack-assets", + "version": "v2.3.7", + "version_normalized": "2.3.7.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-assets.git", + "reference": "ace534dbeca02ead69d01bbdcc305319c902f4b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-assets/zipball/ace534dbeca02ead69d01bbdcc305319c902f4b6", + "reference": "ace534dbeca02ead69d01bbdcc305319c902f4b6", + "shasum": "" + }, + "require": { + "automattic/jetpack-constants": "^2.0.4", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "brain/monkey": "2.6.1", + "wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:25+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-assets", + "textdomain": "jetpack-assets", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-assets/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Asset management utilities for Jetpack ecosystem packages", + "support": { + "source": "https://github.com/Automattic/jetpack-assets/tree/v2.3.7" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-assets" + }, + { + "name": "automattic/jetpack-autoloader", + "version": "v3.1.0", + "version_normalized": "3.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-autoloader.git", + "reference": "0e36d60ad64e35b5dab7fa4757fadb2235d58f73" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/0e36d60ad64e35b5dab7fa4757fadb2235d58f73", + "reference": "0e36d60ad64e35b5dab7fa4757fadb2235d58f73", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "composer/composer": "^1.1 || ^2.0", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "time": "2024-09-06T15:32:10+00:00", + "type": "composer-plugin", + "extra": { + "autotagger": true, + "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin", + "mirror-repo": "Automattic/jetpack-autoloader", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}" + }, + "version-constants": { + "::VERSION": "src/AutoloadGenerator.php" + }, + "branch-alias": { + "dev-trunk": "3.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Automattic\\Jetpack\\Autoloader\\": "src" + }, + "classmap": [ + "src/AutoloadGenerator.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Creates a custom autoloader for a plugin or theme.", + "keywords": [ + "autoload", + "autoloader", + "composer", + "jetpack", + "plugin", + "wordpress" + ], + "support": { + "source": "https://github.com/Automattic/jetpack-autoloader/tree/v3.1.0" + }, + "install-path": "../automattic/jetpack-autoloader" + }, + { + "name": "automattic/jetpack-backup-helper-script-manager", + "version": "v0.2.7", + "version_normalized": "0.2.7.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-backup-helper-script-manager.git", + "reference": "8643c13843b9b7864c4541a49b8d8bead9bc4fd6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-backup-helper-script-manager/zipball/8643c13843b9b7864c4541a49b8d8bead9bc4fd6", + "reference": "8643c13843b9b7864c4541a49b8d8bead9bc4fd6", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-26T14:48:58+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-backup-helper-script-manager", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-backup-helper-script-manager/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Install / delete helper script for backup and transport server. Not visible to site owners.", + "support": { + "source": "https://github.com/Automattic/jetpack-backup-helper-script-manager/tree/v0.2.7" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-backup-helper-script-manager" + }, + { + "name": "automattic/jetpack-boost-core", + "version": "v0.2.11", + "version_normalized": "0.2.11.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-boost-core.git", + "reference": "bb00d7828aa695280e49db3af8b77e4548a40b40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-boost-core/zipball/bb00d7828aa695280e49db3af8b77e4548a40b40", + "reference": "bb00d7828aa695280e49db3af8b77e4548a40b40", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "dev-master", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:47+00:00", + "type": "jetpack-library", + "extra": { + "mirror-repo": "Automattic/jetpack-boost-core", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-boost-core/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "textdomain": "jetpack-boost-core" + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Core functionality for boost and relevant packages to depend on", + "support": { + "source": "https://github.com/Automattic/jetpack-boost-core/tree/v0.2.11" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-boost-core" + }, + { + "name": "automattic/jetpack-boost-speed-score", + "version": "v0.3.12", + "version_normalized": "0.3.12.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-boost-speed-score.git", + "reference": "362c3c0d3d779e757c48f7fecba65a107d9a0ab1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-boost-speed-score/zipball/362c3c0d3d779e757c48f7fecba65a107d9a0ab1", + "reference": "362c3c0d3d779e757c48f7fecba65a107d9a0ab1", + "shasum": "" + }, + "require": { + "automattic/jetpack-boost-core": "^0.2.9", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "brain/monkey": "^2.6", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-26T14:49:58+00:00", + "type": "jetpack-library", + "extra": { + "mirror-repo": "Automattic/jetpack-boost-speed-score", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-boost-speed-score/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.3.x-dev" + }, + "textdomain": "jetpack-boost-speed-score", + "version-constants": { + "::PACKAGE_VERSION": "src/class-speed-score.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A package that handles the API to generate the speed score.", + "support": { + "source": "https://github.com/Automattic/jetpack-boost-speed-score/tree/v0.3.12" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-boost-speed-score" + }, + { + "name": "automattic/jetpack-composer-plugin", + "version": "v2.0.3", + "version_normalized": "2.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-composer-plugin.git", + "reference": "67d11838aa00ef9922a8a3b439b1fa25adb1feef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-composer-plugin/zipball/67d11838aa00ef9922a8a3b439b1fa25adb1feef", + "reference": "67d11838aa00ef9922a8a3b439b1fa25adb1feef", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.1.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "composer/composer": "^2.2 || ^2.4", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "time": "2024-08-26T14:48:44+00:00", + "type": "composer-plugin", + "extra": { + "plugin-modifies-install-path": true, + "class": "Automattic\\Jetpack\\Composer\\Plugin", + "mirror-repo": "Automattic/jetpack-composer-plugin", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-composer-plugin/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A custom installer plugin for Composer to move Jetpack packages out of `vendor/` so WordPress's translation infrastructure will find their strings.", + "keywords": [ + "composer", + "i18n", + "jetpack", + "plugin" + ], + "support": { + "source": "https://github.com/Automattic/jetpack-composer-plugin/tree/v2.0.3" + }, + "install-path": "../automattic/jetpack-composer-plugin" + }, + { + "name": "automattic/jetpack-config", + "version": "v2.0.4", + "version_normalized": "2.0.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-config.git", + "reference": "9f075c81bae6fd638e0b3183612cda5cc9e01e06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-config/zipball/9f075c81bae6fd638e0b3183612cda5cc9e01e06", + "reference": "9f075c81bae6fd638e0b3183612cda5cc9e01e06", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.4", + "automattic/jetpack-connection": "@dev", + "automattic/jetpack-import": "@dev", + "automattic/jetpack-jitm": "@dev", + "automattic/jetpack-post-list": "@dev", + "automattic/jetpack-publicize": "@dev", + "automattic/jetpack-search": "@dev", + "automattic/jetpack-stats": "@dev", + "automattic/jetpack-stats-admin": "@dev", + "automattic/jetpack-sync": "@dev", + "automattic/jetpack-videopress": "@dev", + "automattic/jetpack-waf": "@dev", + "automattic/jetpack-wordads": "@dev", + "automattic/jetpack-yoast-promo": "@dev" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-06-24T19:22:07+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-config", + "textdomain": "jetpack-config", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-config/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + }, + "dependencies": { + "test-only": [ + "packages/connection", + "packages/import", + "packages/jitm", + "packages/post-list", + "packages/publicize", + "packages/search", + "packages/stats", + "packages/stats-admin", + "packages/sync", + "packages/videopress", + "packages/waf", + "packages/wordads", + "packages/yoast-promo" + ] + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Jetpack configuration package that initializes other packages and configures Jetpack's functionality. Can be used as a base for all variants of Jetpack package usage.", + "support": { + "source": "https://github.com/Automattic/jetpack-config/tree/v2.0.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-config" + }, + { + "name": "automattic/jetpack-connection", + "version": "v4.0.1", + "version_normalized": "4.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-connection.git", + "reference": "88597263fa2af184cfd4164de6d4e4ba95f05768" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-connection/zipball/88597263fa2af184cfd4164de6d4e4ba95f05768", + "reference": "88597263fa2af184cfd4164de6d4e4ba95f05768", + "shasum": "" + }, + "require": { + "automattic/jetpack-a8c-mc-stats": "^2.0.2", + "automattic/jetpack-admin-ui": "^0.4.5", + "automattic/jetpack-assets": "^2.3.7", + "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-redirect": "^2.0.4", + "automattic/jetpack-roles": "^2.0.3", + "automattic/jetpack-status": "^4.0.1", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-06T15:32:30+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-connection", + "textdomain": "jetpack-connection", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "4.0.x-dev" + }, + "dependencies": { + "test-only": [ + "packages/licensing", + "packages/sync" + ] + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "legacy", + "src/", + "src/webhooks", + "src/identity-crisis" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Everything needed to connect to the Jetpack infrastructure", + "support": { + "source": "https://github.com/Automattic/jetpack-connection/tree/v4.0.1" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-connection" + }, + { + "name": "automattic/jetpack-constants", + "version": "v2.0.4", + "version_normalized": "2.0.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-constants.git", + "reference": "f6958c313a34c5e92171c45a57d9dc978e5975ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/f6958c313a34c5e92171c45a57d9dc978e5975ed", + "reference": "f6958c313a34c5e92171c45a57d9dc978e5975ed", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-23T14:28:14+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-constants", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-constants/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A wrapper for defining constants in a more testable way.", + "support": { + "source": "https://github.com/Automattic/jetpack-constants/tree/v2.0.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-constants" + }, + { + "name": "automattic/jetpack-device-detection", + "version": "v2.1.4", + "version_normalized": "2.1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-device-detection.git", + "reference": "a59d71b55184bfd67a5b43f2df62c74ea6154b05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-device-detection/zipball/a59d71b55184bfd67a5b43f2df62c74ea6154b05", + "reference": "a59d71b55184bfd67a5b43f2df62c74ea6154b05", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-23T14:28:19+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-device-detection", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-device-detection/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A way to detect device types based on User-Agent header.", + "support": { + "source": "https://github.com/Automattic/jetpack-device-detection/tree/v2.1.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-device-detection" + }, + { + "name": "automattic/jetpack-explat", + "version": "v0.1.7", + "version_normalized": "0.1.7.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-explat.git", + "reference": "3a85d490843ab7e98f45753dd067b2dfce31a64b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-explat/zipball/3a85d490843ab7e98f45753dd067b2dfce31a64b", + "reference": "3a85d490843ab7e98f45753dd067b2dfce31a64b", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:58+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-explat/compare/v${old}...v${new}" + }, + "mirror-repo": "Automattic/jetpack-explat", + "textdomain": "jetpack-explat", + "version-constants": { + "::PACKAGE_VERSION": "src/class-explat.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A package for running A/B tests on the Experimentation Platform (ExPlat) in the plugin.", + "support": { + "source": "https://github.com/Automattic/jetpack-explat/tree/v0.1.7" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-explat" + }, + { + "name": "automattic/jetpack-ip", + "version": "v0.2.3", + "version_normalized": "0.2.3.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-ip.git", + "reference": "f7a42b1603a24775c6f20eef2ac5cba3d6b37194" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-ip/zipball/f7a42b1603a24775c6f20eef2ac5cba3d6b37194", + "reference": "f7a42b1603a24775c6f20eef2ac5cba3d6b37194", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-23T14:28:05+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-ip", + "changelogger": { + "link-template": "https://github.com/automattic/jetpack-ip/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "textdomain": "jetpack-ip", + "version-constants": { + "::PACKAGE_VERSION": "src/class-utils.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Utilities for working with IP addresses.", + "support": { + "source": "https://github.com/Automattic/jetpack-ip/tree/v0.2.3" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-ip" + }, + { + "name": "automattic/jetpack-jitm", + "version": "v3.1.21", + "version_normalized": "3.1.21.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-jitm.git", + "reference": "5cf53d23d21b8b5d05c74c20b6d70a7a57c5f15f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-jitm/zipball/5cf53d23d21b8b5d05c74c20b6d70a7a57c5f15f", + "reference": "5cf53d23d21b8b5d05c74c20b6d70a7a57c5f15f", + "shasum": "" + }, + "require": { + "automattic/jetpack-a8c-mc-stats": "^2.0.2", + "automattic/jetpack-assets": "^2.3.7", + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-device-detection": "^2.1.4", + "automattic/jetpack-logo": "^2.0.4", + "automattic/jetpack-redirect": "^2.0.4", + "automattic/jetpack-status": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:35:03+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-jitm", + "textdomain": "jetpack-jitm", + "version-constants": { + "::PACKAGE_VERSION": "src/class-jitm.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-jitm/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "3.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Just in time messages for Jetpack", + "support": { + "source": "https://github.com/Automattic/jetpack-jitm/tree/v3.1.21" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-jitm" + }, + { + "name": "automattic/jetpack-licensing", + "version": "v2.0.9", + "version_normalized": "2.0.9.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-licensing.git", + "reference": "6783c5958fe0f8d81bb098485d5422ed87065c51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-licensing/zipball/6783c5958fe0f8d81bb098485d5422ed87065c51", + "reference": "6783c5958fe0f8d81bb098485d5422ed87065c51", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:46+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-licensing", + "textdomain": "jetpack-licensing", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-licensing/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Everything needed to manage Jetpack licenses client-side.", + "support": { + "source": "https://github.com/Automattic/jetpack-licensing/tree/v2.0.9" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-licensing" + }, + { + "name": "automattic/jetpack-logo", + "version": "v2.0.4", + "version_normalized": "2.0.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-logo.git", + "reference": "6047525955b12ac8654ac4544e0b79deaed31fa2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-logo/zipball/6047525955b12ac8654ac4544e0b79deaed31fa2", + "reference": "6047525955b12ac8654ac4544e0b79deaed31fa2", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-23T14:28:12+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-logo", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-logo/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A logo for Jetpack", + "support": { + "source": "https://github.com/Automattic/jetpack-logo/tree/v2.0.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-logo" + }, + { + "name": "automattic/jetpack-my-jetpack", + "version": "v4.35.3", + "version_normalized": "4.35.3.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-my-jetpack.git", + "reference": "1424bd0fce9b059c41397cd3da9679407b00d3da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-my-jetpack/zipball/1424bd0fce9b059c41397cd3da9679407b00d3da", + "reference": "1424bd0fce9b059c41397cd3da9679407b00d3da", + "shasum": "" + }, + "require": { + "automattic/jetpack-admin-ui": "^0.4.5", + "automattic/jetpack-assets": "^2.3.7", + "automattic/jetpack-boost-speed-score": "^0.3.12", + "automattic/jetpack-connection": "^4.0.1", + "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-explat": "^0.1.7", + "automattic/jetpack-jitm": "^3.1.21", + "automattic/jetpack-licensing": "^2.0.9", + "automattic/jetpack-plans": "^0.4.10", + "automattic/jetpack-plugins-installer": "^0.4.3", + "automattic/jetpack-protect-status": "^0.1.5", + "automattic/jetpack-redirect": "^2.0.4", + "automattic/jetpack-status": "^4.0.1", + "automattic/jetpack-sync": "^3.10.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-06T15:32:54+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-my-jetpack", + "textdomain": "jetpack-my-jetpack", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "4.35.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-initializer.php" + }, + "dependencies": { + "test-only": [ + "packages/search", + "packages/videopress" + ] + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/", + "src/products" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", + "support": { + "source": "https://github.com/Automattic/jetpack-my-jetpack/tree/v4.35.3" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-my-jetpack" + }, + { + "name": "automattic/jetpack-password-checker", + "version": "v0.3.2", + "version_normalized": "0.3.2.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-password-checker.git", + "reference": "bdf70591123932112e447e295d7f174b5c0e3a44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-password-checker/zipball/bdf70591123932112e447e295d7f174b5c0e3a44", + "reference": "bdf70591123932112e447e295d7f174b5c0e3a44", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-23T14:28:17+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-password-checker", + "textdomain": "jetpack-password-checker", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-password-checker/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Password Checker.", + "support": { + "source": "https://github.com/Automattic/jetpack-password-checker/tree/v0.3.2" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-password-checker" + }, + { + "name": "automattic/jetpack-plans", + "version": "v0.4.10", + "version_normalized": "0.4.10.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-plans.git", + "reference": "4611e943c7851eade1b57f6f557325d675c5edef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-plans/zipball/4611e943c7851eade1b57f6f557325d675c5edef", + "reference": "4611e943c7851eade1b57f6f557325d675c5edef", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-status": "^4.0.0", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:44+00:00", + "type": "library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-plans", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plans/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Fetch information about Jetpack Plans from wpcom", + "support": { + "source": "https://github.com/Automattic/jetpack-plans/tree/v0.4.10" + }, + "install-path": "../automattic/jetpack-plans" + }, + { + "name": "automattic/jetpack-plugins-installer", + "version": "v0.4.3", + "version_normalized": "0.4.3.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-plugins-installer.git", + "reference": "53599f17ca0def355edbab886cdf765713a8809a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-plugins-installer/zipball/53599f17ca0def355edbab886cdf765713a8809a", + "reference": "53599f17ca0def355edbab886cdf765713a8809a", + "shasum": "" + }, + "require": { + "automattic/jetpack-a8c-mc-stats": "^2.0.2", + "automattic/jetpack-status": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:11+00:00", + "type": "jetpack-library", + "extra": { + "branch-alias": { + "dev-trunk": "0.4.x-dev" + }, + "mirror-repo": "Automattic/jetpack-plugins-installer", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plugins-installer/compare/v${old}...v${new}" + }, + "autotagger": true, + "textdomain": "jetpack-plugins-installer" + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Handle installation of plugins from WP.org", + "support": { + "source": "https://github.com/Automattic/jetpack-plugins-installer/tree/v0.4.3" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-plugins-installer" + }, + { + "name": "automattic/jetpack-protect-models", + "version": "v0.2.1", + "version_normalized": "0.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-protect-models.git", + "reference": "d76966670cffb49fda782c72182238f2e07ad962" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-protect-models/zipball/d76966670cffb49fda782c72182238f2e07ad962", + "reference": "d76966670cffb49fda782c72182238f2e07ad962", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "0.4.2", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-26T14:48:59+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-protect-models/compare/v${old}...v${new}" + }, + "mirror-repo": "Automattic/jetpack-protect-models", + "textdomain": "jetpack-protect-models", + "version-constants": { + "::PACKAGE_VERSION": "src/class-protect-models.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "This package contains the models used in Protect. ", + "support": { + "source": "https://github.com/Automattic/jetpack-protect-models/tree/v0.2.1" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-protect-models" + }, + { + "name": "automattic/jetpack-protect-status", + "version": "v0.1.5", + "version_normalized": "0.1.5.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-protect-status.git", + "reference": "2fc75b06dd4ddc7c4a7ce0441041d7457561d179" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-protect-status/zipball/2fc75b06dd4ddc7c4a7ce0441041d7457561d179", + "reference": "2fc75b06dd4ddc7c4a7ce0441041d7457561d179", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-plans": "^0.4.10", + "automattic/jetpack-plugins-installer": "^0.4.3", + "automattic/jetpack-protect-models": "^0.2.1", + "automattic/jetpack-sync": "^3.10.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "dev-master", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:51+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-protect-status/compare/v${old}...v${new}" + }, + "mirror-repo": "Automattic/jetpack-protect-status", + "textdomain": "jetpack-protect-status", + "version-constants": { + "::PACKAGE_VERSION": "src/class-status.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "This package contains the Protect Status API functionality to retrieve a site's scan status (WordPress, Themes, and Plugins threats).", + "support": { + "source": "https://github.com/Automattic/jetpack-protect-status/tree/v0.1.5" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-protect-status" + }, + { + "name": "automattic/jetpack-redirect", + "version": "v2.0.4", + "version_normalized": "2.0.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-redirect.git", + "reference": "72457f3899c772529d26e83a44d6ffd6758a71fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-redirect/zipball/72457f3899c772529d26e83a44d6ffd6758a71fd", + "reference": "72457f3899c772529d26e83a44d6ffd6758a71fd", + "shasum": "" + }, + "require": { + "automattic/jetpack-status": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:13+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-redirect", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-redirect/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Utilities to build URLs to the jetpack.com/redirect/ service", + "support": { + "source": "https://github.com/Automattic/jetpack-redirect/tree/v2.0.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-redirect" + }, + { + "name": "automattic/jetpack-roles", + "version": "v2.0.3", + "version_normalized": "2.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-roles.git", + "reference": "32e45299a6ff93de0b1f4c71e6669f15917220fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-roles/zipball/32e45299a6ff93de0b1f4c71e6669f15917220fb", + "reference": "32e45299a6ff93de0b1f4c71e6669f15917220fb", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-08-23T14:28:15+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-roles", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-roles/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Utilities, related with user roles and capabilities.", + "support": { + "source": "https://github.com/Automattic/jetpack-roles/tree/v2.0.3" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-roles" + }, + { + "name": "automattic/jetpack-status", + "version": "v4.0.1", + "version_normalized": "4.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-status.git", + "reference": "7175788be67f91a7e26d0d216afd81372ace0027" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-status/zipball/7175788be67f91a7e26d0d216afd81372ace0027", + "reference": "7175788be67f91a7e26d0d216afd81372ace0027", + "shasum": "" + }, + "require": { + "automattic/jetpack-constants": "^2.0.4", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-connection": "@dev", + "automattic/jetpack-ip": "^0.2.3", + "automattic/jetpack-plans": "@dev", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-06T15:32:09+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-status", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "4.0.x-dev" + }, + "dependencies": { + "test-only": [ + "packages/connection", + "packages/plans" + ] + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Used to retrieve information about the current status of Jetpack and the site overall.", + "support": { + "source": "https://github.com/Automattic/jetpack-status/tree/v4.0.1" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-status" + }, + { + "name": "automattic/jetpack-sync", + "version": "v3.10.0", + "version_normalized": "3.10.0.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-sync.git", + "reference": "44c699a3343bccf26cbfe7942355339cd5de678b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-sync/zipball/44c699a3343bccf26cbfe7942355339cd5de678b", + "reference": "44c699a3343bccf26cbfe7942355339cd5de678b", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-ip": "^0.2.3", + "automattic/jetpack-password-checker": "^0.3.2", + "automattic/jetpack-roles": "^2.0.3", + "automattic/jetpack-status": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-search": "@dev", + "automattic/jetpack-waf": "@dev", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-05T19:34:48+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-sync", + "textdomain": "jetpack-sync", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-sync/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "3.10.x-dev" + }, + "dependencies": { + "test-only": [ + "packages/search", + "packages/waf" + ] + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Everything needed to allow syncing to the WP.com infrastructure.", + "support": { + "source": "https://github.com/Automattic/jetpack-sync/tree/v3.10.0" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-sync" + }, + { + "name": "automattic/jetpack-transport-helper", + "version": "v0.2.4", + "version_normalized": "0.2.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-transport-helper.git", + "reference": "2792d86e1f19466a6597318e8d812d1793751671" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-transport-helper/zipball/2792d86e1f19466a6597318e8d812d1793751671", + "reference": "2792d86e1f19466a6597318e8d812d1793751671", + "shasum": "" + }, + "require": { + "automattic/jetpack-backup-helper-script-manager": "^0.2.7", + "automattic/jetpack-connection": "^4.0.0", + "php": ">=7.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "dev-master", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-06T04:39:59+00:00", + "type": "jetpack-library", + "extra": { + "mirror-repo": "Automattic/jetpack-transport-helper", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-transport-helper/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "textdomain": "jetpack-transport-helper" + }, + "installation-source": "dist", + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Package to help transport server communication", + "support": { + "source": "https://github.com/Automattic/jetpack-transport-helper/tree/v0.2.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-transport-helper" + }, + { + "name": "automattic/jetpack-waf", + "version": "v0.18.5", + "version_normalized": "0.18.5.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-waf.git", + "reference": "5e7a9db1e6afe65fc6f56ceaaf54563815e25e1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-waf/zipball/5e7a9db1e6afe65fc6f56ceaaf54563815e25e1c", + "reference": "5e7a9db1e6afe65fc6f56ceaaf54563815e25e1c", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^4.0.0", + "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-ip": "^0.2.3", + "automattic/jetpack-status": "^4.0.0", + "php": ">=7.0", + "wikimedia/aho-corasick": "^1.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^4.2.6", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "^1.1.1" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2024-09-06T04:40:02+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-waf", + "textdomain": "jetpack-waf", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-waf/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.18.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "cli.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Tools to assist with the Jetpack Web Application Firewall", + "support": { + "source": "https://github.com/Automattic/jetpack-waf/tree/v0.18.5" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-waf" + }, + { + "name": "wikimedia/aho-corasick", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/AhoCorasick.git", + "reference": "2f3a1bd765913637a66eade658d11d82f0e551be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/AhoCorasick/zipball/2f3a1bd765913637a66eade658d11d82f0e551be", + "reference": "2f3a1bd765913637a66eade658d11d82f0e551be", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "jakub-onderka/php-console-highlighter": "0.3.2", + "jakub-onderka/php-parallel-lint": "1.0.0", + "mediawiki/mediawiki-codesniffer": "18.0.0", + "mediawiki/minus-x": "0.3.1", + "phpunit/phpunit": "4.8.36 || ^6.5" + }, + "time": "2018-05-01T18:13:32+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ori Livneh", + "email": "ori@wikimedia.org" + } + ], + "description": "An implementation of the Aho-Corasick string matching algorithm.", + "homepage": "https://gerrit.wikimedia.org/g/AhoCorasick", + "keywords": [ + "ahocorasick", + "matcher" + ], + "support": { + "source": "https://github.com/wikimedia/AhoCorasick/tree/v1.0.1" + }, + "install-path": "../wikimedia/aho-corasick" + } + ], + "dev": false, + "dev-package-names": [] +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.php new file mode 100644 index 00000000..0d6bf5ed --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.php @@ -0,0 +1,293 @@ + array( + 'name' => 'automattic/jetpack-protect', + 'pretty_version' => 'dev-trunk', + 'version' => 'dev-trunk', + 'reference' => null, + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => false, + ), + 'versions' => array( + 'automattic/jetpack-a8c-mc-stats' => array( + 'pretty_version' => 'v2.0.2', + 'version' => '2.0.2.0', + 'reference' => '5753860f28e1a8629b3c6ab481c1ab75e38a244f', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-a8c-mc-stats', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-admin-ui' => array( + 'pretty_version' => 'v0.4.5', + 'version' => '0.4.5.0', + 'reference' => '7d5b8485ebe5984774375468ae52efe5c2849369', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-admin-ui', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-assets' => array( + 'pretty_version' => 'v2.3.7', + 'version' => '2.3.7.0', + 'reference' => 'ace534dbeca02ead69d01bbdcc305319c902f4b6', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-assets', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-autoloader' => array( + 'pretty_version' => 'v3.1.0', + 'version' => '3.1.0.0', + 'reference' => '0e36d60ad64e35b5dab7fa4757fadb2235d58f73', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../automattic/jetpack-autoloader', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-backup-helper-script-manager' => array( + 'pretty_version' => 'v0.2.7', + 'version' => '0.2.7.0', + 'reference' => '8643c13843b9b7864c4541a49b8d8bead9bc4fd6', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-backup-helper-script-manager', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-boost-core' => array( + 'pretty_version' => 'v0.2.11', + 'version' => '0.2.11.0', + 'reference' => 'bb00d7828aa695280e49db3af8b77e4548a40b40', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-boost-core', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-boost-speed-score' => array( + 'pretty_version' => 'v0.3.12', + 'version' => '0.3.12.0', + 'reference' => '362c3c0d3d779e757c48f7fecba65a107d9a0ab1', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-boost-speed-score', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-composer-plugin' => array( + 'pretty_version' => 'v2.0.3', + 'version' => '2.0.3.0', + 'reference' => '67d11838aa00ef9922a8a3b439b1fa25adb1feef', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../automattic/jetpack-composer-plugin', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-config' => array( + 'pretty_version' => 'v2.0.4', + 'version' => '2.0.4.0', + 'reference' => '9f075c81bae6fd638e0b3183612cda5cc9e01e06', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-config', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-connection' => array( + 'pretty_version' => 'v4.0.1', + 'version' => '4.0.1.0', + 'reference' => '88597263fa2af184cfd4164de6d4e4ba95f05768', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-connection', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-constants' => array( + 'pretty_version' => 'v2.0.4', + 'version' => '2.0.4.0', + 'reference' => 'f6958c313a34c5e92171c45a57d9dc978e5975ed', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-constants', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-device-detection' => array( + 'pretty_version' => 'v2.1.4', + 'version' => '2.1.4.0', + 'reference' => 'a59d71b55184bfd67a5b43f2df62c74ea6154b05', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-device-detection', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-explat' => array( + 'pretty_version' => 'v0.1.7', + 'version' => '0.1.7.0', + 'reference' => '3a85d490843ab7e98f45753dd067b2dfce31a64b', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-explat', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-ip' => array( + 'pretty_version' => 'v0.2.3', + 'version' => '0.2.3.0', + 'reference' => 'f7a42b1603a24775c6f20eef2ac5cba3d6b37194', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-ip', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-jitm' => array( + 'pretty_version' => 'v3.1.21', + 'version' => '3.1.21.0', + 'reference' => '5cf53d23d21b8b5d05c74c20b6d70a7a57c5f15f', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-jitm', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-licensing' => array( + 'pretty_version' => 'v2.0.9', + 'version' => '2.0.9.0', + 'reference' => '6783c5958fe0f8d81bb098485d5422ed87065c51', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-licensing', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-logo' => array( + 'pretty_version' => 'v2.0.4', + 'version' => '2.0.4.0', + 'reference' => '6047525955b12ac8654ac4544e0b79deaed31fa2', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-logo', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-my-jetpack' => array( + 'pretty_version' => 'v4.35.3', + 'version' => '4.35.3.0', + 'reference' => '1424bd0fce9b059c41397cd3da9679407b00d3da', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-my-jetpack', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-password-checker' => array( + 'pretty_version' => 'v0.3.2', + 'version' => '0.3.2.0', + 'reference' => 'bdf70591123932112e447e295d7f174b5c0e3a44', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-password-checker', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-plans' => array( + 'pretty_version' => 'v0.4.10', + 'version' => '0.4.10.0', + 'reference' => '4611e943c7851eade1b57f6f557325d675c5edef', + 'type' => 'library', + 'install_path' => __DIR__ . '/../automattic/jetpack-plans', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-plugins-installer' => array( + 'pretty_version' => 'v0.4.3', + 'version' => '0.4.3.0', + 'reference' => '53599f17ca0def355edbab886cdf765713a8809a', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-plugins-installer', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-protect' => array( + 'pretty_version' => 'dev-trunk', + 'version' => 'dev-trunk', + 'reference' => null, + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-protect-models' => array( + 'pretty_version' => 'v0.2.1', + 'version' => '0.2.1.0', + 'reference' => 'd76966670cffb49fda782c72182238f2e07ad962', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-protect-models', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-protect-status' => array( + 'pretty_version' => 'v0.1.5', + 'version' => '0.1.5.0', + 'reference' => '2fc75b06dd4ddc7c4a7ce0441041d7457561d179', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-protect-status', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-redirect' => array( + 'pretty_version' => 'v2.0.4', + 'version' => '2.0.4.0', + 'reference' => '72457f3899c772529d26e83a44d6ffd6758a71fd', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-redirect', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-roles' => array( + 'pretty_version' => 'v2.0.3', + 'version' => '2.0.3.0', + 'reference' => '32e45299a6ff93de0b1f4c71e6669f15917220fb', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-roles', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-status' => array( + 'pretty_version' => 'v4.0.1', + 'version' => '4.0.1.0', + 'reference' => '7175788be67f91a7e26d0d216afd81372ace0027', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-status', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-sync' => array( + 'pretty_version' => 'v3.10.0', + 'version' => '3.10.0.0', + 'reference' => '44c699a3343bccf26cbfe7942355339cd5de678b', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-sync', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-transport-helper' => array( + 'pretty_version' => 'v0.2.4', + 'version' => '0.2.4.0', + 'reference' => '2792d86e1f19466a6597318e8d812d1793751671', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-transport-helper', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-waf' => array( + 'pretty_version' => 'v0.18.5', + 'version' => '0.18.5.0', + 'reference' => '5e7a9db1e6afe65fc6f56ceaaf54563815e25e1c', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-waf', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wikimedia/aho-corasick' => array( + 'pretty_version' => 'v1.0.1', + 'version' => '1.0.1.0', + 'reference' => '2f3a1bd765913637a66eade658d11d82f0e551be', + 'type' => 'library', + 'install_path' => __DIR__ . '/../wikimedia/aho-corasick', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_classmap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_classmap.php new file mode 100644 index 00000000..bfb0d783 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_classmap.php @@ -0,0 +1,997 @@ + array( + 'version' => '1.0.1.0', + 'path' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringMatcher.php' + ), + 'AhoCorasick\\MultiStringReplacer' => array( + 'version' => '1.0.1.0', + 'path' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringReplacer.php' + ), + 'Autoloader' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader.php' + ), + 'Autoloader_Handler' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-handler.php' + ), + 'Autoloader_Locator' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-locator.php' + ), + 'Automattic\\Jetpack\\A8c_Mc_Stats' => array( + 'version' => '2.0.2.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php' + ), + 'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => array( + 'version' => '0.4.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php' + ), + 'Automattic\\Jetpack\\Assets' => array( + 'version' => '2.3.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php' + ), + 'Automattic\\Jetpack\\Assets\\Logo' => array( + 'version' => '2.0.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php' + ), + 'Automattic\\Jetpack\\Assets\\Script_Data' => array( + 'version' => '2.3.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-script-data.php' + ), + 'Automattic\\Jetpack\\Assets\\Semver' => array( + 'version' => '2.3.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php' + ), + 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php' + ), + 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php' + ), + 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php' + ), + 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php' + ), + 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php' + ), + 'Automattic\\Jetpack\\Automatic_Install_Skin' => array( + 'version' => '0.4.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php' + ), + 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager' => array( + 'version' => '0.2.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-helper-script-manager.php' + ), + 'Automattic\\Jetpack\\Backup\\V0004\\Helper_Script_Manager_Impl' => array( + 'version' => '0.2.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-helper-script-manager-impl.php' + ), + 'Automattic\\Jetpack\\Backup\\V0004\\Throw_On_Errors' => array( + 'version' => '0.2.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-backup-helper-script-manager/src/class-throw-on-errors.php' + ), + 'Automattic\\Jetpack\\Boost_Core\\Contracts\\Boost_API_Client' => array( + 'version' => '0.2.11.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/contracts/boost-api-client.php' + ), + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Boost_API' => array( + 'version' => '0.2.11.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-boost-api.php' + ), + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Cacheable' => array( + 'version' => '0.2.11.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-cacheable.php' + ), + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Transient' => array( + 'version' => '0.2.11.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-transient.php' + ), + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Url' => array( + 'version' => '0.2.11.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-url.php' + ), + 'Automattic\\Jetpack\\Boost_Core\\Lib\\Utils' => array( + 'version' => '0.2.11.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-utils.php' + ), + 'Automattic\\Jetpack\\Boost_Core\\Lib\\WPCOM_Boost_API_Client' => array( + 'version' => '0.2.11.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-wpcom-boost-api-client.php' + ), + 'Automattic\\Jetpack\\Boost_Speed_Score\\Jetpack_Boost_Modules' => array( + 'version' => '0.3.12.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-jetpack-boost-modules.php' + ), + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score' => array( + 'version' => '0.3.12.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score.php' + ), + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_Graph_History_Request' => array( + 'version' => '0.3.12.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-graph-history-request.php' + ), + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_History' => array( + 'version' => '0.3.12.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-history.php' + ), + 'Automattic\\Jetpack\\Boost_Speed_Score\\Speed_Score_Request' => array( + 'version' => '0.3.12.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-request.php' + ), + 'Automattic\\Jetpack\\Composer\\Manager' => array( + 'version' => '2.0.3.0', + 'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-manager.php' + ), + 'Automattic\\Jetpack\\Composer\\Plugin' => array( + 'version' => '2.0.3.0', + 'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-plugin.php' + ), + 'Automattic\\Jetpack\\Config' => array( + 'version' => '2.0.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php' + ), + 'Automattic\\Jetpack\\Connection\\Authorize_Json_Api' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-authorize-json-api.php' + ), + 'Automattic\\Jetpack\\Connection\\Client' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php' + ), + 'Automattic\\Jetpack\\Connection\\Connection_Assets' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-assets.php' + ), + 'Automattic\\Jetpack\\Connection\\Connection_Notice' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php' + ), + 'Automattic\\Jetpack\\Connection\\Error_Handler' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php' + ), + 'Automattic\\Jetpack\\Connection\\Initial_State' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php' + ), + 'Automattic\\Jetpack\\Connection\\Manager' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php' + ), + 'Automattic\\Jetpack\\Connection\\Manager_Interface' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php' + ), + 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php' + ), + 'Automattic\\Jetpack\\Connection\\Package_Version' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php' + ), + 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php' + ), + 'Automattic\\Jetpack\\Connection\\Plugin' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php' + ), + 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php' + ), + 'Automattic\\Jetpack\\Connection\\REST_Connector' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php' + ), + 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php' + ), + 'Automattic\\Jetpack\\Connection\\SSO' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php' + ), + 'Automattic\\Jetpack\\Connection\\SSO\\Force_2FA' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-force-2fa.php' + ), + 'Automattic\\Jetpack\\Connection\\SSO\\Helpers' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php' + ), + 'Automattic\\Jetpack\\Connection\\SSO\\Notices' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php' + ), + 'Automattic\\Jetpack\\Connection\\SSO\\User_Admin' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php' + ), + 'Automattic\\Jetpack\\Connection\\Secrets' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php' + ), + 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php' + ), + 'Automattic\\Jetpack\\Connection\\Tokens' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php' + ), + 'Automattic\\Jetpack\\Connection\\Tokens_Locks' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php' + ), + 'Automattic\\Jetpack\\Connection\\Urls' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php' + ), + 'Automattic\\Jetpack\\Connection\\Utils' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php' + ), + 'Automattic\\Jetpack\\Connection\\Webhooks' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php' + ), + 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php' + ), + 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php' + ), + 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php' + ), + 'Automattic\\Jetpack\\Constants' => array( + 'version' => '2.0.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php' + ), + 'Automattic\\Jetpack\\CookieState' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php' + ), + 'Automattic\\Jetpack\\Current_Plan' => array( + 'version' => '0.4.10.0', + 'path' => $vendorDir . '/automattic/jetpack-plans/src/class-current-plan.php' + ), + 'Automattic\\Jetpack\\Device_Detection' => array( + 'version' => '2.1.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php' + ), + 'Automattic\\Jetpack\\Device_Detection\\User_Agent_Info' => array( + 'version' => '2.1.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php' + ), + 'Automattic\\Jetpack\\Errors' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php' + ), + 'Automattic\\Jetpack\\ExPlat' => array( + 'version' => '0.1.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-explat/src/class-explat.php' + ), + 'Automattic\\Jetpack\\ExPlat\\REST_Controller' => array( + 'version' => '0.1.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-explat/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Files' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php' + ), + 'Automattic\\Jetpack\\Heartbeat' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php' + ), + 'Automattic\\Jetpack\\IP\\Utils' => array( + 'version' => '0.2.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php' + ), + 'Automattic\\Jetpack\\IdentityCrisis\\Exception' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-exception.php' + ), + 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-rest-endpoints.php' + ), + 'Automattic\\Jetpack\\IdentityCrisis\\UI' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-ui.php' + ), + 'Automattic\\Jetpack\\IdentityCrisis\\URL_Secret' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-url-secret.php' + ), + 'Automattic\\Jetpack\\Identity_Crisis' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/identity-crisis/class-identity-crisis.php' + ), + 'Automattic\\Jetpack\\JITMS\\JITM' => array( + 'version' => '3.1.21.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php' + ), + 'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => array( + 'version' => '3.1.21.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php' + ), + 'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => array( + 'version' => '3.1.21.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php' + ), + 'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => array( + 'version' => '3.1.21.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php' + ), + 'Automattic\\Jetpack\\Licensing' => array( + 'version' => '2.0.9.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php' + ), + 'Automattic\\Jetpack\\Licensing\\Endpoints' => array( + 'version' => '2.0.9.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php' + ), + 'Automattic\\Jetpack\\Modules' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Activitylog' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Initializer' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Jetpack_Manage' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Product' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Creator' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Jetpack_Ai' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Starter' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Stats' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_AI' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_Product_Data' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_Recommendations_Evaluation' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-recommendations-evaluation.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_Zendesk_Chat' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => array( + 'version' => '4.35.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php' + ), + 'Automattic\\Jetpack\\Partner' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php' + ), + 'Automattic\\Jetpack\\Partner_Coupon' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner-coupon.php' + ), + 'Automattic\\Jetpack\\Password_Checker' => array( + 'version' => '0.3.2.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php' + ), + 'Automattic\\Jetpack\\Paths' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php' + ), + 'Automattic\\Jetpack\\Plans' => array( + 'version' => '0.4.10.0', + 'path' => $vendorDir . '/automattic/jetpack-plans/src/class-plans.php' + ), + 'Automattic\\Jetpack\\Plugins_Installer' => array( + 'version' => '0.4.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php' + ), + 'Automattic\\Jetpack\\Protect\\Credentials' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-credentials.php' + ), + 'Automattic\\Jetpack\\Protect\\Onboarding' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-onboarding.php' + ), + 'Automattic\\Jetpack\\Protect\\REST_Controller' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Protect\\Scan_History' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-scan-history.php' + ), + 'Automattic\\Jetpack\\Protect\\Site_Health' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-site-health.php' + ), + 'Automattic\\Jetpack\\Protect\\Threats' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-threats.php' + ), + 'Automattic\\Jetpack\\Protect_Models' => array( + 'version' => '0.2.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-protect-models.php' + ), + 'Automattic\\Jetpack\\Protect_Models\\Extension_Model' => array( + 'version' => '0.2.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-extension-model.php' + ), + 'Automattic\\Jetpack\\Protect_Models\\History_Model' => array( + 'version' => '0.2.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-history-model.php' + ), + 'Automattic\\Jetpack\\Protect_Models\\Status_Model' => array( + 'version' => '0.2.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-status-model.php' + ), + 'Automattic\\Jetpack\\Protect_Models\\Threat_Model' => array( + 'version' => '0.2.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-models/src/class-threat-model.php' + ), + 'Automattic\\Jetpack\\Protect_Status\\Plan' => array( + 'version' => '0.1.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-plan.php' + ), + 'Automattic\\Jetpack\\Protect_Status\\Protect_Status' => array( + 'version' => '0.1.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-protect-status.php' + ), + 'Automattic\\Jetpack\\Protect_Status\\REST_Controller' => array( + 'version' => '0.1.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Protect_Status\\Scan_Status' => array( + 'version' => '0.1.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-scan-status.php' + ), + 'Automattic\\Jetpack\\Protect_Status\\Status' => array( + 'version' => '0.1.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-protect-status/src/class-status.php' + ), + 'Automattic\\Jetpack\\Redirect' => array( + 'version' => '2.0.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php' + ), + 'Automattic\\Jetpack\\Roles' => array( + 'version' => '2.0.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php' + ), + 'Automattic\\Jetpack\\Status' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php' + ), + 'Automattic\\Jetpack\\Status\\Cache' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php' + ), + 'Automattic\\Jetpack\\Status\\Host' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php' + ), + 'Automattic\\Jetpack\\Status\\Visitor' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php' + ), + 'Automattic\\Jetpack\\Sync\\Actions' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php' + ), + 'Automattic\\Jetpack\\Sync\\Codec_Interface' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php' + ), + 'Automattic\\Jetpack\\Sync\\Data_Settings' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php' + ), + 'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php' + ), + 'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php' + ), + 'Automattic\\Jetpack\\Sync\\Defaults' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php' + ), + 'Automattic\\Jetpack\\Sync\\Functions' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php' + ), + 'Automattic\\Jetpack\\Sync\\Health' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php' + ), + 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php' + ), + 'Automattic\\Jetpack\\Sync\\Listener' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php' + ), + 'Automattic\\Jetpack\\Sync\\Lock' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php' + ), + 'Automattic\\Jetpack\\Sync\\Main' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Menus' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Meta' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Module' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Protect' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Search' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Stats' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Terms' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Themes' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Updates' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce_HPOS_Orders' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php' + ), + 'Automattic\\Jetpack\\Sync\\Package_Version' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php' + ), + 'Automattic\\Jetpack\\Sync\\Queue' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php' + ), + 'Automattic\\Jetpack\\Sync\\Queue\\Queue_Storage_Options' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-options.php' + ), + 'Automattic\\Jetpack\\Sync\\Queue\\Queue_Storage_Table' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php' + ), + 'Automattic\\Jetpack\\Sync\\Queue_Buffer' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php' + ), + 'Automattic\\Jetpack\\Sync\\REST_Endpoints' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php' + ), + 'Automattic\\Jetpack\\Sync\\REST_Sender' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php' + ), + 'Automattic\\Jetpack\\Sync\\Sender' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php' + ), + 'Automattic\\Jetpack\\Sync\\Server' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php' + ), + 'Automattic\\Jetpack\\Sync\\Settings' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php' + ), + 'Automattic\\Jetpack\\Sync\\Simple_Codec' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php' + ), + 'Automattic\\Jetpack\\Sync\\Users' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php' + ), + 'Automattic\\Jetpack\\Sync\\Utils' => array( + 'version' => '3.10.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php' + ), + 'Automattic\\Jetpack\\Terms_Of_Service' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php' + ), + 'Automattic\\Jetpack\\Tracking' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php' + ), + 'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => array( + 'version' => '0.2.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php' + ), + 'Automattic\\Jetpack\\Transport_Helper\\V0001\\Package_Version' => array( + 'version' => '0.2.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version-compat.php' + ), + 'Automattic\\Jetpack\\Transport_Helper\\V0004\\REST_Controller' => array( + 'version' => '0.2.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Blocked_Login_Page' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Math_Authenticate' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-math-fallback.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Shared_Functions' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-shared-functions.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Transient_Cleanup' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php' + ), + 'Automattic\\Jetpack\\Waf\\CLI' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php' + ), + 'Automattic\\Jetpack\\Waf\\File_System_Exception' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php' + ), + 'Automattic\\Jetpack\\Waf\\REST_Controller' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Waf\\Rules_API_Exception' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-rules-api-exception.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Constants' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Exception' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Initializer' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Operators' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Request' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Rules_Manager' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Runner' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Runtime' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Stats' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Transforms' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php' + ), + 'Container' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-container.php' + ), + 'Hook_Manager' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-hook-manager.php' + ), + 'Jetpack_IXR_Client' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php' + ), + 'Jetpack_IXR_ClientMulticall' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php' + ), + 'Jetpack_Options' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php' + ), + 'Jetpack_Protect' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-jetpack-protect.php' + ), + 'Jetpack_Signature' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php' + ), + 'Jetpack_Tracks_Client' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php' + ), + 'Jetpack_Tracks_Event' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php' + ), + 'Jetpack_XMLRPC_Server' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php' + ), + 'Latest_Autoloader_Guard' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php' + ), + 'Manifest_Reader' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-manifest-reader.php' + ), + 'PHP_Autoloader' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-php-autoloader.php' + ), + 'Path_Processor' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-path-processor.php' + ), + 'Plugin_Locator' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugin-locator.php' + ), + 'Plugins_Handler' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugins-handler.php' + ), + 'Shutdown_Handler' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-shutdown-handler.php' + ), + 'Version_Loader' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-version-loader.php' + ), + 'Version_Selector' => array( + 'version' => '3.1.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-version-selector.php' + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_filemap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_filemap.php new file mode 100644 index 00000000..51ffc16c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_filemap.php @@ -0,0 +1,25 @@ + array( + 'version' => '2.3.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/actions.php' + ), + '7372b7fb88a9723cf5b76d456eb0b738' => array( + 'version' => '4.0.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/actions.php' + ), + '590147edb63acb03b2852d5c4db13ce8' => array( + 'version' => '0.2.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php' + ), + '3d45c7e6a7f0e71849e33afe4b3b3ede' => array( + 'version' => '0.18.5.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/cli.php' + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/platform_check.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/platform_check.php new file mode 100644 index 00000000..f79e574b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70000)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-handler.php new file mode 100644 index 00000000..695a0892 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-handler.php @@ -0,0 +1,147 @@ +php_autoloader = $php_autoloader; + $this->hook_manager = $hook_manager; + $this->manifest_reader = $manifest_reader; + $this->version_selector = $version_selector; + } + + /** + * Checks to see whether or not an autoloader is currently in the process of initializing. + * + * @return bool + */ + public function is_initializing() { + // If no version has been set it means that no autoloader has started initializing yet. + global $jetpack_autoloader_latest_version; + if ( ! isset( $jetpack_autoloader_latest_version ) ) { + return false; + } + + // When the version is set but the classmap is not it ALWAYS means that this is the + // latest autoloader and is being included by an older one. + global $jetpack_packages_classmap; + if ( empty( $jetpack_packages_classmap ) ) { + return true; + } + + // Version 2.4.0 added a new global and altered the reset semantics. We need to check + // the other global as well since it may also point at initialization. + // Note: We don't need to check for the class first because every autoloader that + // will set the latest version global requires this class in the classmap. + $replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version']; + if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) { + global $jetpack_autoloader_loader; + if ( ! isset( $jetpack_autoloader_loader ) ) { + return true; + } + } + + return false; + } + + /** + * Activates an autoloader using the given plugins and activates it. + * + * @param string[] $plugins The plugins to initialize the autoloader for. + */ + public function activate_autoloader( $plugins ) { + global $jetpack_packages_psr4; + $jetpack_packages_psr4 = array(); + $this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 ); + + global $jetpack_packages_classmap; + $jetpack_packages_classmap = array(); + $this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap ); + + global $jetpack_packages_filemap; + $jetpack_packages_filemap = array(); + $this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap ); + + $loader = new Version_Loader( + $this->version_selector, + $jetpack_packages_classmap, + $jetpack_packages_psr4, + $jetpack_packages_filemap + ); + + $this->php_autoloader->register_autoloader( $loader ); + + // Now that the autoloader is active we can load the filemap. + $loader->load_filemap(); + } + + /** + * Resets the active autoloader and all related global state. + */ + public function reset_autoloader() { + $this->php_autoloader->unregister_autoloader(); + $this->hook_manager->reset(); + + // Clear all of the autoloader globals so that older autoloaders don't do anything strange. + global $jetpack_autoloader_latest_version; + $jetpack_autoloader_latest_version = null; + + global $jetpack_packages_classmap; + $jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders! + + global $jetpack_packages_psr4; + $jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders! + + global $jetpack_packages_filemap; + $jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders! + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-locator.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-locator.php new file mode 100644 index 00000000..69fbf8b5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-locator.php @@ -0,0 +1,90 @@ +version_selector = $version_selector; + } + + /** + * Finds the path to the plugin with the latest autoloader. + * + * @param array $plugin_paths An array of plugin paths. + * @param string $latest_version The latest version reference. @phan-output-reference. + * + * @return string|null + */ + public function find_latest_autoloader( $plugin_paths, &$latest_version ) { + $latest_plugin = null; + + foreach ( $plugin_paths as $plugin_path ) { + $version = $this->get_autoloader_version( $plugin_path ); + if ( ! $version || ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) { + continue; + } + + $latest_version = $version; + $latest_plugin = $plugin_path; + } + + return $latest_plugin; + } + + /** + * Gets the path to the autoloader. + * + * @param string $plugin_path The path to the plugin. + * + * @return string + */ + public function get_autoloader_path( $plugin_path ) { + return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php'; + } + + /** + * Gets the version for the autoloader. + * + * @param string $plugin_path The path to the plugin. + * + * @return string|null + */ + public function get_autoloader_version( $plugin_path ) { + $classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php'; + if ( ! file_exists( $classmap ) ) { + return null; + } + + $classmap = require $classmap; + if ( isset( $classmap[ AutoloadGenerator::class ] ) ) { + return $classmap[ AutoloadGenerator::class ]['version']; + } + + return null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader.php new file mode 100644 index 00000000..13bb223c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader.php @@ -0,0 +1,93 @@ +get( Autoloader_Handler::class ); + + // If the autoloader is already initializing it means that it has included us as the latest. + $was_included_by_autoloader = $autoloader_handler->is_initializing(); + + /** @var Plugin_Locator $plugin_locator */ + $plugin_locator = $container->get( Plugin_Locator::class ); + + /** @var Plugins_Handler $plugins_handler */ + $plugins_handler = $container->get( Plugins_Handler::class ); + + // The current plugin is the one that we are attempting to initialize here. + $current_plugin = $plugin_locator->find_current_plugin(); + + // The active plugins are those that we were able to discover on the site. This list will not + // include mu-plugins, those activated by code, or those who are hidden by filtering. We also + // want to take care to not consider the current plugin unknown if it was included by an + // autoloader. This avoids the case where a plugin will be marked "active" while deactivated + // due to it having the latest autoloader. + $active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader ); + + // The cached plugins are all of those that were active or discovered by the autoloader during a previous request. + // Note that it's possible this list will include plugins that have since been deactivated, but after a request + // the cache should be updated and the deactivated plugins will be removed. + $cached_plugins = $plugins_handler->get_cached_plugins(); + + // We combine the active list and cached list to preemptively load classes for plugins that are + // presently unknown but will be loaded during the request. While this may result in us considering packages in + // deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient. + $all_plugins = array_merge( $active_plugins, $cached_plugins ); + + // In particular we also include the current plugin to address the case where it is the latest autoloader + // but also unknown (and not cached). We don't want it in the active list because we don't know that it + // is active but we need it in the all plugins list so that it is considered by the autoloader. + $all_plugins[] = $current_plugin; + + // We require uniqueness in the array to avoid processing the same plugin more than once. + $all_plugins = array_values( array_unique( $all_plugins ) ); + + /** @var Latest_Autoloader_Guard $guard */ + $guard = $container->get( Latest_Autoloader_Guard::class ); + if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) { + return; + } + + // Initialize the autoloader using the handler now that we're ready. + $autoloader_handler->activate_autoloader( $all_plugins ); + + /** @var Hook_Manager $hook_manager */ + $hook_manager = $container->get( Hook_Manager::class ); + + // Register a shutdown handler to clean up the autoloader. + $hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) ); + + // Register a plugins_loaded handler to check for conflicting autoloaders. + $hook_manager->add_action( 'plugins_loaded', array( $guard, 'check_for_conflicting_autoloaders' ), 1 ); + + // phpcs:enable Generic.Commenting.DocComment.MissingShort + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-container.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-container.php new file mode 100644 index 00000000..8129b86a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-container.php @@ -0,0 +1,150 @@ + 'Hook_Manager', + ); + + /** + * A map of all the dependencies we've registered with the container and created. + * + * @var array + */ + protected $dependencies; + + /** + * The constructor. + */ + public function __construct() { + $this->dependencies = array(); + + $this->register_shared_dependencies(); + $this->register_dependencies(); + $this->initialize_globals(); + } + + /** + * Gets a dependency out of the container. + * + * @param string $class The class to fetch. + * + * @return mixed + * @throws \InvalidArgumentException When a class that isn't registered with the container is fetched. + */ + public function get( $class ) { + if ( ! isset( $this->dependencies[ $class ] ) ) { + throw new \InvalidArgumentException( "Class '$class' is not registered with the container." ); + } + + return $this->dependencies[ $class ]; + } + + /** + * Registers all of the dependencies that are shared between all instances of the autoloader. + */ + private function register_shared_dependencies() { + global $jetpack_autoloader_container_shared; + if ( ! isset( $jetpack_autoloader_container_shared ) ) { + $jetpack_autoloader_container_shared = array(); + } + + $key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ]; + if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) { + require_once __DIR__ . '/class-hook-manager.php'; + $jetpack_autoloader_container_shared[ $key ] = new Hook_Manager(); + } + $this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ]; + } + + /** + * Registers all of the dependencies with the container. + */ + private function register_dependencies() { + require_once __DIR__ . '/class-path-processor.php'; + $this->dependencies[ Path_Processor::class ] = new Path_Processor(); + + require_once __DIR__ . '/class-plugin-locator.php'; + $this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator( + $this->get( Path_Processor::class ) + ); + + require_once __DIR__ . '/class-version-selector.php'; + $this->dependencies[ Version_Selector::class ] = new Version_Selector(); + + require_once __DIR__ . '/class-autoloader-locator.php'; + $this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator( + $this->get( Version_Selector::class ) + ); + + require_once __DIR__ . '/class-php-autoloader.php'; + $this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader(); + + require_once __DIR__ . '/class-manifest-reader.php'; + $this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader( + $this->get( Version_Selector::class ) + ); + + require_once __DIR__ . '/class-plugins-handler.php'; + $this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler( + $this->get( Plugin_Locator::class ), + $this->get( Path_Processor::class ) + ); + + require_once __DIR__ . '/class-autoloader-handler.php'; + $this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler( + $this->get( PHP_Autoloader::class ), + $this->get( Hook_Manager::class ), + $this->get( Manifest_Reader::class ), + $this->get( Version_Selector::class ) + ); + + require_once __DIR__ . '/class-latest-autoloader-guard.php'; + $this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard( + $this->get( Plugins_Handler::class ), + $this->get( Autoloader_Handler::class ), + $this->get( Autoloader_Locator::class ) + ); + + // Register any classes that we will use elsewhere. + require_once __DIR__ . '/class-version-loader.php'; + require_once __DIR__ . '/class-shutdown-handler.php'; + } + + /** + * Initializes any of the globals needed by the autoloader. + */ + private function initialize_globals() { + /* + * This global was retired in version 2.9. The value is set to 'false' to maintain + * compatibility with older versions of the autoloader. + */ + global $jetpack_autoloader_including_latest; + $jetpack_autoloader_including_latest = false; + + // Not all plugins can be found using the locator. In cases where a plugin loads the autoloader + // but was not discoverable, we will record them in this array to track them as "active". + global $jetpack_autoloader_activating_plugins_paths; + if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) { + $jetpack_autoloader_activating_plugins_paths = array(); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-hook-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-hook-manager.php new file mode 100644 index 00000000..a44b5fae --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-hook-manager.php @@ -0,0 +1,76 @@ +registered_hooks = array(); + } + + /** + * Adds an action to WordPress and registers it internally. + * + * @param string $tag The name of the action which is hooked. + * @param callable $callable The function to call. + * @param int $priority Used to specify the priority of the action. + * @param int $accepted_args Used to specify the number of arguments the callable accepts. + */ + public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) { + $this->registered_hooks[ $tag ][] = array( + 'priority' => $priority, + 'callable' => $callable, + ); + + add_action( $tag, $callable, $priority, $accepted_args ); + } + + /** + * Adds a filter to WordPress and registers it internally. + * + * @param string $tag The name of the filter which is hooked. + * @param callable $callable The function to call. + * @param int $priority Used to specify the priority of the filter. + * @param int $accepted_args Used to specify the number of arguments the callable accepts. + */ + public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) { + $this->registered_hooks[ $tag ][] = array( + 'priority' => $priority, + 'callable' => $callable, + ); + + add_filter( $tag, $callable, $priority, $accepted_args ); + } + + /** + * Removes all of the registered hooks. + */ + public function reset() { + foreach ( $this->registered_hooks as $tag => $hooks ) { + foreach ( $hooks as $hook ) { + remove_filter( $tag, $hook['callable'], $hook['priority'] ); + } + } + $this->registered_hooks = array(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-latest-autoloader-guard.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-latest-autoloader-guard.php new file mode 100644 index 00000000..e0191107 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-latest-autoloader-guard.php @@ -0,0 +1,183 @@ +plugins_handler = $plugins_handler; + $this->autoloader_handler = $autoloader_handler; + $this->autoloader_locator = $autoloader_locator; + } + + /** + * Indicates whether or not the autoloader should be initialized. Note that this function + * has the side-effect of actually loading the latest autoloader in the event that this + * is not it. + * + * @param string $current_plugin The current plugin we're checking. + * @param string[] $plugins The active plugins to check for autoloaders in. + * @param bool $was_included_by_autoloader Indicates whether or not this autoloader was included by another. + * + * @return bool True if we should stop initialization, otherwise false. + */ + public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) { + global $jetpack_autoloader_latest_version; + + // We need to reset the autoloader when the plugins change because + // that means the autoloader was generated with a different list. + if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) { + $this->autoloader_handler->reset_autoloader(); + } + + // When the latest autoloader has already been found we don't need to search for it again. + // We should take care however because this will also trigger if the autoloader has been + // included by an older one. + if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) { + return true; + } + + $latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version ); + if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) { + require $this->autoloader_locator->get_autoloader_path( $latest_plugin ); + return true; + } + + return false; + } + + /** + * Check for conflicting autoloaders. + * + * A common source of strange and confusing problems is when another plugin + * registers a Composer autoloader at a higher priority that us. If enabled, + * check for this problem and warn about it. + * + * Called from the plugins_loaded hook. + * + * @since 3.1.0 + * @return void + */ + public function check_for_conflicting_autoloaders() { + if ( ! defined( 'JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS' ) || ! JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS ) { + return; + } + + global $jetpack_autoloader_loader; + if ( ! isset( $jetpack_autoloader_loader ) ) { + return; + } + $prefixes = array(); + foreach ( ( $jetpack_autoloader_loader->get_class_map() ?? array() ) as $classname => $data ) { + $parts = explode( '\\', trim( $classname, '\\' ) ); + array_pop( $parts ); + while ( $parts ) { + $prefixes[ implode( '\\', $parts ) . '\\' ] = true; + array_pop( $parts ); + } + } + foreach ( ( $jetpack_autoloader_loader->get_psr4_map() ?? array() ) as $prefix => $data ) { + $parts = explode( '\\', trim( $prefix, '\\' ) ); + while ( $parts ) { + $prefixes[ implode( '\\', $parts ) . '\\' ] = true; + array_pop( $parts ); + } + } + + $autoload_chain = spl_autoload_functions(); + if ( ! $autoload_chain ) { + return; + } + + foreach ( $autoload_chain as $autoloader ) { + // No need to check anything after us. + if ( is_array( $autoloader ) && is_string( $autoloader[0] ) && substr( $autoloader[0], 0, strlen( __NAMESPACE__ ) + 1 ) === __NAMESPACE__ . '\\' ) { + break; + } + + // We can check Composer autoloaders easily enough. + if ( is_array( $autoloader ) && $autoloader[0] instanceof \Composer\Autoload\ClassLoader && is_callable( array( $autoloader[0], 'getPrefixesPsr4' ) ) ) { + $composer_autoloader = $autoloader[0]; + foreach ( $composer_autoloader->getClassMap() as $classname => $path ) { + if ( $jetpack_autoloader_loader->find_class_file( $classname ) ) { + $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the classes we handle (e.g. $classname => $path). This may cause strange and confusing problems."; + // @todo Remove the is_callable check once we drop support for WP 6.5. + if ( is_callable( 'wp_trigger_error' ) ) { + wp_trigger_error( '', $msg ); + } else { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + trigger_error( $msg ); + } + continue 2; + } + } + foreach ( $composer_autoloader->getPrefixesPsr4() as $prefix => $paths ) { + if ( isset( $prefixes[ $prefix ] ) ) { + $path = array_pop( $paths ); + $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; + // @todo Remove the is_callable check once we drop support for WP 6.5. + if ( is_callable( 'wp_trigger_error' ) ) { + wp_trigger_error( '', $msg ); + } else { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + trigger_error( $msg ); + } + continue 2; + } + } + foreach ( $composer_autoloader->getPrefixes() as $prefix => $paths ) { + if ( isset( $prefixes[ $prefix ] ) ) { + $path = array_pop( $paths ); + $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; + // @todo Remove the is_callable check once we drop support for WP 6.5. + if ( is_callable( 'wp_trigger_error' ) ) { + wp_trigger_error( '', $msg ); + } else { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + trigger_error( $msg ); + } + continue 2; + } + } + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-manifest-reader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-manifest-reader.php new file mode 100644 index 00000000..5ed50647 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-manifest-reader.php @@ -0,0 +1,99 @@ +version_selector = $version_selector; + } + + /** + * Reads all of the manifests in the given plugin paths. + * + * @param array $plugin_paths The paths to the plugins we're loading the manifest in. + * @param string $manifest_path The path that we're loading the manifest from in each plugin. + * @param array $path_map The path map to add the contents of the manifests to. + * + * @return array $path_map The path map we've built using the manifests in each plugin. + */ + public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) { + $file_paths = array_map( + function ( $path ) use ( $manifest_path ) { + return trailingslashit( $path ) . $manifest_path; + }, + $plugin_paths + ); + + foreach ( $file_paths as $path ) { + $this->register_manifest( $path, $path_map ); + } + + return $path_map; + } + + /** + * Registers a plugin's manifest file with the path map. + * + * @param string $manifest_path The absolute path to the manifest that we're loading. + * @param array $path_map The path map to add the contents of the manifest to. + */ + protected function register_manifest( $manifest_path, &$path_map ) { + if ( ! is_readable( $manifest_path ) ) { + return; + } + + $manifest = require $manifest_path; + if ( ! is_array( $manifest ) ) { + return; + } + + foreach ( $manifest as $key => $data ) { + $this->register_record( $key, $data, $path_map ); + } + } + + /** + * Registers an entry from the manifest in the path map. + * + * @param string $key The identifier for the entry we're registering. + * @param array $data The data for the entry we're registering. + * @param array $path_map The path map to add the contents of the manifest to. + */ + protected function register_record( $key, $data, &$path_map ) { + if ( isset( $path_map[ $key ]['version'] ) ) { + $selected_version = $path_map[ $key ]['version']; + } else { + $selected_version = null; + } + + if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) { + $path_map[ $key ] = array( + 'version' => $data['version'], + 'path' => $data['path'], + ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-path-processor.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-path-processor.php new file mode 100644 index 00000000..b320f643 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-path-processor.php @@ -0,0 +1,194 @@ +get_normalized_constants(); + foreach ( $constants as $constant => $constant_path ) { + $len = strlen( $constant_path ); + if ( substr( $path, 0, $len ) !== $constant_path ) { + continue; + } + + return substr_replace( $path, '{{' . $constant . '}}', 0, $len ); + } + + return $path; + } + + /** + * Given a path this will replace any of the path constant tokens with the expanded path. + * + * @param string $tokenized_path The path we want to process. + * + * @return string The expanded path. + */ + public function untokenize_path_constants( $tokenized_path ) { + $tokenized_path = wp_normalize_path( $tokenized_path ); + + $constants = $this->get_normalized_constants(); + foreach ( $constants as $constant => $constant_path ) { + $constant = '{{' . $constant . '}}'; + + $len = strlen( $constant ); + if ( substr( $tokenized_path, 0, $len ) !== $constant ) { + continue; + } + + return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) ); + } + + return $tokenized_path; + } + + /** + * Given a file and an array of places it might be, this will find the absolute path and return it. + * + * @param string $file The plugin or theme file to resolve. + * @param array $directories_to_check The directories we should check for the file if it isn't an absolute path. + * + * @return string|false Returns the absolute path to the directory, otherwise false. + */ + public function find_directory_with_autoloader( $file, $directories_to_check ) { + $file = wp_normalize_path( $file ); + + if ( ! $this->is_absolute_path( $file ) ) { + $file = $this->find_absolute_plugin_path( $file, $directories_to_check ); + if ( ! isset( $file ) ) { + return false; + } + } + + // We need the real path for consistency with __DIR__ paths. + $file = $this->get_real_path( $file ); + + // phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged + $directory = @is_file( $file ) ? dirname( $file ) : $file; + if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) { + return false; + } + // phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged + + return $directory; + } + + /** + * Fetches an array of normalized paths keyed by the constant they came from. + * + * @return string[] The normalized paths keyed by the constant. + */ + private function get_normalized_constants() { + $raw_constants = array( + // Order the constants from most-specific to least-specific. + 'WP_PLUGIN_DIR', + 'WPMU_PLUGIN_DIR', + 'WP_CONTENT_DIR', + 'ABSPATH', + ); + + $constants = array(); + foreach ( $raw_constants as $raw ) { + if ( ! defined( $raw ) ) { + continue; + } + + $path = wp_normalize_path( constant( $raw ) ); + if ( isset( $path ) ) { + $constants[ $raw ] = $path; + } + } + + return $constants; + } + + /** + * Indicates whether or not a path is absolute. + * + * @param string $path The path to check. + * + * @return bool True if the path is absolute, otherwise false. + */ + private function is_absolute_path( $path ) { + if ( empty( $path ) || 0 === strlen( $path ) || '.' === $path[0] ) { + return false; + } + + // Absolute paths on Windows may begin with a drive letter. + if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) { + return true; + } + + // A path starting with / or \ is absolute; anything else is relative. + return ( '/' === $path[0] || '\\' === $path[0] ); + } + + /** + * Given a file and a list of directories to check, this method will try to figure out + * the absolute path to the file in question. + * + * @param string $normalized_path The normalized path to the plugin or theme file to resolve. + * @param array $directories_to_check The directories we should check for the file if it isn't an absolute path. + * + * @return string|null The absolute path to the plugin file, otherwise null. + */ + private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) { + // We're only able to find the absolute path for plugin/theme PHP files. + if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) { + return null; + } + + foreach ( $directories_to_check as $directory ) { + $normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path; + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + if ( @is_file( $normalized_check ) ) { + return $normalized_check; + } + } + + return null; + } + + /** + * Given a path this will figure out the real path that we should be using. + * + * @param string $path The path to resolve. + * + * @return string The resolved path. + */ + private function get_real_path( $path ) { + // We want to resolve symbolic links for consistency with __DIR__ paths. + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $real_path = @realpath( $path ); + if ( false === $real_path ) { + // Let the autoloader deal with paths that don't exist. + $real_path = $path; + } + + // Using realpath will make it platform-specific so we must normalize it after. + if ( $path !== $real_path ) { + $real_path = wp_normalize_path( $real_path ); + } + + return $real_path; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-php-autoloader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-php-autoloader.php new file mode 100644 index 00000000..43acf2f6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-php-autoloader.php @@ -0,0 +1,111 @@ +unregister_autoloader(); + + // Set the global so that it can be used to load classes. + global $jetpack_autoloader_loader; + $jetpack_autoloader_loader = $version_loader; + + // Ensure that the autoloader is first to avoid contention with others. + spl_autoload_register( array( self::class, 'load_class' ), true, true ); + } + + /** + * Unregisters the active autoloader so that it will no longer autoload classes. + */ + public function unregister_autoloader() { + // Remove any v2 autoloader that we've already registered. + $autoload_chain = spl_autoload_functions(); + if ( ! $autoload_chain ) { + return; + } + foreach ( $autoload_chain as $autoloader ) { + // We can identify a v2 autoloader using the namespace. + $namespace_check = null; + + // Functions are recorded as strings. + if ( is_string( $autoloader ) ) { + $namespace_check = $autoloader; + } elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) { + // Static method calls have the class as the first array element. + $namespace_check = $autoloader[0]; + } else { + // Since the autoloader has only ever been a function or a static method we don't currently need to check anything else. + continue; + } + + // Check for the namespace without the generated suffix. + if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) { + spl_autoload_unregister( $autoloader ); + } + } + + // Clear the global now that the autoloader has been unregistered. + global $jetpack_autoloader_loader; + $jetpack_autoloader_loader = null; + } + + /** + * Loads a class file if one could be found. + * + * Note: This function is static so that the autoloader can be easily unregistered. If + * it was a class method we would have to unwrap the object to check the namespace. + * + * @param string $class_name The name of the class to autoload. + * + * @return bool Indicates whether or not a class file was loaded. + */ + public static function load_class( $class_name ) { + global $jetpack_autoloader_loader; + if ( ! isset( $jetpack_autoloader_loader ) ) { + return false; + } + + $file = $jetpack_autoloader_loader->find_class_file( $class_name ); + if ( ! isset( $file ) ) { + return false; + } + + // A common source of strange and confusing problems is when a vendor + // file is autoloaded before all plugins have had a chance to register + // with the autoloader. Detect that, if a development constant is set. + if ( defined( 'JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS' ) && JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS && + ( strpos( $file, '/vendor/' ) !== false || strpos( $file, '/jetpack_vendor/' ) !== false ) && + is_callable( 'did_action' ) && ! did_action( 'plugins_loaded' ) + ) { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_wp_debug_backtrace_summary -- This is a debug log message. + $msg = "Jetpack Autoloader: Autoloading `$class_name` before the plugins_loaded hook may cause strange and confusing problems. " . wp_debug_backtrace_summary( '', 1 ); + // @todo Remove the is_callable check once we drop support for WP 6.5. + if ( is_callable( 'wp_trigger_error' ) ) { + wp_trigger_error( '', $msg ); + } else { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + trigger_error( $msg ); + } + } + + require $file; + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugin-locator.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugin-locator.php new file mode 100644 index 00000000..995cd80e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugin-locator.php @@ -0,0 +1,153 @@ +path_processor = $path_processor; + } + + /** + * Finds the path to the current plugin. + * + * @return string $path The path to the current plugin. + * + * @throws \RuntimeException If the current plugin does not have an autoloader. + */ + public function find_current_plugin() { + // Escape from `vendor/__DIR__` to root plugin directory. + $plugin_directory = dirname( __DIR__, 2 ); + + // Use the path processor to ensure that this is an autoloader we're referencing. + $path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() ); + if ( false === $path ) { + throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory ); + } + + return $path; + } + + /** + * Checks a given option for plugin paths. + * + * @param string $option_name The option that we want to check for plugin information. + * @param bool $site_option Indicates whether or not we want to check the site option. + * + * @return array $plugin_paths The list of absolute paths we've found. + */ + public function find_using_option( $option_name, $site_option = false ) { + $raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name ); + if ( false === $raw ) { + return array(); + } + + return $this->convert_plugins_to_paths( $raw ); + } + + /** + * Checks for plugins in the `action` request parameter. + * + * @param string[] $allowed_actions The actions that we're allowed to return plugins for. + * + * @return array $plugin_paths The list of absolute paths we've found. + */ + public function find_using_request_action( $allowed_actions ) { + /** + * Note: we're not actually checking the nonce here because it's too early + * in the execution. The pluggable functions are not yet loaded to give + * plugins a chance to plug their versions. Therefore we're doing the bare + * minimum: checking whether the nonce exists and it's in the right place. + * The request will fail later if the nonce doesn't pass the check. + */ + if ( empty( $_REQUEST['_wpnonce'] ) ) { + return array(); + } + + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated just below. + $action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false; + if ( ! in_array( $action, $allowed_actions, true ) ) { + return array(); + } + + $plugin_slugs = array(); + switch ( $action ) { + case 'activate': + case 'deactivate': + if ( empty( $_REQUEST['plugin'] ) ) { + break; + } + + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated by convert_plugins_to_paths. + $plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] ); + break; + + case 'activate-selected': + case 'deactivate-selected': + if ( empty( $_REQUEST['checked'] ) ) { + break; + } + + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated by convert_plugins_to_paths. + $plugin_slugs = wp_unslash( $_REQUEST['checked'] ); + break; + } + + return $this->convert_plugins_to_paths( $plugin_slugs ); + } + + /** + * Given an array of plugin slugs or paths, this will convert them to absolute paths and filter + * out the plugins that are not directory plugins. Note that array keys will also be included + * if they are plugin paths! + * + * @param string[] $plugins Plugin paths or slugs to filter. + * + * @return string[] + */ + private function convert_plugins_to_paths( $plugins ) { + if ( ! is_array( $plugins ) || empty( $plugins ) ) { + return array(); + } + + // We're going to look for plugins in the standard directories. + $path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR ); + + $plugin_paths = array(); + foreach ( $plugins as $key => $value ) { + $path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants ); + if ( $path ) { + $plugin_paths[] = $path; + } + + $path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants ); + if ( $path ) { + $plugin_paths[] = $path; + } + } + + return $plugin_paths; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugins-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugins-handler.php new file mode 100644 index 00000000..604694b5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugins-handler.php @@ -0,0 +1,164 @@ +plugin_locator = $plugin_locator; + $this->path_processor = $path_processor; + } + + /** + * Gets all of the active plugins we can find. + * + * @param bool $include_deactivating When true, plugins deactivating this request will be considered active. + * @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown. + * + * @return string[] + */ + public function get_active_plugins( $include_deactivating, $record_unknown ) { + global $jetpack_autoloader_activating_plugins_paths; + + // We're going to build a unique list of plugins from a few different sources + // to find all of our "active" plugins. While we need to return an integer + // array, we're going to use an associative array internally to reduce + // the amount of time that we're going to spend checking uniqueness + // and merging different arrays together to form the output. + $active_plugins = array(); + + // Make sure that plugins which have activated this request are considered as "active" even though + // they probably won't be present in any option. + if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) { + foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) { + $active_plugins[ $path ] = $path; + } + } + + // This option contains all of the plugins that have been activated. + $plugins = $this->plugin_locator->find_using_option( 'active_plugins' ); + foreach ( $plugins as $path ) { + $active_plugins[ $path ] = $path; + } + + // This option contains all of the multisite plugins that have been activated. + if ( is_multisite() ) { + $plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true ); + foreach ( $plugins as $path ) { + $active_plugins[ $path ] = $path; + } + } + + // These actions contain plugins that are being activated/deactivated during this request. + $plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) ); + foreach ( $plugins as $path ) { + $active_plugins[ $path ] = $path; + } + + // When the current plugin isn't considered "active" there's a problem. + // Since we're here, the plugin is active and currently being loaded. + // We can support this case (mu-plugins and non-standard activation) + // by adding the current plugin to the active list and marking it + // as an unknown (activating) plugin. This also has the benefit + // of causing a reset because the active plugins list has + // been changed since it was saved in the global. + $current_plugin = $this->plugin_locator->find_current_plugin(); + if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) { + $active_plugins[ $current_plugin ] = $current_plugin; + $jetpack_autoloader_activating_plugins_paths[] = $current_plugin; + } + + // When deactivating plugins aren't desired we should entirely remove them from the active list. + if ( ! $include_deactivating ) { + // These actions contain plugins that are being deactivated during this request. + $plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) ); + foreach ( $plugins as $path ) { + unset( $active_plugins[ $path ] ); + } + } + + // Transform the array so that we don't have to worry about the keys interacting with other array types later. + return array_values( $active_plugins ); + } + + /** + * Gets all of the cached plugins if there are any. + * + * @return string[] + */ + public function get_cached_plugins() { + $cached = get_transient( self::TRANSIENT_KEY ); + if ( ! is_array( $cached ) || empty( $cached ) ) { + return array(); + } + + // We need to expand the tokens to an absolute path for this webserver. + return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached ); + } + + /** + * Saves the plugin list to the cache. + * + * @param array $plugins The plugin list to save to the cache. + */ + public function cache_plugins( $plugins ) { + // We store the paths in a tokenized form so that that webservers with different absolute paths don't break. + $plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins ); + + set_transient( self::TRANSIENT_KEY, $plugins ); + } + + /** + * Checks to see whether or not the plugin list given has changed when compared to the + * shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal + * with cases where the active list may change due to filtering.. + * + * @param string[] $plugins The plugins list to check against the global cache. + * + * @return bool True if the plugins have changed, otherwise false. + */ + public function have_plugins_changed( $plugins ) { + global $jetpack_autoloader_cached_plugin_paths; + + if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) { + $jetpack_autoloader_cached_plugin_paths = $plugins; + return true; + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-shutdown-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-shutdown-handler.php new file mode 100644 index 00000000..1e6a308f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-shutdown-handler.php @@ -0,0 +1,92 @@ +plugins_handler = $plugins_handler; + $this->cached_plugins = $cached_plugins; + $this->was_included_by_autoloader = $was_included_by_autoloader; + } + + /** + * Handles the shutdown of the autoloader. + */ + public function __invoke() { + // Don't save a broken cache if an error happens during some plugin's initialization. + if ( ! did_action( 'plugins_loaded' ) ) { + // Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame. + if ( ! empty( $this->cached_plugins ) ) { + $this->plugins_handler->cache_plugins( array() ); + } + + return; + } + + // Load the active plugins fresh since the list we pulled earlier might not contain + // plugins that were activated but did not reset the autoloader. This happens + // when a plugin is in the cache but not "active" when the autoloader loads. + // We also want to make sure that plugins which are deactivating are not + // considered "active" so that they will be removed from the cache now. + try { + $active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader ); + } catch ( \Exception $ex ) { + // When the package is deleted before shutdown it will throw an exception. + // In the event this happens we should erase the cache. + if ( ! empty( $this->cached_plugins ) ) { + $this->plugins_handler->cache_plugins( array() ); + } + return; + } + + // The paths should be sorted for easy comparisons with those loaded from the cache. + // Note we don't need to sort the cached entries because they're already sorted. + sort( $active_plugins ); + + // We don't want to waste time saving a cache that hasn't changed. + if ( $this->cached_plugins === $active_plugins ) { + return; + } + + $this->plugins_handler->cache_plugins( $active_plugins ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-loader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-loader.php new file mode 100644 index 00000000..4bcc6971 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-loader.php @@ -0,0 +1,184 @@ +version_selector = $version_selector; + $this->classmap = $classmap; + $this->psr4_map = $psr4_map; + $this->filemap = $filemap; + } + + /** + * Fetch the classmap. + * + * @since 3.1.0 + * @return array + */ + public function get_class_map() { + return $this->classmap; + } + + /** + * Fetch the psr-4 mappings. + * + * @since 3.1.0 + * @return array + */ + public function get_psr4_map() { + return $this->psr4_map; + } + + /** + * Finds the file path for the given class. + * + * @param string $class_name The class to find. + * + * @return string|null $file_path The path to the file if found, null if no class was found. + */ + public function find_class_file( $class_name ) { + $data = $this->select_newest_file( + $this->classmap[ $class_name ] ?? null, + $this->find_psr4_file( $class_name ) + ); + if ( ! isset( $data ) ) { + return null; + } + + return $data['path']; + } + + /** + * Load all of the files in the filemap. + */ + public function load_filemap() { + if ( empty( $this->filemap ) ) { + return; + } + + foreach ( $this->filemap as $file_identifier => $file_data ) { + if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) { + require_once $file_data['path']; + + $GLOBALS['__composer_autoload_files'][ $file_identifier ] = true; + } + } + } + + /** + * Compares different class sources and returns the newest. + * + * @param array|null $classmap_data The classmap class data. + * @param array|null $psr4_data The PSR-4 class data. + * + * @return array|null $data + */ + private function select_newest_file( $classmap_data, $psr4_data ) { + if ( ! isset( $classmap_data ) ) { + return $psr4_data; + } elseif ( ! isset( $psr4_data ) ) { + return $classmap_data; + } + + if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) { + return $psr4_data; + } + + return $classmap_data; + } + + /** + * Finds the file for a given class in a PSR-4 namespace. + * + * @param string $class_name The class to find. + * + * @return array|null $data The version and path path to the file if found, null otherwise. + */ + private function find_psr4_file( $class_name ) { + if ( ! isset( $this->psr4_map ) ) { + return null; + } + + // Don't bother with classes that have no namespace. + $class_index = strrpos( $class_name, '\\' ); + if ( ! $class_index ) { + return null; + } + $class_for_path = str_replace( '\\', '/', $class_name ); + + // Search for the namespace by iteratively cutting off the last segment until + // we find a match. This allows us to check the most-specific namespaces + // first as well as minimize the amount of time spent looking. + for ( + $class_namespace = substr( $class_name, 0, $class_index ); + ! empty( $class_namespace ); + $class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) ) + ) { + $namespace = $class_namespace . '\\'; + if ( ! isset( $this->psr4_map[ $namespace ] ) ) { + continue; + } + $data = $this->psr4_map[ $namespace ]; + + foreach ( $data['path'] as $path ) { + $path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php'; + if ( file_exists( $path ) ) { + return array( + 'version' => $data['version'], + 'path' => $path, + ); + } + } + } + + return null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-selector.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-selector.php new file mode 100644 index 00000000..74b4f80f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-selector.php @@ -0,0 +1,69 @@ +is_dev_version( $selected_version ) ) { + return false; + } + + if ( $this->is_dev_version( $compare_version ) ) { + if ( $use_dev_versions ) { + return true; + } else { + return false; + } + } + + if ( version_compare( $selected_version, $compare_version, '<' ) ) { + return true; + } + + return false; + } + + /** + * Checks whether the given package version is a development version. + * + * @param String $version The package version. + * + * @return bool True if the version is a dev version, else false. + */ + public function is_dev_version( $version ) { + if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) { + return true; + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/LICENSE b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/NOTICE b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/NOTICE new file mode 100644 index 00000000..344d6275 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/NOTICE @@ -0,0 +1,2 @@ +AhoCorasick PHP Library +Copyright 2015 Ori Livneh diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/bench.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/bench.php new file mode 100644 index 00000000..499899a8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/bench.php @@ -0,0 +1,75 @@ +searchAndReplace( $text ); + } + $endTime = microtime( true ); + $wallTime = 1000 * ( ( $endTime - $startTime ) / $loops ); + printf( "%-'.40s %.2fms\n", 'MultiStringRepeater::searchAndReplace(): ', $wallTime ); + if ( $profile ) { + $profile = xhprof_disable(); + foreach ( $profile as $func => $data ) { + printf( "%s: %.2f\n", $func, $data['cpu'] / $data['ct'] ); + } + } +} + +if ( function_exists( 'fss_prep_replace' ) && isset( $options['fss'] ) ) { + $fss = fss_prep_replace( $zh2Hant ); + $startTime = microtime( true ); + for ( $i = 0; $i < $loops; $i++ ) { + fss_exec_replace( $fss, $text ); + } + $endTime = microtime( true ); + $wallTime = 1000 * ( ( $endTime - $startTime ) / $loops ); + printf( "%-'.40s %.2fms\n", 'fss_exec_replace(): ', $wallTime ); +} + +if ( isset( $options['strtr'] ) ) { + $startTime = microtime( true ); + for ( $i = 0; $i < $loops; $i++ ) { + strtr( $text, $zh2Hant ); + } + $endTime = microtime( true ); + $wallTime = 1000 * ( ( $endTime - $startTime ) / $loops ); + printf( "%-'.40s %.2fms\n", 'strtr(): ', $wallTime ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/check.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/check.php new file mode 100644 index 00000000..1cb6384e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/check.php @@ -0,0 +1,42 @@ +searchAndReplace( $text ) !== $expected ) { + echo "ERROR\n"; + $status = 1; +} else { + echo "OK\n"; +} + +if ( function_exists( 'fss_exec_replace' ) ) { + echo "fss_exec_replace(): "; + $fss = fss_prep_replace( $zh2Hant ); + if ( fss_exec_replace( $fss, $text ) !== $expected ) { + echo "ERROR\n"; + $status = 1; + } else { + echo "OK\n"; + } +} + +exit( $status ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringMatcher.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringMatcher.php new file mode 100644 index 00000000..b2953c4d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringMatcher.php @@ -0,0 +1,230 @@ + + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @file + * @author Ori Livneh + */ + +namespace AhoCorasick; + +/** + * Represents a finite state machine that can find all occurrences + * of a set of search keywords in a body of text. + * + * The time it takes to construct the finite state machine is + * proportional to the sum of the lengths of the search keywords. + * Once constructed, the machine can locate all occurences of all + * search keywords in a body of text in a single pass, making exactly + * one state transition per input character. + * + * This is an implementation of the Aho-Corasick string matching + * algorithm. + * + * Alfred V. Aho and Margaret J. Corasick, "Efficient string matching: + * an aid to bibliographic search", CACM, 18(6):333-340, June 1975. + * + * @link http://xlinux.nist.gov/dads//HTML/ahoCorasick.html + */ +class MultiStringMatcher { + + /** @var string[] The set of keywords to be searched for. **/ + protected $searchKeywords = []; + + /** @var int The number of possible states of the string-matching finite state machine. **/ + protected $numStates = 1; + + /** @var array Mapping of states to outputs. **/ + protected $outputs = []; + + /** @var array Mapping of failure transitions. **/ + protected $noTransitions = []; + + /** @var array Mapping of success transitions. **/ + protected $yesTransitions = []; + + /** + * Constructor. + * + * @param string[] $searchKeywords The set of keywords to be matched. + */ + public function __construct( array $searchKeywords ) { + foreach ( $searchKeywords as $keyword ) { + if ( $keyword !== '' ) { + $this->searchKeywords[$keyword] = strlen( $keyword ); + } + } + + if ( !$this->searchKeywords ) { + trigger_error( __METHOD__ . ': The set of search keywords is empty.', E_USER_WARNING ); + // Unreachable 'return' when PHPUnit detects trigger_error + return; // @codeCoverageIgnore + } + + $this->computeYesTransitions(); + $this->computeNoTransitions(); + } + + /** + * Accessor for the search keywords. + * + * @return string[] Search keywords. + */ + public function getKeywords() { + return array_keys( $this->searchKeywords ); + } + + /** + * Map the current state and input character to the next state. + * + * @param int $currentState The current state of the string-matching + * automaton. + * @param string $inputChar The character the string-matching + * automaton is currently processing. + * @return int The state the automaton should transition to. + */ + public function nextState( $currentState, $inputChar ) { + $initialState = $currentState; + while ( true ) { + $transitions =& $this->yesTransitions[$currentState]; + if ( isset( $transitions[$inputChar] ) ) { + $nextState = $transitions[$inputChar]; + // Avoid failure transitions next time. + if ( $currentState !== $initialState ) { + $this->yesTransitions[$initialState][$inputChar] = $nextState; + } + return $nextState; + } + if ( $currentState === 0 ) { + return 0; + } + $currentState = $this->noTransitions[$currentState]; + } + // Unreachable outside 'while' + } // @codeCoverageIgnore + + /** + * Locate the search keywords in some text. + * + * @param string $text The string to search in. + * @return array[] An array of matches. Each match is a vector + * containing an integer offset and the matched keyword. + * + * @par Example: + * @code + * $keywords = new MultiStringMatcher( array( 'ore', 'hell' ) ); + * $keywords->searchIn( 'She sells sea shells by the sea shore.' ); + * // result: array( array( 15, 'hell' ), array( 34, 'ore' ) ) + * @endcode + */ + public function searchIn( $text ) { + if ( !$this->searchKeywords || $text === '' ) { + return []; // fast path + } + + $state = 0; + $results = []; + $length = strlen( $text ); + + for ( $i = 0; $i < $length; $i++ ) { + $ch = $text[$i]; + $state = $this->nextState( $state, $ch ); + foreach ( $this->outputs[$state] as $match ) { + $offset = $i - $this->searchKeywords[$match] + 1; + $results[] = [ $offset, $match ]; + } + } + + return $results; + } + + /** + * Get the state transitions which the string-matching automaton + * shall make as it advances through input text. + * + * Constructs a directed tree with a root node which represents the + * initial state of the string-matching automaton and from which a + * path exists which spells out each search keyword. + */ + protected function computeYesTransitions() { + $this->yesTransitions = [ [] ]; + $this->outputs = [ [] ]; + foreach ( $this->searchKeywords as $keyword => $length ) { + $state = 0; + for ( $i = 0; $i < $length; $i++ ) { + $ch = $keyword[$i]; + if ( !empty( $this->yesTransitions[$state][$ch] ) ) { + $state = $this->yesTransitions[$state][$ch]; + } else { + $this->yesTransitions[$state][$ch] = $this->numStates; + $this->yesTransitions[] = []; + $this->outputs[] = []; + $state = $this->numStates++; + } + } + + $this->outputs[$state][] = $keyword; + } + } + + /** + * Get the state transitions which the string-matching automaton + * shall make when a partial match proves false. + */ + protected function computeNoTransitions() { + $queue = []; + $this->noTransitions = []; + + foreach ( $this->yesTransitions[0] as $ch => $toState ) { + $queue[] = $toState; + $this->noTransitions[$toState] = 0; + } + + while ( true ) { + $fromState = array_shift( $queue ); + if ( $fromState === null ) { + break; + } + foreach ( $this->yesTransitions[$fromState] as $ch => $toState ) { + $queue[] = $toState; + $state = $this->noTransitions[$fromState]; + + while ( $state !== 0 && empty( $this->yesTransitions[$state][$ch] ) ) { + $state = $this->noTransitions[$state]; + } + + if ( isset( $this->yesTransitions[$state][$ch] ) ) { + $noState = $this->yesTransitions[$state][$ch]; + } else { + $noState = 0; + } + + $this->noTransitions[$toState] = $noState; + $this->outputs[$toState] = array_merge( + $this->outputs[$toState], $this->outputs[$noState] ); + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringReplacer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringReplacer.php new file mode 100644 index 00000000..6b7891f6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringReplacer.php @@ -0,0 +1,96 @@ + + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @file + * @author Ori Livneh + */ + +namespace AhoCorasick; + +/** + * This class extends MultiStringMatcher, adding search and replace + * functionality. + */ +class MultiStringReplacer extends MultiStringMatcher { + + /** @var array Mapping of states to outputs. **/ + protected $replacePairs = []; + + /** + * Constructor. + * + * @param array $replacePairs array of ( 'from' => 'to' ) replacement pairs. + */ + public function __construct( array $replacePairs ) { + foreach ( $replacePairs as $keyword => $replacement ) { + if ( $keyword !== '' ) { + $this->replacePairs[$keyword] = $replacement; + } + } + parent::__construct( array_keys( $this->replacePairs ) ); + } + + /** + * Search and replace a set of keywords in some text. + * + * @param string $text The string to search in. + * @return string The input text with replacements. + * + * @par Example: + * @code + * $replacer = new MultiStringReplacer( array( 'csh' => 'sea shells' ) ); + * $replacer->searchAndReplace( 'She sells csh by the sea shore.' ); + * // result: 'She sells sea shells by the sea shore.' + * @endcode + */ + public function searchAndReplace( $text ) { + $state = 0; + $length = strlen( $text ); + $matches = []; + for ( $i = 0; $i < $length; $i++ ) { + $ch = $text[$i]; + $state = $this->nextState( $state, $ch ); + foreach ( $this->outputs[$state] as $match ) { + $offset = $i - $this->searchKeywords[$match] + 1; + $matches[$offset] = $match; + } + } + ksort( $matches ); + + $buf = ''; + $lastInsert = 0; + foreach ( $matches as $offset => $match ) { + if ( $offset >= $lastInsert ) { + $buf .= substr( $text, $lastInsert, $offset - $lastInsert ); + $buf .= $this->replacePairs[$match]; + $lastInsert = $offset + $this->searchKeywords[$match]; + } + } + $buf .= substr( $text, $lastInsert ); + + return $buf; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/menu-icons/CHANGELOG.md new file mode 100644 index 00000000..7aee3e2d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/CHANGELOG.md @@ -0,0 +1,159 @@ +##### [Version 0.13.15](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.14...v0.13.15) (2024-07-10) + +- Removed recommendations of unsupported plugins +- Fixed conditions for theme recommendation + +##### [Version 0.13.14](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.13...v0.13.14) (2024-05-14) + +- Enhanced security + +##### [Version 0.13.13](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.12...v0.13.13) (2024-04-18) + +### Improvements +​- **Updated internal dependencies:​​** Enhanced performance and security. + +##### [Version 0.13.12](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.11...v0.13.12) (2024-04-01) + +### Improvements +- **Updated internal dependencies** + +##### [Version 0.13.11](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.10...v0.13.11) (2024-03-29) + +### Fixes +- Updated internal dependencies +- Enhanced security + +##### [Version 0.13.10](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.9...v0.13.10) (2024-03-26) + +### Improvements +- Updated internal dependencies +- Improved readme to link to the public source files +- Filter promotions + +##### [Version 0.13.9](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.8...v0.13.9) (2024-02-23) + +### Fixes +- Updated dependencies +- Harden security + +##### [Version 0.13.8](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.7...v0.13.8) (2023-12-19) + +- SDK Updates +- Fixed global hide label issue + +##### [Version 0.13.7](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.6...v0.13.7) (2023-08-17) + +- Updated dependencies +- Fixed broken button layout issues in other languages + +##### [Version 0.13.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.5...v0.13.6) (2023-07-07) + +- Updated composer dependencies to address warning in the widgets section + +##### [Version 0.13.5](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.4...v0.13.5) (2023-03-30) + +- Updated Dependencies and WordPress core tested up to version 6.2 + +##### [Version 0.13.4](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.3...v0.13.4) (2023-03-01) + +Update dependencies + +##### [Version 0.13.3](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.2...v0.13.3) (2023-02-25) + +- Fix img width/height value, props @Htbaa +- Update dependencies + +##### [Version 0.13.2](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.1...v0.13.2) (2022-11-24) + +* Fix - update dependencies + +##### [Version 0.13.1](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.0...v0.13.1) (2022-11-04) + +Tested with the WordPress 6.1 version + +#### [Version 0.13.0](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.12...v0.13.0) (2022-08-23) + +* Fix Neve upsells showing up inconsistently on edge cases +* Fix inconsistency with Font Awesome 5 and adds compatibility with 6th version +* Fix compatibility with JupiterX +* Update dependencies + +##### [Version 0.12.12](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.11...v0.12.12) (2022-05-27) + +- Fix the style handler conflict issue which breaks the arrow icon of the submenus on some themes +- Fix dismiss dashboard notice issue on some edge cases +- Fix compatibility with the Max Mega Menu plugin + +##### [Version 0.12.11](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.10...v0.12.11) (2022-03-16) + +Add font awesome 5 support +Enhance compatibility with Otter/Neve + +##### [Version 0.12.10](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.9...v0.12.10) (2022-02-07) + +- [Fix] Add support for alt attribute for SVG icons +- Tested up with WordPress 5.9 + +##### [Version 0.12.9](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.8...v0.12.9) (2021-08-04) + +* Tested compatibility with WordPress 5.8 + +##### [Version 0.12.8](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.7...v0.12.8) (2021-05-12) + +* Fix issue when the image is not accessible to fetch the width/height metadata. + +##### [Version 0.12.7](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.6...v0.12.7) (2021-05-07) + +Fix PHP fatal error when uploading SVG with the image uploader + +##### [Version 0.12.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.5...v0.12.6) (2021-05-05) + +* Adds explicit width/height to icons to prevent layout shifts issues + +### v0.12.5 - 2020-08-18 + **Changes:** + + ### v0.12.4 - 2020-07-13 + **Changes:** + * Fix Font Awesome not loading + + ### v0.12.3 - 2020-07-13 + **Changes:** + * Fixed Menu Icons in Block Editor not working +* Fixed CWP links. + + ### v0.12.2 - 2019-11-15 + **Changes:** + + ### v0.12.1 - 2019-11-15 + **Changes:** + * Improve legacy compatibility + + ### v0.12.0 - 2019-11-15 + **Changes:** + * Fix issues with WordPress 5.3. + + ### v0.11.5 - 2019-05-23 + **Changes:** + * Sync composer dependencies with the latest version + + ### v0.11.4 - 2018-12-10 + **Changes:** + * fix issue with composer libraries. + + ### v0.11.3 - 2018-12-10 + **Changes:** + * Tested with WP 5.0 + + ### v0.11.2 - 2018-03-05 + **Changes:** + * Improve popup sidebar layout. + + ### v0.11.1 - 2018-02-24 + **Changes:** + * Add recommendation boxes in the menu icon popup. + + ### v0.11.0 - 2018-01-05 + **Changes:** + * Change ownership to ThemeIsle. +* Improves compatibility with various ThemeIsle products. diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/LICENSE b/wp-content/upgrade-temp-backup/plugins/menu-icons/LICENSE new file mode 100644 index 00000000..d7f10513 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/LICENSE @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.css new file mode 100644 index 00000000..288acd71 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.css @@ -0,0 +1,246 @@ +.menu-icons-wrap { + margin-top: 5px; + margin-bottom: 5px; +} + +.menu-icons-wrap p { + min-height: 2.2em; + margin-bottom: 0; +} + +.menu-icons-wrap p a, +.menu-icons-wrap p label { + display: inline-block; + height: 100%; + line-height: 2.2em; + vertical-align: middle; +} + +.menu-icons-wrap a { + text-decoration: none; + cursor: pointer; +} + +.menu-icons-wrap .submitdelete { + display: inline-block; + float: none; + height: 100%; + margin: 0; + padding: 0; + line-height: 2.2em; +} + +.menu-icons-wrap .hidden { + display: none; +} + +.menu-icons-wrap ._icon { + width: auto; + height: auto; + margin: -0.1em 0.2em 0 0.2em; + color: #666; + font-size: 1.9em; + vertical-align: middle; +} + +.menu-icons-wrap img._icon { + max-width: 24px; +} + +.menu-icons-wrap a._select:focus ._icon, +.menu-icons-wrap a._select:hover ._icon { + color: #101010; +} + +.mi-preview.menu-item { + min-height: 0; + font-size: 1.2em; +} + +.mi-preview.menu-item a { + text-decoration: none; +} + +.mi-preview.menu-item a > * { + display: inline-block; + height: 100%; + line-height: 100%; + vertical-align: middle; +} + +.mi-preview.menu-item ._icon { + margin-right: 0.25em; +} + +.rtl .mi-preview.menu-item ._icon { + margin-right: 0; +} + +.media-sidebar .mi-settings .setting input[type="number"], +.menu-icons-settings input[type="number"] { + float: none; + width: auto; + max-width: 5em; +} + +.media-sidebar .mi-settings .setting input, +.media-sidebar .mi-settings span.description { + float: none; +} + +/** Settings Meta Box **/ +.menu-icons-settings ._field { + padding: 0.5em 0; +} + +.menu-icons-settings ._field ._main { + display: block; + margin-bottom: 0.25em; + font-weight: bold; +} + +#menu-settings-column .menu-icons-settings .inside { + margin-top: 0; +} + +.menu-icons-settings .taxonomydiv .tabs-panel { + max-height: none; + margin-bottom: 0.75em; + padding-top: 0.3em; + padding-bottom: 0.4em; +} + +.js .menu-icons-settings .taxonomydiv .tabs-panel { + margin-bottom: 0; +} + +.menu-icons-settings h4 { + margin: 0; +} + +.menu-icons-settings ._menu span.description { + margin-left: 0.5em; +} + +.menu-icons-settings ._extensions ul { + margin-top: 0.75em; + padding-left: 1.5em; + list-style: disc; +} + +.menu-icons-settings ._extensions ul a { + text-decoration: none; +} + +.menu-icons-settings .spinner { + float: none; + margin: 0 5px 0 0; + vertical-align: middle; +} + +.attachment .svg-icon img { + max-width: 100%; +} + +.nv-upgrade-notice { + width: 90%; + margin-top: 0; + padding: 15px; +} + +#menu-icons-sidebar div.new-card { + width: auto; + min-width: initial; + max-width: initial; + margin: 10px auto; +} + +.menu-icons-subscribe { + padding: 15px; +} + +.menu-icons-submit-mail { + width: auto; +} + +#success { + display: none; +} + +#failure { + display: none; +} + +.attachments-browser.iconpicker-fonts-browser .media-toolbar { + width: 62%; +} + +.attachments-browser.iconpicker-fonts-browser .attachments.iconpicker-items { + width: 64%; +} + +.attachments-browser.iconpicker-fonts-browser .media-sidebar { + width: 32%; +} + +.nv-upgrade-notice { + background: #FFFFFF; + border: 1px solid #E1E1E1; + box-sizing: border-box; + padding: 20px; + display: flex; + flex-wrap: wrap; +} + +.nv-upgrade-notice .menu-icon-notice-popup-img { + width: 115px; + height: 100px; + background-color: #f1f1f1; + margin-right: 20px; + margin-bottom: 20px; +} + +.nv-upgrade-notice .menu-icon-notice-popup-img img{ + width: 100%; + height: 100%; + object-fit: cover; +} + +.nv-upgrade-notice .menu-icon-notice-popup { + flex: 1; +} + +.nv-upgrade-notice .menu-icon-notice-popup h4{ + padding: 0; + margin: 0 0 8px; + font-weight: 590; + font-size: 14px; + line-height: 1.2; + color: #000000; + display: block; + width: 100%; +} + +.nv-upgrade-notice .menu-icon-notice-popup p { + font-size: 13px; + line-height: 1.2; + color: #000000; + margin: 0 0 16px; + display: block; + padding: 0; +} + +.nv-upgrade-notice .menu-icon-notice-popup .button { + width: auto; + height: 30px; + background: #0071AE; + border-radius: 4px; + padding: 5px 12px; + font-size: 13px; + line-height: 1.5; + color: #fff; +} + +.nv-upgrade-notice .menu-icon-notice-popup .button:hover { + color: #fff; +} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.min.css new file mode 100644 index 00000000..2d4fd049 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.min.css @@ -0,0 +1 @@ +.menu-icons-wrap{margin-top:5px;margin-bottom:5px}.menu-icons-wrap p{min-height:2.2em;margin-bottom:0}.menu-icons-wrap p a,.menu-icons-wrap p label{display:inline-block;height:100%;line-height:2.2em;vertical-align:middle}.menu-icons-wrap a{text-decoration:none;cursor:pointer}.menu-icons-wrap .submitdelete{display:inline-block;float:none;height:100%;margin:0;padding:0;line-height:2.2em}.menu-icons-wrap .hidden{display:none}.menu-icons-wrap ._icon{width:auto;height:auto;margin:-.1em .2em 0 .2em;color:#666;font-size:1.9em;vertical-align:middle}.menu-icons-wrap img._icon{max-width:24px}.menu-icons-wrap a._select:focus ._icon,.menu-icons-wrap a._select:hover ._icon{color:#101010}.mi-preview.menu-item{min-height:0;font-size:1.2em}.mi-preview.menu-item a{text-decoration:none}.mi-preview.menu-item a>*{display:inline-block;height:100%;line-height:100%;vertical-align:middle}.mi-preview.menu-item ._icon{margin-right:.25em}.rtl .mi-preview.menu-item ._icon{margin-right:0}.media-sidebar .mi-settings .setting input[type=number],.menu-icons-settings input[type=number]{float:none;width:auto;max-width:5em}.media-sidebar .mi-settings .setting input,.media-sidebar .mi-settings span.description{float:none}.menu-icons-settings ._field{padding:.5em 0}.menu-icons-settings ._field ._main{display:block;margin-bottom:.25em;font-weight:700}#menu-settings-column .menu-icons-settings .inside{margin-top:0}.menu-icons-settings .taxonomydiv .tabs-panel{max-height:none;margin-bottom:.75em;padding-top:.3em;padding-bottom:.4em}.js .menu-icons-settings .taxonomydiv .tabs-panel{margin-bottom:0}.menu-icons-settings h4{margin:0}.menu-icons-settings ._menu span.description{margin-left:.5em}.menu-icons-settings ._extensions ul{margin-top:.75em;padding-left:1.5em;list-style:disc}.menu-icons-settings ._extensions ul a{text-decoration:none}.menu-icons-settings .spinner{float:none;margin:0 5px 0 0;vertical-align:middle}.attachment .svg-icon img{max-width:100%}.nv-upgrade-notice{width:90%;margin-top:0;padding:15px}#menu-icons-sidebar div.new-card{width:auto;min-width:initial;max-width:initial;margin:10px auto}.menu-icons-subscribe{padding:15px}.menu-icons-submit-mail{width:auto}#success{display:none}#failure{display:none}.attachments-browser.iconpicker-fonts-browser .media-toolbar{width:62%}.attachments-browser.iconpicker-fonts-browser .attachments.iconpicker-items{width:64%}.attachments-browser.iconpicker-fonts-browser .media-sidebar{width:32%}.nv-upgrade-notice{background:#fff;border:1px solid #e1e1e1;box-sizing:border-box;padding:20px;display:flex;flex-wrap:wrap}.nv-upgrade-notice .menu-icon-notice-popup-img{width:115px;height:100px;background-color:#f1f1f1;margin-right:20px;margin-bottom:20px}.nv-upgrade-notice .menu-icon-notice-popup-img img{width:100%;height:100%;object-fit:cover}.nv-upgrade-notice .menu-icon-notice-popup{flex:1}.nv-upgrade-notice .menu-icon-notice-popup h4{padding:0;margin:0 0 8px;font-weight:590;font-size:14px;line-height:1.2;color:#000;display:block;width:100%}.nv-upgrade-notice .menu-icon-notice-popup p{font-size:13px;line-height:1.2;color:#000;margin:0 0 16px;display:block;padding:0}.nv-upgrade-notice .menu-icon-notice-popup .button{width:auto;height:30px;background:#0071ae;border-radius:4px;padding:5px 12px;font-size:13px;line-height:1.5;color:#fff}.nv-upgrade-notice .menu-icon-notice-popup .button:hover{color:#fff} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.css new file mode 100644 index 00000000..7a937595 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.css @@ -0,0 +1,45 @@ +.menu-icon-dashboard-notice { + position: relative; + background: #FFFFFF; + border: 1px solid #E1E1E1; + box-sizing: border-box; + padding: 24px; + border-left: 4px solid #72AEE6; + margin: 0 0 30px; +} + +.menu-icon-dashboard-notice h2 { + padding: 0; + margin: 0 0 8px; + font-weight: bold; + font-size: 18px; + line-height: 1.2; + color: #000000; +} + +.menu-icon-dashboard-notice p { + font-size: 12px; + line-height: 1.2; + color: #000000; + display: block; + margin-bottom: 16px; +} + +.menu-icon-dashboard-notice .button { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 5px 12px; + background: #0071AE; + border-radius: 4px; + display: inline-block; + width: auto; + height: 30px; + color: #FFFFFF; + font-size: 13px; + line-height: 1.5; +} +.menu-icon-dashboard-notice .notice-dismiss { + text-decoration: none; +} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.min.css new file mode 100644 index 00000000..65ed114b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.min.css @@ -0,0 +1 @@ +.menu-icon-dashboard-notice{position:relative;background:#fff;border:1px solid #e1e1e1;box-sizing:border-box;padding:24px;border-left:4px solid #72aee6;margin:0 0 30px}.menu-icon-dashboard-notice h2{padding:0;margin:0 0 8px;font-weight:700;font-size:18px;line-height:1.2;color:#000}.menu-icon-dashboard-notice p{font-size:12px;line-height:1.2;color:#000;display:block;margin-bottom:16px}.menu-icon-dashboard-notice .button{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:5px 12px;background:#0071ae;border-radius:4px;display:inline-block;width:auto;height:30px;color:#fff;font-size:13px;line-height:1.5}.menu-icon-dashboard-notice .notice-dismiss{text-decoration:none} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.css new file mode 100644 index 00000000..ec8b2a60 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.css @@ -0,0 +1,74 @@ +.menu-item i._mi, +.menu-item img._mi { + display: inline-block; + vertical-align: middle; +} + +.menu-item i._mi { + width: auto; + height: auto; + margin-top: -0.265em; + font-size: 1.2em; + line-height: 1; +} + +.menu-item i._before, +.rtl .menu-item i._after { + margin-right: 0.25em; +} + +.menu-item i._after, +.rtl .menu-item i._before { + margin-left: 0.25em; +} + +.menu-item img._before, +.rtl .menu-item img._after { + margin-right: 0.5em; +} + +.menu-item img._after, +.rtl .menu-item img._before { + margin-left: 0.5em; +} + +.menu-item ._svg { + width: 1em; +} + +.rtl .menu-item i._before { + margin-right: 0; +} + +.rtl .menu-item i._after { + margin-left: 0; +} + +.visuallyhidden { + overflow: hidden; + clip: rect(0 0 0 0); + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + border: 0; +} + +.menu-item i.elusive { + margin-top: -0.3em; +} + +/** + * Force the icons' styles + * + * Some themes -- notably 2014 -- has nasty rules that + * could override the icons' styles so we need to force them here. + */ +.dashicons-admin-site:before { + content: "\f319" !important; +} + +.dashicons-welcome-view-site:before { + content: "\f115" !important; +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.min.css new file mode 100644 index 00000000..7ff02d86 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.min.css @@ -0,0 +1 @@ +.menu-item i._mi,.menu-item img._mi{display:inline-block;vertical-align:middle}.menu-item i._mi{width:auto;height:auto;margin-top:-.265em;font-size:1.2em;line-height:1}.menu-item i._before,.rtl .menu-item i._after{margin-right:.25em}.menu-item i._after,.rtl .menu-item i._before{margin-left:.25em}.menu-item img._before,.rtl .menu-item img._after{margin-right:.5em}.menu-item img._after,.rtl .menu-item img._before{margin-left:.5em}.menu-item ._svg{width:1em}.rtl .menu-item i._before{margin-right:0}.rtl .menu-item i._after{margin-left:0}.visuallyhidden{overflow:hidden;clip:rect(0 0 0 0);position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0}.menu-item i.elusive{margin-top:-.3em}.dashicons-admin-site:before{content:"\f319"!important}.dashicons-welcome-view-site:before{content:"\f115"!important} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/LICENSE.txt new file mode 100644 index 00000000..f31bef92 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/LICENSE.txt @@ -0,0 +1,34 @@ +Font Awesome Free License +------------------------- + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) +In the Font Awesome Free download, the CC BY 4.0 license applies to all icons +packaged as SVG and JS file types. + +# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +# Code: MIT License (https://opensource.org/licenses/MIT) +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +# Attribution +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +# Brand Icons +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/css/all.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/css/all.min.css new file mode 100644 index 00000000..b9a01fbb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/css/all.min.css @@ -0,0 +1,6 @@ +/*! + * Font Awesome Free 6.1.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2022 Fonticons, Inc. + */ +.fa{font-family:var(--fa-style-family,"Font Awesome 6 Free");font-weight:var(--fa-style,900)}.fa,.fa-brands,.fa-duotone,.fa-light,.fa-regular,.fa-solid,.fa-thin,.fab,.fad,.fal,.far,.fas,.fat{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:var(--fa-display,inline-block);font-style:normal;font-variant:normal;line-height:1;text-rendering:auto}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width, 2em)*-1);position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-radius:var(--fa-border-radius,.1em);border:var(--fa-border-width,.08em) var(--fa-border-style,solid) var(--fa-border-color,#eee);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade,.fa-fade{-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s)}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-shake,.fa-spin{-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-duration:var(--fa-animation-duration,2s);animation-duration:var(--fa-animation-duration,2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,steps(8));animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@-webkit-keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle,none));transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%;z-index:var(--fa-stack-z-index,auto)}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:var(--fa-inverse,#fff)}.fa-0:before{content:"\30"}.fa-1:before{content:"\31"}.fa-2:before{content:"\32"}.fa-3:before{content:"\33"}.fa-4:before{content:"\34"}.fa-5:before{content:"\35"}.fa-6:before{content:"\36"}.fa-7:before{content:"\37"}.fa-8:before{content:"\38"}.fa-9:before{content:"\39"}.fa-a:before{content:"\41"}.fa-address-book:before,.fa-contact-book:before{content:"\f2b9"}.fa-address-card:before,.fa-contact-card:before,.fa-vcard:before{content:"\f2bb"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-anchor:before{content:"\f13d"}.fa-anchor-circle-check:before{content:"\e4aa"}.fa-anchor-circle-exclamation:before{content:"\e4ab"}.fa-anchor-circle-xmark:before{content:"\e4ac"}.fa-anchor-lock:before{content:"\e4ad"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-double-down:before,.fa-angles-down:before{content:"\f103"}.fa-angle-double-left:before,.fa-angles-left:before{content:"\f100"}.fa-angle-double-right:before,.fa-angles-right:before{content:"\f101"}.fa-angle-double-up:before,.fa-angles-up:before{content:"\f102"}.fa-ankh:before{content:"\f644"}.fa-apple-alt:before,.fa-apple-whole:before{content:"\f5d1"}.fa-archway:before{content:"\f557"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-down-1-9:before,.fa-sort-numeric-asc:before,.fa-sort-numeric-down:before{content:"\f162"}.fa-arrow-down-9-1:before,.fa-sort-numeric-desc:before,.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-arrow-down-a-z:before,.fa-sort-alpha-asc:before,.fa-sort-alpha-down:before{content:"\f15d"}.fa-arrow-down-long:before,.fa-long-arrow-down:before{content:"\f175"}.fa-arrow-down-short-wide:before,.fa-sort-amount-desc:before,.fa-sort-amount-down-alt:before{content:"\f884"}.fa-arrow-down-up-across-line:before{content:"\e4af"}.fa-arrow-down-up-lock:before{content:"\e4b0"}.fa-arrow-down-wide-short:before,.fa-sort-amount-asc:before,.fa-sort-amount-down:before{content:"\f160"}.fa-arrow-down-z-a:before,.fa-sort-alpha-desc:before,.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-left-long:before,.fa-long-arrow-left:before{content:"\f177"}.fa-arrow-pointer:before,.fa-mouse-pointer:before{content:"\f245"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-right-arrow-left:before,.fa-exchange:before{content:"\f0ec"}.fa-arrow-right-from-bracket:before,.fa-sign-out:before{content:"\f08b"}.fa-arrow-right-long:before,.fa-long-arrow-right:before{content:"\f178"}.fa-arrow-right-to-bracket:before,.fa-sign-in:before{content:"\f090"}.fa-arrow-right-to-city:before{content:"\e4b3"}.fa-arrow-left-rotate:before,.fa-arrow-rotate-back:before,.fa-arrow-rotate-backward:before,.fa-arrow-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-arrow-right-rotate:before,.fa-arrow-rotate-forward:before,.fa-arrow-rotate-right:before,.fa-redo:before{content:"\f01e"}.fa-arrow-trend-down:before{content:"\e097"}.fa-arrow-trend-up:before{content:"\e098"}.fa-arrow-turn-down:before,.fa-level-down:before{content:"\f149"}.fa-arrow-turn-up:before,.fa-level-up:before{content:"\f148"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-up-1-9:before,.fa-sort-numeric-up:before{content:"\f163"}.fa-arrow-up-9-1:before,.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-arrow-up-a-z:before,.fa-sort-alpha-up:before{content:"\f15e"}.fa-arrow-up-from-bracket:before{content:"\e09a"}.fa-arrow-up-from-ground-water:before{content:"\e4b5"}.fa-arrow-up-from-water-pump:before{content:"\e4b6"}.fa-arrow-up-long:before,.fa-long-arrow-up:before{content:"\f176"}.fa-arrow-up-right-dots:before{content:"\e4b7"}.fa-arrow-up-right-from-square:before,.fa-external-link:before{content:"\f08e"}.fa-arrow-up-short-wide:before,.fa-sort-amount-up-alt:before{content:"\f885"}.fa-arrow-up-wide-short:before,.fa-sort-amount-up:before{content:"\f161"}.fa-arrow-up-z-a:before,.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-arrows-down-to-line:before{content:"\e4b8"}.fa-arrows-down-to-people:before{content:"\e4b9"}.fa-arrows-h:before,.fa-arrows-left-right:before{content:"\f07e"}.fa-arrows-left-right-to-line:before{content:"\e4ba"}.fa-arrows-rotate:before,.fa-refresh:before,.fa-sync:before{content:"\f021"}.fa-arrows-spin:before{content:"\e4bb"}.fa-arrows-split-up-and-left:before{content:"\e4bc"}.fa-arrows-to-circle:before{content:"\e4bd"}.fa-arrows-to-dot:before{content:"\e4be"}.fa-arrows-to-eye:before{content:"\e4bf"}.fa-arrows-turn-right:before{content:"\e4c0"}.fa-arrows-turn-to-dots:before{content:"\e4c1"}.fa-arrows-up-down:before,.fa-arrows-v:before{content:"\f07d"}.fa-arrows-up-down-left-right:before,.fa-arrows:before{content:"\f047"}.fa-arrows-up-to-line:before{content:"\e4c2"}.fa-asterisk:before{content:"\2a"}.fa-at:before{content:"\40"}.fa-atom:before{content:"\f5d2"}.fa-audio-description:before{content:"\f29e"}.fa-austral-sign:before{content:"\e0a9"}.fa-award:before{content:"\f559"}.fa-b:before{content:"\42"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before,.fa-carriage-baby:before{content:"\f77d"}.fa-backward:before{content:"\f04a"}.fa-backward-fast:before,.fa-fast-backward:before{content:"\f049"}.fa-backward-step:before,.fa-step-backward:before{content:"\f048"}.fa-bacon:before{content:"\f7e5"}.fa-bacteria:before{content:"\e059"}.fa-bacterium:before{content:"\e05a"}.fa-bag-shopping:before,.fa-shopping-bag:before{content:"\f290"}.fa-bahai:before,.fa-haykal:before{content:"\f666"}.fa-baht-sign:before{content:"\e0ac"}.fa-ban:before,.fa-cancel:before{content:"\f05e"}.fa-ban-smoking:before,.fa-smoking-ban:before{content:"\f54d"}.fa-band-aid:before,.fa-bandage:before{content:"\f462"}.fa-barcode:before{content:"\f02a"}.fa-bars:before,.fa-navicon:before{content:"\f0c9"}.fa-bars-progress:before,.fa-tasks-alt:before{content:"\f828"}.fa-bars-staggered:before,.fa-reorder:before,.fa-stream:before{content:"\f550"}.fa-baseball-ball:before,.fa-baseball:before{content:"\f433"}.fa-baseball-bat-ball:before{content:"\f432"}.fa-basket-shopping:before,.fa-shopping-basket:before{content:"\f291"}.fa-basketball-ball:before,.fa-basketball:before{content:"\f434"}.fa-bath:before,.fa-bathtub:before{content:"\f2cd"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-battery-5:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-half:before{content:"\f242"}.fa-battery-2:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-4:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-bed-pulse:before,.fa-procedures:before{content:"\f487"}.fa-beer-mug-empty:before,.fa-beer:before{content:"\f0fc"}.fa-bell:before{content:"\f0f3"}.fa-bell-concierge:before,.fa-concierge-bell:before{content:"\f562"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bicycle:before{content:"\f206"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-bitcoin-sign:before{content:"\e0b4"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blog:before{content:"\f781"}.fa-bold:before{content:"\f032"}.fa-bolt:before,.fa-zap:before{content:"\f0e7"}.fa-bolt-lightning:before{content:"\e0b7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-atlas:before,.fa-book-atlas:before{content:"\f558"}.fa-bible:before,.fa-book-bible:before{content:"\f647"}.fa-book-bookmark:before{content:"\e0bb"}.fa-book-journal-whills:before,.fa-journal-whills:before{content:"\f66a"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-open-reader:before,.fa-book-reader:before{content:"\f5da"}.fa-book-quran:before,.fa-quran:before{content:"\f687"}.fa-book-dead:before,.fa-book-skull:before{content:"\f6b7"}.fa-book-tanakh:before,.fa-tanakh:before{content:"\f827"}.fa-bookmark:before{content:"\f02e"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before,.fa-border-top-left:before{content:"\f853"}.fa-bore-hole:before{content:"\e4c3"}.fa-bottle-droplet:before{content:"\e4c4"}.fa-bottle-water:before{content:"\e4c5"}.fa-bowl-food:before{content:"\e4c6"}.fa-bowl-rice:before{content:"\e2eb"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-archive:before,.fa-box-archive:before{content:"\f187"}.fa-box-open:before{content:"\f49e"}.fa-box-tissue:before{content:"\e05b"}.fa-boxes-packing:before{content:"\e4c7"}.fa-boxes-alt:before,.fa-boxes-stacked:before,.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-brazilian-real-sign:before{content:"\e46c"}.fa-bread-slice:before{content:"\f7ec"}.fa-bridge:before{content:"\e4c8"}.fa-bridge-circle-check:before{content:"\e4c9"}.fa-bridge-circle-exclamation:before{content:"\e4ca"}.fa-bridge-circle-xmark:before{content:"\e4cb"}.fa-bridge-lock:before{content:"\e4cc"}.fa-bridge-water:before{content:"\e4ce"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broom:before{content:"\f51a"}.fa-broom-ball:before,.fa-quidditch-broom-ball:before,.fa-quidditch:before{content:"\f458"}.fa-brush:before{content:"\f55d"}.fa-bucket:before{content:"\e4cf"}.fa-bug:before{content:"\f188"}.fa-bug-slash:before{content:"\e490"}.fa-bugs:before{content:"\e4d0"}.fa-building:before{content:"\f1ad"}.fa-building-circle-arrow-right:before{content:"\e4d1"}.fa-building-circle-check:before{content:"\e4d2"}.fa-building-circle-exclamation:before{content:"\e4d3"}.fa-building-circle-xmark:before{content:"\e4d4"}.fa-bank:before,.fa-building-columns:before,.fa-institution:before,.fa-museum:before,.fa-university:before{content:"\f19c"}.fa-building-flag:before{content:"\e4d5"}.fa-building-lock:before{content:"\e4d6"}.fa-building-ngo:before{content:"\e4d7"}.fa-building-shield:before{content:"\e4d8"}.fa-building-un:before{content:"\e4d9"}.fa-building-user:before{content:"\e4da"}.fa-building-wheat:before{content:"\e4db"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burger:before,.fa-hamburger:before{content:"\f805"}.fa-burst:before{content:"\e4dc"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before,.fa-bus-simple:before{content:"\f55e"}.fa-briefcase-clock:before,.fa-business-time:before{content:"\f64a"}.fa-c:before{content:"\43"}.fa-cable-car:before,.fa-tram:before{content:"\f7da"}.fa-birthday-cake:before,.fa-cake-candles:before,.fa-cake:before{content:"\f1fd"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-alt:before,.fa-calendar-days:before{content:"\f073"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-week:before{content:"\f784"}.fa-calendar-times:before,.fa-calendar-xmark:before{content:"\f273"}.fa-camera-alt:before,.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-camera-rotate:before{content:"\e0d8"}.fa-campground:before{content:"\f6bb"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-battery-car:before,.fa-car-battery:before{content:"\f5df"}.fa-car-burst:before,.fa-car-crash:before{content:"\f5e1"}.fa-car-on:before{content:"\e4dd"}.fa-car-alt:before,.fa-car-rear:before{content:"\f5de"}.fa-car-side:before{content:"\f5e4"}.fa-car-tunnel:before{content:"\e4de"}.fa-caravan:before{content:"\f8ff"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-flatbed:before,.fa-dolly-flatbed:before{content:"\f474"}.fa-cart-flatbed-suitcase:before,.fa-luggage-cart:before{content:"\f59d"}.fa-cart-plus:before{content:"\f217"}.fa-cart-shopping:before,.fa-shopping-cart:before{content:"\f07a"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cedi-sign:before{content:"\e0df"}.fa-cent-sign:before{content:"\e3f5"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-blackboard:before,.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before,.fa-chalkboard-user:before{content:"\f51c"}.fa-champagne-glasses:before,.fa-glass-cheers:before{content:"\f79f"}.fa-charging-station:before{content:"\f5e7"}.fa-area-chart:before,.fa-chart-area:before{content:"\f1fe"}.fa-bar-chart:before,.fa-chart-bar:before{content:"\f080"}.fa-chart-column:before{content:"\e0e3"}.fa-chart-gantt:before{content:"\e0e4"}.fa-chart-line:before,.fa-line-chart:before{content:"\f201"}.fa-chart-pie:before,.fa-pie-chart:before{content:"\f200"}.fa-chart-simple:before{content:"\e473"}.fa-check:before{content:"\f00c"}.fa-check-double:before{content:"\f560"}.fa-check-to-slot:before,.fa-vote-yea:before{content:"\f772"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-child-dress:before{content:"\e59c"}.fa-child-reaching:before{content:"\e59d"}.fa-child-rifle:before{content:"\e4e0"}.fa-children:before{content:"\e4e1"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-arrow-circle-down:before,.fa-circle-arrow-down:before{content:"\f0ab"}.fa-arrow-circle-left:before,.fa-circle-arrow-left:before{content:"\f0a8"}.fa-arrow-circle-right:before,.fa-circle-arrow-right:before{content:"\f0a9"}.fa-arrow-circle-up:before,.fa-circle-arrow-up:before{content:"\f0aa"}.fa-check-circle:before,.fa-circle-check:before{content:"\f058"}.fa-chevron-circle-down:before,.fa-circle-chevron-down:before{content:"\f13a"}.fa-chevron-circle-left:before,.fa-circle-chevron-left:before{content:"\f137"}.fa-chevron-circle-right:before,.fa-circle-chevron-right:before{content:"\f138"}.fa-chevron-circle-up:before,.fa-circle-chevron-up:before{content:"\f139"}.fa-circle-dollar-to-slot:before,.fa-donate:before{content:"\f4b9"}.fa-circle-dot:before,.fa-dot-circle:before{content:"\f192"}.fa-arrow-alt-circle-down:before,.fa-circle-down:before{content:"\f358"}.fa-circle-exclamation:before,.fa-exclamation-circle:before{content:"\f06a"}.fa-circle-h:before,.fa-hospital-symbol:before{content:"\f47e"}.fa-adjust:before,.fa-circle-half-stroke:before{content:"\f042"}.fa-circle-info:before,.fa-info-circle:before{content:"\f05a"}.fa-arrow-alt-circle-left:before,.fa-circle-left:before{content:"\f359"}.fa-circle-minus:before,.fa-minus-circle:before{content:"\f056"}.fa-circle-nodes:before{content:"\e4e2"}.fa-circle-notch:before{content:"\f1ce"}.fa-circle-pause:before,.fa-pause-circle:before{content:"\f28b"}.fa-circle-play:before,.fa-play-circle:before{content:"\f144"}.fa-circle-plus:before,.fa-plus-circle:before{content:"\f055"}.fa-circle-question:before,.fa-question-circle:before{content:"\f059"}.fa-circle-radiation:before,.fa-radiation-alt:before{content:"\f7ba"}.fa-arrow-alt-circle-right:before,.fa-circle-right:before{content:"\f35a"}.fa-circle-stop:before,.fa-stop-circle:before{content:"\f28d"}.fa-arrow-alt-circle-up:before,.fa-circle-up:before{content:"\f35b"}.fa-circle-user:before,.fa-user-circle:before{content:"\f2bd"}.fa-circle-xmark:before,.fa-times-circle:before,.fa-xmark-circle:before{content:"\f057"}.fa-city:before{content:"\f64f"}.fa-clapperboard:before{content:"\e131"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clipboard-question:before{content:"\e4e3"}.fa-clipboard-user:before{content:"\f7f3"}.fa-clock-four:before,.fa-clock:before{content:"\f017"}.fa-clock-rotate-left:before,.fa-history:before{content:"\f1da"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-arrow-down:before,.fa-cloud-download-alt:before,.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-arrow-up:before,.fa-cloud-upload-alt:before,.fa-cloud-upload:before{content:"\f0ee"}.fa-cloud-bolt:before,.fa-thunderstorm:before{content:"\f76c"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-showers-water:before{content:"\e4e4"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-clover:before{content:"\e139"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-code-commit:before{content:"\f386"}.fa-code-compare:before{content:"\e13a"}.fa-code-fork:before{content:"\e13b"}.fa-code-merge:before{content:"\f387"}.fa-code-pull-request:before{content:"\e13c"}.fa-coins:before{content:"\f51e"}.fa-colon-sign:before{content:"\e140"}.fa-comment:before{content:"\f075"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before,.fa-commenting:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comment-sms:before,.fa-sms:before{content:"\f7cd"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compass-drafting:before,.fa-drafting-compass:before{content:"\f568"}.fa-compress:before{content:"\f066"}.fa-computer:before{content:"\e4e5"}.fa-computer-mouse:before,.fa-mouse:before{content:"\f8cc"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cow:before{content:"\f6c8"}.fa-credit-card-alt:before,.fa-credit-card:before{content:"\f09d"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before,.fa-crop-simple:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-cruzeiro-sign:before{content:"\e152"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cubes-stacked:before{content:"\e4e6"}.fa-d:before{content:"\44"}.fa-database:before{content:"\f1c0"}.fa-backspace:before,.fa-delete-left:before{content:"\f55a"}.fa-democrat:before{content:"\f747"}.fa-desktop-alt:before,.fa-desktop:before{content:"\f390"}.fa-dharmachakra:before{content:"\f655"}.fa-diagram-next:before{content:"\e476"}.fa-diagram-predecessor:before{content:"\e477"}.fa-diagram-project:before,.fa-project-diagram:before{content:"\f542"}.fa-diagram-successor:before{content:"\e47a"}.fa-diamond:before{content:"\f219"}.fa-diamond-turn-right:before,.fa-directions:before{content:"\f5eb"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-disease:before{content:"\f7fa"}.fa-display:before{content:"\e163"}.fa-divide:before{content:"\f529"}.fa-dna:before{content:"\f471"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before,.fa-dollar:before,.fa-usd:before{content:"\24"}.fa-dolly-box:before,.fa-dolly:before{content:"\f472"}.fa-dong-sign:before{content:"\e169"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dove:before{content:"\f4ba"}.fa-compress-alt:before,.fa-down-left-and-up-right-to-center:before{content:"\f422"}.fa-down-long:before,.fa-long-arrow-alt-down:before{content:"\f309"}.fa-download:before{content:"\f019"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-droplet:before,.fa-tint:before{content:"\f043"}.fa-droplet-slash:before,.fa-tint-slash:before{content:"\f5c7"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-e:before{content:"\45"}.fa-deaf:before,.fa-deafness:before,.fa-ear-deaf:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-assistive-listening-systems:before,.fa-ear-listen:before{content:"\f2a2"}.fa-earth-africa:before,.fa-globe-africa:before{content:"\f57c"}.fa-earth-america:before,.fa-earth-americas:before,.fa-earth:before,.fa-globe-americas:before{content:"\f57d"}.fa-earth-asia:before,.fa-globe-asia:before{content:"\f57e"}.fa-earth-europe:before,.fa-globe-europe:before{content:"\f7a2"}.fa-earth-oceania:before,.fa-globe-oceania:before{content:"\e47b"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elevator:before{content:"\e16d"}.fa-ellipsis-h:before,.fa-ellipsis:before{content:"\f141"}.fa-ellipsis-v:before,.fa-ellipsis-vertical:before{content:"\f142"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-circle-check:before{content:"\e4e8"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelopes-bulk:before,.fa-mail-bulk:before{content:"\f674"}.fa-equals:before{content:"\3d"}.fa-eraser:before{content:"\f12d"}.fa-ethernet:before{content:"\f796"}.fa-eur:before,.fa-euro-sign:before,.fa-euro:before{content:"\f153"}.fa-exclamation:before{content:"\21"}.fa-expand:before{content:"\f065"}.fa-explosion:before{content:"\e4e9"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper-empty:before,.fa-eye-dropper:before,.fa-eyedropper:before{content:"\f1fb"}.fa-eye-low-vision:before,.fa-low-vision:before{content:"\f2a8"}.fa-eye-slash:before{content:"\f070"}.fa-f:before{content:"\46"}.fa-angry:before,.fa-face-angry:before{content:"\f556"}.fa-dizzy:before,.fa-face-dizzy:before{content:"\f567"}.fa-face-flushed:before,.fa-flushed:before{content:"\f579"}.fa-face-frown:before,.fa-frown:before{content:"\f119"}.fa-face-frown-open:before,.fa-frown-open:before{content:"\f57a"}.fa-face-grimace:before,.fa-grimace:before{content:"\f57f"}.fa-face-grin:before,.fa-grin:before{content:"\f580"}.fa-face-grin-beam:before,.fa-grin-beam:before{content:"\f582"}.fa-face-grin-beam-sweat:before,.fa-grin-beam-sweat:before{content:"\f583"}.fa-face-grin-hearts:before,.fa-grin-hearts:before{content:"\f584"}.fa-face-grin-squint:before,.fa-grin-squint:before{content:"\f585"}.fa-face-grin-squint-tears:before,.fa-grin-squint-tears:before{content:"\f586"}.fa-face-grin-stars:before,.fa-grin-stars:before{content:"\f587"}.fa-face-grin-tears:before,.fa-grin-tears:before{content:"\f588"}.fa-face-grin-tongue:before,.fa-grin-tongue:before{content:"\f589"}.fa-face-grin-tongue-squint:before,.fa-grin-tongue-squint:before{content:"\f58a"}.fa-face-grin-tongue-wink:before,.fa-grin-tongue-wink:before{content:"\f58b"}.fa-face-grin-wide:before,.fa-grin-alt:before{content:"\f581"}.fa-face-grin-wink:before,.fa-grin-wink:before{content:"\f58c"}.fa-face-kiss:before,.fa-kiss:before{content:"\f596"}.fa-face-kiss-beam:before,.fa-kiss-beam:before{content:"\f597"}.fa-face-kiss-wink-heart:before,.fa-kiss-wink-heart:before{content:"\f598"}.fa-face-laugh:before,.fa-laugh:before{content:"\f599"}.fa-face-laugh-beam:before,.fa-laugh-beam:before{content:"\f59a"}.fa-face-laugh-squint:before,.fa-laugh-squint:before{content:"\f59b"}.fa-face-laugh-wink:before,.fa-laugh-wink:before{content:"\f59c"}.fa-face-meh:before,.fa-meh:before{content:"\f11a"}.fa-face-meh-blank:before,.fa-meh-blank:before{content:"\f5a4"}.fa-face-rolling-eyes:before,.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-face-sad-cry:before,.fa-sad-cry:before{content:"\f5b3"}.fa-face-sad-tear:before,.fa-sad-tear:before{content:"\f5b4"}.fa-face-smile:before,.fa-smile:before{content:"\f118"}.fa-face-smile-beam:before,.fa-smile-beam:before{content:"\f5b8"}.fa-face-smile-wink:before,.fa-smile-wink:before{content:"\f4da"}.fa-face-surprise:before,.fa-surprise:before{content:"\f5c2"}.fa-face-tired:before,.fa-tired:before{content:"\f5c8"}.fa-fan:before{content:"\f863"}.fa-faucet:before{content:"\e005"}.fa-faucet-drip:before{content:"\e006"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before,.fa-feather-pointed:before{content:"\f56b"}.fa-ferry:before{content:"\e4ea"}.fa-file:before{content:"\f15b"}.fa-file-arrow-down:before,.fa-file-download:before{content:"\f56d"}.fa-file-arrow-up:before,.fa-file-upload:before{content:"\f574"}.fa-file-audio:before{content:"\f1c7"}.fa-file-circle-check:before{content:"\e5a0"}.fa-file-circle-exclamation:before{content:"\e4eb"}.fa-file-circle-minus:before{content:"\e4ed"}.fa-file-circle-plus:before{content:"\e494"}.fa-file-circle-question:before{content:"\e4ef"}.fa-file-circle-xmark:before{content:"\e5a1"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-excel:before{content:"\f1c3"}.fa-arrow-right-from-file:before,.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-arrow-right-to-file:before,.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-alt:before,.fa-file-lines:before,.fa-file-text:before{content:"\f15c"}.fa-file-medical:before{content:"\f477"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-edit:before,.fa-file-pen:before{content:"\f31c"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-shield:before{content:"\e4f0"}.fa-file-signature:before{content:"\f573"}.fa-file-video:before{content:"\f1c8"}.fa-file-medical-alt:before,.fa-file-waveform:before{content:"\f478"}.fa-file-word:before{content:"\f1c2"}.fa-file-archive:before,.fa-file-zipper:before{content:"\f1c6"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-filter-circle-dollar:before,.fa-funnel-dollar:before{content:"\f662"}.fa-filter-circle-xmark:before{content:"\e17b"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-burner:before{content:"\e4f1"}.fa-fire-extinguisher:before{content:"\f134"}.fa-fire-alt:before,.fa-fire-flame-curved:before{content:"\f7e4"}.fa-burn:before,.fa-fire-flame-simple:before{content:"\f46a"}.fa-fish:before{content:"\f578"}.fa-fish-fins:before{content:"\e4f2"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flask-vial:before{content:"\e4f3"}.fa-floppy-disk:before,.fa-save:before{content:"\f0c7"}.fa-florin-sign:before{content:"\e184"}.fa-folder-blank:before,.fa-folder:before{content:"\f07b"}.fa-folder-closed:before{content:"\e185"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-folder-tree:before{content:"\f802"}.fa-font:before{content:"\f031"}.fa-football-ball:before,.fa-football:before{content:"\f44e"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before,.fa-forward-fast:before{content:"\f050"}.fa-forward-step:before,.fa-step-forward:before{content:"\f051"}.fa-franc-sign:before{content:"\e18f"}.fa-frog:before{content:"\f52e"}.fa-futbol-ball:before,.fa-futbol:before,.fa-soccer-ball:before{content:"\f1e3"}.fa-g:before{content:"\47"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-dashboard:before,.fa-gauge-med:before,.fa-gauge:before,.fa-tachometer-alt-average:before{content:"\f624"}.fa-gauge-high:before,.fa-tachometer-alt-fast:before,.fa-tachometer-alt:before{content:"\f625"}.fa-gauge-simple-med:before,.fa-gauge-simple:before,.fa-tachometer-average:before{content:"\f629"}.fa-gauge-simple-high:before,.fa-tachometer-fast:before,.fa-tachometer:before{content:"\f62a"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-glass-water:before{content:"\e4f4"}.fa-glass-water-droplet:before{content:"\e4f5"}.fa-glasses:before{content:"\f530"}.fa-globe:before{content:"\f0ac"}.fa-golf-ball-tee:before,.fa-golf-ball:before{content:"\f450"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-greater-than:before{content:"\3e"}.fa-greater-than-equal:before{content:"\f532"}.fa-grip-horizontal:before,.fa-grip:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-group-arrows-rotate:before{content:"\e4f6"}.fa-guarani-sign:before{content:"\e19a"}.fa-guitar:before{content:"\f7a6"}.fa-gun:before{content:"\e19b"}.fa-h:before{content:"\48"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-paper:before,.fa-hand:before{content:"\f256"}.fa-hand-back-fist:before,.fa-hand-rock:before{content:"\f255"}.fa-allergies:before,.fa-hand-dots:before{content:"\f461"}.fa-fist-raised:before,.fa-hand-fist:before{content:"\f6de"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-dollar:before,.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-holding-droplet:before,.fa-hand-holding-water:before{content:"\f4c1"}.fa-hand-holding-hand:before{content:"\e4f7"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-medical:before{content:"\e05c"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-sparkles:before{content:"\e05d"}.fa-hand-spock:before{content:"\f259"}.fa-handcuffs:before{content:"\e4f8"}.fa-hands:before,.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before,.fa-hands-american-sign-language-interpreting:before,.fa-hands-asl-interpreting:before{content:"\f2a3"}.fa-hands-bound:before{content:"\e4f9"}.fa-hands-bubbles:before,.fa-hands-wash:before{content:"\e05e"}.fa-hands-clapping:before{content:"\e1a8"}.fa-hands-holding:before{content:"\f4c2"}.fa-hands-holding-child:before{content:"\e4fa"}.fa-hands-holding-circle:before{content:"\e4fb"}.fa-hands-praying:before,.fa-praying-hands:before{content:"\f684"}.fa-handshake:before{content:"\f2b5"}.fa-hands-helping:before,.fa-handshake-angle:before{content:"\f4c4"}.fa-handshake-alt:before,.fa-handshake-simple:before{content:"\f4c6"}.fa-handshake-alt-slash:before,.fa-handshake-simple-slash:before{content:"\e05f"}.fa-handshake-slash:before{content:"\e060"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-drive:before,.fa-hdd:before{content:"\f0a0"}.fa-hashtag:before{content:"\23"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-head-side-cough:before{content:"\e061"}.fa-head-side-cough-slash:before{content:"\e062"}.fa-head-side-mask:before{content:"\e063"}.fa-head-side-virus:before{content:"\e064"}.fa-header:before,.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before,.fa-headphones-simple:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-circle-bolt:before{content:"\e4fc"}.fa-heart-circle-check:before{content:"\e4fd"}.fa-heart-circle-exclamation:before{content:"\e4fe"}.fa-heart-circle-minus:before{content:"\e4ff"}.fa-heart-circle-plus:before{content:"\e500"}.fa-heart-circle-xmark:before{content:"\e501"}.fa-heart-broken:before,.fa-heart-crack:before{content:"\f7a9"}.fa-heart-pulse:before,.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-helicopter-symbol:before{content:"\e502"}.fa-hard-hat:before,.fa-hat-hard:before,.fa-helmet-safety:before{content:"\f807"}.fa-helmet-un:before{content:"\e503"}.fa-highlighter:before{content:"\f591"}.fa-hill-avalanche:before{content:"\e507"}.fa-hill-rockslide:before{content:"\e508"}.fa-hippo:before{content:"\f6ed"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital-alt:before,.fa-hospital-wide:before,.fa-hospital:before{content:"\f0f8"}.fa-hospital-user:before{content:"\f80d"}.fa-hot-tub-person:before,.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hourglass-empty:before,.fa-hourglass:before{content:"\f254"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-home-alt:before,.fa-home-lg-alt:before,.fa-home:before,.fa-house:before{content:"\f015"}.fa-home-lg:before,.fa-house-chimney:before{content:"\e3af"}.fa-house-chimney-crack:before,.fa-house-damage:before{content:"\f6f1"}.fa-clinic-medical:before,.fa-house-chimney-medical:before{content:"\f7f2"}.fa-house-chimney-user:before{content:"\e065"}.fa-house-chimney-window:before{content:"\e00d"}.fa-house-circle-check:before{content:"\e509"}.fa-house-circle-exclamation:before{content:"\e50a"}.fa-house-circle-xmark:before{content:"\e50b"}.fa-house-crack:before{content:"\e3b1"}.fa-house-fire:before{content:"\e50c"}.fa-house-flag:before{content:"\e50d"}.fa-house-flood-water:before{content:"\e50e"}.fa-house-flood-water-circle-arrow-right:before{content:"\e50f"}.fa-house-laptop:before,.fa-laptop-house:before{content:"\e066"}.fa-house-lock:before{content:"\e510"}.fa-house-medical:before{content:"\e3b2"}.fa-house-medical-circle-check:before{content:"\e511"}.fa-house-medical-circle-exclamation:before{content:"\e512"}.fa-house-medical-circle-xmark:before{content:"\e513"}.fa-house-medical-flag:before{content:"\e514"}.fa-house-signal:before{content:"\e012"}.fa-house-tsunami:before{content:"\e515"}.fa-home-user:before,.fa-house-user:before{content:"\e1b0"}.fa-hryvnia-sign:before,.fa-hryvnia:before{content:"\f6f2"}.fa-hurricane:before{content:"\f751"}.fa-i:before{content:"\49"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-heart-music-camera-bolt:before,.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before,.fa-id-card-clip:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-image-portrait:before,.fa-portrait:before{content:"\f3e0"}.fa-images:before{content:"\f302"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-indian-rupee-sign:before,.fa-indian-rupee:before,.fa-inr:before{content:"\e1bc"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-italic:before{content:"\f033"}.fa-j:before{content:"\4a"}.fa-jar:before{content:"\e516"}.fa-jar-wheat:before{content:"\e517"}.fa-jedi:before{content:"\f669"}.fa-fighter-jet:before,.fa-jet-fighter:before{content:"\f0fb"}.fa-jet-fighter-up:before{content:"\e518"}.fa-joint:before{content:"\f595"}.fa-jug-detergent:before{content:"\e519"}.fa-k:before{content:"\4b"}.fa-kaaba:before{content:"\f66b"}.fa-key:before{content:"\f084"}.fa-keyboard:before{content:"\f11c"}.fa-khanda:before{content:"\f66d"}.fa-kip-sign:before{content:"\e1c4"}.fa-first-aid:before,.fa-kit-medical:before{content:"\f479"}.fa-kitchen-set:before{content:"\e51a"}.fa-kiwi-bird:before{content:"\f535"}.fa-l:before{content:"\4c"}.fa-land-mine-on:before{content:"\e51b"}.fa-landmark:before{content:"\f66f"}.fa-landmark-alt:before,.fa-landmark-dome:before{content:"\f752"}.fa-landmark-flag:before{content:"\e51c"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-file:before{content:"\e51d"}.fa-laptop-medical:before{content:"\f812"}.fa-lari-sign:before{content:"\e1c8"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-left-long:before,.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-arrows-alt-h:before,.fa-left-right:before{content:"\f337"}.fa-lemon:before{content:"\f094"}.fa-less-than:before{content:"\3c"}.fa-less-than-equal:before{content:"\f537"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-lines-leaning:before{content:"\e51e"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-chain-broken:before,.fa-chain-slash:before,.fa-link-slash:before,.fa-unlink:before{content:"\f127"}.fa-lira-sign:before{content:"\f195"}.fa-list-squares:before,.fa-list:before{content:"\f03a"}.fa-list-check:before,.fa-tasks:before{content:"\f0ae"}.fa-list-1-2:before,.fa-list-numeric:before,.fa-list-ol:before{content:"\f0cb"}.fa-list-dots:before,.fa-list-ul:before{content:"\f0ca"}.fa-litecoin-sign:before{content:"\e1d3"}.fa-location-arrow:before{content:"\f124"}.fa-location-crosshairs:before,.fa-location:before{content:"\f601"}.fa-location-dot:before,.fa-map-marker-alt:before{content:"\f3c5"}.fa-location-pin:before,.fa-map-marker:before{content:"\f041"}.fa-location-pin-lock:before{content:"\e51f"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-locust:before{content:"\e520"}.fa-lungs:before{content:"\f604"}.fa-lungs-virus:before{content:"\e067"}.fa-m:before{content:"\4d"}.fa-magnet:before{content:"\f076"}.fa-magnifying-glass:before,.fa-search:before{content:"\f002"}.fa-magnifying-glass-arrow-right:before{content:"\e521"}.fa-magnifying-glass-chart:before{content:"\e522"}.fa-magnifying-glass-dollar:before,.fa-search-dollar:before{content:"\f688"}.fa-magnifying-glass-location:before,.fa-search-location:before{content:"\f689"}.fa-magnifying-glass-minus:before,.fa-search-minus:before{content:"\f010"}.fa-magnifying-glass-plus:before,.fa-search-plus:before{content:"\f00e"}.fa-manat-sign:before{content:"\e1d5"}.fa-map:before{content:"\f279"}.fa-map-location:before,.fa-map-marked:before{content:"\f59f"}.fa-map-location-dot:before,.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-pin:before{content:"\f276"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-and-venus:before{content:"\f224"}.fa-mars-and-venus-burst:before{content:"\e523"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before,.fa-mars-stroke-right:before{content:"\f22b"}.fa-mars-stroke-up:before,.fa-mars-stroke-v:before{content:"\f22a"}.fa-glass-martini-alt:before,.fa-martini-glass:before{content:"\f57b"}.fa-cocktail:before,.fa-martini-glass-citrus:before{content:"\f561"}.fa-glass-martini:before,.fa-martini-glass-empty:before{content:"\f000"}.fa-mask:before{content:"\f6fa"}.fa-mask-face:before{content:"\e1d7"}.fa-mask-ventilator:before{content:"\e524"}.fa-masks-theater:before,.fa-theater-masks:before{content:"\f630"}.fa-mattress-pillow:before{content:"\e525"}.fa-expand-arrows-alt:before,.fa-maximize:before{content:"\f31e"}.fa-medal:before{content:"\f5a2"}.fa-memory:before{content:"\f538"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-comment-alt:before,.fa-message:before{content:"\f27a"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before,.fa-microphone-lines:before{content:"\f3c9"}.fa-microphone-alt-slash:before,.fa-microphone-lines-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-mill-sign:before{content:"\e1ed"}.fa-compress-arrows-alt:before,.fa-minimize:before{content:"\f78c"}.fa-minus:before,.fa-subtract:before{content:"\f068"}.fa-mitten:before{content:"\f7b5"}.fa-mobile-android:before,.fa-mobile-phone:before,.fa-mobile:before{content:"\f3ce"}.fa-mobile-button:before{content:"\f10b"}.fa-mobile-retro:before{content:"\e527"}.fa-mobile-android-alt:before,.fa-mobile-screen:before{content:"\f3cf"}.fa-mobile-alt:before,.fa-mobile-screen-button:before{content:"\f3cd"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-1:before,.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-1-wave:before,.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-bill-transfer:before{content:"\e528"}.fa-money-bill-trend-up:before{content:"\e529"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wheat:before{content:"\e52a"}.fa-money-bills:before{content:"\e1f3"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before,.fa-money-check-dollar:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-mosquito:before{content:"\e52b"}.fa-mosquito-net:before{content:"\e52c"}.fa-motorcycle:before{content:"\f21c"}.fa-mound:before{content:"\e52d"}.fa-mountain:before{content:"\f6fc"}.fa-mountain-city:before{content:"\e52e"}.fa-mountain-sun:before{content:"\e52f"}.fa-mug-hot:before{content:"\f7b6"}.fa-coffee:before,.fa-mug-saucer:before{content:"\f0f4"}.fa-music:before{content:"\f001"}.fa-n:before{content:"\4e"}.fa-naira-sign:before{content:"\e1f6"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-not-equal:before{content:"\f53e"}.fa-notdef:before{content:"\e1fe"}.fa-note-sticky:before,.fa-sticky-note:before{content:"\f249"}.fa-notes-medical:before{content:"\f481"}.fa-o:before{content:"\4f"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-oil-can:before{content:"\f613"}.fa-oil-well:before{content:"\e532"}.fa-om:before{content:"\f679"}.fa-otter:before{content:"\f700"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-p:before{content:"\50"}.fa-pager:before{content:"\f815"}.fa-paint-roller:before{content:"\f5aa"}.fa-paint-brush:before,.fa-paintbrush:before{content:"\f1fc"}.fa-palette:before{content:"\f53f"}.fa-pallet:before{content:"\f482"}.fa-panorama:before{content:"\e209"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-passport:before{content:"\f5ab"}.fa-file-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-pause:before{content:"\f04c"}.fa-paw:before{content:"\f1b0"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before,.fa-pen-clip:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-ruler:before,.fa-pencil-ruler:before{content:"\f5ae"}.fa-edit:before,.fa-pen-to-square:before{content:"\f044"}.fa-pencil-alt:before,.fa-pencil:before{content:"\f303"}.fa-people-arrows-left-right:before,.fa-people-arrows:before{content:"\e068"}.fa-people-carry-box:before,.fa-people-carry:before{content:"\f4ce"}.fa-people-group:before{content:"\e533"}.fa-people-line:before{content:"\e534"}.fa-people-pulling:before{content:"\e535"}.fa-people-robbery:before{content:"\e536"}.fa-people-roof:before{content:"\e537"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before,.fa-percentage:before{content:"\25"}.fa-male:before,.fa-person:before{content:"\f183"}.fa-person-arrow-down-to-line:before{content:"\e538"}.fa-person-arrow-up-from-line:before{content:"\e539"}.fa-biking:before,.fa-person-biking:before{content:"\f84a"}.fa-person-booth:before{content:"\f756"}.fa-person-breastfeeding:before{content:"\e53a"}.fa-person-burst:before{content:"\e53b"}.fa-person-cane:before{content:"\e53c"}.fa-person-chalkboard:before{content:"\e53d"}.fa-person-circle-check:before{content:"\e53e"}.fa-person-circle-exclamation:before{content:"\e53f"}.fa-person-circle-minus:before{content:"\e540"}.fa-person-circle-plus:before{content:"\e541"}.fa-person-circle-question:before{content:"\e542"}.fa-person-circle-xmark:before{content:"\e543"}.fa-digging:before,.fa-person-digging:before{content:"\f85e"}.fa-diagnoses:before,.fa-person-dots-from-line:before{content:"\f470"}.fa-female:before,.fa-person-dress:before{content:"\f182"}.fa-person-dress-burst:before{content:"\e544"}.fa-person-drowning:before{content:"\e545"}.fa-person-falling:before{content:"\e546"}.fa-person-falling-burst:before{content:"\e547"}.fa-person-half-dress:before{content:"\e548"}.fa-person-harassing:before{content:"\e549"}.fa-hiking:before,.fa-person-hiking:before{content:"\f6ec"}.fa-person-military-pointing:before{content:"\e54a"}.fa-person-military-rifle:before{content:"\e54b"}.fa-person-military-to-person:before{content:"\e54c"}.fa-person-praying:before,.fa-pray:before{content:"\f683"}.fa-person-pregnant:before{content:"\e31e"}.fa-person-rays:before{content:"\e54d"}.fa-person-rifle:before{content:"\e54e"}.fa-person-running:before,.fa-running:before{content:"\f70c"}.fa-person-shelter:before{content:"\e54f"}.fa-person-skating:before,.fa-skating:before{content:"\f7c5"}.fa-person-skiing:before,.fa-skiing:before{content:"\f7c9"}.fa-person-skiing-nordic:before,.fa-skiing-nordic:before{content:"\f7ca"}.fa-person-snowboarding:before,.fa-snowboarding:before{content:"\f7ce"}.fa-person-swimming:before,.fa-swimmer:before{content:"\f5c4"}.fa-person-through-window:before{content:"\e5a9"}.fa-person-walking:before,.fa-walking:before{content:"\f554"}.fa-person-walking-arrow-loop-left:before{content:"\e551"}.fa-person-walking-arrow-right:before{content:"\e552"}.fa-person-walking-dashed-line-arrow-right:before{content:"\e553"}.fa-person-walking-luggage:before{content:"\e554"}.fa-blind:before,.fa-person-walking-with-cane:before{content:"\f29d"}.fa-peseta-sign:before{content:"\e221"}.fa-peso-sign:before{content:"\e222"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before,.fa-phone-flip:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-volume:before,.fa-volume-control-phone:before{content:"\f2a0"}.fa-photo-film:before,.fa-photo-video:before{content:"\f87c"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-circle-check:before{content:"\e555"}.fa-plane-circle-exclamation:before{content:"\e556"}.fa-plane-circle-xmark:before{content:"\e557"}.fa-plane-departure:before{content:"\f5b0"}.fa-plane-lock:before{content:"\e558"}.fa-plane-slash:before{content:"\e069"}.fa-plane-up:before{content:"\e22d"}.fa-plant-wilt:before{content:"\e5aa"}.fa-plate-wheat:before{content:"\e55a"}.fa-play:before{content:"\f04b"}.fa-plug:before{content:"\f1e6"}.fa-plug-circle-bolt:before{content:"\e55b"}.fa-plug-circle-check:before{content:"\e55c"}.fa-plug-circle-exclamation:before{content:"\e55d"}.fa-plug-circle-minus:before{content:"\e55e"}.fa-plug-circle-plus:before{content:"\e55f"}.fa-plug-circle-xmark:before{content:"\e560"}.fa-add:before,.fa-plus:before{content:"\2b"}.fa-plus-minus:before{content:"\e43c"}.fa-podcast:before{content:"\f2ce"}.fa-poo:before{content:"\f2fe"}.fa-poo-bolt:before,.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-power-off:before{content:"\f011"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before,.fa-prescription-bottle-medical:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-pump-medical:before{content:"\e06a"}.fa-pump-soap:before{content:"\e06b"}.fa-puzzle-piece:before{content:"\f12e"}.fa-q:before{content:"\51"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\3f"}.fa-quote-left-alt:before,.fa-quote-left:before{content:"\f10d"}.fa-quote-right-alt:before,.fa-quote-right:before{content:"\f10e"}.fa-r:before{content:"\52"}.fa-radiation:before{content:"\f7b9"}.fa-radio:before{content:"\f8d7"}.fa-rainbow:before{content:"\f75b"}.fa-ranking-star:before{content:"\e561"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-ad:before,.fa-rectangle-ad:before{content:"\f641"}.fa-list-alt:before,.fa-rectangle-list:before{content:"\f022"}.fa-rectangle-times:before,.fa-rectangle-xmark:before,.fa-times-rectangle:before,.fa-window-close:before{content:"\f410"}.fa-recycle:before{content:"\f1b8"}.fa-registered:before{content:"\f25d"}.fa-repeat:before{content:"\f363"}.fa-mail-reply:before,.fa-reply:before{content:"\f3e5"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-republican:before{content:"\f75e"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-ribbon:before{content:"\f4d6"}.fa-right-from-bracket:before,.fa-sign-out-alt:before{content:"\f2f5"}.fa-exchange-alt:before,.fa-right-left:before{content:"\f362"}.fa-long-arrow-alt-right:before,.fa-right-long:before{content:"\f30b"}.fa-right-to-bracket:before,.fa-sign-in-alt:before{content:"\f2f6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-road-barrier:before{content:"\e562"}.fa-road-bridge:before{content:"\e563"}.fa-road-circle-check:before{content:"\e564"}.fa-road-circle-exclamation:before{content:"\e565"}.fa-road-circle-xmark:before{content:"\e566"}.fa-road-lock:before{content:"\e567"}.fa-road-spikes:before{content:"\e568"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rotate:before,.fa-sync-alt:before{content:"\f2f1"}.fa-rotate-back:before,.fa-rotate-backward:before,.fa-rotate-left:before,.fa-undo-alt:before{content:"\f2ea"}.fa-redo-alt:before,.fa-rotate-forward:before,.fa-rotate-right:before{content:"\f2f9"}.fa-route:before{content:"\f4d7"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-rouble:before,.fa-rub:before,.fa-ruble-sign:before,.fa-ruble:before{content:"\f158"}.fa-rug:before{content:"\e569"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-rupee-sign:before,.fa-rupee:before{content:"\f156"}.fa-rupiah-sign:before{content:"\e23d"}.fa-s:before{content:"\53"}.fa-sack-dollar:before{content:"\f81d"}.fa-sack-xmark:before{content:"\e56a"}.fa-sailboat:before{content:"\e445"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-balance-scale:before,.fa-scale-balanced:before{content:"\f24e"}.fa-balance-scale-left:before,.fa-scale-unbalanced:before{content:"\f515"}.fa-balance-scale-right:before,.fa-scale-unbalanced-flip:before{content:"\f516"}.fa-school:before{content:"\f549"}.fa-school-circle-check:before{content:"\e56b"}.fa-school-circle-exclamation:before{content:"\e56c"}.fa-school-circle-xmark:before{content:"\e56d"}.fa-school-flag:before{content:"\e56e"}.fa-school-lock:before{content:"\e56f"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-screwdriver:before{content:"\f54a"}.fa-screwdriver-wrench:before,.fa-tools:before{content:"\f7d9"}.fa-scroll:before{content:"\f70e"}.fa-scroll-torah:before,.fa-torah:before{content:"\f6a0"}.fa-sd-card:before{content:"\f7c2"}.fa-section:before{content:"\e447"}.fa-seedling:before,.fa-sprout:before{content:"\f4d8"}.fa-server:before{content:"\f233"}.fa-shapes:before,.fa-triangle-circle-square:before{content:"\f61f"}.fa-arrow-turn-right:before,.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-share-from-square:before,.fa-share-square:before{content:"\f14d"}.fa-share-alt:before,.fa-share-nodes:before{content:"\f1e0"}.fa-sheet-plastic:before{content:"\e571"}.fa-ils:before,.fa-shekel-sign:before,.fa-shekel:before,.fa-sheqel-sign:before,.fa-sheqel:before{content:"\f20b"}.fa-shield-blank:before,.fa-shield:before{content:"\f132"}.fa-shield-cat:before{content:"\e572"}.fa-shield-dog:before{content:"\e573"}.fa-shield-alt:before,.fa-shield-halved:before{content:"\f3ed"}.fa-shield-heart:before{content:"\e574"}.fa-shield-virus:before{content:"\e06c"}.fa-ship:before{content:"\f21a"}.fa-shirt:before,.fa-t-shirt:before,.fa-tshirt:before{content:"\f553"}.fa-shoe-prints:before{content:"\f54b"}.fa-shop:before,.fa-store-alt:before{content:"\f54f"}.fa-shop-lock:before{content:"\e4a5"}.fa-shop-slash:before,.fa-store-alt-slash:before{content:"\e070"}.fa-shower:before{content:"\f2cc"}.fa-shrimp:before{content:"\e448"}.fa-random:before,.fa-shuffle:before{content:"\f074"}.fa-shuttle-space:before,.fa-space-shuttle:before{content:"\f197"}.fa-sign-hanging:before,.fa-sign:before{content:"\f4d9"}.fa-signal-5:before,.fa-signal-perfect:before,.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-map-signs:before,.fa-signs-post:before{content:"\f277"}.fa-sim-card:before{content:"\f7c4"}.fa-sink:before{content:"\e06d"}.fa-sitemap:before{content:"\f0e8"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before,.fa-sliders:before{content:"\f1de"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-soap:before{content:"\e06e"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-spa:before{content:"\f5bb"}.fa-pastafarianism:before,.fa-spaghetti-monster-flying:before{content:"\f67b"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spoon:before,.fa-utensil-spoon:before{content:"\f2e5"}.fa-spray-can:before{content:"\f5bd"}.fa-air-freshener:before,.fa-spray-can-sparkles:before{content:"\f5d0"}.fa-square:before{content:"\f0c8"}.fa-external-link-square:before,.fa-square-arrow-up-right:before{content:"\f14c"}.fa-caret-square-down:before,.fa-square-caret-down:before{content:"\f150"}.fa-caret-square-left:before,.fa-square-caret-left:before{content:"\f191"}.fa-caret-square-right:before,.fa-square-caret-right:before{content:"\f152"}.fa-caret-square-up:before,.fa-square-caret-up:before{content:"\f151"}.fa-check-square:before,.fa-square-check:before{content:"\f14a"}.fa-envelope-square:before,.fa-square-envelope:before{content:"\f199"}.fa-square-full:before{content:"\f45c"}.fa-h-square:before,.fa-square-h:before{content:"\f0fd"}.fa-minus-square:before,.fa-square-minus:before{content:"\f146"}.fa-square-nfi:before{content:"\e576"}.fa-parking:before,.fa-square-parking:before{content:"\f540"}.fa-pen-square:before,.fa-pencil-square:before,.fa-square-pen:before{content:"\f14b"}.fa-square-person-confined:before{content:"\e577"}.fa-phone-square:before,.fa-square-phone:before{content:"\f098"}.fa-phone-square-alt:before,.fa-square-phone-flip:before{content:"\f87b"}.fa-plus-square:before,.fa-square-plus:before{content:"\f0fe"}.fa-poll-h:before,.fa-square-poll-horizontal:before{content:"\f682"}.fa-poll:before,.fa-square-poll-vertical:before{content:"\f681"}.fa-square-root-alt:before,.fa-square-root-variable:before{content:"\f698"}.fa-rss-square:before,.fa-square-rss:before{content:"\f143"}.fa-share-alt-square:before,.fa-square-share-nodes:before{content:"\f1e1"}.fa-external-link-square-alt:before,.fa-square-up-right:before{content:"\f360"}.fa-square-virus:before{content:"\e578"}.fa-square-xmark:before,.fa-times-square:before,.fa-xmark-square:before{content:"\f2d3"}.fa-rod-asclepius:before,.fa-rod-snake:before,.fa-staff-aesculapius:before,.fa-staff-snake:before{content:"\e579"}.fa-stairs:before{content:"\e289"}.fa-stamp:before{content:"\f5bf"}.fa-stapler:before{content:"\e5af"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before,.fa-star-half-stroke:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-gbp:before,.fa-pound-sign:before,.fa-sterling-sign:before{content:"\f154"}.fa-stethoscope:before{content:"\f0f1"}.fa-stop:before{content:"\f04d"}.fa-stopwatch:before{content:"\f2f2"}.fa-stopwatch-20:before{content:"\e06f"}.fa-store:before{content:"\f54e"}.fa-store-slash:before{content:"\e071"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stroopwafel:before{content:"\f551"}.fa-subscript:before{content:"\f12c"}.fa-suitcase:before{content:"\f0f2"}.fa-medkit:before,.fa-suitcase-medical:before{content:"\f0fa"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-sun-plant-wilt:before{content:"\e57a"}.fa-superscript:before{content:"\f12b"}.fa-swatchbook:before{content:"\f5c3"}.fa-synagogue:before{content:"\f69b"}.fa-syringe:before{content:"\f48e"}.fa-t:before{content:"\54"}.fa-table:before{content:"\f0ce"}.fa-table-cells:before,.fa-th:before{content:"\f00a"}.fa-table-cells-large:before,.fa-th-large:before{content:"\f009"}.fa-columns:before,.fa-table-columns:before{content:"\f0db"}.fa-table-list:before,.fa-th-list:before{content:"\f00b"}.fa-ping-pong-paddle-ball:before,.fa-table-tennis-paddle-ball:before,.fa-table-tennis:before{content:"\f45d"}.fa-tablet-android:before,.fa-tablet:before{content:"\f3fb"}.fa-tablet-button:before{content:"\f10a"}.fa-tablet-alt:before,.fa-tablet-screen-button:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-digital-tachograph:before,.fa-tachograph-digital:before{content:"\f566"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tarp:before{content:"\e57b"}.fa-tarp-droplet:before{content:"\e57c"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-temperature-arrow-down:before,.fa-temperature-down:before{content:"\e03f"}.fa-temperature-arrow-up:before,.fa-temperature-up:before{content:"\e040"}.fa-temperature-0:before,.fa-temperature-empty:before,.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-temperature-4:before,.fa-temperature-full:before,.fa-thermometer-4:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-temperature-2:before,.fa-temperature-half:before,.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-temperature-1:before,.fa-temperature-quarter:before,.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-temperature-3:before,.fa-temperature-three-quarters:before,.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-tenge-sign:before,.fa-tenge:before{content:"\f7d7"}.fa-tent:before{content:"\e57d"}.fa-tent-arrow-down-to-line:before{content:"\e57e"}.fa-tent-arrow-left-right:before{content:"\e57f"}.fa-tent-arrow-turn-left:before{content:"\e580"}.fa-tent-arrows-down:before{content:"\e581"}.fa-tents:before{content:"\e582"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-remove-format:before,.fa-text-slash:before{content:"\f87d"}.fa-text-width:before{content:"\f035"}.fa-thermometer:before{content:"\f491"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumb-tack:before,.fa-thumbtack:before{content:"\f08d"}.fa-ticket:before{content:"\f145"}.fa-ticket-alt:before,.fa-ticket-simple:before{content:"\f3ff"}.fa-timeline:before{content:"\e29c"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toilet-paper-slash:before{content:"\e072"}.fa-toilet-portable:before{content:"\e583"}.fa-toilets-portable:before{content:"\e584"}.fa-toolbox:before{content:"\f552"}.fa-tooth:before{content:"\f5c9"}.fa-torii-gate:before{content:"\f6a1"}.fa-tornado:before{content:"\f76f"}.fa-broadcast-tower:before,.fa-tower-broadcast:before{content:"\f519"}.fa-tower-cell:before{content:"\e585"}.fa-tower-observation:before{content:"\e586"}.fa-tractor:before{content:"\f722"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-trailer:before{content:"\e041"}.fa-train:before{content:"\f238"}.fa-subway:before,.fa-train-subway:before{content:"\f239"}.fa-train-tram:before{content:"\e5b4"}.fa-transgender-alt:before,.fa-transgender:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-arrow-up:before,.fa-trash-restore:before{content:"\f829"}.fa-trash-alt:before,.fa-trash-can:before{content:"\f2ed"}.fa-trash-can-arrow-up:before,.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-tree-city:before{content:"\e587"}.fa-exclamation-triangle:before,.fa-triangle-exclamation:before,.fa-warning:before{content:"\f071"}.fa-trophy:before{content:"\f091"}.fa-trowel:before{content:"\e589"}.fa-trowel-bricks:before{content:"\e58a"}.fa-truck:before{content:"\f0d1"}.fa-truck-arrow-right:before{content:"\e58b"}.fa-truck-droplet:before{content:"\e58c"}.fa-shipping-fast:before,.fa-truck-fast:before{content:"\f48b"}.fa-truck-field:before{content:"\e58d"}.fa-truck-field-un:before{content:"\e58e"}.fa-truck-front:before{content:"\e2b7"}.fa-ambulance:before,.fa-truck-medical:before{content:"\f0f9"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-truck-plane:before{content:"\e58f"}.fa-truck-loading:before,.fa-truck-ramp-box:before{content:"\f4de"}.fa-teletype:before,.fa-tty:before{content:"\f1e4"}.fa-try:before,.fa-turkish-lira-sign:before,.fa-turkish-lira:before{content:"\e2bb"}.fa-level-down-alt:before,.fa-turn-down:before{content:"\f3be"}.fa-level-up-alt:before,.fa-turn-up:before{content:"\f3bf"}.fa-television:before,.fa-tv-alt:before,.fa-tv:before{content:"\f26c"}.fa-u:before{content:"\55"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-universal-access:before{content:"\f29a"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before,.fa-unlock-keyhole:before{content:"\f13e"}.fa-arrows-alt-v:before,.fa-up-down:before{content:"\f338"}.fa-arrows-alt:before,.fa-up-down-left-right:before{content:"\f0b2"}.fa-long-arrow-alt-up:before,.fa-up-long:before{content:"\f30c"}.fa-expand-alt:before,.fa-up-right-and-down-left-from-center:before{content:"\f424"}.fa-external-link-alt:before,.fa-up-right-from-square:before{content:"\f35d"}.fa-upload:before{content:"\f093"}.fa-user:before{content:"\f007"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-clock:before{content:"\f4fd"}.fa-user-doctor:before,.fa-user-md:before{content:"\f0f0"}.fa-user-cog:before,.fa-user-gear:before{content:"\f4fe"}.fa-user-graduate:before{content:"\f501"}.fa-user-friends:before,.fa-user-group:before{content:"\f500"}.fa-user-injured:before{content:"\f728"}.fa-user-alt:before,.fa-user-large:before{content:"\f406"}.fa-user-alt-slash:before,.fa-user-large-slash:before{content:"\f4fa"}.fa-user-lock:before{content:"\f502"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-edit:before,.fa-user-pen:before{content:"\f4ff"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before,.fa-user-xmark:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-between-lines:before{content:"\e591"}.fa-users-cog:before,.fa-users-gear:before{content:"\f509"}.fa-users-line:before{content:"\e592"}.fa-users-rays:before{content:"\e593"}.fa-users-rectangle:before{content:"\e594"}.fa-users-slash:before{content:"\e073"}.fa-users-viewfinder:before{content:"\e595"}.fa-cutlery:before,.fa-utensils:before{content:"\f2e7"}.fa-v:before{content:"\56"}.fa-shuttle-van:before,.fa-van-shuttle:before{content:"\f5b6"}.fa-vault:before{content:"\e2c5"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-vest:before{content:"\e085"}.fa-vest-patches:before{content:"\e086"}.fa-vial:before{content:"\f492"}.fa-vial-circle-check:before{content:"\e596"}.fa-vial-virus:before{content:"\e597"}.fa-vials:before{content:"\f493"}.fa-video-camera:before,.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-virus:before{content:"\e074"}.fa-virus-covid:before{content:"\e4a8"}.fa-virus-covid-slash:before{content:"\e4a9"}.fa-virus-slash:before{content:"\e075"}.fa-viruses:before{content:"\e076"}.fa-voicemail:before{content:"\f897"}.fa-volcano:before{content:"\f770"}.fa-volleyball-ball:before,.fa-volleyball:before{content:"\f45f"}.fa-volume-high:before,.fa-volume-up:before{content:"\f028"}.fa-volume-down:before,.fa-volume-low:before{content:"\f027"}.fa-volume-off:before{content:"\f026"}.fa-volume-mute:before,.fa-volume-times:before,.fa-volume-xmark:before{content:"\f6a9"}.fa-vr-cardboard:before{content:"\f729"}.fa-w:before{content:"\57"}.fa-walkie-talkie:before{content:"\f8ef"}.fa-wallet:before{content:"\f555"}.fa-magic:before,.fa-wand-magic:before{content:"\f0d0"}.fa-magic-wand-sparkles:before,.fa-wand-magic-sparkles:before{content:"\e2ca"}.fa-wand-sparkles:before{content:"\f72b"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-ladder-water:before,.fa-swimming-pool:before,.fa-water-ladder:before{content:"\f5c5"}.fa-wave-square:before{content:"\f83e"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weight-scale:before,.fa-weight:before{content:"\f496"}.fa-wheat-alt:before,.fa-wheat-awn:before{content:"\e2cd"}.fa-wheat-awn-circle-exclamation:before{content:"\e598"}.fa-wheelchair:before{content:"\f193"}.fa-wheelchair-alt:before,.fa-wheelchair-move:before{content:"\e2ce"}.fa-glass-whiskey:before,.fa-whiskey-glass:before{content:"\f7a0"}.fa-wifi-3:before,.fa-wifi-strong:before,.fa-wifi:before{content:"\f1eb"}.fa-wind:before{content:"\f72e"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before,.fa-wine-glass-empty:before{content:"\f5ce"}.fa-krw:before,.fa-won-sign:before,.fa-won:before{content:"\f159"}.fa-worm:before{content:"\e599"}.fa-wrench:before{content:"\f0ad"}.fa-x:before{content:"\58"}.fa-x-ray:before{content:"\f497"}.fa-close:before,.fa-multiply:before,.fa-remove:before,.fa-times:before,.fa-xmark:before{content:"\f00d"}.fa-xmarks-lines:before{content:"\e59a"}.fa-y:before{content:"\59"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen-sign:before,.fa-yen:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-z:before{content:"\5a"}.fa-sr-only,.fa-sr-only-focusable:not(:focus),.sr-only,.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host,:root{--fa-font-brands:normal 400 1em/1 "Font Awesome 6 Brands"}@font-face{font-family:"Font Awesome 6 Brands";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}.fa-brands,.fab{font-family:"Font Awesome 6 Brands";font-weight:400}.fa-42-group:before,.fa-innosoft:before{content:"\e080"}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-alipay:before{content:"\f642"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-amilia:before{content:"\f36d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-pay:before{content:"\f415"}.fa-artstation:before{content:"\f77a"}.fa-asymmetrik:before{content:"\f372"}.fa-atlassian:before{content:"\f77b"}.fa-audible:before{content:"\f373"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-aws:before{content:"\f375"}.fa-bandcamp:before{content:"\f2d5"}.fa-battle-net:before{content:"\f835"}.fa-behance:before{content:"\f1b4"}.fa-bilibili:before{content:"\e3d9"}.fa-bimobject:before{content:"\f378"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bootstrap:before{content:"\f836"}.fa-bots:before{content:"\e340"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-buromobelexperte:before{content:"\f37f"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-cloudflare:before{content:"\e07d"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cmplid:before{content:"\e360"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cotton-bureau:before{content:"\f89e"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-critical-role:before{content:"\f6c9"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dailymotion:before{content:"\e052"}.fa-dashcube:before{content:"\f210"}.fa-deezer:before{content:"\e077"}.fa-delicious:before{content:"\f1a5"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dhl:before{content:"\f790"}.fa-diaspora:before{content:"\f791"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-draft2digital:before{content:"\f396"}.fa-dribbble:before{content:"\f17d"}.fa-dropbox:before{content:"\f16b"}.fa-drupal:before{content:"\f1a9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edge-legacy:before{content:"\e078"}.fa-elementor:before{content:"\f430"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envira:before{content:"\f299"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-etsy:before{content:"\f2d7"}.fa-evernote:before{content:"\f839"}.fa-expeditedssl:before{content:"\f23e"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-figma:before{content:"\f799"}.fa-firefox:before{content:"\f269"}.fa-firefox-browser:before{content:"\e007"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-fly:before{content:"\f417"}.fa-font-awesome-flag:before,.fa-font-awesome-logo-full:before,.fa-font-awesome:before{content:"\f2b4"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-fulcrum:before{content:"\f50b"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-gofore:before{content:"\f3a7"}.fa-golang:before{content:"\e40f"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-pay:before{content:"\e079"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-wallet:before{content:"\f1ee"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guilded:before{content:"\e07e"}.fa-gulp:before{content:"\f3ae"}.fa-hacker-news:before{content:"\f1d4"}.fa-hackerrank:before{content:"\f5f7"}.fa-hashnode:before{content:"\e499"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-hive:before{content:"\e07f"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-hotjar:before{content:"\f3b1"}.fa-houzz:before{content:"\f27c"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-ideal:before{content:"\e013"}.fa-imdb:before{content:"\f2d8"}.fa-instagram:before{content:"\f16d"}.fa-instalod:before{content:"\e081"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joomla:before{content:"\f1aa"}.fa-js:before{content:"\f3b8"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaggle:before{content:"\f5fa"}.fa-keybase:before{content:"\f4f5"}.fa-keycdn:before{content:"\f3ba"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-korvue:before{content:"\f42f"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-leanpub:before{content:"\f212"}.fa-less:before{content:"\f41d"}.fa-line:before{content:"\f3c0"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-mailchimp:before{content:"\f59e"}.fa-mandalorian:before{content:"\f50f"}.fa-markdown:before{content:"\f60f"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medapps:before{content:"\f3c6"}.fa-medium-m:before,.fa-medium:before{content:"\f23a"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-mendeley:before{content:"\f7b3"}.fa-meta:before{content:"\e49b"}.fa-microblog:before{content:"\e01a"}.fa-microsoft:before{content:"\f3ca"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mixer:before{content:"\e056"}.fa-mizuni:before{content:"\f3cc"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-nfc-directional:before{content:"\e530"}.fa-nfc-symbol:before{content:"\e531"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-octopus-deploy:before{content:"\e082"}.fa-odnoklassniki:before{content:"\f263"}.fa-old-republic:before{content:"\f510"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-padlet:before{content:"\e4a0"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-palfed:before{content:"\f3d8"}.fa-patreon:before{content:"\f3d9"}.fa-paypal:before{content:"\f1ed"}.fa-perbyte:before{content:"\e083"}.fa-periscope:before{content:"\f3da"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pix:before{content:"\e43a"}.fa-playstation:before{content:"\f3df"}.fa-product-hunt:before{content:"\f288"}.fa-pushed:before{content:"\f3e1"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-r-project:before{content:"\f4f7"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-redhat:before{content:"\f7bc"}.fa-renren:before{content:"\f18b"}.fa-replyd:before{content:"\f3e6"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-rev:before{content:"\f5b2"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-rust:before{content:"\e07a"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-schlix:before{content:"\f3ea"}.fa-screenpal:before{content:"\e570"}.fa-scribd:before{content:"\f28a"}.fa-searchengin:before{content:"\f3eb"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-servicestack:before{content:"\f3ec"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shopify:before{content:"\e057"}.fa-shopware:before{content:"\f5b5"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sith:before{content:"\f512"}.fa-sitrox:before{content:"\e44a"}.fa-sketch:before{content:"\f7c6"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack-hash:before,.fa-slack:before{content:"\f198"}.fa-slideshare:before{content:"\f1e7"}.fa-snapchat-ghost:before,.fa-snapchat:before{content:"\f2ab"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-space-awesome:before{content:"\e5ac"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spotify:before{content:"\f1bc"}.fa-behance-square:before,.fa-square-behance:before{content:"\f1b5"}.fa-dribbble-square:before,.fa-square-dribbble:before{content:"\f397"}.fa-facebook-square:before,.fa-square-facebook:before{content:"\f082"}.fa-square-font-awesome:before{content:"\e5ad"}.fa-font-awesome-alt:before,.fa-square-font-awesome-stroke:before{content:"\f35c"}.fa-git-square:before,.fa-square-git:before{content:"\f1d2"}.fa-github-square:before,.fa-square-github:before{content:"\f092"}.fa-gitlab-square:before,.fa-square-gitlab:before{content:"\e5ae"}.fa-google-plus-square:before,.fa-square-google-plus:before{content:"\f0d4"}.fa-hacker-news-square:before,.fa-square-hacker-news:before{content:"\f3af"}.fa-instagram-square:before,.fa-square-instagram:before{content:"\e055"}.fa-js-square:before,.fa-square-js:before{content:"\f3b9"}.fa-lastfm-square:before,.fa-square-lastfm:before{content:"\f203"}.fa-odnoklassniki-square:before,.fa-square-odnoklassniki:before{content:"\f264"}.fa-pied-piper-square:before,.fa-square-pied-piper:before{content:"\e01e"}.fa-pinterest-square:before,.fa-square-pinterest:before{content:"\f0d3"}.fa-reddit-square:before,.fa-square-reddit:before{content:"\f1a2"}.fa-snapchat-square:before,.fa-square-snapchat:before{content:"\f2ad"}.fa-square-steam:before,.fa-steam-square:before{content:"\f1b7"}.fa-square-tumblr:before,.fa-tumblr-square:before{content:"\f174"}.fa-square-twitter:before,.fa-twitter-square:before{content:"\f081"}.fa-square-viadeo:before,.fa-viadeo-square:before{content:"\f2aa"}.fa-square-vimeo:before,.fa-vimeo-square:before{content:"\f194"}.fa-square-whatsapp:before,.fa-whatsapp-square:before{content:"\f40c"}.fa-square-xing:before,.fa-xing-square:before{content:"\f169"}.fa-square-youtube:before,.fa-youtube-square:before{content:"\f431"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-symbol:before{content:"\f3f6"}.fa-sticker-mule:before{content:"\f3f7"}.fa-strava:before{content:"\f428"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-superpowers:before{content:"\f2dd"}.fa-supple:before{content:"\f3f9"}.fa-suse:before{content:"\f7d6"}.fa-swift:before{content:"\f8e1"}.fa-symfony:before{content:"\f83d"}.fa-teamspeak:before{content:"\f4f9"}.fa-telegram-plane:before,.fa-telegram:before{content:"\f2c6"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-the-red-yeti:before{content:"\f69d"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-think-peaks:before{content:"\f731"}.fa-tiktok:before{content:"\e07b"}.fa-trade-federation:before{content:"\f513"}.fa-trello:before{content:"\f181"}.fa-tumblr:before{content:"\f173"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-uncharted:before{content:"\e084"}.fa-uniregistry:before{content:"\f404"}.fa-unity:before{content:"\e049"}.fa-unsplash:before{content:"\e07c"}.fa-untappd:before{content:"\f405"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-vaadin:before{content:"\f408"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viber:before{content:"\f409"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-vuejs:before{content:"\f41f"}.fa-watchman-monitoring:before{content:"\e087"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whmcs:before{content:"\f40d"}.fa-wikipedia-w:before{content:"\f266"}.fa-windows:before{content:"\f17a"}.fa-wirsindhandwerk:before,.fa-wsh:before{content:"\e2d0"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wodu:before{content:"\e088"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-rendact:before,.fa-wpressr:before{content:"\f3e4"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-zhihu:before{content:"\f63f"}:host,:root{--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}.fa-regular,.far{font-family:"Font Awesome 6 Free";font-weight:400}:host,:root{--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}.fa-solid,.fas{font-family:"Font Awesome 6 Free";font-weight:900}@font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:900;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:400;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype");unicode-range:u+f003,u+f006,u+f014,u+f016-f017,u+f01a-f01b,u+f01d,u+f022,u+f03e,u+f044,u+f046,u+f05c-f05d,u+f06e,u+f070,u+f087-f088,u+f08a,u+f094,u+f096-f097,u+f09d,u+f0a0,u+f0a2,u+f0a4-f0a7,u+f0c5,u+f0c7,u+f0e5-f0e6,u+f0eb,u+f0f6-f0f8,u+f10c,u+f114-f115,u+f118-f11a,u+f11c-f11d,u+f133,u+f147,u+f14e,u+f150-f152,u+f185-f186,u+f18e,u+f190-f192,u+f196,u+f1c1-f1c9,u+f1d9,u+f1db,u+f1e3,u+f1ea,u+f1f7,u+f1f9,u+f20a,u+f247-f248,u+f24a,u+f24d,u+f255-f25b,u+f25d,u+f271-f274,u+f278,u+f27b,u+f28c,u+f28e,u+f29c,u+f2b5,u+f2b7,u+f2ba,u+f2bc,u+f2be,u+f2c0-f2c1,u+f2c3,u+f2d0,u+f2d2,u+f2d4,u+f2dc}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-v4compatibility.woff2) format("woff2"),url(../webfonts/fa-v4compatibility.ttf) format("truetype");unicode-range:u+f041,u+f047,u+f065-f066,u+f07d-f07e,u+f080,u+f08b,u+f08e,u+f090,u+f09a,u+f0ac,u+f0ae,u+f0b2,u+f0d0,u+f0d6,u+f0e4,u+f0ec,u+f10a-f10b,u+f123,u+f13e,u+f148-f149,u+f14c,u+f156,u+f15e,u+f160-f161,u+f163,u+f175-f178,u+f195,u+f1f8,u+f219,u+f27a} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.ttf new file mode 100644 index 00000000..24ca8b17 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.woff2 new file mode 100644 index 00000000..e67e5cd5 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.ttf new file mode 100644 index 00000000..c5ac0095 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.woff2 new file mode 100644 index 00000000..7dca1d90 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.ttf new file mode 100644 index 00000000..43ba1cc7 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.woff2 new file mode 100644 index 00000000..4a7f9665 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.ttf new file mode 100644 index 00000000..243bc25b Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.woff2 new file mode 100644 index 00000000..e18a16d5 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/images/neve-theme.jpg b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/neve-theme.jpg new file mode 100644 index 00000000..2e1c1c56 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/neve-theme.jpg differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/images/otter-block.png b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/otter-block.png new file mode 100644 index 00000000..dec4b8cd Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/otter-block.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/front.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/front.php new file mode 100644 index 00000000..a411d97e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/front.php @@ -0,0 +1,516 @@ + + */ +final class Menu_Icons_Front_End { + + /** + * Icon types + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $icon_types = array(); + + /** + * Default icon style + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $default_style = array( + 'font_size' => array( + 'property' => 'font-size', + 'value' => '1.2', + 'unit' => 'em', + ), + 'vertical_align' => array( + 'property' => 'vertical-align', + 'value' => 'middle', + 'unit' => null, + ), + 'svg_width' => array( + 'property' => 'width', + 'value' => '1', + 'unit' => 'em', + ), + ); + + /** + * Hidden label class + * + * @since 0.9.0 + * @access protected + * @var string + */ + protected static $hidden_label_class = 'visuallyhidden'; + + + /** + * Add hooks for front-end functionalities + * + * @since 0.9.0 + */ + public static function init() { + $active_types = Menu_Icons_Settings::get( 'global', 'icon_types' ); + + if ( empty( $active_types ) ) { + return; + } + + foreach ( Menu_Icons::get( 'types' ) as $type ) { + if ( in_array( $type->id, $active_types, true ) ) { + self::$icon_types[ $type->id ] = $type; + } + } + + /** + * Allow themes/plugins to override the hidden label class + * + * @since 0.8.0 + * @param string $hidden_label_class Hidden label class. + * @return string + */ + self::$hidden_label_class = apply_filters( 'menu_icons_hidden_label_class', self::$hidden_label_class ); + + /** + * Allow themes/plugins to override default inline style + * + * @since 0.9.0 + * @param array $default_style Default inline style. + * @return array + */ + self::$default_style = apply_filters( 'menu_icons_default_style', self::$default_style ); + + add_action( 'wp_enqueue_scripts', array( __CLASS__, '_enqueue_styles' ), 4 ); + add_filter( 'wp_nav_menu_args', array( __CLASS__, '_add_menu_item_title_filter' ) ); + add_filter( 'wp_nav_menu', array( __CLASS__, '_remove_menu_item_title_filter' ) ); + } + + + /** + * Get nav menu ID based on arguments passed to wp_nav_menu() + * + * @since 0.3.0 + * @param array $args wp_nav_menu() Arguments + * @return mixed Nav menu ID or FALSE on failure + */ + public static function get_nav_menu_id( $args ) { + $args = (object) $args; + $menu = wp_get_nav_menu_object( $args->menu ); + + // Get the nav menu based on the theme_location + if ( ! $menu + && $args->theme_location + && ( $locations = get_nav_menu_locations() ) + && isset( $locations[ $args->theme_location ] ) + ) { + $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); + } + + // get the first menu that has items if we still can't find a menu + if ( ! $menu && ! $args->theme_location ) { + $menus = wp_get_nav_menus(); + foreach ( $menus as $menu_maybe ) { + if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) { + $menu = $menu_maybe; + break; + } + } + } + + if ( is_object( $menu ) && ! is_wp_error( $menu ) ) { + return $menu->term_id; + } else { + return false; + } + } + + + /** + * Enqueue stylesheets + * + * @since 0.1.0 + * @wp_hook action wp_enqueue_scripts + * @link http://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts + */ + public static function _enqueue_styles() { + // Deregister icon picker plugin font-awesome style and re-register with the new handler to avoid other plugin/theme style handler conflict. + $wp_styles = wp_styles(); + if ( $wp_styles && isset( $wp_styles->registered['font-awesome'] ) ) { + $registered = $wp_styles->registered['font-awesome']; + if ( strpos( $registered->src, Menu_Icons::get( 'url' ) ) !== false ) { + $wp_styles->remove( 'font-awesome' ); + $registered->ver = Menu_Icons_Font_Awesome::$version; + $wp_styles->add( 'menu-icon-' . $registered->handle, $registered->src, $registered->deps, $registered->ver, $registered->args ); + } + } + + foreach ( self::$icon_types as $type ) { + $stylesheet_id = $type->stylesheet_id; + if ( 'font-awesome' === $stylesheet_id ) { + $stylesheet_id = 'menu-icon-' . $stylesheet_id; + } + if ( wp_style_is( $stylesheet_id, 'registered' ) ) { + wp_enqueue_style( $stylesheet_id ); + } + } + + /** + * Allow plugins/themes to override the extra stylesheet location + * + * @since 0.9.0 + * @param string $extra_stylesheet_uri Extra stylesheet URI. + */ + $extra_stylesheet_uri = apply_filters( + 'menu_icons_extra_stylesheet_uri', + sprintf( '%scss/extra%s.css', Menu_Icons::get( 'url' ), kucrut_get_script_suffix() ) + ); + + wp_enqueue_style( + 'menu-icons-extra', + $extra_stylesheet_uri, + false, + Menu_Icons::VERSION + ); + } + + + /** + * Add filter to 'the_title' hook + * + * We need to filter the menu item title but **not** regular post titles. + * Thus, we're adding the filter when `wp_nav_menu()` is called. + * + * @since 0.1.0 + * @wp_hook filter wp_nav_menu_args + * @param array $args Not used. + * + * @return array + */ + public static function _add_menu_item_title_filter( $args ) { + add_filter( 'the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + add_filter( 'megamenu_the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + add_filter( 'megamenu_nav_menu_css_class', array( __CLASS__, '_add_menu_item_class' ), 10, 3 ); + + return $args; + } + + + /** + * Remove filter from 'the_title' hook + * + * Because we don't want to filter post titles, we need to remove our + * filter when `wp_nav_menu()` exits. + * + * @since 0.1.0 + * @wp_hook filter wp_nav_menu + * @param array $nav_menu Not used. + * @return array + */ + public static function _remove_menu_item_title_filter( $nav_menu ) { + remove_filter( 'the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + remove_filter( 'megamenu_the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + remove_filter( 'megamenu_nav_menu_css_class', array( __CLASS__, '_add_menu_item_class' ), 10, 3 ); + return $nav_menu; + } + + + /** + * Add icon to menu item title + * + * @since 0.1.0 + * @since 0.9.0 Renamed the method to `add_icon()`. + * @wp_hook filter the_title + * @param string $title Menu item title. + * @param int $id Menu item ID. + * + * @return string + */ + public static function _add_icon( $title, $id ) { + $meta = Menu_Icons_Meta::get( $id ); + $icon = self::get_icon( $meta ); + + if ( empty( $icon ) ) { + return $title; + } + $menu_id = Menu_Icons_Settings::get_current_menu_id(); + $menu_key = sprintf( 'menu_%d', $menu_id ); + $global_hide_label = Menu_Icons_Settings::get( $menu_key, 'hide_label' ); + $title_class = ! empty( $global_hide_label ) || ! empty( $meta['hide_label'] ) ? self::$hidden_label_class : ''; + $title_wrapped = sprintf( + '%s', + ( ! empty( $title_class ) ) ? sprintf( ' class="%s"', esc_attr( $title_class ) ) : '', + $title + ); + + if ( 'after' === $meta['position'] ) { + $title_with_icon = "{$title_wrapped}{$icon}"; + } else { + $title_with_icon = "{$icon}{$title_wrapped}"; + } + + /** + * Allow plugins/themes to override menu item markup + * + * @since 0.8.0 + * + * @param string $title_with_icon Menu item markup after the icon is added. + * @param integer $id Menu item ID. + * @param array $meta Menu item metadata values. + * @param string $title Original menu item title. + * + * @return string + */ + $title_with_icon = apply_filters( 'menu_icons_item_title', $title_with_icon, $id, $meta, $title ); + + return $title_with_icon; + } + + + /** + * Get icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_icon( $meta ) { + $icon = ''; + + // Icon type is not set. + if ( empty( $meta['type'] ) ) { + return $icon; + } + + // Icon is not set. + if ( empty( $meta['icon'] ) ) { + return $icon; + } + + // Icon type is not registered/enabled. + if ( ! isset( self::$icon_types[ $meta['type'] ] ) ) { + return $icon; + } + + $type = self::$icon_types[ $meta['type'] ]; + + $callbacks = array( + array( $type, 'get_icon' ), + array( __CLASS__, "get_{$type->id}_icon" ), + array( __CLASS__, "get_{$type->template_id}_icon" ), + ); + + foreach ( $callbacks as $callback ) { + if ( is_callable( $callback ) ) { + $icon = call_user_func( $callback, $meta ); + break; + } + } + + return $icon; + } + + + /** + * Get icon style + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @param array $keys Style properties. + * @param bool $as_attribute Optional. Whether to output the style as HTML attribute or value only. + * Defaults to TRUE. + * @return string + */ + public static function get_icon_style( $meta, $keys, $as_attribute = true ) { + $style_a = array(); + $style_s = ''; + + foreach ( $keys as $key ) { + if ( ! isset( self::$default_style[ $key ] ) ) { + continue; + } + + $rule = self::$default_style[ $key ]; + + if ( ! isset( $meta[ $key ] ) || $meta[ $key ] === $rule['value'] ) { + continue; + } + + $value = $meta[ $key ]; + if ( ! empty( $rule['unit'] ) ) { + $value .= $rule['unit']; + } + + $style_a[ $rule['property'] ] = $value; + } + + if ( empty( $style_a ) ) { + return $style_s; + } + + foreach ( $style_a as $key => $value ) { + $style_s .= "{$key}:{$value};"; + } + + $style_s = esc_attr( $style_s ); + + if ( $as_attribute ) { + $style_s = sprintf( ' style="%s"', $style_s ); + } + + return $style_s; + } + + + /** + * Get icon classes + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @param string $output Whether to output the classes as string or array. Defaults to string. + * @return string|array + */ + public static function get_icon_classes( $meta, $output = 'string' ) { + $classes = array( '_mi' ); + + if ( empty( $meta['hide_label'] ) ) { + $classes[] = "_{$meta['position']}"; + } + + if ( 'string' === $output ) { + $classes = implode( ' ', $classes ); + } + + return $classes; + } + + + /** + * Get font icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_font_icon( $meta ) { + $type = $meta['type']; + $icon = $meta['icon']; + + $font_awesome5 = font_awesome_backward_compatible(); + if ( ! empty( $type ) && 'fa' === $type ) { + $icon = explode( ' ', $icon ); + $type = reset( $icon ); + $icon = end( $icon ); + $fa_icon = sprintf( '%s-%s', $type, $icon ); + if ( array_key_exists( $fa_icon, $font_awesome5 ) ) { + $fa5_icon = $font_awesome5[ $fa_icon ]; + $fa5_class = explode( ' ', $fa5_icon ); + $type = reset( $fa5_class ); + $icon = end( $fa5_class ); + } + } + $classes = sprintf( '%s %s %s', self::get_icon_classes( $meta ), $type, $icon ); + $style = self::get_icon_style( $meta, array( 'font_size', 'vertical_align' ) ); + return sprintf( '', esc_attr( $classes ), $style ); + } + + + /** + * Get image icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_image_icon( $meta ) { + $args = array( + 'class' => sprintf( '%s _image', self::get_icon_classes( $meta ) ), + 'aria-hidden' => 'true', + ); + + $style = self::get_icon_style( $meta, array( 'vertical_align' ), false ); + if ( ! empty( $style ) ) { + $args['style'] = $style; + } + + return wp_get_attachment_image( $meta['icon'], $meta['image_size'], false, $args ); + } + + + /** + * Get SVG icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_svg_icon( $meta ) { + $classes = sprintf( '%s _svg', self::get_icon_classes( $meta ) ); + $style = self::get_icon_style( $meta, array( 'svg_width', 'vertical_align' ) ); + + $svg_icon = esc_url( wp_get_attachment_url( $meta['icon'] ) ); + $width = ''; + $height = ''; + if ( 'image/svg+xml' === get_post_mime_type( $meta['icon'] ) ) { + + // Check `WP_Filesystem` function exists OR not. + require_once ABSPATH . '/wp-admin/includes/file.php'; + \WP_Filesystem(); + global $wp_filesystem; + + $svg_icon = get_attached_file( $meta['icon'] ); + $svg_icon_content = $wp_filesystem->get_contents( $svg_icon ); + if ( $svg_icon_content ) { + $xmlget = simplexml_load_string( $svg_icon_content ); + $xmlattributes = $xmlget->attributes(); + $width = (string) $xmlattributes->width; + $width = (int) filter_var( $xmlattributes->width, FILTER_SANITIZE_NUMBER_INT ); + $height = (string) $xmlattributes->height; + $height = (int) filter_var( $xmlattributes->height, FILTER_SANITIZE_NUMBER_INT ); + } + } else { + $attachment_meta = wp_get_attachment_metadata( $meta['icon'] ); + if ( $attachment_meta ) { + $width = isset( $attachment_meta['width'] ) ? $attachment_meta['width'] : $width; + $height = isset( $attachment_meta['height'] ) ? $attachment_meta['height'] : $height; + } + } + if ( ! empty( $width ) ) { + $width = sprintf( ' width="%d"', $width ); + } + if ( ! empty( $height ) ) { + $height = sprintf( ' height="%d"', $height ); + } + $image_alt = get_post_meta( $meta['icon'], '_wp_attachment_image_alt', true ); + $image_alt = $image_alt ? wp_strip_all_tags( $image_alt ) : ''; + return sprintf( + '', + esc_url( wp_get_attachment_url( $meta['icon'] ) ), + esc_attr( $classes ), + $image_alt, + $width, + $height, + $style + ); + } + + /** + * Add menu item class in `Max Mega Menu` item. + * + * @param array $classes Item classes. + * @param array $item WP menu item. + * @param object $args Menu object. + * @return array + */ + public static function _add_menu_item_class( $classes, $item, $args ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore + $classes[] = 'menu-item'; + return $classes; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/compat.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/compat.php new file mode 100644 index 00000000..cf7ca6b0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/compat.php @@ -0,0 +1,23 @@ + 'fab fa-500px', + 'fa-fa-address-book-o' => 'far fa-address-book', + 'fa-fa-address-card-o' => 'far fa-address-card', + 'fa-fa-adn' => 'fab fa-adn', + 'fa-fa-amazon' => 'fab fa-amazon', + 'fa-fa-android' => 'fab fa-android', + 'fa-fa-angellist' => 'fab fa-angellist', + 'fa-fa-apple' => 'fab fa-apple', + 'fa-fa-area-chart' => 'fas fa-chart-area', + 'fa-fa-arrow-circle-o-down' => 'far fa-arrow-alt-circle-down', + 'fa-fa-arrow-circle-o-left' => 'far fa-arrow-alt-circle-left', + 'fa-fa-arrow-circle-o-right' => 'far fa-arrow-alt-circle-right', + 'fa-fa-arrow-circle-o-up' => 'far fa-arrow-alt-circle-up', + 'fa-fa-arrows-alt' => 'fas fa-expand-arrows-alt', + 'fa-fa-arrows-h' => 'fas fa-arrows-alt-h', + 'fa-fa-arrows-v' => 'fas fa-arrows-alt-v', + 'fa-fa-arrows' => 'fas fa-arrows-alt', + 'fa-fa-asl-interpreting' => 'fas fa-american-sign-language-interpreting', + 'fa-fa-automobile' => 'fas fa-car', + 'fa-fa-bandcamp' => 'fab fa-bandcamp', + 'fa-fa-bank' => 'fas fa-university', + 'fa-fa-bar-chart-o' => 'far fa-chart-bar', + 'fa-fa-bar-chart' => 'far fa-chart-bar', + 'fa-fa-bathtub' => 'fas fa-bath', + 'fa-fa-battery-0' => 'fas fa-battery-empty', + 'fa-fa-battery-1' => 'fas fa-battery-quarter', + 'fa-fa-battery-2' => 'fas fa-battery-half', + 'fa-fa-battery-3' => 'fas fa-battery-three-quarters', + 'fa-fa-battery-4' => 'fas fa-battery-full', + 'fa-fa-battery' => 'fas fa-battery-full', + 'fa-fa-behance' => 'fab fa-behance', + 'fa-fa-behance-square' => 'fab fa-behance-square', + 'fa-fa-bell-o' => 'far fa-bell', + 'fa-fa-bell-slash-o' => 'far fa-bell-slash', + 'fa-fa-bitbucket-square' => 'fab fa-bitbucket', + 'fa-fa-bitbucket' => 'fab fa-bitbucket', + 'fa-fa-bitcoin' => 'fab fa-btc', + 'fa-fa-black-tie' => 'fab fa-black-tie', + 'fa-fa-bluetooth-b' => 'fab fa-bluetooth-b', + 'fa-fa-bluetooth' => 'fab fa-bluetooth', + 'fa-fa-bookmark-o' => 'far fa-bookmark', + 'fa-fa-btc' => 'fab fa-btc', + 'fa-fa-building-o' => 'far fa-building', + 'fa-fa-buysellads' => 'fab fa-buysellads', + 'fa-fa-cab' => 'fas fa-taxi', + 'fa-fa-calendar-check-o' => 'far fa-calendar-check', + 'fa-fa-calendar-minus-o' => 'far fa-calendar-minus', + 'fa-fa-calendar-o' => 'far fa-calendar', + 'fa-fa-calendar-plus-o' => 'far fa-calendar-plus', + 'fa-fa-calendar-times-o' => 'far fa-calendar-times', + 'fa-fa-calendar' => 'fas fa-calendar-alt', + 'fa-fa-caret-square-o-down' => 'far fa-caret-square-down', + 'fa-fa-caret-square-o-left' => 'far fa-caret-square-left', + 'fa-fa-caret-square-o-right' => 'far fa-caret-square-right', + 'fa-fa-caret-square-o-up' => 'far fa-caret-square-up', + 'fa-fa-cc-amex' => 'fab fa-cc-amex', + 'fa-fa-cc-diners-club' => 'fab fa-cc-diners-club', + 'fa-fa-cc-discover' => 'fab fa-cc-discover', + 'fa-fa-cc-jcb' => 'fab fa-cc-jcb', + 'fa-fa-cc-mastercard' => 'fab fa-cc-mastercard', + 'fa-fa-cc-paypal' => 'fab fa-cc-paypal', + 'fa-fa-cc-stripe' => 'fab fa-cc-stripe', + 'fa-fa-cc-visa' => 'fab fa-cc-visa', + 'fa-fa-cc' => 'far fa-closed-captioning', + 'fa-fa-chain-broken' => 'fas fa-unlink', + 'fa-fa-chain' => 'fas fa-link', + 'fa-fa-check-circle-o' => 'far fa-check-circle', + 'fa-fa-check-square-o' => 'far fa-check-square', + 'fa-fa-chrome' => 'fab fa-chrome', + 'fa-fa-circle-o-notch' => 'fas fa-circle-notch', + 'fa-fa-circle-o' => 'far fa-circle', + 'fa-fa-circle-thin' => 'far fa-circle', + 'fa-fa-clipboard' => 'far fa-clipboard', + 'fa-fa-clock-o' => 'far fa-clock', + 'fa-fa-clone' => 'far fa-clone', + 'fa-fa-close' => 'fas fa-times', + 'fa-fa-cloud-download' => 'fas fa-cloud-download-alt', + 'fa-fa-cloud-upload' => 'fas fa-cloud-upload-alt', + 'fa-fa-cny' => 'fas fa-yen-sign', + 'fa-fa-code-fork' => 'fas fa-code-branch', + 'fa-fa-codepen' => 'fab fa-codepen', + 'fa-fa-codiepie' => 'fab fa-codiepie', + 'fa-fa-comment-o' => 'far fa-comment', + 'fa-fa-commenting-o' => 'far fa-comment-dots', + 'fa-fa-commenting' => 'fas fa-comment-dots', + 'fa-fa-comments-o' => 'far fa-comments', + 'fa-fa-compass' => 'far fa-compass', + 'fa-fa-connectdevelop' => 'fab fa-connectdevelop', + 'fa-fa-contao' => 'fab fa-contao', + 'fa-fa-copyright' => 'far fa-copyright', + 'fa-fa-creative-commons' => 'fab fa-creative-commons', + 'fa-fa-credit-card-alt' => 'fas fa-credit-card', + 'fa-fa-credit-card' => 'far fa-credit-card', + 'fa-fa-css3' => 'fab fa-css3', + 'fa-fa-cutlery' => 'fas fa-utensils', + 'fa-fa-dashboard' => 'fas fa-tachometer-alt', + 'fa-fa-dashcube' => 'fab fa-dashcube', + 'fa-fa-deafness' => 'fas fa-deaf', + 'fa-fa-dedent' => 'fas fa-outdent', + 'fa-fa-delicious' => 'fab fa-delicious', + 'fa-fa-deviantart' => 'fab fa-deviantart', + 'fa-fa-diamond' => 'far fa-gem', + 'fa-fa-digg' => 'fab fa-digg', + 'fa-fa-dollar' => 'fas fa-dollar-sign', + 'fa-fa-dot-circle-o' => 'far fa-dot-circle', + 'fa-fa-dribbble' => 'fab fa-dribbble', + 'fa-fa-drivers-license-o' => 'far fa-id-card', + 'fa-fa-drivers-license' => 'fas fa-id-card', + 'fa-fa-dropbox' => 'fab fa-dropbox', + 'fa-fa-drupal' => 'fab fa-drupal', + 'fa-fa-edge' => 'fab fa-edge', + 'fa-fa-eercast' => 'fab fa-sellcast', + 'fa-fa-empire' => 'fab fa-empire', + 'fa-fa-envelope-open-o' => 'far fa-envelope-open', + 'fa-fa-envelope-o' => 'far fa-envelope', + 'fa-fa-envira' => 'fab fa-envira', + 'fa-fa-etsy' => 'fab fa-etsy', + 'fa-fa-euro' => 'fas fa-euro-sign', + 'fa-fa-eur' => 'fas fa-euro-sign', + 'fa-fa-exchange' => 'fas fa-exchange-alt', + 'fa-fa-expeditedssl' => 'fab fa-expeditedssl', + 'fa-fa-external-link-square' => 'fas fa-external-link-square-alt', + 'fa-fa-external-link' => 'fas fa-external-link-alt', + 'fa-fa-eye-slash' => 'far fa-eye-slash', + 'fa-fa-eyedropper' => 'fas fa-eye-dropper', + 'fa-fa-eye' => 'far fa-eye', + 'fa-fa-facebook-f' => 'fab fa-facebook-f', + 'fa-fa-facebook-official' => 'fab fa-facebook', + 'fa-fa-facebook-square' => 'fab fa-facebook-square', + 'fa-fa-facebook' => 'fab fa-facebook-f', + 'fa-fa-feed' => 'fas fa-rss', + 'fa-fa-file-archive-o' => 'far fa-file-archive', + 'fa-fa-file-audio-o' => 'far fa-file-audio', + 'fa-fa-file-code-o' => 'far fa-file-code', + 'fa-fa-file-excel-o' => 'far fa-file-excel', + 'fa-fa-file-image-o' => 'far fa-file-image', + 'fa-fa-file-movie-o' => 'far fa-file-video', + 'fa-fa-file-o' => 'far fa-file', + 'fa-fa-file-pdf-o' => 'far fa-file-pdf', + 'fa-fa-file-photo-o' => 'far fa-file-image', + 'fa-fa-file-picture-o' => 'far fa-file-image', + 'fa-fa-file-powerpoint-o' => 'far fa-file-powerpoint', + 'fa-fa-file-sound-o' => 'far fa-file-audio', + 'fa-fa-file-text-o' => 'far fa-file-alt', + 'fa-fa-file-text' => 'fas fa-file-alt', + 'fa-fa-file-video-o' => 'far fa-file-video', + 'fa-fa-file-word-o' => 'far fa-file-word', + 'fa-fa-file-zip-o' => 'far fa-file-archive', + 'fa-fa-files-o' => 'far fa-copy', + 'fa-fa-firefox' => 'fab fa-firefox', + 'fa-fa-first-order' => 'fab fa-first-order', + 'fa-fa-flag-o' => 'far fa-flag', + 'fa-fa-flash' => 'fas fa-bolt', + 'fa-fa-flickr' => 'fab fa-flickr', + 'fa-fa-floppy-o' => 'far fa-save', + 'fa-fa-folder-o' => 'far fa-folder', + 'fa-fa-folder-open-o' => 'far fa-folder-open', + 'fa-fa-font-awesome' => 'fab fa-font-awesome', + 'fa-fa-fonticons' => 'fab fa-fonticons', + 'fa-fa-fort-awesome' => 'fab fa-fort-awesome', + 'fa-fa-forumbee' => 'fab fa-forumbee', + 'fa-fa-foursquare' => 'fab fa-foursquare', + 'fa-fa-free-code-camp' => 'fab fa-free-code-camp', + 'fa-fa-frown-o' => 'far fa-frown', + 'fa-fa-futbol-o' => 'far fa-futbol', + 'fa-fa-gbp' => 'fas fa-pound-sign', + 'fa-fa-gears' => 'fas fa-cogs', + 'fa-fa-gear' => 'fas fa-cog', + 'fa-fa-get-pocket' => 'fab fa-get-pocket', + 'fa-fa-ge' => 'fab fa-empire', + 'fa-fa-gg-circle' => 'fab fa-gg-circle', + 'fa-fa-gg' => 'fab fa-gg', + 'fa-fa-git-square' => 'fab fa-git-square', + 'fa-fa-github-alt' => 'fab fa-github-alt', + 'fa-fa-github-square' => 'fab fa-github-square', + 'fa-fa-github' => 'fab fa-github', + 'fa-fa-gitlab' => 'fab fa-gitlab', + 'fa-fa-gittip' => 'fab fa-gratipay', + 'fa-fa-git' => 'fab fa-git', + 'fa-fa-glass' => 'fas fa-glass-martini', + 'fa-fa-glide-g' => 'fab fa-glide-g', + 'fa-fa-glide' => 'fab fa-glide', + 'fa-fa-google-plus-circle' => 'fab fa-google-plus', + 'fa-fa-google-plus-official' => 'fab fa-google-plus', + 'fa-fa-google-plus-square' => 'fab fa-google-plus-square', + 'fa-fa-google-plus' => 'fab fa-google-plus-g', + 'fa-fa-google-wallet' => 'fab fa-google-wallet', + 'fa-fa-google' => 'fab fa-google', + 'fa-fa-gratipay' => 'fab fa-gratipay', + 'fa-fa-grav' => 'fab fa-grav', + 'fa-fa-group' => 'fas fa-users', + 'fa-fa-hacker-news' => 'fab fa-hacker-news', + 'fa-fa-hand-grab-o' => 'far fa-hand-rock', + 'fa-fa-hand-lizard-o' => 'far fa-hand-lizard', + 'fa-fa-hand-o-down' => 'far fa-hand-point-down', + 'fa-fa-hand-o-left' => 'far fa-hand-point-left', + 'fa-fa-hand-o-right' => 'far fa-hand-point-right', + 'fa-fa-hand-o-up' => 'far fa-hand-point-up', + 'fa-fa-hand-paper-o' => 'far fa-hand-paper', + 'fa-fa-hand-peace-o' => 'far fa-hand-peace', + 'fa-fa-hand-pointer-o' => 'far fa-hand-pointer', + 'fa-fa-hand-rock-o' => 'far fa-hand-rock', + 'fa-fa-hand-scissors-o' => 'far fa-hand-scissors', + 'fa-fa-hand-spock-o' => 'far fa-hand-spock', + 'fa-fa-hand-stop-o' => 'far fa-hand-paper', + 'fa-fa-handshake-o' => 'far fa-handshake', + 'fa-fa-hard-of-hearing' => 'fas fa-deaf', + 'fa-fa-hdd-o' => 'far fa-hdd', + 'fa-fa-header' => 'fas fa-heading', + 'fa-fa-heart-o' => 'far fa-heart', + 'fa-fa-hospital-o' => 'far fa-hospital', + 'fa-fa-hotel' => 'fas fa-bed', + 'fa-fa-hourglass-1' => 'fas fa-hourglass-start', + 'fa-fa-hourglass-2' => 'fas fa-hourglass-half', + 'fa-fa-hourglass-3' => 'fas fa-hourglass-end', + 'fa-fa-hourglass-o' => 'far fa-hourglass', + 'fa-fa-houzz' => 'fab fa-houzz', + 'fa-fa-html5' => 'fab fa-html5', + 'fa-fa-id-badge' => 'far fa-id-badge', + 'fa-fa-id-card-o' => 'far fa-id-card', + 'fa-fa-ils' => 'fas fa-shekel-sign', + 'fa-fa-image' => 'far fa-image', + 'fa-fa-imdb' => 'fab fa-imdb', + 'fa-fa-inr' => 'fas fa-rupee-sign', + 'fa-fa-instagram' => 'fab fa-instagram', + 'fa-fa-institution' => 'fas fa-university', + 'fa-fa-internet-explorer' => 'fab fa-internet-explorer', + 'fa-fa-intersex' => 'fas fa-transgender', + 'fa-fa-ioxhost' => 'fab fa-ioxhost', + 'fa-fa-joomla' => 'fab fa-joomla', + 'fa-fa-jpy' => 'fas fa-yen-sign', + 'fa-fa-jsfiddle' => 'fab fa-jsfiddle', + 'fa-fa-keyboard-o' => 'far fa-keyboard', + 'fa-fa-krw' => 'fas fa-won-sign', + 'fa-fa-lastfm-square' => 'fab fa-lastfm-square', + 'fa-fa-lastfm' => 'fab fa-lastfm', + 'fa-fa-leanpub' => 'fab fa-leanpub', + 'fa-fa-legal' => 'fas fa-gavel', + 'fa-fa-lemon-o' => 'far fa-lemon', + 'fa-fa-level-down' => 'fas fa-level-down-alt', + 'fa-fa-level-up' => 'fas fa-level-up-alt', + 'fa-fa-life-bouy' => 'far fa-life-ring', + 'fa-fa-life-buoy' => 'far fa-life-ring', + 'fa-fa-life-ring' => 'far fa-life-ring', + 'fa-fa-life-saver' => 'far fa-life-ring', + 'fa-fa-lightbulb-o' => 'far fa-lightbulb', + 'fa-fa-line-chart' => 'fas fa-chart-line', + 'fa-fa-linkedin-square' => 'fab fa-linkedin', + 'fa-fa-linkedin' => 'fab fa-linkedin-in', + 'fa-fa-linode' => 'fab fa-linode', + 'fa-fa-linux' => 'fab fa-linux', + 'fa-fa-list-alt' => 'far fa-list-alt', + 'fa-fa-long-arrow-down' => 'fas fa-long-arrow-alt-down', + 'fa-fa-long-arrow-left' => 'fas fa-long-arrow-alt-left', + 'fa-fa-long-arrow-right' => 'fas fa-long-arrow-alt-right', + 'fa-fa-long-arrow-up' => 'fas fa-long-arrow-alt-up', + 'fa-fa-mail-forward' => 'fas fa-share', + 'fa-fa-mail-reply-all' => 'fas fa-reply-all', + 'fa-fa-mail-reply' => 'fas fa-reply', + 'fa-fa-map-marker' => 'fas fa-map-marker-alt', + 'fa-fa-map-o' => 'far fa-map', + 'fa-fa-maxcdn' => 'fab fa-maxcdn', + 'fa-fa-meanpath' => 'fab fa-font-awesome', + 'fa-fa-medium' => 'fab fa-medium', + 'fa-fa-meetup' => 'fab fa-meetup', + 'fa-fa-meh-o' => 'far fa-meh', + 'fa-fa-minus-square-o' => 'far fa-minus-square', + 'fa-fa-mixcloud' => 'fab fa-mixcloud', + 'fa-fa-mobile-phone' => 'fas fa-mobile-alt', + 'fa-fa-mobile' => 'fas fa-mobile-alt', + 'fa-fa-modx' => 'fab fa-modx', + 'fa-fa-moon-o' => 'far fa-moon', + 'fa-fa-money' => 'far fa-money-bill-alt', + 'fa-fa-mortar-board' => 'fas fa-graduation-cap', + 'fa-fa-navicon' => 'fas fa-bars', + 'fa-fa-newspaper-o' => 'far fa-newspaper', + 'fa-fa-object-group' => 'far fa-object-group', + 'fa-fa-object-ungroup' => 'far fa-object-ungroup', + 'fa-fa-odnoklassniki-square' => 'fab fa-odnoklassniki-square', + 'fa-fa-odnoklassniki' => 'fab fa-odnoklassniki', + 'fa-fa-opencart' => 'fab fa-opencart', + 'fa-fa-openid' => 'fab fa-openid', + 'fa-fa-opera' => 'fab fa-opera', + 'fa-fa-optin-monster' => 'fab fa-optin-monster', + 'fa-fa-pagelines' => 'fab fa-pagelines', + 'fa-fa-paper-plane-o' => 'far fa-paper-plane', + 'fa-fa-paste' => 'far fa-clipboard', + 'fa-fa-pause-circle-o' => 'far fa-pause-circle', + 'fa-fa-paypal' => 'fab fa-paypal', + 'fa-fa-pencil-square' => 'fas fa-pen-square', + 'fa-fa-pencil-square-o' => 'far fa-edit', + 'fa-fa-pencil' => 'fas fa-pencil-alt', + 'fa-fa-photo' => 'far fa-image', + 'fa-fa-picture-o' => 'far fa-image', + 'fa-fa-pie-chart' => 'fas fa-chart-pie', + 'fa-fa-pied-piper-alt' => 'fab fa-pied-piper-alt', + 'fa-fa-pied-piper-pp' => 'fab fa-pied-piper-pp', + 'fa-fa-pied-piper' => 'fab fa-pied-piper', + 'fa-fa-pinterest-p' => 'fab fa-pinterest-p', + 'fa-fa-pinterest-square' => 'fab fa-pinterest-square', + 'fa-fa-pinterest' => 'fab fa-pinterest', + 'fa-fa-play-circle-o' => 'far fa-play-circle', + 'fa-fa-plus-square-o' => 'far fa-plus-square', + 'fa-fa-product-hunt' => 'fab fa-product-hunt', + 'fa-fa-qq' => 'fab fa-qq', + 'fa-fa-question-circle-o' => 'far fa-question-circle', + 'fa-fa-quora' => 'fab fa-quora', + 'fa-fa-ravelry' => 'fab fa-ravelry', + 'fa-fa-ra' => 'fab fa-rebel', + 'fa-fa-rebel' => 'fab fa-rebel', + 'fa-fa-reddit-alien' => 'fab fa-reddit-alien', + 'fa-fa-reddit-square' => 'fab fa-reddit-square', + 'fa-fa-reddit' => 'fab fa-reddit', + 'fa-fa-refresh' => 'fas fa-sync', + 'fa-fa-registered' => 'far fa-registered', + 'fa-fa-remove' => 'fas fa-times', + 'fa-fa-renren' => 'fab fa-renren', + 'fa-fa-reorder' => 'fas fa-bars', + 'fa-fa-repeat' => 'fas fa-redo', + 'fa-fa-resistance' => 'fab fa-rebel', + 'fa-fa-rmb' => 'fas fa-yen-sign', + 'fa-fa-rotate-left' => 'fas fa-undo', + 'fa-fa-rotate-right' => 'fas fa-redo', + 'fa-fa-rouble' => 'fas fa-ruble-sign', + 'fa-fa-ruble' => 'fas fa-ruble-sign', + 'fa-fa-rub' => 'fas fa-ruble-sign', + 'fa-fa-rupee' => 'fas fa-rupee-sign', + 'fa-fa-s15' => 'fas fa-bath', + 'fa-fa-safari' => 'fab fa-safari', + 'fa-fa-scissors' => 'fas fa-cut', + 'fa-fa-scribd' => 'fab fa-scribd', + 'fa-fa-sellsy' => 'fab fa-sellsy', + 'fa-fa-send-o' => 'far fa-paper-plane', + 'fa-fa-send' => 'fas fa-paper-plane', + 'fa-fa-share-square-o' => 'far fa-share-square', + 'fa-fa-shekel' => 'fas fa-shekel-sign', + 'fa-fa-sheqel' => 'fas fa-shekel-sign', + 'fa-fa-shield' => 'fas fa-shield-alt', + 'fa-fa-shirtsinbulk' => 'fab fa-shirtsinbulk', + 'fa-fa-sign-in' => 'fas fa-sign-in-alt', + 'fa-fa-sign-out' => 'fas fa-sign-out-alt', + 'fa-fa-signing' => 'fas fa-sign-language', + 'fa-fa-simplybuilt' => 'fab fa-simplybuilt', + 'fa-fa-skyatlas' => 'fab fa-skyatlas', + 'fa-fa-skype' => 'fab fa-skype', + 'fa-fa-slack' => 'fab fa-slack', + 'fa-fa-sliders' => 'fas fa-sliders-h', + 'fa-fa-slideshare' => 'fab fa-slideshare', + 'fa-fa-smile-o' => 'far fa-smile', + 'fa-fa-snapchat-ghost' => 'fab fa-snapchat-ghost', + 'fa-fa-snapchat-square' => 'fab fa-snapchat-square', + 'fa-fa-snapchat' => 'fab fa-snapchat', + 'fa-fa-snowflake-o' => 'far fa-snowflake', + 'fa-fa-soccer-ball-o' => 'far fa-futbol', + 'fa-fa-sort-alpha-asc' => 'fas fa-sort-alpha-down', + 'fa-fa-sort-alpha-desc' => 'fas fa-sort-alpha-up', + 'fa-fa-sort-amount-asc' => 'fas fa-sort-amount-down', + 'fa-fa-sort-amount-desc' => 'fas fa-sort-amount-up', + 'fa-fa-sort-asc' => 'fas fa-sort-up', + 'fa-fa-sort-desc' => 'fas fa-sort-down', + 'fa-fa-sort-numeric-asc' => 'fas fa-sort-numeric-down', + 'fa-fa-sort-numeric-desc' => 'fas fa-sort-numeric-up', + 'fa-fa-soundcloud' => 'fab fa-soundcloud', + 'fa-fa-spoon' => 'fas fa-utensil-spoon', + 'fa-fa-spotify' => 'fab fa-spotify', + 'fa-fa-square-o' => 'far fa-square', + 'fa-fa-stack-exchange' => 'fab fa-stack-exchange', + 'fa-fa-stack-overflow' => 'fab fa-stack-overflow', + 'fa-fa-star-half-empty' => 'far fa-star-half', + 'fa-fa-star-half-full' => 'far fa-star-half', + 'fa-fa-star-half-o' => 'far fa-star-half', + 'fa-fa-star-o' => 'far fa-star', + 'fa-fa-steam-square' => 'fab fa-steam-square', + 'fa-fa-steam' => 'fab fa-steam', + 'fa-fa-sticky-note-o' => 'far fa-sticky-note', + 'fa-fa-stop-circle-o' => 'far fa-stop-circle', + 'fa-fa-stumbleupon-circle' => 'fab fa-stumbleupon-circle', + 'fa-fa-stumbleupon' => 'fab fa-stumbleupon', + 'fa-fa-sun-o' => 'far fa-sun', + 'fa-fa-superpowers' => 'fab fa-superpowers', + 'fa-fa-support' => 'far fa-life-ring', + 'fa-fa-tablet' => 'fas fa-tablet-alt', + 'fa-fa-tachometer' => 'fas fa-tachometer-alt', + 'fa-fa-telegram' => 'fab fa-telegram', + 'fa-fa-television' => 'fas fa-tv', + 'fa-fa-tencent-weibo' => 'fab fa-tencent-weibo', + 'fa-fa-themeisle' => 'fab fa-themeisle', + 'fa-fa-thermometer-0' => 'fas fa-thermometer-empty', + 'fa-fa-thermometer-1' => 'fas fa-thermometer-quarter', + 'fa-fa-thermometer-2' => 'fas fa-thermometer-half', + 'fa-fa-thermometer-3' => 'fas fa-thermometer-three-quarters', + 'fa-fa-thermometer-4' => 'fas fa-thermometer-full', + 'fa-fa-thermometer' => 'fas fa-thermometer-full', + 'fa-fa-thumb-tack' => 'fas fa-thumbtack', + 'fa-fa-thumbs-o-down' => 'far fa-thumbs-down', + 'fa-fa-thumbs-o-up' => 'far fa-thumbs-up', + 'fa-fa-ticket' => 'fas fa-ticket-alt', + 'fa-fa-times-circle-o' => 'far fa-times-circle', + 'fa-fa-times-rectangle-o' => 'far fa-window-close', + 'fa-fa-times-rectangle' => 'fas fa-window-close', + 'fa-fa-toggle-down' => 'far fa-caret-square-down', + 'fa-fa-toggle-left' => 'far fa-caret-square-left', + 'fa-fa-toggle-right' => 'far fa-caret-square-right', + 'fa-fa-toggle-up' => 'far fa-caret-square-up', + 'fa-fa-trash-o' => 'far fa-trash-alt', + 'fa-fa-trash' => 'fas fa-trash-alt', + 'fa-fa-trello' => 'fab fa-trello', + 'fa-fa-tripadvisor' => 'fab fa-tripadvisor', + 'fa-fa-try' => 'fas fa-lira-sign', + 'fa-fa-tumblr-square' => 'fab fa-tumblr-square', + 'fa-fa-tumblr' => 'fab fa-tumblr', + 'fa-fa-turkish-lira' => 'fas fa-lira-sign', + 'fa-fa-twitch' => 'fab fa-twitch', + 'fa-fa-twitter-square' => 'fab fa-twitter-square', + 'fa-fa-twitter' => 'fab fa-twitter', + 'fa-fa-unsorted' => 'fas fa-sort', + 'fa-fa-usb' => 'fab fa-usb', + 'fa-fa-usd' => 'fas fa-dollar-sign', + 'fa-fa-user-circle-o' => 'far fa-user-circle', + 'fa-fa-user-o' => 'far fa-user', + 'fa-fa-vcard-o' => 'far fa-address-card', + 'fa-fa-vcard' => 'fas fa-address-card', + 'fa-fa-viacoin' => 'fab fa-viacoin', + 'fa-fa-viadeo-square' => 'fab fa-viadeo-square', + 'fa-fa-viadeo' => 'fab fa-viadeo', + 'fa-fa-video-camera' => 'fas fa-video', + 'fa-fa-vimeo-square' => 'fab fa-vimeo-square', + 'fa-fa-vimeo' => 'fab fa-vimeo-v', + 'fa-fa-vine' => 'fab fa-vine', + 'fa-fa-vk' => 'fab fa-vk', + 'fa-fa-volume-control-phone' => 'fas fa-phone-volume', + 'fa-fa-warning' => 'fas fa-exclamation-triangle', + 'fa-fa-wechat' => 'fab fa-weixin', + 'fa-fa-weibo' => 'fab fa-weibo', + 'fa-fa-weixin' => 'fab fa-weixin', + 'fa-fa-whatsapp' => 'fab fa-whatsapp', + 'fa-fa-wheelchair-alt' => 'fab fa-accessible-icon', + 'fa-fa-wikipedia-w' => 'fab fa-wikipedia-w', + 'fa-fa-window-close-o' => 'far fa-window-close', + 'fa-fa-window-maximize' => 'far fa-window-maximize', + 'fa-fa-window-restore' => 'far fa-window-restore', + 'fa-fa-windows' => 'fab fa-windows', + 'fa-fa-won' => 'fas fa-won-sign', + 'fa-fa-wordpress' => 'fab fa-wordpress', + 'fa-fa-wpbeginner' => 'fab fa-wpbeginner', + 'fa-fa-wpexplorer' => 'fab fa-wpexplorer', + 'fa-fa-wpforms' => 'fab fa-wpforms', + 'fa-fa-xing-square' => 'fab fa-xing-square', + 'fa-fa-xing' => 'fab fa-xing', + 'fa-fa-y-combinator-square' => 'fab fa-hacker-news', + 'fa-fa-y-combinator' => 'fab fa-y-combinator', + 'fa-fa-yahoo' => 'fab fa-yahoo', + 'fa-fa-yc' => 'fab fa-y-combinator', + 'fa-fa-yc-square' => 'fab fa-hacker-news', + 'fa-fa-yelp' => 'fab fa-yelp', + 'fa-fa-yen' => 'fas fa-yen-sign', + 'fa-fa-yoast' => 'fab fa-yoast', + 'fa-fa-youtube-play' => 'fab fa-youtube', + 'fa-fa-youtube-square' => 'fab fa-youtube-square', + 'fa-fa-youtube' => 'fab fa-youtube', + 'fa-fa-fa' => 'fab fa-font-awesome', + ); + $font_awesome_icon = apply_filters( 'menu_icons_backward_compatibility_icons', $font_awesome_icon ); + + return $font_awesome_icon; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/font-awesome/font-awesome.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/font-awesome/font-awesome.php new file mode 100644 index 00000000..3f674bf4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/font-awesome/font-awesome.php @@ -0,0 +1,122 @@ +version + ); + } + + return $stylesheet_uri; + } + + + /** + * Icon picker fontawesome items. + * + * @param array $icons Icons. + * @return array Icons. + */ + public static function _icon_picker_fa_items( $icons ) { + if ( empty( $icons ) ) { + return $icons; + } + + $deprecated_icons = array_search( 'fa-tripadvisor', array_column( $icons, 'id' ), true ); + if ( false !== $deprecated_icons ) { + unset( $icons[ $deprecated_icons ] ); + $icons = array_values( $icons ); + } + + $font_awesome = font_awesome_backward_compatible(); + foreach ( $icons as $key => $icon ) { + $old_fa_icon = sprintf( 'fa-%s', $icons[ $key ]['id'] ); + if ( array_key_exists( $old_fa_icon, $font_awesome ) ) { + $icons[ $key ]['id'] = trim( $font_awesome[ $old_fa_icon ] ); + } else { + $icons[ $key ]['id'] = sprintf( 'fa %s', trim( $icons[ $key ]['id'] ) ); + } + } + + // Fa5 extra icons support. + $global_settins = get_option( 'menu-icons', false ); + if ( ! empty( $global_settins['global']['fa5_extra_icons'] ) ) { + $fa5_extra_icons = $global_settins['global']['fa5_extra_icons']; + $fa5_extra_icons = explode( ',', $fa5_extra_icons ); + $fa5_extra_icons = array_map( 'trim', $fa5_extra_icons ); + if ( ! empty( $fa5_extra_icons ) ) { + foreach ( $fa5_extra_icons as $fa5_icon ) { + $icon_name = explode( '-', $fa5_icon ); + $icon_name = end( $icon_name ); + $icons[] = array( + 'group' => 'all', + 'id' => $fa5_icon, + 'name' => $icon_name, + ); + } + } + } + + return $icons; + } + + + /** + * Icon picker font media template. + * + * @param string $template Media template. + * @return string Media template. + */ + public static function _icon_picker_font_media_templates( $template ) { + $templates = array( + 'icon' => '', + 'item' => sprintf( + '
+
+ +
{{ data.name }}
+
+
+
', + esc_attr__( 'Deselect', 'icon-picker' ) + ), + ); + + return $templates; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/form-fields.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/form-fields.php new file mode 100644 index 00000000..a63962ce --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/form-fields.php @@ -0,0 +1,575 @@ + + */ + +/** + * Form Fields + */ +abstract class Kucrut_Form_Field { + + /** + * Holds field & argument defaults + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $defaults = array( + 'field' => array( + 'id' => '', + 'type' => 'text', + 'value' => null, + 'default' => null, + 'attributes' => array(), + 'description' => '', + 'choices' => array(), + ), + 'args' => array( + 'keys' => array(), + 'inline_description' => false, + ), + ); + + /** + * Holds field attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $types = array( + 'text' => 'Kucrut_Form_Field_Text', + 'number' => 'Kucrut_Form_Field_Text', + 'url' => 'Kucrut_Form_Field_Text', + 'color' => 'Kucrut_Form_Field_Text', + 'date' => 'Kucrut_Form_Field_Text', + 'hidden' => 'Kucrut_Form_Field_Text', + 'checkbox' => 'Kucrut_Form_Field_Checkbox', + 'radio' => 'Kucrut_Form_Field_Radio', + 'textarea' => 'Kucrut_Form_Field_Textarea', + 'select' => 'Kucrut_Form_Field_Select', + 'select_multiple' => 'Kucrut_Form_Field_Select_Multiple', + 'select_pages' => 'Kucrut_Form_Field_Select_Pages', + 'special' => 'Kucrut_Form_Field_Special', + ); + + /** + * Holds forbidden attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $forbidden_attributes = array( + 'id', + 'name', + 'value', + 'checked', + 'multiple', + ); + + /** + * Holds allowed html tags + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $allowed_html = array( + 'a' => array( + 'href' => true, + 'target' => true, + 'title' => true, + ), + 'code' => true, + 'em' => true, + 'p' => array( 'class' => true ), + 'span' => array( 'class' => true ), + 'strong' => true, + ); + + /** + * Holds constructed field + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $field; + + + /** + * Holds field attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $attributes = array(); + + + /** + * Loader + * + * @param string URL path to this directory + */ + final public static function load( $url_path = null ) { + // Set URL path for assets + if ( ! is_null( $url_path ) ) { + self::$url_path = $url_path; + } else { + self::$url_path = plugin_dir_url( __FILE__ ); + } + + // Supported field types + self::$types = apply_filters( + 'form_field_types', + self::$types + ); + } + + + /** + * Create field + * + * @param array $field Field array + * @param array $args Extra field arguments + */ + final public static function create( array $field, $args = array() ) { + $field = wp_parse_args( $field, self::$defaults['field'] ); + if ( ! isset( self::$types[ $field['type'] ] ) + || ! is_subclass_of( self::$types[ $field['type'] ], __CLASS__ ) + ) { + trigger_error( + sprintf( + esc_html__( '%1$s: Type %2$s is not supported, reverting to text.', 'menu-icons' ), + __CLASS__, + esc_html( $field['type'] ) + ), + E_USER_WARNING + ); + $field['type'] = 'text'; + } + + if ( is_null( $field['value'] ) && ! is_null( $field['default'] ) ) { + $field['value'] = $field['default']; + } + + foreach ( self::$forbidden_attributes as $key ) { + unset( $field['attributes'][ $key ] ); + } + + $args = (object) wp_parse_args( $args, self::$defaults['args'] ); + $class = self::$types[ $field['type'] ]; + + return new $class( $field, $args ); + } + + + /** + * Constructor + * + * @since 0.1.0 + * @param array $field Field array + * @param object $args Extra field arguments + */ + public function __construct( $field, $args ) { + $this->field = $field; + $this->args = $args; + + if ( ! is_array( $this->args->keys ) ) { + $this->args->keys = array(); + } + $this->args->keys[] = $field['id']; + + $this->attributes['id'] = $this->create_id(); + $this->attributes['name'] = $this->create_name(); + + $this->attributes = wp_parse_args( + $this->attributes, + (array) $field['attributes'] + ); + + $this->set_properties(); + } + + + /** + * Attribute + * + * @since 0.1.0 + * @param string $key Attribute key + * @return mixed NULL if attribute doesn't exist + */ + public function __get( $key ) { + foreach ( array( 'attributes', 'field' ) as $group ) { + if ( isset( $this->{$group}[ $key ] ) ) { + return $this->{$group}[ $key ]; + } + } + + return null; + } + + + /** + * Create id/name attribute + * + * @since 0.1.0 + * @param string $format Attribute format + */ + protected function create_id_name( $format ) { + return call_user_func_array( + 'sprintf', + array_merge( + array( $format ), + $this->args->keys + ) + ); + } + + + /** + * Create id attribute + * + * @since 0.1.0 + * @access protected + * @return string + */ + protected function create_id() { + $format = implode( '-', $this->args->keys ); + + return $this->create_id_name( $format ); + } + + + /** + * Create name attribute + * + * @since 0.1.0 + * @access protected + * @return string + */ + protected function create_name() { + $format = '%s'; + $format .= str_repeat( '[%s]', ( count( $this->args->keys ) - 1 ) ); + + return $this->create_id_name( $format ); + } + + + /** + * Set field properties + * + * @since 0.1.0 + */ + protected function set_properties() {} + + + /** + * Build field attributes + * + * @since 0.1.0 + * @param array $excludes Attributes to be excluded + * @return string + */ + protected function build_attributes( $excludes = array() ) { + $excludes = array_filter( (array) $excludes ); + $attributes = ''; + + foreach ( $this->attributes as $key => $value ) { + if ( in_array( $key, $excludes, true ) ) { + continue; + } + + if ( 'class' === $key ) { + $value = implode( ' ', (array) $value ); + } + + $attributes .= sprintf( + ' %s="%s"', + esc_attr( $key ), + esc_attr( $value ) + ); + } + + return $attributes; + } + + + /** + * Print field + * + * @since 0.1.0 + */ + abstract public function render(); + + + /** + * Print field description + * + * @since 0.1.0 + */ + public function description() { + if ( ! empty( $this->field['description'] ) ) { + $tag = ( ! empty( $this->args->inline_description ) ) ? 'span' : 'p'; + + printf( // WPCS: XSS ok. + '<%1$s class="description">%2$s', + $tag, + wp_kses( $this->field['description'], $this->allowed_html ) + ); + } + } +} + + +/** + * Field: text + */ +class Kucrut_Form_Field_Text extends Kucrut_Form_Field { + + protected $template = ''; + + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + + if ( in_array( $this->field['type'], array( 'text', 'url' ), true ) ) { + if ( ! isset( $this->attributes['class'] ) ) { + $this->attributes['class'] = array(); + } + $this->attributes['class'] = array_unique( + array_merge( + array( 'regular-text' ), + $this->attributes['class'] + ) + ); + } + } + + + public function render() { + printf( // WPCS: xss ok + $this->template, + esc_attr( $this->field['type'] ), + esc_attr( $this->field['value'] ), + $this->build_attributes() + ); + $this->description(); + } +} + + +/** + * Field: Textarea + */ +class Kucrut_Form_Field_Textarea extends Kucrut_Form_Field { + + protected $template = '%s'; + + protected $attributes = array( + 'class' => 'widefat', + 'cols' => 50, + 'rows' => 5, + ); + + + public function render() { + printf( // WPCS: XSS ok. + $this->template, + $this->build_attributes(), + esc_textarea( $this->field['value'] ) + ); + } +} + + +/** + * Field: Checkbox + */ +class Kucrut_Form_Field_Checkbox extends Kucrut_Form_Field { + + protected $template = '
'; + + + protected function set_properties() { + $this->field['value'] = array_filter( (array) $this->field['value'] ); + $this->attributes['name'] .= '[]'; + } + + + protected function checked( $value ) { + return checked( in_array( $value, $this->field['value'], true ), true, false ); + } + + + public function render() { + foreach ( $this->field['choices'] as $value => $label ) { + printf( // WPCS: XSS ok. + $this->template, + $this->field['type'], + esc_attr( $value ), + $this->checked( $value ), + $this->build_attributes( 'id' ), + esc_html( $label ) + ); + } + } +} + + +/** + * Field: Radio + */ +class Kucrut_Form_Field_Radio extends Kucrut_Form_Field_Checkbox { + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + } + + + protected function checked( $value ) { + return checked( $value, $this->field['value'], false ); + } +} + + +/** + * Field: Select + */ +class Kucrut_Form_Field_Select extends Kucrut_Form_Field { + + protected $template = ''; + + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + } + + + protected function selected( $value ) { + return selected( ( $value === $this->field['value'] ), true, false ); + } + + + public function render() { + ?> + build_attributes() // xss ok ?>> + field['choices'] as $index => $choice ) : ?> + + template, + esc_attr( $value ), + $this->selected( $value ), + esc_html( $label ) + ); + ?> + + + field['value'] = array_filter( (array) $this->field['value'] ); + $this->attributes['name'] .= '[]'; + $this->attributes['multiple'] = 'multiple'; + } + + + protected function selected( $value ) { + return selected( in_array( $value, $this->field['value'], true ), true, false ); + } +} + + +/** + * Field: Select Pages + */ +class Kucrut_Form_Field_Select_Pages extends Kucrut_Form_Field_Select { + + protected $wp_dropdown_pages_args = array( + 'depth' => 0, + 'child_of' => 0, + 'option_none_value' => '', + ); + + + public function __construct( $field, $args ) { + $this->wp_dropdown_pages_args['show_option_none'] = __( '— Select —', 'menu-icons' ); + parent::__construct( $field, $args ); + } + + + public function set_properties() { + parent::set_properties(); + + if ( empty( $this->args->wp_dropdown_pages_args ) ) { + $this->args->wp_dropdown_pages_args = array(); + } + + // Apply defeaults + $this->args->wp_dropdown_pages_args = wp_parse_args( + $this->args->wp_dropdown_pages_args, + $this->wp_dropdown_pages_args + ); + + // Force some args + $this->args->wp_dropdown_pages_args = array_merge( + $this->args->wp_dropdown_pages_args, + array( + 'echo' => true, + 'name' => $this->attributes['name'], + 'id' => $this->attributes['id'], + 'selected' => $this->field['value'], + ) + ); + } + + + public function render() { + wp_dropdown_pages( $this->args->wp_dropdown_pages_args ); // WPCS: XSS ok. + } +} + + +/** + * Field: Special (Callback) + */ +class Kucrut_Form_Field_Special extends Kucrut_Form_Field { + public function render() { + call_user_func_array( + $this->field['render_cb'], + array( $this ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/functions.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/functions.php new file mode 100644 index 00000000..7985369a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/functions.php @@ -0,0 +1,111 @@ + + */ + + +if ( ! function_exists( 'kucrut_get_array_value_deep' ) ) { + /** + * Get value of a multidimensional array + * + * @since 0.1.0 + * @param array $array Haystack + * @param array $keys Needles + * @return mixed + */ + function kucrut_get_array_value_deep( array $array, array $keys ) { + if ( empty( $array ) || empty( $keys ) ) { + return $array; + } + + foreach ( $keys as $idx => $key ) { + unset( $keys[ $idx ] ); + + if ( ! isset( $array[ $key ] ) ) { + return null; + } + + if ( ! empty( $keys ) ) { + $array = $array[ $key ]; + } + } + + if ( ! isset( $array[ $key ] ) ) { + return null; + } + + return $array[ $key ]; + } +} + + +if ( ! function_exists( 'kucrut_validate' ) ) { + /** + * Validate settings values + * + * @param array $values Settings values + * @return array + */ + function kucrut_validate( $values, $sanitize_cb = 'wp_kses_data' ) { + foreach ( $values as $key => $value ) { + if ( is_array( $value ) ) { + $values[ $key ] = kucrut_validate( $value ); + } else { + $values[ $key ] = call_user_func_array( + $sanitize_cb, + array( $value ) + ); + } + } + + return $values; + } +} + + +if ( ! function_exists( 'kucrut_get_image_sizes' ) ) { + /** + * Get image sizes + * + * @since 0.9.0 + * @access protected + * @return array + */ + function kucrut_get_image_sizes() { + $_sizes = array( + 'thumbnail' => __( 'Thumbnail', 'menu-icons' ), + 'medium' => __( 'Medium', 'menu-icons' ), + 'large' => __( 'Large', 'menu-icons' ), + 'full' => __( 'Full Size', 'menu-icons' ), + ); + + $_sizes = apply_filters( 'image_size_names_choose', $_sizes ); + + $sizes = array(); + foreach ( $_sizes as $value => $label ) { + $sizes[] = array( + 'value' => $value, + 'label' => $label, + ); + } + + return $sizes; + } +} + + +if ( ! function_exists( 'kucrut_get_script_suffix' ) ) { + /** + * Get script & style suffix + * + * When SCRIPT_DEBUG is defined true, this will return '.min'. + * + * @return string + */ + function kucrut_get_script_suffix() { + return ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/media-template.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/media-template.php new file mode 100644 index 00000000..4749e150 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/media-template.php @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ +final class Menu_Icons_Meta { + + const KEY = 'menu-icons'; + + /** + * Default meta value + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $defaults = array( + 'type' => '', + 'icon' => '', + 'url' => '', + ); + + + /** + * Initialize metadata functionalities + * + * @since 0.9.0 + */ + public static function init() { + add_filter( 'is_protected_meta', array( __CLASS__, '_protect_meta_key' ), 10, 3 ); + } + + + /** + * Protect meta key + * + * This prevents our meta key from showing up on Custom Fields meta box. + * + * @since 0.3.0 + * @wp_hook filter is_protected_meta + * @param bool $protected Protection status. + * @param string $meta_key Meta key. + * @param string $meta_type Meta type. + * @return bool Protection status. + */ + public static function _protect_meta_key( $protected, $meta_key, $meta_type ) { + if ( self::KEY === $meta_key ) { + $protected = true; + } + + return $protected; + } + + + /** + * Get menu item meta value + * + * @since 0.3.0 + * @since 0.9.0 Add $defaults parameter. + * @param int $id Menu item ID. + * @param array $defaults Optional. Default value. + * @return array + */ + public static function get( $id, $defaults = array() ) { + $defaults = wp_parse_args( $defaults, self::$defaults ); + $value = get_post_meta( $id, self::KEY, true ); + $value = wp_parse_args( (array) $value, $defaults ); + + if ( ! empty( $value['type'] ) && 'fa' === $value['type'] ) { + if ( ! empty( $value['icon'] ) && count( explode( ' ', $value['icon'] ) ) <= 1 ) { + $value['icon'] = sprintf( 'fa %s', $value['icon'] ); + } + } + + $font_awesome5 = font_awesome_backward_compatible(); + $icon = ! empty( $value['icon'] ) ? $value['icon'] : ''; + $icon = explode( ' ', $icon ); + $icon = sprintf( '%s-%s', reset( $icon ), end( $icon ) ); + + if ( ! empty( $font_awesome5[ $icon ] ) ) { + $value['icon'] = $font_awesome5[ $icon ]; + } + + // Backward-compatibility. + if ( empty( $value['icon'] ) && + ! empty( $value['type'] ) && + ! empty( $value[ "{$value['type']}-icon" ] ) + ) { + $value['icon'] = $value[ "{$value['type']}-icon" ]; + } + + if ( ! empty( $value['width'] ) ) { + $value['svg_width'] = $value['width']; + } + unset( $value['width'] ); + + if ( isset( $value['position'] ) && + ! in_array( $value['position'], array( 'before', 'after' ), true ) + ) { + $value['position'] = $defaults['position']; + } + + if ( isset( $value['size'] ) && ! isset( $value['font_size'] ) ) { + $value['font_size'] = $value['size']; + unset( $value['size'] ); + } + + // The values below will NOT be saved + if ( ! empty( $value['icon'] ) && + in_array( $value['type'], array( 'image', 'svg' ), true ) + ) { + $value['url'] = wp_get_attachment_image_url( $value['icon'], 'thumbnail', false ); + } + + return $value; + } + + + /** + * Update menu item metadata + * + * @since 0.9.0 + * + * @param int $id Menu item ID. + * @param mixed $value Metadata value. + * + * @return void + */ + public static function update( $id, $value ) { + /** + * Allow plugins/themes to filter the values + * + * Deprecated. + * + * @since 0.1.0 + * @param array $value Metadata value. + * @param int $id Menu item ID. + */ + $_value = apply_filters( 'menu_icons_values', $value, $id ); + + if ( $_value !== $value && WP_DEBUG ) { + _deprecated_function( 'menu_icons_values', '0.8.0', 'menu_icons_item_meta_values' ); + } + + /** + * Allow plugins/themes to filter the values + * + * @since 0.8.0 + * @param array $value Metadata value. + * @param int $id Menu item ID. + */ + $value = apply_filters( 'menu_icons_item_meta_values', $_value, $id ); + + // Don't bother saving if `type` or `icon` is not set. + if ( empty( $value['type'] ) || empty( $value['icon'] ) ) { + $value = false; + } + + // Update + if ( ! empty( $value ) ) { + update_post_meta( $id, self::KEY, $value ); + } else { + delete_post_meta( $id, self::KEY ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/picker.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/picker.php new file mode 100644 index 00000000..f653abe6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/picker.php @@ -0,0 +1,305 @@ + + */ + + +/** + * Nav menu admin + */ +final class Menu_Icons_Picker { + + /** + * Initialize class + * + * @since 0.1.0 + */ + public static function init() { + add_action( 'load-nav-menus.php', array( __CLASS__, '_load_nav_menus' ) ); + add_filter( 'wp_nav_menu_item_custom_fields', array( __CLASS__, '_fields' ), 10, 4 ); + add_filter( 'manage_nav-menus_columns', array( __CLASS__, '_columns' ), 99 ); + add_action( 'wp_update_nav_menu_item', array( __CLASS__, '_save' ), 10, 3 ); + add_filter( 'icon_picker_type_props', array( __CLASS__, '_add_extra_type_props_data' ), 10, 3 ); + + if ( ! version_compare( get_bloginfo( 'version' ), '5.4', '>=' ) ) { + add_filter( + 'wp_edit_nav_menu_walker', function() { + return 'Menu_Item_Custom_Fields_Walker'; + }, 99 + ); + } + } + + + /** + * Load Icon Picker + * + * @since 0.9.0 + * @wp_hook action load-nav-menus.php + */ + public static function _load_nav_menus() { + Icon_Picker::instance()->load(); + + add_action( 'print_media_templates', array( __CLASS__, '_media_templates' ) ); + } + + + /** + * Get menu item setting fields + * + * @since 0.9.0 + * @access protected + * @param array $meta Menu item meta value. + * @return array + */ + protected static function _get_menu_item_fields( $meta ) { + $fa_icon = sprintf( '%s-%s', $meta['type'], $meta['icon'] ); + $font_awesome5 = font_awesome_backward_compatible(); + + if ( array_key_exists( $fa_icon, $font_awesome5 ) ) { + $fa5_icon = $font_awesome5[ $fa_icon ]; + $fa5_class = explode( ' ', $fa5_icon ); + $type = reset( $fa5_class ); + $icon = end( $fa5_class ); + $meta['icon'] = sprintf( '%s %s', $type, $icon ); + } + + $fields = array_merge( + array( + array( + 'id' => 'type', + 'label' => __( 'Type', 'menu-icons' ), + 'value' => $meta['type'], + ), + array( + 'id' => 'icon', + 'label' => __( 'Icon', 'menu-icons' ), + 'value' => $meta['icon'], + ), + ), + Menu_Icons_Settings::get_settings_fields( $meta ) + ); + + return $fields; + } + + + /** + * Print fields + * + * @since 0.1.0 + * @access protected + * @uses add_action() Calls 'menu_icons_before_fields' hook + * @uses add_action() Calls 'menu_icons_after_fields' hook + * @wp_hook action menu_item_custom_fields + * + * @param object $item Menu item data object. + * @param int $depth Nav menu depth. + * @param array $args Menu item args. + * @param int $id Nav menu ID. + * + * @return string Form fields + */ + public static function _fields( $id, $item, $depth, $args ) { + $input_id = sprintf( 'menu-icons-%d', $item->ID ); + $input_name = sprintf( 'menu-icons[%d]', $item->ID ); + $menu_settings = Menu_Icons_Settings::get_menu_settings( Menu_Icons_Settings::get_current_menu_id() ); + $meta = Menu_Icons_Meta::get( $item->ID, $menu_settings ); + $fields = self::_get_menu_item_fields( $meta ); + ?> + + id ) { + return; + } + + check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); + + // Sanitize + if ( ! empty( $_POST['menu-icons'][ $menu_item_db_id ] ) ) { + $value = array_map( + 'sanitize_text_field', + wp_unslash( (array) $_POST['menu-icons'][ $menu_item_db_id ] ) + ); + } else { + $value = array(); + } + + Menu_Icons_Meta::update( $menu_item_db_id, $value ); + } + + + /** + * Get and print media templates from all types + * + * @since 0.2.0 + * @since 0.9.0 Deprecate menu_icons_media_templates filter. + * @wp_hook action print_media_templates + */ + public static function _media_templates() { + $id_prefix = 'tmpl-menu-icons'; + + // Deprecated. + $templates = apply_filters( 'menu_icons_media_templates', array() ); + + if ( ! empty( $templates ) ) { + if ( WP_DEBUG ) { + _deprecated_function( 'menu_icons_media_templates', '0.9.0', 'menu_icons_js_templates' ); + } + + foreach ( $templates as $key => $template ) { + $id = sprintf( '%s-%s', $id_prefix, $key ); + self::_print_tempate( $id, $template ); + } + } + + require_once dirname( __FILE__ ) . '/media-template.php'; + } + + + /** + * Print media template + * + * @since 0.2.0 + * @param string $id Template ID. + * @param string $template Media template HTML. + */ + protected static function _print_tempate( $id, $template ) { + ?> + + + */ + +/** + * Menu Icons Settings module + */ +final class Menu_Icons_Settings { + + const UPDATE_KEY = 'menu-icons-settings-update'; + + const RESET_KEY = 'menu-icons-settings-reset'; + + const TRANSIENT_KEY = 'menu_icons_message'; + + /** + * Default setting values + * + * @since 0.3.0 + * @var array + * @access protected + */ + protected static $defaults = array( + 'global' => array( + 'icon_types' => array( 'dashicons' ), + ), + ); + + /** + * Setting values + * + * @since 0.3.0 + * @var array + * @access protected + */ + protected static $settings = array(); + + /** + * Script dependencies + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $script_deps = array( 'jquery' ); + + /** + * Settings init + * + * @since 0.3.0 + */ + public static function init() { + // Include Menu Icons for Block Editor + if ( class_exists( '\ThemeIsle\GutenbergMenuIcons' ) ) { + \ThemeIsle\GutenbergMenuIcons::instance(); + add_action( 'enqueue_block_assets', array( __CLASS__, '_enqueue_font_awesome' ) ); + } + + /** + * Allow themes/plugins to override the default settings + * + * @since 0.9.0 + * + * @param array $default_settings Default settings. + */ + self::$defaults = apply_filters( 'menu_icons_settings_defaults', self::$defaults ); + + self::$settings = get_option( 'menu-icons', self::$defaults ); + + foreach ( self::$settings as $key => &$value ) { + if ( 'global' === $key ) { + // Remove unregistered icon types. + $value['icon_types'] = array_values( + array_intersect( + array_keys( Menu_Icons::get( 'types' ) ), + array_filter( (array) $value['icon_types'] ) + ) + ); + } else { + // Backward-compatibility. + if ( isset( $value['width'] ) && ! isset( $value['svg_width'] ) ) { + $value['svg_width'] = $value['width']; + } + + unset( $value['width'] ); + } + } + + unset( $value ); + + /** + * Allow themes/plugins to override the settings + * + * @since 0.9.0 + * + * @param array $settings Menu Icons settings. + */ + self::$settings = apply_filters( 'menu_icons_settings', self::$settings ); + + if ( self::is_menu_icons_disabled_for_menu() ) { + return; + } + + if ( ! empty( self::$settings['global']['icon_types'] ) ) { + require_once Menu_Icons::get( 'dir' ) . 'includes/picker.php'; + Menu_Icons_Picker::init(); + self::$script_deps[] = 'icon-picker'; + } + + add_action( 'load-nav-menus.php', array( __CLASS__, '_load_nav_menus' ), 1 ); + add_action( 'wp_ajax_menu_icons_update_settings', array( __CLASS__, '_ajax_menu_icons_update_settings' ) ); + } + + /** + * Check if menu icons is disabled for a menu + * + * @since 0.8.0 + * + * @param int $menu_id Menu ID. Defaults to current menu being edited. + * + * @return bool + */ + public static function is_menu_icons_disabled_for_menu( $menu_id = 0 ) { + if ( empty( $menu_id ) ) { + $menu_id = self::get_current_menu_id(); + } + + // When we're creating a new menu or the recently edited menu + // could not be found. + if ( empty( $menu_id ) ) { + return true; + } + + $menu_settings = self::get_menu_settings( $menu_id ); + $is_disabled = ! empty( $menu_settings['disabled'] ); + + return $is_disabled; + } + + /** + * Get ID of menu being edited + * + * @since 0.7.0 + * @since 0.8.0 Get the recently edited menu from user option. + * + * @return int + */ + public static function get_current_menu_id() { + global $nav_menu_selected_id; + + if ( ! empty( $nav_menu_selected_id ) ) { + return $nav_menu_selected_id; + } + + if ( is_admin() && isset( $_REQUEST['menu'] ) ) { + $menu_id = absint( $_REQUEST['menu'] ); + } else { + $menu_id = absint( get_user_option( 'nav_menu_recently_edited' ) ); + } + + return $menu_id; + } + + /** + * Get menu settings + * + * @since 0.3.0 + * + * @param int $menu_id + * + * @return array + */ + public static function get_menu_settings( $menu_id ) { + $menu_settings = self::get( sprintf( 'menu_%d', $menu_id ) ); + $menu_settings = apply_filters( 'menu_icons_menu_settings', $menu_settings, $menu_id ); + + if ( ! is_array( $menu_settings ) ) { + $menu_settings = array(); + } + + return $menu_settings; + } + + /** + * Get setting value + * + * @since 0.3.0 + * @return mixed + */ + public static function get() { + $args = func_get_args(); + + return kucrut_get_array_value_deep( self::$settings, $args ); + } + + /** + * Prepare wp-admin/nav-menus.php page + * + * @since 0.3.0 + * @wp_hook action load-nav-menus.php + */ + public static function _load_nav_menus() { + add_action( 'admin_enqueue_scripts', array( __CLASS__, '_enqueue_assets' ), 99 ); + + /** + * Allow settings meta box to be disabled. + * + * @since 0.4.0 + * + * @param bool $disabled Defaults to FALSE. + */ + $settings_disabled = apply_filters( 'menu_icons_disable_settings', false ); + if ( true === $settings_disabled ) { + return; + } + + self::_maybe_update_settings(); + self::_add_settings_meta_box(); + + add_action( 'admin_notices', array( __CLASS__, '_admin_notices' ) ); + } + + /** + * Update settings + * + * @since 0.3.0 + */ + public static function _maybe_update_settings() { + if ( ! empty( $_POST['menu-icons']['settings'] ) ) { + check_admin_referer( self::UPDATE_KEY, self::UPDATE_KEY ); + + $redirect_url = self::_update_settings( $_POST['menu-icons']['settings'] ); // Input var okay. + wp_redirect( $redirect_url ); + } elseif ( ! empty( $_REQUEST[ self::RESET_KEY ] ) ) { + check_admin_referer( self::RESET_KEY, self::RESET_KEY ); + wp_redirect( self::_reset_settings() ); + } + } + + /** + * Update settings + * + * @since 0.7.0 + * @access protected + * + * @param array $values Settings values. + * + * @return string Redirect URL. + */ + protected static function _update_settings( $values ) { + update_option( + 'menu-icons', + wp_parse_args( + kucrut_validate( $values ), + self::$settings + ) + ); + set_transient( self::TRANSIENT_KEY, 'updated', 30 ); + + $redirect_url = remove_query_arg( + array( 'menu-icons-reset' ), + wp_get_referer() + ); + + return $redirect_url; + } + + /** + * Reset settings + * + * @since 0.7.0 + * @access protected + * @return string Redirect URL. + */ + protected static function _reset_settings() { + delete_option( 'menu-icons' ); + set_transient( self::TRANSIENT_KEY, 'reset', 30 ); + + $redirect_url = remove_query_arg( + array( self::RESET_KEY, 'menu-icons-updated' ), + wp_get_referer() + ); + + return $redirect_url; + } + + /** + * Settings meta box + * + * @since 0.3.0 + * @access private + */ + private static function _add_settings_meta_box() { + add_meta_box( + 'menu-icons-settings', + __( 'Menu Icons Settings', 'menu-icons' ), + array( __CLASS__, '_meta_box' ), + 'nav-menus', + 'side', + 'low', + array() + ); + } + + /** + * Update settings via ajax + * + * @since 0.7.0 + * @wp_hook action wp_ajax_menu_icons_update_settings + */ + public static function _ajax_menu_icons_update_settings() { + check_ajax_referer( self::UPDATE_KEY, self::UPDATE_KEY ); + + if ( empty( $_POST['menu-icons']['settings'] ) ) { + wp_send_json_error(); + } + + $redirect_url = self::_update_settings( $_POST['menu-icons']['settings'] ); // Input var okay. + wp_send_json_success( array( 'redirectUrl' => $redirect_url ) ); + } + + /** + * Print admin notices + * + * @since 0.3.0 + * @wp_hook action admin_notices + */ + public static function _admin_notices() { + $messages = array( + 'updated' => __( 'Menu Icons Settings have been successfully updated.', 'menu-icons' ), + 'reset' => __( 'Menu Icons Settings have been successfully reset.', 'menu-icons' ), + ); + + $message_type = get_transient( self::TRANSIENT_KEY ); + + if ( ! empty( $message_type ) && ! empty( $messages[ $message_type ] ) ) { + printf( + '

%s

', + wp_kses( $messages[ $message_type ], array( 'strong' => true ) ) + ); + } + + delete_transient( self::TRANSIENT_KEY ); + } + + /** + * Settings meta box + * + * @since 0.3.0 + */ + public static function _meta_box() { + ?> +
+ + $section ) : ?> + + +
+

+ + + %s', + esc_url( + wp_nonce_url( + admin_url( '/nav-menus.php' ), + self::RESET_KEY, + self::RESET_KEY + ) + ), + esc_attr__( 'Discard all changes and reset to default state', 'menu-icons' ), + esc_html__( 'Reset', 'menu-icons' ) + ); + ?> + + + + + + +

+ array( + 'id' => 'global', + 'title' => __( 'Global', 'menu-icons' ), + 'description' => __( 'Global settings', 'menu-icons' ), + 'fields' => array( + array( + 'id' => 'icon_types', + 'type' => 'checkbox', + 'label' => __( 'Icon Types', 'menu-icons' ), + 'choices' => $icon_types, + 'value' => self::get( 'global', 'icon_types' ), + ), + array( + 'id' => 'fa5_extra_icons', + 'type' => 'textarea', + 'label' => __( 'FA Custom Icon Classes', 'menu-icons' ), + 'value' => self::get( 'global', 'fa5_extra_icons' ), + 'help_text' => '( comma separated icons )', + ), + ), + 'args' => array(), + ), + ); + + if ( ! empty( $menu_id ) ) { + $menu_term = get_term( $menu_id, 'nav_menu' ); + $menu_key = sprintf( 'menu_%d', $menu_id ); + $menu_settings = self::get_menu_settings( $menu_id ); + + $sections['menu'] = array( + 'id' => $menu_key, + 'title' => __( 'Current Menu', 'menu-icons' ), + 'description' => sprintf( + __( '"%s" menu settings', 'menu-icons' ), + apply_filters( 'single_term_title', $menu_term->name ) + ), + 'fields' => self::get_settings_fields( $menu_settings ), + 'args' => array( 'inline_description' => true ), + ); + } + + return apply_filters( 'menu_icons_settings_sections', $sections, $menu_id ); + } + + /** + * Get settings fields + * + * @since 0.4.0 + * + * @param array $values Values to be applied to each field. + * + * @uses apply_filters() Calls 'menu_icons_settings_fields'. + * @return array + */ + public static function get_settings_fields( array $values = array() ) { + $fields = array( + 'hide_label' => array( + 'id' => 'hide_label', + 'type' => 'select', + 'label' => __( 'Hide Label', 'menu-icons' ), + 'default' => '', + 'choices' => array( + array( + 'value' => '', + 'label' => __( 'No', 'menu-icons' ), + ), + array( + 'value' => '1', + 'label' => __( 'Yes', 'menu-icons' ), + ), + ), + ), + 'position' => array( + 'id' => 'position', + 'type' => 'select', + 'label' => __( 'Position', 'menu-icons' ), + 'default' => 'before', + 'choices' => array( + array( + 'value' => 'before', + 'label' => __( 'Before', 'menu-icons' ), + ), + array( + 'value' => 'after', + 'label' => __( 'After', 'menu-icons' ), + ), + ), + ), + 'vertical_align' => array( + 'id' => 'vertical_align', + 'type' => 'select', + 'label' => __( 'Vertical Align', 'menu-icons' ), + 'default' => 'middle', + 'choices' => array( + array( + 'value' => 'super', + 'label' => __( 'Super', 'menu-icons' ), + ), + array( + 'value' => 'top', + 'label' => __( 'Top', 'menu-icons' ), + ), + array( + 'value' => 'text-top', + 'label' => __( 'Text Top', 'menu-icons' ), + ), + array( + 'value' => 'middle', + 'label' => __( 'Middle', 'menu-icons' ), + ), + array( + 'value' => 'baseline', + 'label' => __( 'Baseline', 'menu-icons' ), + ), + array( + 'value' => 'text-bottom', + 'label' => __( 'Text Bottom', 'menu-icons' ), + ), + array( + 'value' => 'bottom', + 'label' => __( 'Bottom', 'menu-icons' ), + ), + array( + 'value' => 'sub', + 'label' => __( 'Sub', 'menu-icons' ), + ), + ), + ), + 'font_size' => array( + 'id' => 'font_size', + 'type' => 'number', + 'label' => __( 'Font Size', 'menu-icons' ), + 'default' => '1.2', + 'description' => 'em', + 'attributes' => array( + 'min' => '0.1', + 'step' => '0.1', + ), + ), + 'svg_width' => array( + 'id' => 'svg_width', + 'type' => 'number', + 'label' => __( 'SVG Width', 'menu-icons' ), + 'default' => '1', + 'description' => 'em', + 'attributes' => array( + 'min' => '.5', + 'step' => '.1', + ), + ), + 'image_size' => array( + 'id' => 'image_size', + 'type' => 'select', + 'label' => __( 'Image Size', 'menu-icons' ), + 'default' => 'thumbnail', + 'choices' => kucrut_get_image_sizes(), + ), + ); + + $fields = apply_filters( 'menu_icons_settings_fields', $fields ); + + foreach ( $fields as &$field ) { + if ( isset( $values[ $field['id'] ] ) ) { + $field['value'] = $values[ $field['id'] ]; + } + + if ( ! isset( $field['value'] ) && isset( $field['default'] ) ) { + $field['value'] = $field['default']; + } + } + + unset( $field ); + + return $fields; + } + + /** + * Get processed settings fields + * + * @since 0.3.0 + * @access private + * @return array + */ + private static function _get_fields() { + if ( ! class_exists( 'Kucrut_Form_Field' ) ) { + require_once Menu_Icons::get( 'dir' ) . 'includes/library/form-fields.php'; + } + + $keys = array( 'menu-icons', 'settings' ); + $sections = self::get_fields(); + + foreach ( $sections as &$section ) { + $_keys = array_merge( $keys, array( $section['id'] ) ); + $_args = array_merge( array( 'keys' => $_keys ), $section['args'] ); + + foreach ( $section['fields'] as &$field ) { + $field = Kucrut_Form_Field::create( $field, $_args ); + } + + unset( $field ); + } + + unset( $section ); + + return $sections; + } + + /** + * Enqueue scripts & styles for Block Icons + * + * @since 0.3.0 + * @wp_hook action enqueue_block_assets + */ + public static function _enqueue_font_awesome() { + $url = Menu_Icons::get( 'url' ); + + wp_register_style( + 'font-awesome-5', + "{$url}css/fontawesome/css/all.min.css" + ); + } + + /** + * Enqueue scripts & styles for Appearance > Menus page + * + * @since 0.3.0 + * @wp_hook action admin_enqueue_scripts + */ + public static function _enqueue_assets() { + $url = Menu_Icons::get( 'url' ); + $suffix = kucrut_get_script_suffix(); + + if ( defined( 'MENU_ICONS_SCRIPT_DEBUG' ) && MENU_ICONS_SCRIPT_DEBUG ) { + $script_url = '//localhost:8081/'; + } else { + $script_url = $url; + } + + wp_enqueue_style( + 'menu-icons', + "{$url}css/admin{$suffix}.css", + false, + Menu_Icons::VERSION + ); + + wp_enqueue_script( + 'menu-icons', + "{$script_url}js/admin{$suffix}.js", + self::$script_deps, + Menu_Icons::VERSION, + true + ); + + $customizer_url = add_query_arg( + array( + 'autofocus[section]' => 'custom_css', + 'return' => admin_url( 'nav-menus.php' ), + ), + admin_url( 'customize.php' ) + ); + + /** + * Allow plugins/themes to filter the settings' JS data + * + * @since 0.9.0 + * + * @param array $js_data JS Data. + */ + $menu_current_theme = ''; + $theme = wp_get_theme(); + if ( ! empty( $theme ) ) { + if ( is_child_theme() && $theme->parent() ) { + $menu_current_theme = $theme->parent()->get( 'Name' ); + } else { + $menu_current_theme = $theme->get( 'Name' ); + } + } + $upsell_notices = array(); + $box_data = ' + + + + + + ID ) ) { + wp_safe_redirect( home_url() ); + return; + } + + $provider = self::get_provider_for_user( $user, $provider ); + if ( ! $provider ) { + wp_die( __( 'Cheatin’ uh?', 'two-factor' ) ); + } + + // Run the provider processing. + $result = self::process_provider( $provider, $user, $is_post_request ); + if ( true !== $result ) { + $error = ''; + if ( is_wp_error( $result ) ) { + do_action( 'wp_login_failed', $user->user_login, $result ); + + $error = $result->get_error_message(); + } + + $nonce = wp_create_nonce( 'two_factor_revalidate_' . $user->ID ); + + self::login_html( $user, $nonce, $redirect_to, $error, $provider, 'revalidate_2fa' ); + return; + } + + // Update the session metadata with the revalidation details. + self::update_current_user_session( array( + 'two-factor-provider' => $provider->get_key(), + 'two-factor-login' => time(), + ) ); + + // Must be global because that's how login_header() uses it. + global $interim_login; + $interim_login = isset( $_REQUEST['interim-login'] ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited,WordPress.Security.NonceVerification.Recommended + + if ( $interim_login ) { + $message = '

' . __( 'You have revalidated successfully.', 'two-factor' ) . '

'; + $interim_login = 'success'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + login_header( '', $message ); + ?> + + + + pre_process_authentication( $user ) ) { + return false; + } + + // If it's not a POST request, there's no processing to perform. + if ( ! $is_post_request ) { + return false; + } + + // Rate limit two factor authentication attempts. + if ( true === self::is_user_rate_limited( $user ) ) { + $time_delay = self::get_user_time_delay( $user ); + $last_login = get_user_meta( $user->ID, self::USER_RATE_LIMIT_KEY, true ); + + return new WP_Error( + 'two_factor_too_fast', + sprintf( + __( 'ERROR: Too many invalid verification codes, you can try again in %s. This limit protects your account against automated attacks.', 'two-factor' ), + human_time_diff( $last_login + $time_delay ) + ) + ); + } + + // Ask the provider to verify the second factor. + if ( true !== $provider->validate_authentication( $user ) ) { + // Store the last time a failed login occured. + update_user_meta( $user->ID, self::USER_RATE_LIMIT_KEY, time() ); + + // Store the number of failed login attempts. + update_user_meta( $user->ID, self::USER_FAILED_LOGIN_ATTEMPTS_KEY, 1 + (int) get_user_meta( $user->ID, self::USER_FAILED_LOGIN_ATTEMPTS_KEY, true ) ); + + if ( ! is_user_logged_in() && self::should_reset_password( $user->ID ) ) { + self::reset_compromised_password( $user ); + self::send_password_reset_emails( $user ); + self::show_password_reset_error(); + exit; + } + + return new WP_Error( + 'two_factor_invalid', + __( 'ERROR: Invalid verification code.', 'two-factor' ) + ); + } + + return true; + } + + /** + * Determine if the user's password should be reset. + * + * @param int $user_id + * + * @return bool + */ + public static function should_reset_password( $user_id ) { + $failed_attempts = (int) get_user_meta( $user_id, self::USER_FAILED_LOGIN_ATTEMPTS_KEY, true ); + + /** + * Filters the maximum number of failed attempts on a 2nd factor before the user's + * password will be reset. After a reasonable number of attempts, it's safe to assume + * that the password has been compromised and an attacker is trying to brute force the 2nd + * factor. + * + * ⚠️ `get_user_time_delay()` mitigates brute force attempts, but many 2nd factors -- + * like TOTP and backup codes -- are very weak on their own, so it's not safe to give + * attackers unlimited attempts. Setting this to a very large number is strongly + * discouraged. + * + * @param int $limit The number of attempts before the password is reset. + */ + $failed_attempt_limit = apply_filters( 'two_factor_failed_attempt_limit', 30 ); + + return $failed_attempts >= $failed_attempt_limit; + } + + /** + * Reset a compromised password. + * + * If we know that the the password is compromised, we have the responsibility to reset it and inform the + * user. `get_user_time_delay()` mitigates brute force attempts, but this acts as an extra layer of defense + * which guarantees that attackers can't brute force it (unless they compromise the new password). + * + * @param WP_User $user The user who failed to login + */ + public static function reset_compromised_password( $user ) { + // Unhook because `wp_password_change_notification()` wouldn't notify the site admin when + // their password is compromised. + remove_action( 'after_password_reset', 'wp_password_change_notification' ); + reset_password( $user, wp_generate_password( 25 ) ); + update_user_meta( $user->ID, self::USER_PASSWORD_WAS_RESET_KEY, true ); + add_action( 'after_password_reset', 'wp_password_change_notification' ); + + self::delete_login_nonce( $user->ID ); + delete_user_meta( $user->ID, self::USER_RATE_LIMIT_KEY ); + delete_user_meta( $user->ID, self::USER_FAILED_LOGIN_ATTEMPTS_KEY ); + } + + /** + * Notify the user and admin that a password was reset for being compromised. + * + * @param WP_User $user The user whose password should be reset + */ + public static function send_password_reset_emails( $user ) { + self::notify_user_password_reset( $user ); + + /** + * Filters whether or not to email the site admin when a user's password has been + * compromised and reset. + * + * @param bool $reset `true` to notify the admin, `false` to not notify them. + */ + $notify_admin = apply_filters( 'two_factor_notify_admin_user_password_reset', true ); + $admin_email = get_option( 'admin_email' ); + + if ( $notify_admin && $admin_email !== $user->user_email ) { + self::notify_admin_user_password_reset( $user ); + } + } + + /** + * Notify the user that their password has been compromised and reset. + * + * @param WP_User $user The user to notify + * + * @return bool `true` if the email was sent, `false` if it failed. + */ + public static function notify_user_password_reset( $user ) { + $user_message = sprintf( + 'Hello %1$s, an unusually high number of failed login attempts have been detected on your account at %2$s. + + These attempts successfully entered your password, and were only blocked because they failed to enter your second authentication factor. Despite not being able to access your account, this behavior indicates that the attackers have compromised your password. The most common reasons for this are that your password was easy to guess, or was reused on another site which has been compromised. + + To protect your account, your password has been reset, and you will need to create a new one. For advice on setting a strong password, please read %3$s + + To pick a new password, please visit %4$s + + This is an automated notification. If you would like to speak to a site administrator, please contact them directly.', + esc_html( $user->user_login ), + home_url(), + 'https://wordpress.org/documentation/article/password-best-practices/', + esc_url( add_query_arg( 'action', 'lostpassword', wp_login_url() ) ) + ); + $user_message = str_replace( "\t", '', $user_message ); + + return wp_mail( $user->user_email, 'Your password was compromised and has been reset', $user_message ); + } + + /** + * Notify the admin that a user's password was compromised and reset. + * + * @param WP_User $user The user whose password was reset. + * + * @return bool `true` if the email was sent, `false` if it failed. + */ + public static function notify_admin_user_password_reset( $user ) { + $admin_email = get_option( 'admin_email' ); + $subject = sprintf( 'Compromised password for %s has been reset', esc_html( $user->user_login ) ); + + $message = sprintf( + 'Hello, this is a notice from the Two Factor plugin to inform you that an unusually high number of failed login attempts have been detected on the %1$s account (ID %2$d). + + Those attempts successfully entered the user\'s password, and were only blocked because they entered invalid second authentication factors. + + To protect their account, the password has automatically been reset, and they have been notified that they will need to create a new one. + + If you do not wish to receive these notifications, you can disable them with the `two_factor_notify_admin_user_password_reset` filter. See %3$s for more information. + + Thank you', + esc_html( $user->user_login ), + $user->ID, + 'https://developer.wordpress.org/plugins/hooks/' + ); + $message = str_replace( "\t", '', $message ); + + return wp_mail( $admin_email, $subject, $message ); + } + + /** + * Show the password reset error when on the login screen. + */ + public static function show_password_reset_error() { + $error = new WP_Error( + 'too_many_attempts', + sprintf( + '

%s

+

%s

', + __( 'There have been too many failed two-factor authentication attempts, which often indicates that the password has been compromised. The password has been reset in order to protect the account.', 'two-factor' ), + __( 'If you are the owner of this account, please check your email for instructions on regaining access.', 'two-factor' ) + ) + ); + + login_header( __( 'Password Reset', 'two-factor' ), '', $error ); + login_footer(); + } + + /** + * Filter the columns on the Users admin screen. + * + * @param array $columns Available columns. + * @return array Updated array of columns. + */ + public static function filter_manage_users_columns( array $columns ) { + $columns['two-factor'] = __( 'Two-Factor', 'two-factor' ); + return $columns; + } + + /** + * Output the 2FA column data on the Users screen. + * + * @param string $output The column output. + * @param string $column_name The column ID. + * @param int $user_id The user ID. + * @return string The column output. + */ + public static function manage_users_custom_column( $output, $column_name, $user_id ) { + + if ( 'two-factor' !== $column_name ) { + return $output; + } + + if ( ! self::is_user_using_two_factor( $user_id ) ) { + return sprintf( '%s', esc_html__( 'Disabled', 'two-factor' ) ); + } else { + $provider = self::get_primary_provider_for_user( $user_id ); + return esc_html( $provider->get_label() ); + } + + } + + /** + * Add user profile fields. + * + * This executes during the `show_user_profile` & `edit_user_profile` actions. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public static function user_two_factor_options( $user ) { + wp_enqueue_style( 'user-edit-2fa', plugins_url( 'user-edit.css', __FILE__ ), array(), TWO_FACTOR_VERSION ); + + $enabled_providers = array_keys( self::get_available_providers_for_user( $user ) ); + $primary_provider = self::get_primary_provider_for_user( $user->ID ); + + if ( ! empty( $primary_provider ) && is_object( $primary_provider ) ) { + $primary_provider_key = $primary_provider->get_key(); + } else { + $primary_provider_key = null; + } + + // This is specific to the current session, not the displayed user. + $show_2fa_options = self::current_user_can_update_two_factor_options(); + + if ( ! $show_2fa_options ) { + $url = self::get_user_two_factor_revalidate_url(); + $url = add_query_arg( 'redirect_to', urlencode( self::get_user_settings_page_url( $user->ID ) . '#two-factor-options' ), $url ); + + printf( + '

%s

', + sprintf( + __( 'To update your Two-Factor options, you must first revalidate your session.', 'two-factor' ) . + '
' . __( 'Revalidate now', 'two-factor' ) . '', + esc_url( $url ) + ) + ); + } + + printf( + '
', + $show_2fa_options ? '' : 'disabled="disabled"' + ); + + wp_nonce_field( 'user_two_factor_options', '_nonce_user_two_factor_options', false ); + ?> + + + + + + +
+ + + + + + + + + + + + $object ) : ?> + + + + + + + +
/> /> + + +
+
+
+ '', + 'two-factor-login' => time(), + ) ); + } elseif ( $existing_providers && ! $enabled_providers ) { + // We've disabled two-factor, remove session metadata. + self::update_current_user_session( array( + 'two-factor-provider' => null, + 'two-factor-login' => null, + ) ); + } + } + + // Destroy other sessions if setup 2FA for the first time, or deactivated a provider + if ( + // No providers, enabling one (or more) + ( ! $existing_providers && $enabled_providers ) || + // Has providers, and is disabling one (or more), but remaining with 2FA. + ( $existing_providers && $enabled_providers && array_diff( $existing_providers, $enabled_providers ) ) + ) { + if ( $user_id === get_current_user_id() ) { + // Keep the current session, destroy others sessions for this user. + wp_destroy_other_sessions(); + } else { + // Destroy all sessions for the user. + WP_Session_Tokens::get_instance( $user_id )->destroy_all(); + } + } + } + } + + /** + * Update the current user session metadata. + * + * Any values set in $data that are null will be removed from the user session metadata. + * + * @param array $data The data to append/remove from the current session. + * @return bool + */ + public static function update_current_user_session( $data = array() ) { + $user_id = get_current_user_id(); + $token = wp_get_session_token(); + if ( ! $user_id || ! $token ) { + return false; + } + + $manager = WP_Session_Tokens::get_instance( $user_id ); + $session = $manager->get( $token ); + + // Add any session data. + $session = array_merge( $session, $data ); + + // Remove any set null fields. + foreach ( array_filter( $data, 'is_null' ) as $key => $null ) { + unset( $session[ $key ] ); + } + + return $manager->update( $token, $session ); + } + + /** + * Fetch the current user session metadata. + * + * @return false|array The session array, false on error. + */ + public static function get_current_user_session() { + $user_id = get_current_user_id(); + $token = wp_get_session_token(); + if ( ! $user_id || ! $token ) { + return false; + } + + $manager = WP_Session_Tokens::get_instance( $user_id ); + + return $manager->get( $token ); + } + + /** + * Should the login session persist between sessions. + * + * @return boolean + */ + public static function rememberme() { + $rememberme = false; + + if ( ! empty( $_REQUEST['rememberme'] ) ) { + $rememberme = true; + } + + return (bool) apply_filters( 'two_factor_rememberme', $rememberme ); + } + + /** + * Sync the Two-Factor session data from the current session to newly created sessions. + * + * This is required as WordPress creates a new session when the user password is changed. + * + * @see https://core.trac.wordpress.org/ticket/58427 + * + * @param array $session The Session information. + * @param int $user_id The User ID for the session. + * @return array + */ + public static function filter_session_information( $session, $user_id ) { + if ( $user_id !== get_current_user_id() ) { + return $session; + } + + $current_session = self::get_current_user_session(); + if ( $current_session ) { + foreach ( $current_session as $key => $value ) { + if ( str_starts_with( $key, 'two-factor-' ) ) { + $session[ $key ] = $value; + } + } + } + + return $session; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Google/u2f-api.js b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Google/u2f-api.js new file mode 100644 index 00000000..1036b920 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Google/u2f-api.js @@ -0,0 +1,748 @@ +//Copyright 2014-2015 Google Inc. All rights reserved. + +//Use of this source code is governed by a BSD-style +//license that can be found in the LICENSE file or at +//https://developers.google.com/open-source/licenses/bsd + +/** + * @fileoverview The U2F api. + */ +'use strict'; + + +/** + * Namespace for the U2F api. + * @type {Object} + */ +var u2f = u2f || {}; + +/** + * FIDO U2F Javascript API Version + * @number + */ +var js_api_version; + +/** + * The U2F extension id + * @const {string} + */ +// The Chrome packaged app extension ID. +// Uncomment this if you want to deploy a server instance that uses +// the package Chrome app and does not require installing the U2F Chrome extension. + u2f.EXTENSION_ID = 'kmendfapggjehodndflmmgagdbamhnfd'; +// The U2F Chrome extension ID. +// Uncomment this if you want to deploy a server instance that uses +// the U2F Chrome extension to authenticate. +// u2f.EXTENSION_ID = 'pfboblefjcgdjicmnffhdgionmgcdmne'; + + +/** + * Message types for messages to/from the extension + * @const + * @enum {string} + */ +u2f.MessageTypes = { + 'U2F_REGISTER_REQUEST': 'u2f_register_request', + 'U2F_REGISTER_RESPONSE': 'u2f_register_response', + 'U2F_SIGN_REQUEST': 'u2f_sign_request', + 'U2F_SIGN_RESPONSE': 'u2f_sign_response', + 'U2F_GET_API_VERSION_REQUEST': 'u2f_get_api_version_request', + 'U2F_GET_API_VERSION_RESPONSE': 'u2f_get_api_version_response' +}; + + +/** + * Response status codes + * @const + * @enum {number} + */ +u2f.ErrorCodes = { + 'OK': 0, + 'OTHER_ERROR': 1, + 'BAD_REQUEST': 2, + 'CONFIGURATION_UNSUPPORTED': 3, + 'DEVICE_INELIGIBLE': 4, + 'TIMEOUT': 5 +}; + + +/** + * A message for registration requests + * @typedef {{ + * type: u2f.MessageTypes, + * appId: ?string, + * timeoutSeconds: ?number, + * requestId: ?number + * }} + */ +u2f.U2fRequest; + + +/** + * A message for registration responses + * @typedef {{ + * type: u2f.MessageTypes, + * responseData: (u2f.Error | u2f.RegisterResponse | u2f.SignResponse), + * requestId: ?number + * }} + */ +u2f.U2fResponse; + + +/** + * An error object for responses + * @typedef {{ + * errorCode: u2f.ErrorCodes, + * errorMessage: ?string + * }} + */ +u2f.Error; + +/** + * Data object for a single sign request. + * @typedef {enum {BLUETOOTH_RADIO, BLUETOOTH_LOW_ENERGY, USB, NFC}} + */ +u2f.Transport; + + +/** + * Data object for a single sign request. + * @typedef {Array} + */ +u2f.Transports; + +/** + * Data object for a single sign request. + * @typedef {{ + * version: string, + * challenge: string, + * keyHandle: string, + * appId: string + * }} + */ +u2f.SignRequest; + + +/** + * Data object for a sign response. + * @typedef {{ + * keyHandle: string, + * signatureData: string, + * clientData: string + * }} + */ +u2f.SignResponse; + + +/** + * Data object for a registration request. + * @typedef {{ + * version: string, + * challenge: string + * }} + */ +u2f.RegisterRequest; + + +/** + * Data object for a registration response. + * @typedef {{ + * version: string, + * keyHandle: string, + * transports: Transports, + * appId: string + * }} + */ +u2f.RegisterResponse; + + +/** + * Data object for a registered key. + * @typedef {{ + * version: string, + * keyHandle: string, + * transports: ?Transports, + * appId: ?string + * }} + */ +u2f.RegisteredKey; + + +/** + * Data object for a get API register response. + * @typedef {{ + * js_api_version: number + * }} + */ +u2f.GetJsApiVersionResponse; + + +//Low level MessagePort API support + +/** + * Sets up a MessagePort to the U2F extension using the + * available mechanisms. + * @param {function((MessagePort|u2f.WrappedChromeRuntimePort_))} callback + */ +u2f.getMessagePort = function(callback) { + if (typeof chrome != 'undefined' && chrome.runtime) { + // The actual message here does not matter, but we need to get a reply + // for the callback to run. Thus, send an empty signature request + // in order to get a failure response. + var msg = { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + signRequests: [] + }; + chrome.runtime.sendMessage(u2f.EXTENSION_ID, msg, function() { + if (!chrome.runtime.lastError) { + // We are on a whitelisted origin and can talk directly + // with the extension. + u2f.getChromeRuntimePort_(callback); + } else { + // chrome.runtime was available, but we couldn't message + // the extension directly, use iframe + u2f.getIframePort_(callback); + } + }); + } else if (u2f.isAndroidChrome_()) { + u2f.getAuthenticatorPort_(callback); + } else if (u2f.isIosChrome_()) { + u2f.getIosPort_(callback); + } else { + // chrome.runtime was not available at all, which is normal + // when this origin doesn't have access to any extensions. + u2f.getIframePort_(callback); + } +}; + +/** + * Detect chrome running on android based on the browser's useragent. + * @private + */ +u2f.isAndroidChrome_ = function() { + var userAgent = navigator.userAgent; + return userAgent.indexOf('Chrome') != -1 && + userAgent.indexOf('Android') != -1; +}; + +/** + * Detect chrome running on iOS based on the browser's platform. + * @private + */ +u2f.isIosChrome_ = function() { + return ["iPhone", "iPad", "iPod"].indexOf(navigator.platform) > -1; +}; + +/** + * Connects directly to the extension via chrome.runtime.connect. + * @param {function(u2f.WrappedChromeRuntimePort_)} callback + * @private + */ +u2f.getChromeRuntimePort_ = function(callback) { + var port = chrome.runtime.connect(u2f.EXTENSION_ID, + {'includeTlsChannelId': true}); + setTimeout(function() { + callback(new u2f.WrappedChromeRuntimePort_(port)); + }, 0); +}; + +/** + * Return a 'port' abstraction to the Authenticator app. + * @param {function(u2f.WrappedAuthenticatorPort_)} callback + * @private + */ +u2f.getAuthenticatorPort_ = function(callback) { + setTimeout(function() { + callback(new u2f.WrappedAuthenticatorPort_()); + }, 0); +}; + +/** + * Return a 'port' abstraction to the iOS client app. + * @param {function(u2f.WrappedIosPort_)} callback + * @private + */ +u2f.getIosPort_ = function(callback) { + setTimeout(function() { + callback(new u2f.WrappedIosPort_()); + }, 0); +}; + +/** + * A wrapper for chrome.runtime.Port that is compatible with MessagePort. + * @param {Port} port + * @constructor + * @private + */ +u2f.WrappedChromeRuntimePort_ = function(port) { + this.port_ = port; +}; + +/** + * Format and return a sign request compliant with the JS API version supported by the extension. + * @param {Array} signRequests + * @param {number} timeoutSeconds + * @param {number} reqId + * @return {Object} + */ +u2f.formatSignRequest_ = + function(appId, challenge, registeredKeys, timeoutSeconds, reqId) { + if (js_api_version === undefined || js_api_version < 1.1) { + // Adapt request to the 1.0 JS API. + var signRequests = []; + for (var i = 0; i < registeredKeys.length; i++) { + signRequests[i] = { + version: registeredKeys[i].version, + challenge: challenge, + keyHandle: registeredKeys[i].keyHandle, + appId: appId + }; + } + return { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + signRequests: signRequests, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + } + // JS 1.1 API. + return { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + appId: appId, + challenge: challenge, + registeredKeys: registeredKeys, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; +}; + +/** + * Format and return a register request compliant with the JS API version supported by the extension.. + * @param {Array} signRequests + * @param {Array} signRequests + * @param {number} timeoutSeconds + * @param {number} reqId + * @return {Object} + */ +u2f.formatRegisterRequest_ = + function(appId, registeredKeys, registerRequests, timeoutSeconds, reqId) { + if (js_api_version === undefined || js_api_version < 1.1) { + // Adapt request to the 1.0 JS API. + for (var i = 0; i < registerRequests.length; i++) { + registerRequests[i].appId = appId; + } + var signRequests = []; + for (var i = 0; i < registeredKeys.length; i++) { + signRequests[i] = { + version: registeredKeys[i].version, + challenge: registerRequests[0], + keyHandle: registeredKeys[i].keyHandle, + appId: appId + }; + } + return { + type: u2f.MessageTypes.U2F_REGISTER_REQUEST, + signRequests: signRequests, + registerRequests: registerRequests, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + } + // JS 1.1 API. + return { + type: u2f.MessageTypes.U2F_REGISTER_REQUEST, + appId: appId, + registerRequests: registerRequests, + registeredKeys: registeredKeys, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; +}; + + +/** + * Posts a message on the underlying channel. + * @param {Object} message + */ +u2f.WrappedChromeRuntimePort_.prototype.postMessage = function(message) { + this.port_.postMessage(message); +}; + + +/** + * Emulates the HTML 5 addEventListener interface. Works only for the + * onmessage event, which is hooked up to the chrome.runtime.Port.onMessage. + * @param {string} eventName + * @param {function({data: Object})} handler + */ +u2f.WrappedChromeRuntimePort_.prototype.addEventListener = + function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name == 'message' || name == 'onmessage') { + this.port_.onMessage.addListener(function(message) { + // Emulate a minimal MessageEvent object. + handler({'data': message}); + }); + } else { + console.error('WrappedChromeRuntimePort only supports onMessage'); + } +}; + +/** + * Wrap the Authenticator app with a MessagePort interface. + * @constructor + * @private + */ +u2f.WrappedAuthenticatorPort_ = function() { + this.requestId_ = -1; + this.requestObject_ = null; +} + +/** + * Launch the Authenticator intent. + * @param {Object} message + */ +u2f.WrappedAuthenticatorPort_.prototype.postMessage = function(message) { + var intentUrl = + u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_ + + ';S.request=' + encodeURIComponent(JSON.stringify(message)) + + ';end'; + document.location = intentUrl; +}; + +/** + * Tells what type of port this is. + * @return {String} port type + */ +u2f.WrappedAuthenticatorPort_.prototype.getPortType = function() { + return "WrappedAuthenticatorPort_"; +}; + + +/** + * Emulates the HTML 5 addEventListener interface. + * @param {string} eventName + * @param {function({data: Object})} handler + */ +u2f.WrappedAuthenticatorPort_.prototype.addEventListener = function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name == 'message') { + var self = this; + /* Register a callback to that executes when + * chrome injects the response. */ + window.addEventListener( + 'message', self.onRequestUpdate_.bind(self, handler), false); + } else { + console.error('WrappedAuthenticatorPort only supports message'); + } +}; + +/** + * Callback invoked when a response is received from the Authenticator. + * @param function({data: Object}) callback + * @param {Object} message message Object + */ +u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_ = + function(callback, message) { + var messageObject = JSON.parse(message.data); + var intentUrl = messageObject['intentURL']; + + var errorCode = messageObject['errorCode']; + var responseObject = null; + if (messageObject.hasOwnProperty('data')) { + responseObject = /** @type {Object} */ ( + JSON.parse(messageObject['data'])); + } + + callback({'data': responseObject}); +}; + +/** + * Base URL for intents to Authenticator. + * @const + * @private + */ +u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_ = + 'intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE'; + +/** + * Wrap the iOS client app with a MessagePort interface. + * @constructor + * @private + */ +u2f.WrappedIosPort_ = function() {}; + +/** + * Launch the iOS client app request + * @param {Object} message + */ +u2f.WrappedIosPort_.prototype.postMessage = function(message) { + var str = JSON.stringify(message); + var url = "u2f://auth?" + encodeURI(str); + location.replace(url); +}; + +/** + * Tells what type of port this is. + * @return {String} port type + */ +u2f.WrappedIosPort_.prototype.getPortType = function() { + return "WrappedIosPort_"; +}; + +/** + * Emulates the HTML 5 addEventListener interface. + * @param {string} eventName + * @param {function({data: Object})} handler + */ +u2f.WrappedIosPort_.prototype.addEventListener = function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name !== 'message') { + console.error('WrappedIosPort only supports message'); + } +}; + +/** + * Sets up an embedded trampoline iframe, sourced from the extension. + * @param {function(MessagePort)} callback + * @private + */ +u2f.getIframePort_ = function(callback) { + // Create the iframe + var iframeOrigin = 'chrome-extension://' + u2f.EXTENSION_ID; + var iframe = document.createElement('iframe'); + iframe.src = iframeOrigin + '/u2f-comms.html'; + iframe.setAttribute('style', 'display:none'); + document.body.appendChild(iframe); + + var channel = new MessageChannel(); + var ready = function(message) { + if (message.data == 'ready') { + channel.port1.removeEventListener('message', ready); + callback(channel.port1); + } else { + console.error('First event on iframe port was not "ready"'); + } + }; + channel.port1.addEventListener('message', ready); + channel.port1.start(); + + iframe.addEventListener('load', function() { + // Deliver the port to the iframe and initialize + iframe.contentWindow.postMessage('init', iframeOrigin, [channel.port2]); + }); +}; + + +//High-level JS API + +/** + * Default extension response timeout in seconds. + * @const + */ +u2f.EXTENSION_TIMEOUT_SEC = 30; + +/** + * A singleton instance for a MessagePort to the extension. + * @type {MessagePort|u2f.WrappedChromeRuntimePort_} + * @private + */ +u2f.port_ = null; + +/** + * Callbacks waiting for a port + * @type {Array} + * @private + */ +u2f.waitingForPort_ = []; + +/** + * A counter for requestIds. + * @type {number} + * @private + */ +u2f.reqCounter_ = 0; + +/** + * A map from requestIds to client callbacks + * @type {Object.} + * @private + */ +u2f.callbackMap_ = {}; + +/** + * Creates or retrieves the MessagePort singleton to use. + * @param {function((MessagePort|u2f.WrappedChromeRuntimePort_))} callback + * @private + */ +u2f.getPortSingleton_ = function(callback) { + if (u2f.port_) { + callback(u2f.port_); + } else { + if (u2f.waitingForPort_.length == 0) { + u2f.getMessagePort(function(port) { + u2f.port_ = port; + u2f.port_.addEventListener('message', + /** @type {function(Event)} */ (u2f.responseHandler_)); + + // Careful, here be async callbacks. Maybe. + while (u2f.waitingForPort_.length) + u2f.waitingForPort_.shift()(u2f.port_); + }); + } + u2f.waitingForPort_.push(callback); + } +}; + +/** + * Handles response messages from the extension. + * @param {MessageEvent.} message + * @private + */ +u2f.responseHandler_ = function(message) { + var response = message.data; + var reqId = response['requestId']; + if (!reqId || !u2f.callbackMap_[reqId]) { + console.error('Unknown or missing requestId in response.'); + return; + } + var cb = u2f.callbackMap_[reqId]; + delete u2f.callbackMap_[reqId]; + cb(response['responseData']); +}; + +/** + * Dispatches an array of sign requests to available U2F tokens. + * If the JS API version supported by the extension is unknown, it first sends a + * message to the extension to find out the supported API version and then it sends + * the sign request. + * @param {string=} appId + * @param {string=} challenge + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.SignResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.sign = function(appId, challenge, registeredKeys, callback, opt_timeoutSeconds) { + if (js_api_version === undefined) { + // Send a message to get the extension to JS API version, then send the actual sign request. + u2f.getApiVersion( + function (response) { + js_api_version = response['js_api_version'] === undefined ? 0 : response['js_api_version']; + console.log("Extension JS API Version: ", js_api_version); + u2f.sendSignRequest(appId, challenge, registeredKeys, callback, opt_timeoutSeconds); + }); + } else { + // We know the JS API version. Send the actual sign request in the supported API version. + u2f.sendSignRequest(appId, challenge, registeredKeys, callback, opt_timeoutSeconds); + } +}; + +/** + * Dispatches an array of sign requests to available U2F tokens. + * @param {string=} appId + * @param {string=} challenge + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.SignResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.sendSignRequest = function(appId, challenge, registeredKeys, callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var timeoutSeconds = (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC); + var req = u2f.formatSignRequest_(appId, challenge, registeredKeys, timeoutSeconds, reqId); + port.postMessage(req); + }); +}; + +/** + * Dispatches register requests to available U2F tokens. An array of sign + * requests identifies already registered tokens. + * If the JS API version supported by the extension is unknown, it first sends a + * message to the extension to find out the supported API version and then it sends + * the register request. + * @param {string=} appId + * @param {Array} registerRequests + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.RegisterResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.register = function(appId, registerRequests, registeredKeys, callback, opt_timeoutSeconds) { + if (js_api_version === undefined) { + // Send a message to get the extension to JS API version, then send the actual register request. + u2f.getApiVersion( + function (response) { + js_api_version = response['js_api_version'] === undefined ? 0: response['js_api_version']; + console.log("Extension JS API Version: ", js_api_version); + u2f.sendRegisterRequest(appId, registerRequests, registeredKeys, + callback, opt_timeoutSeconds); + }); + } else { + // We know the JS API version. Send the actual register request in the supported API version. + u2f.sendRegisterRequest(appId, registerRequests, registeredKeys, + callback, opt_timeoutSeconds); + } +}; + +/** + * Dispatches register requests to available U2F tokens. An array of sign + * requests identifies already registered tokens. + * @param {string=} appId + * @param {Array} registerRequests + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.RegisterResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.sendRegisterRequest = function(appId, registerRequests, registeredKeys, callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var timeoutSeconds = (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC); + var req = u2f.formatRegisterRequest_( + appId, registeredKeys, registerRequests, timeoutSeconds, reqId); + port.postMessage(req); + }); +}; + + +/** + * Dispatches a message to the extension to find out the supported + * JS API version. + * If the user is on a mobile phone and is thus using Google Authenticator instead + * of the Chrome extension, don't send the request and simply return 0. + * @param {function((u2f.Error|u2f.GetJsApiVersionResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.getApiVersion = function(callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + // If we are using Android Google Authenticator or iOS client app, + // do not fire an intent to ask which JS API version to use. + if (port.getPortType) { + var apiVersion; + switch (port.getPortType()) { + case 'WrappedIosPort_': + case 'WrappedAuthenticatorPort_': + apiVersion = 1.1; + break; + + default: + apiVersion = 0; + break; + } + callback({ 'js_api_version': apiVersion }); + return; + } + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var req = { + type: u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST, + timeoutSeconds: (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC), + requestId: reqId + }; + port.postMessage(req); + }); +}; diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Yubico/U2F.php b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Yubico/U2F.php new file mode 100644 index 00000000..e819bbc1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Yubico/U2F.php @@ -0,0 +1,507 @@ +appId = $appId; + $this->attestDir = $attestDir; + } + + /** + * Called to get a registration request to send to a user. + * Returns an array of one registration request and a array of sign requests. + * + * @param array $registrations List of current registrations for this + * user, to prevent the user from registering the same authenticator several + * times. + * @return array An array of two elements, the first containing a + * RegisterRequest the second being an array of SignRequest + * @throws Error + */ + public function getRegisterData(array $registrations = array()) + { + $challenge = $this->createChallenge(); + $request = new RegisterRequest($challenge, $this->appId); + $signs = $this->getAuthenticateData($registrations); + return array($request, $signs); + } + + /** + * Called to verify and unpack a registration message. + * + * @param RegisterRequest $request this is a reply to + * @param object $response response from a user + * @param bool $includeCert set to true if the attestation certificate should be + * included in the returned Registration object + * @return Registration + * @throws Error + */ + public function doRegister($request, $response, $includeCert = true) + { + if( !is_object( $request ) ) { + throw new \InvalidArgumentException('$request of doRegister() method only accepts object.'); + } + + if( !is_object( $response ) ) { + throw new \InvalidArgumentException('$response of doRegister() method only accepts object.'); + } + + if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) { + throw new Error('User-agent returned error. Error code: ' . $response->errorCode, ERR_BAD_UA_RETURNING ); + } + + if( !is_bool( $includeCert ) ) { + throw new \InvalidArgumentException('$include_cert of doRegister() method only accepts boolean.'); + } + + $rawReg = $this->base64u_decode($response->registrationData); + $regData = array_values(unpack('C*', $rawReg)); + $clientData = $this->base64u_decode($response->clientData); + $cli = json_decode($clientData); + + if($cli->challenge !== $request->challenge) { + throw new Error('Registration challenge does not match', ERR_UNMATCHED_CHALLENGE ); + } + + $registration = new Registration(); + $offs = 1; + $pubKey = substr($rawReg, $offs, PUBKEY_LEN); + $offs += PUBKEY_LEN; + // Decode the pubKey to make sure it's good. + $tmpKey = $this->pubkey_to_pem($pubKey); + if($tmpKey === null) { + throw new Error('Decoding of public key failed', ERR_PUBKEY_DECODE ); + } + $registration->publicKey = base64_encode($pubKey); + $khLen = $regData[$offs++]; + $kh = substr($rawReg, $offs, $khLen); + $offs += $khLen; + $registration->keyHandle = $this->base64u_encode($kh); + + // length of certificate is stored in byte 3 and 4 (excluding the first 4 bytes). + $certLen = 4; + $certLen += ($regData[$offs + 2] << 8); + $certLen += $regData[$offs + 3]; + + $rawCert = $this->fixSignatureUnusedBits(substr($rawReg, $offs, $certLen)); + $offs += $certLen; + $pemCert = "-----BEGIN CERTIFICATE-----\r\n"; + $pemCert .= chunk_split(base64_encode($rawCert), 64); + $pemCert .= "-----END CERTIFICATE-----"; + if($includeCert) { + $registration->certificate = base64_encode($rawCert); + } + if($this->attestDir) { + if(openssl_x509_checkpurpose($pemCert, -1, $this->get_certs()) !== true) { + throw new Error('Attestation certificate can not be validated', ERR_ATTESTATION_VERIFICATION ); + } + } + + if(!openssl_pkey_get_public($pemCert)) { + throw new Error('Decoding of public key failed', ERR_PUBKEY_DECODE ); + } + $signature = substr($rawReg, $offs); + + $dataToVerify = chr(0); + $dataToVerify .= hash('sha256', $request->appId, true); + $dataToVerify .= hash('sha256', $clientData, true); + $dataToVerify .= $kh; + $dataToVerify .= $pubKey; + + if(openssl_verify($dataToVerify, $signature, $pemCert, 'sha256') === 1) { + return $registration; + } else { + throw new Error('Attestation signature does not match', ERR_ATTESTATION_SIGNATURE ); + } + } + + /** + * Called to get an authentication request. + * + * @param array $registrations An array of the registrations to create authentication requests for. + * @return array An array of SignRequest + * @throws Error + */ + public function getAuthenticateData(array $registrations) + { + $sigs = array(); + $challenge = $this->createChallenge(); + foreach ($registrations as $reg) { + if( !is_object( $reg ) ) { + throw new \InvalidArgumentException('$registrations of getAuthenticateData() method only accepts array of object.'); + } + + $sig = new SignRequest(); + $sig->appId = $this->appId; + $sig->keyHandle = $reg->keyHandle; + $sig->challenge = $challenge; + $sigs[] = $sig; + } + return $sigs; + } + + /** + * Called to verify an authentication response + * + * @param array $requests An array of outstanding authentication requests + * @param array $registrations An array of current registrations + * @param object $response A response from the authenticator + * @return Registration + * @throws Error + * + * The Registration object returned on success contains an updated counter + * that should be saved for future authentications. + * If the Error returned is ERR_COUNTER_TOO_LOW this is an indication of + * token cloning or similar and appropriate action should be taken. + */ + public function doAuthenticate(array $requests, array $registrations, $response) + { + if( !is_object( $response ) ) { + throw new \InvalidArgumentException('$response of doAuthenticate() method only accepts object.'); + } + + if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) { + throw new Error('User-agent returned error. Error code: ' . $response->errorCode, ERR_BAD_UA_RETURNING ); + } + + /** @var object|null $req */ + $req = null; + + /** @var object|null $reg */ + $reg = null; + + $clientData = $this->base64u_decode($response->clientData); + $decodedClient = json_decode($clientData); + foreach ($requests as $req) { + if( !is_object( $req ) ) { + throw new \InvalidArgumentException('$requests of doAuthenticate() method only accepts array of object.'); + } + + if($req->keyHandle === $response->keyHandle && $req->challenge === $decodedClient->challenge) { + break; + } + + $req = null; + } + if($req === null) { + throw new Error('No matching request found', ERR_NO_MATCHING_REQUEST ); + } + foreach ($registrations as $reg) { + if( !is_object( $reg ) ) { + throw new \InvalidArgumentException('$registrations of doAuthenticate() method only accepts array of object.'); + } + + if($reg->keyHandle === $response->keyHandle) { + break; + } + $reg = null; + } + if($reg === null) { + throw new Error('No matching registration found', ERR_NO_MATCHING_REGISTRATION ); + } + $pemKey = $this->pubkey_to_pem($this->base64u_decode($reg->publicKey)); + if($pemKey === null) { + throw new Error('Decoding of public key failed', ERR_PUBKEY_DECODE ); + } + + $signData = $this->base64u_decode($response->signatureData); + $dataToVerify = hash('sha256', $req->appId, true); + $dataToVerify .= substr($signData, 0, 5); + $dataToVerify .= hash('sha256', $clientData, true); + $signature = substr($signData, 5); + + if(openssl_verify($dataToVerify, $signature, $pemKey, 'sha256') === 1) { + $ctr = unpack("Nctr", substr($signData, 1, 4)); + $counter = $ctr['ctr']; + /* TODO: wrap-around should be handled somehow.. */ + if($counter > $reg->counter) { + $reg->counter = $counter; + return $reg; + } else { + throw new Error('Counter too low.', ERR_COUNTER_TOO_LOW ); + } + } else { + throw new Error('Authentication failed', ERR_AUTHENTICATION_FAILURE ); + } + } + + /** + * @return array + */ + private function get_certs() + { + $files = array(); + $dir = $this->attestDir; + if($dir && $handle = opendir($dir)) { + while(false !== ($entry = readdir($handle))) { + if(is_file("$dir/$entry")) { + $files[] = "$dir/$entry"; + } + } + closedir($handle); + } + return $files; + } + + /** + * @param string $data + * @return string + */ + private function base64u_encode($data) + { + return trim(strtr(base64_encode($data), '+/', '-_'), '='); + } + + /** + * @param string $data + * @return string + */ + private function base64u_decode($data) + { + return base64_decode(strtr($data, '-_', '+/')); + } + + /** + * @param string $key + * @return null|string + */ + private function pubkey_to_pem($key) + { + if(strlen($key) !== PUBKEY_LEN || $key[0] !== "\x04") { + return null; + } + + /* + * Convert the public key to binary DER format first + * Using the ECC SubjectPublicKeyInfo OIDs from RFC 5480 + * + * SEQUENCE(2 elem) 30 59 + * SEQUENCE(2 elem) 30 13 + * OID1.2.840.10045.2.1 (id-ecPublicKey) 06 07 2a 86 48 ce 3d 02 01 + * OID1.2.840.10045.3.1.7 (secp256r1) 06 08 2a 86 48 ce 3d 03 01 07 + * BIT STRING(520 bit) 03 42 ..key.. + */ + $der = "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01"; + $der .= "\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42"; + $der .= "\0".$key; + + $pem = "-----BEGIN PUBLIC KEY-----\r\n"; + $pem .= chunk_split(base64_encode($der), 64); + $pem .= "-----END PUBLIC KEY-----"; + + return $pem; + } + + /** + * @return string + * @throws Error + */ + private function createChallenge() + { + $challenge = openssl_random_pseudo_bytes(32, $crypto_strong ); + if( $crypto_strong !== true ) { + throw new Error('Unable to obtain a good source of randomness', ERR_BAD_RANDOM); + } + + $challenge = $this->base64u_encode( $challenge ); + + return $challenge; + } + + /** + * Fixes a certificate where the signature contains unused bits. + * + * @param string $cert + * @return mixed + */ + private function fixSignatureUnusedBits($cert) + { + if(in_array(hash('sha256', $cert), $this->FIXCERTS)) { + $cert[strlen($cert) - 257] = "\0"; + } + return $cert; + } +} + +/** + * Class for building a registration request + * + * @package u2flib_server + */ +class RegisterRequest +{ + /** Protocol version */ + public $version = U2F_VERSION; + + /** Registration challenge */ + public $challenge; + + /** Application id */ + public $appId; + + /** + * @param string $challenge + * @param string $appId + * @internal + */ + public function __construct($challenge, $appId) + { + $this->challenge = $challenge; + $this->appId = $appId; + } +} + +/** + * Class for building up an authentication request + * + * @package u2flib_server + */ +class SignRequest +{ + /** Protocol version */ + public $version = U2F_VERSION; + + /** Authentication challenge */ + public $challenge; + + /** Key handle of a registered authenticator */ + public $keyHandle; + + /** Application id */ + public $appId; +} + +/** + * Class returned for successful registrations + * + * @package u2flib_server + */ +class Registration +{ + /** The key handle of the registered authenticator */ + public $keyHandle; + + /** The public key of the registered authenticator */ + public $publicKey; + + /** The attestation certificate of the registered authenticator */ + public $certificate; + + /** The counter associated with this registration */ + public $counter = -1; +} + +/** + * Error class, returned on errors + * + * @package u2flib_server + */ +class Error extends \Exception +{ + /** + * Override constructor and make message and code mandatory + * @param string $message + * @param int $code + * @param \Exception|null $previous + */ + public function __construct($message, $code, \Exception $previous = null) { + parent::__construct($message, $code, $previous); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/includes/function.login-footer.php b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/function.login-footer.php new file mode 100644 index 00000000..a2876b02 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/function.login-footer.php @@ -0,0 +1,87 @@ + +

+ %s', + esc_url( home_url( '/' ) ), + sprintf( + /* translators: %s: Site title. */ + _x( '← Go to %s', 'site' ), + get_bloginfo( 'title', 'display' ) + ) + ); + /** + * Filter the "Go to site" link displayed in the login page footer. + * + * @since 5.7.0 + * + * @param string $link HTML link to the home URL of the current site. + */ + echo apply_filters( 'login_site_html_link', $html_link ); + ?> +

+ ', '' ); + } + + ?> + . ?> + + + + +
+ + + + + ` element. + * Default 'Log In'. + * @param string $message Optional. Message to display in header. Default empty. + * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance. + */ +function login_header( $title = 'Log In', $message = '', $wp_error = null ) { + global $error, $interim_login, $action; + + // Don't index any of these forms. + add_filter( 'wp_robots', 'wp_robots_sensitive_page' ); + add_action( 'login_head', 'wp_strict_cross_origin_referrer' ); + + add_action( 'login_head', 'wp_login_viewport_meta' ); + + if ( ! is_wp_error( $wp_error ) ) { + $wp_error = new WP_Error(); + } + + // Shake it! + $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password', 'retrieve_password_email_failure' ); + /** + * Filters the error codes array for shaking the login form. + * + * @since 3.0.0 + * + * @param array $shake_error_codes Error codes that shake the login form. + */ + $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); + + if ( $shake_error_codes && $wp_error->has_errors() && in_array( $wp_error->get_error_code(), $shake_error_codes, true ) ) { + add_action( 'login_footer', 'wp_shake_js', 12 ); + } + + $login_title = get_bloginfo( 'name', 'display' ); + + /* translators: Login screen title. 1: Login screen name, 2: Network or site name. */ + $login_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $login_title ); + + if ( wp_is_recovery_mode() ) { + /* translators: %s: Login screen title. */ + $login_title = sprintf( __( 'Recovery Mode — %s' ), $login_title ); + } + + /** + * Filters the title tag content for login page. + * + * @since 4.9.0 + * + * @param string $login_title The page title, with extra context added. + * @param string $title The original page title. + */ + $login_title = apply_filters( 'login_title', $login_title, $title ); + + ?> + > + + + <?php echo $login_title; ?> + get_error_code() ) { + ?> + + + + + + + + +
+

+ add( 'error', $error ); + unset( $error ); + } + + if ( $wp_error->has_errors() ) { + $errors = ''; + $messages = ''; + + foreach ( $wp_error->get_error_codes() as $code ) { + $severity = $wp_error->get_error_data( $code ); + foreach ( $wp_error->get_error_messages( $code ) as $error_message ) { + if ( 'message' === $severity ) { + $messages .= ' ' . $error_message . "
\n"; + } else { + $errors .= ' ' . $error_message . "
\n"; + } + } + } + + if ( ! empty( $errors ) ) { + /** + * Filters the error messages displayed above the login form. + * + * @since 2.1.0 + * + * @param string $errors Login error message. + */ + echo '
' . apply_filters( 'login_errors', $errors ) . "
\n"; + } + + if ( ! empty( $messages ) ) { + /** + * Filters instructional messages displayed above the login form. + * + * @since 2.5.0 + * + * @param string $messages Login messages. + */ + echo '

' . apply_filters( 'login_messages', $messages ) . "

\n"; + } + } +} // End of login_header(). + +/** + * Outputs the viewport meta tag for the login page. + * + * @since 3.7.0 + */ +function wp_login_viewport_meta() { + ?> + + = 7) { + setupTypeNumber(test); + } + + if (_dataCache == null) { + _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList); + } + + mapData(_dataCache, maskPattern); + }; + + var setupPositionProbePattern = function(row, col) { + + for (var r = -1; r <= 7; r += 1) { + + if (row + r <= -1 || _moduleCount <= row + r) continue; + + for (var c = -1; c <= 7; c += 1) { + + if (col + c <= -1 || _moduleCount <= col + c) continue; + + if ( (0 <= r && r <= 6 && (c == 0 || c == 6) ) + || (0 <= c && c <= 6 && (r == 0 || r == 6) ) + || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) { + _modules[row + r][col + c] = true; + } else { + _modules[row + r][col + c] = false; + } + } + } + }; + + var getBestMaskPattern = function() { + + var minLostPoint = 0; + var pattern = 0; + + for (var i = 0; i < 8; i += 1) { + + makeImpl(true, i); + + var lostPoint = QRUtil.getLostPoint(_this); + + if (i == 0 || minLostPoint > lostPoint) { + minLostPoint = lostPoint; + pattern = i; + } + } + + return pattern; + }; + + var setupTimingPattern = function() { + + for (var r = 8; r < _moduleCount - 8; r += 1) { + if (_modules[r][6] != null) { + continue; + } + _modules[r][6] = (r % 2 == 0); + } + + for (var c = 8; c < _moduleCount - 8; c += 1) { + if (_modules[6][c] != null) { + continue; + } + _modules[6][c] = (c % 2 == 0); + } + }; + + var setupPositionAdjustPattern = function() { + + var pos = QRUtil.getPatternPosition(_typeNumber); + + for (var i = 0; i < pos.length; i += 1) { + + for (var j = 0; j < pos.length; j += 1) { + + var row = pos[i]; + var col = pos[j]; + + if (_modules[row][col] != null) { + continue; + } + + for (var r = -2; r <= 2; r += 1) { + + for (var c = -2; c <= 2; c += 1) { + + if (r == -2 || r == 2 || c == -2 || c == 2 + || (r == 0 && c == 0) ) { + _modules[row + r][col + c] = true; + } else { + _modules[row + r][col + c] = false; + } + } + } + } + } + }; + + var setupTypeNumber = function(test) { + + var bits = QRUtil.getBCHTypeNumber(_typeNumber); + + for (var i = 0; i < 18; i += 1) { + var mod = (!test && ( (bits >> i) & 1) == 1); + _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod; + } + + for (var i = 0; i < 18; i += 1) { + var mod = (!test && ( (bits >> i) & 1) == 1); + _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod; + } + }; + + var setupTypeInfo = function(test, maskPattern) { + + var data = (_errorCorrectionLevel << 3) | maskPattern; + var bits = QRUtil.getBCHTypeInfo(data); + + // vertical + for (var i = 0; i < 15; i += 1) { + + var mod = (!test && ( (bits >> i) & 1) == 1); + + if (i < 6) { + _modules[i][8] = mod; + } else if (i < 8) { + _modules[i + 1][8] = mod; + } else { + _modules[_moduleCount - 15 + i][8] = mod; + } + } + + // horizontal + for (var i = 0; i < 15; i += 1) { + + var mod = (!test && ( (bits >> i) & 1) == 1); + + if (i < 8) { + _modules[8][_moduleCount - i - 1] = mod; + } else if (i < 9) { + _modules[8][15 - i - 1 + 1] = mod; + } else { + _modules[8][15 - i - 1] = mod; + } + } + + // fixed module + _modules[_moduleCount - 8][8] = (!test); + }; + + var mapData = function(data, maskPattern) { + + var inc = -1; + var row = _moduleCount - 1; + var bitIndex = 7; + var byteIndex = 0; + var maskFunc = QRUtil.getMaskFunction(maskPattern); + + for (var col = _moduleCount - 1; col > 0; col -= 2) { + + if (col == 6) col -= 1; + + while (true) { + + for (var c = 0; c < 2; c += 1) { + + if (_modules[row][col - c] == null) { + + var dark = false; + + if (byteIndex < data.length) { + dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1); + } + + var mask = maskFunc(row, col - c); + + if (mask) { + dark = !dark; + } + + _modules[row][col - c] = dark; + bitIndex -= 1; + + if (bitIndex == -1) { + byteIndex += 1; + bitIndex = 7; + } + } + } + + row += inc; + + if (row < 0 || _moduleCount <= row) { + row -= inc; + inc = -inc; + break; + } + } + } + }; + + var createBytes = function(buffer, rsBlocks) { + + var offset = 0; + + var maxDcCount = 0; + var maxEcCount = 0; + + var dcdata = new Array(rsBlocks.length); + var ecdata = new Array(rsBlocks.length); + + for (var r = 0; r < rsBlocks.length; r += 1) { + + var dcCount = rsBlocks[r].dataCount; + var ecCount = rsBlocks[r].totalCount - dcCount; + + maxDcCount = Math.max(maxDcCount, dcCount); + maxEcCount = Math.max(maxEcCount, ecCount); + + dcdata[r] = new Array(dcCount); + + for (var i = 0; i < dcdata[r].length; i += 1) { + dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset]; + } + offset += dcCount; + + var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); + var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1); + + var modPoly = rawPoly.mod(rsPoly); + ecdata[r] = new Array(rsPoly.getLength() - 1); + for (var i = 0; i < ecdata[r].length; i += 1) { + var modIndex = i + modPoly.getLength() - ecdata[r].length; + ecdata[r][i] = (modIndex >= 0)? modPoly.getAt(modIndex) : 0; + } + } + + var totalCodeCount = 0; + for (var i = 0; i < rsBlocks.length; i += 1) { + totalCodeCount += rsBlocks[i].totalCount; + } + + var data = new Array(totalCodeCount); + var index = 0; + + for (var i = 0; i < maxDcCount; i += 1) { + for (var r = 0; r < rsBlocks.length; r += 1) { + if (i < dcdata[r].length) { + data[index] = dcdata[r][i]; + index += 1; + } + } + } + + for (var i = 0; i < maxEcCount; i += 1) { + for (var r = 0; r < rsBlocks.length; r += 1) { + if (i < ecdata[r].length) { + data[index] = ecdata[r][i]; + index += 1; + } + } + } + + return data; + }; + + var createData = function(typeNumber, errorCorrectionLevel, dataList) { + + var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectionLevel); + + var buffer = qrBitBuffer(); + + for (var i = 0; i < dataList.length; i += 1) { + var data = dataList[i]; + buffer.put(data.getMode(), 4); + buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) ); + data.write(buffer); + } + + // calc num max data. + var totalDataCount = 0; + for (var i = 0; i < rsBlocks.length; i += 1) { + totalDataCount += rsBlocks[i].dataCount; + } + + if (buffer.getLengthInBits() > totalDataCount * 8) { + throw 'code length overflow. (' + + buffer.getLengthInBits() + + '>' + + totalDataCount * 8 + + ')'; + } + + // end code + if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { + buffer.put(0, 4); + } + + // padding + while (buffer.getLengthInBits() % 8 != 0) { + buffer.putBit(false); + } + + // padding + while (true) { + + if (buffer.getLengthInBits() >= totalDataCount * 8) { + break; + } + buffer.put(PAD0, 8); + + if (buffer.getLengthInBits() >= totalDataCount * 8) { + break; + } + buffer.put(PAD1, 8); + } + + return createBytes(buffer, rsBlocks); + }; + + _this.addData = function(data, mode) { + + mode = mode || 'Byte'; + + var newData = null; + + switch(mode) { + case 'Numeric' : + newData = qrNumber(data); + break; + case 'Alphanumeric' : + newData = qrAlphaNum(data); + break; + case 'Byte' : + newData = qr8BitByte(data); + break; + case 'Kanji' : + newData = qrKanji(data); + break; + default : + throw 'mode:' + mode; + } + + _dataList.push(newData); + _dataCache = null; + }; + + _this.isDark = function(row, col) { + if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) { + throw row + ',' + col; + } + return _modules[row][col]; + }; + + _this.getModuleCount = function() { + return _moduleCount; + }; + + _this.make = function() { + if (_typeNumber < 1) { + var typeNumber = 1; + + for (; typeNumber < 40; typeNumber++) { + var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, _errorCorrectionLevel); + var buffer = qrBitBuffer(); + + for (var i = 0; i < _dataList.length; i++) { + var data = _dataList[i]; + buffer.put(data.getMode(), 4); + buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) ); + data.write(buffer); + } + + var totalDataCount = 0; + for (var i = 0; i < rsBlocks.length; i++) { + totalDataCount += rsBlocks[i].dataCount; + } + + if (buffer.getLengthInBits() <= totalDataCount * 8) { + break; + } + } + + _typeNumber = typeNumber; + } + + makeImpl(false, getBestMaskPattern() ); + }; + + _this.createTableTag = function(cellSize, margin) { + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + var qrHtml = ''; + + qrHtml += ''; + qrHtml += ''; + + for (var r = 0; r < _this.getModuleCount(); r += 1) { + + qrHtml += ''; + + for (var c = 0; c < _this.getModuleCount(); c += 1) { + qrHtml += ''; + } + + qrHtml += ''; + qrHtml += '
'; + } + + qrHtml += '
'; + + return qrHtml; + }; + + _this.createSvgTag = function(cellSize, margin, alt, title) { + + var opts = {}; + if (typeof arguments[0] == 'object') { + // Called by options. + opts = arguments[0]; + // overwrite cellSize and margin. + cellSize = opts.cellSize; + margin = opts.margin; + alt = opts.alt; + title = opts.title; + } + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + // Compose alt property surrogate + alt = (typeof alt === 'string') ? {text: alt} : alt || {}; + alt.text = alt.text || null; + alt.id = (alt.text) ? alt.id || 'qrcode-description' : null; + + // Compose title property surrogate + title = (typeof title === 'string') ? {text: title} : title || {}; + title.text = title.text || null; + title.id = (title.text) ? title.id || 'qrcode-title' : null; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var c, mc, r, mr, qrSvg='', rect; + + rect = 'l' + cellSize + ',0 0,' + cellSize + + ' -' + cellSize + ',0 0,-' + cellSize + 'z '; + + qrSvg += '' + + escapeXml(title.text) + '' : ''; + qrSvg += (alt.text) ? '' + + escapeXml(alt.text) + '' : ''; + qrSvg += ''; + qrSvg += ''; + qrSvg += ''; + + return qrSvg; + }; + + _this.createDataURL = function(cellSize, margin) { + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var min = margin; + var max = size - margin; + + return createDataURL(size, size, function(x, y) { + if (min <= x && x < max && min <= y && y < max) { + var c = Math.floor( (x - min) / cellSize); + var r = Math.floor( (y - min) / cellSize); + return _this.isDark(r, c)? 0 : 1; + } else { + return 1; + } + } ); + }; + + _this.createImgTag = function(cellSize, margin, alt) { + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + + var img = ''; + img += '': escaped += '>'; break; + case '&': escaped += '&'; break; + case '"': escaped += '"'; break; + default : escaped += c; break; + } + } + return escaped; + }; + + var _createHalfASCII = function(margin) { + var cellSize = 1; + margin = (typeof margin == 'undefined')? cellSize * 2 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var min = margin; + var max = size - margin; + + var y, x, r1, r2, p; + + var blocks = { + '██': '█', + '█ ': '▀', + ' █': '▄', + ' ': ' ' + }; + + var blocksLastLineNoMargin = { + '██': '▀', + '█ ': '▀', + ' █': ' ', + ' ': ' ' + }; + + var ascii = ''; + for (y = 0; y < size; y += 2) { + r1 = Math.floor((y - min) / cellSize); + r2 = Math.floor((y + 1 - min) / cellSize); + for (x = 0; x < size; x += 1) { + p = '█'; + + if (min <= x && x < max && min <= y && y < max && _this.isDark(r1, Math.floor((x - min) / cellSize))) { + p = ' '; + } + + if (min <= x && x < max && min <= y+1 && y+1 < max && _this.isDark(r2, Math.floor((x - min) / cellSize))) { + p += ' '; + } + else { + p += '█'; + } + + // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square. + ascii += (margin < 1 && y+1 >= max) ? blocksLastLineNoMargin[p] : blocks[p]; + } + + ascii += '\n'; + } + + if (size % 2 && margin > 0) { + return ascii.substring(0, ascii.length - size - 1) + Array(size+1).join('▀'); + } + + return ascii.substring(0, ascii.length-1); + }; + + _this.createASCII = function(cellSize, margin) { + cellSize = cellSize || 1; + + if (cellSize < 2) { + return _createHalfASCII(margin); + } + + cellSize -= 1; + margin = (typeof margin == 'undefined')? cellSize * 2 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var min = margin; + var max = size - margin; + + var y, x, r, p; + + var white = Array(cellSize+1).join('██'); + var black = Array(cellSize+1).join(' '); + + var ascii = ''; + var line = ''; + for (y = 0; y < size; y += 1) { + r = Math.floor( (y - min) / cellSize); + line = ''; + for (x = 0; x < size; x += 1) { + p = 1; + + if (min <= x && x < max && min <= y && y < max && _this.isDark(r, Math.floor((x - min) / cellSize))) { + p = 0; + } + + // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square. + line += p ? white : black; + } + + for (r = 0; r < cellSize; r += 1) { + ascii += line + '\n'; + } + } + + return ascii.substring(0, ascii.length-1); + }; + + _this.renderTo2dContext = function(context, cellSize) { + cellSize = cellSize || 2; + var length = _this.getModuleCount(); + for (var row = 0; row < length; row++) { + for (var col = 0; col < length; col++) { + context.fillStyle = _this.isDark(row, col) ? 'black' : 'white'; + context.fillRect(row * cellSize, col * cellSize, cellSize, cellSize); + } + } + } + + return _this; + }; + + //--------------------------------------------------------------------- + // qrcode.stringToBytes + //--------------------------------------------------------------------- + + qrcode.stringToBytesFuncs = { + 'default' : function(s) { + var bytes = []; + for (var i = 0; i < s.length; i += 1) { + var c = s.charCodeAt(i); + bytes.push(c & 0xff); + } + return bytes; + } + }; + + qrcode.stringToBytes = qrcode.stringToBytesFuncs['default']; + + //--------------------------------------------------------------------- + // qrcode.createStringToBytes + //--------------------------------------------------------------------- + + /** + * @param unicodeData base64 string of byte array. + * [16bit Unicode],[16bit Bytes], ... + * @param numChars + */ + qrcode.createStringToBytes = function(unicodeData, numChars) { + + // create conversion map. + + var unicodeMap = function() { + + var bin = base64DecodeInputStream(unicodeData); + var read = function() { + var b = bin.read(); + if (b == -1) throw 'eof'; + return b; + }; + + var count = 0; + var unicodeMap = {}; + while (true) { + var b0 = bin.read(); + if (b0 == -1) break; + var b1 = read(); + var b2 = read(); + var b3 = read(); + var k = String.fromCharCode( (b0 << 8) | b1); + var v = (b2 << 8) | b3; + unicodeMap[k] = v; + count += 1; + } + if (count != numChars) { + throw count + ' != ' + numChars; + } + + return unicodeMap; + }(); + + var unknownChar = '?'.charCodeAt(0); + + return function(s) { + var bytes = []; + for (var i = 0; i < s.length; i += 1) { + var c = s.charCodeAt(i); + if (c < 128) { + bytes.push(c); + } else { + var b = unicodeMap[s.charAt(i)]; + if (typeof b == 'number') { + if ( (b & 0xff) == b) { + // 1byte + bytes.push(b); + } else { + // 2bytes + bytes.push(b >>> 8); + bytes.push(b & 0xff); + } + } else { + bytes.push(unknownChar); + } + } + } + return bytes; + }; + }; + + //--------------------------------------------------------------------- + // QRMode + //--------------------------------------------------------------------- + + var QRMode = { + MODE_NUMBER : 1 << 0, + MODE_ALPHA_NUM : 1 << 1, + MODE_8BIT_BYTE : 1 << 2, + MODE_KANJI : 1 << 3 + }; + + //--------------------------------------------------------------------- + // QRErrorCorrectionLevel + //--------------------------------------------------------------------- + + var QRErrorCorrectionLevel = { + L : 1, + M : 0, + Q : 3, + H : 2 + }; + + //--------------------------------------------------------------------- + // QRMaskPattern + //--------------------------------------------------------------------- + + var QRMaskPattern = { + PATTERN000 : 0, + PATTERN001 : 1, + PATTERN010 : 2, + PATTERN011 : 3, + PATTERN100 : 4, + PATTERN101 : 5, + PATTERN110 : 6, + PATTERN111 : 7 + }; + + //--------------------------------------------------------------------- + // QRUtil + //--------------------------------------------------------------------- + + var QRUtil = function() { + + var PATTERN_POSITION_TABLE = [ + [], + [6, 18], + [6, 22], + [6, 26], + [6, 30], + [6, 34], + [6, 22, 38], + [6, 24, 42], + [6, 26, 46], + [6, 28, 50], + [6, 30, 54], + [6, 32, 58], + [6, 34, 62], + [6, 26, 46, 66], + [6, 26, 48, 70], + [6, 26, 50, 74], + [6, 30, 54, 78], + [6, 30, 56, 82], + [6, 30, 58, 86], + [6, 34, 62, 90], + [6, 28, 50, 72, 94], + [6, 26, 50, 74, 98], + [6, 30, 54, 78, 102], + [6, 28, 54, 80, 106], + [6, 32, 58, 84, 110], + [6, 30, 58, 86, 114], + [6, 34, 62, 90, 118], + [6, 26, 50, 74, 98, 122], + [6, 30, 54, 78, 102, 126], + [6, 26, 52, 78, 104, 130], + [6, 30, 56, 82, 108, 134], + [6, 34, 60, 86, 112, 138], + [6, 30, 58, 86, 114, 142], + [6, 34, 62, 90, 118, 146], + [6, 30, 54, 78, 102, 126, 150], + [6, 24, 50, 76, 102, 128, 154], + [6, 28, 54, 80, 106, 132, 158], + [6, 32, 58, 84, 110, 136, 162], + [6, 26, 54, 82, 110, 138, 166], + [6, 30, 58, 86, 114, 142, 170] + ]; + var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0); + var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0); + var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1); + + var _this = {}; + + var getBCHDigit = function(data) { + var digit = 0; + while (data != 0) { + digit += 1; + data >>>= 1; + } + return digit; + }; + + _this.getBCHTypeInfo = function(data) { + var d = data << 10; + while (getBCHDigit(d) - getBCHDigit(G15) >= 0) { + d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) ); + } + return ( (data << 10) | d) ^ G15_MASK; + }; + + _this.getBCHTypeNumber = function(data) { + var d = data << 12; + while (getBCHDigit(d) - getBCHDigit(G18) >= 0) { + d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) ); + } + return (data << 12) | d; + }; + + _this.getPatternPosition = function(typeNumber) { + return PATTERN_POSITION_TABLE[typeNumber - 1]; + }; + + _this.getMaskFunction = function(maskPattern) { + + switch (maskPattern) { + + case QRMaskPattern.PATTERN000 : + return function(i, j) { return (i + j) % 2 == 0; }; + case QRMaskPattern.PATTERN001 : + return function(i, j) { return i % 2 == 0; }; + case QRMaskPattern.PATTERN010 : + return function(i, j) { return j % 3 == 0; }; + case QRMaskPattern.PATTERN011 : + return function(i, j) { return (i + j) % 3 == 0; }; + case QRMaskPattern.PATTERN100 : + return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; }; + case QRMaskPattern.PATTERN101 : + return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; }; + case QRMaskPattern.PATTERN110 : + return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; }; + case QRMaskPattern.PATTERN111 : + return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; }; + + default : + throw 'bad maskPattern:' + maskPattern; + } + }; + + _this.getErrorCorrectPolynomial = function(errorCorrectLength) { + var a = qrPolynomial([1], 0); + for (var i = 0; i < errorCorrectLength; i += 1) { + a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) ); + } + return a; + }; + + _this.getLengthInBits = function(mode, type) { + + if (1 <= type && type < 10) { + + // 1 - 9 + + switch(mode) { + case QRMode.MODE_NUMBER : return 10; + case QRMode.MODE_ALPHA_NUM : return 9; + case QRMode.MODE_8BIT_BYTE : return 8; + case QRMode.MODE_KANJI : return 8; + default : + throw 'mode:' + mode; + } + + } else if (type < 27) { + + // 10 - 26 + + switch(mode) { + case QRMode.MODE_NUMBER : return 12; + case QRMode.MODE_ALPHA_NUM : return 11; + case QRMode.MODE_8BIT_BYTE : return 16; + case QRMode.MODE_KANJI : return 10; + default : + throw 'mode:' + mode; + } + + } else if (type < 41) { + + // 27 - 40 + + switch(mode) { + case QRMode.MODE_NUMBER : return 14; + case QRMode.MODE_ALPHA_NUM : return 13; + case QRMode.MODE_8BIT_BYTE : return 16; + case QRMode.MODE_KANJI : return 12; + default : + throw 'mode:' + mode; + } + + } else { + throw 'type:' + type; + } + }; + + _this.getLostPoint = function(qrcode) { + + var moduleCount = qrcode.getModuleCount(); + + var lostPoint = 0; + + // LEVEL1 + + for (var row = 0; row < moduleCount; row += 1) { + for (var col = 0; col < moduleCount; col += 1) { + + var sameCount = 0; + var dark = qrcode.isDark(row, col); + + for (var r = -1; r <= 1; r += 1) { + + if (row + r < 0 || moduleCount <= row + r) { + continue; + } + + for (var c = -1; c <= 1; c += 1) { + + if (col + c < 0 || moduleCount <= col + c) { + continue; + } + + if (r == 0 && c == 0) { + continue; + } + + if (dark == qrcode.isDark(row + r, col + c) ) { + sameCount += 1; + } + } + } + + if (sameCount > 5) { + lostPoint += (3 + sameCount - 5); + } + } + }; + + // LEVEL2 + + for (var row = 0; row < moduleCount - 1; row += 1) { + for (var col = 0; col < moduleCount - 1; col += 1) { + var count = 0; + if (qrcode.isDark(row, col) ) count += 1; + if (qrcode.isDark(row + 1, col) ) count += 1; + if (qrcode.isDark(row, col + 1) ) count += 1; + if (qrcode.isDark(row + 1, col + 1) ) count += 1; + if (count == 0 || count == 4) { + lostPoint += 3; + } + } + } + + // LEVEL3 + + for (var row = 0; row < moduleCount; row += 1) { + for (var col = 0; col < moduleCount - 6; col += 1) { + if (qrcode.isDark(row, col) + && !qrcode.isDark(row, col + 1) + && qrcode.isDark(row, col + 2) + && qrcode.isDark(row, col + 3) + && qrcode.isDark(row, col + 4) + && !qrcode.isDark(row, col + 5) + && qrcode.isDark(row, col + 6) ) { + lostPoint += 40; + } + } + } + + for (var col = 0; col < moduleCount; col += 1) { + for (var row = 0; row < moduleCount - 6; row += 1) { + if (qrcode.isDark(row, col) + && !qrcode.isDark(row + 1, col) + && qrcode.isDark(row + 2, col) + && qrcode.isDark(row + 3, col) + && qrcode.isDark(row + 4, col) + && !qrcode.isDark(row + 5, col) + && qrcode.isDark(row + 6, col) ) { + lostPoint += 40; + } + } + } + + // LEVEL4 + + var darkCount = 0; + + for (var col = 0; col < moduleCount; col += 1) { + for (var row = 0; row < moduleCount; row += 1) { + if (qrcode.isDark(row, col) ) { + darkCount += 1; + } + } + } + + var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; + lostPoint += ratio * 10; + + return lostPoint; + }; + + return _this; + }(); + + //--------------------------------------------------------------------- + // QRMath + //--------------------------------------------------------------------- + + var QRMath = function() { + + var EXP_TABLE = new Array(256); + var LOG_TABLE = new Array(256); + + // initialize tables + for (var i = 0; i < 8; i += 1) { + EXP_TABLE[i] = 1 << i; + } + for (var i = 8; i < 256; i += 1) { + EXP_TABLE[i] = EXP_TABLE[i - 4] + ^ EXP_TABLE[i - 5] + ^ EXP_TABLE[i - 6] + ^ EXP_TABLE[i - 8]; + } + for (var i = 0; i < 255; i += 1) { + LOG_TABLE[EXP_TABLE[i] ] = i; + } + + var _this = {}; + + _this.glog = function(n) { + + if (n < 1) { + throw 'glog(' + n + ')'; + } + + return LOG_TABLE[n]; + }; + + _this.gexp = function(n) { + + while (n < 0) { + n += 255; + } + + while (n >= 256) { + n -= 255; + } + + return EXP_TABLE[n]; + }; + + return _this; + }(); + + //--------------------------------------------------------------------- + // qrPolynomial + //--------------------------------------------------------------------- + + function qrPolynomial(num, shift) { + + if (typeof num.length == 'undefined') { + throw num.length + '/' + shift; + } + + var _num = function() { + var offset = 0; + while (offset < num.length && num[offset] == 0) { + offset += 1; + } + var _num = new Array(num.length - offset + shift); + for (var i = 0; i < num.length - offset; i += 1) { + _num[i] = num[i + offset]; + } + return _num; + }(); + + var _this = {}; + + _this.getAt = function(index) { + return _num[index]; + }; + + _this.getLength = function() { + return _num.length; + }; + + _this.multiply = function(e) { + + var num = new Array(_this.getLength() + e.getLength() - 1); + + for (var i = 0; i < _this.getLength(); i += 1) { + for (var j = 0; j < e.getLength(); j += 1) { + num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i) ) + QRMath.glog(e.getAt(j) ) ); + } + } + + return qrPolynomial(num, 0); + }; + + _this.mod = function(e) { + + if (_this.getLength() - e.getLength() < 0) { + return _this; + } + + var ratio = QRMath.glog(_this.getAt(0) ) - QRMath.glog(e.getAt(0) ); + + var num = new Array(_this.getLength() ); + for (var i = 0; i < _this.getLength(); i += 1) { + num[i] = _this.getAt(i); + } + + for (var i = 0; i < e.getLength(); i += 1) { + num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i) ) + ratio); + } + + // recursive call + return qrPolynomial(num, 0).mod(e); + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // QRRSBlock + //--------------------------------------------------------------------- + + var QRRSBlock = function() { + + var RS_BLOCK_TABLE = [ + + // L + // M + // Q + // H + + // 1 + [1, 26, 19], + [1, 26, 16], + [1, 26, 13], + [1, 26, 9], + + // 2 + [1, 44, 34], + [1, 44, 28], + [1, 44, 22], + [1, 44, 16], + + // 3 + [1, 70, 55], + [1, 70, 44], + [2, 35, 17], + [2, 35, 13], + + // 4 + [1, 100, 80], + [2, 50, 32], + [2, 50, 24], + [4, 25, 9], + + // 5 + [1, 134, 108], + [2, 67, 43], + [2, 33, 15, 2, 34, 16], + [2, 33, 11, 2, 34, 12], + + // 6 + [2, 86, 68], + [4, 43, 27], + [4, 43, 19], + [4, 43, 15], + + // 7 + [2, 98, 78], + [4, 49, 31], + [2, 32, 14, 4, 33, 15], + [4, 39, 13, 1, 40, 14], + + // 8 + [2, 121, 97], + [2, 60, 38, 2, 61, 39], + [4, 40, 18, 2, 41, 19], + [4, 40, 14, 2, 41, 15], + + // 9 + [2, 146, 116], + [3, 58, 36, 2, 59, 37], + [4, 36, 16, 4, 37, 17], + [4, 36, 12, 4, 37, 13], + + // 10 + [2, 86, 68, 2, 87, 69], + [4, 69, 43, 1, 70, 44], + [6, 43, 19, 2, 44, 20], + [6, 43, 15, 2, 44, 16], + + // 11 + [4, 101, 81], + [1, 80, 50, 4, 81, 51], + [4, 50, 22, 4, 51, 23], + [3, 36, 12, 8, 37, 13], + + // 12 + [2, 116, 92, 2, 117, 93], + [6, 58, 36, 2, 59, 37], + [4, 46, 20, 6, 47, 21], + [7, 42, 14, 4, 43, 15], + + // 13 + [4, 133, 107], + [8, 59, 37, 1, 60, 38], + [8, 44, 20, 4, 45, 21], + [12, 33, 11, 4, 34, 12], + + // 14 + [3, 145, 115, 1, 146, 116], + [4, 64, 40, 5, 65, 41], + [11, 36, 16, 5, 37, 17], + [11, 36, 12, 5, 37, 13], + + // 15 + [5, 109, 87, 1, 110, 88], + [5, 65, 41, 5, 66, 42], + [5, 54, 24, 7, 55, 25], + [11, 36, 12, 7, 37, 13], + + // 16 + [5, 122, 98, 1, 123, 99], + [7, 73, 45, 3, 74, 46], + [15, 43, 19, 2, 44, 20], + [3, 45, 15, 13, 46, 16], + + // 17 + [1, 135, 107, 5, 136, 108], + [10, 74, 46, 1, 75, 47], + [1, 50, 22, 15, 51, 23], + [2, 42, 14, 17, 43, 15], + + // 18 + [5, 150, 120, 1, 151, 121], + [9, 69, 43, 4, 70, 44], + [17, 50, 22, 1, 51, 23], + [2, 42, 14, 19, 43, 15], + + // 19 + [3, 141, 113, 4, 142, 114], + [3, 70, 44, 11, 71, 45], + [17, 47, 21, 4, 48, 22], + [9, 39, 13, 16, 40, 14], + + // 20 + [3, 135, 107, 5, 136, 108], + [3, 67, 41, 13, 68, 42], + [15, 54, 24, 5, 55, 25], + [15, 43, 15, 10, 44, 16], + + // 21 + [4, 144, 116, 4, 145, 117], + [17, 68, 42], + [17, 50, 22, 6, 51, 23], + [19, 46, 16, 6, 47, 17], + + // 22 + [2, 139, 111, 7, 140, 112], + [17, 74, 46], + [7, 54, 24, 16, 55, 25], + [34, 37, 13], + + // 23 + [4, 151, 121, 5, 152, 122], + [4, 75, 47, 14, 76, 48], + [11, 54, 24, 14, 55, 25], + [16, 45, 15, 14, 46, 16], + + // 24 + [6, 147, 117, 4, 148, 118], + [6, 73, 45, 14, 74, 46], + [11, 54, 24, 16, 55, 25], + [30, 46, 16, 2, 47, 17], + + // 25 + [8, 132, 106, 4, 133, 107], + [8, 75, 47, 13, 76, 48], + [7, 54, 24, 22, 55, 25], + [22, 45, 15, 13, 46, 16], + + // 26 + [10, 142, 114, 2, 143, 115], + [19, 74, 46, 4, 75, 47], + [28, 50, 22, 6, 51, 23], + [33, 46, 16, 4, 47, 17], + + // 27 + [8, 152, 122, 4, 153, 123], + [22, 73, 45, 3, 74, 46], + [8, 53, 23, 26, 54, 24], + [12, 45, 15, 28, 46, 16], + + // 28 + [3, 147, 117, 10, 148, 118], + [3, 73, 45, 23, 74, 46], + [4, 54, 24, 31, 55, 25], + [11, 45, 15, 31, 46, 16], + + // 29 + [7, 146, 116, 7, 147, 117], + [21, 73, 45, 7, 74, 46], + [1, 53, 23, 37, 54, 24], + [19, 45, 15, 26, 46, 16], + + // 30 + [5, 145, 115, 10, 146, 116], + [19, 75, 47, 10, 76, 48], + [15, 54, 24, 25, 55, 25], + [23, 45, 15, 25, 46, 16], + + // 31 + [13, 145, 115, 3, 146, 116], + [2, 74, 46, 29, 75, 47], + [42, 54, 24, 1, 55, 25], + [23, 45, 15, 28, 46, 16], + + // 32 + [17, 145, 115], + [10, 74, 46, 23, 75, 47], + [10, 54, 24, 35, 55, 25], + [19, 45, 15, 35, 46, 16], + + // 33 + [17, 145, 115, 1, 146, 116], + [14, 74, 46, 21, 75, 47], + [29, 54, 24, 19, 55, 25], + [11, 45, 15, 46, 46, 16], + + // 34 + [13, 145, 115, 6, 146, 116], + [14, 74, 46, 23, 75, 47], + [44, 54, 24, 7, 55, 25], + [59, 46, 16, 1, 47, 17], + + // 35 + [12, 151, 121, 7, 152, 122], + [12, 75, 47, 26, 76, 48], + [39, 54, 24, 14, 55, 25], + [22, 45, 15, 41, 46, 16], + + // 36 + [6, 151, 121, 14, 152, 122], + [6, 75, 47, 34, 76, 48], + [46, 54, 24, 10, 55, 25], + [2, 45, 15, 64, 46, 16], + + // 37 + [17, 152, 122, 4, 153, 123], + [29, 74, 46, 14, 75, 47], + [49, 54, 24, 10, 55, 25], + [24, 45, 15, 46, 46, 16], + + // 38 + [4, 152, 122, 18, 153, 123], + [13, 74, 46, 32, 75, 47], + [48, 54, 24, 14, 55, 25], + [42, 45, 15, 32, 46, 16], + + // 39 + [20, 147, 117, 4, 148, 118], + [40, 75, 47, 7, 76, 48], + [43, 54, 24, 22, 55, 25], + [10, 45, 15, 67, 46, 16], + + // 40 + [19, 148, 118, 6, 149, 119], + [18, 75, 47, 31, 76, 48], + [34, 54, 24, 34, 55, 25], + [20, 45, 15, 61, 46, 16] + ]; + + var qrRSBlock = function(totalCount, dataCount) { + var _this = {}; + _this.totalCount = totalCount; + _this.dataCount = dataCount; + return _this; + }; + + var _this = {}; + + var getRsBlockTable = function(typeNumber, errorCorrectionLevel) { + + switch(errorCorrectionLevel) { + case QRErrorCorrectionLevel.L : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; + case QRErrorCorrectionLevel.M : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; + case QRErrorCorrectionLevel.Q : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; + case QRErrorCorrectionLevel.H : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; + default : + return undefined; + } + }; + + _this.getRSBlocks = function(typeNumber, errorCorrectionLevel) { + + var rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel); + + if (typeof rsBlock == 'undefined') { + throw 'bad rs block @ typeNumber:' + typeNumber + + '/errorCorrectionLevel:' + errorCorrectionLevel; + } + + var length = rsBlock.length / 3; + + var list = []; + + for (var i = 0; i < length; i += 1) { + + var count = rsBlock[i * 3 + 0]; + var totalCount = rsBlock[i * 3 + 1]; + var dataCount = rsBlock[i * 3 + 2]; + + for (var j = 0; j < count; j += 1) { + list.push(qrRSBlock(totalCount, dataCount) ); + } + } + + return list; + }; + + return _this; + }(); + + //--------------------------------------------------------------------- + // qrBitBuffer + //--------------------------------------------------------------------- + + var qrBitBuffer = function() { + + var _buffer = []; + var _length = 0; + + var _this = {}; + + _this.getBuffer = function() { + return _buffer; + }; + + _this.getAt = function(index) { + var bufIndex = Math.floor(index / 8); + return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1; + }; + + _this.put = function(num, length) { + for (var i = 0; i < length; i += 1) { + _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1); + } + }; + + _this.getLengthInBits = function() { + return _length; + }; + + _this.putBit = function(bit) { + + var bufIndex = Math.floor(_length / 8); + if (_buffer.length <= bufIndex) { + _buffer.push(0); + } + + if (bit) { + _buffer[bufIndex] |= (0x80 >>> (_length % 8) ); + } + + _length += 1; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qrNumber + //--------------------------------------------------------------------- + + var qrNumber = function(data) { + + var _mode = QRMode.MODE_NUMBER; + var _data = data; + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return _data.length; + }; + + _this.write = function(buffer) { + + var data = _data; + + var i = 0; + + while (i + 2 < data.length) { + buffer.put(strToNum(data.substring(i, i + 3) ), 10); + i += 3; + } + + if (i < data.length) { + if (data.length - i == 1) { + buffer.put(strToNum(data.substring(i, i + 1) ), 4); + } else if (data.length - i == 2) { + buffer.put(strToNum(data.substring(i, i + 2) ), 7); + } + } + }; + + var strToNum = function(s) { + var num = 0; + for (var i = 0; i < s.length; i += 1) { + num = num * 10 + chatToNum(s.charAt(i) ); + } + return num; + }; + + var chatToNum = function(c) { + if ('0' <= c && c <= '9') { + return c.charCodeAt(0) - '0'.charCodeAt(0); + } + throw 'illegal char :' + c; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qrAlphaNum + //--------------------------------------------------------------------- + + var qrAlphaNum = function(data) { + + var _mode = QRMode.MODE_ALPHA_NUM; + var _data = data; + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return _data.length; + }; + + _this.write = function(buffer) { + + var s = _data; + + var i = 0; + + while (i + 1 < s.length) { + buffer.put( + getCode(s.charAt(i) ) * 45 + + getCode(s.charAt(i + 1) ), 11); + i += 2; + } + + if (i < s.length) { + buffer.put(getCode(s.charAt(i) ), 6); + } + }; + + var getCode = function(c) { + + if ('0' <= c && c <= '9') { + return c.charCodeAt(0) - '0'.charCodeAt(0); + } else if ('A' <= c && c <= 'Z') { + return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10; + } else { + switch (c) { + case ' ' : return 36; + case '$' : return 37; + case '%' : return 38; + case '*' : return 39; + case '+' : return 40; + case '-' : return 41; + case '.' : return 42; + case '/' : return 43; + case ':' : return 44; + default : + throw 'illegal char :' + c; + } + } + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qr8BitByte + //--------------------------------------------------------------------- + + var qr8BitByte = function(data) { + + var _mode = QRMode.MODE_8BIT_BYTE; + var _data = data; + var _bytes = qrcode.stringToBytes(data); + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return _bytes.length; + }; + + _this.write = function(buffer) { + for (var i = 0; i < _bytes.length; i += 1) { + buffer.put(_bytes[i], 8); + } + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qrKanji + //--------------------------------------------------------------------- + + var qrKanji = function(data) { + + var _mode = QRMode.MODE_KANJI; + var _data = data; + + var stringToBytes = qrcode.stringToBytesFuncs['SJIS']; + if (!stringToBytes) { + throw 'sjis not supported.'; + } + !function(c, code) { + // self test for sjis support. + var test = stringToBytes(c); + if (test.length != 2 || ( (test[0] << 8) | test[1]) != code) { + throw 'sjis not supported.'; + } + }('\u53cb', 0x9746); + + var _bytes = stringToBytes(data); + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return ~~(_bytes.length / 2); + }; + + _this.write = function(buffer) { + + var data = _bytes; + + var i = 0; + + while (i + 1 < data.length) { + + var c = ( (0xff & data[i]) << 8) | (0xff & data[i + 1]); + + if (0x8140 <= c && c <= 0x9FFC) { + c -= 0x8140; + } else if (0xE040 <= c && c <= 0xEBBF) { + c -= 0xC140; + } else { + throw 'illegal char at ' + (i + 1) + '/' + c; + } + + c = ( (c >>> 8) & 0xff) * 0xC0 + (c & 0xff); + + buffer.put(c, 13); + + i += 2; + } + + if (i < data.length) { + throw 'illegal char at ' + (i + 1); + } + }; + + return _this; + }; + + //===================================================================== + // GIF Support etc. + // + + //--------------------------------------------------------------------- + // byteArrayOutputStream + //--------------------------------------------------------------------- + + var byteArrayOutputStream = function() { + + var _bytes = []; + + var _this = {}; + + _this.writeByte = function(b) { + _bytes.push(b & 0xff); + }; + + _this.writeShort = function(i) { + _this.writeByte(i); + _this.writeByte(i >>> 8); + }; + + _this.writeBytes = function(b, off, len) { + off = off || 0; + len = len || b.length; + for (var i = 0; i < len; i += 1) { + _this.writeByte(b[i + off]); + } + }; + + _this.writeString = function(s) { + for (var i = 0; i < s.length; i += 1) { + _this.writeByte(s.charCodeAt(i) ); + } + }; + + _this.toByteArray = function() { + return _bytes; + }; + + _this.toString = function() { + var s = ''; + s += '['; + for (var i = 0; i < _bytes.length; i += 1) { + if (i > 0) { + s += ','; + } + s += _bytes[i]; + } + s += ']'; + return s; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // base64EncodeOutputStream + //--------------------------------------------------------------------- + + var base64EncodeOutputStream = function() { + + var _buffer = 0; + var _buflen = 0; + var _length = 0; + var _base64 = ''; + + var _this = {}; + + var writeEncoded = function(b) { + _base64 += String.fromCharCode(encode(b & 0x3f) ); + }; + + var encode = function(n) { + if (n < 0) { + // error. + } else if (n < 26) { + return 0x41 + n; + } else if (n < 52) { + return 0x61 + (n - 26); + } else if (n < 62) { + return 0x30 + (n - 52); + } else if (n == 62) { + return 0x2b; + } else if (n == 63) { + return 0x2f; + } + throw 'n:' + n; + }; + + _this.writeByte = function(n) { + + _buffer = (_buffer << 8) | (n & 0xff); + _buflen += 8; + _length += 1; + + while (_buflen >= 6) { + writeEncoded(_buffer >>> (_buflen - 6) ); + _buflen -= 6; + } + }; + + _this.flush = function() { + + if (_buflen > 0) { + writeEncoded(_buffer << (6 - _buflen) ); + _buffer = 0; + _buflen = 0; + } + + if (_length % 3 != 0) { + // padding + var padlen = 3 - _length % 3; + for (var i = 0; i < padlen; i += 1) { + _base64 += '='; + } + } + }; + + _this.toString = function() { + return _base64; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // base64DecodeInputStream + //--------------------------------------------------------------------- + + var base64DecodeInputStream = function(str) { + + var _str = str; + var _pos = 0; + var _buffer = 0; + var _buflen = 0; + + var _this = {}; + + _this.read = function() { + + while (_buflen < 8) { + + if (_pos >= _str.length) { + if (_buflen == 0) { + return -1; + } + throw 'unexpected end of file./' + _buflen; + } + + var c = _str.charAt(_pos); + _pos += 1; + + if (c == '=') { + _buflen = 0; + return -1; + } else if (c.match(/^\s$/) ) { + // ignore if whitespace. + continue; + } + + _buffer = (_buffer << 6) | decode(c.charCodeAt(0) ); + _buflen += 6; + } + + var n = (_buffer >>> (_buflen - 8) ) & 0xff; + _buflen -= 8; + return n; + }; + + var decode = function(c) { + if (0x41 <= c && c <= 0x5a) { + return c - 0x41; + } else if (0x61 <= c && c <= 0x7a) { + return c - 0x61 + 26; + } else if (0x30 <= c && c <= 0x39) { + return c - 0x30 + 52; + } else if (c == 0x2b) { + return 62; + } else if (c == 0x2f) { + return 63; + } else { + throw 'c:' + c; + } + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // gifImage (B/W) + //--------------------------------------------------------------------- + + var gifImage = function(width, height) { + + var _width = width; + var _height = height; + var _data = new Array(width * height); + + var _this = {}; + + _this.setPixel = function(x, y, pixel) { + _data[y * _width + x] = pixel; + }; + + _this.write = function(out) { + + //--------------------------------- + // GIF Signature + + out.writeString('GIF87a'); + + //--------------------------------- + // Screen Descriptor + + out.writeShort(_width); + out.writeShort(_height); + + out.writeByte(0x80); // 2bit + out.writeByte(0); + out.writeByte(0); + + //--------------------------------- + // Global Color Map + + // black + out.writeByte(0x00); + out.writeByte(0x00); + out.writeByte(0x00); + + // white + out.writeByte(0xff); + out.writeByte(0xff); + out.writeByte(0xff); + + //--------------------------------- + // Image Descriptor + + out.writeString(','); + out.writeShort(0); + out.writeShort(0); + out.writeShort(_width); + out.writeShort(_height); + out.writeByte(0); + + //--------------------------------- + // Local Color Map + + //--------------------------------- + // Raster Data + + var lzwMinCodeSize = 2; + var raster = getLZWRaster(lzwMinCodeSize); + + out.writeByte(lzwMinCodeSize); + + var offset = 0; + + while (raster.length - offset > 255) { + out.writeByte(255); + out.writeBytes(raster, offset, 255); + offset += 255; + } + + out.writeByte(raster.length - offset); + out.writeBytes(raster, offset, raster.length - offset); + out.writeByte(0x00); + + //--------------------------------- + // GIF Terminator + out.writeString(';'); + }; + + var bitOutputStream = function(out) { + + var _out = out; + var _bitLength = 0; + var _bitBuffer = 0; + + var _this = {}; + + _this.write = function(data, length) { + + if ( (data >>> length) != 0) { + throw 'length over'; + } + + while (_bitLength + length >= 8) { + _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) ); + length -= (8 - _bitLength); + data >>>= (8 - _bitLength); + _bitBuffer = 0; + _bitLength = 0; + } + + _bitBuffer = (data << _bitLength) | _bitBuffer; + _bitLength = _bitLength + length; + }; + + _this.flush = function() { + if (_bitLength > 0) { + _out.writeByte(_bitBuffer); + } + }; + + return _this; + }; + + var getLZWRaster = function(lzwMinCodeSize) { + + var clearCode = 1 << lzwMinCodeSize; + var endCode = (1 << lzwMinCodeSize) + 1; + var bitLength = lzwMinCodeSize + 1; + + // Setup LZWTable + var table = lzwTable(); + + for (var i = 0; i < clearCode; i += 1) { + table.add(String.fromCharCode(i) ); + } + table.add(String.fromCharCode(clearCode) ); + table.add(String.fromCharCode(endCode) ); + + var byteOut = byteArrayOutputStream(); + var bitOut = bitOutputStream(byteOut); + + // clear code + bitOut.write(clearCode, bitLength); + + var dataIndex = 0; + + var s = String.fromCharCode(_data[dataIndex]); + dataIndex += 1; + + while (dataIndex < _data.length) { + + var c = String.fromCharCode(_data[dataIndex]); + dataIndex += 1; + + if (table.contains(s + c) ) { + + s = s + c; + + } else { + + bitOut.write(table.indexOf(s), bitLength); + + if (table.size() < 0xfff) { + + if (table.size() == (1 << bitLength) ) { + bitLength += 1; + } + + table.add(s + c); + } + + s = c; + } + } + + bitOut.write(table.indexOf(s), bitLength); + + // end code + bitOut.write(endCode, bitLength); + + bitOut.flush(); + + return byteOut.toByteArray(); + }; + + var lzwTable = function() { + + var _map = {}; + var _size = 0; + + var _this = {}; + + _this.add = function(key) { + if (_this.contains(key) ) { + throw 'dup key:' + key; + } + _map[key] = _size; + _size += 1; + }; + + _this.size = function() { + return _size; + }; + + _this.indexOf = function(key) { + return _map[key]; + }; + + _this.contains = function(key) { + return typeof _map[key] != 'undefined'; + }; + + return _this; + }; + + return _this; + }; + + var createDataURL = function(width, height, getPixel) { + var gif = gifImage(width, height); + for (var y = 0; y < height; y += 1) { + for (var x = 0; x < width; x += 1) { + gif.setPixel(x, y, getPixel(x, y) ); + } + } + + var b = byteArrayOutputStream(); + gif.write(b); + + var base64 = base64EncodeOutputStream(); + var bytes = b.toByteArray(); + for (var i = 0; i < bytes.length; i += 1) { + base64.writeByte(bytes[i]); + } + base64.flush(); + + return 'data:image/gif;base64,' + base64; + }; + + //--------------------------------------------------------------------- + // returns qrcode function. + + return qrcode; +}(); + +// multibyte support +!function() { + + qrcode.stringToBytesFuncs['UTF-8'] = function(s) { + // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array + function toUTF8Array(str) { + var utf8 = []; + for (var i=0; i < str.length; i++) { + var charcode = str.charCodeAt(i); + if (charcode < 0x80) utf8.push(charcode); + else if (charcode < 0x800) { + utf8.push(0xc0 | (charcode >> 6), + 0x80 | (charcode & 0x3f)); + } + else if (charcode < 0xd800 || charcode >= 0xe000) { + utf8.push(0xe0 | (charcode >> 12), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + // surrogate pair + else { + i++; + // UTF-16 encodes 0x10000-0x10FFFF by + // subtracting 0x10000 and splitting the + // 20 bits of 0x0-0xFFFFF into two halves + charcode = 0x10000 + (((charcode & 0x3ff)<<10) + | (str.charCodeAt(i) & 0x3ff)); + utf8.push(0xf0 | (charcode >>18), + 0x80 | ((charcode>>12) & 0x3f), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + } + return utf8; + } + return toUTF8Array(s); + }; + +}(); + +(function (factory) { + if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } +}(function () { + return qrcode; +})); diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-backup-codes.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-backup-codes.php new file mode 100644 index 00000000..c53a8448 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-backup-codes.php @@ -0,0 +1,402 @@ + WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'rest_generate_codes' ), + 'permission_callback' => function( $request ) { + return Two_Factor_Core::rest_api_can_edit_user_and_update_two_factor_options( $request['user_id'] ); + }, + 'args' => array( + 'user_id' => array( + 'required' => true, + 'type' => 'integer', + ), + 'enable_provider' => array( + 'required' => false, + 'type' => 'boolean', + 'default' => false, + ), + ), + ) + ); + } + + /** + * Displays an admin notice when backup codes have run out. + * + * @since 0.1-dev + * + * @codeCoverageIgnore + */ + public function admin_notices() { + $user = wp_get_current_user(); + + // Return if the provider is not enabled. + if ( ! in_array( __CLASS__, Two_Factor_Core::get_enabled_providers_for_user( $user->ID ), true ) ) { + return; + } + + // Return if we are not out of codes. + if ( $this->is_available_for_user( $user ) ) { + return; + } + ?> +
+

+ + regenerate!', 'two-factor' ), + esc_url( get_edit_user_link( $user->ID ) . '#two-factor-backup-codes' ) + ), + array( 'a' => array( 'href' => true ) ) + ); + ?> + +

+
+ +

+

+ +

+

+ +

+

+ + + ID, self::BACKUP_CODES_META_KEY, true ); + } + + for ( $i = 0; $i < $num_codes; $i++ ) { + $code = $this->get_code(); + $codes_hashed[] = wp_hash_password( $code ); + $codes[] = $code; + unset( $code ); + } + + update_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, $codes_hashed ); + + // Unhashed. + return $codes; + } + + /** + * Generates Backup Codes for returning through the WordPress Rest API. + * + * @since 0.8.0 + */ + public function rest_generate_codes( $request ) { + $user_id = $request['user_id']; + $user = get_user_by( 'id', $user_id ); + + // Hardcode these, the user shouldn't be able to choose them. + $args = array( + 'number' => self::NUMBER_OF_CODES, + 'method' => 'replace', + ); + + // Setup the return data. + $codes = $this->generate_codes( $user, $args ); + $count = self::codes_remaining_for_user( $user ); + $title = sprintf( + /* translators: %s: the site's domain */ + __( 'Two-Factor Recovery Codes for %s', 'two-factor' ), + home_url( '/' ) + ); + + // Generate download content. + $download_link = 'data:application/text;charset=utf-8,'; + $download_link .= rawurlencode( "{$title}\r\n\r\n" ); + + $i = 1; + foreach ( $codes as $code ) { + $download_link .= rawurlencode( "{$i}. {$code}\r\n" ); + $i++; + } + + $i18n = array( + /* translators: %s: count */ + 'count' => esc_html( sprintf( _n( '%s unused code remaining, each recovery code can only be used once.', '%s unused codes remaining, each recovery code can only be used once.', $count, 'two-factor' ), $count ) ), + ); + + if ( $request->get_param( 'enable_provider' ) && ! Two_Factor_Core::enable_provider_for_user( $user_id, 'Two_Factor_Backup_Codes' ) ) { + return new WP_Error( 'db_error', __( 'Unable to enable recovery codes for this user.', 'two-factor' ), array( 'status' => 500 ) ); + } + + return array( + 'codes' => $codes, + 'download_link' => $download_link, + 'remaining' => $count, + 'i18n' => $i18n, + ); + } + + /** + * Returns the number of unused codes for the specified user + * + * @param WP_User $user WP_User object of the logged-in user. + * @return int $int The number of unused codes remaining + */ + public static function codes_remaining_for_user( $user ) { + $backup_codes = get_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, true ); + if ( is_array( $backup_codes ) && ! empty( $backup_codes ) ) { + return count( $backup_codes ); + } + return 0; + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function authentication_page( $user ) { + require_once ABSPATH . '/wp-admin/includes/template.php'; + ?> +


+

+ + +

+ sanitize_code_from_request( 'two-factor-backup-code' ); + if ( ! $backup_code ) { + return false; + } + + return $this->validate_code( $user, $backup_code ); + } + + /** + * Validates a backup code. + * + * Backup Codes are single use and are deleted upon a successful validation. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @param int $code The backup code. + * @return boolean + */ + public function validate_code( $user, $code ) { + $backup_codes = get_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, true ); + + if ( is_array( $backup_codes ) && ! empty( $backup_codes ) ) { + foreach ( $backup_codes as $code_index => $code_hashed ) { + if ( wp_check_password( $code, $code_hashed, $user->ID ) ) { + $this->delete_code( $user, $code_hashed ); + return true; + } + } + } + return false; + } + + /** + * Deletes a backup code. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @param string $code_hashed The hashed the backup code. + */ + public function delete_code( $user, $code_hashed ) { + $backup_codes = get_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, true ); + + // Delete the current code from the list since it's been used. + $backup_codes = array_flip( $backup_codes ); + unset( $backup_codes[ $code_hashed ] ); + $backup_codes = array_values( array_flip( $backup_codes ) ); + + // Update the backup code master list. + update_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, $backup_codes ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-dummy.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-dummy.php new file mode 100644 index 00000000..34c6b57d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-dummy.php @@ -0,0 +1,85 @@ + +

+ get_code(); + + update_user_meta( $user_id, self::TOKEN_META_KEY_TIMESTAMP, time() ); + update_user_meta( $user_id, self::TOKEN_META_KEY, wp_hash( $token ) ); + + return $token; + } + + /** + * Check if user has a valid token already. + * + * @param int $user_id User ID. + * @return boolean If user has a valid email token. + */ + public function user_has_token( $user_id ) { + $hashed_token = $this->get_user_token( $user_id ); + + if ( ! empty( $hashed_token ) ) { + return true; + } + + return false; + } + + /** + * Has the user token validity timestamp expired. + * + * @param integer $user_id User ID. + * + * @return boolean + */ + public function user_token_has_expired( $user_id ) { + $token_lifetime = $this->user_token_lifetime( $user_id ); + $token_ttl = $this->user_token_ttl( $user_id ); + + // Invalid token lifetime is considered an expired token. + if ( is_int( $token_lifetime ) && $token_lifetime <= $token_ttl ) { + return false; + } + + return true; + } + + /** + * Get the lifetime of a user token in seconds. + * + * @param integer $user_id User ID. + * + * @return integer|null Return `null` if the lifetime can't be measured. + */ + public function user_token_lifetime( $user_id ) { + $timestamp = intval( get_user_meta( $user_id, self::TOKEN_META_KEY_TIMESTAMP, true ) ); + + if ( ! empty( $timestamp ) ) { + return time() - $timestamp; + } + + return null; + } + + /** + * Return the token time-to-live for a user. + * + * @param integer $user_id User ID. + * + * @return integer + */ + public function user_token_ttl( $user_id ) { + $token_ttl = 15 * MINUTE_IN_SECONDS; + + /** + * Number of seconds the token is considered valid + * after the generation. + * + * @param integer $token_ttl Token time-to-live in seconds. + * @param integer $user_id User ID. + */ + return (int) apply_filters( 'two_factor_token_ttl', $token_ttl, $user_id ); + } + + /** + * Get the authentication token for the user. + * + * @param int $user_id User ID. + * + * @return string|boolean User token or `false` if no token found. + */ + public function get_user_token( $user_id ) { + $hashed_token = get_user_meta( $user_id, self::TOKEN_META_KEY, true ); + + if ( ! empty( $hashed_token ) && is_string( $hashed_token ) ) { + return $hashed_token; + } + + return false; + } + + /** + * Validate the user token. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @param string $token User token. + * @return boolean + */ + public function validate_token( $user_id, $token ) { + $hashed_token = $this->get_user_token( $user_id ); + + // Bail if token is empty or it doesn't match. + if ( empty( $hashed_token ) || ! hash_equals( wp_hash( $token ), $hashed_token ) ) { + return false; + } + + if ( $this->user_token_has_expired( $user_id ) ) { + return false; + } + + // Ensure the token can be used only once. + $this->delete_token( $user_id ); + + return true; + } + + /** + * Delete the user token. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + */ + public function delete_token( $user_id ) { + delete_user_meta( $user_id, self::TOKEN_META_KEY ); + } + + /** + * Generate and email the user token. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return bool Whether the email contents were sent successfully. + */ + public function generate_and_email_token( $user ) { + $token = $this->generate_token( $user->ID ); + + /* translators: %s: site name */ + $subject = wp_strip_all_tags( sprintf( __( 'Your login confirmation code for %s', 'two-factor' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); + /* translators: %s: token */ + $message = wp_strip_all_tags( sprintf( __( 'Enter %s to log in.', 'two-factor' ), $token ) ); + + /** + * Filter the token email subject. + * + * @param string $subject The email subject line. + * @param int $user_id The ID of the user. + */ + $subject = apply_filters( 'two_factor_token_email_subject', $subject, $user->ID ); + + /** + * Filter the token email message. + * + * @param string $message The email message. + * @param string $token The token. + * @param int $user_id The ID of the user. + */ + $message = apply_filters( 'two_factor_token_email_message', $message, $token, $user->ID ); + + return wp_mail( $user->user_email, $subject, $message ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function authentication_page( $user ) { + if ( ! $user ) { + return; + } + + if ( ! $this->user_has_token( $user->ID ) || $this->user_token_has_expired( $user->ID ) ) { + $this->generate_and_email_token( $user ); + } + + require_once ABSPATH . '/wp-admin/includes/template.php'; + ?> +

+

+ + + +

+

+ +

+ + ID ) && isset( $_REQUEST[ self::INPUT_NAME_RESEND_CODE ] ) ) { + $this->generate_and_email_token( $user ); + return true; + } + + return false; + } + + /** + * Validates the users input token. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function validate_authentication( $user ) { + $code = $this->sanitize_code_from_request( 'two-factor-email-code' ); + if ( ! isset( $user->ID ) || ! $code ) { + return false; + } + + return $this->validate_token( $user->ID, $code ); + } + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function is_available_for_user( $user ) { + return true; + } + + /** + * Inserts markup at the end of the user profile field for this provider. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function user_options( $user ) { + $email = $user->user_email; + ?> +
+ +
+ wp_strip_all_tags( __( 'Name', 'two-factor' ) ), + 'added' => wp_strip_all_tags( __( 'Added', 'two-factor' ) ), + 'last_used' => wp_strip_all_tags( __( 'Last Used', 'two-factor' ) ), + ); + } + + /** + * Prepares the list of items for displaying. + * + * @since 0.1-dev + */ + public function prepare_items() { + $columns = $this->get_columns(); + $hidden = array(); + $sortable = array(); + $primary = 'name'; + $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); + } + + /** + * Generates content for a single row of the table + * + * @since 0.1-dev + * @access protected + * + * @param object $item The current item. + * @param string $column_name The current column name. + * @return string + */ + protected function column_default( $item, $column_name ) { + switch ( $column_name ) { + case 'name': + $out = ''; + + $actions = array( + 'rename hide-if-no-js' => Two_Factor_FIDO_U2F_Admin::rename_link( $item ), + 'delete' => Two_Factor_FIDO_U2F_Admin::delete_link( $item ), + ); + + return esc_html( $item->name ) . $out . self::row_actions( $actions ); + case 'added': + return gmdate( get_option( 'date_format', 'r' ), $item->added ); + case 'last_used': + return gmdate( get_option( 'date_format', 'r' ), $item->last_used ); + default: + return 'WTF^^?'; + } + } + + /** + * Generates custom table navigation to prevent conflicting nonces. + * + * @since 0.1-dev + * @access protected + * + * @param string $which The location of the bulk actions: 'top' or 'bottom'. + */ + protected function display_tablenav( $which ) { + // Not used for the Security key list. + } + + /** + * Generates content for a single row of the table + * + * @since 0.1-dev + * @access public + * + * @param object $item The current item. + */ + public function single_row( $item ) { + ?> + + single_row_columns( $item ); ?> + + + + + + + + +
+ getRegisterData( $security_keys ); + list( $req,$sigs ) = $data; + + update_user_meta( $user_id, self::REGISTER_DATA_USER_META_KEY, $req ); + } catch ( Exception $e ) { + return false; + } + + wp_enqueue_style( + 'fido-u2f-admin', + plugins_url( 'css/fido-u2f-admin.css', __FILE__ ), + null, + self::asset_version() + ); + + wp_enqueue_script( + 'fido-u2f-admin', + plugins_url( 'js/fido-u2f-admin.js', __FILE__ ), + array( 'jquery', 'fido-u2f-api' ), + self::asset_version(), + true + ); + + /** + * Pass a U2F challenge and user data to our scripts + */ + + $translation_array = array( + 'user_id' => $user_id, + 'register' => array( + 'request' => $req, + 'sigs' => $sigs, + ), + 'text' => array( + 'insert' => esc_html__( 'Now insert (and tap) your Security Key.', 'two-factor' ), + 'error' => esc_html__( 'U2F request failed.', 'two-factor' ), + 'error_codes' => array( + // Map u2f.ErrorCodes to error messages. + 0 => esc_html__( 'Request OK.', 'two-factor' ), + 1 => esc_html__( 'Other U2F error.', 'two-factor' ), + 2 => esc_html__( 'Bad U2F request.', 'two-factor' ), + 3 => esc_html__( 'Unsupported U2F configuration.', 'two-factor' ), + 4 => esc_html__( 'U2F device ineligible.', 'two-factor' ), + 5 => esc_html__( 'U2F request timeout reached.', 'two-factor' ), + ), + 'u2f_not_supported' => esc_html__( 'FIDO U2F appears to be not supported by your web browser. Try using Google Chrome or Firefox.', 'two-factor' ), + ), + ); + + wp_localize_script( + 'fido-u2f-admin', + 'u2fL10n', + $translation_array + ); + + /** + * Script for admin UI + */ + + wp_enqueue_script( + 'inline-edit-key', + plugins_url( 'js/fido-u2f-admin-inline-edit.js', __FILE__ ), + array( 'jquery' ), + self::asset_version(), + true + ); + + wp_localize_script( + 'inline-edit-key', + 'inlineEditL10n', + array( + 'error' => esc_html__( 'Error while saving the changes.', 'two-factor' ), + ) + ); + } + + /** + * Return the current asset version number. + * + * Added as own helper to allow swapping the implementation once we inject + * it as a dependency. + * + * @return string + */ + protected static function asset_version() { + return Two_Factor_FIDO_U2F::asset_version(); + } + + /** + * Display the security key section in a users profile. + * + * This executes during the `show_user_security_settings` action. + * + * @since 0.1-dev + * + * @access public + * @static + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public static function show_user_profile( $user ) { + wp_nonce_field( "user_security_keys-{$user->ID}", '_nonce_user_security_keys' ); + $new_key = false; + + $security_keys = Two_Factor_FIDO_U2F::get_security_keys( $user->ID ); + if ( $security_keys ) { + foreach ( $security_keys as &$security_key ) { + if ( property_exists( $security_key, 'new' ) ) { + $new_key = true; + unset( $security_key->new ); + + // If we've got a new one, update the db record to not save it there any longer. + Two_Factor_FIDO_U2F::update_security_key( $user->ID, $security_key ); + } + } + unset( $security_key ); + } + + ?> +
+

+ + +

+ +

+ + +
+ + + + + +
+ + +
+

+
+ + +

+ + items = $security_keys; + $u2f_list_table->prepare_items(); + $u2f_list_table->display(); + $u2f_list_table->inline_edit(); + ?> +
+ doRegister( get_user_meta( $user_id, self::REGISTER_DATA_USER_META_KEY, true ), $response ); + $reg->new = true; + + Two_Factor_FIDO_U2F::add_security_key( $user_id, $reg ); + } catch ( Exception $e ) { + return false; + } + + delete_user_meta( $user_id, self::REGISTER_DATA_USER_META_KEY ); + + wp_safe_redirect( + add_query_arg( + array( + 'new_app_pass' => 1, + ), + wp_get_referer() + ) . '#security-keys-section' + ); + exit; + } + } + + /** + * Catch the delete security key request. + * + * This executes during the `load-profile.php` & `load-user-edit.php` actions. + * + * @since 0.1-dev + * + * @access public + * @static + */ + public static function catch_delete_security_key() { + $user_id = Two_Factor_Core::current_user_being_edited(); + + if ( ! empty( $user_id ) && ! empty( $_REQUEST['delete_security_key'] ) ) { + $slug = $_REQUEST['delete_security_key']; + + check_admin_referer( "delete_security_key-{$slug}", '_nonce_delete_security_key' ); + + Two_Factor_FIDO_U2F::delete_security_key( $user_id, $slug ); + + wp_safe_redirect( remove_query_arg( 'new_app_pass', wp_get_referer() ) . '#security-keys-section' ); + exit; + } + } + + /** + * Generate a link to rename a specified security key. + * + * @since 0.1-dev + * + * @access public + * @static + * + * @param array $item The current item. + * @return string + */ + public static function rename_link( $item ) { + return sprintf( '%s', esc_html__( 'Rename', 'two-factor' ) ); + } + + /** + * Generate a link to delete a specified security key. + * + * @since 0.1-dev + * + * @access public + * @static + * + * @param array $item The current item. + * @return string + */ + public static function delete_link( $item ) { + $delete_link = add_query_arg( 'delete_security_key', $item->keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + $delete_link = wp_nonce_url( $delete_link, "delete_security_key-{$item->keyHandle}", '_nonce_delete_security_key' ); + return sprintf( '%2$s', esc_url( $delete_link ), esc_html__( 'Delete', 'two-factor' ) ); + } + + /** + * Ajax handler for quick edit saving for a security key. + * + * @since 0.1-dev + * + * @access public + * @static + */ + public static function wp_ajax_inline_save() { + check_ajax_referer( 'keyinlineeditnonce', '_inline_edit' ); + + require_once TWO_FACTOR_DIR . 'providers/class-two-factor-fido-u2f-admin-list-table.php'; + $wp_list_table = new Two_Factor_FIDO_U2F_Admin_List_Table(); + + if ( ! isset( $_POST['keyHandle'] ) ) { + wp_die(); + } + + $user_id = Two_Factor_Core::current_user_being_edited(); + $security_keys = Two_Factor_FIDO_U2F::get_security_keys( $user_id ); + if ( ! $security_keys ) { + wp_die(); + } + + foreach ( $security_keys as &$key ) { + if ( $key->keyHandle === $_POST['keyHandle'] ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + break; + } + } + + $key->name = $_POST['name']; + + $updated = Two_Factor_FIDO_U2F::update_security_key( $user_id, $key ); + if ( ! $updated ) { + wp_die( esc_html__( 'Item not updated.', 'two-factor' ) ); + } + $wp_list_table->single_row( $key ); + wp_die(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-fido-u2f.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-fido-u2f.php new file mode 100644 index 00000000..52d28f57 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-fido-u2f.php @@ -0,0 +1,391 @@ + +

+ ID ); + $data = self::$u2f->getAuthenticateData( $keys ); + update_user_meta( $user->ID, self::AUTH_DATA_USER_META_KEY, $data ); + } catch ( Exception $e ) { + ?> +

+ $data, + ) + ); + + wp_enqueue_script( 'fido-u2f-login' ); + + ?> +

+ + ID, self::AUTH_DATA_USER_META_KEY, true ); + + $response = json_decode( stripslashes( $_REQUEST['u2f_response'] ) ); + + $keys = self::get_security_keys( $user->ID ); + + try { + $reg = self::$u2f->doAuthenticate( $requests, $keys, $response ); + + $reg->last_used = time(); + + self::update_security_key( $user->ID, $reg ); + + return true; + } catch ( Exception $e ) { + return false; + } + } + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function is_available_for_user( $user ) { + return (bool) self::get_security_keys( $user->ID ); + } + + /** + * Inserts markup at the end of the user profile field for this provider. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function user_options( $user ) { + ?> +

+ +

+ keyHandle ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $register, 'publicKey' ) || empty( $register->publicKey ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $register, 'certificate' ) || empty( $register->certificate ) + || ! property_exists( $register, 'counter' ) || ( -1 > $register->counter ) + ) { + return false; + } + + $register = array( + 'keyHandle' => $register->keyHandle, // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + 'publicKey' => $register->publicKey, // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + 'certificate' => $register->certificate, + 'counter' => $register->counter, + ); + + $register['name'] = __( 'New Security Key', 'two-factor' ); + $register['added'] = time(); + $register['last_used'] = $register['added']; + + return add_user_meta( $user_id, self::REGISTERED_KEY_USER_META_KEY, $register ); + } + + /** + * Retrieve registered security keys for a user. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @return array|bool Array of keys on success, false on failure. + */ + public static function get_security_keys( $user_id ) { + if ( ! is_numeric( $user_id ) ) { + return false; + } + + $keys = get_user_meta( $user_id, self::REGISTERED_KEY_USER_META_KEY ); + if ( $keys ) { + foreach ( $keys as &$key ) { + $key = (object) $key; + } + unset( $key ); + } + + return $keys; + } + + /** + * Update registered security key. + * + * Use the $prev_value parameter to differentiate between meta fields with the + * same key and user ID. + * + * If the meta field for the user does not exist, it will be added. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @param object $data The data of registered security key. + * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure. + */ + public static function update_security_key( $user_id, $data ) { + if ( ! is_numeric( $user_id ) ) { + return false; + } + + if ( + ! is_object( $data ) + || ! property_exists( $data, 'keyHandle' ) || empty( $data->keyHandle ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $data, 'publicKey' ) || empty( $data->publicKey ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $data, 'certificate' ) || empty( $data->certificate ) + || ! property_exists( $data, 'counter' ) || ( -1 > $data->counter ) + ) { + return false; + } + + $keys = self::get_security_keys( $user_id ); + if ( $keys ) { + foreach ( $keys as $key ) { + if ( $key->keyHandle === $data->keyHandle ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + return update_user_meta( $user_id, self::REGISTERED_KEY_USER_META_KEY, (array) $data, (array) $key ); + } + } + } + + return self::add_security_key( $user_id, $data ); + } + + /** + * Remove registered security key matching criteria from a user. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @param string $keyHandle Optional. Key handle. + * @return bool True on success, false on failure. + */ + public static function delete_security_key( $user_id, $keyHandle = null ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + global $wpdb; + + if ( ! is_numeric( $user_id ) ) { + return false; + } + + $user_id = absint( $user_id ); + if ( ! $user_id ) { + return false; + } + + $keyHandle = wp_unslash( $keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + $keyHandle = maybe_serialize( $keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + + $query = $wpdb->prepare( "SELECT umeta_id FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id = %d", self::REGISTERED_KEY_USER_META_KEY, $user_id ); + + if ( $keyHandle ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + $key_handle_lookup = sprintf( ':"%s";s:', $keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + + $query .= $wpdb->prepare( + ' AND meta_value LIKE %s', + '%' . $wpdb->esc_like( $key_handle_lookup ) . '%' + ); + } + + $meta_ids = $wpdb->get_col( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + if ( ! count( $meta_ids ) ) { + return false; + } + + foreach ( $meta_ids as $meta_id ) { + delete_metadata_by_mid( 'user', $meta_id ); + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-provider.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-provider.php new file mode 100644 index 00000000..2e9f2a8f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-provider.php @@ -0,0 +1,168 @@ +get_label() + ); + } + + /** + * Prints the name of the provider. + * + * @since 0.1-dev + */ + public function print_label() { + echo esc_html( $this->get_label() ); + } + + /** + * Retrieves the provider key / slug. + * + * @since 0.9.0 + * + * @return string + */ + public function get_key() { + return get_class( $this ); + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + abstract public function authentication_page( $user ); + + /** + * Allow providers to do extra processing before the authentication. + * Return `true` to prevent the authentication and render the + * authentication page. + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function pre_process_authentication( $user ) { + return false; + } + + /** + * Validates the users input token. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + abstract public function validate_authentication( $user ); + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + abstract public function is_available_for_user( $user ); + + /** + * Generate a random eight-digit string to send out as an auth code. + * + * @since 0.1-dev + * + * @param int $length The code length. + * @param string|array $chars Valid auth code characters. + * @return string + */ + public static function get_code( $length = 8, $chars = '1234567890' ) { + $code = ''; + if ( is_array( $chars ) ) { + $chars = implode( '', $chars ); + } + for ( $i = 0; $i < $length; $i++ ) { + $code .= substr( $chars, wp_rand( 0, strlen( $chars ) - 1 ), 1 ); + } + return $code; + } + + /** + * Sanitizes a numeric code to be used as an auth code. + * + * @param string $field The _REQUEST field to check for the code. + * @param int $length The valid expected length of the field. + * @return false|string Auth code on success, false if the field is not set or not expected length. + */ + public static function sanitize_code_from_request( $field, $length = 0 ) { + if ( empty( $_REQUEST[ $field ] ) ) { + return false; + } + + $code = wp_unslash( $_REQUEST[ $field ] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, handled by the core method already. + $code = preg_replace( '/\s+/', '', $code ); + + // Maybe validate the length. + if ( $length && strlen( $code ) !== $length ) { + return false; + } + + return (string) $code; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-totp.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-totp.php new file mode 100644 index 00000000..4b075495 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-totp.php @@ -0,0 +1,765 @@ + WP_REST_Server::DELETABLE, + 'callback' => array( $this, 'rest_delete_totp' ), + 'permission_callback' => function( $request ) { + return Two_Factor_Core::rest_api_can_edit_user_and_update_two_factor_options( $request['user_id'] ); + }, + 'args' => array( + 'user_id' => array( + 'required' => true, + 'type' => 'integer', + ), + ), + ), + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'rest_setup_totp' ), + 'permission_callback' => function( $request ) { + return Two_Factor_Core::rest_api_can_edit_user_and_update_two_factor_options( $request['user_id'] ); + }, + 'args' => array( + 'user_id' => array( + 'required' => true, + 'type' => 'integer', + ), + 'key' => array( + 'type' => 'string', + 'default' => '', + 'validate_callback' => null, // Note: validation handled in ::rest_setup_totp(). + ), + 'code' => array( + 'type' => 'string', + 'default' => '', + 'validate_callback' => null, // Note: validation handled in ::rest_setup_totp(). + ), + 'enable_provider' => array( + 'required' => false, + 'type' => 'boolean', + 'default' => false, + ), + ), + ), + ) + ); + } + + /** + * Returns the name of the provider. + */ + public function get_label() { + return _x( 'Authenticator app', 'Provider Label', 'two-factor' ); + } + + /** + * Returns the "continue with" text provider for the login screen. + * + * @since 0.9.0 + */ + public function get_alternative_provider_label() { + return __( 'Use your authenticator app', 'two-factor' ); + } + + /** + * Enqueue scripts + * + * @codeCoverageIgnore + */ + public function enqueue_assets( $hook_suffix ) { + $environment_prefix = file_exists( TWO_FACTOR_DIR . '/dist' ) ? '/dist' : ''; + + wp_register_script( + 'two-factor-qr-code-generator', + plugins_url( $environment_prefix . '/includes/qrcode-generator/qrcode.js', __DIR__ ), + array(), + TWO_FACTOR_VERSION, + true + ); + } + + /** + * Rest API endpoint for handling deactivation of TOTP. + * + * @param WP_Rest_Request $request The Rest Request object. + * @return array Success array. + */ + public function rest_delete_totp( $request ) { + $user_id = $request['user_id']; + $user = get_user_by( 'id', $user_id ); + + $this->delete_user_totp_key( $user_id ); + + ob_start(); + $this->user_two_factor_options( $user ); + $html = ob_get_clean(); + + return [ + 'success' => true, + 'html' => $html, + ]; + } + + /** + * REST API endpoint for setting up TOTP. + * + * @param WP_Rest_Request $request The Rest Request object. + * @return WP_Error|array Array of data on success, WP_Error on error. + */ + public function rest_setup_totp( $request ) { + $user_id = $request['user_id']; + $user = get_user_by( 'id', $user_id ); + + $key = $request['key']; + $code = preg_replace( '/\s+/', '', $request['code'] ); + + if ( ! $this->is_valid_key( $key ) ) { + return new WP_Error( 'invalid_key', __( 'Invalid Two Factor Authentication secret key.', 'two-factor' ), array( 'status' => 400 ) ); + } + + if ( ! $this->is_valid_authcode( $key, $code ) ) { + return new WP_Error( 'invalid_key_code', __( 'Invalid Two Factor Authentication code.', 'two-factor' ), array( 'status' => 400 ) ); + } + + if ( ! $this->set_user_totp_key( $user_id, $key ) ) { + return new WP_Error( 'db_error', __( 'Unable to save Two Factor Authentication code. Please re-scan the QR code and enter the code provided by your application.', 'two-factor' ), array( 'status' => 500 ) ); + } + + if ( $request->get_param( 'enable_provider' ) && ! Two_Factor_Core::enable_provider_for_user( $user_id, 'Two_Factor_Totp' ) ) { + return new WP_Error( 'db_error', __( 'Unable to enable TOTP provider for this user.', 'two-factor' ), array( 'status' => 500 ) ); + } + + ob_start(); + $this->user_two_factor_options( $user ); + $html = ob_get_clean(); + + return [ + 'success' => true, + 'html' => $html, + ]; + } + + /** + * Generates a URL that can be used to create a QR code. + * + * @param WP_User $user The user to generate a URL for. + * @param string $key The secret key. + * + * @return string + */ + public static function generate_qr_code_url( $user, $secret_key ) { + $issuer = get_bloginfo( 'name', 'display' ); + + /** + * Filter the Issuer for the TOTP. + * + * Must follow the TOTP format for a "issuer". Do not URL Encode. + * + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format#issuer + * @param string $issuer The issuer for TOTP. + */ + $issuer = apply_filters( 'two_factor_totp_issuer', $issuer ); + + /** + * Filter the Label for the TOTP. + * + * Must follow the TOTP format for a "label". Do not URL Encode. + * + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format#label + * @param string $totp_title The label for the TOTP. + * @param WP_User $user The User object. + * @param string $issuer The issuer of the TOTP. This should be the prefix of the result. + */ + $totp_title = apply_filters( 'two_factor_totp_title', $issuer . ':' . $user->user_login, $user, $issuer ); + + $totp_url = add_query_arg( + array( + 'secret' => rawurlencode( $secret_key ), + 'issuer' => rawurlencode( $issuer ), + ), + 'otpauth://totp/' . rawurlencode( $totp_title ) + ); + + /** + * Filter the TOTP generated URL. + * + * Must follow the TOTP format. Do not URL Encode. + * + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format + * @param string $totp_url The TOTP URL. + * @param WP_User $user The user object. + */ + $totp_url = apply_filters( 'two_factor_totp_url', $totp_url, $user ); + $totp_url = esc_url( $totp_url, array( 'otpauth' ) ); + + return $totp_url; + } + + /** + * Display TOTP options on the user settings page. + * + * @param WP_User $user The current user being edited. + * @return false + * + * @codeCoverageIgnore + */ + public function user_two_factor_options( $user ) { + if ( ! isset( $user->ID ) ) { + return false; + } + + $key = $this->get_user_totp_key( $user->ID ); + + wp_enqueue_script( 'two-factor-qr-code-generator' ); + wp_enqueue_script( 'wp-api-request' ); + wp_enqueue_script( 'jquery' ); + + ?> +
+ generate_key(); + $totp_url = $this->generate_qr_code_url( $user, $key ); + + ?> + +

+ +

+

+ + Loading... + + +

+ + + + + +

+ +

+

+ + + +

+ + + + +

+ +

+

+ + +

+ +
+ sanitize_code_from_request( 'authcode', self::DEFAULT_DIGIT_COUNT ); + if ( ! $code ) { + return false; + } + + return $this->validate_code_for_user( $user, $code ); + } + + /** + * Validates an authentication code for a given user, preventing re-use and older TOTP keys. + * + * @param WP_User $user WP_User object of the logged-in user. + * @param int $code The TOTP token to validate. + * + * @return bool Whether the code is valid for the user and a newer code has not been used. + */ + public function validate_code_for_user( $user, $code ) { + $valid_timestamp = $this->get_authcode_valid_ticktime( + $this->get_user_totp_key( $user->ID ), + $code + ); + + if ( ! $valid_timestamp ) { + return false; + } + + $last_totp_login = (int) get_user_meta( $user->ID, self::LAST_SUCCESSFUL_LOGIN_META_KEY, true ); + + // The TOTP authentication is not valid, if we've seen the same or newer code. + if ( $last_totp_login && $last_totp_login >= $valid_timestamp ) { + return false; + } + + update_user_meta( $user->ID, self::LAST_SUCCESSFUL_LOGIN_META_KEY, $valid_timestamp ); + + return true; + } + + + /** + * Checks if a given code is valid for a given key, allowing for a certain amount of time drift. + * + * @param string $key The share secret key to use. + * @param string $authcode The code to test. + * + * @return bool Whether the code is valid within the time frame. + */ + public static function is_valid_authcode( $key, $authcode ) { + return (bool) self::get_authcode_valid_ticktime( $key, $authcode ); + } + + /** + * Checks if a given code is valid for a given key, allowing for a certain amount of time drift. + * + * @param string $key The share secret key to use. + * @param string $authcode The code to test. + * + * @return false|int Returns the timestamp of the authcode on success, False otherwise. + */ + public static function get_authcode_valid_ticktime( $key, $authcode ) { + /** + * Filter the maximum ticks to allow when checking valid codes. + * + * Ticks are the allowed offset from the correct time in 30 second increments, + * so the default of 4 allows codes that are two minutes to either side of server time + * + * @deprecated 0.7.0 Use {@see 'two_factor_totp_time_step_allowance'} instead. + * @param int $max_ticks Max ticks of time correction to allow. Default 4. + */ + $max_ticks = apply_filters_deprecated( 'two-factor-totp-time-step-allowance', array( self::DEFAULT_TIME_STEP_ALLOWANCE ), '0.7.0', 'two_factor_totp_time_step_allowance' ); + + $max_ticks = apply_filters( 'two_factor_totp_time_step_allowance', self::DEFAULT_TIME_STEP_ALLOWANCE ); + + // Array of all ticks to allow, sorted using absolute value to test closest match first. + $ticks = range( - $max_ticks, $max_ticks ); + usort( $ticks, array( __CLASS__, 'abssort' ) ); + + $time = floor( time() / self::DEFAULT_TIME_STEP_SEC ); + + foreach ( $ticks as $offset ) { + $log_time = $time + $offset; + if ( hash_equals( self::calc_totp( $key, $log_time ), $authcode ) ) { + // Return the tick timestamp. + return $log_time * self::DEFAULT_TIME_STEP_SEC; + } + } + + return false; + } + + /** + * Generates key + * + * @param int $bitsize Nume of bits to use for key. + * + * @return string $bitsize long string composed of available base32 chars. + */ + public static function generate_key( $bitsize = self::DEFAULT_KEY_BIT_SIZE ) { + $bytes = ceil( $bitsize / 8 ); + $secret = wp_generate_password( $bytes, true, true ); + + return self::base32_encode( $secret ); + } + + /** + * Pack stuff + * + * @param string $value The value to be packed. + * + * @return string Binary packed string. + */ + public static function pack64( $value ) { + // 64bit mode (PHP_INT_SIZE == 8). + if ( PHP_INT_SIZE >= 8 ) { + // If we're on PHP 5.6.3+ we can use the new 64bit pack functionality. + if ( version_compare( PHP_VERSION, '5.6.3', '>=' ) && PHP_INT_SIZE >= 8 ) { + return pack( 'J', $value ); // phpcs:ignore PHPCompatibility.ParameterValues.NewPackFormat.NewFormatFound + } + $highmap = 0xffffffff << 32; + $higher = ( $value & $highmap ) >> 32; + } else { + /* + * 32bit PHP can't shift 32 bits like that, so we have to assume 0 for the higher + * and not pack anything beyond it's limits. + */ + $higher = 0; + } + + $lowmap = 0xffffffff; + $lower = $value & $lowmap; + + return pack( 'NN', $higher, $lower ); + } + + /** + * Calculate a valid code given the shared secret key + * + * @param string $key The shared secret key to use for calculating code. + * @param mixed $step_count The time step used to calculate the code, which is the floor of time() divided by step size. + * @param int $digits The number of digits in the returned code. + * @param string $hash The hash used to calculate the code. + * @param int $time_step The size of the time step. + * + * @return string The totp code + */ + public static function calc_totp( $key, $step_count = false, $digits = self::DEFAULT_DIGIT_COUNT, $hash = self::DEFAULT_CRYPTO, $time_step = self::DEFAULT_TIME_STEP_SEC ) { + $secret = self::base32_decode( $key ); + + if ( false === $step_count ) { + $step_count = floor( time() / $time_step ); + } + + $timestamp = self::pack64( $step_count ); + + $hash = hash_hmac( $hash, $timestamp, $secret, true ); + + $offset = ord( $hash[19] ) & 0xf; + + $code = ( + ( ( ord( $hash[ $offset + 0 ] ) & 0x7f ) << 24 ) | + ( ( ord( $hash[ $offset + 1 ] ) & 0xff ) << 16 ) | + ( ( ord( $hash[ $offset + 2 ] ) & 0xff ) << 8 ) | + ( ord( $hash[ $offset + 3 ] ) & 0xff ) + ) % pow( 10, $digits ); + + return str_pad( $code, $digits, '0', STR_PAD_LEFT ); + } + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @param WP_User $user WP_User object of the logged-in user. + * + * @return boolean + */ + public function is_available_for_user( $user ) { + // Only available if the secret key has been saved for the user. + $key = $this->get_user_totp_key( $user->ID ); + + return ! empty( $key ); + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @param WP_User $user WP_User object of the logged-in user. + * + * @codeCoverageIgnore + */ + public function authentication_page( $user ) { + require_once ABSPATH . '/wp-admin/includes/template.php'; + ?> +

+ +

+

+ + +

+ + = 8 ) { + $j -= 8; + $binary .= chr( ( $n & ( 0xFF << $j ) ) >> $j ); + } + } + + return $binary; + } + + /** + * Used with usort to sort an array by distance from 0 + * + * @param int $a First array element. + * @param int $b Second array element. + * + * @return int -1, 0, or 1 as needed by usort + */ + private static function abssort( $a, $b ) { + $a = abs( $a ); + $b = abs( $b ); + if ( $a === $b ) { + return 0; + } + return ( $a < $b ) ? -1 : 1; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/css/fido-u2f-admin.css b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/css/fido-u2f-admin.css new file mode 100644 index 00000000..96ca78aa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/css/fido-u2f-admin.css @@ -0,0 +1,12 @@ +#security-keys-section .wp-list-table { + margin-bottom: 2em; +} + +#security-keys-section .register-security-key .spinner { + float: none; +} + +#security-keys-section .security-key-status { + vertical-align: middle; + font-style: italic; +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-admin-inline-edit.js b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-admin-inline-edit.js new file mode 100644 index 00000000..b7b0123e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-admin-inline-edit.js @@ -0,0 +1,150 @@ +/* global window, document, jQuery, inlineEditL10n, ajaxurl */ +var inlineEditKey; + +( function( $ ) { + inlineEditKey = { + + init: function() { + var t = this, + row = $( '#security-keys-section #inline-edit' ); + + t.what = '#key-'; + + $( '#security-keys-section #the-list' ).on( 'click', 'a.editinline', function() { + inlineEditKey.edit( this ); + return false; + } ); + + // Prepare the edit row. + row.keyup( function( event ) { + if ( 27 === event.which ) { + return inlineEditKey.revert(); + } + } ); + + $( 'a.cancel', row ).click( function() { + return inlineEditKey.revert(); + } ); + + $( 'a.save', row ).click( function() { + return inlineEditKey.save( this ); + } ); + + $( 'input, select', row ).keydown( function( event ) { + if ( 13 === event.which ) { + return inlineEditKey.save( this ); + } + } ); + }, + + toggle: function( el ) { + var t = this; + + if ( 'none' === $( t.what + t.getId( el ) ).css( 'display' ) ) { + t.revert(); + } else { + t.edit( el ); + } + }, + + edit: function( id ) { + var editRow, rowData, val, + t = this; + t.revert(); + + if ( 'object' === typeof id ) { + id = t.getId( id ); + } + + editRow = $( '#inline-edit' ).clone( true ); + rowData = $( '#inline_' + id ); + + $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '#security-keys-section .widefat thead' ).length ); + + $( t.what + id ).hide().after( editRow ).after( '' ); + + val = $( '.name', rowData ); + val.find( 'img' ).replaceWith( function() { + return this.alt; + } ); + val = val.text(); + $( ':input[name="name"]', editRow ).val( val ); + + $( editRow ).attr( 'id', 'edit-' + id ).addClass( 'inline-editor' ).show(); + $( '.ptitle', editRow ).eq( 0 ).focus(); + + return false; + }, + + save: function( id ) { + var params, fields; + + if ( 'object' === typeof id ) { + id = this.getId( id ); + } + + $( '#security-keys-section table.widefat .spinner' ).addClass( 'is-active' ); + + params = { + action: 'inline-save-key', + keyHandle: id, + user_id: window.u2fL10n.user_id + }; + + fields = $( '#edit-' + id ).find( ':input' ).serialize(); + params = fields + '&' + $.param( params ); + + // Make ajax request. + $.post( ajaxurl, params, + function( r ) { + var row, newID; + $( '#security-keys-section table.widefat .spinner' ).removeClass( 'is-active' ); + + if ( r ) { + if ( -1 !== r.indexOf( '' )[0].submit.call( $( '#your-profile' )[0] ); + } ); + } ); +}( jQuery ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-login.js b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-login.js new file mode 100644 index 00000000..28295307 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-login.js @@ -0,0 +1,16 @@ +/* global window, u2f, u2fL10n, jQuery */ +( function( $ ) { + if ( ! window.u2fL10n ) { + window.console.error( 'u2fL10n is not defined' ); + return; + } + + u2f.sign( u2fL10n.request[0].appId, u2fL10n.request[0].challenge, u2fL10n.request, function( data ) { + if ( data.errorCode ) { + window.console.error( 'Registration Failed', data.errorCode ); + } else { + $( '#u2f_response' ).val( JSON.stringify( data ) ); + $( '#loginform' ).submit(); + } + } ); +}( jQuery ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/readme.txt b/wp-content/upgrade-temp-backup/plugins/two-factor/readme.txt new file mode 100644 index 00000000..5540ef68 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/readme.txt @@ -0,0 +1,52 @@ +=== Two-Factor === +Contributors: georgestephanis, valendesigns, stevenkword, extendwings, sgrant, aaroncampbell, johnbillion, stevegrunwell, netweb, kasparsd, alihusnainarshad, passoniate +Tags: two factor, two step, authentication, login, totp, fido u2f, u2f, email, backup codes, 2fa, yubikey +Requires at least: 4.3 +Tested up to: 6.5 +Requires PHP: 5.6 +Stable tag: 0.9.1 + +Enable Two-Factor Authentication using time-based one-time passwords (OTP, Google Authenticator), Universal 2nd Factor (FIDO U2F, YubiKey), email and backup verification codes. + +== Description == + +Use the "Two-Factor Options" section under "Users" → "Your Profile" to enable and configure one or multiple two-factor authentication providers for your account: + +- Email codes +- Time Based One-Time Passwords (TOTP) +- FIDO Universal 2nd Factor (U2F) +- Backup Codes +- Dummy Method (only for testing purposes) + +For more history, see [this post](https://georgestephanis.wordpress.com/2013/08/14/two-cents-on-two-factor/). + += Actions & Filters = + +Here is a list of action and filter hooks provided by the plugin: + +- `two_factor_providers` filter overrides the available two-factor providers such as email and time-based one-time passwords. Array values are PHP classnames of the two-factor providers. +- `two_factor_enabled_providers_for_user` filter overrides the list of two-factor providers enabled for a user. First argument is an array of enabled provider classnames as values, the second argument is the user ID. +- `two_factor_user_authenticated` action which receives the logged in `WP_User` object as the first argument for determining the logged in user right after the authentication workflow. +- `two_factor_token_ttl` filter overrides the time interval in seconds that an email token is considered after generation. Accepts the time in seconds as the first argument and the ID of the `WP_User` object being authenticated. + +== Frequently Asked Questions == + += How can I send feedback or get help with a bug? = + +The best place to report bugs, feature suggestions, or any other (non-security) feedback is at the Two Factor GitHub issues page. Before submitting a new issue, please search the existing issues to check if someone else has reported the same feedback. + += Where can I report security bugs? = + +The plugin contributors and WordPress community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. + +To report a security issue, please visit the [WordPress HackerOne](https://hackerone.com/wordpress) program. + +== Screenshots == + +1. Two-factor options under User Profile. +2. U2F Security Keys section under User Profile. +3. Email Code Authentication during WordPress Login. + +== Changelog == + +See the [release history](https://github.com/wordpress/two-factor/releases). diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/two-factor.php b/wp-content/upgrade-temp-backup/plugins/two-factor/two-factor.php new file mode 100644 index 00000000..feab321a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/two-factor.php @@ -0,0 +1,48 @@ +