diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/LICENSE b/wp-content/upgrade-temp-backup/plugins/activitypub/LICENSE deleted file mode 100644 index 644800f2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2019 Matthias Pfefferle -Copyright (c) 2023 Automattic - -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/activitypub/activitypub.php b/wp-content/upgrade-temp-backup/plugins/activitypub/activitypub.php deleted file mode 100644 index 478486ef..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/activitypub.php +++ /dev/null @@ -1,239 +0,0 @@ -)|(?<=
)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))' ); -\defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9\._-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' ); -\defined( 'ACTIVITYPUB_CUSTOM_POST_CONTENT' ) || \define( 'ACTIVITYPUB_CUSTOM_POST_CONTENT', "

[ap_title]

\n\n[ap_content]\n\n[ap_hashtags]\n\n[ap_shortlink]" ); -\defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) || \define( 'ACTIVITYPUB_AUTHORIZED_FETCH', false ); -\defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || \define( 'ACTIVITYPUB_DISABLE_REWRITES', false ); -\defined( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS' ) || \define( 'ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS', false ); -\defined( 'ACTIVITYPUB_DISABLE_OUTGOING_INTERACTIONS' ) || \define( 'ACTIVITYPUB_DISABLE_OUTGOING_INTERACTIONS', false ); -\defined( 'ACTIVITYPUB_SHARED_INBOX_FEATURE' ) || \define( 'ACTIVITYPUB_SHARED_INBOX_FEATURE', false ); -\defined( 'ACTIVITYPUB_SEND_VARY_HEADER' ) || \define( 'ACTIVITYPUB_SEND_VARY_HEADER', false ); -\defined( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE' ) || \define( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE', 'note' ); - -\define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -\define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); -\define( 'ACTIVITYPUB_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) ); -\define( 'ACTIVITYPUB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); - -/** - * Initialize REST routes. - */ -function rest_init() { - Rest\Actors::init(); - Rest\Outbox::init(); - Rest\Inbox::init(); - Rest\Followers::init(); - Rest\Following::init(); - Rest\Webfinger::init(); - Rest\Comment::init(); - Rest\Server::init(); - Rest\Collection::init(); - - // load NodeInfo endpoints only if blog is public - if ( is_blog_public() ) { - Rest\NodeInfo::init(); - } -} -\add_action( 'rest_api_init', __NAMESPACE__ . '\rest_init' ); - -/** - * Initialize plugin. - */ -function plugin_init() { - \add_action( 'init', array( __NAMESPACE__ . '\Migration', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Activitypub', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Activity_Dispatcher', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Handler', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Admin', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Hashtag', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Mention', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Health_Check', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Scheduler', 'init' ) ); - \add_action( 'init', array( __NAMESPACE__ . '\Comment', 'init' ) ); - - if ( site_supports_blocks() ) { - \add_action( 'init', array( __NAMESPACE__ . '\Blocks', 'init' ) ); - } - - $debug_file = __DIR__ . '/includes/debug.php'; - if ( \WP_DEBUG && file_exists( $debug_file ) && is_readable( $debug_file ) ) { - require_once $debug_file; - Debug::init(); - } - - require_once __DIR__ . '/integration/class-webfinger.php'; - Integration\Webfinger::init(); - - require_once __DIR__ . '/integration/class-nodeinfo.php'; - Integration\Nodeinfo::init(); - - require_once __DIR__ . '/integration/class-enable-mastodon-apps.php'; - Integration\Enable_Mastodon_Apps::init(); - - require_once __DIR__ . '/integration/class-opengraph.php'; - Integration\Opengraph::init(); - - if ( \defined( 'JETPACK__VERSION' ) && ! \defined( 'IS_WPCOM' ) ) { - require_once __DIR__ . '/integration/class-jetpack.php'; - Integration\Jetpack::init(); - } -} -\add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_init' ); - - -/** - * Class Autoloader - */ -\spl_autoload_register( - function ( $full_class ) { - $base_dir = __DIR__ . '/includes/'; - $base = 'Activitypub\\'; - - if ( strncmp( $full_class, $base, strlen( $base ) ) === 0 ) { - $maybe_uppercase = str_replace( $base, '', $full_class ); - $class = strtolower( $maybe_uppercase ); - // All classes should be capitalized. If this is instead looking for a lowercase method, we ignore that. - if ( $maybe_uppercase === $class ) { - return; - } - - if ( false !== strpos( $class, '\\' ) ) { - $parts = explode( '\\', $class ); - $class = array_pop( $parts ); - $sub_dir = strtr( implode( '/', $parts ), '_', '-' ); - $base_dir = $base_dir . $sub_dir . '/'; - } - - $filename = 'class-' . strtr( $class, '_', '-' ); - $file = $base_dir . $filename . '.php'; - - if ( file_exists( $file ) && is_readable( $file ) ) { - require_once $file; - } else { - // translators: %s is the class name - \wp_die( sprintf( esc_html__( 'Required class not found or not readable: %s', 'activitypub' ), esc_html( $full_class ) ) ); - } - } - } -); - -/** - * Add plugin settings link - */ -function plugin_settings_link( $actions ) { - $settings_link = array(); - $settings_link[] = \sprintf( - '%2s', - \menu_page_url( 'activitypub', false ), - \__( 'Settings', 'activitypub' ) - ); - - return \array_merge( $settings_link, $actions ); -} -\add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), __NAMESPACE__ . '\plugin_settings_link' ); - -\register_activation_hook( - __FILE__, - array( - __NAMESPACE__ . '\Activitypub', - 'activate', - ) -); - -\register_deactivation_hook( - __FILE__, - array( - __NAMESPACE__ . '\Activitypub', - 'deactivate', - ) -); - -\register_uninstall_hook( - __FILE__, - array( - __NAMESPACE__ . '\Activitypub', - 'uninstall', - ) -); - -/** - * Only load code that needs BuddyPress to run once BP is loaded and initialized. - */ -add_action( - 'bp_include', - function () { - require_once __DIR__ . '/integration/class-buddypress.php'; - Integration\Buddypress::init(); - }, - 0 -); - -/** - * `get_plugin_data` wrapper - * - * @return array The plugin metadata array - */ -function get_plugin_meta( $default_headers = array() ) { - if ( ! $default_headers ) { - $default_headers = array( - 'Name' => 'Plugin Name', - 'PluginURI' => 'Plugin URI', - 'Version' => 'Version', - 'Description' => 'Description', - 'Author' => 'Author', - 'AuthorURI' => 'Author URI', - 'TextDomain' => 'Text Domain', - 'DomainPath' => 'Domain Path', - 'Network' => 'Network', - 'RequiresWP' => 'Requires at least', - 'RequiresPHP' => 'Requires PHP', - 'UpdateURI' => 'Update URI', - ); - } - - return \get_file_data( __FILE__, $default_headers, 'plugin' ); -} - -/** - * Plugin Version Number used for caching. - */ -function get_plugin_version() { - if ( \defined( 'ACTIVITYPUB_PLUGIN_VERSION' ) ) { - return ACTIVITYPUB_PLUGIN_VERSION; - } - - $meta = get_plugin_meta( array( 'Version' => 'Version' ) ); - - return $meta['Version']; -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/css/activitypub-admin.css b/wp-content/upgrade-temp-backup/plugins/activitypub/assets/css/activitypub-admin.css deleted file mode 100644 index 7c7589e4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/css/activitypub-admin.css +++ /dev/null @@ -1,204 +0,0 @@ -.activitypub-settings { - max-width: 800px; - margin: 0 auto; -} - -.settings_page_activitypub .notice { - max-width: 800px; - margin: auto; - margin: 0px auto 30px; -} - -.settings_page_activitypub .wrap { - padding-left: 22px; -} - -.activitypub-settings-header { - text-align: center; - margin: 0 0 1rem; - background: #fff; - border-bottom: 1px solid #dcdcde; -} - -.activitypub-settings-title-section { - display: flex; - align-items: center; - justify-content: center; - clear: both; - padding-top: 8px; -} - -.settings_page_activitypub #wpcontent { - padding-left: 0; -} - -.activitypub-settings-tabs-wrapper { - display: -ms-inline-grid; - -ms-grid-columns: auto auto auto; - vertical-align: top; - display: inline-grid; - grid-template-columns: auto auto auto; -} - -.activitypub-settings-tab.active { - box-shadow: inset 0 -3px #3582c4; - font-weight: 600; -} - -.activitypub-settings-tab { - display: block; - text-decoration: none; - color: inherit; - padding: .5rem 1rem 1rem; - margin: 0 1rem; - transition: box-shadow .5s ease-in-out; -} - -.wp-header-end { - visibility: hidden; - margin: -2px 0 0; -} - -summary { - cursor: pointer; - text-decoration: underline; - color: #2271b1; -} - -.activitypub-settings-accordion { - border: 1px solid #c3c4c7; -} - -.activitypub-settings-accordion-heading { - margin: 0; - border-top: 1px solid #c3c4c7; - font-size: inherit; - line-height: inherit; - font-weight: 600; - color: inherit; -} - -.activitypub-settings-accordion-heading:first-child { - border-top: none; -} - -.activitypub-settings-accordion-panel { - margin: 0; - padding: 1em 1.5em; - background: #fff; -} - -.activitypub-settings-accordion-trigger { - background: #fff; - border: 0; - color: #2c3338; - cursor: pointer; - display: flex; - font-weight: 400; - margin: 0; - padding: 1em 3.5em 1em 1.5em; - min-height: 46px; - position: relative; - text-align: left; - width: 100%; - align-items: center; - justify-content: space-between; - -webkit-user-select: auto; - user-select: auto; -} - -.activitypub-settings-accordion-trigger { - color: #2c3338; - cursor: pointer; - font-weight: 400; - text-align: left; -} - -.activitypub-settings-accordion-trigger .title { - pointer-events: none; - font-weight: 600; - flex-grow: 1; -} - -.activitypub-settings-accordion-trigger .icon, -.activitypub-settings-accordion-viewed .icon { - border: solid #50575e medium; - border-width: 0 2px 2px 0; - height: .5rem; - pointer-events: none; - position: absolute; - right: 1.5em; - top: 50%; - transform: translateY(-70%) rotate(45deg); - width: .5rem; -} - -.activitypub-settings-accordion-trigger[aria-expanded="true"] .icon { - transform: translateY(-30%) rotate(-135deg); -} - -.activitypub-settings-accordion-trigger:active, -.activitypub-settings-accordion-trigger:hover { - background: #f6f7f7; -} - -.activitypub-settings-accordion-trigger:focus { - color: #1d2327; - border: none; - box-shadow: none; - outline-offset: -1px; - outline: 2px solid #2271b1; - background-color: #f6f7f7; -} - -.activitypub-settings -input.blog-user-identifier { - text-align: right; -} - -.activitypub-settings -.header-image { - width: 100%; - height: 80px; - position: relative; - display: block; - margin-bottom: 40px; - background-image: rgb(168,165,175); - background-image: linear-gradient(180deg, red, yellow); - background-size: cover; -} - -.activitypub-settings -.logo { - height: 80px; - width: 80px; - position: relative; - top: 40px; - left: 40px; -} - -.settings_page_activitypub .box { - border: 1px solid #c3c4c7; - background-color: #fff; - padding: 1em 1.5em; - margin-bottom: 1.5em; -} - -.settings_page_activitypub .activitypub-welcome-page .box label { - font-weight: bold; -} - -.settings_page_activitypub .activitypub-welcome-page input { - font-size: 20px; - width: 95%; -} - -.settings_page_activitypub .plugin-recommendations { - border-bottom: none; - margin-bottom: 0; -} - -#dashboard_right_now li a.activitypub-followers::before { - content: "\f307"; - font-family: dashicons; -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/img/mp.jpg b/wp-content/upgrade-temp-backup/plugins/activitypub/assets/img/mp.jpg deleted file mode 100644 index 05964b49..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/img/mp.jpg and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/img/wp-logo.png b/wp-content/upgrade-temp-backup/plugins/activitypub/assets/img/wp-logo.png deleted file mode 100644 index b48f08e8..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/img/wp-logo.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/js/activitypub-admin.js b/wp-content/upgrade-temp-backup/plugins/activitypub/assets/js/activitypub-admin.js deleted file mode 100644 index 37117cab..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/assets/js/activitypub-admin.js +++ /dev/null @@ -1,21 +0,0 @@ -jQuery( function( $ ) { - // Accordion handling in various areas. - $( '.activitypub-settings-accordion' ).on( 'click', '.activitypub-settings-accordion-trigger', function() { - var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) ); - - if ( isExpanded ) { - $( this ).attr( 'aria-expanded', 'false' ); - $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true ); - } else { - $( this ).attr( 'aria-expanded', 'true' ); - $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false ); - } - } ); - - $(document).on( 'wp-plugin-install-success', function( event, response ) { - setTimeout( function() { - $( '.activate-now' ).removeClass( 'thickbox open-plugin-details-modal' ); - }, 1200 ); - } ); - -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/block.json b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/block.json deleted file mode 100644 index 6e685671..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/block.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "name": "activitypub/follow-me", - "apiVersion": 3, - "version": "1.0.0", - "title": "Follow me on the Fediverse", - "category": "widgets", - "description": "Display your Fediverse profile so that visitors can follow you.", - "textdomain": "activitypub", - "icon": "groups", - "supports": { - "html": false, - "color": { - "gradients": true, - "link": true, - "__experimentalDefaultControls": { - "background": true, - "text": true, - "link": true - } - }, - "__experimentalBorder": { - "radius": true, - "width": true, - "color": true, - "style": true - }, - "typography": { - "fontSize": true, - "__experimentalDefaultControls": { - "fontSize": true - } - } - }, - "attributes": { - "selectedUser": { - "type": "string", - "default": "site" - } - }, - "editorScript": "file:./index.js", - "viewScript": "file:./view.js", - "style": [ - "file:./style-view.css", - "wp-components" - ] -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.asset.php b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.asset.php deleted file mode 100644 index dd3f4529..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '7be9f9b97d08a20bde26'); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.js b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.js deleted file mode 100644 index 873ed24f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={17:(e,t,r)=>{const o=window.wp.blocks,n=window.wp.primitives;var l=r(848);const a=(0,l.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.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"})});var i=r(609);const c=window.wp.blockEditor,s=window.wp.i18n,u=window.wp.components,p=window.wp.data,m=window.wp.element,v=window._activityPubOptions?.enabled,d=window.wp.apiFetch;var f=r.n(d);function y(e){return`var(--wp--preset--color--${e})`}function b(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return y(t)}function _(e,t,r=null,o=""){return r?`${e}${o} { ${t}: ${r}; }\n`:""}function w(e,t,r,o){return _(e,"background-color",t)+_(e,"color",r)+_(e,"background-color",o,":hover")+_(e,"background-color",o,":focus")}function h({selector:e,style:t,backgroundColor:r}){const o=function(e,t,r){const o=`${e} .components-button`,n=("string"==typeof(l=r)?y(l):l?.color?.background||null)||t?.color?.background;var l;return w(o,b(t?.elements?.link?.color?.text),n,b(t?.elements?.link?.[":hover"]?.color?.text))}(e,t,r);return(0,i.createElement)("style",null,o)}const g=(0,l.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),E=(0,l.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.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"})}),k=(0,m.forwardRef)((function({icon:e,size:t=24,...r},o){return(0,m.cloneElement)(e,{width:t,height:t,...r,ref:o})})),x=window.wp.compose,S="fediverse-remote-user";function O(e){try{return new URL(e),!0}catch(e){return!1}}function C({actionText:e,copyDescription:t,handle:r,resourceUrl:o,myProfile:n=!1,rememberProfile:l=!1}){const c=(0,s.__)("Loading...","activitypub"),p=(0,s.__)("Opening...","activitypub"),v=(0,s.__)("Error","activitypub"),d=(0,s.__)("Invalid","activitypub"),y=n||(0,s.__)("My Profile","activitypub"),[b,_]=(0,m.useState)(e),[w,h]=(0,m.useState)(g),C=(0,x.useCopyToClipboard)(r,(()=>{h(E),setTimeout((()=>h(g)),1e3)})),[N,R]=(0,m.useState)(""),[U,P]=(0,m.useState)(!0),{setRemoteUser:I}=function(){const[e,t]=(0,m.useState)(function(){const e=localStorage.getItem(S);return e?JSON.parse(e):{}}()),r=(0,m.useCallback)((e=>{!function(e){localStorage.setItem(S,JSON.stringify(e))}(e),t(e)}),[]),o=(0,m.useCallback)((()=>{localStorage.removeItem(S),t({})}),[]);return{template:e?.template||!1,profileURL:e?.profileURL||!1,setRemoteUser:r,deleteRemoteUser:o}}(),$=(0,m.useCallback)((()=>{let t;if(!O(N)&&!function(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&O(`https://${t[1]}`)}(N))return _(d),t=setTimeout((()=>_(e)),2e3),()=>clearTimeout(t);const r=o+N;_(c),f()({path:r}).then((({url:t,template:r})=>{U&&I({profileURL:N,template:r}),_(p),setTimeout((()=>{window.open(t,"_blank"),_(e)}),200)})).catch((()=>{_(v),setTimeout((()=>_(e)),2e3)}))}),[N]);return(0,i.createElement)("div",{className:"activitypub__dialog"},(0,i.createElement)("div",{className:"activitypub-dialog__section"},(0,i.createElement)("h4",null,y),(0,i.createElement)("div",{className:"activitypub-dialog__description"},t),(0,i.createElement)("div",{className:"activitypub-dialog__button-group"},(0,i.createElement)("input",{type:"text",value:r,readOnly:!0}),(0,i.createElement)(u.Button,{ref:C},(0,i.createElement)(k,{icon:w}),(0,s.__)("Copy","activitypub")))),(0,i.createElement)("div",{className:"activitypub-dialog__section"},(0,i.createElement)("h4",null,(0,s.__)("Your Profile","activitypub")),(0,i.createElement)("div",{className:"activitypub-dialog__description"},(0,m.createInterpolateElement)((0,s.__)("Or, if you know your own profile, we can start things that way! (eg yourusername@example.com)","activitypub"),{code:(0,i.createElement)("code",null)})),(0,i.createElement)("div",{className:"activitypub-dialog__button-group"},(0,i.createElement)("input",{type:"text",value:N,onKeyDown:e=>{"Enter"===e?.code&&$()},onChange:e=>R(e.target.value)}),(0,i.createElement)(u.Button,{onClick:$},(0,i.createElement)(k,{icon:a}),b)),l&&(0,i.createElement)("div",{className:"activitypub-dialog__remember"},(0,i.createElement)(u.CheckboxControl,{checked:U,label:(0,s.__)("Remember me for easier comments","activitypub"),onChange:()=>{P(!U)}}))))}const{namespace:N}=window._activityPubOptions,R={avatar:"",webfinger:"@well@hello.dolly",name:(0,s.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function U(e){if(!e)return R;const t={...R,...e};return t.avatar=t?.icon?.url,t}function P({profile:e,popupStyles:t,userId:r}){const{avatar:o,name:n,webfinger:l}=e;return(0,i.createElement)("div",{className:"activitypub-profile"},(0,i.createElement)("img",{className:"activitypub-profile__avatar",src:o,alt:n}),(0,i.createElement)("div",{className:"activitypub-profile__content"},(0,i.createElement)("div",{className:"activitypub-profile__name"},n),(0,i.createElement)("div",{className:"activitypub-profile__handle",title:l},l)),(0,i.createElement)(I,{profile:e,popupStyles:t,userId:r}))}function I({profile:e,popupStyles:t,userId:r}){const[o,n]=(0,m.useState)(!1),l=(0,s.sprintf)((0,s.__)("Follow %s","activitypub"),e?.name);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(u.Button,{className:"activitypub-profile__follow",onClick:()=>n(!0)},(0,s.__)("Follow","activitypub")),o&&(0,i.createElement)(u.Modal,{className:"activitypub-profile__confirm activitypub__modal",onRequestClose:()=>n(!1),title:l},(0,i.createElement)($,{profile:e,userId:r}),(0,i.createElement)("style",null,t)))}function $({profile:e,userId:t}){const{webfinger:r}=e,o=(0,s.__)("Follow","activitypub"),n=`/${N}/actors/${t}/remote-follow?resource=`,l=(0,s.__)("Copy and paste my profile into the search field of your favorite fediverse app or server.","activitypub");return(0,i.createElement)(C,{actionText:o,copyDescription:l,handle:r,resourceUrl:n})}function T({selectedUser:e,style:t,backgroundColor:r,id:o,useId:n=!1,profileData:l=!1}){const[a,c]=(0,m.useState)(U()),s="site"===e?0:e,u=function(e){return w(".apfmd__button-group .components-button",b(e?.elements?.link?.color?.text)||"#111","#fff",b(e?.elements?.link?.[":hover"]?.color?.text)||"#333")}(t),p=n?{id:o}:{};function v(e){c(U(e))}return(0,m.useEffect)((()=>{if(l)return v(l);(function(e){const t={headers:{Accept:"application/activity+json"},path:`/${N}/actors/${e}`};return f()(t)})(s).then(v)}),[s,l]),(0,i.createElement)("div",{...p},(0,i.createElement)(h,{selector:`#${o}`,style:t,backgroundColor:r}),(0,i.createElement)(P,{profile:a,userId:s,popupStyles:u}))}(0,o.registerBlockType)("activitypub/follow-me",{edit:function({attributes:e,setAttributes:t}){const r=(0,c.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),o=function(){const e=v?.users?(0,p.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,m.useMemo)((()=>{if(!e)return[];const t=v?.site?[{label:(0,s.__)("Whole Site","activitypub"),value:"site"}]:[];return e.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),t)}),[e])}(),{selectedUser:n}=e;return(0,m.useEffect)((()=>{o.length&&(o.find((({value:e})=>e===n))||t({selectedUser:o[0].value}))}),[n,o]),(0,i.createElement)("div",{...r},o.length>1&&(0,i.createElement)(c.InspectorControls,{key:"setting"},(0,i.createElement)(u.PanelBody,{title:(0,s.__)("Followers Options","activitypub")},(0,i.createElement)(u.SelectControl,{label:(0,s.__)("Select User","activitypub"),value:e.selectedUser,options:o,onChange:e=>t({selectedUser:e})}))),(0,i.createElement)(T,{...e,id:r.id}))},save:()=>null,icon:a})},20:(e,t,r)=>{var o=r(609),n=Symbol.for("react.element"),l=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,c={},s=null,u=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!i.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:u,props:c,_owner:a.current}}},848:(e,t,r)=>{e.exports=r(20)},609:e=>{e.exports=window.React}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,o),l.exports}o.m=t,e=[],o.O=(t,r,n,l)=>{if(!r){var a=1/0;for(u=0;u=l)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(i=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[r,n,l]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={338:0,301:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var n,l,[a,i,c]=r,s=0;if(a.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(c)var u=c(o)}for(t&&t(r);so(17)));n=o.O(n)})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-view-rtl.css b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-view-rtl.css deleted file mode 100644 index 782f5765..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-view-rtl.css +++ /dev/null @@ -1 +0,0 @@ -.activitypub__modal.components-modal__frame{background-color:#f7f7f7;color:#333}.activitypub__modal.components-modal__frame .components-modal__header-heading,.activitypub__modal.components-modal__frame h4{color:#333;letter-spacing:inherit;word-spacing:inherit}.activitypub__modal.components-modal__frame .components-modal__header .components-button:hover{color:var(--wp--preset--color--white)}.activitypub__dialog{max-width:40em}.activitypub__dialog h4{line-height:1;margin:0}.activitypub__dialog .activitypub-dialog__section{margin-bottom:2em}.activitypub__dialog .activitypub-dialog__remember{margin-top:1em}.activitypub__dialog .activitypub-dialog__description{font-size:var(--wp--preset--font-size--normal,.75rem);margin:.33em 0 1em}.activitypub__dialog .activitypub-dialog__button-group{align-items:flex-end;display:flex;justify-content:flex-end}.activitypub__dialog .activitypub-dialog__button-group svg{height:21px;margin-left:.5em;width:21px}.activitypub__dialog .activitypub-dialog__button-group input{background-color:var(--wp--preset--color--white);border-radius:0 50px 50px 0;border-width:1px;border:1px solid var(--wp--preset--color--black);color:var(--wp--preset--color--black);flex:1;font-size:16px;height:inherit;line-height:1;margin-left:0;padding:15px 23px}.activitypub__dialog .activitypub-dialog__button-group button{align-self:center;background-color:var(--wp--preset--color--black);border-radius:50px 0 0 50px;border-width:1px;color:var(--wp--preset--color--white);font-size:16px;height:inherit;line-height:1;margin-right:0;padding:15px 23px;text-decoration:none}.activitypub__dialog .activitypub-dialog__button-group button:hover{border:inherit}.activitypub-follow-me-block-wrapper{width:100%}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border-color .activitypub-profile{padding-right:1rem;padding-left:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__avatar{border-radius:50%;height:75px;margin-left:1rem;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__content{flex:1;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__name{line-height:1.2;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__name{font-size:1.25em}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__follow{align-self:center;background-color:var(--wp--preset--color--black);color:var(--wp--preset--color--white);margin-right:1rem} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-view.css b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-view.css deleted file mode 100644 index fdc7405a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/style-view.css +++ /dev/null @@ -1 +0,0 @@ -.activitypub__modal.components-modal__frame{background-color:#f7f7f7;color:#333}.activitypub__modal.components-modal__frame .components-modal__header-heading,.activitypub__modal.components-modal__frame h4{color:#333;letter-spacing:inherit;word-spacing:inherit}.activitypub__modal.components-modal__frame .components-modal__header .components-button:hover{color:var(--wp--preset--color--white)}.activitypub__dialog{max-width:40em}.activitypub__dialog h4{line-height:1;margin:0}.activitypub__dialog .activitypub-dialog__section{margin-bottom:2em}.activitypub__dialog .activitypub-dialog__remember{margin-top:1em}.activitypub__dialog .activitypub-dialog__description{font-size:var(--wp--preset--font-size--normal,.75rem);margin:.33em 0 1em}.activitypub__dialog .activitypub-dialog__button-group{align-items:flex-end;display:flex;justify-content:flex-end}.activitypub__dialog .activitypub-dialog__button-group svg{height:21px;margin-right:.5em;width:21px}.activitypub__dialog .activitypub-dialog__button-group input{background-color:var(--wp--preset--color--white);border-radius:50px 0 0 50px;border-width:1px;border:1px solid var(--wp--preset--color--black);color:var(--wp--preset--color--black);flex:1;font-size:16px;height:inherit;line-height:1;margin-right:0;padding:15px 23px}.activitypub__dialog .activitypub-dialog__button-group button{align-self:center;background-color:var(--wp--preset--color--black);border-radius:0 50px 50px 0;border-width:1px;color:var(--wp--preset--color--white);font-size:16px;height:inherit;line-height:1;margin-left:0;padding:15px 23px;text-decoration:none}.activitypub__dialog .activitypub-dialog__button-group button:hover{border:inherit}.activitypub-follow-me-block-wrapper{width:100%}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border-color .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile{align-items:center;display:flex;padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__content{flex:1;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__name{line-height:1.2;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__name{font-size:1.25em}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__follow{align-self:center;background-color:var(--wp--preset--color--black);color:var(--wp--preset--color--white);margin-left:1rem} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.asset.php b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.asset.php deleted file mode 100644 index da6b09c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'ab8c0dad126bb0a61ed6'); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.js b/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.js deleted file mode 100644 index 7fd3cb16..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/follow-me/view.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={729:(e,t,r)=>{var o=r(609);const n=window.wp.element,a=window.wp.domReady;var l=r.n(a);const i=window.wp.apiFetch;var c=r.n(i);const s=window.wp.components,u=window.wp.i18n;function p(e){return`var(--wp--preset--color--${e})`}function m(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|");return p(t)}function v(e,t,r=null,o=""){return r?`${e}${o} { ${t}: ${r}; }\n`:""}function d(e,t,r,o){return v(e,"background-color",t)+v(e,"color",r)+v(e,"background-color",o,":hover")+v(e,"background-color",o,":focus")}function f({selector:e,style:t,backgroundColor:r}){const n=function(e,t,r){const o=`${e} .components-button`,n=("string"==typeof(a=r)?p(a):a?.color?.background||null)||t?.color?.background;var a;return d(o,m(t?.elements?.link?.color?.text),n,m(t?.elements?.link?.[":hover"]?.color?.text))}(e,t,r);return(0,o.createElement)("style",null,n)}const y=window.wp.primitives;var _=r(848);const b=(0,_.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_.jsx)(y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),w=(0,_.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_.jsx)(y.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),h=(0,n.forwardRef)((function({icon:e,size:t=24,...r},o){return(0,n.cloneElement)(e,{width:t,height:t,...r,ref:o})})),g=(0,_.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_.jsx)(y.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"})}),E=window.wp.compose,k="fediverse-remote-user";function x(e){try{return new URL(e),!0}catch(e){return!1}}function O({actionText:e,copyDescription:t,handle:r,resourceUrl:a,myProfile:l=!1,rememberProfile:i=!1}){const p=(0,u.__)("Loading...","activitypub"),m=(0,u.__)("Opening...","activitypub"),v=(0,u.__)("Error","activitypub"),d=(0,u.__)("Invalid","activitypub"),f=l||(0,u.__)("My Profile","activitypub"),[y,_]=(0,n.useState)(e),[O,S]=(0,n.useState)(b),C=(0,E.useCopyToClipboard)(r,(()=>{S(w),setTimeout((()=>S(b)),1e3)})),[N,R]=(0,n.useState)(""),[I,P]=(0,n.useState)(!0),{setRemoteUser:$}=function(){const[e,t]=(0,n.useState)(function(){const e=localStorage.getItem(k);return e?JSON.parse(e):{}}()),r=(0,n.useCallback)((e=>{!function(e){localStorage.setItem(k,JSON.stringify(e))}(e),t(e)}),[]),o=(0,n.useCallback)((()=>{localStorage.removeItem(k),t({})}),[]);return{template:e?.template||!1,profileURL:e?.profileURL||!1,setRemoteUser:r,deleteRemoteUser:o}}(),j=(0,n.useCallback)((()=>{let t;if(!x(N)&&!function(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&x(`https://${t[1]}`)}(N))return _(d),t=setTimeout((()=>_(e)),2e3),()=>clearTimeout(t);const r=a+N;_(p),c()({path:r}).then((({url:t,template:r})=>{I&&$({profileURL:N,template:r}),_(m),setTimeout((()=>{window.open(t,"_blank"),_(e)}),200)})).catch((()=>{_(v),setTimeout((()=>_(e)),2e3)}))}),[N]);return(0,o.createElement)("div",{className:"activitypub__dialog"},(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",null,f),(0,o.createElement)("div",{className:"activitypub-dialog__description"},t),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("input",{type:"text",value:r,readOnly:!0}),(0,o.createElement)(s.Button,{ref:C},(0,o.createElement)(h,{icon:O}),(0,u.__)("Copy","activitypub")))),(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",null,(0,u.__)("Your Profile","activitypub")),(0,o.createElement)("div",{className:"activitypub-dialog__description"},(0,n.createInterpolateElement)((0,u.__)("Or, if you know your own profile, we can start things that way! (eg yourusername@example.com)","activitypub"),{code:(0,o.createElement)("code",null)})),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("input",{type:"text",value:N,onKeyDown:e=>{"Enter"===e?.code&&j()},onChange:e=>R(e.target.value)}),(0,o.createElement)(s.Button,{onClick:j},(0,o.createElement)(h,{icon:g}),y)),i&&(0,o.createElement)("div",{className:"activitypub-dialog__remember"},(0,o.createElement)(s.CheckboxControl,{checked:I,label:(0,u.__)("Remember me for easier comments","activitypub"),onChange:()=>{P(!I)}}))))}const{namespace:S}=window._activityPubOptions,C={avatar:"",webfinger:"@well@hello.dolly",name:(0,u.__)("Hello Dolly Fan Account","activitypub"),url:"#"};function N(e){if(!e)return C;const t={...C,...e};return t.avatar=t?.icon?.url,t}function R({profile:e,popupStyles:t,userId:r}){const{avatar:n,name:a,webfinger:l}=e;return(0,o.createElement)("div",{className:"activitypub-profile"},(0,o.createElement)("img",{className:"activitypub-profile__avatar",src:n,alt:a}),(0,o.createElement)("div",{className:"activitypub-profile__content"},(0,o.createElement)("div",{className:"activitypub-profile__name"},a),(0,o.createElement)("div",{className:"activitypub-profile__handle",title:l},l)),(0,o.createElement)(I,{profile:e,popupStyles:t,userId:r}))}function I({profile:e,popupStyles:t,userId:r}){const[a,l]=(0,n.useState)(!1),i=(0,u.sprintf)((0,u.__)("Follow %s","activitypub"),e?.name);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(s.Button,{className:"activitypub-profile__follow",onClick:()=>l(!0)},(0,u.__)("Follow","activitypub")),a&&(0,o.createElement)(s.Modal,{className:"activitypub-profile__confirm activitypub__modal",onRequestClose:()=>l(!1),title:i},(0,o.createElement)(P,{profile:e,userId:r}),(0,o.createElement)("style",null,t)))}function P({profile:e,userId:t}){const{webfinger:r}=e,n=(0,u.__)("Follow","activitypub"),a=`/${S}/actors/${t}/remote-follow?resource=`,l=(0,u.__)("Copy and paste my profile into the search field of your favorite fediverse app or server.","activitypub");return(0,o.createElement)(O,{actionText:n,copyDescription:l,handle:r,resourceUrl:a})}function $({selectedUser:e,style:t,backgroundColor:r,id:a,useId:l=!1,profileData:i=!1}){const[s,u]=(0,n.useState)(N()),p="site"===e?0:e,v=function(e){return d(".apfmd__button-group .components-button",m(e?.elements?.link?.color?.text)||"#111","#fff",m(e?.elements?.link?.[":hover"]?.color?.text)||"#333")}(t),y=l?{id:a}:{};function _(e){u(N(e))}return(0,n.useEffect)((()=>{if(i)return _(i);(function(e){const t={headers:{Accept:"application/activity+json"},path:`/${S}/actors/${e}`};return c()(t)})(p).then(_)}),[p,i]),(0,o.createElement)("div",{...y},(0,o.createElement)(f,{selector:`#${a}`,style:t,backgroundColor:r}),(0,o.createElement)(R,{profile:s,userId:p,popupStyles:v}))}let j=1;l()((()=>{[].forEach.call(document.querySelectorAll(".activitypub-follow-me-block-wrapper"),(e=>{const t=JSON.parse(e.dataset.attrs);(0,n.createRoot)(e).render((0,o.createElement)($,{...t,id:"activitypub-follow-me-block-"+j++,useId:!0}))}))}))},20:(e,t,r)=>{var o=r(609),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,c={},s=null,u=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,o)&&!i.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:u,props:c,_owner:l.current}}},848:(e,t,r)=>{e.exports=r(20)},609:e=>{e.exports=window.React}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,r,n,a)=>{if(!r){var l=1/0;for(u=0;u=a)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(i=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,n,a]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={41:0,301:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var n,a,[l,i,c]=r,s=0;if(l.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(c)var u=c(o)}for(t&&t(r);so(729)));n=o.O(n)})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/block.json b/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/block.json deleted file mode 100644 index c7015d33..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/block.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "name": "activitypub/followers", - "apiVersion": 3, - "version": "1.0.0", - "title": "Fediverse Followers", - "category": "widgets", - "description": "Display your followers from the Fediverse on your website.", - "textdomain": "activitypub", - "icon": "groups", - "supports": { - "html": false - }, - "attributes": { - "title": { - "type": "string", - "default": "Fediverse Followers" - }, - "selectedUser": { - "type": "string", - "default": "site" - }, - "per_page": { - "type": "number", - "default": 10 - }, - "order": { - "type": "string", - "default": "desc", - "enum": [ - "asc", - "desc" - ] - } - }, - "styles": [ - { - "name": "default", - "label": "No Lines", - "isDefault": true - }, - { - "name": "with-lines", - "label": "Lines" - }, - { - "name": "compact", - "label": "Compact" - } - ], - "editorScript": "file:./index.js", - "viewScript": "file:./view.js", - "style": [ - "file:./style-view.css", - "wp-block-query-pagination" - ] -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/index.asset.php b/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/index.asset.php deleted file mode 100644 index fb5c1d96..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '3d39b46b3415c2d57654'); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/index.js b/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/index.js deleted file mode 100644 index a47e3cac..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/index.js +++ /dev/null @@ -1,3 +0,0 @@ -(()=>{var e={20:(e,t,a)=>{"use strict";var r=a(609),n=Symbol.for("react.element"),l=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,a){var r,c={},s=null,p=null;for(r in void 0!==a&&(s=""+a),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(p=t.ref),t)l.call(t,r)&&!i.hasOwnProperty(r)&&(c[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===c[r]&&(c[r]=t[r]);return{$$typeof:n,type:e,key:s,ref:p,props:c,_owner:o.current}}},848:(e,t,a)=>{"use strict";e.exports=a(20)},609:e=>{"use strict";e.exports=window.React},942:(e,t)=>{var a;!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.wp.primitives;var r=a(848);const n=(0,r.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(t.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"})});var l=a(609);const o=window.wp.components,i=window.wp.element,c=window.wp.blockEditor,s=window.wp.i18n,p=window.wp.apiFetch;var u=a.n(p);const v=window.wp.url;var m=a(942),w=a.n(m);function d({active:e,children:t,page:a,pageClick:r,className:n}){const o=w()("wp-block activitypub-pager",n,{current:e});return(0,l.createElement)("a",{className:o,onClick:t=>{t.preventDefault(),!e&&r(a)}},t)}const f={outlined:"outlined",minimal:"minimal"};function b({compact:e,nextLabel:t,page:a,pageClick:r,perPage:n,prevLabel:o,total:i,variant:c=f.outlined}){const s=((e,t)=>{let a=[1,e-2,e-1,e,e+1,e+2,t];a.sort(((e,t)=>e-t)),a=a.filter(((e,a,r)=>e>=1&&e<=t&&r.lastIndexOf(e)===a));for(let e=a.length-2;e>=0;e--)a[e]===a[e+1]&&a.splice(e+1,1);return a})(a,Math.ceil(i/n)),p=w()("alignwide wp-block-query-pagination is-content-justification-space-between is-layout-flex wp-block-query-pagination-is-layout-flex",`is-${c}`,{"is-compact":e});return(0,l.createElement)("nav",{className:p},o&&(0,l.createElement)(d,{key:"prev",page:a-1,pageClick:r,active:1===a,"aria-label":o,className:"wp-block-query-pagination-previous block-editor-block-list__block"},o),!e&&(0,l.createElement)("div",{className:"block-editor-block-list__block wp-block wp-block-query-pagination-numbers"},s.map((e=>(0,l.createElement)(d,{key:e,page:e,pageClick:r,active:e===a,className:"page-numbers"},e)))),t&&(0,l.createElement)(d,{key:"next",page:a+1,pageClick:r,active:a===Math.ceil(i/n),"aria-label":t,className:"wp-block-query-pagination-next block-editor-block-list__block"},t))}const{namespace:y}=window._activityPubOptions;function g({selectedUser:e,per_page:t,order:a,title:r,page:n,setPage:o,className:c="",followLinks:p=!0,followerData:m=!1}){const w="site"===e?0:e,[d,f]=(0,l.useState)([]),[g,k]=(0,l.useState)(0),[h,E]=(0,l.useState)(0),[x,N]=function(){const[e,t]=(0,l.useState)(1);return[e,t]}(),S=n||x,C=o||N,O=(0,i.createInterpolateElement)(/* translators: arrow for previous followers link */ /* translators: arrow for previous followers link */ -(0,s.__)(" Less","activitypub"),{span:(0,l.createElement)("span",{className:"wp-block-query-pagination-previous-arrow is-arrow-arrow","aria-hidden":"true"})}),P=(0,i.createInterpolateElement)(/* translators: arrow for next followers link */ /* translators: arrow for next followers link */ -(0,s.__)("More ","activitypub"),{span:(0,l.createElement)("span",{className:"wp-block-query-pagination-next-arrow is-arrow-arrow","aria-hidden":"true"})}),L=(e,a)=>{f(e),E(a),k(Math.ceil(a/t))};return(0,l.useEffect)((()=>{if(m&&1===S)return L(m.followers,m.total);const e=function(e,t,a,r){const n=`/${y}/actors/${e}/followers`,l={per_page:t,order:a,page:r,context:"full"};return(0,v.addQueryArgs)(n,l)}(w,t,a,S);u()({path:e}).then((e=>L(e.orderedItems,e.totalItems))).catch((()=>{}))}),[w,t,a,S,m]),(0,l.createElement)("div",{className:"activitypub-follower-block "+c},(0,l.createElement)("h3",null,r),(0,l.createElement)("ul",null,d&&d.map((e=>(0,l.createElement)("li",{key:e.url},(0,l.createElement)(_,{...e,followLinks:p}))))),g>1&&(0,l.createElement)(b,{page:S,perPage:t,total:h,pageClick:C,nextLabel:P,prevLabel:O,compact:"is-style-compact"===c}))}function _({name:e,icon:t,url:a,preferredUsername:r,followLinks:n=!0}){const i=`@${r}`,c={};return n||(c.onClick=e=>e.preventDefault()),(0,l.createElement)(o.ExternalLink,{className:"activitypub-link",href:a,title:i,...c},(0,l.createElement)("img",{width:"40",height:"40",src:t.url,className:"avatar activitypub-avatar",alt:e}),(0,l.createElement)("span",{className:"activitypub-actor"},(0,l.createElement)("strong",{className:"activitypub-name"},e),(0,l.createElement)("span",{className:"sep"},"/"),(0,l.createElement)("span",{className:"activitypub-handle"},i)))}const k=window.wp.data,h=window._activityPubOptions?.enabled;(0,e.registerBlockType)("activitypub/followers",{edit:function({attributes:e,setAttributes:t}){const{order:a,per_page:r,selectedUser:n,title:p}=e,u=(0,c.useBlockProps)(),[v,m]=(0,i.useState)(1),w=[{label:(0,s.__)("New to old","activitypub"),value:"desc"},{label:(0,s.__)("Old to new","activitypub"),value:"asc"}],d=function(){const e=h?.users?(0,k.useSelect)((e=>e("core").getUsers({who:"authors"}))):[];return(0,i.useMemo)((()=>{if(!e)return[];const t=h?.site?[{label:(0,s.__)("Whole Site","activitypub"),value:"site"}]:[];return e.reduce(((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e)),t)}),[e])}(),f=e=>a=>{m(1),t({[e]:a})};return(0,i.useEffect)((()=>{d.length&&(d.find((({value:e})=>e===n))||t({selectedUser:d[0].value}))}),[n,d]),(0,l.createElement)("div",{...u},(0,l.createElement)(c.InspectorControls,{key:"setting"},(0,l.createElement)(o.PanelBody,{title:(0,s.__)("Followers Options","activitypub")},(0,l.createElement)(o.TextControl,{label:(0,s.__)("Title","activitypub"),help:(0,s.__)("Title to display above the list of followers. Blank for none.","activitypub"),value:p,onChange:e=>t({title:e})}),d.length>1&&(0,l.createElement)(o.SelectControl,{label:(0,s.__)("Select User","activitypub"),value:n,options:d,onChange:f("selectedUser")}),(0,l.createElement)(o.SelectControl,{label:(0,s.__)("Sort","activitypub"),value:a,options:w,onChange:f("order")}),(0,l.createElement)(o.RangeControl,{label:(0,s.__)("Number of Followers","activitypub"),value:r,onChange:f("per_page"),min:1,max:10}))),(0,l.createElement)(g,{...e,page:v,setPage:m,followLinks:!1}))},save:()=>null,icon:n})})()})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/style-view-rtl.css b/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/style-view-rtl.css deleted file mode 100644 index d6e565ff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/style-view-rtl.css +++ /dev/null @@ -1 +0,0 @@ -.activitypub-follower-block.is-style-compact .activitypub-handle,.activitypub-follower-block.is-style-compact .sep{display:none}.activitypub-follower-block.is-style-with-lines ul li{border-bottom:.5px solid;margin-bottom:.5rem;padding-bottom:.5rem}.activitypub-follower-block.is-style-with-lines ul li:last-child{border-bottom:none}.activitypub-follower-block.is-style-with-lines .activitypub-handle,.activitypub-follower-block.is-style-with-lines .activitypub-name{text-decoration:none}.activitypub-follower-block.is-style-with-lines .activitypub-handle:hover,.activitypub-follower-block.is-style-with-lines .activitypub-name:hover{text-decoration:underline}.activitypub-follower-block ul{margin:0!important;padding:0!important}.activitypub-follower-block li{display:flex;margin-bottom:1rem}.activitypub-follower-block img{border-radius:50%;height:40px;margin-left:var(--wp--preset--spacing--20,.5rem);width:40px}.activitypub-follower-block .activitypub-link{align-items:center;color:inherit!important;display:flex;flex-flow:row nowrap;max-width:100%;text-decoration:none!important}.activitypub-follower-block .activitypub-handle,.activitypub-follower-block .activitypub-name{text-decoration:underline;text-decoration-thickness:.8px;text-underline-position:under}.activitypub-follower-block .activitypub-handle:hover,.activitypub-follower-block .activitypub-name:hover{text-decoration:none}.activitypub-follower-block .activitypub-name{font-size:var(--wp--preset--font-size--normal,16px)}.activitypub-follower-block .activitypub-actor{font-size:var(--wp--preset--font-size--small,13px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follower-block .sep{padding:0 .2rem}.activitypub-follower-block .wp-block-query-pagination{margin-top:1.5rem}.activitypub-follower-block .activitypub-pager{cursor:default}.activitypub-follower-block .activitypub-pager.current{opacity:.33}.activitypub-follower-block .page-numbers{padding:0 .2rem}.activitypub-follower-block .page-numbers.current{font-weight:700;opacity:1} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/style-view.css b/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/style-view.css deleted file mode 100644 index 824879e9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/style-view.css +++ /dev/null @@ -1 +0,0 @@ -.activitypub-follower-block.is-style-compact .activitypub-handle,.activitypub-follower-block.is-style-compact .sep{display:none}.activitypub-follower-block.is-style-with-lines ul li{border-bottom:.5px solid;margin-bottom:.5rem;padding-bottom:.5rem}.activitypub-follower-block.is-style-with-lines ul li:last-child{border-bottom:none}.activitypub-follower-block.is-style-with-lines .activitypub-handle,.activitypub-follower-block.is-style-with-lines .activitypub-name{text-decoration:none}.activitypub-follower-block.is-style-with-lines .activitypub-handle:hover,.activitypub-follower-block.is-style-with-lines .activitypub-name:hover{text-decoration:underline}.activitypub-follower-block ul{margin:0!important;padding:0!important}.activitypub-follower-block li{display:flex;margin-bottom:1rem}.activitypub-follower-block img{border-radius:50%;height:40px;margin-right:var(--wp--preset--spacing--20,.5rem);width:40px}.activitypub-follower-block .activitypub-link{align-items:center;color:inherit!important;display:flex;flex-flow:row nowrap;max-width:100%;text-decoration:none!important}.activitypub-follower-block .activitypub-handle,.activitypub-follower-block .activitypub-name{text-decoration:underline;text-decoration-thickness:.8px;text-underline-position:under}.activitypub-follower-block .activitypub-handle:hover,.activitypub-follower-block .activitypub-name:hover{text-decoration:none}.activitypub-follower-block .activitypub-name{font-size:var(--wp--preset--font-size--normal,16px)}.activitypub-follower-block .activitypub-actor{font-size:var(--wp--preset--font-size--small,13px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follower-block .sep{padding:0 .2rem}.activitypub-follower-block .wp-block-query-pagination{margin-top:1.5rem}.activitypub-follower-block .activitypub-pager{cursor:default}.activitypub-follower-block .activitypub-pager.current{opacity:.33}.activitypub-follower-block .page-numbers{padding:0 .2rem}.activitypub-follower-block .page-numbers.current{font-weight:700;opacity:1} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/view.asset.php b/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/view.asset.php deleted file mode 100644 index 4e64279d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/view.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '111b88843c05346aadbf'); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/view.js b/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/view.js deleted file mode 100644 index e9a5792a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/followers/view.js +++ /dev/null @@ -1,3 +0,0 @@ -(()=>{var e,t={250:(e,t,a)=>{"use strict";const r=window.React,n=window.wp.apiFetch;var l=a.n(n);const o=window.wp.url,i=window.wp.element,c=window.wp.i18n;var s=a(942),p=a.n(s);function u({active:e,children:t,page:a,pageClick:n,className:l}){const o=p()("wp-block activitypub-pager",l,{current:e});return(0,r.createElement)("a",{className:o,onClick:t=>{t.preventDefault(),!e&&n(a)}},t)}const m={outlined:"outlined",minimal:"minimal"};function f({compact:e,nextLabel:t,page:a,pageClick:n,perPage:l,prevLabel:o,total:i,variant:c=m.outlined}){const s=((e,t)=>{let a=[1,e-2,e-1,e,e+1,e+2,t];a.sort(((e,t)=>e-t)),a=a.filter(((e,a,r)=>e>=1&&e<=t&&r.lastIndexOf(e)===a));for(let e=a.length-2;e>=0;e--)a[e]===a[e+1]&&a.splice(e+1,1);return a})(a,Math.ceil(i/l)),f=p()("alignwide wp-block-query-pagination is-content-justification-space-between is-layout-flex wp-block-query-pagination-is-layout-flex",`is-${c}`,{"is-compact":e});return(0,r.createElement)("nav",{className:f},o&&(0,r.createElement)(u,{key:"prev",page:a-1,pageClick:n,active:1===a,"aria-label":o,className:"wp-block-query-pagination-previous block-editor-block-list__block"},o),!e&&(0,r.createElement)("div",{className:"block-editor-block-list__block wp-block wp-block-query-pagination-numbers"},s.map((e=>(0,r.createElement)(u,{key:e,page:e,pageClick:n,active:e===a,className:"page-numbers"},e)))),t&&(0,r.createElement)(u,{key:"next",page:a+1,pageClick:n,active:a===Math.ceil(i/l),"aria-label":t,className:"wp-block-query-pagination-next block-editor-block-list__block"},t))}const v=window.wp.components,{namespace:b}=window._activityPubOptions;function d({selectedUser:e,per_page:t,order:a,title:n,page:s,setPage:p,className:u="",followLinks:m=!0,followerData:v=!1}){const d="site"===e?0:e,[g,y]=(0,r.useState)([]),[k,h]=(0,r.useState)(0),[E,N]=(0,r.useState)(0),[x,_]=function(){const[e,t]=(0,r.useState)(1);return[e,t]}(),O=s||x,S=p||_,C=(0,i.createInterpolateElement)(/* translators: arrow for previous followers link */ /* translators: arrow for previous followers link */ -(0,c.__)(" Less","activitypub"),{span:(0,r.createElement)("span",{className:"wp-block-query-pagination-previous-arrow is-arrow-arrow","aria-hidden":"true"})}),L=(0,i.createInterpolateElement)(/* translators: arrow for next followers link */ /* translators: arrow for next followers link */ -(0,c.__)("More ","activitypub"),{span:(0,r.createElement)("span",{className:"wp-block-query-pagination-next-arrow is-arrow-arrow","aria-hidden":"true"})}),q=(e,a)=>{y(e),N(a),h(Math.ceil(a/t))};return(0,r.useEffect)((()=>{if(v&&1===O)return q(v.followers,v.total);const e=function(e,t,a,r){const n=`/${b}/actors/${e}/followers`,l={per_page:t,order:a,page:r,context:"full"};return(0,o.addQueryArgs)(n,l)}(d,t,a,O);l()({path:e}).then((e=>q(e.orderedItems,e.totalItems))).catch((()=>{}))}),[d,t,a,O,v]),(0,r.createElement)("div",{className:"activitypub-follower-block "+u},(0,r.createElement)("h3",null,n),(0,r.createElement)("ul",null,g&&g.map((e=>(0,r.createElement)("li",{key:e.url},(0,r.createElement)(w,{...e,followLinks:m}))))),k>1&&(0,r.createElement)(f,{page:O,perPage:t,total:E,pageClick:S,nextLabel:L,prevLabel:C,compact:"is-style-compact"===u}))}function w({name:e,icon:t,url:a,preferredUsername:n,followLinks:l=!0}){const o=`@${n}`,i={};return l||(i.onClick=e=>e.preventDefault()),(0,r.createElement)(v.ExternalLink,{className:"activitypub-link",href:a,title:o,...i},(0,r.createElement)("img",{width:"40",height:"40",src:t.url,className:"avatar activitypub-avatar",alt:e}),(0,r.createElement)("span",{className:"activitypub-actor"},(0,r.createElement)("strong",{className:"activitypub-name"},e),(0,r.createElement)("span",{className:"sep"},"/"),(0,r.createElement)("span",{className:"activitypub-handle"},o)))}const g=window.wp.domReady;a.n(g)()((()=>{[].forEach.call(document.querySelectorAll(".activitypub-follower-block"),(e=>{const t=JSON.parse(e.dataset.attrs);(0,i.createRoot)(e).render((0,r.createElement)(d,{...t}))}))}))},942:(e,t)=>{var a;!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e="",t=0;t{if(!a){var o=1/0;for(p=0;p=l)&&Object.keys(r.O).every((e=>r.O[e](a[c])))?a.splice(c--,1):(i=!1,l0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[a,n,l]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={996:0,528:0};r.O.j=t=>0===e[t];var t=(t,a)=>{var n,l,[o,i,c]=a,s=0;if(o.some((t=>0!==e[t]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(c)var p=c(r)}for(t&&t(a);sr(250)));n=r.O(n)})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/block.json b/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/block.json deleted file mode 100644 index b7d0b495..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/block.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "name": "activitypub/remote-reply", - "apiVersion": 3, - "version": "1.0.0", - "title": "Reply on the Fediverse", - "category": "widgets", - "description": "", - "textdomain": "activitypub", - "viewScript": "file:./index.js" -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/index.asset.php b/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/index.asset.php deleted file mode 100644 index 6afb3060..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'ab787305c7ed07812b96'); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/index.js b/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/index.js deleted file mode 100644 index a0584f57..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={456:(e,t,r)=>{var o=r(609);const a=window.wp.element,n=window.wp.domReady;var i=r.n(n);const l=window.wp.components,c=window.wp.i18n,s=(0,a.forwardRef)((function({icon:e,size:t=24,...r},o){return(0,a.cloneElement)(e,{width:t,height:t,...r,ref:o})})),m=window.wp.primitives;var p=r(848);const u=(0,p.jsx)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)(m.Path,{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM15.5303 8.46967C15.8232 8.76256 15.8232 9.23744 15.5303 9.53033L13.0607 12L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L12 13.0607L9.53033 15.5303C9.23744 15.8232 8.76256 15.8232 8.46967 15.5303C8.17678 15.2374 8.17678 14.7626 8.46967 14.4697L10.9393 12L8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967C8.76256 8.17678 9.23744 8.17678 9.53033 8.46967L12 10.9393L14.4697 8.46967C14.7626 8.17678 15.2374 8.17678 15.5303 8.46967Z"})}),v=window.wp.apiFetch;var d=r.n(v);const y=(0,p.jsx)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(m.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),_=(0,p.jsx)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(m.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),f=(0,p.jsx)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(m.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"})}),w=window.wp.compose,b="fediverse-remote-user";function h(){const[e,t]=(0,a.useState)(function(){const e=localStorage.getItem(b);return e?JSON.parse(e):{}}()),r=(0,a.useCallback)((e=>{!function(e){localStorage.setItem(b,JSON.stringify(e))}(e),t(e)}),[]),o=(0,a.useCallback)((()=>{localStorage.removeItem(b),t({})}),[]);return{template:e?.template||!1,profileURL:e?.profileURL||!1,setRemoteUser:r,deleteRemoteUser:o}}function g(e){try{return new URL(e),!0}catch(e){return!1}}function E({actionText:e,copyDescription:t,handle:r,resourceUrl:n,myProfile:i=!1,rememberProfile:m=!1}){const p=(0,c.__)("Loading...","activitypub"),u=(0,c.__)("Opening...","activitypub"),v=(0,c.__)("Error","activitypub"),b=(0,c.__)("Invalid","activitypub"),E=i||(0,c.__)("My Profile","activitypub"),[C,R]=(0,a.useState)(e),[x,O]=(0,a.useState)(y),k=(0,w.useCopyToClipboard)(r,(()=>{O(_),setTimeout((()=>O(y)),1e3)})),[L,S]=(0,a.useState)(""),[U,N]=(0,a.useState)(!0),{setRemoteUser:P}=h(),j=(0,a.useCallback)((()=>{let t;if(!g(L)&&!function(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&g(`https://${t[1]}`)}(L))return R(b),t=setTimeout((()=>R(e)),2e3),()=>clearTimeout(t);const r=n+L;R(p),d()({path:r}).then((({url:t,template:r})=>{U&&P({profileURL:L,template:r}),R(u),setTimeout((()=>{window.open(t,"_blank"),R(e)}),200)})).catch((()=>{R(v),setTimeout((()=>R(e)),2e3)}))}),[L]);return(0,o.createElement)("div",{className:"activitypub__dialog"},(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",null,E),(0,o.createElement)("div",{className:"activitypub-dialog__description"},t),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("input",{type:"text",value:r,readOnly:!0}),(0,o.createElement)(l.Button,{ref:k},(0,o.createElement)(s,{icon:x}),(0,c.__)("Copy","activitypub")))),(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",null,(0,c.__)("Your Profile","activitypub")),(0,o.createElement)("div",{className:"activitypub-dialog__description"},(0,a.createInterpolateElement)((0,c.__)("Or, if you know your own profile, we can start things that way! (eg yourusername@example.com)","activitypub"),{code:(0,o.createElement)("code",null)})),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("input",{type:"text",value:L,onKeyDown:e=>{"Enter"===e?.code&&j()},onChange:e=>S(e.target.value)}),(0,o.createElement)(l.Button,{onClick:j},(0,o.createElement)(s,{icon:f}),C)),m&&(0,o.createElement)("div",{className:"activitypub-dialog__remember"},(0,o.createElement)(l.CheckboxControl,{checked:U,label:(0,c.__)("Remember me for easier comments","activitypub"),onChange:()=>{N(!U)}}))))}const{namespace:C}=window._activityPubOptions;function R({selectedComment:e,commentId:t}){const r=(0,c.__)("Reply","activitypub"),a=`/${C}/comments/${t}/remote-reply?resource=`,n=(0,c.__)("Copy and paste the Comment URL into the search field of your favorite fediverse app or server.","activitypub");return(0,o.createElement)(E,{actionText:r,copyDescription:n,handle:e,resourceUrl:a,myProfile:(0,c.__)("Original Comment URL","activitypub"),rememberProfile:!0})}function x({profileURL:e,template:t,commentURL:r,deleteRemoteUser:a}){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(l.Button,{variant:"link",className:"comment-reply-link activitypub-remote-reply__button",onClick:()=>{const e=t.replace("{uri}",r);window.open(e,"_blank")}},(0,c.sprintf)((0,c.__)("Reply as %s","activitypub"),e)),(0,o.createElement)(l.Button,{className:"activitypub-remote-profile-delete",onClick:a,title:(0,c.__)("Delete Remote Profile","activitypub")},(0,o.createElement)(s,{icon:u,size:18})))}function O({selectedComment:e,commentId:t}){const[r,n]=(0,a.useState)(!1),i=(0,c.__)("Remote Reply","activitypub"),{profileURL:s,template:m,deleteRemoteUser:p}=h(),u=s&&m;return(0,o.createElement)(o.Fragment,null,u?(0,o.createElement)(x,{profileURL:s,template:m,commentURL:e,deleteRemoteUser:p}):(0,o.createElement)(l.Button,{variant:"link",className:"comment-reply-link activitypub-remote-reply__button",onClick:()=>n(!0)},(0,c.__)("Reply on the Fediverse","activitypub")),r&&(0,o.createElement)(l.Modal,{className:"activitypub-remote-reply__modal activitypub__modal",onRequestClose:()=>n(!1),title:i},(0,o.createElement)(R,{selectedComment:e,commentId:t})))}let k=1;i()((()=>{[].forEach.call(document.querySelectorAll(".activitypub-remote-reply"),(e=>{const t=JSON.parse(e.dataset.attrs);(0,a.createRoot)(e).render((0,o.createElement)(O,{...t,id:"activitypub-remote-reply-link-"+k++,useId:!0}))}))}))},20:(e,t,r)=>{var o=r(609),a=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,c={},s=null,m=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(m=t.ref),t)n.call(t,o)&&!l.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:a,type:e,key:s,ref:m,props:c,_owner:i.current}}},848:(e,t,r)=>{e.exports=r(20)},609:e=>{e.exports=window.React}},r={};function o(e){var a=r[e];if(void 0!==a)return a.exports;var n=r[e]={exports:{}};return t[e](n,n.exports,o),n.exports}o.m=t,e=[],o.O=(t,r,a,n)=>{if(!r){var i=1/0;for(m=0;m=n)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(l=!1,n0&&e[m-1][2]>n;m--)e[m]=e[m-1];e[m]=[r,a,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={227:0,739:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var a,n,[i,l,c]=r,s=0;if(i.some((t=>0!==e[t]))){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(c)var m=c(o)}for(t&&t(r);so(456)));a=o.O(a)})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/style-index-rtl.css b/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/style-index-rtl.css deleted file mode 100644 index ae34ff03..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/style-index-rtl.css +++ /dev/null @@ -1 +0,0 @@ -.activitypub__modal.components-modal__frame{background-color:#f7f7f7;color:#333}.activitypub__modal.components-modal__frame .components-modal__header-heading,.activitypub__modal.components-modal__frame h4{color:#333;letter-spacing:inherit;word-spacing:inherit}.activitypub__modal.components-modal__frame .components-modal__header .components-button:hover{color:var(--wp--preset--color--white)}.activitypub__dialog{max-width:40em}.activitypub__dialog h4{line-height:1;margin:0}.activitypub__dialog .activitypub-dialog__section{margin-bottom:2em}.activitypub__dialog .activitypub-dialog__remember{margin-top:1em}.activitypub__dialog .activitypub-dialog__description{font-size:var(--wp--preset--font-size--normal,.75rem);margin:.33em 0 1em}.activitypub__dialog .activitypub-dialog__button-group{align-items:flex-end;display:flex;justify-content:flex-end}.activitypub__dialog .activitypub-dialog__button-group svg{height:21px;margin-left:.5em;width:21px}.activitypub__dialog .activitypub-dialog__button-group input{background-color:var(--wp--preset--color--white);border-radius:0 50px 50px 0;border-width:1px;border:1px solid var(--wp--preset--color--black);color:var(--wp--preset--color--black);flex:1;font-size:16px;height:inherit;line-height:1;margin-left:0;padding:15px 23px}.activitypub__dialog .activitypub-dialog__button-group button{align-self:center;background-color:var(--wp--preset--color--black);border-radius:50px 0 0 50px;border-width:1px;color:var(--wp--preset--color--white);font-size:16px;height:inherit;line-height:1;margin-right:0;padding:15px 23px;text-decoration:none}.activitypub__dialog .activitypub-dialog__button-group button:hover{border:inherit}.activitypub-remote-profile-delete{align-self:center;color:inherit;font-size:inherit;height:inherit;padding:0 5px}.activitypub-remote-profile-delete:hover{background:inherit;border:inherit}.activitypub-remote-reply{display:flex} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/style-index.css b/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/style-index.css deleted file mode 100644 index a8a0f412..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/build/remote-reply/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.activitypub__modal.components-modal__frame{background-color:#f7f7f7;color:#333}.activitypub__modal.components-modal__frame .components-modal__header-heading,.activitypub__modal.components-modal__frame h4{color:#333;letter-spacing:inherit;word-spacing:inherit}.activitypub__modal.components-modal__frame .components-modal__header .components-button:hover{color:var(--wp--preset--color--white)}.activitypub__dialog{max-width:40em}.activitypub__dialog h4{line-height:1;margin:0}.activitypub__dialog .activitypub-dialog__section{margin-bottom:2em}.activitypub__dialog .activitypub-dialog__remember{margin-top:1em}.activitypub__dialog .activitypub-dialog__description{font-size:var(--wp--preset--font-size--normal,.75rem);margin:.33em 0 1em}.activitypub__dialog .activitypub-dialog__button-group{align-items:flex-end;display:flex;justify-content:flex-end}.activitypub__dialog .activitypub-dialog__button-group svg{height:21px;margin-right:.5em;width:21px}.activitypub__dialog .activitypub-dialog__button-group input{background-color:var(--wp--preset--color--white);border-radius:50px 0 0 50px;border-width:1px;border:1px solid var(--wp--preset--color--black);color:var(--wp--preset--color--black);flex:1;font-size:16px;height:inherit;line-height:1;margin-right:0;padding:15px 23px}.activitypub__dialog .activitypub-dialog__button-group button{align-self:center;background-color:var(--wp--preset--color--black);border-radius:0 50px 50px 0;border-width:1px;color:var(--wp--preset--color--white);font-size:16px;height:inherit;line-height:1;margin-left:0;padding:15px 23px;text-decoration:none}.activitypub__dialog .activitypub-dialog__button-group button:hover{border:inherit}.activitypub-remote-profile-delete{align-self:center;color:inherit;font-size:inherit;height:inherit;padding:0 5px}.activitypub-remote-profile-delete:hover{background:inherit;border:inherit}.activitypub-remote-reply{display:flex} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-activity.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-activity.php deleted file mode 100644 index fcc35e46..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-activity.php +++ /dev/null @@ -1,191 +0,0 @@ - - * | array - * | Link - */ - protected $actor; - - /** - * The indirect object, or target, of the activity. - * The precise meaning of the target is largely dependent on the - * type of action being described but will often be the object of - * the English preposition "to". - * For instance, in the activity "John added a movie to his - * wishlist", the target of the activity is John's wishlist. - * An activity can have more than one target. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-target - * - * @var string - * | ObjectType - * | array - * | Link - * | array - */ - protected $target; - - /** - * Describes the result of the activity. - * For instance, if a particular action results in the creation of - * a new resource, the result property can be used to describe - * that new resource. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-result - * - * @var string - * | ObjectType - * | Link - * | null - */ - protected $result; - - /** - * An indirect object of the activity from which the - * activity is directed. - * The precise meaning of the origin is the object of the English - * preposition "from". - * For instance, in the activity "John moved an item to List B - * from List A", the origin of the activity is "List A". - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-origin - * - * @var string - * | ObjectType - * | Link - * | null - */ - protected $origin; - - /** - * One or more objects used (or to be used) in the completion of an - * Activity. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-instrument - * - * @var string - * | ObjectType - * | Link - * | null - */ - protected $instrument; - - /** - * Set the object and copy Object properties to the Activity. - * - * Any to, bto, cc, bcc, and audience properties specified on the object - * MUST be copied over to the new Create activity by the server. - * - * @see https://www.w3.org/TR/activitypub/#object-without-create - * - * @param string|Base_Objectr|Link|null $object - * - * @return void - */ - public function set_object( $object ) { - // convert array to object - if ( is_array( $object ) ) { - $object = self::init_from_array( $object ); - } - - // set object - $this->set( 'object', $object ); - - if ( ! is_object( $object ) ) { - return; - } - - foreach ( array( 'to', 'bto', 'cc', 'bcc', 'audience' ) as $i ) { - $this->set( $i, $object->get( $i ) ); - } - - if ( $object->get_published() && ! $this->get_published() ) { - $this->set( 'published', $object->get_published() ); - } - - if ( $object->get_updated() && ! $this->get_updated() ) { - $this->set( 'updated', $object->get_updated() ); - } - - if ( $object->get_attributed_to() && ! $this->get_actor() ) { - $this->set( 'actor', $object->get_attributed_to() ); - } - - if ( $object->get_id() && ! $this->get_id() ) { - $id = strtok( $object->get_id(), '#' ); - if ( $object->get_updated() ) { - $updated = $object->get_updated(); - } else { - $updated = $object->get_published(); - } - $this->set( 'id', $id . '#activity-' . strtolower( $this->get_type() ) . '-' . $updated ); - } - } - - /** - * The context of an Activity is usually just the context of the object it contains. - * - * @return array $context A compacted JSON-LD context. - */ - public function get_json_ld_context() { - if ( $this->object instanceof Base_Object ) { - $class = get_class( $this->object ); - if ( $class && $class::JSON_LD_CONTEXT ) { - // Without php 5.6 support this could be just: 'return $this->object::JSON_LD_CONTEXT;' - return $class::JSON_LD_CONTEXT; - } - } - - return static::JSON_LD_CONTEXT; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-actor.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-actor.php deleted file mode 100644 index 64631888..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-actor.php +++ /dev/null @@ -1,174 +0,0 @@ - 'http://schema.org#', - 'toot' => 'http://joinmastodon.org/ns#', - 'webfinger' => 'https://webfinger.net/#', - 'lemmy' => 'https://join-lemmy.org/ns#', - 'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers', - 'PropertyValue' => 'schema:PropertyValue', - 'value' => 'schema:value', - 'Hashtag' => 'as:Hashtag', - 'featured' => array( - '@id' => 'toot:featured', - '@type' => '@id', - ), - 'featuredTags' => array( - '@id' => 'toot:featuredTags', - '@type' => '@id', - ), - 'moderators' => array( - '@id' => 'lemmy:moderators', - '@type' => '@id', - ), - 'postingRestrictedToMods' => 'lemmy:postingRestrictedToMods', - 'discoverable' => 'toot:discoverable', - 'indexable' => 'toot:indexable', - 'resource' => 'webfinger:resource', - ), - ); - - /** - * @var string - */ - protected $type; - - /** - * A reference to an ActivityStreams OrderedCollection comprised of - * all the messages received by the actor. - * - * @see https://www.w3.org/TR/activitypub/#inbox - * - * @var string - * | null - */ - protected $inbox; - - /** - * A reference to an ActivityStreams OrderedCollection comprised of - * all the messages produced by the actor. - * - * @see https://www.w3.org/TR/activitypub/#outbox - * - * @var string - * | null - */ - protected $outbox; - - /** - * A link to an ActivityStreams collection of the actors that this - * actor is following. - * - * @see https://www.w3.org/TR/activitypub/#following - * - * @var string - */ - protected $following; - - /** - * A link to an ActivityStreams collection of the actors that - * follow this actor. - * - * @see https://www.w3.org/TR/activitypub/#followers - * - * @var string - */ - protected $followers; - - /** - * A link to an ActivityStreams collection of objects this actor has - * liked. - * - * @see https://www.w3.org/TR/activitypub/#liked - * - * @var string - */ - protected $liked; - - /** - * A list of supplementary Collections which may be of interest. - * - * @see https://www.w3.org/TR/activitypub/#streams-property - * - * @var array - */ - protected $streams = array(); - - /** - * A short username which may be used to refer to the actor, with no - * uniqueness guarantees. - * - * @see https://www.w3.org/TR/activitypub/#preferredUsername - * - * @var string|null - */ - protected $preferred_username; - - /** - * A JSON object which maps additional typically server/domain-wide - * endpoints which may be useful either for this actor or someone - * referencing this actor. This mapping may be nested inside the - * actor document as the value or may be a link to a JSON-LD - * document with these properties. - * - * @see https://www.w3.org/TR/activitypub/#endpoints - * - * @var string|array|null - */ - protected $endpoints; - - /** - * It's not part of the ActivityPub protocol but it's a quite common - * practice to handle an actor public key with a publicKey array: - * [ - * 'id' => 'https://my-example.com/actor#main-key' - * 'owner' => 'https://my-example.com/actor', - * 'publicKeyPem' => '-----BEGIN PUBLIC KEY----- - * MIIBI [...] - * DQIDAQAB - * -----END PUBLIC KEY-----' - * ] - * - * @see https://www.w3.org/wiki/SocialCG/ActivityPub/Authentication_Authorization#Signing_requests_using_HTTP_Signatures - * - * @var string|array|null - */ - protected $public_key; - - /** - * It's not part of the ActivityPub protocol but it's a quite common - * practice to lock an account. If anabled, new followers will not be - * automatically accepted, but will instead require you to manually - * approve them. - * - * WordPress does only support 'false' at the moment. - * - * @see https://docs.joinmastodon.org/spec/activitypub/#as - * - * @context as:manuallyApprovesFollowers - * - * @var boolean - */ - protected $manually_approves_followers = false; -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-base-object.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-base-object.php deleted file mode 100644 index 9a5cd3f8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/class-base-object.php +++ /dev/null @@ -1,714 +0,0 @@ - 'as:Hashtag', - ), - ); - - /** - * The object's unique global identifier - * - * @see https://www.w3.org/TR/activitypub/#obj-id - * - * @var string - */ - protected $id; - - /** - * @var string - */ - protected $type = 'Object'; - - /** - * A resource attached or related to an object that potentially - * requires special handling. - * The intent is to provide a model that is at least semantically - * similar to attachments in email. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $attachment; - - /** - * One or more entities to which this object is attributed. - * The attributed entities might not be Actors. For instance, an - * object might be attributed to the completion of another activity. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attributedto - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $attributed_to; - - /** - * One or more entities that represent the total population of - * entities for which the object can considered to be relevant. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audience - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $audience; - - /** - * The content or textual representation of the Object encoded as a - * JSON string. By default, the value of content is HTML. - * The mediaType property can be used in the object to indicate a - * different content type. - * - * The content MAY be expressed using multiple language-tagged - * values. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content - * - * @var string|null - */ - protected $content; - - /** - * The context within which the object exists or an activity was - * performed. - * The notion of "context" used is intentionally vague. - * The intended function is to serve as a means of grouping objects - * and activities that share a common originating context or - * purpose. An example could be all activities relating to a common - * project or event. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-context - * - * @var string - * | ObjectType - * | Link - * | null - */ - protected $context; - - /** - * The content MAY be expressed using multiple language-tagged - * values. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content - * - * @var array|null - */ - protected $content_map; - - /** - * A simple, human-readable, plain-text name for the object. - * HTML markup MUST NOT be included. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name - * - * @var string|null xsd:string - */ - protected $name; - - /** - * The name MAY be expressed using multiple language-tagged values. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name - * - * @var array|null rdf:langString - */ - protected $name_map; - - /** - * The date and time describing the actual or expected ending time - * of the object. - * When used with an Activity object, for instance, the endTime - * property specifies the moment the activity concluded or - * is expected to conclude. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-endtime - * - * @var string|null - */ - protected $end_time; - - /** - * The entity (e.g. an application) that generated the object. - * - * @var string|null - */ - protected $generator; - - /** - * An entity that describes an icon for this object. - * The image should have an aspect ratio of one (horizontal) - * to one (vertical) and should be suitable for presentation - * at a small size. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-icon - * - * @var string - * | Image - * | Link - * | array - * | array - * | null - */ - protected $icon; - - /** - * An entity that describes an image for this object. - * Unlike the icon property, there are no aspect ratio - * or display size limitations assumed. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-image-term - * - * @var string - * | Image - * | Link - * | array - * | array - * | null - */ - protected $image; - - /** - * One or more entities for which this object is considered a - * response. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-inreplyto - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $in_reply_to; - - /** - * One or more physical or logical locations associated with the - * object. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-location - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $location; - - /** - * An entity that provides a preview of this object. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-preview - * - * @var string - * | ObjectType - * | Link - * | null - */ - protected $preview; - - /** - * The date and time at which the object was published - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-published - * - * @var string|null xsd:dateTime - */ - protected $published; - - /** - * The date and time describing the actual or expected starting time - * of the object. - * When used with an Activity object, for instance, the startTime - * property specifies the moment the activity began - * or is scheduled to begin. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-starttime - * - * @var string|null xsd:dateTime - */ - protected $start_time; - - /** - * A natural language summarization of the object encoded as HTML. - * Multiple language tagged summaries MAY be provided. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-summary - * - * @var string - * | ObjectType - * | Link - * | null - */ - protected $summary; - - /** - * The content MAY be expressed using multiple language-tagged - * values. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-summary - * - * @var array|null - */ - protected $summary_map; - - /** - * One or more "tags" that have been associated with an objects. - * A tag can be any kind of Object. - * The key difference between attachment and tag is that the former - * implies association by inclusion, while the latter implies - * associated by reference. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tag - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $tag; - - /** - * The date and time at which the object was updated - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-updated - * - * @var string|null xsd:dateTime - */ - protected $updated; - - /** - * One or more links to representations of the object. - * - * @var string - * | array - * | Link - * | array - * | null - */ - protected $url; - - /** - * An entity considered to be part of the public primary audience - * of an Object - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $to; - - /** - * An Object that is part of the private primary audience of this - * Object. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bto - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $bto; - - /** - * An Object that is part of the public secondary audience of this - * Object. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-cc - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $cc; - - /** - * One or more Objects that are part of the private secondary - * audience of this Object. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bcc - * - * @var string - * | ObjectType - * | Link - * | array - * | array - * | null - */ - protected $bcc; - - /** - * The MIME media type of the value of the content property. - * If not specified, the content property is assumed to contain - * text/html content. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-mediatype - * - * @var string|null - */ - protected $media_type; - - /** - * When the object describes a time-bound resource, such as an audio - * or video, a meeting, etc, the duration property indicates the - * object's approximate duration. - * The value MUST be expressed as an xsd:duration as defined by - * xmlschema11-2, section 3.3.6 (e.g. a period of 5 seconds is - * represented as "PT5S"). - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration - * - * @var string|null - */ - protected $duration; - - /** - * Intended to convey some sort of source from which the content - * markup was derived, as a form of provenance, or to support - * future editing by clients. - * - * @see https://www.w3.org/TR/activitypub/#source-property - * - * @var ObjectType - */ - protected $source; - - /** - * A Collection containing objects considered to be responses to - * this object. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-replies - * - * @var string - * | Collection - * | Link - * | null - */ - protected $replies; - - /** - * Magic function to implement getter and setter - * - * @param string $method The method name. - * @param string $params The method params. - * - * @return void - */ - public function __call( $method, $params ) { - $var = \strtolower( \substr( $method, 4 ) ); - - if ( \strncasecmp( $method, 'get', 3 ) === 0 ) { - if ( ! $this->has( $var ) ) { - return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) ); - } - - return $this->$var; - } - - if ( \strncasecmp( $method, 'set', 3 ) === 0 ) { - return $this->set( $var, $params[0] ); - } - - if ( \strncasecmp( $method, 'add', 3 ) === 0 ) { - $this->add( $var, $params[0] ); - } - } - - /** - * Magic function, to transform the object to string. - * - * @return string The object id. - */ - public function __toString() { - return $this->to_string(); - } - - /** - * Function to transform the object to string. - * - * @return string The object id. - */ - public function to_string() { - return $this->get_id(); - } - - /** - * Generic getter. - * - * @param string $key The key to get. - * - * @return mixed The value. - */ - public function get( $key ) { - if ( ! $this->has( $key ) ) { - return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) ); - } - - return call_user_func( array( $this, 'get_' . $key ) ); - } - - /** - * Check if the object has a key - * - * @param string $key The key to check. - * - * @return boolean True if the object has the key. - */ - public function has( $key ) { - return property_exists( $this, $key ); - } - - /** - * Generic setter. - * - * @param string $key The key to set. - * @param string $value The value to set. - * - * @return mixed The value. - */ - public function set( $key, $value ) { - if ( ! $this->has( $key ) ) { - return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) ); - } - - $this->$key = $value; - - return $this; - } - - /** - * Generic adder. - * - * @param string $key The key to set. - * @param mixed $value The value to add. - * - * @return mixed The value. - */ - public function add( $key, $value ) { - if ( ! $this->has( $key ) ) { - return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) ); - } - - if ( ! isset( $this->$key ) ) { - $this->$key = array(); - } - - $attributes = $this->$key; - $attributes[] = $value; - - $this->$key = $attributes; - - return $this->$key; - } - - /** - * Convert JSON input to an array. - * - * @return string The JSON string. - * - * @return \Activitypub\Activity\Base_Object An Object built from the JSON string. - */ - public static function init_from_json( $json ) { - $array = \json_decode( $json, true ); - - if ( ! is_array( $array ) ) { - $array = array(); - } - - return self::init_from_array( $array ); - } - - /** - * Convert JSON input to an array. - * - * @return string The object array. - * - * @return \Activitypub\Activity\Base_Object An Object built from the JSON string. - */ - public static function init_from_array( $array ) { - if ( ! is_array( $array ) ) { - return new WP_Error( 'invalid_array', __( 'Invalid array', 'activitypub' ), array( 'status' => 404 ) ); - } - - $object = new static(); - - foreach ( $array as $key => $value ) { - $key = camel_to_snake_case( $key ); - call_user_func( array( $object, 'set_' . $key ), $value ); - } - - return $object; - } - - /** - * Convert JSON input to an array and pre-fill the object. - * - * @param string $json The JSON string. - */ - public function from_json( $json ) { - $array = \json_decode( $json, true ); - - $this->from_array( $array ); - } - - /** - * Convert JSON input to an array and pre-fill the object. - * - * @param array $array The array. - */ - public function from_array( $array ) { - foreach ( $array as $key => $value ) { - if ( $value ) { - $key = camel_to_snake_case( $key ); - call_user_func( array( $this, 'set_' . $key ), $value ); - } - } - } - - /** - * Convert Object to an array. - * - * It tries to get the object attributes if they exist - * and falls back to the getters. Empty values are ignored. - * - * @param bool $include_json_ld_context Whether to include the JSON-LD context. Default true. - * - * @return array An array built from the Object. - */ - public function to_array( $include_json_ld_context = true ) { - $array = array(); - $vars = get_object_vars( $this ); - - foreach ( $vars as $key => $value ) { - // ignotre all _prefixed keys. - if ( '_' === substr( $key, 0, 1 ) ) { - continue; - } - - // if value is empty, try to get it from a getter. - if ( ! $value ) { - $value = call_user_func( array( $this, 'get_' . $key ) ); - } - - if ( is_object( $value ) ) { - $value = $value->to_array( false ); - } - - // if value is still empty, ignore it for the array and continue. - if ( isset( $value ) ) { - $array[ snake_to_camel_case( $key ) ] = $value; - } - } - - if ( $include_json_ld_context ) { - // Get JsonLD context and move it to '@context' at the top. - $array = array_merge( array( '@context' => $this->get_json_ld_context() ), $array ); - } - - $class = new ReflectionClass( $this ); - $class = strtolower( $class->getShortName() ); - - $array = \apply_filters( 'activitypub_activity_object_array', $array, $class, $this->id, $this ); - $array = \apply_filters( "activitypub_activity_{$class}_object_array", $array, $this->id, $this ); - - return $array; - } - - /** - * Convert Object to JSON. - * - * @param bool $include_json_ld_context Whether to include the JSON-LD context. Default true. - * - * @return string The JSON string. - */ - public function to_json( $include_json_ld_context = true ) { - $array = $this->to_array( $include_json_ld_context ); - $options = \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT; - - /* - * Options to be passed to json_encode() - * - * @param int $options The current options flags - */ - $options = \apply_filters( 'activitypub_json_encode_options', $options ); - - return \wp_json_encode( $array, $options ); - } - - /** - * Returns the keys of the object vars. - * - * @return array The keys of the object vars. - */ - public function get_object_var_keys() { - return \array_keys( \get_object_vars( $this ) ); - } - - /** - * Returns the JSON-LD context of this object. - * - * @return array $context A compacted JSON-LD context for the ActivityPub object. - */ - public function get_json_ld_context() { - return static::JSON_LD_CONTEXT; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/extended-object/class-event.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/extended-object/class-event.php deleted file mode 100644 index b0adb84f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/extended-object/class-event.php +++ /dev/null @@ -1,340 +0,0 @@ - 'https://joinpeertube.org/ns#', - 'mz' => 'https://joinmobilizon.org/ns#', - 'status' => 'http://www.w3.org/2002/12/cal/ical#status', - 'commentsEnabled' => 'pt:commentsEnabled', - 'isOnline' => 'mz:isOnline', - 'timezone' => 'mz:timezone', - 'participantCount' => 'mz:participantCount', - 'anonymousParticipationEnabled' => 'mz:anonymousParticipationEnabled', - 'joinMode' => array( - '@id' => 'mz:joinMode', - '@type' => 'mz:joinModeType', - ), - 'externalParticipationUrl' => array( - '@id' => 'mz:externalParticipationUrl', - '@type' => 'schema:URL', - ), - 'repliesModerationOption' => array( - '@id' => 'mz:repliesModerationOption', - '@type' => '@vocab', - ), - 'contacts' => array( - '@id' => 'mz:contacts', - '@type' => '@id', - ), - ), - ); - - /** - * Mobilizon compatible values for repliesModertaionOption. - * @var array - */ - const REPLIES_MODERATION_OPTION_TYPES = array( 'allow_all', 'closed' ); - - /** - * Mobilizon compatible values for joinModeTypes. - */ - const JOIN_MODE_TYPES = array( 'free', 'restricted', 'external' ); // and 'invite', but not used by mobilizon atm - - /** - * Allowed values for ical VEVENT STATUS. - * @var array - */ - const ICAL_EVENT_STATUS_TYPES = array( 'TENTATIVE', 'CONFIRMED', 'CANCELLED' ); - - /** - * Default event categories. - * - * These values currently reflect the default set as proposed by Mobilizon to maximize interoperability. - * @var array - */ - const DEFAULT_EVENT_CATEGORIES = array( - 'ARTS', - 'BOOK_CLUBS', - 'BUSINESS', - 'CAUSES', - 'COMEDY', - 'CRAFTS', - 'FOOD_DRINK', - 'HEALTH', - 'MUSIC', - 'AUTO_BOAT_AIR', - 'COMMUNITY', - 'FAMILY_EDUCATION', - 'FASHION_BEAUTY', - 'FILM_MEDIA', - 'GAMES', - 'LANGUAGE_CULTURE', - 'LEARNING', - 'LGBTQ', - 'MOVEMENTS_POLITICS', - 'NETWORKING', - 'PARTY', - 'PERFORMING_VISUAL_ARTS', - 'PETS', - 'PHOTOGRAPHY', - 'OUTDOORS_ADVENTURE', - 'SPIRITUALITY_RELIGION_BELIEFS', - 'SCIENCE_TECH', - 'SPORTS', - 'THEATRE', - 'MEETING', // Default value. - ); - - /** - * Event is an implementation of one of the - * Activity Streams - * - * @var string - */ - protected $type = 'Event'; - - /** - * The Title of the event. - */ - protected $name; - - /** - * The events contacts - * - * @context { - * '@id' => 'mz:contacts', - * '@type' => '@id', - * } - * - * @var array Array of contacts (ActivityPub actor IDs). - */ - protected $contacts; - - /** - * Extension invented by PeerTube whether comments/replies are - * Mobilizon also implemented this as a fallback to their own - * repliesModerationOption. - * - * @see https://docs.joinpeertube.org/api/activitypub#video - * @see https://docs.joinmobilizon.org/contribute/activity_pub/ - * @var bool|null - */ - protected $comments_enabled; - - /** - * @context https://joinmobilizon.org/ns#timezone - * @var string - */ - protected $timezone; - - /** - * @context https://joinmobilizon.org/ns#repliesModerationOption - * @see https://docs.joinmobilizon.org/contribute/activity_pub/#repliesmoderation - * @var string - */ - protected $replies_moderation_option; - - /** - * @context https://joinmobilizon.org/ns#anonymousParticipationEnabled - * @see https://docs.joinmobilizon.org/contribute/activity_pub/#anonymousparticipationenabled - * @var bool - */ - protected $anonymous_participation_enabled; - - /** - * @context https://schema.org/category - * @var enum - */ - protected $category; - - /** - * @context https://schema.org/inLanguage - * @var - */ - protected $in_language; - - /** - * @context https://joinmobilizon.org/ns#isOnline - * @var bool - */ - protected $is_online; - - /** - * @context https://www.w3.org/2002/12/cal/ical#status - * @var enum - */ - protected $status; - - /** - * Which actor created the event. - * - * This field is needed due to the current group structure of Mobilizon. - * - * @todo this seems to not be a default property of an Object but needed by mobilizon. - * @var string - */ - protected $actor; - - /** - * @context https://joinmobilizon.org/ns#externalParticipationUrl - * @var string - */ - protected $external_participation_url; - - /** - * @context https://joinmobilizon.org/ns#joinMode - * @see https://docs.joinmobilizon.org/contribute/activity_pub/#joinmode - * @var - */ - protected $join_mode; - - /** - * @context https://joinmobilizon.org/ns#participantCount - * @var int - */ - protected $participant_count; - - /** - * @context https://schema.org/maximumAttendeeCapacity - * @see https://docs.joinmobilizon.org/contribute/activity_pub/#maximumattendeecapacity - * @var int - */ - protected $maximum_attendee_capacity; - - /** - * @context https://schema.org/remainingAttendeeCapacity - * @see https://docs.joinmobilizon.org/contribute/activity_pub/#remainignattendeecapacity - * @var int - */ - protected $remaining_attendee_capacity; - - /** - * Setter for the timezone. - * - * The passed timezone is only set when it is a valid one, otherwise the site's timezone is used. - * - * @param string $timezone The timezone string to be set, e.g. 'Europe/Berlin'. - */ - public function set_timezone( $timezone ) { - if ( in_array( $timezone, timezone_identifiers_list(), true ) ) { - $this->timezone = $timezone; - } else { - $this->timezone = wp_timezone_string(); - } - - return $this; - } - - /** - * Custom setter for repliesModerationOption which also directy sets commentsEnabled accordingly. - * - * @param string $type - */ - public function set_replies_moderation_option( $type ) { - if ( in_array( $type, self::REPLIES_MODERATION_OPTION_TYPES, true ) ) { - $this->replies_moderation_option = $type; - $this->comments_enabled = ( 'allow_all' === $type ) ? true : false; - } else { - _doing_it_wrong( - __METHOD__, - 'The replies moderation option must be either allow_all or closed.', - '' - ); - } - - return $this; - } - - /** - * Custom setter for commentsEnabled which also directly sets repliesModerationOption accordingly. - * - * @param bool $comments_enabled - */ - public function set_comments_enabled( $comments_enabled ) { - if ( is_bool( $comments_enabled ) ) { - $this->comments_enabled = $comments_enabled; - $this->replies_moderation_option = $comments_enabled ? 'allow_all' : 'closed'; - } else { - _doing_it_wrong( - __METHOD__, - 'The commentsEnabled must be boolean.', - '' - ); - } - - return $this; - } - - /** - * Custom setter for the ical status that checks whether the status is an ical event status. - * - * @param string $status - */ - public function set_status( $status ) { - if ( in_array( $status, self::ICAL_EVENT_STATUS_TYPES, true ) ) { - $this->status = $status; - } else { - _doing_it_wrong( - __METHOD__, - 'The status of the event must be a VEVENT iCal status.', - '' - ); - } - - return $this; - } - - /** - * Custom setter for the event category. - * - * Falls back to Mobilizons default category. - * - * @param string $category - * @param bool $mobilizon_compatibilty Whether the category must be compatibly with Mobilizon. - */ - public function set_category( $category, $mobilizon_compatibilty = true ) { - if ( $mobilizon_compatibilty ) { - $this->category = in_array( $category, self::DEFAULT_EVENT_CATEGORIES, true ) ? $category : 'MEETING'; - } else { - $this->category = $category; - } - - return $this; - } - - /** - * Custom setter for an external participation url. - * - * Automatically sets the joinMode to true if called. - * - * @param string $url - */ - public function set_external_participation_url( $url ) { - if ( preg_match( '/^https?:\/\/.*/i', $url ) ) { - $this->external_participation_url = $url; - $this->join_mode = 'external'; - } - - return $this; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/extended-object/class-place.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/extended-object/class-place.php deleted file mode 100644 index f84013df..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/activity/extended-object/class-place.php +++ /dev/null @@ -1,93 +0,0 @@ -= 0.0f, <= 100.0f] - */ - protected $accuracy; - - /** - * Indicates the altitude of a place. The measurement units is indicated using the units property. - * If units is not specified, the default is assumed to be "m" indicating meters. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-altitude - * @var float xsd:float - */ - protected $altitude; - - /** - * The latitude of a place. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-latitude - * @var float xsd:float - */ - protected $latitude; - - /** - * The longitude of a place. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-longitude - * @var float xsd:float - */ - protected $longitude; - - /** - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-radius - * @var float - */ - protected $radius; - - /** - * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-units - * @var string - */ - protected $units; - - /** - * @var Postal_Address|string - */ - protected $address; - - public function set_address( $address ) { - if ( is_string( $address ) || is_array( $address ) ) { - $this->address = $address; - } else { - _doing_it_wrong( - __METHOD__, - 'The address must be either a string or an array like schema.org/PostalAddress.', - '' - ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activity-dispatcher.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activity-dispatcher.php deleted file mode 100644 index 32c91a7b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activity-dispatcher.php +++ /dev/null @@ -1,238 +0,0 @@ -change_wp_user_id( $user_id ); - } - - $user_id = $transformer->get_wp_user_id(); - - if ( is_user_disabled( $user_id ) ) { - return; - } - - $activity = $transformer->to_activity( $type ); - - self::send_activity_to_followers( $activity, $user_id, $wp_object ); - } - - /** - * Send Announces to followers and mentioned users. - * - * @param mixed $wp_object The ActivityPub Post. - * @param string $type The Activity-Type. - * - * @return void - */ - public static function send_announce( $wp_object, $type ) { - if ( ! in_array( $type, array( 'Create', 'Update', 'Delete' ), true ) ) { - return; - } - - if ( is_user_disabled( Users::BLOG_USER_ID ) ) { - return; - } - - $transformer = Factory::get_transformer( $wp_object ); - - if ( \is_wp_error( $transformer ) ) { - return; - } - - $user_id = Users::BLOG_USER_ID; - $activity = $transformer->to_activity( $type ); - $user = Users::get_by_id( Users::BLOG_USER_ID ); - - $announce = new Activity(); - $announce->set_type( 'Announce' ); - $announce->set_object( $activity ); - $announce->set_actor( $user->get_id() ); - - self::send_activity_to_followers( $announce, $user_id, $wp_object ); - } - - /** - * Send a "Update" Activity when a user updates their profile. - * - * @param int $user_id The user ID to send an update for. - * - * @return void - */ - public static function send_profile_update( $user_id ) { - $user = Users::get_by_various( $user_id ); - - // bail if that's not a good user - if ( is_wp_error( $user ) ) { - return; - } - - // build the update - $activity = new Activity(); - $activity->set_id( $user->get_url() . '#update' ); - $activity->set_type( 'Update' ); - $activity->set_actor( $user->get_url() ); - $activity->set_object( $user->get_url() ); - $activity->set_to( 'https://www.w3.org/ns/activitystreams#Public' ); - - // send the update - self::send_activity_to_followers( $activity, $user_id, $user ); - } - - /** - * Send an Activity to all followers and mentioned users. - * - * @param Activity $activity The ActivityPub Activity. - * @param int $user_id The user ID. - * @param WP_User|WP_Post|WP_Comment $wp_object The WordPress object. - * - * @return void - */ - private static function send_activity_to_followers( $activity, $user_id, $wp_object ) { - // check if the Activity should be send to the followers - if ( ! apply_filters( 'activitypub_send_activity_to_followers', true, $activity, $user_id, $wp_object ) ) { - return; - } - - $follower_inboxes = Followers::get_inboxes( $user_id ); - - $mentioned_inboxes = array(); - $cc = $activity->get_cc(); - if ( $cc ) { - $mentioned_inboxes = Mention::get_inboxes( $cc ); - } - - $inboxes = array_merge( $follower_inboxes, $mentioned_inboxes ); - $inboxes = array_unique( $inboxes ); - - if ( empty( $inboxes ) ) { - return; - } - - $json = $activity->to_json(); - - foreach ( $inboxes as $inbox ) { - safe_remote_post( $inbox, $json, $user_id ); - } - - set_wp_object_state( $wp_object, 'federated' ); - } - - /** - * Send a "Create" or "Update" Activity for a WordPress Post. - * - * @param int $id The WordPress Post ID. - * @param string $type The Activity-Type. - * - * @return void - */ - public static function send_post( $id, $type ) { - $post = get_post( $id ); - - if ( ! $post ) { - return; - } - - do_action( 'activitypub_send_activity', $post, $type ); - do_action( - sprintf( - 'activitypub_send_%s_activity', - \strtolower( $type ) - ), - $post - ); - } - - /** - * Send a "Create" or "Update" Activity for a WordPress Comment. - * - * @param int $id The WordPress Comment ID. - * @param string $type The Activity-Type. - * - * @return void - */ - public static function send_comment( $id, $type ) { - $comment = get_comment( $id ); - - if ( ! $comment ) { - return; - } - - do_action( 'activitypub_send_activity', $comment, $type ); - do_action( - sprintf( - 'activitypub_send_%s_activity', - \strtolower( $type ) - ), - $comment - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activitypub.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activitypub.php deleted file mode 100644 index 9e5796e9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-activitypub.php +++ /dev/null @@ -1,561 +0,0 @@ -set_404(); - return; - } - - // stop if it's not an ActivityPub comment - if ( is_activitypub_request() && ! is_local_comment( $comment ) ) { - return; - } - - wp_safe_redirect( get_comment_link( $comment ) ); - exit; - } - - /** - * Add the 'activitypub' query variable so WordPress won't mangle it. - */ - public static function add_query_vars( $vars ) { - $vars[] = 'activitypub'; - $vars[] = 'c'; - $vars[] = 'p'; - - return $vars; - } - - /** - * Replaces the default avatar. - * - * @param array $args Arguments passed to get_avatar_data(), after processing. - * @param int|string|object $id_or_email A user ID, email address, or comment object. - * - * @return array $args - */ - public static function pre_get_avatar_data( $args, $id_or_email ) { - if ( - ! $id_or_email instanceof \WP_Comment || - ! isset( $id_or_email->comment_type ) || - $id_or_email->user_id - ) { - return $args; - } - - $allowed_comment_types = \apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); - if ( - ! empty( $id_or_email->comment_type ) && - ! \in_array( - $id_or_email->comment_type, - (array) $allowed_comment_types, - true - ) - ) { - $args['url'] = false; - /** This filter is documented in wp-includes/link-template.php */ - return \apply_filters( 'get_avatar_data', $args, $id_or_email ); - } - - // Check if comment has an avatar. - $avatar = self::get_avatar_url( $id_or_email->comment_ID ); - - if ( $avatar ) { - if ( empty( $args['class'] ) ) { - $args['class'] = array(); - } elseif ( \is_string( $args['class'] ) ) { - $args['class'] = \explode( ' ', $args['class'] ); - } - - $args['url'] = $avatar; - $args['class'][] = 'avatar-activitypub'; - $args['class'][] = 'u-photo'; - $args['class'] = \array_unique( $args['class'] ); - } - - return $args; - } - - /** - * Function to retrieve Avatar URL if stored in meta. - * - * @param int|WP_Comment $comment - * - * @return string $url - */ - public static function get_avatar_url( $comment ) { - if ( \is_numeric( $comment ) ) { - $comment = \get_comment( $comment ); - } - return \get_comment_meta( $comment->comment_ID, 'avatar_url', true ); - } - - /** - * Store permalink in meta, to send delete Activity. - * - * @param string $post_id The Post ID. - * - * @return void - */ - public static function trash_post( $post_id ) { - \add_post_meta( - $post_id, - 'activitypub_canonical_url', - \get_permalink( $post_id ), - true - ); - } - - /** - * Delete permalink from meta - * - * @param string $post_id The Post ID - * - * @return void - */ - public static function untrash_post( $post_id ) { - \delete_post_meta( $post_id, 'activitypub_canonical_url' ); - } - - /** - * Add rewrite rules - */ - public static function add_rewrite_rules() { - // If another system needs to take precedence over the ActivityPub rewrite rules, - // they can define their own and will manually call the appropriate functions as required. - if ( ACTIVITYPUB_DISABLE_REWRITES ) { - return; - } - - if ( ! \class_exists( 'Webfinger' ) ) { - \add_rewrite_rule( - '^.well-known/webfinger', - 'index.php?rest_route=/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger', - 'top' - ); - } - - if ( ! \class_exists( 'Nodeinfo_Endpoint' ) && true === (bool) \get_option( 'blog_public', 1 ) ) { - \add_rewrite_rule( - '^.well-known/nodeinfo', - 'index.php?rest_route=/' . ACTIVITYPUB_REST_NAMESPACE . '/nodeinfo/discovery', - 'top' - ); - \add_rewrite_rule( - '^.well-known/x-nodeinfo2', - 'index.php?rest_route=/' . ACTIVITYPUB_REST_NAMESPACE . '/nodeinfo2', - 'top' - ); - } - - \add_rewrite_rule( - '^@([\w\-\.]+)', - 'index.php?rest_route=/' . ACTIVITYPUB_REST_NAMESPACE . '/actors/$matches[1]', - 'top' - ); - - \add_rewrite_endpoint( 'activitypub', EP_AUTHORS | EP_PERMALINK | EP_PAGES ); - } - - /** - * Flush rewrite rules; - */ - public static function flush_rewrite_rules() { - self::add_rewrite_rules(); - \flush_rewrite_rules(); - } - - /** - * Theme compatibility stuff - * - * @return void - */ - public static function theme_compat() { - $site_icon = get_theme_support( 'custom-logo' ); - - if ( ! $site_icon ) { - // custom logo support - add_theme_support( - 'custom-logo', - array( - 'height' => 80, - 'width' => 80, - ) - ); - } - - $custom_header = get_theme_support( 'custom-header' ); - - if ( ! $custom_header ) { - // This theme supports a custom header - $custom_header_args = array( - 'width' => 1250, - 'height' => 600, - 'header-text' => true, - ); - add_theme_support( 'custom-header', $custom_header_args ); - } - - // We assume that you want to use Post-Formats when enabling the setting - if ( 'wordpress-post-format' === \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ) { - if ( ! get_theme_support( 'post-formats' ) ) { - // Add support for the Aside, Gallery Post Formats... - add_theme_support( - 'post-formats', - array( - 'gallery', - 'status', - 'image', - 'video', - 'audio', - ) - ); - } - } - } - - /** - * Display plugin upgrade notice to users - * - * @param array $data The plugin data - * - * @return void - */ - public static function plugin_update_message( $data ) { - if ( ! isset( $data['upgrade_notice'] ) ) { - return; - } - - printf( - '
%s
', - wp_kses( - wpautop( $data['upgrade_notice '] ), - array( - 'p' => array(), - 'a' => array( 'href', 'title' ), - 'strong' => array(), - 'em' => array(), - ) - ) - ); - } - - /** - * Register the "Followers" Taxonomy - * - * @return void - */ - private static function register_post_types() { - \register_post_type( - Followers::POST_TYPE, - array( - 'labels' => array( - 'name' => _x( 'Followers', 'post_type plural name', 'activitypub' ), - 'singular_name' => _x( 'Follower', 'post_type single name', 'activitypub' ), - ), - 'public' => false, - 'hierarchical' => false, - 'rewrite' => false, - 'query_var' => false, - 'delete_with_user' => false, - 'can_export' => true, - 'supports' => array(), - ) - ); - - \register_post_meta( - Followers::POST_TYPE, - 'activitypub_inbox', - array( - 'type' => 'string', - 'single' => true, - 'sanitize_callback' => 'sanitize_url', - ) - ); - - \register_post_meta( - Followers::POST_TYPE, - 'activitypub_errors', - array( - 'type' => 'string', - 'single' => false, - 'sanitize_callback' => function ( $value ) { - if ( ! is_string( $value ) ) { - throw new Exception( 'Error message is no valid string' ); - } - - return esc_sql( $value ); - }, - ) - ); - - \register_post_meta( - Followers::POST_TYPE, - 'activitypub_user_id', - array( - 'type' => 'string', - 'single' => false, - 'sanitize_callback' => function ( $value ) { - return esc_sql( $value ); - }, - ) - ); - - \register_post_meta( - Followers::POST_TYPE, - 'activitypub_actor_json', - array( - 'type' => 'string', - 'single' => true, - 'sanitize_callback' => function ( $value ) { - return sanitize_text_field( $value ); - }, - ) - ); - - \register_post_type( - 'ap_extrafield', - array( - 'labels' => array( - 'name' => _x( 'Extra fields', 'post_type plural name', 'activitypub' ), - 'singular_name' => _x( 'Extra field', 'post_type single name', 'activitypub' ), - 'add_new' => __( 'Add new', 'activitypub' ), - 'add_new_item' => __( 'Add new extra field', 'activitypub' ), - 'new_item' => __( 'New extra field', 'activitypub' ), - 'edit_item' => __( 'Edit extra field', 'activitypub' ), - 'view_item' => __( 'View extra field', 'activitypub' ), - 'all_items' => __( 'All extra fields', 'activitypub' ), - ), - 'public' => false, - 'hierarchical' => false, - 'query_var' => false, - 'has_archive' => false, - 'publicly_queryable' => false, - 'show_in_menu' => false, - 'delete_with_user' => true, - 'can_export' => true, - 'exclude_from_search' => true, - 'show_in_rest' => true, - 'map_meta_cap' => true, - 'show_ui' => true, - 'supports' => array( 'title', 'editor' ), - ) - ); - - \do_action( 'activitypub_after_register_post_type' ); - } - - /** - * Add the 'activitypub' capability to users who can publish posts. - * - * @param int $user_id User ID. - * - * @param array $userdata The raw array of data passed to wp_insert_user(). - */ - public static function user_register( $user_id ) { - if ( \user_can( $user_id, 'publish_posts' ) ) { - $user = \get_user_by( 'id', $user_id ); - $user->add_cap( 'activitypub' ); - } - } - - /** - * Add default extra fields to an actor. - * - * @param array $extra_fields The extra fields. - * @param int $user_id The User-ID. - * - * @return array The extra fields. - */ - public static function default_actor_extra_fields( $extra_fields, $user_id ) { - if ( $extra_fields || ! $user_id ) { - return $extra_fields; - } - - $already_migrated = \get_user_meta( $user_id, 'activitypub_default_extra_fields', true ); - - if ( $already_migrated ) { - return $extra_fields; - } - - $defaults = array( - \__( 'Blog', 'activitypub' ) => \home_url( '/' ), - \__( 'Profile', 'activitypub' ) => \get_author_posts_url( $user_id ), - \__( 'Homepage', 'activitypub' ) => \get_the_author_meta( 'user_url', $user_id ), - ); - - foreach ( $defaults as $title => $url ) { - if ( ! $url ) { - continue; - } - - $extra_field = array( - 'post_type' => 'ap_extrafield', - 'post_title' => $title, - 'post_status' => 'publish', - 'post_author' => $user_id, - 'post_content' => sprintf( - '

%s

', - \esc_attr( $url ), - $url, - \wp_parse_url( $url, \PHP_URL_HOST ) - ), - 'comment_status' => 'closed', - ); - - $extra_field_id = wp_insert_post( $extra_field ); - $extra_fields[] = get_post( $extra_field_id ); - } - - \update_user_meta( $user_id, 'activitypub_default_extra_fields', true ); - - return $extra_fields; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-admin.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-admin.php deleted file mode 100644 index de24daf3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-admin.php +++ /dev/null @@ -1,649 +0,0 @@ -id ) && 'edit-ap_extrafield' === $current_screen->id ) { - ?> -
- -
- - -
-

-
- - 'string', - 'description' => \__( 'Use title and link, summary, full or custom content', 'activitypub' ), - 'show_in_rest' => array( - 'schema' => array( - 'enum' => array( - 'title', - 'excerpt', - 'content', - ), - ), - ), - 'default' => 'content', - ) - ); - \register_setting( - 'activitypub', - 'activitypub_custom_post_content', - array( - 'type' => 'string', - 'description' => \__( 'Define your own custom post template', 'activitypub' ), - 'show_in_rest' => true, - 'default' => ACTIVITYPUB_CUSTOM_POST_CONTENT, - ) - ); - \register_setting( - 'activitypub', - 'activitypub_max_image_attachments', - array( - 'type' => 'integer', - 'description' => \__( 'Number of images to attach to posts.', 'activitypub' ), - 'default' => ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS, - ) - ); - \register_setting( - 'activitypub', - 'activitypub_object_type', - array( - 'type' => 'string', - 'description' => \__( 'The Activity-Object-Type', 'activitypub' ), - 'show_in_rest' => array( - 'schema' => array( - 'enum' => array( - 'note', - 'wordpress-post-format', - ), - ), - ), - 'default' => 'note', - ) - ); - \register_setting( - 'activitypub', - 'activitypub_use_hashtags', - array( - 'type' => 'boolean', - 'description' => \__( 'Add hashtags in the content as native tags and replace the #tag with the tag-link', 'activitypub' ), - 'default' => '0', - ) - ); - \register_setting( - 'activitypub', - 'activitypub_support_post_types', - array( - 'type' => 'string', - 'description' => \esc_html__( 'Enable ActivityPub support for post types', 'activitypub' ), - 'show_in_rest' => true, - 'default' => array( 'post' ), - ) - ); - \register_setting( - 'activitypub', - 'activitypub_blog_user_identifier', - array( - 'type' => 'string', - 'description' => \esc_html__( 'The Identifier of the Blog-User', 'activitypub' ), - 'show_in_rest' => true, - 'default' => Blog::get_default_username(), - 'sanitize_callback' => function ( $value ) { - // hack to allow dots in the username - $parts = explode( '.', $value ); - $sanitized = array(); - - foreach ( $parts as $part ) { - $sanitized[] = \sanitize_title( $part ); - } - - $sanitized = implode( '.', $sanitized ); - - // check for login or nicename. - $user = new WP_User_Query( - array( - 'search' => $sanitized, - 'search_columns' => array( 'user_login', 'user_nicename' ), - 'number' => 1, - 'hide_empty' => true, - 'fields' => 'ID', - ) - ); - - if ( $user->results ) { - add_settings_error( - 'activitypub_blog_user_identifier', - 'activitypub_blog_user_identifier', - \esc_html__( 'You cannot use an existing author\'s name for the blog profile ID.', 'activitypub' ), - 'error' - ); - - return Blog::get_default_username(); - } - - return $sanitized; - }, - ) - ); - \register_setting( - 'activitypub', - 'activitypub_enable_users', - array( - 'type' => 'boolean', - 'description' => \__( 'Every Author on this Blog (with the publish_posts capability) gets his own ActivityPub enabled Profile.', 'activitypub' ), - 'default' => '1', - ) - ); - \register_setting( - 'activitypub', - 'activitypub_enable_blog_user', - array( - 'type' => 'boolean', - 'description' => \__( 'Your Blog becomes an ActivityPub compatible Profile.', 'activitypub' ), - 'default' => '0', - ) - ); - } - - public static function add_settings_help_tab() { - require_once ACTIVITYPUB_PLUGIN_DIR . 'includes/help.php'; - } - - public static function add_followers_list_help_tab() { - // todo - } - - public static function add_profile( $user ) { - $description = get_user_meta( $user->ID, 'activitypub_user_description', true ); - - \load_template( - ACTIVITYPUB_PLUGIN_DIR . 'templates/user-settings.php', - true, - array( - 'description' => $description, - ) - ); - } - - public static function save_user_description( $user_id ) { - if ( ! isset( $_REQUEST['_apnonce'] ) ) { - return false; - } - $nonce = sanitize_text_field( wp_unslash( $_REQUEST['_apnonce'] ) ); - if ( - ! wp_verify_nonce( $nonce, 'activitypub-user-description' ) || - ! current_user_can( 'edit_user', $user_id ) - ) { - return false; - } - $description = ! empty( $_POST['activitypub-user-description'] ) ? sanitize_text_field( wp_unslash( $_POST['activitypub-user-description'] ) ) : false; - if ( $description ) { - update_user_meta( $user_id, 'activitypub_user_description', $description ); - } - } - - public static function enqueue_scripts( $hook_suffix ) { - if ( false !== strpos( $hook_suffix, 'activitypub' ) ) { - wp_enqueue_style( 'activitypub-admin-styles', plugins_url( 'assets/css/activitypub-admin.css', ACTIVITYPUB_PLUGIN_FILE ), array(), get_plugin_version() ); - wp_enqueue_script( 'activitypub-admin-script', plugins_url( 'assets/js/activitypub-admin.js', ACTIVITYPUB_PLUGIN_FILE ), array( 'jquery' ), get_plugin_version(), false ); - } - - if ( 'index.php' === $hook_suffix ) { - wp_enqueue_style( 'activitypub-admin-styles', plugins_url( 'assets/css/activitypub-admin.css', ACTIVITYPUB_PLUGIN_FILE ), array(), get_plugin_version() ); - } - } - - /** - * Hook into the edit_comment functionality - * - * * Disable the edit_comment capability for federated comments. - * - * @return void - */ - public static function edit_comment() { - // Disable the edit_comment capability for federated comments. - \add_filter( - 'user_has_cap', - function ( $allcaps, $caps, $arg ) { - if ( 'edit_comment' !== $arg[0] ) { - return $allcaps; - } - - if ( was_comment_received( $arg[2] ) ) { - return false; - } - - return $allcaps; - }, - 1, - 3 - ); - } - - public static function edit_post() { - // Disable the edit_post capability for federated posts. - \add_filter( - 'user_has_cap', - function ( $allcaps, $caps, $arg ) { - if ( 'edit_post' !== $arg[0] ) { - return $allcaps; - } - - $post = get_post( $arg[2] ); - - if ( 'ap_extrafield' !== $post->post_type ) { - return $allcaps; - } - - if ( (int) get_current_user_id() !== (int) $post->post_author ) { - return false; - } - - return $allcaps; - }, - 1, - 3 - ); - } - - /** - * Add ActivityPub specific actions/filters to the post list view - * - * @return void - */ - public static function list_posts() { - // Show only the user's extra fields. - \add_action( - 'pre_get_posts', - function ( $query ) { - if ( $query->get( 'post_type' ) === 'ap_extrafield' ) { - $query->set( 'author', get_current_user_id() ); - } - } - ); - - // Remove all views for the extra fields. - $screen_id = get_current_screen()->id; - - add_filter( - "views_{$screen_id}", - function ( $views ) { - if ( 'ap_extrafield' === get_post_type() ) { - return array(); - } - - return $views; - } - ); - - // Set defaults for new extra fields. - if ( 'edit-ap_extrafield' === $screen_id ) { - Activitypub::default_actor_extra_fields( array(), get_current_user_id() ); - } - } - - public static function comment_row_actions( $actions, $comment ) { - if ( was_comment_received( $comment ) ) { - unset( $actions['edit'] ); - unset( $actions['quickedit'] ); - } - - return $actions; - } - - /** - * Add a column "activitypub" - * - * This column shows if the user has the capability to use ActivityPub. - * - * @param array $columns The columns. - * - * @return array The columns extended by the activitypub. - */ - public static function manage_users_columns( $columns ) { - $columns['activitypub'] = __( 'ActivityPub', 'activitypub' ); - return $columns; - } - - /** - * Add "comment-type" and "protocol" as column in WP-Admin - * - * @param array $columns the list of column names - */ - public static function manage_comment_columns( $columns ) { - $columns['comment_type'] = esc_attr__( 'Comment-Type', 'activitypub' ); - $columns['comment_protocol'] = esc_attr__( 'Protocol', 'activitypub' ); - - return $columns; - } - - /** - * Add "post_content" as column for Extra-Fields in WP-Admin - * - * @param array $columns Tthe list of column names. - * @param string $post_type The post type. - */ - public static function manage_post_columns( $columns, $post_type ) { - if ( 'ap_extrafield' === $post_type ) { - $after_key = 'title'; - $index = array_search( $after_key, array_keys( $columns ), true ); - $columns = array_slice( $columns, 0, $index + 1 ) + array( 'extra_field_content' => esc_attr__( 'Content', 'activitypub' ) ) + $columns; - } - - return $columns; - } - - /** - * Add "comment-type" and "protocol" as column in WP-Admin - * - * @param array $column The column to implement - * @param int $comment_id The comment id - */ - public static function manage_comments_custom_column( $column, $comment_id ) { - if ( 'comment_type' === $column && ! defined( 'WEBMENTION_PLUGIN_DIR' ) ) { - echo esc_attr( ucfirst( get_comment_type( $comment_id ) ) ); - } elseif ( 'comment_protocol' === $column ) { - $protocol = get_comment_meta( $comment_id, 'protocol', true ); - - if ( $protocol ) { - echo esc_attr( ucfirst( str_replace( 'activitypub', 'ActivityPub', $protocol ) ) ); - } else { - esc_attr_e( 'Local', 'activitypub' ); - } - } - } - - /** - * Return the results for the activitypub column. - * - * @param string $output Custom column output. Default empty. - * @param string $column_name Column name. - * @param int $user_id ID of the currently-listed user. - * - * @return string The column contents. - */ - public static function manage_users_custom_column( $output, $column_name, $user_id ) { - if ( 'activitypub' !== $column_name ) { - return $output; - } - - if ( \user_can( $user_id, 'activitypub' ) ) { - return '' . esc_html__( 'ActivityPub enabled for this author', 'activitypub' ) . ''; - } else { - return '' . esc_html__( 'ActivityPub disabled for this author', 'activitypub' ) . ''; - } - } - - /** - * Add a column "extra_field_content" to the post list view - * - * @param string $column_name The column name. - * @param int $post_id The post ID. - * - * @return void - */ - public static function manage_posts_custom_column( $column_name, $post_id ) { - $post = get_post( $post_id ); - - if ( 'extra_field_content' === $column_name ) { - $post = get_post( $post_id ); - if ( 'ap_extrafield' === $post->post_type ) { - echo esc_attr( wp_strip_all_tags( $post->post_content ) ); - } - } - } - - /** - * Add options to the Bulk dropdown on the users page - * - * @param array $actions The existing bulk options. - * - * @return array The extended bulk options. - */ - public static function user_bulk_options( $actions ) { - $actions['add_activitypub_cap'] = __( 'Enable for ActivityPub', 'activitypub' ); - $actions['remove_activitypub_cap'] = __( 'Disable for ActivityPub', 'activitypub' ); - - return $actions; - } - - /** - * Handle bulk activitypub requests - * - * * `add_activitypub_cap` - Add the activitypub capability to the selected users. - * * `remove_activitypub_cap` - Remove the activitypub capability from the selected users. - * - * @param string $sendback The URL to send the user back to. - * @param string $action The requested action. - * @param array $users The selected users. - * - * @return string The URL to send the user back to. - */ - public static function handle_bulk_request( $sendback, $action, $users ) { - if ( - 'remove_activitypub_cap' !== $action && - 'add_activitypub_cap' !== $action - ) { - return $sendback; - } - - foreach ( $users as $user_id ) { - $user = new \WP_User( $user_id ); - if ( - 'add_activitypub_cap' === $action && - user_can( $user_id, 'publish_posts' ) - ) { - $user->add_cap( 'activitypub' ); - } elseif ( 'remove_activitypub_cap' === $action ) { - $user->remove_cap( 'activitypub' ); - } - } - - return $sendback; - } - - /** - * Add ActivityPub infos to the dashboard glance items - * - * @param array $items The existing glance items. - * - * @return array The extended glance items. - */ - public static function dashboard_glance_items( $items ) { - \add_filter( 'number_format_i18n', '\Activitypub\custom_large_numbers', 10, 3 ); - - if ( ! is_user_disabled( get_current_user_id() ) ) { - $follower_count = sprintf( - // translators: %s: number of followers - _n( - '%s Follower', - '%s Followers', - count_followers( \get_current_user_id() ), - 'activitypub' - ), - \number_format_i18n( count_followers( \get_current_user_id() ) ) - ); - $items['activitypub-followers-user'] = sprintf( - '%3$s', - \esc_url( \admin_url( 'users.php?page=activitypub-followers-list' ) ), - \esc_attr__( 'Your followers', 'activitypub' ), - \esc_html( $follower_count ) - ); - } - - if ( ! is_user_type_disabled( 'blog' ) && current_user_can( 'manage_options' ) ) { - $follower_count = sprintf( - // translators: %s: number of followers - _n( - '%s Follower (Blog)', - '%s Followers (Blog)', - count_followers( Users::BLOG_USER_ID ), - 'activitypub' - ), - \number_format_i18n( count_followers( Users::BLOG_USER_ID ) ) - ); - $items['activitypub-followers-blog'] = sprintf( - '%3$s', - \esc_url( \admin_url( 'options-general.php?page=activitypub&tab=followers' ) ), - \esc_attr__( 'The Blog\'s followers', 'activitypub' ), - \esc_html( $follower_count ) - ); - } - - \remove_filter( 'number_format_i18n', '\Activitypub\custom_large_numbers', 10, 3 ); - - return $items; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-blocks.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-blocks.php deleted file mode 100644 index 660dcce0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-blocks.php +++ /dev/null @@ -1,159 +0,0 @@ - ACTIVITYPUB_REST_NAMESPACE, - 'enabled' => array( - 'site' => ! is_user_type_disabled( 'blog' ), - 'users' => ! is_user_type_disabled( 'user' ), - ), - ); - $js = sprintf( 'var _activityPubOptions = %s;', wp_json_encode( $data ) ); - \wp_add_inline_script( $followers_handle, $js, 'before' ); - \wp_add_inline_script( $follow_me_handle, $js, 'before' ); - } - - public static function register_blocks() { - \register_block_type_from_metadata( - ACTIVITYPUB_PLUGIN_DIR . '/build/followers', - array( - 'render_callback' => array( self::class, 'render_follower_block' ), - ) - ); - \register_block_type_from_metadata( - ACTIVITYPUB_PLUGIN_DIR . '/build/follow-me', - array( - 'render_callback' => array( self::class, 'render_follow_me_block' ), - ) - ); - } - - private static function get_user_id( $user_string ) { - if ( is_numeric( $user_string ) ) { - return absint( $user_string ); - } - // any other non-numeric falls back to 0, including the `site` string used in the UI - return 0; - } - - /** - * Filter an array by a list of keys. - * @param array $array The array to filter. - * @param array $keys The keys to keep. - * @return array The filtered array. - */ - protected static function filter_array_by_keys( $array, $keys ) { - return array_intersect_key( $array, array_flip( $keys ) ); - } - - /** - * Render the follow me block. - * @param array $attrs The block attributes. - * @return string The HTML to render. - */ - public static function render_follow_me_block( $attrs ) { - $user_id = self::get_user_id( $attrs['selectedUser'] ); - $user = User_Collection::get_by_id( $user_id ); - if ( ! is_wp_error( $user ) ) { - $attrs['profileData'] = self::filter_array_by_keys( - $user->to_array(), - array( 'icon', 'name', 'webfinger' ) - ); - } - - // add `@` prefix if it's missing - if ( '@' !== substr( $attrs['profileData']['webfinger'], 0, 1 ) ) { - $attrs['profileData']['webfinger'] = '@' . $attrs['profileData']['webfinger']; - } - - $wrapper_attributes = get_block_wrapper_attributes( - array( - 'aria-label' => __( 'Follow me on the Fediverse', 'activitypub' ), - 'class' => 'activitypub-follow-me-block-wrapper', - 'data-attrs' => wp_json_encode( $attrs ), - ) - ); - // todo: render more than an empty div? - return '
'; - } - - public static function render_follower_block( $attrs ) { - $followee_user_id = self::get_user_id( $attrs['selectedUser'] ); - $per_page = absint( $attrs['per_page'] ); - $follower_data = Followers::get_followers_with_count( $followee_user_id, $per_page ); - - $attrs['followerData']['total'] = $follower_data['total']; - $attrs['followerData']['followers'] = array_map( - function ( $follower ) { - return self::filter_array_by_keys( - $follower->to_array(), - array( 'icon', 'name', 'preferredUsername', 'url' ) - ); - }, - $follower_data['followers'] - ); - $wrapper_attributes = get_block_wrapper_attributes( - array( - 'aria-label' => __( 'Fediverse Followers', 'activitypub' ), - 'class' => 'activitypub-follower-block', - 'data-attrs' => wp_json_encode( $attrs ), - ) - ); - - $html = '
'; - if ( $attrs['title'] ) { - $html .= '

' . esc_html( $attrs['title'] ) . '

'; - } - $html .= '
    '; - foreach ( $follower_data['followers'] as $follower ) { - $html .= '
  • ' . self::render_follower( $follower ) . '
  • '; - } - // We are only pagination on the JS side. Could be revisited but we gotta ship! - $html .= '
'; - return $html; - } - - public static function render_follower( $follower ) { - $external_svg = ''; - $template = - ' - - - %s - / - @%s - - %s - '; - - $data = $follower->to_array(); - - return sprintf( - $template, - esc_url( object_to_uri( $data['url'] ) ), - esc_attr( $data['name'] ), - esc_attr( $data['icon']['url'] ), - esc_html( $data['name'] ), - esc_html( $data['preferredUsername'] ), - $external_svg - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-comment.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-comment.php deleted file mode 100644 index bda7d0e5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-comment.php +++ /dev/null @@ -1,465 +0,0 @@ - self::generate_id( $comment ), - 'commentId' => $comment->comment_ID, - ); - - $div = sprintf( - '
', - esc_attr( wp_json_encode( $attrs ) ) - ); - - return apply_filters( 'activitypub_comment_reply_link', $div ); - } - - /** - * Create a link to reply to a federated comment. - * This function adds a title attribute to the reply link to inform the user - * that the comment was received from the fediverse and the reply will be sent - * to the original author. - * - * @param string $link The HTML markup for the comment reply link. - * @param array $args The args provided by the `comment_reply_link` filter. - * - * @return string The modified HTML markup for the comment reply link. - */ - private static function create_fediverse_reply_link( $link, $args ) { - $str_to_replace = sprintf( '>%s<', $args['reply_text'] ); - $replace_with = sprintf( - ' title="%s">%s<', - esc_attr__( 'This comment was received from the fediverse and your reply will be sent to the original author', 'activitypub' ), - esc_html__( 'Reply with federation', 'activitypub' ) - ); - return str_replace( $str_to_replace, $replace_with, $link ); - } - - /** - * Check if it is allowed to comment to a comment. - * - * Checks if the comment is local only or if the user can comment federated comments. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the user can comment, false otherwise. - */ - public static function are_comments_allowed( $comment ) { - $comment = \get_comment( $comment ); - - if ( ! self::was_received( $comment ) ) { - return true; - } - - $current_user = get_current_user_id(); - - if ( ! $current_user ) { - return false; - } - - if ( is_single_user() && \user_can( $current_user, 'publish_posts' ) ) { - // On a single user site, comments by users with the `publish_posts` capability will be federated as the blog user - $current_user = Users::BLOG_USER_ID; - } - - $is_user_disabled = is_user_disabled( $current_user ); - - if ( $is_user_disabled ) { - return false; - } - - return true; - } - - /** - * Check if a comment is federated. - * - * We consider a comment federated if comment was received via ActivityPub. - * - * Use this function to check if it is comment that was received via ActivityPub. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment is federated, false otherwise. - */ - public static function was_received( $comment ) { - $comment = \get_comment( $comment ); - - if ( ! $comment ) { - return false; - } - - $protocol = \get_comment_meta( $comment->comment_ID, 'protocol', true ); - - if ( 'activitypub' === $protocol ) { - return true; - } - - return false; - } - - /** - * Check if a comment was federated. - * - * This function checks if a comment was federated via ActivityPub. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment was federated, false otherwise. - */ - public static function was_sent( $comment ) { - $comment = \get_comment( $comment ); - - if ( ! $comment ) { - return false; - } - - $status = \get_comment_meta( $comment->comment_ID, 'activitypub_status', true ); - - if ( $status ) { - return true; - } - - return false; - } - - /** - * Check if a comment is local only. - * - * This function checks if a comment is local only and was not sent or received via ActivityPub. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment is local only, false otherwise. - */ - public static function is_local( $comment ) { - if ( self::was_sent( $comment ) || self::was_received( $comment ) ) { - return false; - } - - return true; - } - - /** - * Check if a comment should be federated. - * - * We consider a comment should be federated if it is authored by a user that is - * not disabled for federation and if it is a reply directly to the post or to a - * federated comment. - * - * Use this function to check if a comment should be federated. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment should be federated, false otherwise. - */ - public static function should_be_federated( $comment ) { - // we should not federate federated comments - if ( self::was_received( $comment ) ) { - return false; - } - - $comment = \get_comment( $comment ); - $user_id = $comment->user_id; - - // comments without user can't be federated - if ( ! $user_id ) { - return false; - } - - if ( is_single_user() && \user_can( $user_id, 'publish_posts' ) ) { - // On a single user site, comments by users with the `publish_posts` capability will be federated as the blog user - $user_id = Users::BLOG_USER_ID; - } - - $is_user_disabled = is_user_disabled( $user_id ); - - // user is disabled for federation - if ( $is_user_disabled ) { - return false; - } - - // it is a comment to the post and can be federated - if ( empty( $comment->comment_parent ) ) { - return true; - } - - // check if parent comment is federated - $parent_comment = \get_comment( $comment->comment_parent ); - - return ! self::is_local( $parent_comment ); - } - - /** - * Examine a comment ID and look up an existing comment it represents. - * - * @param string $id ActivityPub object ID (usually a URL) to check. - * - * @return \WP_Comment|false Comment object, or false on failure. - */ - public static function object_id_to_comment( $id ) { - $comment_query = new WP_Comment_Query( - array( - 'meta_key' => 'source_id', // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key - 'meta_value' => $id, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value - ) - ); - - if ( ! $comment_query->comments ) { - return false; - } - - if ( count( $comment_query->comments ) > 1 ) { - return false; - } - - return $comment_query->comments[0]; - } - - /** - * Verify if URL is a local comment, or if it is a previously received - * remote comment (For threading comments locally) - * - * @param string $url The URL to check. - * - * @return int comment_ID or null if not found - */ - public static function url_to_commentid( $url ) { - if ( ! $url || ! filter_var( $url, \FILTER_VALIDATE_URL ) ) { - return null; - } - - // check for local comment - if ( \wp_parse_url( \home_url(), \PHP_URL_HOST ) === \wp_parse_url( $url, \PHP_URL_HOST ) ) { - $query = \wp_parse_url( $url, \PHP_URL_QUERY ); - - if ( $query ) { - parse_str( $query, $params ); - - if ( ! empty( $params['c'] ) ) { - $comment = \get_comment( $params['c'] ); - - if ( $comment ) { - return $comment->comment_ID; - } - } - } - } - - $args = array( - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - 'relation' => 'OR', - array( - 'key' => 'source_url', - 'value' => $url, - ), - array( - 'key' => 'source_id', - 'value' => $url, - ), - ), - ); - - $query = new WP_Comment_Query(); - $comments = $query->query( $args ); - - if ( $comments && is_array( $comments ) ) { - return $comments[0]->comment_ID; - } - - return null; - } - - /** - * Filters the CSS classes to add an ActivityPub class. - * - * @param string[] $classes An array of comment classes. - * @param string[] $css_class An array of additional classes added to the list. - * @param string $comment_id The comment ID as a numeric string. - * - * @return string[] An array of classes. - */ - public static function comment_class( $classes, $css_class, $comment_id ) { - // check if ActivityPub comment - if ( 'activitypub' === get_comment_meta( $comment_id, 'protocol', true ) ) { - $classes[] = 'activitypub-comment'; - } - - return $classes; - } - - /** - * Link remote comments to source url. - * - * @param string $comment_link - * @param object|WP_Comment $comment - * - * @return string $url - */ - public static function remote_comment_link( $comment_link, $comment ) { - if ( ! $comment || is_admin() ) { - return $comment_link; - } - - $comment_meta = \get_comment_meta( $comment->comment_ID ); - - if ( ! empty( $comment_meta['source_url'][0] ) ) { - return $comment_meta['source_url'][0]; - } elseif ( ! empty( $comment_meta['source_id'][0] ) ) { - return $comment_meta['source_id'][0]; - } - - return $comment_link; - } - - - /** - * Generates an ActivityPub URI for a comment - * - * @param WP_Comment|int $comment A comment object or comment ID - * - * @return string ActivityPub URI for comment - */ - public static function generate_id( $comment ) { - $comment = \get_comment( $comment ); - $comment_meta = \get_comment_meta( $comment->comment_ID ); - - // show external comment ID if it exists - if ( ! empty( $comment_meta['source_id'][0] ) ) { - return $comment_meta['source_id'][0]; - } elseif ( ! empty( $comment_meta['source_url'][0] ) ) { - return $comment_meta['source_url'][0]; - } - - // generate URI based on comment ID - return \add_query_arg( 'c', $comment->comment_ID, \trailingslashit( \home_url() ) ); - } - - /** - * Check if a post has remote comments - * - * @param int $post_id The post ID. - * - * @return bool True if the post has remote comments, false otherwise. - */ - private static function post_has_remote_comments( $post_id ) { - $comments = \get_comments( - array( - 'post_id' => $post_id, - 'meta_query' => array( - 'relation' => 'AND', - array( - 'key' => 'protocol', - 'value' => 'activitypub', - 'compare' => '=', - ), - array( - 'key' => 'source_id', - 'compare' => 'EXISTS', - ), - ), - ) - ); - - return ! empty( $comments ); - } - - /** - * Enqueue scripts for remote comments - */ - public static function enqueue_scripts() { - if ( ! \is_singular() || \is_user_logged_in() ) { - // only on single pages, only for logged out users - return; - } - - if ( ! \post_type_supports( \get_post_type(), 'activitypub' ) ) { - // post type does not support ActivityPub - return; - } - - if ( ! \comments_open() || ! \get_comments_number() ) { - // no comments, no need to load the script - return; - } - - if ( ! self::post_has_remote_comments( \get_the_ID() ) ) { - // no remote comments, no need to load the script - return; - } - - $handle = 'activitypub-remote-reply'; - $data = array( - 'namespace' => ACTIVITYPUB_REST_NAMESPACE, - ); - $js = sprintf( 'var _activityPubOptions = %s;', wp_json_encode( $data ) ); - $asset_file = ACTIVITYPUB_PLUGIN_DIR . 'build/remote-reply/index.asset.php'; - - if ( \file_exists( $asset_file ) ) { - $assets = require_once $asset_file; - - \wp_enqueue_script( - $handle, - \plugins_url( 'build/remote-reply/index.js', __DIR__ ), - $assets['dependencies'], - $assets['version'], - true - ); - \wp_add_inline_script( $handle, $js, 'before' ); - - \wp_enqueue_style( - $handle, - \plugins_url( 'build/remote-reply/style-index.css', __DIR__ ), - [ 'wp-components' ], - $assets['version'] - ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-debug.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-debug.php deleted file mode 100644 index bdb84c68..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-debug.php +++ /dev/null @@ -1,37 +0,0 @@ -post_content, $match ) ) { - $tags = \implode( ', ', $match[1] ); - - \wp_add_post_tags( $post->post_parent, $tags ); - } - - return $id; - } - - /** - * Filter to replace the #tags in the content with links - * - * @param string $the_content the post-content - * - * @return string the filtered post-content - */ - public static function the_content( $the_content ) { - // small protection against execution timeouts: limit to 1 MB - if ( mb_strlen( $the_content ) > MB_IN_BYTES ) { - return $the_content; - } - $tag_stack = array(); - $protected_tags = array( - 'pre', - 'code', - 'textarea', - 'style', - 'a', - ); - $content_with_links = ''; - $in_protected_tag = false; - foreach ( wp_html_split( $the_content ) as $chunk ) { - if ( preg_match( '#^$#i', $chunk, $m ) ) { - $content_with_links .= $chunk; - continue; - } - - if ( preg_match( '#^<(/)?([a-z-]+)\b[^>]*>$#i', $chunk, $m ) ) { - $tag = strtolower( $m[2] ); - if ( '/' === $m[1] ) { - // Closing tag. - $i = array_search( $tag, $tag_stack, true ); - // We can only remove the tag from the stack if it is in the stack. - if ( false !== $i ) { - $tag_stack = array_slice( $tag_stack, 0, $i ); - } - } else { - // Opening tag, add it to the stack. - $tag_stack[] = $tag; - } - - // If we're in a protected tag, the tag_stack contains at least one protected tag string. - // The protected tag state can only change when we encounter a start or end tag. - $in_protected_tag = array_intersect( $tag_stack, $protected_tags ); - - // Never inspect tags. - $content_with_links .= $chunk; - continue; - } - - if ( $in_protected_tag ) { - // Don't inspect a chunk inside an inspected tag. - $content_with_links .= $chunk; - continue; - } - - // Only reachable when there is no protected tag in the stack. - $content_with_links .= \preg_replace_callback( '/' . ACTIVITYPUB_HASHTAGS_REGEXP . '/i', array( '\Activitypub\Hashtag', 'replace_with_links' ), $chunk ); - } - - return $content_with_links; - } - - /** - * A callback for preg_replace to build the term links - * - * @param array $result the preg_match results - * @return string the final string - */ - public static function replace_with_links( $result ) { - $tag = $result[1]; - $tag_object = \get_term_by( 'name', $tag, 'post_tag' ); - - if ( $tag_object ) { - $link = \get_term_link( $tag_object, 'post_tag' ); - return \sprintf( '', $link, $tag ); - } - - return '#' . $tag; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-health-check.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-health-check.php deleted file mode 100644 index 878ee85d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-health-check.php +++ /dev/null @@ -1,365 +0,0 @@ - \__( 'Author URL test', 'activitypub' ), - 'test' => array( self::class, 'test_author_url' ), - ); - } - - $tests['direct']['activitypub_test_webfinger'] = array( - 'label' => __( 'WebFinger Test', 'activitypub' ), - 'test' => array( self::class, 'test_webfinger' ), - ); - - return $tests; - } - - /** - * Author URL tests - * - * @return array - */ - public static function test_author_url() { - $result = array( - 'label' => \__( 'Author URL accessible', 'activitypub' ), - 'status' => 'good', - 'badge' => array( - 'label' => \__( 'ActivityPub', 'activitypub' ), - 'color' => 'green', - ), - 'description' => \sprintf( - '

%s

', - \__( 'Your author URL is accessible and supports the required "Accept" header.', 'activitypub' ) - ), - 'actions' => '', - 'test' => 'test_author_url', - ); - - $check = self::is_author_url_accessible(); - - if ( true === $check ) { - return $result; - } - - $result['status'] = 'critical'; - $result['label'] = \__( 'Author URL is not accessible', 'activitypub' ); - $result['badge']['color'] = 'red'; - $result['description'] = \sprintf( - '

%s

', - $check->get_error_message() - ); - - return $result; - } - - /** - * System Cron tests - * - * @return array - */ - public static function test_system_cron() { - $result = array( - 'label' => \__( 'System Task Scheduler configured', 'activitypub' ), - 'status' => 'good', - 'badge' => array( - 'label' => \__( 'ActivityPub', 'activitypub' ), - 'color' => 'green', - ), - 'description' => \sprintf( - '

%s

', - \esc_html__( 'You seem to use the System Task Scheduler to process WP_Cron tasks.', 'activitypub' ) - ), - 'actions' => '', - 'test' => 'test_system_cron', - ); - - if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { - return $result; - } - - $result['status'] = 'recommended'; - $result['label'] = \__( 'System Task Scheduler not configured', 'activitypub' ); - $result['badge']['color'] = 'orange'; - $result['description'] = \sprintf( - '

%s

', - \__( 'Enhance your WordPress site’s performance and mitigate potential heavy loads caused by plugins like ActivityPub by setting up a system cron job to run WP Cron. This ensures scheduled tasks are executed consistently and reduces the reliance on website traffic for trigger events.', 'activitypub' ) - ); - $result['actions'] .= sprintf( - '

%s %s

', - __( 'https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/', 'activitypub' ), - __( 'Learn how to hook the WP-Cron into the System Task Scheduler.', 'activitypub' ), - /* translators: Hidden accessibility text. */ - __( '(opens in a new tab)', 'activitypub' ) - ); - - return $result; - } - - /** - * WebFinger tests - * - * @return array - */ - public static function test_webfinger() { - $result = array( - 'label' => \__( 'WebFinger endpoint', 'activitypub' ), - 'status' => 'good', - 'badge' => array( - 'label' => \__( 'ActivityPub', 'activitypub' ), - 'color' => 'green', - ), - 'description' => \sprintf( - '

%s

', - \__( 'Your WebFinger endpoint is accessible and returns the correct information.', 'activitypub' ) - ), - 'actions' => '', - 'test' => 'test_webfinger', - ); - - $check = self::is_webfinger_endpoint_accessible(); - - if ( true === $check ) { - return $result; - } - - $result['status'] = 'critical'; - $result['label'] = \__( 'WebFinger endpoint is not accessible', 'activitypub' ); - $result['badge']['color'] = 'red'; - $result['description'] = \sprintf( - '

%s

', - $check->get_error_message() - ); - - return $result; - } - - /** - * Check if `author_posts_url` is accessible and that request returns correct JSON - * - * @return boolean|WP_Error - */ - public static function is_author_url_accessible() { - $user = \wp_get_current_user(); - $author_url = \get_author_posts_url( $user->ID ); - $reference_author_url = self::get_author_posts_url( $user->ID, $user->user_nicename ); - - // check for "author" in URL - if ( $author_url !== $reference_author_url ) { - return new WP_Error( - 'author_url_not_accessible', - \sprintf( - // translators: %s: Author URL - \__( - 'Your author URL %s was replaced, this is often done by plugins.', - 'activitypub' - ), - $author_url - ) - ); - } - - // try to access author URL - $response = \wp_remote_get( - $author_url, - array( - 'headers' => array( 'Accept' => 'application/activity+json' ), - 'redirection' => 0, - ) - ); - - if ( \is_wp_error( $response ) ) { - return new WP_Error( - 'author_url_not_accessible', - \sprintf( - // translators: %s: Author URL - \__( - 'Your author URL %s is not accessible. Please check your WordPress setup or permalink structure. If the setup seems fine, maybe check if a plugin might restrict the access.', - 'activitypub' - ), - $author_url - ) - ); - } - - $response_code = \wp_remote_retrieve_response_code( $response ); - - // check for redirects - if ( \in_array( $response_code, array( 301, 302, 307, 308 ), true ) ) { - return new WP_Error( - 'author_url_not_accessible', - \sprintf( - // translators: %s: Author URL - \__( - 'Your author URL %s is redirecting to another page, this is often done by SEO plugins like "Yoast SEO".', - 'activitypub' - ), - $author_url - ) - ); - } - - // check if response is JSON - $body = \wp_remote_retrieve_body( $response ); - - if ( ! \is_string( $body ) || ! \is_array( \json_decode( $body, true ) ) ) { - return new WP_Error( - 'author_url_not_accessible', - \sprintf( - // translators: %s: Author URL - \__( - 'Your author URL %s does not return valid JSON for application/activity+json. Please check if your hosting supports alternate Accept headers.', - 'activitypub' - ), - $author_url - ) - ); - } - - return true; - } - - /** - * Check if WebFinger endpoint is accessible and profile request returns correct JSON - * - * @return boolean|WP_Error - */ - public static function is_webfinger_endpoint_accessible() { - $user = Users::get_by_id( Users::APPLICATION_USER_ID ); - $resource = $user->get_webfinger(); - - $url = Webfinger::resolve( $resource ); - if ( \is_wp_error( $url ) ) { - $allowed = array( 'code' => array() ); - $not_accessible = wp_kses( - // translators: %s: Author URL - \__( - 'Your WebFinger endpoint %s is not accessible. Please check your WordPress setup or permalink structure.', - 'activitypub' - ), - $allowed - ); - $invalid_response = wp_kses( - // translators: %s: Author URL - \__( - 'Your WebFinger endpoint %s does not return valid JSON for application/jrd+json.', - 'activitypub' - ), - $allowed - ); - - $health_messages = array( - 'webfinger_url_not_accessible' => \sprintf( - $not_accessible, - $url->get_error_data() - ), - 'webfinger_url_invalid_response' => \sprintf( - // translators: %s: Author URL - $invalid_response, - $url->get_error_data() - ), - ); - $message = null; - if ( isset( $health_messages[ $url->get_error_code() ] ) ) { - $message = $health_messages[ $url->get_error_code() ]; - } - return new WP_Error( - $url->get_error_code(), - $message, - $url->get_error_data() - ); - } - - return true; - } - - /** - * Retrieve the URL to the author page for the user with the ID provided. - * - * @global WP_Rewrite $wp_rewrite WordPress rewrite component. - * - * @param int $author_id Author ID. - * @param string $author_nicename Optional. The author's nicename (slug). Default empty. - * - * @return string The URL to the author's page. - */ - public static function get_author_posts_url( $author_id, $author_nicename = '' ) { - global $wp_rewrite; - $auth_id = (int) $author_id; - $link = $wp_rewrite->get_author_permastruct(); - - if ( empty( $link ) ) { - $file = home_url( '/' ); - $link = $file . '?author=' . $auth_id; - } else { - if ( '' === $author_nicename ) { - $user = get_userdata( $author_id ); - if ( ! empty( $user->user_nicename ) ) { - $author_nicename = $user->user_nicename; - } - } - $link = str_replace( '%author%', $author_nicename, $link ); - $link = home_url( user_trailingslashit( $link ) ); - } - - return $link; - } - - /** - * Static function for generating site debug data when required. - * - * @param array $info The debug information to be added to the core information page. - * @return array The filtered information - */ - public static function debug_information( $info ) { - $info['activitypub'] = array( - 'label' => __( 'ActivityPub', 'activitypub' ), - 'fields' => array( - 'webfinger' => array( - 'label' => __( 'WebFinger Resource', 'activitypub' ), - 'value' => Webfinger::get_user_resource( wp_get_current_user()->ID ), - 'private' => true, - ), - 'author_url' => array( - 'label' => __( 'Author URL', 'activitypub' ), - 'value' => get_author_posts_url( wp_get_current_user()->ID ), - 'private' => true, - ), - 'plugin_version' => array( - 'label' => __( 'Plugin Version', 'activitypub' ), - 'value' => get_plugin_version(), - 'private' => true, - ), - ), - ); - - return $info; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-http.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-http.php deleted file mode 100644 index 2a8ce7d0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-http.php +++ /dev/null @@ -1,251 +0,0 @@ - 100, - 'limit_response_size' => 1048576, - 'redirection' => 3, - 'user-agent' => "$user_agent; ActivityPub", - 'headers' => array( - 'Accept' => 'application/activity+json', - 'Content-Type' => 'application/activity+json', - 'Digest' => $digest, - 'Signature' => $signature, - 'Date' => $date, - ), - 'body' => $body, - ); - - $response = \wp_safe_remote_post( $url, $args ); - $code = \wp_remote_retrieve_response_code( $response ); - - if ( $code >= 400 ) { - $response = new WP_Error( $code, __( 'Failed HTTP Request', 'activitypub' ), array( 'status' => $code ) ); - } - - \do_action( 'activitypub_safe_remote_post_response', $response, $url, $body, $user_id ); - - return $response; - } - - /** - * Send a GET Request with the needed HTTP Headers - * - * @param string $url The URL endpoint - * @param bool|int $cached If the result should be cached, or its duration. Default: 1hr. - * - * @return array|WP_Error The GET Response or an WP_ERROR - */ - public static function get( $url, $cached = false ) { - \do_action( 'activitypub_pre_http_get', $url ); - - if ( $cached ) { - $transient_key = self::generate_cache_key( $url ); - - $response = \get_transient( $transient_key ); - - if ( $response ) { - \do_action( 'activitypub_safe_remote_get_response', $response, $url ); - - return $response; - } - } - - $date = \gmdate( 'D, d M Y H:i:s T' ); - $signature = Signature::generate_signature( Users::APPLICATION_USER_ID, 'get', $url, $date ); - - $wp_version = get_masked_wp_version(); - - /** - * Filter the HTTP headers user agent. - * - * @param string $user_agent The user agent string. - */ - $user_agent = \apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . \get_bloginfo( 'url' ) ); - - $args = array( - 'timeout' => apply_filters( 'activitypub_remote_get_timeout', 100 ), - 'limit_response_size' => 1048576, - 'redirection' => 3, - 'user-agent' => "$user_agent; ActivityPub", - 'headers' => array( - 'Accept' => 'application/activity+json', - 'Content-Type' => 'application/activity+json', - 'Signature' => $signature, - 'Date' => $date, - ), - ); - - $response = \wp_safe_remote_get( $url, $args ); - $code = \wp_remote_retrieve_response_code( $response ); - - if ( $code >= 400 ) { - $response = new WP_Error( $code, __( 'Failed HTTP Request', 'activitypub' ), array( 'status' => $code ) ); - } - - \do_action( 'activitypub_safe_remote_get_response', $response, $url ); - - if ( $cached ) { - $cache_duration = $cached; - if ( ! is_int( $cache_duration ) ) { - $cache_duration = HOUR_IN_SECONDS; - } - \set_transient( $transient_key, $response, $cache_duration ); - } - - return $response; - } - - /** - * Check for URL for Tombstone. - * - * @param string $url The URL to check. - * - * @return bool True if the URL is a tombstone. - */ - public static function is_tombstone( $url ) { - \do_action( 'activitypub_pre_http_is_tombstone', $url ); - - $response = \wp_safe_remote_get( $url ); - $code = \wp_remote_retrieve_response_code( $response ); - - if ( in_array( (int) $code, array( 404, 410 ), true ) ) { - return true; - } - - return false; - } - - public static function generate_cache_key( $url ) { - return 'activitypub_http_' . \md5( $url ); - } - - /** - * Requests the Data from the Object-URL or Object-Array - * - * @param array|string $url_or_object The Object or the Object URL. - * @param bool $cached If the result should be cached. - * - * @return array|WP_Error The Object data as array or WP_Error on failure. - */ - public static function get_remote_object( $url_or_object, $cached = true ) { - if ( is_array( $url_or_object ) ) { - if ( array_key_exists( 'id', $url_or_object ) ) { - $url = $url_or_object['id']; - } elseif ( array_key_exists( 'url', $url_or_object ) ) { - $url = $url_or_object['url']; - } else { - return new WP_Error( - 'activitypub_no_valid_actor_identifier', - \__( 'The "actor" identifier is not valid', 'activitypub' ), - array( - 'status' => 404, - 'object' => $url_or_object, - ) - ); - } - } else { - $url = $url_or_object; - } - - if ( preg_match( '/^@?' . ACTIVITYPUB_USERNAME_REGEXP . '$/i', $url ) ) { - $url = Webfinger::resolve( $url ); - } - - if ( ! $url ) { - return new WP_Error( - 'activitypub_no_valid_actor_identifier', - \__( 'The "actor" identifier is not valid', 'activitypub' ), - array( - 'status' => 404, - 'object' => $url, - ) - ); - } - - if ( is_wp_error( $url ) ) { - return $url; - } - - $transient_key = self::generate_cache_key( $url ); - - // only check the cache if needed. - if ( $cached ) { - $data = \get_transient( $transient_key ); - - if ( $data ) { - return $data; - } - } - - if ( ! \wp_http_validate_url( $url ) ) { - return new WP_Error( - 'activitypub_no_valid_object_url', - \__( 'The "object" is/has no valid URL', 'activitypub' ), - array( - 'status' => 400, - 'object' => $url, - ) - ); - } - - $response = self::get( $url ); - - if ( \is_wp_error( $response ) ) { - return $response; - } - - $data = \wp_remote_retrieve_body( $response ); - $data = \json_decode( $data, true ); - - if ( ! $data ) { - return new WP_Error( - 'activitypub_invalid_json', - \__( 'No valid JSON data', 'activitypub' ), - array( - 'status' => 400, - 'object' => $url, - ) - ); - } - - \set_transient( $transient_key, $data, WEEK_IN_SECONDS ); - - return $data; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-mention.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-mention.php deleted file mode 100644 index c2e8792d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-mention.php +++ /dev/null @@ -1,183 +0,0 @@ - MB_IN_BYTES ) { - return $the_content; - } - $tag_stack = array(); - $protected_tags = array( - 'pre', - 'code', - 'textarea', - 'style', - 'a', - ); - $content_with_links = ''; - $in_protected_tag = false; - foreach ( wp_html_split( $the_content ) as $chunk ) { - if ( preg_match( '#^$#i', $chunk, $m ) ) { - $content_with_links .= $chunk; - continue; - } - - if ( preg_match( '#^<(/)?([a-z-]+)\b[^>]*>$#i', $chunk, $m ) ) { - $tag = strtolower( $m[2] ); - if ( '/' === $m[1] ) { - // Closing tag. - $i = array_search( $tag, $tag_stack ); - // We can only remove the tag from the stack if it is in the stack. - if ( false !== $i ) { - $tag_stack = array_slice( $tag_stack, 0, $i ); - } - } else { - // Opening tag, add it to the stack. - $tag_stack[] = $tag; - } - - // If we're in a protected tag, the tag_stack contains at least one protected tag string. - // The protected tag state can only change when we encounter a start or end tag. - $in_protected_tag = array_intersect( $tag_stack, $protected_tags ); - - // Never inspect tags. - $content_with_links .= $chunk; - continue; - } - - if ( $in_protected_tag ) { - // Don't inspect a chunk inside an inspected tag. - $content_with_links .= $chunk; - continue; - } - - // Only reachable when there is no protected tag in the stack. - $content_with_links .= \preg_replace_callback( '/@' . ACTIVITYPUB_USERNAME_REGEXP . '/', array( self::class, 'replace_with_links' ), $chunk ); - } - - return $content_with_links; - } - - /** - * A callback for preg_replace to build the user links - * - * @param array $result the preg_match results - * - * @return string the final string - */ - public static function replace_with_links( $result ) { - $metadata = get_remote_metadata_by_actor( $result[0] ); - - if ( - ! empty( $metadata ) && - ! is_wp_error( $metadata ) && - ( ! empty( $metadata['id'] ) || ! empty( $metadata['url'] ) ) - ) { - $username = ltrim( $result[0], '@' ); - if ( ! empty( $metadata['name'] ) ) { - $username = $metadata['name']; - } - if ( ! empty( $metadata['preferredUsername'] ) ) { - $username = $metadata['preferredUsername']; - } - - $url = isset( $metadata['url'] ) ? object_to_uri( $metadata['url'] ) : object_to_uri( $metadata['id'] ); - - return \sprintf( '@%s', esc_url( $url ), esc_html( $username ) ); - } - - return $result[0]; - } - - /** - * Get the Inboxes for the mentioned Actors - * - * @param array $mentioned The list of Actors that were mentioned - * - * @return array The list of Inboxes - */ - public static function get_inboxes( $mentioned ) { - $inboxes = array(); - - foreach ( $mentioned as $actor ) { - $inbox = self::get_inbox_by_mentioned_actor( $actor ); - - if ( ! is_wp_error( $inbox ) && $inbox ) { - $inboxes[] = $inbox; - } - } - - return $inboxes; - } - - /** - * Get the inbox from the Remote-Profile of a mentioned Actor - * - * @param string $actor The Actor-URL - * - * @return string The Inbox-URL - */ - public static function get_inbox_by_mentioned_actor( $actor ) { - $metadata = get_remote_metadata_by_actor( $actor ); - - if ( \is_wp_error( $metadata ) ) { - return $metadata; - } - - if ( isset( $metadata['endpoints'] ) && isset( $metadata['endpoints']['sharedInbox'] ) ) { - return $metadata['endpoints']['sharedInbox']; - } - - if ( \array_key_exists( 'inbox', $metadata ) ) { - return $metadata['inbox']; - } - - return new WP_Error( 'activitypub_no_inbox', \__( 'No "Inbox" found', 'activitypub' ), $metadata ); - } - - /** - * Extract the mentions from the post_content. - * - * @param array $mentions The already found mentions. - * @param string $post_content The post content. - * - * @return mixed The discovered mentions. - */ - public static function extract_mentions( $mentions, $post_content ) { - \preg_match_all( '/@' . ACTIVITYPUB_USERNAME_REGEXP . '/i', $post_content, $matches ); - foreach ( $matches[0] as $match ) { - $link = Webfinger::resolve( $match ); - if ( ! is_wp_error( $link ) ) { - $mentions[ $match ] = $link; - } - } - return $mentions; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-migration.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-migration.php deleted file mode 100644 index 0e12ac11..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-migration.php +++ /dev/null @@ -1,287 +0,0 @@ - 'ID' ) ) as $user_id ) { - $followers = get_user_meta( $user_id, 'activitypub_followers', true ); - - if ( $followers ) { - foreach ( $followers as $actor ) { - Followers::add_follower( $user_id, $actor ); - } - } - } - - Activitypub::flush_rewrite_rules(); - } - - /** - * Clear the cache after updating to 1.3.0 - * - * @return void - */ - private static function migrate_from_1_2_0() { - $user_ids = \get_users( - array( - 'fields' => 'ID', - 'capability__in' => array( 'publish_posts' ), - ) - ); - - foreach ( $user_ids as $user_id ) { - wp_cache_delete( sprintf( Followers::CACHE_KEY_INBOXES, $user_id ), 'activitypub' ); - } - } - - /** - * Unschedule Hooks after updating to 2.0.0 - * - * @return void - */ - private static function migrate_from_2_0_0() { - wp_clear_scheduled_hook( 'activitypub_send_post_activity' ); - wp_clear_scheduled_hook( 'activitypub_send_update_activity' ); - wp_clear_scheduled_hook( 'activitypub_send_delete_activity' ); - - wp_unschedule_hook( 'activitypub_send_post_activity' ); - wp_unschedule_hook( 'activitypub_send_update_activity' ); - wp_unschedule_hook( 'activitypub_send_delete_activity' ); - - $object_type = \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ); - if ( 'article' === $object_type ) { - \update_option( 'activitypub_object_type', 'wordpress-post-format' ); - } - } - - /** - * Add the ActivityPub capability to all users that can publish posts - * Delete old meta to store followers - * - * @return void - */ - private static function migrate_from_2_2_0() { - // add the ActivityPub capability to all users that can publish posts - self::add_activitypub_capability(); - } - - /** - * Set the defaults needed for the plugin to work - * - * * Add the ActivityPub capability to all users that can publish posts - * - * @return void - */ - public static function add_default_settings() { - self::add_activitypub_capability(); - } - - /** - * Add the ActivityPub capability to all users that can publish posts - * - * @return void - */ - private static function add_activitypub_capability() { - // get all WP_User objects that can publish posts - $users = \get_users( - array( - 'capability__in' => array( 'publish_posts' ), - ) - ); - - // add ActivityPub capability to all users that can publish posts - foreach ( $users as $user ) { - $user->add_cap( 'activitypub' ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-notification.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-notification.php deleted file mode 100644 index 72747021..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-notification.php +++ /dev/null @@ -1,58 +0,0 @@ -type = $type; - $this->actor = $actor; - $this->object = $object; - $this->target = $target; - } - - /** - * Send the notification. - */ - public function send() { - do_action( 'activitypub_notification', $this ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-scheduler.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-scheduler.php deleted file mode 100644 index 4faf51a7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-scheduler.php +++ /dev/null @@ -1,348 +0,0 @@ -post_type ) { - self::schedule_profile_update( $post->post_author ); - return; - } - - // Do not send activities if post is password protected. - if ( \post_password_required( $post ) ) { - return; - } - - // Check if post-type supports ActivityPub. - $post_types = \get_post_types_by_support( 'activitypub' ); - if ( ! \in_array( $post->post_type, $post_types, true ) ) { - return; - } - - $type = false; - - if ( - 'publish' === $new_status && - 'publish' !== $old_status - ) { - $type = 'Create'; - } elseif ( - 'publish' === $new_status || - ( 'draft' === $new_status && - 'draft' !== $old_status ) - ) { - $type = 'Update'; - } elseif ( 'trash' === $new_status ) { - $type = 'Delete'; - } - - if ( empty( $type ) ) { - return; - } - - $hook = 'activitypub_send_post'; - $args = array( $post->ID, $type ); - - if ( false === wp_next_scheduled( $hook, $args ) ) { - set_wp_object_state( $post, 'federate' ); - \wp_schedule_single_event( \time(), $hook, $args ); - } - } - - /** - * Schedule Comment Activities - * - * transition_comment_status() - * - * @param string $new_status New comment status. - * @param string $old_status Old comment status. - * @param WP_Comment $comment Comment object. - */ - public static function schedule_comment_activity( $new_status, $old_status, $comment ) { - $comment = get_comment( $comment ); - - // federate only comments that are written by a registered user. - if ( ! $comment->user_id ) { - return; - } - - $type = false; - - if ( - 'approved' === $new_status && - 'approved' !== $old_status - ) { - $type = 'Create'; - } elseif ( 'approved' === $new_status ) { - $type = 'Update'; - \update_comment_meta( $comment->comment_ID, 'activitypub_comment_modified', time(), true ); - } elseif ( - 'trash' === $new_status || - 'spam' === $new_status - ) { - $type = 'Delete'; - } - - if ( empty( $type ) ) { - return; - } - - // check if comment should be federated or not - if ( ! should_comment_be_federated( $comment ) ) { - return; - } - - $hook = 'activitypub_send_comment'; - $args = array( $comment->comment_ID, $type ); - - if ( false === wp_next_scheduled( $hook, $args ) ) { - set_wp_object_state( $comment, 'federate' ); - \wp_schedule_single_event( \time(), $hook, $args ); - } - } - - /** - * Update followers - * - * @return void - */ - public static function update_followers() { - $number = 5; - - if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { - $number = 50; - } - - $number = apply_filters( 'activitypub_update_followers_number', $number ); - $followers = Followers::get_outdated_followers( $number ); - - foreach ( $followers as $follower ) { - $meta = get_remote_metadata_by_actor( $follower->get_id(), false ); - - if ( empty( $meta ) || ! is_array( $meta ) || is_wp_error( $meta ) ) { - Followers::add_error( $follower->get__id(), $meta ); - } else { - $follower->from_array( $meta ); - $follower->update(); - } - } - } - - /** - * Cleanup followers - * - * @return void - */ - public static function cleanup_followers() { - $number = 5; - - if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { - $number = 50; - } - - $number = apply_filters( 'activitypub_update_followers_number', $number ); - $followers = Followers::get_faulty_followers( $number ); - - foreach ( $followers as $follower ) { - $meta = get_remote_metadata_by_actor( $follower->get_url(), false ); - - if ( is_tombstone( $meta ) ) { - $follower->delete(); - } elseif ( empty( $meta ) || ! is_array( $meta ) || is_wp_error( $meta ) ) { - if ( $follower->count_errors() >= 5 ) { - $follower->delete(); - \wp_schedule_single_event( - \time(), - 'activitypub_delete_actor_interactions', - array( $follower->get_id() ) - ); - } else { - Followers::add_error( $follower->get__id(), $meta ); - } - } else { - $follower->reset_errors(); - } - } - } - - /** - * Send a profile update when relevant user meta is updated. - * - * @param int $meta_id Meta ID being updated. - * @param int $user_id User ID being updated. - * @param string $meta_key Meta key being updated. - * - * @return void - */ - public static function user_meta_update( $meta_id, $user_id, $meta_key ) { - // don't bother if the user can't publish - if ( ! \user_can( $user_id, 'activitypub' ) ) { - return; - } - // the user meta fields that affect a profile. - $fields = array( - 'activitypub_user_description', - 'description', - 'user_url', - 'display_name', - ); - if ( in_array( $meta_key, $fields, true ) ) { - self::schedule_profile_update( $user_id ); - } - } - - /** - * Send a profile update when a user is updated. - * - * @param int $user_id User ID being updated. - * - * @return void - */ - public static function user_update( $user_id ) { - // don't bother if the user can't publish - if ( ! \user_can( $user_id, 'activitypub' ) ) { - return; - } - - self::schedule_profile_update( $user_id ); - } - - /** - * Theme mods only have a dynamic filter so we fudge it like this. - * - * @param mixed $value - * - * @return mixed - */ - public static function blog_user_update( $value = null ) { - self::schedule_profile_update( 0 ); - return $value; - } - - /** - * Send a profile update to all followers. Gets hooked into all relevant options/meta etc. - * - * @param int $user_id The user ID to update (Could be 0 for Blog-User). - */ - public static function schedule_profile_update( $user_id ) { - \wp_schedule_single_event( - \time(), - 'activitypub_send_update_profile_activity', - array( $user_id ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-shortcodes.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-shortcodes.php deleted file mode 100644 index b32b91dd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-shortcodes.php +++ /dev/null @@ -1,598 +0,0 @@ -ID ); - - if ( ! $tags ) { - return ''; - } - - $hash_tags = array(); - - foreach ( $tags as $tag ) { - $hash_tags[] = \sprintf( - '', - \esc_url( \get_tag_link( $tag ) ), - esc_hashtag( $tag->name ) - ); - } - - return \implode( ' ', $hash_tags ); - } - - /** - * Generates output for the 'ap_title' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post title. - */ - public static function title( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - return \wp_strip_all_tags( \get_the_title( $item->ID ), true ); - } - - /** - * Generates output for the 'ap_excerpt' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post excerpt. - */ - public static function excerpt( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $atts = shortcode_atts( - array( 'length' => ACTIVITYPUB_EXCERPT_LENGTH ), - $atts, - $tag - ); - - $excerpt_length = intval( $atts['length'] ); - - if ( 0 === $excerpt_length ) { - $excerpt_length = ACTIVITYPUB_EXCERPT_LENGTH; - } - - $excerpt = \get_post_field( 'post_excerpt', $item ); - - if ( 'attachment' === $item->post_type ) { - // get title of attachment with fallback to alt text. - $content = wp_get_attachment_caption( $item->ID ); - if ( empty( $content ) ) { - $content = get_post_meta( $item->ID, '_wp_attachment_image_alt', true ); - } - } elseif ( '' === $excerpt ) { - $content = \get_post_field( 'post_content', $item ); - - // An empty string will make wp_trim_excerpt do stuff we do not want. - if ( '' !== $content ) { - $excerpt = \strip_shortcodes( $content ); - - /** This filter is documented in wp-includes/post-template.php */ - $excerpt = \apply_filters( 'the_content', $excerpt ); - $excerpt = \str_replace( ']]>', ']]>', $excerpt ); - } - } - - // Strip out any remaining tags. - $excerpt = \wp_strip_all_tags( $excerpt ); - - $excerpt_more = \apply_filters( 'activitypub_excerpt_more', ' […]' ); - $excerpt_more_len = strlen( $excerpt_more ); - - // We now have a excerpt, but we need to check it's length, it may be longer than we want for two reasons: - // - // * The user has entered a manual excerpt which is longer that what we want. - // * No manual excerpt exists so we've used the content which might be longer than we want. - // - // Either way, let's trim it up if we need too. Also, don't forget to take into account the more indicator - // as part of the total length. - // - - // Setup a variable to hold the current excerpts length. - $current_excerpt_length = strlen( $excerpt ); - - // Setup a variable to keep track of our target length. - $target_excerpt_length = $excerpt_length - $excerpt_more_len; - - // Setup a variable to keep track of the current max length. - $current_excerpt_max = $target_excerpt_length; - - // This is a loop since we can't calculate word break the string after 'the_excpert' filter has run (we would break - // all kinds of html tags), so we have to cut the excerpt down a bit at a time until we hit our target length. - while ( $current_excerpt_length > $target_excerpt_length && $current_excerpt_max > 0 ) { - // Trim the excerpt based on wordwrap() positioning. - // Note: we're using
as the linebreak just in case there are any newlines existing in the excerpt from the user. - // There won't be any
left after we've run wp_strip_all_tags() in the code above, so they're - // safe to use here. It won't be included in the final excerpt as the substr() will trim it off. - $excerpt = substr( $excerpt, 0, strpos( wordwrap( $excerpt, $current_excerpt_max, '
' ), '
' ) ); - - // If something went wrong, or we're in a language that wordwrap() doesn't understand, - // just chop it off and don't worry about breaking in the middle of a word. - if ( strlen( $excerpt ) > $excerpt_length - $excerpt_more_len ) { - $excerpt = substr( $excerpt, 0, $current_excerpt_max ); - } - - // Add in the more indicator. - $excerpt = $excerpt . $excerpt_more; - - // Run it through the excerpt filter which will add some html tags back in. - $excerpt_filtered = apply_filters( 'the_excerpt', $excerpt ); - - // Now set the current excerpt length to this new filtered length. - $current_excerpt_length = strlen( $excerpt_filtered ); - - // Check to see if we're over the target length. - if ( $current_excerpt_length > $target_excerpt_length ) { - // If so, remove 20 characters from the current max and run the loop again. - $current_excerpt_max = $current_excerpt_max - 20; - } - } - - return \apply_filters( 'the_excerpt', $excerpt ); - } - - /** - * Generates output for the 'ap_content' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post content. - */ - public static function content( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - // prevent inception - remove_shortcode( 'ap_content' ); - - $atts = shortcode_atts( - array( 'apply_filters' => 'yes' ), - $atts, - $tag - ); - - $content = ''; - - if ( 'attachment' === $item->post_type ) { - // get title of attachment with fallback to alt text. - $content = wp_get_attachment_caption( $item->ID ); - if ( empty( $content ) ) { - $content = get_post_meta( $item->ID, '_wp_attachment_image_alt', true ); - } - } else { - $content = \get_post_field( 'post_content', $item ); - - if ( 'yes' === $atts['apply_filters'] ) { - $content = \apply_filters( 'the_content', $content ); - } else { - $content = do_blocks( $content ); - $content = wptexturize( $content ); - $content = wp_filter_content_tags( $content ); - } - - // replace script and style elements - $content = \preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $content ); - $content = strip_shortcodes( $content ); - $content = \trim( \preg_replace( '/[\n\r\t]/', '', $content ) ); - } - - add_shortcode( 'ap_content', array( 'Activitypub\Shortcodes', 'content' ) ); - - return $content; - } - - /** - * Generates output for the 'ap_permalink' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post permalink. - */ - public static function permalink( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $atts = shortcode_atts( - array( - 'type' => 'url', - ), - $atts, - $tag - ); - - if ( 'url' === $atts['type'] ) { - return \esc_url( \get_permalink( $item->ID ) ); - } - - return \sprintf( - '%1$s', - \esc_url( \get_permalink( $item->ID ) ) - ); - } - - /** - * Generates output for the 'ap_shortlink' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post shortlink. - */ - public static function shortlink( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $atts = shortcode_atts( - array( - 'type' => 'url', - ), - $atts, - $tag - ); - - if ( 'url' === $atts['type'] ) { - return \esc_url( \wp_get_shortlink( $item->ID ) ); - } - - return \sprintf( - '%1$s', - \esc_url( \wp_get_shortlink( $item->ID ) ) - ); - } - - /** - * Generates output for the 'ap_image' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string - */ - public static function image( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $atts = shortcode_atts( - array( - 'type' => 'full', - ), - $atts, - $tag - ); - - $size = 'full'; - - if ( in_array( - $atts['type'], - array( 'thumbnail', 'medium', 'large', 'full' ), - true - ) ) { - $size = $atts['type']; - } - - $image = \get_the_post_thumbnail_url( $item->ID, $size ); - - if ( ! $image ) { - return ''; - } - - return \esc_url( $image ); - } - - /** - * Generates output for the 'ap_hashcats' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post categories as hashtags. - */ - public static function hashcats( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $categories = \get_the_category( $item->ID ); - - if ( ! $categories ) { - return ''; - } - - $hash_tags = array(); - - foreach ( $categories as $category ) { - $hash_tags[] = \sprintf( - '', - \esc_url( \get_category_link( $category ) ), - esc_hashtag( $category->name ) - ); - } - - return \implode( ' ', $hash_tags ); - } - - /** - * Generates output for the 'ap_author' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The author name. - */ - public static function author( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $author_id = \get_post_field( 'post_author', $item->ID ); - $name = \get_the_author_meta( 'display_name', $author_id ); - - if ( ! $name ) { - return ''; - } - - return wp_strip_all_tags( $name ); - } - - /** - * Generates output for the 'ap_authorurl' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The author URL. - */ - public static function authorurl( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $author_id = \get_post_field( 'post_author', $item->ID ); - $url = \get_the_author_meta( 'user_url', $author_id ); - - if ( ! $url ) { - return ''; - } - - return \esc_url( $url ); - } - - /** - * Generates output for the 'ap_blogurl' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The site URL. - */ - public static function blogurl( $atts, $content, $tag ) { - return \esc_url( \get_bloginfo( 'url' ) ); - } - - /** - * Generates output for the 'ap_blogname' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string - */ - public static function blogname( $atts, $content, $tag ) { - return \wp_strip_all_tags( \get_bloginfo( 'name' ) ); - } - - /** - * Generates output for the 'ap_blogdesc' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The site description. - */ - public static function blogdesc( $atts, $content, $tag ) { - return \wp_strip_all_tags( \get_bloginfo( 'description' ) ); - } - - /** - * Generates output for the 'ap_date' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post date. - */ - public static function date( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $datetime = \get_post_datetime( $item ); - $dateformat = \get_option( 'date_format' ); - $timeformat = \get_option( 'time_format' ); - - $date = $datetime->format( $dateformat ); - - if ( ! $date ) { - return ''; - } - - return $date; - } - - /** - * Generates output for the 'ap_time' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post time. - */ - public static function time( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $datetime = \get_post_datetime( $item ); - $dateformat = \get_option( 'date_format' ); - $timeformat = \get_option( 'time_format' ); - - $date = $datetime->format( $timeformat ); - - if ( ! $date ) { - return ''; - } - - return $date; - } - - /** - * Generates output for the 'ap_datetime' Shortcode - * - * @param array $atts The Shortcode attributes. - * @param string $content The ActivityPub post-content. - * @param string $tag The tag/name of the Shortcode. - * - * @return string The post date/time. - */ - public static function datetime( $atts, $content, $tag ) { - $item = self::get_item(); - - if ( ! $item ) { - return ''; - } - - $datetime = \get_post_datetime( $item ); - $dateformat = \get_option( 'date_format' ); - $timeformat = \get_option( 'time_format' ); - - $date = $datetime->format( $dateformat . ' @ ' . $timeformat ); - - if ( ! $date ) { - return ''; - } - - return $date; - } - - /** - * Get a WordPress item to federate. - * - * Checks if item (WP_Post) is "public", a supported post type - * and not password protected. - * - * @return null|WP_Post The WordPress item. - */ - protected static function get_item() { - $post = \get_post(); - - if ( ! $post ) { - return null; - } - - if ( 'publish' !== \get_post_status( $post ) ) { - return null; - } - - if ( \post_password_required( $post ) ) { - return null; - } - - if ( ! \in_array( \get_post_type( $post ), \get_post_types_by_support( 'activitypub' ), true ) ) { - return null; - } - - return $post; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-signature.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-signature.php deleted file mode 100644 index e7087595..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-signature.php +++ /dev/null @@ -1,510 +0,0 @@ - 'sha512', - 'private_key_bits' => 2048, - 'private_key_type' => \OPENSSL_KEYTYPE_RSA, - ); - - $key = \openssl_pkey_new( $config ); - $priv_key = null; - - \openssl_pkey_export( $key, $priv_key ); - - $detail = \openssl_pkey_get_details( $key ); - - // check if keys are valid - if ( - empty( $priv_key ) || ! is_string( $priv_key ) || - ! isset( $detail['key'] ) || ! is_string( $detail['key'] ) - ) { - return array( - 'private_key' => null, - 'public_key' => null, - ); - } - - $key_pair = array( - 'private_key' => $priv_key, - 'public_key' => $detail['key'], - ); - - // persist keys - \add_option( $option_key, $key_pair ); - - return $key_pair; - } - - /** - * Return the option key for a given user. - * - * @param int $user_id The WordPress User ID. - * - * @return string The option key. - */ - protected static function get_signature_options_key_for( $user_id ) { - $id = $user_id; - - if ( $user_id > 0 ) { - $user = \get_userdata( $user_id ); - // sanatize username because it could include spaces and special chars - $id = sanitize_title( $user->user_login ); - } - - return 'activitypub_keypair_for_' . $id; - } - - /** - * Check if there is a legacy key pair - * - * @param int $user_id The WordPress User ID. - * - * @return array|bool The key pair or false. - */ - protected static function check_legacy_key_pair_for( $user_id ) { - switch ( $user_id ) { - case 0: - $public_key = \get_option( 'activitypub_blog_user_public_key' ); - $private_key = \get_option( 'activitypub_blog_user_private_key' ); - break; - case -1: - $public_key = \get_option( 'activitypub_application_user_public_key' ); - $private_key = \get_option( 'activitypub_application_user_private_key' ); - break; - default: - $public_key = \get_user_meta( $user_id, 'magic_sig_public_key', true ); - $private_key = \get_user_meta( $user_id, 'magic_sig_private_key', true ); - break; - } - - if ( ! empty( $public_key ) && is_string( $public_key ) && ! empty( $private_key ) && is_string( $private_key ) ) { - return array( - 'private_key' => $private_key, - 'public_key' => $public_key, - ); - } - - return false; - } - - /** - * Generates the Signature for a HTTP Request - * - * @param int $user_id The WordPress User ID. - * @param string $http_method The HTTP method. - * @param string $url The URL to send the request to. - * @param string $date The date the request is sent. - * @param string $digest The digest of the request body. - * - * @return string The signature. - */ - public static function generate_signature( $user_id, $http_method, $url, $date, $digest = null ) { - $user = Users::get_by_id( $user_id ); - $key = self::get_private_key_for( $user->get__id() ); - - $url_parts = \wp_parse_url( $url ); - - $host = $url_parts['host']; - $path = '/'; - - // add path - if ( ! empty( $url_parts['path'] ) ) { - $path = $url_parts['path']; - } - - // add query - if ( ! empty( $url_parts['query'] ) ) { - $path .= '?' . $url_parts['query']; - } - - $http_method = \strtolower( $http_method ); - - if ( ! empty( $digest ) ) { - $signed_string = "(request-target): $http_method $path\nhost: $host\ndate: $date\ndigest: $digest"; - } else { - $signed_string = "(request-target): $http_method $path\nhost: $host\ndate: $date"; - } - - $signature = null; - \openssl_sign( $signed_string, $signature, $key, \OPENSSL_ALGO_SHA256 ); - $signature = \base64_encode( $signature ); // phpcs:ignore - - $key_id = $user->get_url() . '#main-key'; - - if ( ! empty( $digest ) ) { - return \sprintf( 'keyId="%s",algorithm="rsa-sha256",headers="(request-target) host date digest",signature="%s"', $key_id, $signature ); - } else { - return \sprintf( 'keyId="%s",algorithm="rsa-sha256",headers="(request-target) host date",signature="%s"', $key_id, $signature ); - } - } - - /** - * Verifies the http signatures - * - * @param WP_REST_Request|array $request The request object or $_SERVER array. - * - * @return mixed A boolean or WP_Error. - */ - public static function verify_http_signature( $request ) { - if ( is_object( $request ) ) { // REST Request object - // check if route starts with "index.php" - if ( str_starts_with( $request->get_route(), '/index.php' ) || ! rest_get_url_prefix() ) { - $route = $request->get_route(); - } else { - $route = '/' . rest_get_url_prefix() . '/' . ltrim( $request->get_route(), '/' ); - } - - // fix route for subdirectory installs - $path = \wp_parse_url( \get_home_url(), PHP_URL_PATH ); - - if ( \is_string( $path ) ) { - $path = trim( $path, '/' ); - } - - if ( $path ) { - $route = '/' . $path . $route; - } - - $headers = $request->get_headers(); - $headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' ' . $route; - } else { - $request = self::format_server_request( $request ); - $headers = $request['headers']; // $_SERVER array - $headers['(request-target)'][0] = strtolower( $headers['request_method'][0] ) . ' ' . $headers['request_uri'][0]; - } - - if ( ! isset( $headers['signature'] ) ) { - return new WP_Error( 'activitypub_signature', __( 'Request not signed', 'activitypub' ), array( 'status' => 401 ) ); - } - - if ( array_key_exists( 'signature', $headers ) ) { - $signature_block = self::parse_signature_header( $headers['signature'][0] ); - } elseif ( array_key_exists( 'authorization', $headers ) ) { - $signature_block = self::parse_signature_header( $headers['authorization'][0] ); - } - - if ( ! isset( $signature_block ) || ! $signature_block ) { - return new WP_Error( 'activitypub_signature', __( 'Incompatible request signature. keyId and signature are required', 'activitypub' ), array( 'status' => 401 ) ); - } - - $signed_headers = $signature_block['headers']; - if ( ! $signed_headers ) { - $signed_headers = array( 'date' ); - } - - $signed_data = self::get_signed_data( $signed_headers, $signature_block, $headers ); - if ( ! $signed_data ) { - return new WP_Error( 'activitypub_signature', __( 'Signed request date outside acceptable time window', 'activitypub' ), array( 'status' => 401 ) ); - } - - $algorithm = self::get_signature_algorithm( $signature_block ); - if ( ! $algorithm ) { - return new WP_Error( 'activitypub_signature', __( 'Unsupported signature algorithm (only rsa-sha256 and hs2019 are supported)', 'activitypub' ), array( 'status' => 401 ) ); - } - - if ( \in_array( 'digest', $signed_headers, true ) && isset( $body ) ) { - if ( is_array( $headers['digest'] ) ) { - $headers['digest'] = $headers['digest'][0]; - } - $hashalg = 'sha256'; - $digest = explode( '=', $headers['digest'], 2 ); - if ( 'SHA-256' === $digest[0] ) { - $hashalg = 'sha256'; - } - if ( 'SHA-512' === $digest[0] ) { - $hashalg = 'sha512'; - } - - if ( \base64_encode( \hash( $hashalg, $body, true ) ) !== $digest[1] ) { // phpcs:ignore - return new WP_Error( 'activitypub_signature', __( 'Invalid Digest header', 'activitypub' ), array( 'status' => 401 ) ); - } - } - - $public_key = self::get_remote_key( $signature_block['keyId'] ); - - if ( \is_wp_error( $public_key ) ) { - return $public_key; - } - - $verified = \openssl_verify( $signed_data, $signature_block['signature'], $public_key, $algorithm ) > 0; - - if ( ! $verified ) { - return new WP_Error( 'activitypub_signature', __( 'Invalid signature', 'activitypub' ), array( 'status' => 401 ) ); - } - return $verified; - } - - /** - * Get public key from key_id - * - * @param string $key_id The URL to the public key. - * - * @return WP_Error|string The public key or WP_Error. - */ - public static function get_remote_key( $key_id ) { // phpcs:ignore - $actor = get_remote_metadata_by_actor( strip_fragment_from_url( $key_id ) ); // phpcs:ignore - if ( \is_wp_error( $actor ) ) { - return new WP_Error( - 'activitypub_no_remote_profile_found', - __( 'No Profile found or Profile not accessible', 'activitypub' ), - array( 'status' => 401 ) - ); - } - if ( isset( $actor['publicKey']['publicKeyPem'] ) ) { - return \rtrim( $actor['publicKey']['publicKeyPem'] ); // phpcs:ignore - } - return new WP_Error( - 'activitypub_no_remote_key_found', - __( 'No Public-Key found', 'activitypub' ), - array( 'status' => 401 ) - ); - } - - /** - * Gets the signature algorithm from the signature header - * - * @param array $signature_block - * - * @return string The signature algorithm. - */ - public static function get_signature_algorithm( $signature_block ) { - if ( $signature_block['algorithm'] ) { - switch ( $signature_block['algorithm'] ) { - case 'rsa-sha-512': - return 'sha512'; //hs2019 https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12 - default: - return 'sha256'; - } - } - return false; - } - - /** - * Parses the Signature header - * - * @param string $signature The signature header. - * - * @return array signature parts - */ - public static function parse_signature_header( $signature ) { - $parsed_header = array(); - $matches = array(); - - if ( \preg_match( '/keyId="(.*?)"/ism', $signature, $matches ) ) { - $parsed_header['keyId'] = trim( $matches[1] ); - } - if ( \preg_match( '/created=["|\']*([0-9]*)["|\']*/ism', $signature, $matches ) ) { - $parsed_header['(created)'] = trim( $matches[1] ); - } - if ( \preg_match( '/expires=["|\']*([0-9]*)["|\']*/ism', $signature, $matches ) ) { - $parsed_header['(expires)'] = trim( $matches[1] ); - } - if ( \preg_match( '/algorithm="(.*?)"/ism', $signature, $matches ) ) { - $parsed_header['algorithm'] = trim( $matches[1] ); - } - if ( \preg_match( '/headers="(.*?)"/ism', $signature, $matches ) ) { - $parsed_header['headers'] = \explode( ' ', trim( $matches[1] ) ); - } - if ( \preg_match( '/signature="(.*?)"/ism', $signature, $matches ) ) { - $parsed_header['signature'] = \base64_decode( preg_replace( '/\s+/', '', trim( $matches[1] ) ) ); // phpcs:ignore - } - - if ( ( $parsed_header['signature'] ) && ( $parsed_header['algorithm'] ) && ( ! $parsed_header['headers'] ) ) { - $parsed_header['headers'] = array( 'date' ); - } - - return $parsed_header; - } - - /** - * Gets the header data from the included pseudo headers - * - * @param array $signed_headers The signed headers. - * @param array $signature_block (pseudo-headers) - * @param array $headers (http headers) - * - * @return string signed headers for comparison - */ - public static function get_signed_data( $signed_headers, $signature_block, $headers ) { - $signed_data = ''; - // This also verifies time-based values by returning false if any of these are out of range. - foreach ( $signed_headers as $header ) { - if ( 'host' === $header ) { - if ( isset( $headers['x_original_host'] ) ) { - $signed_data .= $header . ': ' . $headers['x_original_host'][0] . "\n"; - continue; - } - } - if ( '(request-target)' === $header ) { - $signed_data .= $header . ': ' . $headers[ $header ][0] . "\n"; - continue; - } - if ( str_contains( $header, '-' ) ) { - $signed_data .= $header . ': ' . $headers[ str_replace( '-', '_', $header ) ][0] . "\n"; - continue; - } - if ( '(created)' === $header ) { - if ( ! empty( $signature_block['(created)'] ) && \intval( $signature_block['(created)'] ) > \time() ) { - // created in future - return false; - } - - if ( ! array_key_exists( '(created)', $headers ) ) { - $signed_data .= $header . ': ' . $signature_block['(created)'] . "\n"; - continue; - } - } - if ( '(expires)' === $header ) { - if ( ! empty( $signature_block['(expires)'] ) && \intval( $signature_block['(expires)'] ) < \time() ) { - // expired in past - return false; - } - - if ( ! array_key_exists( '(expires)', $headers ) ) { - $signed_data .= $header . ': ' . $signature_block['(expires)'] . "\n"; - continue; - } - } - if ( 'date' === $header ) { - // allow a bit of leeway for misconfigured clocks. - $d = new DateTime( $headers[ $header ][0] ); - $d->setTimeZone( new DateTimeZone( 'UTC' ) ); - $c = $d->format( 'U' ); - - $dplus = time() + ( 3 * HOUR_IN_SECONDS ); - $dminus = time() - ( 3 * HOUR_IN_SECONDS ); - - if ( $c > $dplus || $c < $dminus ) { - // time out of range - return false; - } - } - $signed_data .= $header . ': ' . $headers[ $header ][0] . "\n"; - } - return \rtrim( $signed_data, "\n" ); - } - - /** - * Generates the digest for a HTTP Request - * - * @param string $body The body of the request. - * - * @return string The digest. - */ - public static function generate_digest( $body ) { - $digest = \base64_encode( \hash( 'sha256', $body, true ) ); // phpcs:ignore - return "SHA-256=$digest"; - } - - /** - * Formats the $_SERVER to resemble the WP_REST_REQUEST array, - * for use with verify_http_signature() - * - * @param array $_SERVER The $_SERVER array. - * - * @return array $request The formatted request array. - */ - public static function format_server_request( $server ) { - $request = array(); - foreach ( $server as $param_key => $param_val ) { - $req_param = strtolower( $param_key ); - if ( 'REQUEST_URI' === $req_param ) { - $request['headers']['route'][] = $param_val; - } else { - $header_key = str_replace( - 'http_', - '', - $req_param - ); - $request['headers'][ $header_key ][] = \wp_unslash( $param_val ); - } - } - return $request; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-webfinger.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-webfinger.php deleted file mode 100644 index d1357c98..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/class-webfinger.php +++ /dev/null @@ -1,287 +0,0 @@ -get_webfinger(); - } - - /** - * Resolve a WebFinger resource - * - * @param string $uri The WebFinger Resource - * - * @return string|WP_Error The URL or WP_Error - */ - public static function resolve( $uri ) { - $data = self::get_data( $uri ); - - if ( \is_wp_error( $data ) ) { - return $data; - } - - if ( ! is_array( $data ) || empty( $data['links'] ) ) { - return new WP_Error( - 'webfinger_missing_links', - __( 'No valid Link elements found.', 'activitypub' ), - array( - 'status' => 400, - 'data' => $data, - ) - ); - } - - foreach ( $data['links'] as $link ) { - if ( - 'self' === $link['rel'] && - ( - 'application/activity+json' === $link['type'] || - 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' === $link['type'] - ) - ) { - return $link['href']; - } - } - - return new WP_Error( - 'webfinger_url_no_activitypub', - __( 'The Site supports WebFinger but not ActivityPub', 'activitypub' ), - array( - 'status' => 400, - 'data' => $data, - ) - ); - } - - /** - * Transform a URI to an acct @ - * - * @param string $uri The URI (acct:, mailto:, http:, https:) - * - * @return string|WP_Error Error or acct URI - */ - public static function uri_to_acct( $uri ) { - $data = self::get_data( $uri ); - - if ( is_wp_error( $data ) ) { - return $data; - } - - // check if subject is an acct URI - if ( - isset( $data['subject'] ) && - \str_starts_with( $data['subject'], 'acct:' ) - ) { - return $data['subject']; - } - - // search for an acct URI in the aliases - if ( isset( $data['aliases'] ) ) { - foreach ( $data['aliases'] as $alias ) { - if ( \str_starts_with( $alias, 'acct:' ) ) { - return $alias; - } - } - } - - return new WP_Error( - 'webfinger_url_no_acct', - __( 'No acct URI found.', 'activitypub' ), - array( - 'status' => 400, - 'data' => $data, - ) - ); - } - - /** - * Convert a URI string to an identifier and its host. - * Automatically adds acct: if it's missing. - * - * @param string $url The URI (acct:, mailto:, http:, https:) - * - * @return WP_Error|array Error reaction or array with - * identifier and host as values - */ - public static function get_identifier_and_host( $url ) { - if ( ! $url ) { - return new WP_Error( - 'webfinger_invalid_identifier', - __( 'Invalid Identifier', 'activitypub' ), - array( - 'status' => 400, - 'data' => $url, - ) - ); - } - - // remove leading @ - $url = ltrim( $url, '@' ); - - if ( ! preg_match( '/^([a-zA-Z+]+):/', $url, $match ) ) { - $identifier = 'acct:' . $url; - $scheme = 'acct'; - } else { - $identifier = $url; - $scheme = $match[1]; - } - - $host = null; - - switch ( $scheme ) { - case 'acct': - case 'mailto': - case 'xmpp': - if ( strpos( $identifier, '@' ) !== false ) { - $host = substr( $identifier, strpos( $identifier, '@' ) + 1 ); - } - break; - default: - $host = wp_parse_url( $identifier, PHP_URL_HOST ); - break; - } - - if ( empty( $host ) ) { - return new WP_Error( - 'webfinger_invalid_identifier', - __( 'Invalid Identifier', 'activitypub' ), - array( - 'status' => 400, - 'data' => $url, - ) - ); - } - - return array( $identifier, $host ); - } - - /** - * Get the WebFinger data for a given URI - * - * @param string $uri The Identifier: @ or URI - * - * @return WP_Error|array Error reaction or array with - * identifier and host as values - */ - public static function get_data( $uri ) { - $identifier_and_host = self::get_identifier_and_host( $uri ); - - if ( is_wp_error( $identifier_and_host ) ) { - return $identifier_and_host; - } - - $transient_key = self::generate_cache_key( $uri ); - - list( $identifier, $host ) = $identifier_and_host; - - $data = \get_transient( $transient_key ); - if ( $data ) { - return $data; - } - - $webfinger_url = sprintf( 'https://%s/.well-known/webfinger?resource=%s', $host, rawurlencode( $identifier ) ); - - $response = wp_safe_remote_get( - $webfinger_url, - array( - 'headers' => array( 'Accept' => 'application/jrd+json' ), - ) - ); - - if ( is_wp_error( $response ) ) { - return new WP_Error( - 'webfinger_url_not_accessible', - __( 'The WebFinger Resource is not accessible.', 'activitypub' ), - array( - 'status' => 400, - 'data' => $webfinger_url, - ) - ); - } - - $body = wp_remote_retrieve_body( $response ); - $data = json_decode( $body, true ); - - \set_transient( $transient_key, $data, WEEK_IN_SECONDS ); - - return $data; - } - - /** - * Get the Remote-Follow endpoint for a given URI - * - * @return string|WP_Error Error or the Remote-Follow endpoint URI. - */ - public static function get_remote_follow_endpoint( $uri ) { - $data = self::get_data( $uri ); - - if ( is_wp_error( $data ) ) { - return $data; - } - - if ( empty( $data['links'] ) ) { - return new WP_Error( - 'webfinger_missing_links', - __( 'No valid Link elements found.', 'activitypub' ), - array( - 'status' => 400, - 'data' => $data, - ) - ); - } - - foreach ( $data['links'] as $link ) { - if ( 'http://ostatus.org/schema/1.0/subscribe' === $link['rel'] ) { - return $link['template']; - } - } - - return new WP_Error( - 'webfinger_missing_remote_follow_endpoint', - __( 'No valid Remote-Follow endpoint found.', 'activitypub' ), - array( - 'status' => 400, - 'data' => $data, - ) - ); - } - - /** - * Generate a cache key for a given URI - * - * @param string $uri A WebFinger Resource URI - * - * @return string The cache key - */ - public static function generate_cache_key( $uri ) { - $uri = ltrim( $uri, '@' ); - - if ( filter_var( $uri, FILTER_VALIDATE_EMAIL ) ) { - $uri = 'acct:' . $uri; - } - - return 'webfinger_' . md5( $uri ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-followers.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-followers.php deleted file mode 100644 index b51224fd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-followers.php +++ /dev/null @@ -1,432 +0,0 @@ - 400 ) ); - } - - $follower = new Follower(); - $follower->from_array( $meta ); - - $id = $follower->upsert(); - - if ( is_wp_error( $id ) ) { - return $id; - } - - $post_meta = get_post_meta( $id, 'activitypub_user_id' ); - - // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict - if ( is_array( $post_meta ) && ! in_array( $user_id, $post_meta ) ) { - add_post_meta( $id, 'activitypub_user_id', $user_id ); - wp_cache_delete( sprintf( self::CACHE_KEY_INBOXES, $user_id ), 'activitypub' ); - } - - return $follower; - } - - /** - * Remove a Follower - * - * @param int $user_id The ID of the WordPress User - * @param string $actor The Actor URL - * - * @return bool|WP_Error True on success, false or WP_Error on failure. - */ - public static function remove_follower( $user_id, $actor ) { - wp_cache_delete( sprintf( self::CACHE_KEY_INBOXES, $user_id ), 'activitypub' ); - - $follower = self::get_follower( $user_id, $actor ); - - if ( ! $follower ) { - return false; - } - - return delete_post_meta( $follower->get__id(), 'activitypub_user_id', $user_id ); - } - - /** - * Get a Follower. - * - * @param int $user_id The ID of the WordPress User - * @param string $actor The Actor URL - * - * @return \Activitypub\Model\Follower|null The Follower object or null - */ - public static function get_follower( $user_id, $actor ) { - global $wpdb; - - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching - $post_id = $wpdb->get_var( - $wpdb->prepare( - "SELECT DISTINCT p.ID FROM $wpdb->posts p INNER JOIN $wpdb->postmeta pm ON p.ID = pm.post_id WHERE p.post_type = %s AND pm.meta_key = 'activitypub_user_id' AND pm.meta_value = %d AND p.guid = %s", - array( - esc_sql( self::POST_TYPE ), - esc_sql( $user_id ), - esc_sql( $actor ), - ) - ) - ); - - if ( $post_id ) { - $post = get_post( $post_id ); - return Follower::init_from_cpt( $post ); - } - - return null; - } - - /** - * Get a Follower by Actor indepenent from the User. - * - * @param string $actor The Actor URL. - * - * @return \Activitypub\Model\Follower|null The Follower object or null - */ - public static function get_follower_by_actor( $actor ) { - global $wpdb; - - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching - $post_id = $wpdb->get_var( - $wpdb->prepare( - "SELECT ID FROM $wpdb->posts WHERE guid=%s", - esc_sql( $actor ) - ) - ); - - if ( $post_id ) { - $post = get_post( $post_id ); - return Follower::init_from_cpt( $post ); - } - - return null; - } - - /** - * Get the Followers of a given user - * - * @param int $user_id The ID of the WordPress User. - * @param int $number Maximum number of results to return. - * @param int $page Page number. - * @param array $args The WP_Query arguments. - * @return array List of `Follower` objects. - */ - public static function get_followers( $user_id, $number = -1, $page = null, $args = array() ) { - $data = self::get_followers_with_count( $user_id, $number, $page, $args ); - return $data['followers']; - } - - /** - * Get the Followers of a given user, along with a total count for pagination purposes. - * - * @param int $user_id The ID of the WordPress User. - * @param int $number Maximum number of results to return. - * @param int $page Page number. - * @param array $args The WP_Query arguments. - * - * @return array - * followers List of `Follower` objects. - * total Total number of followers. - */ - public static function get_followers_with_count( $user_id, $number = -1, $page = null, $args = array() ) { - $defaults = array( - 'post_type' => self::POST_TYPE, - 'posts_per_page' => $number, - 'paged' => $page, - 'orderby' => 'ID', - 'order' => 'DESC', - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - array( - 'key' => 'activitypub_user_id', - 'value' => $user_id, - ), - ), - ); - - $args = wp_parse_args( $args, $defaults ); - $query = new WP_Query( $args ); - $total = $query->found_posts; - $followers = array_map( - function ( $post ) { - return Follower::init_from_cpt( $post ); - }, - $query->get_posts() - ); - return compact( 'followers', 'total' ); - } - - /** - * Get all Followers - * - * @param array $args The WP_Query arguments. - * - * @return array The Term list of Followers. - */ - public static function get_all_followers() { - $args = array( - 'nopaging' => true, - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - 'relation' => 'AND', - array( - 'key' => 'activitypub_inbox', - 'compare' => 'EXISTS', - ), - array( - 'key' => 'activitypub_actor_json', - 'compare' => 'EXISTS', - ), - ), - ); - return self::get_followers( null, null, null, $args ); - } - - /** - * Count the total number of followers - * - * @param int $user_id The ID of the WordPress User - * - * @return int The number of Followers - */ - public static function count_followers( $user_id ) { - $query = new WP_Query( - array( - 'post_type' => self::POST_TYPE, - 'fields' => 'ids', - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - 'relation' => 'AND', - array( - 'key' => 'activitypub_user_id', - 'value' => $user_id, - ), - array( - 'key' => 'activitypub_inbox', - 'compare' => 'EXISTS', - ), - array( - 'key' => 'activitypub_actor_json', - 'compare' => 'EXISTS', - ), - ), - ) - ); - - return $query->found_posts; - } - - /** - * Returns all Inboxes fo a Users Followers - * - * @param int $user_id The ID of the WordPress User - * - * @return array The list of Inboxes - */ - public static function get_inboxes( $user_id ) { - $cache_key = sprintf( self::CACHE_KEY_INBOXES, $user_id ); - $inboxes = wp_cache_get( $cache_key, 'activitypub' ); - - if ( $inboxes ) { - return $inboxes; - } - - // get all Followers of a ID of the WordPress User - $posts = new WP_Query( - array( - 'nopaging' => true, - 'post_type' => self::POST_TYPE, - 'fields' => 'ids', - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - 'relation' => 'AND', - array( - 'key' => 'activitypub_inbox', - 'compare' => 'EXISTS', - ), - array( - 'key' => 'activitypub_user_id', - 'value' => $user_id, - ), - array( - 'key' => 'activitypub_inbox', - 'value' => '', - 'compare' => '!=', - ), - ), - ) - ); - - $posts = $posts->get_posts(); - - if ( ! $posts ) { - return array(); - } - - global $wpdb; - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery - $results = $wpdb->get_col( - $wpdb->prepare( - "SELECT DISTINCT meta_value FROM {$wpdb->postmeta} - WHERE post_id IN (" . implode( ', ', array_fill( 0, count( $posts ), '%d' ) ) . ") - AND meta_key = 'activitypub_inbox' - AND meta_value IS NOT NULL", - $posts - ) - ); - - $inboxes = array_filter( $results ); - wp_cache_set( $cache_key, $inboxes, 'activitypub' ); - - return $inboxes; - } - - /** - * Get all Followers that have not been updated for a given time - * - * @param enum $output The output format, supported ARRAY_N, OBJECT and ACTIVITYPUB_OBJECT. - * @param int $number Limits the result. - * @param int $older_than The time in seconds. - * - * @return mixed The Term list of Followers, the format depends on $output. - */ - public static function get_outdated_followers( $number = 50, $older_than = 86400 ) { - $args = array( - 'post_type' => self::POST_TYPE, - 'posts_per_page' => $number, - 'orderby' => 'modified', - 'order' => 'ASC', - 'post_status' => 'any', // 'any' includes 'trash - 'date_query' => array( - array( - 'column' => 'post_modified_gmt', - 'before' => gmdate( 'Y-m-d', \time() - $older_than ), - ), - ), - ); - - $posts = new WP_Query( $args ); - $items = array(); - - foreach ( $posts->get_posts() as $follower ) { - $items[] = Follower::init_from_cpt( $follower ); // phpcs:ignore - } - - return $items; - } - - /** - * Get all Followers that had errors - * - * @param enum $output The output format, supported ARRAY_N, OBJECT and ACTIVITYPUB_OBJECT - * @param integer $number The number of Followers to return. - * - * @return mixed The Term list of Followers, the format depends on $output. - */ - public static function get_faulty_followers( $number = 20 ) { - $args = array( - 'post_type' => self::POST_TYPE, - 'posts_per_page' => $number, - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - 'relation' => 'OR', - array( - 'key' => 'activitypub_errors', - 'compare' => 'EXISTS', - ), - array( - 'key' => 'activitypub_inbox', - 'compare' => 'NOT EXISTS', - ), - array( - 'key' => 'activitypub_actor_json', - 'compare' => 'NOT EXISTS', - ), - array( - 'key' => 'activitypub_inbox', - 'value' => '', - 'compare' => '=', - ), - array( - 'key' => 'activitypub_actor_json', - 'value' => '', - 'compare' => '=', - ), - ), - ); - - $posts = new WP_Query( $args ); - $items = array(); - - foreach ( $posts->get_posts() as $follower ) { - $items[] = Follower::init_from_cpt( $follower ); // phpcs:ignore - } - - return $items; - } - - /** - * This function is used to store errors that occur when - * sending an ActivityPub message to a Follower. - * - * The error will be stored in the - * post meta. - * - * @param int $post_id The ID of the WordPress Custom-Post-Type. - * @param mixed $error The error message. Can be a string or a WP_Error. - * - * @return int|false The meta ID on success, false on failure. - */ - public static function add_error( $post_id, $error ) { - if ( is_string( $error ) ) { - $error_message = $error; - } elseif ( is_wp_error( $error ) ) { - $error_message = $error->get_error_message(); - } else { - $error_message = __( - 'Unknown Error or misconfigured Error-Message', - 'activitypub' - ); - } - - return add_post_meta( - $post_id, - 'activitypub_errors', - $error_message - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-interactions.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-interactions.php deleted file mode 100644 index c29cf259..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-interactions.php +++ /dev/null @@ -1,247 +0,0 @@ -comment_post_ID; - } - - // not a reply to a post or comment - if ( ! $comment_post_id ) { - return false; - } - - $actor = object_to_uri( $activity['actor'] ); - $meta = get_remote_metadata_by_actor( $actor ); - - if ( ! $meta || \is_wp_error( $meta ) ) { - return false; - } - - $url = object_to_uri( $meta['url'] ); - - $commentdata = array( - 'comment_post_ID' => $comment_post_id, - 'comment_author' => isset( $meta['name'] ) ? \esc_attr( $meta['name'] ) : \esc_attr( $meta['preferredUsername'] ), - 'comment_author_url' => \esc_url_raw( $url ), - 'comment_content' => \addslashes( $activity['object']['content'] ), - 'comment_type' => 'comment', - 'comment_author_email' => '', - 'comment_parent' => $parent_comment_id ? $parent_comment_id : 0, - 'comment_meta' => array( - 'source_id' => \esc_url_raw( $activity['object']['id'] ), - 'protocol' => 'activitypub', - ), - ); - - if ( isset( $meta['icon']['url'] ) ) { - $commentdata['comment_meta']['avatar_url'] = \esc_url_raw( $meta['icon']['url'] ); - } - - if ( isset( $activity['object']['url'] ) ) { - $commentdata['comment_meta']['source_url'] = \esc_url_raw( object_to_uri( $activity['object']['url'] ) ); - } - - // disable flood control - \remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 ); - // do not require email for AP entries - \add_filter( 'pre_option_require_name_email', '__return_false' ); - // No nonce possible for this submission route - \add_filter( - 'akismet_comment_nonce', - function () { - return 'inactive'; - } - ); - \add_filter( 'wp_kses_allowed_html', array( self::class, 'allowed_comment_html' ), 10, 2 ); - - $comment = \wp_new_comment( $commentdata, true ); - - \remove_filter( 'wp_kses_allowed_html', array( self::class, 'allowed_comment_html' ), 10 ); - \remove_filter( 'pre_option_require_name_email', '__return_false' ); - // re-add flood control - \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); - - return $comment; - } - - /** - * Update a comment - * - * @param array $activity The activity-object - * - * @return array|string|int|\WP_Error|false The commentdata or false on failure - */ - public static function update_comment( $activity ) { - $meta = get_remote_metadata_by_actor( $activity['actor'] ); - - //Determine comment_ID - $comment = object_id_to_comment( \esc_url_raw( $activity['object']['id'] ) ); - $commentdata = \get_comment( $comment, ARRAY_A ); - - if ( ! $commentdata ) { - return false; - } - - //found a local comment id - $commentdata['comment_author'] = \esc_attr( $meta['name'] ? $meta['name'] : $meta['preferredUsername'] ); - $commentdata['comment_content'] = \addslashes( $activity['object']['content'] ); - if ( isset( $meta['icon']['url'] ) ) { - $commentdata['comment_meta']['avatar_url'] = \esc_url_raw( $meta['icon']['url'] ); - } - - // disable flood control - \remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 ); - // do not require email for AP entries - \add_filter( 'pre_option_require_name_email', '__return_false' ); - // No nonce possible for this submission route - \add_filter( - 'akismet_comment_nonce', - function () { - return 'inactive'; - } - ); - \add_filter( 'wp_kses_allowed_html', array( self::class, 'allowed_comment_html' ), 10, 2 ); - - $state = \wp_update_comment( $commentdata, true ); - - \remove_filter( 'wp_kses_allowed_html', array( self::class, 'allowed_comment_html' ), 10 ); - \remove_filter( 'pre_option_require_name_email', '__return_false' ); - // re-add flood control - \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); - - if ( 1 === $state ) { - return $commentdata; - } else { - return $state; // Either `false` or a `WP_Error` instance or `0` or `1`! - } - } - - /** - * Get interaction(s) for a given URL/ID. - * - * @param strin $url The URL/ID to get interactions for. - * - * @return array The interactions as WP_Comment objects. - */ - public static function get_interaction_by_id( $url ) { - $args = array( - 'nopaging' => true, - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - 'relation' => 'AND', - array( - 'key' => 'protocol', - 'value' => 'activitypub', - ), - array( - 'relation' => 'OR', - array( - 'key' => 'source_url', - 'value' => $url, - ), - array( - 'key' => 'source_id', - 'value' => $url, - ), - ), - ), - ); - - $query = new WP_Comment_Query( $args ); - return $query->comments; - } - - /** - * Get interaction(s) for a given actor. - * - * @param string $actor The Actor-URL. - * - * @return array The interactions as WP_Comment objects. - */ - public static function get_interactions_by_actor( $actor ) { - $meta = get_remote_metadata_by_actor( $actor ); - - // get URL, because $actor seems to be the ID - if ( $meta && ! is_wp_error( $meta ) && isset( $meta['url'] ) ) { - $actor = object_to_uri( $meta['url'] ); - } - - $args = array( - 'nopaging' => true, - 'author_url' => $actor, - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - array( - 'key' => 'protocol', - 'value' => 'activitypub', - 'compare' => '=', - ), - ), - ); - $comment_query = new WP_Comment_Query( $args ); - return $comment_query->comments; - } - - /** - * Adds line breaks to the list of allowed comment tags. - * - * @param array $allowed_tags Allowed HTML tags. - * @param string $context Context. - * - * @return array Filtered tag list. - */ - public static function allowed_comment_html( $allowed_tags, $context = '' ) { - if ( 'pre_comment_content' !== $context ) { - // Do nothing. - return $allowed_tags; - } - - // Add `p` and `br` to the list of allowed tags. - if ( ! array_key_exists( 'br', $allowed_tags ) ) { - $allowed_tags['br'] = array(); - } - - if ( ! array_key_exists( 'p', $allowed_tags ) ) { - $allowed_tags['p'] = array(); - } - - return $allowed_tags; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-users.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-users.php deleted file mode 100644 index e4596b87..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/collection/class-users.php +++ /dev/null @@ -1,278 +0,0 @@ - 404 ) - ); - } - - if ( self::BLOG_USER_ID === $user_id ) { - return new Blog(); - } elseif ( self::APPLICATION_USER_ID === $user_id ) { - return new Application(); - } elseif ( $user_id > 0 ) { - return User::from_wp_user( $user_id ); - } - - return new WP_Error( - 'activitypub_user_not_found', - \__( 'User not found', 'activitypub' ), - array( 'status' => 404 ) - ); - } - - /** - * Get the User by username. - * - * @param string $username The User-Name. - * - * @return \Acitvitypub\Model\User The User. - */ - public static function get_by_username( $username ) { - // check for blog user. - if ( Blog::get_default_username() === $username ) { - return new Blog(); - } - - if ( get_option( 'activitypub_blog_user_identifier' ) === $username ) { - return new Blog(); - } - - // check for application user. - if ( 'application' === $username ) { - return new Application(); - } - - // check for 'activitypub_username' meta - $user = new WP_User_Query( - array( - 'count_total' => false, - 'number' => 1, - 'hide_empty' => true, - 'fields' => 'ID', - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - 'meta_query' => array( - 'relation' => 'OR', - array( - 'key' => 'activitypub_user_identifier', - 'value' => $username, - 'compare' => 'LIKE', - ), - ), - ) - ); - - if ( $user->results ) { - return self::get_by_id( $user->results[0] ); - } - - $username = str_replace( array( '*', '%' ), '', $username ); - - // check for login or nicename. - $user = new WP_User_Query( - array( - 'count_total' => false, - 'search' => $username, - 'search_columns' => array( 'user_login', 'user_nicename' ), - 'number' => 1, - 'hide_empty' => true, - 'fields' => 'ID', - ) - ); - - if ( $user->results ) { - return self::get_by_id( $user->results[0] ); - } - - return new WP_Error( - 'activitypub_user_not_found', - \__( 'User not found', 'activitypub' ), - array( 'status' => 404 ) - ); - } - - /** - * Get the User by resource. - * - * @param string $resource The User-Resource. - * - * @return \Acitvitypub\Model\User The User. - */ - public static function get_by_resource( $resource ) { - $resource = object_to_uri( $resource ); - - $scheme = 'acct'; - $match = array(); - // try to extract the scheme and the host - if ( preg_match( '/^([a-zA-Z^:]+):(.*)$/i', $resource, $match ) ) { - // extract the scheme - $scheme = \esc_attr( $match[1] ); - } - - switch ( $scheme ) { - // check for http(s) URIs - case 'http': - case 'https': - $resource_path = \wp_parse_url( $resource, PHP_URL_PATH ); - - if ( $resource_path ) { - $blog_path = \wp_parse_url( \home_url(), PHP_URL_PATH ); - - if ( $blog_path ) { - $resource_path = \str_replace( $blog_path, '', $resource_path ); - } - - $resource_path = \trim( $resource_path, '/' ); - - // check for http(s)://blog.example.com/@username - if ( str_starts_with( $resource_path, '@' ) ) { - $identifier = \str_replace( '@', '', $resource_path ); - $identifier = \trim( $identifier, '/' ); - - return self::get_by_username( $identifier ); - } - } - - // check for http(s)://blog.example.com/author/username - $user_id = url_to_authorid( $resource ); - - if ( $user_id ) { - return self::get_by_id( $user_id ); - } - - // check for http(s)://blog.example.com/ - if ( - normalize_url( site_url() ) === normalize_url( $resource ) || - normalize_url( home_url() ) === normalize_url( $resource ) - ) { - return self::get_by_id( self::BLOG_USER_ID ); - } - - return new WP_Error( - 'activitypub_no_user_found', - \__( 'User not found', 'activitypub' ), - array( 'status' => 404 ) - ); - // check for acct URIs - case 'acct': - $resource = \str_replace( 'acct:', '', $resource ); - $identifier = \substr( $resource, 0, \strrpos( $resource, '@' ) ); - $host = normalize_host( \substr( \strrchr( $resource, '@' ), 1 ) ); - $blog_host = normalize_host( \wp_parse_url( \home_url( '/' ), \PHP_URL_HOST ) ); - - if ( $blog_host !== $host ) { - return new WP_Error( - 'activitypub_wrong_host', - \__( 'Resource host does not match blog host', 'activitypub' ), - array( 'status' => 404 ) - ); - } - - // prepare wildcards https://github.com/mastodon/mastodon/issues/22213 - if ( in_array( $identifier, array( '_', '*', '' ), true ) ) { - return self::get_by_id( self::BLOG_USER_ID ); - } - - return self::get_by_username( $identifier ); - default: - return new WP_Error( - 'activitypub_wrong_scheme', - \__( 'Wrong scheme', 'activitypub' ), - array( 'status' => 404 ) - ); - } - } - - /** - * Get the User by resource. - * - * @param string $resource The User-Resource. - * - * @return \Acitvitypub\Model\User The User. - */ - public static function get_by_various( $id ) { - $user = null; - - if ( is_numeric( $id ) ) { - $user = self::get_by_id( $id ); - } elseif ( - // is URL - filter_var( $id, FILTER_VALIDATE_URL ) || - // is acct - str_starts_with( $id, 'acct:' ) || - // is email - filter_var( $id, FILTER_VALIDATE_EMAIL ) - ) { - $user = self::get_by_resource( $id ); - } - - if ( $user && ! is_wp_error( $user ) ) { - return $user; - } - - return self::get_by_username( $id ); - } - - /** - * Get the User collection. - * - * @return array The User collection. - */ - public static function get_collection() { - $users = \get_users( - array( - 'capability__in' => array( 'activitypub' ), - ) - ); - - $return = array(); - - foreach ( $users as $user ) { - $return[] = User::from_wp_user( $user->ID ); - } - - return $return; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/compat.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/compat.php deleted file mode 100644 index 8c274c88..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/compat.php +++ /dev/null @@ -1,99 +0,0 @@ - $v ) { - if ( ++$next_key !== $k ) { - return false; - } - } - - return true; - } -} - -if ( ! function_exists( 'str_contains' ) ) { - /** - * Polyfill for `str_contains()` function added in PHP 8.0. - * - * Performs a case-sensitive check indicating if needle is - * contained in haystack. - * - * @param string $haystack The string to search in. - * @param string $needle The substring to search for in the `$haystack`. - * - * @return bool True if `$needle` is in `$haystack`, otherwise false. - */ - function str_contains( $haystack, $needle ) { - if ( '' === $needle ) { - return true; - } - - return false !== strpos( $haystack, $needle ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/debug.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/debug.php deleted file mode 100644 index d42b2a9a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/debug.php +++ /dev/null @@ -1,17 +0,0 @@ - 404, 'actor' => $actor ) ); - } - } - - if ( preg_match( '/^@?' . ACTIVITYPUB_USERNAME_REGEXP . '$/i', $actor ) ) { - $actor = Webfinger::resolve( $actor ); - } - - if ( ! $actor ) { - return new WP_Error( 'activitypub_no_valid_actor_identifier', \__( 'The "actor" identifier is not valid', 'activitypub' ), array( 'status' => 404, 'actor' => $actor ) ); - } - - if ( is_wp_error( $actor ) ) { - return $actor; - } - - $transient_key = 'activitypub_' . $actor; - - // only check the cache if needed. - if ( $cached ) { - $metadata = \get_transient( $transient_key ); - - if ( $metadata ) { - return $metadata; - } - } - - if ( ! \wp_http_validate_url( $actor ) ) { - $metadata = new WP_Error( 'activitypub_no_valid_actor_url', \__( 'The "actor" is no valid URL', 'activitypub' ), array( 'status' => 400, 'actor' => $actor ) ); - return $metadata; - } - - $response = Http::get( $actor ); - - if ( \is_wp_error( $response ) ) { - return $response; - } - - $metadata = \wp_remote_retrieve_body( $response ); - $metadata = \json_decode( $metadata, true ); - - if ( ! $metadata ) { - $metadata = new WP_Error( 'activitypub_invalid_json', \__( 'No valid JSON data', 'activitypub' ), array( 'status' => 400, 'actor' => $actor ) ); - return $metadata; - } - - \set_transient( $transient_key, $metadata, WEEK_IN_SECONDS ); - - return $metadata; -} - -/** - * Returns the followers of a given user. - * - * @param int $user_id The User-ID. - * - * @return array The followers. - */ -function get_followers( $user_id ) { - return Followers::get_followers( $user_id ); -} - -/** - * Count the number of followers for a given user. - * - * @param int $user_id The User-ID. - * - * @return int The number of followers. - */ -function count_followers( $user_id ) { - return Followers::count_followers( $user_id ); -} - -/** - * Examine a url and try to determine the author ID it represents. - * - * Checks are supposedly from the hosted site blog. - * - * @param string $url Permalink to check. - * - * @return int User ID, or 0 on failure. - */ -function url_to_authorid( $url ) { - global $wp_rewrite; - - // check if url hase the same host - if ( \wp_parse_url( \home_url(), \PHP_URL_HOST ) !== \wp_parse_url( $url, \PHP_URL_HOST ) ) { - return 0; - } - - // first, check to see if there is a 'author=N' to match against - if ( \preg_match( '/[?&]author=(\d+)/i', $url, $values ) ) { - $id = \absint( $values[1] ); - if ( $id ) { - return $id; - } - } - - // check to see if we are using rewrite rules - $rewrite = $wp_rewrite->wp_rewrite_rules(); - - // not using rewrite rules, and 'author=N' method failed, so we're out of options - if ( empty( $rewrite ) ) { - return 0; - } - - // generate rewrite rule for the author url - $author_rewrite = $wp_rewrite->get_author_permastruct(); - $author_regexp = \str_replace( '%author%', '', $author_rewrite ); - - // match the rewrite rule with the passed url - if ( \preg_match( '/https?:\/\/(.+)' . \preg_quote( $author_regexp, '/' ) . '([^\/]+)/i', $url, $match ) ) { - $user = \get_user_by( 'slug', $match[2] ); - if ( $user ) { - return $user->ID; - } - } - - return 0; -} - -/** - * Verify if url is a wp_ap_comment, - * Or if it is a previously received remote comment - * - * @return int comment_id - */ -function is_comment() { - $comment_id = get_query_var( 'c', null ); - - if ( ! is_null( $comment_id ) ) { - $comment = \get_comment( $comment_id ); - - // Only return local origin comments - if ( $comment && $comment->user_id ) { - return $comment_id; - } - } - - return false; -} - -/** - * Check for Tombstone Objects - * - * @see https://www.w3.org/TR/activitypub/#delete-activity-outbox - * - * @param WP_Error $wp_error A WP_Error-Response of an HTTP-Request - * - * @return boolean true if HTTP-Code is 410 or 404 - */ -function is_tombstone( $wp_error ) { - if ( ! is_wp_error( $wp_error ) ) { - return false; - } - - if ( in_array( (int) $wp_error->get_error_code(), array( 404, 410 ), true ) ) { - return true; - } - - return false; -} - -/** - * Get the REST URL relative to this plugin's namespace. - * - * @param string $path Optional. REST route path. Otherwise this plugin's namespaced root. - * - * @return string REST URL relative to this plugin's namespace. - */ -function get_rest_url_by_path( $path = '' ) { - // we'll handle the leading slash. - $path = ltrim( $path, '/' ); - $namespaced_path = sprintf( '/%s/%s', ACTIVITYPUB_REST_NAMESPACE, $path ); - return \get_rest_url( null, $namespaced_path ); -} - -/** - * Convert a string from camelCase to snake_case. - * - * @param string $string The string to convert. - * - * @return string The converted string. - */ -// phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.stringFound -function camel_to_snake_case( $string ) { - return strtolower( preg_replace( '/(?query_vars['activitypub'] ) ) { - return true; - } - - /* - * The other (more common) option to make an ActivityPub request - * is to send an Accept header. - */ - if ( isset( $_SERVER['HTTP_ACCEPT'] ) ) { - $accept = sanitize_text_field( wp_unslash( $_SERVER['HTTP_ACCEPT'] ) ); - - /* - * $accept can be a single value, or a comma separated list of values. - * We want to support both scenarios, - * and return true when the header includes at least one of the following: - * - application/activity+json - * - application/ld+json - * - application/json - */ - if ( preg_match( '/(application\/(ld\+json|activity\+json|json))/i', $accept ) ) { - return true; - } - } - - return false; -} - -/** - * This function checks if a user is disabled for ActivityPub. - * - * @param int $user_id The User-ID. - * - * @return boolean True if the user is disabled, false otherwise. - */ -function is_user_disabled( $user_id ) { - $return = false; - - switch ( $user_id ) { - // if the user is the application user, it's always enabled. - case \Activitypub\Collection\Users::APPLICATION_USER_ID: - $return = false; - break; - // if the user is the blog user, it's only enabled in single-user mode. - case \Activitypub\Collection\Users::BLOG_USER_ID: - if ( is_user_type_disabled( 'blog' ) ) { - $return = true; - break; - } - - $return = false; - break; - // if the user is any other user, it's enabled if it can publish posts. - default: - if ( ! \get_user_by( 'id', $user_id ) ) { - $return = true; - break; - } - - if ( is_user_type_disabled( 'user' ) ) { - $return = true; - break; - } - - if ( ! \user_can( $user_id, 'activitypub' ) ) { - $return = true; - break; - } - - $return = false; - break; - } - - return apply_filters( 'activitypub_is_user_disabled', $return, $user_id ); -} - -/** - * Checks if a User-Type is disabled for ActivityPub. - * - * This function is used to check if the 'blog' or 'user' - * type is disabled for ActivityPub. - * - * @param enum $type Can be 'blog' or 'user'. - * - * @return boolean True if the user type is disabled, false otherwise. - */ -function is_user_type_disabled( $type ) { - switch ( $type ) { - case 'blog': - if ( \defined( 'ACTIVITYPUB_SINGLE_USER_MODE' ) ) { - if ( ACTIVITYPUB_SINGLE_USER_MODE ) { - $return = false; - break; - } - } - - if ( \defined( 'ACTIVITYPUB_DISABLE_BLOG_USER' ) ) { - $return = ACTIVITYPUB_DISABLE_BLOG_USER; - break; - } - - if ( '1' !== \get_option( 'activitypub_enable_blog_user', '0' ) ) { - $return = true; - break; - } - - $return = false; - break; - case 'user': - if ( \defined( 'ACTIVITYPUB_SINGLE_USER_MODE' ) ) { - if ( ACTIVITYPUB_SINGLE_USER_MODE ) { - $return = true; - break; - } - } - - if ( \defined( 'ACTIVITYPUB_DISABLE_USER' ) ) { - $return = ACTIVITYPUB_DISABLE_USER; - break; - } - - if ( '1' !== \get_option( 'activitypub_enable_users', '1' ) ) { - $return = true; - break; - } - - $return = false; - break; - default: - $return = new WP_Error( 'activitypub_wrong_user_type', __( 'Wrong user type', 'activitypub' ), array( 'status' => 400 ) ); - break; - } - - return apply_filters( 'activitypub_is_user_type_disabled', $return, $type ); -} - -/** - * Check if the blog is in single-user mode. - * - * @return boolean True if the blog is in single-user mode, false otherwise. - */ -function is_single_user() { - if ( - false === is_user_type_disabled( 'blog' ) && - true === is_user_type_disabled( 'user' ) - ) { - return true; - } - - return false; -} - -/** - * Check if a site supports the block editor. - * - * @return boolean True if the site supports the block editor, false otherwise. - */ -function site_supports_blocks() { - if ( \version_compare( \get_bloginfo( 'version' ), '5.9', '<' ) ) { - return false; - } - - if ( ! \function_exists( 'register_block_type_from_metadata' ) ) { - return false; - } - - /** - * Allow plugins to disable block editor support, - * thus disabling blocks registered by the ActivityPub plugin. - * - * @param boolean $supports_blocks True if the site supports the block editor, false otherwise. - */ - return apply_filters( 'activitypub_site_supports_blocks', true ); -} - -/** - * Check if data is valid JSON. - * - * @param string $data The data to check. - * - * @return boolean True if the data is JSON, false otherwise. - */ -function is_json( $data ) { - return \is_array( \json_decode( $data, true ) ) ? true : false; -} - -/** - * Check if a blog is public based on the `blog_public` option - * - * @return bollean True if public, false if not - */ -function is_blog_public() { - return (bool) apply_filters( 'activitypub_is_blog_public', \get_option( 'blog_public', 1 ) ); -} - -/** - * Sanitize a URL - * - * @param string $value The URL to sanitize - * - * @return string|null The sanitized URL or null if invalid - */ -function sanitize_url( $value ) { - if ( filter_var( $value, FILTER_VALIDATE_URL ) === false ) { - return null; - } - - return esc_url_raw( $value ); -} - -/** - * Extract recipient URLs from Activity object - * - * @param array $data - * - * @return array The list of user URLs - */ -function extract_recipients_from_activity( $data ) { - $recipient_items = array(); - - foreach ( array( 'to', 'bto', 'cc', 'bcc', 'audience' ) as $i ) { - if ( array_key_exists( $i, $data ) ) { - if ( is_array( $data[ $i ] ) ) { - $recipient = $data[ $i ]; - } else { - $recipient = array( $data[ $i ] ); - } - $recipient_items = array_merge( $recipient_items, $recipient ); - } - - if ( is_array( $data['object'] ) && array_key_exists( $i, $data['object'] ) ) { - if ( is_array( $data['object'][ $i ] ) ) { - $recipient = $data['object'][ $i ]; - } else { - $recipient = array( $data['object'][ $i ] ); - } - $recipient_items = array_merge( $recipient_items, $recipient ); - } - } - - $recipients = array(); - - // flatten array - foreach ( $recipient_items as $recipient ) { - if ( is_array( $recipient ) ) { - // check if recipient is an object - if ( array_key_exists( 'id', $recipient ) ) { - $recipients[] = $recipient['id']; - } - } else { - $recipients[] = $recipient; - } - } - - return array_unique( $recipients ); -} - -/** - * Check if passed Activity is Public - * - * @param array $data The Activity object as array - * - * @return boolean True if public, false if not - */ -function is_activity_public( $data ) { - $recipients = extract_recipients_from_activity( $data ); - - return in_array( 'https://www.w3.org/ns/activitystreams#Public', $recipients, true ); -} - -/** - * Get active users based on a given duration - * - * @param int $duration The duration to check in month(s) - * - * @return int The number of active users - */ -function get_active_users( $duration = 1 ) { - - $duration = intval( $duration ); - $transient_key = sprintf( 'monthly_active_users_%d', $duration ); - $count = get_transient( $transient_key ); - - if ( false === $count ) { - global $wpdb; - $query = "SELECT COUNT( DISTINCT post_author ) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' AND post_date <= DATE_SUB( NOW(), INTERVAL %d MONTH )"; - $query = $wpdb->prepare( $query, $duration ); - $count = $wpdb->get_var( $query ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching - - set_transient( $transient_key, $count, DAY_IN_SECONDS ); - } - - // if 0 authors where active - if ( 0 === $count ) { - return 0; - } - - // if single user mode - if ( is_single_user() ) { - return 1; - } - - // if blog user is disabled - if ( is_user_disabled( Users::BLOG_USER_ID ) ) { - return $count; - } - - // also count blog user - return $count + 1; -} - -/** - * Get the total number of users - * - * @return int The total number of users - */ -function get_total_users() { - // if single user mode - if ( is_single_user() ) { - return 1; - } - - $users = \get_users( - array( - 'capability__in' => array( 'activitypub' ), - ) - ); - - if ( is_array( $users ) ) { - $users = count( $users ); - } else { - $users = 1; - } - - // if blog user is disabled - if ( is_user_disabled( Users::BLOG_USER_ID ) ) { - return $users; - } - - return $users + 1; -} - -/** - * Examine a comment ID and look up an existing comment it represents. - * - * @param string $id ActivityPub object ID (usually a URL) to check. - * - * @return int|boolean Comment ID, or false on failure. - */ -function object_id_to_comment( $id ) { - return Comment::object_id_to_comment( $id ); -} - -/** - * Verify if URL is a local comment, - * Or if it is a previously received remote comment - * (For threading comments locally) - * - * @param string $url The URL to check. - * - * @return int comment_ID or null if not found - */ -function url_to_commentid( $url ) { - return Comment::url_to_commentid( $url ); -} - -/** - * Get the URI of an ActivityPub object - * - * @param array $object The ActivityPub object - * - * @return string The URI of the ActivityPub object - */ -function object_to_uri( $object ) { - // check if it is already simple - if ( ! $object || is_string( $object ) ) { - return $object; - } - - // check if it is a list, then take first item - // this plugin does not support collections - if ( array_is_list( $object ) ) { - $object = $object[0]; - } - - // check if it is simplified now - if ( is_string( $object ) ) { - return $object; - } - - // return part of Object that makes most sense - switch ( $object['type'] ) { - case 'Link': - $object = $object['href']; - break; - default: - $object = $object['id']; - break; - } - - return $object; -} - -/** - * Check if a comment should be federated. - * - * We consider a comment should be federated if it is authored by a user that is - * not disabled for federation and if it is a reply directly to the post or to a - * federated comment. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment should be federated, false otherwise. - */ -function should_comment_be_federated( $comment ) { - return Comment::should_be_federated( $comment ); -} - -/** - * Check if a comment was federated. - * - * This function checks if a comment was federated via ActivityPub. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment was federated, false otherwise. - */ -function was_comment_sent( $comment ) { - return Comment::was_sent( $comment ); -} - -/** - * Check if a comment is federated. - * - * We consider a comment federated if comment was received via ActivityPub. - * - * Use this function to check if it is comment that was received via ActivityPub. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment is federated, false otherwise. - */ -function was_comment_received( $comment ) { - return Comment::was_received( $comment ); -} - -/** - * Check if a comment is local only. - * - * This function checks if a comment is local only and was not sent or received via ActivityPub. - * - * @param mixed $comment Comment object or ID. - * - * @return boolean True if the comment is local only, false otherwise. - */ -function is_local_comment( $comment ) { - return Comment::is_local( $comment ); -} - -/** - * Mark a WordPress object as federated. - * - * @param WP_Comment|WP_Post|mixed $wp_object - * - * @return void - */ -function set_wp_object_state( $wp_object, $state ) { - $meta_key = 'activitypub_status'; - - if ( $wp_object instanceof \WP_Post ) { - \update_post_meta( $wp_object->ID, $meta_key, $state ); - } elseif ( $wp_object instanceof \WP_Comment ) { - \update_comment_meta( $wp_object->comment_ID, $meta_key, $state ); - } else { - \apply_filters( 'activitypub_mark_wp_object_as_federated', $wp_object ); - } -} - -/** - * Get the federation state of a WordPress object. - * - * @param WP_Comment|WP_Post|mixed $wp_object - * - * @return string|false The state of the object or false if not found. - */ -function get_wp_object_state( $wp_object ) { - $meta_key = 'activitypub_status'; - - if ( $wp_object instanceof \WP_Post ) { - return \get_post_meta( $wp_object->ID, $meta_key, true ); - } elseif ( $wp_object instanceof \WP_Comment ) { - return \get_comment_meta( $wp_object->comment_ID, $meta_key, true ); - } else { - return \apply_filters( 'activitypub_get_wp_object_state', false, $wp_object ); - } -} - -/** - * Get the description of a post type. - * - * Set some default descriptions for the default post types. - * - * @param WP_Post_Type $post_type The post type object. - * - * @return string The description of the post type. - */ -function get_post_type_description( $post_type ) { - $description = ''; - - switch ( $post_type->name ) { - case 'post': - $description = ''; - break; - case 'page': - $description = ''; - break; - case 'attachment': - $description = ' - ' . __( 'The attachments that you have uploaded to a post (images, videos, documents or other files).', 'activitypub' ); - break; - default: - if ( ! empty( $post_type->description ) ) { - $description = ' - ' . $post_type->description; - } - } - - return apply_filters( 'activitypub_post_type_description', $description, $post_type->name, $post_type ); -} - -/** - * Get the masked WordPress version to only show the major and minor version. - * - * @return string The masked version. - */ -function get_masked_wp_version() { - // only show the major and minor version - $version = get_bloginfo( 'version' ); - // strip the RC or beta part - $version = preg_replace( '/-.*$/', '', $version ); - $version = explode( '.', $version ); - $version = array_slice( $version, 0, 2 ); - - return implode( '.', $version ); -} - -/** - * Get the enclosures of a post. - * - * @param int $post_id The post ID. - * - * @return array The enclosures. - */ -function get_enclosures( $post_id ) { - $enclosures = get_post_meta( $post_id, 'enclosure' ); - - if ( ! $enclosures ) { - return array(); - } - - $enclosures = array_map( - function ( $enclosure ) { - $attributes = explode( "\n", $enclosure ); - - if ( ! isset( $attributes[0] ) || ! \wp_http_validate_url( $attributes[0] ) ) { - return false; - } - - return array( - 'url' => $attributes[0], - 'length' => isset( $attributes[1] ) ? trim( $attributes[1] ) : null, - 'mediaType' => isset( $attributes[2] ) ? trim( $attributes[2] ) : null, - ); - }, - $enclosures - ); - - return array_filter( $enclosures ); -} - -/** - * Retrieves the IDs of the ancestors of a comment. - * - * Adaption of `get_post_ancestors` from WordPress core. - * - * @see https://developer.wordpress.org/reference/functions/get_post_ancestors/ - * - * @param int|WP_Comment $comment Comment ID or comment object. - * - * @return WP_Comment[] Array of ancestor comments or empty array if there are none. - */ -function get_comment_ancestors( $comment ) { - $comment = \get_comment( $comment ); - - // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual - if ( ! $comment || empty( $comment->comment_parent ) || $comment->comment_parent == $comment->comment_ID ) { - return array(); - } - - $ancestors = array(); - - $id = (int) $comment->comment_parent; - $ancestors[] = $id; - - // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition - while ( $id > 0 ) { - $ancestor = \get_comment( $id ); - $parent_id = (int) $ancestor->comment_parent; - - // Loop detection: If the ancestor has been seen before, break. - if ( empty( $parent_id ) || ( $parent_id === (int) $comment->comment_ID ) || in_array( $parent_id, $ancestors, true ) ) { - break; - } - - $id = $parent_id; - $ancestors[] = $id; - } - - return $ancestors; -} - -/** - * Change the display of large numbers on the site. - * - * @author Jeremy Herve - * - * @see https://wordpress.org/support/topic/abbreviate-numbers-with-k/ - * - * @param string $formatted Converted number in string format. - * @param float $number The number to convert based on locale. - * @param int $decimals Precision of the number of decimal places. - * - * @return string Converted number in string format. - */ -function custom_large_numbers( $formatted, $number, $decimals ) { - global $wp_locale; - - $decimals = 0; - $decimal_point = '.'; - $thousands_sep = ','; - - if ( isset( $wp_locale ) ) { - $decimals = (int) $wp_locale->number_format['decimal_point']; - $decimal_point = $wp_locale->number_format['decimal_point']; - $thousands_sep = $wp_locale->number_format['thousands_sep']; - } - - if ( $number < 1000 ) { // any number less than a Thousand. - return \number_format( $number, $decimals, $decimal_point, $thousands_sep ); - } elseif ( $number < 1000000 ) { // any number less than a million - return \number_format( $number / 1000, $decimals, $decimal_point, $thousands_sep ) . 'K'; - } elseif ( $number < 1000000000 ) { // any number less than a billion - return \number_format( $number / 1000000, $decimals, $decimal_point, $thousands_sep ) . 'M'; - } else { // at least a billion - return \number_format( $number / 1000000000, $decimals, $decimal_point, $thousands_sep ) . 'B'; - } - - // Default fallback. We should not get here. - return $formatted; -} - -/** - * Normalize a URL. - * - * @param string $url The URL. - * - * @return string The normalized URL. - */ -function normalize_url( $url ) { - $url = \untrailingslashit( $url ); - $url = \str_replace( 'https://', '', $url ); - $url = \str_replace( 'http://', '', $url ); - $url = \str_replace( 'www.', '', $url ); - - return $url; -} - -/** - * Normalize a host. - * - * @param string $host The host. - * - * @return string The normalized host. - */ -function normalize_host( $host ) { - return \str_replace( 'www.', '', $host ); -} - -/** - * Get the Extra Fields of an Actor - * - * @param int $user_id The User-ID. - * - * @return array The extra fields. - */ -function get_actor_extra_fields( $user_id ) { - $extra_fields = new WP_Query( - array( - 'post_type' => 'ap_extrafield', - 'nopaging' => true, - 'status' => 'publish', - 'author' => $user_id, - ) - ); - - if ( $extra_fields->have_posts() ) { - $extra_fields = $extra_fields->posts; - } else { - $extra_fields = array(); - } - - return apply_filters( 'activitypub_get_actor_extra_fields', $extra_fields, $user_id ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-announce.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-announce.php deleted file mode 100644 index 46db2a3b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-announce.php +++ /dev/null @@ -1,69 +0,0 @@ -delete(); - self::maybe_delete_interactions( $activity ); - } - } - - /** - * Delete Reactions if Actor-URL is a Tombstone. - * - * @param array $activity The delete activity. - */ - public static function maybe_delete_interactions( $activity ) { - // verify if Actor is deleted. - if ( Http::is_tombstone( $activity['actor'] ) ) { - \wp_schedule_single_event( - \time(), - 'activitypub_delete_actor_interactions', - array( $activity['actor'] ) - ); - } - } - - /** - * Delete comments from an Actor. - * - * @param array $comments The comments to delete. - */ - public static function delete_interactions( $actor ) { - $comments = Interactions::get_interactions_by_actor( $actor ); - - if ( is_array( $comments ) ) { - foreach ( $comments as $comment ) { - wp_delete_comment( $comment->comment_ID ); - } - } - } - - /** - * Delete a Reaction if URL is a Tombstone. - * - * @param array $activity The delete activity. - * - * @return void - */ - public static function maybe_delete_interaction( $activity ) { - if ( is_array( $activity['object'] ) ) { - $id = $activity['object']['id']; - } else { - $id = $activity['object']; - } - - $comments = Interactions::get_interaction_by_id( $id ); - - if ( $comments && Http::is_tombstone( $id ) ) { - foreach ( $comments as $comment ) { - wp_delete_comment( $comment->comment_ID, true ); - } - } - } - - /** - * Defer signature verification for `Delete` requests. - * - * @param bool $defer Whether to defer signature verification. - * @param WP_REST_Request $request The request object. - * - * @return bool Whether to defer signature verification. - */ - public static function defer_signature_verification( $defer, $request ) { - $json = $request->get_json_params(); - - if ( isset( $json['type'] ) && 'Delete' === $json['type'] ) { - return true; - } - - return false; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-follow.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-follow.php deleted file mode 100644 index ed29dadf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-follow.php +++ /dev/null @@ -1,119 +0,0 @@ -get__id(); - - // save follower - $follower = Followers::add_follower( - $user_id, - $activity['actor'] - ); - - do_action( - 'activitypub_followers_post_follow', - $activity['actor'], - $activity, - $user_id, - $follower - ); - - // send notification - $notification = new Notification( - 'follow', - $activity['actor'], - $activity, - $user_id - ); - $notification->send(); - } - - /** - * Send Accept response - * - * @param string $actor The Actor URL - * @param array $object The Activity object - * @param int $user_id The ID of the WordPress User - * @param Activitypub\Model\Follower $follower The Follower object - * - * @return void - */ - public static function send_follow_response( $actor, $object, $user_id, $follower ) { - if ( \is_wp_error( $follower ) ) { - // it is not even possible to send a "Reject" because - // we can not get the Remote-Inbox - return; - } - - // only send minimal data - $object = array_intersect_key( - $object, - array_flip( - array( - 'id', - 'type', - 'actor', - 'object', - ) - ) - ); - - $user = Users::get_by_id( $user_id ); - - // get inbox - $inbox = $follower->get_shared_inbox(); - - // send "Accept" activity - $activity = new Activity(); - $activity->set_type( 'Accept' ); - $activity->set_object( $object ); - $activity->set_actor( $user->get_id() ); - $activity->set_to( $actor ); - $activity->set_id( $user->get_id() . '#follow-' . \preg_replace( '~^https?://~', '', $actor ) . '-' . \time() ); - - $activity = $activity->to_json(); - - Http::post( $inbox, $activity, $user_id ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-undo.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-undo.php deleted file mode 100644 index 5e222daa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-undo.php +++ /dev/null @@ -1,50 +0,0 @@ -get__id(); - $actor = object_to_uri( $activity['actor'] ); - - Followers::remove_follower( $user_id, $actor ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-update.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-update.php deleted file mode 100644 index 0542d560..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/handler/class-update.php +++ /dev/null @@ -1,95 +0,0 @@ -add_help_tab( - array( - 'id' => 'template-tags', - 'title' => \__( 'Template Tags', 'activitypub' ), - 'content' => - '

' . __( 'The following Template Tags are available:', 'activitypub' ) . '

' . - '
' . - '
[ap_title]
' . - '
' . \wp_kses( __( 'The post\'s title.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_content apply_filters="yes"]
' . - '
' . \wp_kses( __( 'The post\'s content. With apply_filters you can decide if filters (apply_filters( \'the_content\', $content )) should be applied or not (default is yes). The values can be yes or no. apply_filters attribute is optional.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_excerpt length="400"]
' . - '
' . \wp_kses( __( 'The post\'s excerpt (uses the_excerpt if that is set). If no excerpt is provided, will truncate at length (optional, default = 400).', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_permalink type="url"]
' . - '
' . \wp_kses( __( 'The post\'s permalink. type can be either: url or html (an <a /> tag). type attribute is optional.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_shortlink type="url"]
' . - '
' . \wp_kses( __( 'The post\'s shortlink. type can be either url or html (an <a /> tag). I can recommend Hum, to prettify the Shortlinks. type attribute is optional.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_hashtags]
' . - '
' . \wp_kses( __( 'The post\'s tags as hashtags.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_hashcats]
' . - '
' . \wp_kses( __( 'The post\'s categories as hashtags.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_image type=full]
' . - '
' . \wp_kses( __( 'The URL for the post\'s featured image, defaults to full size. The type attribute can be any of the following: thumbnail, medium, large, full. type attribute is optional.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_author]
' . - '
' . \wp_kses( __( 'The author\'s name.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_authorurl]
' . - '
' . \wp_kses( __( 'The URL to the author\'s profile page.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_date]
' . - '
' . \wp_kses( __( 'The post\'s date.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_time]
' . - '
' . \wp_kses( __( 'The post\'s time.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_datetime]
' . - '
' . \wp_kses( __( 'The post\'s date/time formated as "date @ time".', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_blogurl]
' . - '
' . \wp_kses( __( 'The URL to the site.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_blogname]
' . - '
' . \wp_kses( __( 'The name of the site.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
[ap_blogdesc]
' . - '
' . \wp_kses( __( 'The description of the site.', 'activitypub' ), array( 'code' => array() ) ) . '
' . - '
' . - '

' . __( 'You may also use any Shortcode normally available to you on your site, however be aware that Shortcodes may significantly increase the size of your content depending on what they do.', 'activitypub' ) . '

' . - '

' . __( 'Note: the old Template Tags are now deprecated and automatically converted to the new ones.', 'activitypub' ) . '

' . - '

' . \wp_kses( \__( 'Let me know if you miss a Template Tag.', 'activitypub' ), 'activitypub' ) . '

', - ) -); - -\get_current_screen()->add_help_tab( - array( - 'id' => 'glossary', - 'title' => \__( 'Glossary', 'activitypub' ), - 'content' => - '

' . \__( 'Fediverse', 'activitypub' ) . '

' . - '

' . \__( 'The Fediverse is a new word made of two words: "federation" + "universe"', 'activitypub' ) . '

' . - '

' . \__( 'It is a federated social network running on free open software on a myriad of computers across the globe. Many independent servers are interconnected and allow people to interact with one another. There\'s no one central site: you choose a server to register. This ensures some decentralization and sovereignty of data. Fediverse (also called Fedi) has no built-in advertisements, no tricky algorithms, no one big corporation dictating the rules. Instead we have small cozy communities of like-minded people. Welcome!', 'activitypub' ) . '

' . - '

' . \__( 'For more informations please visit fediverse.party', 'activitypub' ) . '

' . - '

' . \__( 'ActivityPub', 'activitypub' ) . '

' . - '

' . \__( 'ActivityPub is a decentralized social networking protocol based on the ActivityStreams 2.0 data format. ActivityPub is an official W3C recommended standard published by the W3C Social Web Working Group. It provides a client to server API for creating, updating and deleting content, as well as a federated server to server API for delivering notifications and subscribing to content.', 'activitypub' ) . '

' . - '

' . \__( 'WebFinger', 'activitypub' ) . '

' . - '

' . \__( 'WebFinger is used to discover information about people or other entities on the Internet that are identified by a URI using standard Hypertext Transfer Protocol (HTTP) methods over a secure transport. A WebFinger resource returns a JavaScript Object Notation (JSON) object describing the entity that is queried. The JSON object is referred to as the JSON Resource Descriptor (JRD).', 'activitypub' ) . '

' . - '

' . \__( 'For a person, the type of information that might be discoverable via WebFinger includes a personal profile address, identity service, telephone number, or preferred avatar. For other entities on the Internet, a WebFinger resource might return JRDs containing link relations that enable a client to discover, for example, that a printer can print in color on A4 paper, the physical location of a server, or other static information.', 'activitypub' ) . '

' . - '

' . \__( 'On Mastodon [and other Plattforms], user profiles can be hosted either locally on the same website as yours, or remotely on a completely different website. The same username may be used on a different domain. Therefore, a Mastodon user\'s full mention consists of both the username and the domain, in the form @username@domain. In practical terms, @user@example.com is not the same as @user@example.org. If the domain is not included, Mastodon will try to find a local user named @username. However, in order to deliver to someone over ActivityPub, the @username@domain mention is not enough – mentions must be translated to an HTTPS URI first, so that the remote actor\'s inbox and outbox can be found. (This paragraph is copied from the Mastodon Documentation)', 'activitypub' ) . '

' . - '

' . \__( 'For more informations please visit webfinger.net', 'activitypub' ) . '

' . - '

' . \__( 'NodeInfo', 'activitypub' ) . '

' . - '

' . \__( 'NodeInfo is an effort to create a standardized way of exposing metadata about a server running one of the distributed social networks. The two key goals are being able to get better insights into the user base of distributed social networking and the ability to build tools that allow users to choose the best fitting software and server for their needs.', 'activitypub' ) . '

' . - '

' . \__( 'For more informations please visit nodeinfo.diaspora.software', 'activitypub' ) . '

', - ) -); - -\get_current_screen()->set_help_sidebar( - '

' . \__( 'For more information:', 'activitypub' ) . '

' . - '

' . \__( 'Get support', 'activitypub' ) . '

' . - '

' . \__( 'Report an issue', 'activitypub' ) . '

' -); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-application.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-application.php deleted file mode 100644 index 35c57d64..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-application.php +++ /dev/null @@ -1,204 +0,0 @@ - - */ - protected $webfinger; - - public function get_type() { - return 'Application'; - } - - public function get_manually_approves_followers() { - return true; - } - - public function get_id() { - return get_rest_url_by_path( 'application' ); - } - - /** - * Get the User-Url. - * - * @return string The User-Url. - */ - public function get_url() { - return $this->get_id(); - } - - /** - * Returns the User-URL with @-Prefix for the username. - * - * @return string The User-URL with @-Prefix for the username. - */ - public function get_alternate_url() { - return $this->get_url(); - } - - public function get_name() { - return 'application'; - } - - public function get_preferred_username() { - return $this->get_name(); - } - - /** - * Get the User-Icon. - * - * @return array The User-Icon. - */ - public function get_icon() { - // try site icon first - $icon_id = get_option( 'site_icon' ); - - // try custom logo second - if ( ! $icon_id ) { - $icon_id = get_theme_mod( 'custom_logo' ); - } - - $icon_url = false; - - if ( $icon_id ) { - $icon = wp_get_attachment_image_src( $icon_id, 'full' ); - if ( $icon ) { - $icon_url = $icon[0]; - } - } - - if ( ! $icon_url ) { - // fallback to default icon - $icon_url = plugins_url( '/assets/img/wp-logo.png', ACTIVITYPUB_PLUGIN_FILE ); - } - - return array( - 'type' => 'Image', - 'url' => esc_url( $icon_url ), - ); - } - - /** - * Get the User-Header-Image. - * - * @return array|null The User-Header-Image. - */ - public function get_header_image() { - if ( \has_header_image() ) { - return array( - 'type' => 'Image', - 'url' => esc_url( \get_header_image() ), - ); - } - - return null; - } - - public function get_published() { - $first_post = new WP_Query( - array( - 'orderby' => 'date', - 'order' => 'ASC', - 'number' => 1, - ) - ); - - if ( ! empty( $first_post->posts[0] ) ) { - $time = \strtotime( $first_post->posts[0]->post_date_gmt ); - } else { - $time = \time(); - } - - return \gmdate( 'Y-m-d\TH:i:s\Z', $time ); - } - - /** - * Returns the Inbox-API-Endpoint. - * - * @return string The Inbox-Endpoint. - */ - public function get_inbox() { - return get_rest_url_by_path( sprintf( 'actors/%d/inbox', $this->get__id() ) ); - } - - /** - * Returns the Outbox-API-Endpoint. - * - * @return string The Outbox-Endpoint. - */ - public function get_outbox() { - return get_rest_url_by_path( sprintf( 'actors/%d/outbox', $this->get__id() ) ); - } - - /** - * Returns a user@domain type of identifier for the user. - * - * @return string The Webfinger-Identifier. - */ - public function get_webfinger() { - return $this->get_preferred_username() . '@' . \wp_parse_url( \home_url(), \PHP_URL_HOST ); - } - - public function get_public_key() { - return array( - 'id' => $this->get_id() . '#main-key', - 'owner' => $this->get_id(), - 'publicKeyPem' => Signature::get_public_key_for( Users::APPLICATION_USER_ID ), - ); - } - - /** - * Get the User-Description. - * - * @return string The User-Description. - */ - public function get_summary() { - return \wpautop( - \wp_kses( - \get_bloginfo( 'description' ), - 'default' - ) - ); - } - - public function get_canonical_url() { - return \home_url(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-blog.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-blog.php deleted file mode 100644 index 3c52abff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-blog.php +++ /dev/null @@ -1,405 +0,0 @@ - - */ - protected $webfinger; - - /** - * If the User is discoverable. - * - * @see https://docs.joinmastodon.org/spec/activitypub/#discoverable - * - * @context http://joinmastodon.org/ns#discoverable - * - * @var boolean - */ - protected $discoverable; - - /** - * Restrict posting to mods - * - * @see https://join-lemmy.org/docs/contributors/05-federation.html - * - * @var boolean - */ - protected $posting_restricted_to_mods; - - public function get_manually_approves_followers() { - return false; - } - - public function get_discoverable() { - return true; - } - - /** - * Get the User-ID. - * - * @return string The User-ID. - */ - public function get_id() { - return $this->get_url(); - } - - /** - * Get the type of the object. - * - * If the Blog is in "single user" mode, return "Person" insted of "Group". - * - * @return string The type of the object. - */ - public function get_type() { - if ( is_single_user() ) { - return 'Person'; - } else { - return 'Group'; - } - } - - /** - * Get the User-Name. - * - * @return string The User-Name. - */ - public function get_name() { - return \wp_strip_all_tags( - \html_entity_decode( - \get_bloginfo( 'name' ), - \ENT_QUOTES, - 'UTF-8' - ) - ); - } - - /** - * Get the User-Description. - * - * @return string The User-Description. - */ - public function get_summary() { - return \wpautop( - \wp_kses( - \get_bloginfo( 'description' ), - 'default' - ) - ); - } - - /** - * Get the User-Url. - * - * @return string The User-Url. - */ - public function get_url() { - return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() ); - } - - /** - * Get blog's homepage URL. - * - * @return string The User-Url. - */ - public function get_alternate_url() { - return \esc_url( \trailingslashit( get_home_url() ) ); - } - - /** - * Generate a default Username. - * - * @return string The auto-generated Username. - */ - public static function get_default_username() { - // check if domain host has a subdomain - $host = \wp_parse_url( \get_home_url(), \PHP_URL_HOST ); - $host = \preg_replace( '/^www\./i', '', $host ); - - /** - * Filter the default blog username. - * - * @param string $host The default username. - */ - return apply_filters( 'activitypub_default_blog_username', $host ); - } - - /** - * Get the preferred User-Name. - * - * @return string The User-Name. - */ - public function get_preferred_username() { - $username = \get_option( 'activitypub_blog_user_identifier' ); - - if ( $username ) { - return $username; - } - - return self::get_default_username(); - } - - /** - * Get the User-Icon. - * - * @return array The User-Icon. - */ - public function get_icon() { - // try site icon first - $icon_id = get_option( 'site_icon' ); - - // try custom logo second - if ( ! $icon_id ) { - $icon_id = get_theme_mod( 'custom_logo' ); - } - - $icon_url = false; - - if ( $icon_id ) { - $icon = wp_get_attachment_image_src( $icon_id, 'full' ); - if ( $icon ) { - $icon_url = $icon[0]; - } - } - - if ( ! $icon_url ) { - // fallback to default icon - $icon_url = plugins_url( '/assets/img/wp-logo.png', ACTIVITYPUB_PLUGIN_FILE ); - } - - return array( - 'type' => 'Image', - 'url' => esc_url( $icon_url ), - ); - } - - /** - * Get the User-Header-Image. - * - * @return array|null The User-Header-Image. - */ - public function get_image() { - if ( \has_header_image() ) { - return array( - 'type' => 'Image', - 'url' => esc_url( \get_header_image() ), - ); - } - - return null; - } - - public function get_published() { - $first_post = new WP_Query( - array( - 'orderby' => 'date', - 'order' => 'ASC', - 'number' => 1, - ) - ); - - if ( ! empty( $first_post->posts[0] ) ) { - $time = \strtotime( $first_post->posts[0]->post_date_gmt ); - } else { - $time = \time(); - } - - return \gmdate( 'Y-m-d\TH:i:s\Z', $time ); - } - - public function get_canonical_url() { - return \home_url(); - } - - public function get_moderators() { - if ( is_single_user() || 'Group' !== $this->get_type() ) { - return null; - } - - return get_rest_url_by_path( 'collections/moderators' ); - } - - public function get_attributed_to() { - if ( is_single_user() || 'Group' !== $this->get_type() ) { - return null; - } - - return get_rest_url_by_path( 'collections/moderators' ); - } - - public function get_public_key() { - return array( - 'id' => $this->get_id() . '#main-key', - 'owner' => $this->get_id(), - 'publicKeyPem' => Signature::get_public_key_for( $this->get__id() ), - ); - } - - public function get_posting_restricted_to_mods() { - if ( 'Group' === $this->get_type() ) { - return true; - } - - return null; - } - - /** - * Returns the Inbox-API-Endpoint. - * - * @return string The Inbox-Endpoint. - */ - public function get_inbox() { - return get_rest_url_by_path( sprintf( 'actors/%d/inbox', $this->get__id() ) ); - } - - /** - * Returns the Outbox-API-Endpoint. - * - * @return string The Outbox-Endpoint. - */ - public function get_outbox() { - return get_rest_url_by_path( sprintf( 'actors/%d/outbox', $this->get__id() ) ); - } - - /** - * Returns the Followers-API-Endpoint. - * - * @return string The Followers-Endpoint. - */ - public function get_followers() { - return get_rest_url_by_path( sprintf( 'actors/%d/followers', $this->get__id() ) ); - } - - /** - * Returns the Following-API-Endpoint. - * - * @return string The Following-Endpoint. - */ - public function get_following() { - return get_rest_url_by_path( sprintf( 'actors/%d/following', $this->get__id() ) ); - } - - public function get_endpoints() { - $endpoints = null; - - if ( ACTIVITYPUB_SHARED_INBOX_FEATURE ) { - $endpoints = array( - 'sharedInbox' => get_rest_url_by_path( 'inbox' ), - ); - } - - return $endpoints; - } - - /** - * Returns a user@domain type of identifier for the user. - * - * @return string The Webfinger-Identifier. - */ - public function get_webfinger() { - return $this->get_preferred_username() . '@' . \wp_parse_url( \home_url(), \PHP_URL_HOST ); - } - - /** - * Returns the Featured-API-Endpoint. - * - * @return string The Featured-Endpoint. - */ - public function get_featured() { - return get_rest_url_by_path( sprintf( 'actors/%d/collections/featured', $this->get__id() ) ); - } - - public function get_indexable() { - if ( \get_option( 'blog_public', 1 ) ) { - return true; - } else { - return false; - } - } - - /** - * Extend the User-Output with Attachments. - * - * @return array The extended User-Output. - */ - public function get_attachment() { - $array = array(); - - $array[] = array( - 'type' => 'PropertyValue', - 'name' => \__( 'Blog', 'activitypub' ), - 'value' => \html_entity_decode( - sprintf( - '%s', - \esc_attr( \home_url( '/' ) ), - \esc_url( \home_url( '/' ) ), - \wp_parse_url( \home_url( '/' ), \PHP_URL_HOST ) - ), - \ENT_QUOTES, - 'UTF-8' - ), - ); - - // Add support for FEP-fb2a, for more information see FEDERATION.md - $array[] = array( - 'type' => 'Link', - 'name' => \__( 'Blog', 'activitypub' ), - 'href' => \esc_url( \home_url( '/' ) ), - 'rel' => array( 'me' ), - ); - - return $array; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-follower.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-follower.php deleted file mode 100644 index 4590ea49..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-follower.php +++ /dev/null @@ -1,395 +0,0 @@ -_id, 'activitypub_errors' ); - } - - /** - * Get the Summary. - * - * @return int The Summary. - */ - public function get_summary() { - if ( isset( $this->summary ) ) { - return $this->summary; - } - - return ''; - } - - /** - * Getter for URL attribute. - * - * Falls back to ID, if no URL is set. This is relevant for - * Plattforms like Lemmy, where the ID is the URL. - * - * @return string The URL. - */ - public function get_url() { - if ( $this->url ) { - return $this->url; - } - - return $this->id; - } - - /** - * Reset (delete) all errors. - * - * @return void - */ - public function reset_errors() { - delete_post_meta( $this->_id, 'activitypub_errors' ); - } - - /** - * Count the errors. - * - * @return int The number of errors. - */ - public function count_errors() { - $errors = $this->get_errors(); - - if ( is_array( $errors ) && ! empty( $errors ) ) { - return count( $errors ); - } - - return 0; - } - - /** - * Return the latest error message. - * - * @return string The error message. - */ - public function get_latest_error_message() { - $errors = $this->get_errors(); - - if ( is_array( $errors ) && ! empty( $errors ) ) { - return reset( $errors ); - } - - return ''; - } - - /** - * Update the current Follower-Object. - * - * @return void - */ - public function update() { - $this->save(); - } - - /** - * Validate the current Follower-Object. - * - * @return boolean True if the verification was successful. - */ - public function is_valid() { - // the minimum required attributes - $required_attributes = array( - 'id', - 'preferredUsername', - 'inbox', - 'publicKey', - 'publicKeyPem', - ); - - foreach ( $required_attributes as $attribute ) { - if ( ! $this->get( $attribute ) ) { - return false; - } - } - - return true; - } - - /** - * Save the current Follower-Object. - * - * @return int|WP_Error The Post-ID or an WP_Error. - */ - public function save() { - if ( ! $this->is_valid() ) { - return new WP_Error( 'activitypub_invalid_follower', __( 'Invalid Follower', 'activitypub' ), array( 'status' => 400 ) ); - } - - if ( ! $this->get__id() ) { - global $wpdb; - - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching - $post_id = $wpdb->get_var( - $wpdb->prepare( - "SELECT ID FROM $wpdb->posts WHERE guid=%s", - esc_sql( $this->get_id() ) - ) - ); - - if ( $post_id ) { - $post = get_post( $post_id ); - $this->set__id( $post->ID ); - } - } - - $post_id = $this->get__id(); - - $args = array( - 'ID' => $post_id, - 'guid' => esc_url_raw( $this->get_id() ), - 'post_title' => wp_strip_all_tags( sanitize_text_field( $this->get_name() ) ), - 'post_author' => 0, - 'post_type' => Followers::POST_TYPE, - 'post_name' => esc_url_raw( $this->get_id() ), - 'post_excerpt' => sanitize_text_field( wp_kses( $this->get_summary(), 'user_description' ) ), - 'post_status' => 'publish', - 'meta_input' => $this->get_post_meta_input(), - ); - - if ( ! empty( $post_id ) ) { - // If this is an update, prevent the "followed" date from being - // overwritten by the current date. - $post = get_post( $post_id ); - $args['post_date'] = $post->post_date; - $args['post_date_gmt'] = $post->post_date_gmt; - } - - $post_id = wp_insert_post( $args ); - $this->_id = $post_id; - - return $post_id; - } - - /** - * Upsert the current Follower-Object. - * - * @return int|WP_Error The Post-ID or an WP_Error. - */ - public function upsert() { - return $this->save(); - } - - /** - * Delete the current Follower-Object. - * - * Beware that this os deleting a Follower for ALL users!!! - * - * To delete only the User connection (unfollow) - * @see \Activitypub\Rest\Followers::remove_follower() - * - * @return void - */ - public function delete() { - wp_delete_post( $this->_id ); - } - - /** - * Update the post meta. - * - * @return void - */ - protected function get_post_meta_input() { - $meta_input = array(); - $meta_input['activitypub_inbox'] = $this->get_shared_inbox(); - $meta_input['activitypub_actor_json'] = $this->to_json(); - - return $meta_input; - } - - /** - * Get the icon. - * - * Sets a fallback to better handle API and HTML outputs. - * - * @return array The icon. - */ - public function get_icon() { - if ( isset( $this->icon['url'] ) ) { - return $this->icon; - } - - return array( - 'type' => 'Image', - 'mediaType' => 'image/jpeg', - 'url' => ACTIVITYPUB_PLUGIN_URL . 'assets/img/mp.jpg', - ); - } - - /** - * Get Name. - * - * Tries to extract a name from the URL or ID if not set. - * - * @return string The name. - */ - public function get_name() { - if ( $this->name ) { - return $this->name; - } elseif ( $this->preferred_username ) { - return $this->preferred_username; - } - - return $this->extract_name_from_uri(); - } - - /** - * The preferred Username. - * - * Tries to extract a name from the URL or ID if not set. - * - * @return string The preferred Username. - */ - public function get_preferred_username() { - if ( $this->preferred_username ) { - return $this->preferred_username; - } - - return $this->extract_name_from_uri(); - } - - /** - * Get the Icon URL (Avatar) - * - * @return string The URL to the Avatar. - */ - public function get_icon_url() { - $icon = $this->get_icon(); - - if ( ! $icon ) { - return ''; - } - - if ( is_array( $icon ) ) { - return $icon['url']; - } - - return $icon; - } - - /** - * Get the Icon URL (Avatar) - * - * @return string The URL to the Avatar. - */ - public function get_image_url() { - $image = $this->get_image(); - - if ( ! $image ) { - return ''; - } - - if ( is_array( $image ) ) { - return $image['url']; - } - - return $image; - } - - /** - * Get the shared inbox, with a fallback to the inbox. - * - * @return string|null The URL to the shared inbox, the inbox or null. - */ - public function get_shared_inbox() { - if ( ! empty( $this->get_endpoints()['sharedInbox'] ) ) { - return $this->get_endpoints()['sharedInbox']; - } elseif ( ! empty( $this->get_inbox() ) ) { - return $this->get_inbox(); - } - - return null; - } - - /** - * Convert a Custom-Post-Type input to an Activitypub\Model\Follower. - * - * @return string The JSON string. - * - * @return array Activitypub\Model\Follower - */ - public static function init_from_cpt( $post ) { - $actor_json = get_post_meta( $post->ID, 'activitypub_actor_json', true ); - $object = self::init_from_json( $actor_json ); - $object->set__id( $post->ID ); - $object->set_id( $post->guid ); - $object->set_name( $post->post_title ); - $object->set_summary( $post->post_excerpt ); - $object->set_published( gmdate( 'Y-m-d H:i:s', strtotime( $post->post_date ) ) ); - $object->set_updated( gmdate( 'Y-m-d H:i:s', strtotime( $post->post_modified ) ) ); - - return $object; - } - - /** - * Infer a shortname from the Actor ID or URL. Used only for fallbacks, - * we will try to use what's supplied. - * - * @return string Hopefully the name of the Follower. - */ - protected function extract_name_from_uri() { - // prefer the URL, but fall back to the ID. - if ( $this->url ) { - $name = $this->url; - } else { - $name = $this->id; - } - - if ( \filter_var( $name, FILTER_VALIDATE_URL ) ) { - $name = \rtrim( $name, '/' ); - $path = \wp_parse_url( $name, PHP_URL_PATH ); - - if ( $path ) { - if ( \strpos( $name, '@' ) !== false ) { - // expected: https://example.com/@user (default URL pattern) - $name = \preg_replace( '|^/@?|', '', $path ); - } else { - // expected: https://example.com/users/user (default ID pattern) - $parts = \explode( '/', $path ); - $name = \array_pop( $parts ); - } - } - } elseif ( - \is_email( $name ) || - \strpos( $name, 'acct' ) === 0 || - \strpos( $name, '@' ) === 0 - ) { - // expected: user@example.com or acct:user@example (WebFinger) - $name = \ltrim( $name, '@' ); - $name = \ltrim( $name, 'acct:' ); - $parts = \explode( '@', $name ); - $name = $parts[0]; - } - - return $name; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-post.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-post.php deleted file mode 100644 index a4229539..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-post.php +++ /dev/null @@ -1,136 +0,0 @@ -post = $post; - $this->object = $transformer->to_object(); - } - } - - /** - * Returns the User ID. - * - * @return int the User ID. - */ - public function get_user_id() { - return apply_filters( 'activitypub_post_user_id', $this->post->post_author, $this->post ); - } - - /** - * Converts this Object into an Array. - * - * @return array the array representation of a Post. - */ - public function to_array() { - return \apply_filters( 'activitypub_post', $this->object->to_array(), $this->post ); - } - - /** - * Returns the Actor of this Object. - * - * @return string The URL of the Actor. - */ - public function get_actor() { - $user = Users::get_by_id( $this->get_user_id() ); - - return $user->get_url(); - } - - /** - * Converts this Object into a JSON String - * - * @return string - */ - public function to_json() { - return \wp_json_encode( $this->to_array(), \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT ); - } - - /** - * Returns the URL of an Activity Object - * - * @return string - */ - public function get_url() { - return $this->object->get_url(); - } - - /** - * Returns the ID of an Activity Object - * - * @return string - */ - public function get_id() { - return $this->object->get_id(); - } - - /** - * Returns a list of Image Attachments - * - * @return array - */ - public function get_attachments() { - return $this->object->get_attachment(); - } - - /** - * Returns a list of Tags, used in the Post - * - * @return array - */ - public function get_tags() { - return $this->object->get_tag(); - } - - /** - * Returns the as2 object-type for a given post - * - * @return string the object-type - */ - public function get_object_type() { - return $this->object->get_type(); - } - - /** - * Returns the content for the ActivityPub Item. - * - * @return string the content - */ - public function get_content() { - return $this->object->get_content(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-user.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-user.php deleted file mode 100644 index dc6cb6c0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/model/class-user.php +++ /dev/null @@ -1,336 +0,0 @@ - - */ - protected $webfinger; - - public function get_type() { - return 'Person'; - } - - public static function from_wp_user( $user_id ) { - if ( is_user_disabled( $user_id ) ) { - return new WP_Error( - 'activitypub_user_not_found', - \__( 'User not found', 'activitypub' ), - array( 'status' => 404 ) - ); - } - - $object = new static(); - $object->_id = $user_id; - - return $object; - } - - /** - * Get the User-ID. - * - * @return string The User-ID. - */ - public function get_id() { - return $this->get_url(); - } - - /** - * Get the User-Name. - * - * @return string The User-Name. - */ - public function get_name() { - return \esc_attr( \get_the_author_meta( 'display_name', $this->_id ) ); - } - - /** - * Get the User-Description. - * - * @return string The User-Description. - */ - public function get_summary() { - $description = get_user_meta( $this->_id, 'activitypub_user_description', true ); - if ( empty( $description ) ) { - $description = get_user_meta( $this->_id, 'description', true ); - } - return \wpautop( \wp_kses( $description, 'default' ) ); - } - - /** - * Get the User-Url. - * - * @return string The User-Url. - */ - public function get_url() { - return \esc_url( \get_author_posts_url( $this->_id ) ); - } - - /** - * Returns the User-URL with @-Prefix for the username. - * - * @return string The User-URL with @-Prefix for the username. - */ - public function get_alternate_url() { - return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() ); - } - - public function get_preferred_username() { - return \esc_attr( \get_the_author_meta( 'login', $this->_id ) ); - } - - public function get_icon() { - $icon = \esc_url( - \get_avatar_url( - $this->_id, - array( 'size' => 120 ) - ) - ); - - return array( - 'type' => 'Image', - 'url' => $icon, - ); - } - - public function get_image() { - if ( \has_header_image() ) { - $image = \esc_url( \get_header_image() ); - return array( - 'type' => 'Image', - 'url' => $image, - ); - } - - return null; - } - - public function get_published() { - return \gmdate( 'Y-m-d\TH:i:s\Z', \strtotime( \get_the_author_meta( 'registered', $this->_id ) ) ); - } - - public function get_public_key() { - return array( - 'id' => $this->get_id() . '#main-key', - 'owner' => $this->get_id(), - 'publicKeyPem' => Signature::get_public_key_for( $this->get__id() ), - ); - } - - /** - * Returns the Inbox-API-Endpoint. - * - * @return string The Inbox-Endpoint. - */ - public function get_inbox() { - return get_rest_url_by_path( sprintf( 'actors/%d/inbox', $this->get__id() ) ); - } - - /** - * Returns the Outbox-API-Endpoint. - * - * @return string The Outbox-Endpoint. - */ - public function get_outbox() { - return get_rest_url_by_path( sprintf( 'actors/%d/outbox', $this->get__id() ) ); - } - - /** - * Returns the Followers-API-Endpoint. - * - * @return string The Followers-Endpoint. - */ - public function get_followers() { - return get_rest_url_by_path( sprintf( 'actors/%d/followers', $this->get__id() ) ); - } - - /** - * Returns the Following-API-Endpoint. - * - * @return string The Following-Endpoint. - */ - public function get_following() { - return get_rest_url_by_path( sprintf( 'actors/%d/following', $this->get__id() ) ); - } - - /** - * Returns the Featured-API-Endpoint. - * - * @return string The Featured-Endpoint. - */ - public function get_featured() { - return get_rest_url_by_path( sprintf( 'actors/%d/collections/featured', $this->get__id() ) ); - } - - public function get_endpoints() { - $endpoints = null; - - if ( ACTIVITYPUB_SHARED_INBOX_FEATURE ) { - $endpoints = array( - 'sharedInbox' => get_rest_url_by_path( 'inbox' ), - ); - } - - return $endpoints; - } - - /** - * Extend the User-Output with Attachments. - * - * @return array The extended User-Output. - */ - public function get_attachment() { - $extra_fields = get_actor_extra_fields( $this->_id ); - - $attachments = array(); - - foreach ( $extra_fields as $post ) { - $content = \get_the_content( null, false, $post ); - $content = \make_clickable( $content ); - $content = \do_blocks( $content ); - $content = \wptexturize( $content ); - $content = \wp_filter_content_tags( $content ); - // replace script and style elements - $content = \preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $content ); - $content = \strip_shortcodes( $content ); - $content = \trim( \preg_replace( '/[\n\r\t]/', '', $content ) ); - - $attachments[] = array( - 'type' => 'PropertyValue', - 'name' => \get_the_title( $post ), - 'value' => \html_entity_decode( - $content, - \ENT_QUOTES, - 'UTF-8' - ), - ); - - $link_added = false; - - // Add support for FEP-fb2a, for more information see FEDERATION.md - if ( \class_exists( '\WP_HTML_Tag_Processor' ) ) { - $tags = new \WP_HTML_Tag_Processor( $content ); - $tags->next_tag(); - - if ( 'P' === $tags->get_tag() ) { - $tags->next_tag(); - } - - if ( 'A' === $tags->get_tag() ) { - $tags->set_bookmark( 'link' ); - if ( ! $tags->next_tag() ) { - $tags->seek( 'link' ); - $attachment = array( - 'type' => 'Link', - 'name' => \get_the_title( $post ), - 'href' => \esc_url( $tags->get_attribute( 'href' ) ), - 'rel' => explode( ' ', $tags->get_attribute( 'rel' ) ), - ); - - $link_added = true; - } - } - } - - if ( ! $link_added ) { - $attachment = array( - 'type' => 'Note', - 'name' => \get_the_title( $post ), - 'content' => \html_entity_decode( - $content, - \ENT_QUOTES, - 'UTF-8' - ), - ); - } - - $attachments[] = $attachment; - } - - return $attachments; - } - - /** - * Returns a user@domain type of identifier for the user. - * - * @return string The Webfinger-Identifier. - */ - public function get_webfinger() { - return $this->get_preferred_username() . '@' . \wp_parse_url( \home_url(), \PHP_URL_HOST ); - } - - public function get_canonical_url() { - return $this->get_url(); - } - - public function get_streams() { - return null; - } - - public function get_tag() { - return array(); - } - - public function get_indexable() { - if ( \get_option( 'blog_public', 1 ) ) { - return true; - } else { - return false; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-actors.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-actors.php deleted file mode 100644 index f5854a68..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-actors.php +++ /dev/null @@ -1,150 +0,0 @@ -[\w\-\.]+)', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'get' ), - 'args' => self::request_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - - \register_rest_route( - ACTIVITYPUB_REST_NAMESPACE, - '/(users|actors)/(?P[\w\-\.]+)/remote-follow', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'remote_follow_get' ), - 'permission_callback' => '__return_true', - 'args' => array( - 'resource' => array( - 'required' => true, - 'sanitize_callback' => 'sanitize_text_field', - ), - ), - ), - ) - ); - } - - /** - * Handle GET request - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function get( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - // redirect to canonical URL if it is not an ActivityPub request - if ( ! is_activitypub_request() ) { - header( 'Location: ' . $user->get_canonical_url(), true, 301 ); - exit; - } - - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_users_pre' ); - - $json = $user->to_array(); - - $rest_response = new WP_REST_Response( $json, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - - /** - * Endpoint for remote follow UI/Block - * - * @param WP_REST_Request $request The request object. - * - * @return void|string The URL to the remote follow page - */ - public static function remote_follow_get( WP_REST_Request $request ) { - $resource = $request->get_param( 'resource' ); - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - $template = Webfinger::get_remote_follow_endpoint( $resource ); - - if ( is_wp_error( $template ) ) { - return $template; - } - - $resource = $user->get_webfinger(); - $url = str_replace( '{uri}', $resource, $template ); - - return new WP_REST_Response( - array( 'url' => $url, 'template' => $template ), - 200 - ); - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function request_parameters() { - $params = array(); - - $params['page'] = array( - 'type' => 'string', - ); - - $params['user_id'] = array( - 'required' => true, - 'type' => 'string', - ); - - return $params; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-collection.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-collection.php deleted file mode 100644 index 296789fb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-collection.php +++ /dev/null @@ -1,228 +0,0 @@ -[\w\-\.]+)/collections/tags', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'tags_get' ), - 'args' => self::request_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - - \register_rest_route( - ACTIVITYPUB_REST_NAMESPACE, - '/(users|actors)/(?P[\w\-\.]+)/collections/featured', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'featured_get' ), - 'args' => self::request_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - - \register_rest_route( - ACTIVITYPUB_REST_NAMESPACE, - '/collections/moderators', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'moderators_get' ), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * The Featured Tags endpoint - * - * @param WP_REST_Request $request The request object. - * - * @return WP_REST_Response The response object. - */ - public static function tags_get( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - $number = 4; - - $tags = \get_terms( - array( - 'taxonomy' => 'post_tag', - 'orderby' => 'count', - 'order' => 'DESC', - 'number' => $number, - ) - ); - - if ( is_wp_error( $tags ) ) { - $tags = array(); - } - - $response = array( - '@context' => Base_Object::JSON_LD_CONTEXT, - 'id' => get_rest_url_by_path( sprintf( 'actors/%d/collections/tags', $user->get__id() ) ), - 'type' => 'Collection', - 'totalItems' => is_countable( $tags ) ? count( $tags ) : 0, - 'items' => array(), - ); - - foreach ( $tags as $tag ) { - $response['items'][] = array( - 'type' => 'Hashtag', - 'href' => \esc_url( \get_tag_link( $tag ) ), - 'name' => esc_hashtag( $tag->name ), - ); - } - - $rest_response = new WP_REST_Response( $response, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * Featured posts endpoint - * - * @param WP_REST_Request $request The request object. - * - * @return WP_REST_Response The response object. - */ - public static function featured_get( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - $sticky_posts = \get_option( 'sticky_posts' ); - - if ( ! is_single_user() && User_Collection::BLOG_USER_ID === $user->get__id() ) { - $posts = array(); - } elseif ( $sticky_posts ) { - $args = array( - 'post__in' => $sticky_posts, - 'ignore_sticky_posts' => 1, - 'orderby' => 'date', - 'order' => 'DESC', - ); - - if ( $user->get__id() > 0 ) { - $args['author'] = $user->get__id(); - } - - $posts = \get_posts( $args ); - } else { - $posts = array(); - } - - $response = array( - '@context' => Base_Object::JSON_LD_CONTEXT, - 'id' => get_rest_url_by_path( sprintf( 'actors/%d/collections/featured', $user_id ) ), - 'type' => 'OrderedCollection', - 'totalItems' => is_countable( $posts ) ? count( $posts ) : 0, - 'orderedItems' => array(), - ); - - foreach ( $posts as $post ) { - $transformer = Factory::get_transformer( $post ); - - if ( \is_wp_error( $transformer ) ) { - continue; - } - - $response['orderedItems'][] = $transformer->to_object()->to_array( false ); - } - - $rest_response = new WP_REST_Response( $response, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * Moderators endpoint - * - * @param WP_REST_Request $request The request object. - * - * @return WP_REST_Response The response object. - */ - public static function moderators_get( $request ) { - $response = array( - '@context' => Actor::JSON_LD_CONTEXT, - 'id' => get_rest_url_by_path( 'collections/moderators' ), - 'type' => 'OrderedCollection', - 'orderedItems' => array(), - ); - - $users = User_Collection::get_collection(); - - foreach ( $users as $user ) { - $response['orderedItems'][] = $user->get_url(); - } - - $rest_response = new WP_REST_Response( $response, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function request_parameters() { - $params = array(); - - $params['user_id'] = array( - 'required' => true, - 'type' => 'string', - ); - - return $params; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-comment.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-comment.php deleted file mode 100644 index a31b5978..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-comment.php +++ /dev/null @@ -1,95 +0,0 @@ -\d+)/remote-reply', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'remote_reply_get' ), - 'permission_callback' => '__return_true', - 'args' => array( - 'resource' => array( - 'required' => true, - 'sanitize_callback' => 'sanitize_text_field', - ), - ), - ), - ) - ); - } - - /** - * Endpoint for remote follow UI/Block - * - * @param WP_REST_Request $request The request object. - * - * @return void|string The URL to the remote follow page - */ - public static function remote_reply_get( WP_REST_Request $request ) { - $resource = $request->get_param( 'resource' ); - $comment_id = $request->get_param( 'comment_id' ); - - $comment = get_comment( $comment_id ); - - if ( ! $comment ) { - return new WP_Error( 'activitypub_comment_not_found', __( 'Comment not found', 'activitypub' ), array( 'status' => 404 ) ); - } - - $is_local = Comment_Utils::is_local( $comment ); - - if ( $is_local ) { - return new WP_Error( 'activitypub_local_only_comment', __( 'Comment is local only', 'activitypub' ), array( 'status' => 403 ) ); - } - - $template = Webfinger_Utils::get_remote_follow_endpoint( $resource ); - - if ( is_wp_error( $template ) ) { - return $template; - } - - $comment_meta = \get_comment_meta( $comment_id ); - - if ( ! empty( $comment_meta['source_id'][0] ) ) { - $resource = $comment_meta['source_id'][0]; - } elseif ( ! empty( $comment_meta['source_url'][0] ) ) { - $resource = $comment_meta['source_url'][0]; - } else { - $resource = Comment_Utils::generate_id( $comment ); - } - - $url = str_replace( '{uri}', $resource, $template ); - - return new WP_REST_Response( - array( 'url' => $url, 'template' => $template ), - 200 - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-followers.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-followers.php deleted file mode 100644 index ca882cf3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-followers.php +++ /dev/null @@ -1,150 +0,0 @@ -[\w\-\.]+)/followers', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'get' ), - 'args' => self::request_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * Handle GET request - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function get( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - $order = $request->get_param( 'order' ); - $per_page = (int) $request->get_param( 'per_page' ); - $page = (int) $request->get_param( 'page' ); - $context = $request->get_param( 'context' ); - - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_followers_pre' ); - - $data = Follower_Collection::get_followers_with_count( $user_id, $per_page, $page, array( 'order' => ucwords( $order ) ) ); - $json = new stdClass(); - - $json->{'@context'} = \Activitypub\get_context(); - - $json->id = get_rest_url_by_path( sprintf( 'actors/%d/followers', $user->get__id() ) ); - $json->generator = 'http://wordpress.org/?v=' . get_masked_wp_version(); - $json->actor = $user->get_id(); - $json->type = 'OrderedCollectionPage'; - - $json->totalItems = $data['total']; // phpcs:ignore - $json->partOf = get_rest_url_by_path( sprintf( 'actors/%d/followers', $user->get__id() ) ); // phpcs:ignore - - $json->first = \add_query_arg( 'page', 1, $json->partOf ); // phpcs:ignore - $json->last = \add_query_arg( 'page', \ceil ( $json->totalItems / $per_page ), $json->partOf ); // phpcs:ignore - - if ( $page && ( ( \ceil ( $json->totalItems / $per_page ) ) > $page ) ) { // phpcs:ignore - $json->next = \add_query_arg( 'page', $page + 1, $json->partOf ); // phpcs:ignore - } - - if ( $page && ( $page > 1 ) ) { // phpcs:ignore - $json->prev = \add_query_arg( 'page', $page - 1, $json->partOf ); // phpcs:ignore - } - - // phpcs:ignore - $json->orderedItems = array_map( - function ( $item ) use ( $context ) { - if ( 'full' === $context ) { - return $item->to_array( false ); - } - return $item->get_url(); - }, - $data['followers'] - ); - - $rest_response = new WP_REST_Response( $json, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function request_parameters() { - $params = array(); - - $params['page'] = array( - 'type' => 'integer', - 'default' => 1, - ); - - $params['per_page'] = array( - 'type' => 'integer', - 'default' => 20, - ); - - $params['order'] = array( - 'type' => 'string', - 'default' => 'desc', - 'enum' => array( 'asc', 'desc' ), - ); - - $params['user_id'] = array( - 'required' => true, - 'type' => 'string', - ); - - $params['context'] = array( - 'type' => 'string', - 'default' => 'simple', - 'enum' => array( 'simple', 'full' ), - ); - - return $params; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-following.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-following.php deleted file mode 100644 index 4e077279..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-following.php +++ /dev/null @@ -1,132 +0,0 @@ -[\w\-\.]+)/following', - array( - array( - 'methods' => \WP_REST_Server::READABLE, - 'callback' => array( self::class, 'get' ), - 'args' => self::request_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * Handle GET request - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function get( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_following_pre' ); - - $json = new \stdClass(); - - $json->{'@context'} = \Activitypub\get_context(); - - $json->id = get_rest_url_by_path( sprintf( 'actors/%d/following', $user->get__id() ) ); - $json->generator = 'http://wordpress.org/?v=' . get_masked_wp_version(); - $json->actor = $user->get_id(); - $json->type = 'OrderedCollectionPage'; - - $json->partOf = get_rest_url_by_path( sprintf( 'actors/%d/following', $user->get__id() ) ); // phpcs:ignore - - $items = apply_filters( 'activitypub_rest_following', array(), $user ); // phpcs:ignore - - $json->totalItems = is_countable( $items ) ? count( $items ) : 0; // phpcs:ignore - $json->orderedItems = $items; // phpcs:ignore - - $json->first = $json->partOf; // phpcs:ignore - - $rest_response = new WP_REST_Response( $json, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function request_parameters() { - $params = array(); - - $params['page'] = array( - 'type' => 'integer', - ); - - $params['user_id'] = array( - 'required' => true, - 'type' => 'string', - ); - - return $params; - } - - /** - * Add the Blog Authors to the following list of the Blog Actor - * if Blog not in single mode. - * - * @param array $array The array of following urls. - * @param User $user The user object. - * - * @return array The array of following urls. - */ - public static function default_following( $array, $user ) { - if ( 0 !== $user->get__id() || is_single_user() ) { - return $array; - } - - $users = User_Collection::get_collection(); - - foreach ( $users as $user ) { - $array[] = $user->get_url(); - } - - return $array; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-inbox.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-inbox.php deleted file mode 100644 index 161fcf19..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-inbox.php +++ /dev/null @@ -1,328 +0,0 @@ - WP_REST_Server::CREATABLE, - 'callback' => array( self::class, 'shared_inbox_post' ), - 'args' => self::shared_inbox_post_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - - \register_rest_route( - ACTIVITYPUB_REST_NAMESPACE, - '/(users|actors)/(?P[\w\-\.]+)/inbox', - array( - array( - 'methods' => WP_REST_Server::CREATABLE, - 'callback' => array( self::class, 'user_inbox_post' ), - 'args' => self::user_inbox_post_parameters(), - 'permission_callback' => '__return_true', - ), - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'user_inbox_get' ), - 'args' => self::user_inbox_get_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * Renders the user-inbox - * - * @param WP_REST_Request $request - * @return WP_REST_Response - */ - public static function user_inbox_get( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - $page = $request->get_param( 'page', 0 ); - - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_inbox_pre' ); - - $json = new \stdClass(); - - $json->{'@context'} = get_context(); - $json->id = get_rest_url_by_path( sprintf( 'actors/%d/inbox', $user->get__id() ) ); - $json->generator = 'http://wordpress.org/?v=' . get_masked_wp_version(); - $json->type = 'OrderedCollectionPage'; - $json->partOf = get_rest_url_by_path( sprintf( 'actors/%d/inbox', $user->get__id() ) ); // phpcs:ignore - $json->totalItems = 0; // phpcs:ignore - $json->orderedItems = array(); // phpcs:ignore - $json->first = $json->partOf; // phpcs:ignore - - // filter output - $json = \apply_filters( 'activitypub_rest_inbox_array', $json ); - - /* - * Action triggerd after the ActivityPub profile has been created and sent to the client - */ - \do_action( 'activitypub_inbox_post' ); - - $rest_response = new WP_REST_Response( $json, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * Handles user-inbox requests - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function user_inbox_post( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - $data = $request->get_json_params(); - $activity = Activity::init_from_array( $data ); - $type = $request->get_param( 'type' ); - $type = \strtolower( $type ); - - \do_action( 'activitypub_inbox', $data, $user->get__id(), $type, $activity ); - \do_action( "activitypub_inbox_{$type}", $data, $user->get__id(), $activity ); - - $rest_response = new WP_REST_Response( array(), 202 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * The shared inbox - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function shared_inbox_post( $request ) { - $data = $request->get_json_params(); - $activity = Activity::init_from_array( $data ); - $type = $request->get_param( 'type' ); - $type = \strtolower( $type ); - - \do_action( 'activitypub_inbox', $data, null, $type, $activity ); - \do_action( "activitypub_inbox_{$type}", $data, null, $activity ); - - $rest_response = new WP_REST_Response( array(), 202 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function user_inbox_get_parameters() { - $params = array(); - - $params['page'] = array( - 'type' => 'integer', - ); - - $params['user_id'] = array( - 'required' => true, - 'type' => 'string', - ); - - return $params; - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function user_inbox_post_parameters() { - $params = array(); - - $params['page'] = array( - 'type' => 'integer', - ); - - $params['user_id'] = array( - 'required' => true, - 'type' => 'string', - ); - - $params['id'] = array( - 'required' => true, - 'sanitize_callback' => 'esc_url_raw', - ); - - $params['actor'] = array( - 'required' => true, - 'sanitize_callback' => function ( $param, $request, $key ) { - return object_to_uri( $param ); - }, - ); - - $params['type'] = array( - 'required' => true, - //'type' => 'enum', - //'enum' => array( 'Create' ), - //'sanitize_callback' => function ( $param, $request, $key ) { - // return \strtolower( $param ); - //}, - ); - - $params['object'] = array( - 'required' => true, - ); - - return $params; - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function shared_inbox_post_parameters() { - $params = array(); - - $params['page'] = array( - 'type' => 'integer', - ); - - $params['id'] = array( - 'required' => true, - 'type' => 'string', - 'sanitize_callback' => 'esc_url_raw', - ); - - $params['actor'] = array( - 'required' => true, - //'type' => array( 'object', 'string' ), - 'sanitize_callback' => function ( $param, $request, $key ) { - return object_to_uri( $param ); - }, - ); - - $params['type'] = array( - 'required' => true, - //'type' => 'enum', - //'enum' => array( 'Create' ), - //'sanitize_callback' => function ( $param, $request, $key ) { - // return \strtolower( $param ); - //}, - ); - - $params['object'] = array( - 'required' => true, - //'type' => 'object', - ); - - $params['to'] = array( - 'required' => false, - 'sanitize_callback' => function ( $param, $request, $key ) { - if ( \is_string( $param ) ) { - $param = array( $param ); - } - - return $param; - }, - ); - - $params['cc'] = array( - 'sanitize_callback' => function ( $param, $request, $key ) { - if ( \is_string( $param ) ) { - $param = array( $param ); - } - - return $param; - }, - ); - - $params['bcc'] = array( - 'sanitize_callback' => function ( $param, $request, $key ) { - if ( \is_string( $param ) ) { - $param = array( $param ); - } - - return $param; - }, - ); - - return $params; - } - - /** - * Get local user recipients - * - * @param array $data - * - * @return array The list of local users - */ - public static function get_recipients( $data ) { - $recipients = extract_recipients_from_activity( $data ); - $users = array(); - - foreach ( $recipients as $recipient ) { - $user_id = url_to_authorid( $recipient ); - - $user = get_user_by( 'id', $user_id ); - - if ( $user ) { - $users[] = $user; - } - } - - return $users; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-nodeinfo.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-nodeinfo.php deleted file mode 100644 index 02b89b6c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-nodeinfo.php +++ /dev/null @@ -1,187 +0,0 @@ - \WP_REST_Server::READABLE, - 'callback' => array( self::class, 'discovery' ), - 'permission_callback' => '__return_true', - ), - ) - ); - - \register_rest_route( - ACTIVITYPUB_REST_NAMESPACE, - '/nodeinfo', - array( - array( - 'methods' => \WP_REST_Server::READABLE, - 'callback' => array( self::class, 'nodeinfo' ), - 'permission_callback' => '__return_true', - ), - ) - ); - - \register_rest_route( - ACTIVITYPUB_REST_NAMESPACE, - '/nodeinfo2', - array( - array( - 'methods' => \WP_REST_Server::READABLE, - 'callback' => array( self::class, 'nodeinfo2' ), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * Render NodeInfo file - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function nodeinfo( $request ) { - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_nodeinfo_pre' ); - - $nodeinfo = array(); - - $nodeinfo['version'] = '2.0'; - $nodeinfo['software'] = array( - 'name' => 'wordpress', - 'version' => get_masked_wp_version(), - ); - - $posts = \wp_count_posts(); - $comments = \wp_count_comments(); - - $nodeinfo['usage'] = array( - 'users' => array( - 'total' => get_total_users(), - 'activeMonth' => get_active_users( '1 month ago' ), - 'activeHalfyear' => get_active_users( '6 month ago' ), - ), - 'localPosts' => (int) $posts->publish, - 'localComments' => (int) $comments->approved, - ); - - $nodeinfo['openRegistrations'] = false; - $nodeinfo['protocols'] = array( 'activitypub' ); - - $nodeinfo['services'] = array( - 'inbound' => array(), - 'outbound' => array(), - ); - - $nodeinfo['metadata'] = array( - 'nodeName' => \get_bloginfo( 'name' ), - 'nodeDescription' => \get_bloginfo( 'description' ), - 'nodeIcon' => \get_site_icon_url(), - ); - - return new WP_REST_Response( $nodeinfo, 200 ); - } - - /** - * Render NodeInfo file - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function nodeinfo2( $request ) { - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_nodeinfo2_pre' ); - - $nodeinfo = array(); - - $nodeinfo['version'] = '2.0'; - $nodeinfo['server'] = array( - 'baseUrl' => \home_url( '/' ), - 'name' => \get_bloginfo( 'name' ), - 'software' => 'wordpress', - 'version' => get_masked_wp_version(), - ); - - $posts = \wp_count_posts(); - $comments = \wp_count_comments(); - - $nodeinfo['usage'] = array( - 'users' => array( - 'total' => get_total_users(), - 'activeMonth' => get_active_users( 1 ), - 'activeHalfyear' => get_active_users( 6 ), - ), - 'localPosts' => (int) $posts->publish, - 'localComments' => (int) $comments->approved, - ); - - $nodeinfo['openRegistrations'] = false; - $nodeinfo['protocols'] = array( 'activitypub' ); - - $nodeinfo['services'] = array( - 'inbound' => array(), - 'outbound' => array(), - ); - - return new WP_REST_Response( $nodeinfo, 200 ); - } - - /** - * Render NodeInfo discovery file - * - * @param WP_REST_Request $request - * - * @return WP_REST_Response - */ - public static function discovery( $request ) { - $discovery = array(); - $discovery['links'] = array( - array( - 'rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.0', - 'href' => get_rest_url_by_path( 'nodeinfo' ), - ), - array( - 'rel' => 'https://www.w3.org/ns/activitystreams#Application', - 'href' => get_rest_url_by_path( 'application' ), - ), - ); - - return new \WP_REST_Response( $discovery, 200 ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-outbox.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-outbox.php deleted file mode 100644 index e0670301..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-outbox.php +++ /dev/null @@ -1,162 +0,0 @@ -[\w\-\.]+)/outbox', - array( - array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( self::class, 'user_outbox_get' ), - 'args' => self::request_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * Renders the user-outbox - * - * @param WP_REST_Request $request - * @return WP_REST_Response - */ - public static function user_outbox_get( $request ) { - $user_id = $request->get_param( 'user_id' ); - $user = User_Collection::get_by_various( $user_id ); - - if ( is_wp_error( $user ) ) { - return $user; - } - - $post_types = \get_option( 'activitypub_support_post_types', array( 'post' ) ); - - $page = $request->get_param( 'page', 1 ); - - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_outbox_pre' ); - - $json = new stdClass(); - - $json->{'@context'} = get_context(); - $json->id = get_rest_url_by_path( sprintf( 'actors/%d/outbox', $user_id ) ); - $json->generator = 'http://wordpress.org/?v=' . get_masked_wp_version(); - $json->actor = $user->get_id(); - $json->type = 'OrderedCollectionPage'; - $json->partOf = get_rest_url_by_path( sprintf( 'actors/%d/outbox', $user_id ) ); // phpcs:ignore - $json->totalItems = 0; // phpcs:ignore - - if ( $user_id > 0 ) { - $count_posts = \count_user_posts( $user_id, $post_types, true ); - $json->totalItems = \intval( $count_posts ); // phpcs:ignore - } else { - foreach ( $post_types as $post_type ) { - $count_posts = \wp_count_posts( $post_type ); - $json->totalItems += \intval( $count_posts->publish ); // phpcs:ignore - } - } - - $json->first = \add_query_arg( 'page', 1, $json->partOf ); // phpcs:ignore - $json->last = \add_query_arg( 'page', \ceil ( $json->totalItems / 10 ), $json->partOf ); // phpcs:ignore - - if ( $page && ( ( \ceil ( $json->totalItems / 10 ) ) > $page ) ) { // phpcs:ignore - $json->next = \add_query_arg( 'page', $page + 1, $json->partOf ); // phpcs:ignore - } - - if ( $page && ( $page > 1 ) ) { // phpcs:ignore - $json->prev = \add_query_arg( 'page', $page - 1, $json->partOf ); // phpcs:ignore - } - - if ( $page ) { - $posts = \get_posts( - array( - 'posts_per_page' => 10, - 'author' => $user_id > 0 ? $user_id : null, - 'paged' => $page, - 'post_type' => $post_types, - ) - ); - - foreach ( $posts as $post ) { - $transformer = Factory::get_transformer( $post ); - - if ( \is_wp_error( $transformer ) ) { - continue; - } - - $post = $transformer->to_object(); - $activity = new Activity(); - $activity->set_type( 'Create' ); - $activity->set_object( $post ); - $json->orderedItems[] = $activity->to_array( false ); // phpcs:ignore - } - } - - // filter output - $json = \apply_filters( 'activitypub_rest_outbox_array', $json ); - - /* - * Action triggerd after the ActivityPub profile has been created and sent to the client - */ - \do_action( 'activitypub_outbox_post' ); - - $rest_response = new WP_REST_Response( $json, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function request_parameters() { - $params = array(); - - $params['page'] = array( - 'type' => 'integer', - 'default' => 1, - ); - - $params['user_id'] = array( - 'required' => true, - 'type' => 'string', - ); - - return $params; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-server.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-server.php deleted file mode 100644 index d03f6c17..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-server.php +++ /dev/null @@ -1,127 +0,0 @@ - \WP_REST_Server::READABLE, - 'callback' => array( self::class, 'application_actor' ), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * Render Application actor profile - * - * @return WP_REST_Response The JSON profile of the Application Actor. - */ - public static function application_actor() { - $user = new Application(); - - $json = $user->to_array(); - - $rest_response = new WP_REST_Response( $json, 200 ); - $rest_response->header( 'Content-Type', 'application/activity+json; charset=' . get_option( 'blog_charset' ) ); - - return $rest_response; - } - - /** - * Callback function to authorize each api requests - * - * @see WP_REST_Request - * - * @see https://www.w3.org/wiki/SocialCG/ActivityPub/Primer/Authentication_Authorization#Authorized_fetch - * @see https://swicg.github.io/activitypub-http-signature/#authorized-fetch - * - * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. - * Usually a WP_REST_Response or WP_Error. - * @param array $handler Route handler used for the request. - * @param WP_REST_Request $request Request used to generate the response. - * - * @return mixed|WP_Error The response, error, or modified response. - */ - public static function authorize_activitypub_requests( $response, $handler, $request ) { - if ( 'HEAD' === $request->get_method() ) { - return $response; - } - - $route = $request->get_route(); - - // check if it is an activitypub request and exclude webfinger and nodeinfo endpoints - if ( - ! \str_starts_with( $route, '/' . ACTIVITYPUB_REST_NAMESPACE ) || - \str_starts_with( $route, '/' . \trailingslashit( ACTIVITYPUB_REST_NAMESPACE ) . 'webfinger' ) || - \str_starts_with( $route, '/' . \trailingslashit( ACTIVITYPUB_REST_NAMESPACE ) . 'nodeinfo' ) || - \str_starts_with( $route, '/' . \trailingslashit( ACTIVITYPUB_REST_NAMESPACE ) . 'application' ) - ) { - return $response; - } - - /** - * Filter to defer signature verification - * - * Skip signature verification for debugging purposes or to reduce load for - * certain Activity-Types, like "Delete". - * - * @param bool $defer Whether to defer signature verification. - * @param WP_REST_Request $request The request used to generate the response. - * - * @return bool Whether to defer signature verification. - */ - $defer = \apply_filters( 'activitypub_defer_signature_verification', false, $request ); - - if ( $defer ) { - return $response; - } - - if ( - // POST-Requests are always signed - 'GET' !== $request->get_method() || - // GET-Requests only require a signature in secure mode - ( 'GET' === $request->get_method() && ACTIVITYPUB_AUTHORIZED_FETCH ) - ) { - $verified_request = Signature::verify_http_signature( $request ); - if ( \is_wp_error( $verified_request ) ) { - return new WP_Error( - 'activitypub_signature_verification', - $verified_request->get_error_message(), - array( 'status' => 401 ) - ); - } - } - - return $response; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-webfinger.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-webfinger.php deleted file mode 100644 index 48224e18..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/rest/class-webfinger.php +++ /dev/null @@ -1,145 +0,0 @@ - \WP_REST_Server::READABLE, - 'callback' => array( self::class, 'webfinger' ), - 'args' => self::request_parameters(), - 'permission_callback' => '__return_true', - ), - ) - ); - } - - /** - * WebFinger endpoint. - * - * @param WP_REST_Request $request The request object. - * - * @return WP_REST_Response The response object. - */ - public static function webfinger( $request ) { - /* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ - \do_action( 'activitypub_rest_webfinger_pre' ); - - $code = 200; - - $resource = $request->get_param( 'resource' ); - $response = self::get_profile( $resource ); - - if ( \is_wp_error( $response ) ) { - $code = 400; - $error_data = $response->get_error_data(); - - if ( isset( $error_data['status'] ) ) { - $code = $error_data['status']; - } - } - - return new WP_REST_Response( - $response, - $code, - array( - 'Access-Control-Allow-Origin' => '*', - 'Content-Type' => 'application/jrd+json; charset=' . get_option( 'blog_charset' ), - ) - ); - } - - /** - * The supported parameters - * - * @return array list of parameters - */ - public static function request_parameters() { - $params = array(); - - $params['resource'] = array( - 'required' => true, - 'type' => 'string', - 'pattern' => '^(acct:)|^(https?://)(.+)$', - ); - - return $params; - } - - /** - * Get the WebFinger profile. - * - * @param string $resource the WebFinger resource. - * - * @return array the WebFinger profile. - */ - public static function get_profile( $resource ) { - $user = User_Collection::get_by_resource( $resource ); - - if ( \is_wp_error( $user ) ) { - return $user; - } - - $aliases = array( - $user->get_url(), - $user->get_alternate_url(), - ); - - $aliases = array_unique( $aliases ); - - $profile = array( - 'subject' => sprintf( 'acct:%s', $user->get_webfinger() ), - 'aliases' => array_values( array_unique( $aliases ) ), - 'links' => array( - array( - 'rel' => 'self', - 'type' => 'application/activity+json', - 'href' => $user->get_url(), - ), - array( - 'rel' => 'http://webfinger.net/rel/profile-page', - 'type' => 'text/html', - 'href' => $user->get_url(), - ), - ), - ); - - if ( 'Person' !== $user->get_type() ) { - $profile['links'][0]['properties'] = array( - 'https://www.w3.org/ns/activitystreams#type' => $user->get_type(), - ); - } - - return $profile; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/table/class-followers.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/table/class-followers.php deleted file mode 100644 index df9747bd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/table/class-followers.php +++ /dev/null @@ -1,178 +0,0 @@ -id === 'settings_page_activitypub' ) { - $this->user_id = Users::BLOG_USER_ID; - } else { - $this->user_id = \get_current_user_id(); - } - - parent::__construct( - array( - 'singular' => \__( 'Follower', 'activitypub' ), - 'plural' => \__( 'Followers', 'activitypub' ), - 'ajax' => false, - ) - ); - } - - public function get_columns() { - return array( - 'cb' => '', - 'avatar' => \__( 'Avatar', 'activitypub' ), - 'post_title' => \__( 'Name', 'activitypub' ), - 'username' => \__( 'Username', 'activitypub' ), - 'url' => \__( 'URL', 'activitypub' ), - 'published' => \__( 'Followed', 'activitypub' ), - 'modified' => \__( 'Last updated', 'activitypub' ), - ); - } - - public function get_sortable_columns() { - $sortable_columns = array( - 'post_title' => array( 'post_title', true ), - 'modified' => array( 'modified', false ), - 'published' => array( 'published', false ), - ); - - return $sortable_columns; - } - - public function prepare_items() { - $columns = $this->get_columns(); - $hidden = array(); - - $this->process_action(); - $this->_column_headers = array( $columns, $hidden, $this->get_sortable_columns() ); - - $page_num = $this->get_pagenum(); - $per_page = 20; - - $args = array(); - - // phpcs:ignore WordPress.Security.NonceVerification.Recommended - if ( isset( $_GET['orderby'] ) ) { - // phpcs:ignore WordPress.Security.NonceVerification.Recommended - $args['orderby'] = sanitize_text_field( wp_unslash( $_GET['orderby'] ) ); - } - - // phpcs:ignore WordPress.Security.NonceVerification.Recommended - if ( isset( $_GET['order'] ) ) { - // phpcs:ignore WordPress.Security.NonceVerification.Recommended - $args['order'] = sanitize_text_field( wp_unslash( $_GET['order'] ) ); - } - - // phpcs:ignore WordPress.Security.NonceVerification.Recommended - if ( isset( $_GET['s'] ) && isset( $_REQUEST['_wpnonce'] ) ) { - $nonce = sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ); - if ( wp_verify_nonce( $nonce, 'bulk-' . $this->_args['plural'] ) ) { - // phpcs:ignore WordPress.Security.NonceVerification.Recommended - $args['s'] = sanitize_text_field( wp_unslash( $_GET['s'] ) ); - } - } - - $followers_with_count = FollowerCollection::get_followers_with_count( $this->user_id, $per_page, $page_num, $args ); - $followers = $followers_with_count['followers']; - $counter = $followers_with_count['total']; - - $this->items = array(); - $this->set_pagination_args( - array( - 'total_items' => $counter, - 'total_pages' => ceil( $counter / $per_page ), - 'per_page' => $per_page, - ) - ); - - foreach ( $followers as $follower ) { - $item = array( - 'icon' => esc_attr( $follower->get_icon_url() ), - 'post_title' => esc_attr( $follower->get_name() ), - 'username' => esc_attr( $follower->get_preferred_username() ), - 'url' => esc_attr( object_to_uri( $follower->get_url() ) ), - 'identifier' => esc_attr( $follower->get_id() ), - 'published' => esc_attr( $follower->get_published() ), - 'modified' => esc_attr( $follower->get_updated() ), - ); - - $this->items[] = $item; - } - } - - public function get_bulk_actions() { - return array( - 'delete' => __( 'Delete', 'activitypub' ), - ); - } - - public function column_default( $item, $column_name ) { - if ( ! array_key_exists( $column_name, $item ) ) { - return __( 'None', 'activitypub' ); - } - return $item[ $column_name ]; - } - - public function column_avatar( $item ) { - return sprintf( - '', - $item['icon'] - ); - } - - public function column_url( $item ) { - return sprintf( - '%s', - $item['url'], - $item['url'] - ); - } - - public function column_cb( $item ) { - return sprintf( '', esc_attr( $item['identifier'] ) ); - } - - public function process_action() { - if ( ! isset( $_REQUEST['followers'] ) || ! isset( $_REQUEST['_wpnonce'] ) ) { - return false; - } - $nonce = sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ); - if ( ! wp_verify_nonce( $nonce, 'bulk-' . $this->_args['plural'] ) ) { - return false; - } - - if ( ! current_user_can( 'edit_user', $this->user_id ) ) { - return false; - } - - $followers = $_REQUEST['followers']; // phpcs:ignore - - switch ( $this->current_action() ) { - case 'delete': - if ( ! is_array( $followers ) ) { - $followers = array( $followers ); - } - foreach ( $followers as $follower ) { - FollowerCollection::remove_follower( $this->user_id, $follower ); - } - break; - } - } - - public function get_user_count() { - return FollowerCollection::count_followers( $this->user_id ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-attachment.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-attachment.php deleted file mode 100644 index 2fc46350..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-attachment.php +++ /dev/null @@ -1,61 +0,0 @@ -wp_object->ID ); - $media_type = preg_replace( '/(\/[a-zA-Z]+)/i', '', $mime_type ); - - switch ( $media_type ) { - case 'audio': - case 'video': - $type = 'Document'; - break; - case 'image': - $type = 'Image'; - break; - } - - $attachment = array( - 'type' => $type, - 'url' => wp_get_attachment_url( $this->wp_object->ID ), - 'mediaType' => $mime_type, - ); - - $alt = \get_post_meta( $this->wp_object->ID, '_wp_attachment_image_alt', true ); - if ( $alt ) { - $attachment['name'] = $alt; - } - - return $attachment; - } - - /** - * Returns the ActivityStreams 2.0 Object-Type for a Post based on the - * settings and the Post-Type. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#activity-types - * - * @return string The Object-Type. - */ - protected function get_type() { - return 'Note'; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-base.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-base.php deleted file mode 100644 index 5041fa96..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-base.php +++ /dev/null @@ -1,124 +0,0 @@ -wp_object = $wp_object; - } - - /** - * Transform all properties with available get(ter) functions. - * - * @param Base_Object|object $object - * - * @return Base_Object|object $object - */ - protected function transform_object_properties( $activitypub_object ) { - $vars = $activitypub_object->get_object_var_keys(); - - foreach ( $vars as $var ) { - $getter = 'get_' . $var; - - if ( method_exists( $this, $getter ) ) { - $value = call_user_func( array( $this, $getter ) ); - - if ( isset( $value ) ) { - $setter = 'set_' . $var; - - call_user_func( array( $activitypub_object, $setter ), $value ); - } - } - } - return $activitypub_object; - } - - /** - * Transform the WordPress Object into an ActivityPub Object. - * - * @return Activitypub\Activity\Base_Object - */ - public function to_object() { - $activitypub_object = new Base_Object(); - $activitypub_object = $this->transform_object_properties( $activitypub_object ); - - return $activitypub_object; - } - - /** - * Transforms the ActivityPub Object to an Activity - * - * @param string $type The Activity-Type. - * - * @return \Activitypub\Activity\Activity The Activity. - */ - public function to_activity( $type ) { - $object = $this->to_object(); - - $activity = new Activity(); - $activity->set_type( $type ); - - // Pre-fill the Activity with data (for example cc and to). - $activity->set_object( $object ); - - // Use simple Object (only ID-URI) for Like and Announce - if ( in_array( $type, array( 'Like', 'Announce' ), true ) ) { - $activity->set_object( $object->get_id() ); - } - - return $activity; - } - - /** - * Returns the ID of the WordPress Object. - * - * @return int The ID of the WordPress Object - */ - abstract public function get_wp_user_id(); - - /** - * Change the User-ID of the WordPress Post. - * - * @return int The User-ID of the WordPress Post - */ - abstract public function change_wp_user_id( $user_id ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-comment.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-comment.php deleted file mode 100644 index 72cf11f6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-comment.php +++ /dev/null @@ -1,292 +0,0 @@ -wp_object->user_id; - } - - /** - * Change the User-ID of the WordPress Comment. - * - * @return int The User-ID of the WordPress Comment - */ - public function change_wp_user_id( $user_id ) { - $this->wp_object->user_id = $user_id; - } - - /** - * Transforms the WP_Comment object to an ActivityPub Object - * - * @see \Activitypub\Activity\Base_Object - * - * @return \Activitypub\Activity\Base_Object The ActivityPub Object - */ - public function to_object() { - $comment = $this->wp_object; - $object = parent::to_object(); - - $object->set_url( $this->get_id() ); - $object->set_type( 'Note' ); - - $published = \strtotime( $comment->comment_date_gmt ); - $object->set_published( \gmdate( 'Y-m-d\TH:i:s\Z', $published ) ); - - $updated = \get_comment_meta( $comment->comment_ID, 'activitypub_comment_modified', true ); - if ( $updated > $published ) { - $object->set_updated( \gmdate( 'Y-m-d\TH:i:s\Z', $updated ) ); - } - - $object->set_content_map( - array( - $this->get_locale() => $this->get_content(), - ) - ); - $path = sprintf( 'actors/%d/followers', intval( $comment->comment_author ) ); - - $object->set_to( - array( - 'https://www.w3.org/ns/activitystreams#Public', - get_rest_url_by_path( $path ), - ) - ); - - return $object; - } - - /** - * Returns the User-URL of the Author of the Post. - * - * If `single_user` mode is enabled, the URL of the Blog-User is returned. - * - * @return string The User-URL. - */ - protected function get_attributed_to() { - if ( is_single_user() ) { - $user = new Blog(); - return $user->get_url(); - } - - return Users::get_by_id( $this->wp_object->user_id )->get_url(); - } - - /** - * Returns the content for the ActivityPub Item. - * - * The content will be generated based on the user settings. - * - * @return string The content. - */ - protected function get_content() { - // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited - $comment = $this->wp_object; - $content = $comment->comment_content; - - $content = \apply_filters( 'comment_text', $content, $comment, array() ); - $content = \preg_replace( '/[\n\r\t]/', '', $content ); - $content = \trim( $content ); - $content = \apply_filters( 'activitypub_the_content', $content, $comment ); - - return $content; - } - - /** - * Returns the in-reply-to for the ActivityPub Item. - * - * @return int The URL of the in-reply-to. - */ - protected function get_in_reply_to() { - $comment = $this->wp_object; - - $parent_comment = null; - $in_reply_to = null; - - if ( $comment->comment_parent ) { - $parent_comment = \get_comment( $comment->comment_parent ); - } - - if ( $parent_comment ) { - $comment_meta = \get_comment_meta( $parent_comment->comment_ID ); - - if ( ! empty( $comment_meta['source_id'][0] ) ) { - $in_reply_to = $comment_meta['source_id'][0]; - } elseif ( ! empty( $comment_meta['source_url'][0] ) ) { - $in_reply_to = $comment_meta['source_url'][0]; - } elseif ( ! empty( $parent_comment->user_id ) ) { - $in_reply_to = Comment_Utils::generate_id( $parent_comment ); - } - } else { - $in_reply_to = \get_permalink( $comment->comment_post_ID ); - } - - return $in_reply_to; - } - - /** - * Returns the ID of the ActivityPub Object. - * - * @see https://www.w3.org/TR/activitypub/#obj-id - * @see https://github.com/tootsuite/mastodon/issues/13879 - * - * @return string ActivityPub URI for comment - */ - protected function get_id() { - $comment = $this->wp_object; - return Comment_Utils::generate_id( $comment ); - } - - /** - * Returns a list of Mentions, used in the Comment. - * - * @see https://docs.joinmastodon.org/spec/activitypub/#Mention - * - * @return array The list of Mentions. - */ - protected function get_cc() { - $cc = array(); - - $mentions = $this->get_mentions(); - if ( $mentions ) { - foreach ( $mentions as $url ) { - $cc[] = $url; - } - } - - return array_unique( $cc ); - } - - /** - * Returns a list of Tags, used in the Comment. - * - * This includes Hash-Tags and Mentions. - * - * @return array The list of Tags. - */ - protected function get_tag() { - $tags = array(); - - $mentions = $this->get_mentions(); - if ( $mentions ) { - foreach ( $mentions as $mention => $url ) { - $tag = array( - 'type' => 'Mention', - 'href' => \esc_url( $url ), - 'name' => \esc_html( $mention ), - ); - $tags[] = $tag; - } - } - - return \array_unique( $tags, SORT_REGULAR ); - } - - /** - * Helper function to get the @-Mentions from the comment content. - * - * @return array The list of @-Mentions. - */ - protected function get_mentions() { - \add_filter( 'activitypub_extract_mentions', array( $this, 'extract_reply_context' ) ); - - return apply_filters( 'activitypub_extract_mentions', array(), $this->wp_object->comment_content, $this->wp_object ); - } - - /** - * Gets the ancestors of the comment, but only the ones that are ActivityPub comments. - * - * @return array The list of ancestors. - */ - protected function get_comment_ancestors() { - $ancestors = get_comment_ancestors( $this->wp_object ); - - // Now that we have the full tree of ancestors, only return the ones received from the fediverse - return array_filter( - $ancestors, - function ( $comment_id ) { - return \get_comment_meta( $comment_id, 'protocol', true ) === 'activitypub'; - } - ); - } - - /** - * Collect all other Users that participated in this comment-thread - * to send them a notification about the new reply. - * - * @param array $mentions The already mentioned ActivityPub users - * - * @return array The list of all Repliers. - */ - public function extract_reply_context( $mentions ) { - // Check if `$this->wp_object` is a WP_Comment - if ( 'WP_Comment' !== get_class( $this->wp_object ) ) { - return $mentions; - } - - $ancestors = $this->get_comment_ancestors(); - if ( ! $ancestors ) { - return $mentions; - } - - foreach ( $ancestors as $comment_id ) { - $comment = \get_comment( $comment_id ); - if ( $comment && ! empty( $comment->comment_author_url ) ) { - $acct = Webfinger::uri_to_acct( $comment->comment_author_url ); - if ( $acct && ! is_wp_error( $acct ) ) { - $acct = str_replace( 'acct:', '@', $acct ); - $mentions[ $acct ] = $comment->comment_author_url; - } - } - } - - return $mentions; - } - - /** - * Returns the locale of the post. - * - * @return string The locale of the post. - */ - public function get_locale() { - $comment_id = $this->wp_object->ID; - $lang = \strtolower( \strtok( \get_locale(), '_-' ) ); - - /** - * Filter the locale of the comment. - * - * @param string $lang The locale of the comment. - * @param int $comment_id The comment ID. - * @param WP_Post $post The comment object. - * - * @return string The filtered locale of the comment. - */ - return apply_filters( 'activitypub_comment_locale', $lang, $comment_id, $this->wp_object ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-factory.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-factory.php deleted file mode 100644 index b21de7f9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-factory.php +++ /dev/null @@ -1,80 +0,0 @@ -post_type === 'event' ) { - * return new My_Event_Transformer( $object ); - * } - * return $transformer; - * }, 10, 3 ); - * - * @param Base $transformer The transformer to use. - * @param mixed $object The object to transform. - * @param string $object_class The class of the object to transform. - * - * @return mixed The transformer to use. - */ - $transformer = \apply_filters( 'activitypub_transformer', null, $object, $class ); - - if ( $transformer ) { - if ( - ! \is_object( $transformer ) || - ! $transformer instanceof Base - ) { - return new WP_Error( 'invalid_transformer', __( 'Invalid transformer', 'activitypub' ) ); - } - - return $transformer; - } - - // use default transformer - switch ( $class ) { - case 'WP_Post': - if ( 'attachment' === $object->post_type ) { - return new Attachment( $object ); - } - return new Post( $object ); - case 'WP_Comment': - return new Comment( $object ); - default: - return null; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-post.php b/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-post.php deleted file mode 100644 index 82f69dcc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/includes/transformer/class-post.php +++ /dev/null @@ -1,881 +0,0 @@ -wp_object->post_author; - } - - /** - * Change the User-ID of the WordPress Post. - * - * @return int The User-ID of the WordPress Post - */ - public function change_wp_user_id( $user_id ) { - $this->wp_object->post_author = $user_id; - - return $this; - } - - /** - * Transforms the WP_Post object to an ActivityPub Object - * - * @see \Activitypub\Activity\Base_Object - * - * @return \Activitypub\Activity\Base_Object The ActivityPub Object - */ - public function to_object() { - $post = $this->wp_object; - $object = parent::to_object(); - - $published = \strtotime( $post->post_date_gmt ); - - $object->set_published( \gmdate( 'Y-m-d\TH:i:s\Z', $published ) ); - - $updated = \strtotime( $post->post_modified_gmt ); - - if ( $updated > $published ) { - $object->set_updated( \gmdate( 'Y-m-d\TH:i:s\Z', $updated ) ); - } - - $object->set_content_map( - array( - $this->get_locale() => $this->get_content(), - ) - ); - $path = sprintf( 'actors/%d/followers', intval( $post->post_author ) ); - - $object->set_to( - array( - 'https://www.w3.org/ns/activitystreams#Public', - get_rest_url_by_path( $path ), - ) - ); - - return $object; - } - - /** - * Returns the ID of the Post. - * - * @return string The Posts ID. - */ - public function get_id() { - return $this->get_url(); - } - - /** - * Returns the URL of the Post. - * - * @return string The Posts URL. - */ - public function get_url() { - $post = $this->wp_object; - - if ( 'trash' === get_post_status( $post ) ) { - $permalink = \get_post_meta( $post->ID, 'activitypub_canonical_url', true ); - } elseif ( 'draft' === get_post_status( $post ) && get_sample_permalink( $post->ID ) ) { - $sample = get_sample_permalink( $post->ID ); - $permalink = str_replace( array( '%pagename%', '%postname%' ), $sample[1], $sample[0] ); - } else { - $permalink = \get_permalink( $post ); - } - - return \esc_url( $permalink ); - } - - /** - * Returns the User-URL of the Author of the Post. - * - * If `single_user` mode is enabled, the URL of the Blog-User is returned. - * - * @return string The User-URL. - */ - protected function get_attributed_to() { - $blog_user = new Blog(); - - if ( is_single_user() ) { - return $blog_user->get_url(); - } - - $user = Users::get_by_id( $this->wp_object->post_author ); - - if ( $user && ! is_wp_error( $user ) ) { - return $user->get_url(); - } - - return $blog_user->get_url(); - } - - /** - * Generates all Media Attachments for a Post. - * - * @return array The Attachments. - */ - protected function get_attachment() { - // Remove attachments from drafts. - if ( 'draft' === \get_post_status( $this->wp_object ) ) { - return array(); - } - - // Once upon a time we only supported images, but we now support audio/video as well. - // We maintain the image-centric naming for backwards compatibility. - $max_media = \intval( - \apply_filters( - 'activitypub_max_image_attachments', - \get_option( 'activitypub_max_image_attachments', ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS ) - ) - ); - - $media = array( - 'audio' => array(), - 'video' => array(), - 'image' => array(), - ); - $id = $this->wp_object->ID; - - // list post thumbnail first if this post has one - if ( \function_exists( 'has_post_thumbnail' ) && \has_post_thumbnail( $id ) ) { - $media['image'][] = array( 'id' => \get_post_thumbnail_id( $id ) ); - } - - $media = $this->get_enclosures( $media ); - - if ( site_supports_blocks() && \has_blocks( $this->wp_object->post_content ) ) { - $media = $this->get_block_attachments( $media, $max_media ); - } else { - $media = $this->get_classic_editor_images( $media, $max_media ); - } - - $media = self::filter_media_by_object_type( $media, \get_post_format( $this->wp_object ), $this->wp_object ); - $unique_ids = \array_unique( \array_column( $media, 'id' ) ); - $media = \array_intersect_key( $media, $unique_ids ); - $media = \array_slice( $media, 0, $max_media ); - - return \array_filter( \array_map( array( self::class, 'wp_attachment_to_activity_attachment' ), $media ) ); - } - - /** - * Get media attachments from blocks. They will be formatted as ActivityPub attachments, not as WP attachments. - * - * @param array $media The media array grouped by type. - * @param int $max_media The maximum number of attachments to return. - * - * @return array The attachments. - */ - protected function get_block_attachments( $media, $max_media ) { - // max media can't be negative or zero - if ( $max_media <= 0 ) { - return array(); - } - - $blocks = \parse_blocks( $this->wp_object->post_content ); - $media = self::get_media_from_blocks( $blocks, $media ); - - return $media; - } - - /** - * Get image attachments from the classic editor. - * This is imperfect as the contained images aren't necessarily the - * same as the attachments. - * - * @param int $max_images The maximum number of images to return. - * - * @return array The attachment IDs. - */ - protected function get_classic_editor_image_attachments( $max_images ) { - // max images can't be negative or zero - if ( $max_images <= 0 ) { - return array(); - } - - $images = array(); - $query = new \WP_Query( - array( - 'post_parent' => $this->wp_object->ID, - 'post_status' => 'inherit', - 'post_type' => 'attachment', - 'post_mime_type' => 'image', - 'order' => 'ASC', - 'orderby' => 'menu_order ID', - 'posts_per_page' => $max_images, - ) - ); - - foreach ( $query->get_posts() as $attachment ) { - if ( ! \in_array( $attachment->ID, $images, true ) ) { - $images[] = array( 'id' => $attachment->ID ); - } - } - - return $images; - } - - /** - * Get image embeds from the classic editor by parsing HTML. - * - * @param int $max_images The maximum number of images to return. - * - * @return array The attachments. - */ - protected function get_classic_editor_image_embeds( $max_images ) { - // if someone calls that function directly, bail - if ( ! \class_exists( '\WP_HTML_Tag_Processor' ) ) { - return array(); - } - - // max images can't be negative or zero - if ( $max_images <= 0 ) { - return array(); - } - - $images = array(); - $base = \wp_get_upload_dir()['baseurl']; - $content = \get_post_field( 'post_content', $this->wp_object ); - $tags = new \WP_HTML_Tag_Processor( $content ); - - // This linter warning is a false positive - we have to - // re-count each time here as we modify $images. - // phpcs:ignore Squiz.PHP.DisallowSizeFunctionsInLoops.Found - while ( $tags->next_tag( 'img' ) && ( \count( $images ) <= $max_images ) ) { - $src = $tags->get_attribute( 'src' ); - - // If the img source is in our uploads dir, get the - // associated ID. Note: if there's a -500x500 - // type suffix, we remove it, but we try the original - // first in case the original image is actually called - // that. Likewise, we try adding the -scaled suffix for - // the case that this is a small version of an image - // that was big enough to get scaled down on upload: - // https://make.wordpress.org/core/2019/10/09/introducing-handling-of-big-images-in-wordpress-5-3/ - if ( null !== $src && \str_starts_with( $src, $base ) ) { - $img_id = \attachment_url_to_postid( $src ); - - if ( 0 === $img_id ) { - $count = 0; - $src = preg_replace( '/-(?:\d+x\d+)(\.[a-zA-Z]+)$/', '$1', $src, 1, $count ); - if ( $count > 0 ) { - $img_id = \attachment_url_to_postid( $src ); - } - } - - if ( 0 === $img_id ) { - $src = preg_replace( '/(\.[a-zA-Z]+)$/', '-scaled$1', $src ); - $img_id = \attachment_url_to_postid( $src ); - } - - if ( 0 !== $img_id ) { - $images[] = array( - 'id' => $img_id, - 'alt' => $tags->get_attribute( 'alt' ), - ); - } - } - } - - return $images; - } - - /** - * Get post images from the classic editor. - * Note that audio/video attachments are only supported in the block editor. - * - * @param array $media The media array grouped by type. - * @param int $max_images The maximum number of images to return. - * - * @return array The attachments. - */ - protected function get_classic_editor_images( $media, $max_images ) { - // max images can't be negative or zero - if ( $max_images <= 0 ) { - return array(); - } - - if ( \count( $media['image'] ) <= $max_images ) { - if ( \class_exists( '\WP_HTML_Tag_Processor' ) ) { - $media['image'] = \array_merge( $media['image'], $this->get_classic_editor_image_embeds( $max_images ) ); - } else { - $media['image'] = \array_merge( $media['image'], $this->get_classic_editor_image_attachments( $max_images ) ); - } - } - - return $media; - } - - /** - * Get enclosures for a post. - * - * @param array $media The media array grouped by type. - * - * @return array The media array extended with enclosures. - */ - public function get_enclosures( $media ) { - $enclosures = get_enclosures( $this->wp_object->ID ); - - if ( ! $enclosures ) { - return $media; - } - - foreach ( $enclosures as $enclosure ) { - // check if URL is an attachment - $attachment_id = \attachment_url_to_postid( $enclosure['url'] ); - if ( $attachment_id ) { - $enclosure['id'] = $attachment_id; - $enclosure['url'] = \wp_get_attachment_url( $attachment_id ); - $enclosure['mediaType'] = \get_post_mime_type( $attachment_id ); - } - - $mime_type = $enclosure['mediaType']; - $mime_type_parts = \explode( '/', $mime_type ); - - switch ( $mime_type_parts[0] ) { - case 'image': - $media['image'][] = $enclosure; - break; - case 'audio': - $media['audio'][] = $enclosure; - break; - case 'video': - $media['video'][] = $enclosure; - break; - } - } - - return $media; - } - - /** - * Recursively get media IDs from blocks. - * @param array $blocks The blocks to search for media IDs - * @param array $media The media IDs to append new IDs to - * @param int $max_media The maximum number of media to return. - * - * @return array The image IDs. - */ - protected static function get_media_from_blocks( $blocks, $media ) { - foreach ( $blocks as $block ) { - // recurse into inner blocks - if ( ! empty( $block['innerBlocks'] ) ) { - $media = self::get_media_from_blocks( $block['innerBlocks'], $media ); - } - - switch ( $block['blockName'] ) { - case 'core/image': - case 'core/cover': - if ( ! empty( $block['attrs']['id'] ) ) { - $alt = ''; - $check = preg_match( '//i', $block['innerHTML'], $match ); - - if ( $check ) { - $alt = $match[2]; - } - - $media['image'][] = array( - 'id' => $block['attrs']['id'], - 'alt' => $alt, - ); - } - break; - case 'core/audio': - if ( ! empty( $block['attrs']['id'] ) ) { - $media['audio'][] = array( 'id' => $block['attrs']['id'] ); - } - break; - case 'core/video': - case 'videopress/video': - if ( ! empty( $block['attrs']['id'] ) ) { - $media['video'][] = array( 'id' => $block['attrs']['id'] ); - } - break; - case 'jetpack/slideshow': - case 'jetpack/tiled-gallery': - if ( ! empty( $block['attrs']['ids'] ) ) { - $media['image'] = array_merge( - $media['image'], - array_map( - function ( $id ) { - return array( 'id' => $id ); - }, - $block['attrs']['ids'] - ) - ); - } - break; - case 'jetpack/image-compare': - if ( ! empty( $block['attrs']['beforeImageId'] ) ) { - $media['image'][] = array( 'id' => $block['attrs']['beforeImageId'] ); - } - if ( ! empty( $block['attrs']['afterImageId'] ) ) { - $media['image'][] = array( 'id' => $block['attrs']['afterImageId'] ); - } - break; - } - } - - return $media; - } - - /** - * Filter media IDs by object type. - * - * @param array $media The media array grouped by type. - * @param string $type The object type. - * - * @return array The filtered media IDs. - */ - protected static function filter_media_by_object_type( $media, $type, $wp_object ) { - $type = \apply_filters( 'filter_media_by_object_type', \strtolower( $type ), $wp_object ); - - if ( ! empty( $media[ $type ] ) ) { - return $media[ $type ]; - } - - return array_filter( array_merge( array(), ...array_values( $media ) ) ); - } - - /** - * Converts a WordPress Attachment to an ActivityPub Attachment. - * - * @param array $media The Attachment array. - * - * @return array The ActivityPub Attachment. - */ - public static function wp_attachment_to_activity_attachment( $media ) { - if ( ! isset( $media['id'] ) ) { - return $media; - } - - $id = $media['id']; - $attachment = array(); - $mime_type = \get_post_mime_type( $id ); - $mime_type_parts = \explode( '/', $mime_type ); - // switching on image/audio/video - switch ( $mime_type_parts[0] ) { - case 'image': - $image_size = 'large'; - - /** - * Filter the image URL returned for each post. - * - * @param array|false $thumbnail The image URL, or false if no image is available. - * @param int $id The attachment ID. - * @param string $image_size The image size to retrieve. Set to 'large' by default. - */ - $thumbnail = apply_filters( - 'activitypub_get_image', - self::get_wordpress_attachment( $id, $image_size ), - $id, - $image_size - ); - - if ( $thumbnail ) { - $image = array( - 'type' => 'Image', - 'url' => \esc_url( $thumbnail[0] ), - 'mediaType' => \esc_attr( $mime_type ), - ); - - if ( ! empty( $media['alt'] ) ) { - $image['name'] = \wp_strip_all_tags( \html_entity_decode( $media['alt'] ) ); - } else { - $alt = \get_post_meta( $id, '_wp_attachment_image_alt', true ); - if ( $alt ) { - $image['name'] = \wp_strip_all_tags( \html_entity_decode( $alt ) ); - } - } - - $attachment = $image; - } - break; - - case 'audio': - case 'video': - $attachment = array( - 'type' => 'Document', - 'mediaType' => \esc_attr( $mime_type ), - 'url' => \esc_url( \wp_get_attachment_url( $id ) ), - 'name' => \esc_attr( \get_the_title( $id ) ), - ); - $meta = wp_get_attachment_metadata( $id ); - // height and width for videos - if ( isset( $meta['width'] ) && isset( $meta['height'] ) ) { - $attachment['width'] = \esc_attr( $meta['width'] ); - $attachment['height'] = \esc_attr( $meta['height'] ); - } - // @todo: add `icon` support for audio/video attachments. Maybe use post thumbnail? - break; - } - - return \apply_filters( 'activitypub_attachment', $attachment, $id ); - } - - /** - * Return details about an image attachment. - * - * @param int $id The attachment ID. - * @param string $image_size The image size to retrieve. Set to 'large' by default. - * - * @return array|false Array of image data, or boolean false if no image is available. - */ - protected static function get_wordpress_attachment( $id, $image_size = 'large' ) { - /** - * Hook into the image retrieval process. Before image retrieval. - * - * @param int $id The attachment ID. - * @param string $image_size The image size to retrieve. Set to 'large' by default. - */ - do_action( 'activitypub_get_image_pre', $id, $image_size ); - - $image = \wp_get_attachment_image_src( $id, $image_size ); - - /** - * Hook into the image retrieval process. After image retrieval. - * - * @param int $id The attachment ID. - * @param string $image_size The image size to retrieve. Set to 'large' by default. - */ - do_action( 'activitypub_get_image_post', $id, $image_size ); - - return $image; - } - - /** - * Returns the ActivityStreams 2.0 Object-Type for a Post based on the - * settings and the Post-Type. - * - * @see https://www.w3.org/TR/activitystreams-vocabulary/#activity-types - * - * @return string The Object-Type. - */ - protected function get_type() { - $post_format_setting = \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ); - - if ( 'wordpress-post-format' !== $post_format_setting ) { - return \ucfirst( $post_format_setting ); - } - - $has_title = post_type_supports( $this->wp_object->post_type, 'title' ); - - if ( ! $has_title ) { - return 'Note'; - } - - // Default to Article. - $object_type = 'Note'; - $post_format = 'standard'; - - if ( \get_theme_support( 'post-formats' ) ) { - $post_format = \get_post_format( $this->wp_object ); - } - - $post_type = \get_post_type( $this->wp_object ); - switch ( $post_type ) { - case 'post': - switch ( $post_format ) { - case 'standard': - case '': - $object_type = 'Article'; - break; - default: - $object_type = 'Note'; - break; - } - break; - case 'page': - $object_type = 'Page'; - break; - default: - $object_type = 'Note'; - break; - } - - return $object_type; - } - - /** - * Returns a list of Mentions, used in the Post. - * - * @see https://docs.joinmastodon.org/spec/activitypub/#Mention - * - * @return array The list of Mentions. - */ - protected function get_cc() { - $cc = array(); - - $mentions = $this->get_mentions(); - if ( $mentions ) { - foreach ( $mentions as $url ) { - $cc[] = $url; - } - } - - return $cc; - } - - - public function get_audience() { - if ( is_single_user() ) { - return null; - } else { - $blog = new Blog(); - return $blog->get_id(); - } - } - - /** - * Returns a list of Tags, used in the Post. - * - * This includes Hash-Tags and Mentions. - * - * @return array The list of Tags. - */ - protected function get_tag() { - $tags = array(); - - $post_tags = \get_the_tags( $this->wp_object->ID ); - if ( $post_tags ) { - foreach ( $post_tags as $post_tag ) { - $tag = array( - 'type' => 'Hashtag', - 'href' => \esc_url( \get_tag_link( $post_tag->term_id ) ), - 'name' => esc_hashtag( $post_tag->name ), - ); - $tags[] = $tag; - } - } - - $mentions = $this->get_mentions(); - if ( $mentions ) { - foreach ( $mentions as $mention => $url ) { - $tag = array( - 'type' => 'Mention', - 'href' => \esc_url( $url ), - 'name' => \esc_html( $mention ), - ); - $tags[] = $tag; - } - } - - return $tags; - } - - /** - * Returns the summary for the ActivityPub Item. - * - * The summary will be generated based on the user settings and only if the - * object type is not set to `note`. - * - * @return string|null The summary or null if the object type is `note`. - */ - protected function get_summary() { - if ( 'Note' === $this->get_type() ) { - return null; - } - - // Remove Teaser from drafts. - if ( 'draft' === \get_post_status( $this->wp_object ) ) { - return \__( '(This post is being modified)', 'activitypub' ); - } - - $content = \get_post_field( 'post_content', $this->wp_object->ID ); - $content = \html_entity_decode( $content ); - $content = \wp_strip_all_tags( $content ); - $content = \trim( $content ); - $content = \preg_replace( '/\R+/m', "\n\n", $content ); - $content = \preg_replace( '/[\r\t]/', '', $content ); - - $excerpt_more = \apply_filters( 'activitypub_excerpt_more', '[...]' ); - $length = 500; - $length = $length - strlen( $excerpt_more ); - - if ( \strlen( $content ) > $length ) { - $content = \wordwrap( $content, $length, '' ); - $content = \explode( '', $content, 2 ); - $content = $content[0]; - } - - return $content . ' ' . $excerpt_more; - } - - /** - * Returns the title for the ActivityPub Item. - * - * The title will be generated based on the user settings and only if the - * object type is not set to `note`. - * - * @return string|null The title or null if the object type is `note`. - */ - protected function get_name() { - if ( 'Note' === $this->get_type() ) { - return null; - } - - $title = \get_the_title( $this->wp_object->ID ); - - if ( $title ) { - return \wp_strip_all_tags( - \html_entity_decode( - $title - ) - ); - } - - return null; - } - - /** - * Returns the content for the ActivityPub Item. - * - * The content will be generated based on the user settings. - * - * @return string The content. - */ - protected function get_content() { - // Remove Content from drafts. - if ( 'draft' === \get_post_status( $this->wp_object ) ) { - return \__( '(This post is being modified)', 'activitypub' ); - } - - global $post; - - /** - * Provides an action hook so plugins can add their own hooks/filters before AP content is generated. - * - * Example: if a plugin adds a filter to `the_content` to add a button to the end of posts, it can also remove that filter here. - * - * @param WP_Post $post The post object. - */ - do_action( 'activitypub_before_get_content', $post ); - - add_filter( 'render_block_core/embed', array( self::class, 'revert_embed_links' ), 10, 2 ); - - // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited - $post = $this->wp_object; - $content = $this->get_post_content_template(); - - // Register our shortcodes just in time. - Shortcodes::register(); - // Fill in the shortcodes. - setup_postdata( $post ); - $content = do_shortcode( $content ); - wp_reset_postdata(); - - $content = \wpautop( $content ); - $content = \preg_replace( '/[\n\r\t]/', '', $content ); - $content = \trim( $content ); - - $content = \apply_filters( 'activitypub_the_content', $content, $post ); - - // Don't need these any more, should never appear in a post. - Shortcodes::unregister(); - - return $content; - } - - /** - * Gets the template to use to generate the content of the activitypub item. - * - * @return string The Template. - */ - protected function get_post_content_template() { - $type = \get_option( 'activitypub_post_content_type', 'content' ); - - switch ( $type ) { - case 'excerpt': - $template = "[ap_excerpt]\n\n[ap_permalink type=\"html\"]"; - break; - case 'title': - $template = "

[ap_title]

\n\n[ap_permalink type=\"html\"]"; - break; - case 'content': - $template = "[ap_content]\n\n[ap_permalink type=\"html\"]\n\n[ap_hashtags]"; - break; - default: - $template = \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT ); - break; - } - - $post_format_setting = \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ); - - if ( 'wordpress-post-format' === $post_format_setting ) { - $template = '[ap_content]'; - } - - return apply_filters( 'activitypub_object_content_template', $template, $this->wp_object ); - } - - /** - * Helper function to get the @-Mentions from the post content. - * - * @return array The list of @-Mentions. - */ - protected function get_mentions() { - return apply_filters( 'activitypub_extract_mentions', array(), $this->wp_object->post_content, $this->wp_object ); - } - - /** - * Returns the locale of the post. - * - * @return string The locale of the post. - */ - public function get_locale() { - $post_id = $this->wp_object->ID; - $lang = \strtolower( \strtok( \get_locale(), '_-' ) ); - - /** - * Filter the locale of the post. - * - * @param string $lang The locale of the post. - * @param int $post_id The post ID. - * @param WP_Post $post The post object. - * - * @return string The filtered locale of the post. - */ - return apply_filters( 'activitypub_post_locale', $lang, $post_id, $this->wp_object ); - } - - /** - * Transform Embed blocks to block level link. - * - * Remote servers will simply drop iframe elements, rendering incomplete content. - * - * @see https://www.w3.org/TR/activitypub/#security-sanitizing-content - * @see https://www.w3.org/wiki/ActivityPub/Primer/HTML - * - * @param string $block_content The block content (html) - * @param object $block The block object - * - * @return string A block level link - */ - public static function revert_embed_links( $block_content, $block ) { - return '

' . $block['attrs']['url'] . '

'; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-buddypress.php b/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-buddypress.php deleted file mode 100644 index 8d71c1d2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-buddypress.php +++ /dev/null @@ -1,76 +0,0 @@ -url = bp_core_get_user_domain( $author_id ); //add BP member profile URL as user URL - - // add BuddyPress' cover_image instead of WordPress' header_image - $cover_image_url = bp_attachments_get_attachment( 'url', array( 'item_id' => $author_id ) ); - - if ( $cover_image_url ) { - $object->image = array( - 'type' => 'Image', - 'url' => $cover_image_url, - ); - } - - // change profile URL to BuddyPress' profile URL - $object->attachment['profile_url'] = array( - 'type' => 'PropertyValue', - 'name' => \__( 'Profile', 'activitypub' ), - 'value' => \html_entity_decode( - sprintf( - '%s', - \esc_attr( bp_core_get_user_domain( $author_id ) ), - \bp_core_get_user_domain( $author_id ), - \wp_parse_url( \bp_core_get_user_domain( $author_id ), \PHP_URL_HOST ) - ), - \ENT_QUOTES, - 'UTF-8' - ), - ); - - // replace blog URL on multisite - if ( is_multisite() ) { - $user_blogs = get_blogs_of_user( $author_id ); //get sites of user to send as AP metadata - - if ( ! empty( $user_blogs ) ) { - unset( $object->attachment['blog_url'] ); - - foreach ( $user_blogs as $blog ) { - if ( 1 !== $blog->userblog_id ) { - $object->attachment[] = array( - 'type' => 'PropertyValue', - 'name' => $blog->blogname, - 'value' => \html_entity_decode( - sprintf( - '%s', - \esc_attr( $blog->siteurl ), - $blog->siteurl, - \wp_parse_url( $blog->siteurl, \PHP_URL_HOST ) - ), - \ENT_QUOTES, - 'UTF-8' - ), - ); - } - } - } - } - - return $object; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-enable-mastodon-apps.php b/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-enable-mastodon-apps.php deleted file mode 100644 index 6c643b10..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-enable-mastodon-apps.php +++ /dev/null @@ -1,468 +0,0 @@ -get_id() ); - - if ( $acct && ! is_wp_error( $acct ) ) { - $acct = \str_replace( 'acct:', '', $acct ); - } else { - $acct = $item->get_url(); - } - - $account = new Account(); - $account->id = \strval( $item->get__id() ); - $account->username = $item->get_preferred_username(); - $account->acct = $acct; - $account->display_name = $item->get_name(); - $account->url = $item->get_url(); - $account->uri = $item->get_id(); - $account->avatar = $item->get_icon_url(); - $account->avatar_static = $item->get_icon_url(); - $account->created_at = new DateTime( $item->get_published() ); - $account->last_status_at = new DateTime( $item->get_published() ); - $account->note = $item->get_summary(); - $account->header = $item->get_image_url(); - $account->header_static = $item->get_image_url(); - $account->followers_count = 0; - $account->following_count = 0; - $account->statuses_count = 0; - $account->bot = false; - $account->locked = false; - $account->group = false; - $account->discoversable = false; - $account->indexable = false; - $account->hide_collections = false; - $account->noindex = false; - $account->fields = array(); - $account->emojis = array(); - $account->roles = array(); - - return $account; - }, - $activitypub_followers - ); - - $followers = array_merge( $mastodon_followers, $followers ); - - return $followers; - } - - /** - * Add followers count to Mastodon API - * - * @param Enable_Mastodon_Apps\Entity\Account $account The account - * @param int $user_id The user id - * - * @return Enable_Mastodon_Apps\Entity\Account The filtered Account - */ - public static function api_account_add_followers( $account, $user_id ) { - if ( ! $account instanceof Account ) { - return $account; - } - - $user = Users::get_by_various( $user_id ); - - if ( ! $user || is_wp_error( $user ) ) { - return $account; - } - - $header = $user->get_image(); - if ( $header ) { - $account->header = $header['url']; - $account->header_static = $header['url']; - } - - foreach ( $user->get_attachment() as $attachment ) { - if ( 'PropertyValue' === $attachment['type'] ) { - $account->fields[] = array( - 'name' => $attachment['name'], - 'value' => $attachment['value'], - ); - } - } - - $account->acct = $user->get_preferred_username(); - $account->note = $user->get_summary(); - - $account->followers_count = Followers::count_followers( $user->get__id() ); - return $account; - } - - /** - * Resolve external accounts for Mastodon API - * - * @param Enable_Mastodon_Apps\Entity\Account $user_data The user data - * @param string $user_id The user id - * - * @return Enable_Mastodon_Apps\Entity\Account The filtered Account - */ - public static function api_account_external( $user_data, $user_id ) { - if ( $user_data || ( is_numeric( $user_id ) && $user_id ) ) { - // Only augment. - return $user_data; - } - - $user = Users::get_by_various( $user_id ); - - if ( $user && ! is_wp_error( $user ) ) { - return $user_data; - } - - $uri = Webfinger_Util::resolve( $user_id ); - - if ( ! $uri || is_wp_error( $uri ) ) { - return $user_data; - } - - $account = self::get_account_for_actor( $uri ); - if ( $account ) { - return $account; - } - - return $user_data; - } - - private static function get_account_for_actor( $uri ) { - if ( ! is_string( $uri ) ) { - return null; - } - $data = get_remote_metadata_by_actor( $uri ); - - if ( ! $data || is_wp_error( $data ) ) { - return null; - } - $account = new Account(); - - $acct = Webfinger_Util::uri_to_acct( $uri ); - if ( str_starts_with( $acct, 'acct:' ) ) { - $acct = substr( $acct, 5 ); - } - - $account->id = $acct; - $account->username = $acct; - $account->acct = $acct; - $account->display_name = $data['name']; - $account->url = $uri; - - if ( ! empty( $data['summary'] ) ) { - $account->note = $data['summary']; - } - - if ( - isset( $data['icon']['type'] ) && - isset( $data['icon']['url'] ) && - 'Image' === $data['icon']['type'] - ) { - $account->avatar = $data['icon']['url']; - $account->avatar_static = $data['icon']['url']; - } - - if ( isset( $data['image'] ) ) { - $account->header = $data['image']['url']; - $account->header_static = $data['image']['url']; - } - if ( ! isset( $data['published'] ) ) { - $data['published'] = 'now'; - } - $account->created_at = new DateTime( $data['published'] ); - - return $account; - } - - public static function api_search_by_url( $search_data, $request ) { - $p = \wp_parse_url( $request->get_param( 'q' ) ); - if ( ! $p || ! isset( $p['host'] ) ) { - return $search_data; - } - - $object = Http::get_remote_object( $request->get_param( 'q' ), true ); - if ( is_wp_error( $object ) || ! isset( $object['attributedTo'] ) ) { - return $search_data; - } - - $account = self::get_account_for_actor( $object['attributedTo'] ); - if ( ! $account ) { - return $search_data; - } - - $status = self::activity_to_status( $object, $account ); - if ( $status ) { - $search_data['statuses'][] = $status; - } - - return $search_data; - } - - public static function api_search( $search_data, $request ) { - $user_id = \get_current_user_id(); - if ( ! $user_id ) { - return $search_data; - } - - $q = $request->get_param( 'q' ); - if ( ! $q ) { - return $search_data; - } - $q = sanitize_text_field( wp_unslash( $q ) ); - - $followers = Followers::get_followers( $user_id, 40, null, array( 's' => $q ) ); - if ( ! $followers ) { - return $search_data; - } - - foreach ( $followers as $follower ) { - $acct = Webfinger_Util::uri_to_acct( $follower->get_id() ); - - if ( $acct && ! is_wp_error( $acct ) ) { - $acct = \str_replace( 'acct:', '', $acct ); - } else { - $acct = $follower->get_url(); - } - - $account = new Account(); - $account->id = \strval( $follower->get__id() ); - $account->username = $follower->get_preferred_username(); - $account->acct = $acct; - $account->display_name = $follower->get_name(); - $account->url = $follower->get_url(); - $account->uri = $follower->get_id(); - $account->avatar = $follower->get_icon_url(); - $account->avatar_static = $follower->get_icon_url(); - $account->created_at = new DateTime( $follower->get_published() ); - $account->last_status_at = new DateTime( $follower->get_published() ); - $account->note = $follower->get_summary(); - $account->header = $follower->get_image_url(); - $account->header_static = $follower->get_image_url(); - - $search_data['accounts'][] = $account; - } - - return $search_data; - } - - public static function api_get_posts_query_args( $args ) { - if ( isset( $args['author'] ) && is_string( $args['author'] ) ) { - $uri = Webfinger_Util::resolve( $args['author'] ); - if ( $uri && ! is_wp_error( $uri ) ) { - $args['activitypub'] = $uri; - unset( $args['author'] ); - } - } - - return $args; - } - - private static function activity_to_status( $item, $account ) { - if ( isset( $item['object'] ) ) { - $object = $item['object']; - } else { - $object = $item; - } - - if ( ! isset( $object['type'] ) || 'Note' !== $object['type'] ) { - return null; - } - - $status = new Status(); - $status->id = $object['id']; - $status->created_at = new DateTime( $object['published'] ); - $status->content = $object['content']; - $status->account = $account; - - if ( ! empty( $object['inReplyTo'] ) ) { - $status->in_reply_to_id = $object['inReplyTo']; - } - - if ( ! empty( $object['visibility'] ) ) { - $status->visibility = $object['visibility']; - } - if ( ! empty( $object['url'] ) ) { - $status->url = $object['url']; - $status->uri = $object['url']; - } else { - $status->uri = $object['id']; - } - - if ( ! empty( $object['attachment'] ) ) { - $status->media_attachments = array_map( - function ( $attachment ) { - $default_attachment = array( - 'url' => null, - 'mediaType' => null, - 'name' => null, - 'width' => 0, - 'height' => 0, - 'blurhash' => null, - ); - - $attachment = array_merge( $default_attachment, $attachment ); - - $media_attachment = new Media_Attachment(); - $media_attachment->id = $attachment['url']; - $media_attachment->type = strtok( $attachment['mediaType'], '/' ); - $media_attachment->url = $attachment['url']; - $media_attachment->preview_url = $attachment['url']; - $media_attachment->description = $attachment['name']; - if ( $attachment['blurhash'] ) { - $media_attachment->blurhash = $attachment['blurhash']; - } - if ( $attachment['width'] > 0 && $attachment['height'] > 0 ) { - $media_attachment->meta = array( - 'original' => array( - 'width' => $attachment['width'], - 'height' => $attachment['height'], - 'size' => $attachment['width'] . 'x' . $attachment['height'], - 'aspect' => $attachment['width'] / $attachment['height'], - ), - );} - return $media_attachment; - }, - $object['attachment'] - ); - } - - return $status; - } - - public static function api_statuses_external( $statuses, $args ) { - if ( ! isset( $args['activitypub'] ) ) { - return $statuses; - } - - $data = get_remote_metadata_by_actor( $args['activitypub'] ); - - if ( ! $data || is_wp_error( $data ) || ! isset( $data['outbox'] ) ) { - return $statuses; - } - - $outbox = Http::get_remote_object( $data['outbox'], true ); - if ( is_wp_error( $outbox ) || ! isset( $outbox['first'] ) ) { - return $statuses; - } - - $account = self::get_account_for_actor( $args['activitypub'] ); - if ( ! $account ) { - return $statuses; - } - $limit = 10; - if ( isset( $args['posts_per_page'] ) ) { - $limit = $args['posts_per_page']; - } - if ( $limit > 40 ) { - $limit = 40; - } - $activitypub_statuses = array(); - $url = $outbox['first']; - $tries = 0; - while ( $url ) { - if ( ++$tries > 3 ) { - break; - } - - $posts = Http::get_remote_object( $url, true ); - if ( is_wp_error( $posts ) ) { - return $statuses; - } - - $new_statuses = array_map( - function ( $item ) use ( $account, $args ) { - if ( $args['exclude_replies'] ) { - if ( isset( $item['object']['inReplyTo'] ) && $item['object']['inReplyTo'] ) { - return null; - } - } - return self::activity_to_status( $item, $account ); - }, - $posts['orderedItems'] - ); - $activitypub_statuses = array_merge( $activitypub_statuses, array_filter( $new_statuses ) ); - $url = $posts['next']; - - if ( count( $activitypub_statuses ) >= $limit ) { - break; - } - } - - return array_slice( $activitypub_statuses, 0, $limit ); - } - - public static function api_get_replies( $context, $post_id, $url ) { - $meta = Http::get_remote_object( $url, true ); - if ( is_wp_error( $meta ) || ! isset( $meta['replies']['first']['next'] ) ) { - return $context; - } - - $replies_url = $meta['replies']['first']['next']; - $replies = Http::get_remote_object( $replies_url, true ); - if ( is_wp_error( $replies ) || ! isset( $replies['items'] ) ) { - return $context; - } - - foreach ( $replies['items'] as $url ) { - $response = Http::get( $url, true ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) { - continue; - } - $status = json_decode( wp_remote_retrieve_body( $response ), true ); - if ( ! $status || is_wp_error( $status ) ) { - continue; - } - - $account = self::get_account_for_actor( $status['attributedTo'] ); - $status = self::activity_to_status( $status, $account ); - if ( $status ) { - $context['descendants'][ $status->id ] = $status; - } - } - - return $context; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-jetpack.php b/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-jetpack.php deleted file mode 100644 index 009811e9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-jetpack.php +++ /dev/null @@ -1,21 +0,0 @@ -= '2.0' ) { - $nodeinfo['protocols'][] = 'activitypub'; - } else { - $nodeinfo['protocols']['inbound'][] = 'activitypub'; - $nodeinfo['protocols']['outbound'][] = 'activitypub'; - } - - $nodeinfo['usage']['users'] = array( - 'total' => get_total_users(), - 'activeMonth' => get_active_users( '1 month ago' ), - 'activeHalfyear' => get_active_users( '6 month ago' ), - ); - - return $nodeinfo; - } - - /** - * Extend NodeInfo2 data - * - * @param array $nodeinfo NodeInfo2 data - * - * @return array The extended array - */ - public static function add_nodeinfo2_data( $nodeinfo ) { - $nodeinfo['protocols'][] = 'activitypub'; - - $nodeinfo['usage']['users'] = array( - 'total' => get_total_users(), - 'activeMonth' => get_active_users( '1 month ago' ), - 'activeHalfyear' => get_active_users( '6 month ago' ), - ); - - return $nodeinfo; - } - - /** - * Extend the well-known nodeinfo data - * - * @param array $data The well-known nodeinfo data - * - * @return array The extended array - */ - public static function add_wellknown_nodeinfo_data( $data ) { - $data['links'][] = array( - 'rel' => 'https://www.w3.org/ns/activitystreams#Application', - 'href' => get_rest_url_by_path( 'application' ), - ); - - return $data; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-opengraph.php b/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-opengraph.php deleted file mode 100644 index 2d0f8c96..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-opengraph.php +++ /dev/null @@ -1,107 +0,0 @@ -get_webfinger(); - - return $metadata; - } - - if ( \is_author() ) { - // Use the Author of the Archive-Page - $user_id = \get_queried_object_id(); - } elseif ( \is_singular() ) { - // Use the Author of the Post - $user_id = \get_post_field( 'post_author', \get_queried_object_id() ); - } elseif ( ! is_user_type_disabled( 'blog' ) ) { - // Use the Blog-User for any other page, if the Blog-User is not disabled - $user_id = Users::BLOG_USER_ID; - } else { - // Do not add any metadata otherwise - return $metadata; - } - - $user = Users::get_by_id( $user_id ); - - if ( ! $user || \is_wp_error( $user ) ) { - return $metadata; - } - - // add WebFinger resource - $metadata['fediverse:creator'] = $user->get_webfinger(); - - return $metadata; - } - - /** - * Output Open Graph tags in the page header. - */ - public static function add_meta_tags() { - $metadata = apply_filters( 'opengraph_metadata', array() ); - foreach ( $metadata as $key => $value ) { - if ( empty( $key ) || empty( $value ) ) { - continue; - } - $value = (array) $value; - - foreach ( $value as $v ) { - printf( - '' . PHP_EOL, - esc_attr( $key ), - esc_attr( $v ) - ); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-webfinger.php b/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-webfinger.php deleted file mode 100644 index c9727861..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/integration/class-webfinger.php +++ /dev/null @@ -1,69 +0,0 @@ -ID ); - - if ( ! $user || is_wp_error( $user ) ) { - return $array; - } - - $array['subject'] = sprintf( 'acct:%s', $user->get_webfinger() ); - - $array['aliases'][] = $user->get_url(); - $array['aliases'][] = $user->get_alternate_url(); - - $array['links'][] = array( - 'rel' => 'self', - 'type' => 'application/activity+json', - 'href' => $user->get_url(), - ); - - return $array; - } - - /** - * Add WebFinger discovery links - * - * @param array $array the jrd array - * @param string $resource the WebFinger resource - * @param WP_User $user the WordPress user - * - * @return array the jrd array - */ - public static function add_pseudo_user_discovery( $array, $resource ) { - $user = Webfinger_Rest::get_profile( $resource ); - - if ( ! $user || is_wp_error( $user ) ) { - return $array; - } - - return $user; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/readme.txt b/wp-content/upgrade-temp-backup/plugins/activitypub/readme.txt deleted file mode 100644 index 3dcd963b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/readme.txt +++ /dev/null @@ -1,233 +0,0 @@ -=== ActivityPub === -Contributors: automattic, pfefferle, mediaformat, mattwiebe, akirk, jeherve, nuriapena, cavalierlife -Tags: OStatus, fediverse, activitypub, activitystream -Requires at least: 5.5 -Tested up to: 6.6 -Stable tag: 2.6.1 -Requires PHP: 7.0 -License: MIT -License URI: http://opensource.org/licenses/MIT - -The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - -== Description == - -Enter the fediverse with **ActivityPub**, broadcasting your blog to a wider audience! Attract followers, deliver updates, and receive comments from a diverse user base of **ActivityPub**\-compliant platforms. - -With the ActivityPub plugin installed, your WordPress blog itself function as a federated profile, along with profiles for each author. For instance, if your website is `example.com`, then the blog-wide profile can be found at `@example.com@example.com`, and authors like Jane and Bob would have their individual profiles at `@jane@example.com` and `@bobz@example.com`, respectively. - -An example: I give you my Mastodon profile name: `@pfefferle@mastodon.social`. You search, see my profile, and hit follow. Now, any post I make appears in your Home feed. Similarly, with the ActivityPub plugin, you can find and follow Jane's profile at `@jane@example.com`. - -Once you follow Jane's `@jane@example.com` profile, any blog post she crafts on `example.com` will land in your Home feed. Simultaneously, by following the blog-wide profile `@example.com@example.com`, you'll receive updates from all authors. - -**Note**: if no one follows your author or blog instance, your posts remain unseen. The simplest method to verify the plugin's operation is by following your profile. If you possess a Mastodon profile, initiate by following your new one. - -The plugin works with the following tested federated platforms, but there may be more that it works with as well: - -* [Mastodon](https://joinmastodon.org/) -* [Pleroma](https://pleroma.social/)/[Akkoma](https://akkoma.social/) -* [friendica](https://friendi.ca/) -* [Hubzilla](https://hubzilla.org/) -* [Pixelfed](https://pixelfed.org/) -* [Socialhome](https://socialhome.network/) -* [Misskey](https://join.misskey.page/) -* [Firefish](https://joinfirefish.org/) (rebrand of Calckey) - -Some things to note: - -1. The blog-wide profile is only compatible with sites with rewrite rules enabled. If your site does not have rewrite rules enabled, the author-specific profiles may still work. -1. Many single-author blogs have chosen to turn off or redirect their author profile pages, usually via an SEO plugin like Yoast or Rank Math. This is usually done to avoid duplicate content with your blog’s home page. If your author page has been deactivated in this way, then ActivityPub author profiles won’t work for you. Instead, you can turn your author profile page back on, and then use the option in your SEO plugin to noindex the author page. This will still resolve duplicate content issues with search engines and will enable ActivityPub author profiles to work. -1. Once ActivityPub is installed, *only new posts going forward* will be available in the fediverse. Likewise, even if you’ve been using ActivityPub for a while, anyone who follows your site will only see new posts you publish from that moment on. They will never see previously-published posts in their Home feed. This process is very similar to subscribing to a newsletter. If you subscribe to a newsletter, you will only receive future emails, but not the old archived ones. With ActivityPub, if someone follows your site, they will only receive new blog posts you publish from then on. - -So what’s the process? - -1. Install the ActivityPub plugin. -1. Go to the plugin’s settings page and adjust the settings to your liking. Click the Save button when ready. -1. Make sure your blog’s author profile page is active if you are using author profiles. -1. Go to Mastodon or any other federated platform, and search for your profile, and follow it. Your new profile will be in the form of either `@your_username@example.com` or `@example.com@example.com`, so that is what you’ll search for. -1. On your blog, publish a new post. -1. From Mastodon, check to see if the new post appears in your Home feed. - -Please note that it may take up to 15 minutes or so for the new post to show up in your federated feed. This is because the messages are sent to the federated platforms using a delayed cron. This avoids breaking the publishing process for those cases where users might have lots of followers. So please don’t assume that just because you didn’t see it show up right away that something is broken. Give it some time. In most cases, it will show up within a few minutes, and you’ll know everything is working as expected. - -== Frequently Asked Questions == - -= tl;dr = - -This plugin connects your WordPress blog to popular social platforms like Mastodon, making your posts more accessible to a wider audience. Once installed, your blog can be followed by users on these platforms, allowing them to receive your new posts in their feeds. - -= What is the status of this plugin? = - -Implemented: - -* blog profile pages (JSON representation) -* author profile pages (JSON representation) -* custom links -* functional inbox/outbox -* follow (accept follows) -* share posts -* receive comments/reactions -* signature verification -* threaded comments support - -To implement: - -* replace shortcodes with blocks for layout - -= What is "ActivityPub for WordPress" = - -*ActivityPub for WordPress* extends WordPress with some Fediverse features, but it does not compete with platforms like Friendica or Mastodon. If you want to run a **decentralized social network**, please use [Mastodon](https://joinmastodon.org/) or [GNU social](https://gnusocial.network/). - -= What if you are running your blog in a subdirectory? = - -In order for webfinger to work, it must be mapped to the root directory of the URL on which your blog resides. - -**Apache** - -Add the following to the .htaccess file in the root directory: - - RedirectMatch "^\/\.well-known/(webfinger|nodeinfo|x-nodeinfo2)(.*)$" /blog/.well-known/$1$2 - -Where 'blog' is the path to the subdirectory at which your blog resides. - -**Nginx** - -Add the following to the site.conf in sites-available: - - location ~* /.well-known { - allow all; - try_files $uri $uri/ /blog/?$args; - } - -Where 'blog' is the path to the subdirectory at which your blog resides. - -= What if you are running your blog in a subdirectory? = - -If you are running your blog in a subdirectory, but have a different [wp_siteurl](https://wordpress.org/documentation/article/giving-wordpress-its-own-directory/), you don't need the redirect, because the index.php will take care of that. - -= Constants = - -The plugin uses PHP Constants to enable, disable or change its default behaviour. Please use them with caution and only if you know what you are doing. - -* `ACTIVITYPUB_REST_NAMESPACE` - Change the default Namespace of the REST endpoint. Default: `activitypub/1.0`. -* `ACTIVITYPUB_EXCERPT_LENGTH` - Change the length of the Excerpt. Default: `400`. -* `ACTIVITYPUB_SHOW_PLUGIN_RECOMMENDATIONS` - show plugin recommendations in the ActivityPub settings. Default: `true`. -* `ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS` - Change the number of attachments, that should be federated. Default: `3`. -* `ACTIVITYPUB_HASHTAGS_REGEXP` - Change the default regex to detect hashtext in a text. Default: `(?:(?<=\s)|(?<=

)|(?<=
)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))`. -* `ACTIVITYPUB_USERNAME_REGEXP` - Change the default regex to detect @-replies in a text. Default: `(?:([A-Za-z0-9\._-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))`. -* `ACTIVITYPUB_CUSTOM_POST_CONTENT` - Change the default template for Activities. Default: `[ap_title]\n\n[ap_content]\n\n[ap_hashtags]\n\n[ap_shortlink]`. -* `ACTIVITYPUB_AUTHORIZED_FETCH` - Enable AUTHORIZED_FETCH. Default: `false`. -* `ACTIVITYPUB_DISABLE_REWRITES` - Disable auto generation of `mod_rewrite` rules. Default: `false`. -* `ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS` - Block incoming replies/comments/likes. Default: `false`. -* `ACTIVITYPUB_DISABLE_OUTGOING_INTERACTIONS` - Disable outgoing replies/comments/likes. Default: `false`. -* `ACTIVITYPUB_SHARED_INBOX_FEATURE` - Enable the shared inbox. Default: `false`. -* `ACTIVITYPUB_SEND_VARY_HEADER` - Enable to send the `Vary: Accept` header. Default: `false`. - -= Where can you manage your followers? = - -If you have activated the blog user, you will find the list of his followers in the settings under `/wp-admin/options-general.php?page=activitypub&tab=followers`. - -The followers of a user can be found in the menu under "Users" -> "Followers" or under `wp-admin/users.php?page=activitypub-followers-list`. - -For reasons of data protection, it is not possible to see the followers of other users. - -== Changelog == - -= 2.6.1 = - -* Fixed: Extra Fields will generate wrong entries - -= 2.6.0 = - -* Added: Support for FEP-fb2a -* Added: CRUD support for Extra Fields -* Improved: Remote-Follow UI and UX -* Improved: Open Graph `fediverse:creator` implementation -* Fixed: Compatibility issues with fed.brid.gy -* Fixed: Remote-Reply endpoint -* Fixed: WebFinger Error Codes (thanks to the FediTest project) -* Fixed: Fatal Error when wp_schedule_single_event third argument is being passed as a string - -= 2.5.0 = - -* Added: WebFinger cors header -* Added: WebFinger Content-Type -* Added: The Fediverse creator of a post to OpenGraph -* Improved: Try to lookup local users first for Enable Mastodon Apps -* Improved: Send also Announces for deletes -* Improved: Load time by adding `count_total=false` to `WP_User_Query` -* Fixed: Several WebFinger issues -* Fixed: Redirect issue for Application user -* Fixed: Accessibilty issues with missing screen-reader-text on User overview page - -= 2.4.0 = - -* Added: A core/embed block filter to transform iframes to links -* Added: Basic support of incoming `Announce`s -* Added: Improve attachment handling -* Added: Notifications: Introduce general class and use it for new follows -* Added: Always fall back to `get_by_username` if one of the above fail -* Added: Notification support for Jetpack -* Added: EMA: Support for fetching external statuses without replies -* Added: EMA: Remote context -* Added: EMA: Allow searching for URLs -* Added: EMA: Ensuring numeric ids is now done in EMA directly -* Added: Podcast support -* Added: Follower count to "At a Glance" dashboard widget -* Improved: Use `Note` as default Object-Type, instead of `Article` -* Improved: Improve `AUTHORIZED_FETCH` -* Improved: Only send Mentions to comments in the direct hierarchy -* Improved: Improve transformer -* Improved: Improve Lemmy compatibility -* Improved: Updated JS dependencies -* Fixed: EMA: Add missing static keyword and try to lookup if the id is 0 -* Fixed: Blog-wide account when WordPress is in subdirectory -* Fixed: Funkwhale URLs -* Fixed: Prevent infinite loops in `get_comment_ancestors` -* Fixed: Better Content-Negotiation handling - -See full Changelog on [GitHub](https://github.com/Automattic/wordpress-activitypub/blob/master/CHANGELOG.md). - -== Upgrade Notice == - -= 1.0.0 = - -For version 1.0.0 we have completely rebuilt the followers lists. There is a migration from the old format to the new, but it may take some time until the migration is complete. No data will be lost in the process, please give the migration some time. - -== Installation == - -Follow the normal instructions for [installing WordPress plugins](https://wordpress.org/support/article/managing-plugins/). - -= Automatic Plugin Installation = - -To add a WordPress Plugin using the [built-in plugin installer](https://codex.wordpress.org/Administration_Screens#Add_New_Plugins): - -1. Go to [Plugins](https://codex.wordpress.org/Administration_Screens#Plugins) > [Add New](https://codex.wordpress.org/Plugins_Add_New_Screen). -1. Type "`activitypub`" into the **Search Plugins** box. -1. Find the WordPress Plugin you wish to install. - 1. Click **Details** for more information about the Plugin and instructions you may wish to print or save to help setup the Plugin. - 1. Click **Install Now** to install the WordPress Plugin. -1. The resulting installation screen will list the installation as successful or note any problems during the install. -1. If successful, click **Activate Plugin** to activate it, or **Return to Plugin Installer** for further actions. - -= Manual Plugin Installation = - -There are a few cases when manually installing a WordPress Plugin is appropriate. - -* If you wish to control the placement and the process of installing a WordPress Plugin. -* If your server does not permit automatic installation of a WordPress Plugin. -* If you want to try the [latest development version](https://github.com/pfefferle/wordpress-activitypub). - -Installation of a WordPress Plugin manually requires FTP familiarity and the awareness that you may put your site at risk if you install a WordPress Plugin incompatible with the current version or from an unreliable source. - -Backup your site completely before proceeding. - -To install a WordPress Plugin manually: - -* Download your WordPress Plugin to your desktop. - * Download from [the WordPress directory](https://wordpress.org/plugins/activitypub/) - * Download from [GitHub](https://github.com/pfefferle/wordpress-activitypub/releases) -* If downloaded as a zip archive, extract the Plugin folder to your desktop. -* With your FTP program, upload the Plugin folder to the `wp-content/plugins` folder in your WordPress directory online. -* Go to [Plugins screen](https://codex.wordpress.org/Administration_Screens#Plugins) and find the newly uploaded Plugin in the list. -* Click **Activate** to activate it. diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/admin-header.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/admin-header.php deleted file mode 100644 index 67b91ba9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/admin-header.php +++ /dev/null @@ -1,27 +0,0 @@ - -

-
-

-
- - -
-
diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/author-json.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/author-json.php deleted file mode 100644 index 63f6d12f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/author-json.php +++ /dev/null @@ -1,15 +0,0 @@ -get__id() ); - -\header( 'Content-Type: application/activity+json' ); -echo $user->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - -/* - * Action triggerd after the ActivityPub profile has been created and sent to the client - */ -\do_action( 'activitypub_json_author_post', $user->get__id() ); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/blog-json.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/blog-json.php deleted file mode 100644 index 5d8c53ce..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/blog-json.php +++ /dev/null @@ -1,15 +0,0 @@ -get__id() ); - -\header( 'Content-Type: application/activity+json' ); -echo $user->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - -/* - * Action triggerd after the ActivityPub profile has been created and sent to the client - */ -\do_action( 'activitypub_json_author_post', $user->get__id() ); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/blog-user-followers-list.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/blog-user-followers-list.php deleted file mode 100644 index 1eaa7ee9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/blog-user-followers-list.php +++ /dev/null @@ -1,28 +0,0 @@ - '', - 'welcome' => '', - 'followers' => 'active', - ) -); -$table = new \Activitypub\Table\Followers(); -$follower_count = $table->get_user_count(); -// translators: The follower count. -$followers_template = _n( 'Your blog profile currently has %s follower.', 'Your blog profile currently has %s followers.', $follower_count, 'activitypub' ); -?> -
-

- -
- - - prepare_items(); - $table->search_box( 'Search', 'search' ); - $table->display(); - ?> -
-
diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/comment-json.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/comment-json.php deleted file mode 100644 index a3583b77..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/comment-json.php +++ /dev/null @@ -1,23 +0,0 @@ -get_error_message() ), - 404 - ); -} - -/* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ -\do_action( 'activitypub_json_comment_pre' ); - -\header( 'Content-Type: application/activity+json' ); -echo $transformer->to_object()->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - -/* - * Action triggerd after the ActivityPub profile has been created and sent to the client - */ -\do_action( 'activitypub_json_comment_post' ); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/post-json.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/post-json.php deleted file mode 100644 index a89a7c01..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/post-json.php +++ /dev/null @@ -1,25 +0,0 @@ -get_error_message() ), - 404 - ); -} - - -/* - * Action triggerd prior to the ActivityPub profile being created and sent to the client - */ -\do_action( 'activitypub_json_post_pre' ); - -\header( 'Content-Type: application/activity+json' ); -echo $transformer->to_object()->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - -/* - * Action triggerd after the ActivityPub profile has been created and sent to the client - */ -\do_action( 'activitypub_json_post_post' ); diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/settings.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/settings.php deleted file mode 100644 index a00a551f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/settings.php +++ /dev/null @@ -1,270 +0,0 @@ - 'active', - 'welcome' => '', - 'followers' => '', - ) -); -?> - -
-
- - -
-

- - - - - - - - - - - -
- - -

- -

-

- activitypub capability) gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => array() ) ); ?> - - user settings.', 'activitypub' ), admin_url( '/users.php' ) ), array( 'a' => array( 'href' => array() ) ) ); ?> - array() ) ); ?> -

-

- -

-

- -

-
- - - -

- -

-

- - - -

-
- - -
- -
-

- - - - - - - - > - - - - - - - - - - - - - - - - -
- - -

- -

-

- -

- -
- - -

-

- -

-

- -

-

- -

-

- -

-

- -

- -
-
    -
  • [ap_title] -
  • -
  • [ap_content] -
  • -
  • [ap_excerpt] -
  • -
  • [ap_permalink] -
  • -
  • [ap_shortlink] - Hum.', 'activitypub' ), 'default' ); ?>
  • -
  • [ap_hashtags] -
  • -
-

-
-
-

-
- - - -

- %s', 'activitypub' ), - \esc_html( ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS ) - ), - 'default' - ); - ?> -

-

- - - -

-
-
- - - true ), 'objects' ); ?> - -
    - - -
  • - name, $support_post_types, true ) ); ?> /> - - - - -
  • - -
-
-
- - -

- -

-
- - -
- -
-

- - - - - - - -
- - -

- Disallowed Comment Keys" list.', 'activitypub' ), - \esc_attr( \admin_url( 'options-discussion.php#disallowed_keys' ) ) - ), - 'default' - ); - ?> -

-
- - -
- - - -
-
diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-followers-list.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-followers-list.php deleted file mode 100644 index 8ea35a73..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-followers-list.php +++ /dev/null @@ -1,21 +0,0 @@ - -
-

-

- - - -
- - prepare_items(); - $table->search_box( 'Search', 'search' ); - $table->display(); - ?> -
-
diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-settings.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-settings.php deleted file mode 100644 index 9489acbd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/user-settings.php +++ /dev/null @@ -1,67 +0,0 @@ - -

- - - - - - - - - - - - - - - - - -
- - -

- get_webfinger() ); ?> or - get_url() ); ?> -

- -

get_webfinger() ) ); ?>

-
- - - -

-
- - -

- - - - - - - - - - - -

- - - - - - -

-
diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/welcome.php b/wp-content/upgrade-temp-backup/plugins/activitypub/templates/welcome.php deleted file mode 100644 index e5e9440e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/activitypub/templates/welcome.php +++ /dev/null @@ -1,162 +0,0 @@ - '', - 'welcome' => 'active', - 'followers' => '', - ) -); -?> - -
-
-

- -

ActivityPub, broadcasting your blog to a wider audience. Attract followers, deliver updates, and receive comments from a diverse user base on Mastodon, Friendica, Pleroma, Pixelfed, and all ActivityPub-compliant platforms.', 'activitypub' ), array( 'strong' => array() ) ); ?>

-
- - -
-

-

- -

-

- -

-

- -

-

- -

-

- -

-

- -

-

- - - -

-
- - - ID ); - ?> -
-

-

- -

-

- -

-

- -

-

- -

-

- -

-

- -

-

- - - -

-
- - -
-

-

- Site Health page to ensure that your site is compatible and/or use the "Help" tab (in the top right of the settings pages).', - 'activitypub' - ), - \esc_url_raw( admin_url( 'site-health.php' ) ) - ), - 'default' - ); - ?> -

-
- - -
-

- -

-
-
- -

- -

-
-

-

-
- - -

- -

- - - -

- -

- - - -

- -

- - -
- -
diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/functions.php b/wp-content/upgrade-temp-backup/plugins/gitium/functions.php deleted file mode 100644 index d648985f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/functions.php +++ /dev/null @@ -1,420 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -function gitium_error_log( $message ) { - if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) { return; } - error_log( "gitium_error_log: $message" ); -} - -function wp_content_is_versioned() { - return file_exists( WP_CONTENT_DIR . '/.git' ); -} - -if ( ! function_exists( 'gitium_enable_maintenance_mode' ) ) : - function gitium_enable_maintenance_mode() { - $file = ABSPATH . '/.maintenance'; - - if ( false === file_put_contents( $file, 'set_key( $git_private_key ); - - $git->add( $dir ); - gitium_update_versions(); - $current_user = wp_get_current_user(); - return $git->commit( $message, $current_user->display_name, $current_user->user_email ); -} - -function _gitium_format_message( $name, $version = false, $prefix = '' ) { - $commit_message = "`$name`"; - if ( $version ) { - $commit_message .= " version $version"; - } - if ( $prefix ) { - $commit_message = "$prefix $commit_message"; - } - return $commit_message; -} - -/** - * This function return the basic info about a path. - * - * base_path - means the path after wp-content dir (themes/plugins) - * type - can be file/theme/plugin - * name - the file name of the path, if it is a file, or the theme/plugin name - * version - the theme/plugin version, othewise null - */ -/* Some examples: - - with 'wp-content/themes/twentyten/style.css' will return: - array( - 'base_path' => 'wp-content/themes/twentyten' - 'type' => 'theme' - 'name' => 'TwentyTen' - 'version' => '1.12' - ) - - with 'wp-content/themes/twentyten/img/foo.png' will return: - array( - 'base_path' => 'wp-content/themes/twentyten' - 'type' => 'theme' - 'name' => 'TwentyTen' - 'version' => '1.12' - ) - - with 'wp-content/plugins/foo.php' will return: - array( - 'base_path' => 'wp-content/plugins/foo.php' - 'type' => 'plugin' - 'name' => 'Foo' - 'varsion' => '2.0' - ) - - with 'wp-content/plugins/autover/autover.php' will return: - array( - 'base_path' => 'wp-content/plugins/autover' - 'type' => 'plugin' - 'name' => 'autover' - 'version' => '3.12' - ) - - with 'wp-content/plugins/autover/' will return: - array( - 'base_path' => 'wp-content/plugins/autover' - 'type' => 'plugin' - 'name' => 'autover' - 'version' => '3.12' - ) -*/ -function _gitium_module_by_path( $path ) { - $versions = gitium_get_versions(); - - // default values - $module = array( - 'base_path' => $path, - 'type' => 'file', - 'name' => basename( $path ), - 'version' => null, - ); - - // find the base_path - $split_path = explode( '/', $path ); - if ( 2 < count( $split_path ) ) { - $module['base_path'] = "{$split_path[0]}/{$split_path[1]}/{$split_path[2]}"; - } - - // find other data for theme - if ( array_key_exists( 'themes', $versions ) && 0 === strpos( $path, 'wp-content/themes/' ) ) { - $module['type'] = 'theme'; - foreach ( $versions['themes'] as $theme => $data ) { - if ( 0 === strpos( $path, "wp-content/themes/$theme" ) ) { - $module['name'] = $data['name']; - $module['version'] = $data['version']; - break; - } - } - } - - // find other data for plugin - if ( array_key_exists( 'plugins', $versions ) && 0 === strpos( $path, 'wp-content/plugins/' ) ) { - $module['type'] = 'plugin'; - foreach ( $versions['plugins'] as $plugin => $data ) { - if ( '.' === dirname( $plugin ) ) { // single file plugin - if ( "wp-content/plugins/$plugin" === $path ) { - $module['base_path'] = $path; - $module['name'] = $data['name']; - $module['version'] = $data['version']; - break; - } - } else if ( 'wp-content/plugins/' . dirname( $plugin ) === $module['base_path'] ) { - $module['name'] = $data['name']; - $module['version'] = $data['version']; - break; - } - } - } - - return $module; -} - -function gitium_group_commit_modified_plugins_and_themes( $msg_append = '' ) { - global $git; - - $uncommited_changes = $git->get_local_changes(); - $commit_groups = array(); - $commits = array(); - - if ( ! empty( $msg_append ) ) { - $msg_append = "($msg_append)"; - } - foreach ( $uncommited_changes as $path => $action ) { - $change = _gitium_module_by_path( $path ); - $change['action'] = $action; - $commit_groups[ $change['base_path'] ] = $change; - } - - foreach ( $commit_groups as $base_path => $change ) { - $commit_message = _gitium_format_message( $change['name'], $change['version'], "${change['action']} ${change['type']}" ); - $commit = _gitium_commit_changes( "$commit_message $msg_append", $base_path, false ); - if ( $commit ) { - $commits[] = $commit; - } - } - - return $commits; -} - -function gitium_commit_and_push_gitignore_file( $path = '' ) { - global $git; - - $current_user = wp_get_current_user(); - if ( ! empty( $path ) ) { $git->rm_cached( $path ); } - $git->add( '.gitignore' ); - $commit = $git->commit( 'Update the `.gitignore` file', $current_user->display_name, $current_user->user_email ); - gitium_merge_and_push( $commit ); -} - -if ( ! function_exists( 'gitium_acquire_merge_lock' ) ) : - function gitium_acquire_merge_lock() { - $gitium_lock_path = apply_filters( 'gitium_lock_path', sys_get_temp_dir().'/.gitium-lock' ); - $gitium_lock_handle = fopen( $gitium_lock_path, 'w+' ); - - $lock_timeout = intval( ini_get( 'max_execution_time' ) ) > 10 ? intval( ini_get( 'max_execution_time' ) ) - 5 : 10; - $lock_timeout_ms = 10; - $lock_retries = 0; - while ( ! flock( $gitium_lock_handle, LOCK_EX | LOCK_NB ) ) { - usleep( $lock_timeout_ms * 1000 ); - $lock_retries++; - if ( $lock_retries * $lock_timeout_ms > $lock_timeout * 1000 ) { - return false; // timeout - } - } - gitium_error_log( __FUNCTION__ ); - return array( $gitium_lock_path, $gitium_lock_handle ); - } -endif; - -if ( ! function_exists( 'gitium_release_merge_lock' ) ) : - function gitium_release_merge_lock( $lock ) { - list( $gitium_lock_path, $gitium_lock_handle ) = $lock; - gitium_error_log( __FUNCTION__ ); - flock( $gitium_lock_handle, LOCK_UN ); - fclose( $gitium_lock_handle ); - } -endif; - -// Merges the commits with remote and pushes them back -function gitium_merge_and_push( $commits ) { - global $git; - - $lock = gitium_acquire_merge_lock() - or trigger_error( 'Timeout when gitium lock was acquired', E_USER_WARNING ); - - if ( ! $git->fetch_ref() ) { - return false; - } - - $merge_status = $git->merge_with_accept_mine( $commits ); - - gitium_release_merge_lock( $lock ); - - return $git->push() && $merge_status; -} - -function gitium_check_after_event( $plugin, $event = 'activation' ) { - global $git; - - if ( 'gitium/gitium.php' == $plugin ) { return; } // do not hook on activation of this plugin - - if ( $git->is_dirty() ) { - $versions = gitium_update_versions(); - if ( isset( $versions['plugins'][ $plugin ] ) ) { - $name = $versions['plugins'][ $plugin ]['name']; - $version = $versions['plugins'][ $plugin ]['version']; - } else { - $name = $plugin; - } - gitium_auto_push( _gitium_format_message( $name, $version, "after $event of" ) ); - } -} - -function gitium_update_remote_tracking_branch() { - global $git; - $remote_branch = $git->get_remote_tracking_branch(); - set_transient( 'gitium_remote_tracking_branch', $remote_branch ); - - return $remote_branch; -} - -function _gitium_get_remote_tracking_branch( $update_transient = false ) { - if ( ! $update_transient && ( false !== ( $remote_branch = get_transient( 'gitium_remote_tracking_branch' ) ) ) ) { - return $remote_branch; - } else { - return gitium_update_remote_tracking_branch(); - } -} - -function gitium_update_is_status_working() { - global $git; - $is_status_working = $git->is_status_working(); - set_transient( 'gitium_is_status_working', $is_status_working ); - return $is_status_working; -} - -function _gitium_is_status_working( $update_transient = false ) { - if ( ! $update_transient && ( false !== ( $is_status_working = get_transient( 'gitium_is_status_working' ) ) ) ) { - return $is_status_working; - } else { - return gitium_update_is_status_working(); - } -} - -function _gitium_status( $update_transient = false ) { - global $git; - - if ( ! $update_transient && ( false !== ( $changes = get_transient( 'gitium_uncommited_changes' ) ) ) ) { - return $changes; - } - - $git_version = get_transient( 'gitium_git_version' ); - if ( false === $git_version ) { - set_transient( 'gitium_git_version', $git->get_version() ); - } - - if ( $git->is_status_working() && $git->get_remote_tracking_branch() ) { - if ( ! $git->fetch_ref() ) { - set_transient( 'gitium_remote_disconnected', $git->get_last_error() ); - } else { - delete_transient( 'gitium_remote_disconnected' ); - } - $changes = $git->status(); - } else { - delete_transient( 'gitium_remote_disconnected' ); - $changes = array(); - } - - set_transient( 'gitium_uncommited_changes', $changes, 12 * 60 * 60 ); // cache changes for half-a-day - return $changes; -} - -function _gitium_ssh_encode_buffer( $buffer ) { - $len = strlen( $buffer ); - if ( ord( $buffer[0] ) & 0x80 ) { - $len++; - $buffer = "\x00" . $buffer; - } - return pack( 'Na*', $len, $buffer ); -} - -function _gitium_generate_keypair() { - $rsa_key = openssl_pkey_new( - array( - 'private_key_bits' => 2048, - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - ) - ); - - try { - $private_key = openssl_pkey_get_private( $rsa_key ); - $try = openssl_pkey_export( $private_key, $pem ); //Private Key - if (!$try) - return false; - } catch (Exception $e) { - return false; - } - - $key_info = openssl_pkey_get_details( $rsa_key ); - $buffer = pack( 'N', 7 ) . 'ssh-rsa' . - _gitium_ssh_encode_buffer( $key_info['rsa']['e'] ) . - _gitium_ssh_encode_buffer( $key_info['rsa']['n'] ); - $public_key = 'ssh-rsa ' . base64_encode( $buffer ) . ' gitium@' . parse_url( get_home_url(), PHP_URL_HOST ); - - return array( $public_key, $pem ); -} - -function gitium_get_keypair( $generate_new_keypair = false ) { - if ( $generate_new_keypair ) { - $keypair = _gitium_generate_keypair(); - delete_option( 'gitium_keypair' ); - add_option( 'gitium_keypair', $keypair, '', false ); - } - if ( false === ( $keypair = get_option( 'gitium_keypair', false ) ) ) { - $keypair = _gitium_generate_keypair(); - add_option( 'gitium_keypair', $keypair, '', false ); - } - return $keypair; -} - -function _gitium_generate_webhook_key() { - return md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.()[]{}-_=+!@#%^&*~<>:;' ) ); -} - -function gitium_get_webhook_key( $generate_new_webhook_key = false ) { - if ( $generate_new_webhook_key ) { - $key = _gitium_generate_webhook_key(); - delete_option( 'gitium_webhook_key' ); - add_option( 'gitium_webhook_key', $key, '', false ); - return $key; - } - if ( false === ( $key = get_option( 'gitium_webhook_key', false ) ) ) { - $key = _gitium_generate_webhook_key(); - add_option( 'gitium_webhook_key', $key, '', false ); - } - return $key; -} - -function gitium_get_webhook() { - if ( defined( 'GIT_WEBHOOK_URL' ) && GIT_WEBHOOK_URL ) { return GIT_WEBHOOK_URL; } - $key = gitium_get_webhook_key(); - $url = add_query_arg( 'key', $key, plugins_url( 'gitium-webhook.php', __FILE__ ) ); - return apply_filters( 'gitium_webhook_url', $url, $key ); -} - -function gitium_admin_init() { - global $git; - - $git_version = get_transient( 'gitium_git_version' ); - if ( false === $git_version ) { - set_transient( 'gitium_git_version', $git->get_version() ); - } -} -add_action( 'admin_init', 'gitium_admin_init' ); diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/gitium-webhook.php b/wp-content/upgrade-temp-backup/plugins/gitium/gitium-webhook.php deleted file mode 100644 index 2f99481b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/gitium-webhook.php +++ /dev/null @@ -1,49 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -header( 'Content-Type: text/html' ); -define( 'SHORTINIT', true ); -//$wordpress_loader = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php'; -$wordpress_loader = filter_input(INPUT_SERVER, 'DOCUMENT_ROOT', FILTER_SANITIZE_STRING) . '/wp-load.php'; - -require_once $wordpress_loader; -require_once __DIR__ . '/functions.php'; -require_once __DIR__ . '/inc/class-git-wrapper.php'; - -$webhook_key = get_option( 'gitium_webhook_key', '' ); -$get_key = filter_input(INPUT_GET, 'key', FILTER_SANITIZE_STRING); -if ( ! empty ( $webhook_key ) && isset( $get_key ) && $webhook_key == $get_key ) : - ( '1.7' <= substr( $git->get_version(), 0, 3 ) ) or wp_die( 'Gitium plugin require minimum `git version 1.7`!' ); - - list( $git_public_key, $git_private_key ) = gitium_get_keypair(); - if ( ! $git_public_key || ! $git_private_key ) - wp_die('Not ready.', 'Not ready.', array( 'response' => 403 )); - else - $git->set_key( $git_private_key ); - - $commits = array(); - $commitmsg = sprintf( 'Merged changes from %s on %s', $_SERVER['SERVER_NAME'], date( 'm.d.Y' ) ); - - if ( $git->is_dirty() && $git->add() > 0 ) { - $commits[] = $git->commit( $commitmsg ) or trigger_error( 'Could not commit local changes!', E_USER_ERROR ); - } - gitium_merge_and_push( $commits ) or trigger_error( 'Failed merge & push: ' . serialize( $git->get_last_error() ), E_USER_ERROR ); - - wp_die( $commitmsg , 'Pull done!', array( 'response' => 200 ) ); -else : - wp_die( 'Cheating uh?', 'Cheating uh?', array( 'response' => 403 ) ); -endif; diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/gitium.php b/wp-content/upgrade-temp-backup/plugins/gitium/gitium.php deleted file mode 100644 index e524c08d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/gitium.php +++ /dev/null @@ -1,374 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -define( 'GITIUM_LAST_COMMITS', 20 ); -define( 'GITIUM_MIN_GIT_VER', '1.7' ); -define( 'GITIUM_MIN_PHP_VER', '5.6' ); - -if ( is_multisite() ) { - define( 'GITIUM_ADMIN_MENU_ACTION', 'network_admin_menu' ); - define( 'GITIUM_ADMIN_NOTICES_ACTION', 'network_admin_notices' ); - define( 'GITIUM_MANAGE_OPTIONS_CAPABILITY', 'manage_network_options' ); -} else { - define( 'GITIUM_ADMIN_MENU_ACTION', 'admin_menu' ); - define( 'GITIUM_ADMIN_NOTICES_ACTION', 'admin_notices' ); - define( 'GITIUM_MANAGE_OPTIONS_CAPABILITY', 'manage_options' ); -} - -require_once __DIR__ . '/functions.php'; -require_once __DIR__ . '/inc/class-git-wrapper.php'; -require_once __DIR__ . '/inc/class-gitium-requirements.php'; -require_once __DIR__ . '/inc/class-gitium-admin.php'; -require_once __DIR__ . '/inc/class-gitium-help.php'; -require_once __DIR__ . '/inc/class-gitium-menu.php'; -require_once __DIR__ . '/inc/class-gitium-menu-bubble.php'; -require_once __DIR__ . '/inc/class-gitium-submenu-configure.php'; -require_once __DIR__ . '/inc/class-gitium-submenu-status.php'; -require_once __DIR__ . '/inc/class-gitium-submenu-commits.php'; -require_once __DIR__ . '/inc/class-gitium-submenu-settings.php'; - -function gitium_load_textdomain() { - load_plugin_textdomain( 'gitium', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); -} -add_action( 'plugins_loaded', 'gitium_load_textdomain' ); - -function _gitium_make_ssh_git_file_exe() { - $ssh_wrapper = dirname( __FILE__ ) . '/inc/ssh-git'; - $process = proc_open( - "chmod -f +x $ssh_wrapper", - array( - 0 => array( 'pipe', 'r' ), // stdin - 1 => array( 'pipe', 'w' ), // stdout - ), - $pipes - ); - if ( is_resource( $process ) ) { - fclose( $pipes[0] ); - proc_close( $process ); - } -} -register_activation_hook( __FILE__, '_gitium_make_ssh_git_file_exe' ); - -function gitium_deactivation() { - delete_transient( 'gitium_git_version' ); -} -register_deactivation_hook( __FILE__, 'gitium_deactivation' ); - -function gitium_uninstall_hook() { - delete_transient( 'gitium_remote_tracking_branch' ); - delete_transient( 'gitium_remote_disconnected' ); - delete_transient( 'gitium_uncommited_changes' ); - delete_transient( 'gitium_git_version' ); - delete_transient( 'gitium_versions' ); - delete_transient( 'gitium_menu_bubble' ); - delete_transient( 'gitium_is_status_working' ); - - delete_option( 'gitium_keypair' ); - delete_option( 'gitium_webhook_key' ); -} -register_uninstall_hook( __FILE__, 'gitium_uninstall_hook' ); - -/* Array -( - [themes] => Array - ( - [twentytwelve] => `Twenty Twelve` version 1.3 - ) - [plugins] => Array - ( - [cron-view/cron-gui.php] => `Cron GUI` version 1.03 - [hello-dolly/hello.php] => `Hello Dolly` version 1.6 - ) - -) */ -function gitium_update_versions() { - $new_versions = []; - - // get all themes from WP - $all_themes = wp_get_themes( array( 'allowed' => true ) ); - foreach ( $all_themes as $theme_name => $theme ) : - $theme_versions[ $theme_name ] = array( - 'name' => $theme->Name, - 'version' => null, - 'msg' => '', - ); - $theme_versions[ $theme_name ]['msg'] = '`' . $theme->Name . '`'; - $version = $theme->Version; - if ( ! empty( $version ) ) { - $theme_versions[ $theme_name ]['msg'] .= " version $version"; - $theme_versions[ $theme_name ]['version'] .= $version; - } - endforeach; - - if ( ! empty( $theme_versions ) ) { - $new_versions['themes'] = $theme_versions; - } - // get all plugins from WP - if ( ! function_exists( 'get_plugins' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - $all_plugins = get_plugins(); - foreach ( $all_plugins as $name => $data ) : - $plugin_versions[ $name ] = array( - 'name' => $data['Name'], - 'version' => null, - 'msg' => '', - ); - $plugin_versions[ $name ]['msg'] = "`{$data['Name']}`"; - if ( ! empty( $data['Version'] ) ) { - $plugin_versions[ $name ]['msg'] .= ' version ' . $data['Version']; - $plugin_versions[ $name ]['version'] .= $data['Version']; - } - endforeach; - - if ( ! empty( $plugin_versions ) ) { - $new_versions['plugins'] = $plugin_versions; - } - - set_transient( 'gitium_versions', $new_versions ); - - return $new_versions; -} -add_action( 'load-plugins.php', 'gitium_update_versions', 999 ); - -function gitium_upgrader_post_install( $res, $hook_extra, $result ) { - _gitium_make_ssh_git_file_exe(); - - $action = null; - $type = null; - - // install logic - if ( isset( $hook_extra['type'] ) && ( 'plugin' === $hook_extra['type'] ) ) { - $action = 'installed'; - $type = 'plugin'; - } else if ( isset( $hook_extra['type'] ) && ( 'theme' === $hook_extra['type'] ) ) { - $action = 'installed'; - $type = 'theme'; - } - - // update/upgrade logic - if ( isset( $hook_extra['plugin'] ) ) { - $action = 'updated'; - $type = 'plugin'; - } else if ( isset( $hook_extra['theme'] ) ) { - $action = 'updated'; - $type = 'theme'; - } - - // get action if missed above - if ( isset( $hook_extra['action'] ) ) { - $action = $hook_extra['action']; - if ( 'install' === $action ) { - $action = 'installed'; - } - if ( 'update' === $action ) { - $action = 'updated'; - } - } - - if ( WP_DEBUG ) { - error_log( __FUNCTION__ . ':hook_extra:' . serialize( $hook_extra ) ); - error_log( __FUNCTION__ . ':action:type:' . $action . ':' . $type ); - } - - $git_dir = $result['destination']; - $version = ''; - - if ( ABSPATH == substr( $git_dir, 0, strlen( ABSPATH ) ) ) { - $git_dir = substr( $git_dir, strlen( ABSPATH ) ); - } - switch ( $type ) { - case 'theme': - wp_clean_themes_cache(); - $theme_data = wp_get_theme( $result['destination_name'] ); - $name = $theme_data->get( 'Name' ); - $version = $theme_data->get( 'Version' ); - break; - case 'plugin': - foreach ( $result['source_files'] as $file ) : - if ( '.php' != substr( $file, -4 ) ) { continue; } - // every .php file is a possible plugin so we check if it's a plugin - $filepath = trailingslashit( $result['destination'] ) . $file; - $plugin_data = get_plugin_data( $filepath ); - if ( $plugin_data['Name'] ) : - $name = $plugin_data['Name']; - $version = $plugin_data['Version']; - // We get info from the first plugin in the package - break; - endif; - endforeach; - break; - } - if ( empty( $name ) ) { - $name = $result['destination_name']; - } - $commit_message = _gitium_format_message( $name,$version,"$action $type" ); - $commit = _gitium_commit_changes( $commit_message, $git_dir, false ); - gitium_merge_and_push( $commit ); - - return $res; -} -add_filter( 'upgrader_post_install', 'gitium_upgrader_post_install', 10, 3 ); - -// Checks for local changes, tries to group them by plugin/theme and pushes the changes -function gitium_auto_push( $msg_prepend = '' ) { - global $git; - list( , $git_private_key ) = gitium_get_keypair(); - if ( ! $git_private_key ) - return; - $git->set_key( $git_private_key ); - - $commits = gitium_group_commit_modified_plugins_and_themes( $msg_prepend ); - gitium_merge_and_push( $commits ); - gitium_update_versions(); -} -add_action( 'upgrader_process_complete', 'gitium_auto_push', 11, 0 ); - -function gitium_check_after_activate_modifications( $plugin ) { - gitium_check_after_event( $plugin ); -} -add_action( 'activated_plugin', 'gitium_check_after_activate_modifications', 999 ); - -function gitium_check_after_deactivate_modifications( $plugin ) { - gitium_check_after_event( $plugin, 'deactivation' ); -} -add_action( 'deactivated_plugin', 'gitium_check_after_deactivate_modifications', 999 ); - -function gitium_check_for_plugin_deletions() { // Handle plugin deletion - // $_GET['deleted'] used to resemble if a plugin has been deleted (true) - // ...meanwhile commit b28dd45f3dad19f0e06c546fdc89ed5b24bacd72 in github.com/WordPress/WordPress... - // Now it resembles the number of deleted plugins (a number). Thanks WP - if ( isset( $_GET['deleted'] ) && ( 1 <= (int) $_GET['deleted'] || 'true' == $_GET['deleted'] ) ) { - gitium_auto_push(); - } -} -add_action( 'load-plugins.php', 'gitium_check_for_plugin_deletions' ); - -add_action( 'wp_ajax_wp-plugin-delete-success', 'gitium_auto_push' ); -add_action( 'wp_ajax_wp-theme-delete-success', 'gitium_auto_push' ); - -function gitium_wp_plugin_delete_success() { -?> - - - -=' ) ) - add_action( 'wp_ajax_edit-theme-plugin-file', 'add_filter_for_ajax_save', 1, 0 ); -else - add_action( 'admin_enqueue_scripts', 'gitium_hook_plugin_and_theme_editor_page' ); - -function gitium_options_page_check() { - global $git; - if ( ! $git->can_exec_git() ) { wp_die( 'Cannot exec git' ); } - return true; -} - -function gitium_remote_disconnected_notice() { - if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) && $message = get_transient( 'gitium_remote_disconnected' ) ) : ?> -
-

- Could not connect to remote repository. -

-

-
- - - - - - - - \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-git-wrapper.php b/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-git-wrapper.php deleted file mode 100644 index 7e00d101..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-git-wrapper.php +++ /dev/null @@ -1,671 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -define('GITIGNORE', <<repo_dir = $repo_dir; - } - - function _rrmdir( $dir ) { - if ( empty( $dir ) || ! is_dir( $dir ) ) { - return false; - } - - $files = array_diff( scandir( $dir ), array( '.', '..' ) ); - foreach ( $files as $file ) { - $filepath = realpath("$dir/$file"); - ( is_dir( $filepath ) ) ? $this->_rrmdir( $filepath ) : unlink( $filepath ); - } - return rmdir( $dir ); - } - - function _log(...$args) { - if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) { return; } - - $output = ''; - if (isset($args) && $args) foreach ( $args as $arg ) { - $output .= var_export($arg, true).'/n/n'; - } - - if ($output) error_log($output); - } - - function _git_temp_key_file() { - $key_file = tempnam( sys_get_temp_dir(), 'ssh-git' ); - return $key_file; - } - - function set_key( $private_key ) { - $this->private_key = $private_key; - } - - private function get_env() { - $env = array(); - $key_file = null; - - if ( defined( 'GIT_SSH' ) && GIT_SSH ) { - $env['GIT_SSH'] = GIT_SSH; - } else { - $env['GIT_SSH'] = dirname( __FILE__ ) . '/ssh-git'; - } - - if ( defined( 'GIT_KEY_FILE' ) && GIT_KEY_FILE ) { - $env['GIT_KEY_FILE'] = GIT_KEY_FILE; - } elseif ( $this->private_key ) { - $key_file = $this->_git_temp_key_file(); - chmod( $key_file, 0600 ); - file_put_contents( $key_file, $this->private_key ); - $env['GIT_KEY_FILE'] = $key_file; - } - - return $env; - } - - protected function _call(...$args) { - $args = join( ' ', array_map( 'escapeshellarg', $args ) ); - $return = -1; - $response = array(); - $env = $this->get_env(); - - $git_bin_path = apply_filters( 'gitium_git_bin_path', '' ); - $cmd = "${git_bin_path}git $args 2>&1"; - - $proc = proc_open( - $cmd, - array( - 0 => array( 'pipe', 'r' ), // stdin - 1 => array( 'pipe', 'w' ), // stdout - ), - $pipes, - $this->repo_dir, - $env - ); - if ( is_resource( $proc ) ) { - fclose( $pipes[0] ); - while ( $line = fgets( $pipes[1] ) ) { - $response[] = rtrim( $line, "\n\r" ); - } - $return = (int)proc_close( $proc ); - } - $this->_log( "$return $cmd", join( "\n", $response ) ); - if ( ! defined( 'GIT_KEY_FILE' ) && isset( $env['GIT_KEY_FILE'] ) ) { - unlink( $env['GIT_KEY_FILE'] ); - } - if ( 0 != $return ) { - $this->last_error = join( "\n", $response ); - } else { - $this->last_error = null; - } - return array( $return, $response ); - } - - function get_last_error() { - return $this->last_error; - } - - function can_exec_git() { - list( $return, ) = $this->_call( 'version' ); - return ( 0 == $return ); - } - - function is_status_working() { - list( $return, ) = $this->_call( 'status', '-s' ); - return ( 0 == $return ); - } - - function get_version() { - list( $return, $version ) = $this->_call( 'version' ); - if ( 0 != $return ) { return ''; } - if ( ! empty( $version[0] ) ) { - return substr( $version[0], 12 ); - } - return ''; - } - - // git rev-list @{u}.. - function get_ahead_commits() { - list( , $commits ) = $this->_call( 'rev-list', '@{u}..' ); - return $commits; - } - - // git rev-list ..@{u} - function get_behind_commits() { - list( , $commits ) = $this->_call( 'rev-list', '..@{u}' ); - return $commits; - } - - function init() { - file_put_contents( "$this->repo_dir/.gitignore", $this->gitignore ); - list( $return, ) = $this->_call( 'init' ); - $this->_call( 'config', 'user.email', 'gitium@presslabs.com' ); - $this->_call( 'config', 'user.name', 'Gitium' ); - $this->_call( 'config', 'push.default', 'matching' ); - return ( 0 == $return ); - } - - function is_dot_git_dir( $dir ) { - $realpath = realpath( $dir ); - $git_config = realpath( $realpath . '/config' ); - $git_index = realpath( $realpath . '/index' ); - if ( ! empty( $realpath ) && is_dir( $realpath ) && file_exists( $git_config ) && file_exists( $git_index ) ) { - return True; - } - return False; - } - - function cleanup() { - $dot_git_dir = realpath( $this->repo_dir . '/.git' ); - if ( $this->is_dot_git_dir( $dot_git_dir ) && $this->_rrmdir( $dot_git_dir ) ) { - if ( WP_DEBUG ) { - error_log( "Gitium cleanup successfull. Removed '$dot_git_dir'." ); - } - return True; - } - if ( WP_DEBUG ) { - error_log( "Gitium cleanup failed. '$dot_git_dir' is not a .git dir." ); - } - return False; - } - - function add_remote_url( $url ) { - list( $return, ) = $this->_call( 'remote', 'add', 'origin', $url ); - return ( 0 == $return ); - } - - function get_remote_url() { - list( , $response ) = $this->_call( 'config', '--get', 'remote.origin.url' ); - if ( isset( $response[0] ) ) { - return $response[0]; - } - return ''; - } - - function remove_remote() { - list( $return, ) = $this->_call( 'remote', 'rm', 'origin'); - return ( 0 == $return ); - } - - function get_remote_tracking_branch() { - list( $return, $response ) = $this->_call( 'rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}' ); - if ( 0 == $return ) { - return $response[0]; - } - return false; - } - - function get_local_branch() { - list( $return, $response ) = $this->_call( 'rev-parse', '--abbrev-ref', 'HEAD' ); - if ( 0 == $return ) { - return $response[0]; - } - return false; - } - - function fetch_ref() { - list( $return, ) = $this->_call( 'fetch', 'origin' ); - return ( 0 == $return ); - } - - protected function _resolve_merge_conflicts( $message ) { - list( , $changes ) = $this->status( true ); - $this->_log( $changes ); - foreach ( $changes as $path => $change ) { - if ( in_array( $change, array( 'UD', 'DD' ) ) ) { - $this->_call( 'rm', $path ); - $message .= "\n\tConflict: $path [removed]"; - } elseif ( 'DU' == $change ) { - $this->_call( 'add', $path ); - $message .= "\n\tConflict: $path [added]"; - } elseif ( in_array( $change, array( 'AA', 'UU', 'AU', 'UA' ) ) ) { - $this->_call( 'checkout', '--theirs', $path ); - $this->_call( 'add', '--all', $path ); - $message .= "\n\tConflict: $path [local version]"; - } - } - $this->commit( $message ); - } - - function get_commit_message( $commit ) { - list( $return, $response ) = $this->_call( 'log', '--format=%B', '-n', '1', $commit ); - return ( $return !== 0 ? false : join( "\n", $response ) ); - } - - private function strpos_haystack_array( $haystack, $needle, $offset=0 ) { - if ( ! is_array( $haystack ) ) { $haystack = array( $haystack ); } - - foreach ( $haystack as $query ) { - if ( strpos( $query, $needle, $offset) !== false ) { return true; } - } - return false; - } - - private function cherry_pick( $commits ) { - foreach ( $commits as $commit ) { - if ( empty( $commit ) ) { return false; } - - list( $return, $response ) = $this->_call( 'cherry-pick', $commit ); - - // abort the cherry-pick if the changes are already pushed - if ( false !== $this->strpos_haystack_array( $response, 'previous cherry-pick is now empty' ) ) { - $this->_call( 'cherry-pick', '--abort' ); - continue; - } - - if ( $return != 0 ) { - $this->_resolve_merge_conflicts( $this->get_commit_message( $commit ) ); - } - } - } - - function merge_with_accept_mine(...$commits) { - do_action( 'gitium_before_merge_with_accept_mine' ); - - if ( 1 == count($commits) && is_array( $commits[0] ) ) { - $commits = $commits[0]; - } - - // get ahead commits - $ahead_commits = $this->get_ahead_commits(); - - // combine all commits with the ahead commits - $commits = array_unique( array_merge( array_reverse( $commits ), $ahead_commits ) ); - $commits = array_reverse( $commits ); - - // get the remote branch - $remote_branch = $this->get_remote_tracking_branch(); - - // get the local branch - $local_branch = $this->get_local_branch(); - - // rename the local branch to 'merge_local' - $this->_call( 'branch', '-m', 'merge_local' ); - - // local branch set up to track remote branch - $this->_call( 'branch', $local_branch, $remote_branch ); - - // checkout to the $local_branch - list( $return, ) = $this->_call( 'checkout', $local_branch ); - if ( $return != 0 ) { - $this->_call( 'branch', '-M', $local_branch ); - return false; - } - - // don't cherry pick if there are no commits - if ( count( $commits ) > 0 ) { - $this->cherry_pick( $commits ); - } - - if ( $this->successfully_merged() ) { // git status without states: AA, DD, UA, AU ... - // delete the 'merge_local' branch - $this->_call( 'branch', '-D', 'merge_local' ); - return true; - } else { - $this->_call( 'cherry-pick', '--abort' ); - $this->_call( 'checkout', '-b', 'merge_local' ); - $this->_call( 'branch', '-M', $local_branch ); - return false; - } - } - - function successfully_merged() { - list( , $response ) = $this->status( true ); - $changes = array_values( $response ); - return ( 0 == count( array_intersect( $changes, array( 'DD', 'AU', 'UD', 'UA', 'DU', 'AA', 'UU' ) ) ) ); - } - - function merge_initial_commit( $commit, $branch ) { - list( $return, ) = $this->_call( 'branch', '-m', 'initial' ); - if ( 0 != $return ) { - return false; - } - list( $return, ) = $this->_call( 'checkout', $branch ); - if ( 0 != $return ) { - return false; - } - list( $return, ) = $this->_call( - 'cherry-pick', '--strategy', 'recursive', '--strategy-option', 'theirs', $commit - ); - if ( $return != 0 ) { - $this->_resolve_merge_conflicts( $this->get_commit_message( $commit ) ); - if ( ! $this->successfully_merged() ) { - $this->_call( 'cherry-pick', '--abort' ); - $this->_call( 'checkout', 'initial' ); - return false; - } - } - $this->_call( 'branch', '-D', 'initial' ); - return true; - } - - function get_remote_branches() { - list( , $response ) = $this->_call( 'branch', '-r' ); - $response = array_map( 'trim', $response ); - $response = array_map( function( $b ) { return str_replace( "origin/", "", $b ); }, $response ); - return $response; - } - - function add(...$args) { - if ( 1 == count($args) && is_array( $args[0] ) ) { - $args = $args[0]; - } - $params = array_merge( array( 'add', '-n', '--all' ), $args ); - list ( , $response ) = call_user_func_array( array( $this, '_call' ), $params ); - $count = count( $response ); - - $params = array_merge( array( 'add', '--all' ), $args ); - list ( , $response ) = call_user_func_array( array( $this, '_call' ), $params ); - - return $count; - } - - function commit( $message, $author_name = '', $author_email = '' ) { - $author = ''; - if ( $author_email ) { - if ( empty( $author_name ) ) { - $author_name = $author_email; - } - $author = "$author_name <$author_email>"; - } - - if ( ! empty( $author ) ) { - list( $return, $response ) = $this->_call( 'commit', '-m', $message, '--author', $author ); - } else { - list( $return, $response ) = $this->_call( 'commit', '-m', $message ); - } - if ( $return !== 0 ) { return false; } - - list( $return, $response ) = $this->_call( 'rev-parse', 'HEAD' ); - - return ( $return === 0 ) ? $response[0] : false; - } - - function push( $branch = '' ) { - if ( ! empty( $branch ) ) { - list( $return, ) = $this->_call( 'push', '--porcelain', '-u', 'origin', $branch ); - } else { - list( $return, ) = $this->_call( 'push', '--porcelain', '-u', 'origin', 'HEAD' ); - } - return ( $return == 0 ); - } - - /* - * Get uncommited changes with status porcelain - * git status --porcelain - * It returns an array like this: - array( - file => deleted|modified - ... - ) - */ - function get_local_changes() { - list( $return, $response ) = $this->_call( 'status', '--porcelain' ); - - if ( 0 !== $return ) { - return array(); - } - $new_response = array(); - if ( ! empty( $response ) ) { - foreach ( $response as $line ) : - $work_tree_status = substr( $line, 1, 1 ); - $path = substr( $line, 3 ); - - if ( ( '"' == $path[0] ) && ('"' == $path[strlen( $path ) - 1] ) ) { - // git status --porcelain will put quotes around paths with whitespaces - // we don't want the quotes, let's get rid of them - $path = substr( $path, 1, strlen( $path ) - 2 ); - } - - if ( 'D' == $work_tree_status ) { - $action = 'deleted'; - } else { - $action = 'modified'; - } - $new_response[ $path ] = $action; - endforeach; - } - return $new_response; - } - - function get_uncommited_changes() { - list( , $changes ) = $this->status(); - return $changes; - } - - function local_status() { - list( $return, $response ) = $this->_call( 'status', '-s', '-b', '-u' ); - if ( 0 !== $return ) { - return array( '', array() ); - } - - $new_response = array(); - if ( ! empty( $response ) ) { - $branch_status = array_shift( $response ); - foreach ( $response as $idx => $line ) : - unset( $index_status, $work_tree_status, $path, $new_path, $old_path ); - - if ( empty( $line ) ) { continue; } // ignore empty lines like the last item - if ( '#' == $line[0] ) { continue; } // ignore branch status - - $index_status = substr( $line, 0, 1 ); - $work_tree_status = substr( $line, 1, 1 ); - $path = substr( $line, 3 ); - - $old_path = ''; - $new_path = explode( '->', $path ); - if ( ( 'R' === $index_status ) && ( ! empty( $new_path[1] ) ) ) { - $old_path = trim( $new_path[0] ); - $path = trim( $new_path[1] ); - } - $new_response[ $path ] = trim( $index_status . $work_tree_status . ' ' . $old_path ); - endforeach; - } - - return array( $branch_status, $new_response ); - } - - function status( $local_only = false ) { - list( $branch_status, $new_response ) = $this->local_status(); - - if ( $local_only ) { return array( $branch_status, $new_response ); } - - $behind_count = 0; - $ahead_count = 0; - if ( preg_match( '/## ([^.]+)\.+([^ ]+)/', $branch_status, $matches ) ) { - $local_branch = $matches[1]; - $remote_branch = $matches[2]; - - list( , $response ) = $this->_call( 'rev-list', "$local_branch..$remote_branch", '--count' ); - $behind_count = (int)$response[0]; - - list( , $response ) = $this->_call( 'rev-list', "$remote_branch..$local_branch", '--count' ); - $ahead_count = (int)$response[0]; - } - - if ( $behind_count ) { - list( , $response ) = $this->_call( 'diff', '-z', '--name-status', "$local_branch~$ahead_count", $remote_branch ); - $response = explode( chr( 0 ), $response[0] ); - array_pop( $response ); - for ( $idx = 0 ; $idx < count( $response ) / 2 ; $idx++ ) { - $file = $response[ $idx * 2 + 1 ]; - $change = $response[ $idx * 2 ]; - if ( ! isset( $new_response[ $file ] ) ) { - $new_response[ $file ] = "r$change"; - } - } - } - return array( $branch_status, $new_response ); - } - - /* - * Checks if repo has uncommited changes - * git status --porcelain - */ - function is_dirty() { - $changes = $this->get_uncommited_changes(); - return ! empty( $changes ); - } - - /** - * Return the last n commits - */ - function get_last_commits( $n = 20 ) { - list( $return, $message ) = $this->_call( 'log', '-n', $n, '--pretty=format:%s' ); - if ( 0 !== $return ) { return false; } - - list( $return, $response ) = $this->_call( 'log', '-n', $n, '--pretty=format:%h|%an|%ae|%ad|%cn|%ce|%cd' ); - if ( 0 !== $return ) { return false; } - - foreach ( $response as $index => $value ) { - $commit_info = explode( '|', $value ); - $commits[ $commit_info[0] ] = array( - 'subject' => $message[ $index ], - 'author_name' => $commit_info[1], - 'author_email' => $commit_info[2], - 'author_date' => $commit_info[3], - ); - if ( $commit_info[1] != $commit_info[4] && $commit_info[2] != $commit_info[5] ) { - $commits[ $commit_info[0] ]['committer_name'] = $commit_info[4]; - $commits[ $commit_info[0] ]['committer_email'] = $commit_info[5]; - $commits[ $commit_info[0] ]['committer_date'] = $commit_info[6]; - } - } - return $commits; - } - - public function set_gitignore( $content ) { - file_put_contents( $this->repo_dir . '/.gitignore', $content ); - return true; - } - - public function get_gitignore() { - return file_get_contents( $this->repo_dir . '/.gitignore' ); - } - - /** - * Remove files in .gitignore from version control - */ - function rm_cached( $path ) { - list( $return, ) = $this->_call( 'rm', '--cached', $path ); - return ( $return == 0 ); - } - - function remove_wp_content_from_version_control() { - $process = proc_open( - 'rm -rf ' . ABSPATH . '/wp-content/.git', - array( - 0 => array( 'pipe', 'r' ), // stdin - 1 => array( 'pipe', 'w' ), // stdout - ), - $pipes - ); - if ( is_resource( $process ) ) { - fclose( $pipes[0] ); - proc_close( $process ); - return true; - } - return false; - } -} - -if ( ! defined( 'GIT_DIR' ) ) { - define( 'GIT_DIR', dirname( WP_CONTENT_DIR ) ); -} - -# global is needed here for wp-cli as it includes/exec files inside a function scope -# this forces the context to really be global :\. -global $git; -$git = new Git_Wrapper( GIT_DIR ); diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-admin.php b/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-admin.php deleted file mode 100644 index d8db6dd8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-admin.php +++ /dev/null @@ -1,53 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Admin { - - public function __construct() { - global $git; - - list( , $git_private_key ) = gitium_get_keypair(); - $git->set_key( $git_private_key ); - - if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) { - $req = new Gitium_Requirements(); - if ( ! $req->get_status() ) { - return false; - } - - if ( $this->has_configuration() ) { - new Gitium_Submenu_Status(); - new Gitium_Submenu_Commits(); - new Gitium_Submenu_Settings(); - new Gitium_Menu_Bubble(); - } else { - new Gitium_Submenu_Configure(); - } - } - } - - public function has_configuration() { - return _gitium_is_status_working() && _gitium_get_remote_tracking_branch(); - } -} - -if ( ( is_admin() && ! is_multisite() ) || ( is_network_admin() && is_multisite() ) ) { - add_action( 'init', 'gitium_admin_page' ); - function gitium_admin_page() { - new Gitium_Admin(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-help.php b/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-help.php deleted file mode 100644 index b41dae78..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-help.php +++ /dev/null @@ -1,107 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Help { - - public function __construct( $hook, $help = 'gitium' ) { - add_action( "load-{$hook}", array( $this, $help ), 20 ); - } - - private function general() { - $screen = get_current_screen(); - $screen->add_help_tab( array( 'id' => 'gitium', 'title' => __( 'Gitium', 'gitium' ), 'callback' => array( $this, 'gitium' ) ) ); - $screen->add_help_tab( array( 'id' => 'faq', 'title' => __( 'F.A.Q.', 'gitium' ), 'callback' => array( $this, 'faq' ) ) ); - $screen->add_help_tab( array( 'id' => 'requirements', 'title' => __( 'Requirements', 'gitium' ), 'callback' => array( $this, 'requirements_callback' ) ) ); - $screen->set_help_sidebar( '
' ); - } - - public function gitium() { - echo '

' . __( 'Gitium enables continuous deployment for WordPress integrating with tools such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs and removals are automatically versioned.', 'gitium' ) . '

'; - echo '

' . __( 'Ninja code edits from the WordPress editor are also tracked into version control. Gitium is designed for sane development environments.', 'gitium' ) . '

'; - echo '

' . __( 'Staging and production can follow different branches of the same repository. You can deploy code simply trough git push.', 'gitium' ) . '

'; - echo '

' . __( 'Gitium requires git command line tool minimum version 1.7 installed on the server and proc_open PHP function enabled.', 'gitium' ) . '

'; - } - - public function faq() { - echo '

' . __( 'Could not connect to remote repository?', 'gitium' ) . '
'. __( 'If you encounter this kind of error you can try to fix it by setting the proper username of the .git directory.', 'gitium' ) . '
' . __( 'Example', 'gitium' ) .': chown -R www-data:www-data .git

'; - echo '

' . __( 'Is this plugin considered stable?', 'gitium' ) . '
'. __( 'Right now this plugin is considered alpha quality and should be used in production environments only by adventurous kinds.', 'gitium' ) . '

'; - echo '

' . __( 'What happens in case of conflicts?', 'gitium' ) . '
'. __( 'The behavior in case of conflicts is to overwrite the changes on the origin repository with the local changes (ie. local modifications take precedence over remote ones).', 'gitium' ) . '

'; - echo '

' . __( 'How to deploy automatically after a push?', 'gitium' ) . '
'. __( 'You can ping the webhook url after a push to automatically deploy the new code. The webhook url can be found under Code menu. This url plays well with Github or Bitbucket webhooks.', 'gitium' ) . '

'; - echo '

' . __( 'Does it works on multi site setups?', 'gitium' ) . '
'. __( 'Gitium is not supporting multisite setups at the moment.', 'gitium' ) . '

'; - echo '

' . __( 'How does gitium handle submodules?', 'gitium' ) . '
'. __( 'Currently submodules are not supported.', 'gitium' ) . '

'; - } - - public function requirements_callback() { - echo '

' . __( 'Gitium requires:', 'gitium' ) . '

'; - echo '

' . __( 'the function proc_open available', 'gitium' ) . '

'; - echo '

' . __( 'can exec the file inc/ssh-git', 'gitium' ) . '

'; - - printf( '

' . __( 'git version >= %s', 'gitium' ) . '

', GITIUM_MIN_GIT_VER ); - printf( '

' . __( 'PHP version >= %s', 'gitium' ) . '

', GITIUM_MIN_PHP_VER ); - } - - public function configuration() { - $screen = get_current_screen(); - $screen->add_help_tab( array( 'id' => 'configuration', 'title' => __( 'Configuration', 'gitium' ), 'callback' => array( $this, 'configuration_callback' ) ) ); - $this->general(); - } - - public function configuration_callback() { - echo '

' . __( 'Configuration step 1', 'gitium' ) . '
' . __( 'In this step you must specify the Remote URL. This URL represents the link between the git sistem and your site.', 'gitium' ) . '

'; - echo '

' . __( 'You can get this URL from your Git repository and it looks like this:', 'gitium' ) . '

'; - echo '

' . __( 'github.com -> git@github.com:user/example.git', 'gitium' ) . '

'; - echo '

' . __( 'bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git', 'gitium' ) . '

'; - echo '

' . __( 'To go to the next step, fill the Remote URL and then press the Fetch button.', 'gitium' ) . '

'; - echo '

' . __( 'Configuration step 2', 'gitium' ) . '
' . __( 'In this step you must select the branch you want to follow.', 'gitium' ) . '

'; - echo '

' . __( 'Only this branch will have all of your code modifications.', 'gitium' ) . '

'; - echo '

' . __( 'When you push the button Merge & Push, all code(plugins & themes) will be pushed on the git repository.', 'gitium' ) . '

'; - } - - public function status() { - $screen = get_current_screen(); - $screen->add_help_tab( array( 'id' => 'status', 'title' => __( 'Status', 'gitium' ), 'callback' => array( $this, 'status_callback' ) ) ); - $this->general(); - } - - public function status_callback() { - echo '

' . __( 'On status page you can see what files are modified, and you can commit the changes to git.', 'gitium' ) . '

'; - } - - public function commits() { - $screen = get_current_screen(); - $screen->add_help_tab( array( 'id' => 'commits', 'title' => __( 'Commits', 'gitium' ), 'callback' => array( $this, 'commits_callback' ) ) ); - $this->general(); - } - - public function commits_callback() { - echo '

' . __( 'You may be wondering what is the difference between author and committer.', 'gitium' ) . '

'; - echo '

' . __( 'The author is the person who originally wrote the patch, whereas the committer is the person who last applied the patch.', 'gitium' ) . '

'; - echo '

' . __( 'So, if you send in a patch to a project and one of the core members applies the patch, both of you get credit — you as the author and the core member as the committer.', 'gitium' ) . '

'; - } - - public function settings() { - $screen = get_current_screen(); - $screen->add_help_tab( array( 'id' => 'settings', 'title' => __( 'Settings', 'gitium' ), 'callback' => array( $this, 'settings_callback' ) ) ); - $this->general(); - } - - public function settings_callback() { - echo '

' . __( 'Each line from the gitignore file specifies a pattern.', 'gitium' ) . '

'; - echo '

' . __( 'When deciding whether to ignore a path, Git normally checks gitignore patterns from multiple sources, with the following order of precedence, from highest to lowest (within one level of precedence, the last matching pattern decides the outcome)', 'gitium' ) . '

'; - echo '

' . sprintf( __( 'Read more on %s', 'gitium' ), 'git documentation' ) . '

'; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-menu-bubble.php b/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-menu-bubble.php deleted file mode 100644 index 81f3e2dd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-menu-bubble.php +++ /dev/null @@ -1,55 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Menu_Bubble extends Gitium_Menu { - - public function __construct() { - parent::__construct( $this->gitium_menu_slug, $this->gitium_menu_slug ); - add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'add_menu_bubble' ) ); - } - - public function add_menu_bubble() { - global $menu; - - if ( ! _gitium_is_status_working() ) { - foreach ( $menu as $key => $value ) { - if ( $this->menu_slug == $menu[ $key ][2] ) { - $menu_bubble = get_transient( 'gitium_menu_bubble' ); - if ( false === $menu_bubble ) { $menu_bubble = ''; } - $menu[ $key ][0] = str_replace( $menu_bubble, '', $menu[ $key ][0] ); - delete_transient( 'gitium_menu_bubble' ); - return; - } - } - } - - list( , $changes ) = _gitium_status(); - - if ( ! empty( $changes ) ) : - $bubble_count = count( $changes ); - foreach ( $menu as $key => $value ) { - if ( $this->menu_slug == $menu[ $key ][2] ) { - $menu_bubble = " " - . $bubble_count . ''; - $menu[ $key ][0] .= $menu_bubble; - set_transient( 'gitium_menu_bubble', $menu_bubble ); - return; - } - } - endif; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-menu.php b/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-menu.php deleted file mode 100644 index ebad1b1a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-menu.php +++ /dev/null @@ -1,97 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Menu { - - public $gitium_menu_slug = 'gitium/gitium.php'; - public $commits_menu_slug = 'gitium/gitium-commits.php'; - public $settings_menu_slug = 'gitium/gitium-settings.php'; - - public $git = null; - - public $menu_slug; - public $submenu_slug; - - public function __construct( $menu_slug, $submenu_slug ) { - global $git; - $this->git = $git; - - $this->menu_slug = $menu_slug; - $this->submenu_slug = $submenu_slug; - } - - public function redirect( $message = '', $success = false, $menu_slug = '' ) { - $message_id = substr( - md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8 - ); - if ( $message ) { - set_transient( 'message_' . $message_id, $message, 900 ); - } - if ( '' === $menu_slug ) { $menu_slug = $this->menu_slug; } - $url = network_admin_url( 'admin.php?page=' . $menu_slug ); - $url = esc_url_raw( add_query_arg( - array( - 'message' => $message_id, - 'success' => $success, - ), - $url - ) ); - wp_safe_redirect( $url ); - exit; - } - - public function success_redirect( $message = '', $menu_slug = '' ) { - $this->redirect( $message, true, $menu_slug ); - } - - public function disconnect_repository() { - $gitium_disconnect_repo = filter_input(INPUT_POST, 'GitiumSubmitDisconnectRepository', FILTER_SANITIZE_STRING); - - if ( ! isset( $gitium_disconnect_repo ) ) { - return; - } - check_admin_referer( 'gitium-admin' ); - gitium_uninstall_hook(); - if ( ! $this->git->remove_remote() ) { - $this->redirect( __('Could not remove remote.', 'gitium') ); - } - $this->success_redirect( __('You are now disconnected from the repository. New key pair generated.', 'gitium') ); - } - - public function show_message() { - $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_STRING); - $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_STRING); - if ( isset( $get_message ) && $get_message ) { - $type = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error'; - $message = get_transient( 'message_'. $get_message ); - if ( $message ) : ?> -

- -
- - ' class="button secondary" onclick="return confirm('')"/>  -
- - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Requirements { - - private $req = array(); - private $msg = array(); - - /** - * Gitium requires: - * git min version - * the function proc_open available - * PHP min version - * can exec the file inc/ssh-git - */ - public function __construct() { - $this->_check_req(); - add_action( GITIUM_ADMIN_NOTICES_ACTION, array( $this, 'admin_notices' ) ); - } - - private function _check_req() { - list($this->req['is_git_version'], $this->msg['is_git_version'] ) = $this->is_git_version(); - list($this->req['is_proc_open'], $this->msg['is_proc_open'] ) = $this->is_proc_open(); - list($this->req['is_php_verion'], $this->msg['is_php_verion'] ) = $this->is_php_version(); - list($this->req['can_exec_ssh_git_file'],$this->msg['can_exec_ssh_git_file']) = $this->can_exec_ssh_git_file(); - - return $this->req; - } - - public function admin_notices() { - if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) { - return; - } - - foreach ( $this->req as $key => $value ) { - if ( false === $value ) { - echo "

Gitium Requirement: {$this->msg[$key]}

"; - } - } - } - - public function get_status() { - $requirements = $this->req; - - foreach ( $requirements as $req ) : - if ( false === $req ) : - return false; - endif; - endforeach; - - return true; - } - - private function is_git_version() { - $git_version = get_transient( 'gitium_git_version' ); - - if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) { - global $git; - $git_version = $git->get_version(); - set_transient( 'gitium_git_version', $git_version ); - if ( empty( $git_version ) ) { - return array( false, 'There is no git installed on this server.' ); - } else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) { - return array( false, "The git version is `$git_version` and must be greater than `" . GITIUM_MIN_GIT_VER . "`!" ); - } - } - - return array( true, "The git version is `$git_version`." ); - } - - private function is_proc_open() { - if ( ! function_exists( 'proc_open' ) ) { - return array( false, 'The function `proc_open` is disabled!' ); - } else { - return array( true, 'The function `proc_open` is enabled!' ); - } - } - - private function is_php_version() { - if ( ! function_exists( 'phpversion' ) ) { - return array( false, 'The function `phpversion` is disabled!' ); - } else { - $php_version = phpversion(); - if ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) { - return array( true, "The PHP version is `$php_version`." ); - } else { - return array( false, "The PHP version is `$php_version` and is not greater or equal to " . GITIUM_MIN_PHP_VER ); - } - } - } - - private function can_exec_ssh_git_file() { - $filepath = dirname( __FILE__ ) . '/ssh-git'; - - if ( ! function_exists( 'is_executable' ) ) { - return array( false, 'The function `is_executable` is disabled!' ); - } else if ( is_executable( $filepath ) ) { - return array( true, "The `$filepath` file can be executed!" ); - } else { - return array( false, "The `$filepath` file is not executable" ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-submenu-commits.php b/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-submenu-commits.php deleted file mode 100644 index d7811294..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-submenu-commits.php +++ /dev/null @@ -1,94 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Submenu_Commits extends Gitium_Menu { - - public function __construct() { - parent::__construct( $this->gitium_menu_slug, $this->commits_menu_slug ); - add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) ); - } - - public function admin_menu() { - $submenu_hook = add_submenu_page( - $this->menu_slug, - __( 'Git Commits', 'gitium' ), - __( 'Commits', 'gitium' ), - GITIUM_MANAGE_OPTIONS_CAPABILITY, - $this->submenu_slug, - array( $this, 'page' ) - ); - new Gitium_Help( $submenu_hook, 'commits' ); - } - - public function table_head() { - ?> - - - - - - - '; - } - - public function table_start_row() { - static $counter = 0; - $counter++; - echo ( 0 != $counter % 2 ) ? '' : ''; - } - - public function page() { - ?> -
-

- - table_head(); ?> - - git->get_last_commits( GITIUM_LAST_COMMITS ) as $commit_id => $data ) { - unset( $committer_name ); - extract( $data ); - if ( isset( $committer_name ) ) { - $committer = " -> $committer_name " . sprintf( __( 'committed %s ago', 'gitium' ), human_time_diff( strtotime( $committer_date ) ) ) . ''; - $committers_avatar = '
' . get_avatar( $committer_email, 16 ) . '
'; - } else { - $committer = ''; - $committers_avatar = ''; - } - $this->table_start_row(); - ?> - - - table_end_row(); - } - ?> - -
-
- -

-
-

-
- - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Submenu_Configure extends Gitium_Menu { - - public function __construct() { - parent::__construct( $this->gitium_menu_slug, $this->gitium_menu_slug ); - - if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) { - add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) ); - add_action( 'admin_init', array( $this, 'regenerate_keypair' ) ); - add_action( 'admin_init', array( $this, 'gitium_warning' ) ); - add_action( 'admin_init', array( $this, 'init_repo' ) ); - add_action( 'admin_init', array( $this, 'choose_branch' ) ); - add_action( 'admin_init', array( $this, 'disconnect_repository' ) ); - } - } - - public function admin_menu() { - add_menu_page( - __( 'Git Configuration', 'gitium' ), - 'Gitium', - GITIUM_MANAGE_OPTIONS_CAPABILITY, - $this->menu_slug, - array( $this, 'page' ), - plugins_url( 'img/gitium.png', dirname( __FILE__ ) ) - ); - - $submenu_hook = add_submenu_page( - $this->menu_slug, - __( 'Git Configuration', 'gitium' ), - __( 'Configuration', 'gitium' ), - GITIUM_MANAGE_OPTIONS_CAPABILITY, - $this->menu_slug, - array( $this, 'page' ) - ); - new Gitium_Help( $submenu_hook, 'configuration' ); - } - - public function regenerate_keypair() { - $submit_keypair = filter_input(INPUT_POST, 'GitiumSubmitRegenerateKeypair', FILTER_SANITIZE_STRING); - if ( ! isset( $submit_keypair ) ) { - return; - } - check_admin_referer( 'gitium-admin' ); - gitium_get_keypair( true ); - $this->success_redirect( __( 'Keypair successfully regenerated.', 'gitium' ) ); - } - - public function gitium_warning() { - $submit_warning = filter_input(INPUT_POST, 'GitiumSubmitWarning', FILTER_SANITIZE_STRING); - if ( ! isset( $submit_warning ) ) { - return; - } - check_admin_referer( 'gitium-admin' ); - $this->git->remove_wp_content_from_version_control(); - } - - public function init_process( $remote_url ) { - $git = $this->git; - $git->init(); - $git->add_remote_url( $remote_url ); - $git->fetch_ref(); - if ( count( $git->get_remote_branches() ) == 0 ) { - $git->add( 'wp-content', '.gitignore' ); - $current_user = wp_get_current_user(); - $git->commit( __( 'Initial commit', 'gitium' ), $current_user->display_name, $current_user->user_email ); - if ( ! $git->push( 'master' ) ) { - $git->cleanup(); - return false; - } - } - return true; - } - - public function init_repo() { - $remote_url = filter_input(INPUT_POST, 'remote_url', FILTER_SANITIZE_STRING); - $gitium_submit_fetch = filter_input(INPUT_POST, 'GitiumSubmitFetch', FILTER_SANITIZE_STRING); - if ( ! isset( $gitium_submit_fetch ) || ! isset( $remote_url ) ) { - return; - } - check_admin_referer( 'gitium-admin' ); - - if ( empty( $remote_url ) ) { - $this->redirect( __( 'Please specify a valid repo.', 'gitium' ) ); - } - if ( $this->init_process( $remote_url ) ) { - $this->success_redirect( __( 'Repository initialized successfully.', 'gitium' ) ); - } else { - global $git; - $this->redirect( __( 'Could not push to remote: ', 'gitium' ) . $remote_url . ' ERROR: ' . serialize( $git->get_last_error() ) ); - } - } - - public function choose_branch() { - $gitium_submit_merge_push = filter_input(INPUT_POST, 'GitiumSubmitMergeAndPush', FILTER_SANITIZE_STRING); - $tracking_branch = filter_input(INPUT_POST, 'tracking_branch', FILTER_SANITIZE_STRING); - if ( ! isset( $gitium_submit_merge_push ) || ! isset( $tracking_branch ) ) { - return; - } - check_admin_referer( 'gitium-admin' ); - $this->git->add(); - - $branch = $tracking_branch; - set_transient( 'gitium_remote_tracking_branch', $branch ); - $current_user = wp_get_current_user(); - - $commit = $this->git->commit( __( 'Merged existing code from ', 'gitium' ) . get_home_url(), $current_user->display_name, $current_user->user_email ); - if ( ! $commit ) { - $this->git->cleanup(); - $this->redirect( __( 'Could not create initial commit -> ', 'gitium' ) . $this->git->get_last_error() ); - } - if ( ! $this->git->merge_initial_commit( $commit, $branch ) ) { - $this->git->cleanup(); - $this->redirect( __( 'Could not merge the initial commit -> ', 'gitium' ) . $this->git->get_last_error() ); - } - $this->git->push( $branch ); - $this->success_redirect( __( 'Branch selected successfully.', 'gitium' ) ); - } - - private function setup_step_1_remote_url() { - ?> - - - - -


- https://user:pass@github.com/user/example.git', 'gitium' ); ?>

- - - - - - -

- - -

-


- github or bitbucket.', 'gitium' ); ?> -

- - - -
-

-
- -

wp-content is already under version control. You must remove it from version control in order to continue.

-

NOTE by doing this you WILL LOSE commit history, but NOT the actual files.

- -
-
- -
-

-

-
- - - setup_step_1_remote_url(); ?> - setup_step_1_key_pair(); ?> -
-

- -

-
-
- git; ?> -
-

-

- - -
- - - - - - - -
- -

get_remote_url() ); ?>

-
- -

- -

-
- show_disconnect_repository_button(); - ?> -
- show_message(); - - if ( wp_content_is_versioned() ) { - return $this->setup_warning(); - } - - if ( ! $this->git->is_status_working() || ! $this->git->get_remote_url() ) { - return $this->setup_step_1(); - } - - if ( ! $this->git->get_remote_tracking_branch() ) { - return $this->setup_step_2(); - } - - _gitium_status( true ); - gitium_update_is_status_working(); - gitium_update_remote_tracking_branch(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-submenu-settings.php b/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-submenu-settings.php deleted file mode 100644 index 3bc93c5c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/class-gitium-submenu-settings.php +++ /dev/null @@ -1,139 +0,0 @@ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Submenu_Settings extends Gitium_Menu { - - public function __construct() { - parent::__construct( $this->gitium_menu_slug, $this->settings_menu_slug ); - add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) ); - add_action( 'admin_init', array( $this, 'save' ) ); - add_action( 'admin_init', array( $this, 'regenerate_webhook' ) ); - add_action( 'admin_init', array( $this, 'regenerate_public_key' ) ); - } - - public function admin_menu() { - $submenu_hook = add_submenu_page( - $this->menu_slug, - 'Settings', - __( 'Settings' ), - GITIUM_MANAGE_OPTIONS_CAPABILITY, - $this->submenu_slug, - array( $this, 'page' ) - ); - new Gitium_Help( $submenu_hook, 'settings' ); - } - - public function regenerate_webhook() { - $gitium_regen_webhook = filter_input(INPUT_POST, 'GitiumSubmitRegenerateWebhook', FILTER_SANITIZE_STRING); - if ( ! isset( $gitium_regen_webhook ) ) { - return; - } - check_admin_referer( 'gitium-settings' ); - gitium_get_webhook_key( true ); - $this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug ); - } - - public function regenerate_public_key() { - $submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_STRING); - if ( ! isset( $submit_regenerate_pub_key ) ) { - return; - } - check_admin_referer( 'gitium-settings' ); - gitium_get_keypair( true ); - $this->success_redirect( __( 'Public key successfully regenerated.', 'gitium' ), $this->settings_menu_slug ); - } - - private function show_webhook_table_webhook_url() { - ?> - - - -

- - - Merge changes

- -

- - - - - - -

-

-


- github or bitbucket.', 'gitium' ); ?> -

- - - - - show_webhook_table_webhook_url() ?> - show_webhook_table_public_key(); ?> -
- git->set_gitignore( $gitignore_content ) ) { - gitium_commit_and_push_gitignore_file(); - $this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->settings_menu_slug ); - } else { - $this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug ); - } - } - - public function page() { - $this->show_message(); - ?> -
-

- -
- - -

- - - show_webhook_table(); ?> -

- -

- -
-
- - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - 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 -*/ - -class Gitium_Submenu_Status extends Gitium_Menu { - - public function __construct() { - parent::__construct( $this->gitium_menu_slug, $this->gitium_menu_slug ); - - if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) { - add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) ); - add_action( 'admin_init', array( $this, 'save_changes' ) ); - add_action( 'admin_init', array( $this, 'save_ignorelist' ) ); - add_action( 'admin_init', array( $this, 'disconnect_repository' ) ); - } - } - - public function admin_menu() { - add_menu_page( - __( 'Git Status', 'gitium' ), - 'Gitium', - GITIUM_MANAGE_OPTIONS_CAPABILITY, - $this->menu_slug, - array( $this, 'page' ), - plugins_url( 'img/gitium.png', dirname( __FILE__ ) ) - ); - - $submenu_hook = add_submenu_page( - $this->menu_slug, - __( 'Git Status', 'gitium' ), - __( 'Status', 'gitium' ), - GITIUM_MANAGE_OPTIONS_CAPABILITY, - $this->menu_slug, - array( $this, 'page' ) - ); - new Gitium_Help( $submenu_hook, 'status' ); - } - - private function get_change_meanings() { - return array( - '??' => __( 'untracked', 'gitium' ), - 'rM' => __( 'modified on remote', 'gitium' ), - 'rA' => __( 'added to remote', 'gitium' ), - 'rD' => __( 'deleted from remote', 'gitium' ), - 'D' => __( 'deleted from work tree', 'gitium' ), - 'M' => __( 'updated in work tree', 'gitium' ), - 'A' => __( 'added to work tree', 'gitium' ), - 'AM' => __( 'added to work tree', 'gitium' ), - 'R' => __( 'deleted from work tree', 'gitium' ), - ); - } - - public function humanized_change( $change ) { - $meaning = $this->get_change_meanings(); - - if ( isset( $meaning[ $change ] ) ) { - return $meaning[ $change ]; - } - if ( 0 === strpos( $change, 'R ' ) ) { - $old_filename = substr( $change, 2 ); - $change = sprintf( __( 'renamed from `%s`', 'gitium' ), $old_filename ); - } - return $change; - } - - public function save_ignorelist() { - $gitium_ignore_path = filter_input(INPUT_POST, 'GitiumIgnorePath', FILTER_SANITIZE_STRING); - if ( ! isset( $gitium_ignore_path ) ) { - return; - } else { - $path = $gitium_ignore_path; - } - check_admin_referer( 'gitium-admin' ); - - if ( $this->git->set_gitignore( join( "\n", array_unique( array_merge( explode( "\n", $this->git->get_gitignore() ), array( $path ) ) ) ) ) ) { - gitium_commit_and_push_gitignore_file( $path ); - $this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->gitium_menu_slug ); - } else { - $this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->gitium_menu_slug ); - } - } - - public function save_changes() { - $gitium_save_changes = filter_input(INPUT_POST, 'GitiumSubmitSaveChanges', FILTER_SANITIZE_STRING); - $gitium_commit_msg = filter_input(INPUT_POST, 'commitmsg', FILTER_SANITIZE_STRING); - if ( ! isset( $gitium_save_changes ) ) { - return; - } - check_admin_referer( 'gitium-admin' ); - - gitium_enable_maintenance_mode() or wp_die( __( 'Could not enable the maintenance mode!', 'gitium' ) ); - $this->git->add(); - $commitmsg = sprintf( __( 'Merged changes from %s on %s', 'gitium' ), get_site_url(), date( 'm.d.Y' ) ); - if ( isset( $gitium_commit_msg ) && ! empty( $gitium_commit_msg ) ) { - $commitmsg = $gitium_commit_msg; - } - $current_user = wp_get_current_user(); - $commit = $this->git->commit( $commitmsg, $current_user->display_name, $current_user->user_email ); - if ( ! $commit ) { - $this->redirect( __( 'Could not commit!', 'gitium' ) ); - } - $merge_success = gitium_merge_and_push( $commit ); - gitium_disable_maintenance_mode(); - if ( ! $merge_success ) { - $this->redirect( __( 'Merge failed: ', 'gitium' ) . $this->git->get_last_error() ); - } - $this->success_redirect( sprintf( __( 'Pushed commit: `%s`', 'gitium' ), $commitmsg ) ); - } - - private function show_ahead_and_behind_info( $changes = '' ) { - $branch = $this->git->get_remote_tracking_branch(); - $ahead = count( $this->git->get_ahead_commits() ); - $behind = count( $this->git->get_behind_commits() ); - ?> -

- %s.', 'gitium' ), $branch ); - ?>  -

- - - $type ) : - $counter++; - echo ( 0 != $counter % 2 ) ? '' : ''; - echo '' . esc_html( $path ) . ''; - echo ''; - echo ''; - if ( is_dir( ABSPATH . '/' . $path ) && is_dir( ABSPATH . '/' . trailingslashit( $path ) . '.git' ) ) { // test if is submodule - _e( 'Submodules are not supported in this version.', 'gitium' ); - } else { - echo '' . esc_html( $this->humanized_change( $type ) ) . ''; - } - echo ''; - echo ''; - endforeach; - } - - private function show_git_changes_table( $changes = '' ) { - ?> - - - - - '; - else : - $this->show_git_changes_table_rows( $changes ); - endif; - ?> - -

'; - _e( 'Nothing to commit, working directory clean.', 'gitium' ); - echo '

- -

- - -

-

- />  -

- -
-
 
-

git->get_remote_url() ); ?>

- -
- show_ahead_and_behind_info( $changes ); - $this->show_git_changes_table( $changes ); - $this->show_git_changes_table_submit_buttons( $changes ); - ?> -
- show_disconnect_repository_button(); - ?> -
- show_message(); - _gitium_status( true ); - $this->changes_page(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/inc/ssh-git b/wp-content/upgrade-temp-backup/plugins/gitium/inc/ssh-git deleted file mode 100755 index ee976562..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/inc/ssh-git +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -SSH_AUTH_SOCK='' -SSH="ssh -q -F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -if [ -z "$GIT_KEY_FILE" ] ; then - exec $SSH "$@" -else - exec $SSH -i "$GIT_KEY_FILE" "$@" -fi diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-es_ES.mo b/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-es_ES.mo deleted file mode 100644 index d0ce249f..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-es_ES.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-es_ES.po b/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-es_ES.po deleted file mode 100644 index 8af1389f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-es_ES.po +++ /dev/null @@ -1,546 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Gitium\n" -"POT-Creation-Date: 2014-10-20 19:06+0200\n" -"PO-Revision-Date: 2014-11-13 11:20+0200\n" -"Last-Translator: Presslabs \n" -"Language-Team: Presslabs \n" -"Language: English\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.4\n" -"X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-SearchPath-0: ..\n" - -#: ../inc/class-gitium-submenu-configure.php:34 -#: ../inc/class-gitium-submenu-configure.php:44 -msgid "Git Configuration" -msgstr "Configuración Git" - -#: ../inc/class-gitium-submenu-configure.php:45 -msgid "Configuration" -msgstr "Configuración" - -#: ../inc/class-gitium-submenu-configure.php:59 -msgid "Keypair successfully regenerated." -msgstr "Par de claves regenerado con éxito." - -#: ../inc/class-gitium-submenu-configure.php:78 -msgid "Initial commit" -msgstr "Commit Inicial" - -#: ../inc/class-gitium-submenu-configure.php:94 -msgid "Please specify a valid repo." -msgstr "Por favor, especifique un repo válido" - -#: ../inc/class-gitium-submenu-configure.php:99 -msgid "Could not push to remote" -msgstr "No se pudo empujar al remoto" - -#: ../inc/class-gitium-submenu-configure.php:113 -msgid "Merged existing code from " -msgstr "Código existente fusionado de" - -#: ../inc/class-gitium-submenu-configure.php:116 -msgid "Could not create initial commit -> " -msgstr "No se pudo crear Commit inicial ->" - -#: ../inc/class-gitium-submenu-configure.php:120 -msgid "Could not merge the initial commit -> " -msgstr "No se pudo fusionar el Commit inicial ->" - -#: ../inc/class-gitium-submenu-configure.php:129 -msgid "Remote URL" -msgstr "URL remoto" - -#: ../inc/class-gitium-submenu-configure.php:132 -msgid "" -"This URL provide access to a Git repository via SSH, HTTPS, or Subversion." -msgstr "" -"Este URL proporciona acceso a un repositorio Git vía SSH, HTTPS o Subversión." - -#: ../inc/class-gitium-submenu-configure.php:133 -msgid "" -"If you need to authenticate over \"https://\" instead of SSH use: " -"https://user:pass@github.com/user/example.git" -msgstr "" -"Si necesita autenticar sobre \"https:// en lugar del uso de SSH: " -"https://user:pass@github.com/user/example.git " - -#: ../inc/class-gitium-submenu-configure.php:143 -msgid "Key pair" -msgstr "Par de claves" - -#: ../inc/class-gitium-submenu-configure.php:147 -#: ../inc/class-gitium-submenu-settings.php:80 -msgid "Regenerate Key" -msgstr "Regenerar clave" - -#: ../inc/class-gitium-submenu-configure.php:149 -#: ../inc/class-gitium-submenu-settings.php:81 -msgid "" -"If your code use ssh keybased authentication for git you need to allow write " -"access to your repository using this key." -msgstr "" -"Si su código usa autenticación ssh keybased para git, usted necesita " -"permitir el acceso de escritura a su repositorio utilizando esta clave." - -#: ../inc/class-gitium-submenu-configure.php:150 -#: ../inc/class-gitium-submenu-settings.php:82 -msgid "" -"Checkout instructions for github or bitbucket." -msgstr "" -"Instrucciones de Pedido para github or %s." -msgstr "Siguiendo sucursal remota %s." - -#: ../inc/class-gitium-submenu-status.php:127 -msgid "Everything is up to date" -msgstr "Todo está actualizado" - -#: ../inc/class-gitium-submenu-status.php:130 -#, php-format -msgid "You are %s commits ahead and %s behind remote." -msgstr "Usted está %s Commits por delante y %s por detrás del remoto." - -#: ../inc/class-gitium-submenu-status.php:132 -#, php-format -msgid "You are %s commits ahead remote." -msgstr "Usted está %s Commits delante del remoto." - -#: ../inc/class-gitium-submenu-status.php:134 -#, php-format -msgid "You are %s commits behind remote." -msgstr "Usted está %s Commits detrás del remoto." - -#: ../inc/class-gitium-submenu-status.php:160 -msgid "Add this file to the `.gitignore` list." -msgstr "Añadir este archivo a la lista `.gitignore`." - -#: ../inc/class-gitium-submenu-status.php:163 -msgid "Submodules are not supported in this version." -msgstr "Sub-módulos no son compatibles con esta versión." - -#: ../inc/class-gitium-submenu-status.php:175 -#: ../inc/class-gitium-submenu-status.php:176 -msgid "Path" -msgstr "Ruta" - -#: ../inc/class-gitium-submenu-status.php:175 -#: ../inc/class-gitium-submenu-status.php:176 -msgid "Change" -msgstr "Cambiar" - -#: ../inc/class-gitium-submenu-status.php:181 -msgid "Nothing to commit, working directory clean." -msgstr "Nada que comprometer, directorio de trabajo limpio." - -#: ../inc/class-gitium-submenu-status.php:195 -msgid "Commit message" -msgstr "Comprometer mensaje" - -#: ../inc/class-gitium-submenu-status.php:199 -msgid "Save changes" -msgstr "Guardar cambios" - -#: ../inc/class-gitium-submenu-status.php:209 -msgid "connected to" -msgstr "conectados a" - -#: ../inc/class-gitium-submenu-settings.php:32 ../inc/class-gitium-help.php:81 -msgid "Settings" -msgstr "Ajustes" - -#: ../inc/class-gitium-submenu-settings.php:46 -msgid "" -"Webhook URL regenerates. Please make sure you update any external references." -msgstr "" -"Webhook URL se regenera. Por favor, asegúrese de actualizar todas las " -"referencias externas." - -#: ../inc/class-gitium-submenu-settings.php:55 -msgid "Public key successfully regenerated." -msgstr "Clave pública regenera con éxito." - -#: ../inc/class-gitium-submenu-settings.php:61 -msgid "Webhook URL" -msgstr "URL Webhook" - -#: ../inc/class-gitium-submenu-settings.php:65 -msgid "Regenerate Webhook" -msgstr "Regenerar Webhook" - -#: ../inc/class-gitium-submenu-settings.php:67 -msgid "Pinging this URL triggers an update from remote repository." -msgstr "" -"Hacer ping en esta URL desencadena una actualización del repositorio remoto." - -#: ../inc/class-gitium-submenu-settings.php:77 -msgid "Public Key" -msgstr "Clave Pública" - -#: ../inc/class-gitium-submenu-settings.php:116 -msgid "Gitium Settings" -msgstr "Ajustes Gitium" - -#: ../inc/class-gitium-submenu-settings.php:121 -msgid "Be careful when you modify this list!" -msgstr "¡Tenga cuidado al modificar esta lista!" - -#: ../inc/class-gitium-submenu-settings.php:126 -msgid "Save" -msgstr "Guardar" - -#: ../inc/class-gitium-help.php:26 -msgid "Gitium" -msgstr "Gitium" - -#: ../inc/class-gitium-help.php:27 -msgid "F.A.Q." -msgstr "PF" - -#: ../inc/class-gitium-help.php:32 -msgid "" -"Gitium enables continuous deployment for WordPress integrating with tools " -"such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs " -"and removals are automatically versioned." -msgstr "" -"Gitium permite el despliegue continuo para integración de WordPress con " -"herramientas como Github, Bitbucket o Travis-CI. El plugin y las " -"actualizaciones de temas, instalaciones y eliminaciones están versionadas " -"automáticamente." - -#: ../inc/class-gitium-help.php:33 -msgid "" -"Ninja code edits from the WordPress editor are also tracked into version " -"control. Gitium is designed for sane development environments." -msgstr "" -"Las ediciones Código Ninja desde el editor de WordPress también son " -"rastreadas en el control de versiones. Gitium está diseñado para entornos de " -"desarrollo sanos." - -#: ../inc/class-gitium-help.php:34 -msgid "" -"Staging and production can follow different branches of the same repository. " -"You can deploy code simply trough git push." -msgstr "" -"Puesta en escena y producción pueden seguir diferentes ramas del mismo " -"repositorio. Puede implementar código simplemente a través git push." - -#: ../inc/class-gitium-help.php:35 -msgid "" -"Gitium requires git command line tool minimum version 1.7 " -"installed on the server and proc_open PHP function enabled." -msgstr "" -"Gitium requiere la herramienta de línea de comandos git , " -"mínimo la versión 1.7 instalada en el servidor y proc_open la " -"función PHP habilitada." - -#: ../inc/class-gitium-help.php:39 -msgid "Is this plugin considered stable?" -msgstr "¿Es este plugin considerado estable?" - -#: ../inc/class-gitium-help.php:39 -msgid "" -"Right now this plugin is considered alpha quality and should be used in " -"production environments only by adventurous kinds." -msgstr "" -"Ahora mismo este plugin se considera de calidad alfa y debe utilizarse en " -"entornos de producción sólo por tipos aventureros." - -#: ../inc/class-gitium-help.php:40 -msgid "What happens in case of conflicts?" -msgstr "¿Qué sucede en caso de conflictos?" - -#: ../inc/class-gitium-help.php:40 -msgid "" -"The behavior in case of conflicts is to overwrite the changes on the origin " -"repository with the local changes (ie. local modifications take precedence " -"over remote ones)." -msgstr "" -"El comportamiento en caso de conflictos es sobrescribir los cambios en el " -"repositorio de origen con los cambios locales (p.ej. las modificaciones " -"locales toman precedencia sobre las remotas)." - -#: ../inc/class-gitium-help.php:41 -msgid "How to deploy automatically after a push?" -msgstr "¿Cómo implementar automáticamente después de un empujón?" - -#: ../inc/class-gitium-help.php:41 -msgid "" -"You can ping the webhook url after a push to automatically deploy the new " -"code. The webhook url can be found under Code menu. This url plays well with " -"Github or Bitbucket webhooks." -msgstr "" -"Puede hacer ping en la url webhook después de un empujón para distribuir " -"automáticamente el nuevo código. La url webhook se puede encontrar en el " -"menú Código. Esta url juega bien con Github o BitBucket WebHooks." - -#: ../inc/class-gitium-help.php:42 -msgid "Does it works on multi site setups?" -msgstr "¿Trabaja en múltiples configuraciones de sitio?" - -#: ../inc/class-gitium-help.php:42 -msgid "Gitium is not supporting multisite setups at the moment." -msgstr "" -"Gitium no soporta a las configuraciones de múltiples sitios en este momento." - -#: ../inc/class-gitium-help.php:43 -msgid "How does gitium handle submodules?" -msgstr "¿Cómo manejar gitium los submódulos?" - -#: ../inc/class-gitium-help.php:43 -msgid "Currently submodules are not supported." -msgstr "Actualmente los submódulos no son compatibles." - -#: ../inc/class-gitium-help.php:47 -msgid "" -"In this step you must specify the Remote URL. This URL " -"represents the link between the git sistem and your site." -msgstr "" -"En esta etapa, se debe especificar el URL remoto . Esta URL " -"representa el enlace entre el sistema git y su sitio." - -#: ../inc/class-gitium-help.php:48 -msgid "You can get this URL from your Git repository and it looks like this:" -msgstr "" -"Usted puede obtener esta dirección URL de su repositorio Git y se ve así:" - -#: ../inc/class-gitium-help.php:49 -msgid "github.com -> git@github.com:user/example.git" -msgstr "github.com -> git@github.com:user/example.git" - -#: ../inc/class-gitium-help.php:50 -msgid "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git" -msgstr "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git" - -#: ../inc/class-gitium-help.php:51 -msgid "" -"To go to the next step, fill the Remote URL and then press the " -"Fetch button." -msgstr "" -"Para ir al siguiente paso, llene la URL remota y pulse el " -"botón Buscar ." - -#: ../inc/class-gitium-help.php:52 -msgid "" -"In this step you must select the branch you want to follow." -msgstr "" -"En este paso deberá seleccionar la rama que desea seguir." - -#: ../inc/class-gitium-help.php:53 -msgid "Only this branch will have all of your code modifications." -msgstr "Sólo esta rama tendrá todas sus modificaciones de código." - -#: ../inc/class-gitium-help.php:54 -msgid "" -"When you push the button Merge & Push, all code(plugins & " -"themes) will be pushed on the git repository." -msgstr "" -"Cuando se presiona el botón Combinar y Empujar , todo el " -"código (plugins y temas) serán empujados en el repositorio git." - -#: ../inc/class-gitium-help.php:64 -msgid "" -"On status page you can see what files are modified, and you can commit the " -"changes to git." -msgstr "" -"En la página de estado se puede ver qué archivos son modificados, y usted " -"puede confirmar los cambios a Git." - -#: ../inc/class-gitium-help.php:69 ../inc/class-gitium-submenu-commits.php:29 -#: ../inc/class-gitium-submenu-commits.php:41 -msgid "Commits" -msgstr "Commits" - -#: ../inc/class-gitium-help.php:74 -msgid "" -"You may be wondering what is the difference between author and committer." -msgstr "" -"Usted puede preguntarse cuál es la diferencia entre el autor y el comitter." - -#: ../inc/class-gitium-help.php:75 -msgid "" -"The author is the person who originally wrote the patch, " -"whereas the committer is the person who last applied the patch." -msgstr "" -"El autor es la persona que originalmente escribió el parche, " -"mientras que el committer es la persona que aplicó el parche " -"al final." - -#: ../inc/class-gitium-help.php:76 -msgid "" -"So, if you send in a patch to a project and one of the core members applies " -"the patch, both of you get credit — you as the author and the core member as " -"the committer." -msgstr "" -"Por lo tanto, si usted envía en un parche para un proyecto y uno de los " -"principales miembros aplica el parche, ambos consiguen crédito - usted como " -"el autor y el miembro de núcleo como el commiter." - -#: ../inc/class-gitium-help.php:86 -msgid "Each line from the gitignore file specifies a pattern." -msgstr "Cada línea del archivo gitignore especifica un patrón." - -#: ../inc/class-gitium-help.php:87 -msgid "" -"When deciding whether to ignore a path, Git normally checks gitignore " -"patterns from multiple sources, with the following order of precedence, from " -"highest to lowest (within one level of precedence, the last matching pattern " -"decides the outcome)" -msgstr "" -"A la hora de decidir si se debe pasar por alto una ruta, Git normalmente " -"comprueba patrones gitignore de múltiples fuentes, con el siguiente orden, " -"de de mayor a menor (dentro de un nivel de prioridad, la última " -"coincidencia de patrones decide el resultado)" - -#: ../inc/class-gitium-help.php:88 -#, php-format -msgid "Read more on %s" -msgstr "Leer más en %s" - -#: ../inc/class-gitium-submenu-commits.php:28 -msgid "Git Commits" -msgstr "Commits Git" - -#: ../inc/class-gitium-submenu-commits.php:61 -#, php-format -msgid "Last %s commits" -msgstr "Últimos commits %s" - -#: ../inc/class-gitium-submenu-commits.php:70 -#, php-format -msgid "committed %s ago" -msgstr "cometido hace %s" - -#: ../inc/class-gitium-submenu-commits.php:82 -#, php-format -msgid "authored %s ago" -msgstr "Creado hace %s" diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-sr_RS.mo b/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-sr_RS.mo deleted file mode 100644 index 677d3bf3..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-sr_RS.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-sr_RS.po b/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-sr_RS.po deleted file mode 100644 index 09cb064a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium-sr_RS.po +++ /dev/null @@ -1,538 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Gitium\n" -"POT-Creation-Date: 2014-10-20 19:06+0200\n" -"PO-Revision-Date: 2014-10-24 12:51+0200\n" -"Last-Translator: Presslabs \n" -"Language-Team: Presslabs \n" -"Language: English\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.4\n" -"X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-SearchPath-0: ..\n" - -#: ../inc/class-gitium-submenu-configure.php:34 -#: ../inc/class-gitium-submenu-configure.php:44 -msgid "Git Configuration" -msgstr "Git konfiguracija" - -#: ../inc/class-gitium-submenu-configure.php:45 -msgid "Configuration" -msgstr "Konfiguracija" - -#: ../inc/class-gitium-submenu-configure.php:59 -msgid "Keypair successfully regenerated." -msgstr "Par ključeva uspešno regenerisan" - -#: ../inc/class-gitium-submenu-configure.php:78 -msgid "Initial commit" -msgstr "Početna uputstva" - -#: ../inc/class-gitium-submenu-configure.php:94 -msgid "Please specify a valid repo." -msgstr "Odaberite važeće spremište" - -#: ../inc/class-gitium-submenu-configure.php:99 -msgid "Could not push to remote" -msgstr "Neuspelo potiskivanje u udaljeno spremište" - -#: ../inc/class-gitium-submenu-configure.php:113 -msgid "Merged existing code from " -msgstr "Postojeći kod spojen sa" - -#: ../inc/class-gitium-submenu-configure.php:116 -msgid "Could not create initial commit -> " -msgstr "Neuspelo kreiranje početnog uputstva ->" - -#: ../inc/class-gitium-submenu-configure.php:120 -msgid "Could not merge the initial commit -> " -msgstr "Neuspelo spajanje početnog uputstva ->" - -#: ../inc/class-gitium-submenu-configure.php:129 -msgid "Remote URL" -msgstr "URL udaljenog spremišta" - -#: ../inc/class-gitium-submenu-configure.php:132 -msgid "" -"This URL provide access to a Git repository via SSH, HTTPS, or Subversion." -msgstr "" -"Ovaj URL obezbeđuje pristup Git skladištu putem SSH-a, HTTPS-a ili " -"Subverzije." - -#: ../inc/class-gitium-submenu-configure.php:133 -msgid "" -"If you need to authenticate over \"https://\" instead of SSH use: " -"https://user:pass@github.com/user/example.git" -msgstr "" -"Ako treba da proverite preko \"https://\" umesto SSH, koristite: " -"https://user:pass@github.com/user/example.git" - -#: ../inc/class-gitium-submenu-configure.php:143 -msgid "Key pair" -msgstr "Par ključeva" - -#: ../inc/class-gitium-submenu-configure.php:147 -#: ../inc/class-gitium-submenu-settings.php:80 -msgid "Regenerate Key" -msgstr "Ključ za regenerisanje" - -#: ../inc/class-gitium-submenu-configure.php:149 -#: ../inc/class-gitium-submenu-settings.php:81 -msgid "" -"If your code use ssh keybased authentication for git you need to allow write " -"access to your repository using this key." -msgstr "" -"Ako vaš kod koristi git autentifikaciju na osnovu ssh ključa, morate pismeno " -"dozvoliti pristup svom spremištu uz pomoć ovog ključa. " - -#: ../inc/class-gitium-submenu-configure.php:150 -#: ../inc/class-gitium-submenu-settings.php:82 -msgid "" -"Checkout instructions for github or bitbucket." -msgstr "" -"Pogledajte uputstva na github " -"ili bitbucket." - -#: ../inc/class-gitium-submenu-configure.php:160 -msgid "Warning!" -msgstr "Upozorenje!" - -#: ../inc/class-gitium-submenu-configure.php:174 -#: ../inc/class-gitium-help.php:47 -msgid "Configuration step 1" -msgstr "Konfiguracija, korak 1" - -#: ../inc/class-gitium-submenu-configure.php:175 -#: ../inc/class-gitium-submenu-configure.php:194 -msgid "" -"If you need help to set this up, please click on the \"Help\" button from " -"the top right corner of this screen." -msgstr "" -"Ako vam treba pomoć za ovo podešavanje, kliknite na taster \"Pomoć\" u " -"gornjem desnom uglu ekrana." - -#: ../inc/class-gitium-submenu-configure.php:183 -msgid "Fetch" -msgstr "Uzmi" - -#: ../inc/class-gitium-submenu-configure.php:193 -#: ../inc/class-gitium-help.php:52 -msgid "Configuration step 2" -msgstr "Konfiguracija, korak 2" - -#: ../inc/class-gitium-submenu-configure.php:202 -msgid "Choose tracking branch" -msgstr "Odaberite ogranak za praćenje" - -#: ../inc/class-gitium-submenu-configure.php:215 -msgid "Merge & Push" -msgstr "Spoji & Potisni" - -#: ../inc/class-gitium-submenu-status.php:32 -#: ../inc/class-gitium-submenu-status.php:42 -msgid "Git Status" -msgstr "Git Status" - -#: ../inc/class-gitium-submenu-status.php:43 -#: ../inc/class-gitium-submenu-status.php:209 ../inc/class-gitium-help.php:59 -msgid "Status" -msgstr "Status" - -#: ../inc/class-gitium-submenu-status.php:53 -msgid "untracked" -msgstr "nepraćen" - -#: ../inc/class-gitium-submenu-status.php:54 -msgid "modified on remote" -msgstr "modifikovan na udaljenom skladištu" - -#: ../inc/class-gitium-submenu-status.php:55 -msgid "added to remote" -msgstr "dodat udaljenom skladištu" - -#: ../inc/class-gitium-submenu-status.php:56 -msgid "deleted from remote" -msgstr "obrisan sa udaljenog skladišta" - -#: ../inc/class-gitium-submenu-status.php:57 -#: ../inc/class-gitium-submenu-status.php:61 -msgid "deleted from work tree" -msgstr "obrisan sa radnog drveta" - -#: ../inc/class-gitium-submenu-status.php:58 -msgid "updated in work tree" -msgstr "ažuriran u radnom drvetu" - -#: ../inc/class-gitium-submenu-status.php:59 -#: ../inc/class-gitium-submenu-status.php:60 -msgid "added to work tree" -msgstr "dodat radnom drvetu" - -#: ../inc/class-gitium-submenu-status.php:73 -#, php-format -msgid "renamed from `%s`" -msgstr "ime `%s` promenjeno" - -#: ../inc/class-gitium-submenu-status.php:88 -#: ../inc/class-gitium-submenu-settings.php:106 -msgid "The file `.gitignore` is saved!" -msgstr "Datoteka `.gitignore` je sačuvana!" - -#: ../inc/class-gitium-submenu-status.php:90 -#: ../inc/class-gitium-submenu-settings.php:108 -msgid "The file `.gitignore` could not be saved!" -msgstr "Datoteka `.gitignore` ne može biti sačuvana!" - -#: ../inc/class-gitium-submenu-status.php:100 -msgid "Could not enable the maintenance mode!" -msgstr "Režim održavanja nije mogao biti aktiviran!" - -#: ../inc/class-gitium-submenu-status.php:102 -#: ../inc/class-gitium-submenu-status.php:196 -#, php-format -msgid "Merged changes from %s on %s" -msgstr "Promene sa %s na %s spojene!" - -#: ../inc/class-gitium-submenu-status.php:109 -msgid "Could not commit!" -msgstr "Neuspelo izvršenje!" - -#: ../inc/class-gitium-submenu-status.php:114 -msgid "Merge failed: " -msgstr "Neuspelo spajanje:" - -#: ../inc/class-gitium-submenu-status.php:116 -#, php-format -msgid "Pushed commit: `%s`" -msgstr "Preneto izvršenje: `%s`" - -#: ../inc/class-gitium-submenu-status.php:125 -#, php-format -msgid "Following remote branch %s." -msgstr "Praćenje udaljenog ogranka%s." - -#: ../inc/class-gitium-submenu-status.php:127 -msgid "Everything is up to date" -msgstr "Sve je ažurirano" - -#: ../inc/class-gitium-submenu-status.php:130 -#, php-format -msgid "You are %s commits ahead and %s behind remote." -msgstr "Vi ste %s izvršenja ispred i %s iza udaljenog spremišta." - -#: ../inc/class-gitium-submenu-status.php:132 -#, php-format -msgid "You are %s commits ahead remote." -msgstr "Vi ste %s izvršenja ispred udaljenog spremišta." - -#: ../inc/class-gitium-submenu-status.php:134 -#, php-format -msgid "You are %s commits behind remote." -msgstr "Vi ste %s izvršenja iza udaljenog spremišta." - -#: ../inc/class-gitium-submenu-status.php:160 -msgid "Add this file to the `.gitignore` list." -msgstr "Dodajte ovu datoteku `.gitignore` listi." - -#: ../inc/class-gitium-submenu-status.php:163 -msgid "Submodules are not supported in this version." -msgstr "U ovoj verziji nisu podržani submoduli." - -#: ../inc/class-gitium-submenu-status.php:175 -#: ../inc/class-gitium-submenu-status.php:176 -msgid "Path" -msgstr "Putanja" - -#: ../inc/class-gitium-submenu-status.php:175 -#: ../inc/class-gitium-submenu-status.php:176 -msgid "Change" -msgstr "Izmeni" - -#: ../inc/class-gitium-submenu-status.php:181 -msgid "Nothing to commit, working directory clean." -msgstr "Nema ničega za izvršenje, radni direktorijum je čist." - -#: ../inc/class-gitium-submenu-status.php:195 -msgid "Commit message" -msgstr "Poruka o izvršenju" - -#: ../inc/class-gitium-submenu-status.php:199 -msgid "Save changes" -msgstr "Sačuvaj izmene" - -#: ../inc/class-gitium-submenu-status.php:209 -msgid "connected to" -msgstr "povezan sa" - -#: ../inc/class-gitium-submenu-settings.php:32 ../inc/class-gitium-help.php:81 -msgid "Settings" -msgstr "Podešavanja" - -#: ../inc/class-gitium-submenu-settings.php:46 -msgid "" -"Webhook URL regenerates. Please make sure you update any external references." -msgstr "" -"Webhook URL se regeneriše. Proverite da li ste ažurirali eksterne reference." - -#: ../inc/class-gitium-submenu-settings.php:55 -msgid "Public key successfully regenerated." -msgstr "Javni ključ uspešno regenerisan." - -#: ../inc/class-gitium-submenu-settings.php:61 -msgid "Webhook URL" -msgstr "Webhook URL" - -#: ../inc/class-gitium-submenu-settings.php:65 -msgid "Regenerate Webhook" -msgstr "Regeneriši webhook" - -#: ../inc/class-gitium-submenu-settings.php:67 -msgid "Pinging this URL triggers an update from remote repository." -msgstr "Pingovanje ovog URL-a povlači ažuriranje iz udaljenog skladišta." - -#: ../inc/class-gitium-submenu-settings.php:77 -msgid "Public Key" -msgstr "Javni ključ" - -#: ../inc/class-gitium-submenu-settings.php:116 -msgid "Gitium Settings" -msgstr "Gitium podešavanja" - -#: ../inc/class-gitium-submenu-settings.php:121 -msgid "Be careful when you modify this list!" -msgstr "Oprezno menjajte ovu listu!" - -#: ../inc/class-gitium-submenu-settings.php:126 -msgid "Save" -msgstr "Sačuvaj" - -#: ../inc/class-gitium-help.php:26 -msgid "Gitium" -msgstr "Gitium" - -#: ../inc/class-gitium-help.php:27 -msgid "F.A.Q." -msgstr "Često postavljana pitanja" - -#: ../inc/class-gitium-help.php:32 -msgid "" -"Gitium enables continuous deployment for WordPress integrating with tools " -"such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs " -"and removals are automatically versioned." -msgstr "" -"Gitium omogućava kontinuiranu primenu WordPress integrisanja alatima, kao " -"što su: Github, Bitbucket ili Travis-CI. Ažuriranja plugin-a i teme, " -"instalacije i uklanjanja automatski su verzionirani." - -#: ../inc/class-gitium-help.php:33 -msgid "" -"Ninja code edits from the WordPress editor are also tracked into version " -"control. Gitium is designed for sane development environments." -msgstr "" -"Nindža kod, koji uređuje iz WordPress uređivača, takođe se prati u kontroli " -"verzije. Gitium je dizajniran za razumna razvojna okruženja." - -#: ../inc/class-gitium-help.php:34 -msgid "" -"Staging and production can follow different branches of the same repository. " -"You can deploy code simply trough git push." -msgstr "" -"Postavljanje i proizvodnja mogu da prate različite grane istog spremišta. " -"Možete da primenite kod jednostavno kroz git push." - -#: ../inc/class-gitium-help.php:35 -msgid "" -"Gitium requires git command line tool minimum version 1.7 " -"installed on the server and proc_open PHP function enabled." -msgstr "" -"Gitium zahteva da na serveru bude instaliran git alat komandne " -"linije, najmanje verzije 1.7 i proc_open aktiviranu PHP " -"funkciju." - -#: ../inc/class-gitium-help.php:39 -msgid "Is this plugin considered stable?" -msgstr "Da li se ovaj plugin smatra stabilnim?" - -#: ../inc/class-gitium-help.php:39 -msgid "" -"Right now this plugin is considered alpha quality and should be used in " -"production environments only by adventurous kinds." -msgstr "" -"Trenutno se smatra da ovaj plugin ima alfa kvalitet i treba ga koristiti u " -"okruženjima produkcije isključivo avanturističkog karaktera." - -#: ../inc/class-gitium-help.php:40 -msgid "What happens in case of conflicts?" -msgstr "Šta se dešava u slučaju konflikta?" - -#: ../inc/class-gitium-help.php:40 -msgid "" -"The behavior in case of conflicts is to overwrite the changes on the origin " -"repository with the local changes (ie. local modifications take precedence " -"over remote ones)." -msgstr "" -"U slučaju konflikta treba poništiti izmene u prvobitnom spremištu, zajedno " -"sa lokalnim izmenama (tj. Lokalne izmene imaju prednost u odnosu na " -"udaljene)." - -#: ../inc/class-gitium-help.php:41 -msgid "How to deploy automatically after a push?" -msgstr "Kako izvršiti automatsko razmeštanje posle pritiska?" - -#: ../inc/class-gitium-help.php:41 -msgid "" -"You can ping the webhook url after a push to automatically deploy the new " -"code. The webhook url can be found under Code menu. This url plays well with " -"Github or Bitbucket webhooks." -msgstr "" -"Možete pingovati url za webhook nakon pritiska za automatsko razmeštanje " -"novog koda. URL za webhook možete naći u meniju koda. Ovaj url dobro radi uz " -"Github ili Bitbucket webhooks." - -#: ../inc/class-gitium-help.php:42 -msgid "Does it works on multi site setups?" -msgstr "Da li radi na podešavanjima višestrukih site-ova?" - -#: ../inc/class-gitium-help.php:42 -msgid "Gitium is not supporting multisite setups at the moment." -msgstr "Gitium trenutno ne podržava podešavanje višestrukih site-ova." - -#: ../inc/class-gitium-help.php:43 -msgid "How does gitium handle submodules?" -msgstr "Kako gitium upravlja submodulima?" - -#: ../inc/class-gitium-help.php:43 -msgid "Currently submodules are not supported." -msgstr "Trenutno, submoduli nisu podržani." - -#: ../inc/class-gitium-help.php:47 -msgid "" -"In this step you must specify the Remote URL. This URL " -"represents the link between the git sistem and your site." -msgstr "" -"U ovom koraku morate odrediti Udaljeni URL. Ovaj URL " -"predstavlja vezu između git sistema i vašeg site-a." - -#: ../inc/class-gitium-help.php:48 -msgid "You can get this URL from your Git repository and it looks like this:" -msgstr "Ovaj URL možete dobiti iz svog Git spremišta i on izgleda ovako:" - -#: ../inc/class-gitium-help.php:49 -msgid "github.com -> git@github.com:user/example.git" -msgstr "github.com -> git@github.com:user/example.git" - -#: ../inc/class-gitium-help.php:50 -msgid "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git" -msgstr "bitbucket.org -> git@bitbucket.org:user/glowing-happines.git" - -#: ../inc/class-gitium-help.php:51 -msgid "" -"To go to the next step, fill the Remote URL and then press the " -"Fetch button." -msgstr "" -"Da biste prešli na sledeći korak, popunite Udaljeni URL i " -"pritisnite Dobavi taster." - -#: ../inc/class-gitium-help.php:52 -msgid "" -"In this step you must select the branch you want to follow." -msgstr "" -"U ovom koraku morate odabrati ogranak koji želite da pratite. " - -#: ../inc/class-gitium-help.php:53 -msgid "Only this branch will have all of your code modifications." -msgstr "Samo će ovaj ogranak imati sve vaše modifikacije koda." - -#: ../inc/class-gitium-help.php:54 -msgid "" -"When you push the button Merge & Push, all code(plugins & " -"themes) will be pushed on the git repository." -msgstr "" -"Kad kliknete na taster Spoji & Potisni svi (plugin-ovi i teme) " -"koda biće potisnuti u git spremište." - -#: ../inc/class-gitium-help.php:64 -msgid "" -"On status page you can see what files are modified, and you can commit the " -"changes to git." -msgstr "" -"Na stranici statusa možete videti koje su datoteke izmenjene i možete uneti " -"izmene u git." - -#: ../inc/class-gitium-help.php:69 ../inc/class-gitium-submenu-commits.php:29 -#: ../inc/class-gitium-submenu-commits.php:41 -msgid "Commits" -msgstr "Izvršenja" - -#: ../inc/class-gitium-help.php:74 -msgid "" -"You may be wondering what is the difference between author and committer." -msgstr "Možda se pitate u čemu je razlika između autora i izvršioca?" - -#: ../inc/class-gitium-help.php:75 -msgid "" -"The author is the person who originally wrote the patch, " -"whereas the committer is the person who last applied the patch." -msgstr "" -"Autor je osoba koja je originalno napisala zakrpu, dok je " -"izvršilac osoba koja je poslednja primenila zakrpu." - -#: ../inc/class-gitium-help.php:76 -msgid "" -"So, if you send in a patch to a project and one of the core members applies " -"the patch, both of you get credit — you as the author and the core member as " -"the committer." -msgstr "" -"Dakle, ako pošaljete zakrpu projektu i jedan od ključnih članova je primeni " -"- oboje dobijate zasluge - vi kao autor, a ključni član kao izvršilac." - -#: ../inc/class-gitium-help.php:86 -msgid "Each line from the gitignore file specifies a pattern." -msgstr "Svaka linija iz gitignore datoteke označava šablon." - -#: ../inc/class-gitium-help.php:87 -msgid "" -"When deciding whether to ignore a path, Git normally checks gitignore " -"patterns from multiple sources, with the following order of precedence, from " -"highest to lowest (within one level of precedence, the last matching pattern " -"decides the outcome)" -msgstr "" -"Kad odlučujete o tome da li ćete ignorisati putanju, Git obično proverava " -"gitignore šablone iz višestrukih izvora, sa sledećim redosledom - od " -"najvišeg do najnižeg (u okviru jednog nivoa prednosti, poslednji šablon koji " -"se poklapa odlučuje o ishodu)." - -#: ../inc/class-gitium-help.php:88 -#, php-format -msgid "Read more on %s" -msgstr "Pročitajte više o %s" - -#: ../inc/class-gitium-submenu-commits.php:28 -msgid "Git Commits" -msgstr "Git izvršenja" - -#: ../inc/class-gitium-submenu-commits.php:61 -#, php-format -msgid "Last %s commits" -msgstr "Poslednja %s izvršenja" - -#: ../inc/class-gitium-submenu-commits.php:70 -#, php-format -msgid "committed %s ago" -msgstr "izvršena pre %s" - -#: ../inc/class-gitium-submenu-commits.php:82 -#, php-format -msgid "authored %s ago" -msgstr "autorizovana pre %s" diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium.pot b/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium.pot deleted file mode 100644 index 807f7dae..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/languages/gitium.pot +++ /dev/null @@ -1,489 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Gitium\n" -"POT-Creation-Date: 2014-10-20 19:06+0200\n" -"PO-Revision-Date: 2014-10-20 19:06+0200\n" -"Last-Translator: Presslabs \n" -"Language-Team: Presslabs \n" -"Language: English\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.4\n" -"X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-SearchPath-0: ..\n" - -#: ../inc/class-gitium-submenu-configure.php:34 -#: ../inc/class-gitium-submenu-configure.php:44 -msgid "Git Configuration" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:45 -msgid "Configuration" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:59 -msgid "Keypair successfully regenerated." -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:78 -msgid "Initial commit" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:94 -msgid "Please specify a valid repo." -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:99 -msgid "Could not push to remote" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:113 -msgid "Merged existing code from " -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:116 -msgid "Could not create initial commit -> " -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:120 -msgid "Could not merge the initial commit -> " -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:129 -msgid "Remote URL" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:132 -msgid "" -"This URL provide access to a Git repository via SSH, HTTPS, or Subversion." -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:133 -msgid "" -"If you need to authenticate over \"https://\" instead of SSH use: " -"https://user:pass@github.com/user/example.git" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:143 -msgid "Key pair" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:147 -#: ../inc/class-gitium-submenu-settings.php:80 -msgid "Regenerate Key" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:149 -#: ../inc/class-gitium-submenu-settings.php:81 -msgid "" -"If your code use ssh keybased authentication for git you need to allow write " -"access to your repository using this key." -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:150 -#: ../inc/class-gitium-submenu-settings.php:82 -msgid "" -"Checkout instructions for github or bitbucket." -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:160 -msgid "Warning!" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:174 -#: ../inc/class-gitium-help.php:47 -msgid "Configuration step 1" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:175 -#: ../inc/class-gitium-submenu-configure.php:194 -msgid "" -"If you need help to set this up, please click on the \"Help\" button from " -"the top right corner of this screen." -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:183 -msgid "Fetch" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:193 -#: ../inc/class-gitium-help.php:52 -msgid "Configuration step 2" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:202 -msgid "Choose tracking branch" -msgstr "" - -#: ../inc/class-gitium-submenu-configure.php:215 -msgid "Merge & Push" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:32 -#: ../inc/class-gitium-submenu-status.php:42 -msgid "Git Status" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:43 -#: ../inc/class-gitium-submenu-status.php:209 ../inc/class-gitium-help.php:59 -msgid "Status" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:53 -msgid "untracked" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:54 -msgid "modified on remote" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:55 -msgid "added to remote" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:56 -msgid "deleted from remote" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:57 -#: ../inc/class-gitium-submenu-status.php:61 -msgid "deleted from work tree" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:58 -msgid "updated in work tree" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:59 -#: ../inc/class-gitium-submenu-status.php:60 -msgid "added to work tree" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:73 -#, php-format -msgid "renamed from `%s`" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:88 -#: ../inc/class-gitium-submenu-settings.php:106 -msgid "The file `.gitignore` is saved!" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:90 -#: ../inc/class-gitium-submenu-settings.php:108 -msgid "The file `.gitignore` could not be saved!" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:100 -msgid "Could not enable the maintenance mode!" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:102 -#: ../inc/class-gitium-submenu-status.php:196 -#, php-format -msgid "Merged changes from %s on %s" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:109 -msgid "Could not commit!" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:114 -msgid "Merge failed: " -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:116 -#, php-format -msgid "Pushed commit: `%s`" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:125 -#, php-format -msgid "Following remote branch %s." -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:127 -msgid "Everything is up to date" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:130 -#, php-format -msgid "You are %s commits ahead and %s behind remote." -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:132 -#, php-format -msgid "You are %s commits ahead remote." -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:134 -#, php-format -msgid "You are %s commits behind remote." -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:160 -msgid "Add this file to the `.gitignore` list." -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:163 -msgid "Submodules are not supported in this version." -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:175 -#: ../inc/class-gitium-submenu-status.php:176 -msgid "Path" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:175 -#: ../inc/class-gitium-submenu-status.php:176 -msgid "Change" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:181 -msgid "Nothing to commit, working directory clean." -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:195 -msgid "Commit message" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:199 -msgid "Save changes" -msgstr "" - -#: ../inc/class-gitium-submenu-status.php:209 -msgid "connected to" -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:32 ../inc/class-gitium-help.php:81 -msgid "Settings" -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:46 -msgid "" -"Webhook URL regenerates. Please make sure you update any external references." -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:55 -msgid "Public key successfully regenerated." -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:61 -msgid "Webhook URL" -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:65 -msgid "Regenerate Webhook" -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:67 -msgid "Pinging this URL triggers an update from remote repository." -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:77 -msgid "Public Key" -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:116 -msgid "Gitium Settings" -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:121 -msgid "Be careful when you modify this list!" -msgstr "" - -#: ../inc/class-gitium-submenu-settings.php:126 -msgid "Save" -msgstr "" - -#: ../inc/class-gitium-help.php:26 -msgid "Gitium" -msgstr "" - -#: ../inc/class-gitium-help.php:27 -msgid "F.A.Q." -msgstr "" - -#: ../inc/class-gitium-help.php:32 -msgid "" -"Gitium enables continuous deployment for WordPress integrating with tools " -"such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs " -"and removals are automatically versioned." -msgstr "" - -#: ../inc/class-gitium-help.php:33 -msgid "" -"Ninja code edits from the WordPress editor are also tracked into version " -"control. Gitium is designed for sane development environments." -msgstr "" - -#: ../inc/class-gitium-help.php:34 -msgid "" -"Staging and production can follow different branches of the same repository. " -"You can deploy code simply trough git push." -msgstr "" - -#: ../inc/class-gitium-help.php:35 -msgid "" -"Gitium requires git command line tool minimum version 1.7 " -"installed on the server and proc_open PHP function enabled." -msgstr "" - -#: ../inc/class-gitium-help.php:39 -msgid "Is this plugin considered stable?" -msgstr "" - -#: ../inc/class-gitium-help.php:39 -msgid "" -"Right now this plugin is considered alpha quality and should be used in " -"production environments only by adventurous kinds." -msgstr "" - -#: ../inc/class-gitium-help.php:40 -msgid "What happens in case of conflicts?" -msgstr "" - -#: ../inc/class-gitium-help.php:40 -msgid "" -"The behavior in case of conflicts is to overwrite the changes on the origin " -"repository with the local changes (ie. local modifications take precedence " -"over remote ones)." -msgstr "" - -#: ../inc/class-gitium-help.php:41 -msgid "How to deploy automatically after a push?" -msgstr "" - -#: ../inc/class-gitium-help.php:41 -msgid "" -"You can ping the webhook url after a push to automatically deploy the new " -"code. The webhook url can be found under Code menu. This url plays well with " -"Github or Bitbucket webhooks." -msgstr "" - -#: ../inc/class-gitium-help.php:42 -msgid "Does it works on multi site setups?" -msgstr "" - -#: ../inc/class-gitium-help.php:42 -msgid "Gitium is not supporting multisite setups at the moment." -msgstr "" - -#: ../inc/class-gitium-help.php:43 -msgid "How does gitium handle submodules?" -msgstr "" - -#: ../inc/class-gitium-help.php:43 -msgid "Currently submodules are not supported." -msgstr "" - -#: ../inc/class-gitium-help.php:47 -msgid "" -"In this step you must specify the Remote URL. This URL " -"represents the link between the git sistem and your site." -msgstr "" - -#: ../inc/class-gitium-help.php:48 -msgid "You can get this URL from your Git repository and it looks like this:" -msgstr "" - -#: ../inc/class-gitium-help.php:49 -msgid "github.com -> git@github.com:user/example.git" -msgstr "" - -#: ../inc/class-gitium-help.php:50 -msgid "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git" -msgstr "" - -#: ../inc/class-gitium-help.php:51 -msgid "" -"To go to the next step, fill the Remote URL and then press the " -"Fetch button." -msgstr "" - -#: ../inc/class-gitium-help.php:52 -msgid "" -"In this step you must select the branch you want to follow." -msgstr "" - -#: ../inc/class-gitium-help.php:53 -msgid "Only this branch will have all of your code modifications." -msgstr "" - -#: ../inc/class-gitium-help.php:54 -msgid "" -"When you push the button Merge & Push, all code(plugins & " -"themes) will be pushed on the git repository." -msgstr "" - -#: ../inc/class-gitium-help.php:64 -msgid "" -"On status page you can see what files are modified, and you can commit the " -"changes to git." -msgstr "" - -#: ../inc/class-gitium-help.php:69 ../inc/class-gitium-submenu-commits.php:29 -#: ../inc/class-gitium-submenu-commits.php:41 -msgid "Commits" -msgstr "" - -#: ../inc/class-gitium-help.php:74 -msgid "" -"You may be wondering what is the difference between author and committer." -msgstr "" - -#: ../inc/class-gitium-help.php:75 -msgid "" -"The author is the person who originally wrote the patch, " -"whereas the committer is the person who last applied the patch." -msgstr "" - -#: ../inc/class-gitium-help.php:76 -msgid "" -"So, if you send in a patch to a project and one of the core members applies " -"the patch, both of you get credit — you as the author and the core member as " -"the committer." -msgstr "" - -#: ../inc/class-gitium-help.php:86 -msgid "Each line from the gitignore file specifies a pattern." -msgstr "" - -#: ../inc/class-gitium-help.php:87 -msgid "" -"When deciding whether to ignore a path, Git normally checks gitignore " -"patterns from multiple sources, with the following order of precedence, from " -"highest to lowest (within one level of precedence, the last matching pattern " -"decides the outcome)" -msgstr "" - -#: ../inc/class-gitium-help.php:88 -#, php-format -msgid "Read more on %s" -msgstr "" - -#: ../inc/class-gitium-submenu-commits.php:28 -msgid "Git Commits" -msgstr "" - -#: ../inc/class-gitium-submenu-commits.php:61 -#, php-format -msgid "Last %s commits" -msgstr "" - -#: ../inc/class-gitium-submenu-commits.php:70 -#, php-format -msgid "committed %s ago" -msgstr "" - -#: ../inc/class-gitium-submenu-commits.php:82 -#, php-format -msgid "authored %s ago" -msgstr "" diff --git a/wp-content/upgrade-temp-backup/plugins/gitium/readme.txt b/wp-content/upgrade-temp-backup/plugins/gitium/readme.txt deleted file mode 100644 index 0c74c846..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gitium/readme.txt +++ /dev/null @@ -1,267 +0,0 @@ -=== Gitium === - -Contributors: PressLabs -Donate link: https://www.presslabs.com/gitium/ -Tags: git, version, versioning, deployment, version-control, github, bitbucket, travis, code, revision, testing, development, branch, production, staging, debug, plugin, gitium, presslabs, simple -Requires at least: 4.7 -Tested up to: 6.2.2 -Requires PHP: 5.6 -License: GPLv2 -Stable tag: 1.0.6 -License URI: http://www.gnu.org/licenses/gpl-2.0.html - -Automatic git version control and deployment for your plugins and themes integrated into wp-admin. - -== About the makers == -This plugin was developed by the crafty people at Presslabs—the Smart Managed WordPress Hosting Platform. Here we bring high-performance hosting and business intelligence for WordPress sites. In our spare time, we contribute to the global open-source community with our code. - -We’ve built Gitium back in 2013 to provide our clients a more simple and error-free method to integrate a new git version control into their code management flow. - -== What is Gitium? == - -This plugin enables continuous deployment for WordPress, integrating with tools such as Github, Bitbucket or Travis-CI. Theme or plugin updates, installs and removals are all automatically versioned. Ninja code edits from the WordPress editor are also tracked by the version control system. - -== Why is Gitium? == - -Gitium is designed with responsible development environments in mind, allowing staging and production to follow different branches of the same repository. You can also deploy code by simply using git push. - -Gitium requires git command line tool with a minimum version of 1.7 installed on the server and the proc_open PHP function enabled. - -== Gitium features: == --preserves the WordPress behavior --accountability for code changes --safe code storage—gets all code edits in Git - -== Development == -For more details about Gitium, head here: http://docs.presslabs.com/gitium/usage/ - -== Receiving is nicer when giving == -We’ve built this to make our lives easier and we’re happy to do that for other developers, too. We’d really appreciate it if you could contribute with code, tests, documentation or just share your experience with Gitium. - -Development of Gitium happens at http://github.com/PressLabs/gitium -Issues are tracked at http://github.com/PressLabs/gitium/issues -This WordPress plugin can be found at https://wordpress.org/plugins/gitium/ - -== Screenshots == - -1. Setup step 1: Get SSH Key -2. Setup step 2: Set SSH Key (Github) -3. Setup step 3: Add remote repository -4. Setup step 4: Choose following branch -5. Commit local changes - - -== Installation == - -= Manual Installation = -1. Upload `gitium.zip` to the `/wp-content/plugins/` directory; -2. Extract the `gitium.zip` archive into the `/wp-content/plugins/` directory; -3. Activate the plugin through the 'Plugins' menu in WordPress. - -Alternatively, go into your WordPress dashboard and click on Plugins -> Add Plugin and search for `Gitium`. Then, click on Install and, after that, on Activate Now. - - -= Usage = - -Activate the plugin and follow the on-screen instructions under the `Gitium` menu. - -_IMPORTANT_: Gitium does its best not to version your WordPress core, neither your `/wp-content/uploads` folder. - -== Frequently Asked Questions == - -= Could not connect to remote repository? = - -If you encounter this kind of error you can try to fix it by setting the proper username of the .git directory. - -Example: chown -R www-data:www-data .git - -= Is this plugin considered stable? = - -Yes, we consider the plugin stable after extensive usage in production environments at Presslabs, with hundreds of users and powering sites with hundreds of millions of pageviews per month. - -= What will happen in case of conflicts? = - -The behavior in case of conflicts is to overwrite the changes on the `origin` repository with the local changes (ie. local modifications take precedence over remote ones). - -= How to deploy automatically after a push? = - -You can ping the webhook url after a push to automatically deploy the new code. The webhook url can be found under `Gitium` menu, `Settings` section. This url also plays well with Github or Bitbucket webhooks. - -= Does it works on multi site setups? = - -Gitium does not support multisite setups at the moment. - -= How does gitium handle submodules? = - -Submodules are currently not supported. - -== Upgrade Notice == -= 1.0.5 = -Fixed wrong redirection for multisite installations during initial setup - -== Changelog == - -= 1.0.6 = -* Fixed deprecation warnings for dynamic property in git-wrapper - -= 1.0.5 = -* Various bug fixes - -= 1.0.4 = -* PHP 8 compat. fixes - -= 1.0.3 = -* Fixed wrong redirection for multisite installations during initial setup - -= 1.0.2 = -* Full PHP 7+ compatibility -* Hotfix - Fixed the blank pages being displayed instead of success of failure messages; -* Hotfix - Fixed the push process when other remote branches had changes; -* Hotfix - Fixed the missing ssh / key handling with fatal errors during activation; -* Added - More success messages in certain cases. - -= 1.0.1 = -* Hotfix - Fix race condition on Code Editor Save - -= 1.0 = -* Fixed WP 4.9 Compatibility - -= 1.0-rc12 = -* Bumped plugin version - -= 1.0-rc11 = -* Hotfixed an error that prevented gitium to error_log properly. - -= 1.0-rc10 = -* Bumped wordpress tested version - -= 1.0-rc9 = -* PHP7 compat and wp-cli - -= 1.0-rc8 = -* Fix some indents -* Add some more tests -* Fix the submenu configure logic - -= 1.0-rc7 = -* Test remote url from git wrapper -* Remove the phpmd package from test environment -* Set WP_DEBUG to false on tests -* Refactoring -* Abort the cherry-pick - changes are already there -* Fix the race condition -* Add acquire and release logs for gitium lock -* Add explanations to merge with accept mine logic - -= 1.0-rc6 = -* Delete all transients and options on uninstall hook -* Add transients to is_versions and get_remote_tracking_branch functions -* Update the composer -* Check requirements before show the admin menu -* Put the logs off by default(on test env) -* Fix redirect issue and display errors -* Create wordpress docker env command -* PHP Warning: unlink #114 - -= 1.0-rc5 = -* Fix delete plugin/theme bug on 4.6 -* Update the readme file - -= 1.0-rc4 = -* Fix merge with accept mine behind commits bug - -= 1.0-rc3 = -* Add support for multisite -* Fix PHP error on merge & push - -= 1.0-rc2 = -* Change the default lockfile location -* Fix a PHP Warning - -= 1.0-rc1 = -* Update the logic of merge and push -* Add lock mechanism for fetch and merge -* Fix repo stuck on merge_local branch -* Tested up to 4.5.3 - -= 0.5.8-beta = -* Add documentation for 'Could not connect to remote repository?' -* Fix the update theme from Dashboard commit message & the install plugin commit message -* Fix install/delete plugin/theme commit message -* Add a test and rewrite the tests -* Tested up to 4.5.2 - -= 0.5.7-beta = -* Fix bug deleting plugins/themes causes wrong commit message -* Fix bug wrong commit message -* Fix bug updated function to stop maintenance mode hang -* Fix bug undefined variable 'new_versions' -* Add 'Merge changes' button for gitium webhook -* Add gitium documentation for docker -* Add more tests - -= 0.5.6-beta = -* Fix compatibility issues with wp-cli - -= 0.5.5-beta = -* Fix bug plugin deletion from plugins page did not trigger commit - -= 0.5.4-beta = -* Fix bug missing changes on similarly named plugins -* Add requirements notices -* Add requirements help section - -= 0.5.3-beta = -* Fix paths with spaces bug -* Add a Disconnect from repo button -* Fix POST var `path` conflicts -* Fix travis tests - -= 0.5.2-beta = -* Add Contextual Help to Configuration page -* Make the icon path relative -* The key file is deleted properly -* Update serbian translation -* Make the resource type more specific -* Fix Menu Bubble -* Remove useless param for get_transient -* Add Spanish Translation -* Rename `gitium_version` transient -* Fix git version notice -* Delete .vimrc -* Update .gitignore -* Fix syntax error -* Add better git version check -* Fix add_query_arg vulnerability - -= 0.5.1-beta = -* Update Serbian Translation (by [Ogi Djuraskovic](http://firstsiteguide.com/)) -* Fix Menu Bubble - -= 0.5-beta = -* Add `Last 20 Commits` menu page -* Add WordPress Contextual Help menu -* Add `Settings` menu page -* Move `Webhook URL` and `Public Key` fields to `Settings` page -* Add menu icon -* The `.gitignore` file can be edited -* Fix commit message on theme/plugin update event -* Refactoring - -= 0.4-beta = -* Add `Bitbucket` documentation link -* Add the action `gitium_before_merge_with_accept_mine` -* Moved to `travis-ci.org` -* Add new tests -* Added code climate coverage reporting -* Refactoring - -= 0.3.2-alpha = -* Fix plugin activation issues - -= 0.3.1-alpha = -* Fix issues with ssh repositories -* Fix maintemance mode when webhook fails - -= 0.3-alpha = -* First alpha release diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/css.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/css.php deleted file mode 100644 index e46eec65..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/css.php +++ /dev/null @@ -1,134 +0,0 @@ -_selector ) { - $this->add_selector_rules_to_output(); - } - - $this->_selector = $selector; - - return $this; - } - - /** - * Adds a css property with value to the css output - * - * @access public - * @since 1.0 - * - * @param string $property - the css property. - * @param string $value - the value to be placed with the property. - * @param string $url Whether we need to generate URL in the string. - * @return $this - */ - public function add_property( $property, $value, $url = '' ) { - // If we don't have a value or our value is the same as our og default, bail. - if ( empty( $value ) ) { - return false; - } - - // Set up our background image URL param if needed. - $url_start = ( '' !== $url ) ? "url('" : ""; // phpcs:ignore -- need double quotes. - $url_end = ( '' !== $url ) ? "')" : ""; // phpcs:ignore -- need double quotes. - - $this->_css .= $property . ':' . $url_start . $value . $url_end . ';'; - return $this; - } - - /** - * Adds the current selector rules to the output variable - * - * @access private - * @since 1.0 - * - * @return $this - */ - private function add_selector_rules_to_output() { - if ( ! empty( $this->_css ) ) { - $this->_selector_output = $this->_selector; - $selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css ); - - $this->_output .= $selector_output; - - // Reset the css. - $this->_css = ''; - } - - return $this; - } - - /** - * Returns the minified css in the $_output variable - * - * @access public - * @since 1.0 - * - * @return string - */ - public function css_output() { - // Add current selector's rules to output. - $this->add_selector_rules_to_output(); - - // Output minified css. - return $this->_output; - } - - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/functions.php deleted file mode 100644 index fb21ce01..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/functions.php +++ /dev/null @@ -1,1342 +0,0 @@ - '', - 'body_repeat' => '', - 'body_size' => '', - 'body_attachment' => '', - 'body_position' => '', - 'top_bar_image' => '', - 'top_bar_repeat' => '', - 'top_bar_size' => '', - 'top_bar_attachment' => '', - 'top_bar_position' => '', - 'header_image' => '', - 'header_repeat' => '', - 'header_size' => '', - 'header_attachment' => '', - 'header_position' => '', - 'nav_image' => '', - 'nav_repeat' => '', - 'nav_item_image' => '', - 'nav_item_repeat' => '', - 'nav_item_hover_image' => '', - 'nav_item_hover_repeat' => '', - 'nav_item_current_image' => '', - 'nav_item_current_repeat' => '', - 'sub_nav_image' => '', - 'sub_nav_repeat' => '', - 'sub_nav_item_image' => '', - 'sub_nav_item_repeat' => '', - 'sub_nav_item_hover_image' => '', - 'sub_nav_item_hover_repeat' => '', - 'sub_nav_item_current_image' => '', - 'sub_nav_item_current_repeat' => '', - 'content_image' => '', - 'content_repeat' => '', - 'content_size' => '', - 'content_attachment' => '', - 'content_position' => '', - 'sidebar_widget_image' => '', - 'sidebar_widget_repeat' => '', - 'sidebar_widget_size' => '', - 'sidebar_widget_attachment' => '', - 'sidebar_widget_position' => '', - 'footer_widget_image' => '', - 'footer_widget_repeat' => '', - 'footer_widget_size' => '', - 'footer_widget_attachment' => '', - 'footer_widget_position' => '', - 'footer_image' => '', - 'footer_repeat' => '', - 'footer_size' => '', - 'footer_attachment' => '', - 'footer_position' => '', - ); - - return apply_filters( 'generate_background_option_defaults', $generate_background_defaults ); - } -} - -if ( ! function_exists( 'generate_backgrounds_customize' ) ) { - add_action( 'customize_register', 'generate_backgrounds_customize', 999 ); - /** - * Build our Customizer options - * - * @since 0.1 - * - * @param object $wp_customize The Customizer object. - */ - function generate_backgrounds_customize( $wp_customize ) { - $defaults = generate_get_background_defaults(); - - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Background_Images_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - if ( class_exists( 'WP_Customize_Panel' ) ) { - if ( ! $wp_customize->get_panel( 'generate_backgrounds_panel' ) ) { - $wp_customize->add_panel( - 'generate_backgrounds_panel', - array( - 'capability' => 'edit_theme_options', - 'theme_supports' => '', - 'title' => __( 'Background Images', 'gp-premium' ), - 'priority' => 55, - ) - ); - } - } - - $wp_customize->add_section( - 'backgrounds_section', - array( - 'title' => __( 'Background Images', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 50, - ) - ); - - $wp_customize->add_section( - 'generate_backgrounds_body', - array( - 'title' => __( 'Body', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 5, - 'panel' => 'generate_backgrounds_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_body_background_image_shortcuts', - array( - 'section' => 'generate_backgrounds_body', - 'element' => __( 'Body', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_container', - 'colors' => 'body_section', - 'typography' => 'font_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - /** - * Body background - */ - $wp_customize->add_setting( - 'generate_background_settings[body_image]', - array( - 'default' => $defaults['body_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_backgrounds-body-image', - array( - 'section' => 'generate_backgrounds_body', - 'settings' => 'generate_background_settings[body_image]', - 'label' => __( 'Body', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[body_repeat]', - array( - 'default' => $defaults['body_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[body_size]', - array( - 'default' => $defaults['body_size'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[body_attachment]', - array( - 'default' => $defaults['body_attachment'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[body_position]', - array( - 'default' => $defaults['body_position'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_html', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Background_Images_Customize_Control( - $wp_customize, - 'body_backgrounds_control', - array( - 'section' => 'generate_backgrounds_body', - 'settings' => array( - 'repeat' => 'generate_background_settings[body_repeat]', - 'size' => 'generate_background_settings[body_size]', - 'attachment' => 'generate_background_settings[body_attachment]', - 'position' => 'generate_background_settings[body_position]', - ), - ) - ) - ); - - /** - * Top bar background - */ - $wp_customize->add_section( - 'generate_backgrounds_top_bar', - array( - 'title' => __( 'Top Bar', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 5, - 'panel' => 'generate_backgrounds_panel', - 'active_callback' => 'generate_premium_is_top_bar_active', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[top_bar_image]', - array( - 'default' => $defaults['top_bar_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[top_bar_image]', - array( - 'section' => 'generate_backgrounds_top_bar', - 'settings' => 'generate_background_settings[top_bar_image]', - 'label' => __( 'Top Bar', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[top_bar_repeat]', - array( - 'default' => $defaults['top_bar_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[top_bar_size]', - array( - 'default' => $defaults['top_bar_size'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[top_bar_attachment]', - array( - 'default' => $defaults['top_bar_attachment'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[top_bar_position]', - array( - 'default' => $defaults['top_bar_position'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_html', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Background_Images_Customize_Control( - $wp_customize, - 'top_bar_backgrounds_control', - array( - 'section' => 'generate_backgrounds_top_bar', - 'settings' => array( - 'repeat' => 'generate_background_settings[top_bar_repeat]', - 'size' => 'generate_background_settings[top_bar_size]', - 'attachment' => 'generate_background_settings[top_bar_attachment]', - 'position' => 'generate_background_settings[top_bar_position]', - ), - ) - ) - ); - - /** - * Header background - */ - $wp_customize->add_section( - 'generate_backgrounds_header', - array( - 'title' => __( 'Header', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 10, - 'panel' => 'generate_backgrounds_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_header_background_image_shortcuts', - array( - 'section' => 'generate_backgrounds_header', - 'element' => __( 'Header', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_header', - 'colors' => 'header_color_section', - 'typography' => 'font_header_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[header_image]', - array( - 'default' => $defaults['header_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_backgrounds-header-image', - array( - 'section' => 'generate_backgrounds_header', - 'settings' => 'generate_background_settings[header_image]', - 'label' => __( 'Header', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[header_repeat]', - array( - 'default' => $defaults['header_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[header_size]', - array( - 'default' => $defaults['header_size'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[header_attachment]', - array( - 'default' => $defaults['header_attachment'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[header_position]', - array( - 'default' => $defaults['header_position'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_html', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Background_Images_Customize_Control( - $wp_customize, - 'header_backgrounds_control', - array( - 'section' => 'generate_backgrounds_header', - 'settings' => array( - 'repeat' => 'generate_background_settings[header_repeat]', - 'size' => 'generate_background_settings[header_size]', - 'attachment' => 'generate_background_settings[header_attachment]', - 'position' => 'generate_background_settings[header_position]', - ), - ) - ) - ); - - $wp_customize->add_section( - 'generate_backgrounds_navigation', - array( - 'title' => __( 'Primary Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 15, - 'panel' => 'generate_backgrounds_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_primary_navigation_background_image_shortcuts', - array( - 'section' => 'generate_backgrounds_navigation', - 'element' => __( 'Primary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_navigation', - 'colors' => 'navigation_color_section', - 'typography' => 'font_navigation_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - /** - * Navigation background - */ - $wp_customize->add_setting( - 'generate_background_settings[nav_image]', - array( - 'default' => $defaults['nav_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[nav_image]', - array( - 'section' => 'generate_backgrounds_navigation', - 'settings' => 'generate_background_settings[nav_image]', - 'priority' => 750, - 'label' => __( 'Navigation', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[nav_repeat]', - array( - 'default' => $defaults['nav_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_control( - 'generate_background_settings[nav_repeat]', - array( - 'type' => 'select', - 'section' => 'generate_backgrounds_navigation', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_background_settings[nav_repeat]', - 'priority' => 800, - ) - ); - - /** - * Navigation item background - */ - $wp_customize->add_setting( - 'generate_background_settings[nav_item_image]', - array( - 'default' => $defaults['nav_item_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_backgrounds-nav-item-image', - array( - 'section' => 'generate_backgrounds_navigation', - 'settings' => 'generate_background_settings[nav_item_image]', - 'priority' => 950, - 'label' => __( 'Navigation Item', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[nav_item_repeat]', - array( - 'default' => $defaults['nav_item_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_control( - 'generate_background_settings[nav_item_repeat]', - array( - 'type' => 'select', - 'section' => 'generate_backgrounds_navigation', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_background_settings[nav_item_repeat]', - 'priority' => 1000, - ) - ); - - /** - * Navigation item hover background - */ - $wp_customize->add_setting( - 'generate_background_settings[nav_item_hover_image]', - array( - 'default' => $defaults['nav_item_hover_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_backgrounds-nav-item-hover-image', - array( - 'section' => 'generate_backgrounds_navigation', - 'settings' => 'generate_background_settings[nav_item_hover_image]', - 'priority' => 1150, - 'label' => __( 'Navigation Item Hover', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[nav_item_hover_repeat]', - array( - 'default' => $defaults['nav_item_hover_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_control( - 'generate_background_settings[nav_item_hover_repeat]', - array( - 'type' => 'select', - 'section' => 'generate_backgrounds_navigation', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_background_settings[nav_item_hover_repeat]', - 'priority' => 1200, - ) - ); - - /** - * Navigation item current background - */ - $wp_customize->add_setting( - 'generate_background_settings[nav_item_current_image]', - array( - 'default' => $defaults['nav_item_current_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_backgrounds-nav-item-current-image', - array( - 'section' => 'generate_backgrounds_navigation', - 'settings' => 'generate_background_settings[nav_item_current_image]', - 'priority' => 1350, - 'label' => __( 'Navigation Item Current', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[nav_item_current_repeat]', - array( - 'default' => $defaults['nav_item_current_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_control( - 'generate_background_settings[nav_item_current_repeat]', - array( - 'type' => 'select', - 'section' => 'generate_backgrounds_navigation', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_background_settings[nav_item_current_repeat]', - 'priority' => 1400, - ) - ); - - $wp_customize->add_section( - 'generate_backgrounds_subnavigation', - array( - 'title' => __( 'Primary Sub-Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 20, - 'panel' => 'generate_backgrounds_panel', - ) - ); - - /** - * Sub-Navigation item background - */ - $wp_customize->add_setting( - 'generate_background_settings[sub_nav_item_image]', - array( - 'default' => $defaults['sub_nav_item_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[sub_nav_item_image]', - array( - 'section' => 'generate_backgrounds_subnavigation', - 'settings' => 'generate_background_settings[sub_nav_item_image]', - 'priority' => 1700, - 'label' => __( 'Sub-Navigation Item', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sub_nav_item_repeat]', - array( - 'default' => $defaults['sub_nav_item_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_control( - 'generate_background_settings[sub_nav_item_repeat]', - array( - 'type' => 'select', - 'section' => 'generate_backgrounds_subnavigation', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_background_settings[sub_nav_item_repeat]', - 'priority' => 1800, - ) - ); - - /** - * Sub-Navigation item hover background - */ - $wp_customize->add_setting( - 'generate_background_settings[sub_nav_item_hover_image]', - array( - 'default' => $defaults['sub_nav_item_hover_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[sub_nav_item_hover_image]', - array( - 'section' => 'generate_backgrounds_subnavigation', - 'settings' => 'generate_background_settings[sub_nav_item_hover_image]', - 'priority' => 2000, - 'label' => __( 'Sub-Navigation Item Hover', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sub_nav_item_hover_repeat]', - array( - 'default' => $defaults['sub_nav_item_hover_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_control( - 'generate_background_settings[sub_nav_item_hover_repeat]', - array( - 'type' => 'select', - 'section' => 'generate_backgrounds_subnavigation', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_background_settings[sub_nav_item_hover_repeat]', - 'priority' => 2100, - ) - ); - - /** - * Sub-Navigation item current background - */ - $wp_customize->add_setting( - 'generate_background_settings[sub_nav_item_current_image]', - array( - 'default' => $defaults['sub_nav_item_current_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[sub_nav_item_current_image]', - array( - 'section' => 'generate_backgrounds_subnavigation', - 'settings' => 'generate_background_settings[sub_nav_item_current_image]', - 'priority' => 2300, - 'label' => __( 'Sub-Navigation Item Current', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sub_nav_item_current_repeat]', - array( - 'default' => $defaults['sub_nav_item_current_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_control( - 'generate_background_settings[sub_nav_item_current_repeat]', - array( - 'type' => 'select', - 'section' => 'generate_backgrounds_subnavigation', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_background_settings[sub_nav_item_current_repeat]', - 'priority' => 2400, - ) - ); - - $wp_customize->add_section( - 'generate_backgrounds_content', - array( - 'title' => __( 'Content', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 25, - 'panel' => 'generate_backgrounds_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_content_background_image_shortcuts', - array( - 'section' => 'generate_backgrounds_content', - 'element' => __( 'Content', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'content_color_section', - 'typography' => 'font_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - /** - * Content background - */ - $wp_customize->add_setting( - 'generate_background_settings[content_image]', - array( - 'default' => $defaults['content_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[content_image]', - array( - 'section' => 'generate_backgrounds_content', - 'settings' => 'generate_background_settings[content_image]', - 'label' => __( 'Content', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[content_repeat]', - array( - 'default' => $defaults['content_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[content_size]', - array( - 'default' => $defaults['content_size'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[content_attachment]', - array( - 'default' => $defaults['content_attachment'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[content_position]', - array( - 'default' => $defaults['content_position'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_html', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Background_Images_Customize_Control( - $wp_customize, - 'content_backgrounds_control', - array( - 'section' => 'generate_backgrounds_content', - 'settings' => array( - 'repeat' => 'generate_background_settings[content_repeat]', - 'size' => 'generate_background_settings[content_size]', - 'attachment' => 'generate_background_settings[content_attachment]', - 'position' => 'generate_background_settings[content_position]', - ), - ) - ) - ); - - $wp_customize->add_section( - 'generate_backgrounds_sidebars', - array( - 'title' => __( 'Sidebar', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 25, - 'panel' => 'generate_backgrounds_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_sidebar_background_image_shortcuts', - array( - 'section' => 'generate_backgrounds_sidebars', - 'element' => __( 'Sidebar', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_sidebars', - 'colors' => 'sidebar_widget_color_section', - 'typography' => 'font_widget_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sidebar_widget_image]', - array( - 'default' => $defaults['sidebar_widget_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[sidebar_widget_image]', - array( - 'section' => 'generate_backgrounds_sidebars', - 'settings' => 'generate_background_settings[sidebar_widget_image]', - 'label' => __( 'Sidebar Widgets', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sidebar_widget_repeat]', - array( - 'default' => $defaults['sidebar_widget_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sidebar_widget_size]', - array( - 'default' => $defaults['sidebar_widget_size'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sidebar_widget_attachment]', - array( - 'default' => $defaults['sidebar_widget_attachment'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[sidebar_widget_position]', - array( - 'default' => $defaults['sidebar_widget_position'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_html', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Background_Images_Customize_Control( - $wp_customize, - 'sidebar_backgrounds_control', - array( - 'section' => 'generate_backgrounds_sidebars', - 'settings' => array( - 'repeat' => 'generate_background_settings[sidebar_widget_repeat]', - 'size' => 'generate_background_settings[sidebar_widget_size]', - 'attachment' => 'generate_background_settings[sidebar_widget_attachment]', - 'position' => 'generate_background_settings[sidebar_widget_position]', - ), - ) - ) - ); - - $wp_customize->add_section( - 'generate_backgrounds_footer', - array( - 'title' => __( 'Footer', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 30, - 'panel' => 'generate_backgrounds_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_footer_background_image_shortcuts', - array( - 'section' => 'generate_backgrounds_footer', - 'element' => __( 'Footer', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_footer', - 'colors' => 'footer_color_section', - 'typography' => 'font_footer_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_widget_image]', - array( - 'default' => $defaults['footer_widget_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_background_settings[footer_widget_image]', - array( - 'section' => 'generate_backgrounds_footer', - 'settings' => 'generate_background_settings[footer_widget_image]', - 'label' => __( 'Footer Widget Area', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_widget_repeat]', - array( - 'default' => $defaults['footer_widget_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_widget_size]', - array( - 'default' => $defaults['footer_widget_size'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_widget_attachment]', - array( - 'default' => $defaults['footer_widget_attachment'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_widget_position]', - array( - 'default' => $defaults['footer_widget_position'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_html', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Background_Images_Customize_Control( - $wp_customize, - 'footer_widgets_backgrounds_control', - array( - 'section' => 'generate_backgrounds_footer', - 'settings' => array( - 'repeat' => 'generate_background_settings[footer_widget_repeat]', - 'size' => 'generate_background_settings[footer_widget_size]', - 'attachment' => 'generate_background_settings[footer_widget_attachment]', - 'position' => 'generate_background_settings[footer_widget_position]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_image]', - array( - 'default' => $defaults['footer_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_backgrounds-footer-image', - array( - 'section' => 'generate_backgrounds_footer', - 'settings' => 'generate_background_settings[footer_image]', - 'label' => __( 'Footer Area', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_repeat]', - array( - 'default' => $defaults['footer_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_size]', - array( - 'default' => $defaults['footer_size'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_attachment]', - array( - 'default' => $defaults['footer_attachment'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - ) - ); - - $wp_customize->add_setting( - 'generate_background_settings[footer_position]', - array( - 'default' => $defaults['footer_position'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_html', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Background_Images_Customize_Control( - $wp_customize, - 'footer_backgrounds_control', - array( - 'section' => 'generate_backgrounds_footer', - 'settings' => array( - 'repeat' => 'generate_background_settings[footer_repeat]', - 'size' => 'generate_background_settings[footer_size]', - 'attachment' => 'generate_background_settings[footer_attachment]', - 'position' => 'generate_background_settings[footer_position]', - ), - ) - ) - ); - } -} - -if ( ! function_exists( 'generate_backgrounds_css' ) ) { - /** - * Generate the CSS in the section using the Theme Customizer - * - * @since 0.1 - */ - function generate_backgrounds_css() { - $generate_settings = wp_parse_args( - get_option( 'generate_background_settings', array() ), - generate_get_background_defaults() - ); - - // Fix size values. - // Spaces and % are stripped by sanitize_key. - $generate_settings['body_size'] = ( '100' == $generate_settings['body_size'] ) ? '100% auto' : esc_attr( $generate_settings['body_size'] ); // phpcs:ignore -- Non-strict comparison ok. - $generate_settings['top_bar_size'] = ( '100' == $generate_settings['top_bar_size'] ) ? '100% auto' : esc_attr( $generate_settings['top_bar_size'] ); // phpcs:ignore -- Non-strict comparison ok. - $generate_settings['header_size'] = ( '100' == $generate_settings['header_size'] ) ? '100% auto' : esc_attr( $generate_settings['header_size'] ); // phpcs:ignore -- Non-strict comparison ok. - $generate_settings['content_size'] = ( '100' == $generate_settings['content_size'] ) ? '100% auto' : esc_attr( $generate_settings['content_size'] ); // phpcs:ignore -- Non-strict comparison ok. - $generate_settings['sidebar_widget_size'] = ( '100' == $generate_settings['sidebar_widget_size'] ) ? '100% auto' : esc_attr( $generate_settings['sidebar_widget_size'] ); // phpcs:ignore -- Non-strict comparison ok. - $generate_settings['footer_widget_size'] = ( '100' == $generate_settings['footer_widget_size'] ) ? '100% auto' : esc_attr( $generate_settings['footer_widget_size'] ); // phpcs:ignore -- Non-strict comparison ok. - $generate_settings['footer_size'] = ( '100' == $generate_settings['footer_size'] ) ? '100% auto' : esc_attr( $generate_settings['footer_size'] ); // phpcs:ignore -- Non-strict comparison ok. - - $css = new GeneratePress_Backgrounds_CSS(); - - $css->set_selector( 'body' ); - $css->add_property( 'background-image', esc_url( $generate_settings['body_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['body_repeat'] ) ); - $css->add_property( 'background-size', esc_attr( $generate_settings['body_size'] ) ); - $css->add_property( 'background-attachment', esc_attr( $generate_settings['body_attachment'] ) ); - $css->add_property( 'background-position', esc_attr( $generate_settings['body_position'] ) ); - - if ( is_active_sidebar( 'top-bar' ) ) { - $css->set_selector( '.top-bar' ); - $css->add_property( 'background-image', esc_url( $generate_settings['top_bar_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['top_bar_repeat'] ) ); - $css->add_property( 'background-size', esc_attr( $generate_settings['top_bar_size'] ) ); - $css->add_property( 'background-attachment', esc_attr( $generate_settings['top_bar_attachment'] ) ); - $css->add_property( 'background-position', esc_attr( $generate_settings['top_bar_position'] ) ); - } - - $css->set_selector( '.site-header' ); - $css->add_property( 'background-image', esc_url( $generate_settings['header_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['header_repeat'] ) ); - $css->add_property( 'background-size', esc_attr( $generate_settings['header_size'] ) ); - $css->add_property( 'background-attachment', esc_attr( $generate_settings['header_attachment'] ) ); - $css->add_property( 'background-position', esc_attr( $generate_settings['header_position'] ) ); - - $css->set_selector( '.main-navigation, .main-navigation .menu-toggle' ); - $css->add_property( 'background-image', esc_url( $generate_settings['nav_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_repeat'] ) ); - - $css->set_selector( '.main-navigation .main-nav > ul > li > a' ); - $css->add_property( 'background-image', esc_url( $generate_settings['nav_item_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_repeat'] ) ); - - $css->set_selector( '.main-navigation .main-nav > ul > li > a:hover,.main-navigation .main-nav > ul > li.sfHover > a' ); - $css->add_property( 'background-image', esc_url( $generate_settings['nav_item_hover_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_hover_repeat'] ) ); - - $css->set_selector( '.main-navigation .main-nav > ul > li[class*="current-menu-"] > a,.main-navigation .main-nav > ul > li[class*="current-menu-"] > a:hover,.main-navigation .main-nav > ul > li[class*="current-menu-"].sfHover > a' ); - $css->add_property( 'background-image', esc_url( $generate_settings['nav_item_current_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_current_repeat'] ) ); - - $css->set_selector( '.main-navigation ul ul li a' ); - $css->add_property( 'background-image', esc_url( $generate_settings['sub_nav_item_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_repeat'] ) ); - - $css->set_selector( '.main-navigation ul ul li > a:hover,.main-navigation ul ul li.sfHover > a' ); - $css->add_property( 'background-image', esc_url( $generate_settings['sub_nav_item_hover_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_hover_repeat'] ) ); - - $css->set_selector( '.main-navigation ul ul li[class*="current-menu-"] > a,.main-navigation ul ul li[class*="current-menu-"] > a:hover,.main-navigation ul ul li[class*="current-menu-"].sfHover > a' ); - $css->add_property( 'background-image', esc_url( $generate_settings['sub_nav_item_current_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_current_repeat'] ) ); - - $css->set_selector( '.separate-containers .inside-article,.separate-containers .comments-area,.separate-containers .page-header,.one-container .container,.separate-containers .paging-navigation,.separate-containers .inside-page-header' ); - $css->add_property( 'background-image', esc_url( $generate_settings['content_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['content_repeat'] ) ); - $css->add_property( 'background-size', esc_attr( $generate_settings['content_size'] ) ); - $css->add_property( 'background-attachment', esc_attr( $generate_settings['content_attachment'] ) ); - $css->add_property( 'background-position', esc_attr( $generate_settings['content_position'] ) ); - - $css->set_selector( '.sidebar .widget' ); - $css->add_property( 'background-image', esc_url( $generate_settings['sidebar_widget_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['sidebar_widget_repeat'] ) ); - $css->add_property( 'background-size', esc_attr( $generate_settings['sidebar_widget_size'] ) ); - $css->add_property( 'background-attachment', esc_attr( $generate_settings['sidebar_widget_attachment'] ) ); - $css->add_property( 'background-position', esc_attr( $generate_settings['sidebar_widget_position'] ) ); - - $css->set_selector( '.footer-widgets' ); - $css->add_property( 'background-image', esc_url( $generate_settings['footer_widget_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['footer_widget_repeat'] ) ); - $css->add_property( 'background-size', esc_attr( $generate_settings['footer_widget_size'] ) ); - $css->add_property( 'background-attachment', esc_attr( $generate_settings['footer_widget_attachment'] ) ); - $css->add_property( 'background-position', esc_attr( $generate_settings['footer_widget_position'] ) ); - - $css->set_selector( '.site-info' ); - $css->add_property( 'background-image', esc_url( $generate_settings['footer_image'] ), 'url' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['footer_repeat'] ) ); - $css->add_property( 'background-size', esc_attr( $generate_settings['footer_size'] ) ); - $css->add_property( 'background-attachment', esc_attr( $generate_settings['footer_attachment'] ) ); - $css->add_property( 'background-position', esc_attr( $generate_settings['footer_position'] ) ); - - return apply_filters( 'generate_backgrounds_css_output', $css->css_output() ); - } -} - -if ( ! function_exists( 'generate_background_scripts' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_background_scripts', 70 ); - /** - * Enqueue scripts and styles. - * - * @since 0.1 - */ - function generate_background_scripts() { - if ( 'inline' === generate_get_css_print_method() ) { - wp_add_inline_style( 'generate-style', generate_backgrounds_css() ); - } - } -} - -add_filter( 'generate_external_dynamic_css_output', 'generate_backgrounds_add_external_css' ); -/** - * Add to external stylesheet. - * - * @since 1.11.0 - * - * @param string $css Existing CSS. - */ -function generate_backgrounds_add_external_css( $css ) { - if ( 'inline' === generate_get_css_print_method() ) { - return $css; - } - - $css .= generate_backgrounds_css(); - - return $css; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/secondary-nav-backgrounds.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/secondary-nav-backgrounds.php deleted file mode 100644 index fdc17f1d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/functions/secondary-nav-backgrounds.php +++ /dev/null @@ -1,420 +0,0 @@ -get_section( 'secondary_nav_section' ) ) { - return; - } - - $defaults = generate_secondary_nav_get_defaults(); - - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - $wp_customize->add_section( - 'secondary_bg_images_section', - array( - 'title' => __( 'Secondary Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'panel' => 'generate_backgrounds_panel', - 'priority' => 21, - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_secondary_navigation_background_image_shortcuts', - array( - 'section' => 'secondary_bg_images_section', - 'element' => __( 'Secondary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'secondary_nav_section', - 'colors' => 'secondary_navigation_color_section', - 'typography' => 'secondary_font_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_image]', - array( - 'default' => $defaults['nav_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_secondary_backgrounds-nav-image', - array( - 'section' => 'secondary_bg_images_section', - 'settings' => 'generate_secondary_nav_settings[nav_image]', - 'priority' => 750, - 'label' => __( 'Navigation', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_repeat]', - array( - 'default' => $defaults['nav_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[nav_repeat]', - array( - 'type' => 'select', - 'section' => 'secondary_bg_images_section', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[nav_repeat]', - 'priority' => 800, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_item_image]', - array( - 'default' => $defaults['nav_item_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_secondary_backgrounds-nav-item-image', - array( - 'section' => 'secondary_bg_images_section', - 'settings' => 'generate_secondary_nav_settings[nav_item_image]', - 'priority' => 950, - 'label' => __( 'Navigation Item', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_item_repeat]', - array( - 'default' => $defaults['nav_item_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[nav_item_repeat]', - array( - 'type' => 'select', - 'section' => 'secondary_bg_images_section', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[nav_item_repeat]', - 'priority' => 1000, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_item_hover_image]', - array( - 'default' => $defaults['nav_item_hover_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_secondary_backgrounds-nav-item-hover-image', - array( - 'section' => 'secondary_bg_images_section', - 'settings' => 'generate_secondary_nav_settings[nav_item_hover_image]', - 'priority' => 1150, - 'label' => __( 'Navigation Item Hover', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_item_hover_repeat]', - array( - 'default' => $defaults['nav_item_hover_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[nav_item_hover_repeat]', - array( - 'type' => 'select', - 'section' => 'secondary_bg_images_section', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[nav_item_hover_repeat]', - 'priority' => 1200, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_item_current_image]', - array( - 'default' => $defaults['nav_item_current_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_secondary_backgrounds-nav-item-current-image', - array( - 'section' => 'secondary_bg_images_section', - 'settings' => 'generate_secondary_nav_settings[nav_item_current_image]', - 'priority' => 1350, - 'label' => __( 'Navigation Item Current', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[nav_item_current_repeat]', - array( - 'default' => $defaults['nav_item_current_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[nav_item_current_repeat]', - array( - 'type' => 'select', - 'section' => 'secondary_bg_images_section', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[nav_item_current_repeat]', - 'priority' => 1400, - ) - ); - - $wp_customize->add_section( - 'secondary_subnav_bg_images_section', - array( - 'title' => __( 'Secondary Sub-Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'panel' => 'generate_backgrounds_panel', - 'priority' => 22, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[sub_nav_item_image]', - array( - 'default' => $defaults['sub_nav_item_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_secondary_backgrounds-sub-nav-item-image', - array( - 'section' => 'secondary_subnav_bg_images_section', - 'settings' => 'generate_secondary_nav_settings[sub_nav_item_image]', - 'priority' => 1700, - 'label' => __( 'Sub-Navigation Item', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[sub_nav_item_repeat]', - array( - 'default' => $defaults['sub_nav_item_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[sub_nav_item_repeat]', - array( - 'type' => 'select', - 'section' => 'secondary_subnav_bg_images_section', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[sub_nav_item_repeat]', - 'priority' => 1800, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[sub_nav_item_hover_image]', - array( - 'default' => $defaults['sub_nav_item_hover_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_secondary_backgrounds-sub-nav-item-hover-image', - array( - 'section' => 'secondary_subnav_bg_images_section', - 'settings' => 'generate_secondary_nav_settings[sub_nav_item_hover_image]', - 'priority' => 2000, - 'label' => __( 'Sub-Navigation Item Hover', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[sub_nav_item_hover_repeat]', - array( - 'default' => $defaults['sub_nav_item_hover_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[sub_nav_item_hover_repeat]', - array( - 'type' => 'select', - 'section' => 'secondary_subnav_bg_images_section', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[sub_nav_item_hover_repeat]', - 'priority' => 2100, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[sub_nav_item_current_image]', - array( - 'default' => $defaults['sub_nav_item_current_image'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'esc_url_raw', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Image_Control( - $wp_customize, - 'generate_secondary_backgrounds-sub-nav-item-current-image', - array( - 'section' => 'secondary_subnav_bg_images_section', - 'settings' => 'generate_secondary_nav_settings[sub_nav_item_current_image]', - 'priority' => 2300, - 'label' => __( 'Sub-Navigation Item Current', 'gp-premium' ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[sub_nav_item_current_repeat]', - array( - 'default' => $defaults['sub_nav_item_current_repeat'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[sub_nav_item_current_repeat]', - array( - 'type' => 'select', - 'section' => 'secondary_subnav_bg_images_section', - 'choices' => array( - '' => __( 'Repeat', 'gp-premium' ), - 'repeat-x' => __( 'Repeat x', 'gp-premium' ), - 'repeat-y' => __( 'Repeat y', 'gp-premium' ), - 'no-repeat' => __( 'No Repeat', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[sub_nav_item_current_repeat]', - 'priority' => 2400, - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/generate-backgrounds.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/generate-backgrounds.php deleted file mode 100644 index d9cd1055..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/backgrounds/generate-backgrounds.php +++ /dev/null @@ -1,19 +0,0 @@ -post_count ) { - $columns = false; - } - } - - // Return the result. - return apply_filters( 'generate_blog_columns', $columns ); - } -} - -if ( ! function_exists( 'generate_blog_get_masonry' ) ) { - /** - * Check if masonry is enabled. - * This function is a mess with strings as bools etc.. Will re-write in a big upate to get lots of testing. - */ - function generate_blog_get_masonry() { - $generate_blog_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - // If masonry is enabled via option or filter, enable it. - // phpcs:ignore -- non-strict comparison allowed. - if ( $generate_blog_settings['masonry'] || 'true' == apply_filters( 'generate_blog_masonry', 'false' ) ) { - $masonry = 'true'; - } else { - $masonry = 'false'; - } - - // Allow masonry to be turned off using a boolean. - if ( false === apply_filters( 'generate_blog_masonry', 'false' ) ) { - $masonry = 'false'; - } - - return $masonry; - } -} - -if ( ! function_exists( 'generate_blog_add_columns_container' ) ) { - add_action( 'generate_before_main_content', 'generate_blog_add_columns_container' ); - /** - * Add columns container - * - * @since 1.0 - */ - function generate_blog_add_columns_container() { - if ( ! generate_blog_get_columns() ) { - return; - } - - $columns = generate_blog_get_column_count(); - - printf( - '
%2$s', - 'false' !== generate_blog_get_masonry() ? 'masonry-container are-images-unloaded' : '', - 'false' !== generate_blog_get_masonry() ? '
' : '' // phpcs:ignore -- no escaping needed. - ); - } -} - -if ( ! function_exists( 'generate_blog_add_ending_columns_container' ) ) { - add_action( 'generate_after_main_content', 'generate_blog_add_ending_columns_container' ); - /** - * Add closing columns container - * - * @since 1.0 - */ - function generate_blog_add_ending_columns_container() { - if ( ! generate_blog_get_columns() ) { - return; - } - - echo '
'; - } -} - -if ( ! function_exists( 'generate_blog_columns_css' ) ) { - /** - * Add inline CSS - */ - function generate_blog_columns_css() { - $generate_blog_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( function_exists( 'generate_spacing_get_defaults' ) ) { - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - } - - $separator = ( function_exists( 'generate_spacing_get_defaults' ) ) ? absint( $spacing_settings['separator'] ) : 20; - - $return = ''; - if ( generate_blog_get_columns() ) { - $return .= '.generate-columns {margin-bottom: ' . $separator . 'px;padding-left: ' . $separator . 'px;}'; - $return .= '.generate-columns-container {margin-left: -' . $separator . 'px;}'; - $return .= '.page-header {margin-bottom: ' . $separator . 'px;margin-left: ' . $separator . 'px}'; - $return .= '.generate-columns-container > .paging-navigation {margin-left: ' . $separator . 'px;}'; - } - - return $return; - } -} - -if ( ! function_exists( 'generate_blog_get_column_count' ) ) { - /** - * Get our column grid class - */ - function generate_blog_get_column_count() { - $generate_blog_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - $count = $generate_blog_settings['columns']; - - return apply_filters( 'generate_blog_get_column_count', $count ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/columns.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/columns.css deleted file mode 100644 index 1066ab1f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/columns.css +++ /dev/null @@ -1,149 +0,0 @@ -.masonry-enabled .page-header { - position: relative !important; -} - -.separate-containers .site-main > .generate-columns-container { - margin-bottom: 0; -} - -.masonry-container.are-images-unloaded, -.load-more.are-images-unloaded, -.masonry-enabled #nav-below { - opacity: 0; -} - -/* columns */ -.generate-columns-container:not(.masonry-container) { - display: flex; - flex-wrap: wrap; - align-items: stretch; -} - -.generate-columns .inside-article { - height: 100%; - box-sizing: border-box; -} - -.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image, -.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image { - float: none; - text-align: center; - margin-left: 0; - margin-right: 0; -} - -.generate-columns-container .paging-navigation, -.generate-columns-container .page-header { - flex: 1 1 100%; - clear: both; -} - -.generate-columns-container .paging-navigation { - margin-bottom: 0; -} - -.load-more:not(.has-svg-icon) .button.loading:before { - content: "\e900"; - display: inline-block; - font-family: "GP Premium"; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - animation: spin 2s infinite linear; - margin-right: 7px; -} - -.load-more .button:not(.loading) .gp-icon { - display: none; -} - -.load-more .gp-icon svg { - animation: spin 2s infinite linear; - margin-right: 7px; -} - -@keyframes spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -} - -.generate-columns { - box-sizing: border-box; -} - -.generate-columns.grid-20, -.grid-sizer.grid-20 { - width: 20%; -} - -.generate-columns.grid-25, -.grid-sizer.grid-25 { - width: 25%; -} - -.generate-columns.grid-33, -.grid-sizer.grid-33 { - width: 33.3333%; -} - -.generate-columns.grid-50, -.grid-sizer.grid-50 { - width: 50%; -} - -.generate-columns.grid-60, -.grid-sizer.grid-60 { - width: 60%; -} - -.generate-columns.grid-66, -.grid-sizer.grid-66 { - width: 66.66667%; -} - -.generate-columns.grid-100, -.grid-sizer.grid-100 { - width: 100%; -} - -@media (min-width: 768px) and (max-width: 1024px) { - .generate-columns.tablet-grid-50, - .grid-sizer.tablet-grid-50 { - width: 50%; - } -} - -@media (max-width: 767px) { - .generate-columns-activated .generate-columns-container { - margin-left: 0; - margin-right: 0; - } - .generate-columns-container > *, - .generate-columns-container .generate-columns { - padding-left: 0; - } - .generate-columns-container .page-header { - margin-left: 0; - } - .generate-columns.mobile-grid-100, - .grid-sizer.mobile-grid-100 { - width: 100%; - } - .generate-columns-container > .paging-navigation { - margin-left: 0; - } -} - -@media (max-width: 768px) { - .load-more { - display: block; - text-align: center; - margin-bottom: 0; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/columns.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/columns.min.css deleted file mode 100644 index 3814f76b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/columns.min.css +++ /dev/null @@ -1 +0,0 @@ -.masonry-enabled .page-header{position:relative!important}.separate-containers .site-main>.generate-columns-container{margin-bottom:0}.load-more.are-images-unloaded,.masonry-container.are-images-unloaded,.masonry-enabled #nav-below{opacity:0}.generate-columns-container:not(.masonry-container){display:flex;flex-wrap:wrap;align-items:stretch}.generate-columns .inside-article{height:100%;box-sizing:border-box}.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image{float:none;text-align:center;margin-left:0;margin-right:0}.generate-columns-container .page-header,.generate-columns-container .paging-navigation{flex:1 1 100%;clear:both}.generate-columns-container .paging-navigation{margin-bottom:0}.load-more:not(.has-svg-icon) .button.loading:before{content:"\e900";display:inline-block;font-family:"GP Premium";font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;animation:spin 2s infinite linear;margin-right:7px}.load-more .button:not(.loading) .gp-icon{display:none}.load-more .gp-icon svg{animation:spin 2s infinite linear;margin-right:7px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.generate-columns{box-sizing:border-box}.generate-columns.grid-20,.grid-sizer.grid-20{width:20%}.generate-columns.grid-25,.grid-sizer.grid-25{width:25%}.generate-columns.grid-33,.grid-sizer.grid-33{width:33.3333%}.generate-columns.grid-50,.grid-sizer.grid-50{width:50%}.generate-columns.grid-60,.grid-sizer.grid-60{width:60%}.generate-columns.grid-66,.grid-sizer.grid-66{width:66.66667%}.generate-columns.grid-100,.grid-sizer.grid-100{width:100%}@media (min-width:768px) and (max-width:1024px){.generate-columns.tablet-grid-50,.grid-sizer.tablet-grid-50{width:50%}}@media (max-width:767px){.generate-columns-activated .generate-columns-container{margin-left:0;margin-right:0}.generate-columns-container .generate-columns,.generate-columns-container>*{padding-left:0}.generate-columns-container .page-header{margin-left:0}.generate-columns.mobile-grid-100,.grid-sizer.mobile-grid-100{width:100%}.generate-columns-container>.paging-navigation{margin-left:0}}@media (max-width:768px){.load-more{display:block;text-align:center;margin-bottom:0}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/featured-images.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/featured-images.css deleted file mode 100644 index c3efa57f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/featured-images.css +++ /dev/null @@ -1,104 +0,0 @@ -.post-image-above-header .inside-article .post-image, -.post-image-above-header .inside-article .featured-image { - margin-top: 0; - margin-bottom: 2em; -} - -.post-image-aligned-left .inside-article .post-image, -.post-image-aligned-left .inside-article .featured-image { - margin-top: 0; - margin-right: 2em; - float: left; - text-align: left; -} - -.post-image-aligned-center .post-image, -.post-image-aligned-center .featured-image { - text-align: center; -} - -.post-image-aligned-right .inside-article .post-image, -.post-image-aligned-right .inside-article .featured-image { - margin-top: 0; - margin-left: 2em; - float: right; - text-align: right; -} - -.post-image-below-header.post-image-aligned-right .inside-article .post-image, -.post-image-below-header.post-image-aligned-right .inside-article .featured-image, -.post-image-below-header.post-image-aligned-center .inside-article .featured-image, -.post-image-below-header.post-image-aligned-left .inside-article .post-image, -.post-image-below-header.post-image-aligned-left .inside-article .featured-image { - margin-top: 2em; -} - -.post-image-aligned-left > .featured-image, -.post-image-aligned-right > .featured-image { - float: none; - margin-left: auto; - margin-right: auto; -} - -.post-image-aligned-left .featured-image { - text-align: left; -} - -.post-image-aligned-right .featured-image { - text-align: right; -} - -.post-image-aligned-left .inside-article:before, -.post-image-aligned-left .inside-article:after, -.post-image-aligned-right .inside-article:before, -.post-image-aligned-right .inside-article:after { - content: ""; - display: table; -} - -.post-image-aligned-left .inside-article:after, -.post-image-aligned-right .inside-article:after { - clear: both; -} - -.one-container.post-image-above-header .page-header + .no-featured-image-padding .inside-article .post-image, -.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image { - margin-top: 0; -} - -.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image, -.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image { - margin-right: 0; -} - -.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image, -.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image { - margin-left: 0; -} - -.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image { - margin-left: 0; - margin-right: 0; -} - -.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image, -.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image { - margin-left: 0; - margin-right: 0; -} - -@media (max-width: 768px) { - body:not(.post-image-aligned-center) .inside-article .post-image, - body:not(.post-image-aligned-center) .featured-image, - body:not(.post-image-aligned-center) .inside-article .featured-image { - margin-right: 0; - margin-left: 0; - float: none; - text-align: center; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/featured-images.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/featured-images.min.css deleted file mode 100644 index ba2493d8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/featured-images.min.css +++ /dev/null @@ -1 +0,0 @@ -.post-image-above-header .inside-article .featured-image,.post-image-above-header .inside-article .post-image{margin-top:0;margin-bottom:2em}.post-image-aligned-left .inside-article .featured-image,.post-image-aligned-left .inside-article .post-image{margin-top:0;margin-right:2em;float:left;text-align:left}.post-image-aligned-center .featured-image,.post-image-aligned-center .post-image{text-align:center}.post-image-aligned-right .inside-article .featured-image,.post-image-aligned-right .inside-article .post-image{margin-top:0;margin-left:2em;float:right;text-align:right}.post-image-below-header.post-image-aligned-center .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .post-image,.post-image-below-header.post-image-aligned-right .inside-article .featured-image,.post-image-below-header.post-image-aligned-right .inside-article .post-image{margin-top:2em}.post-image-aligned-left>.featured-image,.post-image-aligned-right>.featured-image{float:none;margin-left:auto;margin-right:auto}.post-image-aligned-left .featured-image{text-align:left}.post-image-aligned-right .featured-image{text-align:right}.post-image-aligned-left .inside-article:after,.post-image-aligned-left .inside-article:before,.post-image-aligned-right .inside-article:after,.post-image-aligned-right .inside-article:before{content:"";display:table}.post-image-aligned-left .inside-article:after,.post-image-aligned-right .inside-article:after{clear:both}.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image,.one-container.post-image-above-header .page-header+.no-featured-image-padding .inside-article .post-image{margin-top:0}.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-right:0}.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0}.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0;margin-right:0}.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image,.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image{margin-left:0;margin-right:0}@media (max-width:768px){body:not(.post-image-aligned-center) .featured-image,body:not(.post-image-aligned-center) .inside-article .featured-image,body:not(.post-image-aligned-center) .inside-article .post-image{margin-right:0;margin-left:0;float:none;text-align:center}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/style.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/style.css deleted file mode 100644 index e79ddd50..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/style.css +++ /dev/null @@ -1,254 +0,0 @@ -.post-image-above-header .inside-article .post-image, -.post-image-above-header .inside-article .featured-image { - margin-top: 0; - margin-bottom: 2em; -} - -.post-image-aligned-left .inside-article .post-image, -.post-image-aligned-left .inside-article .featured-image { - margin-top: 0; - margin-right: 2em; - float: left; - text-align: left; -} - -.post-image-aligned-center .post-image, -.post-image-aligned-center .featured-image { - text-align: center; -} - -.post-image-aligned-right .inside-article .post-image, -.post-image-aligned-right .inside-article .featured-image { - margin-top: 0; - margin-left: 2em; - float: right; - text-align: right; -} - -.post-image-below-header.post-image-aligned-right .inside-article .post-image, -.post-image-below-header.post-image-aligned-right .inside-article .featured-image, -.post-image-below-header.post-image-aligned-center .inside-article .featured-image, -.post-image-below-header.post-image-aligned-left .inside-article .post-image, -.post-image-below-header.post-image-aligned-left .inside-article .featured-image { - margin-top: 2em; -} - -.post-image-aligned-left > .featured-image, -.post-image-aligned-right > .featured-image { - float: none; - margin-left: auto; - margin-right: auto; -} - -.post-image-aligned-left .featured-image { - text-align: left; -} - -.post-image-aligned-right .featured-image { - text-align: right; -} - -.post-image-aligned-left .inside-article:before, -.post-image-aligned-left .inside-article:after, -.post-image-aligned-right .inside-article:before, -.post-image-aligned-right .inside-article:after { - content: ""; - display: table; -} - -.post-image-aligned-left .inside-article:after, -.post-image-aligned-right .inside-article:after { - clear: both; -} - -.one-container.post-image-above-header .page-header + .no-featured-image-padding .inside-article .post-image, -.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image { - margin-top: 0; -} - -.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image, -.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image { - margin-right: 0; -} - -.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image, -.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image { - margin-left: 0; -} - -.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image, -.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image { - margin-left: 0; - margin-right: 0; -} - -.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image, -.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image { - margin-left: 0; - margin-right: 0; -} - -@media (max-width: 768px) { - body:not(.post-image-aligned-center) .inside-article .post-image, - body:not(.post-image-aligned-center) .featured-image, - body:not(.post-image-aligned-center) .inside-article .featured-image { - margin-right: 0; - margin-left: 0; - float: none; - text-align: center; - } -} - -.masonry-enabled .page-header { - position: relative !important; -} - -.separate-containers .site-main > .generate-columns-container { - margin-bottom: 0; -} - -.masonry-container.are-images-unloaded, -.load-more.are-images-unloaded, -.masonry-enabled #nav-below { - opacity: 0; -} - -/* columns */ -.generate-columns-container:not(.masonry-container) { - display: flex; - flex-wrap: wrap; - align-items: stretch; -} - -.generate-columns .inside-article { - height: 100%; - box-sizing: border-box; -} - -.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image, -.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image { - float: none; - text-align: center; - margin-left: 0; - margin-right: 0; -} - -.generate-columns-container .paging-navigation, -.generate-columns-container .page-header { - flex: 1 1 100%; - clear: both; -} - -.generate-columns-container .paging-navigation { - margin-bottom: 0; -} - -.load-more:not(.has-svg-icon) .button.loading:before { - content: "\e900"; - display: inline-block; - font-family: "GP Premium"; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - animation: spin 2s infinite linear; - margin-right: 7px; -} - -.load-more .button:not(.loading) .gp-icon { - display: none; -} - -.load-more .gp-icon svg { - animation: spin 2s infinite linear; - margin-right: 7px; -} - -@keyframes spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -} - -.generate-columns { - box-sizing: border-box; -} - -.generate-columns.grid-20, -.grid-sizer.grid-20 { - width: 20%; -} - -.generate-columns.grid-25, -.grid-sizer.grid-25 { - width: 25%; -} - -.generate-columns.grid-33, -.grid-sizer.grid-33 { - width: 33.3333%; -} - -.generate-columns.grid-50, -.grid-sizer.grid-50 { - width: 50%; -} - -.generate-columns.grid-60, -.grid-sizer.grid-60 { - width: 60%; -} - -.generate-columns.grid-66, -.grid-sizer.grid-66 { - width: 66.66667%; -} - -.generate-columns.grid-100, -.grid-sizer.grid-100 { - width: 100%; -} - -@media (min-width: 768px) and (max-width: 1024px) { - .generate-columns.tablet-grid-50, - .grid-sizer.tablet-grid-50 { - width: 50%; - } -} - -@media (max-width: 767px) { - .generate-columns-activated .generate-columns-container { - margin-left: 0; - margin-right: 0; - } - .generate-columns-container > *, - .generate-columns-container .generate-columns { - padding-left: 0; - } - .generate-columns-container .page-header { - margin-left: 0; - } - .generate-columns.mobile-grid-100, - .grid-sizer.mobile-grid-100 { - width: 100%; - } - .generate-columns-container > .paging-navigation { - margin-left: 0; - } -} - -@media (max-width: 768px) { - .load-more { - display: block; - text-align: center; - margin-bottom: 0; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/style.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/style.min.css deleted file mode 100644 index 6f877184..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/css/style.min.css +++ /dev/null @@ -1 +0,0 @@ -.post-image-above-header .inside-article .featured-image,.post-image-above-header .inside-article .post-image{margin-top:0;margin-bottom:2em}.post-image-aligned-left .inside-article .featured-image,.post-image-aligned-left .inside-article .post-image{margin-top:0;margin-right:2em;float:left;text-align:left}.post-image-aligned-center .featured-image,.post-image-aligned-center .post-image{text-align:center}.post-image-aligned-right .inside-article .featured-image,.post-image-aligned-right .inside-article .post-image{margin-top:0;margin-left:2em;float:right;text-align:right}.post-image-below-header.post-image-aligned-center .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .post-image,.post-image-below-header.post-image-aligned-right .inside-article .featured-image,.post-image-below-header.post-image-aligned-right .inside-article .post-image{margin-top:2em}.post-image-aligned-left>.featured-image,.post-image-aligned-right>.featured-image{float:none;margin-left:auto;margin-right:auto}.post-image-aligned-left .featured-image{text-align:left}.post-image-aligned-right .featured-image{text-align:right}.post-image-aligned-left .inside-article:after,.post-image-aligned-left .inside-article:before,.post-image-aligned-right .inside-article:after,.post-image-aligned-right .inside-article:before{content:"";display:table}.post-image-aligned-left .inside-article:after,.post-image-aligned-right .inside-article:after{clear:both}.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image,.one-container.post-image-above-header .page-header+.no-featured-image-padding .inside-article .post-image{margin-top:0}.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-right:0}.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0}.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0;margin-right:0}.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image,.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image{margin-left:0;margin-right:0}@media (max-width:768px){body:not(.post-image-aligned-center) .featured-image,body:not(.post-image-aligned-center) .inside-article .featured-image,body:not(.post-image-aligned-center) .inside-article .post-image{margin-right:0;margin-left:0;float:none;text-align:center}}.masonry-enabled .page-header{position:relative!important}.separate-containers .site-main>.generate-columns-container{margin-bottom:0}.load-more.are-images-unloaded,.masonry-container.are-images-unloaded,.masonry-enabled #nav-below{opacity:0}.generate-columns-container:not(.masonry-container){display:flex;flex-wrap:wrap;align-items:stretch}.generate-columns .inside-article{height:100%;box-sizing:border-box}.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image{float:none;text-align:center;margin-left:0;margin-right:0}.generate-columns-container .page-header,.generate-columns-container .paging-navigation{flex:1 1 100%;clear:both}.generate-columns-container .paging-navigation{margin-bottom:0}.load-more:not(.has-svg-icon) .button.loading:before{content:"\e900";display:inline-block;font-family:"GP Premium";font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;animation:spin 2s infinite linear;margin-right:7px}.load-more .button:not(.loading) .gp-icon{display:none}.load-more .gp-icon svg{animation:spin 2s infinite linear;margin-right:7px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.generate-columns{box-sizing:border-box}.generate-columns.grid-20,.grid-sizer.grid-20{width:20%}.generate-columns.grid-25,.grid-sizer.grid-25{width:25%}.generate-columns.grid-33,.grid-sizer.grid-33{width:33.3333%}.generate-columns.grid-50,.grid-sizer.grid-50{width:50%}.generate-columns.grid-60,.grid-sizer.grid-60{width:60%}.generate-columns.grid-66,.grid-sizer.grid-66{width:66.66667%}.generate-columns.grid-100,.grid-sizer.grid-100{width:100%}@media (min-width:768px) and (max-width:1024px){.generate-columns.tablet-grid-50,.grid-sizer.tablet-grid-50{width:50%}}@media (max-width:767px){.generate-columns-activated .generate-columns-container{margin-left:0;margin-right:0}.generate-columns-container .generate-columns,.generate-columns-container>*{padding-left:0}.generate-columns-container .page-header{margin-left:0}.generate-columns.mobile-grid-100,.grid-sizer.mobile-grid-100{width:100%}.generate-columns-container>.paging-navigation{margin-left:0}}@media (max-width:768px){.load-more{display:block;text-align:center;margin-bottom:0}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/customizer.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/customizer.php deleted file mode 100644 index 2c018ea8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/customizer.php +++ /dev/null @@ -1,1181 +0,0 @@ -register_control_type( 'GeneratePress_Title_Customize_Control' ); - } - - // Remove our blog control from the free theme. - if ( $wp_customize->get_control( 'blog_content_control' ) ) { - $wp_customize->remove_control( 'blog_content_control' ); - } - - // Register our custom controls. - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Refresh_Button_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Information_Customize_Control' ); - $wp_customize->register_control_type( 'Generate_Control_Toggle_Customize_Control' ); - } - - $wp_customize->add_section( - 'generate_blog_loop_template_section', - array( - 'title' => __( 'Blog', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'panel' => 'generate_layout_panel', - 'priority' => 40, - 'active_callback' => function() { - return generate_has_active_element( 'loop-template', true ); - }, - ) - ); - - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_using_loop_template', - array( - 'section' => 'generate_blog_loop_template_section', - 'description' => sprintf( - /* translators: URL to the Elements dashboard. */ - __( 'This page is using a Loop Template Element. Other options can be found within that Element.', 'gp-premium' ), - admin_url( 'edit.php?post_type=gp_elements' ) - ), - 'notice' => true, - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => function() { - return generate_has_active_element( 'loop-template', true ); - }, - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[excerpt_length]', array( - 'default' => $defaults['excerpt_length'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'absint', - ) - ); - - $wp_customize->add_control( - 'generate_loop_template_excerpt_length', - array( - 'type' => 'number', - 'label' => __( 'Excerpt word count', 'gp-premium' ), - 'section' => 'generate_blog_loop_template_section', - 'settings' => 'generate_blog_settings[excerpt_length]', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[read_more]', - array( - 'default' => $defaults['read_more'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'wp_kses_post', - ) - ); - - $wp_customize->add_control( - 'generate_loop_template_read_more', - array( - 'type' => 'text', - 'label' => __( 'Read more label', 'gp-premium' ), - 'section' => 'generate_blog_loop_template_section', - 'settings' => 'generate_blog_settings[read_more]', - ) - ); - - // Blog content section. - $wp_customize->add_section( - 'generate_blog_section', - array( - 'title' => __( 'Blog', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'panel' => 'generate_layout_panel', - 'priority' => 40, - 'active_callback' => function() { - return ! generate_has_active_element( 'loop-template', true ); - }, - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_blog_archives_title', - array( - 'section' => 'generate_blog_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Content', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new Generate_Control_Toggle_Customize_Control( - $wp_customize, - 'generate_post_meta_toggle', - array( - 'section' => 'generate_blog_section', - 'targets' => array( - 'post-meta-archives' => __( 'Archives', 'gp-premium' ), - 'post-meta-single' => __( 'Single', 'gp-premium' ), - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - 'generate_settings[post_content]', - array( - 'type' => 'select', - 'label' => __( 'Content type', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - 'full' => __( 'Full Content', 'gp-premium' ), - 'excerpt' => __( 'Excerpt', 'gp-premium' ), - ), - 'settings' => 'generate_settings[post_content]', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[excerpt_length]', array( - 'type' => 'number', - 'label' => __( 'Excerpt word count', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[excerpt_length]', - 'active_callback' => 'generate_premium_is_excerpt', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[read_more]', array( - 'type' => 'text', - 'label' => __( 'Read more label', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[read_more]', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[read_more_button]', - array( - 'default' => $defaults['read_more_button'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[read_more_button]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display read more as button', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[read_more_button]', - ) - ); - - // Post date - $wp_customize->add_setting( - 'generate_blog_settings[date]', - array( - 'default' => $defaults['date'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[date]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post date', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[date]', - ) - ); - - // Post author - $wp_customize->add_setting( - 'generate_blog_settings[author]', - array( - 'default' => $defaults['author'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[author]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post author', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[author]', - ) - ); - - // Category links - $wp_customize->add_setting( - 'generate_blog_settings[categories]', - array( - 'default' => $defaults['categories'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[categories]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post categories', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[categories]', - ) - ); - - // Tag links - $wp_customize->add_setting( - 'generate_blog_settings[tags]', - array( - 'default' => $defaults['tags'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[tags]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post tags', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[tags]', - ) - ); - - // Comment link - $wp_customize->add_setting( - 'generate_blog_settings[comments]', - array( - 'default' => $defaults['comments'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[comments]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display comment count', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[comments]', - ) - ); - - // Infinite scroll - $wp_customize->add_setting( - 'generate_blog_settings[infinite_scroll]', - array( - 'default' => $defaults['infinite_scroll'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[infinite_scroll]', - array( - 'type' => 'checkbox', - 'label' => __( 'Use infinite scroll', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[infinite_scroll]', - ) - ); - - // Infinite scroll - $wp_customize->add_setting( - 'generate_blog_settings[infinite_scroll_button]', - array( - 'default' => $defaults['infinite_scroll_button'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[infinite_scroll_button]', - array( - 'type' => 'checkbox', - 'label' => __( 'Use button to load more posts', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[infinite_scroll_button]', - 'active_callback' => 'generate_premium_infinite_scroll_active', - ) - ); - - // Load more text - $wp_customize->add_setting( - 'generate_blog_settings[masonry_load_more]', array( - 'default' => $defaults['masonry_load_more'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'wp_kses_post', - ) - ); - - $wp_customize->add_control( - 'blog_masonry_load_more_control', array( - 'label' => __( 'Load more label', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[masonry_load_more]', - 'active_callback' => 'generate_premium_infinite_scroll_button_active', - ) - ); - - // Loading text - $wp_customize->add_setting( - 'generate_blog_settings[masonry_loading]', array( - 'default' => $defaults['masonry_loading'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'wp_kses_post', - ) - ); - - $wp_customize->add_control( - 'blog_masonry_loading_control', array( - 'label' => __( 'Loading label', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[masonry_loading]', - 'active_callback' => 'generate_premium_infinite_scroll_button_active', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[single_date]', - array( - 'default' => $defaults['single_date'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_date]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post date', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_date]', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[single_author]', - array( - 'default' => $defaults['single_author'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_author]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post author', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_author]', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[single_categories]', - array( - 'default' => $defaults['single_categories'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_categories]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post categories', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_categories]', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[single_tags]', - array( - 'default' => $defaults['single_tags'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_tags]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post tags', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_tags]', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[single_post_navigation]', - array( - 'default' => $defaults['single_post_navigation'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_navigation]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display post navigation', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_post_navigation]', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_blog_featured_images_title', - array( - 'section' => 'generate_blog_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Featured Images', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_control( - new Generate_Control_Toggle_Customize_Control( - $wp_customize, - 'generate_featured_image_toggle', - array( - 'section' => 'generate_blog_section', - 'targets' => array( - 'featured-image-archives' => __( 'Archives', 'gp-premium' ), - 'featured-image-single' => __( 'Posts', 'gp-premium' ), - 'featured-image-page' => __( 'Pages', 'gp-premium' ), - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - // Show featured images - $wp_customize->add_setting( - 'generate_blog_settings[post_image]', - array( - 'default' => $defaults['post_image'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[post_image]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display featured images', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[post_image]', - ) - ); - - // Padding - $wp_customize->add_setting( - 'generate_blog_settings[post_image_padding]', - array( - 'default' => $defaults['post_image_padding'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[post_image_padding]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display padding around images', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[post_image_padding]', - 'active_callback' => 'generate_premium_display_image_padding', - ) - ); - - // Location - $wp_customize->add_setting( - 'generate_blog_settings[post_image_position]', - array( - 'default' => $defaults['post_image_position'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[post_image_position]', - array( - 'type' => 'select', - 'label' => __( 'Location', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - '' => __( 'Below Title', 'gp-premium' ), - 'post-image-above-header' => __( 'Above Title', 'gp-premium' ), - ), - 'settings' => 'generate_blog_settings[post_image_position]', - 'active_callback' => 'generate_premium_featured_image_active', - ) - ); - - // Alignment - $wp_customize->add_setting( - 'generate_blog_settings[post_image_alignment]', - array( - 'default' => $defaults['post_image_alignment'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[post_image_alignment]', - array( - 'type' => 'select', - 'label' => __( 'Alignment', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - 'post-image-aligned-center' => __( 'Center', 'gp-premium' ), - 'post-image-aligned-left' => __( 'Left', 'gp-premium' ), - 'post-image-aligned-right' => __( 'Right', 'gp-premium' ), - ), - 'settings' => 'generate_blog_settings[post_image_alignment]', - 'active_callback' => 'generate_premium_featured_image_active', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[post_image_size]', - array( - 'default' => $defaults['post_image_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[post_image_size]', - array( - 'type' => 'select', - 'label' => __( 'Media Attachment Size', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => generate_blog_get_image_sizes(), - 'settings' => 'generate_blog_settings[post_image_size]', - 'active_callback' => 'generate_premium_featured_image_active', - ) - ); - - // Width - $wp_customize->add_setting( - 'generate_blog_settings[post_image_width]', array( - 'default' => $defaults['post_image_width'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[post_image_width]', - array( - 'type' => 'number', - 'label' => __( 'Width', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[post_image_width]', - 'active_callback' => 'generate_premium_featured_image_active', - ) - ); - - // Height - $wp_customize->add_setting( - 'generate_blog_settings[post_image_height]', array( - 'default' => $defaults['post_image_height'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[post_image_height]', - array( - 'type' => 'number', - 'label' => __( 'Height', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[post_image_height]', - 'active_callback' => 'generate_premium_featured_image_active', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_regenerate_images_notice', - array( - 'section' => 'generate_blog_section', - 'description' => sprintf( - __( 'We will attempt to serve exact image sizes based on your width/height settings. If that is not possible, we will resize your images using CSS. Learn more about featured image sizing %s.', 'gp-premium' ), - '' . __( 'here', 'gp-premium' ) . '' - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => 'generate_premium_featured_image_active', - ) - ) - ); - - /* - * Single featured images - */ - - $wp_customize->add_setting( - 'generate_blog_settings[single_post_image]', - array( - 'default' => $defaults['single_post_image'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_image]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display featured images', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_post_image]', - ) - ); - - // Padding - $wp_customize->add_setting( - 'generate_blog_settings[single_post_image_padding]', - array( - 'default' => $defaults['single_post_image_padding'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_image_padding]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display padding around images', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_post_image_padding]', - 'active_callback' => 'generate_premium_display_image_padding_single', - ) - ); - - // Location - $wp_customize->add_setting( - 'generate_blog_settings[single_post_image_position]', - array( - 'default' => $defaults['single_post_image_position'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_image_position]', - array( - 'type' => 'select', - 'label' => __( 'Location', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - 'below-title' => __( 'Below Title', 'gp-premium' ), - 'inside-content' => __( 'Above Title', 'gp-premium' ), - 'above-content' => __( 'Above Content Area', 'gp-premium' ), - ), - 'settings' => 'generate_blog_settings[single_post_image_position]', - 'active_callback' => 'generate_premium_single_featured_image_active', - ) - ); - - // Alignment - $wp_customize->add_setting( - 'generate_blog_settings[single_post_image_alignment]', - array( - 'default' => $defaults['single_post_image_alignment'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_image_alignment]', - array( - 'type' => 'select', - 'label' => __( 'Alignment', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - 'center' => __( 'Center', 'gp-premium' ), - 'left' => __( 'Left', 'gp-premium' ), - 'right' => __( 'Right', 'gp-premium' ), - ), - 'settings' => 'generate_blog_settings[single_post_image_alignment]', - 'active_callback' => 'generate_premium_single_featured_image_active', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[single_post_image_size]', - array( - 'default' => $defaults['single_post_image_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_image_size]', - array( - 'type' => 'select', - 'label' => __( 'Media Attachment Size', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => generate_blog_get_image_sizes(), - 'settings' => 'generate_blog_settings[single_post_image_size]', - 'active_callback' => 'generate_premium_single_featured_image_active', - ) - ); - - // Width - $wp_customize->add_setting( - 'generate_blog_settings[single_post_image_width]', array( - 'default' => $defaults['single_post_image_width'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_image_width]', - array( - 'type' => 'number', - 'label' => __( 'Width', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_post_image_width]', - 'active_callback' => 'generate_premium_single_featured_image_active', - ) - ); - - // Height - $wp_customize->add_setting( - 'generate_blog_settings[single_post_image_height]', array( - 'default' => $defaults['single_post_image_height'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[single_post_image_height]', - array( - 'type' => 'number', - 'label' => __( 'Height', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[single_post_image_height]', - 'active_callback' => 'generate_premium_single_featured_image_active', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_regenerate_single_post_images_notice', - array( - 'section' => 'generate_blog_section', - 'description' => sprintf( - __( 'We will attempt to serve exact image sizes based on your width/height settings. If that is not possible, we will resize your images using CSS. Learn more about featured image sizing %s.', 'gp-premium' ), - '' . __( 'here', 'gp-premium' ) . '' - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => 'generate_premium_single_featured_image_active', - ) - ) - ); - - /* - * Page featured images - */ - - $wp_customize->add_setting( - 'generate_blog_settings[page_post_image]', - array( - 'default' => $defaults['page_post_image'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[page_post_image]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display featured images', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[page_post_image]', - ) - ); - - // Padding - $wp_customize->add_setting( - 'generate_blog_settings[page_post_image_padding]', - array( - 'default' => $defaults['page_post_image_padding'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[page_post_image_padding]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display padding around images', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[page_post_image_padding]', - 'active_callback' => 'generate_premium_display_image_padding_single_page', - ) - ); - - // Location - $wp_customize->add_setting( - 'generate_blog_settings[page_post_image_position]', - array( - 'default' => $defaults['page_post_image_position'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[page_post_image_position]', - array( - 'type' => 'select', - 'label' => __( 'Location', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - 'below-title' => __( 'Below Title', 'gp-premium' ), - 'inside-content' => __( 'Above Title', 'gp-premium' ), - 'above-content' => __( 'Above Content Area', 'gp-premium' ), - ), - 'settings' => 'generate_blog_settings[page_post_image_position]', - 'active_callback' => 'generate_premium_single_page_featured_image_active', - ) - ); - - // Alignment - $wp_customize->add_setting( - 'generate_blog_settings[page_post_image_alignment]', - array( - 'default' => $defaults['page_post_image_alignment'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[page_post_image_alignment]', - array( - 'type' => 'select', - 'label' => __( 'Alignment', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - 'center' => __( 'Center', 'gp-premium' ), - 'left' => __( 'Left', 'gp-premium' ), - 'right' => __( 'Right', 'gp-premium' ), - ), - 'settings' => 'generate_blog_settings[page_post_image_alignment]', - 'active_callback' => 'generate_premium_single_page_featured_image_active', - ) - ); - - $wp_customize->add_setting( - 'generate_blog_settings[page_post_image_size]', - array( - 'default' => $defaults['page_post_image_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[page_post_image_size]', - array( - 'type' => 'select', - 'label' => __( 'Media Attachment Size', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => generate_blog_get_image_sizes(), - 'settings' => 'generate_blog_settings[page_post_image_size]', - 'active_callback' => 'generate_premium_single_page_featured_image_active', - ) - ); - - // Width - $wp_customize->add_setting( - 'generate_blog_settings[page_post_image_width]', array( - 'default' => $defaults['page_post_image_width'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[page_post_image_width]', - array( - 'type' => 'number', - 'label' => __( 'Width', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[page_post_image_width]', - 'active_callback' => 'generate_premium_single_page_featured_image_active', - ) - ); - - // Height - $wp_customize->add_setting( - 'generate_blog_settings[page_post_image_height]', array( - 'default' => $defaults['page_post_image_height'], - 'capability' => 'edit_theme_options', - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[page_post_image_height]', - array( - 'type' => 'number', - 'label' => __( 'Height', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[page_post_image_height]', - 'active_callback' => 'generate_premium_single_page_featured_image_active', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_regenerate_page_images_notice', - array( - 'section' => 'generate_blog_section', - 'description' => sprintf( - __( 'We will attempt to serve exact image sizes based on your width/height settings. If that is not possible, we will resize your images using CSS. Learn more about featured image sizing %s.', 'gp-premium' ), - '' . __( 'here', 'gp-premium' ) . '' - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => 'generate_premium_single_page_featured_image_active', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_blog_columns_title', - array( - 'section' => 'generate_blog_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Columns', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - // Enable columns - $wp_customize->add_setting( - 'generate_blog_settings[column_layout]', - array( - 'default' => $defaults['column_layout'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[column_layout]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display posts in columns', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[column_layout]', - ) - ); - - // Column count class - $wp_customize->add_setting( - 'generate_blog_settings[columns]', - array( - 'default' => $defaults['columns'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[columns]', - array( - 'type' => 'select', - 'label' => __( 'Columns', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'choices' => array( - '50' => '2', - '33' => '3', - '25' => '4', - '20' => '5' - ), - 'settings' => 'generate_blog_settings[columns]', - 'active_callback' => 'generate_premium_blog_columns_active', - ) - ); - - // Featured column - $wp_customize->add_setting( - 'generate_blog_settings[featured_column]', - array( - 'default' => $defaults['featured_column'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[featured_column]', - array( - 'type' => 'checkbox', - 'label' => __( 'Make first post featured', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[featured_column]', - 'active_callback' => 'generate_premium_blog_columns_active', - ) - ); - - // Masonry - $wp_customize->add_setting( - 'generate_blog_settings[masonry]', - array( - 'default' => $defaults['masonry'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_blog_settings[masonry]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display posts in masonry grid', 'gp-premium' ), - 'section' => 'generate_blog_section', - 'settings' => 'generate_blog_settings[masonry]', - 'active_callback' => 'generate_premium_blog_columns_active', - ) - ); - } -} - -add_action( 'customize_controls_print_styles', 'generate_blog_customizer_controls_css' ); - -function generate_blog_customizer_controls_css() { - ?> - - '55', - 'read_more' => __( 'Read more', 'gp-premium' ), - 'read_more_button' => false, - 'masonry' => false, - 'masonry_load_more' => __( '+ More', 'gp-premium' ), - 'masonry_loading' => __( 'Loading...', 'gp-premium' ), - 'infinite_scroll' => false, - 'infinite_scroll_button' => false, - 'post_image' => true, - 'post_image_position' => '', - 'post_image_alignment' => 'post-image-aligned-center', - 'post_image_size' => 'full', - 'post_image_width' => '', - 'post_image_height' => '', - 'post_image_padding' => true, - 'single_post_image' => true, - 'single_post_image_position' => 'inside-content', - 'single_post_image_alignment' => 'center', - 'single_post_image_size' => 'full', - 'single_post_image_width' => '', - 'single_post_image_height' => '', - 'single_post_image_padding' => true, - 'page_post_image' => true, - 'page_post_image_position' => 'above-content', - 'page_post_image_alignment' => 'center', - 'page_post_image_size' => 'full', - 'page_post_image_width' => '', - 'page_post_image_height' => '', - 'page_post_image_padding' => true, - 'date' => true, - 'author' => true, - 'categories' => true, - 'tags' => true, - 'comments' => true, - 'single_date' => true, - 'single_author' => true, - 'single_categories' => true, - 'single_tags' => true, - 'single_post_navigation' => true, - 'column_layout' => false, - 'columns' => '50', - 'featured_column' => false, - ); - - return apply_filters( 'generate_blog_option_defaults', $generate_blog_defaults ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/generate-blog.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/generate-blog.php deleted file mode 100644 index 9b52b1ea..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/generate-blog.php +++ /dev/null @@ -1,754 +0,0 @@ - $settings['masonry_load_more'], - 'loading' => $settings['masonry_loading'], - 'icon' => function_exists( 'generate_get_svg_icon' ) ? generate_get_svg_icon( 'spinner' ) : '', - 'masonryInit' => apply_filters( - 'generate_blog_masonry_init', - array( - 'columnWidth' => '.grid-sizer', - 'itemSelector' => '.masonry-post', - 'stamp' => '.page-header', - 'percentPosition' => true, - 'stagger' => 30, - 'visibleStyle' => array( - 'transform' => 'translateY(0)', - 'opacity' => 1, - ), - 'hiddenStyle' => array( - 'transform' => 'translateY(5px)', - 'opacity' => 0, - ), - ) - ), - 'infiniteScrollInit' => apply_filters( - 'generate_blog_infinite_scroll_init', - array( - 'path' => '.infinite-scroll-path a', - 'append' => '#main .infinite-scroll-item', - 'history' => false, - 'loadOnScroll' => $settings['infinite_scroll_button'] ? false : true, - 'button' => $settings['infinite_scroll_button'] ? '.load-more a' : null, - 'scrollThreshold' => $settings['infinite_scroll_button'] ? false : 600, - ) - ), - ) - ); - } - - $needs_columns_css = false; - $needs_featured_image_css = false; - - if ( generate_blog_get_columns() || $settings['infinite_scroll'] ) { - $needs_columns_css = true; - } - - if ( ! is_singular() ) { - if ( $settings['post_image'] ) { - $needs_featured_image_css = true; - } - } - - if ( is_page() && has_post_thumbnail() ) { - if ( $settings['page_post_image'] ) { - $needs_featured_image_css = true; - } - } - - if ( is_single() && has_post_thumbnail() ) { - if ( $settings['single_post_image'] ) { - $needs_featured_image_css = true; - } - } - - if ( $needs_columns_css && $needs_featured_image_css ) { - wp_enqueue_style( 'generate-blog', plugin_dir_url( __FILE__ ) . "css/style{$suffix}.css", array(), GENERATE_BLOG_VERSION ); - } elseif ( $needs_columns_css ) { - wp_enqueue_style( 'generate-blog-columns', plugin_dir_url( __FILE__ ) . "css/columns{$suffix}.css", array(), GENERATE_BLOG_VERSION ); - } elseif ( $needs_featured_image_css ) { - wp_enqueue_style( 'generate-blog-images', plugin_dir_url( __FILE__ ) . "css/featured-images{$suffix}.css", array(), GENERATE_BLOG_VERSION ); - } - } -} - -if ( ! function_exists( 'generate_blog_post_classes' ) ) { - add_filter( 'post_class', 'generate_blog_post_classes' ); - /** - * Adds custom classes to the content container - * - * @since 0.1 - */ - function generate_blog_post_classes( $classes ) { - // Don't add these classes to the GB Query Loop block items. - if ( in_array( 'gb-query-loop-item', $classes ) ) { - return $classes; - } - - global $wp_query; - $paged = get_query_var( 'paged' ); - $paged = $paged ? $paged : 1; - - // Get our options - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( $settings['infinite_scroll'] ) { - $classes[] = 'infinite-scroll-item'; - } - - // Set our masonry class - if ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) { - $classes[] = 'masonry-post'; - } - - // Set our column classes - if ( generate_blog_get_columns() && ! is_singular() ) { - $classes[] = 'generate-columns'; - $classes[] = 'tablet-grid-50'; - $classes[] = 'mobile-grid-100'; - $classes[] = 'grid-parent'; - - // Set our featured column class - if ( $wp_query->current_post == 0 && $paged == 1 && $settings['featured_column'] ) { - if ( 50 == generate_blog_get_column_count() ) { - $classes[] = 'grid-100'; - } - - if ( 33 == generate_blog_get_column_count() ) { - $classes[] = 'grid-66'; - } - - if ( 25 == generate_blog_get_column_count() ) { - $classes[] = 'grid-50'; - } - - if ( 20 == generate_blog_get_column_count() ) { - $classes[] = 'grid-60'; - } - $classes[] = 'featured-column'; - } else { - $classes[] = 'grid-' . generate_blog_get_column_count(); - } - } - - if ( ! $settings['post_image_padding'] && ! is_singular() ) { - $classes[] = 'no-featured-image-padding'; - } - - $location = generate_blog_get_singular_template(); - - if ( ! $settings[$location . '_post_image_padding'] && is_singular() ) { - $classes[] = 'no-featured-image-padding'; - } - - $atts = generate_get_blog_image_attributes(); - - if ( ! is_singular() && has_post_thumbnail() && ! empty( $atts ) ) { - $values = array( - $atts['width'], - $atts['height'], - $atts['crop'], - ); - - $image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values ); - - if ( $image_src && ( ! $image_src[3] || ! apply_filters( 'generate_use_featured_image_size_match', true ) ) ) { - $classes[] = 'resize-featured-image'; - } - } - - return $classes; - } -} - -if ( ! function_exists( 'generate_blog_body_classes' ) ) { - add_filter( 'body_class', 'generate_blog_body_classes' ); - /** - * Adds custom classes to the body - * - * @since 0.1 - */ - function generate_blog_body_classes( $classes ) { - // Get theme options - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( is_singular() ) { - $location = generate_blog_get_singular_template(); - - if ( 'below-title' == $settings[$location . '_post_image_position'] ) { - $classes[] = 'post-image-below-header'; - } - - if ( 'inside-content' == $settings[$location . '_post_image_position'] ) { - $classes[] = 'post-image-above-header'; - } - - $classes[] = ( ! empty( $settings[$location . '_post_image_alignment'] ) ) ? 'post-image-aligned-' . $settings[$location . '_post_image_alignment'] : 'post-image-aligned-center'; - } else { - $classes[] = ( '' == $settings['post_image_position'] ) ? 'post-image-below-header' : 'post-image-above-header'; - $classes[] = ( ! empty( $settings['post_image_alignment'] ) ) ? $settings['post_image_alignment'] : 'post-image-aligned-center'; - } - - if ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) { - $classes[] = 'masonry-enabled'; - } - - if ( generate_blog_get_columns() && ! is_singular() ) { - $classes[] = 'generate-columns-activated'; - } - - if ( $settings[ 'infinite_scroll' ] && ! is_singular() ) { - $classes[] = 'infinite-scroll'; - } - - return $classes; - } -} - -if ( ! function_exists( 'generate_excerpt_length' ) ) { - add_filter( 'excerpt_length', 'generate_excerpt_length', 15 ); - /** - * Set our excerpt length - * - * @since 0.1 - */ - function generate_excerpt_length( $length ) { - $generate_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - return absint( apply_filters( 'generate_excerpt_length', $generate_settings['excerpt_length'] ) ); - } -} - -if ( ! function_exists( 'generate_blog_css' ) ) { - /** - * Build our inline CSS - * - * @since 0.1 - */ - function generate_blog_css() { - global $post; - $return = ''; - - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( ! defined( 'GENERATE_VERSION' ) ) { - return; - } - - if ( version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '<' ) ) { - // Get disable headline meta. - $disable_headline = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate-disable-headline', true ) : ''; - - if ( ! $settings['categories'] && ! $settings['comments'] && ! $settings['tags'] && ! is_singular() ) { - $return .= '.blog footer.entry-meta, .archive footer.entry-meta {display:none;}'; - } - - if ( ! $settings['single_date'] && ! $settings['single_author'] && $disable_headline && is_singular() ) { - $return .= '.single .entry-header{display:none;}.single .entry-content {margin-top:0;}'; - } - - if ( ! $settings['date'] && ! $settings['author'] && ! is_singular() ) { - $return .= '.entry-header .entry-meta {display:none;}'; - } - - if ( ! $settings['single_date'] && ! $settings['single_author'] && is_singular() ) { - $return .= '.entry-header .entry-meta {display:none;}'; - } - - if ( ! $settings['single_post_navigation'] && is_singular() ) { - $return .= '.post-navigation {display:none;}'; - } - - if ( ! $settings['single_categories'] && ! $settings['single_post_navigation'] && ! $settings['single_tags'] && is_singular() ) { - $return .= '.single footer.entry-meta {display:none;}'; - } - } - - $separator = 20; - $content_padding_top = 40; - $content_padding_right = 40; - $content_padding_left = 40; - $mobile_content_padding_top = 30; - $mobile_content_padding_right = 30; - $mobile_content_padding_left = 30; - - if ( function_exists( 'generate_spacing_get_defaults' ) ) { - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - - $separator = absint( $spacing_settings['separator'] ); - $content_padding_top = absint( $spacing_settings['content_top'] ); - $content_padding_right = absint( $spacing_settings['content_right'] ); - $content_padding_left = absint( $spacing_settings['content_left'] ); - $mobile_content_padding_top = absint( $spacing_settings['mobile_content_top'] ); - $mobile_content_padding_right = absint( $spacing_settings['mobile_content_right'] ); - $mobile_content_padding_left = absint( $spacing_settings['mobile_content_left'] ); - } - - if ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) { - $return .= '.page-header {margin-bottom: ' . $separator . 'px;margin-left: ' . $separator . 'px}'; - } - - if ( $settings[ 'infinite_scroll' ] && ! is_singular() ) { - $return .= '#nav-below {display:none;}'; - } - - if ( ! $settings['post_image_padding'] && 'post-image-aligned-center' == $settings['post_image_alignment'] && ! is_singular() ) { - $return .= '.no-featured-image-padding .post-image {margin-left:-' . $content_padding_left . 'px;margin-right:-' . $content_padding_right . 'px;}'; - $return .= '.post-image-above-header .no-featured-image-padding .inside-article .post-image {margin-top:-' . $content_padding_top . 'px;}'; - } - - $location = generate_blog_get_singular_template(); - - if ( ! $settings[$location . '_post_image_padding'] && 'center' == $settings[$location . '_post_image_alignment'] && is_singular() ) { - $return .= '.no-featured-image-padding .featured-image {margin-left:-' . $content_padding_left . 'px;margin-right:-' . $content_padding_right . 'px;}'; - $return .= '.post-image-above-header .no-featured-image-padding .inside-article .featured-image {margin-top:-' . $content_padding_top . 'px;}'; - } - - if ( ! $settings['page_post_image_padding'] || ! $settings['single_post_image_padding'] || ! $settings['post_image_padding'] ) { - $return .= '@media ' . generate_premium_get_media_query( 'mobile' ) . '{'; - if ( ! $settings['post_image_padding'] && 'post-image-aligned-center' == $settings['post_image_alignment'] && ! is_singular() ) { - $return .= '.no-featured-image-padding .post-image {margin-left:-' . $mobile_content_padding_left . 'px;margin-right:-' . $mobile_content_padding_right . 'px;}'; - $return .= '.post-image-above-header .no-featured-image-padding .inside-article .post-image {margin-top:-' . $mobile_content_padding_top . 'px;}'; - } - - if ( ! $settings[$location . '_post_image_padding'] && 'center' == $settings[$location . '_post_image_alignment'] && is_singular() ) { - $return .= '.no-featured-image-padding .featured-image {margin-left:-' . $mobile_content_padding_left . 'px;margin-right:-' . $mobile_content_padding_right . 'px;}'; - $return .= '.post-image-above-header .no-featured-image-padding .inside-article .featured-image {margin-top:-' . $mobile_content_padding_top . 'px;}'; - } - $return .= '}'; - } - - $atts = generate_get_blog_image_attributes(); - - if ( ! empty( $atts ) ) { - $image_width = $atts['width'] && 9999 !== $atts['width'] ? 'width: ' . $atts['width'] . 'px;' : ''; - $image_height = $atts['height'] && 9999 !== $atts['height'] ? 'height: ' . $atts['height'] . 'px;' : ''; - $image_crop = $atts['crop'] ? '-o-object-fit: cover;object-fit: cover;' : ''; - - if ( ! $image_width && $image_height ) { - $image_crop = '-o-object-fit: cover;object-fit: cover;'; - } - - if ( ! is_singular() ) { - $return .= '.resize-featured-image .post-image img {' . $image_width . $image_height . $image_crop . '}'; - } - - if ( is_single() || is_page() ) { - $values = array( - $atts['width'], - $atts['height'], - $atts['crop'], - ); - - $image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values ); - - if ( $image_src && ( ! $image_src[3] || ! apply_filters( 'generate_use_featured_image_size_match', true ) ) ) { - $return .= '.featured-image img {' . $image_width . $image_height . $image_crop . '}'; - } - } - } - - return $return; - } -} - -add_filter( 'generate_excerpt_more_text', 'generate_blog_set_read_more_text' ); -/** - * Set the read more text with our Customizer setting. - * - * @param string $text The read more text. - */ -function generate_blog_set_read_more_text( $text ) { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( $settings['read_more'] ) { - return wp_kses_post( $settings['read_more'] ); - } - - return $text; -} - -if ( ! function_exists( 'generate_blog_excerpt_more' ) ) { - add_filter( 'excerpt_more', 'generate_blog_excerpt_more', 15 ); - /** - * Prints the read more HTML - */ - function generate_blog_excerpt_more( $more ) { - $generate_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( '' == $generate_settings['read_more'] ) { - return ''; - } - - // We don't need to overwrite the entire element just to change its text. - // If we can filter the text, stop here. - if ( function_exists( 'generate_get_read_more_text' ) ) { - return $more; - } - - return apply_filters( - 'generate_excerpt_more_output', - sprintf( - ' ... %3$s', - the_title_attribute( 'echo=0' ), - esc_url( get_permalink( get_the_ID() ) ), - wp_kses_post( $generate_settings['read_more'] ), - sprintf( - /* translators: Aria-label describing the read more button */ - _x( 'More on %s', 'more on post title', 'gp-premium' ), - the_title_attribute( 'echo=0' ) - ) - ) - ); - } -} - -if ( ! function_exists( 'generate_blog_content_more' ) ) { - add_filter( 'the_content_more_link', 'generate_blog_content_more', 15 ); - /** - * Prints the read more HTML - */ - function generate_blog_content_more( $more ) { - $generate_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( '' == $generate_settings['read_more'] ) { - return ''; - } - - // We don't need to overwrite the entire element just to change its text. - // If we can filter the text, stop here. - if ( function_exists( 'generate_get_read_more_text' ) ) { - return $more; - } - - return apply_filters( - 'generate_content_more_link_output', - sprintf( - '

%3$s

', - the_title_attribute( 'echo=0' ), - esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump', '#more-' . get_the_ID() ) ), - wp_kses_post( $generate_settings['read_more'] ), - sprintf( - /* translators: Aria-label describing the read more button */ - _x( 'More on %s', 'more on post title', 'gp-premium' ), - the_title_attribute( 'echo=0' ) - ) - ) - ); - } -} - -/** - * Checks the setting and returns false if $thing is disabled - * - * @since 1.4 - * - * @param String $data The original data, passed through if not disabled - * @param String $thing The name of the thing to check - * @return String|False The original data, or false (if disabled) - */ -function generate_disable_post_thing( $data, $thing ) { - $generate_blog_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( ! $generate_blog_settings[$thing] ) { - return false; - } - - return $data; -} - -if ( ! function_exists( 'generate_disable_post_date' ) ) { - add_filter( 'generate_post_date', 'generate_disable_post_date' ); - /** - * Remove the post date if set - * - * @since 0.1 - */ - function generate_disable_post_date( $date ) { - if ( is_singular() ) { - return generate_disable_post_thing( $date, 'single_date' ); - } else { - return generate_disable_post_thing( $date, 'date' ); - } - } -} - -if ( ! function_exists( 'generate_disable_post_author' ) ) { - add_filter( 'generate_post_author', 'generate_disable_post_author' ); - /** - * Set the author if set - * - * @since 0.1 - */ - function generate_disable_post_author( $author ) { - if ( is_singular() ) { - return generate_disable_post_thing( $author, 'single_author' ); - } else { - return generate_disable_post_thing( $author, 'author' ); - } - } -} - -if ( ! function_exists( 'generate_disable_post_categories' ) ) { - add_filter( 'generate_show_categories', 'generate_disable_post_categories' ); - /** - * Remove the categories if set - * - * @since 0.1 - */ - function generate_disable_post_categories( $categories ) { - if ( is_singular() ) { - return generate_disable_post_thing( $categories, 'single_categories' ); - } else { - return generate_disable_post_thing( $categories, 'categories' ); - } - } -} - -if ( ! function_exists( 'generate_disable_post_tags' ) ) { - add_filter( 'generate_show_tags', 'generate_disable_post_tags' ); - /** - * Remove the tags if set - * - * @since 0.1 - */ - function generate_disable_post_tags( $tags ) { - if ( is_singular() ) { - return generate_disable_post_thing( $tags, 'single_tags' ); - } else { - return generate_disable_post_thing( $tags, 'tags' ); - } - } -} - -if ( ! function_exists( 'generate_disable_post_comments_link' ) ) { - add_filter( 'generate_show_comments', 'generate_disable_post_comments_link' ); - /** - * Remove the link to comments if set - * - * @since 0.1 - */ - function generate_disable_post_comments_link( $comments_link ) { - return generate_disable_post_thing( $comments_link, 'comments' ); - } -} - -add_filter( 'generate_show_post_navigation', 'generate_disable_post_navigation' ); -/** - * Remove the single post navigation - * - * @since 1.5 - */ -function generate_disable_post_navigation( $navigation ) { - if ( is_singular() ) { - return generate_disable_post_thing( $navigation, 'single_post_navigation' ); - } else { - return $navigation; - } -} - -add_filter( 'generate_excerpt_more_output', 'generate_blog_read_more_button' ); -add_filter( 'generate_content_more_link_output', 'generate_blog_read_more_button' ); -/** - * Add the button class to our read more link if set. - * - * @since 1.5 - * - * @param string $output Our existing read more link. - */ -function generate_blog_read_more_button( $output ) { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( ! $settings['read_more_button'] ) { - return $output; - } - - $aria_label = function_exists( 'generate_get_read_more_aria_label' ) - ? generate_get_read_more_aria_label() - : sprintf( - /* translators: Aria-label describing the read more button */ - _x( 'More on %s', 'more on post title', 'gp-premium' ), - the_title_attribute( 'echo=0' ) - ); - - return sprintf( - '%5$s

%3$s

', - the_title_attribute( 'echo=0' ), - esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump', '#more-' . get_the_ID() ) ), - wp_kses_post( $settings['read_more'] ), - $aria_label, - 'generate_excerpt_more_output' === current_filter() ? ' ... ' : '' - ); -} - -if ( ! function_exists( 'generate_blog_load_more' ) ) { - add_action( 'generate_after_main_content', 'generate_blog_load_more', 20 ); - /** - * Build our load more button - */ - function generate_blog_load_more() { - // Get theme options - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( ( ! $settings[ 'infinite_scroll_button' ] || ! $settings[ 'infinite_scroll' ] ) || is_singular() || is_404() ) { - return; - } - - global $wp_query; - - if ( $wp_query->max_num_pages < 2 ) { - return; - } - - if ( is_post_type_archive( 'product' ) ) { - return; - } - - if ( is_tax( 'product_cat' ) ) { - return; - } - - $icon = ''; - - if ( function_exists( 'generate_get_svg_icon' ) ) { - $icon = generate_get_svg_icon( 'spinner' ); - } - - printf( - '
- %3$s%4$s -
', - $icon ? 'has-svg-icon' : '', - ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) ? 'are-images-unloaded' : '', - $icon, - wp_kses_post( $settings['masonry_load_more'] ) - ); - } -} - -/** - * Checks to see whether we're getting page or single post options. - * - * @since 1.5 - * - * @return string Name of our singular template - */ -function generate_blog_get_singular_template() { - $template = 'single'; - - if ( is_page() ) { - $template = 'page'; - } - - return $template; -} - -add_action( 'generate_after_footer', 'generate_blog_do_infinite_scroll_path', 500 ); -/** - * Add a next page of posts link for infinite scroll. - * - * @since 2.0.0 - */ -function generate_blog_do_infinite_scroll_path() { - if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) { - return; - } - - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( $settings['infinite_scroll'] && ! is_singular() && ! is_404() ) { - printf( - '', - get_next_posts_link() - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/images.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/images.php deleted file mode 100644 index 54f11c71..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/images.php +++ /dev/null @@ -1,369 +0,0 @@ - 'full', - ); - - foreach ( $sizes as $key => $name ) { - $new_sizes[ $name ] = $name; - } - - return $new_sizes; -} - -add_filter( 'generate_page_header_default_size', 'generate_blog_set_featured_image_size' ); -/** - * Set our featured image sizes. - * - * @since 1.10.0 - * - * @param string $size The existing size. - * @return string The new size. - */ -function generate_blog_set_featured_image_size( $size ) { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( ! is_singular() ) { - $size = $settings['post_image_size']; - } - - if ( is_single() ) { - $size = $settings['single_post_image_size']; - } - - if ( is_page() ) { - $size = $settings['page_post_image_size']; - } - - $atts = generate_get_blog_image_attributes(); - - if ( ! empty( $atts ) ) { - $values = array( - $atts['width'], - $atts['height'], - $atts['crop'], - ); - - $image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values ); - - if ( $image_src && $image_src[3] && apply_filters( 'generate_use_featured_image_size_match', true ) ) { - return $values; - } else { - return $size; - } - } - - return $size; -} - -if ( ! function_exists( 'generate_get_blog_image_attributes' ) ) { - /** - * Build our image attributes - * - * @since 0.1 - */ - function generate_get_blog_image_attributes() { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( is_singular() ) { - if ( is_singular( 'page' ) ) { - $single = 'page_'; - } else { - $single = 'single_'; - } - } else { - $single = ''; - } - - $ignore_crop = array( '', '0', '9999' ); - - $atts = array( - 'width' => ( in_array( $settings[ "{$single}post_image_width" ], $ignore_crop ) ) ? 9999 : absint( $settings[ "{$single}post_image_width" ] ), - 'height' => ( in_array( $settings[ "{$single}post_image_height" ], $ignore_crop ) ) ? 9999 : absint( $settings[ "{$single}post_image_height" ] ), - 'crop' => ( in_array( $settings[ "{$single}post_image_width" ], $ignore_crop ) || in_array( $settings[ "{$single}post_image_height" ], $ignore_crop ) ) ? false : true, - ); - - // If there's no height or width, empty the array. - if ( 9999 == $atts['width'] && 9999 == $atts['height'] ) { // phpcs:ignore - $atts = array(); - } - - return apply_filters( 'generate_blog_image_attributes', $atts ); - } -} - -if ( ! function_exists( 'generate_blog_setup' ) ) { - add_action( 'wp', 'generate_blog_setup', 50 ); - /** - * Setup our blog functions and actions - * - * @since 0.1 - */ - function generate_blog_setup() { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - // Move our featured images to above the title. - if ( 'post-image-above-header' === $settings['post_image_position'] ) { - remove_action( 'generate_after_entry_header', 'generate_post_image' ); - add_action( 'generate_before_content', 'generate_post_image' ); - - // If we're using the Page Header add-on, move those as well. - if ( function_exists( 'generate_page_header_post_image' ) ) { - remove_action( 'generate_after_entry_header', 'generate_page_header_post_image' ); - add_action( 'generate_before_content', 'generate_page_header_post_image' ); - } - } - - $page_header_content = false; - if ( function_exists( 'generate_page_header_get_options' ) ) { - $options = generate_page_header_get_options(); - - if ( $options && '' !== $options['content'] ) { - $page_header_content = true; - } - - // If our Page Header has no content, remove it. - // This will allow the Blog add-on to add an image for us. - if ( ! $page_header_content && is_singular() ) { - remove_action( 'generate_before_content', 'generate_page_header' ); - remove_action( 'generate_after_entry_header', 'generate_page_header' ); - remove_action( 'generate_after_header', 'generate_page_header' ); - } - } - - // Remove the core theme featured image. - // I would like to filter instead one day. - remove_action( 'generate_after_header', 'generate_featured_page_header' ); - remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single' ); - - $location = generate_blog_get_singular_template(); - - if ( $settings[ $location . '_post_image' ] && is_singular() && ! $page_header_content ) { - if ( 'below-title' === $settings[ $location . '_post_image_position' ] ) { - add_action( 'generate_after_entry_header', 'generate_blog_single_featured_image' ); - } - - if ( 'inside-content' === $settings[ $location . '_post_image_position' ] ) { - add_action( 'generate_before_content', 'generate_blog_single_featured_image' ); - } - - if ( 'above-content' === $settings[ $location . '_post_image_position' ] ) { - add_action( 'generate_after_header', 'generate_blog_single_featured_image' ); - } - } - } -} - -add_filter( 'generate_featured_image_output', 'generate_blog_featured_image' ); -/** - * Remove featured image if set or using WooCommerce. - * - * @since 1.5 - * @param string $output The existing output. - * @return string The image HTML - */ -function generate_blog_featured_image( $output ) { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings['post_image'] ) { - return false; - } - - return $output; -} - -/** - * Build our featured images for single posts and pages. - * - * This function is way more complicated than it could be so it can - * ensure compatibility with the Page Header add-on. - * - * @since 1.5 - * - * @return string The image HTML - */ -function generate_blog_single_featured_image() { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - $image_id = get_post_thumbnail_id( get_the_ID(), 'full' ); - - if ( function_exists( 'generate_page_header_get_image' ) && generate_page_header_get_image( 'ID' ) ) { - if ( intval( $image_id ) !== generate_page_header_get_image( 'ID' ) ) { - $image_id = generate_page_header_get_image( 'ID' ); - } - } - - $location = generate_blog_get_singular_template(); - - if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings[ $location . '_post_image' ] || ! $image_id ) { - return false; - } - - $attrs = array( - 'itemprop' => 'image', - ); - - if ( function_exists( 'generate_get_schema_type' ) ) { - if ( 'microdata' !== generate_get_schema_type() ) { - $attrs = array(); - } - } - - $attrs['loading'] = false; - $attrs = apply_filters( 'generate_single_featured_image_attrs', $attrs ); - - $image_html = apply_filters( - 'post_thumbnail_html', // phpcs:ignore -- Core filter. - wp_get_attachment_image( - $image_id, - apply_filters( 'generate_page_header_default_size', 'full' ), - '', - $attrs - ), - get_the_ID(), - $image_id, - apply_filters( 'generate_page_header_default_size', 'full' ), - '' - ); - - $location = generate_blog_get_singular_template(); - - $classes = array( - is_page() ? 'page-header-image' : null, - is_singular() && ! is_page() ? 'page-header-image-single' : null, - 'above-content' === $settings[ $location . '_post_image_position' ] ? 'grid-container grid-parent' : null, - ); - - $image_html = apply_filters( 'generate_single_featured_image_html', $image_html ); - - // phpcs:ignore -- No need to escape here. - echo apply_filters( - 'generate_single_featured_image_output', - sprintf( - '', - $image_html, - implode( ' ', $classes ) - ), - $image_html - ); -} - -add_filter( 'generate_blog_image_attributes', 'generate_blog_page_header_image_atts' ); -/** - * Filter our image attributes in case we're using differents atts in our Page Header - * - * @since 1.5 - * - * @param array $atts Our existing image attributes. - * @return array Image attributes - */ -function generate_blog_page_header_image_atts( $atts ) { - if ( ! function_exists( 'generate_page_header_get_options' ) ) { - return $atts; - } - - if ( ! is_singular() ) { - return $atts; - } - - $options = generate_page_header_get_options(); - - if ( $options && 'enable' === $options['image_resize'] ) { - $ignore_crop = array( '', '0', '9999' ); - - $atts = array( - 'width' => ( in_array( $options['image_width'], $ignore_crop ) ) ? 9999 : absint( $options['image_width'] ), - 'height' => ( in_array( $options['image_height'], $ignore_crop ) ) ? 9999 : absint( $options['image_height'] ), - 'crop' => ( in_array( $options['image_width'], $ignore_crop ) || in_array( $options['image_height'], $ignore_crop ) ) ? false : true, - ); - } - - return $atts; -} - -add_filter( 'generate_single_featured_image_html', 'generate_blog_page_header_link' ); -/** - * Add our Page Header link to our featured image if set. - * - * @since 1.5 - * - * @param string $image_html Our existing image HTML. - * @return string Our new image HTML. - */ -function generate_blog_page_header_link( $image_html ) { - if ( ! function_exists( 'generate_page_header_get_options' ) ) { - return $image_html; - } - - $options = generate_page_header_get_options(); - - if ( ! empty( $options['image_link'] ) ) { - return '' . $image_html . ''; - } else { - return $image_html; - } -} - -add_filter( 'body_class', 'generate_blog_remove_featured_image_class', 20 ); -/** - * Remove the featured image classes if they're disabled. - * - * @since 2.1.0 - * @param array $classes The body classes. - */ -function generate_blog_remove_featured_image_class( $classes ) { - if ( is_singular() ) { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( is_single() ) { - $disable_single_featured_image = ! $settings['single_post_image']; - $classes = generate_premium_remove_featured_image_class( $classes, $disable_single_featured_image ); - } - - if ( is_page() && ! $settings['page_post_image'] ) { - $disable_page_featured_image = ! $settings['page_post_image']; - $classes = generate_premium_remove_featured_image_class( $classes, $disable_page_featured_image ); - } - } - - return $classes; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/controls.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/controls.js deleted file mode 100644 index eb397ff9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/controls.js +++ /dev/null @@ -1,98 +0,0 @@ -jQuery( function( $ ) { - // Featured image controls - var featuredImageArchiveControls = [ - 'generate_blog_settings-post_image', - 'generate_blog_settings-post_image_padding', - 'generate_blog_settings-post_image_position', - 'generate_blog_settings-post_image_alignment', - 'generate_blog_settings-post_image_size', - 'generate_blog_settings-post_image_width', - 'generate_blog_settings-post_image_height', - 'generate_regenerate_images_notice', - ]; - - $.each( featuredImageArchiveControls, function( index, value ) { - $( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-archives' ); - } ); - - var featuredImageSingleControls = [ - 'generate_blog_settings-single_post_image', - 'generate_blog_settings-single_post_image_padding', - 'generate_blog_settings-single_post_image_position', - 'generate_blog_settings-single_post_image_alignment', - 'generate_blog_settings-single_post_image_size', - 'generate_blog_settings-single_post_image_width', - 'generate_blog_settings-single_post_image_height', - 'generate_regenerate_single_post_images_notice', - ]; - - $.each( featuredImageSingleControls, function( index, value ) { - $( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-single' ).css( { - visibility: 'hidden', - height: '0', - width: '0', - margin: '0', - overflow: 'hidden', - } ); - } ); - - var featuredImagePageControls = [ - 'generate_blog_settings-page_post_image', - 'generate_blog_settings-page_post_image_padding', - 'generate_blog_settings-page_post_image_position', - 'generate_blog_settings-page_post_image_alignment', - 'generate_blog_settings-page_post_image_size', - 'generate_blog_settings-page_post_image_width', - 'generate_blog_settings-page_post_image_height', - 'generate_regenerate_page_images_notice', - ]; - - $.each( featuredImagePageControls, function( index, value ) { - $( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-page' ).css( { - visibility: 'hidden', - height: '0', - width: '0', - margin: '0', - overflow: 'hidden', - } ); - } ); - - // Post meta controls - var postMetaArchiveControls = [ - 'generate_settings-post_content', - 'generate_blog_settings-excerpt_length', - 'generate_blog_settings-read_more', - 'generate_blog_settings-read_more_button', - 'generate_blog_settings-date', - 'generate_blog_settings-author', - 'generate_blog_settings-categories', - 'generate_blog_settings-tags', - 'generate_blog_settings-comments', - 'generate_blog_settings-infinite_scroll', - 'generate_blog_settings-infinite_scroll_button', - 'blog_masonry_load_more_control', - 'blog_masonry_loading_control', - ]; - - $.each( postMetaArchiveControls, function( index, value ) { - $( '#customize-control-' + value ).attr( 'data-control-section', 'post-meta-archives' ); - } ); - - var postMetaSingleControls = [ - 'generate_blog_settings-single_date', - 'generate_blog_settings-single_author', - 'generate_blog_settings-single_categories', - 'generate_blog_settings-single_tags', - 'generate_blog_settings-single_post_navigation', - ]; - - $.each( postMetaSingleControls, function( index, value ) { - $( '#customize-control-' + value ).attr( 'data-control-section', 'post-meta-single' ).css( { - visibility: 'hidden', - height: '0', - width: '0', - margin: '0', - overflow: 'hidden', - } ); - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/customizer.js deleted file mode 100644 index f3c6656c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/customizer.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Theme Customizer enhancements for a better user experience. - * - * Contains handlers to make Theme Customizer preview reload changes asynchronously. - */ - -( function( $ ) { - // Container width - wp.customize( 'generate_settings[container_width]', function( value ) { - value.bind( function() { - if ( $( '.masonry-container' )[ 0 ] ) { - jQuery( '.masonry-container' ).imagesLoaded( function() { - $container = jQuery( '.masonry-container' ); - if ( jQuery( $container ).length ) { - $container.masonry( { - columnWidth: '.grid-sizer', - itemSelector: '.masonry-post', - stamp: '.page-header', - } ); - } - } ); - } - } ); - } ); - - $( 'body' ).on( 'generate_spacing_updated', function() { - if ( $( '.masonry-container' )[ 0 ] ) { - jQuery( '.masonry-container' ).imagesLoaded( function() { - $container = jQuery( '.masonry-container' ); - if ( jQuery( $container ).length ) { - $container.masonry( { - columnWidth: '.grid-sizer', - itemSelector: '.masonry-post', - stamp: '.page-header', - } ); - } - } ); - } - } ); - - /** - * The first infinite scroll load in the Customizer misses article classes if they've been - * added or removed in the previous refresh. - * - * This is totally hacky, but I'm just happy I finally got it working! - */ - var $container = $( '.infinite-scroll-item' ).first().parent(); - $container.on( 'load.infiniteScroll', function( event, response ) { - var $posts = $( response ).find( 'article' ); - if ( wp.customize.value( 'generate_blog_settings[column_layout]' )() ) { - $posts.addClass( 'generate-columns' ); - $posts.addClass( 'grid-parent' ); - $posts.addClass( 'grid-' + wp.customize.value( 'generate_blog_settings[columns]' )() ); - $posts.addClass( 'tablet-grid-50' ); - $posts.addClass( 'mobile-grid-100' ); - } else { - $posts.removeClass( 'generate-columns' ); - $posts.removeClass( 'grid-parent' ); - $posts.removeClass( 'grid-' + wp.customize.value( 'generate_blog_settings[columns]' )() ); - $posts.removeClass( 'tablet-grid-50' ); - $posts.removeClass( 'mobile-grid-100' ); - } - - if ( wp.customize.value( 'generate_blog_settings[masonry]' )() ) { - $posts.addClass( 'masonry-post' ); - } else { - $posts.removeClass( 'masonry-post' ); - } - - if ( ! wp.customize.value( 'generate_blog_settings[post_image_padding]' )() ) { - $posts.addClass( 'no-featured-image-padding' ); - } else { - $posts.removeClass( 'no-featured-image-padding' ); - } - } ); -}( jQuery ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/infinite-scroll.pkgd.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/infinite-scroll.pkgd.min.js deleted file mode 100644 index 329c20c6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/infinite-scroll.pkgd.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * Infinite Scroll PACKAGED v3.0.6 - * Automatically add next page - * - * Licensed GPLv3 for open source use - * or Infinite Scroll Commercial License for commercial use - * - * https://infinite-scroll.com - * Copyright 2018 Metafizzy - */ - -!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,l){function a(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,a){var h=l.data(a,i);if(!h)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var c=h[e];if(!c||"_"==e.charAt(0))return void s(r+" is not a valid method");var u=c.apply(h,n);o=void 0===o?u:o}),void 0!==o?o:t}function h(t,e){t.each(function(t,n){var o=l.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),l.data(n,i,o))})}l=l||e||t.jQuery,l&&(r.prototype.option||(r.prototype.option=function(t){l.isPlainObject(t)&&(this.options=l.extend(!0,this.options,t))}),l.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return a(this,t,e)}return h(this,t),this},n(l))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return n.indexOf(e)==-1&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return n!=-1&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o=0,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},s.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},s.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/scroll-watch",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){var n=e.prototype;return e.defaults.scrollThreshold=400,e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);var t=this.options.scrollThreshold,e=t||0===t;e&&this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){var i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.pageScrollHandler),t[i]("resize",this.resizeHandler)},n.onPageScroll=e.throttle(function(){var t=this.getBottomDistance();t<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")}),n.getBottomDistance=function(){return this.options.elementScroll?this.getElementBottomDistance():this.getWindowBottomDistance()},n.getWindowBottomDistance=function(){var e=this.top+this.element.clientHeight,i=t.pageYOffset+this.windowHeight;return e-i},n.getElementBottomDistance=function(){var t=this.scroller.scrollHeight,e=this.scroller.scrollTop+this.scroller.clientHeight;return t-e},n.onResize=function(){this.updateMeasurements()},i.debounceMethod(e,"onResize",150),e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/history",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){var n=e.prototype;e.defaults.history="replace";var o=document.createElement("a");return e.create.history=function(){if(this.options.history){o.href=this.getAbsolutePath();var t=o.origin||o.protocol+"//"+o.host,e=t==location.origin;return e?void(this.options.append?this.createHistoryAppend():this.createHistoryPageLoad()):void console.error("[InfiniteScroll] cannot set history with different origin: "+o.origin+" on "+location.origin+" . History behavior disabled.")}},n.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPageIndex=0,this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},n.bindHistoryAppendEvents=function(e){var i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.scrollHistoryHandler),t[i]("unload",this.unloadHandler)},n.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=n.destroyHistory=function(){var t=this.options.history&&this.options.append;t&&this.bindHistoryAppendEvents(!1)},n.onAppendHistory=function(t,e,i){if(i&&i.length){var n=i[0],r=this.getElementScrollY(n);o.href=e,this.scrollPages.push({top:r,path:o.href,title:t.title})}},n.getElementScrollY=function(t){return this.options.elementScroll?this.getElementElementScrollY(t):this.getElementWindowScrollY(t)},n.getElementWindowScrollY=function(e){var i=e.getBoundingClientRect();return i.top+t.pageYOffset},n.getElementElementScrollY=function(t){return t.offsetTop-this.top},n.onScrollHistory=function(){for(var t,e,i=this.getScrollViewY(),n=0;n=i)break;t=n,e=o}t!=this.scrollPageIndex&&(this.scrollPageIndex=t,this.setHistory(e.title,e.path))},i.debounceMethod(e,"onScrollHistory",150),n.getScrollViewY=function(){return this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:t.pageYOffset+this.windowHeight/2},n.setHistory=function(t,e){var i=this.options.history,n=i&&history[i+"State"];n&&(history[i+"State"](null,t,e),this.options.historyTitle&&(document.title=t),this.dispatchEvent("history",null,[t,e]))},n.onUnload=function(){var e=this.scrollPageIndex;if(0!==e){var i=this.scrollPages[e],n=t.pageYOffset-i.top+this.top;this.destroyHistory(),scrollTo(0,n)}},n.onPageLoadHistory=function(t,e){this.setHistory(t.title,e)},e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/button",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){function n(t,e){this.element=t,this.infScroll=e,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),e.on("request",this.disable.bind(this)),e.on("load",this.enable.bind(this)),e.on("error",this.hide.bind(this)),e.on("last",this.hide.bind(this))}return e.create.button=function(){var t=i.getQueryElement(this.options.button);if(t)return void(this.button=new n(t,this))},e.destroy.button=function(){this.button&&this.button.destroy()},n.prototype.onClick=function(t){t.preventDefault(),this.infScroll.loadNextPage()},n.prototype.enable=function(){this.element.removeAttribute("disabled")},n.prototype.disable=function(){this.element.disabled="disabled"},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.destroy=function(){this.element.removeEventListener("click",this.clickHandler)},e.Button=n,e}),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/status",["./core","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,function(t,e,i){function n(t){r(t,"none")}function o(t){r(t,"block")}function r(t,e){t&&(t.style.display=e)}var s=e.prototype;return e.create.status=function(){var t=i.getQueryElement(this.options.status);t&&(this.statusElement=t,this.statusEventElements={request:t.querySelector(".infinite-scroll-request"),error:t.querySelector(".infinite-scroll-error"),last:t.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},s.bindHideStatus=function(t){var e=this.options.append?"append":"load";this[t](e,this.hideAllStatus)},s.showRequestStatus=function(){this.showStatus("request")},s.showErrorStatus=function(){this.showStatus("error")},s.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},s.showStatus=function(t){o(this.statusElement),this.hideStatusEventElements();var e=this.statusEventElements[t];o(e)},s.hideAllStatus=function(){n(this.statusElement),this.hideStatusEventElements()},s.hideStatusEventElements=function(){for(var t in this.statusEventElements){var e=this.statusEventElements[t];n(e)}},e}),function(t,e){"function"==typeof define&&define.amd?define(["infinite-scroll/js/core","infinite-scroll/js/page-load","infinite-scroll/js/scroll-watch","infinite-scroll/js/history","infinite-scroll/js/button","infinite-scroll/js/status"],e):"object"==typeof module&&module.exports&&(module.exports=e(require("./core"),require("./page-load"),require("./scroll-watch"),require("./history"),require("./button"),require("./status")))}(window,function(t){return t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){if(Array.isArray(t))return t;var e="object"==typeof t&&"number"==typeof t.length;return e?h.call(t):[t]}function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);var s=t;return"string"==typeof t&&(s=document.querySelectorAll(t)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof e?r=e:i(this.options,e),r&&this.on("always",r),this.getImages(),l&&(this.jqDeferred=new l.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||t))}function r(t){this.img=t}function s(t,e){this.url=t,this.element=e,this.img=new Image}var l=t.jQuery,a=t.console,h=Array.prototype.slice;o.prototype=Object.create(e.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&c[e]){for(var i=t.querySelectorAll("img"),n=0;n 'false', - 'masonry_width' => 'width2', - 'masonry_most_recent_width' => 'width4', - 'post_image' => 'true', - 'date' => 'true', - 'author' => 'true', - 'categories' => 'true', - 'tags' => 'true', - 'comments' => 'true', - ); - - // Get our spacing settings - $blog_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - $defaults - ); - - $new_settings = array(); - - // These options use to be a select input with false + true values - // This will make the false values empty so the options can be checkboxes - $keys = array( 'date', 'author', 'categories', 'tags', 'comments', 'masonry', 'post_image' ); - foreach ( $keys as $key ) { - if ( is_string( $blog_settings[ $key ] ) ) { - if ( 'false' == $blog_settings[ $key ] ) { - $new_settings[ $key ] = false; - } elseif ( 'true' == $blog_settings[ $key ] ) { - $new_settings[ $key ] = true; - } - } - } - - // Set the single post meta options to whatever the blog options are - $new_settings[ 'single_date' ] = isset( $new_settings[ 'date' ] ) ? $new_settings[ 'date' ] : true; - $new_settings[ 'single_author' ] = isset( $new_settings[ 'author' ] ) ? $new_settings[ 'author' ] : true; - $new_settings[ 'single_categories' ] = isset( $new_settings[ 'categories' ] ) ? $new_settings[ 'categories' ] : true; - $new_settings[ 'single_tags' ] = isset( $new_settings[ 'tags' ] ) ? $new_settings[ 'tags' ] : true; - - if ( isset( $new_settings[ 'masonry' ] ) && $new_settings[ 'masonry' ] ) { - $new_settings[ 'column_layout' ] = true; - $new_settings[ 'infinite_scroll' ] = true; - $new_settings[ 'infinite_scroll_button' ] = true; - - if ( 'width2' == $blog_settings['masonry_width'] ) { - $new_settings[ 'columns' ] = '33'; - } - - if ( 'width4' == $blog_settings['masonry_width'] ) { - $new_settings[ 'columns' ] = '50'; - } - - if ( 'width6' == $blog_settings['masonry_width'] ) { - $new_settings[ 'columns' ] = '100'; - } - - if ( 'width2' == $blog_settings[ 'masonry_width' ] ) { - if ( 'width2' !== $blog_settings[ 'masonry_most_recent_width' ] ) { - $new_settings[ 'featured_column' ] = true; - } else { - $new_settings[ 'featured_column' ] = false; - } - } - - if ( 'width4' == $blog_settings[ 'masonry_width' ] ) { - if ( 'width6' == $blog_settings[ 'masonry_most_recent_width' ] ) { - $new_settings[ 'featured_column' ] = true; - } else { - $new_settings[ 'featured_column' ] = false; - } - } - - if ( 'width6' == $blog_settings[ 'masonry_width' ] ) { - $new_settings[ 'featured_column' ] = false; - } - } - - if ( function_exists( 'generate_page_header_get_defaults' ) ) { - $page_header_settings = wp_parse_args( - get_option( 'generate_page_header_settings', array() ), - generate_page_header_get_defaults() - ); - - if ( 'hide' == $page_header_settings[ 'post_header_position' ] ) { - $new_settings[ 'single_post_image' ] = false; - } else { - $new_settings[ 'single_post_image_position' ] = $page_header_settings[ 'post_header_position' ]; - } - - $new_settings[ 'page_post_image_position' ] = $page_header_settings[ 'page_header_position' ]; - } - - unset( $blog_settings['masonry_width'] ); - unset( $blog_settings['masonry_most_recent_width'] ); - - $update_settings = wp_parse_args( $new_settings, $blog_settings ); - update_option( 'generate_blog_settings', $update_settings ); - - // Update our migration option so we don't need to run this again - $updated[ 'blog_visibility_updated' ] = 'true'; - $migration_settings = wp_parse_args( $updated, $settings ); - update_option( 'generate_migration_settings', $migration_settings ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/generate-blog.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/generate-blog.php deleted file mode 100644 index 49fd37fd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/generate-blog.php +++ /dev/null @@ -1,20 +0,0 @@ -register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Get our palettes. - $palettes = generate_get_default_color_palettes(); - - // Add our Colors panel. - if ( class_exists( 'WP_Customize_Panel' ) ) { - $wp_customize->add_panel( - 'generate_colors_panel', - array( - 'priority' => 30, - 'theme_supports' => '', - 'title' => __( 'Colors', 'gp-premium' ), - 'description' => '', - ) - ); - } - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_body_color_shortcuts', - array( - 'section' => 'body_section', - 'element' => __( 'Body', 'gp-premium' ), - 'shortcuts' => array( - 'typography' => 'font_section', - 'backgrounds' => 'generate_backgrounds_body', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - // Add Top Bar Colors section. - if ( isset( $defaults['top_bar_background_color'] ) && function_exists( 'generate_is_top_bar_active' ) ) { - $wp_customize->add_section( - 'generate_top_bar_colors', - array( - 'title' => __( 'Top Bar', 'gp-premium' ), - 'priority' => 40, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[top_bar_background_color]', - array( - 'default' => $defaults['top_bar_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[top_bar_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'generate_top_bar_colors', - 'settings' => 'generate_settings[top_bar_background_color]', - 'palette' => $palettes, - 'show_opacity' => true, - 'priority' => 1, - 'active_callback' => 'generate_is_top_bar_active', - ) - ) - ); - - // Add color settings. - $top_bar_colors = array(); - $top_bar_colors[] = array( - 'slug' => 'top_bar_text_color', - 'default' => $defaults['top_bar_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - 'priority' => 2, - ); - $top_bar_colors[] = array( - 'slug' => 'top_bar_link_color', - 'default' => $defaults['top_bar_link_color'], - 'label' => __( 'Link', 'gp-premium' ), - 'priority' => 3, - ); - $top_bar_colors[] = array( - 'slug' => 'top_bar_link_color_hover', - 'default' => $defaults['top_bar_link_color_hover'], - 'label' => __( 'Link Hover', 'gp-premium' ), - 'priority' => 4, - ); - - foreach ( $top_bar_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'generate_top_bar_colors', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - 'priority' => $color['priority'], - 'palette' => $palettes, - 'active_callback' => 'generate_is_top_bar_active', - ) - ) - ); - } - } - - // Add Header Colors section. - $wp_customize->add_section( - 'header_color_section', - array( - 'title' => __( 'Header', 'gp-premium' ), - 'priority' => 50, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_header_color_shortcuts', - array( - 'section' => 'header_color_section', - 'element' => __( 'Header', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_header', - 'typography' => 'font_header_section', - 'backgrounds' => 'generate_backgrounds_header', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[header_background_color]', - array( - 'default' => $defaults['header_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[header_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'header_color_section', - 'settings' => 'generate_settings[header_background_color]', - 'palette' => $palettes, - 'show_opacity' => true, - 'priority' => 1, - ) - ) - ); - - // Add color settings. - $header_colors = array(); - $header_colors[] = array( - 'slug' => 'header_text_color', - 'default' => $defaults['header_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - 'priority' => 2, - ); - $header_colors[] = array( - 'slug' => 'header_link_color', - 'default' => $defaults['header_link_color'], - 'label' => __( 'Link', 'gp-premium' ), - 'priority' => 3, - ); - $header_colors[] = array( - 'slug' => 'header_link_hover_color', - 'default' => $defaults['header_link_hover_color'], - 'label' => __( 'Link Hover', 'gp-premium' ), - 'priority' => 4, - ); - $header_colors[] = array( - 'slug' => 'site_title_color', - 'default' => $defaults['site_title_color'], - 'label' => __( 'Site Title', 'gp-premium' ), - 'priority' => 5, - ); - $header_colors[] = array( - 'slug' => 'site_tagline_color', - 'default' => $defaults['site_tagline_color'], - 'label' => __( 'Tagline', 'gp-premium' ), - 'priority' => 6, - ); - - foreach ( $header_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'header_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - 'priority' => $color['priority'], - 'palette' => $palettes, - ) - ) - ); - } - - // Add Navigation section. - $wp_customize->add_section( - 'navigation_color_section', - array( - 'title' => __( 'Primary Navigation', 'gp-premium' ), - 'priority' => 60, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_primary_navigation_color_shortcuts', - array( - 'section' => 'navigation_color_section', - 'element' => __( 'Primary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_navigation', - 'typography' => 'font_navigation_section', - 'backgrounds' => 'generate_backgrounds_navigation', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_primary_navigation_parent_items', - array( - 'section' => 'navigation_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Parent Items', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_background_color]', - array( - 'default' => $defaults['navigation_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[navigation_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[navigation_background_color]', - 'palette' => $palettes, - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_background_hover_color]', - array( - 'default' => $defaults['navigation_background_hover_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[navigation_background_hover_color]', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[navigation_background_hover_color]', - 'palette' => $palettes, - 'priority' => 3, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_background_current_color]', - array( - 'default' => $defaults['navigation_background_current_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[navigation_background_current_color]', - array( - 'label' => __( 'Background Current', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[navigation_background_current_color]', - 'palette' => $palettes, - 'priority' => 5, - ) - ) - ); - - // Add color settings. - $navigation_colors = array(); - $navigation_colors[] = array( - 'slug' => 'navigation_text_color', - 'default' => $defaults['navigation_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - 'priority' => 2, - ); - $navigation_colors[] = array( - 'slug' => 'navigation_text_hover_color', - 'default' => $defaults['navigation_text_hover_color'], - 'label' => __( 'Text Hover', 'gp-premium' ), - 'priority' => 4, - ); - $navigation_colors[] = array( - 'slug' => 'navigation_text_current_color', - 'default' => $defaults['navigation_text_current_color'], - 'label' => __( 'Text Current', 'gp-premium' ), - 'priority' => 6, - ); - - foreach ( $navigation_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - 'priority' => $color['priority'], - ) - ) - ); - } - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_primary_navigation_sub_menu_items', - array( - 'section' => 'navigation_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Sub-Menu Items', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 7, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[subnavigation_background_color]', - array( - 'default' => $defaults['subnavigation_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[subnavigation_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[subnavigation_background_color]', - 'palette' => $palettes, - 'priority' => 8, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[subnavigation_background_hover_color]', - array( - 'default' => $defaults['subnavigation_background_hover_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[subnavigation_background_hover_color]', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[subnavigation_background_hover_color]', - 'palette' => $palettes, - 'priority' => 10, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[subnavigation_background_current_color]', - array( - 'default' => $defaults['subnavigation_background_current_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[subnavigation_background_current_color]', - array( - 'label' => __( 'Background Current', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[subnavigation_background_current_color]', - 'palette' => $palettes, - 'priority' => 12, - ) - ) - ); - - // Add color settings. - $subnavigation_colors = array(); - $subnavigation_colors[] = array( - 'slug' => 'subnavigation_text_color', - 'default' => $defaults['subnavigation_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - 'priority' => 9, - ); - $subnavigation_colors[] = array( - 'slug' => 'subnavigation_text_hover_color', - 'default' => $defaults['subnavigation_text_hover_color'], - 'label' => __( 'Text Hover', 'gp-premium' ), - 'priority' => 11, - ); - $subnavigation_colors[] = array( - 'slug' => 'subnavigation_text_current_color', - 'default' => $defaults['subnavigation_text_current_color'], - 'label' => __( 'Text Current', 'gp-premium' ), - 'priority' => 13, - ); - - foreach ( $subnavigation_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - 'priority' => $color['priority'], - ) - ) - ); - } - - if ( isset( $defaults['navigation_search_background_color'] ) ) { - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_primary_navigation_search', - array( - 'section' => 'navigation_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Navigation Search', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 15, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_search_background_color]', - array( - 'default' => $defaults['navigation_search_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[navigation_search_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[navigation_search_background_color]', - 'palette' => $palettes, - 'priority' => 16, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_search_text_color]', - array( - 'default' => $defaults['navigation_search_text_color'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[navigation_search_text_color]', - array( - 'label' => __( 'Text', 'gp-premium' ), - 'section' => 'navigation_color_section', - 'settings' => 'generate_settings[navigation_search_text_color]', - 'priority' => 17, - ) - ) - ); - } - - $wp_customize->add_section( - 'buttons_color_section', - array( - 'title' => __( 'Buttons', 'gp-premium' ), - 'priority' => 75, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_buttons_color_shortcuts', - array( - 'section' => 'buttons_color_section', - 'element' => __( 'Button', 'gp-premium' ), - 'shortcuts' => array( - 'typography' => 'font_buttons_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_button_background_color]', - array( - 'default' => $defaults['form_button_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[form_button_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'buttons_color_section', - 'settings' => 'generate_settings[form_button_background_color]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_button_text_color]', - array( - 'default' => $defaults['form_button_text_color'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'form_button_text_color', - array( - 'label' => __( 'Text', 'gp-premium' ), - 'section' => 'buttons_color_section', - 'settings' => 'generate_settings[form_button_text_color]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_button_background_color_hover]', - array( - 'default' => $defaults['form_button_background_color_hover'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[form_button_background_color_hover]', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'buttons_color_section', - 'settings' => 'generate_settings[form_button_background_color_hover]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_button_text_color_hover]', - array( - 'default' => $defaults['form_button_text_color_hover'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'form_button_text_color_hover', - array( - 'label' => __( 'Text Hover', 'gp-premium' ), - 'section' => 'buttons_color_section', - 'settings' => 'generate_settings[form_button_text_color_hover]', - ) - ) - ); - - // Add Content Colors section. - $wp_customize->add_section( - 'content_color_section', - array( - 'title' => __( 'Content', 'gp-premium' ), - 'priority' => 80, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_content_color_shortcuts', - array( - 'section' => 'content_color_section', - 'element' => __( 'Content', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_container', - 'typography' => 'font_content_section', - 'backgrounds' => 'generate_backgrounds_content', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[content_background_color]', - array( - 'default' => $defaults['content_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[content_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'content_color_section', - 'settings' => 'generate_settings[content_background_color]', - 'palette' => $palettes, - 'priority' => 1, - ) - ) - ); - - // Add color settings. - $content_colors = array(); - $content_colors[] = array( - 'slug' => 'content_text_color', - 'default' => $defaults['content_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - 'priority' => 2, - ); - $content_colors[] = array( - 'slug' => 'content_link_color', - 'default' => $defaults['content_link_color'], - 'label' => __( 'Link', 'gp-premium' ), - 'priority' => 3, - ); - $content_colors[] = array( - 'slug' => 'content_link_hover_color', - 'default' => $defaults['content_link_hover_color'], - 'label' => __( 'Link Hover', 'gp-premium' ), - 'priority' => 4, - ); - $content_colors[] = array( - 'slug' => 'content_title_color', - 'default' => $defaults['content_title_color'], - 'label' => __( 'Content Title', 'gp-premium' ), - 'priority' => 5, - ); - $content_colors[] = array( - 'slug' => 'blog_post_title_color', - 'default' => $defaults['blog_post_title_color'], - 'label' => __( 'Archive Content Title', 'gp-premium' ), - 'priority' => 6, - ); - $content_colors[] = array( - 'slug' => 'blog_post_title_hover_color', - 'default' => $defaults['blog_post_title_hover_color'], - 'label' => __( 'Archive Content Title Hover', 'gp-premium' ), - 'priority' => 7, - ); - $content_colors[] = array( - 'slug' => 'entry_meta_text_color', - 'default' => $defaults['entry_meta_text_color'], - 'label' => __( 'Entry Meta Text', 'gp-premium' ), - 'priority' => 8, - ); - $content_colors[] = array( - 'slug' => 'entry_meta_link_color', - 'default' => $defaults['entry_meta_link_color'], - 'label' => __( 'Entry Meta Links', 'gp-premium' ), - 'priority' => 9, - ); - $content_colors[] = array( - 'slug' => 'entry_meta_link_color_hover', - 'default' => $defaults['entry_meta_link_color_hover'], - 'label' => __( 'Entry Meta Links Hover', 'gp-premium' ), - 'priority' => 10, - ); - $content_colors[] = array( - 'slug' => 'h1_color', - 'default' => $defaults['h1_color'], - 'label' => __( 'Heading 1 (H1) Color', 'gp-premium' ), - 'priority' => 11, - ); - $content_colors[] = array( - 'slug' => 'h2_color', - 'default' => $defaults['h2_color'], - 'label' => __( 'Heading 2 (H2) Color', 'gp-premium' ), - 'priority' => 12, - ); - $content_colors[] = array( - 'slug' => 'h3_color', - 'default' => $defaults['h3_color'], - 'label' => __( 'Heading 3 (H3) Color', 'gp-premium' ), - 'priority' => 13, - ); - - if ( isset( $defaults['h4_color'] ) ) { - $content_colors[] = array( - 'slug' => 'h4_color', - 'default' => $defaults['h4_color'], - 'label' => __( 'Heading 4 (H4) Color', 'gp-premium' ), - 'priority' => 14, - ); - } - - if ( isset( $defaults['h5_color'] ) ) { - $content_colors[] = array( - 'slug' => 'h5_color', - 'default' => $defaults['h5_color'], - 'label' => __( 'Heading 5 (H5) Color', 'gp-premium' ), - 'priority' => 15, - ); - } - - foreach ( $content_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'content_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - 'priority' => $color['priority'], - ) - ) - ); - } - - // Add Sidebar Widget colors. - $wp_customize->add_section( - 'sidebar_widget_color_section', - array( - 'title' => __( 'Sidebar Widgets', 'gp-premium' ), - 'priority' => 90, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_sidebar_color_shortcuts', - array( - 'section' => 'sidebar_widget_color_section', - 'element' => __( 'Sidebar', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_sidebars', - 'typography' => 'font_widget_section', - 'backgrounds' => 'generate_backgrounds_sidebars', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[sidebar_widget_background_color]', - array( - 'default' => $defaults['sidebar_widget_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[sidebar_widget_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'sidebar_widget_color_section', - 'settings' => 'generate_settings[sidebar_widget_background_color]', - 'palette' => $palettes, - 'priority' => 1, - ) - ) - ); - - // Add color settings. - $sidebar_widget_colors = array(); - $sidebar_widget_colors[] = array( - 'slug' => 'sidebar_widget_text_color', - 'default' => $defaults['sidebar_widget_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - 'priority' => 2, - ); - $sidebar_widget_colors[] = array( - 'slug' => 'sidebar_widget_link_color', - 'default' => $defaults['sidebar_widget_link_color'], - 'label' => __( 'Link', 'gp-premium' ), - 'priority' => 3, - ); - $sidebar_widget_colors[] = array( - 'slug' => 'sidebar_widget_link_hover_color', - 'default' => $defaults['sidebar_widget_link_hover_color'], - 'label' => __( 'Link Hover', 'gp-premium' ), - 'priority' => 4, - ); - $sidebar_widget_colors[] = array( - 'slug' => 'sidebar_widget_title_color', - 'default' => $defaults['sidebar_widget_title_color'], - 'label' => __( 'Widget Title', 'gp-premium' ), - 'priority' => 5, - ); - - foreach ( $sidebar_widget_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'sidebar_widget_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - 'priority' => $color['priority'], - ) - ) - ); - } - - // Add Form colors. - $wp_customize->add_section( - 'form_color_section', - array( - 'title' => __( 'Forms', 'gp-premium' ), - 'priority' => 130, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_background_color]', - array( - 'default' => $defaults['form_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[form_background_color]', - array( - 'label' => __( 'Form Background', 'gp-premium' ), - 'section' => 'form_color_section', - 'settings' => 'generate_settings[form_background_color]', - 'palette' => $palettes, - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_background_color_focus]', - array( - 'default' => $defaults['form_background_color_focus'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[form_background_color_focus]', - array( - 'label' => __( 'Form Background Focus', 'gp-premium' ), - 'section' => 'form_color_section', - 'settings' => 'generate_settings[form_background_color_focus]', - 'palette' => $palettes, - 'priority' => 3, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_border_color]', - array( - 'default' => $defaults['form_border_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[form_border_color]', - array( - 'label' => __( 'Form Border', 'gp-premium' ), - 'section' => 'form_color_section', - 'settings' => 'generate_settings[form_border_color]', - 'palette' => $palettes, - 'priority' => 5, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[form_border_color_focus]', - array( - 'default' => $defaults['form_border_color_focus'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[form_border_color_focus]', - array( - 'label' => __( 'Form Border Focus', 'gp-premium' ), - 'section' => 'form_color_section', - 'settings' => 'generate_settings[form_border_color_focus]', - 'palette' => $palettes, - 'priority' => 6, - ) - ) - ); - - // Add color settings. - $form_colors = array(); - $form_colors[] = array( - 'slug' => 'form_text_color', - 'default' => $defaults['form_text_color'], - 'label' => __( 'Form Text', 'gp-premium' ), - 'priority' => 2, - ); - $form_colors[] = array( - 'slug' => 'form_text_color_focus', - 'default' => $defaults['form_text_color_focus'], - 'label' => __( 'Form Text Focus', 'gp-premium' ), - 'priority' => 4, - ); - - foreach ( $form_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'form_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - 'priority' => $color['priority'], - ) - ) - ); - } - - // Add Footer colors. - $wp_customize->add_section( - 'footer_color_section', - array( - 'title' => __( 'Footer', 'gp-premium' ), - 'priority' => 150, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_footer_color_shortcuts', - array( - 'section' => 'footer_color_section', - 'element' => __( 'Footer', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_footer', - 'typography' => 'font_footer_section', - 'backgrounds' => 'generate_backgrounds_footer', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_footer_widgets_title', - array( - 'section' => 'footer_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Footer Widgets', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[footer_widget_background_color]', - array( - 'default' => $defaults['footer_widget_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[footer_widget_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[footer_widget_background_color]', - 'palette' => $palettes, - ) - ) - ); - - // Add color settings. - $footer_widget_colors = array(); - $footer_widget_colors[] = array( - 'slug' => 'footer_widget_text_color', - 'default' => $defaults['footer_widget_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - ); - $footer_widget_colors[] = array( - 'slug' => 'footer_widget_link_color', - 'default' => $defaults['footer_widget_link_color'], - 'label' => __( 'Link', 'gp-premium' ), - ); - $footer_widget_colors[] = array( - 'slug' => 'footer_widget_link_hover_color', - 'default' => $defaults['footer_widget_link_hover_color'], - 'label' => __( 'Link Hover', 'gp-premium' ), - ); - $footer_widget_colors[] = array( - 'slug' => 'footer_widget_title_color', - 'default' => $defaults['footer_widget_title_color'], - 'label' => __( 'Widget Title', 'gp-premium' ), - ); - - foreach ( $footer_widget_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - ) - ) - ); - } - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_footer_title', - array( - 'section' => 'footer_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Footer Bar', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[footer_background_color]', - array( - 'default' => $defaults['footer_background_color'], - 'type' => 'option', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[footer_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[footer_background_color]', - 'palette' => $palettes, - ) - ) - ); - - // Add color settings. - $footer_colors = array(); - $footer_colors[] = array( - 'slug' => 'footer_text_color', - 'default' => $defaults['footer_text_color'], - 'label' => __( 'Text', 'gp-premium' ), - ); - $footer_colors[] = array( - 'slug' => 'footer_link_color', - 'default' => $defaults['footer_link_color'], - 'label' => __( 'Link', 'gp-premium' ), - ); - $footer_colors[] = array( - 'slug' => 'footer_link_hover_color', - 'default' => $defaults['footer_link_hover_color'], - 'label' => __( 'Link Hover', 'gp-premium' ), - ); - - foreach ( $footer_colors as $color ) { - $wp_customize->add_setting( - 'generate_settings[' . $color['slug'] . ']', - array( - 'default' => $color['default'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - $color['slug'], - array( - 'label' => $color['label'], - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[' . $color['slug'] . ']', - ) - ) - ); - } - - if ( isset( $defaults['back_to_top_background_color'] ) ) { - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_back_to_top_title', - array( - 'section' => 'footer_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Back to Top Button', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[back_to_top_background_color]', - array( - 'default' => $defaults['back_to_top_background_color'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[back_to_top_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[back_to_top_background_color]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[back_to_top_text_color]', - array( - 'default' => $defaults['back_to_top_text_color'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[back_to_top_text_color]', - array( - 'label' => __( 'Text', 'gp-premium' ), - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[back_to_top_text_color]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[back_to_top_background_color_hover]', - array( - 'default' => $defaults['back_to_top_background_color_hover'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[back_to_top_background_color_hover]', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[back_to_top_background_color_hover]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[back_to_top_text_color_hover]', - array( - 'default' => $defaults['back_to_top_text_color_hover'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[back_to_top_text_color_hover]', - array( - 'label' => __( 'Text Hover', 'gp-premium' ), - 'section' => 'footer_color_section', - 'settings' => 'generate_settings[back_to_top_text_color_hover]', - ) - ) - ); - } - } -} - -if ( ! function_exists( 'generate_get_color_setting' ) ) { - /** - * Wrapper function to get our settings - * - * @since 1.3.42 - * @param string $setting The setting to check. - */ - function generate_get_color_setting( $setting ) { - - // Bail if we don't have our color defaults. - if ( ! function_exists( 'generate_get_color_defaults' ) ) { - return; - } - - if ( function_exists( 'generate_get_defaults' ) ) { - $defaults = array_merge( generate_get_defaults(), generate_get_color_defaults() ); - } else { - $defaults = generate_get_color_defaults(); - } - - $generate_settings = wp_parse_args( - get_option( 'generate_settings', array() ), - $defaults - ); - - return $generate_settings[ $setting ]; - } -} - -if ( ! function_exists( 'generate_colors_rgba_to_hex' ) ) { - /** - * Convert RGBA to hex if necessary - * - * @since 1.3.42 - * @param string $rgba The string to convert to hex. - */ - function generate_colors_rgba_to_hex( $rgba ) { - // If it's not rgba, return it. - if ( false === strpos( $rgba, 'rgba' ) ) { - return $rgba; - } - - return substr( $rgba, 0, strrpos( $rgba, ',' ) ) . ')'; - } -} - -if ( ! function_exists( 'generate_get_default_color_palettes' ) ) { - /** - * Set up our colors for the color picker palettes and filter them so you can change them - * - * @since 1.3.42 - */ - function generate_get_default_color_palettes() { - $palettes = array( - generate_colors_rgba_to_hex( generate_get_color_setting( 'link_color' ) ), - generate_colors_rgba_to_hex( generate_get_color_setting( 'background_color' ) ), - generate_colors_rgba_to_hex( generate_get_color_setting( 'navigation_background_color' ) ), - generate_colors_rgba_to_hex( generate_get_color_setting( 'navigation_background_hover_color' ) ), - '#F1C40F', - '#1e72bd', - '#1ABC9C', - '#3498DB', - ); - - return apply_filters( 'generate_default_color_palettes', $palettes ); - } -} - -if ( ! function_exists( 'generate_enqueue_color_palettes' ) ) { - add_action( 'customize_controls_enqueue_scripts', 'generate_enqueue_color_palettes', 1001 ); - /** - * Add our custom color palettes to the color pickers in the Customizer. - * Hooks into 1001 priority to show up after Secondary Nav. - * - * @since 1.3.42 - */ - function generate_enqueue_color_palettes() { - // Old versions of WP don't get nice things. - if ( ! function_exists( 'wp_add_inline_script' ) ) { - return; - } - - // Grab our palette array and turn it into JS. - $palettes = wp_json_encode( generate_get_default_color_palettes() ); - - // Add our custom palettes. - // json_encode takes care of escaping. - wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' ); - } -} - -if ( ! function_exists( 'generate_colors_customizer_live_preview' ) ) { - add_action( 'customize_preview_init', 'generate_colors_customizer_live_preview' ); - /** - * Add our live preview javascript. - * - * @since 0.1 - */ - function generate_colors_customizer_live_preview() { - wp_enqueue_script( - 'generate-colors-customizer', - trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/customizer.js', - array( 'jquery', 'customize-preview' ), - GENERATE_COLORS_VERSION, - true - ); - - wp_register_script( - 'generate-wc-colors-customizer', - trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/wc-customizer.js', - array( 'jquery', 'customize-preview', 'generate-colors-customizer' ), - GENERATE_COLORS_VERSION, - true - ); - - wp_register_script( - 'generate-menu-plus-colors-customizer', - trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/menu-plus-customizer.js', - array( 'jquery', 'customize-preview', 'generate-colors-customizer' ), - GENERATE_COLORS_VERSION, - true - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/customizer.js deleted file mode 100644 index a2fb4253..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/customizer.js +++ /dev/null @@ -1,620 +0,0 @@ -/** - * Theme Customizer enhancements for a better user experience. - * - * Contains handlers to make Theme Customizer preview reload changes asynchronously. - */ -function generate_colors_live_update( id, selector, property, default_value, get_value, settings ) { - default_value = typeof default_value !== 'undefined' ? default_value : 'initial'; - get_value = typeof get_value !== 'undefined' ? get_value : ''; - settings = typeof settings !== 'undefined' ? settings : 'generate_settings'; - wp.customize( settings + '[' + id + ']', function( value ) { - value.bind( function( newval ) { - - // Stop the header link color from applying to the site title. - if ( 'header_link_color' === id || 'header_link_color' === id ) { - jQuery( '.site-header a' ).addClass( 'header-link' ); - jQuery( '.site-header .main-title a' ).removeClass( 'header-link' ); - } - - if ( 'content_link_color' === id || 'content_link_color_hover' === id || 'entry_meta_link_color' === id || 'blog_post_title_color' === id ) { - var content_link = jQuery( '.inside-article a' ); - var meta = jQuery( '.entry-meta a' ); - var title = jQuery( '.entry-title a' ); - - content_link.attr( 'data-content-link-color', true ); - - if ( '' !== wp.customize.value('generate_settings[entry_meta_link_color]')() ) { - meta.attr( 'data-content-link-color', '' ); - } else { - meta.attr( 'data-content-link-color', true ); - } - - if ( '' !== wp.customize.value('generate_settings[blog_post_title_color]')() ) { - title.attr( 'data-content-link-color', '' ); - } else { - title.attr( 'data-content-link-color', true ); - } - } - - default_value = ( '' !== get_value ) ? wp.customize.value('generate_settings[' + get_value + ']')() : default_value; - newval = ( '' !== newval ) ? newval : default_value; - var unique_id = ( 'generate_secondary_nav_settings' == settings ) ? 'secondary_' : ''; - if ( jQuery( 'style#' + unique_id + id ).length ) { - jQuery( 'style#' + unique_id + id ).html( selector + '{' + property + ':' + newval + ';}' ); - } else { - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#' + id ).not( ':last' ).remove(); - }, 1000); - } - - } ); - } ); -} - -/** - * Header background color - * Empty: transparent - */ -generate_colors_live_update( 'top_bar_background_color', '.top-bar', 'background-color', 'transparent' ); - -/** - * Header text color - * Empty: text_color - */ -generate_colors_live_update( 'top_bar_text_color', '.top-bar', 'color', '', 'text_color' ); - -/** - * Header link color - * Empty: link_color - */ -generate_colors_live_update( 'top_bar_link_color', '.top-bar a, .top-bar a:visited', 'color', '', 'link_color' ); - -/** - * Header link color hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'top_bar_link_color_hover', '.top-bar a:hover', 'color', '', 'link_color_hover' ); - - -/** - * Header background color - * Empty: transparent - */ -generate_colors_live_update( 'header_background_color', '.site-header', 'background-color', 'transparent' ); - -/** - * Header text color - * Empty: text_color - */ -generate_colors_live_update( 'header_text_color', '.site-header', 'color', '', 'text_color' ); - -/** - * Header link color - * Empty: link_color - */ -generate_colors_live_update( 'header_link_color', '.site-header a.header-link, .site-header a.header-link:visited', 'color', '', 'link_color' ); - -/** - * Header link color hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'header_link_hover_color', '.site-header a.header-link:hover', 'color', '', 'link_color_hover' ); - -/** - * Site title color - * Empty: link_color - */ -generate_colors_live_update( 'site_title_color', '.main-title a,.main-title a:hover,.main-title a:visited,.header-wrap .navigation-stick .main-title a, .header-wrap .navigation-stick .main-title a:hover, .header-wrap .navigation-stick .main-title a:visited', 'color', '', 'link_color' ); - -/** - * Site tagline color - * Empty: text_color - */ -generate_colors_live_update( 'site_tagline_color', '.site-description', 'color', '', 'text_color' ); - -/** - * Main navigation background - * Empty: transparent - */ -generate_colors_live_update( 'navigation_background_color', '.main-navigation', 'background-color', 'transparent' ); - -/** - * Primary navigation text color - * Empty: link_color - */ -generate_colors_live_update( 'navigation_text_color', - '.main-navigation .main-nav ul li a,\ - .menu-toggle,button.menu-toggle:hover,\ - button.menu-toggle:focus,\ - .main-navigation .mobile-bar-items a,\ - .main-navigation .mobile-bar-items a:hover,\ - .main-navigation .mobile-bar-items a:focus,\ - .main-navigation .menu-bar-items', - 'color', '', 'link_color' -); - -/** - * Primary navigation text color hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'navigation_text_hover_color', - '.navigation-search input[type="search"],\ - .navigation-search input[type="search"]:active,\ - .navigation-search input[type="search"]:focus,\ - .main-navigation .main-nav ul li:hover > a,\ - .main-navigation .main-nav ul li:focus > a,\ - .main-navigation .main-nav ul li.sfHover > a,\ - .main-navigation .menu-bar-item:hover a', - 'color', '', 'link_color_hover' -); - -/** - * Primary navigation menu item hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'navigation_background_hover_color', - '.navigation-search input[type="search"],\ - .navigation-search input[type="search"]:focus,\ - .main-navigation .main-nav ul li:hover > a,\ - .main-navigation .main-nav ul li:focus > a,\ - .main-navigation .main-nav ul li.sfHover > a,\ - .main-navigation .menu-bar-item:hover a', - 'background-color', 'transparent' -); - -/** - * Primary sub-navigation color - * Empty: transparent - */ -generate_colors_live_update( 'subnavigation_background_color', '.main-navigation ul ul', 'background-color', 'transparent' ); - -/** - * Primary sub-navigation text color - * Empty: link_color - */ -generate_colors_live_update( 'subnavigation_text_color', '.main-navigation .main-nav ul ul li a', 'color', 'link_color' ); - -/** - * Primary sub-navigation hover - */ -var subnavigation_hover = '.main-navigation .main-nav ul ul li:hover > a, \ - .main-navigation .main-nav ul ul li:focus > a, \ - .main-navigation .main-nav ul ul li.sfHover > a'; - -/** - * Primary sub-navigation text hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'subnavigation_text_hover_color', subnavigation_hover, 'color', '', 'link_color_hover' ); - -/** - * Primary sub-navigation background hover - * Empty: transparent - */ -generate_colors_live_update( 'subnavigation_background_hover_color', subnavigation_hover, 'background-color', 'transparent' ); - -/** - * Navigation current selectors - */ -var navigation_current = '.main-navigation .main-nav ul li[class*="current-menu-"] > a, \ - .main-navigation .main-nav ul li[class*="current-menu-"]:hover > a, \ - .main-navigation .main-nav ul li[class*="current-menu-"].sfHover > a'; - -/** - * Primary navigation current text - * Empty: link_color - */ -generate_colors_live_update( 'navigation_text_current_color', navigation_current, 'color', '', 'link_color' ); - -/** - * Primary navigation current text - * Empty: transparent - */ -generate_colors_live_update( 'navigation_background_current_color', navigation_current, 'background-color', 'transparent' ); - -/** - * Primary sub-navigation current selectors - */ -var subnavigation_current = '.main-navigation .main-nav ul ul li[class*="current-menu-"] > a,\ - .main-navigation .main-nav ul ul li[class*="current-menu-"]:hover > a, \ - .main-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a'; - -/** - * Primary sub-navigation current text - * Empty: link_color - */ -generate_colors_live_update( 'subnavigation_text_current_color', subnavigation_current, 'color', '', 'link_color' ); - -/** - * Primary navigation current item background - * Empty: transparent - */ -generate_colors_live_update( 'subnavigation_background_current_color', subnavigation_current, 'background-color', 'transparent' ); - -/** - * Secondary navigation background - * Empty: transparent - */ -generate_colors_live_update( 'navigation_background_color', '.secondary-navigation', 'background-color', 'transparent', '', 'generate_secondary_nav_settings' ); - -/** - * Secondary navigation text color - * Empty: link_color - */ -generate_colors_live_update( 'navigation_text_color', - '.secondary-navigation .main-nav ul li a,\ - .secondary-navigation .menu-toggle,\ - button.secondary-menu-toggle:hover,\ - button.secondary-menu-toggle:focus, \ - .secondary-navigation .top-bar, \ - .secondary-navigation .top-bar a,\ - .secondary-menu-bar-items,\ - .secondary-menu-bar-items .menu-bar-item > a', - 'color', '', 'link_color', 'generate_secondary_nav_settings' -); - -/** - * Navigation search - */ -wp.customize( 'generate_settings[navigation_search_background_color]', function( value ) { - value.bind( function( newval ) { - if ( jQuery( 'style#navigation_search_background_color' ).length ) { - jQuery( 'style#navigation_search_background_color' ).html( '.navigation-search input[type="search"],.navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus, .main-navigation .main-nav ul li.search-item.active > a, .main-navigation .menu-bar-items .search-item.active > a{background-color:' + newval + ';}' ); - } else { - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#navigation_search_background_color' ).not( ':last' ).remove(); - }, 1000); - } - - if ( jQuery( 'style#navigation_search_background_opacity' ).length ) { - if ( newval ) { - jQuery( 'style#navigation_search_background_opacity' ).html( '.navigation-search input{opacity: 1;}' ); - } else { - jQuery( 'style#navigation_search_background_opacity' ).html( '.navigation-search input{opacity: 0.9;}' ); - } - } else { - if ( newval ) { - jQuery( 'head' ).append( '' ); - } - - setTimeout(function() { - jQuery( 'style#navigation_search_background_opacity' ).not( ':last' ).remove(); - }, 1000); - } - } ); -} ); - -generate_colors_live_update( 'navigation_search_text_color', '.navigation-search input[type="search"],.navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus, .main-navigation .main-nav ul li.search-item.active > a, .main-navigation .menu-bar-items .search-item.active > a', 'color', '' ); - -/** - * Secondary navigation text color hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'navigation_text_hover_color', - '.secondary-navigation .main-nav ul li:hover > a, \ - .secondary-navigation .main-nav ul li:focus > a, \ - .secondary-navigation .main-nav ul li.sfHover > a,\ - .secondary-menu-bar-items .menu-bar-item:hover > a', - 'color', '', 'link_color_hover', 'generate_secondary_nav_settings' -); - -/** - * Secondary navigation menu item hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'navigation_background_hover_color', - '.secondary-navigation .main-nav ul li:hover > a, \ - .secondary-navigation .main-nav ul li:focus > a, \ - .secondary-navigation .main-nav ul li.sfHover > a, \ - .secondary-menu-bar-items .menu-bar-item:hover > a', - 'background-color', 'transparent', '', 'generate_secondary_nav_settings' -); - -/** - * Secondary navigation top bar link hover - */ -wp.customize( 'generate_secondary_nav_settings[navigation_background_hover_color]', function( value ) { - value.bind( function( newval ) { - if ( jQuery( 'style#secondary_nav_top_bar_hover' ).length ) { - jQuery( 'style#secondary_nav_top_bar_hover' ).html( '.secondary-navigation .top-bar a:hover,.secondary-navigation .top-bar a:focus{color:' + newval + ';}' ); - } else { - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#secondary_nav_top_bar_hover' ).not( ':last' ).remove(); - }, 1000); - } - } ); -} ); - -generate_colors_live_update( 'navigation_top_bar_hover_color', - '.secondary-navigation .top-bar a:hover, \ - .secondary-navigation .top-bar a:focus', - 'color', 'transparent', '', 'generate_secondary_nav_settings' -); - -/** - * Secondary sub-navigation color - * Empty: transparent - */ -generate_colors_live_update( 'subnavigation_background_color', '.secondary-navigation ul ul', 'background-color', 'transparent', '', 'generate_secondary_nav_settings' ); - -/** - * Secondary sub-navigation text color - * Empty: link_color - */ -generate_colors_live_update( 'subnavigation_text_color', '.secondary-navigation .main-nav ul ul li a', 'color', '', 'link_color', 'generate_secondary_nav_settings' ); - -/** - * Secondary sub-navigation hover - */ -var secondary_subnavigation_hover = '.secondary-navigation .main-nav ul ul li > a:hover, \ - .secondary-navigation .main-nav ul ul li:focus > a, \ - .secondary-navigation .main-nav ul ul li.sfHover > a'; - -/** - * Secondary sub-navigation text hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'subnavigation_text_hover_color', secondary_subnavigation_hover, 'color', '', 'link_color_hover', 'generate_secondary_nav_settings' ); - -/** - * Secondary sub-navigation background hover - * Empty: transparent - */ -generate_colors_live_update( 'subnavigation_background_hover_color', secondary_subnavigation_hover, 'background-color', 'transparent', '', 'generate_secondary_nav_settings' ); - -/** - * Secondary navigation current selectors - */ -var secondary_navigation_current = '.secondary-navigation .main-nav ul li[class*="current-menu-"] > a, \ - .secondary-navigation .main-nav ul li[class*="current-menu-"]:hover > a, \ - .secondary-navigation .main-nav ul li[class*="current-menu-"].sfHover > a'; - -/** - * Secondary navigation current text - * Empty: link_color - */ -generate_colors_live_update( 'navigation_text_current_color', secondary_navigation_current, 'color', '', 'link_color', 'generate_secondary_nav_settings' ); - -/** - * Secondary navigation current text - * Empty: transparent - */ -generate_colors_live_update( 'navigation_background_current_color', secondary_navigation_current, 'background-color', 'transparent', '', 'generate_secondary_nav_settings' ); - -/** - * Secondary sub-navigation current selectors - */ -var secondary_subnavigation_current = '.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a,\ - .secondary-navigation .main-nav ul ul li[class*="current-menu-"]:hover > a, \ - .secondary-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a'; - -/** - * Secondary sub-navigation current text - * Empty: link_color - */ -generate_colors_live_update( 'subnavigation_text_current_color', secondary_subnavigation_current, 'color', '', 'link_color', 'generate_secondary_nav_settings' ); - -/** - * Primary navigation current item background - * Empty: transparent - */ -generate_colors_live_update( 'subnavigation_background_current_color', secondary_subnavigation_current, 'background-color', 'transparent', '', 'generate_secondary_nav_settings' ); - -/** - * Content selectors - */ -var content = '.separate-containers .inside-article,\ - .separate-containers .comments-area,\ - .separate-containers .page-header,\ - .one-container .container,\ - .separate-containers .paging-navigation,\ - .inside-page-header'; - -/** - * Content background - * Empty: transparent - */ -generate_colors_live_update( 'content_background_color', content, 'background-color', 'transparent' ); - -/** - * Content text color - * Empty: text_color - */ -generate_colors_live_update( 'content_text_color', content, 'color', '', 'text_color' ); - -/** - * Content links - * Empty: link_color - */ -generate_colors_live_update( 'content_link_color', - '.inside-article a:not(.button):not(.wp-block-button__link)[data-content-link-color=true], \ - .inside-article a:not(.button):not(.wp-block-button__link)[data-content-link-color=true]:visited,\ - .paging-navigation a,\ - .paging-navigation a:visited,\ - .comments-area a,\ - .comments-area a:visited,\ - .page-header a,\ - .page-header a:visited', - 'color', '', 'link_color' -); - -/** - * Content links on hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'content_link_hover_color', - '.inside-article a:not(.button):not(.wp-block-button__link)[data-content-link-color=true]:hover,\ - .paging-navigation a:hover,\ - .comments-area a:hover,\ - .page-header a:hover', - 'color', '', 'link_color_hover' -); - -generate_colors_live_update( 'content_title_color', '.entry-header h1,.page-header h1', 'color', 'inherit', 'text_color' ); -generate_colors_live_update( 'blog_post_title_color', '.entry-title a,.entry-title a:visited', 'color', '', 'link_color' ); -generate_colors_live_update( 'blog_post_title_hover_color', '.entry-title a:hover', 'color', '', 'link_color_hover' ); -generate_colors_live_update( 'entry_meta_text_color', '.entry-meta', 'color', '', 'text_color' ); -generate_colors_live_update( 'entry_meta_link_color', '.entry-meta a, .entry-meta a:visited', 'color', '', 'link_color' ); -generate_colors_live_update( 'entry_meta_link_color_hover', '.entry-meta a:hover', 'color', '', 'link_color_hover' ); -generate_colors_live_update( 'h1_color', 'h1', 'color', '', 'text_color' ); -generate_colors_live_update( 'h2_color', 'h2', 'color', '', 'text_color' ); -generate_colors_live_update( 'h3_color', 'h3', 'color', '', 'text_color' ); -generate_colors_live_update( 'h4_color', 'h4', 'color', '', 'text_color' ); -generate_colors_live_update( 'h5_color', 'h5', 'color', '', 'text_color' ); -generate_colors_live_update( 'sidebar_widget_background_color', '.sidebar .widget', 'background-color', 'transparent' ); -generate_colors_live_update( 'sidebar_widget_text_color', '.sidebar .widget', 'color', '', 'text_color' ); -generate_colors_live_update( 'sidebar_widget_link_color', '.sidebar .widget a, .sidebar .widget a:visited', 'color', '', 'link_color' ); -generate_colors_live_update( 'sidebar_widget_link_hover_color', '.sidebar .widget a:hover', 'color', '', 'link_color_hover' ); -generate_colors_live_update( 'sidebar_widget_title_color', '.sidebar .widget .widget-title', 'color', '', 'text_color' ); -generate_colors_live_update( 'footer_widget_background_color', '.footer-widgets', 'background-color', 'transparent' ); -generate_colors_live_update( 'footer_widget_text_color', '.footer-widgets', 'color', '', 'text_color' ); -generate_colors_live_update( 'footer_widget_link_color', '.footer-widgets a, .footer-widgets a:visited', 'color', '', 'link_color' ); -generate_colors_live_update( 'footer_widget_link_hover_color', '.footer-widgets a:hover', 'color', '', 'link_color_hover' ); -generate_colors_live_update( 'footer_widget_title_color', '.footer-widgets .widget-title', 'color', '', 'text_color' ); -generate_colors_live_update( 'footer_background_color', '.site-info', 'background-color', 'transparent' ); -generate_colors_live_update( 'footer_text_color', '.site-info', 'color', '', 'text_color' ); -generate_colors_live_update( 'footer_link_color', '.site-info a, .site-info a:visited', 'color', '', 'link_color' ); -generate_colors_live_update( 'footer_link_hover_color', '.site-info a:hover', 'color', '', 'link_color_hover' ); - -/** - * Form selectors - */ -var forms = 'input[type="text"], \ - input[type="email"], \ - input[type="url"], \ - input[type="password"], \ - input[type="search"], \ - input[type="number"], \ - input[type="tel"], \ - textarea, \ - select'; - -/** - * Form background - * Empty: inherit - */ -generate_colors_live_update( 'form_background_color', forms, 'background-color', 'inherit' ); - -/** - * Border color - * Empty: inherit - */ -generate_colors_live_update( 'form_border_color', forms, 'border-color' ); - -/** - * Form text color - * Empty: text_color - */ -generate_colors_live_update( 'form_text_color', forms, 'color', '', 'text_color' ); - -/** - * Form background on focus selectors - * Empty: inherit - */ -var forms_focus = 'input[type="text"]:focus, \ - input[type="email"]:focus, \ - input[type="url"]:focus, \ - input[type="password"]:focus, \ - input[type="search"]:focus,\ - input[type="number"]:focus,\ - input[type="tel"]:focus, \ - textarea:focus, \ - select:focus'; - -/** - * Form background color on focus - * Empty: initial - */ -generate_colors_live_update( 'form_background_color_focus', forms_focus, 'background-color' ); - -/** - * Form text color on focus - * Empty: initial - */ -generate_colors_live_update( 'form_text_color_focus', forms_focus, 'color' ); - -/** - * Form border color on focus - * Empty: initial - */ -generate_colors_live_update( 'form_border_color_focus', forms_focus, 'border-color' ); - -/** - * Button selectors - */ -var button = 'button, \ - html input[type="button"], \ - input[type="reset"], \ - input[type="submit"],\ - a.button,\ - a.button:visited,\ - a.wp-block-button__link:not(.has-background)'; - -/** - * Button background - * Empty: initial - */ -generate_colors_live_update( 'form_button_background_color', button, 'background-color' ); - -/** - * Button text - * Empty: initial - */ -generate_colors_live_update( 'form_button_text_color', button, 'color' ); - -/** - * Button on hover/focus selectors - * Empty: initial - */ -var button_hover = 'button:hover, \ - html input[type="button"]:hover, \ - input[type="reset"]:hover, \ - input[type="submit"]:hover,\ - a.button:hover,\ - button:focus, \ - html input[type="button"]:focus, \ - input[type="reset"]:focus, \ - input[type="submit"]:focus,\ - a.button:focus,\ - a.wp-block-button__link:not(.has-background):active,\ - a.wp-block-button__link:not(.has-background):focus,\ - a.wp-block-button__link:not(.has-background):hover'; - -/** - * Button color on hover - * Empty: initial - */ -generate_colors_live_update( 'form_button_background_color_hover', button_hover, 'background-color' ); - -/** - * Button text color on hover - * Empty: initial - */ -generate_colors_live_update( 'form_button_text_color_hover', button_hover, 'color' ); - -/** - * Back to top background color - * Empty: transparent - */ -generate_colors_live_update( 'back_to_top_background_color', 'a.generate-back-to-top', 'background-color', 'transparent' ); - -/** - * Back to top text color - * Empty: text_color - */ -generate_colors_live_update( 'back_to_top_text_color', 'a.generate-back-to-top', 'color', '', 'text_color' ); - -/** - * Back to top background color hover - * Empty: transparent - */ -generate_colors_live_update( 'back_to_top_background_color_hover', 'a.generate-back-to-top:hover,a.generate-back-to-top:focus', 'background-color', 'transparent' ); - -/** - * Back to top text color hover - * Empty: text_color - */ -generate_colors_live_update( 'back_to_top_text_color_hover', 'a.generate-back-to-top:hover,a.generate-back-to-top:focus', 'color', '', 'text_color' ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/menu-plus-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/menu-plus-customizer.js deleted file mode 100644 index f74fa31e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/menu-plus-customizer.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Main navigation background - * Empty: transparent - */ -generate_colors_live_update( 'slideout_background_color', '.main-navigation.slideout-navigation', 'background-color', '' ); - -/** - * Primary navigation text color - * Empty: link_color - */ -generate_colors_live_update( 'slideout_text_color', '.slideout-navigation.main-navigation .main-nav ul li a, .slideout-navigation a, .slideout-navigation', 'color', '' ); - -/** - * Primary navigation text color hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'slideout_text_hover_color', - '.slideout-navigation.main-navigation .main-nav ul li:hover > a,\ - .slideout-navigation.main-navigation .main-nav ul li:focus > a,\ - .slideout-navigation.main-navigation .main-nav ul li.sfHover > a', - 'color', '' -); - -/** - * Primary navigation menu item hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'slideout_background_hover_color', - '.slideout-navigation.main-navigation .main-nav ul li:hover > a,\ - .slideout-navigation.main-navigation .main-nav ul li:focus > a,\ - .slideout-navigation.main-navigation .main-nav ul li.sfHover > a', - 'background-color', 'transparent' -); - -/** - * Primary sub-navigation color - * Empty: transparent - */ -generate_colors_live_update( 'slideout_submenu_background_color', '.slideout-navigation.main-navigation ul ul', 'background-color', '' ); - -/** - * Primary sub-navigation text color - * Empty: link_color - */ -generate_colors_live_update( 'slideout_submenu_text_color', '.slideout-navigation.main-navigation .main-nav ul ul li a', 'color', '' ); - -/** - * Primary sub-navigation hover - */ -var slideout_submenu_hover = '.slideout-navigation.main-navigation .main-nav ul ul li:hover > a,\ - .slideout-navigation.main-navigation .main-nav ul ul li:focus > a,\ - .slideout-navigation.main-navigation .main-nav ul ul li.sfHover > a'; - -/** - * Primary sub-navigation text hover - * Empty: link_color_hover - */ -generate_colors_live_update( 'slideout_submenu_text_hover_color', slideout_submenu_hover, 'color', '' ); - -/** - * Primary sub-navigation background hover - * Empty: transparent - */ -generate_colors_live_update( 'slideout_submenu_background_hover_color', slideout_submenu_hover, 'background-color', '' ); - -/** - * Navigation current selectors - */ -var slideout_current = '.slideout-navigation.main-navigation .main-nav ul li[class*="current-menu-"] > a,\ - .slideout-navigation.main-navigation .main-nav ul li[class*="current-menu-"] > a:hover,\ - .slideout-navigation.main-navigation .main-nav ul li[class*="current-menu-"].sfHover > a'; - -/** - * Primary navigation current text - * Empty: link_color - */ -generate_colors_live_update( 'slideout_text_current_color', slideout_current, 'color', '' ); - -/** - * Primary navigation current text - * Empty: transparent - */ -generate_colors_live_update( 'slideout_background_current_color', slideout_current, 'background-color' ); - -/** - * Primary sub-navigation current selectors - */ -var slideout_submenu_current = '.slideout-navigation.main-navigation .main-nav ul ul li[class*="current-menu-"] > a,\ - .slideout-navigation.main-navigation .main-nav ul ul li[class*="current-menu-"] > a:hover,\ - .slideout-navigation.main-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a'; - -/** - * Primary sub-navigation current text - * Empty: link_color - */ -generate_colors_live_update( 'slideout_submenu_text_current_color', slideout_submenu_current, 'color', '' ); - -/** - * Primary navigation current item background - * Empty: transparent - */ -generate_colors_live_update( 'slideout_submenu_background_current_color', slideout_submenu_current, 'background-color' ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/wc-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/wc-customizer.js deleted file mode 100644 index b694f300..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/js/wc-customizer.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * WooCommerce link color - */ -generate_colors_live_update( 'wc_product_title_color', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link', 'color', '', 'link_color' ); -generate_colors_live_update( 'wc_product_title_color_hover', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover', 'color', '', 'link_color_hover' ); - -/** - * WooCommerce primary button - */ -var wc_button = '.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, button, \ - html input[type="button"], \ - input[type="reset"], \ - input[type="submit"],\ - .button,\ - .button:visited'; -generate_colors_live_update( 'form_button_background_color', wc_button, 'background-color' ); -generate_colors_live_update( 'form_button_text_color', wc_button, 'color' ); - -/** - * WooCommerce primary button hover - */ -var wc_button_hover = '.woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,button:hover, \ - html input[type="button"]:hover, \ - input[type="reset"]:hover, \ - input[type="submit"]:hover,\ - .button:hover,\ - button:focus, \ - html input[type="button"]:focus, \ - input[type="reset"]:focus, \ - input[type="submit"]:focus,\ - .button:focus'; -generate_colors_live_update( 'form_button_background_color_hover', wc_button_hover, 'background-color' ); -generate_colors_live_update( 'form_button_text_color_hover', wc_button_hover, 'color' ); - -/** - * WooCommerce alt button - */ -var wc_alt_button = '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt'; -generate_colors_live_update( 'wc_alt_button_background', wc_alt_button, 'background-color' ); -generate_colors_live_update( 'wc_alt_button_text', wc_alt_button, 'color' ); - -/** - * WooCommerce alt button hover - */ -var wc_alt_button_hover = '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover'; -generate_colors_live_update( 'wc_alt_button_background_hover', wc_alt_button_hover, 'background-color' ); -generate_colors_live_update( 'wc_alt_button_text_hover', wc_alt_button_hover, 'color' ); - -/** - * WooCommerce star ratings - */ -var wc_stars = '.woocommerce .star-rating span:before, .woocommerce .star-rating:before'; -generate_colors_live_update( 'wc_rating_stars', wc_stars, 'color' ); - -/** - * WooCommerce sale sticker - */ -var wc_sale_sticker = '.woocommerce span.onsale'; -generate_colors_live_update( 'wc_sale_sticker_background', wc_sale_sticker, 'background-color' ); -generate_colors_live_update( 'wc_sale_sticker_text', wc_sale_sticker, 'color' ); - -/** - * WooCommerce price - */ -var wc_price = '.woocommerce ul.products li.product .price, .woocommerce div.product p.price'; -generate_colors_live_update( 'wc_price_color', wc_price, 'color' ); - -/** - * WooCommerce product tab text - */ -var wc_product_tab = '.woocommerce div.product .woocommerce-tabs ul.tabs li a'; -generate_colors_live_update( 'wc_product_tab', wc_product_tab, 'color' ); - -/** - * WooCommerce product tab text highlight/active - */ -var wc_product_tab_active = '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a'; -generate_colors_live_update( 'wc_product_tab_highlight', wc_product_tab_active, 'color' ); - -/** - * WooCommerce success message - */ -var wc_success_message = '.woocommerce-message'; -generate_colors_live_update( 'wc_success_message_background', wc_success_message, 'background-color' ); -generate_colors_live_update( 'wc_success_message_text', wc_success_message + ', div.woocommerce-message a.button, div.woocommerce-message a.button:focus, div.woocommerce-message a.button:hover, div.woocommerce-message a, div.woocommerce-message a:focus, div.woocommerce-message a:hover', 'color' ); - -/** - * WooCommerce info message - */ -var wc_info_message = '.woocommerce-info'; -generate_colors_live_update( 'wc_info_message_background', wc_info_message, 'background-color' ); -generate_colors_live_update( 'wc_info_message_text', wc_info_message + ', div.woocommerce-info a.button, div.woocommerce-info a.button:focus, div.woocommerce-info a.button:hover, div.woocommerce-info a, div.woocommerce-info a:focus, div.woocommerce-info a:hover', 'color' ); - -/** - * WooCommerce error message - */ -var wc_error_message = '.woocommerce-error'; -generate_colors_live_update( 'wc_error_message_background', wc_error_message, 'background-color' ); -generate_colors_live_update( 'wc_error_message_text', wc_error_message + ', div.woocommerce-error a.button, div.woocommerce-error a.button:focus, div.woocommerce-error a.button:hover, div.woocommerce-error a, div.woocommerce-error a:focus, div.woocommerce-error a:hover', 'color' ); - -/** - * Menu Mini Cart - */ -generate_colors_live_update( 'wc_mini_cart_background_color', '#wc-mini-cart', 'background-color' ); -generate_colors_live_update( 'wc_mini_cart_text_color', '#wc-mini-cart,#wc-mini-cart a:not(.button), #wc-mini-cart a.remove', 'color' ); - -generate_colors_live_update( 'wc_mini_cart_button_background', '#wc-mini-cart .button.checkout', 'background-color' ); -generate_colors_live_update( 'wc_mini_cart_button_text', '#wc-mini-cart .button.checkout', 'color' ); - -generate_colors_live_update( 'wc_mini_cart_button_background_hover', '#wc-mini-cart .button.checkout:hover, #wc-mini-cart .button.checkout:focus, #wc-mini-cart .button.checkout:active', 'background-color' ); -generate_colors_live_update( 'wc_mini_cart_button_text_hover', '#wc-mini-cart .button.checkout:hover, #wc-mini-cart .button.checkout:focus, #wc-mini-cart .button.checkout:active', 'color' ); - -/** - * Sticky panel cart button - */ - generate_colors_live_update( 'wc_panel_cart_background_color', '.add-to-cart-panel', 'background-color' ); - generate_colors_live_update( 'wc_panel_cart_text_color', '.add-to-cart-panel, .add-to-cart-panel a:not(.button)', 'color' ); - - generate_colors_live_update( 'wc_panel_cart_button_background', '#wc-sticky-cart-panel .button', 'background-color' ); - generate_colors_live_update( 'wc_panel_cart_button_text', '#wc-sticky-cart-panel .button', 'color' ); - - generate_colors_live_update( 'wc_panel_cart_button_background_hover', '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', 'background-color' ); - generate_colors_live_update( 'wc_panel_cart_button_text_hover', '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', 'color' ); - -/** - * Price slider bar - */ -generate_colors_live_update( 'wc_price_slider_background_color', '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content', 'background-color' ); -generate_colors_live_update( 'wc_price_slider_bar_color', '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle', 'background-color' ); - -// Archive product description text -wp.customize( 'generate_settings[text_color]', function( value ) { - value.bind( function( newval ) { - if ( ! wp.customize.value('generate_settings[content_text_color]')() ) { - if ( jQuery( 'style#wc_desc_color' ).length ) { - jQuery( 'style#wc_desc_color' ).html( '.woocommerce-product-details__short-description{color:' + newval + ';}' ); - } else { - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#wc_desc_color' ).not( ':last' ).remove(); - }, 1000); - } - } - } ); -} ); - -wp.customize( 'generate_settings[content_text_color]', function( value ) { - value.bind( function( newval ) { - if ( '' == newval ) { - newval = wp.customize.value('generate_settings[text_color]')(); - } - if ( jQuery( 'style#wc_desc_color' ).length ) { - jQuery( 'style#wc_desc_color' ).html( '.woocommerce-product-details__short-description{color:' + newval + ';}' ); - } else { - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#wc_desc_color' ).not( ':last' ).remove(); - }, 1000); - } - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/secondary-nav-colors.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/secondary-nav-colors.php deleted file mode 100644 index 7c3ee911..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/secondary-nav-colors.php +++ /dev/null @@ -1,403 +0,0 @@ -get_section( 'secondary_nav_section' ) ) { - return; - } - - // Bail if we don't have our color defaults. - if ( ! function_exists( 'generate_secondary_nav_get_defaults' ) ) { - return; - } - - // Add our controls. - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - // Get our defaults. - $defaults = generate_secondary_nav_get_defaults(); - - // Add control types so controls can be built using JS. - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Get our palettes. - $palettes = generate_get_default_color_palettes(); - - // Add Secondary Navigation section. - $wp_customize->add_section( - 'secondary_navigation_color_section', - array( - 'title' => __( 'Secondary Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 71, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_secondary_navigation_color_shortcuts', - array( - 'section' => 'secondary_navigation_color_section', - 'element' => __( 'Secondary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'secondary_nav_section', - 'typography' => 'secondary_font_section', - 'backgrounds' => 'secondary_bg_images_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_secondary_navigation_items', - array( - 'section' => 'secondary_navigation_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Parent Items', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - // Background. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[navigation_background_color]', - array( - 'default' => $defaults['navigation_background_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'secondary_navigation_background_color', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[navigation_background_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[navigation_text_color]', - array( - 'default' => $defaults['navigation_text_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'secondary_navigation_text_color', - array( - 'label' => __( 'Text', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[navigation_text_color]', - ) - ) - ); - - // Background hover. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[navigation_background_hover_color]', - array( - 'default' => $defaults['navigation_background_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'secondary_navigation_background_hover_color', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[navigation_background_hover_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text hover. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[navigation_text_hover_color]', - array( - 'default' => $defaults['navigation_text_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'secondary_navigation_text_hover_color', - array( - 'label' => __( 'Text Hover', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[navigation_text_hover_color]', - ) - ) - ); - - // Background current. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[navigation_background_current_color]', - array( - 'default' => $defaults['navigation_background_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'secondary_navigation_background_current_color', - array( - 'label' => __( 'Background Current', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[navigation_background_current_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text current. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[navigation_text_current_color]', - array( - 'default' => $defaults['navigation_text_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'secondary_navigation_text_current_color', - array( - 'label' => __( 'Text Current', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[navigation_text_current_color]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_secondary_navigation_sub_menu_items', - array( - 'section' => 'secondary_navigation_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Sub-Menu Items', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - // Background. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[subnavigation_background_color]', - array( - 'default' => $defaults['subnavigation_background_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'secondary_subnavigation_background_color', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[subnavigation_background_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[subnavigation_text_color]', - array( - 'default' => $defaults['subnavigation_text_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'secondary_subnavigation_text_color', - array( - 'label' => __( 'Text', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[subnavigation_text_color]', - ) - ) - ); - - // Background hover. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[subnavigation_background_hover_color]', - array( - 'default' => $defaults['subnavigation_background_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'secondary_subnavigation_background_hover_color', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[subnavigation_background_hover_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text hover. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[subnavigation_text_hover_color]', - array( - 'default' => $defaults['subnavigation_text_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'secondary_subnavigation_text_hover_color', - array( - 'label' => __( 'Text Hover', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[subnavigation_text_hover_color]', - ) - ) - ); - - // Background current. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[subnavigation_background_current_color]', - array( - 'default' => $defaults['subnavigation_background_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'secondary_subnavigation_background_current_color', - array( - 'label' => __( 'Background Current', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[subnavigation_background_current_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text current. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[subnavigation_text_current_color]', - array( - 'default' => $defaults['subnavigation_text_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'secondary_subnavigation_text_current_color', - array( - 'label' => __( 'Text Current', 'gp-premium' ), - 'section' => 'secondary_navigation_color_section', - 'settings' => 'generate_secondary_nav_settings[subnavigation_text_current_color]', - ) - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/slideout-nav-colors.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/slideout-nav-colors.php deleted file mode 100644 index f479dd6e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/slideout-nav-colors.php +++ /dev/null @@ -1,400 +0,0 @@ -get_section( 'menu_plus_slideout_menu' ) ) { - return; - } - - // Bail if we don't have our color defaults. - if ( ! function_exists( 'generate_get_color_defaults' ) ) { - return; - } - - // Add our controls. - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - // Get our defaults. - $defaults = generate_get_color_defaults(); - - // Add control types so controls can be built using JS. - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Get our palettes. - $palettes = generate_get_default_color_palettes(); - - // Add Secondary Navigation section. - $wp_customize->add_section( - 'slideout_color_section', - array( - 'title' => __( 'Off Canvas Panel', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 73, - 'panel' => 'generate_colors_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_off_canvas_color_shortcuts', - array( - 'section' => 'slideout_color_section', - 'element' => __( 'Off Canvas Panel', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'menu_plus_slideout_menu', - 'typography' => 'generate_slideout_typography', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_slideout_navigation_items', - array( - 'section' => 'slideout_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Parent Menu Items', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - // Background. - $wp_customize->add_setting( - 'generate_settings[slideout_background_color]', - array( - 'default' => $defaults['slideout_background_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[slideout_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_background_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text. - $wp_customize->add_setting( - 'generate_settings[slideout_text_color]', - array( - 'default' => $defaults['slideout_text_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[slideout_text_color]', - array( - 'label' => __( 'Text', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_text_color]', - ) - ) - ); - - // Background hover. - $wp_customize->add_setting( - 'generate_settings[slideout_background_hover_color]', - array( - 'default' => $defaults['slideout_background_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[slideout_background_hover_color]', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_background_hover_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text hover. - $wp_customize->add_setting( - 'generate_settings[slideout_text_hover_color]', - array( - 'default' => $defaults['slideout_text_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[slideout_text_hover_color]', - array( - 'label' => __( 'Text Hover', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_text_hover_color]', - ) - ) - ); - - // Background current. - $wp_customize->add_setting( - 'generate_settings[slideout_background_current_color]', - array( - 'default' => $defaults['slideout_background_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[slideout_background_current_color]', - array( - 'label' => __( 'Background Current', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_background_current_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text current. - $wp_customize->add_setting( - 'generate_settings[slideout_text_current_color]', - array( - 'default' => $defaults['slideout_text_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[slideout_text_current_color]', - array( - 'label' => __( 'Text Current', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_text_current_color]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_slideout_navigation_sub_menu_items', - array( - 'section' => 'slideout_color_section', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Sub-Menu Items', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - // Background. - $wp_customize->add_setting( - 'generate_settings[slideout_submenu_background_color]', - array( - 'default' => $defaults['slideout_submenu_background_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[slideout_submenu_background_color]', - array( - 'label' => __( 'Background', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_submenu_background_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text. - $wp_customize->add_setting( - 'generate_settings[slideout_submenu_text_color]', - array( - 'default' => $defaults['slideout_submenu_text_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[slideout_submenu_text_color]', - array( - 'label' => __( 'Text', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_submenu_text_color]', - ) - ) - ); - - // Background hover. - $wp_customize->add_setting( - 'generate_settings[slideout_submenu_background_hover_color]', - array( - 'default' => $defaults['slideout_submenu_background_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[slideout_submenu_background_hover_color]', - array( - 'label' => __( 'Background Hover', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_submenu_background_hover_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text hover. - $wp_customize->add_setting( - 'generate_settings[slideout_submenu_text_hover_color]', - array( - 'default' => $defaults['slideout_submenu_text_hover_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[slideout_submenu_text_hover_color]', - array( - 'label' => __( 'Text Hover', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_submenu_text_hover_color]', - ) - ) - ); - - // Background current. - $wp_customize->add_setting( - 'generate_settings[slideout_submenu_background_current_color]', - array( - 'default' => $defaults['slideout_submenu_background_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[slideout_submenu_background_current_color]', - array( - 'label' => __( 'Background Current', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_submenu_background_current_color]', - 'palette' => $palettes, - ) - ) - ); - - // Text current. - $wp_customize->add_setting( - 'generate_settings[slideout_submenu_text_current_color]', - array( - 'default' => $defaults['slideout_submenu_text_current_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[slideout_submenu_text_current_color]', - array( - 'label' => __( 'Text Current', 'gp-premium' ), - 'section' => 'slideout_color_section', - 'settings' => 'generate_settings[slideout_submenu_text_current_color]', - ) - ) - ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/woocommerce-colors.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/woocommerce-colors.php deleted file mode 100644 index 6c453815..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/functions/woocommerce-colors.php +++ /dev/null @@ -1,911 +0,0 @@ -get_section( 'generate_woocommerce_colors' ) ) { - return; - } - - if ( ! function_exists( 'generate_get_color_defaults' ) ) { - return; - } - - // Add our controls. - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - // Get our defaults. - $defaults = generate_get_color_defaults(); - - // Add control types so controls can be built using JS. - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Information_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Get our palettes. - $palettes = generate_get_default_color_palettes(); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_woocommerce_color_shortcuts', - array( - 'section' => 'generate_woocommerce_colors', - 'element' => __( 'WooCommerce', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_woocommerce_layout', - 'typography' => 'generate_woocommerce_typography', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_button_title', - array( - 'section' => 'generate_woocommerce_colors', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Buttons', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_woocommerce_primary_button_message', - array( - 'section' => 'generate_woocommerce_colors', - 'label' => __( 'Primary Button Colors', 'gp-premium' ), - 'description' => __( 'Primary button colors can be set here.', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_alt_button_background]', - array( - 'default' => $defaults['wc_alt_button_background'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_alt_button_background]', - array( - 'label' => __( 'Alt Button Background', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_alt_button_background]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_alt_button_background_hover]', - array( - 'default' => $defaults['wc_alt_button_background_hover'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_alt_button_background_hover]', - array( - 'label' => __( 'Alt Button Background Hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_alt_button_background_hover]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_alt_button_text]', - array( - 'default' => $defaults['wc_alt_button_text'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_alt_button_text]', - array( - 'label' => __( 'Alt Button Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_alt_button_text]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_alt_button_text_hover]', - array( - 'default' => $defaults['wc_alt_button_text_hover'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_alt_button_text_hover]', - array( - 'label' => __( 'Alt Button Text Hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_alt_button_text_hover]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_product_title', - array( - 'section' => 'generate_woocommerce_colors', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Products', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_product_title_color]', - array( - 'default' => $defaults['wc_product_title_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_product_title_color]', - array( - 'label' => __( 'Product Title', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_product_title_color]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_product_title_color_hover]', - array( - 'default' => $defaults['wc_product_title_color_hover'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_product_title_color_hover]', - array( - 'label' => __( 'Product Title Hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_product_title_color_hover]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_rating_stars]', - array( - 'default' => $defaults['wc_rating_stars'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => '', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_rating_stars]', - array( - 'label' => __( 'Star Ratings', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_rating_stars]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_sale_sticker_background]', - array( - 'default' => $defaults['wc_sale_sticker_background'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_sale_sticker_background]', - array( - 'label' => __( 'Sale Sticker Background', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_sale_sticker_background]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_sale_sticker_text]', - array( - 'default' => $defaults['wc_sale_sticker_text'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_sale_sticker_text]', - array( - 'label' => __( 'Sale Sticker Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_sale_sticker_text]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_price_color]', - array( - 'default' => $defaults['wc_price_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_price_color]', - array( - 'label' => __( 'Price', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_price_color]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_panel_cart_title', - array( - 'section' => 'generate_woocommerce_colors', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Sticky Panel Cart', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_panel_cart_background_color]', - array( - 'default' => $defaults['wc_panel_cart_background_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_panel_cart_background_color]', - array( - 'label' => __( 'Background Color', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_panel_cart_background_color]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_panel_cart_text_color]', - array( - 'default' => $defaults['wc_panel_cart_text_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_panel_cart_text_color]', - array( - 'label' => __( 'Text Color', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_panel_cart_text_color]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_panel_cart_button_background]', - array( - 'default' => $defaults['wc_panel_cart_button_background'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_panel_cart_button_background]', - array( - 'label' => __( 'Button Background', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_panel_cart_button_background]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_panel_cart_button_background_hover]', - array( - 'default' => $defaults['wc_panel_cart_button_background_hover'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_panel_cart_button_background_hover]', - array( - 'label' => __( 'Button Background Hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_panel_cart_button_background_hover]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_panel_cart_button_text]', - array( - 'default' => $defaults['wc_panel_cart_button_text'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_panel_cart_button_text]', - array( - 'label' => __( 'Button Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_panel_cart_button_text]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_panel_cart_button_text_hover]', - array( - 'default' => $defaults['wc_panel_cart_button_text_hover'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_panel_cart_button_text_hover]', - array( - 'label' => __( 'Button Text Hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_panel_cart_button_text_hover]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_mini_cart_title', - array( - 'section' => 'generate_woocommerce_colors', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Menu Mini Cart', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_mini_cart_background_color]', - array( - 'default' => $defaults['wc_mini_cart_background_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_mini_cart_background_color]', - array( - 'label' => __( 'Cart Background Color', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_mini_cart_background_color]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_mini_cart_text_color]', - array( - 'default' => $defaults['wc_mini_cart_text_color'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_mini_cart_text_color]', - array( - 'label' => __( 'Cart Text Color', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_mini_cart_text_color]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_mini_cart_button_background]', - array( - 'default' => $defaults['wc_mini_cart_button_background'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_mini_cart_button_background]', - array( - 'label' => __( 'Button Background', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_mini_cart_button_background]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_mini_cart_button_background_hover]', - array( - 'default' => $defaults['wc_mini_cart_button_background_hover'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_mini_cart_button_background_hover]', - array( - 'label' => __( 'Button Background Hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_mini_cart_button_background_hover]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_mini_cart_button_text]', - array( - 'default' => $defaults['wc_mini_cart_button_text'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_mini_cart_button_text]', - array( - 'label' => __( 'Button Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_mini_cart_button_text]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_mini_cart_button_text_hover]', - array( - 'default' => $defaults['wc_mini_cart_button_text_hover'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_mini_cart_button_text_hover]', - array( - 'label' => __( 'Button Text Hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_mini_cart_button_text_hover]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_price_slider_title', - array( - 'section' => 'generate_woocommerce_colors', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Price Slider Widget', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_price_slider_background_color]', - array( - 'default' => $defaults['wc_price_slider_background_color'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_price_slider_background_color]', - array( - 'label' => __( 'Slider Background Color', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_price_slider_background_color]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_price_slider_bar_color]', - array( - 'default' => $defaults['wc_price_slider_bar_color'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_price_slider_bar_color]', - array( - 'label' => __( 'Slider Bar Color', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_price_slider_bar_color]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_product_tabs_title', - array( - 'section' => 'generate_woocommerce_colors', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Product Tabs', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_product_tab]', - array( - 'default' => $defaults['wc_product_tab'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_product_tab]', - array( - 'label' => __( 'Product Tab Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_product_tab]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_product_tab_highlight]', - array( - 'default' => $defaults['wc_product_tab_highlight'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_product_tab_highlight]', - array( - 'label' => __( 'Product Tab Active', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_product_tab_highlight]', - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_messages_title', - array( - 'section' => 'generate_woocommerce_colors', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Messages', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_success_message_background]', - array( - 'default' => $defaults['wc_success_message_background'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_success_message_background]', - array( - 'label' => __( 'Success Message Background', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_success_message_background]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_success_message_text]', - array( - 'default' => $defaults['wc_success_message_text'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_success_message_text]', - array( - 'label' => __( 'Success Message Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_success_message_text]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_info_message_background]', - array( - 'default' => $defaults['wc_info_message_background'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_info_message_background]', - array( - 'label' => __( 'Info Message Background', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_info_message_background]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_info_message_text]', - array( - 'default' => $defaults['wc_info_message_text'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_info_message_text]', - array( - 'label' => __( 'Info Message Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_info_message_text]', - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_error_message_background]', - array( - 'default' => $defaults['wc_error_message_background'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'transport' => 'postMessage', - 'sanitize_callback' => 'generate_premium_sanitize_rgba', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Alpha_Color_Customize_Control( - $wp_customize, - 'generate_settings[wc_error_message_background]', - array( - 'label' => __( 'Error Message Background', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_error_message_background]', - 'palette' => $palettes, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[wc_error_message_text]', - array( - 'default' => $defaults['wc_error_message_text'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_hex_color', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'generate_settings[wc_error_message_text]', - array( - 'label' => __( 'Error Message Text', 'gp-premium' ), - 'section' => 'generate_woocommerce_colors', - 'settings' => 'generate_settings[wc_error_message_text]', - ) - ) - ); - - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/generate-colors.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/generate-colors.php deleted file mode 100644 index a90e5c4c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/colors/generate-colors.php +++ /dev/null @@ -1,20 +0,0 @@ -register_control_type( 'GeneratePress_Copyright_Customize_Control' ); - } - - $wp_customize->add_setting( - 'generate_copyright', - array( - 'default' => '', - 'type' => 'theme_mod', - 'sanitize_callback' => 'wp_kses_post', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Copyright_Customize_Control( - $wp_customize, - 'generate_copyright', - array( - 'label' => __( 'Copyright', 'gp-premium' ), - 'section' => 'generate_layout_footer', - 'settings' => 'generate_copyright', - 'priority' => 500, - ) - ) - ); - - // Initiate selective refresh. - if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( - 'generate_copyright', - array( - 'selector' => '.copyright-bar', - 'settings' => array( 'generate_copyright' ), - 'render_callback' => 'generate_copyright_selective_refresh', - ) - ); - } - } -} - -if ( ! function_exists( 'generate_copyright_selective_refresh' ) ) { - /** - * Return our copyright on selective refresh - */ - function generate_copyright_selective_refresh() { - $options = array( - '%current_year%', - '%copy%', - ); - - $replace = array( - date( 'Y' ), // phpcs:ignore -- prefer date(). - '©', - ); - - $new_copyright = get_theme_mod( 'generate_copyright' ); - $new_copyright = str_replace( $options, $replace, get_theme_mod( 'generate_copyright' ) ); - - return do_shortcode( $new_copyright ); - } -} - -if ( ! function_exists( 'generate_copyright_remove_default' ) ) { - add_action( 'wp', 'generate_copyright_remove_default' ); - /** - * Remove the default copyright. - * - * @since 0.1 - * @deprecated GP 1.3.42 - */ - function generate_copyright_remove_default() { - // As of 1.3.42, we no longer need to do this. - // We use a nice little filter instead. - if ( ! function_exists( 'generate_add_login_attribution' ) ) { - return; - } - - if ( get_theme_mod( 'generate_copyright' ) && '' !== get_theme_mod( 'generate_copyright' ) ) { - remove_action( 'generate_credits', 'generate_add_footer_info' ); - remove_action( 'generate_copyright_line', 'generate_add_login_attribution' ); - } - } -} - -if ( ! function_exists( 'generate_copyright_add_custom' ) ) { - add_action( 'generate_credits', 'generate_copyright_add_custom' ); - /** - * Add the custom copyright. - * - * @since 0.1 - * @deprecated GP 1.3.42 - */ - function generate_copyright_add_custom() { - // As of 1.3.42, we no longer need to do this. - // We use a nice little filter instead. - if ( ! function_exists( 'generate_add_login_attribution' ) ) { - return; - } - - $options = array( - '%current_year%', - '%copy%', - ); - - $replace = array( - date( 'Y' ), // phpcs:ignore -- prefer date(). - '©', - ); - - $new_copyright = get_theme_mod( 'generate_copyright' ); - $new_copyright = str_replace( $options, $replace, get_theme_mod( 'generate_copyright' ) ); - - if ( get_theme_mod( 'generate_copyright' ) && '' !== get_theme_mod( 'generate_copyright' ) ) { - echo do_shortcode( $new_copyright ); - } - } -} - -if ( ! function_exists( 'generate_apply_custom_copyright' ) ) { - add_filter( 'generate_copyright', 'generate_apply_custom_copyright' ); - /** - * Add the custom copyright - * - * @since 1.2.92 - * @param string $copyright The copyright value. - */ - function generate_apply_custom_copyright( $copyright ) { - // This will only work if GP >= 1.3.42 and the below function doesn't exist. - if ( function_exists( 'generate_add_login_attribution' ) ) { - return; - } - - $options = array( - '%current_year%', - '%copy%', - ); - - $replace = array( - date( 'Y' ), // phpcs:ignore -- prefer date(). - '©', - ); - - $new_copyright = get_theme_mod( 'generate_copyright' ); - $new_copyright = str_replace( $options, $replace, get_theme_mod( 'generate_copyright' ) ); - - if ( get_theme_mod( 'generate_copyright' ) && '' !== get_theme_mod( 'generate_copyright' ) ) { - return do_shortcode( $new_copyright ); - } - - return $copyright; - - } -} - -if ( ! function_exists( 'generate_copyright_customizer_live_preview' ) ) { - add_action( 'customize_preview_init', 'generate_copyright_customizer_live_preview' ); - /** - * Add our live preview - */ - function generate_copyright_customizer_live_preview() { - wp_enqueue_script( - 'generate-copyright-customizer', - plugin_dir_url( __FILE__ ) . 'js/customizer.js', - array( 'jquery', 'customize-preview' ), - GENERATE_COPYRIGHT_VERSION, - true - ); - } -} - -if ( ! function_exists( 'generate_update_copyright' ) ) { - add_action( 'admin_init', 'generate_update_copyright' ); - /** - * Our copyright use to have it's own setting - * If we have the old setting, move it into our theme_mod - */ - function generate_update_copyright() { - // If we already have a custom logo, bail. - if ( get_theme_mod( 'generate_copyright' ) ) { - return; - } - - // Get the old logo value. - $old_value = get_option( 'gen_custom_copyright' ); - - // If there's no old value, bail. - if ( empty( $old_value ) ) { - return; - } - - // Now let's update the new logo setting with our ID. - set_theme_mod( 'generate_copyright', $old_value ); - - // Got our custom logo? Time to delete the old value. - if ( get_theme_mod( 'generate_copyright' ) ) { - delete_option( 'gen_custom_copyright' ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/copyright/functions/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/copyright/functions/js/customizer.js deleted file mode 100644 index fdd64115..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/copyright/functions/js/customizer.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Theme Customizer enhancements for a better user experience. - * - * Contains handlers to make Theme Customizer preview reload changes asynchronously. - */ - -( function( $ ) { - // Update the site title in real time... - wp.customize( 'generate_copyright', function( value ) { - value.bind( function( newval ) { - if ( $( '.copyright-bar' ).length ) { - $( '.copyright-bar' ).html( newval ); - } else { - $( '.inside-site-info' ).html( newval ); - } - } ); - } ); -}( jQuery ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/copyright/generate-copyright.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/copyright/generate-copyright.php deleted file mode 100644 index 2b9ce0b3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/copyright/generate-copyright.php +++ /dev/null @@ -1,20 +0,0 @@ -ID, '_generate-disable-header', true ); - $disable_nav = get_post_meta( $post->ID, '_generate-disable-nav', true ); - $disable_secondary_nav = get_post_meta( $post->ID, '_generate-disable-secondary-nav', true ); - $disable_post_image = get_post_meta( $post->ID, '_generate-disable-post-image', true ); - $disable_headline = get_post_meta( $post->ID, '_generate-disable-headline', true ); - $disable_footer = get_post_meta( $post->ID, '_generate-disable-footer', true ); - } - - $return = ''; - - if ( ! empty( $disable_header ) && false !== $disable_header ) { - $return = '.site-header {display:none}'; - } - - if ( ! empty( $disable_nav ) && false !== $disable_nav ) { - $return .= '#site-navigation,.navigation-clone, #mobile-header {display:none !important}'; - } - - if ( ! empty( $disable_secondary_nav ) && false !== $disable_secondary_nav ) { - $return .= '#secondary-navigation {display:none}'; - } - - if ( ! empty( $disable_post_image ) && false !== $disable_post_image ) { - $return .= '.generate-page-header, .page-header-image, .page-header-image-single {display:none}'; - } - - $need_css_removal = true; - - if ( defined( 'GENERATE_VERSION' ) && version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '>=' ) ) { - $need_css_removal = false; - } - - if ( $need_css_removal && ! empty( $disable_headline ) && false !== $disable_headline && ! is_single() ) { - $return .= '.entry-header {display:none} .page-content, .entry-content, .entry-summary {margin-top:0}'; - } - - if ( ! empty( $disable_footer ) && false !== $disable_footer ) { - $return .= '.site-footer {display:none}'; - } - - return $return; - } -} - -if ( ! function_exists( 'generate_de_scripts' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_de_scripts', 50 ); - /** - * Enqueue scripts and styles - */ - function generate_de_scripts() { - wp_add_inline_style( 'generate-style', generate_disable_elements() ); - } -} - -if ( ! function_exists( 'generate_add_de_meta_box' ) ) { - add_action( 'add_meta_boxes', 'generate_add_de_meta_box', 50 ); - /** - * Generate the layout metabox. - * - * @since 0.1 - */ - function generate_add_de_meta_box() { - // Set user role - make filterable. - $allowed = apply_filters( 'generate_metabox_capability', 'edit_theme_options' ); - - // If not an administrator, don't show the metabox. - if ( ! current_user_can( $allowed ) ) { - return; - } - - if ( defined( 'GENERATE_LAYOUT_META_BOX' ) ) { - return; - } - - $args = array( 'public' => true ); - $post_types = get_post_types( $args ); - foreach ( $post_types as $type ) { - if ( 'attachment' !== $type ) { - add_meta_box( - 'generate_de_meta_box', - __( 'Disable Elements', 'gp-premium' ), - 'generate_show_de_meta_box', - $type, - 'side', - 'default' - ); - } - } - } -} - -if ( ! function_exists( 'generate_show_de_meta_box' ) ) { - /** - * Outputs the content of the metabox. - * - * @param object $post The post object. - */ - function generate_show_de_meta_box( $post ) { - wp_nonce_field( basename( __FILE__ ), 'generate_de_nonce' ); - $stored_meta = get_post_meta( $post->ID ); - $stored_meta['_generate-disable-header'][0] = ( isset( $stored_meta['_generate-disable-header'][0] ) ) ? $stored_meta['_generate-disable-header'][0] : ''; - $stored_meta['_generate-disable-nav'][0] = ( isset( $stored_meta['_generate-disable-nav'][0] ) ) ? $stored_meta['_generate-disable-nav'][0] : ''; - $stored_meta['_generate-disable-secondary-nav'][0] = ( isset( $stored_meta['_generate-disable-secondary-nav'][0] ) ) ? $stored_meta['_generate-disable-secondary-nav'][0] : ''; - $stored_meta['_generate-disable-post-image'][0] = ( isset( $stored_meta['_generate-disable-post-image'][0] ) ) ? $stored_meta['_generate-disable-post-image'][0] : ''; - $stored_meta['_generate-disable-headline'][0] = ( isset( $stored_meta['_generate-disable-headline'][0] ) ) ? $stored_meta['_generate-disable-headline'][0] : ''; - $stored_meta['_generate-disable-footer'][0] = ( isset( $stored_meta['_generate-disable-footer'][0] ) ) ? $stored_meta['_generate-disable-footer'][0] : ''; - $stored_meta['_generate-disable-top-bar'][0] = ( isset( $stored_meta['_generate-disable-top-bar'][0] ) ) ? $stored_meta['_generate-disable-top-bar'][0] : ''; - ?> - -

-

- - - - - - - - - - - - - - - - - -
-

- - ID, '_generate-disable-top-bar', true ); - $disable_header = get_post_meta( $post->ID, '_generate-disable-header', true ); - $disable_mobile_header = get_post_meta( $post->ID, '_generate-disable-mobile-header', true ); - $disable_nav = get_post_meta( $post->ID, '_generate-disable-nav', true ); - $disable_headline = get_post_meta( $post->ID, '_generate-disable-headline', true ); - $disable_footer = get_post_meta( $post->ID, '_generate-disable-footer', true ); - } - - // Remove the top bar. - if ( ! empty( $disable_top_bar ) && false !== $disable_top_bar && function_exists( 'generate_top_bar' ) ) { - remove_action( 'generate_before_header', 'generate_top_bar', 5 ); - remove_action( 'generate_inside_secondary_navigation', 'generate_secondary_nav_top_bar_widget', 5 ); - } - - // Remove the header. - if ( ! empty( $disable_header ) && false !== $disable_header && function_exists( 'generate_construct_header' ) ) { - remove_action( 'generate_header', 'generate_construct_header' ); - } - - // Remove the mobile header. - if ( ! empty( $disable_mobile_header ) && false !== $disable_mobile_header && function_exists( 'generate_menu_plus_mobile_header' ) ) { - remove_action( 'generate_after_header', 'generate_menu_plus_mobile_header', 5 ); - } - - // Remove the navigation. - if ( ! empty( $disable_nav ) && false !== $disable_nav && function_exists( 'generate_get_navigation_location' ) ) { - add_filter( 'generate_navigation_location', '__return_false', 20 ); - add_filter( 'generate_disable_mobile_header_menu', '__return_true' ); - } - - // Remove the title. - if ( ! empty( $disable_headline ) && false !== $disable_headline && function_exists( 'generate_show_title' ) ) { - add_filter( 'generate_show_title', '__return_false' ); - } - - // Remove the footer. - if ( ! empty( $disable_footer ) && false !== $disable_footer ) { - if ( function_exists( 'generate_construct_footer_widgets' ) ) { - remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 ); - } - - if ( function_exists( 'generate_construct_footer' ) ) { - remove_action( 'generate_footer', 'generate_construct_footer' ); - } - } - } -} - -add_action( 'generate_layout_disable_elements_section', 'generate_premium_disable_elements_options' ); -/** - * Add the meta box options to the Layout meta box in the new GP - * - * @since 1.4 - * @param array $stored_meta Existing meta data. - */ -function generate_premium_disable_elements_options( $stored_meta ) { - $stored_meta['_generate-disable-header'][0] = ( isset( $stored_meta['_generate-disable-header'][0] ) ) ? $stored_meta['_generate-disable-header'][0] : ''; - $stored_meta['_generate-disable-mobile-header'][0] = ( isset( $stored_meta['_generate-disable-mobile-header'][0] ) ) ? $stored_meta['_generate-disable-mobile-header'][0] : ''; - $stored_meta['_generate-disable-nav'][0] = ( isset( $stored_meta['_generate-disable-nav'][0] ) ) ? $stored_meta['_generate-disable-nav'][0] : ''; - $stored_meta['_generate-disable-secondary-nav'][0] = ( isset( $stored_meta['_generate-disable-secondary-nav'][0] ) ) ? $stored_meta['_generate-disable-secondary-nav'][0] : ''; - $stored_meta['_generate-disable-post-image'][0] = ( isset( $stored_meta['_generate-disable-post-image'][0] ) ) ? $stored_meta['_generate-disable-post-image'][0] : ''; - $stored_meta['_generate-disable-headline'][0] = ( isset( $stored_meta['_generate-disable-headline'][0] ) ) ? $stored_meta['_generate-disable-headline'][0] : ''; - $stored_meta['_generate-disable-footer'][0] = ( isset( $stored_meta['_generate-disable-footer'][0] ) ) ? $stored_meta['_generate-disable-footer'][0] : ''; - $stored_meta['_generate-disable-top-bar'][0] = ( isset( $stored_meta['_generate-disable-top-bar'][0] ) ) ? $stored_meta['_generate-disable-top-bar'][0] : ''; - ?> -
- - - - - - - - - - - - - - - - - - - - - -
- array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-server-side-render'), 'version' => 'cf85acaca6a9b96dc3a3'); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/block-elements.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/block-elements.css deleted file mode 100644 index c1ba6a46..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/block-elements.css +++ /dev/null @@ -1,7 +0,0 @@ -.inline-post-meta-area.block-editor-block-list__layout,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout{align-items:center;display:flex}.inline-post-meta-area.block-editor-block-list__layout>.wp-block.block-list-appender,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout>.wp-block.block-list-appender,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block.block-list-appender{margin-left:20px}.inline-post-meta-area.block-editor-block-list__layout>.wp-block-image,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout>.wp-block-image,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block-image{line-height:0}.inline-post-meta-area.block-editor-block-list__layout>.wp-block-image figcaption,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout>.wp-block-image figcaption,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block-image figcaption{display:none}.inline-post-meta-area .wp-block{margin-left:0;margin-right:0}.gpp-dynamic-container-bg-dropdown .components-popover__content{width:275px}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:not(:last-child){margin-bottom:20px}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:last-child .components-base-control__field{margin-bottom:0}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:last-child .components-base-control__help{margin-top:3px} -.gpp-dynamic-headline-text-dropdown .components-popover__content{width:275px}.gpp-dynamic-headline-text-dropdown .components-popover__content .components-base-control:not(:last-child){margin-bottom:20px}.gpp-dynamic-headline-text-dropdown .components-popover__content .components-base-control:last-child .components-base-control__field{margin-bottom:0}.gpp-dynamic-headline-text-dropdown .components-popover__content .components-base-control:last-child .components-base-control__help{margin-top:3px}.gpp-blocks-dynamic-text-replace-field{display:none}.gpp-block-dynamic-year .components-base-control__help{margin-top:2px} -.wp-block[data-type="generatepress/dynamic-content"]{margin-bottom:0;margin-top:0} -.wp-block[data-type="generatepress/dynamic-image"]{color:#fff;margin-bottom:0;margin-top:0}.wp-block[data-type="generatepress/dynamic-image"] .components-gpp-dynamic-image-placeholder__label{align-items:center;bottom:0;color:#fff;display:flex;font-size:1em;justify-content:center;left:0;position:absolute;right:0;top:0}.wp-block[data-type="generatepress/dynamic-image"] .components-gpp-dynamic-image-placeholder__label>.gpp-dynamic-featured-image__label{margin-left:10px}.wp-block[data-type="generatepress/dynamic-image"] .gpp-dynamic-image-placeholder{background:#000;vertical-align:middle}.wp-block[data-type="generatepress/dynamic-image"] .components-placeholder{width:100%}.wp-block[data-type="generatepress/dynamic-image"] .gpp-dynamic-image-preview{display:inline-block;position:relative}.wp-block[data-type="generatepress/dynamic-image"] .dynamic-author-image-rounded{border-radius:100%} -.components-generatepress-units-control-header__units{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px}.components-generatepress-control__units .components-generatepress-control-buttons__units button.components-button{background:#fff;border:0;border-radius:0!important;box-shadow:none!important;color:#929da7;font-size:10px;height:auto;line-height:20px;padding:0 5px;position:relative;text-align:center;text-shadow:none}.components-generatepress-control__units .components-generatepress-control-buttons__units button.components-button.is-primary{background:#fff!important;color:#000!important;cursor:default;font-weight:700;z-index:1} -.editor-styles-wrapper .is-root-container>.wp-block{margin-left:auto;margin-right:auto;max-width:var(--gp-block-element-width)}.left-sidebar-block-type div:not(.block-editor-inner-blocks)>.block-editor-block-list__layout,.right-sidebar-block-type div:not(.block-editor-inner-blocks)>.block-editor-block-list__layout{padding:10px}.gpp-block-element-panel>.components-base-control{margin-bottom:20px}.gpp-block-element-panel .components-notice,.gpp-block-element-panel .components-notice .components-notice__content{margin:0}.gpp-element-panel-label .components-panel__body-toggle.components-button{display:flex;flex-direction:row-reverse;justify-content:flex-end}.gpp-element-panel-label .components-panel__body-toggle.components-button svg.components-panel__icon{margin:0 10px 0 0}button.gpp-block-elements-template-button{background:#fff;border:1px solid #ddd;border-radius:5px;cursor:pointer;margin:0 0 10px;padding:5px}button.gpp-block-elements-template-button:hover{border-color:var(--wp-admin-theme-color)}button.gpp-block-elements-template-button .gpp-block-template-label{color:#888;font-size:13px;padding:5px}.element-has-parent #generate_premium_elements{display:none}.gpp-block-element-template-panel{background:#fafafa} -.gp-select-search .select-search-container{--select-search-background:#fff;--select-search-border:#949494;--select-search-selected:var(--wp-admin-theme-color);--select-search-text:#2c3338;--select-search-subtle-text:#6c6f85;--select-search-inverted-text:var(--select-search-background);--select-search-highlight:#eff1f5;box-sizing:border-box;color:var(--select-search-text);font-family:var(--select-search-font);position:relative;width:100%}.gp-select-search .select-search-container *,.gp-select-search .select-search-container :after,.gp-select-search .select-search-container :before{box-sizing:inherit}.gp-select-search .select-search-input{-webkit-font-smoothing:antialiased;-webkit-appearance:none;background:var(--select-search-background) url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E") no-repeat right 5px top 55%;background-size:13px 13px;border:1px solid var(--select-search-border);border-radius:3px;color:var(--select-search-text);display:block;font-size:13px;height:30px;letter-spacing:.01rem;line-height:30px;outline:none;padding:0 26px 0 8px;position:relative;text-align:left;text-overflow:ellipsis;width:100%;z-index:1}.gp-select-search .select-search-is-multiple .select-search-input{border-radius:3px 3px 0 0;margin-bottom:-2px}.gp-select-search .select-search-input::-webkit-search-cancel-button,.gp-select-search .select-search-input::-webkit-search-decoration,.gp-select-search .select-search-input::-webkit-search-results-button,.gp-select-search .select-search-input::-webkit-search-results-decoration{-webkit-appearance:none}.gp-select-search .select-search-input[readonly]{cursor:pointer}.gp-select-search .select-search-is-disabled .select-search-input{cursor:not-allowed}.gp-select-search .select-search-container:not(.select-search-is-disabled) .select-search-input:hover,.gp-select-search .select-search-container:not(.select-search-is-disabled).select-search-has-focus .select-search-input{border-color:var(--select-search-selected)}.gp-select-search .select-search-select{background:var(--select-search-background);border:1px solid var(--select-search-border);box-shadow:0 .0625rem .125rem rgba(0,0,0,.15);max-height:360px;overflow:auto}.gp-select-search .select-search-container:not(.select-search-is-multiple) .select-search-select{border-radius:3px;display:none;left:0;position:absolute;right:0;top:35px;z-index:2}.gp-select-search .select-search-container:not(.select-search-is-multiple).select-search-has-focus .select-search-select{display:block}.gp-select-search .select-search-has-focus .select-search-select{border-color:var(--select-search-selected)}.gp-select-search .select-search-options{list-style:none}.gp-select-search .select-search-not-found,.gp-select-search .select-search-option{-webkit-font-smoothing:antialiased;background:var(--select-search-background);border:none;color:var(--select-search-text);cursor:pointer;display:block;font-family:monospace;font-size:10px;height:30px;letter-spacing:.01rem;outline:none;padding:0 16px;text-align:left;width:100%}.gp-select-search .select-search-option:disabled{background:transparent!important;cursor:not-allowed;opacity:.5}.gp-select-search .select-search-is-highlighted,.gp-select-search .select-search-option:not(.select-search-is-selected):hover{background:var(--select-search-highlight)}.gp-select-search .select-search-is-selected{color:var(--select-search-selected);font-weight:700}.gp-select-search .select-search-group-header{font-size:12px;font-weight:700;letter-spacing:.1rem;padding:10px 16px;text-transform:uppercase} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/block-elements.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/block-elements.js deleted file mode 100644 index 57b22635..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/block-elements.js +++ /dev/null @@ -1,3 +0,0 @@ -!function(){var e={184:function(e,t){var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var e=[],t=0;t .gb-inside-container > .block-editor-inner-blocks > .block-editor-block-list__layout";return void 0!==s&&(d=s?".gb-container-"+a+".inline-post-meta-area > .gb-inside-container":".gb-container-"+a+".inline-post-meta-area"),r&&(o(e,d,{"justify-content":p}),"generateblocks.editor.tabletCSS"===(0,l.currentFilter)()&&o(e,d,{"justify-content":c}),"generateblocks.editor.mobileCSS"===(0,l.currentFilter)()&&o(e,d,{"justify-content":g})),e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?n({className:t.join(" ")}):n({className:""}),"generateblocks/headline"===i){var o=(0,p.__)("Hello World","gp-premium");"post-date"===e?o=(0,p.__)("Post date","gp-premium"):"post-author"===e?o=(0,p.__)("Post author name","gp-premium"):"terms"===e?o=(0,p.__)("Terms","gp-premium"):"comments-number"===e?o=(0,p.__)("Comments number","gp-premium"):"post-meta"===e?o=(0,p.__)("Post meta","gp-premium"):"user-meta"===e?o=(0,p.__)("User meta","gp-premium"):"term-meta"===e&&(o=(0,p.__)("Term meta","gp-premium")),n({content:o})}}}),""!==o&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.TextControl,{className:"gpp-blocks-dynamic-text-replace-field",type:"text",value:l}),"post-date"===o&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Date type","gp-premium"),value:T,options:[{label:(0,p.__)("Published date","gp-premim"),value:"published-date"},{label:(0,p.__)("Updated date","gp-premium"),value:"updated-date"}],onChange:function(e){n({gpDynamicDateType:e,gpDynamicTextBefore:"",gpDynamicUpdatedDateBefore:""})}}),"published-date"===T&&(0,a.createElement)(g.ToggleControl,{label:(0,p.__)("Replace with updated date","gp-premium"),checked:!!b,onChange:function(e){n({gpDynamicDateUpdated:e})}})),"terms"===o&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Taxonomy","gp-premium"),value:s,options:D,onChange:function(e){n({gpDynamicTextTaxonomy:e})}}),"generateblocks/headline"===i&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.TextControl,{label:(0,p.__)("Term separator","gp-premium"),type:"text",value:d,onChange:function(e){n({gpDynamicTextTaxonomySeparator:e})}}))),"comments-number"===o&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.TextControl,{label:(0,p.__)("No comments text","gp-premium"),type:"text",value:x,onChange:function(e){n({gpDynamicNoCommentsText:e})}}),(0,a.createElement)(g.TextControl,{label:(0,p.__)("Singular comments text","gp-premium"),type:"text",value:h,onChange:function(e){n({gpDynamicSingleCommentText:e})}}),(0,a.createElement)(g.TextControl,{label:(0,p.__)("Plural comments text","gp-premium"),help:(0,p.__)("Use % in place of the number of comments","gp-premium"),type:"text",value:f,onChange:function(e){n({gpDynamicMultipleCommentsText:e})}})),("post-meta"===o||"term-meta"===o||"user-meta"===o)&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Meta field name","gp-premium"),type:"text",value:m,onChange:function(e){n({gpDynamicTextCustomField:e})}}),"generateblocks/headline"===i&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.TextControl,{label:B,type:"text",value:u,onChange:function(e){n({gpDynamicTextBefore:e})}}),"post-date"===o&&!!b&&"published-date"===T&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Updated date before text","gp-premium"),type:"text",value:C,onChange:function(e){n({gpDynamicUpdatedDateBefore:e})}}))),S.length>1&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Dynamic link type","gp-premium"),value:y,options:S,onChange:function(e){"generateblocks/button"===i&&n(e?{gpDynamicLinkType:e,hasUrl:!0,url:"#"}:{gpDynamicLinkType:e,hasUrl:!1,url:""}),"generateblocks/headline"===i&&n({gpDynamicLinkType:e})}}),("post-meta"===y||"term-meta"===y||"user-meta"===y)&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Meta field name","gp-premium"),type:"text",value:_,onChange:function(e){n({gpDynamicLinkCustomField:e})}})),I&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Source","gp-premium"),value:r,options:[{label:(0,p.__)("Current post","gp-premium"),value:"current-post"},{label:(0,p.__)("Next post","gp-premium"),value:"next-post"},{label:(0,p.__)("Previous post","gp-premium"),value:"previous-post"}],onChange:function(e){n({gpDynamicSource:e})}}),("next-post"===r||"previous-post"===r)&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.ToggleControl,{label:(0,p.__)("In same term","gp-premium"),help:(0,p.__)("Check for posts with the same term as the current post.","gp-premim"),checked:!!k,onChange:function(e){n({gpDynamicSourceInSameTerm:e})}}),!!k&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Taxonomy","gp-premium"),help:(0,p.__)("The taxonomy to check if in the same term.","gp-premim"),type:"text",value:v,onChange:function(e){n({gpDynamicSourceInSameTermTaxonomy:e})}}))))}}]),o}(c.Component),E=L;function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function z(e){for(var t=1;tPrevious post title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"86e1ad46","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"post-author","gpDynamicLinkType":"author-archives","gpDynamicTextReplace":"Author name","gpDynamicSource":"previous-post","gpDynamicTextBefore":"by "} --\x3e

Author name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"2540358d","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row-reverse","flexDirectionMobile":"row","alignItems":"center","columnGap":"20px","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"typography":{"textAlignMobile":"left"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"gpRemoveContainerCondition":"no-next-post"} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"featured-image","imageSource":"next-post","imageSize":"thumbnail","linkTo":"single-post","imageWidth":100,"imageHeight":100,"avatarSize":100} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"daa456b5","isDynamic":true,"blockVersion":4,"sizing":{"width":"75%","widthMobile":"75%","height":"","maxWidth":""},"typography":{"textAlign":"right","textAlignMobile":"left"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"2883b2a4","element":"p","blockVersion":3,"spacing":{"marginBottom":"5px"},"gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Next post title","gpDynamicSource":"next-post"} --\x3e

Next post title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"3d2e07c6","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"post-author","gpDynamicLinkType":"author-archives","gpDynamicTextReplace":"Author name","gpDynamicSource":"next-post","gpDynamicTextBefore":"by "} --\x3e

Author name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_do_template_part"},{key:"_generate_hook_priority",value:"1"},{key:"_generate_disable_post_navigation",value:!0},{key:"_generate_use_archive_navigation_container",value:!0}]},template_2:{label:(0,p._x)("Two columns with arrows","label","gp-premium"),thumbnail:"post-navigation-arrows-1.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"d1dd99b1","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"20px","paddingRight":"0px","paddingBottom":"20px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"8878e700","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","flexDirectionMobile":"column","alignItems":"center","justifyContent":"space-between","rowGapMobile":"10px","sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"9c89f761","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","columnGap":"30px","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":"","marginBottomMobile":"10px"},"gpRemoveContainerCondition":"no-previous-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"9cf413a8","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthTablet":"","widthMobile":"","height":"","maxWidth":""},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":""}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"bec8d56e","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"10px","paddingRight":"10px","paddingBottom":"10px","paddingLeft":"10px"},"backgroundColor":"#000000","backgroundColorHover":"#abb8c3","textColor":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1.5em","height":"1.5em","paddingRight":"0.5em"},"gpDynamicLinkType":"single-post","gpDynamicSource":"previous-post"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"625f3305","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthTablet":"","widthMobile":"","height":"","maxWidth":""},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":""}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"a6f36397","element":"p","blockVersion":3,"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Previous post title","gpDynamicSource":"previous-post"} --\x3e

Previous post title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"3d262c0b","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Date","gpDynamicSource":"previous-post","gpDynamicDateUpdated":true} --\x3e

Date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"5d70717c","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","justifyContent":"flex-end","justifyContentMobile":"flex-start","columnGap":"30px","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"typography":{"textAlign":"right","textAlignMobile":"left"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"gpRemoveContainerCondition":"no-next-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"78f3ead4","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthTablet":"","widthMobile":"","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"643cf12f","element":"p","blockVersion":3,"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Next post title","gpDynamicSource":"next-post"} --\x3e

Next post title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"8ac35083","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Date","gpDynamicSource":"next-post","gpDynamicDateUpdated":true} --\x3e

Date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"780c810b","isDynamic":true,"blockVersion":4,"orderMobile":-1,"sizing":{"width":"","widthTablet":"","widthMobile":"","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"122d9fa4","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"10px","paddingRight":"10px","paddingBottom":"10px","paddingLeft":"10px"},"backgroundColor":"#000000","backgroundColorHover":"#abb8c3","textColor":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1.5em","height":"1.5em","paddingRight":"0.5em"},"gpDynamicLinkType":"single-post","gpDynamicSource":"next-post"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_do_template_part"},{key:"_generate_hook_priority",value:"1"},{key:"_generate_disable_post_navigation",value:!0},{key:"_generate_use_archive_navigation_container",value:!0}]},template_3:{label:(0,p._x)("Two columns with background overlays","label","gp-premium"),thumbnail:"post-navigation-overlay.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"aadd0a6f","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"3642451a","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"59edc08b","backgroundColor":"#000000","textColor":"#ffffff","linkColor":"#ffffff","linkColorHover":"#e3e3e3","bgImage":{"id":"","image":{"url":"#dynamic-background-image"}},"bgOptions":{"selector":"pseudo-element","opacity":0.4,"overlay":false,"position":"center center","size":"cover","repeat":"no-repeat","attachment":""},"innerZindex":1,"isDynamic":true,"blockVersion":4,"position":"relative","overflowX":"hidden","overflowY":"hidden","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"40px","paddingRight":"40px","paddingBottom":"40px","paddingLeft":"40px"},"paddingSyncUnits":true,"gpDynamicImageBg":"featured-image","gpDynamicSource":"previous-post","gpRemoveContainerCondition":"no-previous-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"a510c6c2","isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"8d3d4c12","element":"p","blockVersion":3,"display":"inline-block","typography":{"fontSize":"14px","textTransform":"uppercase"},"spacing":{"paddingTop":"5px","paddingRight":"10px","paddingBottom":"5px","paddingLeft":"10px"},"inlineWidth":true,"backgroundColor":"#cf2e2e"} --\x3e

Previous

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"352592d1","element":"h3","blockVersion":3,"typography":{"fontSize":"25px"},"spacing":{"marginBottom":"0px"},"className":"","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World","gpDynamicSource":"previous-post"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"993a41e4","backgroundColor":"#000000","textColor":"#ffffff","linkColor":"#ffffff","linkColorHover":"#e3e3e3","bgImage":{"id":"","image":{"url":"#dynamic-background-image"}},"bgOptions":{"selector":"pseudo-element","opacity":0.4,"overlay":false,"position":"center center","size":"cover","repeat":"no-repeat","attachment":""},"innerZindex":1,"isDynamic":true,"blockVersion":4,"position":"relative","overflowX":"hidden","overflowY":"hidden","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"40px","paddingRight":"40px","paddingBottom":"40px","paddingLeft":"40px"},"paddingSyncUnits":true,"gpDynamicImageBg":"featured-image","gpDynamicSource":"next-post","gpRemoveContainerCondition":"no-next-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"ea84c30e","isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"49c8845f","element":"p","blockVersion":3,"display":"inline-block","typography":{"fontSize":"14px","textTransform":"uppercase"},"spacing":{"paddingTop":"5px","paddingRight":"10px","paddingBottom":"5px","paddingLeft":"10px"},"inlineWidth":true,"backgroundColor":"#cf2e2e"} --\x3e

Next

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"6ba8079e","element":"h3","blockVersion":3,"typography":{"fontSize":"25px"},"spacing":{"marginBottom":"0px"},"className":"","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World","gpDynamicSource":"next-post"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_do_template_part"},{key:"_generate_hook_priority",value:"1"},{key:"_generate_disable_post_navigation",value:!0},{key:"_generate_use_archive_navigation_container",value:!1}]},template_4:{label:(0,p._x)("Two columns with arrows","label","gp-premium"),thumbnail:"post-navigation-arrows-2.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"96f5f0fa","innerContainer":"full","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"f9c8f86f","isDynamic":true,"blockVersion":4,"display":"flex","sizing":{"maxWidth":""},"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"5287d6da","backgroundColor":"#ffffff","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row-reverse","flexDirectionMobile":"column","justifyContent":"space-between","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"30px","paddingRight":"0px","paddingBottom":"25px","paddingLeft":"25px"},"gpRemoveContainerCondition":"no-previous-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"75cd654a","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthMobile":"100%","height":"","maxWidth":""},"typography":{"textAlignMobile":"right"},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":""}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"6acb0e83","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"15px","paddingRight":"20px","paddingBottom":"15px","paddingLeft":"20px"},"backgroundColor":"#0366d6","backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"gpDynamicLinkType":"single-post","gpDynamicSource":"previous-post"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"eb3b7005","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthMobile":"100%","height":"","maxWidth":""},"typography":{},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":"","paddingTopMobile":"","paddingRightMobile":"10px","paddingBottomMobile":"","paddingLeftMobile":"","marginTopMobile":"20px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"0a2d5bfc","element":"h3","blockVersion":3,"typography":{"textAlign":"left"},"spacing":{"marginBottom":"10px"},"textColor":"#000000","linkColor":"#000000","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World","gpDynamicSource":"previous-post"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"164ae39e","element":"p","blockVersion":3,"display":"flex","alignItems":"center","typography":{"fontSize":"14px"},"spacing":{"marginBottom":"0px"},"hasIcon":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"gpDynamicTextType":"comments-number","gpDynamicLinkType":"comments","gpDynamicTextReplace":"Comments number","gpDynamicSource":"previous-post"} --\x3e

Comments number

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"7af8fa61","backgroundColor":"#0366d6","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","flexDirectionMobile":"column","justifyContent":"space-between","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"30px","paddingRight":"25px","paddingBottom":"25px","paddingLeft":"0px"},"gpRemoveContainerCondition":"no-next-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"045e1698","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthMobile":"100%","height":"","maxWidth":""},"typography":{},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":""}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"557abb73","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"15px","paddingRight":"20px","paddingBottom":"15px","paddingLeft":"20px"},"backgroundColor":"#ffffff","backgroundColorHover":"#222222","textColor":"#0693e3","textColorHover":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"gpDynamicLinkType":"single-post","gpDynamicSource":"next-post"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"9ad09f6f","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthMobile":"100%","height":"","maxWidth":""},"typography":{},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":"","paddingLeftMobile":"10px","marginTopMobile":"20px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"9ba9e9d1","element":"h3","blockVersion":3,"typography":{},"spacing":{"marginBottom":"10px"},"textColor":"#ffffff","linkColor":"#ffffff","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World","gpDynamicSource":"next-post"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"8ebf8dbe","element":"p","blockVersion":3,"display":"flex","alignItems":"center","typography":{"fontSize":"14px","textAlign":""},"spacing":{"marginBottom":"0px"},"textColor":"#ffffff","linkColor":"#ffffff","hasIcon":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"gpDynamicTextType":"comments-number","gpDynamicLinkType":"comments","gpDynamicTextReplace":"Comments number","gpDynamicSource":"next-post"} --\x3e

Comments number

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_do_template_part"},{key:"_generate_hook_priority",value:"1"},{key:"_generate_disable_post_navigation",value:!0},{key:"_generate_use_archive_navigation_container",value:!1}]},template_5:{label:(0,p._x)("Two columns with featured image offset","label","gp-premim"),thumbnail:"post-navigation-offset.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"52018004","innerContainer":"full","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"typography":{"textAlign":"right"},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":"","marginRight":"30px","marginLeft":"30px","marginLeftTablet":"30px","marginRightMobile":"25px","marginLeftMobile":"25px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"e54982d5","isDynamic":true,"blockVersion":4,"sizing":{"maxWidth":""},"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/grid {"uniqueId":"7bdd6853","columns":4,"horizontalGap":0,"verticalGapMobile":0,"isDynamic":true,"blockVersion":3,"useLegacyRowGap":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"4138dd74","isGrid":true,"gridId":"7bdd6853","bgImage":{"id":"","image":{"url":"#dynamic-background-image"}},"verticalAlignment":"center","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"column","justifyContent":"center","sizing":{"width":"25%","widthTablet":"50%","widthMobile":"50%","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"borders":{"borderBottomLeftRadius":"10px","borderTopLeftRadius":"10px","borderBottomLeftRadiusTablet":"0px","borderBottomLeftRadiusMobile":"0px","borderTopLeftRadiusMobile":"5px"},"gpDynamicImageBg":"featured-image","gpDynamicSource":"previous-post","gpRemoveContainerCondition":"no-previous-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"83fd48c9","isDynamic":true,"blockVersion":4,"typography":{"textAlign":"left"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"a3aaad4c","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"15px","paddingRight":"15px","paddingBottom":"15px","paddingLeft":"15px","marginRight":"1.5em","marginLeft":"-1.5em"},"borders":{"borderTopWidth":"7px","borderTopStyle":"solid","borderTopColor":"#f9f9f9","borderRightWidth":"7px","borderRightStyle":"solid","borderRightColor":"#f9f9f9","borderBottomWidth":"7px","borderBottomStyle":"solid","borderBottomColor":"#f9f9f9","borderLeftWidth":"7px","borderLeftStyle":"solid","borderLeftColor":"#f9f9f9","borderTopRightRadius":"100%","borderBottomRightRadius":"100%","borderBottomLeftRadius":"100%","borderTopLeftRadius":"100%"},"backgroundColor":"#b5b5b5","backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1em","height":"1em","widthMobile":"0.8em","heightMobile":"0.8em","paddingRight":"0.5em"},"gpDynamicLinkType":"single-post","gpDynamicSource":"previous-post"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"18430adf","isGrid":true,"gridId":"7bdd6853","backgroundColor":"#ffffff","isDynamic":true,"blockVersion":4,"position":"relative","zindex":2,"sizing":{"width":"25%","widthTablet":"50%","widthMobile":"50%","height":"100%","maxWidth":""},"typography":{"textAlign":"center"},"spacing":{"paddingTop":"30px","paddingRight":"30px","paddingBottom":"30px","paddingLeft":"30px","marginRight":"10px","marginRightTablet":"0px","paddingTopMobile":"10px","paddingRightMobile":"10px","paddingBottomMobile":"10px","paddingLeftMobile":"10px","marginRightMobile":"0px"},"paddingSyncUnits":true,"borders":{"borderTopRightRadius":"10px","borderBottomRightRadius":"10px","borderBottomRightRadiusTablet":"0px","borderTopRightRadiusMobile":"5px","borderBottomRightRadiusMobile":"0px"},"gpDynamicImageBg":"featured-image","gpDynamicSource":"previous-post","gpRemoveContainerCondition":"no-previous-post"} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"2acc62a4","element":"h3","blockVersion":3,"typography":{"fontSize":"25px","textAlign":"left","fontSizeMobile":"17px"},"spacing":{"paddingTop":"10px","paddingRight":"10px","paddingBottom":"10px","paddingLeft":"10px","marginBottom":"0em","marginLeft":"-4em","marginLeftMobile":"-3em"},"paddingSyncUnits":true,"borders":{"borderBottomLeftRadius":"10px","borderTopLeftRadius":"10px","borderTopRightRadiusMobile":"5px","borderBottomRightRadiusMobile":"5px","borderBottomLeftRadiusMobile":"5px","borderTopLeftRadiusMobile":"5px"},"backgroundColor":"#ffffff","textColor":"#000000","linkColor":"#000000","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World","gpDynamicSource":"previous-post"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"ce9878f4","isGrid":true,"gridId":"7bdd6853","backgroundColor":"#ffffff","isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"width":"25%","widthTablet":"50%","widthMobile":"50%","height":"100%","maxWidth":""},"typography":{"textAlign":"center"},"spacing":{"paddingTop":"30px","paddingRight":"30px","paddingBottom":"30px","paddingLeft":"30px","marginLeft":"10px","marginLeftTablet":"0px","paddingTopMobile":"10px","paddingRightMobile":"10px","paddingBottomMobile":"10px","paddingLeftMobile":"10px","marginLeftMobile":"0px"},"paddingSyncUnits":true,"borders":{"borderBottomLeftRadius":"10px","borderTopLeftRadius":"10px","borderTopLeftRadiusTablet":"0px","borderBottomLeftRadiusMobile":"5px","borderTopLeftRadiusMobile":"0px"},"gpDynamicImageBg":"featured-image","gpDynamicSource":"next-post","gpRemoveContainerCondition":"no-next-post"} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"9d97a37f","element":"h3","blockVersion":3,"typography":{"fontSize":"25px","textAlign":"right","fontSizeMobile":"17px"},"spacing":{"paddingTop":"10px","paddingRight":"10px","paddingBottom":"10px","paddingLeft":"10px","marginRight":"-4em","marginBottom":"0em","marginRightMobile":"-3em"},"paddingSyncUnits":true,"borders":{"borderTopRightRadius":"10px","borderBottomRightRadius":"10px","borderTopRightRadiusMobile":"5px","borderBottomRightRadiusMobile":"5px","borderBottomLeftRadiusMobile":"5px","borderTopLeftRadiusMobile":"5px"},"backgroundColor":"#ffffff","textColor":"#000000","linkColor":"#000000","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World","gpDynamicSource":"next-post"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"6c856070","isGrid":true,"gridId":"7bdd6853","bgImage":{"id":"","image":{"url":"#dynamic-background-image"}},"verticalAlignment":"center","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"column","justifyContent":"center","sizing":{"width":"25%","widthTablet":"50%","widthMobile":"50%","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"borders":{"borderTopRightRadius":"10px","borderBottomRightRadius":"10px","borderTopRightRadiusTablet":"0px","borderTopRightRadiusMobile":"0px","borderBottomRightRadiusMobile":"5px"},"gpDynamicImageBg":"featured-image","gpDynamicSource":"next-post","gpRemoveContainerCondition":"no-next-post"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"be12f57c","isDynamic":true,"blockVersion":4} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"139d60e4","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"15px","paddingRight":"15px","paddingBottom":"15px","paddingLeft":"15px","marginRight":"-1.5em","marginLeft":"1.5em"},"borders":{"borderTopWidth":"7px","borderTopStyle":"solid","borderTopColor":"#f9f9f9","borderRightWidth":"7px","borderRightStyle":"solid","borderRightColor":"#f9f9f9","borderBottomWidth":"7px","borderBottomStyle":"solid","borderBottomColor":"#f9f9f9","borderLeftWidth":"7px","borderLeftStyle":"solid","borderLeftColor":"#f9f9f9","borderTopRightRadius":"100%","borderBottomRightRadius":"100%","borderBottomLeftRadius":"100%","borderTopLeftRadius":"100%"},"backgroundColor":"#b5b5b5","backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1em","height":"1em","widthMobile":"0.8em","heightMobile":"0.8em","paddingRight":"0.5em"},"gpDynamicLinkType":"single-post","gpDynamicSource":"next-post"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/grid --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_do_template_part"},{key:"_generate_hook_priority",value:"1"},{key:"_generate_disable_post_navigation",value:!0},{key:"_generate_use_archive_navigation_container",value:!1}]}},Z={basic_1:{label:(0,p._x)("Inline with avatar","label","gp-premium"),thumbnail:"post-meta-inline.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"8a25fc79","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","sizing":{"height":"","maxWidth":""},"typography":{"fontSize":"14px"},"spacing":{"paddingTop":"15px","paddingRight":"0px","paddingBottom":"15px","paddingLeft":"0px","marginTop":"20px","marginBottom":"20px"},"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#e8edf0","borderBottomWidth":"1px","borderBottomStyle":"solid","borderBottomColor":"#e8edf0"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"82a213c1","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center"} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"author-avatar","avatarRounded":true} /--\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"3fb4928a","element":"div","blockVersion":3,"display":"inline-block","spacing":{"paddingRight":"10px","marginLeft":"10px"},"inlineWidth":true,"gpDynamicTextType":"post-author","gpDynamicLinkType":"author-archives","gpDynamicTextReplace":"Author Name"} --\x3e
Author Name
\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"f9b55781","element":"div","blockVersion":3,"display":"inline-block","spacing":{"paddingLeft":"10px"},"inlineWidth":true,"borders":{"borderLeftWidth":"1px","borderLeftStyle":"solid","borderLeftColor":"#e8edf0"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Date"} --\x3e
Date
\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"8fca9ec9","element":"div","blockVersion":3,"display":"inline-flex","alignItems":"center","spacing":{"paddingLeft":"10px","marginLeft":"10px"},"inlineWidth":true,"borders":{"borderLeftWidth":"1px","borderLeftStyle":"solid","borderLeftColor":"#e8edf0"},"hasIcon":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"gpDynamicTextType":"comments-number","gpDynamicLinkType":"comments","gpDynamicTextReplace":"Comments","gpDynamicTextTaxonomy":"category","gpDynamicNoCommentsText":"0","gpDynamicSingleCommentText":"1","gpDynamicMultipleCommentsText":"%"} --\x3e
Comments
\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_post_meta_location",value:"after-post-title"},{key:"_generate_disable_primary_post_meta",value:!0}]},basic_2:{label:(0,p._x)("Stacked with avatar","label","gp-premium"),thumbnail:"post-meta-avatar-stacked.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"a745be15","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","columnGap":"20px","sizing":{"height":"","maxWidth":""},"typography":{"fontSize":"14px"},"spacing":{"paddingTop":"20px","paddingRight":"0px","paddingBottom":"20px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"fd4592f4","isDynamic":true,"blockVersion":4,"sizing":{"width":"10%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"author-avatar","avatarSize":120} /--\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"137e86ad","isDynamic":true,"blockVersion":4,"sizing":{"width":"90%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"d7bb0434","element":"p","blockVersion":3,"spacing":{"marginBottom":"5px"},"gpDynamicTextType":"post-author","gpDynamicLinkType":"author-archives","gpDynamicTextReplace":"Author Name"} --\x3e

Author Name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"759ebd2f","element":"p","blockVersion":3,"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Date","gpDynamicDateUpdated":true} --\x3e

Date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_post_meta_location",value:"after-post-title"},{key:"_generate_disable_primary_post_meta",value:!0}]},basic_3:{label:(0,p._x)("Term buttons","label","gp-premium"),thumbnail:"post-meta-term-buttons.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"7134d7c2","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","columnGap":"10px","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"e378fc0b","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"13px","textAlign":"center"},"fontSize":"","spacing":{"paddingTop":"10px","paddingRight":"10px","paddingBottom":"10px","paddingLeft":"10px","marginTop":"","marginRight":"","marginBottom":"","marginLeft":""},"borders":{"borderTopRightRadius":"","borderBottomRightRadius":"","borderBottomLeftRadius":"","borderTopLeftRadius":""},"backgroundColor":"#000000","backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#ffffff","className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicLinkType":"term-archives","gpDynamicTextReplace":"Terms","gpDynamicTextTaxonomy":"category"} --\x3e Terms \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_post_meta_location",value:"before-post-title"},{key:"_generate_disable_primary_post_meta",value:!1}]}},Q={template_1:{label:(0,p._x)("Full footer 1","label","gp-premium"),thumbnail:"site-footer-full-1.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"73cd57e1","backgroundColor":"#1b1b42","shapeDividers":[],"isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"140px","paddingRight":"30px","paddingBottom":"60px","paddingLeft":"30px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"7d9550dd","isDynamic":true,"blockVersion":4,"sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/grid {"uniqueId":"b76f312f","columns":3,"horizontalGap":80,"verticalAlignment":"center","verticalGapTablet":40,"isDynamic":true,"blockVersion":3,"useLegacyRowGap":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"53cb46e2","isGrid":true,"gridId":"b76f312f","isDynamic":true,"blockVersion":4,"sizing":{"width":"60%","widthTablet":"100%","widthMobile":"100%","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"aa19f1fb","element":"h3","blockVersion":3,"textColor":"#ffffff"} --\x3e

Reach out to us for a consultation.

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"41582601","element":"p","blockVersion":3,"spacing":{"paddingRight":"100px","paddingRightTablet":"0px"},"textColor":"#ffffff"} --\x3e

Semper blandit suspendisse faucibus metus lobortis morbi magna vivamus per risus fermentum dapibus imperdiet praesent magnis.

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"529d5dda","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontWeight":"600","textAlign":"center"},"spacing":{"paddingTop":"10px","paddingRight":"20px","paddingBottom":"10px","paddingLeft":"20px","marginRight":"20px","marginBottomMobile":"20px"},"borders":{"borderTopWidth":"3px","borderTopStyle":"solid","borderTopColor":"#ffffff","borderTopColorHover":"rgba(242, 245, 250, 0.8)","borderRightWidth":"3px","borderRightStyle":"solid","borderRightColor":"#ffffff","borderRightColorHover":"rgba(242, 245, 250, 0.8)","borderBottomWidth":"3px","borderBottomStyle":"solid","borderBottomColor":"#ffffff","borderBottomColorHover":"rgba(242, 245, 250, 0.8)","borderLeftWidth":"3px","borderLeftStyle":"solid","borderLeftColor":"#ffffff","borderLeftColorHover":"rgba(242, 245, 250, 0.8)","borderTopRightRadius":"2px","borderBottomRightRadius":"2px","borderBottomLeftRadius":"2px","borderTopLeftRadius":"2px"},"backgroundColorHover":"#6212b3","backgroundColorHoverOpacity":0,"textColor":"#ffffff","textColorHover":"#f2f5fa"} --\x3e Contact Us \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"e1bd60bb","isGrid":true,"gridId":"b76f312f","removeVerticalGapTablet":true,"isDynamic":true,"blockVersion":4,"sizing":{"width":"20%","widthTablet":"50%","widthMobile":"100%","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"37420255","element":"p","blockVersion":3,"textColor":"#ffffff"} --\x3e

Company Name
Address Here
Address Here

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"bf8e162e","element":"p","blockVersion":3,"display":"flex","alignItems":"center","spacing":{"marginBottom":"0px"},"textColor":"#ffffff","linkColor":"#ffffff","linkColorHover":"#f2f5fa","hasIcon":true,"iconStyles":{"width":"1em","height":"1em","paddingTop":".1em","paddingRight":"0.5em"}} --\x3e

+1 000 000 0000

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"c762d353","isGrid":true,"gridId":"b76f312f","removeVerticalGapTablet":true,"removeVerticalGapMobile":true,"isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","columnGap":"10px","sizing":{"width":"20%","widthTablet":"50%","widthMobile":"100%","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"13c371f8","hasUrl":true,"ariaLabel":"instagram link","blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"6px","paddingRight":"6px","paddingBottom":"6px","paddingLeft":"6px","marginRight":""},"borders":{"borderTopWidth":"2px","borderTopStyle":"solid","borderTopColor":"#ffffff","borderTopColorHover":"#f2f5fa","borderRightWidth":"2px","borderRightStyle":"solid","borderRightColor":"#ffffff","borderRightColorHover":"#f2f5fa","borderBottomWidth":"2px","borderBottomStyle":"solid","borderBottomColor":"#ffffff","borderBottomColorHover":"#f2f5fa","borderLeftWidth":"2px","borderLeftStyle":"solid","borderLeftColor":"#ffffff","borderLeftColorHover":"#f2f5fa","borderTopRightRadius":"50px","borderBottomRightRadius":"50px","borderBottomLeftRadius":"50px","borderTopLeftRadius":"50px"},"backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#f2f5fa","hasIcon":true,"removeText":true,"iconStyles":{"width":"0.8em","height":"0.8em","paddingRight":"0.5em"}} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"926332bd","hasUrl":true,"ariaLabel":"twitter link","blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"6px","paddingRight":"6px","paddingBottom":"6px","paddingLeft":"6px","marginRight":""},"borders":{"borderTopWidth":"2px","borderTopStyle":"solid","borderTopColor":"#ffffff","borderTopColorHover":"#f2f5fa","borderRightWidth":"2px","borderRightStyle":"solid","borderRightColor":"#ffffff","borderRightColorHover":"#f2f5fa","borderBottomWidth":"2px","borderBottomStyle":"solid","borderBottomColor":"#ffffff","borderBottomColorHover":"#f2f5fa","borderLeftWidth":"2px","borderLeftStyle":"solid","borderLeftColor":"#ffffff","borderLeftColorHover":"#f2f5fa","borderTopRightRadius":"50px","borderBottomRightRadius":"50px","borderBottomLeftRadius":"50px","borderTopLeftRadius":"50px"},"backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#f2f5fa","hasIcon":true,"removeText":true,"iconStyles":{"width":"0.8em","height":"0.8em","paddingRight":"0.5em"}} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"d957854e","hasUrl":true,"ariaLabel":"facebook link","blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"6px","paddingRight":"6px","paddingBottom":"6px","paddingLeft":"6px"},"borders":{"borderTopWidth":"2px","borderTopStyle":"solid","borderTopColor":"#ffffff","borderTopColorHover":"#f2f5fa","borderRightWidth":"2px","borderRightStyle":"solid","borderRightColor":"#ffffff","borderRightColorHover":"#f2f5fa","borderBottomWidth":"2px","borderBottomStyle":"solid","borderBottomColor":"#ffffff","borderBottomColorHover":"#f2f5fa","borderLeftWidth":"2px","borderLeftStyle":"solid","borderLeftColor":"#ffffff","borderLeftColorHover":"#f2f5fa","borderTopRightRadius":"50px","borderBottomRightRadius":"50px","borderBottomLeftRadius":"50px","borderTopLeftRadius":"50px"},"backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#f2f5fa","hasIcon":true,"removeText":true,"iconStyles":{"width":"0.8em","height":"0.8em","paddingRight":"0.5em"}} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/grid --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"0f87c806","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","flexDirectionMobile":"column-reverse","alignItems":"center","justifyContent":"space-between","rowGapMobile":"20px","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"60px","paddingRight":"0px","paddingBottom":"60px","paddingLeft":"0px","marginTop":"60px"},"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#ffffff"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"e6861bde","isDynamic":true,"blockVersion":4,"sizing":{"width":"","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"97c10964","element":"p","blockVersion":3,"typography":{"fontSize":"17px"},"spacing":{"marginBottom":"0px"},"textColor":"#ffffff"} --\x3e

© Company Name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"7c528044","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","flexDirectionMobile":"column","alignItems":"center","alignItemsMobile":"flex-start","columnGap":"20px","rowGapMobile":"10px","sizing":{"width":"","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"907cc664","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"17px","textAlign":"center"},"fontSize":"","spacing":{"marginRight":""},"textColor":"#ffffff","textColorHover":"#f2f5fa"} --\x3e Privacy Policy \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"a6a340bc","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"17px","textAlign":"center"},"fontSize":"","textColor":"#ffffff","textColorHover":"#f2f5fa"} --\x3e Terms of Service \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e'},template_2:{label:(0,p._x)("Full footer 2","label","gp-premium"),thumbnail:"site-footer-full-2.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"e224c1dd","backgroundColor":"#fafbfc","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"80px","paddingRight":"20px","paddingBottom":"80px","paddingLeft":"20px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"0836612c","isDynamic":true,"blockVersion":4,"sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"34307d45","element":"p","blockVersion":3,"typography":{"fontSize":"14px","letterSpacing":"0.3em","fontWeight":"bold","textTransform":"uppercase","textAlign":"center"},"spacing":{"marginTop":"10px"},"textColor":"#2e3d4d"} --\x3e

Your Company Name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"4068688a","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","flexDirectionMobile":"column","alignItems":"center","rowGapMobile":"20px","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"60px","paddingRight":"20px","paddingBottom":"60px","paddingLeft":"20px","marginTop":"60px","marginBottom":"60px"},"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#5c7a99","borderBottomWidth":"1px","borderBottomStyle":"solid","borderBottomColor":"#5c7a99"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"12d457ad","isDynamic":true,"blockVersion":4,"sizing":{"width":"33.33%","widthMobile":"100%","height":"","maxWidth":""},"typography":{"textAlign":"center"},"spacing":{"paddingTop":"0px","paddingRight":"20px","paddingBottom":"0px","paddingLeft":"20px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"8818b435","element":"p","blockVersion":3,"typography":{"fontSize":"13px","letterSpacing":"0.2em","fontWeight":"bold","textTransform":"uppercase"},"spacing":{"marginBottom":"0px"}} --\x3e

PH +1 000 000 0000

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"68ec175a","isDynamic":true,"blockVersion":4,"sizing":{"width":"33.33%","widthMobile":"100%","height":"","maxWidth":""},"typography":{"textAlign":"center"},"spacing":{"paddingTop":"0px","paddingRight":"20px","paddingBottom":"0px","paddingLeft":"20px"},"borders":{"borderRightWidth":"1px","borderRightStyle":"solid","borderRightColor":"#5c7a99","borderLeftWidth":"1px","borderLeftStyle":"solid","borderLeftColor":"#5c7a99","borderTopWidthMobile":"0px","borderTopStyleMobile":"solid","borderTopColorMobile":"#5c7a99","borderRightWidthMobile":"0px","borderRightStyleMobile":"solid","borderRightColorMobile":"#5c7a99","borderBottomWidthMobile":"0px","borderBottomStyleMobile":"solid","borderBottomColorMobile":"#5c7a99","borderLeftWidthMobile":"0px","borderLeftStyleMobile":"solid","borderLeftColorMobile":"#5c7a99"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"cf4dcfab","element":"p","blockVersion":3,"typography":{"fontSize":"13px","letterSpacing":"0.2em","fontWeight":"bold","textTransform":"uppercase"},"spacing":{"marginBottom":"0px"}} --\x3e

24 M Drive
East Hampton, NY 11937

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"47f78435","removeVerticalGapMobile":true,"isDynamic":true,"blockVersion":4,"sizing":{"width":"33.33%","widthMobile":"100%","height":"","maxWidth":""},"typography":{"textAlign":"center"},"spacing":{"paddingTop":"0px","paddingRight":"20px","paddingBottom":"0px","paddingLeft":"20px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"2800ad9a","hasUrl":false,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"marginRight":"20px"},"textColor":"#2e3d4d","textColorHover":"#5c7a99","hasIcon":true,"removeText":true,"iconStyles":{"width":"0.9em","height":"0.9em","paddingRight":"0.5em"}} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"eb98a6f6","hasUrl":false,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"marginRight":"20px"},"textColor":"#2e3d4d","textColorHover":"#5c7a99","hasIcon":true,"removeText":true,"iconStyles":{"width":"0.9em","height":"0.9em","paddingRight":"0.5em"}} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"ab839eb9","hasUrl":false,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"marginRight":"20px"},"textColor":"#2e3d4d","textColorHover":"#5c7a99","hasIcon":true,"removeText":true,"iconStyles":{"width":"0.8em","height":"0.8em","paddingRight":"0.5em"}} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"5b757c38","hasUrl":false,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"marginRight":"20px"},"textColor":"#2e3d4d","textColorHover":"#5c7a99","hasIcon":true,"removeText":true,"iconStyles":{"width":"0.8em","height":"0.8em","paddingRight":"0.5em"}} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"77c9f71e","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","flexDirectionMobile":"column","alignItems":"center","justifyContent":"space-between","rowGapMobile":"20px"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"cc32f783","isDynamic":true,"blockVersion":4,"sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"1e50faeb","element":"p","blockVersion":3,"typography":{"fontSize":"12px","letterSpacing":"0.2em","fontWeight":"bold","textTransform":"uppercase","textAlign":"left","textAlignMobile":"center"},"spacing":{"marginBottom":"0px"}} --\x3e

© Your Copyright Message

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"b706d851","removeVerticalGapMobile":true,"isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","justifyContent":"flex-end","justifyContentMobile":"center","columnGap":"20px","rowGap":"10px","sizing":{"width":"50%","widthMobile":"100%","height":"","maxWidth":""},"typography":{},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"373aae0d","hasUrl":false,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"12px","letterSpacing":"0.2em","fontWeight":"bold","textTransform":"uppercase","textAlign":"center"},"fontSize":"","spacing":{"marginRight":""},"textColor":"#2e3d4d","textColorHover":"#5c7a99"} --\x3e Privacy Policy \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"3cd1cf71","hasUrl":false,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"12px","letterSpacing":"0.2em","fontWeight":"bold","textTransform":"uppercase","textAlign":"center"},"fontSize":"","textColor":"#2e3d4d","textColorHover":"#5c7a99"} --\x3e Terms of Service \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e'}},ee={template_1:{label:(0,p._x)("Basic layout with term buttons","label","gp-premium"),thumbnail:"content-template-basic.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"d2cafe96","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":""},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"75c01790","isDynamic":true,"blockVersion":4} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"38620841","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"13px","textAlign":"center"},"fontSize":"","spacing":{"paddingTop":"5px","paddingRight":"10px","paddingBottom":"5px","paddingLeft":"10px"},"backgroundColor":"#000000","backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#ffffff","className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicLinkType":"term-archives","gpDynamicTextReplace":"Terms","gpDynamicTextTaxonomy":"category"} --\x3e Terms \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"f593ba8c","blockVersion":3,"typography":{"fontWeight":"bold"},"spacing":{"marginBottom":"30px"},"linkColor":"#000000","linkColorHover":"#858585","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Post Title"} --\x3e

Post Title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"1ed16867","isDynamic":true,"blockVersion":4,"display":"flex","alignItems":"center","justifyContent":"space-between","columnGap":"10px","rowGap":"10px","sizing":{"height":"","maxWidth":""},"typography":{"fontSize":"14px"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"dc72dc13","isDynamic":true,"blockVersion":4,"display":"flex","alignItems":"center","sizing":{"width":"50%","widthMobile":"50%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"author-avatar","avatarRounded":true} /--\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"c7b33e8b","element":"p","blockVersion":3,"spacing":{"marginBottom":"0px","marginLeft":"10px"},"gpDynamicTextType":"post-author","gpDynamicLinkType":"author-archives","gpDynamicTextReplace":"Author name"} --\x3e

Author name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"ec93a944","isDynamic":true,"blockVersion":4,"sizing":{"width":"50%","widthMobile":"50%","height":"","maxWidth":""},"typography":{"textAlign":"right"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"af8af68e","element":"p","blockVersion":3,"spacing":{"marginBottom":"0px"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Post date","gpDynamicDateUpdated":true} --\x3e

Post date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"b70b46a6","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginTop":"30px","marginBottom":"30px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"featured-image","imageSize":"medium_large","linkTo":"single-post"} /--\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generatepress/dynamic-content {"contentType":"post-excerpt"} /--\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_block_element_editor_width_unit",value:"px"},{key:"_generate_block_element_editor_width",value:"750"},{key:"_generate_use_theme_post_container",value:!0}]},template_2:{label:(0,p._x)("Layout with offset content","label","gp-premium"),thumbnail:"content-template-offset.jpg",content:'\x3c!-- wp:generatepress/dynamic-image {"imageType":"featured-image","imageSize":"large","linkTo":"single-post"} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"05e7d83e","backgroundColor":"#ffffff","isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"20px","paddingRight":"20px","paddingBottom":"20px","paddingLeft":"20px","marginTop":"-65px","marginRight":"40px","marginBottom":"20px","marginLeft":"0px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"83898f1c","element":"p","blockVersion":3,"typography":{"fontSize":"14px","fontWeight":"700","textTransform":"uppercase"},"spacing":{"marginBottom":"20px"},"linkColor":"#000000","linkColorHover":"#abb8c3","className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicLinkType":"term-archives","gpDynamicTextReplace":"Category","gpDynamicTextTaxonomy":"category"} --\x3e

Category

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"98a0e67b","blockVersion":3,"typography":{"fontSize":"28px"},"gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Title"} --\x3e

Title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generatepress/dynamic-content {"contentType":"post-excerpt","excerptLength":25,"useThemeMoreLink":false} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"fed802f7","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","justifyContent":"space-between","columnGap":"5px","rowGap":"5px","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginTop":"20px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"74fcc8db","isDynamic":true,"blockVersion":4,"display":"flex","alignItems":"center","sizing":{"width":"66.66%","widthMobile":"66.66%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginTop":"15px"}} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"author-avatar","avatarSize":35,"avatarRounded":true} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"33ed7660","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginLeft":"10px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"2def9732","element":"p","blockVersion":3,"typography":{"fontSize":"15px"},"spacing":{"marginBottom":"0px"},"borders":{"borderRightWidth":"0px","borderRightStyle":"solid"},"gpDynamicTextType":"post-author","gpDynamicTextReplace":"Post author name"} --\x3e

Post author name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"dd34513e","element":"p","blockVersion":3,"typography":{"fontSize":"12px"},"spacing":{"marginRight":"10px","marginBottom":"0px"},"borders":{"borderBottomWidth":"0px","borderBottomStyle":"solid"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Date","gpDynamicDateUpdated":true} --\x3e

Date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"6d144082","verticalAlignment":"center","isDynamic":true,"blockVersion":4,"sizing":{"width":"33.33%","widthMobile":"33.33%","height":"","maxWidth":""},"typography":{"textAlign":"right"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginTop":"15px"},"gpInlinePostMetaJustify":"flex-end"} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"7c89fc64","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontWeight":"700","textTransform":"uppercase","textAlign":"center"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"textColor":"#000000","textColorHover":"#abb8c3","gpDynamicLinkType":"single-post"} --\x3e More \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_block_element_editor_width_unit",value:"px"},{key:"_generate_block_element_editor_width",value:"500"},{key:"_generate_use_theme_post_container",value:!1}]},template_3:{label:(0,p._x)("Layout with featured image overlay","label","gp-premim"),thumbnail:"content-template-overlay.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"99e0f8fe","gradient":true,"gradientDirection":180,"gradientColorOne":"#000000","gradientColorOneOpacity":0.62,"gradientColorTwo":"#000000","gradientColorTwoOpacity":0,"gradientSelector":"pseudo-element","textColor":"#ffffff","linkColor":"#ffffff","linkColorHover":"#ffffff","bgImage":{"id":"","image":{"url":"#dynamic-background-image"}},"innerZindex":1,"isDynamic":true,"blockVersion":4,"position":"relative","overflowX":"hidden","overflowY":"hidden","sizing":{"minHeight":"420px","height":"","maxWidth":""},"spacing":{"paddingTop":"20px","paddingRight":"20px","paddingBottom":"20px","paddingLeft":"20px"},"borders":{"borderTopRightRadius":"12px","borderBottomRightRadius":"12px","borderBottomLeftRadius":"12px","borderTopLeftRadius":"12px"},"gpDynamicImageBg":"featured-image"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"95ce0971","isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"864271b1","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","justifyContent":"space-between","columnGap":"5px","rowGap":"5px","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginBottom":"10px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"bc0ec4fa","element":"p","blockVersion":3,"typography":{"fontSize":"13px","fontWeight":"700","textTransform":"uppercase"},"spacing":{"marginRight":"10px","marginBottom":"0px"},"className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicTextReplace":"Category","gpDynamicTextTaxonomy":"category","gpDynamicTextTaxonomySeparator":" / "} --\x3e

Category

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"5e2dac4c","element":"p","blockVersion":3,"display":"flex","alignItems":"center","justifyContent":"flex-end","typography":{"fontSize":"12px","textAlign":"right"},"spacing":{"marginBottom":"0px"},"hasIcon":true,"iconStyles":{"width":"1.4em","height":"1.4em","paddingRight":"0.5em"},"gpDynamicTextType":"comments-number","gpDynamicTextReplace":"COMMENTS","gpDynamicNoCommentsText":"0","gpDynamicSingleCommentText":"1","gpDynamicMultipleCommentsText":"%"} --\x3e

COMMENTS

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"b1e898af","blockVersion":3,"typography":{"fontSize":"24px"},"marginUnit":"%","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Title"} --\x3e

Title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"64bb1fda","isDynamic":true,"blockVersion":4,"display":"flex","justifyContent":"flex-end","spacing":{"marginTop":"300px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"95f40917","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"12px","fontWeight":"700","textTransform":"uppercase","textAlign":"center"},"fontSize":"","spacing":{"paddingTop":"10px","paddingRight":"20px","paddingBottom":"10px","paddingLeft":"20px"},"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#ffffff","borderTopColorHover":"#ffffff","borderRightWidth":"1px","borderRightStyle":"solid","borderRightColor":"#ffffff","borderRightColorHover":"#ffffff","borderBottomWidth":"1px","borderBottomStyle":"solid","borderBottomColor":"#ffffff","borderBottomColorHover":"#ffffff","borderLeftWidth":"1px","borderLeftStyle":"solid","borderLeftColor":"#ffffff","borderLeftColorHover":"#ffffff","borderTopRightRadius":"8px","borderBottomRightRadius":"8px","borderBottomLeftRadius":"8px","borderTopLeftRadius":"8px"},"backgroundColor":"#ffffff","backgroundColorHover":"#ffffff","backgroundColorHoverOpacity":0.75,"textColor":"#000000","textColorHover":"#000000","gpDynamicLinkType":"single-post"} --\x3e Read More \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_block_element_editor_width_unit",value:"px"},{key:"_generate_block_element_editor_width",value:"500"},{key:"_generate_use_theme_post_container",value:!1}]},template_4:{label:(0,p._x)("Layout with slanted shape divider","label","gp-premim"),thumbnail:"content-template-slant.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"0af7ec3a","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"paddingSyncUnits":true,"borders":{"borderTopWidth":"0px","borderTopStyle":"solid","borderTopColor":"#000000","borderRightWidth":"0px","borderRightStyle":"solid","borderRightColor":"#000000","borderBottomWidth":"0px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderLeftWidth":"0px","borderLeftStyle":"solid","borderLeftColor":"#000000"}} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"featured-image","imageSize":"large"} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"cc5683f8","shapeDividers":[{"shape":"gb-angle-1","color":"#ffffff","colorOpacity":1,"location":"bottom","height":50,"heightTablet":"","heightMobile":"","width":100,"widthTablet":"","widthMobile":"","flipHorizontally":false,"zindex":""}],"isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"height":"","maxWidth":""},"typography":{"fontSize":"14px"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginTop":"0px","marginBottom":"0px"},"paddingSyncUnits":true} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"7f6bf8cd","backgroundColor":"#ffffff","shapeDividers":[],"isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"25px","paddingBottom":"15px","paddingLeft":"25px","marginTop":"0px","marginRight":"0px","marginBottom":"0px","marginLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"7fd9c317","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginBottom":"5px"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Post date","gpDynamicDateUpdated":true} --\x3e

Post date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"a8ee15fd","blockVersion":3,"typography":{"fontSize":"30px"},"spacing":{"marginBottom":"15px"},"gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generatepress/dynamic-content {"contentType":"post-excerpt","excerptLength":25,"useThemeMoreLink":false} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"72735d03","isDynamic":true,"blockVersion":4,"display":"flex","justifyContent":"flex-end"} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"120ee35e","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontWeight":"700","textTransform":"uppercase","textAlign":"center"},"spacing":{"paddingTop":"15px","paddingRight":"20px","paddingBottom":"15px","paddingLeft":"20px"},"backgroundColorHover":"#222222","textColor":"#000000","textColorHover":"#ffffff","gpDynamicLinkType":"single-post"} --\x3e Read More \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_block_element_editor_width_unit",value:"px"},{key:"_generate_block_element_editor_width",value:"500"},{key:"_generate_use_theme_post_container",value:!1}]},template_5:{label:(0,p._x)("Layout with centered content","label","gp-premim"),thumbnail:"content-template-centered.jpg",content:'\x3c!-- wp:generatepress/dynamic-image {"imageType":"featured-image","imageSize":"large"} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"5a785d21","backgroundColor":"#ffffff","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"typography":{"textAlign":"center"},"spacing":{"paddingTop":"25px","paddingRight":"25px","paddingBottom":"25px","paddingLeft":"25px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"82629d5c","blockVersion":3,"typography":{"fontSize":"25px","fontWeight":"700"},"linkColor":"#000000","gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generatepress/dynamic-content {"contentType":"post-excerpt","excerptLength":15,"useThemeMoreLink":false} /--\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"a1b8a609","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"fontSize":"15px","textTransform":"uppercase","textAlign":"center"},"fontSize":"","spacing":{"paddingTop":"8px","paddingRight":"20px","paddingBottom":"8px","paddingLeft":"20px"},"borders":{"borderTopRightRadius":"50px","borderBottomRightRadius":"50px","borderBottomLeftRadius":"50px","borderTopLeftRadius":"50px"},"backgroundColor":"#cf2e2e","backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#ffffff","gpDynamicLinkType":"single-post"} --\x3e Read more \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_block_element_editor_width_unit",value:"px"},{key:"_generate_block_element_editor_width",value:"500"},{key:"_generate_use_theme_post_container",value:!1}]},template_6:{label:(0,p._x)("Layout with borders","label","gp-premim"),thumbnail:"content-template-borders.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"0af4cc7c","backgroundColor":"#ffffff","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"5px","paddingRight":"5px","paddingBottom":"5px","paddingLeft":"5px"},"paddingSyncUnits":true,"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#b6b6b6","borderRightWidth":"1px","borderRightStyle":"solid","borderRightColor":"#b6b6b6","borderBottomWidth":"1px","borderBottomStyle":"solid","borderBottomColor":"#b6b6b6","borderLeftWidth":"1px","borderLeftStyle":"solid","borderLeftColor":"#b6b6b6","borderTopRightRadius":"2px","borderBottomRightRadius":"2px","borderBottomLeftRadius":"2px","borderTopLeftRadius":"2px"}} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"featured-image","imageSize":"large"} /--\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"b69b5c43","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"30px","paddingRight":"30px","paddingBottom":"30px","paddingLeft":"30px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"8dfa4238","element":"p","blockVersion":3,"typography":{"fontSize":"14px","fontWeight":"700","textTransform":"uppercase"},"spacing":{"marginBottom":"5px"},"textColor":"#0693e3","className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicLinkType":"term-archives","gpDynamicTextReplace":"Terms","gpDynamicTextTaxonomy":"category"} --\x3e

Terms

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"29491daa","blockVersion":3,"typography":{"fontSize":"30px"},"spacing":{"marginBottom":"15px"},"gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Hello World"} --\x3e

Hello World

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generatepress/dynamic-content {"contentType":"post-excerpt","excerptLength":25,"useThemeMoreLink":false} /--\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"d5dadc43","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","justifyContent":"space-between","sizing":{"height":"","maxWidth":""},"typography":{"fontSize":"14px"},"spacing":{"paddingTop":"15px","paddingRight":"10px","paddingBottom":"10px","paddingLeft":"10px"},"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#b6b6b6"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"2c30b1f9","isDynamic":true,"blockVersion":4,"sizing":{"width":"50%","widthMobile":"50%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"fc06eba3","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginBottom":"0px"},"textColor":"#b6b6b6","gpDynamicTextType":"post-date","gpDynamicTextReplace":"Post date","gpDynamicTextTaxonomy":"category","gpDynamicDateUpdated":true} --\x3e

Post date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"9bb8c373","isDynamic":true,"blockVersion":4,"sizing":{"width":"50%","widthMobile":"50%","height":"","maxWidth":""},"typography":{"textAlign":"right"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"0fcad1cd","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textTransform":"uppercase","textAlign":"center"},"spacing":{"paddingTop":"8px","paddingRight":"12px","paddingBottom":"8px","paddingLeft":"12px"},"borders":{"borderTopWidth":"2px","borderTopStyle":"solid","borderTopColor":"#0693e3","borderTopColorHover":"#222222","borderRightWidth":"2px","borderRightStyle":"solid","borderRightColor":"#0693e3","borderRightColorHover":"#222222","borderBottomWidth":"2px","borderBottomStyle":"solid","borderBottomColor":"#0693e3","borderBottomColorHover":"#222222","borderLeftWidth":"2px","borderLeftStyle":"solid","borderLeftColor":"#0693e3","borderLeftColorHover":"#222222","borderTopRightRadius":"2px","borderBottomRightRadius":"2px","borderBottomLeftRadius":"2px","borderTopLeftRadius":"2px"},"backgroundColorHover":"#222222","textColor":"#0693e3","textColorHover":"#ffffff","gpDynamicLinkType":"single-post"} --\x3e Read more \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_block_element_editor_width_unit",value:"px"},{key:"_generate_block_element_editor_width",value:"500"},{key:"_generate_use_theme_post_container",value:!1}]},template_7:{label:(0,p._x)("Landscape layout","label","gp-premium"),thumbnail:"content-template-landscape.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"918d68ce","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"","paddingRight":"","paddingBottom":"","paddingLeft":""},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/grid {"uniqueId":"ae18e4a9","columns":2,"horizontalGap":30,"verticalGapMobile":10,"isDynamic":true,"blockVersion":3,"useLegacyRowGap":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"ff15641f","isGrid":true,"gridId":"ae18e4a9","isDynamic":true,"blockVersion":4,"sizing":{"width":"40%","widthTablet":"40%","widthMobile":"100%","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"gpRemoveContainerCondition":"no-featured-image"} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"featured-image","imageSize":"medium_large","linkTo":"single-post"} /--\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"64596747","isGrid":true,"gridId":"ae18e4a9","verticalAlignment":"center","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"column","justifyContent":"center","sizing":{"width":"60%","widthTablet":"60%","widthMobile":"100%","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"20px","paddingBottom":"10px","paddingLeft":"0px","paddingTopMobile":"10px","paddingRightMobile":"10px","paddingBottomMobile":"10px","paddingLeftMobile":"10px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"ce3f6f48","isDynamic":true,"blockVersion":4,"display":"flex","alignItems":"center","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginBottom":"10px"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"fdbba1f9","element":"p","blockVersion":3,"typography":{"fontSize":"14px","fontWeight":"900","textTransform":"uppercase"},"spacing":{"paddingRight":"10px","marginRight":"10px","marginBottom":"0px"},"borders":{"borderRightWidth":"1px","borderRightStyle":"solid"},"className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicTextReplace":"Category","gpDynamicTextTaxonomy":"category"} --\x3e

Category

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"6df4d39e","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginRight":"10px","marginBottom":"0px"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Date","gpDynamicDateUpdated":true} --\x3e

Date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"84923e14","blockVersion":3,"typography":{"fontSize":"28px"},"spacing":{"marginBottom":"20px"},"gpDynamicTextType":"title","gpDynamicLinkType":"single-post","gpDynamicTextReplace":"Title"} --\x3e

Title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generatepress/dynamic-content {"contentType":"post-excerpt","excerptLength":20} /--\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/grid --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_block_element_editor_width_unit",value:"px"},{key:"_generate_block_element_editor_width",value:"800"},{key:"_generate_use_theme_post_container",value:!0}]}},te={template_1:{label:(0,p._x)("Default next and previous buttons","label","gp-premium"),thumbnail:"archive-navigation-buttons-2.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"fb6c192f","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","justifyContent":"space-between","columnGap":"10px","rowGap":"10px","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"af38c5d0","isDynamic":true,"blockVersion":4,"sizing":{"width":"50%","widthMobile":"50%","height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"aa4ef21a","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"hasIcon":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"className":"button","gpDynamicLinkType":"previous-posts"} --\x3e Previous \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"4f3ab895","isDynamic":true,"blockVersion":4,"sizing":{"width":"50%","widthMobile":"50%","height":"","maxWidth":""},"typography":{"textAlign":"right"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"84010058","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"hasIcon":true,"iconLocation":"right","iconPaddingRight":"","iconStyles":{"width":"1em","height":"1em","paddingLeft":"0.5em"},"className":"button","gpDynamicLinkType":"next-posts"} --\x3e Next \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_main_content"},{key:"_generate_hook_priority",value:"20"},{key:"_generate_disable_archive_navigation",value:!0},{key:"_generate_use_archive_navigation_container",value:!0}]},template_2:{label:(0,p._x)("Rounded buttons with icon","label","gp-premium"),thumbnail:"archive-navigation-buttons-1.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"5edb5029","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"row","alignItems":"center","justifyContent":"center","columnGap":"10px","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"4c23c469","hasUrl":true,"ariaLabel":"Previous page","blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"20px","paddingRight":"20px","paddingBottom":"20px","paddingLeft":"20px","marginTop":"","marginRight":"","marginBottom":"","marginLeft":""},"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#000000","borderRightWidth":"1px","borderRightStyle":"solid","borderRightColor":"#000000","borderBottomWidth":"1px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderLeftWidth":"1px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderTopRightRadius":"100px","borderBottomRightRadius":"100px","borderBottomLeftRadius":"100px","borderTopLeftRadius":"100px"},"backgroundColor":"#ffffff","backgroundColorHover":"#222222","textColor":"#000000","textColorHover":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"gpDynamicLinkType":"previous-posts"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- wp:generateblocks/button {"uniqueId":"55622f43","hasUrl":true,"ariaLabel":"Next page","blockVersion":4,"display":"inline-flex","alignItems":"center","justifyContent":"center","typography":{"textAlign":"center"},"spacing":{"paddingTop":"20px","paddingRight":"20px","paddingBottom":"20px","paddingLeft":"20px","marginTop":"","marginRight":"","marginBottom":"","marginLeft":""},"borders":{"borderTopWidth":"1px","borderTopStyle":"solid","borderTopColor":"#000000","borderRightWidth":"1px","borderRightStyle":"solid","borderRightColor":"#000000","borderBottomWidth":"1px","borderBottomStyle":"solid","borderBottomColor":"#000000","borderLeftWidth":"1px","borderLeftStyle":"solid","borderLeftColor":"#000000","borderTopRightRadius":"100px","borderBottomRightRadius":"100px","borderBottomLeftRadius":"100px","borderTopLeftRadius":"100px"},"backgroundColor":"#ffffff","backgroundColorHover":"#222222","textColor":"#000000","textColorHover":"#ffffff","hasIcon":true,"removeText":true,"iconStyles":{"width":"1em","height":"1em","paddingRight":"0.5em"},"gpDynamicLinkType":"next-posts"} --\x3e \x3c!-- /wp:generateblocks/button --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_main_content"},{key:"_generate_hook_priority",value:"20"},{key:"_generate_disable_archive_navigation",value:!0},{key:"_generate_use_archive_navigation_container",value:!1}]}},ne={template_1:{label:(0,p._x)("Basic single post page hero","label","gp-premium"),thumbnail:"page-hero-basic.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"8b6d1c4b","backgroundColor":"#000000","textColor":"#ffffff","linkColor":"#ffffff","bgImage":{"id":"","image":{"url":"#dynamic-background-image"}},"bgOptions":{"selector":"pseudo-element","opacity":0.3,"overlay":false,"position":"center center","size":"cover","repeat":"no-repeat","attachment":""},"innerZindex":1,"isDynamic":true,"blockVersion":4,"position":"relative","overflowX":"hidden","overflowY":"hidden","sizing":{"height":"","maxWidth":""},"typography":{"textAlign":"center"},"spacing":{"paddingTop":"150px","paddingRight":"40px","paddingBottom":"150px","paddingLeft":"40px"},"gpDynamicImageBg":"featured-image"} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"3f517a84","isDynamic":true,"blockVersion":4,"position":"relative","zindex":1,"sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"62a8b2cc","element":"h1","blockVersion":3,"typography":{"fontSize":"50px"},"gpDynamicTextType":"title","gpDynamicTextReplace":"Page Title"} --\x3e

Page Title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"f49b9f49","isDynamic":true,"blockVersion":4,"display":"flex","alignItems":"center","justifyContent":"center","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generatepress/dynamic-image {"imageType":"author-avatar","avatarRounded":true} /--\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"2e715b13","element":"p","blockVersion":3,"spacing":{"marginBottom":"0px","marginLeft":"10px"},"gpDynamicTextType":"post-author","gpDynamicTextReplace":"Author name"} --\x3e

Author name

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"dedbe2c8","element":"p","blockVersion":3,"spacing":{"paddingLeft":"20px","marginBottom":"0px","marginLeft":"20px"},"borders":{"borderLeftWidth":"1px","borderLeftStyle":"solid"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Post date","gpDynamicDateUpdated":true} --\x3e

Post date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_header"},{key:"_generate_disable_title",value:!0},{key:"_generate_disable_featured_image",value:!0},{key:"_generate_disable_primary_post_meta",value:!0}]},template_2:{label:(0,p._x)("Single post hero with excerpt","label","gp-premium"),thumbnail:"page-hero-excerpt.jpg",content:'\x3c!-- wp:generateblocks/container {"uniqueId":"70385d72","isDynamic":true,"blockVersion":4,"sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"80px","paddingRight":"40px","paddingBottom":"80px","paddingLeft":"40px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"01bfa731","isDynamic":true,"blockVersion":4,"sizing":{"maxWidth":""},"useGlobalMaxWidth":true,"spacing":{"marginRight":"auto","marginLeft":"auto"}} --\x3e \x3c!-- wp:generateblocks/grid {"uniqueId":"5dc55b95","columns":2,"horizontalGap":80,"verticalGap":20,"isDynamic":true,"blockVersion":3,"useLegacyRowGap":true} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"579e5b87","isGrid":true,"gridId":"5dc55b95","verticalAlignment":"center","isDynamic":true,"blockVersion":4,"display":"flex","flexDirection":"column","justifyContent":"center","sizing":{"width":"45%","widthTablet":"60%","widthMobile":"100%","height":"100%","maxWidth":""},"typography":{"fontSize":"14px"},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"}} --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"d909e043","isDynamic":true,"blockVersion":4,"display":"flex","alignItems":"center","sizing":{"height":"","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px","marginBottom":"10px"},"paddingSyncUnits":true} --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"9fdb86dc","element":"p","blockVersion":3,"typography":{"fontSize":"14px","fontWeight":"900","textTransform":"uppercase"},"spacing":{"paddingRight":"10px","marginRight":"10px","marginBottom":"0px"},"borders":{"borderRightWidth":"1px","borderRightStyle":"solid"},"textColor":"#000000","linkColor":"#000000","className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicLinkType":"term-archives","gpDynamicTextReplace":"Category","gpDynamicTextTaxonomy":"category"} --\x3e

Category

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"1ee4cbcf","element":"p","blockVersion":3,"typography":{"fontSize":"14px"},"spacing":{"marginRight":"10px","marginBottom":"0px"},"gpDynamicTextType":"post-date","gpDynamicTextReplace":"Date","gpDynamicDateUpdated":true} --\x3e

Date

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/headline {"uniqueId":"56c7eb13","blockVersion":3,"spacing":{"marginBottom":"10px"},"gpDynamicTextType":"title","gpDynamicTextReplace":"Title"} --\x3e

Title

\x3c!-- /wp:generateblocks/headline --\x3e \x3c!-- wp:generatepress/dynamic-content {"contentType":"post-excerpt","useThemeMoreLink":false} /--\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- wp:generateblocks/container {"uniqueId":"4e92c4e8","isGrid":true,"gridId":"5dc55b95","bgImage":{"id":"","image":{"url":"#dynamic-background-image"}},"bgOptions":{"selector":"element","opacity":1,"overlay":false,"position":"center center","size":"cover","repeat":"no-repeat","attachment":""},"isDynamic":true,"blockVersion":4,"sizing":{"width":"55%","widthTablet":"40%","widthMobile":"100%","minHeight":"400px","minHeightMobile":"250px","height":"100%","maxWidth":""},"spacing":{"paddingTop":"0px","paddingRight":"0px","paddingBottom":"0px","paddingLeft":"0px"},"gpDynamicImageBg":"featured-image","gpUseFallbackImageBg":true} /--\x3e \x3c!-- /wp:generateblocks/grid --\x3e \x3c!-- /wp:generateblocks/container --\x3e \x3c!-- /wp:generateblocks/container --\x3e',meta:[{key:"_generate_hook",value:"generate_after_header"},{key:"_generate_disable_title",value:!0},{key:"_generate_disable_featured_image",value:!0},{key:"_generate_disable_primary_post_meta",value:!0}]}},ie=window.wp.plugins,ae=window.wp.editPost,oe=window.wp.data,re=window.wp.domReady,pe=n.n(re),le=n(893);function ce(e,t){return String(e)===String(t)}function ge(e,t){return Array.isArray(e)?e.map((e=>t.find((t=>ce(t.value,e))))).filter((e=>e)):t.find((t=>ce(t.value,e)))||null}function se(e){return Array.isArray(e)?e:[e]}function de(e,t,n){if(!e&&!n)return t&&t.length&&t[0].name||"";const i=Array.isArray(e);return e||i?i?e.map((e=>e.name)).filter(Boolean).join(", "):e.name||"":""}function me(e){return e?Array.isArray(e)?e.filter(Boolean).map((e=>e.value)):e.value||null:null}function ue(e,t){return t.length?e.filter((e=>function(e,t){const n=e.length,i=t.length;if(n>i)return!1;if(t.indexOf(e)>=0)return!0;e:for(let a=0,o=0;a"group"===e.type?e.items.map((n=>({...n,group:e.name,index:t++}))):{...e,index:t++})).flat()}const xe=()=>{};function he({options:e,defaultValue:t,value:n,multiple:i,search:o,onChange:r=xe,onFocus:p=xe,onBlur:l=xe,closeOnSelect:c=!0,placeholder:g,getOptions:s,filterOptions:d,useFuzzySearch:m=!0,debounce:u}){const b=(0,a.useRef)(),[x,h]=(0,a.useState)(null),[f,y]=(0,a.useState)(""),[_,k]=(0,a.useState)(!1),[v,w]=function(e,t,n,i){const[o,r]=(0,a.useState)((()=>be(e))),[p,l]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{let e;if(t)return e=setTimeout((()=>{const e=t(i,o);l(!0),Promise.resolve(e).then((e=>r(be(e)))).finally((()=>l(!1)))}),n),()=>{clearTimeout(e)}}),[i]),(0,a.useEffect)((()=>{r(be(e))}),[e]),[o,p]}(e,s,u,f),T=e=>{const t=function(e,t,n){if(!e)return t;if(!n)return e;if(!t)return se(e);const i=se(t),a=i.findIndex((t=>ce(t.value,e.value)));return a>=0?i.splice(a,1):i.push(e),i}(ge(decodeURIComponent(e),v),x,i);void 0===n&&h(t),r(me(t),t),setTimeout((()=>{b.current&&c&&b.current.blur()}),0)},C=function(e){const t=[];return e.forEach((e=>{if(e.group){const n=t.findIndex((t=>"group"===t.type&&t.name===e.group));n>=0?t[n].items.push(e):t.push({items:[e],type:"group",name:e.group})}else t.push(e)})),t}((E=[m?ue:null,...d||[]],M=v,z=f,E.filter(Boolean).reduce(((e,t)=>t(e,z)),M).map(((e,t)=>({...e,index:t}))))),[D,R,S]=function(e,t,n){const[i,o]=(0,a.useState)(-1);return[{onKeyDown:t=>{const n=t.key.replace("Arrow","").toLowerCase();"down"!==n&&"up"!==n||(t.preventDefault(),o(function(e,t,n){const i=n.length-1;let a=null,o=-1,r=e;for(;o++<=i&&(!a||a.disabled);)r="down"===t?r+1:r-1,r<0?r=i:r>i&&(r=0),a=n[r];return r}(i,n,e)))},onKeyUp:a=>{"Escape"===a.key?(a.preventDefault(),n.current.blur()):"Enter"===a.key&&(a.preventDefault(),e[i]&&t(e[i].value))}},i,o]}(C,T,b),I={search:f,focus:_,option:x,value:me(x),fetching:w,highlighted:R,options:C,displayValue:de(x,v,g)},B={tabIndex:"0",readOnly:!o,placeholder:g,value:_&&o?f:I.displayValue,ref:b,...D,onFocus:e=>{k(!0),p(e)},onBlur:e=>{k(!1),y(""),S(-1),l(e)},onMouseDown:e=>{_&&(e.preventDefault(),b.current.blur())},onChange:o?({target:e})=>y(e.value):null},L={tabIndex:"-1",onMouseDown(e){e.preventDefault(),T(e.currentTarget.value)}};var E,M,z;return(0,a.useEffect)((()=>{h(ge(void 0===n?t:n,v))}),[n,v]),[I,B,L]}const fe=e=>"string"==typeof e,ye=(e,t)=>fe(t)?`${t}-${e}`:t[e];function _e({optionProps:e,highlighted:t,selected:n,option:i,cls:a,renderOption:o,disabled:r}){const p={...e,value:encodeURIComponent(i.value),disabled:r},l=a({option:!0,"is-selected":n,"is-highlighted":t});return(0,le.jsxs)("li",{className:a("row"),role:"menuitem","data-index":i.index,children:[o&&o(p,i,{selected:n,highlighted:t},l),!o&&(0,le.jsx)("button",{type:"button",className:l,...p,children:i.name})]})}var ke=(0,a.memo)(_e);function ve(e){const{options:t,cls:n,renderOption:i,renderGroupHeader:a,optionProps:o,snapshot:r,disabled:p}=e;return(0,le.jsx)("ul",{className:n("options"),children:t.map((t=>{return"group"===t.type?(0,le.jsx)("li",{role:"none",className:n("row"),children:(0,le.jsxs)("div",{className:n("group"),children:[(0,le.jsx)("div",{className:n("group-header"),children:a?a(t.name):t.name}),(0,le.jsx)(ve,{...e,options:t.items})]})},t.name):(0,le.jsx)(ke,{option:t,optionProps:o,cls:n,renderOption:i,selected:(l=t,c=r.option,!!c&&(Array.isArray(c)?c.findIndex((e=>e.value===l.value))>=0:c.value===l.value)),highlighted:r.highlighted===t.index,disabled:t.disabled||p},t.value);var l,c}))})}var we=(0,a.memo)(ve);const Te=(0,a.forwardRef)((({disabled:e,placeholder:t,multiple:n,search:i,autoFocus:o,autoComplete:r,id:p,closeOnSelect:l,className:c,renderValue:g,renderOption:s,renderGroupHeader:d,fuzzySearch:m,emptyMessage:u,value:b,...x},h)=>{const f=(0,a.useRef)(null),y=e=>function(e,t){return fe(e)?ye(e,t):Object.entries(e).filter((([e,t])=>e&&t)).map((([e])=>ye(e,t))).join(" ")}(e,c),[_,k]=(0,a.useState)(b),[v,w,T]=he({value:_,placeholder:t,multiple:n,search:i,closeOnSelect:l&&!n,useFuzzySearch:m,...x}),{highlighted:C,value:D,fetching:R,focus:S}=v,I={...w,autoFocus:o,autoComplete:r,disabled:e};return(0,a.useEffect)((()=>{const{current:e}=f;if(e){const t=Array.isArray(D)?D[0]:D,n=e.querySelector(C>-1?`[data-index="${C}"]`:`[value="${encodeURIComponent(t)}"]`);if(n){const t=e.getBoundingClientRect(),i=n.getBoundingClientRect();e.scrollTop=n.offsetTop-t.height/2+i.height/2}}}),[D,C,f.current]),(0,a.useEffect)((()=>k(b)),[b]),(0,le.jsxs)("div",{ref:h,id:p,className:y({container:!0,"is-multiple":n,"is-disabled":e,"is-loading":R,"has-focus":S}),children:[(!n||t||i)&&(0,le.jsxs)("div",{className:y("value"),children:[g&&g(I,v,y("input")),!g&&(0,le.jsx)("input",{...I,className:y("input")})]}),(0,le.jsxs)("div",{className:y("select"),ref:f,onMouseDown:e=>e.preventDefault(),children:[v.options.length>0&&(0,le.jsx)(we,{options:v.options,optionProps:T,renderOption:s,renderGroupHeader:d,disabled:e,snapshot:v,cls:y}),!v.options.length&&(0,le.jsx)("ul",{className:y("options"),children:!v.options.length&&u&&(0,le.jsx)("li",{className:y("not-found"),children:u})})]})]})}));Te.defaultProps={options:[],fuzzySearch:!0,printOptions:"auto",closeOnSelect:!0,debounce:250,autoComplete:"on",className:"select-search"},Te.displayName="SelectSearch";var Ce=(0,a.memo)(Te);function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Re(e){return(0,a.createElement)("div",{className:"gp-select-search"},(0,a.createElement)(Ce,function(e){for(var t=1;t0&&S(o)}},void 0!==V[e].thumbnail&&!!V[e].thumbnail&&(0,a.createElement)("img",{src:gpPremiumBlockElements.templateImageUrl+"/"+V[e].thumbnail,alt:V[e].label}),(0,a.createElement)("div",{className:"gpp-block-template-label"},V[e].label))})))),("right-sidebar"===l||"left-sidebar"===l)&&(0,a.createElement)(g.Notice,{status:"info",isDismissible:!1,className:"gpp-block-element-notice"},(0,p.__)("This will remove the current sidebar widgets for the selected sidebar. Your layout must have a sidebar set for this Element to show.","gp-premium")),"site-footer"===l&&(0,a.createElement)(g.BaseControl,null,(0,a.createElement)(g.Notice,{status:"info",isDismissible:!1,className:"gpp-block-element-notice"},(0,p.__)("This Element will replace your site footer area that holds your copyright message. It will not replace footer widgets if they exist.","gp-premium"))),"post-meta-template"===l&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Location","gp-premium"),value:b,options:[{label:(0,p.__)("After post title","gp-premium"),value:"after-post-title"},{label:(0,p.__)("Before post title","gp-premium"),value:"before-post-title"},{label:(0,p.__)("After content","gp-premium"),value:"after-content"},{label:(0,p.__)("Custom","gp-premium"),value:"custom"}],onChange:function(e){S({_generate_post_meta_location:e})}})),P.length>1&&(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Quick hook select","gp-premium"),value:s||"",options:P,onChange:function(e){S({_generate_hook:e})}}),(!l||"hook"===l||"page-hero"===l||"post-navigation-template"===l||"archive-navigation-template"===l||"post-meta-template"===l&&"custom"===b)&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.BaseControl,{id:"gpp-hook-select",label:(0,p.__)("Hook name","gp-premium"),className:"gpp-hook-select"},(0,a.createElement)(Re,{options:M,value:s,placeholder:(0,p.__)("Choose your hook","gp-premium"),search:!0,onChange:function(e){e!==s&&S({_generate_hook:e||""})}})),"custom"===s&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Custom hook name","gp-premium"),type:"text",onChange:function(e){S({_generate_custom_hook:e||""})},value:d||""}),!!s&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Priority","gp-premium"),type:"text",onChange:function(e){S({_generate_hook_priority:e||""})},value:m||"",placeholder:"10"})),"post-meta-template"===l&&(0,a.createElement)(c.Fragment,null,(""===b||"after-post-title"===b||"before-post-title"===b||"custom"===b)&&(0,a.createElement)(g.ToggleControl,{checked:!!x,label:(0,p.__)("Replace default primary post meta","gp-premium"),onChange:function(e){S({_generate_disable_primary_post_meta:e})}}),("after-content"===b||"custom"===b)&&(0,a.createElement)(g.ToggleControl,{checked:!!h,label:(0,p.__)("Replace default secondary post meta","gp-premium"),onChange:function(e){S({_generate_disable_secondary_post_meta:e})}})),"content-template"===l&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Tag name","gp-premium"),value:u,options:[{label:"article",value:"article"},{label:"div",value:"div"},{label:"section",value:"section"},{label:"aside",value:"aside"}],onChange:function(e){S({_generate_post_loop_item_tagname:e})}}),(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Apply to","gp-premium"),value:k,options:[{label:(0,p.__)("All posts","gp-premium"),value:""},{label:(0,p.__)("Posts with term","gp-premium"),value:"has-term"},{label:(0,p.__)("Posts with custom field","gp-premium"),value:"has-post-meta"},{label:(0,p.__)("First post","gp-premium"),value:"is-first-post"}],onChange:function(e){S({_generate_post_loop_item_display:e})}}),""!==k&&(0,a.createElement)(c.Fragment,null,"has-term"===k&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.SelectControl,{label:(0,p.__)("Taxonomy","gp-premium"),value:v,options:z,onChange:function(e){S({_generate_post_loop_item_display_tax:e})}}),!!v&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Term name","gp-premium"),type:"text",onChange:function(e){S({_generate_post_loop_item_display_term:e||""})},value:w||""})),"has-post-meta"===k&&(0,a.createElement)(g.TextControl,{label:(0,p.__)("Post meta name","gp-premium"),type:"text",onChange:function(e){S({_generate_post_loop_item_display_post_meta:e||""})},value:T||""}),q.length>0&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.BaseControl,null,(0,a.createElement)(g.ComboboxControl,{className:"editor-page-attributes__parent",label:(0,p.__)("Parent Element","gp-premium"),help:(0,p.__)("Set a parent Element to inherit in case the above conditions do not apply.","gp-premim"),value:L,options:q,onFilterValueChange:function(e){e&&$()(I(e),300)},onChange:function(e){I(e)}})),!!L&&(0,a.createElement)(g.TextControl,{type:"number",label:(0,p.__)("Display Order","gp-premium"),onChange:function(e){B(e)},value:E}))),(0,a.createElement)(g.ToggleControl,{checked:!!_,label:(0,p.__)("Keep default post container","gp-premium"),onChange:function(e){S({_generate_use_theme_post_container:e})}})),"page-hero"===l&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.ToggleControl,{checked:!!f,label:(0,p.__)("Disable title","gp-premium"),onChange:function(e){S({_generate_disable_title:e})}}),(0,a.createElement)(g.ToggleControl,{checked:!!y,label:(0,p.__)("Disable featured image","gp-premium"),onChange:function(e){S({_generate_disable_featured_image:e})}}),(0,a.createElement)(g.ToggleControl,{checked:!!x,label:(0,p.__)("Disable primary post meta","gp-premium"),onChange:function(e){S({_generate_disable_primary_post_meta:e})}})),"site-footer"===l&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.TextControl,{className:"gpp-block-dynamic-year",type:"text",readOnly:!0,value:"{{current_year}}",label:(0,p.__)("Current year template tag","gp-premium"),help:(0,p.__)("Use the above template tag to add the current year to your footer.","gp-premium")})),"post-navigation-template"===l&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.ToggleControl,{checked:!!C,label:(0,p.__)("Disable default post navigation","gp-premium"),onChange:function(e){S({_generate_disable_post_navigation:e})}}),(0,a.createElement)(g.ToggleControl,{checked:!!R,label:(0,p.__)("Add default archive navigation container","gp-premium"),onChange:function(e){S({_generate_use_archive_navigation_container:e})}})),"archive-navigation-template"===l&&(0,a.createElement)(c.Fragment,null,(0,a.createElement)(g.ToggleControl,{checked:!!D,label:(0,p.__)("Disable default pagination","gp-premium"),onChange:function(e){S({_generate_disable_archive_navigation:e})}}),(0,a.createElement)(g.ToggleControl,{checked:!!R,label:(0,p.__)("Keep default archive navigation container","gp-premium"),onChange:function(e){S({_generate_use_archive_navigation_container:e})}}))))}}]),o}(c.Component),Le=(0,oe.withSelect)((function(e){var t=e("core/editor").getEditedPostAttribute;return{meta:t("meta"),elementParent:t("parent"),elementMenuOrder:t("menu_order")}})),Ee=(0,oe.withDispatch)((function(e,t){var n=t.meta,i=e("core/editor").editPost;return{updateMeta:function(e){i({meta:Ie(Ie({},n),e)})},updateParentId:function(e){i({parent:e})},updateOrder:function(e){i({menu_order:e})}}})),Me=(0,s.compose)([Le,Ee])(Be);(0,ie.registerPlugin)("generatepress-block-element",{icon:null,render:Me}),pe()((function(){return(0,ie.unregisterPlugin)("generatepress-content-width")}))}()}(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/customizer.asset.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/customizer.asset.php deleted file mode 100644 index ee571e28..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/customizer.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-hooks', 'wp-i18n'), 'version' => '4ec1543129b0728cd3b0'); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/customizer.js deleted file mode 100644 index 3a201d2e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/customizer.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";function e(o){return e="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},e(o)}function o(o){var r=function(o,r){if("object"!==e(o)||null===o)return o;var t=o[Symbol.toPrimitive];if(void 0!==t){var n=t.call(o,"string");if("object"!==e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)}(o);return"symbol"===e(r)?r:String(r)}var r=window.wp.hooks,t=window.wp.i18n;function n(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function a(e){for(var r=1;r array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '0ab64c3a1832f10e060d'); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/dashboard.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/dashboard.js deleted file mode 100644 index 861ddff5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/dashboard.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var e,t={373:function(e,t,n){"use strict";function r(e){return r="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},r(e)}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!==r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:u;a(!0),S(!!e);var t=document.querySelector(".generatepress-dashboard__section-item-message");t.classList.remove("generatepress-dashboard__section-item-message__show"),p()({path:"/generatepress-pro/v1/license",method:"POST",data:{key:e,status:f}}).then((function(e){a(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),e.success&&e.response?(t.classList.remove("generatepress-dashboard__section-item-message__error"),"valid"===e.response.license?t.textContent=(0,c.__)("License key activated.","gp-premium"):"deactivated"===e.response.license?t.textContent=(0,c.__)("License key deactivated.","gp-premium"):t.textContent=e.response,h(e.response.license),setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3)):(t.classList.add("generatepress-dashboard__section-item-message__error"),t.textContent=e.response)}))};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"generatepress-dashboard__section generatepress-license-key-area"},(0,i.createElement)("div",{className:"generatepress-dashboard__section-title"},(0,i.createElement)("h2",null,(0,c.__)("License Key","gp-premium")),(0,i.createElement)("span",{className:"generatepress-dashboard__section-item-message"})),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item"},(0,i.createElement)(l.Notice,{className:"generatepress-dashboard__section-license-notice",isDismissible:!1,status:"valid"===f?"success":"warning"},"valid"===f?(0,i.createElement)("span",null,(0,c.__)("Receiving premium updates.","gp-premium")):(0,i.createElement)("span",null,(0,c.__)("Not receiving premium updates.","gp-premium"))),(0,i.createElement)("div",{className:"generatepress-dashboard__section-license-key"},w?(0,i.createElement)(l.TextControl,{type:"text",autoComplete:"off",value:u,disabled:!0}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(l.TextControl,{placeholder:(0,c.__)("Enter your license key to activate updates.","gp-premium"),type:"text",autoComplete:"off",onChange:function(e){return g(e)}}),!!u&&(0,i.createElement)(l.Button,{variant:"primary",disabled:!!s,onClick:function(){return O()}},s&&(0,i.createElement)(l.Spinner,null),!s&&(0,c.__)("Save key"))),!!w&&!!u&&(0,i.createElement)(l.Button,{variant:"primary",onClick:function(){g(""),O("")}},(0,c.__)("Clear key","generateblocks"))),""!==u&&(0,i.createElement)("div",{className:"generatepress-dashboard__section-beta-tester"},(0,i.createElement)(l.ToggleControl,{label:(0,c.__)("Receive development version updates"),help:(0,c.__)("Get alpha, beta, and release candidate updates directly to your Dashboard.","gp-premium"),checked:!!v,onChange:function(e){y(e),function(e){var t=document.querySelector(".generatepress-dashboard__section-item-message");t.classList.remove("generatepress-dashboard__section-item-message__show"),p()({path:"/generatepress-pro/v1/beta",method:"POST",data:{beta:e}}).then((function(e){a(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),e.success&&e.response?(t.classList.remove("generatepress-dashboard__section-item-message__error"),t.textContent=e.response,setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3)):(t.classList.add("generatepress-dashboard__section-item-message__error"),t.textContent=e.response)}))}(e)}})))))};window.addEventListener("DOMContentLoaded",(function(){(0,m.render)((0,i.createElement)(b,null),document.getElementById("generatepress-license-key"))}));var v=function(){var e=o((0,m.useState)(!1),2),t=e[0],n=e[1],s=o((0,m.useState)(!1),2),a=s[0],d=s[1],u=o((0,m.useState)(!1),2),_=u[0],f=u[1],h=o((0,m.useState)(!1),2),b=h[0],v=h[1],y=o((0,m.useState)("all"),2),E=y[0],w=y[1];return(0,m.useEffect)((function(){t||n(!0)})),t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"generatepress-dashboard__section"},(0,i.createElement)("div",{className:"generatepress-dashboard__section-title"},(0,i.createElement)("h2",null,(0,c.__)("Import / Export","gp-premium"))),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item"},(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-content"},(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-title"},(0,c.__)("Export","gp-premium")),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-description"},(0,c.__)("Export your customizer settings.","gp-premium"))),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-action"},(0,i.createElement)("span",{className:"generatepress-dashboard__section-item-message"}),(0,i.createElement)(l.ButtonGroup,{className:"generatepress-dashboard__section-item-export-type"},(0,i.createElement)(l.Button,{isPrimary:"all"===E,onClick:function(){return w("all")}},(0,c.__)("All","gp-premium")),(0,i.createElement)(l.Button,{isPrimary:"global-colors"===E,onClick:function(){return w("global-colors")}},(0,c.__)("Global Colors","gp-premium")),(0,i.createElement)(l.Button,{isPrimary:"typography"===E,onClick:function(){return w("typography")}},(0,c.__)("Typography","gp-premium"))),(0,i.createElement)(l.Button,{disabled:!!a,isPrimary:!0,onClick:function(e){return function(e){d(!0);var t=e.target.previousElementSibling.previousElementSibling;p()({path:"/generatepress-pro/v1/export",method:"POST",data:{items:!1,type:E}}).then((function(e){if(d(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),"object"===r(e.response)?t.textContent=(0,c.__)("Options exported","gp-premium"):t.textContent=e.response,e.success&&e.response){var n=(new Date).toISOString().slice(0,10),s="generatepress-settings-"+E+"-"+n+".json",a=new Blob([JSON.stringify(e.response)],{type:"application/json",name:s});g()(a,s),setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3)}else t.classList.add("generatepress-dashboard__section-item-message__error")}))}(e)}},!!a&&(0,i.createElement)(l.Spinner,null),!a&&(0,c.__)("Export","gp-premium")))),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item"},(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-content"},(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-title"},(0,c.__)("Import","gp-premium")),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-description"},(0,c.__)("Import your customizer settings.","gp-premium"))),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-action"},(0,i.createElement)("span",{className:"generatepress-dashboard__section-item-message"}),(0,i.createElement)("input",{type:"file",accept:".json",onChange:function(e){var t=new FileReader;t.onloadend=function(){var e=t.result;(e=JSON.parse(e))&&v(e)},t.readAsText(e.target.files[0])}}),(0,i.createElement)(l.Button,{disabled:!!_||!b,isPrimary:!0,onClick:function(e){window.confirm((0,c.__)("This can overwrite existing settings and cannot be undone.","gp-premium"))&&function(e){f(!0);var t=e.target.previousElementSibling.previousElementSibling,n=e.target.previousElementSibling;n.style.display="none",p()({path:"/generatepress-pro/v1/import",method:"POST",data:{import:b}}).then((function(e){f(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),"object"===r(e.response)?t.textContent=(0,c.__)("Options imported.","gp-premium"):t.textContent=e.response,e.success&&e.response?setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show"),n.style.display="block",n.value=""}),3e3):t.classList.add("generatepress-dashboard__section-item-message__error")}))}(e)}},!!_&&(0,i.createElement)(l.Spinner,null),!_&&(0,c.__)("Import","gp-premium")))))):(0,i.createElement)(l.Placeholder,{className:"generatepress-dashboard__placeholder"},(0,i.createElement)(l.Spinner,null))};window.addEventListener("DOMContentLoaded",(function(){(0,m.render)((0,i.createElement)(v,null),document.getElementById("generatepress-import-export-pro"))}));var y=function(){var e=o((0,m.useState)(!1),2),t=e[0],n=e[1],s=o((0,m.useState)(!1),2),a=s[0],d=s[1];return(0,m.useEffect)((function(){t||n(!0)})),t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"generatepress-dashboard__section"},(0,i.createElement)("div",{className:"generatepress-dashboard__section-title",style:{marginBottom:0}},(0,i.createElement)("h2",null,(0,c.__)("Reset","gp-premium"))),(0,i.createElement)("div",{className:"generatepress-dashboard__section-item-description",style:{marginTop:0}},(0,c.__)("Reset your customizer settings.","gp-premium")),(0,i.createElement)(l.Button,{className:"generatepress-dashboard__reset-button",style:{marginTop:"10px"},disabled:!!a,isPrimary:!0,onClick:function(e){window.confirm((0,c.__)("This will delete all of your customizer settings. It cannot be undone.","gp-premium"))&&function(e){d(!0);var t=e.target.nextElementSibling;p()({path:"/generatepress-pro/v1/reset",method:"POST",data:{items:!1}}).then((function(e){d(!1),t.classList.add("generatepress-dashboard__section-item-message__show"),"object"===r(e.response)?t.textContent=(0,c.__)("Settings reset.","gp-premium"):t.textContent=e.response,e.success&&e.response?setTimeout((function(){t.classList.remove("generatepress-dashboard__section-item-message__show")}),3e3):t.classList.add("generatepress-dashboard__section-item-message__error")}))}(e)}},!!a&&(0,i.createElement)(l.Spinner,null),!a&&(0,c.__)("Reset","gp-premium")),(0,i.createElement)("span",{className:"generatepress-dashboard__section-item-message",style:{marginLeft:"10px"}}))):(0,i.createElement)(l.Placeholder,{className:"generatepress-dashboard__placeholder"},(0,i.createElement)(l.Spinner,null))};window.addEventListener("DOMContentLoaded",(function(){(0,m.render)((0,i.createElement)(y,null),document.getElementById("generatepress-reset-pro"))}))},162:function(e,t,n){var r,s;void 0===(s="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){i(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),i=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,n,o){var i=a.URL||a.webkitURL,c=document.createElement("a");n=n||e.name||"download",c.download=n,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?s(c):r(c.href)?t(e,n,o):s(c,c.target="_blank")):(c.href=i.createObjectURL(e),setTimeout((function(){i.revokeObjectURL(c.href)}),4e4),setTimeout((function(){s(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,a){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),n);else if(r(e))t(e,n,a);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){s(o)}))}}:function(e,n,r,s){if((s=s||open("","_blank"))&&(s.document.title=s.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var i="application/octet-stream"===e.type,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||i&&c||o)&&"undefined"!=typeof FileReader){var m=new FileReader;m.onloadend=function(){var e=m.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=e:location=e,s=null},m.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,p=d.createObjectURL(e);s?s.location=p:location.href=p,s=null,setTimeout((function(){d.revokeObjectURL(p)}),4e4)}});a.saveAs=i.saveAs=i,e.exports=i})?r.apply(t,[]):r)||(e.exports=s)}},n={};function r(e){var s=n[e];if(void 0!==s)return s.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,r),a.exports}r.m=t,e=[],r.O=function(t,n,s,a){if(!n){var o=1/0;for(m=0;m=a)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(i=!1,a0&&e[m-1][2]>a;m--)e[m]=e[m-1];e[m]=[n,s,a]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={966:0,100:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var s,a,o=n[0],i=n[1],c=n[2],l=0;if(o.some((function(t){return 0!==e[t]}))){for(s in i)r.o(i,s)&&(r.m[s]=i[s]);if(c)var m=c(r)}for(t&&t(n);l array('react', 'wp-edit-post', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-plugins'), 'version' => 'd1ae659d7b937f65b15d'); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/editor.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/editor.css deleted file mode 100644 index 4d7bafd0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/editor.css +++ /dev/null @@ -1 +0,0 @@ -.gpp-active-element-type{color:#555;font-size:11px;text-transform:uppercase} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/editor.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/editor.js deleted file mode 100644 index 6044d7b4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/editor.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";function e(t){return e="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},e(t)}function t(t,n){for(var r=0;r array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '6e43dc7500e77c46bb9b'); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/site-library.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/site-library.css deleted file mode 100644 index 82d72955..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/site-library.css +++ /dev/null @@ -1 +0,0 @@ -.generatepress-site-library{box-sizing:border-box;margin:40px auto 0;max-width:1200px;padding:0 20px}.generatepress-site-library .generatepress-site-library-opened{bottom:0;display:flex;height:100vh;left:0;position:fixed;right:0;top:0;width:100%;z-index:99999}.generatepress-site-library .generatepress-site-library-info{background:#fff;border-left:1px solid #ddd;padding-bottom:50px;position:relative;width:300px}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-header{border-bottom:1px solid #ddd;display:flex;justify-content:space-between;padding-left:20px}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-header .has-author{margin-bottom:0}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-header .site-library-author{color:#777;display:block;font-size:11px;margin-bottom:1em;margin-top:3px}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-header button{border-left:1px solid #ddd;height:auto}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-footer{border-top:1px solid #ddd;bottom:0;display:flex;left:0;position:absolute;right:0}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-footer button{flex-grow:1;font-size:20px;height:50px;justify-content:center}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-footer button:not(:last-child){border-right:1px solid #ddd}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-content{box-sizing:border-box;height:calc(100% - 53px);overflow-y:auto;padding:20px}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-content>:first-child{margin-top:0}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-content h3{margin-top:30px}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-content h3+.gpp-library-action-button{margin-top:10px}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-plugins{font-size:12px;list-style-type:disc;margin-bottom:0;margin-left:1.5em}.generatepress-site-library .generatepress-site-library-info .generatepress-site-library-plugins li{margin-bottom:0}.generatepress-site-library .generatepress-site-library-iframe{background:#fff;display:flex;justify-content:center;width:calc(100% - 300px)}.generatepress-site-library .generatepress-site-library-iframe iframe{height:100%;width:100%}.generatepress-site-library .gpp-library-action-button{align-items:center;display:flex;margin-top:30px}.generatepress-site-library .gpp-library-action-button button .components-spinner{margin:0}.generatepress-site-library .gpp-library-action-button .gpp-library-action-message{padding-left:10px}.generatepress-site-library .generatepress-site-library-filter{align-items:center;background:#fff;border:1px solid #ddd;border-radius:4px;display:flex;justify-content:space-between;margin-bottom:40px;padding:20px}.generatepress-site-library .generatepress-site-library-filter>.components-base-control{margin-right:20px}.generatepress-site-library .generatepress-site-library-filter>.components-base-control .components-base-control__field{margin-bottom:0}.generatepress-site-library .generatepress-site-library-filter .components-select-control label{font-size:11px}.generatepress-site-library-list{display:flex;flex-wrap:wrap;list-style:none;margin-left:-30px;padding:0}.generatepress-site-library-list>.generatepress-site-library-list-item{box-sizing:border-box;flex:0 0 33.333%;padding-bottom:30px;padding-left:30px;width:33.333%}@media screen and (max-width:840px){.generatepress-site-library-list>.generatepress-site-library-list-item{flex:0 0 50%;width:50%}}@media screen and (max-width:450px){.generatepress-site-library-list>.generatepress-site-library-list-item{flex:0 0 100%;width:100%}}.generatepress-site-library-list>.generatepress-site-library-list-item>button{background-color:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 0 0 2px transparent;cursor:pointer;display:block;padding:5px;text-align:center;transition:border-color .2s,box-shadow .2s;width:100%}.generatepress-site-library-list>.generatepress-site-library-list-item>button:active,.generatepress-site-library-list>.generatepress-site-library-list-item>button:focus,.generatepress-site-library-list>.generatepress-site-library-list-item>button:hover{box-shadow:0 0 0 2px #216eb7}.generatepress-site-library-list>.generatepress-site-library-list-item>button .generatepress-site-library-list-item-image{display:block;position:relative}.generatepress-site-library-list>.generatepress-site-library-list-item>button .generatepress-site-library-list-item-image img{border-top-left-radius:4px;border-top-right-radius:4px;display:block;height:auto;width:100%}.generatepress-site-library-list>.generatepress-site-library-list-item .generatepress-site-library-list-item-title{font-size:20px;padding:20px 20px 10px}.generatepress-site-library-list>.generatepress-site-library-list-item .generatepress-site-library-list-item-title .generatepress-site-library-required-version{color:#000;display:block;font-size:12px;padding-top:5px}.generatepress-site-library-restore{background:#fff;border:1px solid #ddd;padding:40px}.generatepress-site-library-restore h2{font-size:25px;margin-top:0}.components-placeholder.gpp-library-placeholder{background:transparent;border:0;box-shadow:0 0 0}.components-placeholder.gpp-library-placeholder .components-placeholder__fieldset{justify-content:center}.generatepress-site-library-no-results{padding:50px;text-align:center}.generatepress-site-library-no-results button .components-spinner,.generatepress-site-library-refresh button .components-spinner{margin:0}.generatepress-site-library-refresh{text-align:center}.appearance_page_generatepress-library #wpbody-content .metabox-holder,.appearance_page_generatepress-library #wpcontent{padding:0}.site-library-header{background-color:#fff;box-shadow:0 1px 0 rgba(200,215,225,.5),0 1px 2px #ddd;margin-bottom:40px;padding:20px}.site-library-header .site-library-container{box-sizing:border-box;display:flex;margin:0 auto;max-width:1200px;padding:0 20px}.site-library-header .library-links{margin-left:auto}.site-library-header .library-links a{display:inline-block;margin:0 10px}.site-library-header .library-title{color:#000;font-size:20px;font-weight:500}.generatepress-dashboard-tabs{box-sizing:border-box;margin:0 auto;max-width:1200px;padding:0 20px} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/site-library.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/site-library.js deleted file mode 100644 index 54359955..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/site-library.js +++ /dev/null @@ -1,6 +0,0 @@ -!function(){var e={703:function(e,t,n){"use strict";var r=n(414);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,s){if(s!==r){var o=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 o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={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:a,resetWarningCache:i};return n.PropTypes=n,n}},697:function(e,t,n){e.exports=n(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},216:function(e,t,n){"use strict";t.be=void 0;var r=function(){function e(e,t){for(var n=0;n=0&&_-E[0]<=h&&_+v+E[1]>=0}(e,n):function(e){var t=e.ref;if(!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))return!1;var n=void 0,r=void 0;try{var i=t.getBoundingClientRect();n=i.top,r=i.height}catch(e){n=0,r=0}var a=window.innerHeight||document.documentElement.clientHeight,s=Array.isArray(e.props.offset)?e.props.offset:[e.props.offset,e.props.offset];return n-s[0]<=a&&n+r+s[1]>=0}(e);r?e.visible||(e.props.once&&g.push(e),e.visible=!0,e.forceUpdate()):e.props.once&&e.visible||(e.visible=!1,e.props.unmountIfInvisible&&e.forceUpdate())}},y=function(){for(var e=0;e=0?r=setTimeout(l,t-p):(r=null,n||(o=e.apply(a,i),r||(a=null,i=null)))};return function(){a=this,i=arguments,s=+new Date;var p=n&&!r;return r||(r=setTimeout(l,t)),p&&(o=e.apply(a,i),a=null,i=null),o}}},81:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=function(e,t,n,r){r=r||!1,e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on"+t,(function(t){n.call(e,t||window.event)}))},t.off=function(e,t,n,r){r=r||!1,e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on"+t,n)}},315:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!(e instanceof HTMLElement))return document.documentElement;for(var t="absolute"===e.style.position,n=/(scroll|auto)/,r=e;r;){if(!r.parentNode)return e.ownerDocument||document.documentElement;var i=window.getComputedStyle(r),a=i.position,s=i.overflow,o=i["overflow-x"],l=i["overflow-y"];if("static"===a&&t)r=r.parentNode;else{if(n.test(s)&&n.test(o)&&n.test(l))return r;r=r.parentNode}}return e.ownerDocument||e.documentElement||document.documentElement}},821:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r,i;return t||(t=250),function(){var a=n||this,s=+new Date,o=arguments;r&&se.length)&&(t=e.length);for(var n=0,r=new Array(t);ns[l]?1:-1}return a.length!==s.length?-1:0}var c=window.wp.i18n,m=window.wp.components,h=window.wp.element,g=window.wp.htmlEntities,f=window.wp.apiFetch,d=n.n(f);function v(e){var t=e.allSites,n=e.value,r=e.onChange;if(!t)return null;var i=[""];return Object.keys(t).forEach((function(e){t[e].category.forEach((function(e){i.includes(e)||i.push(e)}))})),i.length<2?null:(0,l.createElement)("div",null,i.map((function(e){return(0,l.createElement)(m.Button,{key:e,variant:e===n?"primary":"",onClick:function(){return r(e)}},""===e?(0,c.__)("All","gp-premium"):e)})))}function b(e){var t=e.onChange,n=e.value;return(0,l.createElement)("div",null,(0,l.createElement)("input",{type:"search",onChange:function(e){var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.value)},value:n,placeholder:(0,c.__)("Search site name or author","gp-premium")}))}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(w,e);var n,f,y,_,E=(y=w,_=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=o(y);if(_){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)}(this,e)});function w(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,w),(e=E.apply(this,arguments)).state={allSites:{},isAPIWorking:!1,siteOpened:!1,siteData:{},siteSlug:"",sitePlugins:{},hasData:{},hasWidgets:!1,importOptions:!0,importContent:!0,confirmImport:!1,importComplete:!1,installablePlugins:[],activePlugins:[],manualPlugins:[],refreshingSites:!1,hasBackup:gppSiteLibrary.hasBackup,category:"",search:"",device:"desktop"},e.importThemeOptions=e.importThemeOptions.bind(a(e)),e.installPlugins=e.installPlugins.bind(a(e)),e.activatePlugins=e.activatePlugins.bind(a(e)),e.importContent=e.importContent.bind(a(e)),e.importSiteOptions=e.importSiteOptions.bind(a(e)),e.importWidgets=e.importWidgets.bind(a(e)),e}return n=w,(f=[{key:"componentDidMount",value:function(){var e=this;d()({path:"/generatepress-site-library/v1/get_sites",method:"POST",data:{forceRefresh:!1}}).then((function(t){e.setState({isAPILoaded:!0,allSites:t.response})}))}},{key:"importThemeOptions",value:function(e){var t=this,n=e.target.nextElementSibling;n.classList.add("gpp-library-action-message--show"),n.textContent=(0,c.__)("Importing theme options","gp-premium"),d()({path:"/generatepress-site-library/v1/import_theme_options",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(e){n.textContent=e.response,e.success&&e.response||n.classList.add("gblocks-action-message--error"),setTimeout((function(){t.state.importContent?Object.keys(t.state.hasData.plugin_data).length>0?t.installPlugins(n):t.importContent(n):(n.textContent=(0,c.__)("Import Complete","gp-premium"),t.setState({isAPIWorking:!1,importComplete:!0,hasBackup:!0}))}),2e3)}))}},{key:"installPlugins",value:function(e){var n=this;void 0!==e.target&&(e=e.target.nextElementSibling),e.classList.add("gpp-library-action-message--show"),e.textContent=(0,c.__)("Installing plugins","gp-premium"),Object.entries(this.state.hasData.plugin_data).forEach((function(r){var i=t(r,2),a=i[0],s=i[1],o=s.slug.split("/")[0],l=s.name;s.installed?(delete n.state.hasData.plugin_data[a],0===Object.keys(n.state.hasData.plugin_data).length&&n.activatePlugins(e)):("bb-plugin"===o&&(o="beaver-builder-lite-version",l="Beaver Builder Lite"),e.textContent=(0,c.sprintf)(/* translators: Installing "Plugin Name" */ -(0,c.__)("Installing %s","gp-premium"),l),wp.updates.installPlugin({slug:o,success:function(t){console.log(t),delete n.state.hasData.plugin_data[a],0===Object.keys(n.state.hasData.plugin_data).length&&n.activatePlugins(e)},error:function(t){console.log(t),delete n.state.hasData.plugin_data[a],0===Object.keys(n.state.hasData.plugin_data).length&&n.activatePlugins(e)}}))}))}},{key:"activatePlugins",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=(0,c.__)("Activating plugins","gp-premium"),d()({path:"/generatepress-site-library/v1/activate_plugins",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){t.importContent(e)}),2e3)}))}},{key:"importContent",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=(0,c.__)("Importing content","gp-premium"),d()({path:"/generatepress-site-library/v1/import_content",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){t.importSiteOptions(e)}),2e3)}))}},{key:"importSiteOptions",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=(0,c.__)("Importing site options","gp-premium"),d()({path:"/generatepress-site-library/v1/import_site_options",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){t.state.hasWidgets?t.importWidgets(e):(e.textContent=(0,c.__)("Import Complete","gp-premium"),t.setState({isAPIWorking:!1,importComplete:!0,hasBackup:!0}))}),2e3)}))}},{key:"importWidgets",value:function(e){var t=this;e.classList.add("gpp-library-action-message--show"),e.textContent=(0,c.__)("Importing widgets","gp-premium"),d()({path:"/generatepress-site-library/v1/import_widgets",method:"POST",data:{siteData:this.state.siteData,siteSlug:this.state.siteData.name.replace(/\s+/g,"_").toLowerCase(),importOptions:this.state.importOptions,importContent:this.state.importContent}}).then((function(n){e.textContent=n.response,n.success&&n.response||e.classList.add("gblocks-action-message--error"),setTimeout((function(){e.textContent=(0,c.__)("Import Complete","gp-premium"),t.setState({isAPIWorking:!1,importComplete:!0,hasBackup:!0})}),2e3)}))}},{key:"restoreBackup",value:function(e){var t=this,n=e.target.nextElementSibling;n.classList.add("gpp-library-action-message--show"),n.textContent=(0,c.__)("Restoring theme options","gp-premium"),d()({path:"/generatepress-site-library/v1/restore_theme_options",method:"POST"}).then((function(e){n.textContent=e.response,e.success&&e.response||n.classList.add("gblocks-action-message--error"),setTimeout((function(){n.textContent=(0,c.__)("Restoring content","gp-premium"),d()({path:"/generatepress-site-library/v1/restore_content",method:"POST"}).then((function(e){n.textContent=e.response,e.success&&e.response||n.classList.add("gblocks-action-message--error"),t.setState({isAPIWorking:!1,hasBackup:!1})}))}),2e3)}))}},{key:"render",value:function(){var e=this;if(!this.state.isAPILoaded)return(0,l.createElement)(m.Placeholder,{className:"gpp-library-placeholder"},(0,l.createElement)(m.Spinner,null));var n=this.state.allSites;if(!n||"no results"===n)return(0,l.createElement)("div",{className:"generatepress-site-library-no-results"},(0,l.createElement)("p",null,(0,c.__)("No sites were found.","gp-premium")," ",(0,l.createElement)("a",{href:"https://docs.generatepress.com/article/site-library-unavailable/",target:"_blank",rel:"noreferrer noopener"},(0,c.__)("Why?","gp-premium"))),(0,l.createElement)(m.Button,{variant:"primary",onClick:function(){e.setState({refreshingSites:!0}),d()({path:"/generatepress-site-library/v1/get_sites",method:"POST",data:{forceRefresh:!0}}).then((function(t){e.setState({isAPILoaded:!0,allSites:t.response,refreshingSites:!1})}))}},this.state.refreshingSites&&(0,l.createElement)(m.Spinner,null),!this.state.refreshingSites&&(0,c.__)("Try again","gp-premium")));var r="";"tablet"===this.state.device&&(r="768px"),"mobile"===this.state.device&&(r="480px");var i=this.state.siteData.author_name&&this.state.siteData.author_url&&"GeneratePress"!==this.state.siteData.author_name;return(0,l.createElement)(h.Fragment,null,(0,l.createElement)("div",{className:"generatepress-site-library"},!!this.state.hasBackup&&(0,l.createElement)("div",{className:"generatepress-site-library-restore"},(0,l.createElement)("h2",null,(0,c.__)("Existing Site Import Detected","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("It is highly recommended that you remove the last site you imported before importing a new one.","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.","gp-premium")),(0,l.createElement)("div",{className:"gpp-library-action-button"},(0,l.createElement)(m.Button,{variant:"primary",onClick:function(t){window.confirm((0,c.__)("This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.","gp-premium"))&&(e.setState({isAPIWorking:!0}),e.restoreBackup(t))}},this.state.isAPIWorking&&(0,l.createElement)(m.Spinner,null),!this.state.isAPIWorking&&(0,c.__)("Remove imported site","gp-premium")),(0,l.createElement)("span",{className:"gpp-library-action-message"}),!this.state.isAPIWorking&&(0,l.createElement)(m.Button,{onClick:function(){e.setState({hasBackup:!1})}},(0,c.__)("No thanks","gp-premium")))),!this.state.siteOpened&&!this.state.hasBackup&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("div",{className:"generatepress-site-library-filter"},(0,l.createElement)(v,{allSites:n,value:this.state.category,onChange:function(t){e.setState({category:t}),setTimeout((function(){(0,p.be)()}),100)}}),(0,l.createElement)(b,{value:this.state.search,onChange:function(t){e.setState({search:t,category:""}),setTimeout((function(){(0,p.be)()}),100)}})),(0,l.createElement)("ul",{className:"generatepress-site-library-list"},Object.keys(n).map((function(t){if(""!==e.state.category&&!n[t].category.includes(e.state.category))return null;var r=n[t].name,i=(0,g.decodeEntities)(r);if(""!==e.state.search&&!i.toLowerCase().includes(e.state.search.toLowerCase())&&!n[t].author_name.toLowerCase().includes(e.state.search.toLowerCase()))return null;var a=n[t].directory+"/screenshot.png",s=gppSiteLibrary.gppVersion.split("-")[0],o=n[t].min_version.split("-")[0],m=gppSiteLibrary.gpVersion.split("-")[0],h=gppSiteLibrary.generateblocksVersion.split("-")[0],f=n[t].min_theme_version?n[t].min_theme_version.split("-")[0]:m,d=n[t].min_generateblocks_version?n[t].min_generateblocks_version.split("-")[0]:h,v=n[t].image_width,b=n[t].image_height,y=u(o,s)>0||u(f,m)>0||h&&u(d,h)>0;return(0,l.createElement)("li",{className:"generatepress-site-library-list-item",key:r+":"+t},(0,l.createElement)("button",{disabled:y,onClick:function(){e.setState({siteOpened:!0,siteData:n[t],sitePlugins:JSON.parse(n[t].plugins)})}},(0,l.createElement)("div",{className:"generatepress-site-library-list-item-image"},(0,l.createElement)(p.ZP,{offset:100,once:!0},(0,l.createElement)("img",{src:a,alt:r,width:v,height:b}))),(0,l.createElement)("div",{className:"generatepress-site-library-list-item-title"},i,!!y&&u(o,s)>0&&(0,l.createElement)("span",{className:"generatepress-site-library-required-version"},(0,c.sprintf)(/* translators: Version number */ -(0,c.__)("Requires GP Premium %s.","gp-premium"),o)),!!y&&u(f,m)>0&&(0,l.createElement)("span",{className:"generatepress-site-library-required-version"},(0,c.sprintf)(/* translators: Version number */ -(0,c.__)("Requires GeneratePress %s.","gp-premium"),f)),!!y&&h&&u(d,h)>0&&(0,l.createElement)("span",{className:"generatepress-site-library-required-version"},(0,c.sprintf)(/* translators: Version number */ -(0,c.__)("Requires GenerateBlocks %s.","gp-premium"),d)))))}))),(0,l.createElement)("div",{className:"generatepress-site-library-refresh"},(0,l.createElement)(m.Button,{variant:"primary",onClick:function(){e.setState({refreshingSites:!0}),d()({path:"/generatepress-site-library/v1/get_sites",method:"POST",data:{forceRefresh:!0}}).then((function(t){e.setState({isAPILoaded:!0,allSites:t.response,refreshingSites:!1})}))}},this.state.refreshingSites&&(0,l.createElement)(m.Spinner,null),!this.state.refreshingSites&&(0,c.__)("Refresh sites","gp-premium")))),this.state.siteOpened&&(0,l.createElement)("div",{className:"generatepress-site-library-opened"},(0,l.createElement)("div",{className:"generatepress-site-library-iframe"},(0,l.createElement)("iframe",{title:"gpp-site-library-frame",src:this.state.siteData.preview_url,style:{width:r}})),(0,l.createElement)("div",{className:"generatepress-site-library-info"},(0,l.createElement)("div",{className:"generatepress-site-library-header"},(0,l.createElement)("div",{className:"generatepress-site-library-header__title"},(0,l.createElement)("h2",{className:i?"has-author":""},(0,g.decodeEntities)(this.state.siteData.name)),i&&(0,l.createElement)("span",{className:"site-library-author"},/* translators: Site library site built by "author name" */ -(0,c.__)("Built by","gp-premium")+" ",(0,l.createElement)("a",{href:this.state.siteData.author_url,target:"_blank",rel:"noreferrer noopener"},this.state.siteData.author_name))),(0,l.createElement)(m.Button,{onClick:function(){e.setState({isAPIWorking:!1,siteOpened:!1,siteData:{},siteSlug:"",sitePlugins:{},hasData:{},hasWidgets:!1,importOptions:!0,importContent:!0,confirmImport:!1,importComplete:!1,installablePlugins:[],activePlugins:[],manualPlugins:[]})}},(0,l.createElement)("svg",{width:"35",height:"35",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},(0,l.createElement)("path",{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"})))),(0,l.createElement)("div",{className:"generatepress-site-library-content"},!!this.state.siteData.description&&(0,l.createElement)("p",null,(0,g.decodeEntities)(this.state.siteData.description)),!this.state.importComplete&&(0,l.createElement)(h.Fragment,null,0===Object.keys(this.state.hasData).length&&(0,l.createElement)(h.Fragment,null,gppSiteLibrary.isDebugEnabled&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("h3",null,(0,c.__)("Debug Mode Enabled","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("WordPress debug mode is currently enabled. With this, any errors from third-party plugins might affect the import process.","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("To disable it, find WP_DEBUG in your wp-config.php file and set it to false like the below.","gp-premium")),(0,l.createElement)("code",null,"define( 'WP_DEBUG', false );"),(0,l.createElement)("p",null,(0,l.createElement)("a",{href:"https://docs.generatepress.com/article/debug-mode-enabled/",target:"_blank",rel:"noreferrer noopener"},(0,c.__)("Learn more here","gp-premium")))),Object.keys(this.state.sitePlugins).length>0&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("h3",null,(0,c.__)("Plugins","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("This site uses the following plugins.","gp-premium")),(0,l.createElement)("ul",{className:"generatepress-site-library-plugins"},Object.entries(this.state.sitePlugins).map((function(e){var n=t(e,1)[0];return(0,l.createElement)("li",{key:n},n)})))),(0,l.createElement)("div",{className:"gpp-library-action-button"},(0,l.createElement)(m.Button,{variant:"primary",disabled:this.state.isAPIWorking,onClick:function(n){e.setState({isAPIWorking:!0});var r=n.target.nextElementSibling;r.textContent=(0,c.__)("Gathering information","gp-premium"),d()({path:"/generatepress-site-library/v1/get_site_data",method:"POST",data:{siteData:e.state.siteData}}).then((function(n){var i=[],a=[],s=[];Object.entries(n.response.plugin_data).forEach((function(e){var r=t(e,1)[0],o=n.response.plugin_data[r];o.repo&&!o.installed?i.push(o.name):o.installed||o.active?a.push(o.name):s.push(o.name)})),e.setState({isAPIWorking:!1,hasData:n.response,sitePlugins:n.response.plugins,hasWidgets:n.response.widgets,installablePlugins:i,activePlugins:a,manualPlugins:s}),r.classList.add("gpp-library-action-message--show"),r.textContent=n.response,n.success&&n.response?setTimeout((function(){r.classList.remove("gpp-library-action-message--show")}),3e3):r.classList.add("gpp-library-action-message--error")}))}},this.state.isAPIWorking&&(0,l.createElement)(m.Spinner,null),!this.state.isAPIWorking&&(0,c.__)("Get Started","gp-premium")),(0,l.createElement)("span",{className:"gpp-library-action-message"}))),Object.keys(this.state.hasData).length>0&&Object.keys(this.state.sitePlugins).length>0&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("h3",null,(0,c.__)("Plugins","gp-premium")),this.state.installablePlugins.length>0&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("p",null,(0,c.__)("These plugins can be installed automatically.","gp-premium")),(0,l.createElement)("ul",{className:"generatepress-site-library-plugins"},this.state.installablePlugins.map((function(e){return(0,l.createElement)("li",{key:e},e)})))),this.state.activePlugins.length>0&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("p",null,(0,c.__)("These plugins are already installed.","gp-premium")),(0,l.createElement)("ul",{className:"generatepress-site-library-plugins"},this.state.activePlugins.map((function(e){return(0,l.createElement)("li",{key:e},e)})))),this.state.manualPlugins.length>0&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("p",null,(0,c.__)("These plugins need to be installed manually.","gp-premium")),(0,l.createElement)("ul",{className:"generatepress-site-library-plugins"},this.state.manualPlugins.map((function(e){return(0,l.createElement)("li",{key:e},e)}))))),Object.keys(this.state.hasData).length>0&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("h3",null,(0,c.__)("Import","gp-premium")),this.state.hasData.options&&!this.state.isAPIWorking&&(0,l.createElement)(m.Tooltip,{text:(0,c.__)("This will import the options from the Customizer.","gp-premium")},(0,l.createElement)(m.ToggleControl,{checked:!!this.state.importOptions,label:(0,c.__)("Import Theme Options","gp-premium"),onChange:function(t){e.setState({importOptions:t})}})),this.state.hasData.content&&!this.state.isAPIWorking&&(0,l.createElement)(m.Tooltip,{text:(0,c.__)("This will install and activate needed plugins, import demo content, and import site options.","gp-premium")},(0,l.createElement)(m.ToggleControl,{checked:!!this.state.importContent,label:(0,c.__)("Import Demo Content","gp-premium"),onChange:function(t){e.setState({importContent:t})}})),(!!this.state.importOptions||!!this.state.importContent)&&(0,l.createElement)(h.Fragment,null,!this.state.isAPIWorking&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("h3",null,(0,c.__)("Confirm Import","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.","gp-premium")),(0,l.createElement)(m.ToggleControl,{checked:!!this.state.confirmImport,label:(0,c.__)("I understand","gp-premium"),onChange:function(t){e.setState({confirmImport:t})}})),!!this.state.confirmImport&&!this.state.importComplete&&(0,l.createElement)("div",{className:"gpp-library-action-button"},(0,l.createElement)(m.Button,{variant:"primary",disabled:this.state.isAPIWorking,onClick:function(t){e.setState({isAPIWorking:!0}),e.state.importOptions?e.importThemeOptions(t):e.state.importContent&&e.installPlugins(t)}},this.state.isAPIWorking&&(0,l.createElement)(m.Spinner,null),!this.state.isAPIWorking&&(0,c.__)("Begin Import","gp-premium")),(0,l.createElement)("span",{className:"gpp-library-action-message"}))))),!!this.state.importComplete&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("h3",null,(0,c.__)("Import Complete","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("Check out your new site and start making it yours!","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("Note: We do our best to ensure all imported images are licensed for open use. However, image licenses can change, so we strongly advise that you replace all imported images with your own.","gp-premium")),(0,l.createElement)("a",{className:"components-button is-primary",href:gppSiteLibrary.homeUrl},(0,c.__)("View Site","gp-premium")),this.state.siteData.uploads_url&&Object.values(this.state.sitePlugins).includes("elementor/elementor.php")&&(0,l.createElement)(h.Fragment,null,(0,l.createElement)("h3",null,(0,c.__)("Additional Cleanup","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("This site is using Elementor which means you will want to replace the imported image URLs.","gp-premium")),(0,l.createElement)("p",null,(0,c.__)("Take note of the old and new URLs below, then head over to the Elementor Tools area to replace them.","gp-premium")),(0,l.createElement)(m.TextControl,{label:(0,c.__)("Old URL","gp-premium"),readOnly:!0,value:this.state.siteData.uploads_url}),(0,l.createElement)(m.TextControl,{label:(0,c.__)("New URL","gp-premium"),readOnly:!0,value:gppSiteLibrary.uploadsUrl}),(0,l.createElement)("a",{href:gppSiteLibrary.elementorReplaceUrls,className:"components-button is-primary",target:"_blank",rel:"noopener noreferrer"},(0,c.__)("Elementor Tools","gp-premium")))),(0,l.createElement)("div",{className:"generatepress-site-library-footer"},(0,l.createElement)(m.Tooltip,{text:(0,c.__)("Preview desktop","gp-premium")},(0,l.createElement)(m.Button,{variant:"desktop"===this.state.device?"primary":"",onClick:function(){e.setState({device:"desktop"})}},(0,l.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,l.createElement)("path",{d:"M21 14H3V4h18m0-2H3c-1.11 0-2 .89-2 2v12a2 2 0 002 2h7l-2 3v1h8v-1l-2-3h7a2 2 0 002-2V4a2 2 0 00-2-2z",fill:"currentColor"})))),(0,l.createElement)(m.Tooltip,{text:(0,c.__)("Preview tablet","gp-premium")},(0,l.createElement)(m.Button,{variant:"tablet"===this.state.device?"primary":"",onClick:function(){e.setState({device:"tablet"})}},(0,l.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,l.createElement)("path",{d:"M19 19H4V3h15m-7.5 20a1.5 1.5 0 01-1.5-1.5 1.5 1.5 0 011.5-1.5 1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m7-23h-14A2.5 2.5 0 002 2.5v19A2.5 2.5 0 004.5 24h14a2.5 2.5 0 002.5-2.5v-19A2.5 2.5 0 0018.5 0z",fill:"currentColor"})))),(0,l.createElement)(m.Tooltip,{text:(0,c.__)("Preview mobile","gp-premium")},(0,l.createElement)(m.Button,{variant:"mobile"===this.state.device?"primary":"",onClick:function(){e.setState({device:"mobile"})}},(0,l.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,l.createElement)("path",{d:"M17 19H7V5h10m0-4H7c-1.11 0-2 .89-2 2v18a2 2 0 002 2h10a2 2 0 002-2V3a2 2 0 00-2-2z",fill:"currentColor"}))))))))))}}])&&i(n.prototype,f),Object.defineProperty(n,"prototype",{writable:!1}),w}(h.Component);(0,h.render)((0,l.createElement)(y,null),document.getElementById("gpp-site-library"))}()}(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/style-dashboard.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/style-dashboard.css deleted file mode 100644 index f226f072..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/dist/style-dashboard.css +++ /dev/null @@ -1,4 +0,0 @@ -.generatepress-module-action{display:inline-block;font-size:12px;font-weight:400;line-height:1;margin-left:10px;text-decoration:none}.generatepress-dashboard__section-item-settings{align-items:center;display:flex}.generatepress-dashboard__section-item-settings button{font-size:11px;height:30px;justify-content:center!important}.generatepress-dashboard__section-item-settings button .components-spinner{margin-top:0}.generatepress-dashboard__section-item-settings button svg{height:20px;margin:0!important;width:20px}.generatepress-dashboard__section-item-settings button:not(:last-child){margin-right:5px} -.generatepress-license-key-area .generatepress-dashboard__section-item-message{background:#fff}.generatepress-license-key-area .generatepress-dashboard__section-item{flex-wrap:wrap;justify-content:flex-start}.generatepress-license-key-area .generatepress-dashboard__section-license-key{display:flex;flex:1}.generatepress-license-key-area .generatepress-dashboard__section-license-key .components-base-control{flex:1}.generatepress-license-key-area .generatepress-dashboard__section-license-key button{height:31px;margin-left:8px}.generatepress-license-key-area .generatepress-dashboard__section-beta-tester{align-items:center;display:flex;flex-basis:100%;margin-top:30px}.generatepress-license-key-area .generatepress-dashboard__section-license-notice{flex-basis:100%;margin:0 0 20px}.generatepress-license-key-area .components-base-control__field,.generatepress-license-key-area .components-base-control__help{margin-bottom:0} -.generatepress-dashboard__section-item-action input[type=file]{border:1px solid #ddd;padding:5px}.generatepress-dashboard__section-item-export-popover .components-popover__content{padding:20px} -.generatepress-dashboard__section-item-modules{margin-top:20px} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/author-image-placeholder.png b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/author-image-placeholder.png deleted file mode 100644 index f8bdda75..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/author-image-placeholder.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/background-image-fallback.jpg b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/background-image-fallback.jpg deleted file mode 100644 index ae5ef65d..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/background-image-fallback.jpg and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/balloon.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/balloon.css deleted file mode 100644 index b2dbcb0c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/balloon.css +++ /dev/null @@ -1,211 +0,0 @@ -button[data-balloon] { - overflow: visible; } - -[data-balloon] { - position: relative; - cursor: pointer; } - [data-balloon]:after { - filter: alpha(opacity=0); - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - -moz-opacity: 0; - -khtml-opacity: 0; - opacity: 0; - pointer-events: none; - transition: all 0.18s ease-out 0.18s; - font-weight: normal !important; - font-style: normal !important; - text-shadow: none !important; - font-size: 12px !important; - background: rgba(17, 17, 17, 0.9); - border-radius: 4px; - color: #fff; - content: attr(data-balloon); - padding: .5em 1em; - position: absolute; - white-space: nowrap; - z-index: 10; } - [data-balloon]:before { - background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba(17, 17, 17, 0.9)%22%20transform%3D%22rotate(0)%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E"); - background-size: 100% auto; - width: 18px; - height: 6px; - filter: alpha(opacity=0); - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - -moz-opacity: 0; - -khtml-opacity: 0; - opacity: 0; - pointer-events: none; - transition: all 0.18s ease-out 0.18s; - content: ''; - position: absolute; - z-index: 10; } - [data-balloon]:hover:before, [data-balloon]:hover:after, [data-balloon][data-balloon-visible]:before, [data-balloon][data-balloon-visible]:after { - filter: alpha(opacity=100); - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; - -moz-opacity: 1; - -khtml-opacity: 1; - opacity: 1; - pointer-events: auto; } - [data-balloon].font-awesome:after { - font-family: FontAwesome; } - [data-balloon][data-balloon-break]:after { - white-space: pre; } - [data-balloon][data-balloon-blunt]:before, [data-balloon][data-balloon-blunt]:after { - transition: none; } - [data-balloon][data-balloon-pos="up"]:after { - bottom: 100%; - left: 50%; - margin-bottom: 11px; - transform: translate(-50%, 10px); - transform-origin: top; } - [data-balloon][data-balloon-pos="up"]:before { - bottom: 100%; - left: 50%; - margin-bottom: 5px; - transform: translate(-50%, 10px); - transform-origin: top; } - [data-balloon][data-balloon-pos="up"]:hover:after, [data-balloon][data-balloon-pos="up"][data-balloon-visible]:after { - transform: translate(-50%, 0); } - [data-balloon][data-balloon-pos="up"]:hover:before, [data-balloon][data-balloon-pos="up"][data-balloon-visible]:before { - transform: translate(-50%, 0); } - [data-balloon][data-balloon-pos="up-left"]:after { - bottom: 100%; - left: 0; - margin-bottom: 11px; - transform: translate(0, 10px); - transform-origin: top; } - [data-balloon][data-balloon-pos="up-left"]:before { - bottom: 100%; - left: 5px; - margin-bottom: 5px; - transform: translate(0, 10px); - transform-origin: top; } - [data-balloon][data-balloon-pos="up-left"]:hover:after, [data-balloon][data-balloon-pos="up-left"][data-balloon-visible]:after { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos="up-left"]:hover:before, [data-balloon][data-balloon-pos="up-left"][data-balloon-visible]:before { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos="up-right"]:after { - bottom: 100%; - right: 0; - margin-bottom: 11px; - transform: translate(0, 10px); - transform-origin: top; } - [data-balloon][data-balloon-pos="up-right"]:before { - bottom: 100%; - right: 5px; - margin-bottom: 5px; - transform: translate(0, 10px); - transform-origin: top; } - [data-balloon][data-balloon-pos="up-right"]:hover:after, [data-balloon][data-balloon-pos="up-right"][data-balloon-visible]:after { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos="up-right"]:hover:before, [data-balloon][data-balloon-pos="up-right"][data-balloon-visible]:before { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos='down']:after { - left: 50%; - margin-top: 11px; - top: 100%; - transform: translate(-50%, -10px); } - [data-balloon][data-balloon-pos='down']:before { - background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba(17, 17, 17, 0.9)%22%20transform%3D%22rotate(180 18 6)%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E"); - background-size: 100% auto; - width: 18px; - height: 6px; - left: 50%; - margin-top: 5px; - top: 100%; - transform: translate(-50%, -10px); } - [data-balloon][data-balloon-pos='down']:hover:after, [data-balloon][data-balloon-pos='down'][data-balloon-visible]:after { - transform: translate(-50%, 0); } - [data-balloon][data-balloon-pos='down']:hover:before, [data-balloon][data-balloon-pos='down'][data-balloon-visible]:before { - transform: translate(-50%, 0); } - [data-balloon][data-balloon-pos='down-left']:after { - left: 0; - margin-top: 11px; - top: 100%; - transform: translate(0, -10px); } - [data-balloon][data-balloon-pos='down-left']:before { - background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba(17, 17, 17, 0.9)%22%20transform%3D%22rotate(180 18 6)%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E"); - background-size: 100% auto; - width: 18px; - height: 6px; - left: 5px; - margin-top: 5px; - top: 100%; - transform: translate(0, -10px); } - [data-balloon][data-balloon-pos='down-left']:hover:after, [data-balloon][data-balloon-pos='down-left'][data-balloon-visible]:after { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos='down-left']:hover:before, [data-balloon][data-balloon-pos='down-left'][data-balloon-visible]:before { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos='down-right']:after { - right: 0; - margin-top: 11px; - top: 100%; - transform: translate(0, -10px); } - [data-balloon][data-balloon-pos='down-right']:before { - background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba(17, 17, 17, 0.9)%22%20transform%3D%22rotate(180 18 6)%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E"); - background-size: 100% auto; - width: 18px; - height: 6px; - right: 5px; - margin-top: 5px; - top: 100%; - transform: translate(0, -10px); } - [data-balloon][data-balloon-pos='down-right']:hover:after, [data-balloon][data-balloon-pos='down-right'][data-balloon-visible]:after { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos='down-right']:hover:before, [data-balloon][data-balloon-pos='down-right'][data-balloon-visible]:before { - transform: translate(0, 0); } - [data-balloon][data-balloon-pos='left']:after { - margin-right: 11px; - right: 100%; - top: 50%; - transform: translate(10px, -50%); } - [data-balloon][data-balloon-pos='left']:before { - background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba(17, 17, 17, 0.9)%22%20transform%3D%22rotate(-90 18 18)%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E"); - background-size: 100% auto; - width: 6px; - height: 18px; - margin-right: 5px; - right: 100%; - top: 50%; - transform: translate(10px, -50%); } - [data-balloon][data-balloon-pos='left']:hover:after, [data-balloon][data-balloon-pos='left'][data-balloon-visible]:after { - transform: translate(0, -50%); } - [data-balloon][data-balloon-pos='left']:hover:before, [data-balloon][data-balloon-pos='left'][data-balloon-visible]:before { - transform: translate(0, -50%); } - [data-balloon][data-balloon-pos='right']:after { - left: 100%; - margin-left: 11px; - top: 50%; - transform: translate(-10px, -50%); } - [data-balloon][data-balloon-pos='right']:before { - background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba(17, 17, 17, 0.9)%22%20transform%3D%22rotate(90 6 6)%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E"); - background-size: 100% auto; - width: 6px; - height: 18px; - left: 100%; - margin-left: 5px; - top: 50%; - transform: translate(-10px, -50%); } - [data-balloon][data-balloon-pos='right']:hover:after, [data-balloon][data-balloon-pos='right'][data-balloon-visible]:after { - transform: translate(0, -50%); } - [data-balloon][data-balloon-pos='right']:hover:before, [data-balloon][data-balloon-pos='right'][data-balloon-visible]:before { - transform: translate(0, -50%); } - [data-balloon][data-balloon-length='small']:after { - white-space: normal; - width: 80px; } - [data-balloon][data-balloon-length='medium']:after { - white-space: normal; - width: 150px; } - [data-balloon][data-balloon-length='large']:after { - white-space: normal; - width: 260px; } - [data-balloon][data-balloon-length='xlarge']:after { - white-space: normal; - width: 380px; } - @media screen and (max-width: 768px) { - [data-balloon][data-balloon-length='xlarge']:after { - white-space: normal; - width: 90vw; } } - [data-balloon][data-balloon-length='fit']:after { - white-space: normal; - width: 100%; } \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/elements.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/elements.css deleted file mode 100644 index c37c91b7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/elements.css +++ /dev/null @@ -1,82 +0,0 @@ -.choose-element-type-parent:before { - content: ""; - position: fixed; - left: 0; - top: 0; - right: 0; - bottom: 0; - background: rgba(0,0,0,0.5); - z-index: 9991; -} - -.choose-element-type { - position: fixed; - width: 500px; - background: #fff; - left: 50%; - padding: 30px; - box-sizing: border-box; - box-shadow: 0 0 20px rgba(0,0,0,0.05); - border: 1px solid #ddd; - z-index: 9992; - transform: translate(-50%, -50%); - top: 50%; -} - -.choose-element-type h2 { - margin-top: 0; -} - -select.select-type { - position: relative; - padding: 10px 15px; - margin: 0; - background-color: #fff; - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; - width: 100%; - overflow: hidden; - height: auto; - border: 0; - cursor: pointer; -} - -select.select-type:hover { - background-color: #fafafa; -} - -.dark-mode select.select-type:hover { - background-color: #23282d; -} - -.choose-element-type button.button { - font-size: 17px; - margin-left: 10px; -} - -.select-type-container { - display: flex; -} - -button.close-choose-element-type { - position: absolute; - top: 10px; - right: 10px; - background: transparent; - border: 0; - box-shadow: 0 0 0; - cursor: pointer; - padding: 0; -} - -button.close-choose-element-type svg { - height: 20px; - width: 20px; -} - -.hook-location { - background: #efefef; - padding: 2px 5px; - font-family: monospace; - font-size: 11px; - border-radius: 2px; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/elements.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/elements.js deleted file mode 100644 index 03aa79c9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/elements.js +++ /dev/null @@ -1,29 +0,0 @@ -jQuery( function( $ ) { - $( '.post-type-gp_elements .page-title-action:not(.legacy-button)' ).on( 'click', function( e ) { - e.preventDefault(); - - $( '.choose-element-type-parent' ).show(); - $( '.choose-element-type .select-type' ).focus(); - } ); - - $( '.close-choose-element-type' ).on( 'click', function( e ) { - e.preventDefault(); - - $( '.choose-element-type-parent' ).hide(); - $( '.page-title-action' ).focus(); - } ); - - $( '.post-type-gp_elements' ).on( 'keyup', function( e ) { - const $element = $( '.choose-element-type-parent' ); - - if ( e.key === 'Escape' && $element.is( ':visible' ) ) { - $element.hide(); - $( '.page-title-action' ).focus(); - } - } ); - - // Don't allow Elements to quick edit parents. - $( '.inline-edit-gp_elements select#post_parent, .inline-edit-gp_elements .inline-edit-menu-order-input, .bulk-edit-gp_elements select#post_parent' ).each( function() { - $( this ).closest( 'label' ).remove(); - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/featured-image-placeholder.png b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/featured-image-placeholder.png deleted file mode 100644 index 500f8c9c..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/featured-image-placeholder.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/metabox.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/metabox.css deleted file mode 100644 index e793bcaa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/metabox.css +++ /dev/null @@ -1,396 +0,0 @@ -#generate_premium_elements { - background-color: transparent; - border: 0; - box-shadow: 0 0 0; -} - -#generate_premium_elements .inside { - padding: 0; - margin: 0; -} - -#generate_premium_elements .CodeMirror { - position: relative; - padding: 0; - background: white; - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; - width: 100%; - overflow: hidden; -} - -tr.generate-element-row td { - border-bottom: 1px solid #f0f0f0; - zoom: 1; -} - -td.generate-element-row-heading { - background: #F9F9F9; - border-right: 1px solid #E1E1E1; - padding: 13px 15px; - width: 24%; -} - -td.generate-element-row-heading label { - display: inline-block; - font-size: 13px; - line-height: 1.4em; - font-weight: bold; - padding: 0; - margin: 0 0 3px; - color: #333; -} - -td.generate-element-row-content { - padding: 13px 15px; - position: relative; - width: 75%; -} - -#generate_premium_elements .handlediv, -#generate_premium_elements .hndle, -#generate_premium_elements .postbox-header { - display: none; -} - -#generate_premium_elements .inside { - padding: 0; -} - -#generate_premium_elements select, -#generate_premium_elements input[type="number"], -#generate_premium_elements input[type="text"] { - width: 100%; -} - -#generate_premium_elements .condition select.condition-object-select + .select2 { - display: none; -} - -#generate_premium_elements .condition.generate-elements-rule-objects-visible select.condition-select + .select2 { - margin-right: 5px; - width: 100%; -} - -#generate_premium_elements .condition.generate-elements-rule-objects-visible select.condition-object-select + .select2 { - display: inline-block; - margin-left: 5px; - width: 100%; -} - -#generate_premium_elements .condition { - display: flex; - margin-bottom: 10px; -} - -#generate_premium_elements .condition .select2 { - flex-grow: 1; -} - -button.remove-condition { - background: transparent; - border: 0; - line-height: 1; - width: 30px; - font-size: 20px; - cursor: pointer; - opacity: 0.5; - position: relative; - bottom: -3px; -} - -button.add-condition { - margin-top: 10px !important; -} - -button.remove-condition:before { - content: "\f153"; - font-family: dashicons; -} - -table.generate-elements-settings { - position: relative; - padding: 0; - background: white; - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; - width: 100%; - overflow: hidden; -} - -.generate-element-row-loading { - background-color: rgba(255,255,255,0.9); - background-image: url('spinner.gif'); - background-position: center center; - background-repeat: no-repeat; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 1; -} - -ul.element-metabox-tabs { - position: relative; - padding: 0; - margin: 0 0 20px; - background: white; - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; - display: flex; - width: 100%; - overflow: hidden; -} - -ul.element-metabox-tabs li { - width: auto; - flex: none; - border-bottom: 2px solid transparent; - border-top: none; - text-align: center; - margin-bottom: 0; -} - -ul.element-metabox-tabs li a { - display: block; - width: auto; - padding: 16px 16px 14px 16px; - color: #0087be; - font-weight: 400; - text-decoration: none; - box-shadow: 0 0 0; -} - -ul.element-metabox-tabs li a:hover { - color: #00a0d2; -} - -ul.element-metabox-tabs li.is-selected { - border-bottom-color: #2e4453; -} - -ul.element-metabox-tabs li.is-selected a { - color: #2e4453; -} - -#generate-element-content, -#generate-element-content + .CodeMirror { - margin-bottom: 20px; -} - -.element-metabox-tabs li:not([data-tab="display-rules"]):not([data-tab="internal-notes"]), -.generate-elements-settings:not([data-tab="display-rules"]):not([data-tab="internal-notes"]) { - display: none; -} - -.element-settings.header .element-metabox-tabs li[data-type="header"], -.element-settings.hook .element-metabox-tabs li[data-type="hook"], -.element-settings.block .element-metabox-tabs li[data-type="hook"], -.element-settings.layout .element-metabox-tabs li[data-type="layout"] { - display: block; -} - -.element-settings.header:not(.has-page-hero) table[data-tab="site-header"], -.element-settings.header.has-page-hero table[data-tab="hero"], -.element-settings.hook table[data-tab="hook-settings"], -.element-settings.block table[data-tab="hook-settings"], -.element-settings.layout table[data-tab="sidebars"] { - display: table; -} - -.element-settings.header:not(.has-page-hero) #generate-element-content { - display: none; -} - -.element-settings.header:not(.has-page-hero) #generate-element-content + .CodeMirror:not(.gpp-elements-show-codemirror) { - height: 0; - overflow: hidden; - opacity: 0; - margin: 0; -} - -.padding-container { - display: flex; -} - -.single-value-padding-container { - display: block; -} - -.single-value-padding-container input[type="number"] { - width: 60px !important; - display: inline-block; - vertical-align: middle; -} - -.padding-element-options { - display: flex; -} - -.padding-element span.unit { - border: 1px solid #ddd; - display: inline-block; - line-height: 26px; - padding: 0 10px; - margin-left: -5px; - vertical-align: middle; - border-left: 0; -} - -.padding-element input { - width: 60px !important; - min-height: 30px; -} - -.padding-element select { - width: auto !important; - position: relative; - left: -5px; - min-height: 30px; -} - -.padding-element span { - display: block; - font-size: 90%; - opacity: 0.8; -} - -.generate-element-row-content .responsive-controls.single-responsive-value { - padding: 8px 15px 7px 0; -} - -.generate-element-row-content .responsive-controls.checkbox-responsive-value { - padding: 2px 15px 0 0; -} - -#postimagediv { - display: none; -} - -.image-preview img { - height: 30px; - width: auto; - vertical-align: middle; - border-radius: 5px; -} - -.gp-media-preview img { - vertical-align: middle; - background-color: #efefef; - border-radius: 5px; - height: 30px; - width: auto; -} - -.media-container, -.change-featured-image, -.set-featured-image { - display: flex; - align-items: center; -} - -.media-container > input, -.media-container .gp-media-preview img, -.change-featured-image > *, -.set-featured-image > * { - margin-right: 10px !important; -} - -.generate-element-row-content .responsive-controls { - float: left; - padding: 15px 15px 15px 0; -} - -.generate-element-row-content .responsive-controls a { - text-decoration: none; - color: #222; - opacity: 0.5; - outline: 0; - box-shadow: 0 0 0; -} - -.generate-element-row-content .responsive-controls a.is-selected { - opacity: 1; -} - -.generate-element-row-content .responsive-controls a span { - font-size: 14px; - width: auto; - height: auto; - vertical-align: baseline; -} - -#generate-element-content { - width: 100%; - height: 300px; -} - -.layout-radio-item { - margin-bottom: 3px; -} - -.layout-radio-item:first-child { - margin-bottom: 15px; -} - -span.tip { - display: inline-block; - float: right; - background: #b3b3b3; - height: 15px; - width: 15px; - text-align: center; - line-height: 15px; - color: #fff; - border-radius: 50%; - font-size: 10px; -} - -body:not(.header-element-type) #generate_page_hero_template_tags, -.header-element-type:not(.element-has-page-hero) #generate_page_hero_template_tags { - display: none; -} - -#_generate_element_internal_notes { - width: 100%; - height: 250px; -} - -.select2-results__option { - margin: 0; -} - -body .select2-container--default .select2-selection--single { - border-color: #ddd; -} - -.select2-results__option[role="list"] { - padding: 0; -} - -#generate_premium_elements #_generate_content_width { - width: 65px; - vertical-align: middle; -} - -#_generate_content_width + span { - border: 1px solid #ddd; - height: 26px; - display: inline-block; - vertical-align: middle; - line-height: 26px; - padding: 0 10px; - margin-left: -6px; -} - -.hide-hook-row, -.sidebar-notice { - display: none; -} - -.sidebar-notice { - margin-top: 10px; - font-style: italic; -} - -.element-settings.block .generate-elements-settings[data-type="hook"] tr:last-child td { - border-bottom: 0; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/metabox.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/metabox.js deleted file mode 100644 index c003b0df..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/metabox.js +++ /dev/null @@ -1,424 +0,0 @@ -jQuery( function( $ ) { - if ( $( '.element-settings' ).hasClass( 'header' ) || $( '.element-settings' ).hasClass( 'hook' ) ) { - $( function() { - if ( elements.settings ) { - wp.codeEditor.initialize( 'generate-element-content', elements.settings ); - } - } ); - } - - $( '#_generate_block_type' ).on( 'change', function() { - var _this = $( this ).val(); - - if ( 'hook' === _this ) { - $( '.hook-row' ).removeClass( 'hide-hook-row' ); - } else { - $( '.hook-row' ).addClass( 'hide-hook-row' ); - } - - $( 'body' ).removeClass( 'right-sidebar-block-type' ); - $( 'body' ).removeClass( 'left-sidebar-block-type' ); - $( 'body' ).removeClass( 'header-block-type' ); - $( 'body' ).removeClass( 'footer-block-type' ); - - $( 'body' ).addClass( _this + '-block-type' ); - - if ( 'left-sidebar' === _this || 'right-sidebar' === _this ) { - $( '.sidebar-notice' ).show(); - } else { - $( '.sidebar-notice' ).hide(); - } - } ); - - $( '#_generate_hook' ).on( 'change', function() { - var _this = $( this ); - - $( '.disable-header-hook' ).hide(); - $( '.disable-footer-hook' ).hide(); - $( '.custom-hook-name' ).hide(); - - if ( 'generate_header' === _this.val() ) { - $( '.disable-header-hook' ).show(); - } - - if ( 'generate_footer' === _this.val() ) { - $( '.disable-footer-hook' ).show(); - } - - if ( 'custom' === _this.val() ) { - $( '.custom-hook-name' ).show(); - } - } ); - - $( '#_generate_hook' ).select2( { - width: '100%', - } ); - - $( '.element-metabox-tabs li' ).on( 'click', function() { - var _this = $( this ), - tab = _this.data( 'tab' ); - - _this.siblings().removeClass( 'is-selected' ); - _this.addClass( 'is-selected' ); - $( '.generate-elements-settings' ).hide(); - $( '.generate-elements-settings[data-tab="' + tab + '"]' ).show(); - - if ( $( '.element-settings' ).hasClass( 'block' ) && 'hook-settings' === tab ) { - $( '.generate-elements-settings[data-tab="display-rules"]' ).show(); - } - - if ( $( '.element-settings' ).hasClass( 'header' ) ) { - if ( 'hero' !== tab ) { - $( '#generate-element-content' ).next( '.CodeMirror' ).removeClass( 'gpp-elements-show-codemirror' ); - $( '#generate_page_hero_template_tags' ).css( 'display', '' ); - } else { - $( '#generate-element-content' ).next( '.CodeMirror' ).addClass( 'gpp-elements-show-codemirror' ); - $( '#generate_page_hero_template_tags' ).css( 'display', 'block' ); - } - } - } ); - - var select2Init = function() { - var selects = $( '.generate-element-row-content .condition:not(.hidden) select:not(.select2-init)' ); - - selects.each( function() { - var select = $( this ), - config = { - width: 'style', - }; - - select.select2( config ); - select.addClass( 'select2-init' ); - } ); - }; - - select2Init(); - - $( '.add-condition' ).on( 'click', function() { - var _this = $( this ); - - var row = _this.closest( '.generate-element-row-content' ).find( '.condition.hidden.screen-reader-text' ).clone( true ); - row.removeClass( 'hidden screen-reader-text' ); - row.insertBefore( _this.closest( '.generate-element-row-content' ).find( '.condition:last' ) ); - - select2Init(); - - return false; - } ); - - $( '.remove-condition' ).on( 'click', function() { - $( this ).parents( '.condition' ).remove(); - - select2Init(); - - return false; - } ); - - var getLocationObjects = function( _this, onload = false, data = '' ) { - var select = _this, - parent = select.parent(), - location = select.val(), - objectSelect = parent.find( '.condition-object-select' ), - locationType = '', - actionType = 'terms'; - - if ( '' === location ) { - parent.removeClass( 'generate-elements-rule-objects-visible' ); - select.closest( '.generate-element-row-content' ).find( '.generate-element-row-loading' ).remove(); - } else { - if ( location.indexOf( ':taxonomy:' ) > 0 ) { - locationType = 'taxonomy'; - } else { - locationType = location.substr( 0, location.indexOf( ':' ) ); - } - - var locationID = location.substr( location.lastIndexOf( ':' ) + 1 ); - - if ( 'taxonomy' === locationType || 'post' === locationType ) { - if ( ! ( '.generate-element-row-loading' ).length ) { - select.closest( '.generate-element-row-content' ).prepend( '
' ); - } - - var fillObjects = function( response ) { - var objects = response[ locationID ].objects; - - var blank = { - id: '', - name: 'All ' + response[ locationID ].label, - }; - - if ( location.indexOf( ':taxonomy:' ) > 0 ) { - blank.name = elements.choose; - } - - objectSelect.empty(); - - objectSelect.append( $( '' ); - objectSelect.val( '0' ); - } - } - }; - - $( '.condition select.condition-select' ).on( 'change', function() { - getLocationObjects( $( this ) ); - - $( '.elements-no-location-error' ).hide(); - } ); - - var postObjects = []; - var termObjects = []; - - $( '.generate-elements-rule-objects-visible' ).each( function() { - var _this = $( this ), - select = _this.find( 'select.condition-select' ), - location = select.val(), - locationID = location.substr( location.lastIndexOf( ':' ) + 1 ), - locationType = ''; - - if ( location.indexOf( ':taxonomy:' ) > 0 ) { - locationType = 'taxonomy'; - } else { - locationType = location.substr( 0, location.indexOf( ':' ) ); - } - - if ( 'post' === locationType ) { - if ( ! postObjects.includes( locationID ) ) { - postObjects.push( locationID ); - } - } else if ( 'taxonomy' === locationType && ! termObjects.includes( locationID ) ) { - termObjects.push( locationID ); - } - } ); - - if ( postObjects.length > 0 || termObjects.length > 0 ) { - $.post( ajaxurl, { - action: 'generate_elements_get_location_objects', - posts: postObjects, - terms: termObjects, - nonce: elements.nonce, - }, function( response ) { - response = JSON.parse( response ); - - $( '.generate-elements-rule-objects-visible' ).each( function() { - var _this = $( this ), - select = _this.find( 'select.condition-select' ); - - $( '
' ).insertBefore( _this ); - - getLocationObjects( select, true, response ); - } ); - } ); - } - - $( '.set-featured-image a, .change-featured-image a:not(.remove-image)' ).on( 'click', function( event ) { - event.preventDefault(); - - // Stop propagation to prevent thickbox from activating. - event.stopPropagation(); - - // Open the featured image modal - wp.media.featuredImage.frame().open(); - } ); - - wp.media.featuredImage.frame().on( 'select', function() { - $( '.set-featured-image' ).hide(); - $( '.change-featured-image' ).show(); - - setTimeout( function() { - $( '.image-preview' ).empty(); - $( '#postimagediv img' ).appendTo( '.image-preview' ); - }, 500 ); - } ); - - $( '#postimagediv' ).on( 'click', '#remove-post-thumbnail', function() { - $( '.set-featured-image' ).show(); - $( '.change-featured-image' ).hide(); - $( '.image-preview' ).empty(); - return false; - } ); - - $( '.remove-image' ).on( 'click', function( e ) { - e.preventDefault(); - - $( '#remove-post-thumbnail' ).trigger( 'click' ); - } ); - - $( '.generate-upload-file' ).on( 'click', function() { - if ( frame ) { - frame.open(); - return; - } - - var _this = $( this ), - container = _this.closest( '.media-container' ); - - var frame = wp.media( { - title: _this.data( 'title' ), - multiple: false, - library: { type: _this.data( 'type' ) }, - button: { text: _this.data( 'insert' ) }, - } ); - - frame.on( 'select', function() { - var attachment = frame.state().get( 'selection' ).first().toJSON(); - - container.find( '.media-field' ).val( attachment.id ); - container.find( '.remove-field' ).show(); - - if ( _this.data( 'preview' ) ) { - container.find( '.gp-media-preview' ).empty().append( '' ).show(); - } - } ); - - frame.open(); - } ); - - $( '.remove-field' ).on( 'click', function() { - var _this = $( this ), - container = _this.closest( '.media-container' ); - - _this.hide(); - container.find( '.media-field' ).val( '' ); - container.find( '.gp-media-preview' ).empty(); - } ); - - $( '#_generate_hero_background_image' ).on( 'change', function() { - var _this = $( this ); - - if ( '' !== _this.val() ) { - $( '.requires-background-image' ).show(); - } else { - $( '.requires-background-image' ).hide(); - } - - if ( 'featured-image' === _this.val() ) { - $( '.image-text' ).text( elements.fallback_image ); - } - - if ( 'custom-image' === _this.val() ) { - $( '.image-text' ).text( elements.custom_image ); - } - } ); - - // Responsive controls in our settings. - $( '.responsive-controls a' ).on( 'click', function( e ) { - e.preventDefault(); - - var _this = $( this ), - control = _this.attr( 'data-control' ), - controlArea = _this.closest( '.generate-element-row-content' ); - - controlArea.find( '.padding-container' ).hide(); - controlArea.find( '.padding-container.' + control ).show(); - _this.siblings().removeClass( 'is-selected' ); - _this.addClass( 'is-selected' ); - } ); - - $( '#_generate_site_header_merge' ).on( 'change', function() { - var _this = $( this ); - - if ( '' !== _this.val() ) { - $( '.requires-header-merge' ).show(); - - if ( $( '#_generate_navigation_colors' ).is( ':checked' ) ) { - $( '.requires-navigation-colors' ).show(); - } - - if ( $( '#_generate_hero_full_screen' ).is( ':checked' ) ) { - $( '.requires-full-screen' ).show(); - } - } else { - $( '.requires-header-merge' ).hide(); - $( '.requires-navigation-colors' ).hide(); - $( '.requires-full-screen' ).hide(); - } - } ); - - $( '#_generate_navigation_colors' ).on( 'change', function() { - var _this = $( this ); - - if ( _this.is( ':checked' ) ) { - $( '.requires-navigation-colors' ).show(); - } else { - $( '.requires-navigation-colors' ).hide(); - } - } ); - - $( '#_generate_hero_full_screen' ).on( 'change', function() { - var _this = $( this ); - - if ( _this.is( ':checked' ) ) { - $( '.requires-full-screen' ).show(); - } else { - $( '.requires-full-screen' ).hide(); - } - } ); - - $( '#_generate_hero_background_parallax' ).on( 'change', function() { - var _this = $( this ); - - if ( _this.is( ':checked' ) ) { - $( '#_generate_hero_background_position' ).val( '' ).change(); - $( '#_generate_hero_background_position option[value="left center"]' ).attr( 'disabled', true ); - $( '#_generate_hero_background_position option[value="left bottom"]' ).attr( 'disabled', true ); - $( '#_generate_hero_background_position option[value="right center"]' ).attr( 'disabled', true ); - $( '#_generate_hero_background_position option[value="right bottom"]' ).attr( 'disabled', true ); - $( '#_generate_hero_background_position option[value="center center"]' ).attr( 'disabled', true ); - $( '#_generate_hero_background_position option[value="center bottom"]' ).attr( 'disabled', true ); - } else { - $( '#_generate_hero_background_position option[value="left center"]' ).attr( 'disabled', false ); - $( '#_generate_hero_background_position option[value="left bottom"]' ).attr( 'disabled', false ); - $( '#_generate_hero_background_position option[value="right center"]' ).attr( 'disabled', false ); - $( '#_generate_hero_background_position option[value="right bottom"]' ).attr( 'disabled', false ); - $( '#_generate_hero_background_position option[value="center center"]' ).attr( 'disabled', false ); - $( '#_generate_hero_background_position option[value="center bottom"]' ).attr( 'disabled', false ); - } - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/spinner.gif b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/spinner.gif deleted file mode 100644 index 209d10b6..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/admin/spinner.gif and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/js/parallax.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/js/parallax.js deleted file mode 100644 index a4540e52..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/js/parallax.js +++ /dev/null @@ -1,17 +0,0 @@ -function generate_parallax_element( selector, context ) { - context = context || document; - var elements = context.querySelectorAll( selector ); - return Array.prototype.slice.call( elements ); -} - -window.addEventListener( "scroll", function() { - var scrolledHeight= window.pageYOffset; - generate_parallax_element( ".page-hero" ).forEach( function( el, index, array ) { - var limit = el.offsetTop + el.offsetHeight; - if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) { - el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / hero.parallax + "px"; - } else { - el.style.backgroundPositionY = "0"; - } - }); -}); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/js/parallax.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/js/parallax.min.js deleted file mode 100644 index f1918424..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/assets/js/parallax.min.js +++ /dev/null @@ -1 +0,0 @@ -function generate_parallax_element(e,o){var t=(o=o||document).querySelectorAll(e);return Array.prototype.slice.call(t)}window.addEventListener("scroll",function(){var r=window.pageYOffset;generate_parallax_element(".page-hero").forEach(function(e,o,t){var a=e.offsetTop+e.offsetHeight;r>e.offsetTop&&r<=a?e.style.backgroundPositionY=(r-e.offsetTop)/hero.parallax+"px":e.style.backgroundPositionY="0"})}); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-block-elements.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-block-elements.php deleted file mode 100644 index 4e2b73de..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-block-elements.php +++ /dev/null @@ -1,1789 +0,0 @@ - true, - ) - ) - ); - - $parent_elements = get_posts( - array( - 'post_type' => 'gp_elements', - 'post_parent' => 0, - 'no_found_rows' => true, - 'post_status' => 'publish', - 'numberposts' => 100, - 'fields' => 'ids', - 'exclude' => array( get_the_ID() ), - 'meta_query' => array( - array( - 'key' => '_generate_block_type', - 'value' => 'content-template', - 'compare' => '=', - ), - ), - ) - ); - - $parent_elements_data = array(); - - foreach ( (array) $parent_elements as $element ) { - $parent_elements_data[] = array( - 'label' => get_the_title( $element ), - 'id' => $element, - ); - } - - $image_sizes = get_intermediate_image_sizes(); - $image_sizes = array_diff( $image_sizes, array( '1536x1536', '2048x2048' ) ); - $image_sizes[] = 'full'; - - $containerWidth = function_exists( 'generate_get_option' ) ? generate_get_option( 'container_width' ) : 1100; - $rightSidebarWidth = apply_filters( 'generate_right_sidebar_width', '25' ); - $leftSidebarWidth = apply_filters( 'generate_left_sidebar_width', '25' ); - - $containerWidth = floatval( $containerWidth ); - $leftSidebarWidth = '0.' . $leftSidebarWidth; - $rightSidebarWidth = '0.' . $rightSidebarWidth; - - $leftSidebarWidth = $containerWidth - ( $containerWidth * $leftSidebarWidth ); - $rightSidebarWidth = $containerWidth - ( $containerWidth * $rightSidebarWidth ); - - $leftSidebarWidth = $containerWidth - $leftSidebarWidth; - $rightSidebarWidth = $containerWidth - $rightSidebarWidth; - - $contentWidth = $containerWidth - $rightSidebarWidth; - - wp_localize_script( - 'gp-premium-block-elements', - 'gpPremiumBlockElements', - array( - 'isBlockElement' => 'gp_elements' === get_post_type(), - 'taxonomies' => $taxonomies, - 'rightSidebarWidth' => $rightSidebarWidth, - 'leftSidebarWidth' => $leftSidebarWidth, - 'contentWidth' => $contentWidth, - 'hooks' => GeneratePress_Elements_Helper::get_available_hooks(), - 'excerptLength' => apply_filters( 'excerpt_length', 55 ), // phpcs:ignore -- Core filter. - 'isGenerateBlocksActive' => function_exists( 'generateblocks_load_plugin_textdomain' ), - 'isGenerateBlocksInstalled' => file_exists( WP_PLUGIN_DIR . '/generateblocks/plugin.php' ) ? true : false, - 'isGenerateBlocksProActive' => function_exists( 'generateblocks_pro_init' ), - 'installLink' => wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=generateblocks' ), 'install-plugin_generateblocks' ), - 'activateLink' => wp_nonce_url( 'plugins.php?action=activate&plugin=generateblocks/plugin.php&plugin_status=all&paged=1&s', 'activate-plugin_generateblocks/plugin.php' ), - 'imageSizes' => $image_sizes, - 'imageSizeDimensions' => $this->get_image_Sizes(), - 'featuredImagePlaceholder' => GP_PREMIUM_DIR_URL . 'elements/assets/admin/featured-image-placeholder.png', - 'authorImagePlaceholder' => GP_PREMIUM_DIR_URL . 'elements/assets/admin/author-image-placeholder.png', - 'bgImageFallback' => GP_PREMIUM_DIR_URL . 'elements/assets/admin/background-image-fallback.jpg', - 'templateImageUrl' => 'https://gpsites.co/files/element-library', - 'parentElements' => $parent_elements_data, - ) - ); - - wp_enqueue_style( - 'gp-premium-block-elements', - GP_PREMIUM_DIR_URL . 'dist/block-elements.css', - array( 'wp-edit-blocks' ), - filemtime( GP_PREMIUM_DIR_PATH . 'dist/block-elements.css' ) - ); - } - - /** - * Add our block category. - * - * @param array $categories The existing categories. - */ - public function add_block_category( $categories ) { - return array_merge( - array( - array( - 'slug' => 'generatepress', - 'title' => __( 'GeneratePress', 'gp-premium' ), - ), - ), - $categories - ); - } - - /** - * Register our dynamic blocks. - */ - public function register_dynamic_blocks() { - if ( ! function_exists( 'register_block_type' ) ) { - return; - } - - register_block_type( - 'generatepress/dynamic-content', - array( - 'render_callback' => array( $this, 'do_dynamic_content_block' ), - 'attributes' => array( - 'contentType' => array( - 'type' => 'string', - 'default' => '', - ), - 'excerptLength' => array( - 'type' => 'number', - 'default' => apply_filters( 'excerpt_length', 55 ), // phpcs:ignore -- Core filter. - ), - 'useThemeMoreLink' => array( - 'type' => 'boolean', - 'defaut' => true, - ), - 'customMoreLink' => array( - 'type' => 'string', - 'default' => '', - ), - ), - ) - ); - - register_block_type( - 'generatepress/dynamic-image', - array( - 'render_callback' => array( $this, 'do_dynamic_image_block' ), - 'attributes' => array( - 'imageType' => array( - 'type' => 'string', - 'default' => '', - ), - 'imageSource' => array( - 'type' => 'string', - 'default' => 'current-post', - ), - 'customField' => array( - 'type' => 'string', - 'default' => '', - ), - 'gpDynamicSourceInSameTerm' => array( - 'type' => 'boolean', - 'default' => false, - ), - 'gpDynamicSourceInSameTermTaxonomy' => array( - 'tyoe' => 'string', - 'default' => 'category', - ), - 'imageSize' => array( - 'type' => 'string', - 'default' => 'full', - ), - 'linkTo' => array( - 'type' => 'string', - 'default' => '', - ), - 'linkToCustomField' => array( - 'type' => 'string', - 'default' => '', - ), - 'imageWidth' => array( - 'type' => 'number', - 'default' => null, - ), - 'imageHeight' => array( - 'type' => 'number', - 'default' => null, - ), - 'avatarSize' => array( - 'type' => 'number', - 'default' => 30, - ), - 'avatarRounded' => array( - 'type' => 'boolean', - 'default' => false, - ), - ), - ) - ); - } - - /** - * Do our dynamic content block. - * - * @param array $attributes The attributes from this block. - */ - public function do_dynamic_content_block( $attributes ) { - if ( empty( $attributes['contentType'] ) ) { - return; - } - - if ( 'post-content' === $attributes['contentType'] ) { - return $this->do_content_block(); - } - - if ( 'post-excerpt' === $attributes['contentType'] ) { - return $this->do_excerpt_block( $attributes ); - } - - if ( 'term-description' === $attributes['contentType'] ) { - return sprintf( - '
%s
', - term_description() - ); - } - - if ( 'author-description' === $attributes['contentType'] ) { - return sprintf( - '
%s
', - get_the_author_meta( 'description' ) - ); - } - } - - /** - * Build our content block. - */ - public function do_content_block() { - // Prevents infinite loops while in the editor or autosaving. - $nonpublic_post_types = array( - 'gp_elements', - 'revision', - ); - - if ( ! in_array( get_post_type(), $nonpublic_post_types ) && ! is_admin() ) { - return sprintf( - '
%s
', - apply_filters( 'the_content', str_replace( ']]>', ']]>', get_the_content() ) ) // phpcs:ignore -- Core filter. - ); - } - } - - /** - * Build our excerpt block. - * - * @param array $attributes The block attributes. - */ - public function do_excerpt_block( $attributes ) { - if ( version_compare( PHP_VERSION, '5.6', '>=' ) ) { - $filter_excerpt_length = function( $length ) use ( $attributes ) { - return isset( $attributes['excerptLength'] ) ? $attributes['excerptLength'] : $length; - }; - - add_filter( - 'excerpt_length', - $filter_excerpt_length, - 100 - ); - - if ( isset( $attributes['useThemeMoreLink'] ) && ! $attributes['useThemeMoreLink'] ) { - $filter_more_text = function() use ( $attributes ) { - if ( empty( $attributes['customMoreLink'] ) ) { - return ' ...'; - } - - return apply_filters( - 'generate_excerpt_block_more_output', - sprintf( - ' ... %3$s', - the_title_attribute( 'echo=0' ), - esc_url( get_permalink( get_the_ID() ) ), - wp_kses_post( $attributes['customMoreLink'] ), - sprintf( - /* translators: Aria-label describing the read more button */ - _x( 'More on %s', 'more on post title', 'gp-premium' ), - the_title_attribute( 'echo=0' ) - ) - ) - ); - }; - - add_filter( - 'excerpt_more', - $filter_more_text, - 100 - ); - } - } - - if ( 'gp_elements' === get_post_type() || is_admin() ) { - $post = get_posts( - array( - 'post_type' => 'post', - 'numberposts' => 1, - ) - ); - - if ( ! empty( $post[0] ) ) { - return sprintf( - '
%s
', - apply_filters( 'the_excerpt', get_the_excerpt( $post[0]->ID ) ) // phpcs:ignore -- Core filter. - ); - } else { - return sprintf( - '

%s

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar ligula augue, quis bibendum tellus scelerisque venenatis. Pellentesque porta nisi mi. In hac habitasse platea dictumst. Etiam risus elit, molestie non volutpat ac, pellentesque sed eros. Nunc leo odio, sodales non tortor at, porttitor posuere dui.

', - __( 'This is a placeholder for your content.', 'gp-premium' ) - ); - } - } - - $excerpt = apply_filters( 'the_excerpt', get_the_excerpt() ); // phpcs:ignore -- Core filter. - - if ( isset( $filter_excerpt_length ) ) { - remove_filter( - 'excerpt_length', - $filter_excerpt_length, - 100 - ); - } - - if ( isset( $filter_more_text ) ) { - remove_filter( - 'excerpt_more', - $filter_more_text, - 100 - ); - } - - return sprintf( - '
%s
', - $excerpt - ); - } - - /** - * Build our dynamic image block. - * - * @param array $attributes The block attributes. - */ - public function do_dynamic_image_block( $attributes ) { - if ( empty( $attributes['imageType'] ) ) { - return; - } - - if ( 'featured-image' === $attributes['imageType'] ) { - $image_source = ! empty( $attributes['imageSource'] ) ? $attributes['imageSource'] : 'current-post'; - $id = $this->get_source_id( $image_source, $attributes ); - - if ( ! $id ) { - return; - } - - if ( has_post_thumbnail( $id ) ) { - $size = ! empty( $attributes['imageSize'] ) ? $attributes['imageSize'] : 'full'; - $featured_image_classes = array( 'dynamic-featured-image' ); - - if ( ! empty( $attributes['className'] ) ) { - $featured_image_classes[] = $attributes['className']; - } - - $featured_image = get_the_post_thumbnail( $id, $size, array( 'class' => implode( ' ', $featured_image_classes ) ) ); - - // We can't alter the width/height generated by get_the_post_thumbnail(), so we need to resort to this. - if ( ! empty( $attributes['imageWidth'] ) ) { - $featured_image = preg_replace( '/width=[\"\'][0-9]+[\"\']/i', 'width="' . absint( $attributes['imageWidth'] ) . '"', $featured_image ); - } - - if ( ! empty( $attributes['imageHeight'] ) ) { - $featured_image = preg_replace( '/height=[\"\'][0-9]+[\"\']/i', 'height="' . absint( $attributes['imageHeight'] ) . '"', $featured_image ); - } - - if ( $featured_image ) { - if ( ! empty( $attributes['linkTo'] ) ) { - if ( 'single-post' === $attributes['linkTo'] ) { - $featured_image = sprintf( - '%s', - esc_url( get_permalink( $id ) ), - $featured_image - ); - } - - if ( 'custom-field' === $attributes['linkTo'] ) { - $custom_field = get_post_meta( $id, $attributes['linkToCustomField'], true ); - - if ( $custom_field ) { - $featured_image = sprintf( - '%s', - esc_url( $custom_field ), - $featured_image - ); - } - } - } - - return $featured_image; - } - } - } - - if ( 'post-meta' === $attributes['imageType'] ) { - $image_source = ! empty( $attributes['imageSource'] ) ? $attributes['imageSource'] : 'current-post'; - $id = $this->get_source_id( $image_source, $attributes ); - - if ( ! $id ) { - return; - } - - $image_field_name = ! empty( $attributes['customField'] ) ? $attributes['customField'] : ''; - - if ( $image_field_name ) { - $image = get_post_meta( $id, $image_field_name, true ); - - if ( ctype_digit( $image ) ) { - $size = ! empty( $attributes['imageSize'] ) ? $attributes['imageSize'] : 'full'; - $image_output = wp_get_attachment_image( $image, $size, false, array( 'class' => 'dynamic-meta-image' ) ); - - // We can't alter the width/height generated by get_the_post_thumbnail(), so we need to resort to this. - if ( ! empty( $attributes['imageWidth'] ) ) { - $image_output = preg_replace( '/width=[\"\'][0-9]+[\"\']/i', 'width="' . absint( $attributes['imageWidth'] ) . '"', $image_output ); - } - - if ( ! empty( $attributes['imageHeight'] ) ) { - $image_output = preg_replace( '/height=[\"\'][0-9]+[\"\']/i', 'height="' . absint( $attributes['imageHeight'] ) . '"', $image_output ); - } - } else { - $image_output = apply_filters( - 'generate_dynamic_custom_field_image', - sprintf( - '', - $image, - ! empty( $attributes['imageWidth'] ) ? absint( $attributes['imageWidth'] ) : '', - ! empty( $attributes['imageHeight'] ) ? absint( $attributes['imageHeight'] ) : '' - ) - ); - } - - if ( ! empty( $image_output ) ) { - if ( ! empty( $attributes['linkTo'] ) ) { - if ( 'single-post' === $attributes['linkTo'] ) { - $image_output = sprintf( - '%s', - esc_url( get_permalink( $id ) ), - $image_output - ); - } - - if ( 'custom-field' === $attributes['linkTo'] ) { - $custom_field = get_post_meta( $id, $attributes['linkToCustomField'], true ); - - if ( $custom_field ) { - $image_output = sprintf( - '%s', - esc_url( $custom_field ), - $image_output - ); - } - } - } - - return $image_output; - } - } - } - - if ( 'author-avatar' === $attributes['imageType'] ) { - global $post; - $author_id = $post->post_author; - $size = ! empty( $attributes['avatarSize'] ) ? $attributes['avatarSize'] : 30; - $image_alt = apply_filters( 'generate_dynamic_author_image_alt', __( 'Photo of author', 'gp-premium' ) ); - - $classes = array( - 'dynamic-author-image', - ); - - if ( ! empty( $attributes['avatarRounded'] ) ) { - $classes[] = 'dynamic-author-image-rounded'; - } - - $avatar = get_avatar( - $author_id, - $size, - '', - esc_attr( $image_alt ), - array( - 'class' => implode( ' ', $classes ), - ) - ); - - if ( $avatar ) { - return $avatar; - } - } - } - - /** - * Get our dynamic URL. - * - * @param string $link_type The kind of link to add. - * @param string $source The source of the dynamic data. - * @param array $block The block we're working with. - */ - public function get_dynamic_url( $link_type, $source, $block ) { - $id = $this->get_source_id( $source, $block['attrs'] ); - $author_id = $this->get_author_id( $source, $block['attrs'] ); - $url = ''; - - if ( 'single-post' === $link_type ) { - $url = get_permalink( $id ); - } - - if ( isset( $block['attrs']['gpDynamicLinkCustomField'] ) ) { - if ( 'post-meta' === $link_type ) { - $url = get_post_meta( $id, $block['attrs']['gpDynamicLinkCustomField'], true ); - } - - if ( 'user-meta' === $link_type ) { - $url = $this->get_user_data( $author_id, $block['attrs']['gpDynamicLinkCustomField'] ); - } - - if ( 'term-meta' === $link_type ) { - $url = get_term_meta( get_queried_object_id(), $block['attrs']['gpDynamicLinkCustomField'], true ); - } - } - - if ( 'author-archives' === $link_type ) { - $url = get_author_posts_url( $author_id ); - } - - if ( 'comments' === $link_type ) { - $url = get_comments_link( $id ); - } - - if ( 'next-posts' === $link_type ) { - global $paged, $wp_query; - - $max_page = 0; - - if ( ! $max_page ) { - $max_page = $wp_query->max_num_pages; - } - - $paged_num = isset( $paged ) && $paged ? $paged : 1; - $nextpage = (int) $paged_num + 1; - - if ( ! is_single() && ( $nextpage <= $max_page ) ) { - $url = next_posts( $max_page, false ); - } - } - - if ( 'previous-posts' === $link_type ) { - global $paged; - - if ( ! is_single() && (int) $paged > 1 ) { - $url = previous_posts( false ); - } - } - - return apply_filters( 'generate_dynamic_element_url', $url, $link_type, $source, $block ); - } - - /** - * Wrap our dynamic text in a link. - * - * @param string $text The text to wrap. - * @param string $link_type The kind of link to add. - * @param string $source The source of the dynamic data. - * @param array $block The block we're working with. - */ - public function add_dynamic_link( $text, $link_type, $source, $block ) { - if ( 'generateblocks/headline' === $block['blockName'] ) { - $url = $this->get_dynamic_url( $link_type, $source, $block ); - - if ( ! $url ) { - return $text; - } - - return sprintf( - '%s', - esc_url( $url ), - $text - ); - } - - if ( 'generateblocks/button' === $block['blockName'] ) { - $url = $this->get_dynamic_url( $link_type, $source, $block ); - - // Since this is a button, we want to scrap the whole block if we don't have a link. - if ( ! $url ) { - return ''; - } - - $dynamic_url = sprintf( - 'href="%s"', - esc_url( $url ) - ); - - return str_replace( 'href="#"', $dynamic_url, $text ); - } - } - - /** - * Get user data. - * - * @since 2.0.0 - * @param int $author_id The ID of the user. - * @param string $field The field to look up. - */ - public function get_user_data( $author_id, $field ) { - $data = get_user_meta( $author_id, $field, true ); - - if ( ! $data ) { - $user_data_names = array( - 'user_nicename', - 'user_email', - 'user_url', - 'display_name', - ); - - if ( in_array( $field, $user_data_names ) ) { - $user_data = get_userdata( $author_id ); - - if ( $user_data ) { - switch ( $field ) { - case 'user_nicename': - $data = $user_data->user_nicename; - break; - - case 'user_email': - $data = $user_data->user_email; - break; - - case 'user_url': - $data = $user_data->user_url; - break; - - case 'display_name': - $data = $user_data->display_name; - break; - } - } - } - } - - return $data; - } - - /** - * Add the dynamic bits to our blocks. - * - * @param string $block_content The block content. - * @param array $block The block info. - */ - public function render_blocks( $block_content, $block ) { - if ( 'gp_elements' === get_post_type() || is_admin() ) { - return $block_content; - } - - if ( 'generateblocks/headline' === $block['blockName'] || 'generateblocks/button' === $block['blockName'] ) { - if ( ! empty( $block['attrs']['gpDynamicTextType'] ) && ! empty( $block['attrs']['gpDynamicTextReplace'] ) ) { - $text_to_replace = $block['attrs']['gpDynamicTextReplace']; - $text_type = $block['attrs']['gpDynamicTextType']; - $link_type = ! empty( $block['attrs']['gpDynamicLinkType'] ) ? $block['attrs']['gpDynamicLinkType'] : ''; - $source = ! empty( $block['attrs']['gpDynamicSource'] ) ? $block['attrs']['gpDynamicSource'] : 'current-post'; - $id = $this->get_source_id( $source, $block['attrs'] ); - - if ( ! $id ) { - return ''; - } - - if ( 'title' === $text_type ) { - $post_title = get_the_title( $id ); - - if ( ! in_the_loop() ) { - if ( is_tax() || is_category() || is_tag() ) { - $post_title = get_queried_object()->name; - } elseif ( is_post_type_archive() ) { - $post_title = post_type_archive_title( '', false ); - } elseif ( is_archive() && function_exists( 'get_the_archive_title' ) ) { - $post_title = get_the_archive_title(); - - if ( is_author() ) { - $post_title = get_the_author(); - } - } elseif ( is_home() ) { - $page_for_posts = get_option( 'page_for_posts' ); - - if ( ! empty( $page_for_posts ) ) { - $post_title = get_the_title( $page_for_posts ); - } else { - $post_title = __( 'Blog', 'gp-premium' ); - } - } - } - - $post_title = apply_filters( 'generate_dynamic_element_text', $post_title, $block ); - - if ( $link_type ) { - $post_title = $this->add_dynamic_link( $post_title, $link_type, $source, $block ); - } - - if ( ! empty( $block['attrs']['gpDynamicTextBefore'] ) ) { - $post_title = $block['attrs']['gpDynamicTextBefore'] . $post_title; - } - - $post_title = apply_filters( 'generate_dynamic_element_text_output', $post_title, $block ); - $block_content = str_replace( $text_to_replace, $post_title, $block_content ); - } - - if ( 'post-date' === $text_type ) { - $updated_time = get_the_modified_time( 'U', $id ); - $published_time = get_the_time( 'U', $id ) + 1800; - - $post_date = sprintf( - '', - esc_attr( get_the_date( 'c', $id ) ), - esc_html( get_the_date( '', $id ) ) - ); - - $is_updated_date = isset( $block['attrs']['gpDynamicDateType'] ) && 'updated-date' === $block['attrs']['gpDynamicDateType']; - - if ( ! empty( $block['attrs']['gpDynamicDateUpdated'] ) || $is_updated_date ) { - if ( $updated_time > $published_time ) { - $post_date = sprintf( - '', - esc_attr( get_the_modified_date( 'c', $id ) ), - esc_html( get_the_modified_date( '', $id ) ) - ); - } elseif ( $is_updated_date ) { - // If we're showing the updated date but no updated date exists, don't display anything. - return ''; - } - } - - $post_date = apply_filters( 'generate_dynamic_element_text', $post_date, $block ); - - if ( $link_type ) { - $post_date = $this->add_dynamic_link( $post_date, $link_type, $source, $block ); - } - - $before_text = ''; - - if ( ! empty( $block['attrs']['gpDynamicTextBefore'] ) ) { - $before_text = $block['attrs']['gpDynamicTextBefore']; - } - - // Use the updated date before text if we're set to replace the published date with updated date. - if ( ! empty( $block['attrs']['gpDynamicUpdatedDateBefore'] ) && ! empty( $block['attrs']['gpDynamicDateUpdated'] ) && $updated_time > $published_time ) { - $before_text = $block['attrs']['gpDynamicUpdatedDateBefore']; - } - - if ( ! empty( $before_text ) ) { - $post_date = $before_text . $post_date; - } - - $post_date = apply_filters( 'generate_dynamic_element_text_output', $post_date, $block ); - $block_content = str_replace( $text_to_replace, $post_date, $block_content ); - } - - if ( 'post-author' === $text_type ) { - $author_id = $this->get_author_id( $source, $block['attrs'] ); - $post_author = get_the_author_meta( 'display_name', $author_id ); - $post_author = apply_filters( 'generate_dynamic_element_text', $post_author, $block ); - - if ( empty( $post_author ) ) { - return ''; - } - - if ( $link_type ) { - $post_author = $this->add_dynamic_link( $post_author, $link_type, $source, $block ); - } - - if ( ! empty( $block['attrs']['gpDynamicTextBefore'] ) ) { - $post_author = $block['attrs']['gpDynamicTextBefore'] . $post_author; - } - - $post_author = apply_filters( 'generate_dynamic_element_text_output', $post_author, $block ); - $block_content = str_replace( $text_to_replace, $post_author, $block_content ); - } - - if ( 'terms' === $text_type && 'generateblocks/headline' === $block['blockName'] ) { - if ( ! empty( $block['attrs']['gpDynamicTextTaxonomy'] ) ) { - $terms = get_the_terms( $id, $block['attrs']['gpDynamicTextTaxonomy'] ); - - if ( is_wp_error( $terms ) ) { - return $block_content; - } - - $term_items = array(); - - foreach ( (array) $terms as $term ) { - if ( ! isset( $term->name ) ) { - continue; - } - - if ( 'term-archives' === $link_type ) { - $term_link = get_term_link( $term, $block['attrs']['gpDynamicTextTaxonomy'] ); - - if ( ! is_wp_error( $term_link ) ) { - $term_items[] = sprintf( - '%2$s', - esc_url( get_term_link( $term, $block['attrs']['gpDynamicTextTaxonomy'] ) ), - $term->name, - $term->slug - ); - } - } else { - $term_items[] = sprintf( - '%1$s', - $term->name, - $term->slug - ); - } - } - - if ( empty( $term_items ) ) { - return ''; - } - - $sep = isset( $block['attrs']['gpDynamicTextTaxonomySeparator'] ) ? $block['attrs']['gpDynamicTextTaxonomySeparator'] : ', '; - $term_output = implode( $sep, $term_items ); - - if ( ! empty( $block['attrs']['gpDynamicTextBefore'] ) ) { - $term_output = $block['attrs']['gpDynamicTextBefore'] . $term_output; - } - - $term_output = apply_filters( 'generate_dynamic_element_text_output', $term_output, $block ); - $block_content = str_replace( $text_to_replace, $term_output, $block_content ); - } else { - return ''; - } - } - - if ( 'comments-number' === $text_type ) { - if ( ! post_password_required( $id ) && ( comments_open( $id ) || get_comments_number( $id ) ) ) { - if ( ! isset( $block['attrs']['gpDynamicNoCommentsText'] ) ) { - $block['attrs']['gpDynamicNoCommentsText'] = __( 'No Comments', 'gp-premium' ); - } - - if ( '' === $block['attrs']['gpDynamicNoCommentsText'] && get_comments_number( $id ) < 1 ) { - return ''; - } - - $comments_text = get_comments_number_text( - $block['attrs']['gpDynamicNoCommentsText'], - ! empty( $block['attrs']['gpDynamicSingleCommentText'] ) ? $block['attrs']['gpDynamicSingleCommentText'] : __( '1 Comment', 'gp-premium' ), - ! empty( $block['attrs']['gpDynamicMultipleCommentsText'] ) ? $block['attrs']['gpDynamicMultipleCommentsText'] : __( '% Comments', 'gp-premium' ) - ); - - $comments_text = apply_filters( 'generate_dynamic_element_text', $comments_text, $block ); - - if ( '' === $comments_text ) { - return ''; - } - - if ( $link_type ) { - $comments_text = $this->add_dynamic_link( $comments_text, $link_type, $source, $block ); - } - - if ( ! empty( $block['attrs']['gpDynamicTextBefore'] ) ) { - $comments_text = $block['attrs']['gpDynamicTextBefore'] . $comments_text; - } - - $comments_text = apply_filters( 'generate_dynamic_element_text_output', $comments_text, $block ); - $block_content = str_replace( $text_to_replace, $comments_text, $block_content ); - } else { - return ''; - } - } - - if ( 'post-meta' === $text_type || 'term-meta' === $text_type || 'user-meta' === $text_type ) { - if ( ! empty( $block['attrs']['gpDynamicTextCustomField'] ) ) { - $custom_field = get_post_meta( $id, $block['attrs']['gpDynamicTextCustomField'], true ); - - if ( 'term-meta' === $text_type ) { - $custom_field = get_term_meta( get_queried_object_id(), $block['attrs']['gpDynamicTextCustomField'], true ); - } - - if ( 'user-meta' === $text_type ) { - $author_id = $this->get_author_id( $source, $block['attrs'] ); - $custom_field = $this->get_user_data( $author_id, $block['attrs']['gpDynamicTextCustomField'] ); - } - - $custom_field = apply_filters( 'generate_dynamic_element_text', $custom_field, $block ); - - if ( $custom_field ) { - if ( $link_type ) { - $custom_field = $this->add_dynamic_link( $custom_field, $link_type, $source, $block ); - } - - if ( ! empty( $block['attrs']['gpDynamicTextBefore'] ) ) { - $custom_field = $block['attrs']['gpDynamicTextBefore'] . $custom_field; - } - - add_filter( 'wp_kses_allowed_html', [ 'GeneratePress_Elements_Helper', 'expand_allowed_html' ], 10, 2 ); - $custom_field = wp_kses_post( $custom_field ); - remove_filter( 'wp_kses_allowed_html', [ 'GeneratePress_Elements_Helper', 'expand_allowed_html' ], 10, 2 ); - - $custom_field = apply_filters( 'generate_dynamic_element_text_output', $custom_field, $block ); - $block_content = str_replace( $text_to_replace, $custom_field, $block_content ); - } else { - $block_content = ''; - } - } else { - $block_content = ''; - } - } - } - } - - if ( 'generateblocks/button' === $block['blockName'] ) { - $link_type = ! empty( $block['attrs']['gpDynamicLinkType'] ) ? $block['attrs']['gpDynamicLinkType'] : ''; - - if ( ! empty( $link_type ) && 'term-archives' !== $link_type ) { - $source = ! empty( $block['attrs']['gpDynamicSource'] ) ? $block['attrs']['gpDynamicSource'] : 'current-post'; - $id = $this->get_source_id( $source, $block['attrs'] ); - - if ( ! $id ) { - return ''; - } - - if ( $link_type ) { - $block_content = $this->add_dynamic_link( $block_content, $link_type, $source, $block ); - } - } - - if ( ! empty( $block['attrs']['gpDynamicTextType'] ) && ! empty( $block['attrs']['gpDynamicTextReplace'] ) ) { - $text_to_replace = $block['attrs']['gpDynamicTextReplace']; - $text_type = $block['attrs']['gpDynamicTextType']; - $link_type = ! empty( $block['attrs']['gpDynamicLinkType'] ) ? $block['attrs']['gpDynamicLinkType'] : ''; - $source = ! empty( $block['attrs']['gpDynamicSource'] ) ? $block['attrs']['gpDynamicSource'] : 'current-post'; - $id = $this->get_source_id( $source, $block['attrs'] ); - - if ( ! $id ) { - return ''; - } - - if ( 'terms' === $text_type ) { - if ( ! empty( $block['attrs']['gpDynamicTextTaxonomy'] ) ) { - $terms = get_the_terms( $id, $block['attrs']['gpDynamicTextTaxonomy'] ); - - if ( is_wp_error( $terms ) ) { - return ''; - } - - $term_buttons = array(); - - foreach ( (array) $terms as $term ) { - if ( ! isset( $term->name ) ) { - continue; - } - - $term_button = str_replace( $text_to_replace, $term->name, $block_content ); - - if ( isset( $term->slug ) ) { - $term_button = str_replace( 'dynamic-term-class', 'post-term-item term-' . $term->slug, $term_button ); - } - - if ( 'term-archives' === $link_type ) { - $term_link = get_term_link( $term, $block['attrs']['gpDynamicTextTaxonomy'] ); - - if ( ! is_wp_error( $term_link ) ) { - $term_url = sprintf( - 'href="%s"', - esc_url( $term_link ) - ); - - $term_button = str_replace( 'href="#"', $term_url, $term_button ); - } - } - - $term_buttons[] = $term_button; - } - - if ( empty( $term_buttons ) ) { - return ''; - } - - $block_content = implode( '', $term_buttons ); - } else { - return ''; - } - } - } - } - - if ( 'generateblocks/container' === $block['blockName'] ) { - if ( ! empty( $block['attrs']['gpRemoveContainerCondition'] ) ) { - $in_same_term = ! empty( $block['attrs']['gpAdjacentPostInSameTerm'] ) ? true : false; - $term_taxonomy = ! empty( $block['attrs']['gpAdjacentPostInSameTermTax'] ) ? $block['attrs']['gpAdjacentPostInSameTermTax'] : 'category'; - - if ( 'no-next-post' === $block['attrs']['gpRemoveContainerCondition'] ) { - $next_post = get_next_post( $in_same_term, '', $term_taxonomy ); - - if ( ! is_object( $next_post ) ) { - if ( ! empty( $block['attrs']['isGrid'] ) && ! empty( $block['attrs']['uniqueId'] ) ) { - return '
'; - } else { - return ''; - } - } - } - - if ( 'no-previous-post' === $block['attrs']['gpRemoveContainerCondition'] ) { - $previous_post = get_previous_post( $in_same_term, '', $term_taxonomy ); - - if ( ! is_object( $previous_post ) ) { - if ( ! empty( $block['attrs']['isGrid'] ) && ! empty( $block['attrs']['uniqueId'] ) ) { - return '
'; - } else { - return ''; - } - } - } - - if ( 'no-featured-image' === $block['attrs']['gpRemoveContainerCondition'] ) { - if ( ! has_post_thumbnail() ) { - return ''; - } - } - - if ( 'no-post-meta' === $block['attrs']['gpRemoveContainerCondition'] && ! empty( $block['attrs']['gpRemoveContainerConditionPostMeta'] ) ) { - $post_meta_check = get_post_meta( get_the_ID(), $block['attrs']['gpRemoveContainerConditionPostMeta'], true ); - - if ( ! $post_meta_check ) { - return ''; - } - } - } elseif ( ! empty( $block['attrs']['url'] ) && ! empty( $block['attrs']['gpDynamicLinkType'] ) ) { - $source = ! empty( $block['attrs']['gpDynamicSource'] ) ? $block['attrs']['gpDynamicSource'] : 'current-post'; - - $id = $this->get_source_id( $source, $block['attrs'] ); - - if ( ! $id ) { - return ''; - } - } - } - - return $block_content; - } - - /** - * Set the featured image as a GB background. - * - * @param string $url The current URL. - * @param array $settings The current settings. - */ - public function set_background_image_url( $url, $settings ) { - if ( ! empty( $settings['gpDynamicImageBg'] ) ) { - $custom_field = ''; - $source = ! empty( $settings['gpDynamicSource'] ) ? $settings['gpDynamicSource'] : 'current-post'; - $id = $this->get_source_id( $source, $settings ); - - if ( ! $id ) { - return ''; - } - - if ( 'post-meta' === $settings['gpDynamicImageBg'] ) { - $custom_field = get_post_meta( $id, $settings['gpDynamicImageCustomField'], true ); - } - - if ( 'term-meta' === $settings['gpDynamicImageBg'] ) { - $custom_field = get_term_meta( get_queried_object_id(), $settings['gpDynamicImageCustomField'], true ); - } - - if ( 'user-meta' === $settings['gpDynamicImageBg'] ) { - $author_id = $this->get_author_id( $source, $settings ); - $custom_field = $this->get_user_data( $author_id, $settings['gpDynamicImageCustomField'] ); - } - - if ( 'featured-image' === $settings['gpDynamicImageBg'] && has_post_thumbnail( $id ) ) { - $image_size = ! empty( $settings['bgImageSize'] ) ? $settings['bgImageSize'] : 'full'; - $url = get_the_post_thumbnail_url( $id, $image_size ); - } elseif ( ! empty( $custom_field ) ) { - if ( is_numeric( $custom_field ) ) { - $image_size = ! empty( $settings['bgImageSize'] ) ? $settings['bgImageSize'] : 'full'; - $url = wp_get_attachment_image_url( $custom_field, $image_size ); - } else { - $url = $custom_field; - } - } elseif ( empty( $settings['gpUseFallbackImageBg'] ) ) { - $url = ''; - } - } - - return $url; - } - - /** - * Set the attributes for our main Container wrapper. - * - * @param array $attributes The existing attributes. - * @param array $settings The settings for the block. - */ - public function set_container_attributes( $attributes, $settings ) { - if ( ! empty( $settings['bgImage'] ) && in_the_loop() ) { - if ( ! empty( $settings['gpDynamicImageBg'] ) ) { - $custom_field = ''; - $source = ! empty( $settings['gpDynamicSource'] ) ? $settings['gpDynamicSource'] : 'current-post'; - $id = $this->get_source_id( $source, $settings ); - - if ( ! $id ) { - return $attributes; - } - - if ( 'post-meta' === $settings['gpDynamicImageBg'] ) { - $custom_field = get_post_meta( $id, $settings['gpDynamicImageCustomField'], true ); - } - - if ( 'term-meta' === $settings['gpDynamicImageBg'] ) { - $custom_field = get_term_meta( get_queried_object_id(), $settings['gpDynamicImageCustomField'], true ); - } - - if ( 'user-meta' === $settings['gpDynamicImageBg'] ) { - $author_id = $this->get_author_id( $source, $settings ); - $custom_field = $this->get_user_data( $author_id, $settings['gpDynamicImageCustomField'] ); - } - - if ( 'featured-image' === $settings['gpDynamicImageBg'] && has_post_thumbnail( $id ) ) { - $image_size = ! empty( $settings['bgImageSize'] ) ? $settings['bgImageSize'] : 'full'; - $url = get_the_post_thumbnail_url( $id, $image_size ); - } elseif ( ! empty( $custom_field ) ) { - if ( is_numeric( $custom_field ) ) { - $image_size = ! empty( $settings['bgImageSize'] ) ? $settings['bgImageSize'] : 'full'; - $url = wp_get_attachment_image_url( $custom_field, $image_size ); - } else { - $url = $custom_field; - } - } elseif ( ! empty( $settings['gpUseFallbackImageBg'] ) ) { - if ( isset( $settings['bgImage']['id'] ) ) { - $image_size = ! empty( $settings['bgImageSize'] ) ? $settings['bgImageSize'] : 'full'; - $image_src = wp_get_attachment_image_src( $settings['bgImage']['id'], $image_size ); - - if ( is_array( $image_src ) ) { - $url = $image_src[0]; - } else { - $url = $settings['bgImage']['image']['url']; - } - } else { - $url = $settings['bgImage']['image']['url']; - } - } - - if ( ! empty( $url ) ) { - $attributes['style'] = '--background-url:url(' . esc_url( $url ) . ')'; - $attributes['class'] .= ' gb-has-dynamic-bg'; - } else { - $attributes['class'] .= ' gb-no-dynamic-bg'; - } - } - } - - if ( ! empty( $settings['gpInlinePostMeta'] ) ) { - $attributes['class'] .= ' inline-post-meta-area'; - } - - return $attributes; - } - - /** - * Set GenerateBlocks defaults. - * - * @param array $defaults The current defaults. - */ - public function set_defaults( $defaults ) { - $defaults['container']['gpInlinePostMeta'] = false; - $defaults['container']['gpInlinePostMetaJustify'] = ''; - $defaults['container']['gpInlinePostMetaJustifyTablet'] = ''; - $defaults['container']['gpInlinePostMetaJustifyMobile'] = ''; - $defaults['container']['gpDynamicImageBg'] = ''; - $defaults['container']['gpDynamicImageCustomField'] = ''; - $defaults['container']['gpDynamicLinkType'] = ''; - $defaults['container']['gpDynamicSource'] = 'current-post'; - $defaults['container']['gpDynamicSourceInSameTerm'] = false; - $defaults['headline']['gpDynamicTextTaxonomy'] = ''; - $defaults['headline']['gpDynamicTextTaxonomySeparator'] = ', '; - - return $defaults; - } - - /** - * Generate our CSS for our options. - * - * @param string $name Name of the block. - * @param array $settings Our available settings. - * @param object $css Current desktop CSS object. - * @param object $desktop_css Current desktop-only CSS object. - * @param object $tablet_css Current tablet CSS object. - * @param object $tablet_only_css Current tablet-only CSS object. - * @param object $mobile_css Current mobile CSS object. - */ - public function generate_css( $name, $settings, $css, $desktop_css, $tablet_css, $tablet_only_css, $mobile_css ) { - if ( 'container' === $name ) { - if ( ! empty( $settings['bgImage'] ) ) { - if ( 'element' === $settings['bgOptions']['selector'] ) { - $css->set_selector( '.gb-container-' . $settings['uniqueId'] . '.gb-has-dynamic-bg' ); - } elseif ( 'pseudo-element' === $settings['bgOptions']['selector'] ) { - $css->set_selector( '.gb-container-' . $settings['uniqueId'] . '.gb-has-dynamic-bg:before' ); - } - - $css->add_property( 'background-image', 'var(--background-url)' ); - - if ( 'element' === $settings['bgOptions']['selector'] ) { - $css->set_selector( '.gb-container-' . $settings['uniqueId'] . '.gb-no-dynamic-bg' ); - } elseif ( 'pseudo-element' === $settings['bgOptions']['selector'] ) { - $css->set_selector( '.gb-container-' . $settings['uniqueId'] . '.gb-no-dynamic-bg:before' ); - } - - $css->add_property( 'background-image', 'none' ); - } - - if ( ! empty( $settings['gpInlinePostMeta'] ) ) { - $css->set_selector( '.gb-container-' . $settings['uniqueId'] . '.inline-post-meta-area > .gb-inside-container' ); - $css->add_property( 'display', 'flex' ); - $css->add_property( 'align-items', 'center' ); - $css->add_property( 'justify-content', $settings['gpInlinePostMetaJustify'] ); - - $tablet_css->set_selector( '.gb-container-' . $settings['uniqueId'] . '.inline-post-meta-area > .gb-inside-container' ); - $tablet_css->add_property( 'justify-content', $settings['gpInlinePostMetaJustifyTablet'] ); - - $mobile_css->set_selector( '.gb-container-' . $settings['uniqueId'] . '.inline-post-meta-area > .gb-inside-container' ); - $mobile_css->add_property( 'justify-content', $settings['gpInlinePostMetaJustifyMobile'] ); - } - } - } - - /** - * Set the attributes for our main Container wrapper. - * - * @param array $attributes The existing attributes. - * @param array $settings The settings for the block. - */ - public function set_dynamic_container_url( $attributes, $settings ) { - $link_type = ! empty( $settings['gpDynamicLinkType'] ) ? $settings['gpDynamicLinkType'] : ''; - - if ( - $link_type && - isset( $settings['url'] ) && - isset( $settings['linkType'] ) && - '' !== $settings['url'] && - ( 'wrapper' === $settings['linkType'] || 'hidden-link' === $settings['linkType'] ) - ) { - if ( ! empty( $link_type ) ) { - $source = ! empty( $settings['gpDynamicSource'] ) ? $settings['gpDynamicSource'] : 'current-post'; - $id = $this->get_source_id( $source, $settings ); - - if ( ! $id ) { - return $attributes; - } - - if ( 'post' === $link_type ) { - $attributes['href'] = esc_url( get_permalink( $id ) ); - } - - if ( 'post-meta' === $link_type ) { - if ( ! empty( $settings['gpDynamicLinkCustomField'] ) ) { - $custom_field = get_post_meta( $id, $settings['gpDynamicLinkCustomField'], true ); - - if ( $custom_field ) { - $attributes['href'] = esc_url( $custom_field ); - } - } - } - } - } - - return $attributes; - } - - /** - * Get our needed source ID. - * - * @param string $source The source attribute. - * @param array $attributes All block attributes. - */ - public function get_source_id( $source, $attributes = array() ) { - $id = get_the_ID(); - - if ( 'next-post' === $source ) { - $in_same_term = ! empty( $attributes['gpDynamicSourceInSameTerm'] ) ? true : false; - $term_taxonomy = ! empty( $attributes['gpDynamicSourceInSameTermTaxonomy'] ) ? $attributes['gpDynamicSourceInSameTermTaxonomy'] : 'category'; - $next_post = get_next_post( $in_same_term, '', $term_taxonomy ); - - if ( ! is_object( $next_post ) ) { - return false; - } - - $id = $next_post->ID; - } - - if ( 'previous-post' === $source ) { - $in_same_term = ! empty( $attributes['gpDynamicSourceInSameTerm'] ) ? true : false; - $term_taxonomy = ! empty( $attributes['gpDynamicSourceInSameTermTaxonomy'] ) ? $attributes['gpDynamicSourceInSameTermTaxonomy'] : 'category'; - $previous_post = get_previous_post( $in_same_term, '', $term_taxonomy ); - - if ( ! is_object( $previous_post ) ) { - return false; - } - - $id = $previous_post->ID; - } - - return apply_filters( 'generate_dynamic_element_source_id', $id, $source, $attributes ); - } - - /** - * Get our author ID. - * - * @param string $source The source attribute. - * @param array $attributes All block attributes. - */ - public function get_author_id( $source, $attributes ) { - global $post; - $post_info = $post; - - if ( 'next-post' === $source ) { - $in_same_term = ! empty( $attributes['gpDynamicSourceInSameTerm'] ) ? true : false; - $term_taxonomy = ! empty( $attributes['gpDynamicSourceInSameTermTaxonomy'] ) ? $attributes['gpDynamicSourceInSameTermTaxonomy'] : 'category'; - $next_post = get_next_post( $in_same_term, '', $term_taxonomy ); - - if ( ! is_object( $next_post ) ) { - return ''; - } - - $post_info = $next_post; - } - - if ( 'previous-post' === $source ) { - $in_same_term = ! empty( $attributes['gpDynamicSourceInSameTerm'] ) ? true : false; - $term_taxonomy = ! empty( $attributes['gpDynamicSourceInSameTermTaxonomy'] ) ? $attributes['gpDynamicSourceInSameTermTaxonomy'] : 'category'; - $previous_post = get_previous_post( $in_same_term, '', $term_taxonomy ); - - if ( ! is_object( $previous_post ) ) { - return ''; - } - - $post_info = $previous_post; - } - - if ( isset( $post_info->post_author ) ) { - return $post_info->post_author; - } - } - - /** - * Register our post meta. - */ - public function register_meta() { - register_meta( - 'post', - '_generate_block_element_editor_width', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_int' ), - ) - ); - - register_meta( - 'post', - '_generate_block_element_editor_width_unit', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - register_meta( - 'post', - '_generate_block_type', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - register_meta( - 'post', - '_generate_hook', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - register_meta( - 'post', - '_generate_custom_hook', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_custom_hook' ), - ) - ); - - register_meta( - 'post', - '_generate_hook_priority', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_int' ), - ) - ); - - register_meta( - 'post', - '_generate_post_meta_location', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_text_field' ), - ) - ); - - register_meta( - 'post', - '_generate_post_loop_item_tagname', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_text_field' ), - ) - ); - - register_meta( - 'post', - '_generate_disable_primary_post_meta', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_disable_secondary_post_meta', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_disable_title', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_disable_featured_image', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_use_theme_post_container', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_use_archive_navigation_container', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_disable_post_navigation', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_disable_archive_navigation', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'boolean', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'rest_sanitize_boolean' ), - ) - ); - - register_meta( - 'post', - '_generate_post_loop_item_display', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_text_field' ), - ) - ); - - register_meta( - 'post', - '_generate_post_loop_item_display_tax', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_text_field' ), - ) - ); - - register_meta( - 'post', - '_generate_post_loop_item_display_term', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_text_field' ), - ) - ); - - register_meta( - 'post', - '_generate_post_loop_item_display_post_meta', - array( - 'object_subtype' => 'gp_elements', - 'type' => 'string', - 'show_in_rest' => true, - 'auth_callback' => '__return_true', - 'single' => true, - 'sanitize_callback' => array( $this, 'sanitize_text_field' ), - ) - ); - } - - /** - * Sanitize our custom hook field. - * - * @param string $value The value to sanitize. - */ - public function sanitize_custom_hook( $value ) { - $not_allowed = array( - 'muplugins_loaded', - 'registered_taxonomy', - 'plugins_loaded', - 'setup_theme', - 'after_setup_theme', - 'init', - 'widgets_init', - 'wp_loaded', - 'pre_get_posts', - 'wp', - 'template_redirect', - 'get_header', - 'wp_enqueue_scripts', - 'the_post', - 'dynamic_sidebar', - 'get_footer', - 'get_sidebar', - 'wp_print_footer_scripts', - 'shutdown', - ); - - if ( in_array( $value, $not_allowed ) ) { - return ''; - } - - return sanitize_key( $value ); - } - - /** - * Sanitize number values that can be empty. - * - * @param int $value The value to sanitize. - */ - public function sanitize_int( $value ) { - if ( ! is_numeric( $value ) ) { - return ''; - } - - return absint( $value ); - } - - /** - * Get our image size names and dimensions. - */ - public function get_image_sizes() { - global $_wp_additional_image_sizes; - - $default_image_sizes = get_intermediate_image_sizes(); - - foreach ( $default_image_sizes as $size ) { - $image_sizes[ $size ]['width'] = intval( get_option( "{$size}_size_w" ) ); - $image_sizes[ $size ]['height'] = intval( get_option( "{$size}_size_h" ) ); - $image_sizes[ $size ]['crop'] = get_option( "{$size}_crop" ) ? get_option( "{$size}_crop" ) : false; - } - - if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) { - $image_sizes = array_merge( $image_sizes, $_wp_additional_image_sizes ); - } - - return $image_sizes; - } - - /** - * Add front-end CSS. - */ - public function frontend_css() { - require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; - $css = new GeneratePress_Pro_CSS(); - - $css->set_selector( '.dynamic-author-image-rounded' ); - $css->add_property( 'border-radius', '100%' ); - - $css->set_selector( '.dynamic-featured-image, .dynamic-author-image' ); - $css->add_property( 'vertical-align', 'middle' ); - - $css->set_selector( '.one-container.blog .dynamic-content-template:not(:last-child), .one-container.archive .dynamic-content-template:not(:last-child)' ); - $css->add_property( 'padding-bottom', '0px' ); - - $css->set_selector( '.dynamic-entry-excerpt > p:last-child' ); - $css->add_property( 'margin-bottom', '0px' ); - - wp_add_inline_style( 'generate-style', $css->css_output() ); - } -} - -GeneratePress_Block_Elements::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-block.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-block.php deleted file mode 100644 index 051d8e43..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-block.php +++ /dev/null @@ -1,469 +0,0 @@ -post_id = $post_id; - $this->type = get_post_meta( $post_id, '_generate_block_type', true ); - $has_content_template_condition = get_post_meta( $post_id, '_generate_post_loop_item_display', true ); - - // Take over the $post_id temporarily if this is a child block. - // This allows us to inherit the parent block Display Rules. - if ( 'content-template' === $this->type && $has_content_template_condition ) { - $parent_block = wp_get_post_parent_id( $post_id ); - - if ( ! empty( $parent_block ) ) { - $this->has_parent = true; - $post_id = $parent_block; - } - } - - $display_conditions = get_post_meta( $post_id, '_generate_element_display_conditions', true ) ? get_post_meta( $post_id, '_generate_element_display_conditions', true ) : array(); - $exclude_conditions = get_post_meta( $post_id, '_generate_element_exclude_conditions', true ) ? get_post_meta( $post_id, '_generate_element_exclude_conditions', true ) : array(); - $user_conditions = get_post_meta( $post_id, '_generate_element_user_conditions', true ) ? get_post_meta( $post_id, '_generate_element_user_conditions', true ) : array(); - - $display = apply_filters( - 'generate_block_element_display', - GeneratePress_Conditions::show_data( - $display_conditions, - $exclude_conditions, - $user_conditions - ), - $post_id - ); - - /** - * Simplify filter name. - * - * @since 2.0.0 - */ - $display = apply_filters( - 'generate_element_display', - $display, - $post_id - ); - - // Restore our actual post ID if it's been changed. - if ( 'content-template' === $this->type && $has_content_template_condition ) { - $post_id = $this->post_id; - } - - if ( $display ) { - global $generate_elements; - - $generate_elements[ $post_id ] = array( - 'is_block_element' => true, - 'type' => $this->type, - 'id' => $post_id, - ); - - $hook = get_post_meta( $post_id, '_generate_hook', true ); - $custom_hook = get_post_meta( $post_id, '_generate_custom_hook', true ); - $priority = get_post_meta( $post_id, '_generate_hook_priority', true ); - - if ( '' === $priority ) { - $priority = 10; - } - - switch ( $this->type ) { - case 'site-header': - $hook = 'generate_header'; - break; - - case 'site-footer': - $hook = 'generate_footer'; - break; - - case 'right-sidebar': - $hook = 'generate_before_right_sidebar_content'; - break; - - case 'left-sidebar': - $hook = 'generate_before_left_sidebar_content'; - break; - - case 'content-template': - $hook = 'generate_before_do_template_part'; - break; - - case 'loop-template': - $hook = 'generate_before_main_content'; - break; - - case 'search-modal': - $hook = 'generate_inside_search_modal'; - break; - } - - if ( 'custom' === $hook && $custom_hook ) { - $hook = $custom_hook; - } - - if ( 'post-meta-template' === $this->type ) { - $post_meta_location = get_post_meta( $post_id, '_generate_post_meta_location', true ); - - if ( '' === $post_meta_location || 'after-post-title' === $post_meta_location ) { - $hook = 'generate_after_entry_title'; - - if ( is_page() ) { - $hook = 'generate_after_page_title'; - } - } elseif ( 'before-post-title' === $post_meta_location ) { - $hook = 'generate_before_entry_title'; - - if ( is_page() ) { - $hook = 'generate_before_page_title'; - } - } elseif ( 'after-content' === $post_meta_location ) { - $hook = 'generate_after_content'; - } - } - - if ( ! $hook ) { - return; - } - - if ( 'generate_header' === $hook ) { - remove_action( 'generate_header', 'generate_construct_header' ); - } - - if ( 'generate_footer' === $hook ) { - remove_action( 'generate_footer', 'generate_construct_footer' ); - } - - if ( 'content-template' === $this->type && ! $this->has_parent ) { - add_filter( 'generate_do_template_part', array( $this, 'do_template_part' ) ); - } - - if ( 'loop-template' === $this->type ) { - add_filter( 'generate_has_default_loop', '__return_false' ); - add_filter( 'generate_blog_columns', '__return_false' ); - add_filter( 'option_generate_blog_settings', array( $this, 'filter_blog_settings' ) ); - add_filter( 'post_class', array( $this, 'post_classes' ) ); - } - - if ( 'search-modal' === $this->type ) { - remove_action( 'generate_inside_search_modal', 'generate_do_search_fields' ); - } - - add_action( 'wp', array( $this, 'remove_elements' ), 100 ); - add_action( esc_attr( $hook ), array( $this, 'build_hook' ), absint( $priority ) ); - add_filter( 'generateblocks_do_content', array( $this, 'do_block_content' ) ); - } - } - - /** - * Disable our post loop items if needed. - * - * @param boolean $do Whether to display the default post loop item or not. - */ - public function do_template_part( $do ) { - if ( GeneratePress_Elements_Helper::should_render_content_template( $this->post_id ) ) { - return false; - } - - return $do; - } - - /** - * Tell GenerateBlocks about our block element content so it can build CSS. - * - * @since 1.11.0 - * @param string $content The existing content. - */ - public function do_block_content( $content ) { - if ( has_blocks( $this->post_id ) ) { - $block_element = get_post( $this->post_id ); - - if ( ! $block_element || 'gp_elements' !== $block_element->post_type ) { - return $content; - } - - if ( 'publish' !== $block_element->post_status || ! empty( $block_element->post_password ) ) { - return $content; - } - - $content .= $block_element->post_content; - } - - return $content; - } - - /** - * Remove existing sidebar widgets. - * - * @since 1.11.0 - * @param array $widgets The existing widgets. - */ - public function remove_sidebar_widgets( $widgets ) { - if ( 'right-sidebar' === $this->type ) { - unset( $widgets['sidebar-1'] ); - } - - if ( 'left-sidebar' === $this->type ) { - unset( $widgets['sidebar-2'] ); - } - - return $widgets; - } - - /** - * Filter some of our blog settings. - * - * @param array $settings Existing blog settings. - */ - public function filter_blog_settings( $settings ) { - if ( 'loop-template' === $this->type ) { - $settings['infinite_scroll'] = false; - $settings['read_more_button'] = false; - } - - return $settings; - } - - /** - * Add class to our loop template item posts. - * - * @param array $classes Post classes. - */ - public function post_classes( $classes ) { - if ( 'loop-template' === $this->type && is_main_query() ) { - $classes[] = 'is-loop-template-item'; - } - - return $classes; - } - - /** - * Remove existing elements. - * - * @since 2.0.0 - */ - public function remove_elements() { - if ( 'right-sidebar' === $this->type || 'left-sidebar' === $this->type ) { - add_filter( 'sidebars_widgets', array( $this, 'remove_sidebar_widgets' ) ); - add_filter( 'generate_show_default_sidebar_widgets', '__return_false' ); - } - - if ( 'page-hero' === $this->type ) { - $disable_title = get_post_meta( $this->post_id, '_generate_disable_title', true ); - $disable_featured_image = get_post_meta( $this->post_id, '_generate_disable_featured_image', true ); - $disable_primary_post_meta = get_post_meta( $this->post_id, '_generate_disable_primary_post_meta', true ); - - if ( $disable_title ) { - if ( is_singular() ) { - add_filter( 'generate_show_title', '__return_false' ); - } - - remove_action( 'generate_archive_title', 'generate_archive_title' ); - remove_filter( 'get_the_archive_title', 'generate_filter_the_archive_title' ); - - // WooCommerce removal. - if ( class_exists( 'WooCommerce' ) ) { - remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); - add_filter( 'woocommerce_show_page_title', '__return_false' ); - remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description' ); - remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description' ); - } - } - - if ( $disable_primary_post_meta ) { - remove_action( 'generate_after_entry_title', 'generate_post_meta' ); - } - - if ( $disable_featured_image && is_singular() ) { - remove_action( 'generate_after_entry_header', 'generate_blog_single_featured_image' ); - remove_action( 'generate_before_content', 'generate_blog_single_featured_image' ); - remove_action( 'generate_after_header', 'generate_blog_single_featured_image' ); - remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single' ); - remove_action( 'generate_after_header', 'generate_featured_page_header' ); - } - } - - if ( 'post-meta-template' === $this->type ) { - $post_meta_location = get_post_meta( $this->post_id, '_generate_post_meta_location', true ); - $disable_primary_post_meta = get_post_meta( $this->post_id, '_generate_disable_primary_post_meta', true ); - $disable_secondary_post_meta = get_post_meta( $this->post_id, '_generate_disable_secondary_post_meta', true ); - - if ( '' === $post_meta_location || 'after-post-title' === $post_meta_location || 'custom' === $post_meta_location ) { - if ( $disable_primary_post_meta ) { - remove_action( 'generate_after_entry_title', 'generate_post_meta' ); - } - } elseif ( 'before-post-title' === $post_meta_location || 'custom' === $post_meta_location ) { - if ( $disable_primary_post_meta ) { - remove_action( 'generate_after_entry_title', 'generate_post_meta' ); - } - } elseif ( 'after-content' === $post_meta_location || 'custom' === $post_meta_location ) { - if ( $disable_secondary_post_meta ) { - remove_action( 'generate_after_entry_content', 'generate_footer_meta' ); - } - } - } - - if ( 'post-navigation-template' === $this->type ) { - $disable_post_navigation = get_post_meta( $this->post_id, '_generate_disable_post_navigation', true ); - - if ( $disable_post_navigation ) { - add_filter( 'generate_footer_entry_meta_items', array( $this, 'disable_post_navigation' ) ); - } - } - - if ( 'archive-navigation-template' === $this->type ) { - $disable_archive_navigation = get_post_meta( $this->post_id, '_generate_disable_archive_navigation', true ); - - if ( $disable_archive_navigation ) { - remove_action( 'generate_after_loop', 'generate_do_post_navigation' ); - } - } - } - - /** - * Disable post navigation. - * - * @param array $items The post meta items. - */ - public function disable_post_navigation( $items ) { - return array_diff( $items, array( 'post-navigation' ) ); - } - - /** - * Builds the HTML structure for Page Headers. - * - * @since 1.11.0 - */ - public function build_hook() { - $post_id = $this->post_id; - - if ( 'content-template' === $this->type ) { - // Check for child templates if this isn't already one. - if ( ! $this->has_parent ) { - $children = get_posts( - array( - 'post_type' => 'gp_elements', - 'post_parent' => $post_id, - 'order' => 'ASC', - 'orderby' => 'menu_order', - 'no_found_rows' => true, - 'post_status' => 'publish', - 'numberposts' => 20, - 'fields' => 'ids', - ) - ); - - if ( ! empty( $children ) ) { - // Loop through any child templates and overwrite $post_id if applicable. - foreach ( (array) $children as $child_id ) { - if ( GeneratePress_Elements_Helper::should_render_content_template( $child_id ) ) { - $post_id = $child_id; - break; - } - } - } else { - // No children, check if parent should render. - if ( ! GeneratePress_Elements_Helper::should_render_content_template( $post_id ) ) { - return; - } - } - } else { - // No children, check if template should render. - if ( ! GeneratePress_Elements_Helper::should_render_content_template( $post_id ) ) { - return; - } - } - - // Don't display child elements - they will replace the parent element if applicable. - if ( $this->has_parent ) { - return; - } - - $tag_name_value = get_post_meta( $post_id, '_generate_post_loop_item_tagname', true ); - $use_theme_container = get_post_meta( $post_id, '_generate_use_theme_post_container', true ); - - if ( $tag_name_value ) { - $tag_name = $tag_name_value; - } else { - $tag_name = 'article'; - } - - printf( - '<%s id="%s" class="%s">', - esc_attr( $tag_name ), - 'post-' . get_the_ID(), - implode( ' ', get_post_class( 'dynamic-content-template' ) ) // phpcs:ignore -- No escaping needed. - ); - - if ( $use_theme_container ) { - echo '
'; - } - } - - if ( 'archive-navigation-template' === $this->type || 'post-navigation-template' === $this->type ) { - $use_theme_pagination_container = get_post_meta( $post_id, '_generate_use_archive_navigation_container', true ); - - if ( $use_theme_pagination_container ) { - echo '
'; - } - } - - echo GeneratePress_Elements_Helper::build_content( $post_id ); // phpcs:ignore -- No escaping needed. - - if ( 'content-template' === $this->type ) { - if ( $use_theme_container ) { - echo '
'; - } - - echo ''; - } - - if ( 'archive-navigation-template' === $this->type || 'post-navigation-template' === $this->type ) { - $use_theme_pagination_container = get_post_meta( $post_id, '_generate_use_archive_navigation_container', true ); - - if ( $use_theme_pagination_container ) { - echo '
'; - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-conditions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-conditions.php deleted file mode 100644 index 759d1f81..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-conditions.php +++ /dev/null @@ -1,447 +0,0 @@ - array( - 'label' => esc_attr__( 'General', 'gp-premium' ), - 'locations' => array( - 'general:site' => esc_attr__( 'Entire Site', 'gp-premium' ), - 'general:front_page' => esc_attr__( 'Front Page', 'gp-premium' ), - 'general:blog' => esc_attr__( 'Blog', 'gp-premium' ), - 'general:singular' => esc_attr__( 'All Singular', 'gp-premium' ), - 'general:archive' => esc_attr__( 'All Archives', 'gp-premium' ), - 'general:author' => esc_attr__( 'Author Archives', 'gp-premium' ), - 'general:date' => esc_attr__( 'Date Archives', 'gp-premium' ), - 'general:search' => esc_attr__( 'Search Results', 'gp-premium' ), - 'general:no_results' => esc_attr__( 'No Search Results', 'gp-premium' ), - 'general:404' => esc_attr__( '404 Template', 'gp-premium' ), - 'general:is_paged' => esc_attr__( 'Paginated Results', 'gp-premium' ), - ), - ), - ); - - // Add the post types. - $post_types = get_post_types( - array( - 'public' => true, - ), - 'objects' - ); - - foreach ( $post_types as $post_type_slug => $post_type ) { - - if ( in_array( $post_type_slug, array( 'fl-theme-layout' ) ) ) { - continue; - } - - $post_type_object = get_post_type_object( $post_type_slug ); - $counts = wp_count_posts( $post_type_slug ); - $count = $counts->publish + $counts->future + $counts->draft + $counts->pending + $counts->private; - - // Add the post type. - $types[ $post_type_slug ] = array( - 'label' => esc_html( $post_type->labels->name ), - 'locations' => array( - 'post:' . $post_type_slug => esc_html( $post_type->labels->singular_name ), - ), - ); - - // Add the post type archive. - // We add this regardless of `has_archive` as we deal with that after taxonomies are added. - $types[ $post_type_slug . '_archive' ] = array( - /* translators: post type name */ - 'label' => sprintf( esc_html_x( '%s Archives', '%s is a singular post type name', 'gp-premium' ), $post_type->labels->singular_name ), - 'locations' => array( - /* translators: post type name */ - 'archive:' . $post_type_slug => sprintf( esc_html_x( '%s Archive', '%s is a singular post type name', 'gp-premium' ), $post_type->labels->singular_name ), - ), - ); - - // Add the taxonomies for the post type. - $taxonomies = get_object_taxonomies( $post_type_slug, 'objects' ); - - foreach ( $taxonomies as $taxonomy_slug => $taxonomy ) { - - $public = $taxonomy->public && $taxonomy->show_ui; - - if ( 'post_format' === $taxonomy_slug ) { - continue; - } elseif ( ! apply_filters( 'generate_elements_show_taxonomy', $public, $taxonomy ) ) { - continue; - } - - $label = str_replace( - array( - $post_type->labels->name, - $post_type->labels->singular_name, - ), - '', - $taxonomy->labels->singular_name - ); - - if ( isset( $types[ $post_type_slug . '_archive' ]['locations'] ) ) { - /* translators: '%1$s is post type label. %2$s is taxonomy label. */ - $types[ $post_type_slug . '_archive' ]['locations'][ 'taxonomy:' . $taxonomy_slug ] = sprintf( esc_html_x( '%1$s %2$s Archive', '%1$s is post type label. %2$s is taxonomy label.', 'gp-premium' ), $post_type->labels->singular_name, $label ); - } - - if ( isset( $types[ $post_type_slug ]['locations'] ) ) { - $types[ $post_type_slug ]['locations'][ $post_type_slug . ':taxonomy:' . $taxonomy_slug ] = esc_html( $post_type->labels->singular_name . ' ' . $label ); - } - } - - // Remove the archives location if `has_archive` is set to false. - if ( 'post' !== $post_type_slug && empty( $post_type_object->has_archive ) ) { - unset( $types[ $post_type_slug . '_archive' ]['locations'][ 'archive:' . $post_type_slug ] ); - } - - // Remove the entire item if no locations exist. - if ( 0 === count( (array) $types[ $post_type_slug . '_archive' ]['locations'] ) ) { - unset( $types[ $post_type_slug . '_archive' ] ); - } - } - - return $types; - } - - /** - * Output our available user conditions. - * - * @since 1.7 - * - * @return array - */ - public static function get_user_conditions() { - $rules = array( - 'general' => array( - 'label' => esc_attr__( 'General', 'gp-premium' ), - 'rules' => array( - 'general:all' => esc_attr__( 'All Users', 'gp-premium' ), - 'general:logged_in' => esc_attr__( 'Logged In', 'gp-premium' ), - 'general:logged_out' => esc_attr__( 'Logged Out', 'gp-premium' ), - ), - ), - 'role' => array( - 'label' => esc_attr__( 'Roles', 'gp-premium' ), - 'rules' => array(), - ), - ); - - $roles = get_editable_roles(); - - foreach ( $roles as $slug => $data ) { - $rules['role']['rules'][ $slug ] = $data['name']; - } - - return $rules; - } - - /** - * Get our current location. - * - * @since 1.7 - * - * @return array - */ - public static function get_current_location() { - global $wp_query; - global $post; - - $location = null; - $object = null; - $queried_object = get_queried_object(); - - // Get the location string. - if ( is_front_page() ) { - $location = 'general:front_page'; - } elseif ( is_home() ) { - $location = 'general:blog'; - } elseif ( is_author() ) { - $location = 'general:author'; - } elseif ( is_date() ) { - $location = 'general:date'; - } elseif ( is_search() ) { - $location = 'general:search'; - - global $wp_query; - - if ( 0 === $wp_query->found_posts ) { - $location = 'general:no_results'; - } - } elseif ( is_404() ) { - $location = 'general:404'; - } elseif ( is_category() ) { - - $location = 'taxonomy:category'; - - if ( is_object( $queried_object ) ) { - $object = $queried_object->term_id; - } - } elseif ( is_tag() ) { - - $location = 'taxonomy:post_tag'; - - if ( is_object( $queried_object ) ) { - $object = $queried_object->term_id; - } - } elseif ( is_tax() ) { - - $location = 'taxonomy:' . get_query_var( 'taxonomy' ); - - if ( is_object( $queried_object ) ) { - $location = 'taxonomy:' . $queried_object->taxonomy; - $object = $queried_object->term_id; - } - } elseif ( is_post_type_archive() ) { - $post_type = $wp_query->get( 'post_type' ); - - if ( is_array( $post_type ) ) { - $location = 'archive:' . $post_type[0]; - } else { - $location = 'archive:' . $post_type; - } - } elseif ( is_singular() ) { - - if ( is_object( $post ) ) { - $location = 'post:' . $post->post_type; - } - - if ( is_object( $queried_object ) ) { - $object = $queried_object->ID; - } - } - - if ( is_admin() && function_exists( 'get_current_screen' ) ) { - $current_screen = get_current_screen(); - - if ( isset( $current_screen->is_block_editor ) && $current_screen->is_block_editor ) { - $post_id = false; - - if ( isset( $_GET['post'] ) ) { // phpcs:ignore -- Just checking if it's set. - $post_id = absint( $_GET['post'] ); // phpcs:ignore -- No data processing going on. - } - - if ( $post_id ) { - // Get the location string. - $front_page_id = get_option( 'page_on_front' ); - $blog_id = get_option( 'page_for_posts' ); - - if ( (int) $post_id === (int) $front_page_id ) { - $location = 'general:front_page'; - } elseif ( (int) $post_id === (int) $blog_id ) { - $location = 'general:blog'; - } else { - if ( isset( $current_screen->post_type ) ) { - $location = 'post:' . $current_screen->post_type; - } - - $object = $post_id; - } - } elseif ( isset( $_GET['post_type'] ) ) { // phpcs:ignore -- Just checking if it's set. - $location = 'post:' . esc_attr( $_GET['post_type'] ); // phpcs:ignore -- No data processing going on. - } - } - } - - return array( - 'rule' => $location, - 'object' => $object, - ); - } - - /** - * Get info on the current user. - * - * @since 1.7 - * - * @return array - */ - public static function get_current_user() { - $status = array(); - if ( is_user_logged_in() ) { - $status[] = 'general:logged_in'; - } else { - $status[] = 'general:logged_out'; - } - - $user = wp_get_current_user(); - - foreach ( (array) $user->roles as $role ) { - $status[] = $role; - } - - return $status; - } - - /** - * Figure out if we should display the element or not. - * - * @since 1.7 - * - * @param array $conditionals The conditions. - * @param array $exclude The exclusions. - * @param array $roles The roles. - * @return bool - */ - public static function show_data( $conditionals, $exclude, $roles ) { - $current_location = self::get_current_location(); - $show = false; - - // Show depending on location conditionals. - if ( ! $show ) { - foreach ( (array) $conditionals as $conditional ) { - if ( in_array( 'general:site', $conditional ) ) { - $show = true; - } elseif ( is_singular() && in_array( 'general:singular', $conditional ) ) { - $show = true; - } elseif ( is_archive() && in_array( 'general:archive', $conditional ) ) { - $show = true; - } elseif ( ! empty( $current_location['rule'] ) && in_array( $current_location['rule'], $conditional ) ) { - if ( ! isset( $conditional['object'] ) || empty( $conditional['object'] ) ) { - $show = true; - } else { - if ( in_array( $current_location['object'], $conditional ) ) { - $show = true; - } - } - } elseif ( is_singular() && strstr( $conditional['rule'], ':taxonomy:' ) ) { - $tax = substr( $conditional['rule'], strrpos( $conditional['rule'], ':' ) + 1 ); - - if ( $tax && isset( $conditional['object'] ) && has_term( $conditional['object'], $tax ) ) { - $show = true; - } - } elseif ( is_front_page() && is_home() && ( in_array( 'general:blog', $conditional ) || in_array( 'general:front_page', $conditional ) ) ) { - // If the home page is the blog, both of general:blog and general:front_page apply. - $show = true; - } elseif ( in_array( 'general:is_paged', $conditional ) && is_paged() ) { - $show = true; - } - } - } - - // Exclude based on exclusion conditionals. - if ( $show ) { - foreach ( (array) $exclude as $conditional ) { - if ( is_singular() && in_array( 'general:singular', $conditional ) ) { - $show = false; - } elseif ( is_archive() && in_array( 'general:archive', $conditional ) ) { - $show = false; - } elseif ( ! empty( $current_location['rule'] ) && in_array( $current_location['rule'], $conditional ) ) { - if ( ! isset( $conditional['object'] ) || empty( $conditional['object'] ) ) { - $show = false; - } else { - if ( in_array( $current_location['object'], $conditional ) ) { - $show = false; - } - } - } elseif ( is_singular() && strstr( $conditional['rule'], ':taxonomy:' ) ) { - $tax = substr( $conditional['rule'], strrpos( $conditional['rule'], ':' ) + 1 ); - - if ( $tax && isset( $conditional['object'] ) && has_term( $conditional['object'], $tax ) ) { - $show = false; - } - } elseif ( is_front_page() && is_home() && ( in_array( 'general:blog', $conditional ) || in_array( 'general:front_page', $conditional ) ) ) { - // If the home page is the blog, both of general:blog and general:front_page apply. - $show = false; - } elseif ( in_array( 'general:is_paged', $conditional ) && is_paged() ) { - $show = false; - } - } - } - - // Exclude user roles. - if ( $show && ! empty( $roles ) ) { - $user_info = self::get_current_user(); - - $check = array_intersect( $roles, $user_info ); - if ( ! count( $check ) > 0 && ! in_array( 'general:all', $roles ) ) { - $show = false; - } - } - - return $show; - } - - /** - * Returns the label for a saved location. - * - * @since 1.7 - * @param string $saved_location The location. - * @return string|bool - */ - public static function get_saved_label( $saved_location ) { - $locations = self::get_conditions(); - - $rule = $saved_location['rule']; - $object_id = $saved_location['object']; - $object_type = ''; - $label = false; - - foreach ( $locations as $data ) { - if ( isset( $data['locations'][ $rule ] ) && ! $label ) { - $label = $data['locations'][ $rule ]; - - $object_types = explode( ':', $rule ); - - if ( in_array( 'taxonomy', $object_types ) && $object_id ) { - $term = get_term( $object_id ); - - if ( ! is_object( $term ) || is_wp_error( $term ) ) { - return false; - } - - $label .= ': ' . $term->name; - } elseif ( ( in_array( 'post', $object_types ) || in_array( 'page', $object_types ) ) && $object_id ) { - $post = get_post( $object_id ); - - if ( ! is_object( $post ) ) { - return false; - } - - $label .= ': ' . $post->post_title; - } - } - } - - return $label; - } -} - -GeneratePress_Conditions::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-elements-helper.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-elements-helper.php deleted file mode 100644 index c4ad532b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-elements-helper.php +++ /dev/null @@ -1,527 +0,0 @@ -post_type ) { - return ''; - } - - if ( 'publish' !== $block_element->post_status || ! empty( $block_element->post_password ) ) { - return ''; - } - - $block_type = get_post_meta( $id, '_generate_block_type', true ); - - if ( 'site-footer' === $block_type ) { - $block_element->post_content = str_replace( '{{current_year}}', date( 'Y' ), $block_element->post_content ); // phpcs:ignore -- Prefer date(). - } - - // Handle embeds for block elements. - global $wp_embed; - - if ( is_object( $wp_embed ) && method_exists( $wp_embed, 'autoembed' ) ) { - $block_element->post_content = $wp_embed->autoembed( $block_element->post_content ); - } - - return apply_filters( 'generate_do_block_element_content', do_blocks( $block_element->post_content ) ); - } - - /** - * Get our Element type label. - * - * @since 2.0.0 - * @param string $type The type value. - */ - public static function get_element_type_label( $type ) { - switch ( $type ) { - case 'block': - $label = __( 'Block', 'gp-premium' ); - break; - - case 'header': - $label = __( 'Header', 'gp-premium' ); - break; - - case 'hook': - $label = __( 'Hook', 'gp-premium' ); - break; - - case 'layout': - $label = __( 'Layout', 'gp-premium' ); - break; - - case 'site-header': - $label = __( 'Site Header', 'gp-premium' ); - break; - - case 'page-hero': - $label = __( 'Page Hero', 'gp-premium' ); - break; - - case 'content-template': - $label = __( 'Content Template', 'gp-premium' ); - break; - - case 'loop-template': - $label = __( 'Loop Template', 'gp-premium' ); - break; - - case 'post-meta-template': - $label = __( 'Post Meta Template', 'gp-premium' ); - break; - - case 'post-navigation-template': - $label = __( 'Post Navigation', 'gp-premium' ); - break; - - case 'archive-navigation-template': - $label = __( 'Archive Navigation', 'gp-premium' ); - break; - - case 'right-sidebar': - $label = __( 'Right Sidebar', 'gp-premium' ); - break; - - case 'left-sidebar': - $label = __( 'Left Sidebar', 'gp-premium' ); - break; - - case 'site-footer': - $label = __( 'Site Footer', 'gp-premium' ); - break; - - default: - $label = esc_html( str_replace( '-', ' ', ucfirst( $type ) ) ); - break; - } - - return $label; - } - - /** - * Check for content template conditions. - * - * @since 2.0.0 - * @param int $post_id The post to check. - */ - public static function should_render_content_template( $post_id ) { - $loop_item_display = get_post_meta( $post_id, '_generate_post_loop_item_display', true ); - $display = true; - - if ( 'has-term' === $loop_item_display ) { - $tax = get_post_meta( $post_id, '_generate_post_loop_item_display_tax', true ); - - if ( $tax ) { - $term = get_post_meta( $post_id, '_generate_post_loop_item_display_term', true ); - - // Add support for multiple comma separated terms. - if ( ! empty( $term ) ) { - $term = str_replace( ' ', '', $term ); - $term = explode( ',', $term ); - } - - if ( has_term( $term, $tax ) ) { - $display = true; - } else { - $display = false; - } - } - } - - if ( 'has-post-meta' === $loop_item_display ) { - $post_meta_name = get_post_meta( $post_id, '_generate_post_loop_item_display_post_meta', true ); - - if ( $post_meta_name ) { - $post_meta = get_post_meta( get_the_ID(), $post_meta_name, true ); - - if ( $post_meta ) { - $display = true; - } else { - $display = false; - } - } - } - - if ( 'is-first-post' === $loop_item_display ) { - global $wp_query; - - if ( 0 === $wp_query->current_post && ! is_paged() ) { - $display = true; - } else { - $display = false; - } - } - - return apply_filters( 'generate_should_render_content_template', $display, $post_id ); - } - - /** - * Build our entire list of hooks to display. - * - * @since 1.7 - * - * @return array Our list of hooks. - */ - public static function get_available_hooks() { - $hooks = array( - 'scripts' => array( - 'group' => esc_attr__( 'Scripts/Styles', 'gp-premium' ), - 'hooks' => array( - 'wp_head', - 'wp_body_open', - 'wp_footer', - ), - ), - 'header' => array( - 'group' => esc_attr__( 'Header', 'gp-premium' ), - 'hooks' => array( - 'generate_before_header', - 'generate_after_header', - 'generate_before_header_content', - 'generate_after_header_content', - 'generate_before_logo', - 'generate_after_logo', - 'generate_header', - ), - ), - 'navigation' => array( - 'group' => esc_attr__( 'Navigation', 'gp-premium' ), - 'hooks' => array( - 'generate_inside_navigation', - 'generate_after_primary_menu', - 'generate_inside_secondary_navigation', - 'generate_inside_mobile_menu', - 'generate_inside_mobile_menu_bar', - 'generate_inside_mobile_header', - 'generate_inside_slideout_navigation', - 'generate_after_slideout_navigation', - ), - ), - 'content' => array( - 'group' => esc_attr__( 'Content', 'gp-premium' ), - 'hooks' => array( - 'generate_inside_site_container', - 'generate_inside_container', - 'generate_before_main_content', - 'generate_after_main_content', - 'generate_before_content', - 'generate_after_content', - 'generate_after_entry_content', - 'generate_after_primary_content_area', - 'generate_before_entry_title', - 'generate_after_entry_title', - 'generate_after_entry_header', - 'generate_before_archive_title', - 'generate_after_archive_title', - 'generate_after_archive_description', - ), - ), - 'comments' => array( - 'group' => esc_attr__( 'Comments', 'gp-premium' ), - 'hooks' => array( - 'generate_before_comments_container', - 'generate_before_comments', - 'generate_inside_comments', - 'generate_below_comments_title', - ), - ), - 'sidebars' => array( - 'group' => esc_attr__( 'Sidebars', 'gp-premium' ), - 'hooks' => array( - 'generate_before_right_sidebar_content', - 'generate_after_right_sidebar_content', - 'generate_before_left_sidebar_content', - 'generate_after_left_sidebar_content', - ), - ), - 'footer' => array( - 'group' => esc_attr__( 'Footer', 'gp-premium' ), - 'hooks' => array( - 'generate_before_footer', - 'generate_after_footer', - 'generate_after_footer_widgets', - 'generate_before_footer_content', - 'generate_after_footer_content', - 'generate_footer', - ), - ), - ); - - if ( class_exists( 'WooCommerce' ) ) { - $hooks['navigation']['hooks'][] = 'generate_mobile_cart_items'; - - $hooks['woocommerce-global'] = array( - 'group' => esc_attr__( 'WooCommerce - Global', 'gp-premium' ), - 'hooks' => array( - 'woocommerce_before_main_content', - 'woocommerce_after_main_content', - 'woocommerce_sidebar', - 'woocommerce_breadcrumb', - ), - ); - - $hooks['woocommerce-shop'] = array( - 'group' => esc_attr__( 'WooCommerce - Shop', 'gp-premium' ), - 'hooks' => array( - 'woocommerce_archive_description', - 'woocommerce_before_shop_loop', - 'woocommerce_after_shop_loop', - 'woocommerce_before_shop_loop_item_title', - 'woocommerce_after_shop_loop_item_title', - ), - ); - - $hooks['woocommerce-product'] = array( - 'group' => esc_attr__( 'WooCommerce - Product', 'gp-premium' ), - 'hooks' => array( - 'woocommerce_before_single_product', - 'woocommerce_before_single_product_summary', - 'woocommerce_after_single_product_summary', - 'woocommerce_single_product_summary', - 'woocommerce_share', - 'woocommerce_simple_add_to_cart', - 'woocommerce_before_add_to_cart_form', - 'woocommerce_after_add_to_cart_form', - 'woocommerce_before_add_to_cart_button', - 'woocommerce_after_add_to_cart_button', - 'woocommerce_before_add_to_cart_quantity', - 'woocommerce_after_add_to_cart_quantity', - 'woocommerce_product_meta_start', - 'woocommerce_product_meta_end', - 'woocommerce_after_single_product', - ), - ); - - $hooks['woocommerce-cart'] = array( - 'group' => esc_attr__( 'WooCommerce - Cart', 'gp-premium' ), - 'hooks' => array( - 'woocommerce_before_calculate_totals', - 'woocommerce_after_calculate_totals', - 'woocommerce_before_cart', - 'woocommerce_after_cart_table', - 'woocommerce_before_cart_table', - 'woocommerce_before_cart_contents', - 'woocommerce_cart_contents', - 'woocommerce_after_cart_contents', - 'woocommerce_cart_coupon', - 'woocommerce_cart_actions', - 'woocommerce_before_cart_totals', - 'woocommerce_cart_totals_before_order_total', - 'woocommerce_cart_totals_after_order_total', - 'woocommerce_proceed_to_checkout', - 'woocommerce_after_cart_totals', - 'woocommerce_after_cart', - ), - ); - - $hooks['woocommerce-checkout'] = array( - 'group' => esc_attr__( 'WooCommerce - Checkout', 'gp-premium' ), - 'hooks' => array( - 'woocommerce_before_checkout_form', - 'woocommerce_checkout_before_customer_details', - 'woocommerce_checkout_after_customer_details', - 'woocommerce_checkout_billing', - 'woocommerce_before_checkout_billing_form', - 'woocommerce_after_checkout_billing_form', - 'woocommerce_before_order_notes', - 'woocommerce_after_order_notes', - 'woocommerce_checkout_shipping', - 'woocommerce_checkout_before_order_review', - 'woocommerce_checkout_order_review', - 'woocommerce_review_order_before_cart_contents', - 'woocommerce_review_order_after_cart_contents', - 'woocommerce_review_order_before_order_total', - 'woocommerce_review_order_after_order_total', - 'woocommerce_review_order_before_payment', - 'woocommerce_review_order_before_submit', - 'woocommerce_review_order_after_submit', - 'woocommerce_review_order_after_payment', - 'woocommerce_checkout_after_order_review', - 'woocommerce_after_checkout_form', - ), - ); - - $hooks['woocommerce-account'] = array( - 'group' => esc_attr__( 'WooCommerce - Account', 'gp-premium' ), - 'hooks' => array( - 'woocommerce_before_account_navigation', - 'woocommerce_account_navigation', - 'woocommerce_after_account_navigation', - ), - ); - } - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - $hooks['navigation']['hooks'][] = 'generate_menu_bar_items'; - } - - if ( defined( 'GENERATE_VERSION' ) && version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '>' ) ) { - $hooks['navigation']['hooks'][] = 'generate_before_navigation'; - $hooks['navigation']['hooks'][] = 'generate_after_navigation'; - $hooks['navigation']['hooks'][] = 'generate_after_mobile_menu_button'; - $hooks['navigation']['hooks'][] = 'generate_inside_mobile_menu_control_wrapper'; - - $hooks['content']['hooks'][] = 'generate_after_loop'; - $hooks['content']['hooks'][] = 'generate_before_do_template_part'; - $hooks['content']['hooks'][] = 'generate_after_do_template_part'; - } - - return apply_filters( 'generate_hooks_list', $hooks ); - } - - /** - * Expand the wp_kses_post sanitization function to allow iframe HTML tags - * - * @param array $tags The allowed tags, attributes, and/or attribute values. - * @param string $context Context to judge allowed tags by. Allowed values are 'post'. - * @return array - */ - public static function expand_allowed_html( $tags, $context ) { - if ( ! isset( $tags['iframe'] ) ) { - $tags['iframe'] = [ - 'src' => true, - 'height' => true, - 'width' => true, - 'frameborder' => true, - 'allowfullscreen' => true, - 'title' => true, - ]; - } - - $tags = apply_filters( 'generate_dynamic_content_allowed_html', $tags, $context ); - - return $tags; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-hero.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-hero.php deleted file mode 100644 index 631b1185..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-hero.php +++ /dev/null @@ -1,1041 +0,0 @@ -conditional = get_post_meta( $post_id, '_generate_element_display_conditions', true ); - } - - if ( get_post_meta( $post_id, '_generate_element_exclude_conditions', true ) ) { - $this->exclude = get_post_meta( $post_id, '_generate_element_exclude_conditions', true ); - } - - if ( get_post_meta( $post_id, '_generate_element_user_conditions', true ) ) { - $this->users = get_post_meta( $post_id, '_generate_element_user_conditions', true ); - } - - $display = apply_filters( 'generate_header_element_display', GeneratePress_Conditions::show_data( $this->conditional, $this->exclude, $this->users ), $post_id ); - - /** - * Simplify filter name. - * - * @since 2.0.0 - */ - $display = apply_filters( - 'generate_element_display', - $display, - $post_id - ); - - if ( $display ) { - global $generate_elements; - - $generate_elements[ $post_id ] = array( - 'is_block_element' => false, - 'type' => 'header', - 'id' => $post_id, - ); - - $location = apply_filters( 'generate_page_hero_location', 'generate_after_header', $post_id ); - - add_action( $location, array( $this, 'build_hero' ), 9 ); - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue' ), 100 ); - add_action( 'wp', array( $this, 'after_setup' ), 100 ); - - self::$instances++; - } - - } - - /** - * Add necessary scripts and styles. - * - * @since 1.7 - */ - public function enqueue() { - $options = self::get_options(); - - wp_add_inline_style( 'generate-style', self::build_css() ); - - if ( $options['parallax'] ) { - wp_enqueue_script( 'generate-hero-parallax', plugin_dir_url( __FILE__ ) . 'assets/js/parallax.min.js', array(), GP_PREMIUM_VERSION, true ); - wp_localize_script( - 'generate-hero-parallax', - 'hero', - array( - 'parallax' => apply_filters( 'generate_hero_parallax_speed', 2 ), - ) - ); - } - } - - /** - * Builds the HTML structure for Page Headers. - * - * @since 1.7 - */ - public function build_hero() { - $options = self::get_options(); - - if ( empty( $options['content'] ) ) { - return; - } - - $options['container_classes'] = implode( - ' ', - array( - 'page-hero', - 'contained' === $options['container'] ? 'grid-container grid-parent' : '', - $options['classes'], - ) - ); - - $options['inner_container_classes'] = implode( - ' ', - array( - 'inside-page-hero', - 'full-width' !== $options['inner_container'] ? 'grid-container grid-parent' : '', - ) - ); - - $options['content'] = self::template_tags( $options['content'] ); - $options['content'] = do_shortcode( $options['content'] ); - - // phpcs:ignore -- No escaping needed. - echo apply_filters( - 'generate_page_hero_output', - sprintf( - '
-
- %3$s -
-
', - trim( $options['container_classes'] ), - trim( $options['inner_container_classes'] ), - $options['content'] - ), - $options - ); - } - - /** - * Builds all of our custom CSS for Page Headers. - * - * @since 1.7 - * - * @return string Dynamic CSS. - */ - public static function build_css() { - $options = self::get_options(); - - // Initiate our CSS class. - require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; - $css = new GeneratePress_Pro_CSS(); - - $image_url = false; - if ( $options['background_image'] && function_exists( 'get_the_post_thumbnail_url' ) ) { - if ( 'featured-image' === $options['background_image'] ) { - if ( is_singular() ) { - $image_url = get_the_post_thumbnail_url( get_the_ID(), 'full' ); - } - - if ( ! $image_url ) { - $image_url = get_the_post_thumbnail_url( self::$post_id, 'full' ); - } - } - - if ( 'custom-image' === $options['background_image'] ) { - $image_url = get_the_post_thumbnail_url( self::$post_id, 'full' ); - } - } - - $image_url = apply_filters( 'generate_page_hero_background_image_url', $image_url, $options ); - - // Figure out desktop units. - $options['padding_top_unit'] = $options['padding_top_unit'] ? $options['padding_top_unit'] : 'px'; - $options['padding_right_unit'] = $options['padding_right_unit'] ? $options['padding_right_unit'] : 'px'; - $options['padding_bottom_unit'] = $options['padding_bottom_unit'] ? $options['padding_bottom_unit'] : 'px'; - $options['padding_left_unit'] = $options['padding_left_unit'] ? $options['padding_left_unit'] : 'px'; - - // Figure out mobile units. - $options['padding_top_unit_mobile'] = $options['padding_top_unit_mobile'] ? $options['padding_top_unit_mobile'] : 'px'; - $options['padding_right_unit_mobile'] = $options['padding_right_unit_mobile'] ? $options['padding_right_unit_mobile'] : 'px'; - $options['padding_bottom_unit_mobile'] = $options['padding_bottom_unit_mobile'] ? $options['padding_bottom_unit_mobile'] : 'px'; - $options['padding_left_unit_mobile'] = $options['padding_left_unit_mobile'] ? $options['padding_left_unit_mobile'] : 'px'; - - $padding_inside = false; - $using_flexbox = false; - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - $using_flexbox = true; - - if ( function_exists( 'generate_get_option' ) && 'text' === generate_get_option( 'container_alignment' ) ) { - $padding_inside = true; - } - } - - $css->set_selector( '.page-hero' ); - - if ( $options['background_color'] ) { - $css->add_property( 'background-color', esc_attr( $options['background_color'] ) ); - } - - if ( $image_url ) { - $css->add_property( 'background-image', 'url(' . esc_url( $image_url ) . ')' ); - $css->add_property( 'background-size', 'cover' ); - - if ( $options['background_color'] && $options['background_overlay'] ) { - $css->add_property( 'background-image', 'linear-gradient(0deg, ' . $options['background_color'] . ',' . $options['background_color'] . '), url(' . $image_url . ')' ); - } - - if ( $options['background_position'] ) { - $css->add_property( 'background-position', esc_attr( $options['background_position'] ) ); - } - - $css->add_property( 'background-repeat', 'no-repeat' ); - } - - if ( $options['text_color'] ) { - $css->add_property( 'color', esc_attr( $options['text_color'] ) ); - } - - if ( $options['padding_top'] ) { - $css->add_property( 'padding-top', absint( $options['padding_top'] ), false, esc_html( $options['padding_top_unit'] ) ); - } - - if ( $options['padding_right'] ) { - $css->add_property( 'padding-right', absint( $options['padding_right'] ), false, esc_html( $options['padding_right_unit'] ) ); - } - - if ( $options['padding_bottom'] ) { - $css->add_property( 'padding-bottom', absint( $options['padding_bottom'] ), false, esc_html( $options['padding_bottom_unit'] ) ); - } - - if ( $options['padding_left'] ) { - $css->add_property( 'padding-left', absint( $options['padding_left'] ), false, esc_html( $options['padding_left_unit'] ) ); - } - - if ( $options['horizontal_alignment'] ) { - $css->add_property( 'text-align', esc_html( $options['horizontal_alignment'] ) ); - } - - if ( ! $using_flexbox ) { - $css->add_property( 'box-sizing', 'border-box' ); - } - - if ( $options['site_header_merge'] && $options['full_screen'] ) { - $css->add_property( 'min-height', '100vh' ); - - if ( $options['vertical_alignment'] ) { - $css->add_property( 'display', '-webkit-flex' ); - $css->add_property( 'display', '-ms-flex' ); - $css->add_property( 'display', 'flex' ); - - if ( 'center' === $options['vertical_alignment'] ) { - $css->add_property( '-webkit-box', 'center' ); - $css->add_property( '-ms-flex-pack', 'center' ); - $css->add_property( 'justify-content', 'center' ); - } elseif ( 'bottom' === $options['vertical_alignment'] ) { - $css->add_property( '-webkit-box', 'end' ); - $css->add_property( '-ms-flex-pack', 'end' ); - $css->add_property( 'justify-content', 'flex-end' ); - } - - $css->add_property( '-webkit-box-orient', 'vertical' ); - $css->add_property( '-webkit-box-direction', 'normal' ); - $css->add_property( '-ms-flex-direction', 'column' ); - $css->add_property( 'flex-direction', 'column' ); - - $css->set_selector( '.page-hero .inside-page-hero' ); - $css->add_property( 'width', '100%' ); - } - } - - if ( $padding_inside && function_exists( 'generate_get_option' ) ) { - $container_width = generate_get_option( 'container_width' ); - $padding_right = '0px'; - $padding_left = '0px'; - - if ( $options['padding_right'] ) { - $padding_right = absint( $options['padding_right'] ) . $options['padding_right_unit']; - } - - if ( $options['padding_left'] ) { - $padding_left = absint( $options['padding_left'] ) . $options['padding_left_unit']; - } - - $css->set_selector( '.page-hero .inside-page-hero.grid-container' ); - - $css->add_property( - 'max-width', - sprintf( - 'calc(%1$s - %2$s - %3$s)', - $container_width . 'px', - $padding_right, - $padding_left - ) - ); - } - - $css->set_selector( '.page-hero h1, .page-hero h2, .page-hero h3, .page-hero h4, .page-hero h5, .page-hero h6' ); - if ( $options['text_color'] ) { - $css->add_property( 'color', esc_attr( $options['text_color'] ) ); - } - - $css->set_selector( '.inside-page-hero > *:last-child' ); - $css->add_property( 'margin-bottom', '0px' ); - - $css->set_selector( '.page-hero a, .page-hero a:visited' ); - - if ( $options['link_color'] ) { - $css->add_property( 'color', esc_attr( $options['link_color'] ) ); - } - - if ( $options['content'] ) { - $css->set_selector( '.page-hero time.updated' ); - $css->add_property( 'display', 'none' ); - } - - $css->set_selector( '.page-hero a:hover' ); - - if ( $options['link_color_hover'] ) { - $css->add_property( 'color', esc_attr( $options['link_color_hover'] ) ); - } - - if ( '' !== $options['site_header_merge'] ) { - if ( 'merge-desktop' === $options['site_header_merge'] ) { - $css->start_media_query( apply_filters( 'generate_not_mobile_media_query', '(min-width: 769px)' ) ); - } - - $header_background = $options['header_background_color'] ? $options['header_background_color'] : 'transparent'; - - if ( $options['site_header_height'] ) { - $css->set_selector( '.page-hero' ); - - if ( $options['padding_top'] ) { - $css->add_property( 'padding-top', 'calc(' . absint( $options['padding_top'] ) . esc_html( $options['padding_top_unit'] ) . ' + ' . absint( $options['site_header_height'] ) . 'px)' ); - } else { - $css->add_property( 'padding-top', absint( $options['site_header_height'] ), false, 'px' ); - } - } - - $css->set_selector( '.header-wrap' ); - $css->add_property( 'position', 'absolute' ); - $css->add_property( 'left', '0px' ); - $css->add_property( 'right', '0px' ); - $css->add_property( 'z-index', '10' ); - - $css->set_selector( '.header-wrap .site-header' ); - $css->add_property( 'background', $header_background ); - - $css->set_selector( '.header-wrap .main-title a, .header-wrap .main-title a:hover, .header-wrap .main-title a:visited' ); - $css->add_property( 'color', esc_attr( $options['header_title_color'] ) ); - - if ( ! GeneratePress_Elements_Helper::does_option_exist( 'navigation-as-header' ) ) { - $css->set_selector( '.header-wrap .mobile-header-navigation:not(.navigation-stick):not(.toggled) .main-title a, .header-wrap .mobile-header-navigation:not(.navigation-stick):not(.toggled) .main-title a:hover, .header-wrap .mobile-header-navigation:not(.navigation-stick):not(.toggled) .main-title a:visited' ); - $css->add_property( 'color', esc_attr( $options['header_title_color'] ) ); - } - - if ( function_exists( 'generate_get_color_defaults' ) ) { - $color_settings = wp_parse_args( - get_option( 'generate_settings', array() ), - generate_get_color_defaults() - ); - - if ( GeneratePress_Elements_Helper::does_option_exist( 'navigation-as-header' ) ) { - $css->set_selector( '.header-wrap .toggled .main-title a, .header-wrap .toggled .main-title a:hover, .header-wrap .toggled .main-title a:visited, .header-wrap .navigation-stick .main-title a, .header-wrap .navigation-stick .main-title a:hover, .header-wrap .navigation-stick .main-title a:visited' ); - $css->add_property( 'color', esc_attr( $color_settings['site_title_color'] ) ); - } - } - - $css->set_selector( '.header-wrap .site-description' ); - $css->add_property( 'color', esc_attr( $options['header_tagline_color'] ) ); - - if ( $options['navigation_colors'] ) { - $navigation_background = $options['navigation_background_color'] ? $options['navigation_background_color'] : 'transparent'; - $navigation_background_hover = $options['navigation_background_color_hover'] ? $options['navigation_background_color_hover'] : 'transparent'; - $navigation_background_current = $options['navigation_background_color_current'] ? $options['navigation_background_color_current'] : 'transparent'; - - $css->set_selector( '.header-wrap #site-navigation:not(.toggled), .header-wrap #mobile-header:not(.toggled):not(.navigation-stick), .has-inline-mobile-toggle .mobile-menu-control-wrapper' ); - $css->add_property( 'background', $navigation_background ); - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - $css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li > a, .header-wrap #mobile-header:not(.toggled):not(.navigation-stick) .main-nav > ul > li > a, .header-wrap .main-navigation:not(.toggled):not(.navigation-stick) .menu-toggle, .header-wrap .main-navigation:not(.toggled):not(.navigation-stick) .menu-toggle:hover, .main-navigation:not(.toggled):not(.navigation-stick) .menu-bar-item:not(.close-search) > a' ); - } else { - $css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li > a, .header-wrap #mobile-header:not(.toggled):not(.navigation-stick) .main-nav > ul > li > a, .header-wrap .main-navigation:not(.toggled):not(.navigation-stick) .menu-toggle, .header-wrap .main-navigation:not(.toggled):not(.navigation-stick) .menu-toggle:hover, .main-navigation:not(.toggled):not(.navigation-stick) .mobile-bar-items a, .main-navigation:not(.toggled):not(.navigation-stick) .mobile-bar-items a:hover, .main-navigation:not(.toggled):not(.navigation-stick) .mobile-bar-items a:focus' ); - } - - $css->add_property( 'color', esc_attr( $options['navigation_text_color'] ) ); - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - $css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li:hover > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li:focus > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li.sfHover > a, .header-wrap #mobile-header:not(.toggled) .main-nav > ul > li:hover > a, .header-wrap #site-navigation:not(.toggled) .menu-bar-item:not(.close-search):hover > a, .header-wrap #mobile-header:not(.toggled) .menu-bar-item:not(.close-search):hover > a, .header-wrap #site-navigation:not(.toggled) .menu-bar-item:not(.close-search).sfHover > a, .header-wrap #mobile-header:not(.toggled) .menu-bar-item:not(.close-search).sfHover > a' ); - } else { - $css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li:hover > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li:focus > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li.sfHover > a, .header-wrap #mobile-header:not(.toggled) .main-nav > ul > li:hover > a' ); - } - - $css->add_property( 'background', $navigation_background_hover ); - - if ( '' !== $options['navigation_text_color_hover'] ) { - $css->add_property( 'color', esc_attr( $options['navigation_text_color_hover'] ) ); - } else { - $css->add_property( 'color', esc_attr( $options['navigation_text_color'] ) ); - } - - $css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li[class*="current-menu-"] > a, .header-wrap #mobile-header:not(.toggled) .main-nav > ul > li[class*="current-menu-"] > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li[class*="current-menu-"]:hover > a, .header-wrap #mobile-header:not(.toggled) .main-nav > ul > li[class*="current-menu-"]:hover > a' ); - $css->add_property( 'background', $navigation_background_current ); - - if ( '' !== $options['navigation_text_color_current'] ) { - $css->add_property( 'color', esc_attr( $options['navigation_text_color_current'] ) ); - } else { - $css->add_property( 'color', esc_attr( $options['navigation_text_color'] ) ); - } - } - - if ( $options['site_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'navigation-as-header' ) ) { - $css->set_selector( '.main-navigation .site-logo, .main-navigation.toggled .page-hero-logo, .main-navigation.navigation-stick .page-hero-logo' ); - $css->add_property( 'display', 'none' ); - - $css->set_selector( '.main-navigation .page-hero-logo, .main-navigation.toggled .site-logo:not(.page-hero-logo), #mobile-header .mobile-header-logo' ); - $css->add_property( 'display', 'block' ); - - if ( ! GeneratePress_Elements_Helper::does_option_exist( 'sticky-navigation-logo' ) ) { - $css->set_selector( '.main-navigation.navigation-stick .site-logo:not(.page-hero-logo)' ); - $css->add_property( 'display', 'block' ); - - $css->set_selector( '.main-navigation.navigation-stick .page-hero-logo' ); - $css->add_property( 'display', 'none' ); - } - } - - if ( $options['navigation_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'sticky-navigation' ) ) { - $css->set_selector( '#site-navigation:not(.navigation-stick):not(.toggled) .navigation-logo:not(.page-hero-navigation-logo)' ); - $css->add_property( 'display', 'none' ); - - $css->set_selector( '#sticky-navigation .page-hero-navigation-logo, #site-navigation.navigation-stick .page-hero-navigation-logo, #site-navigation.toggled .page-hero-navigation-logo' ); - $css->add_property( 'display', 'none' ); - } - - if ( $options['mobile_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'mobile-logo' ) ) { - $css->set_selector( '#mobile-header:not(.navigation-stick):not(.toggled) .mobile-header-logo:not(.page-hero-mobile-logo)' ); - $css->add_property( 'display', 'none' ); - - $css->set_selector( '#mobile-header.navigation-stick .page-hero-mobile-logo, #mobile-header.toggled .page-hero-mobile-logo' ); - $css->add_property( 'display', 'none' ); - } - - if ( $options['site_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'site-logo' ) ) { - $css->set_selector( '.site-logo:not(.page-hero-logo)' ); - $css->add_property( 'display', 'none' ); - } - - if ( 'merge-desktop' === $options['site_header_merge'] ) { - $css->stop_media_query(); - } - - if ( class_exists( 'Elementor\Plugin' ) ) { - $css->set_selector( '.elementor-editor-active .header-wrap' ); - $css->add_property( 'pointer-events', 'none' ); - } - } - - $css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); - - $css->set_selector( '.page-hero' ); - - if ( $options['padding_top_mobile'] || '0' === $options['padding_top_mobile'] ) { - $css->add_property( 'padding-top', absint( $options['padding_top_mobile'] ), false, esc_html( $options['padding_top_unit_mobile'] ) ); - } - - if ( 'merge' === $options['site_header_merge'] && $options['site_header_height_mobile'] ) { - if ( $options['padding_top_mobile'] || '0' === $options['padding_top_mobile'] ) { - $css->add_property( 'padding-top', 'calc(' . absint( $options['padding_top_mobile'] ) . esc_html( $options['padding_top_unit_mobile'] ) . ' + ' . absint( $options['site_header_height_mobile'] ) . 'px)' ); - } elseif ( $options['padding_top'] ) { - $css->add_property( 'padding-top', 'calc(' . absint( $options['padding_top'] ) . esc_html( $options['padding_top_unit'] ) . ' + ' . absint( $options['site_header_height_mobile'] ) . 'px)' ); - } else { - $css->add_property( 'padding-top', absint( $options['site_header_height_mobile'] ), false, 'px' ); - } - } - - if ( $options['padding_right_mobile'] || '0' === $options['padding_right_mobile'] ) { - $css->add_property( 'padding-right', absint( $options['padding_right_mobile'] ), false, esc_html( $options['padding_right_unit_mobile'] ) ); - } - - if ( $options['padding_bottom_mobile'] || '0' === $options['padding_bottom_mobile'] ) { - $css->add_property( 'padding-bottom', absint( $options['padding_bottom_mobile'] ), false, esc_html( $options['padding_bottom_unit_mobile'] ) ); - } - - if ( $options['padding_left_mobile'] || '0' === $options['padding_left_mobile'] ) { - $css->add_property( 'padding-left', absint( $options['padding_left_mobile'] ), false, esc_html( $options['padding_left_unit_mobile'] ) ); - } - - if ( GeneratePress_Elements_Helper::does_option_exist( 'site-logo' ) && 'merge-desktop' === $options['site_header_merge'] ) { - $css->set_selector( '.inside-header .page-hero-logo, .main-navigation .page-hero-logo, #mobile-header .page-hero-mobile-logo' ); - $css->add_property( 'display', 'none' ); - } - - $css->stop_media_query(); - - return apply_filters( 'generate_page_hero_css_output', $css->css_output(), $options ); - } - - /** - * Put all of our meta options within an array. - * - * @since 1.7 - * - * @return array All Page Header options. - */ - public static function get_options() { - $post_id = self::$post_id; - - return apply_filters( - 'generate_hero_options', - array( - 'element_id' => $post_id, - 'content' => get_post_meta( $post_id, '_generate_element_content', true ), - 'classes' => get_post_meta( $post_id, '_generate_hero_custom_classes', true ), - 'container' => get_post_meta( $post_id, '_generate_hero_container', true ), - 'inner_container' => get_post_meta( $post_id, '_generate_hero_inner_container', true ), - 'horizontal_alignment' => get_post_meta( $post_id, '_generate_hero_horizontal_alignment', true ), - 'full_screen' => get_post_meta( $post_id, '_generate_hero_full_screen', true ), - 'vertical_alignment' => get_post_meta( $post_id, '_generate_hero_vertical_alignment', true ), - 'padding_top' => get_post_meta( $post_id, '_generate_hero_padding_top', true ), - 'padding_top_unit' => get_post_meta( $post_id, '_generate_hero_padding_top_unit', true ), - 'padding_right' => get_post_meta( $post_id, '_generate_hero_padding_right', true ), - 'padding_right_unit' => get_post_meta( $post_id, '_generate_hero_padding_right_unit', true ), - 'padding_bottom' => get_post_meta( $post_id, '_generate_hero_padding_bottom', true ), - 'padding_bottom_unit' => get_post_meta( $post_id, '_generate_hero_padding_bottom_unit', true ), - 'padding_left' => get_post_meta( $post_id, '_generate_hero_padding_left', true ), - 'padding_left_unit' => get_post_meta( $post_id, '_generate_hero_padding_left_unit', true ), - 'padding_top_mobile' => get_post_meta( $post_id, '_generate_hero_padding_top_mobile', true ), - 'padding_top_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_top_unit_mobile', true ), - 'padding_right_mobile' => get_post_meta( $post_id, '_generate_hero_padding_right_mobile', true ), - 'padding_right_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_right_unit_mobile', true ), - 'padding_bottom_mobile' => get_post_meta( $post_id, '_generate_hero_padding_bottom_mobile', true ), - 'padding_bottom_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_bottom_unit_mobile', true ), - 'padding_left_mobile' => get_post_meta( $post_id, '_generate_hero_padding_left_mobile', true ), - 'padding_left_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_left_unit_mobile', true ), - 'background_image' => get_post_meta( $post_id, '_generate_hero_background_image', true ), - 'disable_featured_image' => get_post_meta( $post_id, '_generate_hero_disable_featured_image', true ), - 'background_overlay' => get_post_meta( $post_id, '_generate_hero_background_overlay', true ), - 'background_position' => get_post_meta( $post_id, '_generate_hero_background_position', true ), - 'parallax' => get_post_meta( $post_id, '_generate_hero_background_parallax', true ), - 'background_color' => get_post_meta( $post_id, '_generate_hero_background_color', true ), - 'text_color' => get_post_meta( $post_id, '_generate_hero_text_color', true ), - 'link_color' => get_post_meta( $post_id, '_generate_hero_link_color', true ), - 'link_color_hover' => get_post_meta( $post_id, '_generate_hero_background_link_color_hover', true ), - 'site_header_merge' => get_post_meta( $post_id, '_generate_site_header_merge', true ), - 'site_header_height' => get_post_meta( $post_id, '_generate_site_header_height', true ), - 'site_header_height_mobile' => get_post_meta( $post_id, '_generate_site_header_height_mobile', true ), - 'site_logo' => get_post_meta( $post_id, '_generate_site_logo', true ), - 'retina_logo' => get_post_meta( $post_id, '_generate_retina_logo', true ), - 'navigation_logo' => get_post_meta( $post_id, '_generate_navigation_logo', true ), - 'mobile_logo' => get_post_meta( $post_id, '_generate_mobile_logo', true ), - 'navigation_location' => get_post_meta( $post_id, '_generate_navigation_location', true ), - 'header_background_color' => get_post_meta( $post_id, '_generate_site_header_background_color', true ), - 'header_title_color' => get_post_meta( $post_id, '_generate_site_header_title_color', true ), - 'header_tagline_color' => get_post_meta( $post_id, '_generate_site_header_tagline_color', true ), - 'navigation_colors' => get_post_meta( $post_id, '_generate_navigation_colors', true ), - 'navigation_background_color' => get_post_meta( $post_id, '_generate_navigation_background_color', true ), - 'navigation_text_color' => get_post_meta( $post_id, '_generate_navigation_text_color', true ), - 'navigation_background_color_hover' => get_post_meta( $post_id, '_generate_navigation_background_color_hover', true ), - 'navigation_text_color_hover' => get_post_meta( $post_id, '_generate_navigation_text_color_hover', true ), - 'navigation_background_color_current' => get_post_meta( $post_id, '_generate_navigation_background_color_current', true ), - 'navigation_text_color_current' => get_post_meta( $post_id, '_generate_navigation_text_color_current', true ), - ) - ); - } - - /** - * Does the bulk of the work after everything has initialized. - * - * @since 1.7 - */ - public function after_setup() { - $options = self::get_options(); - - if ( $options['disable_featured_image'] && is_singular() ) { - remove_action( 'generate_after_entry_header', 'generate_blog_single_featured_image' ); - remove_action( 'generate_before_content', 'generate_blog_single_featured_image' ); - remove_action( 'generate_after_header', 'generate_blog_single_featured_image' ); - remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single' ); - remove_action( 'generate_after_header', 'generate_featured_page_header' ); - } - - if ( $options['site_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'site-logo' ) ) { - if ( '' !== $options['site_header_merge'] ) { - add_action( 'generate_after_logo', array( $this, 'add_site_logo' ) ); - } else { - add_filter( 'theme_mod_custom_logo', array( $this, 'replace_logo' ) ); - - if ( $options['retina_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'retina-logo' ) ) { - add_filter( 'generate_retina_logo', array( $this, 'replace_logo' ) ); - } - } - } - - if ( $options['navigation_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'navigation-logo' ) ) { - if ( $options['site_header_merge'] && GeneratePress_Elements_Helper::does_option_exist( 'sticky-navigation' ) ) { - add_action( 'generate_inside_navigation', array( $this, 'add_navigation_logo' ) ); - } else { - add_filter( 'generate_navigation_logo', array( $this, 'replace_logo' ) ); - } - } - - if ( $options['mobile_logo'] && GeneratePress_Elements_Helper::does_option_exist( 'mobile-logo' ) ) { - if ( 'merge' === $options['site_header_merge'] ) { - add_action( 'generate_inside_mobile_header', array( $this, 'add_mobile_header_logo' ) ); - } else { - add_filter( 'generate_mobile_header_logo', array( $this, 'replace_logo' ) ); - } - } - - if ( $options['navigation_location'] ) { - add_filter( 'generate_navigation_location', array( $this, 'navigation_location' ) ); - } - - if ( '' !== $options['site_header_merge'] ) { - add_action( 'generate_before_header', array( $this, 'merged_header_start' ), 1 ); - add_action( 'generate_after_header', array( $this, 'merged_header_end' ), 8 ); - - if ( 'contained' === $options['container'] ) { - add_filter( 'generate_header_class', array( $this, 'site_header_classes' ) ); - } - } - - if ( $options['content'] ) { - self::remove_template_elements(); - } - } - - /** - * Returns our custom logos if set within the Page Header. - * - * @since 1.7 - * - * @return string New URLs to images. - */ - public static function replace_logo() { - $filter = current_filter(); - $options = self::get_options(); - - if ( 'theme_mod_custom_logo' === $filter ) { - return $options['site_logo']; - } - - if ( 'generate_retina_logo' === $filter ) { - return wp_get_attachment_url( $options['retina_logo'] ); - } - - if ( 'generate_navigation_logo' === $filter ) { - return wp_get_attachment_url( $options['navigation_logo'] ); - } - - if ( 'generate_mobile_header_logo' === $filter ) { - return wp_get_attachment_url( $options['mobile_logo'] ); - } - } - - /** - * Adds a new site logo element if our header is merged on desktop only. - * - * @since 1.7 - */ - public static function add_site_logo() { - $options = self::get_options(); - - $logo_url = wp_get_attachment_url( $options['site_logo'] ); - $retina_logo_url = wp_get_attachment_url( $options['retina_logo'] ); - - if ( ! $logo_url ) { - return; - } - - $attr = apply_filters( - 'generate_page_hero_logo_attributes', - array( - 'class' => 'header-image is-logo-image', - 'alt' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), - 'src' => $logo_url, - 'title' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), - ) - ); - - if ( '' !== $retina_logo_url ) { - $attr['srcset'] = $logo_url . ' 1x, ' . $retina_logo_url . ' 2x'; - - // Add dimensions to image if retina is set. This fixes a container width bug in Firefox. - $data = wp_get_attachment_metadata( $options['site_logo'] ); - - if ( ! empty( $data ) ) { - $attr['width'] = $data['width']; - $attr['height'] = $data['height']; - } - } - - $attr = array_map( 'esc_attr', $attr ); - $html_attr = ''; - - foreach ( $attr as $name => $value ) { - $html_attr .= " $name=" . '"' . $value . '"'; - } - - // phpcs:ignore -- Escaping not needed. - echo apply_filters( - 'generate_page_hero_logo_output', - sprintf( - '', - esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ), - esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), - $html_attr - ), - $logo_url, - $html_attr - ); - } - - /** - * Adds the custom navigation logo if needed. - * Only needed if there's a sticky navigation. - * - * @since 1.7 - */ - public static function add_navigation_logo() { - $options = self::get_options(); - - printf( - '', - esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ), - esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), - esc_url( wp_get_attachment_url( $options['navigation_logo'] ) ), - esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ) - ); - } - - /** - * Adds the custom mobile header if needed. - * Only needed if there's a sticky navigation. - * - * @since 1.7 - */ - public static function add_mobile_header_logo() { - $options = self::get_options(); - - if ( 'title' === GeneratePress_Elements_Helper::does_option_exist( 'mobile-header-branding' ) ) { - return; - } - - printf( - '', - esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ), - esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), - esc_url( wp_get_attachment_url( $options['mobile_logo'] ) ), - esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ) - ); - } - - /** - * Set the navigation location if set. - * - * @since 1.7 - * - * @return string The navigation location. - */ - public static function navigation_location() { - $options = self::get_options(); - - if ( 'no-navigation' === $options['navigation_location'] ) { - return ''; - } else { - return $options['navigation_location']; - } - } - - /** - * The opening merged header element. - * - * @since 1.7 - */ - public static function merged_header_start() { - echo '
'; - } - - /** - * The closing merged header element. - * - * @since 1.7 - */ - public static function merged_header_end() { - echo '
'; - } - - /** - * Adds classes to the site header. - * - * @since 1.7 - * - * @param array $classes Existing classes. - * @return array New classes. - */ - public static function site_header_classes( $classes ) { - $classes[] = 'grid-container'; - $classes[] = 'grid-parent'; - - return $classes; - } - - /** - * Checks if template tags exist, and removes those elements from elsewhere. - * - * @since 1.7 - */ - public static function remove_template_elements() { - $options = self::get_options(); - - if ( strpos( $options['content'], '{{post_title}}' ) !== false ) { - if ( is_singular() ) { - add_filter( 'generate_show_title', '__return_false' ); - } - - remove_action( 'generate_archive_title', 'generate_archive_title' ); - remove_filter( 'get_the_archive_title', 'generate_filter_the_archive_title' ); - add_filter( 'post_class', array( self::$hero, 'remove_hentry' ) ); - } - - if ( strpos( $options['content'], '{{post_date}}' ) !== false ) { - add_filter( 'generate_post_date', '__return_false' ); - add_filter( 'post_class', array( self::$hero, 'remove_hentry' ) ); - } - - if ( strpos( $options['content'], '{{post_author}}' ) !== false ) { - add_filter( 'generate_post_author', '__return_false' ); - add_filter( 'post_class', array( self::$hero, 'remove_hentry' ) ); - } - - if ( strpos( $options['content'], '{{post_terms.category}}' ) !== false ) { - add_filter( 'generate_show_categories', '__return_false' ); - } - - if ( strpos( $options['content'], '{{post_terms.post_tag}}' ) !== false ) { - add_filter( 'generate_show_tags', '__return_false' ); - } - } - - /** - * Checks for template tags and replaces them. - * - * @since 1.7 - * - * @param string $content The content to check. - * @return mixed The content with the template tags replaced. - */ - public static function template_tags( $content ) { - $search = array(); - $replace = array(); - - $search[] = '{{post_title}}'; - $post_title = ''; - - if ( is_singular() ) { - $post_title = get_the_title(); - } elseif ( is_tax() || is_category() || is_tag() ) { - $post_title = get_queried_object()->name; - } elseif ( is_post_type_archive() ) { - $post_title = post_type_archive_title( '', false ); - } elseif ( is_archive() && function_exists( 'get_the_archive_title' ) ) { - $post_title = get_the_archive_title(); - - if ( is_author() ) { - $post_title = get_the_author(); - } - } elseif ( is_home() ) { - $post_title = __( 'Blog', 'gp-premium' ); - } - - $replace[] = apply_filters( 'generate_page_hero_post_title', $post_title ); - - if ( is_singular() ) { - $time_string = ''; - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = '' . $time_string; - } - - $time_string = sprintf( - $time_string, - esc_attr( get_the_date( 'c' ) ), - esc_html( get_the_date() ), - esc_attr( get_the_modified_date( 'c' ) ), - esc_html( get_the_modified_date() ) - ); - - $search[] = '{{post_date}}'; - $replace[] = apply_filters( 'generate_page_hero_post_date', $time_string ); - - // Author. - global $post; - $author_id = $post->post_author; - - $author = sprintf( - '', - esc_url( get_author_posts_url( $author_id ) ), - /* translators: author name */ - esc_attr( sprintf( __( 'View all posts by %s', 'gp-premium' ), get_the_author_meta( 'display_name', $author_id ) ) ), - esc_html( get_the_author_meta( 'display_name', $author_id ) ) - ); - - $search[] = '{{post_author}}'; - $replace[] = apply_filters( 'generate_page_hero_post_author', $author ); - - // Post terms. - if ( strpos( $content, '{{post_terms' ) !== false ) { - $data = preg_match_all( '/{{post_terms.([^}]*)}}/', $content, $matches ); - foreach ( $matches[1] as $match ) { - $search[] = '{{post_terms.' . $match . '}}'; - $terms = get_the_term_list( get_the_ID(), $match, apply_filters( 'generate_page_hero_terms_before', '' ), apply_filters( 'generate_page_hero_terms_separator', ', ' ), apply_filters( 'generate_page_hero_terms_after', '' ) ); - - if ( ! is_wp_error( $terms ) ) { - $replace[] = $terms; - } - } - } - - // Custom field. - if ( strpos( $content, '{{custom_field' ) !== false ) { - $data = preg_match_all( '/{{custom_field.([^}]*)}}/', $content, $matches ); - foreach ( $matches[1] as $match ) { - if ( null !== get_post_meta( get_the_ID(), $match, true ) && '_thumbnail_id' !== $match ) { - $search[] = '{{custom_field.' . $match . '}}'; - $value = get_post_meta( get_the_ID(), $match, true ); - add_filter( 'wp_kses_allowed_html', [ 'GeneratePress_Elements_Helper', 'expand_allowed_html' ], 10, 2 ); - $value = wp_kses_post( $value ); - remove_filter( 'wp_kses_allowed_html', [ 'GeneratePress_Elements_Helper', 'expand_allowed_html' ], 10, 2 ); - $replace[] = $value; - } - } - - $thumbnail_id = get_post_meta( get_the_ID(), '_thumbnail_id', true ); - if ( null !== $thumbnail_id ) { - $search[] = '{{custom_field._thumbnail_id}}'; - $replace[] = wp_get_attachment_image( $thumbnail_id, apply_filters( 'generate_hero_thumbnail_id_size', 'medium' ) ); - } - } - } - - // Taxonomy description. - if ( is_tax() || is_category() || is_tag() ) { - if ( strpos( $content, '{{custom_field' ) !== false ) { - $search[] = '{{custom_field.description}}'; - $replace[] = term_description( get_queried_object()->term_id, get_queried_object()->taxonomy ); - } - } - - return str_replace( $search, $replace, $content ); - } - - /** - * When the post title, author or date are in the Page Hero, they appear outside of the - * hentry element. This causes errors in Google Search Console. - * - * @since 1.7 - * - * @param array $classes Existing classes. - * @return array - */ - public function remove_hentry( $classes ) { - $classes = array_diff( $classes, array( 'hentry' ) ); - - return $classes; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-hooks.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-hooks.php deleted file mode 100644 index dca87caa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-hooks.php +++ /dev/null @@ -1,223 +0,0 @@ -hook = get_post_meta( $post_id, '_generate_hook', true ); - - if ( empty( $this->hook ) ) { - return; - } - - $this->content = get_post_meta( $post_id, '_generate_element_content', true ); - - if ( get_post_meta( $post_id, '_generate_custom_hook', true ) ) { - $this->custom_hook = get_post_meta( $post_id, '_generate_custom_hook', true ); - } - - if ( get_post_meta( $post_id, '_generate_hook_disable_site_header', true ) ) { - $this->disable_site_header = get_post_meta( $post_id, '_generate_hook_disable_site_header', true ); - } - - if ( get_post_meta( $post_id, '_generate_hook_disable_site_footer', true ) ) { - $this->disable_site_footer = get_post_meta( $post_id, '_generate_hook_disable_site_footer', true ); - } - - if ( get_post_meta( $post_id, '_generate_hook_priority', true ) || '0' === get_post_meta( $post_id, '_generate_hook_priority', true ) ) { - $this->priority = get_post_meta( $post_id, '_generate_hook_priority', true ); - } - - if ( get_post_meta( $post_id, '_generate_hook_execute_php', true ) ) { - $this->php = get_post_meta( $post_id, '_generate_hook_execute_php', true ); - } - - if ( get_post_meta( $post_id, '_generate_hook_execute_shortcodes', true ) ) { - $this->shortcodes = get_post_meta( $post_id, '_generate_hook_execute_shortcodes', true ); - } - - if ( get_post_meta( $post_id, '_generate_element_display_conditions', true ) ) { - $this->conditional = get_post_meta( $post_id, '_generate_element_display_conditions', true ); - } - - if ( get_post_meta( $post_id, '_generate_element_exclude_conditions', true ) ) { - $this->exclude = get_post_meta( $post_id, '_generate_element_exclude_conditions', true ); - } - - if ( get_post_meta( $post_id, '_generate_element_user_conditions', true ) ) { - $this->users = get_post_meta( $post_id, '_generate_element_user_conditions', true ); - } - - if ( 'custom' === $this->hook && $this->custom_hook ) { - $this->hook = $this->custom_hook; - } - - $display = apply_filters( 'generate_hook_element_display', GeneratePress_Conditions::show_data( $this->conditional, $this->exclude, $this->users ), $post_id ); - - /** - * Simplify filter name. - * - * @since 2.0.0 - */ - $display = apply_filters( - 'generate_element_display', - $display, - $post_id - ); - - if ( $display ) { - global $generate_elements; - - $generate_elements[ $post_id ] = array( - 'is_block_element' => false, - 'type' => 'hook', - 'id' => $post_id, - ); - - if ( 'generate_header' === $this->hook && $this->disable_site_header ) { - remove_action( 'generate_header', 'generate_construct_header' ); - } - - if ( 'generate_footer' === $this->hook && $this->disable_site_footer ) { - remove_action( 'generate_footer', 'generate_construct_footer' ); - add_filter( 'generate_footer_widgets', '__return_null' ); - } - - add_action( esc_attr( $this->hook ), array( $this, 'execute_hook' ), absint( $this->priority ) ); - } - - } - - /** - * Output our hook content. - * - * @since 1.7 - */ - public function execute_hook() { - - $content = $this->content; - - if ( $this->shortcodes ) { - $content = do_shortcode( $content ); - } - - if ( $this->php && GeneratePress_Elements_Helper::should_execute_php() ) { - ob_start(); - eval( '?>' . $content . 'conditional = get_post_meta( $post_id, '_generate_element_display_conditions', true ); - } - - if ( get_post_meta( $post_id, '_generate_element_exclude_conditions', true ) ) { - $this->exclude = get_post_meta( $post_id, '_generate_element_exclude_conditions', true ); - } - - if ( get_post_meta( $post_id, '_generate_element_user_conditions', true ) ) { - $this->users = get_post_meta( $post_id, '_generate_element_user_conditions', true ); - } - - if ( get_post_meta( $post_id, '_generate_sidebar_layout', true ) ) { - $this->sidebar_layout = get_post_meta( $post_id, '_generate_sidebar_layout', true ); - } - - if ( get_post_meta( $post_id, '_generate_footer_widgets', true ) ) { - $this->footer_widgets = get_post_meta( $post_id, '_generate_footer_widgets', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_site_header', true ) ) { - $this->disable_site_header = get_post_meta( $post_id, '_generate_disable_site_header', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_mobile_header', true ) ) { - $this->disable_mobile_header = get_post_meta( $post_id, '_generate_disable_mobile_header', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_top_bar', true ) ) { - $this->disable_top_bar = get_post_meta( $post_id, '_generate_disable_top_bar', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_primary_navigation', true ) ) { - $this->disable_primary_navigation = get_post_meta( $post_id, '_generate_disable_primary_navigation', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_secondary_navigation', true ) ) { - $this->disable_secondary_navigation = get_post_meta( $post_id, '_generate_disable_secondary_navigation', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_featured_image', true ) ) { - $this->disable_featured_image = get_post_meta( $post_id, '_generate_disable_featured_image', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_content_title', true ) ) { - $this->disable_content_title = get_post_meta( $post_id, '_generate_disable_content_title', true ); - } - - if ( get_post_meta( $post_id, '_generate_disable_footer', true ) ) { - $this->disable_footer = get_post_meta( $post_id, '_generate_disable_footer', true ); - } - - if ( get_post_meta( $post_id, '_generate_content_area', true ) ) { - $this->content_area = get_post_meta( $post_id, '_generate_content_area', true ); - } - - if ( get_post_meta( $post_id, '_generate_content_width', true ) ) { - $this->content_width = get_post_meta( $post_id, '_generate_content_width', true ); - } - - $display = apply_filters( 'generate_layout_element_display', GeneratePress_Conditions::show_data( $this->conditional, $this->exclude, $this->users ), $post_id ); - - /** - * Simplify filter name. - * - * @since 2.0.0 - */ - $display = apply_filters( - 'generate_element_display', - $display, - $post_id - ); - - if ( $display ) { - global $generate_elements; - - $generate_elements[ $post_id ] = array( - 'is_block_element' => false, - 'type' => 'layout', - 'id' => $post_id, - ); - - add_action( 'wp', array( $this, 'after_setup' ), 100 ); - add_action( 'wp_enqueue_scripts', array( $this, 'build_css' ), 50 ); - - if ( is_admin() ) { - add_action( 'current_screen', array( $this, 'after_setup' ), 100 ); - add_action( 'enqueue_block_editor_assets', array( $this, 'build_css' ), 50 ); - } - } - - } - - /** - * Return our available options. - * - * @since 1.7 - * @deprecated 1.7.3 - * - * @return array - */ - public static function get_options() { - return false; - } - - /** - * Initiate our set layout changes. - * - * @since 1.7 - */ - public function after_setup() { - if ( $this->sidebar_layout && ! self::post_meta_exists( '_generate-sidebar-layout-meta' ) ) { - add_filter( 'generate_sidebar_layout', array( $this, 'filter_options' ) ); - } - - if ( $this->footer_widgets && ! self::post_meta_exists( '_generate-footer-widget-meta' ) ) { - add_filter( 'generate_footer_widgets', array( $this, 'filter_options' ) ); - } - - if ( $this->disable_site_header ) { - remove_action( 'generate_header', 'generate_construct_header' ); - } - - if ( $this->disable_mobile_header ) { - remove_action( 'generate_after_header', 'generate_menu_plus_mobile_header', 5 ); - } - - if ( $this->disable_top_bar ) { - remove_action( 'generate_before_header', 'generate_top_bar', 5 ); - remove_action( 'generate_inside_secondary_navigation', 'generate_secondary_nav_top_bar_widget', 5 ); - } - - if ( $this->disable_primary_navigation ) { - add_filter( 'generate_navigation_location', '__return_false', 20 ); - add_filter( 'generate_disable_mobile_header_menu', '__return_true' ); - } - - if ( $this->disable_secondary_navigation ) { - add_filter( 'has_nav_menu', array( $this, 'disable_secondary_navigation' ), 10, 2 ); - } - - if ( $this->disable_featured_image ) { - remove_action( 'generate_after_entry_header', 'generate_blog_single_featured_image' ); - remove_action( 'generate_before_content', 'generate_blog_single_featured_image' ); - remove_action( 'generate_after_header', 'generate_blog_single_featured_image' ); - remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single' ); - remove_action( 'generate_after_header', 'generate_featured_page_header' ); - add_filter( 'body_class', array( $this, 'remove_featured_image_class' ), 20 ); - } - - if ( $this->disable_content_title ) { - add_filter( 'generate_show_title', '__return_false' ); - } - - if ( $this->disable_footer ) { - remove_action( 'generate_footer', 'generate_construct_footer' ); - add_filter( 'generate_footer_widgets', '__return_null' ); - } - - if ( $this->content_area ) { - add_filter( 'body_class', array( $this, 'body_classes' ) ); - } - - if ( is_admin() ) { - if ( $this->sidebar_layout && ! self::admin_post_meta_exists( '_generate-sidebar-layout-meta' ) ) { - add_filter( 'generate_block_editor_sidebar_layout', array( $this, 'filter_options' ) ); - } - - if ( $this->disable_content_title ) { - add_filter( 'generate_block_editor_show_content_title', '__return_false' ); - } - - if ( $this->content_area ) { - add_filter( 'generate_block_editor_content_area_type', array( $this, 'set_editor_content_area' ) ); - } - - if ( $this->content_width ) { - add_filter( 'generate_block_editor_container_width', array( $this, 'set_editor_content_width' ) ); - } - } - } - - /** - * Build dynamic CSS - */ - public function build_css() { - if ( $this->content_width ) { - wp_add_inline_style( 'generate-style', '#content {max-width: ' . absint( $this->content_width ) . 'px;margin-left: auto;margin-right: auto;}' ); - } - - if ( is_admin() ) { - $admin_css = ''; - - if ( version_compare( generate_premium_get_theme_version(), '3.2.0-alpha.1', '<' ) ) { - if ( 'full-width' === $this->content_area ) { - $admin_css .= 'html .editor-styles-wrapper .wp-block{max-width: 100%}'; - } - - if ( $this->content_width ) { - $admin_css .= 'html .editor-styles-wrapper .wp-block{max-width: ' . absint( $this->content_width ) . 'px;}'; - } - } - - if ( $this->content_area ) { - $admin_css .= '#generate-layout-page-builder-container {opacity: 0.5;pointer-events: none;}'; - } - - if ( $admin_css ) { - wp_add_inline_style( 'wp-edit-blocks', $admin_css ); - } - } - } - - /** - * Check to see if our individual post metabox has a value. - * - * @since 1.7 - * - * @param string $meta The meta key we're checking for. - * @return bool - */ - public static function post_meta_exists( $meta ) { - if ( ! is_singular() ) { - return false; - } - - $value = get_post_meta( get_the_ID(), $meta, true ); - - if ( '_generate-footer-widget-meta' === $meta && '0' === $value ) { - $value = true; - } - - if ( $value ) { - return true; - } - - return false; - } - - /** - * Check to see if our individual post metabox has a value in the admin area. - * - * @since 1.11.0 - * - * @param string $meta The meta key we're checking for. - * @return bool - */ - public static function admin_post_meta_exists( $meta ) { - if ( is_admin() ) { - $current_screen = get_current_screen(); - - if ( isset( $current_screen->is_block_editor ) && $current_screen->is_block_editor ) { - $post_id = false; - - if ( isset( $_GET['post'] ) ) { // phpcs:ignore -- No data processing happening here. - $post_id = absint( $_GET['post'] ); // phpcs:ignore -- No data processing happening here. - } - - if ( $post_id ) { - $value = get_post_meta( $post_id, $meta, true ); - - if ( '_generate-footer-widget-meta' === $meta && '0' === $value ) { - $value = true; - } - - if ( $value ) { - return true; - } - } else { - return false; - } - } - } - } - - /** - * Filter our filterable options. - * - * @since 1.7 - */ - public function filter_options() { - $filter = current_filter(); - - if ( 'generate_sidebar_layout' === $filter || 'generate_block_editor_sidebar_layout' === $filter ) { - return $this->sidebar_layout; - } - - if ( 'generate_footer_widgets' === $filter ) { - if ( 'no-widgets' === $this->footer_widgets ) { - return 0; - } else { - return $this->footer_widgets; - } - } - } - - /** - * Set the content area type in the editor. - * - * @param string $area Content area type. - */ - public function set_editor_content_area( $area ) { - if ( 'full-width' === $this->content_area ) { - $area = 'true'; - } - - if ( 'contained-container' === $this->content_area ) { - $area = 'contained'; - } - - return $area; - } - - /** - * Set the content width in the editor. - * - * @param string $width Content width with unit. - */ - public function set_editor_content_width( $width ) { - if ( $this->content_width ) { - $width = absint( $this->content_width ) . 'px'; - } - - return $width; - } - - /** - * Disable the Secondary Navigation if set. - * - * @since 1.7 - * - * @param bool $has_nav_menu The existing value. - * @param string $location The location we're checking. - * @return bool - */ - public static function disable_secondary_navigation( $has_nav_menu, $location ) { - if ( 'secondary' === $location ) { - return false; - } - - return $has_nav_menu; - } - - /** - * Sets any necessary body classes. - * - * @since 1.7 - * - * @param array $classes Our existing body classes. - * @return array Our new set of classes. - */ - public function body_classes( $classes ) { - if ( 'full-width' === $this->content_area ) { - $classes[] = 'full-width-content'; - } - - if ( 'contained' === $this->content_area ) { - $classes[] = 'contained-content'; - } - - return $classes; - } - - /** - * Remove the featured image class if it's disabled. - * - * @since 2.1.0 - * @param array $classes The body classes. - */ - public function remove_featured_image_class( $classes ) { - if ( is_singular() ) { - $classes = generate_premium_remove_featured_image_class( $classes, $this->disable_featured_image ); - } - - return $classes; - } - -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-metabox.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-metabox.php deleted file mode 100644 index 1d8d54ba..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/elements/class-metabox.php +++ /dev/null @@ -1,2245 +0,0 @@ -is_block_editor ) ) { - $element_type = 'block'; - } - } - } - - return $element_type; - } - - /** - * Add a body class if we're using the Header element type. - * We do this so we can hide the Template Tags metabox for other types. - * - * @since 1.7 - * - * @param string $classes Existing classes. - * @return string - */ - public function body_class( $classes ) { - if ( 'gp_elements' === get_post_type() ) { - $element_type = self::get_element_type(); - - if ( $element_type ) { - $classes .= ' ' . $element_type . '-element-type'; - } else { - $classes .= ' no-element-type'; - } - - if ( 'header' === $element_type && get_post_meta( get_the_ID(), '_generate_element_content', true ) ) { - $classes .= ' element-has-page-hero'; - } - - $block_type = get_post_meta( get_the_ID(), '_generate_block_type', true ); - - if ( $block_type ) { - if ( 'content-template' === $block_type && get_post_meta( get_the_ID(), '_generate_use_theme_post_container', true ) ) { - $classes .= ' using-theme-post-container'; - } - - if ( ( 'archive-navigation-template' === $block_type || 'post-navigation-template' === $block_type ) && get_post_meta( get_the_ID(), '_generate_use_archive_navigation_container', true ) ) { - $classes .= ' using-theme-pagination-container'; - } - - $classes .= ' ' . $block_type . '-block-type'; - } - } - - return $classes; - } - - /** - * Enqueue any necessary scripts and styles. - * - * @since 1.7 - * - * @param string $hook The current page hook. - */ - public function scripts( $hook ) { - if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) { - if ( 'gp_elements' === get_post_type() ) { - $element_type = get_post_meta( get_the_ID(), '_generate_element_type', true ); - - // Remove autosave when dealing with non-content Elements. - // phpcs:ignore -- No data processing happening. - if ( 'block' !== $element_type || ( isset( $_GET['element_type'] ) && 'block' !== $_GET['element_type'] ) ) { - wp_dequeue_script( 'autosave' ); - } - - $deps = array( 'jquery' ); - - if ( function_exists( 'wp_enqueue_code_editor' ) ) { - $settings = wp_enqueue_code_editor( - array( - 'type' => 'application/x-httpd-php', - 'codemirror' => array( - 'indentUnit' => 2, - 'tabSize' => 2, - ), - ) - ); - - $deps[] = 'code-editor'; - } else { - $settings = false; - } - - $element_type = self::get_element_type(); - - wp_enqueue_script( 'generate-elements-metabox', plugin_dir_url( __FILE__ ) . 'assets/admin/metabox.js', $deps, GP_PREMIUM_VERSION, true ); - - wp_localize_script( - 'generate-elements-metabox', - 'elements', - array( - 'nonce' => wp_create_nonce( 'generate-elements-location' ), - 'settings' => $settings ? wp_json_encode( $settings ) : false, - 'type' => $element_type, - 'custom_image' => __( 'Custom Image', 'gp-premium' ), - 'fallback_image' => __( 'Fallback Image', 'gp-premium' ), - 'choose' => __( 'Choose...', 'gp-premium' ), - 'showID' => apply_filters( 'generate_elements_show_object_ids', false ), - ) - ); - - wp_enqueue_style( 'generate-elements-metabox', plugin_dir_url( __FILE__ ) . 'assets/admin/metabox.css', array(), GP_PREMIUM_VERSION ); - wp_enqueue_style( 'generate-elements-balloon', plugin_dir_url( __FILE__ ) . 'assets/admin/balloon.css', array(), GP_PREMIUM_VERSION ); - - wp_enqueue_media(); - wp_enqueue_script( 'wp-color-picker' ); - wp_enqueue_style( 'wp-color-picker' ); - wp_enqueue_script( 'wp-color-picker-alpha', GP_LIBRARY_DIRECTORY_URL . 'alpha-color-picker/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '3.0.0', true ); - - wp_add_inline_script( - 'wp-color-picker-alpha', - 'jQuery( function() { jQuery( ".color-picker" ).wpColorPicker(); } );' - ); - - if ( function_exists( 'wp_add_inline_script' ) && function_exists( 'generate_get_default_color_palettes' ) ) { - // Grab our palette array and turn it into JS. - $palettes = wp_json_encode( generate_get_default_color_palettes() ); - - // Add our custom palettes. - // json_encode takes care of escaping. - wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' ); - } - - wp_enqueue_style( 'select2', GP_LIBRARY_DIRECTORY_URL . 'select2/select2.min.css', array(), '4.0.13' ); - wp_enqueue_script( 'select2', GP_LIBRARY_DIRECTORY_URL . 'select2/select2.full.min.js', array( 'jquery', 'generate-elements-metabox' ), '4.0.13', true ); - - $css = ''; - - if ( function_exists( 'generate_get_option' ) && 'separate-containers' === generate_get_option( 'content_layout_setting' ) ) { - $css .= 'body.left-sidebar-block-type .block-editor-block-list__layout.is-root-container, body.right-sidebar-block-type .block-editor-block-list__layout.is-root-container {background: ' . generate_get_option( 'background_color' ) . ';}'; - $css .= 'body.content-template-block-type:not(.using-theme-post-container) .block-editor-block-list__layout.is-root-container, body.archive-navigation-template-block-type:not(.using-theme-pagination-container) .block-editor-block-list__layout.is-root-container {background: ' . generate_get_option( 'background_color' ) . ';}'; - } - - wp_add_inline_style( 'generate-elements-metabox', $css ); - } - } - } - - /** - * Register our metabox. - * - * @since 1.7 - */ - public function register_metabox() { - // Title not translated on purpose. - add_meta_box( 'generate_premium_elements', 'Element', array( $this, 'element_fields' ), 'gp_elements', 'normal', 'high' ); - add_meta_box( 'generate_page_hero_template_tags', __( 'Template Tags', 'gp-premium' ), array( $this, 'template_tags' ), 'gp_elements', 'side', 'low' ); - remove_meta_box( 'slugdiv', 'gp_elements', 'normal' ); - } - - /** - * Output all of our metabox fields. - * - * @since 1.7 - * - * @param object $post Our post object. - */ - public function element_fields( $post ) { - wp_nonce_field( basename( __FILE__ ), 'generate_elements_nonce' ); - - $type = self::get_element_type(); - $page_hero_class = ''; - $merge = get_post_meta( get_the_ID(), '_generate_site_header_merge', true ); - $conditions_set = get_post_meta( get_the_ID(), '_generate_element_display_conditions', true ); - $post_status = get_post_status( get_the_ID() ); - - if ( 'header' === $type && get_post_meta( get_the_ID(), '_generate_element_content', true ) ) { - $page_hero_class = ' has-page-hero'; - } - ?> - - - -
-

-
- - -
- - - - - - - - - - - - - - - > - - - - - > - - - - - > - - - - - - - - - - - - - - - - - - - - - -
- - - /> -
- - - /> -
- - - - DISALLOW_FILE_EDIT' - ); - ?> - - /> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - > - - - - - - - - - - - - - - - - - > - - - - - > - - - - - > - - - - - > - - - - - > - - - - - - - - - - - - - - - - - - - - - - - - - -
- - ? - - -
- - - -
- - - -
- - - -
- - - /> -
- - - -
- - -
- - -
- -
-
-
- - - -
- - -
- -
-
- - - -
- - -
- -
-
- - - -
- - -
- -
-
- - - -
- - -
-
- - -
- - - -
- - - - - -
- - - -
- - - /> -
- - ? - - /> -
- - ? - - /> -
- - - -
- - - -
- - - -
- - - -
- - - - - - - - - > - - - - - > - - - - - - > - - - - - - - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - > - - - - - > - - - - - > - - - - - > - - - - - > - - - - - > - - - - -
- - ? - - -
- - ? - - -
- - -
- -
-
- - px -
-
- - -
- - - -
- - - -
- - - -
- - -
-
- '; - } - ?> -
- - /> - - -
-
- - -
-
- '; - } - ?> -
- - /> - - -
-
- - -
-
- '; - } - ?> -
- - /> - - -
-
- - -
-
- '; - } - ?> -
- - /> - - -
-
- - - -
- - - /> -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - - - - - - - - -
- - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
- - - - - - - - -
- - -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - /> -
- - - /> -
- - - /> -
- - - /> -
- - - /> -
- - - /> -
- - - /> -
- - - /> -
- - - - - - - - - - - - -
- - -
- -
- -
- -
- -
- -
-
- - - - px -
- - - - - - - - - - - - - - - - - - - > - - - - -
- - ? - - $value ) { - $type = explode( ':', $value['rule'] ); - - if ( in_array( 'post', $type ) || in_array( 'taxonomy', $type ) ) { - $show = true; - } else { - $show = false; - } - ?> -
- - - - - -
- -
- - - - - -
- - - - -
- - ? - - $value ) { - $type = explode( ':', $value['rule'] ); - - if ( in_array( 'post', $type ) || in_array( 'taxonomy', $type ) ) { - $show = true; - } else { - $show = false; - } - ?> -
- - - - - -
- -
- - - - - -
- - - - -
- - ? - - $value ) { - ?> -
- - - -
- -
- - - -
- - - - -
- - ? - - /> -
- - - - - - - - -
- 'text', - '_generate_custom_hook' => 'text', - '_generate_hook_priority' => 'number', - ); - - if ( 'hook' === $type_value ) { - $hook_values['_generate_hook_disable_site_header'] = 'key'; - $hook_values['_generate_hook_disable_site_footer'] = 'key'; - $hook_values['_generate_hook_execute_shortcodes'] = 'key'; - $hook_values['_generate_hook_execute_php'] = 'key'; - } - - // We don't want people to be able to use these hooks. - $blacklist = array( - 'muplugins_loaded', - 'registered_taxonomy', - 'plugins_loaded', - 'setup_theme', - 'after_setup_theme', - 'init', - 'widgets_init', - 'wp_loaded', - 'pre_get_posts', - 'wp', - 'template_redirect', - 'get_header', - 'wp_enqueue_scripts', - 'the_post', - 'dynamic_sidebar', - 'get_footer', - 'get_sidebar', - 'wp_print_footer_scripts', - 'shutdown', - ); - - foreach ( $hook_values as $key => $type ) { - $value = false; - - if ( isset( $_POST[ $key ] ) ) { - // Bail if we're using a blacklisted hook. - if ( '_generate_custom_hook' === $key ) { - if ( in_array( $_POST[ $key ], $blacklist ) ) { - continue; - } - } - - if ( 'number' === $type ) { - $value = absint( $_POST[ $key ] ); - } elseif ( 'key' === $type ) { - $value = sanitize_key( $_POST[ $key ] ); - } else { - $value = sanitize_text_field( $_POST[ $key ] ); - } - - // Need to temporarily change the $value so it returns true. - if ( '_generate_hook_priority' === $key ) { - if ( '0' === $_POST[ $key ] ) { - $value = 'zero'; - } - } - } - - if ( $value ) { - if ( 'zero' === $value ) { - $value = '0'; - } - - update_post_meta( $post_id, $key, $value ); - } else { - delete_post_meta( $post_id, $key ); - } - } - } - - // Page Header type. - if ( 'header' === $type_value ) { - $hero_values = array( - '_generate_hero_custom_classes' => 'attribute', - '_generate_hero_container' => 'text', - '_generate_hero_inner_container' => 'text', - '_generate_hero_horizontal_alignment' => 'text', - '_generate_hero_full_screen' => 'key', - '_generate_hero_vertical_alignment' => 'text', - '_generate_hero_padding_top' => 'number', - '_generate_hero_padding_top_unit' => 'text', - '_generate_hero_padding_right' => 'number', - '_generate_hero_padding_right_unit' => 'text', - '_generate_hero_padding_bottom' => 'number', - '_generate_hero_padding_bottom_unit' => 'text', - '_generate_hero_padding_left' => 'number', - '_generate_hero_padding_left_unit' => 'text', - '_generate_hero_padding_top_mobile' => 'number', - '_generate_hero_padding_top_unit_mobile' => 'text', - '_generate_hero_padding_right_mobile' => 'number', - '_generate_hero_padding_right_unit_mobile' => 'text', - '_generate_hero_padding_bottom_mobile' => 'number', - '_generate_hero_padding_bottom_unit_mobile' => 'text', - '_generate_hero_padding_left_mobile' => 'number', - '_generate_hero_padding_left_unit_mobile' => 'text', - '_generate_hero_background_image' => 'key', - '_generate_hero_disable_featured_image' => 'key', - '_generate_hero_background_color' => 'color', - '_generate_hero_text_color' => 'color', - '_generate_hero_link_color' => 'color', - '_generate_hero_background_link_color_hover' => 'color', - '_generate_hero_background_overlay' => 'key', - '_generate_hero_background_position' => 'text', - '_generate_hero_background_parallax' => 'key', - '_generate_site_header_merge' => 'key', - '_generate_site_header_height' => 'number', - '_generate_site_header_height_mobile' => 'number', - '_generate_navigation_colors' => 'key', - '_generate_site_logo' => 'number', - '_generate_retina_logo' => 'number', - '_generate_navigation_logo' => 'number', - '_generate_mobile_logo' => 'number', - '_generate_navigation_location' => 'key', - '_generate_site_header_background_color' => 'text', - '_generate_site_header_title_color' => 'text', - '_generate_site_header_tagline_color' => 'text', - '_generate_navigation_background_color' => 'text', - '_generate_navigation_text_color' => 'text', - '_generate_navigation_background_color_hover' => 'text', - '_generate_navigation_text_color_hover' => 'text', - '_generate_navigation_background_color_current' => 'text', - '_generate_navigation_text_color_current' => 'text', - ); - - foreach ( $hero_values as $key => $type ) { - $value = false; - - if ( isset( $_POST[ $key ] ) ) { - if ( 'number' === $type ) { - $value = absint( $_POST[ $key ] ); - } elseif ( 'key' === $type ) { - $value = sanitize_key( $_POST[ $key ] ); - } elseif ( 'attribute' === $type ) { - $value = esc_attr( $_POST[ $key ] ); - } else { - $value = sanitize_text_field( $_POST[ $key ] ); - } - } - - if ( - '_generate_hero_padding_top_mobile' === $key || - '_generate_hero_padding_right_mobile' === $key || - '_generate_hero_padding_bottom_mobile' === $key || - '_generate_hero_padding_left_mobile' === $key - ) { - if ( '0' === $_POST[ $key ] ) { - $value = 'zero'; - } - } - - if ( $value ) { - if ( 'zero' === $value ) { - $value = '0'; // String on purpose. - } - - update_post_meta( $post_id, $key, $value ); - } else { - delete_post_meta( $post_id, $key ); - } - } - } - - // Save Layout type. - if ( 'layout' === $type_value ) { - $layout_values = array( - '_generate_sidebar_layout' => 'key', - '_generate_footer_widgets' => 'key', - '_generate_disable_site_header' => 'key', - '_generate_disable_mobile_header' => 'key', - '_generate_disable_top_bar' => 'key', - '_generate_disable_primary_navigation' => 'key', - '_generate_disable_secondary_navigation' => 'key', - '_generate_disable_featured_image' => 'key', - '_generate_disable_content_title' => 'key', - '_generate_disable_footer' => 'key', - '_generate_content_area' => 'key', - '_generate_content_width' => 'number', - ); - - foreach ( $layout_values as $key => $type ) { - $value = false; - - if ( isset( $_POST[ $key ] ) ) { - if ( 'number' === $type ) { - $value = absint( $_POST[ $key ] ); - } elseif ( 'key' === $type ) { - $value = sanitize_key( $_POST[ $key ] ); - } else { - $value = sanitize_text_field( $_POST[ $key ] ); - } - } - - if ( $value ) { - update_post_meta( $post_id, $key, $value ); - } else { - delete_post_meta( $post_id, $key ); - } - } - } - - $ignore_languages = false; - - if ( isset( $_POST['_generate_element_ignore_languages'] ) ) { - $ignore_languages = sanitize_key( $_POST['_generate_element_ignore_languages'] ); - } - - if ( $ignore_languages ) { - update_post_meta( $post_id, '_generate_element_ignore_languages', $ignore_languages ); - } else { - delete_post_meta( $post_id, '_generate_element_ignore_languages' ); - } - - // Display conditions. - $conditions = get_post_meta( $post_id, '_generate_element_display_conditions', true ); - $new_conditions = array(); - - $rules = $_POST['display-condition']; - $objects = $_POST['display-condition-object']; - - $count = count( $rules ); - - for ( $i = 0; $i < $count; $i++ ) { - if ( '' !== $rules[ $i ] ) { - if ( in_array( $rules[ $i ], $rules ) ) { - $new_conditions[ $i ]['rule'] = sanitize_text_field( $rules[ $i ] ); - $new_conditions[ $i ]['object'] = sanitize_key( $objects[ $i ] ); - } else { - $new_conditions[ $i ]['rule'] = ''; - $new_conditions[ $i ]['object'] = ''; - } - } - } - - if ( 'block' === $type_value ) { - $dynamic_css_posts = get_option( 'generateblocks_dynamic_css_posts', array() ); - - if ( $dynamic_css_posts ) { - foreach ( $new_conditions as $condition ) { - if ( $condition['object'] && isset( $dynamic_css_posts[ $condition['object'] ] ) ) { - unset( $dynamic_css_posts[ $condition['object'] ] ); - } - - if ( ! $condition['object'] ) { - $dynamic_css_posts = array(); - break; - } - } - - update_option( 'generateblocks_dynamic_css_posts', $dynamic_css_posts ); - } - } - - if ( ! empty( $new_conditions ) && $new_conditions !== $conditions ) { - update_post_meta( $post_id, '_generate_element_display_conditions', $new_conditions ); - } elseif ( empty( $new_conditions ) && $conditions ) { - delete_post_meta( $post_id, '_generate_element_display_conditions', $conditions ); - } - - // Exclude conditions. - $exclude_conditions = get_post_meta( $post_id, '_generate_element_exclude_conditions', true ); - $new_exclude_conditions = array(); - - $exclude_rules = $_POST['exclude-condition']; - $exclude_objects = $_POST['exclude-condition-object']; - - $exclude_count = count( $exclude_rules ); - - for ( $i = 0; $i < $exclude_count; $i++ ) { - if ( '' !== $exclude_rules[ $i ] ) { - if ( in_array( $exclude_rules[ $i ], $exclude_rules ) ) { - $new_exclude_conditions[ $i ]['rule'] = sanitize_text_field( $exclude_rules[ $i ] ); - $new_exclude_conditions[ $i ]['object'] = sanitize_key( $exclude_objects[ $i ] ); - } else { - $new_exclude_conditions[ $i ]['rule'] = ''; - $new_exclude_conditions[ $i ]['object'] = ''; - } - } - } - - if ( ! empty( $new_exclude_conditions ) && $new_exclude_conditions !== $exclude_conditions ) { - update_post_meta( $post_id, '_generate_element_exclude_conditions', $new_exclude_conditions ); - } elseif ( empty( $new_exclude_conditions ) && $exclude_conditions ) { - delete_post_meta( $post_id, '_generate_element_exclude_conditions', $exclude_conditions ); - } - - // User conditions. - $user_conditions = get_post_meta( $post_id, '_generate_element_user_conditions', true ); - $new_user_conditions = array(); - - $user_rules = $_POST['user-condition']; - $user_count = count( $user_rules ); - - for ( $i = 0; $i < $user_count; $i++ ) { - if ( '' !== $user_rules[ $i ] ) { - if ( in_array( $user_rules[ $i ], $user_rules ) ) { - $new_user_conditions[ $i ] = sanitize_text_field( $user_rules[ $i ] ); - } else { - $new_user_conditions[ $i ] = ''; - } - } - } - - if ( ! empty( $new_user_conditions ) && $new_user_conditions !== $user_conditions ) { - update_post_meta( $post_id, '_generate_element_user_conditions', $new_user_conditions ); - } elseif ( empty( $new_user_conditions ) && $user_conditions ) { - delete_post_meta( $post_id, '_generate_element_user_conditions', $user_conditions ); - } - - // Internal notes. - $notes_key = '_generate_element_internal_notes'; - - if ( isset( $_POST[ $notes_key ] ) ) { - if ( function_exists( 'sanitize_textarea_field' ) ) { - $notes_value = sanitize_textarea_field( $_POST[ $notes_key ] ); - } else { - $notes_value = sanitize_text_field( $_POST[ $notes_key ] ); - } - - if ( $notes_value ) { - update_post_meta( $post_id, $notes_key, $notes_value ); - } else { - delete_post_meta( $post_id, $notes_key ); - } - } - } - - /** - * Get terms of a set taxonomy. - * - * @since 1.7 - */ - public function get_terms() { - check_ajax_referer( 'generate-elements-location', 'nonce' ); - - $current_user_can = 'manage_options'; - - if ( apply_filters( 'generate_elements_metabox_ajax_allow_editors', false ) ) { - $current_user_can = 'edit_posts'; - } - - if ( ! current_user_can( $current_user_can ) ) { - return; - } - - if ( ! isset( $_POST['id'] ) ) { - return; - } - - $tax_id = sanitize_text_field( $_POST['id'] ); - - echo wp_json_encode( self::get_taxonomy_terms( $tax_id ) ); - - die(); - } - - /** - * Get all posts inside a specific post type. - * - * @since 1.7 - */ - public function get_posts() { - check_ajax_referer( 'generate-elements-location', 'nonce' ); - - $current_user_can = 'manage_options'; - - if ( apply_filters( 'generate_elements_metabox_ajax_allow_editors', false ) ) { - $current_user_can = 'edit_posts'; - } - - if ( ! current_user_can( $current_user_can ) ) { - return; - } - - if ( ! isset( $_POST['id'] ) ) { - return; - } - - $post_type = sanitize_text_field( $_POST['id'] ); - - echo wp_json_encode( self::get_post_type_posts( $post_type ) ); - - die(); - } - - /** - * Get all of our posts and terms in one go on load. - * - * @since 2.0.0 - */ - public function get_all_objects() { - check_ajax_referer( 'generate-elements-location', 'nonce' ); - - $current_user_can = 'manage_options'; - - if ( apply_filters( 'generate_elements_metabox_ajax_allow_editors', false ) ) { - $current_user_can = 'edit_posts'; - } - - if ( ! current_user_can( $current_user_can ) ) { - return; - } - - if ( ! isset( $_POST['posts'] ) && ! isset( $_POST['terms'] ) ) { - return; - } - - $posts = array(); - $terms = array(); - - if ( ! empty( $_POST['posts'] ) ) { - $posts = array_map( 'sanitize_text_field', $_POST['posts'] ); - } - - if ( ! empty( $_POST['terms'] ) ) { - $terms = array_map( 'sanitize_text_field', $_POST['terms'] ); - } - - $all_posts = self::get_post_type_posts( $posts ); - $all_terms = self::get_taxonomy_terms( $terms ); - - echo wp_json_encode( array_merge( $all_posts, $all_terms ) ); - - die(); - } - - /** - * Look up posts inside a post type. - * - * @since 1.7 - * - * @param string|array $post_type The post type to look up. - * @return array - */ - public static function get_post_type_posts( $post_type ) { - if ( ! is_array( $post_type ) ) { - $post_type = array( $post_type ); - } - - $data = array(); - - foreach ( $post_type as $type ) { - global $wpdb; - - $post_status = array( 'publish', 'future', 'draft', 'pending', 'private' ); - - $object = get_post_type_object( $type ); - - $data[ $type ] = array( - 'type' => 'posts', - 'postType' => $type, - 'label' => $object->label, - 'objects' => array(), - ); - - if ( 'attachment' === $type ) { - $posts = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_title from $wpdb->posts where post_type = %s ORDER BY post_title", $type ) ); - - } else { - $format = implode( ', ', array_fill( 0, count( $post_status ), '%s' ) ); - $query = sprintf( "SELECT ID, post_title from $wpdb->posts where post_type = '%s' AND post_status IN(%s) ORDER BY post_title", $type, $format ); - // @codingStandardsIgnoreLine - $posts = $wpdb->get_results( $wpdb->prepare( $query, $post_status ) ); - } - - foreach ( $posts as $post ) { - $title = ( '' !== $post->post_title ) ? esc_attr( $post->post_title ) : $type . '-' . $post->ID; - $data[ $type ]['objects'][] = array( - 'id' => $post->ID, - 'name' => $title, - ); - } - } - - return $data; - } - - /** - * Get taxonomy terms for a specific taxonomy. - * - * @since 1.7 - * - * @param int|array $tax_id The taxonomy ID. - * @return array - */ - public static function get_taxonomy_terms( $tax_id ) { - if ( ! is_array( $tax_id ) ) { - $tax_id = array( $tax_id ); - } - - $data = array(); - - foreach ( $tax_id as $id ) { - $tax = get_taxonomy( $id ); - - $terms = get_terms( - array( - 'taxonomy' => $id, - 'hide_empty' => false, - ) - ); - - $data[ $id ] = array( - 'type' => 'terms', - 'taxonomy' => $id, - 'label' => $tax->label, - 'objects' => array(), - ); - - foreach ( $terms as $term ) { - $data[ $id ]['objects'][] = array( - 'id' => $term->term_id, - 'name' => esc_attr( $term->name ), - ); - } - } - - return $data; - } - - /** - * Build our entire list of hooks to display. - * - * @since 1.7 - * - * @return array Our list of hooks. - */ - public static function get_available_hooks() { - return GeneratePress_Elements_Helper::get_available_hooks(); - } - - /** - * Add available template tags to Header Elements. - * - * @since 1.7 - */ - public static function template_tags() { - ?> - -

- -

- - -

- -

- - -

- -

- - -

- -

- - -

- -

- _x( 'Elements', 'Post Type General Name', 'gp-premium' ), - 'singular_name' => _x( 'Element', 'Post Type Singular Name', 'gp-premium' ), - 'menu_name' => __( 'Elements', 'gp-premium' ), - 'all_items' => __( 'All Elements', 'gp-premium' ), - 'add_new' => __( 'Add New Element', 'gp-premium' ), - 'add_new_item' => __( 'Add New Element', 'gp-premium' ), - 'new_item' => __( 'New Element', 'gp-premium' ), - 'edit_item' => __( 'Edit Element', 'gp-premium' ), - 'update_item' => __( 'Update Element', 'gp-premium' ), - 'search_items' => __( 'Search Element', 'gp-premium' ), - 'featured_image' => __( 'Background Image', 'gp-premium' ), - 'set_featured_image' => __( 'Set background image', 'gp-premium' ), - 'remove_featured_image' => __( 'Remove background image', 'gp-premium' ), - 'item_published' => __( 'Element published.', 'gp-premium' ), - 'item_updated' => __( 'Element updated.', 'gp-premium' ), - 'item_scheduled' => __( 'Element scheduled.', 'gp-premium' ), - 'item_reverted_to_draft' => __( 'Element reverted to draft.', 'gp-premium' ), - ); - - $args = array( - 'labels' => $labels, - 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes', 'revisions' ), - 'hierarchical' => true, - 'public' => false, - 'show_ui' => true, - 'show_in_menu' => false, - 'can_export' => true, - 'has_archive' => false, - 'exclude_from_search' => true, - 'show_in_rest' => true, - ); - - register_post_type( 'gp_elements', $args ); - } - - /** - * Disable editor and show_in_rest support for non-Block Elements. - * - * @since 1.11.0 - * @param array $args The existing args. - * @param string $post_type The current post type. - */ - public function set_standard_element( $args, $post_type ) { - if ( 'gp_elements' === $post_type ) { - $post_id = false; - $type = false; - - if ( isset( $_GET['post'] ) ) { // phpcs:ignore -- No processing happening. - $post_id = absint( $_GET['post'] ); // phpcs:ignore -- No processing happening. - } - - if ( $post_id ) { - $type = get_post_meta( $post_id, '_generate_element_type', true ); - } elseif ( isset( $_GET['element_type'] ) ) { // phpcs:ignore -- No processing happening. - $type = esc_html( $_GET['element_type'] ); // phpcs:ignore -- No processing happening. - } - - if ( ! $type ) { - return $args; - } - - if ( 'block' !== $type ) { - $args['supports'] = array( 'title', 'thumbnail' ); - $args['show_in_rest'] = false; - $args['hierarchical'] = false; - } - - if ( 'block' === $type ) { - $args['supports'] = array( 'title', 'editor', 'custom-fields', 'page-attributes', 'revisions' ); - } - - if ( 'layout' === $type ) { - $args['labels']['add_new_item'] = __( 'Add New Layout', 'gp-premium' ); - $args['labels']['edit_item'] = __( 'Edit Layout', 'gp-premium' ); - } - - if ( 'hook' === $type ) { - $args['labels']['add_new_item'] = __( 'Add New Hook', 'gp-premium' ); - $args['labels']['edit_item'] = __( 'Edit Hook', 'gp-premium' ); - } - - if ( 'header' === $type ) { - $args['labels']['add_new_item'] = __( 'Add New Header', 'gp-premium' ); - $args['labels']['edit_item'] = __( 'Edit Header', 'gp-premium' ); - } - } - - return $args; - } - - /** - * Register custom post type columns. - * - * @since 1.7 - * - * @param array $columns Existing CPT columns. - * @return array All our CPT columns. - */ - public function register_columns( $columns ) { - $columns['element_type'] = esc_html__( 'Type', 'gp-premium' ); - $columns['location'] = esc_html__( 'Location', 'gp-premium' ); - $columns['exclusions'] = esc_html__( 'Exclusions', 'gp-premium' ); - $columns['users'] = esc_html__( 'Users', 'gp-premium' ); - - $new_columns = array(); - - // Need to do some funky stuff to display these columns before the date. - foreach ( $columns as $key => $value ) { - if ( 'date' === $key ) { - $new_columns['element_type'] = esc_html__( 'Type', 'gp-premium' ); - $new_columns['location'] = esc_html__( 'Location', 'gp-premium' ); - $new_columns['exclusions'] = esc_html__( 'Exclusions', 'gp-premium' ); - $new_columns['users'] = esc_html__( 'Users', 'gp-premium' ); - } - - $new_columns[ $key ] = $value; - } - - return $new_columns; - } - - /** - * Add a filter select input to the admin list. - * - * @since 1.7 - */ - public function build_element_type_filter() { - $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; - - if ( ! $screen ) { - return; - } - - if ( ! isset( $screen->post_type ) || 'gp_elements' !== $screen->post_type ) { - return; - } - - $values = array( - 'block' => esc_html__( 'Blocks', 'gp-premium' ), - 'header' => esc_html__( 'Headers', 'gp-premium' ), - 'hook' => esc_html__( 'Hooks', 'gp-premium' ), - 'layout' => esc_html__( 'Layouts', 'gp-premium' ), - ); - - $current_element_type = isset( $_GET['gp_element_type_filter'] ) ? esc_html( $_GET['gp_element_type_filter'] ) : ''; // phpcs:ignore -- No processing happening. - $current_block_type = isset( $_GET['gp_elements_block_type_filter'] ) ? esc_html( $_GET['gp_elements_block_type_filter'] ) : ''; // phpcs:ignore -- No processing happening. - ?> - - - - is_main_query() && '' !== $type ) { - $meta_query[] = array( - 'key' => '_generate_element_type', - 'value' => esc_attr( $type ), - 'compare' => '=', - ); - - $block_type = isset( $_GET['gp_elements_block_type_filter'] ) ? $_GET['gp_elements_block_type_filter'] : ''; // phpcs:ignore -- No processing happening. - - if ( 'block' === $type && '' !== $block_type ) { - $meta_query['relation'] = 'AND'; - - $meta_query[] = array( - 'key' => '_generate_block_type', - 'value' => esc_attr( $block_type ), - 'compare' => '=', - ); - } - - $query->set( 'meta_query', $meta_query ); - } - } - - /** - * Add content to our custom post type columns. - * - * @since 1.7 - * - * @param string $column The name of the column. - * @param int $post_id The ID of the post row. - */ - public function add_columns( $column, $post_id ) { - switch ( $column ) { - case 'element_type': - $type = get_post_meta( $post_id, '_generate_element_type', true ); - $hook_location = get_post_meta( $post_id, '_generate_hook', true ); - - if ( 'block' === $type ) { - echo esc_html__( 'Block', 'gp-premium' ); - - $block_type = get_post_meta( $post_id, '_generate_block_type', true ); - - if ( $block_type ) { - echo ' - ' . esc_html( GeneratePress_Elements_Helper::get_element_type_label( $block_type ) ); - - if ( 'hook' === $block_type && $hook_location ) { - echo '
'; - - if ( 'custom' === $hook_location ) { - $custom_hook = get_post_meta( $post_id, '_generate_custom_hook', true ); - echo '' . esc_html( $custom_hook ) . ''; - } else { - echo '' . esc_html( $hook_location ) . ''; - } - } - } - } - - if ( 'header' === $type ) { - echo esc_html__( 'Header', 'gp-premium' ); - } - - if ( 'hook' === $type ) { - echo esc_html__( 'Hook', 'gp-premium' ); - - if ( $hook_location ) { - echo '
'; - - if ( 'custom' === $hook_location ) { - $custom_hook = get_post_meta( $post_id, '_generate_custom_hook', true ); - echo '' . esc_html( $custom_hook ) . ''; - } else { - echo '' . esc_html( $hook_location ) . ''; - } - } - } - - if ( 'layout' === $type ) { - echo esc_html__( 'Layout', 'gp-premium' ); - } - break; - - case 'location': - $location = get_post_meta( $post_id, '_generate_element_display_conditions', true ); - $parent_block = wp_get_post_parent_id( $post_id ); - - if ( $location ) { - foreach ( (array) $location as $data ) { - echo esc_html( GeneratePress_Conditions::get_saved_label( $data ) ); - echo '
'; - } - } elseif ( ! empty( $parent_block ) ) { - echo esc_html__( 'Inherit from parent', 'gp-premium' ); - } else { - echo esc_html__( 'Not set', 'gp-premium' ); - } - break; - - case 'exclusions': - $location = get_post_meta( $post_id, '_generate_element_exclude_conditions', true ); - - if ( $location ) { - foreach ( (array) $location as $data ) { - echo esc_html( GeneratePress_Conditions::get_saved_label( $data ) ); - echo '
'; - } - } - break; - - case 'users': - $users = get_post_meta( $post_id, '_generate_element_user_conditions', true ); - - if ( $users ) { - foreach ( (array) $users as $data ) { - if ( strpos( $data, ':' ) !== false ) { - $data = substr( $data, strpos( $data, ':' ) + 1 ); - } - - $return = ucwords( str_replace( '_', ' ', $data ) ); - - echo esc_html( $return ) . '
'; - } - } - break; - } - } - - /** - * Create our admin menu item. - * - * @since 1.7 - */ - public function menu_item() { - add_submenu_page( - 'themes.php', - esc_html__( 'Elements', 'gp-premium' ), - esc_html__( 'Elements', 'gp-premium' ), - apply_filters( 'generate_elements_admin_menu_capability', 'manage_options' ), - 'edit.php?post_type=gp_elements' - ); - } - - /** - * Make sure our admin menu item is highlighted. - * - * @since 1.7 - */ - public function fix_current_item() { - global $parent_file, $submenu_file, $post_type; - - if ( 'gp_elements' === $post_type ) { - $parent_file = 'themes.php'; // phpcs:ignore - $submenu_file = 'edit.php?post_type=gp_elements'; // phpcs:ignore - } - } - - /** - * Add scripts to the edit/post area of Elements. - * - * @since 1.11.0 - * @param string $hook The current hook for the page. - */ - public function admin_scripts( $hook ) { - if ( ! function_exists( 'get_current_screen' ) ) { - return; - } - - $current_screen = get_current_screen(); - - if ( 'edit.php' === $hook || 'post.php' === $hook ) { - if ( 'gp_elements' === $current_screen->post_type ) { - wp_enqueue_script( 'generate-elements', plugin_dir_url( __FILE__ ) . 'assets/admin/elements.js', array( 'jquery' ), GP_PREMIUM_VERSION, true ); - wp_enqueue_style( 'generate-elements', plugin_dir_url( __FILE__ ) . 'assets/admin/elements.css', array(), GP_PREMIUM_VERSION ); - } - } - } - - /** - * Build the Add New Element modal. - * - * @since 1.11.0 - */ - public function element_modal() { - if ( ! function_exists( 'get_current_screen' ) ) { - return; - } - - $current_screen = get_current_screen(); - - if ( 'edit-gp_elements' === $current_screen->id || 'gp_elements' === $current_screen->id ) { - ?> - - 'gp_elements', - 'no_found_rows' => true, - 'post_status' => 'publish', - 'numberposts' => 500, // phpcs:ignore - 'fields' => 'ids', - 'suppress_filters' => false, - ); - - $custom_args = apply_filters( - 'generate_elements_custom_args', - array( - 'order' => 'ASC', - ) - ); - - $args = array_merge( $args, $custom_args ); - - // Prevent Polylang from altering the query. - if ( function_exists( 'pll_get_post_language' ) ) { - $args['lang'] = ''; - } - - $posts = get_posts( $args ); - - foreach ( $posts as $post_id ) { - $post_id = apply_filters( 'generate_element_post_id', $post_id ); - $type = get_post_meta( $post_id, '_generate_element_type', true ); - - if ( 'hook' === $type ) { - new GeneratePress_Hook( $post_id ); - } - - if ( 'header' === $type && ! GeneratePress_Hero::$instances ) { - new GeneratePress_Hero( $post_id ); - } - - if ( 'layout' === $type ) { - new GeneratePress_Site_Layout( $post_id ); - } - - if ( 'block' === $type ) { - new GeneratePress_Block_Element( $post_id ); - } - } -} - -add_filter( 'generate_dashboard_tabs', 'generate_elements_dashboard_tab' ); -/** - * Add the Sites tab to our Dashboard tabs. - * - * @since 1.6 - * - * @param array $tabs Existing tabs. - * @return array New tabs. - */ -function generate_elements_dashboard_tab( $tabs ) { - $screen = get_current_screen(); - - $tabs['Elements'] = array( - 'name' => __( 'Elements', 'gp-premium' ), - 'url' => admin_url( 'edit.php?post_type=gp_elements' ), - 'class' => 'edit-gp_elements' === $screen->id ? 'active' : '', - ); - - return $tabs; -} - -add_filter( 'generate_dashboard_screens', 'generate_elements_dashboard_screen' ); -/** - * Add the Sites tab to our Dashboard screens. - * - * @since 2.1.0 - * - * @param array $screens Existing screens. - * @return array New screens. - */ -function generate_elements_dashboard_screen( $screens ) { - $screens[] = 'edit-gp_elements'; - - return $screens; -} - -add_filter( 'generate_element_post_id', 'generate_elements_ignore_languages' ); -/** - * Disable Polylang elements if their language doesn't match. - * We disable their automatic quering so Elements with no language display by default. - * - * @since 1.8 - * - * @param int $post_id The current post ID. - * @return bool|int - */ -function generate_elements_ignore_languages( $post_id ) { - if ( function_exists( 'pll_get_post_language' ) && function_exists( 'pll_current_language' ) ) { - $language = pll_get_post_language( $post_id, 'locale' ); - $disable = get_post_meta( $post_id, '_generate_element_ignore_languages', true ); - - if ( $disable ) { - return $post_id; - } - - if ( $language && $language !== pll_current_language( 'locale' ) ) { // phpcs:ignore -- Using Yoda check I am. - return false; - } - } - - return $post_id; -} - -add_action( 'save_post_wp_block', 'generate_elements_wp_block_update', 10, 2 ); -/** - * Regenerate the GenerateBlocks CSS file when a re-usable block is saved. - * - * @since 1.11.0 - * @param int $post_id The post ID. - * @param object $post The post object. - */ -function generate_elements_wp_block_update( $post_id, $post ) { - $is_autosave = wp_is_post_autosave( $post_id ); - $is_revision = wp_is_post_revision( $post_id ); - - if ( $is_autosave || $is_revision || ! current_user_can( 'edit_post', $post_id ) ) { - return $post_id; - } - - if ( isset( $post->post_content ) ) { - if ( strpos( $post->post_content, 'wp:generateblocks' ) !== false ) { - global $wpdb; - - $option = get_option( 'generateblocks_dynamic_css_posts', array() ); - - $posts = $wpdb->get_col( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_generateblocks_reusable_blocks'" ); - - foreach ( (array) $posts as $id ) { - $display_conditions = get_post_meta( $id, '_generate_element_display_conditions', true ); - - if ( $display_conditions ) { - foreach ( (array) $display_conditions as $condition ) { - if ( 'general:site' === $condition['rule'] ) { - $option = array(); - break; - } - - if ( $condition['object'] && isset( $option[ $condition['object'] ] ) ) { - unset( $option[ $condition['object'] ] ); - } - } - } - } - - update_option( 'generateblocks_dynamic_css_posts', $option ); - } - } - -} - -add_filter( 'generate_do_block_element_content', 'generate_add_block_element_content_filters' ); -/** - * Apply content filters to our block elements. - * - * @since 1.11.0 - * @param string $content The block element content. - */ -function generate_add_block_element_content_filters( $content ) { - $content = shortcode_unautop( $content ); - $content = do_shortcode( $content ); - - if ( function_exists( 'wp_filter_content_tags' ) ) { - $content = wp_filter_content_tags( $content ); - } elseif ( function_exists( 'wp_make_content_images_responsive' ) ) { - $content = wp_make_content_images_responsive( $content ); - } - - return $content; -} - -add_action( 'admin_bar_menu', 'generate_add_elements_admin_bar', 100 ); -/** - * Add the Elementd admin bar item. - * - * @since 2.0.0 - */ -function generate_add_elements_admin_bar() { - $current_user_can = 'manage_options'; - - if ( apply_filters( 'generate_elements_metabox_ajax_allow_editors', false ) ) { - $current_user_can = 'edit_posts'; - } - - if ( ! current_user_can( $current_user_can ) ) { - return; - } - - global $wp_admin_bar; - global $generate_elements; - - $title = __( 'Elements', 'gp-premium' ); - $count = ! empty( $generate_elements ) ? count( $generate_elements ) : 0; - - // Prevent "Entire Site" Elements from being counted on non-edit pages in the admin. - if ( is_admin() && function_exists( 'get_current_screen' ) ) { - $screen = get_current_screen(); - - if ( ! isset( $screen->is_block_editor ) || ! $screen->is_block_editor ) { - $count = 0; - } - - if ( 'edit' !== $screen->parent_base ) { - $count = 0; - } - } - - if ( $count > 0 ) { - $title = sprintf( - /* translators: Active Element count. */ - __( 'Elements (%s)', 'gp-premium' ), - $count - ); - } - - $wp_admin_bar->add_menu( - array( - 'id' => 'gp_elements-menu', - 'title' => $title, - 'href' => esc_url( admin_url( 'edit.php?post_type=gp_elements' ) ), - ) - ); - - if ( ! empty( $generate_elements ) ) { - // Prevent "Entire Site" Elements from being counted on non-edit pages in the admin. - if ( is_admin() && function_exists( 'get_current_screen' ) ) { - $screen = get_current_screen(); - - if ( ! isset( $screen->is_block_editor ) || ! $screen->is_block_editor ) { - return; - } - - if ( 'edit' !== $screen->parent_base ) { - return; - } - } - - foreach ( (array) $generate_elements as $key => $data ) { - $label = GeneratePress_Elements_Helper::get_element_type_label( $data['type'] ); - - $wp_admin_bar->add_menu( - array( - 'id' => 'element-' . absint( $data['id'] ), - 'parent' => 'gp_elements-menu', - 'title' => get_the_title( $data['id'] ) . ' (' . $label . ')', - 'href' => get_edit_post_link( $data['id'] ), - ) - ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/class-external-file-css.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/class-external-file-css.php deleted file mode 100644 index 9f59b66c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/class-external-file-css.php +++ /dev/null @@ -1,449 +0,0 @@ -register_control_type( 'GeneratePress_Action_Button_Control' ); - } - - $wp_customize->add_setting( - 'generate_settings[css_print_method]', - array( - 'default' => $defaults['css_print_method'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_settings[css_print_method]', - array( - 'type' => 'select', - 'label' => __( 'Dynamic CSS Print Method', 'gp-premium' ), - 'description' => __( 'Generating your dynamic CSS in an external file offers significant performance advantages.', 'gp-premium' ), - 'section' => 'generate_general_section', - 'choices' => array( - 'inline' => __( 'Inline Embedding', 'gp-premium' ), - 'file' => __( 'External File', 'gp-premium' ), - ), - 'settings' => 'generate_settings[css_print_method]', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Action_Button_Control( - $wp_customize, - 'generate_regenerate_external_css_file', - array( - 'section' => 'generate_general_section', - 'data_type' => 'regenerate_external_css', - 'nonce' => esc_html( wp_create_nonce( 'generatepress_regenerate_css_file' ) ), - 'label' => __( 'Regenerate CSS File', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => 'generate_is_using_external_css_file_callback', - ) - ) - ); - } - - /** - * Set our CSS Print Method. - * - * @param string $method The existing method. - */ - public function set_print_method( $method ) { - if ( ! function_exists( 'generate_get_option' ) ) { - return $method; - } - - return generate_get_option( 'css_print_method' ); - } - - /** - * Determine if we're using file mode or inline mode. - */ - public function mode() { - $mode = generate_get_css_print_method(); - - if ( 'file' === $mode && $this->needs_update() ) { - $data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( ! isset( $data['updated_time'] ) ) { - // No time set, so set the current time minus 5 seconds so the file is still generated. - $data['updated_time'] = time() - 5; - update_option( 'generatepress_dynamic_css_data', $data ); - } - - // Only allow processing 1 file every 5 seconds. - $current_time = (int) time(); - $last_time = (int) $data['updated_time']; - - if ( 5 <= ( $current_time - $last_time ) ) { - - // Attempt to write to the file. - $mode = ( $this->can_write() && $this->make_css() ) ? 'file' : 'inline'; - - // Does again if the file exists. - if ( 'file' === $mode ) { - $mode = ( file_exists( $this->file( 'path' ) ) ) ? 'file' : 'inline'; - } - } - } - - return $mode; - } - - /** - * Set things up. - */ - public function init() { - if ( 'file' === $this->mode() ) { - add_filter( 'generate_using_dynamic_css_external_file', '__return_true' ); - add_filter( 'generate_dynamic_css_skip_cache', '__return_true', 20 ); - - // Remove inline CSS in GP < 3.0.0. - if ( ! function_exists( 'generate_get_dynamic_css' ) && function_exists( 'generate_enqueue_dynamic_css' ) ) { - remove_action( 'wp_enqueue_scripts', 'generate_enqueue_dynamic_css', 50 ); - } - } - } - - /** - * Enqueue the dynamic CSS. - */ - public function enqueue_dynamic_css() { - if ( 'file' === $this->mode() ) { - wp_enqueue_style( 'generatepress-dynamic', esc_url( $this->file( 'uri' ) ), array( 'generate-style' ), null ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion - - // Move the child theme after our dynamic stylesheet. - if ( is_child_theme() && wp_style_is( 'generate-child', 'enqueued' ) ) { - wp_dequeue_style( 'generate-child' ); - wp_enqueue_style( 'generate-child' ); - } - - // Re-add no-cache CSS in GP < 3.0.0. - if ( ! function_exists( 'generate_get_dynamic_css' ) && function_exists( 'generate_no_cache_dynamic_css' ) ) { - $nocache_css = generate_no_cache_dynamic_css(); - - if ( function_exists( 'generate_do_icon_css' ) ) { - $nocache_css .= generate_do_icon_css(); - } - - wp_add_inline_style( 'generate-style', wp_strip_all_tags( $nocache_css ) ); - } - } - } - - /** - * Make our CSS. - */ - public function make_css() { - $content = ''; - - if ( function_exists( 'generate_get_dynamic_css' ) ) { - $content = generate_get_dynamic_css(); - } elseif ( function_exists( 'generate_base_css' ) && function_exists( 'generate_font_css' ) && function_exists( 'generate_advanced_css' ) && function_exists( 'generate_spacing_css' ) ) { - $content = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css(); - } - - $content = apply_filters( 'generate_external_dynamic_css_output', $content ); - - if ( ! $content ) { - return false; - } - - $filesystem = generate_premium_get_wp_filesystem(); - - if ( ! $filesystem ) { - return false; - } - - // Take care of domain mapping. - if ( defined( 'DOMAIN_MAPPING' ) && DOMAIN_MAPPING ) { - if ( function_exists( 'domain_mapping_siteurl' ) && function_exists( 'get_original_url' ) ) { - $mapped_domain = domain_mapping_siteurl( false ); - $original_domain = get_original_url( 'siteurl' ); - - $content = str_replace( $original_domain, $mapped_domain, $content ); - } - } - - if ( is_writable( $this->file( 'path' ) ) || ( ! file_exists( $this->file( 'path' ) ) && is_writable( dirname( $this->file( 'path' ) ) ) ) ) { - $chmod_file = 0644; - - if ( defined( 'FS_CHMOD_FILE' ) ) { - $chmod_file = FS_CHMOD_FILE; - } - - if ( ! $filesystem->put_contents( $this->file( 'path' ), wp_strip_all_tags( $content ), $chmod_file ) ) { - - // Fail! - return false; - - } else { - - $this->update_saved_time(); - - // Success! - return true; - - } - } - } - - /** - * Determines if the CSS file is writable. - */ - public function can_write() { - global $blog_id; - - // Get the upload directory for this site. - $upload_dir = wp_get_upload_dir(); - - // If this is a multisite installation, append the blogid to the filename. - $css_blog_id = ( is_multisite() && $blog_id > 1 ) ? '_blog-' . $blog_id : null; - - $file_name = '/style' . $css_blog_id . '.min.css'; - $folder_path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'generatepress'; - - // Does the folder exist? - if ( file_exists( $folder_path ) ) { - // Folder exists, but is the folder writable? - if ( ! is_writable( $folder_path ) ) { - // Folder is not writable. - // Does the file exist? - if ( ! file_exists( $folder_path . $file_name ) ) { - // File does not exist, therefore it can't be created - // since the parent folder is not writable. - return false; - } else { - // File exists, but is it writable? - if ( ! is_writable( $folder_path . $file_name ) ) { - // Nope, it's not writable. - return false; - } - } - } else { - // The folder is writable. - // Does the file exist? - if ( file_exists( $folder_path . $file_name ) ) { - // File exists. - // Is it writable? - if ( ! is_writable( $folder_path . $file_name ) ) { - // Nope, it's not writable. - return false; - } - } - } - } else { - // Can we create the folder? - // returns true if yes and false if not. - return wp_mkdir_p( $folder_path ); - } - - // all is well! - return true; - } - - /** - * Gets the css path or url to the stylesheet - * - * @param string $target path/url. - */ - public function file( $target = 'path' ) { - global $blog_id; - - // Get the upload directory for this site. - $upload_dir = wp_get_upload_dir(); - - // If this is a multisite installation, append the blogid to the filename. - $css_blog_id = ( is_multisite() && $blog_id > 1 ) ? '_blog-' . $blog_id : null; - - $file_name = 'style' . $css_blog_id . '.min.css'; - $folder_path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'generatepress'; - - // The complete path to the file. - $file_path = $folder_path . DIRECTORY_SEPARATOR . $file_name; - - // Get the URL directory of the stylesheet. - $css_uri_folder = $upload_dir['baseurl']; - - $css_uri = trailingslashit( $css_uri_folder ) . 'generatepress/' . $file_name; - - // Take care of domain mapping. - if ( defined( 'DOMAIN_MAPPING' ) && DOMAIN_MAPPING ) { - if ( function_exists( 'domain_mapping_siteurl' ) && function_exists( 'get_original_url' ) ) { - $mapped_domain = domain_mapping_siteurl( false ); - $original_domain = get_original_url( 'siteurl' ); - $css_uri = str_replace( $original_domain, $mapped_domain, $css_uri ); - } - } - - $css_uri = set_url_scheme( $css_uri ); - - if ( 'path' === $target ) { - return $file_path; - } elseif ( 'url' === $target || 'uri' === $target ) { - $timestamp = ( file_exists( $file_path ) ) ? '?ver=' . filemtime( $file_path ) : ''; - return $css_uri . $timestamp; - } - } - - /** - * Update the our updated file time. - */ - public function update_saved_time() { - $data = get_option( 'generatepress_dynamic_css_data', array() ); - $data['updated_time'] = time(); - - update_option( 'generatepress_dynamic_css_data', $data ); - } - - /** - * Delete the saved time. - */ - public function delete_saved_time() { - $data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( isset( $data['updated_time'] ) ) { - unset( $data['updated_time'] ); - } - - update_option( 'generatepress_dynamic_css_data', $data ); - } - - /** - * Update our plugin/theme versions. - */ - public function update_versions() { - $data = get_option( 'generatepress_dynamic_css_data', array() ); - - $data['theme_version'] = GENERATE_VERSION; - $data['plugin_version'] = GP_PREMIUM_VERSION; - - update_option( 'generatepress_dynamic_css_data', $data ); - } - - /** - * Do we need to update the CSS file? - */ - public function needs_update() { - $data = get_option( 'generatepress_dynamic_css_data', array() ); - $update = false; - - // If there's no updated time, needs update. - // The time is set in mode(). - if ( ! isset( $data['updated_time'] ) ) { - $update = true; - } - - // If we haven't set our versions, do so now. - if ( ! isset( $data['theme_version'] ) && ! isset( $data['plugin_version'] ) ) { - $update = true; - $this->update_versions(); - - // Bail early so we don't check undefined versions below. - return $update; - } - - // Version numbers have changed, needs update. - if ( (string) GENERATE_VERSION !== (string) $data['theme_version'] || (string) GP_PREMIUM_VERSION !== (string) $data['plugin_version'] ) { - $update = true; - $this->update_versions(); - } - - return $update; - } - - /** - * Regenerate the CSS file. - */ - public function regenerate_css_file() { - check_ajax_referer( 'generatepress_regenerate_css_file', '_nonce' ); - - if ( ! current_user_can( 'manage_options' ) ) { - wp_send_json_error( __( 'Security check failed.', 'gp-premium' ) ); - } - - $this->delete_saved_time(); - - wp_send_json_success(); - } -} - -GeneratePress_External_CSS_File::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/enqueue-scripts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/enqueue-scripts.php deleted file mode 100644 index a9108a61..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/enqueue-scripts.php +++ /dev/null @@ -1,81 +0,0 @@ - $data ) { - $type = esc_html( GeneratePress_Elements_Helper::get_element_type_label( $data['type'] ) ); - - $active_elements[] = array( - 'type' => $type, - 'name' => get_the_title( $data['id'] ), - 'url' => get_edit_post_link( $data['id'] ), - ); - } - } - - $post_type_is_public = false; - - if ( get_post_type() ) { - $post_type = get_post_type_object( get_post_type() ); - - if ( is_object( $post_type ) && ! empty( $post_type->public ) ) { - $post_type_is_public = true; - } - } - - wp_localize_script( - 'gp-premium-editor', - 'gpPremiumEditor', - array( - 'isBlockElement' => 'gp_elements' === get_post_type(), - 'activeElements' => $active_elements, - 'elementsUrl' => esc_url( admin_url( 'edit.php?post_type=gp_elements' ) ), - 'postTypeIsPublic' => $post_type_is_public, - ) - ); - - wp_enqueue_style( - 'gp-premium-editor', - GP_PREMIUM_DIR_URL . 'dist/editor.css', - array( 'wp-edit-blocks' ), - filemtime( GP_PREMIUM_DIR_PATH . 'dist/editor.css' ) - ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons.php deleted file mode 100644 index 1b587f4c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons.php +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - '; - } - - if ( 'shopping-cart' === $icon ) { - $svg = ''; - } - - if ( 'shopping-basket' === $icon ) { - $svg = ''; - } - - if ( 'spinner' === $icon ) { - $svg = ''; - } - - if ( 'pro-menu-bars' === $icon ) { - $svg = ''; - } - - if ( 'pro-close' === $icon ) { - $svg = ''; - } - - if ( $svg ) { - $output = sprintf( - ' - %2$s - ', - $icon, - $svg - ); - } - - return $output; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.eot b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.eot deleted file mode 100644 index 72d97394..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.eot and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.svg b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.svg deleted file mode 100644 index e1c517d0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.ttf b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.ttf deleted file mode 100644 index 4bae85f6..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.ttf and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.woff b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.woff deleted file mode 100644 index 01c2cc17..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/gp-premium.woff and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/icons.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/icons.css deleted file mode 100644 index be13090e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/icons.css +++ /dev/null @@ -1,10 +0,0 @@ -@font-face { - font-family: 'GP Premium'; - src: url('gp-premium.eot'); - src: url('gp-premium.eot#iefix') format('embedded-opentype'), - url('gp-premium.woff') format('woff'), - url('gp-premium.ttf') format('truetype'), - url('gp-premium.svg#gp-premium') format('svg'); - font-weight: normal; - font-style: normal; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/icons.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/icons.min.css deleted file mode 100644 index 442a46bd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/icons/icons.min.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:'GP Premium';src:url(gp-premium.eot);src:url(gp-premium.eot#iefix) format('embedded-opentype'),url(gp-premium.woff) format('woff'),url(gp-premium.ttf) format('truetype'),url(gp-premium.svg#gp-premium) format('svg');font-weight:400;font-style:normal} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/js/smooth-scroll.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/js/smooth-scroll.js deleted file mode 100644 index c2a8a5f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/js/smooth-scroll.js +++ /dev/null @@ -1,743 +0,0 @@ -/*! - * smooth-scroll v14.2.1: Animate scrolling to anchor links - * (c) 2018 Chris Ferdinandi - * MIT License - * http://github.com/cferdinandi/smooth-scroll - */ - -/** - * closest() polyfill - * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill - */ -if (window.Element && !Element.prototype.closest) { - Element.prototype.closest = function(s) { - var matches = (this.document || this.ownerDocument).querySelectorAll(s), - i, - el = this; - do { - i = matches.length; - while (--i >= 0 && matches.item(i) !== el) {} - } while ((i < 0) && (el = el.parentElement)); - return el; - }; -} - -/** - * CustomEvent() polyfill - * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill - */ -(function () { - - if (typeof window.CustomEvent === "function") return false; - - function CustomEvent(event, params) { - params = params || { bubbles: false, cancelable: false, detail: undefined }; - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - } - - CustomEvent.prototype = window.Event.prototype; - - window.CustomEvent = CustomEvent; -})(); -/** - * requestAnimationFrame() polyfill - * By Erik Möller. Fixes from Paul Irish and Tino Zijdel. - * @link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - * @link http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - * @license MIT - */ -(function() { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || - window[vendors[x]+'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout((function() { callback(currTime + timeToCall); }), - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - } -}()); - -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define([], (function () { - return factory(root); - })); - } else if (typeof exports === 'object') { - module.exports = factory(root); - } else { - root.SmoothScroll = factory(root); - } -})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { - - 'use strict'; - - // - // Default settings - // - - var defaults = { - // Selectors - ignore: '[data-scroll-ignore]', - header: null, - topOnEmptyHash: true, - - // Speed & Easing - speed: 500, - clip: true, - offset: 0, - easing: 'easeInOutCubic', - customEasing: null, - - // History - updateURL: true, - popstate: true, - - // Custom Events - emitEvents: true - }; - - - // - // Utility Methods - // - - /** - * Check if browser supports required methods - * @return {Boolean} Returns true if all required methods are supported - */ - var supports = function () { - return ( - 'querySelector' in document && - 'addEventListener' in window && - 'requestAnimationFrame' in window && - 'closest' in window.Element.prototype - ); - }; - - /** - * Merge two or more objects. Returns a new object. - * @param {Object} objects The objects to merge together - * @returns {Object} Merged values of defaults and options - */ - var extend = function () { - - // Variables - var extended = {}; - - // Merge the object into the extended object - var merge = function (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - extended[prop] = obj[prop]; - } - } - }; - - // Loop through each object and conduct a merge - for (var i = 0; i < arguments.length; i++) { - merge(arguments[i]); - } - - return extended; - - }; - - /** - * Check to see if user prefers reduced motion - * @param {Object} settings Script settings - */ - var reduceMotion = function (settings) { - if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { - return true; - } - return false; - }; - - /** - * Get the height of an element. - * @param {Node} elem The element to get the height of - * @return {Number} The element's height in pixels - */ - var getHeight = function (elem) { - return parseInt(window.getComputedStyle(elem).height, 10); - }; - - /** - * Decode a URI, with error check - * @param {String} hash The URI to decode - * @return {String} A decoded URI (or the original string if an error is thrown) - */ - var decode = function (hash) { - var decoded; - try { - decoded = decodeURIComponent(hash); - } catch(e) { - decoded = hash; - } - return decoded; - }; - - /** - * Escape special characters for use with querySelector - * @author Mathias Bynens - * @link https://github.com/mathiasbynens/CSS.escape - * @param {String} id The anchor ID to escape - */ - var escapeCharacters = function (id) { - - // Remove leading hash - if (id.charAt(0) === '#') { - id = id.substr(1); - } - - var string = String(id); - var length = string.length; - var index = -1; - var codeUnit; - var result = ''; - var firstCodeUnit = string.charCodeAt(0); - while (++index < length) { - codeUnit = string.charCodeAt(index); - // Note: there’s no need to special-case astral symbols, surrogate - // pairs, or lone surrogates. - - // If the character is NULL (U+0000), then throw an - // `InvalidCharacterError` exception and terminate these steps. - if (codeUnit === 0x0000) { - throw new InvalidCharacterError( - 'Invalid character: the input contains U+0000.' - ); - } - - if ( - // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is - // U+007F, […] - (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || - // If the character is the first character and is in the range [0-9] - // (U+0030 to U+0039), […] - (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || - // If the character is the second character and is in the range [0-9] - // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] - ( - index === 1 && - codeUnit >= 0x0030 && codeUnit <= 0x0039 && - firstCodeUnit === 0x002D - ) - ) { - // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point - result += '\\' + codeUnit.toString(16) + ' '; - continue; - } - - // If the character is not handled by one of the above rules and is - // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or - // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to - // U+005A), or [a-z] (U+0061 to U+007A), […] - if ( - codeUnit >= 0x0080 || - codeUnit === 0x002D || - codeUnit === 0x005F || - codeUnit >= 0x0030 && codeUnit <= 0x0039 || - codeUnit >= 0x0041 && codeUnit <= 0x005A || - codeUnit >= 0x0061 && codeUnit <= 0x007A - ) { - // the character itself - result += string.charAt(index); - continue; - } - - // Otherwise, the escaped character. - // http://dev.w3.org/csswg/cssom/#escape-a-character - result += '\\' + string.charAt(index); - - } - - // Return sanitized hash - var hash; - try { - hash = decodeURIComponent('#' + result); - } catch(e) { - hash = '#' + result; - } - return hash; - - }; - - /** - * Calculate the easing pattern - * @link https://gist.github.com/gre/1650294 - * @param {String} type Easing pattern - * @param {Number} time Time animation should take to complete - * @returns {Number} - */ - var easingPattern = function (settings, time) { - var pattern; - - // Default Easing Patterns - if (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity - if (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity - if (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration - - // Custom Easing Patterns - if (!!settings.customEasing) pattern = settings.customEasing(time); - - return pattern || time; // no easing, no acceleration - }; - - /** - * Determine the document's height - * @returns {Number} - */ - var getDocumentHeight = function () { - return Math.max( - document.body.scrollHeight, document.documentElement.scrollHeight, - document.body.offsetHeight, document.documentElement.offsetHeight, - document.body.clientHeight, document.documentElement.clientHeight - ); - }; - - /** - * Calculate how far to scroll - * Clip support added by robjtede - https://github.com/cferdinandi/smooth-scroll/issues/405 - * @param {Element} anchor The anchor element to scroll to - * @param {Number} headerHeight Height of a fixed header, if any - * @param {Number} offset Number of pixels by which to offset scroll - * @param {Boolean} clip If true, adjust scroll distance to prevent abrupt stops near the bottom of the page - * @returns {Number} - */ - var getEndLocation = function (anchor, headerHeight, offset, clip) { - var location = 0; - if (anchor.offsetParent) { - do { - location += anchor.offsetTop; - anchor = anchor.offsetParent; - } while (anchor); - } - location = Math.max(location - headerHeight - offset, 0); - if (clip) { - location = Math.min(location, getDocumentHeight() - window.innerHeight); - } - return location; - }; - - /** - * Get the height of the fixed header - * @param {Node} header The header - * @return {Number} The height of the header - */ - var getHeaderHeight = function (header) { - return !header ? 0 : (getHeight(header) + header.offsetTop); - }; - - /** - * Update the URL - * @param {Node} anchor The anchor that was scrolled to - * @param {Boolean} isNum If true, anchor is a number - * @param {Object} options Settings for Smooth Scroll - */ - var updateURL = function (anchor, isNum, options) { - - // Bail if the anchor is a number - if (isNum) return; - - // Verify that pushState is supported and the updateURL option is enabled - if (!history.pushState || !options.updateURL) return; - - // Update URL - history.pushState( - { - smoothScroll: JSON.stringify(options), - anchor: anchor.id - }, - document.title, - anchor === document.documentElement ? '#top' : '#' + anchor.id - ); - - }; - - /** - * Bring the anchored element into focus - * @param {Node} anchor The anchor element - * @param {Number} endLocation The end location to scroll to - * @param {Boolean} isNum If true, scroll is to a position rather than an element - */ - var adjustFocus = function (anchor, endLocation, isNum) { - - // Is scrolling to top of page, blur - if (anchor === 0) { - document.body.focus(); - } - - // Don't run if scrolling to a number on the page - if (isNum) return; - - // Otherwise, bring anchor element into focus - anchor.focus(); - if (document.activeElement !== anchor) { - anchor.setAttribute('tabindex', '-1'); - anchor.focus(); - anchor.style.outline = 'none'; - } - window.scrollTo(0 , endLocation); - - }; - - /** - * Emit a custom event - * @param {String} type The event type - * @param {Object} options The settings object - * @param {Node} anchor The anchor element - * @param {Node} toggle The toggle element - */ - var emitEvent = function (type, options, anchor, toggle) { - if (!options.emitEvents || typeof window.CustomEvent !== 'function') return; - var event = new CustomEvent(type, { - bubbles: true, - detail: { - anchor: anchor, - toggle: toggle - } - }); - document.dispatchEvent(event); - }; - - - // - // SmoothScroll Constructor - // - - var SmoothScroll = function (selector, options) { - - // - // Variables - // - - var smoothScroll = {}; // Object for public APIs - var settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval; - - - // - // Methods - // - - /** - * Cancel a scroll-in-progress - */ - smoothScroll.cancelScroll = function (noEvent) { - cancelAnimationFrame(animationInterval); - animationInterval = null; - if (noEvent) return; - emitEvent('scrollCancel', settings); - }; - - /** - * Start/stop the scrolling animation - * @param {Node|Number} anchor The element or position to scroll to - * @param {Element} toggle The element that toggled the scroll event - * @param {Object} options - */ - smoothScroll.animateScroll = function (anchor, toggle, options) { - - // Local settings - var animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults - - // Selectors and variables - var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; - var anchorElem = isNum || !anchor.tagName ? null : anchor; - if (!isNum && !anchorElem) return; - var startLocation = window.pageYOffset; // Current location on the page - if (animateSettings.header && !fixedHeader) { - // Get the fixed header if not already set - fixedHeader = document.querySelector(animateSettings.header); - } - if (!headerHeight) { - // Get the height of a fixed header if one exists and not already set - headerHeight = getHeaderHeight(fixedHeader); - } - var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof animateSettings.offset === 'function' ? animateSettings.offset(anchor, toggle) : animateSettings.offset), 10), animateSettings.clip); // Location to scroll to - var distance = endLocation - startLocation; // distance to travel - var documentHeight = getDocumentHeight(); - var timeLapsed = 0; - var start, percentage, position; - - /** - * Stop the scroll animation when it reaches its target (or the bottom/top of page) - * @param {Number} position Current position on the page - * @param {Number} endLocation Scroll to location - * @param {Number} animationInterval How much to scroll on this loop - */ - var stopAnimateScroll = function (position, endLocation) { - - // Get the current location - var currentLocation = window.pageYOffset; - - // Check if the end location has been reached yet (or we've hit the end of the document) - if (position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight)) { - - // Clear the animation timer - smoothScroll.cancelScroll(true); - - // Bring the anchored element into focus - adjustFocus(anchor, endLocation, isNum); - - // Emit a custom event - emitEvent('scrollStop', animateSettings, anchor, toggle); - - // Reset start - start = null; - animationInterval = null; - - return true; - - } - }; - - /** - * Loop scrolling animation - */ - var loopAnimateScroll = function (timestamp) { - if (!start) { start = timestamp; } - timeLapsed += timestamp - start; - percentage = (timeLapsed / parseInt(animateSettings.speed, 10)); - percentage = (percentage > 1) ? 1 : percentage; - position = startLocation + (distance * easingPattern(animateSettings, percentage)); - window.scrollTo(0, Math.floor(position)); - if (!stopAnimateScroll(position, endLocation)) { - animationInterval = window.requestAnimationFrame(loopAnimateScroll); - start = timestamp; - } - }; - - /** - * Reset position to fix weird iOS bug - * @link https://github.com/cferdinandi/smooth-scroll/issues/45 - */ - if (window.pageYOffset === 0) { - window.scrollTo(0, 0); - } - - // Update the URL - updateURL(anchor, isNum, animateSettings); - - // Emit a custom event - emitEvent('scrollStart', animateSettings, anchor, toggle); - - // Start scrolling animation - smoothScroll.cancelScroll(true); - window.requestAnimationFrame(loopAnimateScroll); - - }; - - /** - * If smooth scroll element clicked, animate scroll - */ - var clickHandler = function (event) { - - // Don't run if the user prefers reduced motion - if (reduceMotion(settings)) return; - - // Don't run if right-click or command/control + click - if (event.button !== 0 || event.metaKey || event.ctrlKey) return; - - // Check if event.target has closest() method - // By @totegi - https://github.com/cferdinandi/smooth-scroll/pull/401/ - if(!('closest' in event.target))return; - - // Check if a smooth scroll link was clicked - toggle = event.target.closest(selector); - if (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return; - - // Only run if link is an anchor and points to the current page - if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; - - // Get an escaped version of the hash - var hash = escapeCharacters(decode(toggle.hash)); - - // Get the anchored element - var anchor = settings.topOnEmptyHash && hash === '#' ? document.documentElement : document.querySelector(hash); - anchor = !anchor && hash === '#top' ? document.documentElement : anchor; - - // If anchored element exists, scroll to it - if (!anchor) return; - event.preventDefault(); - smoothScroll.animateScroll(anchor, toggle); - - }; - - /** - * Animate scroll on popstate events - */ - var popstateHandler = function (event) { - // Stop if history.state doesn't exist (ex. if clicking on a broken anchor link). - // fixes `Cannot read property 'smoothScroll' of null` error getting thrown. - if (history.state === null) return; - - // Only run if state is a popstate record for this instantiation - if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return; - - // Only run if state includes an anchor - if (!history.state.anchor) return; - - // Get the anchor - var anchor = document.querySelector(escapeCharacters(decode(history.state.anchor))); - if (!anchor) return; - - // Animate scroll to anchor link - smoothScroll.animateScroll(anchor, null, {updateURL: false}); - - }; - - /** - * On window scroll and resize, only run events at a rate of 15fps for better performance - */ - var resizeThrottler = function (event) { - if (!eventTimeout) { - eventTimeout = setTimeout((function() { - eventTimeout = null; // Reset timeout - headerHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists - }), 66); - } - }; - - /** - * Destroy the current initialization. - */ - smoothScroll.destroy = function () { - - // If plugin isn't already initialized, stop - if (!settings) return; - - // Remove event listeners - document.removeEventListener('click', clickHandler, false); - window.removeEventListener('resize', resizeThrottler, false); - window.removeEventListener('popstate', popstateHandler, false); - - // Cancel any scrolls-in-progress - smoothScroll.cancelScroll(); - - // Reset variables - settings = null; - anchor = null; - toggle = null; - fixedHeader = null; - headerHeight = null; - eventTimeout = null; - animationInterval = null; - - }; - - /** - * Initialize Smooth Scroll - * @param {Object} options User settings - */ - smoothScroll.init = function (options) { - - // feature test - if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.'; - - // Destroy any existing initializations - smoothScroll.destroy(); - - // Selectors and variables - settings = extend(defaults, options || {}); // Merge user options with defaults - fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header - headerHeight = getHeaderHeight(fixedHeader); - - // When a toggle is clicked, run the click handler - document.addEventListener('click', clickHandler, false); - - // If window is resized and there's a fixed header, recalculate its size - if (fixedHeader) { - window.addEventListener('resize', resizeThrottler, false); - } - - // If updateURL and popState are enabled, listen for pop events - if (settings.updateURL && settings.popstate) { - window.addEventListener('popstate', popstateHandler, false); - } - - }; - - - // - // Initialize plugin - // - - smoothScroll.init(options); - - - // - // Public APIs - // - - return smoothScroll; - - }; - - return SmoothScroll; - -})); - -/* GP */ -var gpscroll = new SmoothScroll( gpSmoothScroll.elements.join(), { - speed: gpSmoothScroll.duration, - offset: function( anchor, toggle ) { - var body = document.body, - nav = document.querySelector( '#site-navigation' ), - stickyNav = document.querySelector( '#sticky-navigation' ), - mobileHeader = document.querySelector( '#mobile-header' ), - menuToggle = document.querySelector( '.menu-toggle' ), - offset = 0; - - if ( mobileHeader && ( mobileHeader.offsetWidth || mobileHeader.offsetHeight || mobileHeader.getClientRects().length ) ) { - if ( body.classList.contains( 'mobile-header-sticky' ) ) { - offset = offset + mobileHeader.clientHeight; - } - } else if ( menuToggle && ( menuToggle.offsetWidth || menuToggle.offsetHeight || menuToggle.getClientRects().length ) ) { - if ( body.classList.contains( 'both-sticky-menu' ) || body.classList.contains( 'mobile-sticky-menu' ) ) { - if ( stickyNav ) { - offset = offset + stickyNav.clientHeight; - } else if ( nav ) { - offset = offset + nav.clientHeight; - } - } - } else if ( body.classList.contains( 'both-sticky-menu' ) || body.classList.contains( 'desktop-sticky-menu' ) ) { - if ( stickyNav ) { - offset = offset + stickyNav.clientHeight; - } else if ( nav ) { - offset = offset + nav.clientHeight; - } - } - - return gpSmoothScroll.offset - ? gpSmoothScroll.offset - : offset; - } -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/js/smooth-scroll.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/general/js/smooth-scroll.min.js deleted file mode 100644 index 9fbd8c4e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/general/js/smooth-scroll.min.js +++ /dev/null @@ -1 +0,0 @@ -window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;0<=--t&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}(),function(){for(var r=0,e=["ms","moz","webkit","o"],t=0;t=s)return S.cancelScroll(!0),e=t,n=p,0===(t=o)&&document.body.focus(),n||(t.focus(),document.activeElement!==t&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),b.scrollTo(0,e)),C("scrollStop",h,o,i),!(w=l=null)},f=function(e){var t,n,o;m=(u+=e-(l=l||e))/parseInt(h.speed,10),m=r+c*(n=1 apply_filters( - 'generate_smooth_scroll_elements', - array( - '.smooth-scroll', - 'li.smooth-scroll a', - ) - ), - 'duration' => apply_filters( 'generate_smooth_scroll_duration', 800 ), - 'offset' => apply_filters( 'generate_smooth_scroll_offset', '' ), - ) - ); -} - -add_filter( 'generate_option_defaults', 'generate_smooth_scroll_default' ); -/** - * Add the smooth scroll option to our defaults. - * - * @since 1.6 - * - * @param array $defaults Existing defaults. - * @return array New defaults. - */ -function generate_smooth_scroll_default( $defaults ) { - $defaults['smooth_scroll'] = false; - - return $defaults; -} - -add_action( 'customize_register', 'generate_smooth_scroll_customizer', 99 ); -/** - * Add our smooth scroll option to the Customizer. - * - * @since 1.6 - * - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - */ -function generate_smooth_scroll_customizer( $wp_customize ) { - if ( ! function_exists( 'generate_get_defaults' ) ) { - return; - } - - $defaults = generate_get_defaults(); - - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - $wp_customize->add_setting( - 'generate_settings[smooth_scroll]', - array( - 'default' => $defaults['smooth_scroll'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_settings[smooth_scroll]', - array( - 'type' => 'checkbox', - 'label' => __( 'Smooth scroll', 'gp-premium' ), - 'description' => __( 'Initiate smooth scroll on anchor links using the smooth-scroll class.', 'gp-premium' ), - 'section' => 'generate_general_section', - ) - ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/gp-premium.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/gp-premium.php deleted file mode 100644 index 750727ec..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/gp-premium.php +++ /dev/null @@ -1,307 +0,0 @@ -=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) { - require_once GP_PREMIUM_DIR_PATH . 'site-library/class-site-library-rest.php'; - require_once GP_PREMIUM_DIR_PATH . 'site-library/class-site-library-helper.php'; -} - -if ( is_admin() ) { - require_once GP_PREMIUM_DIR_PATH . 'inc/deprecated-admin.php'; - - if ( generatepress_is_module_active( 'generate_package_site_library', 'GENERATE_SITE_LIBRARY' ) && version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) { - require_once GP_PREMIUM_DIR_PATH . 'site-library/class-site-library.php'; - } -} - -if ( ! function_exists( 'generate_premium_updater' ) ) { - add_action( 'admin_init', 'generate_premium_updater', 0 ); - /** - * Set up the updater - **/ - function generate_premium_updater() { - if ( ! class_exists( 'GeneratePress_Premium_Plugin_Updater' ) ) { - include GP_PREMIUM_DIR_PATH . 'library/class-plugin-updater.php'; - } - - $license_key = get_option( 'gen_premium_license_key' ); - - $edd_updater = new GeneratePress_Premium_Plugin_Updater( - 'https://generatepress.com', - __FILE__, - array( - 'version' => GP_PREMIUM_VERSION, - 'license' => trim( $license_key ), - 'item_name' => 'GP Premium', - 'author' => 'Tom Usborne', - 'url' => home_url(), - 'beta' => apply_filters( 'generate_premium_beta_tester', false ), - ) - ); - } -} - -add_filter( 'edd_sl_plugin_updater_api_params', 'generate_premium_set_updater_api_params', 10, 3 ); -/** - * Add the GeneratePress version to our updater params. - * - * @param array $api_params The array of data sent in the request. - * @param array $api_data The array of data set up in the class constructor. - * @param string $plugin_file The full path and filename of the file. - */ -function generate_premium_set_updater_api_params( $api_params, $api_data, $plugin_file ) { - /* - * Make sure $plugin_file matches your plugin's file path. You should have a constant for this - * or can use __FILE__ if this code goes in your plugin's main file. - */ - if ( __FILE__ === $plugin_file ) { - // Dynamically retrieve the current version number. - $api_params['generatepress_version'] = defined( 'GENERATE_VERSION' ) ? GENERATE_VERSION : ''; - } - - return $api_params; -} - -if ( ! function_exists( 'generate_premium_setup' ) ) { - add_action( 'after_setup_theme', 'generate_premium_setup' ); - /** - * Add useful functions to GP Premium - **/ - function generate_premium_setup() { - // This used to be in the theme but the WP.org review team asked for it to be removed. - // Not wanting people to have broken shortcodes in their widgets on update, I added it into premium. - add_filter( 'widget_text', 'do_shortcode' ); - } -} - -if ( ! function_exists( 'generate_premium_theme_information' ) ) { - add_action( 'admin_notices', 'generate_premium_theme_information' ); - /** - * Checks whether there's a theme update available and lets you know. - * Also checks to see if GeneratePress is the active theme. If not, tell them. - * - * @since 1.2.95 - **/ - function generate_premium_theme_information() { - $theme = wp_get_theme(); - - if ( 'GeneratePress' === $theme->name || 'generatepress' === $theme->template ) { - - // Get our information on updates. - // @see https://developer.wordpress.org/reference/functions/wp_prepare_themes_for_js/. - $updates = array(); - if ( current_user_can( 'update_themes' ) ) { - $updates_transient = get_site_transient( 'update_themes' ); - if ( isset( $updates_transient->response ) ) { - $updates = $updates_transient->response; - } - } - - $screen = get_current_screen(); - - // If a GeneratePress update exists, and we're not on the themes page. - // No need to tell people an update exists on the themes page, WP does that for us. - if ( isset( $updates['generatepress'] ) && 'themes' !== $screen->base ) { - printf( - '
-

%1$s %3$s

-
', - esc_html__( 'GeneratePress has an update available.', 'gp-premium' ), - esc_url( admin_url( 'themes.php' ) ), - esc_html__( 'Update now.', 'gp-premium' ) - ); - } - } else { - // GeneratePress isn't the active theme, let them know GP Premium won't work. - printf( - '
-

%1$s %2$s

-
', - esc_html__( 'GP Premium requires GeneratePress to be your active theme.', 'gp-premium' ), - esc_html__( 'Install now.', 'gp-premium' ), - esc_url( admin_url( 'theme-install.php?theme=generatepress' ) ) - ); - } - - } -} - -add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'generate_add_configure_action_link' ); -/** - * Show a "Configure" link in the plugin action links. - * - * @since 1.3 - * @param array $links The existing plugin row links. - */ -function generate_add_configure_action_link( $links ) { - $configuration_link = '' . __( 'Configure', 'gp-premium' ) . ''; - - return array_merge( $links, array( $configuration_link ) ); -} - -add_action( 'admin_init', 'generatepress_deactivate_standalone_addons' ); -/** - * Deactivate any standalone add-ons if they're active. - * - * @since 1.3.1 - */ -function generatepress_deactivate_standalone_addons() { - $addons = array( - 'generate-backgrounds/generate-backgrounds.php', - 'generate-blog/generate-blog.php', - 'generate-colors/generate-colors.php', - 'generate-copyright/generate-copyright.php', - 'generate-disable-elements/generate-disable-elements.php', - 'generate-hooks/generate-hooks.php', - 'generate-ie/generate-ie.php', - 'generate-menu-plus/generate-menu-plus.php', - 'generate-page-header/generate-page-header.php', - 'generate-secondary-nav/generate-secondary-nav.php', - 'generate-sections/generate-sections.php', - 'generate-spacing/generate-spacing.php', - 'generate-typography/generate-fonts.php', - ); - - deactivate_plugins( $addons ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/css/hooks.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/css/hooks.css deleted file mode 100644 index 5b981c5e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/css/hooks.css +++ /dev/null @@ -1,59 +0,0 @@ -#gp_hooks_settings .form-table td, -#gp_hooks_settings .form-table th { - padding: 30px; - background: #FFF; - display: block; - width: 100%; - box-sizing: border-box; - margin-bottom: 0; -} - -#gp_hooks_settings .form-table th { - padding-bottom: 0; -} - -#gp_hooks_settings .form-table tr { - margin-bottom: 20px; - display: block; - max-width: 100%; - border: 1px solid #e5e5e5; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - box-sizing: border-box; -} - -.execute, div.disable { - background: none repeat scroll 0 0 #f1f1f1; - display: inline-block; - padding: 10px; - font-size: 14px; -} - -.admin-bar #gp_hooks_settings .sticky-scroll-box.fixed { - top: 52px; -} -#gp_hooks_settings .sticky-scroll-box.fixed { - position: fixed; - right: 18px; - top: 20px; -} - -.rtl #gp_hooks_settings .sticky-scroll-box.fixed { - position: fixed; - left: 18px; - right: auto; -} - -#gp_hooks_settings input[type="checkbox"] { - margin-top: 1px; - margin-right: 0px; -} - -#gp_hooks_settings .form-table { - margin-top: 0; -} - -.appearance_page_gp_hooks_settings #setting-error-true { - margin-left: 2px; - margin-right: 19px; - margin-top: 20px; -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/js/admin.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/js/admin.js deleted file mode 100644 index c4a41586..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/js/admin.js +++ /dev/null @@ -1,38 +0,0 @@ -jQuery(document).ready(function($) { - - jQuery('#hook-dropdown').on('change', function() { - var id = jQuery(this).children(":selected").attr("id"); - jQuery('#gp_hooks_settings .form-table tr').hide(); - jQuery('#gp_hooks_settings .form-table tr').eq(id).show(); - Cookies.set('remember_hook', $('#hook-dropdown option:selected').attr('id'), { expires: 90, path: '/'}); - - if ( jQuery('#hook-dropdown').val() == 'all' ) { - $('#gp_hooks_settings .form-table tr').show(); - Cookies.set('remember_hook', 'none', { expires: 90, path: '/'}); - } - - }); - - //checks if the cookie has been set - if( Cookies.get('remember_hook') === null || Cookies.get('remember_hook') === "" || Cookies.get('remember_hook') === "null" || Cookies.get('remember_hook') === "none" || Cookies.get('remember_hook') === undefined ) - { - $('#gp_hooks_settings .form-table tr').show(); - Cookies.set('remember_hook', 'none', { expires: 90, path: '/'}); - } else { - $('#hook-dropdown option[id="' + Cookies.get('remember_hook') + '"]').attr('selected', 'selected'); - $('#gp_hooks_settings .form-table tr').hide(); - $('#gp_hooks_settings .form-table tr').eq(Cookies.get('remember_hook')).show(); - } - - var top = $('.sticky-scroll-box').offset().top; - $(window).scroll(function (event) { - var y = $(this).scrollTop(); - if (y >= top) - $('.sticky-scroll-box').addClass('fixed'); - else - $('.sticky-scroll-box').removeClass('fixed'); - $('.sticky-scroll-box').width($('.sticky-scroll-box').parent().width()); - }); - -}); - diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/js/jquery.cookie.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/js/jquery.cookie.js deleted file mode 100644 index e5733169..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/assets/js/jquery.cookie.js +++ /dev/null @@ -1,165 +0,0 @@ -/*! - * JavaScript Cookie v2.1.3 - * https://github.com/js-cookie/js-cookie - * - * Copyright 2006, 2015 Klaus Hartl & Fagner Brack - * Released under the MIT license - */ -;(function (factory) { - var registeredInModuleLoader = false; - if (typeof define === 'function' && define.amd) { - define(factory); - registeredInModuleLoader = true; - } - if (typeof exports === 'object') { - module.exports = factory(); - registeredInModuleLoader = true; - } - if (!registeredInModuleLoader) { - var OldCookies = window.Cookies; - var api = window.Cookies = factory(); - api.noConflict = function () { - window.Cookies = OldCookies; - return api; - }; - } -}(function () { - function extend () { - var i = 0; - var result = {}; - for (; i < arguments.length; i++) { - var attributes = arguments[ i ]; - for (var key in attributes) { - result[key] = attributes[key]; - } - } - return result; - } - - function init (converter) { - function api (key, value, attributes) { - var result; - if (typeof document === 'undefined') { - return; - } - - // Write - - if (arguments.length > 1) { - attributes = extend({ - path: '/' - }, api.defaults, attributes); - - if (typeof attributes.expires === 'number') { - var expires = new Date(); - expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); - attributes.expires = expires; - } - - // We're using "expires" because "max-age" is not supported by IE - attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; - - try { - result = JSON.stringify(value); - if (/^[\{\[]/.test(result)) { - value = result; - } - } catch (e) {} - - if (!converter.write) { - value = encodeURIComponent(String(value)) - .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); - } else { - value = converter.write(value, key); - } - - key = encodeURIComponent(String(key)); - key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); - key = key.replace(/[\(\)]/g, escape); - - var stringifiedAttributes = ''; - - for (var attributeName in attributes) { - if (!attributes[attributeName]) { - continue; - } - stringifiedAttributes += '; ' + attributeName; - if (attributes[attributeName] === true) { - continue; - } - stringifiedAttributes += '=' + attributes[attributeName]; - } - return (document.cookie = key + '=' + value + stringifiedAttributes); - } - - // Read - - if (!key) { - result = {}; - } - - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. Also prevents odd result when - // calling "get()" - var cookies = document.cookie ? document.cookie.split('; ') : []; - var rdecode = /(%[0-9A-Z]{2})+/g; - var i = 0; - - for (; i < cookies.length; i++) { - var parts = cookies[i].split('='); - var cookie = parts.slice(1).join('='); - - if (cookie.charAt(0) === '"') { - cookie = cookie.slice(1, -1); - } - - try { - var name = parts[0].replace(rdecode, decodeURIComponent); - cookie = converter.read ? - converter.read(cookie, name) : converter(cookie, name) || - cookie.replace(rdecode, decodeURIComponent); - - if (this.json) { - try { - cookie = JSON.parse(cookie); - } catch (e) {} - } - - if (key === name) { - result = cookie; - break; - } - - if (!key) { - result[name] = cookie; - } - } catch (e) {} - } - - return result; - } - - api.set = api; - api.get = function (key) { - return api.call(api, key); - }; - api.getJSON = function () { - return api.apply({ - json: true - }, [].slice.call(arguments)); - }; - api.defaults = {}; - - api.remove = function (key, attributes) { - api(key, '', extend(attributes, { - expires: -1 - })); - }; - - api.withConverter = init; - - return api; - } - - return init(function () {}); -})); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/functions.php deleted file mode 100644 index e0954f28..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/hooks/functions/functions.php +++ /dev/null @@ -1,542 +0,0 @@ - -

%1$s %2$s

- ', - esc_html__( 'DISALLOW_FILE_EDIT is defined. You should also disallow PHP execution in GP Hooks.', 'gp-premium' ), - esc_html__( 'Learn how', 'gp-premium' ) - ); - } - } -} - -if ( ! function_exists( 'generate_hooks_setup' ) ) { - function generate_hooks_setup() { - // Just to verify that we're activated. - } -} - -if ( ! class_exists( 'Generate_Hooks_Settings' ) ) { - class Generate_Hooks_Settings { - private $dir; - private $file; - private $assets_dir; - private $assets_url; - private $settings_base; - private $settings; - - public function __construct( $file ) { - $this->file = $file; - $this->dir = dirname( $this->file ); - $this->assets_dir = trailingslashit( $this->dir ) . 'assets'; - $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) ); - $this->settings_base = ''; - - // Initialise settings - add_action( 'admin_init', array( $this, 'init' ) ); - - // Register plugin settings - add_action( 'admin_init' , array( $this, 'register_settings' ) ); - - // Add settings page to menu - add_action( 'admin_menu' , array( $this, 'add_menu_item' ) ); - - // Add settings link to plugins page - add_filter( 'plugin_action_links_' . plugin_basename( $this->file ) , array( $this, 'add_settings_link' ) ); - } - - /** - * Initialise settings - * @return void - */ - public function init() { - $this->settings = $this->settings_fields(); - } - - /** - * Add settings page to admin menu - * @return void - */ - public function add_menu_item() { - $page = add_theme_page( __( 'GP Hooks', 'gp-premium' ) , __( 'GP Hooks', 'gp-premium' ) , apply_filters( 'generate_hooks_capability','manage_options' ) , 'gp_hooks_settings' , array( $this, 'settings_page' ) ); - add_action( 'admin_print_styles-' . $page, array( $this, 'settings_assets' ) ); - } - - /** - * Load settings JS & CSS - * @return void - */ - public function settings_assets() { - wp_enqueue_script( 'gp-cookie', $this->assets_url . 'js/jquery.cookie.js', array( 'jquery' ), GENERATE_HOOKS_VERSION ); - wp_enqueue_script( 'gp-hooks', $this->assets_url . 'js/admin.js', array( 'jquery', 'gp-cookie' ), GENERATE_HOOKS_VERSION ); - wp_enqueue_style( 'gp-hooks', $this->assets_url . 'css/hooks.css' ); - } - - /** - * Add settings link to plugin list table - * @param array $links Existing links - * @return array Modified links - */ - public function add_settings_link( $links ) { - $settings_link = '' . __( 'GP Hooks', 'gp-premium' ) . ''; - array_push( $links, $settings_link ); - return $links; - } - - /** - * Build settings fields - * @return array Fields to be displayed on settings page - */ - private function settings_fields() { - - $settings['standard'] = array( - 'title' => '', - 'description' => '', - 'fields' => array( - array( - "name" => __( 'wp_head', 'gp-premium' ), - "id" => 'generate_wp_head', - "type" => 'textarea' - ), - - array( - "name" => __( 'Before Header', 'gp-premium' ), - "id" => 'generate_before_header', - "type" => 'textarea' - ), - - array( - "name" => __( 'Before Header Content', 'gp-premium' ), - "id" => 'generate_before_header_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Header Content', 'gp-premium' ), - "id" => 'generate_after_header_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Header', 'gp-premium' ), - "id" => 'generate_after_header', - "type" => 'textarea' - ), - - array( - "name" => __( 'Inside Content Container', 'gp-premium' ), - "id" => 'generate_before_main_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'Before Content', 'gp-premium' ), - "id" => 'generate_before_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Entry Title', 'gp-premium' ), - "id" => 'generate_after_entry_header', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Content', 'gp-premium' ), - "id" => 'generate_after_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'Before Right Sidebar Content', 'gp-premium' ), - "id" => 'generate_before_right_sidebar_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Right Sidebar Content', 'gp-premium' ), - "id" => 'generate_after_right_sidebar_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'Before Left Sidebar Content', 'gp-premium' ), - "id" => 'generate_before_left_sidebar_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Left Sidebar Content', 'gp-premium' ), - "id" => 'generate_after_left_sidebar_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'Before Footer', 'gp-premium' ), - "id" => 'generate_before_footer', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Footer Widgets', 'gp-premium' ), - "id" => 'generate_after_footer_widgets', - "type" => 'textarea' - ), - - array( - "name" => __( 'Before Footer Content', 'gp-premium' ), - "id" => 'generate_before_footer_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'After Footer Content', 'gp-premium' ), - "id" => 'generate_after_footer_content', - "type" => 'textarea' - ), - - array( - "name" => __( 'wp_footer', 'gp-premium' ), - "id" => 'generate_wp_footer', - "type" => 'textarea' - ) - ) - ); - - $settings = apply_filters( 'gp_hooks_settings_fields', $settings ); - - return $settings; - } - - /** - * Register plugin settings - * @return void - */ - public function register_settings() { - if ( is_array( $this->settings ) ) { - foreach( $this->settings as $section => $data ) { - - // Add section to page - add_settings_section( $section, $data['title'], array( $this, 'settings_section' ), 'gp_hooks_settings' ); - - foreach( $data['fields'] as $field ) { - - // Sanitizing isn't possible, as hooks allow any HTML, JS or PHP to be added. - // Allowing PHP can be a security issue if you have admin users who you don't trust. - // In that case, you can disable the ability to add PHP in hooks like this: define( 'GENERATE_HOOKS_DISALLOW_PHP', true ); - $validation = ''; - if( isset( $field['callback'] ) ) { - $validation = $field['callback']; - } - - // Register field - $option_name = $this->settings_base . $field['id']; - register_setting( 'gp_hooks_settings', 'generate_hooks', $validation ); - - // Add field to page - add_settings_field( 'generate_hooks[' . $field['id'] . ']', $field['name'], array( $this, 'display_field' ), 'gp_hooks_settings', $section, array( 'field' => $field ) ); - } - } - } - } - - public function settings_section( $section ) { - $html = ''; - echo $html; - } - - /** - * Generate HTML for displaying fields - * @param array $args Field data - * @return void - */ - public function display_field( $args ) { - - $field = $args['field']; - - $html = ''; - - $option_name = $this->settings_base . $field['id']; - $option = get_option( 'generate_hooks' ); - - $data = ''; - if( isset( $option[$option_name] ) ) { - $data = $option[$option_name]; - } elseif( isset( $field['default'] ) ) { - $data = $field['default']; - } - - - switch( $field['type'] ) { - - case 'textarea': - $checked = ''; - $checked2 = ''; - if( isset( $option[$field['id'] . '_php'] ) && 'true' == $option[$field['id'] . '_php'] ){ - $checked = 'checked="checked"'; - } - if( isset( $option[$field['id'] . '_disable'] ) && 'true' == $option[$field['id'] . '_disable'] ){ - $checked2 = 'checked="checked"'; - } - $html .= ''; - - if ( ! defined( 'GENERATE_HOOKS_DISALLOW_PHP' ) ) { - $html .= '
'; - } - $html .= '
'; - break; - - case 'checkbox': - - - break; - - } - - echo $html; - } - - /** - * Validate individual settings field - * @param string $data Inputted value - * @return string Validated value - */ - public function validate_field( $data ) { - if ( $data && strlen( $data ) > 0 && $data != '' ) { - $data = urlencode( strtolower( str_replace( ' ' , '-' , $data ) ) ); - } - return $data; - } - - /** - * Load settings page content - * @return void - */ - public function settings_page() { - - // Build page HTML - $html = '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - // Get settings fields - ob_start(); - settings_fields( 'gp_hooks_settings' ); - do_settings_sections( 'gp_hooks_settings' ); - $html .= ob_get_clean(); - $html .= '
'; - - $html .= '
'; - $html .= '
'; - $html .= '

' . __( 'GP Hooks', 'gp-premium' ) . '

'; - $html .= '
'; - $html .= '

' . __( 'Use these fields to insert anything you like throughout GeneratePress. Shortcodes are allowed, and you can even use PHP if you check the Execute PHP checkboxes.', 'gp-premium' ) . '

'; - $html .= ''; - $html .= '

'; - $html .= ''; - $html .= '

'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - - echo $html; - } - - } - $settings = new Generate_Hooks_Settings( __FILE__ ); -} - -if ( ! function_exists( 'generate_update_hooks' ) ) { - add_action( 'admin_init', 'generate_update_hooks' ); - /** - * Moving standalone db entries to generate_hooks db entry - */ - function generate_update_hooks() { - $generate_hooks = get_option( 'generate_hooks' ); - - // If we've done this before, bail - if ( ! empty( $generate_hooks ) ) { - return; - } - - // One last check - if ( 'true' == $generate_hooks['updated'] ) { - return; - } - - $hooks = generate_hooks_get_hooks(); - $generate_new_hooks = array(); - - foreach ( $hooks as $hook ) { - - $current_hook = get_option( $hook ); - - if ( isset( $current_hook ) && '' !== $current_hook ) { - - $generate_new_hooks[ $hook ] = get_option( $hook ); - $generate_new_hooks[ 'updated' ] = 'true'; - // Let's not delete the old options yet, just in case - //delete_option( $hook ); - - } - - } - - $generate_new_hook_settings = wp_parse_args( $generate_new_hooks, $generate_hooks ); - update_option( 'generate_hooks', $generate_new_hook_settings ); - - } -} - -if ( ! function_exists( 'generate_hooks_admin_errors' ) ) { - add_action( 'admin_notices', 'generate_hooks_admin_errors' ); - /** - * Add our admin notices - */ - function generate_hooks_admin_errors() { - $screen = get_current_screen(); - if ( 'appearance_page_gp_hooks_settings' !== $screen->base ) { - return; - } - - if ( isset( $_GET['settings-updated'] ) && 'true' == $_GET['settings-updated'] ) { - add_settings_error( 'generate-hook-notices', 'true', __( 'Hooks saved.', 'gp-premium' ), 'updated' ); - } - - settings_errors( 'generate-hook-notices' ); - } -} - -add_action( 'admin_head', 'generate_old_gp_hooks_fix_menu' ); -/** - * Set our current menu in the admin while in the old Page Header pages. - * - * @since 1.7 - */ -function generate_old_gp_hooks_fix_menu() { - if ( ! function_exists( 'generate_premium_do_elements' ) ) { - return; - } - - global $parent_file, $submenu_file, $post_type; - - $screen = get_current_screen(); - - if ( 'appearance_page_gp_hooks_settings' === $screen->base ) { - $parent_file = 'themes.php'; - $submenu_file = 'edit.php?post_type=gp_elements'; - } - - remove_submenu_page( 'themes.php', 'gp_hooks_settings' ); -} - -add_action( 'admin_head', 'generate_hooks_add_legacy_button', 999 ); -/** - * Add legacy buttons to our new GP Elements post type. - * - * @since 1.7 - */ -function generate_hooks_add_legacy_button() { - if ( ! function_exists( 'generate_premium_do_elements' ) ) { - return; - } - - $screen = get_current_screen(); - - if ( 'gp_elements' === $screen->post_type && 'edit' === $screen->base ) : - ?> - - $value array( - 'title' => __( 'Backgrounds', 'gp-premium' ), - 'description' => __( 'Set background images for various HTML elements.', 'gp-premium' ), - 'key' => 'generate_package_backgrounds', - 'settings' => 'generate_background_settings', - 'isActive' => 'activated' === get_option( 'generate_package_backgrounds', false ), - 'exportable' => true, - ), - 'Blog' => array( - 'title' => __( 'Blog', 'gp-premium' ), - 'description' => __( 'Set blog options like infinite scroll, masonry layouts and more.', 'gp-premium' ), - 'key' => 'generate_package_blog', - 'settings' => 'generate_blog_settings', - 'isActive' => 'activated' === get_option( 'generate_package_blog', false ), - 'exportable' => true, - ), - 'Colors' => array( - 'title' => __( 'Colors', 'gp-premium' ), - 'key' => 'generate_package_colors', - 'isActive' => 'activated' === get_option( 'generate_package_colors', false ), - ), - 'Copyright' => array( - 'title' => __( 'Copyright', 'gp-premium' ), - 'description' => __( 'Set a custom copyright message in your footer.', 'gp-premium' ), - 'key' => 'generate_package_copyright', - 'settings' => 'copyright', - 'isActive' => 'activated' === get_option( 'generate_package_copyright', false ), - 'exportable' => true, - ), - 'Disable Elements' => array( - 'title' => __( 'Disable Elements', 'gp-premium' ), - 'description' => __( 'Disable default theme elements on specific pages or inside a Layout Element.', 'gp-premium' ), - 'key' => 'generate_package_disable_elements', - 'isActive' => 'activated' === get_option( 'generate_package_disable_elements', false ), - ), - 'Elements' => array( - 'title' => __( 'Elements', 'gp-premium' ), - 'description' => __( 'Use our block editor theme builder, build advanced HTML hooks, and gain more Layout control.', 'gp-premium' ), - 'key' => 'generate_package_elements', - 'isActive' => 'activated' === get_option( 'generate_package_elements', false ), - ), - 'Hooks' => array( - 'title' => __( 'Hooks', 'gp-premium' ), - 'description' => __( 'This module has been deprecated. Please use Elements instead.', 'gp-premium' ), - 'key' => 'generate_package_hooks', - 'settings' => 'generate_hooks', - 'isActive' => 'activated' === get_option( 'generate_package_hooks', false ), - 'exportable' => true, - ), - 'Menu Plus' => array( - 'title' => __( 'Menu Plus', 'gp-premium' ), - 'description' => __( 'Set up a mobile header, sticky navigation or off-canvas panel.', 'gp-premium' ), - 'key' => 'generate_package_menu_plus', - 'settings' => 'generate_menu_plus_settings', - 'isActive' => 'activated' === get_option( 'generate_package_menu_plus', false ), - 'exportable' => true, - ), - 'Page Header' => array( - 'title' => __( 'Page Header', 'gp-premium' ), - 'description' => __( 'This module has been deprecated. Please use Elements instead.', 'gp-premium' ), - 'key' => 'generate_package_page_header', - 'settings' => 'generate_page_header_settings', - 'isActive' => 'activated' === get_option( 'generate_package_page_header', false ), - 'exportable' => true, - ), - 'Secondary Nav' => array( - 'title' => __( 'Secondary Nav', 'gp-premium' ), - 'description' => __( 'Add a fully-featured secondary navigation to your site.', 'gp-premium' ), - 'key' => 'generate_package_secondary_nav', - 'settings' => 'generate_secondary_nav_settings', - 'isActive' => 'activated' === get_option( 'generate_package_secondary_nav', false ), - 'exportable' => true, - ), - 'Sections' => array( - 'title' => __( 'Sections', 'gp-premium' ), - 'description' => __( 'This module has been deprecated. Please consider using our GenerateBlocks plugin instead.', 'gp-premium' ), - 'key' => 'generate_package_sections', - 'isActive' => 'activated' === get_option( 'generate_package_sections', false ), - ), - 'Spacing' => array( - 'title' => __( 'Spacing', 'gp-premium' ), - 'description' => __( 'Set the padding and overall spacing of your theme elements.', 'gp-premium' ), - 'key' => 'generate_package_spacing', - 'settings' => 'generate_spacing_settings', - 'isActive' => 'activated' === get_option( 'generate_package_spacing', false ), - 'exportable' => true, - ), - 'Typography' => array( - 'title' => __( 'Typography', 'gp-premium' ), - 'description' => __( 'This module has been deprecated. Switch to our dynamic typography system in Customize > General instead.', 'gp-premium' ), - 'key' => 'generate_package_typography', - 'isActive' => 'activated' === get_option( 'generate_package_typography', false ), - ), - 'WooCommerce' => array( - 'title' => __( 'WooCommerce', 'gp-premium' ), - 'description' => __( 'Add colors, typography, and layout options to your WooCommerce store.', 'gp-premium' ), - 'key' => 'generate_package_woocommerce', - 'settings' => 'generate_woocommerce_settings', - 'isActive' => 'activated' === get_option( 'generate_package_woocommerce', false ), - 'exportable' => true, - ), - ); - - if ( version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) { - $modules['Site Library'] = array( - 'title' => __( 'Site Library', 'gp-premium' ), - 'description' => __( 'Choose from an extensive library of professionally designed starter sites.', 'gp-premium' ), - 'key' => 'generate_package_site_library', - 'isActive' => 'activated' === get_option( 'generate_package_site_library', false ), - ); - } - - if ( function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography() ) { - unset( $modules['Typography'] ); - } - - if ( version_compare( generate_premium_get_theme_version(), '3.1.0-alpha.1', '>=' ) ) { - unset( $modules['Colors'] ); - } - - $deprecated_modules = apply_filters( - 'generate_premium_deprecated_modules', - array( - 'Page Header', - 'Hooks', - 'Sections', - ) - ); - - foreach ( $deprecated_modules as $deprecated_module ) { - if ( isset( $modules[ $deprecated_module ] ) ) { - $modules[ $deprecated_module ]['deprecated'] = true; - } - } - - ksort( $modules ); - - return $modules; - } - - /** - * Get modules that can have their settings exported and imported. - */ - public static function get_exportable_modules() { - $modules = array( - 'Core' => array( - 'settings' => 'generate_settings', - 'title' => __( 'Core', 'gp-premium' ), - 'isActive' => true, - ), - ); - - foreach ( self::get_modules() as $key => $data ) { - if ( ! empty( $data['exportable'] ) && $data['isActive'] ) { - $modules[ $key ] = $data; - } - } - - return $modules; - } - - /** - * Get options using theme_mods. - */ - public static function get_theme_mods() { - $theme_mods = array( - 'font_body_variants', - 'font_body_category', - 'font_site_title_variants', - 'font_site_title_category', - 'font_site_tagline_variants', - 'font_site_tagline_category', - 'font_navigation_variants', - 'font_navigation_category', - 'font_secondary_navigation_variants', - 'font_secondary_navigation_category', - 'font_buttons_variants', - 'font_buttons_category', - 'font_heading_1_variants', - 'font_heading_1_category', - 'font_heading_2_variants', - 'font_heading_2_category', - 'font_heading_3_variants', - 'font_heading_3_category', - 'font_heading_4_variants', - 'font_heading_4_category', - 'font_heading_5_variants', - 'font_heading_5_category', - 'font_heading_6_variants', - 'font_heading_6_category', - 'font_widget_title_variants', - 'font_widget_title_category', - 'font_footer_variants', - 'font_footer_category', - 'generate_copyright', - ); - - if ( function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography() ) { - $theme_mods = array( - 'generate_copyright', - ); - } - - return $theme_mods; - } - - /** - * Get our setting keys. - */ - public static function get_setting_keys() { - return array( - 'generate_settings', - 'generate_background_settings', - 'generate_blog_settings', - 'generate_hooks', - 'generate_page_header_settings', - 'generate_secondary_nav_settings', - 'generate_spacing_settings', - 'generate_menu_plus_settings', - 'generate_woocommerce_settings', - ); - } - - /** - * Returns safely the license key. - */ - public static function get_license_key() { - $license_key = get_option( 'gen_premium_license_key', '' ); - - if ( $license_key && strlen( $license_key ) > 4 ) { - $hidden_length = strlen( $license_key ) - 4; - $safe_part = substr( $license_key, 0, 4 ); - $hidden_part = implode('', array_fill( 0, $hidden_length, '*' ) ); - - return $safe_part . $hidden_part; - } - - return $license_key; - } - - /** - * Add our scripts to the page. - */ - public function enqueue_scripts() { - if ( ! class_exists( 'GeneratePress_Dashboard' ) ) { - return; - } - - $dashboard_pages = GeneratePress_Dashboard::get_pages(); - $current_screen = get_current_screen(); - - if ( in_array( $current_screen->id, $dashboard_pages ) ) { - wp_enqueue_style( - 'generate-pro-dashboard', - GP_PREMIUM_DIR_URL . 'dist/style-dashboard.css', - array( 'wp-components' ), - GP_PREMIUM_VERSION - ); - - if ( 'appearance_page_generate-options' === $current_screen->id ) { - wp_enqueue_script( - 'generate-pro-dashboard', - GP_PREMIUM_DIR_URL . 'dist/dashboard.js', - array(), - GP_PREMIUM_VERSION, - true - ); - - wp_set_script_translations( 'generate-pro-dashboard', 'gp-premium', GP_PREMIUM_DIR_PATH . 'langs' ); - - wp_localize_script( - 'generate-pro-dashboard', - 'generateProDashboard', - array( - 'modules' => self::get_modules(), - 'exportableModules' => self::get_exportable_modules(), - 'siteLibraryUrl' => admin_url( 'themes.php?page=generatepress-library' ), - 'elementsUrl' => admin_url( 'edit.php?post_type=gp_elements' ), - 'hasWooCommerce' => class_exists( 'WooCommerce' ), - 'licenseKey' => self::get_license_key(), - 'licenseKeyStatus' => get_option( 'gen_premium_license_key_status', 'deactivated' ), - 'betaTester' => get_option( 'gp_premium_beta_testing', false ), - ) - ); - } - } - } - - /** - * Enable beta testing if our option is set. - * - * @since 2.1.0 - * @param boolean $value Whether beta testing is on or not. - */ - public function set_beta_tester( $value ) { - if ( get_option( 'gp_premium_beta_testing', false ) ) { - return true; - } - - return $value; - } - - /** - * Add the container for our start customizing app. - */ - public function module_list() { - echo '
'; - } - - /** - * Add the container for our start customizing app. - */ - public function license_key() { - echo '
'; - } - - /** - * Add the container for our start customizing app. - */ - public function import_export() { - echo '
'; - } - - /** - * Add the container for our reset app. - */ - public function reset() { - echo '
'; - } -} - -GeneratePress_Pro_Dashboard::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/class-rest.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/class-rest.php deleted file mode 100644 index e9bffe21..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/class-rest.php +++ /dev/null @@ -1,570 +0,0 @@ -namespace . $this->version; - - register_rest_route( - $namespace, - '/modules/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'update_module' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - register_rest_route( - $namespace, - '/license/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'update_licensing' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - register_rest_route( - $namespace, - '/beta/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'update_beta_testing' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - register_rest_route( - $namespace, - '/export/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'export' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - register_rest_route( - $namespace, - '/import/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'import' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - register_rest_route( - $namespace, - '/reset/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'reset' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - } - - /** - * Get edit options permissions. - * - * @return bool - */ - public function update_settings_permission() { - return current_user_can( 'manage_options' ); - } - - /** - * Update modules. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function update_module( WP_REST_Request $request ) { - $module_key = $request->get_param( 'key' ); - $action = $request->get_param( 'action' ); - $current_setting = get_option( $module_key, false ); - $modules = GeneratePress_Pro_Dashboard::get_modules(); - $safe_module_keys = array(); - - foreach ( $modules as $key => $data ) { - $safe_module_keys[] = $data['key']; - } - - if ( ! in_array( $module_key, $safe_module_keys ) ) { - return $this->failed( 'Bad module key.' ); - } - - $message = ''; - - if ( 'activate' === $action ) { - update_option( $module_key, 'activated' ); - $message = __( 'Module activated.', 'gp-premium' ); - } - - if ( 'deactivate' === $action ) { - update_option( $module_key, 'deactivated' ); - $message = __( 'Module deactivated.', 'gp-premium' ); - } - - return $this->success( $message ); - } - - /** - * Update licensing. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function update_licensing( WP_REST_Request $request ) { - $new_license_key = $request->get_param( 'key' ); - $old_license = get_option( 'gen_premium_license_key', '' ); - $old_status = get_option( 'gen_premium_license_key_status', 'deactivated' ); - $new_license = strpos( $new_license_key, '***' ) !== false - ? trim( $old_license ) - : trim( $new_license_key ); - - if ( $new_license ) { - $api_params = array( - 'edd_action' => 'activate_license', - 'license' => sanitize_key( $new_license ), - 'item_name' => rawurlencode( 'GP Premium' ), - 'url' => home_url(), - ); - } elseif ( $old_license && 'valid' === $old_status ) { - $api_params = array( - 'edd_action' => 'deactivate_license', - 'license' => sanitize_key( $old_license ), - 'item_name' => rawurlencode( 'GP Premium' ), - 'url' => home_url(), - ); - } - - if ( isset( $api_params ) ) { - $response = wp_remote_post( - 'https://generatepress.com', - array( - 'timeout' => 30, - 'sslverify' => false, - 'body' => $api_params, - ) - ); - - if ( is_wp_error( $response ) || 200 !== (int) wp_remote_retrieve_response_code( $response ) ) { - if ( is_object( $response ) ) { - return $this->failed( $response->get_error_message() ); - } elseif ( is_array( $response ) && isset( $response['response']['message'] ) ) { - if ( 'Forbidden' === $response['response']['message'] ) { - $message = __( '403 Forbidden. Your server is not able to communicate with generatepress.com in order to activate your license key.', 'gp-premium' ); - } else { - $message = $response['response']['message']; - } - } - } else { - $license_data = json_decode( wp_remote_retrieve_body( $response ) ); - - if ( false === $license_data->success ) { - switch ( $license_data->error ) { - case 'expired': - $message = sprintf( - /* translators: License key expiration date. */ - __( 'Your license key expired on %s.', 'gp-premium' ), - date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) ) // phpcs:ignore - ); - break; - - case 'disabled': - case 'revoked': - $message = __( 'Your license key has been disabled.', 'gp-premium' ); - break; - - case 'missing': - $message = __( 'Invalid license.', 'gp-premium' ); - break; - - case 'invalid': - case 'site_inactive': - $message = __( 'Your license is not active for this URL.', 'gp-premium' ); - break; - - case 'item_name_mismatch': - /* translators: GP Premium */ - $message = sprintf( __( 'This appears to be an invalid license key for %s.', 'gp-premium' ), __( 'GP Premium', 'gp-premium' ) ); - break; - - case 'no_activations_left': - $message = __( 'Your license key has reached its activation limit.', 'gp-premium' ); - break; - - default: - $message = __( 'An error occurred, please try again.', 'gp-premium' ); - break; - } - } - } - - update_option( 'gen_premium_license_key_status', esc_attr( $license_data->license ) ); - } - - update_option( 'gen_premium_license_key', sanitize_key( $new_license ) ); - - if ( ! isset( $api_params ) ) { - return $this->success( __( 'Settings saved.', 'gp-premium' ) ); - } - - if ( ! empty( $message ) ) { - return $this->failed( $message ); - } - - return $this->success( $license_data ); - } - - /** - * Update licensing. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function update_beta_testing( WP_REST_Request $request ) { - $new_beta_tester = $request->get_param( 'beta' ); - - if ( ! empty( $new_beta_tester ) ) { - update_option( 'gp_premium_beta_testing', true, false ); - } else { - delete_option( 'gp_premium_beta_testing' ); - } - - if ( ! isset( $api_params ) ) { - return $this->success( __( 'Settings saved.', 'gp-premium' ) ); - } - - if ( ! empty( $message ) ) { - return $this->failed( $message ); - } - - return $this->success( $license_data ); - } - - /** - * Export settings. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function export( WP_REST_Request $request ) { - $exportable_modules = $request->get_param( 'items' ); - - if ( ! $exportable_modules ) { - $exportable_modules = GeneratePress_Pro_Dashboard::get_exportable_modules(); - } - - $export_type = $request->get_param( 'type' ); - - if ( 'all' === $export_type ) { - $data = array( - 'modules' => array(), - 'mods' => array(), - 'options' => array(), - ); - - $module_settings = array(); - - foreach ( $exportable_modules as $exported_module_key => $exported_module_data ) { - if ( isset( $exported_module_data['settings'] ) ) { - $module_settings[] = $exported_module_data['settings']; - } - } - - $modules = GeneratePress_Pro_Dashboard::get_modules(); - - // Export module status of the exported options. - foreach ( $modules as $module_key => $module_data ) { - if ( isset( $module_data['settings'] ) && in_array( $module_data['settings'], $module_settings ) ) { - $data['modules'][ $module_key ] = $module_data['key']; - } - } - - $theme_mods = GeneratePress_Pro_Dashboard::get_theme_mods(); - - foreach ( $theme_mods as $theme_mod ) { - if ( 'generate_copyright' === $theme_mod ) { - if ( in_array( 'copyright', $module_settings ) ) { - $data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); - } - } else { - if ( in_array( 'generate_settings', $module_settings ) ) { - $data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); - } - } - } - - $settings = GeneratePress_Pro_Dashboard::get_setting_keys(); - - foreach ( $settings as $setting ) { - if ( in_array( $setting, $module_settings ) ) { - $data['options'][ $setting ] = get_option( $setting ); - } - } - } - - if ( 'global-colors' === $export_type ) { - $data['global-colors'] = generate_get_option( 'global_colors' ); - } - - if ( 'typography' === $export_type ) { - $data['font-manager'] = generate_get_option( 'font_manager' ); - $data['typography'] = generate_get_option( 'typography' ); - } - - $data = apply_filters( 'generate_export_data', $data, $export_type ); - - return $this->success( $data ); - } - - /** - * Import settings. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function import( WP_REST_Request $request ) { - $settings = $request->get_param( 'import' ); - - if ( empty( $settings ) ) { - $this->failed( __( 'No settings to import.', 'gp-premium' ) ); - } - - if ( ! empty( $settings['typography'] ) ) { - $existing_settings = get_option( 'generate_settings', array() ); - $existing_settings['typography'] = $settings['typography']; - - if ( ! empty( $settings['font-manager'] ) ) { - $existing_settings['font_manager'] = $settings['font-manager']; - } - - update_option( 'generate_settings', $existing_settings ); - } elseif ( ! empty( $settings['global-colors'] ) ) { - $existing_settings = get_option( 'generate_settings', array() ); - $existing_settings['global_colors'] = $settings['global-colors']; - - update_option( 'generate_settings', $existing_settings ); - } else { - $modules = GeneratePress_Pro_Dashboard::get_modules(); - - foreach ( (array) $settings['modules'] as $key => $val ) { - if ( isset( $modules[ $key ] ) && in_array( $val, $modules[ $key ] ) ) { - update_option( $val, 'activated' ); - } - } - - foreach ( (array) $settings['mods'] as $key => $val ) { - if ( in_array( $key, GeneratePress_Pro_Dashboard::get_theme_mods() ) ) { - set_theme_mod( $key, $val ); - } - } - - foreach ( (array) $settings['options'] as $key => $val ) { - if ( in_array( $key, GeneratePress_Pro_Dashboard::get_setting_keys() ) ) { - update_option( $key, $val ); - } - } - } - - // Delete existing dynamic CSS cache. - delete_option( 'generate_dynamic_css_output' ); - delete_option( 'generate_dynamic_css_cached_version' ); - - $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( isset( $dynamic_css_data['updated_time'] ) ) { - unset( $dynamic_css_data['updated_time'] ); - } - - update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); - - return $this->success( __( 'Settings imported.', 'gp-premium' ) ); - } - - /** - * Reset settings. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function reset( WP_REST_Request $request ) { - $reset_items = $request->get_param( 'items' ); - - if ( ! $reset_items ) { - $reset_items = GeneratePress_Pro_Dashboard::get_exportable_modules(); - } - - $module_settings = array(); - - foreach ( $reset_items as $reset_module_key => $reset_module_data ) { - if ( isset( $reset_module_data['settings'] ) ) { - $module_settings[] = $reset_module_data['settings']; - } - } - - $theme_mods = GeneratePress_Pro_Dashboard::get_theme_mods(); - - foreach ( $theme_mods as $theme_mod ) { - if ( 'generate_copyright' === $theme_mod ) { - if ( in_array( 'copyright', $module_settings ) ) { - remove_theme_mod( $theme_mod ); - } - } else { - if ( in_array( 'generate_settings', $module_settings ) ) { - remove_theme_mod( $theme_mod ); - } - } - } - - $settings = GeneratePress_Pro_Dashboard::get_setting_keys(); - - foreach ( $settings as $setting ) { - if ( in_array( $setting, $module_settings ) ) { - delete_option( $setting ); - } - } - - // Delete our dynamic CSS option. - delete_option( 'generate_dynamic_css_output' ); - delete_option( 'generate_dynamic_css_cached_version' ); - - // Reset our dynamic CSS file updated time so it regenerates. - $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( isset( $dynamic_css_data['updated_time'] ) ) { - unset( $dynamic_css_data['updated_time'] ); - } - - update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); - - // Delete any GeneratePress Site CSS in Additional CSS. - $additional_css = wp_get_custom_css_post(); - - if ( ! empty( $additional_css ) ) { - $additional_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $additional_css->post_content ); - wp_update_custom_css_post( $additional_css->post_content ); - } - - return $this->success( __( 'Settings reset.', 'gp-premium' ) ); - } - - /** - * Success rest. - * - * @param mixed $response response data. - * @return mixed - */ - public function success( $response ) { - return new WP_REST_Response( - array( - 'success' => true, - 'response' => $response, - ), - 200 - ); - } - - /** - * Failed rest. - * - * @param mixed $response response data. - * @return mixed - */ - public function failed( $response ) { - return new WP_REST_Response( - array( - 'success' => false, - 'response' => $response, - ), - 200 - ); - } - - /** - * Error rest. - * - * @param mixed $code error code. - * @param mixed $response response data. - * @return mixed - */ - public function error( $code, $response ) { - return new WP_REST_Response( - array( - 'error' => true, - 'success' => false, - 'error_code' => $code, - 'response' => $response, - ), - 401 - ); - } -} - -GeneratePress_Pro_Rest::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/deprecated-admin.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/deprecated-admin.php deleted file mode 100644 index afe92537..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/deprecated-admin.php +++ /dev/null @@ -1,790 +0,0 @@ -id ) { - return true; - } - - return false; -} - -/** - * Add the Sites tab to our Dashboard tabs. - * - * @since 1.6 - * @deprecated 2.0.0 - * - * @param array $tabs Existing tabs. - * @return array New tabs. - */ -function generate_sites_dashboard_tab( $tabs ) { - $tabs['Sites'] = array( - 'name' => __( 'Site Library', 'gp-premium' ), - 'url' => admin_url( 'themes.php?page=generatepress-site-library' ), - 'class' => generate_is_sites_dashboard() ? 'active' : '', - ); - - return $tabs; -} - -/** - * Register our Site Library page. - * - * @since 1.7 - * @deprecated 2.0.0 - */ -function generate_site_library_register() { - add_submenu_page( - 'themes.php', - __( 'Site Library', 'gp-premium' ), - __( 'Site Library', 'gp-premium' ), - 'manage_options', - 'generatepress-site-library', - 'generate_sites_container' - ); -} - -/** - * Set our current menu item as the GeneratePress Dashboard. - * - * @since 1.7 - * @deprecated 2.0.0 - */ -function generate_site_library_fix_menu() { - global $parent_file, $submenu_file, $post_type; - - if ( generate_is_sites_dashboard() ) { - $parent_file = 'themes.php'; // phpcs:ignore -- Override necessary. - $submenu_file = 'generate-options'; // phpcs:ignore -- Override necessary. - } - - remove_submenu_page( 'themes.php', 'generatepress-site-library' ); -} - -/** - * Add our scripts for the site library. - * - * @since 1.8 - * @deprecated 2.0.0 - */ -function generate_sites_do_enqueue_scripts() { - if ( ! generate_is_sites_dashboard() ) { - return; - } - - $backup_data = get_option( '_generatepress_site_library_backup', array() ); - - wp_enqueue_script( - 'generate-sites-admin', - GENERATE_SITES_URL . 'assets/js/admin.js', - array( 'jquery', 'wp-util', 'updates', 'generate-sites-blazy' ), - GP_PREMIUM_VERSION, - true - ); - - wp_enqueue_script( - 'generate-sites-download', - GENERATE_SITES_URL . 'assets/js/download.js', - array( 'jquery', 'generate-sites-admin' ), - GP_PREMIUM_VERSION, - true - ); - - wp_enqueue_script( - 'generate-sites-blazy', - GENERATE_SITES_URL . 'assets/js/blazy.min.js', - array(), - GP_PREMIUM_VERSION, - true - ); - - wp_localize_script( - 'generate-sites-admin', - 'generate_sites_params', - array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'nonce' => wp_create_nonce( 'generate_sites_nonce' ), - 'importing_options' => __( 'Importing options', 'gp-premium' ), - 'backing_up_options' => __( 'Backing up options', 'gp-premium' ), - 'checking_demo_content' => __( 'Checking demo content', 'gp-premium' ), - 'downloading_content' => __( 'Downloading content', 'gp-premium' ), - 'importing_content' => __( 'Importing content', 'gp-premium' ), - 'importing_site_options' => __( 'Importing site options', 'gp-premium' ), - 'importing_widgets' => __( 'Importing widgets', 'gp-premium' ), - 'activating_plugins' => __( 'Activating plugins', 'gp-premium' ), - 'installing_plugins' => __( 'Installing plugins', 'gp-premium' ), - 'automatic_plugins' => __( 'Automatic', 'gp-premium' ), - 'manual_plugins' => __( 'Manual', 'gp-premium' ), - 'home_url' => home_url(), - 'restoreThemeOptions' => __( 'Restoring theme options', 'gp-premium' ), - 'restoreSiteOptions' => __( 'Restoring site options', 'gp-premium' ), - 'restoreContent' => __( 'Removing imported content', 'gp-premium' ), - 'restorePlugins' => __( 'Deactivating imported plugins', 'gp-premium' ), - 'restoreWidgets' => __( 'Restoring widgets', 'gp-premium' ), - 'restoreCSS' => __( 'Restoring CSS', 'gp-premium' ), - 'cleanUp' => __( 'Cleaning up', 'gp-premium' ), - 'hasContentBackup' => ! empty( $backup_data['content'] ), - 'confirmRemoval' => __( 'This process makes changes to your database. If you have existing data, be sure to create a backup as a precaution.', 'gp-premium' ), - ) - ); - - wp_enqueue_style( - 'generate-sites-admin', - GENERATE_SITES_URL . 'assets/css/admin.css', - array(), - GP_PREMIUM_VERSION - ); - - wp_enqueue_style( - 'generate-premium-dashboard', - plugin_dir_url( dirname( __FILE__ ) ) . 'inc/assets/dashboard.css', - array(), - GP_PREMIUM_VERSION - ); -} - -/** - * Add a body class while in the Site Library. - * - * @since 1.8 - * @deprecated 2.0.0 - * - * @param array $classes Current body classes. - * @return array Existing and our new body classes - */ -function generate_sites_do_admin_body_classes( $classes ) { - if ( generate_is_sites_dashboard() ) { - $classes .= ' generate-sites'; - } - - return $classes; -} - -/** - * Add an opening wrapper element for our Dashboard tabs and page builder links. - * - * @since 1.8 - */ -function generate_sites_add_tabs_wrapper_open() { - echo '
'; -} - -/** - * Adds our Site dashboard container. - * - * @since 1.6 - * @deprecated 2.0.0 - */ -function generate_sites_container() { - ?> -
-
-
-
- -
- - -
-
-
- '; - - if ( ! empty( $page_builders ) ) : - ?> -
- -
- -
-
- - -
- -
- - - - -
-

- -
-

-

-
- -
- - - - -
-
- -
- -
- - - %2$s - -
', - esc_html( wp_create_nonce( 'refresh_sites_nonce' ) ), - __( 'Refresh Sites', 'gp-premium' ), - esc_url( admin_url( 'themes.php?page=generatepress-site-library' ) ), - __( 'Reload Page', 'gp-premium' ) - ); - ?> - - - get_post_types( array( 'public' => true ) ), - 'showposts' => -1, - 'meta_query' => array( - array( - 'key' => '_generate-select-page-header', - 'compare' => 'EXISTS', - ), - ), - ); - - $posts = get_posts( $args ); - $new_values = array(); - - foreach ( $posts as $post ) { - $page_header_id = get_post_meta( $post->ID, '_generate-select-page-header', true ); - - if ( $page_header_id ) { - $new_values[ $post->ID ] = $page_header_id; - } - } - - return $new_values; -} - -/** - * Get our Element display locations. - * - * @since 1.7 - * @deprecated 2.0.0 - * - * @return array - */ -function generate_sites_export_elements_location() { - $args = array( - 'post_type' => 'gp_elements', - 'showposts' => -1, - ); - - $posts = get_posts( $args ); - $new_values = array(); - - foreach ( $posts as $post ) { - $display_conditions = get_post_meta( $post->ID, '_generate_element_display_conditions', true ); - - if ( $display_conditions ) { - $new_values[ $post->ID ] = $display_conditions; - } - } - - return $new_values; -} - -/** - * Get our Element display locations. - * - * @since 1.7 - * @deprecated 2.0.0 - * - * @return array - */ -function generate_sites_export_elements_exclusion() { - $args = array( - 'post_type' => 'gp_elements', - 'showposts' => -1, - ); - - $posts = get_posts( $args ); - $new_values = array(); - - foreach ( $posts as $post ) { - $display_conditions = get_post_meta( $post->ID, '_generate_element_exclude_conditions', true ); - - if ( $display_conditions ) { - $new_values[ $post->ID ] = $display_conditions; - } - } - - return $new_values; -} - -/** - * List out compatible theme modules Sites can activate. - * - * @since 1.6 - * @deprecated 2.0.0 - * - * @return array - */ -function generatepress_get_site_premium_modules() { - return array( - 'Backgrounds' => 'generate_package_backgrounds', - 'Blog' => 'generate_package_blog', - 'Colors' => 'generate_package_colors', - 'Copyright' => 'generate_package_copyright', - 'Elements' => 'generate_package_elements', - 'Disable Elements' => 'generate_package_disable_elements', - 'Hooks' => 'generate_package_hooks', - 'Menu Plus' => 'generate_package_menu_plus', - 'Page Header' => 'generate_package_page_header', - 'Secondary Nav' => 'generate_package_secondary_nav', - 'Sections' => 'generate_package_sections', - 'Spacing' => 'generate_package_spacing', - 'Typography' => 'generate_package_typography', - 'WooCommerce' => 'generate_package_woocommerce', - ); -} - -/** - * Don't allow Sites to modify these options. - * - * @since 1.6 - * @deprecated 2.0.0 - * - * @return array - */ -function generatepress_sites_disallowed_options() { - return array( - 'admin_email', - 'siteurl', - 'home', - 'blog_charset', - 'blog_public', - 'current_theme', - 'stylesheet', - 'template', - 'default_role', - 'mailserver_login', - 'mailserver_pass', - 'mailserver_port', - 'mailserver_url', - 'permalink_structure', - 'rewrite_rules', - 'users_can_register', - ); -} - -/** - * Add our GeneratePress Site export checkbox to the Export module. - * - * @since 1.7 - * @deprecated 2.0.0 - */ -function generatepress_sites_add_export_checkbox() { - if ( ! apply_filters( 'generate_show_generatepress_site_export_option', false ) ) { - return; - } - ?> -
- - - $key ) { - if ( 'activated' === get_option( $key ) ) { - $data['modules'][ $name ] = $key; - } - } - - // Site options. - $data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); - $data['site_options']['custom_logo'] = wp_get_attachment_url( get_theme_mod( 'custom_logo' ) ); - $data['site_options']['show_on_front'] = get_option( 'show_on_front' ); - $data['site_options']['page_on_front'] = get_option( 'page_on_front' ); - $data['site_options']['page_for_posts'] = get_option( 'page_for_posts' ); - - // Page header. - $data['site_options']['page_header_global_locations'] = get_option( 'generate_page_header_global_locations' ); - $data['site_options']['page_headers'] = generate_sites_export_page_headers(); - - // Elements. - $data['site_options']['element_locations'] = generate_sites_export_elements_location(); - $data['site_options']['element_exclusions'] = generate_sites_export_elements_exclusion(); - - // Custom CSS. - if ( function_exists( 'wp_get_custom_css_post' ) ) { - $data['custom_css'] = wp_get_custom_css_post()->post_content; - } - - // WooCommerce. - if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { - $data['site_options']['woocommerce_shop_page_id'] = get_option( 'woocommerce_shop_page_id' ); - $data['site_options']['woocommerce_cart_page_id'] = get_option( 'woocommerce_cart_page_id' ); - $data['site_options']['woocommerce_checkout_page_id'] = get_option( 'woocommerce_checkout_page_id' ); - $data['site_options']['woocommerce_myaccount_page_id'] = get_option( 'woocommerce_myaccount_page_id' ); - $data['site_options']['woocommerce_single_image_width'] = get_option( 'woocommerce_single_image_width' ); - $data['site_options']['woocommerce_thumbnail_image_width'] = get_option( 'woocommerce_thumbnail_image_width' ); - $data['site_options']['woocommerce_thumbnail_cropping'] = get_option( 'woocommerce_thumbnail_cropping' ); - $data['site_options']['woocommerce_shop_page_display'] = get_option( 'woocommerce_shop_page_display' ); - $data['site_options']['woocommerce_category_archive_display'] = get_option( 'woocommerce_category_archive_display' ); - $data['site_options']['woocommerce_default_catalog_orderby'] = get_option( 'woocommerce_default_catalog_orderby' ); - } - - // Elementor. - if ( is_plugin_active( 'elementor/elementor.php' ) ) { - $data['site_options']['elementor_container_width'] = get_option( 'elementor_container_width' ); - $data['site_options']['elementor_cpt_support'] = get_option( 'elementor_cpt_support' ); - $data['site_options']['elementor_css_print_method'] = get_option( 'elementor_css_print_method' ); - $data['site_options']['elementor_default_generic_fonts'] = get_option( 'elementor_default_generic_fonts' ); - $data['site_options']['elementor_disable_color_schemes'] = get_option( 'elementor_disable_color_schemes' ); - $data['site_options']['elementor_disable_typography_schemes'] = get_option( 'elementor_disable_typography_schemes' ); - $data['site_options']['elementor_editor_break_lines'] = get_option( 'elementor_editor_break_lines' ); - $data['site_options']['elementor_exclude_user_roles'] = get_option( 'elementor_exclude_user_roles' ); - $data['site_options']['elementor_global_image_lightbox'] = get_option( 'elementor_global_image_lightbox' ); - $data['site_options']['elementor_page_title_selector'] = get_option( 'elementor_page_title_selector' ); - $data['site_options']['elementor_scheme_color'] = get_option( 'elementor_scheme_color' ); - $data['site_options']['elementor_scheme_color-picker'] = get_option( 'elementor_scheme_color-picker' ); - $data['site_options']['elementor_scheme_typography'] = get_option( 'elementor_scheme_typography' ); - $data['site_options']['elementor_space_between_widgets'] = get_option( 'elementor_space_between_widgets' ); - $data['site_options']['elementor_stretched_section_container'] = get_option( 'elementor_stretched_section_container' ); - $data['site_options']['elementor_load_fa4_shim'] = get_option( 'elementor_load_fa4_shim' ); - $data['site_options']['elementor_active_kit'] = get_option( 'elementor_active_kit' ); - } - - // Beaver Builder. - if ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) ) { - $data['site_options']['_fl_builder_enabled_icons'] = get_option( '_fl_builder_enabled_icons' ); - $data['site_options']['_fl_builder_enabled_modules'] = get_option( '_fl_builder_enabled_modules' ); - $data['site_options']['_fl_builder_post_types'] = get_option( '_fl_builder_post_types' ); - $data['site_options']['_fl_builder_color_presets'] = get_option( '_fl_builder_color_presets' ); - $data['site_options']['_fl_builder_services'] = get_option( '_fl_builder_services' ); - $data['site_options']['_fl_builder_settings'] = get_option( '_fl_builder_settings' ); - $data['site_options']['_fl_builder_user_access'] = get_option( '_fl_builder_user_access' ); - $data['site_options']['_fl_builder_enabled_templates'] = get_option( '_fl_builder_enabled_templates' ); - } - - // Menu Icons. - if ( is_plugin_active( 'menu-icons/menu-icons.php' ) ) { - $data['site_options']['menu-icons'] = get_option( 'menu-icons' ); - } - - // Ninja Forms. - if ( is_plugin_active( 'ninja-forms/ninja-forms.php' ) ) { - $data['site_options']['ninja_forms_settings'] = get_option( 'ninja_forms_settings' ); - } - - // Social Warfare. - if ( is_plugin_active( 'social-warfare/social-warfare.php' ) ) { - $data['site_options']['socialWarfareOptions'] = get_option( 'socialWarfareOptions' ); - } - - // Elements Plus. - if ( is_plugin_active( 'elements-plus/elements-plus.php' ) ) { - $data['site_options']['elements_plus_settings'] = get_option( 'elements_plus_settings' ); - } - - // Ank Google Map. - if ( is_plugin_active( 'ank-google-map/ank-google-map.php' ) ) { - $data['site_options']['ank_google_map'] = get_option( 'ank_google_map' ); - } - - // GP Social Share. - if ( is_plugin_active( 'gp-social-share-svg/gp-social-share.php' ) ) { - $data['site_options']['gp_social_settings'] = get_option( 'gp_social_settings' ); - } - - // Active plugins. - $active_plugins = get_option( 'active_plugins' ); - $all_plugins = get_plugins(); - - $ignore = apply_filters( - 'generate_sites_ignore_plugins', - array( - 'gp-premium/gp-premium.php', - 'widget-importer-exporter/widget-importer-exporter.php', - ) - ); - - foreach ( $ignore as $plugin ) { - unset( $all_plugins[ $plugin ] ); - } - - $activated_plugins = array(); - - foreach ( $active_plugins as $p ) { - if ( isset( $all_plugins[ $p ] ) ) { - $activated_plugins[ $all_plugins[ $p ]['Name'] ] = $p; - } - } - - $data['plugins'] = $activated_plugins; - - return $data; - -} - -/** - * Get our sites from the site server. - * - * @since 1.12.0' - * @deprecated 2.0.0 - */ -function generate_get_sites_from_library() { - $remote_sites = get_transient( 'generatepress_sites' ); - $trusted_authors = get_transient( 'generatepress_sites_trusted_providers' ); - - if ( empty( $remote_sites ) ) { - $sites = array(); - - $data = wp_safe_remote_get( 'https://gpsites.co/wp-json/wp/v2/sites?per_page=100' ); - - if ( is_wp_error( $data ) ) { - set_transient( 'generatepress_sites', 'no results', 5 * MINUTE_IN_SECONDS ); - return; - } - - $data = json_decode( wp_remote_retrieve_body( $data ), true ); - - if ( ! is_array( $data ) ) { - set_transient( 'generatepress_sites', 'no results', 5 * MINUTE_IN_SECONDS ); - return; - } - - foreach ( (array) $data as $site ) { - $sites[ $site['name'] ] = array( - 'name' => $site['name'], - 'directory' => $site['directory'], - 'preview_url' => $site['preview_url'], - 'author_name' => $site['author_name'], - 'author_url' => $site['author_url'], - 'description' => $site['description'], - 'page_builder' => $site['page_builder'], - 'min_version' => $site['min_version'], - 'uploads_url' => $site['uploads_url'], - 'plugins' => $site['plugins'], - 'documentation' => $site['documentation'], - ); - } - - $sites = apply_filters( 'generate_add_sites', $sites ); - - set_transient( 'generatepress_sites', $sites, 24 * HOUR_IN_SECONDS ); - } - - if ( empty( $trusted_authors ) ) { - $trusted_authors = wp_safe_remote_get( 'https://gpsites.co/wp-json/sites/site' ); - - if ( is_wp_error( $trusted_authors ) || empty( $trusted_authors ) ) { - set_transient( 'generatepress_sites_trusted_providers', 'no results', 5 * MINUTE_IN_SECONDS ); - return; - } - - $trusted_authors = json_decode( wp_remote_retrieve_body( $trusted_authors ), true ); - - $authors = array(); - foreach ( (array) $trusted_authors['trusted_author'] as $author ) { - $authors[] = $author; - } - - set_transient( 'generatepress_sites_trusted_providers', $authors, 24 * HOUR_IN_SECONDS ); - } -} - -/** - * Fetch our sites and trusted authors. Stores them in their own transients. - * We use current_screen instead of admin_init so we can check what admin page we're on. - * - * @since 1.6 - * @deprecated 2.0.0 - */ -function generatepress_sites_init() { - $screen = get_current_screen(); - - if ( 'appearance_page_generate-options' === $screen->id || 'appearance_page_generatepress-site-library' === $screen->id ) { - generate_get_sites_from_library(); - } -} - -/** - * Initiate our Sites once everything has loaded. - * We use current_screen instead of admin_init so we can check what admin page we're on. - * - * @since 1.6 - * @deprecated 2.0.0 - */ -function generatepress_sites_output() { - if ( ! class_exists( 'GeneratePress_Site' ) ) { - return; // Bail if we don't have the needed class. - } - - $sites = get_transient( 'generatepress_sites' ); - - if ( empty( $sites ) || ! is_array( $sites ) ) { - add_action( 'generate_inside_sites_container', 'generatepress_sites_no_results_error' ); - return; - } - - if ( apply_filters( 'generate_sites_randomize', false ) ) { - shuffle( $sites ); - } - - foreach ( $sites as $site ) { - new GeneratePress_Site( $site ); - } -} - -/** - * Show an error message when no sites exist. - * - * @since 1.8.2 - * @deprecated 2.0.0 - */ -function generatepress_sites_no_results_error() { - printf( - '
- %1$s %2$s -
', - __( 'No sites found.', 'gp-premium' ), - __( 'Why?', 'gp-premium' ), - 'https://docs.generatepress.com/article/site-library-unavailable/' - ); -} - -/** - * Build each site UI. - * - * @deprecated 2.0.0 - */ -class GeneratePress_Site { - /** - * Get it rockin' - * - * @param array $config The site configuration. - */ - public function __construct( $config = array() ) { - // Do nothing. - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/deprecated.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/deprecated.php deleted file mode 100644 index 4c713be1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/deprecated.php +++ /dev/null @@ -1,718 +0,0 @@ -current_post == 0 && $paged == 1 ) ? true : false; - - // Get our Customizer options - $generate_blog_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - $masonry_post_width = $generate_blog_settings['masonry_width']; - - // Get our post meta option - $stored_meta = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate-blog-post-class', true ) : ''; - - // If our post meta option is set, use it - // Or else, use our Customizer option - if ( '' !== $stored_meta ) { - if ( 'width4' == $stored_meta && 'width4' == $generate_blog_settings['masonry_width'] ) { - $masonry_post_width = 'medium'; - } else { - $masonry_post_width = $stored_meta; - } - } - - // Return our width class - return apply_filters( 'generate_masonry_post_width', $masonry_post_width ); - } -} - -if ( ! function_exists( 'generate_blog_add_post_class_meta_box' ) ) { - /** - * Create our masonry meta box - * - * @deprecated 1.5 - */ - function generate_blog_add_post_class_meta_box() { - $generate_blog_settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( 'true' !== $generate_blog_settings['masonry'] ) { - return; - } - - $post_types = apply_filters( 'generate_blog_masonry_metabox', array( 'post' ) ); - - add_meta_box - ( - 'generate_blog_post_class_meta_box', // $id - __('Masonry Post Width','generate-blog'), // $title - 'generate_blog_show_post_class_metabox', // $callback - $post_types, // $page - 'side', // $context - 'default' // $priority - ); - } -} - -if ( ! function_exists( 'generate_blog_show_post_class_metabox' ) ) { - /** - * Outputs the content of the metabox - * @deprecated 1.5 - */ - function generate_blog_show_post_class_metabox( $post ) { - wp_nonce_field( basename( __FILE__ ), 'generate_blog_post_class_nonce' ); - $stored_meta = get_post_meta( $post->ID ); - - // Set defaults to avoid PHP notices - if ( isset($stored_meta['_generate-blog-post-class'][0]) ) { - $stored_meta['_generate-blog-post-class'][0] = $stored_meta['_generate-blog-post-class'][0]; - } else { - $stored_meta['_generate-blog-post-class'][0] = ''; - } - ?> -

-
- -

- max_num_pages; - } - - if ( ! $paged ) { - $paged = 1; - } - - $nextpage = intval( $paged ) + 1; - - if ( ! is_single() && ( $nextpage <= $max_page ) ) { - return next_posts( $max_page, false ); - } - } -} - -/** - * Fixes a bug in Safari where images with srcset won't display when using infinite scroll. - * - * @since 1.5.5 - * @deprecated 1.6 - */ -function generate_blog_disable_infinite_scroll_srcset() { - $settings = wp_parse_args( - get_option( 'generate_blog_settings', array() ), - generate_blog_get_defaults() - ); - - if ( ! is_singular() && $settings[ 'infinite_scroll' ] ) { - add_filter( 'wp_calculate_image_srcset', '__return_empty_array' ); - } -} - -if ( ! function_exists( 'generate_blog_init' ) ) { - function generate_blog_init() { - load_plugin_textdomain( 'generate-blog', false, 'gp-premium/langs/blog/' ); - } -} - -/** - * Colors module. - */ -if ( ! function_exists( 'generate_colors_init' ) ) { - function generate_colors_init() { - load_plugin_textdomain( 'generate-colors', false, 'gp-premium/langs/colors/' ); - } -} - -if ( ! function_exists( 'generate_colors_setup' ) ) { - function generate_colors_setup() { - // Here so we can check to see if Colors is activated - } -} - -/** - * Copyright module. - */ -if ( ! function_exists( 'generate_copyright_init' ) ) { - function generate_copyright_init() { - load_plugin_textdomain( 'generate-copyright', false, 'gp-premium/langs/copyright/' ); - } -} - -/** - * Disable Elements module. - */ -if ( ! function_exists('generate_disable_elements_init') ) { - function generate_disable_elements_init() { - load_plugin_textdomain( 'disable-elements', false, 'gp-premium/langs/disable-elements/' ); - } -} - -/** - * Hooks module. - */ -if ( ! function_exists( 'generate_hooks_init' ) ) { - function generate_hooks_init() { - load_plugin_textdomain( 'generate-hooks', false, 'gp-premium/langs/hooks/' ); - } -} - -/** - * Import/Export module. - */ -if ( ! function_exists( 'generate_ie_init' ) ) { - function generate_ie_init() { - load_plugin_textdomain( 'generate-ie', false, 'gp-premium/langs/import-export/' ); - } -} - -/** - * Menu Plus module. - */ -if ( ! function_exists( 'generate_slideout_navigation_class' ) ) { - /** - * Display the classes for the slideout navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - */ - function generate_slideout_navigation_class( $class = '' ) { - // Separates classes with a single space, collates classes for post DIV - echo 'class="' . join( ' ', generate_get_slideout_navigation_class( $class ) ) . '"'; - } -} - -if ( ! function_exists( 'generate_get_slideout_navigation_class' ) ) { - /** - * Retrieve the classes for the slideout navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - * @return array Array of classes. - */ - function generate_get_slideout_navigation_class( $class = '' ) { - $classes = array(); - - if ( !empty($class) ) { - if ( !is_array( $class ) ) - $class = preg_split('#\s+#', $class); - $classes = array_merge($classes, $class); - } - - $classes = array_map('esc_attr', $classes); - - return apply_filters('generate_slideout_navigation_class', $classes, $class); - } -} - -if ( ! function_exists( 'generate_slideout_menu_class' ) ) { - /** - * Display the classes for the slideout navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - */ - function generate_slideout_menu_class( $class = '' ) { - // Separates classes with a single space, collates classes for post DIV - echo 'class="' . join( ' ', generate_get_slideout_menu_class( $class ) ) . '"'; - } -} - -if ( ! function_exists( 'generate_get_slideout_menu_class' ) ) { - /** - * Retrieve the classes for the slideout navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - * @return array Array of classes. - */ - function generate_get_slideout_menu_class( $class = '' ) { - $classes = array(); - - if ( !empty($class) ) { - if ( !is_array( $class ) ) - $class = preg_split('#\s+#', $class); - $classes = array_merge($classes, $class); - } - - $classes = array_map('esc_attr', $classes); - - return apply_filters('generate_slideout_menu_class', $classes, $class); - } -} - -if ( ! function_exists( 'generate_slideout_menu_classes' ) ) { - /** - * Adds custom classes to the menu - * @since 0.1 - */ - function generate_slideout_menu_classes( $classes ) { - $classes[] = 'slideout-menu'; - return $classes; - } -} - -if ( ! function_exists( 'generate_slideout_navigation_classes' ) ) { - /** - * Adds custom classes to the navigation - * @since 0.1 - */ - function generate_slideout_navigation_classes( $classes ){ - $slideout_effect = apply_filters( 'generate_menu_slideout_effect','overlay' ); - $slideout_position = apply_filters( 'generate_menu_slideout_position','left' ); - - $classes[] = 'main-navigation'; - $classes[] = 'slideout-navigation'; - - return $classes; - } -} - -if ( ! function_exists( 'generate_menu_plus_init' ) ) { - function generate_menu_plus_init() { - load_plugin_textdomain( 'menu-plus', false, 'gp-premium/langs/menu-plus/' ); - } -} - -if ( ! function_exists( 'generate_slideout_menu_fallback' ) ) { - /** - * Menu fallback. - * - * @param array $args - * @return string - * @since 1.1.4 - */ - function generate_slideout_menu_fallback( $args ) { - - } -} - -/** - * Page header module. - */ -if ( ! function_exists( 'generate_page_header_inside' ) ) { - /** - * Add page header inside content - * @since 0.3 - */ - function generate_page_header_inside() { - if ( ! is_page() ) { - return; - } - - if ( 'inside-content' == generate_get_page_header_location() ) { - generate_page_header_area( 'page-header-image', 'page-header-content' ); - } - } -} - -if ( ! function_exists( 'generate_page_header_single_below_title' ) ) { - /** - * Add post header below title - * @since 0.3 - */ - function generate_page_header_single_below_title() { - if ( ! is_single() ) { - return; - } - - if ( 'below-title' == generate_get_page_header_location() ) { - generate_page_header_area( 'page-header-image-single page-header-below-title', 'page-header-content-single page-header-below-title' ); - } - } -} - -if ( ! function_exists( 'generate_page_header_single_above' ) ) { - /** - * Add post header above content - * @since 0.3 - */ - function generate_page_header_single_above() { - if ( ! is_single() ) { - return; - } - - if ( 'above-content' == generate_get_page_header_location() ) { - generate_page_header_area( 'page-header-image-single', 'page-header-content-single' ); - } - } -} - -if ( ! function_exists( 'generate_page_header_single' ) ) { - /** - * Add post header inside content - * @since 0.3 - */ - function generate_page_header_single() { - $image_class = 'page-header-image-single'; - $content_class = 'page-header-content-single'; - - if ( 'below-title' == generate_get_page_header_location() ) { - $image_class = 'page-header-image-single page-header-below-title'; - $content_class = 'page-header-content-single page-header-below-title'; - } - - if ( 'inside-content' == generate_get_page_header_location() ) { - generate_page_header_area( $image_class, $content_class ); - } - } -} - -if ( ! function_exists( 'generate_page_header_init' ) ) { - function generate_page_header_init() { - load_plugin_textdomain( 'page-header', false, 'gp-premium/langs/page-header/' ); - } -} - -/** - * Secondary Navigation module. - */ -if ( ! function_exists( 'generate_secondary_nav_init' ) ) { - function generate_secondary_nav_init() { - load_plugin_textdomain( 'secondary-nav', false, 'gp-premium/langs/secondary-nav/' ); - } -} - -/** - * Sections module. - */ -if ( ! function_exists( 'generate_sections_init' ) ) { - function generate_sections_init() { - load_plugin_textdomain( 'generate-sections', false, 'gp-premium/langs/sections/' ); - } -} - -if ( ! function_exists( 'generate_sections_metabox_init' ) ) { - /* - * Enqueue styles and scripts specific to metaboxs - */ - function generate_sections_metabox_init(){ - - // I prefer to enqueue the styles only on pages that are using the metaboxes - wp_enqueue_style( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'wpalchemy/css/meta.css'); - wp_enqueue_style( 'generate-style-grid', get_template_directory_uri() . '/css/unsemantic-grid.css', false, GENERATE_VERSION, 'all' ); - - //make sure we enqueue some scripts just in case ( only needed for repeating metaboxes ) - wp_enqueue_script( 'jquery' ); - wp_enqueue_script( 'jquery-ui-core' ); - wp_enqueue_script( 'jquery-ui-widget' ); - wp_enqueue_script( 'jquery-ui-mouse' ); - wp_enqueue_script( 'jquery-ui-sortable' ); - wp_enqueue_style( 'wp-color-picker' ); - - // special script for dealing with repeating textareas- needs to run AFTER all the tinyMCE init scripts, so make 'editor' a requirement - wp_enqueue_script( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'wpalchemy/js/sections-metabox.js', array( 'jquery', 'editor', 'media-upload', 'wp-color-picker' ), GENERATE_SECTIONS_VERSION, true ); - $translation_array = array( - 'no_content_error' => __( 'Error: Content already detected in default editor.', 'gp-premium' ), - 'use_visual_editor' => __( 'Please activate the "Visual" tab in your main editor before transferring content.', 'gp-premium' ) - ); - wp_localize_script( 'generate-sections-metabox', 'generate_sections', $translation_array ); - } -} - -/** - * Spacing module. - */ -if ( ! function_exists( 'generate_spacing_init' ) ) { - function generate_spacing_init() { - load_plugin_textdomain( 'generate-spacing', false, 'gp-premium/langs/spacing/' ); - } -} - -if ( ! function_exists( 'generate_spacing_setup' ) ) { - function generate_spacing_setup() { - // Here so we can check to see if Spacing is active - } -} - -/** - * Typography module. - */ -if ( ! function_exists( 'generate_typography_init' ) ) { - function generate_typography_init() { - load_plugin_textdomain( 'generate-typography', false, 'gp-premium/langs/typography/' ); - } -} - -if ( ! function_exists( 'generate_fonts_setup' ) ) { - function generate_fonts_setup() { - // Here to check if Typography is active - } -} - -/** - * WooCommerce module. - */ -if ( ! function_exists( 'generate_woocommerce_init' ) ) { - function generate_woocommerce_init() { - load_plugin_textdomain( 'generate-woocommerce', false, 'gp-premium/langs/woocommerce/' ); - } -} - -/** - * Use text instead of an icon if essentials are in use. - * - * @since 1.3 - * @deprecated 1.6 - * - * @param string $icon Existing icon HTML. - * @return string New icon HTML. - */ -function generatepress_wc_essentials_menu_icon( $icon ) { - if ( apply_filters( 'generate_fontawesome_essentials', false ) ) { - return __( 'Cart', 'gp-premium' ); - } - - return $icon; -} - -if ( ! function_exists( 'generate_activation_styles' ) ) { - function generate_activation_styles() { - // Added to dashboard.css - } -} - -if ( ! function_exists( 'generate_verify_styles' ) ) { - function generate_verify_styles() { - // Added to dashboard.css - } -} - -if ( ! function_exists( 'generate_add_license_key_field' ) ) { - function generate_add_license_key_field() { - // Replaced by generatepress_premium_license_key_field() - } -} - -if ( ! function_exists( 'generate_premium_license_key' ) ) { - function generate_premium_license_key() { - // Replaced by generatepress_premium_license_key_field() - } -} - -if ( ! function_exists( 'generate_save_premium_license_key' ) ) { - function generate_save_premium_license_key() { - // Replaced by generatepress_premium_process_license_key() - } -} - - -if ( ! function_exists( 'generate_process_license_key' ) ) { - function generate_process_license_key() { - // Replaced by generatepress_premium_process_license_key() - } -} - -/** - * Add the Refresh sites link after the list of sites. - * - * @since 1.6 - * @deprecated 1.7 - */ -function generate_sites_refresh_link() { - if ( ! generate_is_sites_dashboard() ) { - return; - } - - printf( - '
- %2$s -
', - wp_nonce_url( admin_url( 'themes.php?page=generate-options&area=generate-sites' ), 'refresh_sites', 'refresh_sites_nonce' ), - __( 'Refresh Sites', 'gp-premium' ) - ); -} - -/** - * Delete our sites transient if the Refresh sites link is clicked. - * - * @since 1.6 - * @deprecated 1.12.0 - */ -function generate_sites_refresh_list() { - if ( ! isset( $_GET['refresh_sites_nonce'] ) || ! wp_verify_nonce( $_GET['refresh_sites_nonce'], 'refresh_sites' ) ) { - return; - } - - delete_transient( 'generatepress_sites' ); -} - -if ( ! function_exists( 'generate_insert_import_export' ) ) { - /** - * @deprecated 1.7 - */ - function generate_insert_import_export() { - // Replaced by GeneratePress_Import_Export::build_html() - } -} - -if ( ! function_exists( 'generate_ie_import_form' ) ) { - /** - * @deprecated 1.7 - */ - function generate_ie_import_form() { - // Replaced by GeneratePress_Import_Export::build_html() - } -} - -if ( ! function_exists( 'generate_process_settings_export' ) ) { - /** - * Process a settings export that generates a .json file of the shop settings - * - * @deprecated 1.7 - */ - function generate_process_settings_export() { - // Replaced by GeneratePress_Import_Export::export() - } -} - -if ( ! function_exists( 'generate_process_settings_import' ) ) { - /** - * Process a settings import from a json file - * - * @deprecated 1.7 - */ - function generate_process_settings_import() { - // Replaced by GeneratePress_Import_Export::import() - } -} - -if ( ! function_exists( 'generate_ie_exportable' ) ) { - /** - * @deprecated 1.7 - */ - function generate_ie_exportable() { - // A check to see if other addons can add their export button - } -} - -/** - * Build our dynamic CSS. - * - * @since 1.6 - */ -function generate_menu_plus_make_css() { - // Replaced by generate_do_off_canvas_css() -} - -/** - * Enqueue our dynamic CSS. - * - * @since 1.6 - */ -function generate_menu_plus_enqueue_dynamic_css() { - // No longer needed. -} - -if ( ! function_exists( 'generate_hidden_secondary_navigation' ) && function_exists( 'is_customize_preview' ) ) { - /** - * Adds a hidden navigation if no navigation is set - * This allows us to use postMessage to position the navigation when it doesn't exist - */ - function generate_hidden_secondary_navigation() { - if ( is_customize_preview() && function_exists( 'generate_secondary_navigation_position' ) ) { - ?> -
- -
- $desktop, - 'tablet' => $tablet, - 'mobile' => $mobile, - 'mobile-menu' => $mobile_menu, - ) - ); - - return $queries[ $name ]; -} - -/** - * Get our CSS print method. - * - * @since 1.11.0 - */ -function generate_get_css_print_method() { - $mode = apply_filters( 'generatepress_dynamic_css_print_method', 'inline' ); - - if ( - ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) - || - is_preview() - || - // AMP inlines all CSS, so inlining from the start improves CSS processing performance. - ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) - ) { - return 'inline'; - } - - if ( ! defined( 'GENERATE_VERSION' ) ) { - return 'inline'; - } - - return $mode; -} - -/** - * Check to see if we have a Block Element. - * - * @since 2.0.0 - * @param string $element The type of element to check. - * @param boolean $block_element Whether it's a block element or not. - */ -function generate_has_active_element( $element, $block_element ) { - global $generate_elements; - - if ( ! empty( $generate_elements ) ) { - foreach ( (array) $generate_elements as $key => $data ) { - if ( $element === $data['type'] && $block_element === $data['is_block_element'] ) { - return true; - } - } - } - - return false; -} - -/** - * Check our GeneratePress version. - * - * @since 2.1.0 - */ -function generate_premium_get_theme_version() { - return defined( 'GENERATE_VERSION' ) ? GENERATE_VERSION : false; -} - -/** - * Remove the featured-image-active class if needed. - * - * @since 2.1.0 - */ -function generate_premium_remove_featured_image_class( $classes, $remove_class ) { - if ( $remove_class && in_array( 'featured-image-active', $classes ) ) { - $classes = array_diff( $classes, array( 'featured-image-active' ) ); - } - - return $classes; -} - -/** - * Returns the global $wp_filesystem with credentials set. - * Returns null in case of any errors. - * - * @return WP_Filesystem_Base|null - */ -function generate_premium_get_wp_filesystem() { - global $wp_filesystem; - - $success = true; - - // Initialize the file system if it has not been done yet. - if ( ! $wp_filesystem ) { - require_once ABSPATH . '/wp-admin/includes/file.php'; - - $constants = array( - 'hostname' => 'FTP_HOST', - 'username' => 'FTP_USER', - 'password' => 'FTP_PASS', - 'public_key' => 'FTP_PUBKEY', - 'private_key' => 'FTP_PRIKEY', - ); - - $credentials = array(); - - // We provide credentials based on wp-config.php constants. - // Reference https://developer.wordpress.org/apis/wp-config-php/#wordpress-upgrade-constants. - foreach ( $constants as $key => $constant ) { - if ( defined( $constant ) ) { - $credentials[ $key ] = constant( $constant ); - } - } - - $success = WP_Filesystem( $credentials ); - } - - if ( ! $success || $wp_filesystem->errors->has_errors() ) { - return null; - } - - return $wp_filesystem; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/activation.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/activation.php deleted file mode 100644 index bce1852b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/activation.php +++ /dev/null @@ -1,623 +0,0 @@ -base ) { - return; - } - - wp_enqueue_style( 'generate-premium-dashboard', plugin_dir_url( __FILE__ ) . 'assets/dashboard.css', array(), GP_PREMIUM_VERSION ); - wp_enqueue_script( 'generate-premium-dashboard', plugin_dir_url( __FILE__ ) . 'assets/dashboard.js', array( 'jquery' ), GP_PREMIUM_VERSION, true ); - - wp_localize_script( - 'generate-premium-dashboard', - 'dashboard', - array( - 'deprecated_module' => esc_attr__( 'This module has been deprecated. Deactivating it will remove it from this list.', 'gp-premium' ), - ) - ); -} - -if ( ! function_exists( 'generate_premium_notices' ) ) { - add_action( 'admin_notices', 'generate_premium_notices' ); - /* - * Set up errors and messages - */ - function generate_premium_notices() { - if ( isset( $_GET['generate-message'] ) && 'addon_deactivated' == $_GET['generate-message'] ) { - add_settings_error( 'generate-premium-notices', 'addon_deactivated', __( 'Module deactivated.', 'gp-premium' ), 'updated' ); - } - - if ( isset( $_GET['generate-message'] ) && 'addon_activated' == $_GET['generate-message'] ) { - add_settings_error( 'generate-premium-notices', 'addon_activated', __( 'Module activated.', 'gp-premium' ), 'updated' ); - } - - settings_errors( 'generate-premium-notices' ); - } -} - -if ( ! function_exists( 'generate_license_errors' ) ) { - add_action( 'admin_notices', 'generate_license_errors' ); - /* - * Set up errors and messages - */ - function generate_license_errors() { - if ( isset( $_GET['generate-message'] ) && 'deactivation_passed' == $_GET['generate-message'] ) { - add_settings_error( 'generate-license-notices', 'deactivation_passed', __( 'License deactivated.', 'gp-premium' ), 'updated' ); - } - - if ( isset( $_GET['generate-message'] ) && 'license_activated' == $_GET['generate-message'] ) { - add_settings_error( 'generate-license-notices', 'license_activated', __( 'License activated.', 'gp-premium' ), 'updated' ); - } - - if ( isset( $_GET['sl_activation'] ) && ! empty( $_GET['message'] ) ) { - - switch ( $_GET['sl_activation'] ) { - - case 'false': - $message = urldecode( $_GET['message'] ); - add_settings_error( 'generate-license-notices', 'license_failed', esc_html( $message ), 'error' ); - break; - - case 'true': - default: - break; - - } - } - - settings_errors( 'generate-license-notices' ); - } -} - -if ( ! function_exists( 'generate_super_package_addons' ) ) { - add_action( 'generate_options_items', 'generate_super_package_addons', 5 ); - /** - * Build the area that allows us to activate and deactivate modules. - * - * @since 0.1 - */ - function generate_super_package_addons() { - $addons = array( - 'Backgrounds' => 'generate_package_backgrounds', - 'Blog' => 'generate_package_blog', - 'Colors' => 'generate_package_colors', - 'Copyright' => 'generate_package_copyright', - 'Disable Elements' => 'generate_package_disable_elements', - 'Elements' => 'generate_package_elements', - 'Hooks' => 'generate_package_hooks', - 'Menu Plus' => 'generate_package_menu_plus', - 'Page Header' => 'generate_package_page_header', - 'Secondary Nav' => 'generate_package_secondary_nav', - 'Sections' => 'generate_package_sections', - 'Spacing' => 'generate_package_spacing', - 'Typography' => 'generate_package_typography', - 'WooCommerce' => 'generate_package_woocommerce', - ); - - if ( version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) { - $addons['Site Library'] = 'generate_package_site_library'; - } - - if ( function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography() ) { - unset( $addons['Typography'] ); - } - - if ( version_compare( generate_premium_get_theme_version(), '3.1.0-alpha.1', '>=' ) ) { - unset( $addons['Colors'] ); - } - - ksort( $addons ); - - $addon_count = 0; - foreach ( $addons as $k => $v ) { - if ( 'activated' == get_option( $v ) ) - $addon_count++; - } - - $key = get_option( 'gen_premium_license_key_status', 'deactivated' ); - $version = ( defined( 'GP_PREMIUM_VERSION' ) ) ? GP_PREMIUM_VERSION : ''; - - ?> -
-

-
-
-
-
-
- - - - -
-
- $v ) : - - $key = get_option( $v ); - - if( $key == 'activated' ) { ?> -
-
- - -
-
- - -
-
- -
- -
- type="checkbox" class="addon-checkbox" name="generate_addon_checkbox[]" value="" /> - -
- -
- - - - - - -
- -
-
'; - endforeach; - ?> - -
-
- - 'generate_package_typography', - 'Colors' => 'generate_package_colors', - 'Backgrounds' => 'generate_package_backgrounds', - 'Page Header' => 'generate_package_page_header', - 'Sections' => 'generate_package_sections', - 'Copyright' => 'generate_package_copyright', - 'Disable Elements' => 'generate_package_disable_elements', - 'Elements' => 'generate_package_elements', - 'Blog' => 'generate_package_blog', - 'Hooks' => 'generate_package_hooks', - 'Spacing' => 'generate_package_spacing', - 'Secondary Nav' => 'generate_package_secondary_nav', - 'Menu Plus' => 'generate_package_menu_plus', - 'WooCommerce' => 'generate_package_woocommerce', - ); - - if ( version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) { - $addons['Site Library'] = 'generate_package_site_library'; - } - - foreach( $addons as $k => $v ) : - - if ( isset( $_POST[$v . '_activate_package'] ) ) { - - // If we didn't click the button, bail. - if ( ! check_admin_referer( $v . '_activate_nonce', $v . '_activate_nonce' ) ) { - return; - } - - // If we're not an administrator, bail. - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $autoload = null; - - if ( 'generate_package_site_library' === $v ) { - $autoload = false; - } - - update_option( $v, 'activated', $autoload ); - wp_safe_redirect( admin_url( 'themes.php?page=generate-options&generate-message=addon_activated' ) ); - exit; - } - - endforeach; - } -} - -/*********************************************** -* Deactivate the plugin -***********************************************/ -if ( ! function_exists( 'generate_deactivate_super_package_addons' ) ) { - add_action( 'admin_init', 'generate_deactivate_super_package_addons' ); - - function generate_deactivate_super_package_addons() { - $addons = array( - 'Typography' => 'generate_package_typography', - 'Colors' => 'generate_package_colors', - 'Backgrounds' => 'generate_package_backgrounds', - 'Page Header' => 'generate_package_page_header', - 'Sections' => 'generate_package_sections', - 'Copyright' => 'generate_package_copyright', - 'Disable Elements' => 'generate_package_disable_elements', - 'Elements' => 'generate_package_elements', - 'Blog' => 'generate_package_blog', - 'Hooks' => 'generate_package_hooks', - 'Spacing' => 'generate_package_spacing', - 'Secondary Nav' => 'generate_package_secondary_nav', - 'Menu Plus' => 'generate_package_menu_plus', - 'WooCommerce' => 'generate_package_woocommerce', - ); - - if ( version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) { - $addons['Site Library'] = 'generate_package_site_library'; - } - - foreach( $addons as $k => $v ) : - - if ( isset( $_POST[$v . '_deactivate_package'] ) ) { - - // If we didn't click the button, bail. - if ( ! check_admin_referer( $v . '_deactivate_nonce', $v . '_deactivate_nonce' ) ) { - return; - } - - // If we're not an administrator, bail. - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $autoload = null; - - if ( 'generate_package_site_library' === $v ) { - $autoload = false; - } - - update_option( $v, 'deactivated', $autoload ); - wp_safe_redirect( admin_url('themes.php?page=generate-options&generate-message=addon_deactivated' ) ); - exit; - } - - endforeach; - } -} - -if ( ! function_exists( 'generate_premium_body_class' ) ) { - add_filter( 'admin_body_class', 'generate_premium_body_class' ); - /** - * Add a class or many to the body in the dashboard - */ - function generate_premium_body_class( $classes ) { - return "$classes gp_premium"; - } -} - -if ( ! function_exists( 'generate_activation_area' ) ) { - add_action( 'generate_admin_right_panel', 'generate_activation_area' ); - - function generate_activation_area() { - $license = get_option( 'gen_premium_license_key', '' ); - $key = get_option( 'gen_premium_license_key_status', 'deactivated' ); - - if ( 'valid' == $key ) { - $message = sprintf( '%s', __( 'Receiving updates', 'gp-premium' ) ); - } else { - $message = sprintf( '%s', __( 'Not receiving updates', 'gp-premium' ) ); - } - ?> -
-
-

- - - - [?] - -

- -
-
-

- -

- -

> - /> - -

- - - -
-
-
-
- 'activate_license', - 'license' => $new, - 'item_name' => urlencode( 'GP Premium' ), - 'url' => home_url() - ); - } - - // If we don't have a value (it's been cleared), run deactivation. - if ( '' == $new && 'valid' == get_option( 'gen_premium_license_key_status' ) ) { - $api_params = array( - 'edd_action' => 'deactivate_license', - 'license' => $old, - 'item_name' => urlencode( 'GP Premium' ), - 'url' => home_url() - ); - } - - // Nothing? Get out of here. - if ( ! isset( $api_params ) ) { - wp_safe_redirect( admin_url( 'themes.php?page=generate-options' ) ); - exit; - } - - // Phone home. - $license_response = wp_remote_post( 'https://generatepress.com', array( - 'timeout' => 60, - 'sslverify' => false, - 'body' => $api_params - ) ); - - // Make sure the response came back okay. - if ( is_wp_error( $license_response ) || 200 !== wp_remote_retrieve_response_code( $license_response ) ) { - if ( is_object( $license_response ) ) { - $message = $license_response->get_error_message(); - } elseif ( is_array( $license_response ) && isset( $license_response['response']['message'] ) ) { - if ( 'Forbidden' === $license_response['response']['message'] ) { - $message = __( '403 Forbidden. Your server is not able to communicate with generatepress.com in order to activate your license key.', 'gp-premium' ); - } else { - $message = $license_response['response']['message']; - } - } - } else { - - // Still here? Decode our response. - $license_data = json_decode( wp_remote_retrieve_body( $license_response ) ); - - if ( false === $license_data->success ) { - - switch ( $license_data->error ) { - - case 'expired' : - - $message = sprintf( - __( 'Your license key expired on %s.', 'gp-premium' ), - date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) ) - ); - break; - - case 'revoked' : - - $message = __( 'Your license key has been disabled.', 'gp-premium' ); - break; - - case 'missing' : - - $message = __( 'Invalid license.', 'gp-premium' ); - break; - - case 'invalid' : - case 'site_inactive' : - - $message = __( 'Your license is not active for this URL.', 'gp-premium' ); - break; - - case 'item_name_mismatch' : - - $message = __( 'This appears to be an invalid license key for GP Premium.', 'gp-premium' ); - break; - - case 'no_activations_left': - - $message = __( 'Your license key has reached its activation limit.', 'gp-premium' ); - break; - - default : - - $message = __( 'An error occurred, please try again.', 'gp-premium' ); - break; - } - - } - - } - - // Check if anything passed on a message constituting a failure - if ( ! empty( $message ) ) { - delete_option( 'gen_premium_license_key_status' ); - $base_url = admin_url( 'themes.php?page=generate-options' ); - $redirect = add_query_arg( array( 'sl_activation' => 'false', 'message' => urlencode( $message ) ), esc_url( $base_url ) ); - wp_redirect( $redirect ); - exit(); - } - - // Update our license key status - update_option( 'gen_premium_license_key_status', $license_data->license ); - - if ( 'valid' == $license_data->license ) { - // Validated, go tell them - wp_safe_redirect( admin_url( 'themes.php?page=generate-options&generate-message=license_activated' ) ); - exit; - } elseif ( 'deactivated' == $license_data->license ) { - // Deactivated, go tell them - wp_safe_redirect( admin_url( 'themes.php?page=generate-options&generate-message=deactivation_passed' ) ); - exit; - } else { - // Failed, go tell them - wp_safe_redirect( admin_url( 'themes.php?page=generate-options&generate-message=license_failed' ) ); - exit; - } - } -} - -if ( ! function_exists( 'generate_license_missing' ) ) { - add_action( 'in_plugin_update_message-gp-premium/gp-premium.php', 'generate_license_missing', 10, 2 ); - /** - * Add a message to the plugin update area if no license key is set - */ - function generate_license_missing() { - $license = get_option( 'gen_premium_license_key_status' ); - - if ( 'valid' !== $license ) { - echo ' ' . __( 'Enter valid license key for automatic updates.', 'gp-premium' ) . ''; - } - } -} - -add_filter( 'generate_premium_beta_tester', 'generatepress_premium_beta_tester' ); -/** - * Enable beta testing if our option is set. - * - * @since 1.6 - */ -function generatepress_premium_beta_tester( $value ) { - if ( get_option( 'gp_premium_beta_testing', false ) ) { - return true; - } - - return $value; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/assets/dashboard.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/assets/dashboard.css deleted file mode 100644 index 700993cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/assets/dashboard.css +++ /dev/null @@ -1,199 +0,0 @@ -.generatepress-dashboard-tabs { - margin-bottom: 40px; -} - -.generatepress-dashboard-tabs a { - background-color: rgba(255,255,255,0.5); - border: 1px solid #ddd; - padding: 10px 15px; - cursor: pointer; - color: #222; - display: inline-block; - text-decoration: none; -} - -.generatepress-dashboard-tabs a:not(:last-child) { - border-right: 0; -} - -.generatepress-dashboard-tabs a.active { - background-color: #ffffff; - border-color: #ccc; - font-weight: 500; -} - -input#generate-select-all, -.addon-checkbox { - margin-right: 15px !important; -} -.gp-premium-version, -.gp-addon-count { - display: block; - color:#ccc; -} - -.addon-container:before, -.addon-container:after { - content: "."; - display: block; - overflow: hidden; - visibility: hidden; - font-size: 0; - line-height: 0; - width: 0; - height: 0; -} - -.addon-container:after { - clear: both; -} - -.premium-addons .gp-clear { - margin: 0 !important; - border: 0; - padding: 0 !important; -} - -.premium-addons .add-on.gp-clear { - padding: 15px !important; - margin: 0 !important; - box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset; -} - -.premium-addons .add-on:last-child { - border: 0 !important; -} - -.addon-action { - float: right; - clear: right; -} - -.addon-name { - float: left; -} - -.premium-addons .add-on.gp-clear.activated { - background-color:#F7FCFE !important; - border-left: 5px solid #2EA2CC !important; - font-weight: bold; - padding-left: 10px !important; -} - -.premium-addons .addon-action input[type="submit"], -.premium-addons .addon-action input[type="submit"]:visited { - background: none; - border: 0; - color: #0d72b2; - padding: 0; - font-size: inherit; - cursor: pointer; - box-shadow: 0 0 0 transparent; -} - -.premium-addons .addon-action input[type="submit"]:hover, -.premium-addons .addon-action input[type="submit"]:focus { - background: none; - border: 0; - color: #0f92e5; - padding: 0; - font-size: inherit; - box-shadow: 0 0 0 transparent; -} - -.premium-addons input[type="submit"].hide-customizer-button, -.premium-addons input[type="submit"]:visited.hide-customizer-button { - color: #a00; - font-weight: normal; -} - -.premium-addons input[type="submit"]:hover.hide-customizer-button, -.premium-addons input[type="submit"]:focus.hide-customizer-button { - color: red; - font-weight: normal; -} - -.premium-addons input[type="submit"].hide-customizer-button { - display: none; -} - -.premium-addons .add-on.activated:hover input[type="submit"].hide-customizer-button { - display: inline; -} - -.gp_premium input[name="generate_activate_all"] { - display: none; -} - -.email-container .addon-name { - width: 75%; - min-width: 150px; -} - -.license-key-container { - margin-bottom:15px; -} - -.license-key-container:last-child { - margin:0; -} - -.license-key-info { - float: right; - text-decoration: none; -} - -.license-key-container label { - font-size: 11px; - font-weight: normal; - color: #777; - display: inline-block; - margin-bottom: 0; -} - -.status { - position: absolute; - right:10px; - top:-1px; - background:rgba(255,255,255,0.9); -} - -.license-key-input { - width:100%; - box-sizing:border-box; - padding:10px; -} - -.license-key-input::-webkit-credentials-auto-fill-button { - visibility: hidden; - pointer-events: none; - position: absolute; - right: 0; -} - -.license-key-button { - position:relative; - top:1px; - width:100%; - box-sizing:border-box; - padding: 10px !important; - height:auto !important; - line-height:normal !important; -} - -.license-key-message { - font-size: 80%; - font-weight: normal; -} - -.license-key-message.receiving-updates { - color: green; -} - -.license-key-message.not-receiving-updates { - color: red; -} - -.mass-activate-select { - margin-top: 0; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/assets/dashboard.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/assets/dashboard.js deleted file mode 100644 index e789014f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/assets/dashboard.js +++ /dev/null @@ -1,48 +0,0 @@ -jQuery( function( $ ) { - $( '#generate-select-all' ).on( 'click', function() { - if ( this.checked ) { - $( '.addon-checkbox:not(:disabled)' ).each( function() { - this.checked = true; - } ); - } else { - $( '.addon-checkbox' ).each( function() { - this.checked = false; - } ); - } - } ); - - $( '#generate_license_key_gp_premium' ).on( 'input', function() { - if ( '' !== $.trim( this.value ) ) { - $( '.beta-testing-container' ).show(); - } else { - $( '.beta-testing-container' ).hide(); - } - } ); - - $( 'input[name="generate_package_hooks_deactivate_package"]' ).on( 'click', function() { - // eslint-disable-next-line no-alert - var check = confirm( dashboard.deprecated_module ); - - if ( ! check ) { - return false; - } - } ); - - $( 'input[name="generate_package_page_header_deactivate_package"]' ).on( 'click', function() { - // eslint-disable-next-line no-alert - var check = confirm( dashboard.deprecated_module ); - - if ( ! check ) { - return false; - } - } ); - - $( 'input[name="generate_package_sections_deactivate_package"]' ).on( 'click', function() { - // eslint-disable-next-line no-alert - var check = confirm( dashboard.deprecated_module ); - - if ( ! check ) { - return false; - } - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/dashboard.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/dashboard.php deleted file mode 100644 index 2ea4d584..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/dashboard.php +++ /dev/null @@ -1,47 +0,0 @@ - array( - 'name' => __( 'Modules', 'gp-premium' ), - 'url' => admin_url( 'themes.php?page=generate-options' ), - 'class' => 'appearance_page_generate-options' === $screen->id ? 'active' : '', - ), - ) ); - - // Don't print any markup if we only have one tab. - if ( count( $tabs ) === 1 ) { - return; - } - ?> -
- %3$s', - esc_url( $tab['url'] ), - esc_attr( $tab['class'] ), - esc_html( $tab['name'] ) - ); - } - ?> -
- -
-

-
-
-

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

-

- - '' ) ); ?> -

-
- -

-
-

- -

-

- - - '' ) ); ?> -

-
-
-
- array(), - 'mods' => array(), - 'options' => array(), - ); - - foreach ( $modules as $name => $value ) { - if ( 'activated' === get_option( $value ) ) { - $data['modules'][ $name ] = $value; - } - } - - foreach ( $theme_mods as $theme_mod ) { - if ( 'generate_copyright' === $theme_mod ) { - if ( in_array( 'copyright', $_POST['module_group'] ) ) { - $data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); - } - } else { - if ( in_array( 'generate_settings', $_POST['module_group'] ) ) { - $data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); - } - } - } - - foreach ( $settings as $setting ) { - if ( in_array( $setting, $_POST['module_group'] ) ) { - $data['options'][ $setting ] = get_option( $setting ); - } - } - - $data = apply_filters( 'generate_export_data', $data ); - - nocache_headers(); - header( 'Content-Type: application/json; charset=utf-8' ); - header( 'Content-Disposition: attachment; filename=generate-settings-export-' . date( 'Ymd' ) . '.json' ); // phpcs:ignore -- Prefer date(). - header( 'Expires: 0' ); - - echo wp_json_encode( $data ); - exit; - } - - /** - * Import our exported file. - * - * @since 1.7 - */ - public static function import() { - if ( empty( $_POST['generate_action'] ) || 'import_settings' !== $_POST['generate_action'] ) { - return; - } - - if ( ! wp_verify_nonce( $_POST['generate_import_nonce'], 'generate_import_nonce' ) ) { - return; - } - - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $filename = $_FILES['import_file']['name']; - $extension = end( explode( '.', $_FILES['import_file']['name'] ) ); - - if ( 'json' !== $extension ) { - wp_die( __( 'Please upload a valid .json file', 'gp-premium' ) ); - } - - $import_file = $_FILES['import_file']['tmp_name']; - - if ( empty( $import_file ) ) { - wp_die( __( 'Please upload a file to import', 'gp-premium' ) ); - } - - // Retrieve the settings from the file and convert the json object to an array. - $settings = json_decode( file_get_contents( $import_file ), true ); // phpcs:ignore -- file_get_contents() is fine here. - - foreach ( (array) $settings['modules'] as $key => $val ) { - if ( in_array( $val, self::get_modules() ) ) { - update_option( $val, 'activated' ); - } - } - - foreach ( (array) $settings['mods'] as $key => $val ) { - if ( in_array( $key, self::get_theme_mods() ) ) { - set_theme_mod( $key, $val ); - } - } - - foreach ( (array) $settings['options'] as $key => $val ) { - if ( in_array( $key, self::get_settings() ) ) { - update_option( $key, $val ); - } - } - - // Delete existing dynamic CSS cache. - delete_option( 'generate_dynamic_css_output' ); - delete_option( 'generate_dynamic_css_cached_version' ); - - $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( isset( $dynamic_css_data['updated_time'] ) ) { - unset( $dynamic_css_data['updated_time'] ); - } - - update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); - - wp_safe_redirect( admin_url( 'admin.php?page=generate-options&status=imported' ) ); - exit; - } - - /** - * List out our available modules. - * - * @since 1.7 - */ - public static function get_modules() { - return array( - 'Backgrounds' => 'generate_package_backgrounds', - 'Blog' => 'generate_package_blog', - 'Colors' => 'generate_package_colors', - 'Copyright' => 'generate_package_copyright', - 'Elements' => 'generate_package_elements', - 'Disable Elements' => 'generate_package_disable_elements', - 'Hooks' => 'generate_package_hooks', - 'Menu Plus' => 'generate_package_menu_plus', - 'Page Header' => 'generate_package_page_header', - 'Secondary Nav' => 'generate_package_secondary_nav', - 'Sections' => 'generate_package_sections', - 'Spacing' => 'generate_package_spacing', - 'Typography' => 'generate_package_typography', - 'WooCommerce' => 'generate_package_woocommerce', - ); - } - - /** - * List our our set theme mods. - * - * @since 1.7 - */ - public static function get_theme_mods() { - return array( - 'font_body_variants', - 'font_body_category', - 'font_site_title_variants', - 'font_site_title_category', - 'font_site_tagline_variants', - 'font_site_tagline_category', - 'font_navigation_variants', - 'font_navigation_category', - 'font_secondary_navigation_variants', - 'font_secondary_navigation_category', - 'font_buttons_variants', - 'font_buttons_category', - 'font_heading_1_variants', - 'font_heading_1_category', - 'font_heading_2_variants', - 'font_heading_2_category', - 'font_heading_3_variants', - 'font_heading_3_category', - 'font_heading_4_variants', - 'font_heading_4_category', - 'font_heading_5_variants', - 'font_heading_5_category', - 'font_heading_6_variants', - 'font_heading_6_category', - 'font_widget_title_variants', - 'font_widget_title_category', - 'font_footer_variants', - 'font_footer_category', - 'generate_copyright', - ); - } - - /** - * List out our available settings. - * - * @since 1.7 - */ - public static function get_settings() { - return array( - 'generate_settings', - 'generate_background_settings', - 'generate_blog_settings', - 'generate_hooks', - 'generate_page_header_settings', - 'generate_secondary_nav_settings', - 'generate_spacing_settings', - 'generate_menu_plus_settings', - 'generate_woocommerce_settings', - ); - } -} - -GeneratePress_Import_Export::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/reset.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/reset.php deleted file mode 100644 index bdcdca6f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/inc/legacy/reset.php +++ /dev/null @@ -1,273 +0,0 @@ - -
-

-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

-

- esc_js( $warning ), - 'id' => '', - ) - ); - ?> -

-
-
-
- array(), - 'options' => array(), - ); - - foreach ( $theme_mods as $theme_mod ) { - if ( 'generate_copyright' === $theme_mod ) { - if ( in_array( 'copyright', $_POST['module_group'] ) ) { - remove_theme_mod( $theme_mod ); - } - } else { - if ( in_array( 'generate_settings', $_POST['module_group'] ) ) { - remove_theme_mod( $theme_mod ); - } - } - } - - foreach ( $settings as $setting ) { - if ( in_array( $setting, $_POST['module_group'] ) ) { - delete_option( $setting ); - } - } - - // Delete our dynamic CSS option. - delete_option( 'generate_dynamic_css_output' ); - delete_option( 'generate_dynamic_css_cached_version' ); - - // Reset our dynamic CSS file updated time so it regenerates. - $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( isset( $dynamic_css_data['updated_time'] ) ) { - unset( $dynamic_css_data['updated_time'] ); - } - - update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); - - // Delete any GeneratePress Site CSS in Additional CSS. - $additional_css = wp_get_custom_css_post(); - - if ( ! empty( $additional_css ) ) { - $additional_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $additional_css->post_content ); - wp_update_custom_css_post( $additional_css->post_content ); - } - - wp_safe_redirect( admin_url( 'themes.php?page=generate-options&status=reset' ) ); - exit; -} - -add_action( 'admin_head', 'generate_reset_options_css', 100 ); -/** - * Add CSS to the dashboard. - */ -function generate_reset_options_css() { - $screen = get_current_screen(); - - if ( ! is_object( $screen ) ) { - return; - } - - if ( 'appearance_page_generate-options' !== $screen->base ) { - return; - } - ?> - - base ) { - return; - } - ?> - - 1;"},"Post author name":["Nom de l'auteur de la publication"],"Post date":["Date de la publication"],"Title":["Titre"],"Dynamic text type":["Type de texte dynamique"],"Published date before text":["Texte avant la date de publication"],"Term archives":["Archives des termes"],"Author meta":["M\u00e9tadonn\u00e9es des auteurs"],"Previous page of posts":["Pr\u00e9c\u00e9dente page des publications"],"Next page of posts":["Prochaine page des publications"],"Comments area":["Zone des commentaires"],"Author archives":["Archives des auteurs"],"Single post":["Publication unique"],"Taxonomy":["Taxonomie"],"In same term":["Dans le m\u00eame terme"],"No previous post":["Pas de publication pr\u00e9c\u00e9dente"],"This will remove the current sidebar widgets for the selected sidebar. Your layout must have a sidebar set for this Element to show.":["Cela supprimera les widgets en cours pour la colonne lat\u00e9rale s\u00e9lectionn\u00e9e. Votre mise en page doit avoir des colonnes lat\u00e9rales d\u00e9finies pour que cet \u00e9l\u00e9ment soit visible."],"Site Footer":["Pied de page du site"],"None":["Aucun"],"Type":["Type"],"Right Sidebar":["Colonne lat\u00e9rale de droite"],"Left Sidebar":["Colonne lat\u00e9rale gauche"],"Priority":["Priorit\u00e9"],"Custom Hook":["Hook personnalis\u00e9"],"Custom":["Personnaliser"],"Site Header":["Ent\u00eate du site"],"Page Hero":["Banni\u00e8re"],"Hook":["Hook"],"Right":["Droite"],"Left":["Gauche"],"Center":["Centre"],"Location":["Emplacement"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR-53e2a1d5945b8d2b1c35e81ae1e532f3.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR-53e2a1d5945b8d2b1c35e81ae1e532f3.json deleted file mode 100644 index a7b5560a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR-53e2a1d5945b8d2b1c35e81ae1e532f3.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2021-03-10 11:23:17+0000","generator":"WP-CLI\/2.6.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr","plural-forms":"nplurals=2; plural=n > 1;"},"All Elements":["Tous les \u00e9l\u00e9ments"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR-92fa58377f1b6f7bef9c785c31ae29ff.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR-92fa58377f1b6f7bef9c785c31ae29ff.json deleted file mode 100644 index 0c595687..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR-92fa58377f1b6f7bef9c785c31ae29ff.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2021-03-10 11:23:17+0000","generator":"WP-CLI\/2.6.0","source":"dist\/site-library.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr","plural-forms":"nplurals=2; plural=n > 1;"},"Why?":["Pourquoi?"],"This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.":["Cette op\u00e9ration restaure vos r\u00e9glages pr\u00e9c\u00e9dents: options, widgets et extensions actives. Cela va aussi supprimer le contenu import\u00e9 est les CSS. "],"It is highly recommended that you remove the last site you imported before importing a new one.":["Il est vraiment recommand\u00e9 de supprimer le dernier site que vous avez import\u00e9 avant d'en importer un nouveau. "],"Existing Site Import Detected":["L'importation de ce site existe d\u00e9j\u00e0"],"Restoring theme options":["Restaurer les options du th\u00e8me"],"New URL":["Nouvelle URL"],"Old URL":["Ancienne URL"],"This site is using Elementor which means you will want to replace the imported image URLs.":["Ce site utilise Elementor ce qui veut dire que vous devrez remplacer les URLs des images import\u00e9es"],"Additional Cleanup":["Nettoyage suppl\u00e9mentaire"],"This site uses the following plugins.":["Ce site utilise les plugins suivants"],"Installing plugins":["Installation de plugins..."],"Activating plugins":["Activer les plugins"],"Importing widgets":["Importation des widgets"],"Importing site options":["Importation des options du site"],"Importing content":["Importation du contenu"],"None":["Aucun"],"Import":["Importer"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR.mo deleted file mode 100644 index 09ab19f4..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-fr_FR.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-hr.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-hr.mo deleted file mode 100644 index aa6b8ca5..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-hr.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-hu_HU.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-hu_HU.mo deleted file mode 100644 index e0aa58e4..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-hu_HU.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-it_IT.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-it_IT.mo deleted file mode 100644 index f92a2b4a..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-it_IT.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nb_NO.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nb_NO.mo deleted file mode 100644 index 792e21a2..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nb_NO.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-42da344ccb044413769d16ed3484307b.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-42da344ccb044413769d16ed3484307b.json deleted file mode 100644 index cd4fea2c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-42da344ccb044413769d16ed3484307b.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-22 13:18:34+0000","generator":"WP-CLI\/2.6.0","source":"dist\/block-elements.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"nl","plural-forms":"nplurals=2; plural=n != 1;"},"Loop Template":["Loop thema"],"The taxonomy to check if in the same term.":["De taxonomie om te controleren of het om dezelfde term gaat."],"Check for posts with the same term as the current post.":["Zoek naar berichten met dezelfde term als het huidige bericht."],"Remove container condition":["Verwijder container conditie"],"Display Order":["Weergavevolgorde"],"Parent Element":["Bovenliggend element"],"First post":["Eerste bericht"],"No post meta":["Geen bericht-meta"],"No featured image":["Geen uitgelichte afbeelding"],"Keep default archive navigation container":["Behoud standaard archief navigatie container"],"Disable default pagination":["Standaard paginering uitschakelen"],"Add default archive navigation container":["Voeg standaard archief navigatie container toe"],"Disable default post navigation":["Standaard berichtnavigatie uitschakelen"],"Use the above template tag to add the current year to your footer.":["Gebruik bovenstaande template tag om het huidige jaartal aan je footer toe te voegen."],"Current year template tag":["Huidig jaartal template tag"],"Disable primary post meta":["Uitzetten primaire bericht-meta"],"Disable featured image":["Uitzetten uitgelichte afbeelding"],"Disable title":["Uitzetten titel"],"Keep default post container":["Behoud standaard berichtcontainer"],"Post meta name":["Berichtmeta-naam"],"Term name":["Termnaam"],"Posts with custom field":["Berichten met aangepast veld"],"Posts with term":["Berichten met term"],"All posts":["Alle berichten"],"Apply to":["Toepassen op"],"Tag name":["Tag-naam"],"Replace default secondary post meta":["Vervang standaard secundaire bericht-meta"],"Replace default primary post meta":["Vervang standaard primaire bericht-meta"],"Custom hook name":["Aangepaste hook naam"],"Choose your hook":["Kies je hook"],"Hook name":["Hook naam"],"Quick hook select":["Snelle hook selectie"],"Before post title":["Voor berichttitel"],"After post title":["Na bericht titel"],"This Element will replace your site footer area that holds your copyright message. It will not replace footer widgets if they exist.":["Dit element vervangt het footer gebied van je site waar het copyright bericht staat. Het vervangt niet je footer widgets als deze bestaan."],"Templates":["Templates"],"Element type":["Element type"],"Editor width":["Breedte editor"],"Install GenerateBlocks":["Installeer GenerateBlocks"],"Activate GenerateBlocks":["Activeer GenerateBlocks"],"To take full advantage of Block Elements, we suggest using our GenerateBlocks plugin.":["Om volledig gebruikt te kunnen maken Block Elements, raden we het gebruik van onze GenerateBlocks plug-in aan."],"Block Element":["Block Element"],"After content container":["Na inhoud-container"],"After content":["Na inhoud"],"Before content":["Voor inhoud"],"Before content container":["Voor inhoud-container"],"After header":["Na header"],"label\u0004Single post hero with excerpt":["Enkel bericht-hero met uittreksel"],"label\u0004Basic single post page hero":["Eenvoudige enkel bericht-hero "],"label\u0004Rounded buttons with icon":["Afgeronde knoppen met icoon"],"label\u0004Default next and previous buttons":["Standaard volgende en vorige knoppen"],"label\u0004Landscape layout":["Liggende layout"],"label\u0004Layout with offset content":["Layout met offset inhoud"],"label\u0004Basic layout with term buttons":["Eenvoudige layout met term-knoppen"],"label\u0004Full footer 2":["Volledige footer 2"],"label\u0004Full footer 1":["Volledige footer 1"],"label\u0004Term buttons":["Term-knoppen"],"label\u0004Stacked with avatar":["Gestapeld met avatar"],"label\u0004Inline with avatar":["Inline met avatar"],"label\u0004Two columns with background overlays":["Twee kolommen met achtergrond bedekking"],"label\u0004Two columns with arrows":["Twee kolommen met pijlen"],"label\u0004Two columns with featured image":["Twee kolommen met uitgelichte afbeelding"],"%s Units":["%s eenheden"],"A size unit for CSS markup\u0004Degree":["Graden"],"A size unit for CSS markup\u0004Percentage":["Percentage"],"A size unit for CSS markup\u0004Em":["Em"],"A size unit for CSS markup\u0004Pixel":["Pixel"],"Select Units":["Selecteer eenheden"],"Displays a dynamic image from your chosen source.":["Geef een dynamische afbeelding weer van je gekozen bron"],"Dynamic Image":["Dynamische afbeelding"],"Dynamic image placeholder":["Dynamische afbeelding placeholder"],"Choose your dynamic image type.":["Kies type dynamische afbeelding"],"Dynamic image":["Dynamische afbeelding"],"Make image rounded":["Maak afbeelding afgerond"],"Custom field name":["Aangepast veld-naam"],"Custom field":["Aangepast veld"],"Link to":["Link naar"],"Image height":["Afbeeldingshoogte"],"Image width":["Afbeeldingsbreedte"],"Image size":["Afbeeldingsgrootte"],"Author avatar":["Auteur avatar"],"Displays dynamic content based on your chosen source.":["Toont dynamische inhoud gebaseerd op je gekozen bron."],"Dynamic Content":["Dynamische inhoud"],"This is a placeholder for your description.":["Dit is een plaatshouder voor je beschrijving."],"Choose your dynamic content type.":["Selecteer je dynamische inhoudstype"],"Dynamic content":["Dynamische inhoud"],"Custom more link":["Aangepaste meer link"],"Use theme more link":["Gebruik thema meer link"],"Excerpt length":["Lengte uittreksel"],"Author description":["Schrijver omschrijving"],"Term description":["Term omschrijving"],"Post excerpt":["Bericht uittreksel"],"Post content":["Bericht-inhoud"],"Dynamic link type":["Dynamische link-type"],"Updated date before text":["Bijgewerkt datum voor tekst"],"Use % in place of the number of comments":["Gebruik % in de plaats van het aantal reacties"],"Plural comments text":["Meervoud reacties tekst"],"Singular comments text":["Enkelvoudige reacties tekst"],"No comments text":["Geen reacties tekst"],"Term separator":["Term scheidingsteken"],"Replace with updated date":["Vervang door bijgewerkt datum"],"Updated date":["Bijgewerkt datum"],"Date type":["Datumtype"],"Terms":["Termen"],"Hello World":["Hallo wereld"],"Comments number":["Aantal reacties"],"List of terms":["Termenlijst"],"Post author name":["Bericht auteurnaam"],"Post date":["Berichtdatum"],"Title":["Titel"],"Dynamic text type":["Dynamische tekst type"],"Published date before text":["Gepubliceerd datum voor tekst"],"Term archives":["Term archief"],"Author meta":["Auteur meta"],"Previous page of posts":["Vorige pagina van berichten"],"Next page of posts":["Volgende pagina van berichten"],"Comments area":["Reacties gebied"],"Author archives":["Auteur archieven"],"Single post":["Enkel bericht"],"Taxonomy":["Taxonomie"],"In same term":["In dezelfde term"],"No previous post":["Geen vorig bericht"],"No next post":["Geen volgend bericht"],"Space between":["Spatie tussen"],"Inline alignment":["Inline uitlijning"],"Inline post meta items":["Inline bericht meta-termen"],"Previous post":["Vorig bericht"],"Next post":["Volgend bericht"],"Current post":["huidig bericht"],"Source":["Bron"],"Post":["Bericht"],"Choose\u2026":["Selecteer..."],"Dynamic Link":["Dynamische link"],"Use fallback image":["Gebruik terugval-afbeelding"],"Meta field name":["Metaveld naam"],"Add a background image to this Container to make it dynamic.":["Voeg een achtergrond toe aan deze Container om deze dynamisch te maken."],"User meta":["Gebruiker meta"],"Term meta":["Term meta"],"Post meta":["Bericht meta"],"Featured image":["Uitgelichte afbeelding"],"Dynamic Background Image":["Dynamische achtergrond afbeelding"],"Dynamic options":["Dynamische instellingen"],"Archive Navigation":["Archief navigatie"],"Post Navigation":["Berichtnavigatie"],"Post Meta Template":["Bericht meta template"],"Content Template":["Inhoud template"],"% Comments":["% reacties"],"1 Comment":["1 reactie"],"No Comments":["Geen reacties"],"This is a placeholder for your content.":["Dit is een plaatshouder voor je inhoud."],"This will remove the current sidebar widgets for the selected sidebar. Your layout must have a sidebar set for this Element to show.":["Dit verwijdert de huidige zijbalkwidgets voor de geselecteerde zijbalk. Je lay-out moet een zijbalk hebben om dit Element te laten zien."],"Site Footer":["Site footer"],"None":["Geen"],"Type":["Type"],"Right Sidebar":["Rechter zijbalk"],"Left Sidebar":["Linker zijbalk"],"Priority":["Prioriteit"],"Custom Hook":["Aangepaste hook"],"Custom":["Aangepast"],"Site Header":["Site header"],"Page Hero":["Page Hero"],"Hook":["Hook"],"Right":["Rechts"],"Left":["Links"],"Center":["Midden"],"Location":["Locatie"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-53e2a1d5945b8d2b1c35e81ae1e532f3.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-53e2a1d5945b8d2b1c35e81ae1e532f3.json deleted file mode 100644 index bd23357a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-53e2a1d5945b8d2b1c35e81ae1e532f3.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-22 13:18:34+0000","generator":"WP-CLI\/2.6.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"nl","plural-forms":"nplurals=2; plural=n != 1;"},"Active Elements":["Actieve elementen"],"All Elements":["Alle elementen"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-92fa58377f1b6f7bef9c785c31ae29ff.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-92fa58377f1b6f7bef9c785c31ae29ff.json deleted file mode 100644 index 0cc8e32a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-92fa58377f1b6f7bef9c785c31ae29ff.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-22 13:18:34+0000","generator":"WP-CLI\/2.6.0","source":"dist\/site-library.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"nl","plural-forms":"nplurals=2; plural=n != 1;"},"Requires GeneratePress %s.":["Vereist GeneratePress %s."],"Built by":["Gebouwd door"],"Note: We do our best to ensure all imported images are licensed for open use. However, image licenses can change, so we strongly advise that you replace all imported images with your own.":["Opmerking: we doen ons best om ervoor te zorgen dat alle ge\u00efmporteerde afbeeldingen vrij gebruikt mogen worden. Afbeeldingslicenties kunnen echter veranderen, dus we raden je ten zeerste aan om alle ge\u00efmporteerde afbeeldingen te vervangen door je eigen afbeeldingen."],"Check out your new site and start making it yours!":["Bekijk je nieuwe site en geef het jouw unieke stijl!"],"Learn more here":["Leer hier meer"],"To disable it, find WP_DEBUG in your wp-config.php file and set it to false like the below.":["Zoek - om het uit te schakelen - naar WP_DEBUG in je wp-config.php-bestand en stel het in op false zoals hieronder."],"WordPress debug mode is currently enabled. With this, any errors from third-party plugins might affect the import process.":["De foutopsporingsmodus van WordPress is momenteel ingeschakeld. Hierdoor kunnen eventuele fouten van plug-ins van derden het importproces be\u00efnvloeden."],"Debug Mode Enabled":["Foutopsporingsmodus ingeschakeld"],"Preview mobile":["Voorbeeld mobiel"],"Preview tablet":["Voorbeeld tablet"],"Preview desktop":["Voorbeeld desktop"],"Elementor Tools":["Elementor Tools"],"Take note of the old and new URLs below, then head over to the Elementor Tools area to replace them.":["Noteer de oude en nieuwe URL's hieronder en ga naar het Elementor Tools-gebied om ze te vervangen."],"Begin Import":["Begin importeren"],"I understand":["Ik begrijp het"],"Confirm Import":["Bevestig importeren"],"Import Demo Content":["Importeer demo inhoud"],"This will install and activate needed plugins, import demo content, and import site options.":["Dit installeert en activeert de benodigde plug-ins, importeert de demo-inhoud en importeert site-instellingen."],"Import Theme Options":["Importeer thema-instellingen"],"This will import the options from the Customizer.":["Dit importeert de instellingen van de Customizer."],"These plugins need to be installed manually.":["Deze plug-ins moeten handmatig worden ge\u00efnstalleerd."],"These plugins are already installed.":["Deze plug-ins zijn al ge\u00efnstalleerd."],"These plugins can be installed automatically.":["Deze plug-ins kunnen automatisch worden ge\u00efnstalleerd."],"Gathering information":["Informatie aan het verzamelen."],"Refresh sites":["Vernieuw sites"],"Requires GP Premium %s.":["Vereist GP Premium %s."],"Page Builder":["Pagina bouwer"],"Category":["Categorie"],"No thanks":["Nee bedankt"],"Remove imported site":["Verwijder ge\u00efmporteerde site"],"This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.":["Dit proces maakt veranderingen aan je website. Als deze belangrijke data bevat, raden we aan om deze te back-uppen."],"Try again":["Nogmaals proberen"],"No sites were found.":["Geen sites gevonden."],"Restoring content":["Terugzetten inhoud"],"Installing %s":["%s wordt ge\u00efnstalleerd"],"Import Complete":["Import compleet"],"Importing theme options":["Thema-instellingen worden ge\u00efmporteerd"],"Why?":["Waarom?"],"This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.":["Deze procedure zet de vorige instellingen, widgets, en actieve plugins terug. Het verwijdert ook de ge\u00efmporteerde inhoud en CSS."],"It is highly recommended that you remove the last site you imported before importing a new one.":["Het is aanbevolen dat je de laatste site verwijdert die je hebt ge\u00efmporteerd voordat je een nieuwe importeert."],"Existing Site Import Detected":["Bestaande site import gevonden"],"Restoring theme options":["Terugzetten thema-instellingen"],"New URL":["Nieuwe URL"],"Old URL":["Oude URL"],"This site is using Elementor which means you will want to replace the imported image URLs.":["Deze site maakt gebruik van Elementor, wat betekent dat je de ge\u00efmporteerde afbeeldings-URLs moet aanpassen."],"Additional Cleanup":["Extra opruimen"],"This site uses the following plugins.":["Deze site maakt gebruik van de volgende plugins:"],"All":["Alles"],"View Site":["Bekijk site"],"Get Started":["Nu beginnen"],"Plugins":["Plugins"],"Installing plugins":["Plugins aan het installeren"],"Activating plugins":["Plugins aan het activeren"],"Importing widgets":["Widgets aan het importeren"],"Importing site options":["Site-instellingen aan het importeren"],"Importing content":["Inhoud aan het importeren"],"None":["Geen"],"Import":["Importeren"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-cbab080b0f20fd6c323029398be6c986.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-cbab080b0f20fd6c323029398be6c986.json deleted file mode 100644 index 2c6bc645..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-cbab080b0f20fd6c323029398be6c986.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-22 13:18:34+0000","generator":"WP-CLI\/2.6.0","source":"dist\/dashboard.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"nl","plural-forms":"nplurals=2; plural=n != 1;"},"This will delete all of your customizer settings. It cannot be undone.":["Dit zal al je customizer instellingen verwijderen. Het kan niet ongedaan worden gemaakt."],"Reset your customizer settings.":["Reset je customizer instellingen."],"Options imported.":["Opties ge\u00efmporteerd."],"This can overwrite existing settings and cannot be undone.":["Dit kan bestaande instellingen overschrijven en kan niet ongedaan worden gemaakt."],"Import your customizer settings.":["Importeer je customizer instellingen."],"Global Colors":["Globale kleuren"],"Export your customizer settings.":["Exporteer je customizer instellingen."],"Import \/ Export":["Importeren \/ exporteren"],"License key deactivated.":["Licentiesleutel gedeactiveerd."],"License key activated.":["Licentiesleutel geactiveerd."],"Get alpha and beta updates directly to your Dashboard.":["Ontvang alpha en beta updates direct in je Dashboard."],"Enter your license key to activate updates.":["Voer je licentiesleutel in om updates te activeren."],"Not receiving premium updates.":["Geen premium updates ontvangen."],"Receiving premium updates.":["Premium-updates ontvangen."],"Options exported":["Opties ge\u00ebxporteerd"],"This will delete all settings for this module. It cannot be undone.":["Hiermee worden alle instellingen voor deze module verwijderd. Dit kan niet ongedaan worden gemaakt."],"Open tools for this module.":["Open gereedschap voor deze module."],"Open Elements":["Open elementen"],"Open Site Library":["Open site bibliotheek"],"Settings reset.":["Instellingen gereset."],"Typography":["Typografie"],"All":["Alles"],"Reset":["Terugzetten"],"Modules":["Modules"],"License Key":["Licentiecode"],"Deactivate":["Deactiveren"],"Activate":["Activeren"],"This module has been deprecated. Deactivating it will remove it from this list.":["Deze module is verouderd. Als u deze deactiveert, wordt deze uit deze lijst verwijderd."],"Import":["Importeren"],"Export":["Exporteren"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-ecf9f3c2af10c4f2dfbf4f42504922d1.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-ecf9f3c2af10c4f2dfbf4f42504922d1.json deleted file mode 100644 index 69729ba2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL-ecf9f3c2af10c4f2dfbf4f42504922d1.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-22 13:18:34+0000","generator":"WP-CLI\/2.6.0","source":"dist\/customizer.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"nl","plural-forms":"nplurals=2; plural=n != 1;"},"Related\/Upsell Product Titles":["Gerelateerde\/opwaarderende producttitels"],"Catalog Product Titles":["Catalogus product titels"],"Off-Canvas Sub-Menu Items":["Off-canvas submenu items"],"Off-Canvas Menu Items":["Off-canvas menu items"],"Secondary Mobile Menu Toggle":["Secundair mobiel menu toggle"],"Secondary Sub-Menu Items":["Secundaire submenu items"],"Secondary Menu Items":["Secundaire menu-items"],"Off-Canvas Panel":["Off-canvas paneel"],"WooCommerce":["WooCommerce"],"Secondary Navigation":["Secundaire navigatie"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL.mo deleted file mode 100644 index d13ab9e4..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-nl_NL.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pl_PL.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pl_PL.mo deleted file mode 100644 index 06c623d9..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pl_PL.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_BR.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_BR.mo deleted file mode 100644 index e453013e..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_BR.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-42da344ccb044413769d16ed3484307b.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-42da344ccb044413769d16ed3484307b.json deleted file mode 100644 index 101c7110..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-42da344ccb044413769d16ed3484307b.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2020-08-08 21:16:06+0000","generator":"WP-CLI\/2.6.0","source":"dist\/block-elements.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt","plural-forms":"nplurals=2; plural=n != 1;"},"Site Footer":["Rodap\u00e9 do site"],"None":["Nenhuma"],"Type":["Tipo"],"Right Sidebar":["Barra lateral direita"],"Left Sidebar":["Barra lateral esquerda"],"Priority":["Prioridade"],"Custom Hook":["Hook personalizado"],"Custom":["Personalizado"],"Site Header":["Cabe\u00e7alho do site"],"Page Hero":["Hero de p\u00e1gina"],"Hook":["Hook"],"Right":["Direita"],"Left":["Esquerda"],"Center":["Centro"],"Location":["Localiza\u00e7\u00e3o"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-53e2a1d5945b8d2b1c35e81ae1e532f3.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-53e2a1d5945b8d2b1c35e81ae1e532f3.json deleted file mode 100644 index 4fc6aaba..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-53e2a1d5945b8d2b1c35e81ae1e532f3.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2020-08-08 21:16:06+0000","generator":"WP-CLI\/2.6.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt","plural-forms":"nplurals=2; plural=n != 1;"},"All Elements":["Todos os elementos"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-92fa58377f1b6f7bef9c785c31ae29ff.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-92fa58377f1b6f7bef9c785c31ae29ff.json deleted file mode 100644 index d60c4950..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT-92fa58377f1b6f7bef9c785c31ae29ff.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2020-08-08 21:16:06+0000","generator":"WP-CLI\/2.6.0","source":"dist\/site-library.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt","plural-forms":"nplurals=2; plural=n != 1;"},"Why?":["Porqu\u00ea?"],"This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.":["Este processo recupera as suas op\u00e7\u00f5es, widgets e plugins activos anteriores. Tamb\u00e9m ir\u00e1 remover o seu conte\u00fado importado e CSS."],"It is highly recommended that you remove the last site you imported before importing a new one.":["\u00c9 altamente recomendado que remova o site importado anteriormente antes de importar um novo."],"Existing Site Import Detected":["Detectado um site importado existente"],"Restoring theme options":["A recuperar op\u00e7\u00f5es do tema"],"New URL":["URL novo"],"Old URL":["URL antigo"],"This site is using Elementor which means you will want to replace the imported image URLs.":["Este site utiliza o Elementor, isto significa que dever\u00e1 substituir os URL das imagens importadas."],"Additional Cleanup":["Limpeza adicional"],"This site uses the following plugins.":["Este site utiliza os seguintes plugins."],"All":["Todos"],"View Site":["Ver site"],"Get Started":["Come\u00e7ar"],"Plugins":["Plugins"],"Installing plugins":["A instalar plugins"],"Activating plugins":["A activar plugins"],"Importing widgets":["A importar widgets"],"Importing site options":["A importar op\u00e7\u00f5es do site"],"Importing content":["A importar conte\u00fados"],"None":["Nenhuma"],"Import":["Importar"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT.mo deleted file mode 100644 index 53b4c446..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-pt_PT.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-42da344ccb044413769d16ed3484307b.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-42da344ccb044413769d16ed3484307b.json deleted file mode 100644 index ff9ec0df..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-42da344ccb044413769d16ed3484307b.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2023-11-08 16:38:58+0000","generator":"WP-CLI\/2.6.0","source":"dist\/block-elements.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ru","plural-forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"},"Loop Template":["\u0428\u0430\u0431\u043b\u043e\u043d \u0446\u0438\u043a\u043b\u0430"],"The taxonomy to check if in the same term.":["\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0438\u044e \u0435\u0441\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0435\u0440\u043c\u0438\u043d."],"Check for posts with the same term as the current post.":["\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u0438\u043c\u0435\u043d\u0435\u043c \u043a\u0430\u043a \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c."],"Remove container condition":["\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430"],"Display Order":["\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0417\u0430\u043a\u0430\u0437"],"Parent Element":["\u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442"],"First post":["\u041f\u0435\u0440\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c"],"No post meta":["\u041d\u0435\u0442 \u043c\u0435\u0442\u0430-\u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0438"],"No featured image":["\u041d\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f"],"Keep default archive navigation container":["\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0432\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"Disable default pagination":["\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"Add default archive navigation container":["\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e \u0430\u0440\u0445\u0438\u0432\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"Disable default post navigation":["\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043f\u043e \u0437\u0430\u043f\u0438\u0441\u044f\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"Use the above template tag to add the current year to your footer.":["\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u0442\u0435\u0433 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0433\u043e\u0434 \u0432 \u043f\u043e\u0434\u0432\u0430\u043b"],"Current year template tag":["\u0422\u0435\u0433 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0433\u043e\u0434\u0430"],"Disable primary post meta":["\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u0435\u0442\u0430-\u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438"],"Disable featured image":["\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438"],"Disable title":["\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a"],"Keep default post container":["\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"Post meta name":["\u041c\u0435\u0442\u0430-\u0438\u043c\u044f \u0437\u0430\u043f\u0438\u0441\u0438"],"Term name":["\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430"],"Posts with custom field":["\u0417\u0430\u043f\u0438\u0441\u0438 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u0435\u043c"],"Posts with term":["\u0417\u0430\u043f\u0438\u0441\u0438 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043c\u0438"],"All posts":["\u0412\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438"],"Apply to":["\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a"],"Tag name":["\u0418\u043c\u044f \u0442\u0435\u0433\u0430"],"Replace default secondary post meta":["\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0435\u0442\u0443 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"Replace default primary post meta":["\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0435\u0442\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"Custom hook name":["\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0445\u0443\u043a\u0430"],"Choose your hook":["\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0445\u0443\u043a"],"Hook name":["\u0418\u043c\u044f \u0445\u0443\u043a\u0430"],"Quick hook select":["\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0445\u0443\u043a\u0430"],"Before post title":["\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u0438"],"After post title":["\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438"],"This Element will replace your site footer area that holds your copyright message. It will not replace footer widgets if they exist.":["\u042d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u043e\u0434\u0432\u0430\u043b\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u0430\u0432\u0442\u043e\u0440\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0430\u0445. \u041e\u043d \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043f\u043e\u0434\u0432\u0430\u043b\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442."],"Templates":["\u0428\u0430\u0431\u043b\u043e\u043d\u044b\u0439"],"Element type":["\u0422\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430"],"Editor width":["\u0428\u0438\u0440\u0438\u043d\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430"],"Install GenerateBlocks":["\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c GenerateBlocks"],"Activate GenerateBlocks":["\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c GenerateBlocks"],"To take full advantage of Block Elements, we suggest using our GenerateBlocks plugin.":["\u0427\u0442\u043e\u0431\u044b \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u043c\u0435\u0440\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u0431\u043b\u043e\u0447\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043c\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043f\u043b\u0430\u0433\u0438\u043d GenerateBlocks."],"Block Element":["\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u0411\u043b\u043e\u043a\u0430"],"After content container":["\u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430"],"After content":["\u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430"],"Before content":["\u041f\u0435\u0440\u0435\u0434 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c"],"Before content container":["\u041f\u0435\u0440\u0435\u0434 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430"],"After header":["\u041f\u043e\u0441\u043b\u0435 \u0448\u0430\u043f\u043a\u0438"],"label\u0004Single post hero with excerpt":["Hero \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043e\u0442\u0440\u044b\u0432\u043a\u0430\u043c\u0438"],"label\u0004Basic single post page hero":["Hero \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e"],"label\u0004Rounded buttons with icon":["\u041e\u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441\u043e \u0437\u043d\u0430\u0447\u043a\u043e\u043c"],"label\u0004Default next and previous buttons":["\u041a\u043d\u043e\u043f\u043a\u0438 \u00ab\u0414\u0430\u043b\u0435\u0435\u00bb \u0438 \u00ab\u041d\u0430\u0437\u0430\u0434\u00bb \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"],"label\u0004Landscape layout":["\u0410\u043b\u044c\u0431\u043e\u043c\u043d\u0430\u044f \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u044f"],"label\u0004Layout with offset content":["\u041c\u0430\u043a\u0435\u0442 \u0441\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c"],"label\u0004Basic layout with term buttons":["\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043c\u0430\u043a\u0435\u0442 \u0441 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432"],"label\u0004Full footer 2":["\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u043e\u0434\u0432\u0430\u043b 2"],"label\u0004Full footer 1":["\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u043e\u0434\u0432\u0430\u043b 1"],"label\u0004Term buttons":["\u041a\u043d\u043e\u043f\u043a\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432"],"label\u0004Stacked with avatar":["\u0421\u043b\u043e\u0436\u0435\u043d\u044b \u0441 \u0430\u0432\u0430\u0442\u0430\u0440\u043e\u043c"],"label\u0004Inline with avatar":["\u041d\u0430 \u043b\u0438\u043d\u0438\u0438 \u0441 \u0430\u0432\u0430\u0442\u0430\u0440\u043e\u043c"],"label\u0004Two columns with background overlays":["\u0414\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441 \u0444\u043e\u043d\u043e\u0432\u044b\u043c\u0438 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438"],"label\u0004Two columns with arrows":["\u0414\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c\u0438"],"label\u0004Two columns with featured image":["\u0414\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0438"],"%s Units":["% \u0435\u0434\u0438\u043d\u0438\u0446"],"A size unit for CSS markup\u0004Degree":["\u0421\u0442\u0435\u043f\u0435\u043d\u044c"],"A size unit for CSS markup\u0004Percentage":["\u041f\u0440\u043e\u0446\u0435\u043d\u0442"],"A size unit for CSS markup\u0004Em":["\u0420\u0430\u0437\u043c\u0435\u0440"],"A size unit for CSS markup\u0004Pixel":["\u041f\u0438\u043a\u0441\u0435\u043b\u044c"],"Select Units":["\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b"],"Displays a dynamic image from your chosen source.":["\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u043c\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430."],"Dynamic Image":["\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435"],"Dynamic image placeholder":["\u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f"],"Choose your dynamic image type.":["\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f."],"Dynamic image":["\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435"],"Make image rounded":["\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u043c"],"Custom field name":["\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f"],"Custom field":["\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u043e\u043b\u0435"],"Link to":["\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430"],"Image height":["\u0412\u044b\u0441\u043e\u0442\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f"],"Image width":["\u0428\u0438\u0440\u0438\u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f"],"Image size":["\u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438"],"Author avatar":["\u0410\u0432\u0430\u0442\u0430\u0440 \u0430\u0432\u0442\u043e\u0440\u0430"],"Displays dynamic content based on your chosen source.":["\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u043c\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430."],"Dynamic Content":["\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442"],"This is a placeholder for your description.":["\u042d\u0442\u043e \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f"],"Choose your dynamic content type.":["\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0438\u043f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430."],"Dynamic content":["\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442"],"Custom more link":["\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0435\u0449\u0435"],"Use theme more link":["\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u0435\u0449\u0435 \u0442\u0435\u043c\u044b"],"Excerpt length":["\u0414\u043b\u0438\u043d\u0430 \u043e\u0442\u0440\u044b\u0432\u043a\u0430"],"Author description":["\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0430 "],"Term description":["\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430"],"Post excerpt":["\u041e\u0442\u0440\u044b\u0432\u043e\u043a \u0437\u0430\u043f\u0438\u0441\u0438"],"Post content":["\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0437\u0430\u043f\u0438\u0441\u0438"],"Dynamic link type":["\u0422\u0438\u043f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438"],"Updated date before text":["\u0414\u0430\u0442\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u043c"],"Use % in place of the number of comments":["\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 % \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432"],"Plural comments text":["\u0422\u0435\u043a\u0441\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0447\u0438\u0441\u043b\u0435"],"Singular comments text":["\u0422\u0435\u043a\u0441\u0442 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432"],"No comments text":["\u0422\u0435\u043a\u0441\u0442 \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432"],"Term separator":["\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432"],"Replace with updated date":["\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0434\u0430\u0442\u043e\u0439"],"Updated date":["\u0414\u0430\u0442\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f"],"Date type":["\u0422\u0438\u043f \u0434\u0430\u0442\u044b"],"Terms":["\u0422\u0435\u0440\u043c\u0438\u043d\u044b"],"Hello World":["\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0438\u0440"],"Comments number":["\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432"],"List of terms":["\u0421\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432"],"Post author name":["\u0418\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u0438"],"Post date":["\u0414\u0430\u0442\u0430 \u0437\u0430\u043f\u0438\u0441\u0438"],"Title":["\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a"],"Dynamic text type":["\u0422\u0438\u043f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430"],"Published date before text":["\u0414\u0430\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u043c"],"Term archives":["\u0410\u0440\u0445\u0438\u0432\u044b \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432"],"Author meta":["\u041c\u0435\u0442\u0430 \u0430\u0432\u0442\u043e\u0440\u0430"],"Previous page of posts":["\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439"],"Next page of posts":["\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439"],"Comments area":["\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432"],"Author archives":["\u0410\u0440\u0445\u0438\u0432\u044b \u0430\u0432\u0442\u043e\u0440\u0430"],"Single post":["\u0415\u0434\u0438\u043d\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c"],"Taxonomy":["\u0422\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0438\u044f"],"In same term":["\u0422\u0435\u043c \u0436\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043c"],"No previous post":["\u041d\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438"],"No next post":["\u041d\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438"],"Space between":["\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443"],"Inline alignment":["\u041b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435"],"Inline post meta items":["\u041c\u0435\u0442\u0430\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439"],"Previous post":["\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c"],"Next post":["\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c"],"Current post":["\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c"],"Source":["\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a"],"Post":["\u0417\u0430\u043f\u0438\u0441\u044c"],"Choose\u2026":["\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435..."],"Dynamic Link":["\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430"],"Use fallback image":["\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435"],"Meta field name":["\u0418\u043c\u044f \u043c\u0435\u0442\u0430\u043f\u043e\u043b\u044f"],"Add a background image to this Container to make it dynamic.":["\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u0442 \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u044b\u043c."],"User meta":["\u041c\u0435\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f"],"Term meta":["\u0422\u0435\u0440\u043c\u0438\u043d \u043c\u0435\u0442\u0430"],"Post meta":["\u041c\u0435\u0442\u0430 \u0437\u0430\u043f\u0438\u0441\u0438"],"Featured image":["\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438"],"Dynamic Background Image":["\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435"],"Dynamic options":["\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b"],"Archive Navigation":["\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043f\u043e \u0430\u0440\u0445\u0438\u0432\u0443"],"Post Navigation":["\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043f\u043e \u0437\u0430\u043f\u0438\u0441\u044f\u043c"],"Post Meta Template":["\u041c\u0435\u0442\u0430 \u0448\u0430\u0431\u043b\u043e\u043d \u0437\u0430\u043f\u0438\u0441\u0438"],"Content Template":["\u0428\u0430\u0431\u043b\u043e\u043d \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430"],"% Comments":["% \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438"],"1 Comment":["1 \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439"],"No Comments":["\u041d\u0435\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432"],"This is a placeholder for your content.":["\u042d\u0442\u043e \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e. "],"This will remove the current sidebar widgets for the selected sidebar. Your layout must have a sidebar set for this Element to show.":["\u042d\u0442\u043e \u0443\u0434\u0430\u043b\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u0430 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u0430. \u0412 \u0432\u0430\u0448\u0435\u043c \u043c\u0430\u043a\u0435\u0442\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u0430\u0439\u0434\u0431\u0430\u0440 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430."],"Site Footer":["\u041f\u043e\u0434\u0432\u0430\u043b \u0441\u0430\u0439\u0442\u0430"],"None":["\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442"],"Type":["\u0422\u0438\u043f"],"Right Sidebar":["\u0412 \u043f\u0440\u0430\u0432\u043e\u043c \u0431\u043e\u043a\u043e\u0432\u0438\u043a\u0435"],"Left Sidebar":["\u0412 \u043b\u0435\u0432\u043e\u043c \u0431\u043e\u043a\u043e\u0432\u0438\u043a\u0435"],"Priority":["\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442"],"Custom Hook":["\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0445\u0443\u043a"],"Custom":["\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439"],"Site Header":["\u0428\u0430\u043f\u043a\u0430 \u0441\u0430\u0439\u0442\u0430"],"Page Hero":["Hero \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430"],"Hook":["\u0425\u0443\u043a"],"Right":["\u0421\u043f\u0440\u0430\u0432\u0430"],"Left":["\u0421\u043b\u0435\u0432\u0430"],"Center":["\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443"],"Location":["\u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-53e2a1d5945b8d2b1c35e81ae1e532f3.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-53e2a1d5945b8d2b1c35e81ae1e532f3.json deleted file mode 100644 index 31dfd244..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-53e2a1d5945b8d2b1c35e81ae1e532f3.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2023-11-08 16:38:58+0000","generator":"WP-CLI\/2.6.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ru","plural-forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"},"Active Elements":["\u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u042d\u0435\u043c\u0435\u043d\u0442\u044b"],"All Elements":["\u0412\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-92fa58377f1b6f7bef9c785c31ae29ff.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-92fa58377f1b6f7bef9c785c31ae29ff.json deleted file mode 100644 index 3b4bd9e2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-92fa58377f1b6f7bef9c785c31ae29ff.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2023-11-08 16:38:58+0000","generator":"WP-CLI\/2.6.0","source":"dist\/site-library.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ru","plural-forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"},"Requires GeneratePress %s.":["\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f GeneratePress %s."],"Built by":["\u0421\u043e\u0437\u0434\u0430\u043d\u043e"],"Note: We do our best to ensure all imported images are licensed for open use. However, image licenses can change, so we strongly advise that you replace all imported images with your own.":["\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u041c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0432\u0430\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438."],"Check out your new site and start making it yours!":["\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u0432\u043e\u0439 \u043d\u043e\u0432\u044b\u0439 \u0441\u0430\u0439\u0442 \u0438 \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u0432\u043e\u0438\u043c!"],"Learn more here":["\u0423\u0437\u043d\u0430\u0439\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0434\u0435\u0441\u044c"],"To disable it, find WP_DEBUG in your wp-config.php file and set it to false like the below.":["\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u043d\u0430\u0439\u0434\u0438\u0442\u0435 WP_DEBUG \u0432 \u0444\u0430\u0439\u043b\u0435 wp-config.php \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 false, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435."],"WordPress debug mode is currently enabled. With this, any errors from third-party plugins might affect the import process.":["\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043a\u0438 WordPress. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043b\u044e\u0431\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u0430."],"Debug Mode Enabled":["\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043a\u0438"],"Preview mobile":["\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445"],"Preview tablet":["\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u0430"],"Preview desktop":["\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430"],"Elementor Tools":["\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Elementor"],"Take note of the old and new URLs below, then head over to the Elementor Tools area to replace them.":["\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u0438 \u043d\u043e\u0432\u044b\u0439 URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0438\u0436\u0435, \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 Elementor, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445."],"Begin Import":["\u041d\u0430\u0447\u0430\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442"],"I understand":["\u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e"],"Confirm Import":["\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442"],"Import Demo Content":["\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442"],"This will install and activate needed plugins, import demo content, and import site options.":["\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0430\u0439\u0442\u0430."],"Import Theme Options":["\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0442\u0435\u043c\u044b "],"This will import the options from the Customizer.":["\u0418\u043c\u043f\u043e\u0440\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0449\u0438\u043a\u0430."],"These plugins need to be installed manually.":["\u042d\u0442\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e."],"These plugins are already installed.":["\u042d\u0442\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b."],"These plugins can be installed automatically.":["\u042d\u0442\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438."],"Gathering information":["\u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0431\u043e\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. "],"Refresh sites":["\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u0430\u0439\u0442\u044b"],"Requires GP Premium %s.":["\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d GP Premium %s."],"Page Builder":["\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u0442\u0440\u0430\u043d\u0438\u0446"],"Category":["\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f"],"No thanks":["\u041d\u0435\u0442, \u0441\u043f\u0430\u0441\u0438\u0431\u043e"],"Remove imported site":["\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0430\u0439\u0442"],"This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.":["\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u043d\u043e\u0441\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0432\u0430\u0448 \u0441\u0430\u0439\u0442. \u0415\u0441\u043b\u0438 \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0430\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c."],"Try again":["\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439 \u0435\u0449\u0435 \u0440\u0430\u0437"],"No sites were found.":["\u0421\u0430\u0439\u0442\u043e\u0432 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e."],"Restoring content":["\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e"],"Installing %s":["\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 %s"],"Import Complete":["\u0418\u043c\u043f\u043e\u0440\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d"],"Importing theme options":["\u0418\u043c\u043f\u043e\u0440\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0435\u043c\u044b"],"Why?":["\u041f\u043e\u0447\u0435\u043c\u0443?"],"This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.":["\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0430\u0448 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0438 CSS."],"It is highly recommended that you remove the last site you imported before importing a new one.":["\u041d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 \u043f\u0435\u0440\u0435\u0434 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0433\u043e."],"Existing Site Import Detected":["\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u0438\u043c\u043f\u043e\u0440\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430"],"Restoring theme options":["\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0442\u0435\u043c\u044b"],"New URL":["\u041d\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 URL"],"Old URL":["\u0421\u0442\u0430\u0440\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 URL"],"This site is using Elementor which means you will want to replace the imported image URLs.":["\u042d\u0442\u043e\u0442 \u0441\u0430\u0439\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Elementor, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439."],"Additional Cleanup":["\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0430"],"This site uses the following plugins.":["\u042d\u0442\u043e\u0442 \u0441\u0430\u0439\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b."],"All":["\u0412\u0441\u0435"],"View Site":["\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0430\u0439\u0442"],"Get Started":["\u041d\u0430\u0447\u0430\u0442\u044c"],"Plugins":["\u041f\u043b\u0430\u0433\u0438\u043d\u044b"],"Installing plugins":["\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432"],"Activating plugins":["\u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432"],"Importing widgets":["\u0418\u043c\u043f\u043e\u0440\u0442 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432"],"Importing site options":["\u0418\u043c\u043f\u043e\u0440\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0441\u0430\u0439\u0442\u0430"],"Importing content":["\u0418\u043c\u043f\u043e\u0440\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430"],"None":["\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442"],"Import":["\u0418\u043c\u043f\u043e\u0440\u0442"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-cbab080b0f20fd6c323029398be6c986.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-cbab080b0f20fd6c323029398be6c986.json deleted file mode 100644 index c12a39a7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-cbab080b0f20fd6c323029398be6c986.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2023-11-08 16:38:58+0000","generator":"WP-CLI\/2.6.0","source":"dist\/dashboard.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ru","plural-forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"},"This will delete all of your customizer settings. It cannot be undone.":["\u042d\u0442\u043e \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0430\u0439\u0437\u0435\u0440\u0430. \u042d\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043e."],"Reset your customizer settings.":["\u0421\u0431\u0440\u043e\u0441\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0430\u0439\u0437\u0435\u0440\u0430."],"Options imported.":["\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b."],"This can overwrite existing settings and cannot be undone.":["\u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043e."],"Import your customizer settings.":["\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041a\u0430\u0441\u0442\u043e\u043c\u0430\u0439\u0437\u0435\u0440\u0430."],"Global Colors":["\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430"],"Export your customizer settings.":["\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043a\u0430\u0441\u0442\u043e\u043c\u0430\u0439\u0437\u0435\u0440\u0430."],"Import \/ Export":["\u0418\u043c\u043f\u043e\u0440\u0442 \/ \u042d\u043a\u0441\u043f\u043e\u0440\u0442"],"License key deactivated.":["\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d."],"License key activated.":["\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d."],"Get alpha and beta updates directly to your Dashboard.":["\u041f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u0430\u043b\u044c\u0444\u0430- \u0438 \u0431\u0435\u0442\u0430-\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u041a\u043e\u043d\u0441\u043e\u043b\u0438."],"Enter your license key to activate updates.":["\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0447\u0442\u043e\u0431\u044b \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f."],"Not receiving premium updates.":["\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u043c\u0438\u0443\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e."],"Receiving premium updates.":["\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u043c\u0438\u0443\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e."],"Options exported":["\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b"],"This will delete all settings for this module. It cannot be undone.":["\u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u042d\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043e."],"Open tools for this module.":["\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f."],"Open Elements":["\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b"],"Open Site Library":["\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0421\u0430\u0439\u0442\u043e\u0432"],"Settings reset.":["\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0431\u0440\u043e\u0448\u0435\u043d\u044b"],"Typography":["\u0422\u0438\u043f\u043e\u0433\u0440\u0430\u0444\u0438\u043a\u0430"],"All":["\u0412\u0441\u0435"],"Reset":["\u0421\u0431\u0440\u043e\u0441"],"Modules":["\u041c\u043e\u0434\u0443\u043b\u0438"],"License Key":["\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447"],"Deactivate":["\u0414\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c"],"Activate":["\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c"],"This module has been deprecated. Deactivating it will remove it from this list.":["\u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u043b. \u0414\u0435\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0443\u0434\u0430\u043b\u0438\u0442 \u0435\u0433\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430."],"Import":["\u0418\u043c\u043f\u043e\u0440\u0442"],"Export":["\u042d\u043a\u0441\u043f\u043e\u0440\u0442"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-ecf9f3c2af10c4f2dfbf4f42504922d1.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-ecf9f3c2af10c4f2dfbf4f42504922d1.json deleted file mode 100644 index 37e7b72a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU-ecf9f3c2af10c4f2dfbf4f42504922d1.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2023-11-08 16:38:58+0000","generator":"WP-CLI\/2.6.0","source":"dist\/customizer.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ru","plural-forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"},"Related\/Upsell Product Titles":["\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0445\u043e\u0436\u0438\u0445\/\u0430\u043f\u0441\u0435\u043b\u043b \u0442\u043e\u0432\u0430\u0440\u043e\u0432"],"Catalog Product Titles":["\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430"],"Off-Canvas Sub-Menu Items":["\u041f\u0443\u043d\u043a\u0442\u044b \u043f\u043e\u0434\u043c\u0435\u043d\u044e Off-Canvas"],"Off-Canvas Menu Items":["\u041f\u0443\u043d\u043a\u0442\u044b \u043c\u0435\u043d\u044e Off-Canvas"],"Secondary Mobile Menu Toggle":["\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e"],"Secondary Sub-Menu Items":["\u041f\u0443\u043d\u043a\u0442\u044b \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044e"],"Secondary Menu Items":["\u041f\u0443\u043d\u043a\u0442\u044b \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e"],"Off-Canvas Panel":["\u041f\u0430\u043d\u0435\u043b\u044c Off-Canvas"],"WooCommerce":["WooCommerce"],"Secondary Navigation":["\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u043d\u044e"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU.mo deleted file mode 100644 index dd9262e2..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-ru_RU.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-42da344ccb044413769d16ed3484307b.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-42da344ccb044413769d16ed3484307b.json deleted file mode 100644 index 58f573c2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-42da344ccb044413769d16ed3484307b.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-01 13:13:24+0000","generator":"WP-CLI\/2.6.0","source":"dist\/block-elements.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"sv_SE","plural-forms":"nplurals=2; plural=n != 1;"},"Loop Template":[""],"The taxonomy to check if in the same term.":[""],"Check for posts with the same term as the current post.":["Kolla efter inl\u00e4gg med samma term som det nuvarande inl\u00e4gget."],"Remove container condition":["Ta bort beh\u00e5llarens villkor"],"Display Order":[""],"Parent Element":["\u00d6verordnat element"],"First post":["F\u00f6rsta inl\u00e4gg"],"No post meta":[""],"No featured image":["Ingen utvald bild"],"Keep default archive navigation container":[""],"Disable default pagination":[""],"Add default archive navigation container":[""],"Disable default post navigation":[""],"Use the above template tag to add the current year to your footer.":[""],"Current year template tag":[""],"Disable primary post meta":["Inaktivera prim\u00e4r metadata f\u00f6r inl\u00e4gg"],"Disable featured image":["Inaktivera utvald bild"],"Disable title":["Inaktivera rubrik"],"Keep default post container":[""],"Post meta name":["Namn f\u00f6r metadata f\u00f6r inl\u00e4gg"],"Term name":["Termnamn"],"Posts with custom field":["Inl\u00e4gg med anpassat f\u00e4lt"],"Posts with term":["Inl\u00e4gg med term"],"All posts":["Alla inl\u00e4gg"],"Apply to":["Till\u00e4mpa p\u00e5"],"Tag name":["Etikettnamn"],"Replace default secondary post meta":[""],"Replace default primary post meta":[""],"Custom hook name":["V\u00e4lj namn f\u00f6r \u00e5tg\u00e4rds-hook"],"Choose your hook":["V\u00e4lj din \u00e5tg\u00e4rds-hook"],"Hook name":["Namn p\u00e5 \u00e5tg\u00e4rds-hook"],"Quick hook select":[""],"Before post title":["F\u00f6re inl\u00e4ggsrubrik"],"After post title":["Efter inl\u00e4ggsrubrik"],"This Element will replace your site footer area that holds your copyright message. It will not replace footer widgets if they exist.":["Detta element kommer att ers\u00e4tta ditt sidfotomr\u00e5de som inneh\u00e5ller ditt upphovsr\u00e4ttsmeddelande. Det ers\u00e4tter inte sidfotens widgetar om det finns."],"Templates":["Mallar"],"Element type":["Elementtyp"],"Editor width":["Redigeringsbredd"],"Install GenerateBlocks":["Installera GenerateBlocks"],"Activate GenerateBlocks":["Aktivera GenerateBlocks"],"To take full advantage of Block Elements, we suggest using our GenerateBlocks plugin.":["F\u00f6r att dra full nytta av Block Elements f\u00f6resl\u00e5r vi att du anv\u00e4nder v\u00e5rt till\u00e4gg GenerateBlocks."],"Block Element":["Block Element"],"After content container":["Efter inneh\u00e5llsbeh\u00e5llare"],"After content":["Efter inneh\u00e5ll"],"Before content":["F\u00f6re inneh\u00e5ll"],"Before content container":["F\u00f6re inneh\u00e5llsbeh\u00e5llare"],"After header":[""],"label\u0004Single post hero with excerpt":[""],"label\u0004Basic single post page hero":[""],"label\u0004Rounded buttons with icon":["Rundade knappar med ikon"],"label\u0004Default next and previous buttons":["Standardknappar f\u00f6r n\u00e4sta och f\u00f6reg\u00e5ende"],"label\u0004Landscape layout":["Liggande layout"],"label\u0004Layout with offset content":["Layout med f\u00f6rskjutet inneh\u00e5ll"],"label\u0004Basic layout with term buttons":[""],"label\u0004Full footer 2":["Hel sidfot 2"],"label\u0004Full footer 1":["Hel sidfot 1"],"label\u0004Term buttons":[""],"label\u0004Stacked with avatar":["Staplad med profilbild"],"label\u0004Inline with avatar":[""],"label\u0004Two columns with background overlays":["2 kolumner med bakgrund\u00f6verl\u00e4gg"],"label\u0004Two columns with arrows":["Tv\u00e5 kolumner med pilar"],"label\u0004Two columns with featured image":["Tv\u00e5 kolumner med utvald bild"],"%s Units":[""],"A size unit for CSS markup\u0004Degree":["Grad"],"A size unit for CSS markup\u0004Percentage":["Procentsats"],"A size unit for CSS markup\u0004Em":["Em"],"A size unit for CSS markup\u0004Pixel":["Pixel"],"Select Units":["V\u00e4lj enheter"],"Displays a dynamic image from your chosen source.":["Visar en dynamisk bild fr\u00e5n din valda k\u00e4lla."],"Dynamic Image":["Dynamisk bild"],"Dynamic image placeholder":["Platsh\u00e5llare f\u00f6r dynamisk bild"],"Choose your dynamic image type.":["V\u00e4lj din dynamiska bildtyp."],"Dynamic image":["Dynamisk bild"],"Make image rounded":["G\u00f6r bild rundad"],"Custom field name":["Anpassat f\u00e4ltnamn"],"Custom field":["Anpassat f\u00e4lt"],"Link to":["L\u00e4nk till"],"Image height":["Bildh\u00f6jd"],"Image width":["Bildbredd"],"Image size":["Bildstorlek"],"Author avatar":["Profilbild f\u00f6r f\u00f6rfattare"],"Displays dynamic content based on your chosen source.":["Visar dynamiskt inneh\u00e5ll baserat p\u00e5 din valda k\u00e4lla."],"Dynamic Content":["Dynamiskt inneh\u00e5ll"],"This is a placeholder for your description.":["Detta \u00e4r en platsh\u00e5llare f\u00f6r din beskrivning."],"Choose your dynamic content type.":["V\u00e4lj din dynamiska inneh\u00e5llstyp."],"Dynamic content":["Dynamiskt inneh\u00e5ll"],"Custom more link":["Anpassad l\u00e4nk f\u00f6r \u201dMer\u201d"],"Use theme more link":["Anv\u00e4nd temats l\u00e4nk f\u00f6r \u201dMer\u201d"],"Excerpt length":["Utdragsl\u00e4ngd"],"Author description":["F\u00f6rfattarbeskrivning"],"Term description":["Termbeskrivning"],"Post excerpt":["Inl\u00e4ggsutdrag"],"Post content":["Inl\u00e4ggsinneh\u00e5ll"],"Dynamic link type":["Dynamisk l\u00e4nktyp"],"Updated date before text":["Uppdateringsdatum f\u00f6re text"],"Use % in place of the number of comments":["Anv\u00e4nd % i st\u00e4llet f\u00f6r antalet kommentarer"],"Plural comments text":["Kommentarstext i plural"],"Singular comments text":["Kommentarstext i singular"],"No comments text":["Text f\u00f6r \u201dInga kommentarer\u201d"],"Term separator":[""],"Replace with updated date":["Ers\u00e4tt med uppdateringsdatum"],"Updated date":["Uppdateringsdatum"],"Date type":["Datumtyp"],"Terms":["Termer"],"Hello World":["Hej v\u00e4rlden"],"Comments number":["Antal kommentarer"],"List of terms":["Lista \u00f6ver termer"],"Post author name":["Inl\u00e4ggsf\u00f6rfattarens namn"],"Post date":["Publiceringsdatum"],"Title":["Rubrik"],"Dynamic text type":["Dynamisk texttyp"],"Published date before text":["Publiceringsdatum f\u00f6re text"],"Term archives":["Termarkiv"],"Author meta":["Meta f\u00f6r f\u00f6rfattare"],"Previous page of posts":["F\u00f6reg\u00e5ende sida med inl\u00e4gg"],"Next page of posts":["N\u00e4sta sida med inl\u00e4gg"],"Comments area":["Kommentaromr\u00e5de"],"Author archives":["F\u00f6rfattararkiv"],"Single post":["Enskilt inl\u00e4gg"],"Taxonomy":["Taxonomi"],"In same term":["I samma term"],"No previous post":["Inget f\u00f6reg\u00e5ende inl\u00e4gg"],"No next post":["Inget n\u00e4sta inl\u00e4gg"],"Space between":["Avst\u00e5nd mellan"],"Inline alignment":[""],"Inline post meta items":[""],"Previous post":["F\u00f6reg\u00e5ende inl\u00e4gg"],"Next post":["N\u00e4sta inl\u00e4gg"],"Current post":["Nuvarande inl\u00e4gg"],"Source":["K\u00e4lla"],"Post":["Inl\u00e4gg"],"Choose\u2026":["V\u00e4lj \u2026"],"Dynamic Link":["Dynamisk l\u00e4nk"],"Use fallback image":["Anv\u00e4nd reservbild"],"Meta field name":[""],"Add a background image to this Container to make it dynamic.":["L\u00e4gg till en bakgrundsbild i denna beh\u00e5llare f\u00f6r att g\u00f6ra den dynamisk."],"User meta":["Anv\u00e4ndarmeta"],"Term meta":[""],"Post meta":["Metadata f\u00f6r inl\u00e4gg"],"Featured image":["Utvald bild"],"Dynamic Background Image":["Dynamisk bakgrundsbild"],"Dynamic options":["Dynamiska alternativ"],"Archive Navigation":["Arkivnavigering"],"Post Navigation":["Inl\u00e4ggsnavigering"],"Post Meta Template":[""],"Content Template":["Inneh\u00e5llsmall"],"% Comments":["% kommentarer"],"1 Comment":["1 kommentar"],"No Comments":["Inga kommentarer"],"This is a placeholder for your content.":["Detta \u00e4r en platsh\u00e5llare f\u00f6r ditt inneh\u00e5ll."],"This will remove the current sidebar widgets for the selected sidebar. Your layout must have a sidebar set for this Element to show.":["Detta kommer ta bort nuvarande widgetar i sidopanelen f\u00f6r den valda sidopanelen. Din layout m\u00e5ste ha en sidopanel f\u00f6r att detta element ska visas."],"Site Footer":["Webbplatsens sidfot"],"None":["Ingen"],"Type":["Typ"],"Right Sidebar":["H\u00f6ger sidopanel"],"Left Sidebar":["V\u00e4nster sidopanel"],"Priority":["Prioritet"],"Custom Hook":["Anpassad \u00e5tg\u00e4rds-hook"],"Custom":["Anpassad"],"Site Header":["Webbplatsens sidhuvud"],"Page Hero":[""],"Hook":["\u00c5tg\u00e4rds-hook"],"Right":["H\u00f6ger"],"Left":["V\u00e4nster"],"Center":["Centrerat"],"Location":["Plats"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-53e2a1d5945b8d2b1c35e81ae1e532f3.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-53e2a1d5945b8d2b1c35e81ae1e532f3.json deleted file mode 100644 index 5b924ae9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-53e2a1d5945b8d2b1c35e81ae1e532f3.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-01 13:13:24+0000","generator":"WP-CLI\/2.6.0","source":"dist\/editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"sv_SE","plural-forms":"nplurals=2; plural=n != 1;"},"Active Elements":["Aktiva element"],"All Elements":["Alla element"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-92fa58377f1b6f7bef9c785c31ae29ff.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-92fa58377f1b6f7bef9c785c31ae29ff.json deleted file mode 100644 index b2ff7285..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-92fa58377f1b6f7bef9c785c31ae29ff.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-01 13:13:24+0000","generator":"WP-CLI\/2.6.0","source":"dist\/site-library.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"sv_SE","plural-forms":"nplurals=2; plural=n != 1;"},"Requires GeneratePress %s.":["Kr\u00e4ver GeneratePress %s."],"Built by":["Byggd med"],"Note: We do our best to ensure all imported images are licensed for open use. However, image licenses can change, so we strongly advise that you replace all imported images with your own.":[""],"Check out your new site and start making it yours!":["Kolla in din nya webbplats och b\u00f6rja g\u00f6ra den till din egen!"],"Learn more here":["L\u00e4r dig mer h\u00e4r"],"To disable it, find WP_DEBUG in your wp-config.php file and set it to false like the below.":["F\u00f6r att inaktivera den, hitta WP_DEBUG i din wp-config.php-fil och st\u00e4ll in den p\u00e5 falsk som nedan."],"WordPress debug mode is currently enabled. With this, any errors from third-party plugins might affect the import process.":["WordPress fels\u00f6kningsl\u00e4ge \u00e4r f\u00f6r n\u00e4rvarande aktiverat. Med detta kan eventuella fel fr\u00e5n till\u00e4gg fr\u00e5n tredje part p\u00e5verka importprocessen."],"Debug Mode Enabled":["Fels\u00f6kningsl\u00e4ge aktiverat"],"Preview mobile":["F\u00f6rhandsgranska mobil"],"Preview tablet":["F\u00f6rhandsgranska surfplatta"],"Preview desktop":["F\u00f6rhandsgranska station\u00e4r dator"],"Elementor Tools":["Elementor-verktyg"],"Take note of the old and new URLs below, then head over to the Elementor Tools area to replace them.":[""],"Begin Import":["Starta import"],"I understand":["Jag f\u00f6rst\u00e5r"],"Confirm Import":["Bekr\u00e4fta import"],"Import Demo Content":["Importera demoinneh\u00e5ll"],"This will install and activate needed plugins, import demo content, and import site options.":["Detta kommer att installera och aktivera n\u00f6dv\u00e4ndiga till\u00e4gg, importera demo-inneh\u00e5ll och importera webbplatsalternativ."],"Import Theme Options":["Importera temaalternativ"],"This will import the options from the Customizer.":["Detta importerar alternativen fr\u00e5n anpassaren."],"These plugins need to be installed manually.":["Dessa till\u00e4gg m\u00e5ste installeras manuellt."],"These plugins are already installed.":["Dessa till\u00e4gg \u00e4r redan installerade."],"These plugins can be installed automatically.":["Dessa till\u00e4gg kan installeras automatiskt."],"Gathering information":["Samlar information"],"Refresh sites":["Uppdatera webbplatser"],"Requires GP Premium %s.":["Kr\u00e4ver GP Premium %s."],"Page Builder":["Sidbyggare"],"Category":["Kategori"],"No thanks":["Nej tack"],"Remove imported site":["Ta bort importerad webbplats"],"This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.":["Denna process g\u00f6r \u00e4ndringar p\u00e5 din webbplats. Om den inneh\u00e5ller viktiga data f\u00f6resl\u00e5r vi att du s\u00e4kerhetskopierar den innan du forts\u00e4tter."],"Try again":["F\u00f6rs\u00f6k igen"],"No sites were found.":["Inga webbplatser hittades."],"Restoring content":["\u00c5terst\u00e4ller inneh\u00e5ll"],"Installing %s":["Installerar %s"],"Import Complete":["Import slutf\u00f6rd"],"Importing theme options":["Importerar temaalternativ"],"Why?":["Varf\u00f6r?"],"This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.":["Denna process \u00e5terst\u00e4ller dina f\u00f6reg\u00e5ende alternativ, widgetar och aktiva till\u00e4gg. Det tar ocks\u00e5 bort ditt importerade inneh\u00e5ll och CSS."],"It is highly recommended that you remove the last site you imported before importing a new one.":["Det rekommenderas starkt att du tar bort den senaste webbplatsen du importerade innan du importerar en ny."],"Existing Site Import Detected":["Befintlig webbplatsimport uppt\u00e4ckt"],"Restoring theme options":["\u00c5terst\u00e4ller temalternativ"],"New URL":["Ny URL"],"Old URL":["Gammal URL"],"This site is using Elementor which means you will want to replace the imported image URLs.":["Denna webbplats anv\u00e4nder Elementor vilket inneb\u00e4r att du beh\u00f6ver ers\u00e4tta de importerade bild-URL:erna."],"Additional Cleanup":["Ytterligare upprensning"],"This site uses the following plugins.":["Denna webbplats anv\u00e4nder f\u00f6ljande till\u00e4gg."],"All":["Alla"],"View Site":["Visa webbplats"],"Get Started":["Komma ig\u00e5ng"],"Plugins":["Till\u00e4gg"],"Installing plugins":["Installerar till\u00e4gg"],"Activating plugins":["Aktiverar till\u00e4gg"],"Importing widgets":["Importerar widgetar"],"Importing site options":["Importerar webbplatsalternativ"],"Importing content":["Importerar inneh\u00e5ll"],"None":["Ingen"],"Import":["Importera"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-cbab080b0f20fd6c323029398be6c986.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-cbab080b0f20fd6c323029398be6c986.json deleted file mode 100644 index 4bad3bc6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-cbab080b0f20fd6c323029398be6c986.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-01 13:13:24+0000","generator":"WP-CLI\/2.6.0","source":"dist\/dashboard.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"sv_SE","plural-forms":"nplurals=2; plural=n != 1;"},"This will delete all of your customizer settings. It cannot be undone.":["Detta kommer ta bort alla dina anpassningsinst\u00e4llningar. Det kan inte \u00e5ngras."],"Reset your customizer settings.":["\u00c5terst\u00e4ll dina inst\u00e4llningar f\u00f6r anpassaren."],"Options imported.":["Alternativ importerade."],"This can overwrite existing settings and cannot be undone.":["Detta kan skriva \u00f6ver befintliga inst\u00e4llningar och kan inte \u00e5ngras."],"Import your customizer settings.":["Importera dina inst\u00e4llningar f\u00f6r anpassaren."],"Global Colors":["Globala f\u00e4rger"],"Export your customizer settings.":["Exportera dina inst\u00e4llningar f\u00f6r anpassaren."],"Import \/ Export":["Import\/export"],"License key deactivated.":["Licensnyckel inaktiverad."],"License key activated.":["Licensnyckel aktiverad."],"Get alpha and beta updates directly to your Dashboard.":[""],"Enter your license key to activate updates.":["Ange din licensnyckel f\u00f6r att aktivera uppdateringar."],"Not receiving premium updates.":["Tar inte emot premiumuppdateringar."],"Receiving premium updates.":["Tar emot premiumuppdateringar."],"Options exported":["Alternativ exporterad"],"This will delete all settings for this module. It cannot be undone.":["Detta kommer ta bort alla inst\u00e4llningar f\u00f6r denna modul. Det kan inte \u00e5ngras."],"Open tools for this module.":["\u00d6ppna verktyg f\u00f6r denna modul."],"Open Elements":["\u00d6ppna element"],"Open Site Library":["\u00d6ppna webbplatsbibliotek"],"Settings reset.":["Inst\u00e4llningar \u00e5terst\u00e4lls."],"Typography":["Typografi"],"All":["Alla"],"Reset":["\u00c5terst\u00e4ll"],"Modules":["Moduler"],"License Key":["Licensnyckel"],"Deactivate":["Inaktivera"],"Activate":["Aktivera"],"This module has been deprecated. Deactivating it will remove it from this list.":["Denna modul har tagits ur bruk. Vid inaktivering kommer den att tas bort fr\u00e5n denna lista."],"Import":["Importera"],"Export":["Exportera"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-ecf9f3c2af10c4f2dfbf4f42504922d1.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-ecf9f3c2af10c4f2dfbf4f42504922d1.json deleted file mode 100644 index f7a81aff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE-ecf9f3c2af10c4f2dfbf4f42504922d1.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2022-10-01 13:13:24+0000","generator":"WP-CLI\/2.6.0","source":"dist\/customizer.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"sv_SE","plural-forms":"nplurals=2; plural=n != 1;"},"Related\/Upsell Product Titles":["Produktrubriker f\u00f6r relaterad\/merf\u00f6rs\u00e4ljning"],"Catalog Product Titles":[""],"Off-Canvas Sub-Menu Items":[""],"Off-Canvas Menu Items":[""],"Secondary Mobile Menu Toggle":[""],"Secondary Sub-Menu Items":[""],"Secondary Menu Items":["Sekund\u00e4ra menyalternativ"],"Off-Canvas Panel":[""],"WooCommerce":["WooCommerce"],"Secondary Navigation":["Sekund\u00e4r navigation"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE.mo deleted file mode 100644 index 2452b734..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-sv_SE.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-uk.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-uk.mo deleted file mode 100644 index 007659aa..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-uk.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-vi.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-vi.mo deleted file mode 100644 index 1838e84d..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-vi.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-zh_CN.mo b/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-zh_CN.mo deleted file mode 100644 index cf5a1f2d..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/langs/gp-premium-zh_CN.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/alpha-color-picker/wp-color-picker-alpha.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/alpha-color-picker/wp-color-picker-alpha.js deleted file mode 100644 index bd407429..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/alpha-color-picker/wp-color-picker-alpha.js +++ /dev/null @@ -1,635 +0,0 @@ -/**! - * wp-color-picker-alpha - * - * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker - * Only run in input and is defined data alpha in true - * - * Version: 3.0.0 - * https://github.com/kallookoo/wp-color-picker-alpha - * Licensed under the GPLv2 license or later. - */ - -( function( $, undef ) { - - var wpColorPickerAlpha = { - 'version' : 300 - }; - - // Always try to use the last version of this script. - if ( 'wpColorPickerAlpha' in window && 'version' in window.wpColorPickerAlpha ) { - var version = parseInt( window.wpColorPickerAlpha.version, 10 ); - if ( ! isNaN( version ) && version >= wpColorPickerAlpha.version ) { - return; - } - } - - // Prevent multiple initiations - if ( Color.fn.hasOwnProperty( 'to_s' ) ) { - return; - } - - // Create new method to replace the `Color.toString()` inside the scripts. - Color.fn.to_s = function( type ) { - type = ( type || 'hex' ); - // Change hex to rgba to return the correct color. - if ( 'hex' === type && this._alpha < 1 ) { - type = 'rgba'; - } - - var color = ''; - if ( 'hex' === type ) { - color = this.toString(); - } else if ( ! this.error ) { - color = this.toCSS( type ).replace( /\(\s+/, '(' ).replace( /\s+\)/, ')' ); - } - return color; - } - - // Register the global variable. - window.wpColorPickerAlpha = wpColorPickerAlpha; - - // Background image encoded - var backgroundImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg=='; - - /** - * Iris - */ - $.widget( 'a8c.iris', $.a8c.iris, { - /** - * Alpha options - * - * @since 3.0.0 - * - * @type {Object} - */ - alphaOptions: { - alphaEnabled: false, - }, - /** - * Get the current color or the new color. - * - * @since 3.0.0 - * @access private - * - * @param {Object|*} The color instance if not defined return the cuurent color. - * - * @return {string} The element's color. - */ - _getColor: function( color ) { - if ( color === undef ) { - color = this._color; - } - - if ( this.alphaOptions.alphaEnabled ) { - color = color.to_s( this.alphaOptions.alphaColorType ); - if ( ! this.alphaOptions.alphaColorWithSpace ) { - color = color.replace( /\s+/g, '' ); - } - return color; - } - return color.toString(); - }, - /** - * Create widget - * - * @since 3.0.0 - * @access private - * - * @return {void} - */ - _create: function() { - try { - // Try to get the wpColorPicker alpha options. - this.alphaOptions = this.element.wpColorPicker( 'instance' ).alphaOptions; - } catch( e ) {} - - // We make sure there are all options - $.extend( {}, this.alphaOptions, { - alphaEnabled: false, - alphaCustomWidth: 130, - alphaReset: false, - alphaColorType: 'hex', - alphaColorWithSpace: false, - } ); - - this._super(); - }, - /** - * Binds event listeners to the Iris. - * - * @since 3.0.0 - * @access private - * - * @return {void} - */ - _addInputListeners: function( input ) { - var self = this, - debounceTimeout = 100, - callback = function( event ){ - var val = input.val(), - color = new Color( val ), - val = val.replace( /^(#|(rgb|hsl)a?)/, '' ), - type = self.alphaOptions.alphaColorType; - - input.removeClass( 'iris-error' ); - - if ( ! color.error ) { - // let's not do this on keyup for hex shortcodes - if ( 'hex' !== type || ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) { - // Compare color ( #AARRGGBB ) - if ( color.toIEOctoHex() !== self._color.toIEOctoHex() ) { - self._setOption( 'color', self._getColor( color ) ); - } - } - } else if ( val !== '' ) { - input.addClass( 'iris-error' ); - } - }; - - input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) ); - - // If we initialized hidden, show on first focus. The rest is up to you. - if ( self.options.hide ) { - input.one( 'focus', function() { - self.show(); - }); - } - }, - /** - * Init Controls - * - * @since 3.0.0 - * @access private - * - * @return {void} - */ - _initControls: function() { - this._super(); - - if ( this.alphaOptions.alphaEnabled ) { - // Create Alpha controls - var self = this, - stripAlpha = self.controls.strip.clone(false, false), - stripAlphaSlider = stripAlpha.find( '.iris-slider-offset' ), - controls = { - stripAlpha : stripAlpha, - stripAlphaSlider : stripAlphaSlider - }; - - stripAlpha.addClass( 'iris-strip-alpha' ); - stripAlphaSlider.addClass( 'iris-slider-offset-alpha' ); - stripAlpha.appendTo( self.picker.find( '.iris-picker-inner' ) ); - - // Push new controls - $.each( controls, function( k, v ) { - self.controls[k] = v; - } ); - - // Create slider - self.controls.stripAlphaSlider.slider( { - orientation : 'vertical', - min : 0, - max : 100, - step : 1, - value : parseInt( self._color._alpha * 100 ), - slide : function( event, ui ) { - self.active = 'strip'; - // Update alpha value - self._color._alpha = parseFloat( ui.value / 100 ); - self._change.apply( self, arguments ); - } - } ); - } - }, - /** - * Create the controls sizes - * - * @since 3.0.0 - * @access private - * - * @param {bool} reset Set to True for recreate the controls sizes. - * - * @return {void} - */ - _dimensions: function( reset ) { - this._super( reset ); - - if ( this.alphaOptions.alphaEnabled ) { - var self = this, - opts = self.options, - controls = self.controls, - square = controls.square, - strip = self.picker.find( '.iris-strip' ), - innerWidth, squareWidth, stripWidth, stripMargin, totalWidth; - - /** - * I use Math.round() to avoid possible size errors, - * this function returns the value of a number rounded - * to the nearest integer. - * - * The width to append all widgets, - * if border is enabled, 22 is subtracted. - * 20 for css left and right property - * 2 for css border - */ - innerWidth = Math.round( self.picker.outerWidth( true ) - ( opts.border ? 22 : 0 ) ); - // The width of the draggable, aka square. - squareWidth = Math.round( square.outerWidth() ); - // The width for the sliders - stripWidth = Math.round( ( innerWidth - squareWidth ) / 2 ); - // The margin for the sliders - stripMargin = Math.round( stripWidth / 2 ); - // The total width of the elements. - totalWidth = Math.round( squareWidth + ( stripWidth * 2 ) + ( stripMargin * 2 ) ); - - // Check and change if necessary. - while ( totalWidth > innerWidth ) { - stripWidth = Math.round( stripWidth - 2 ); - stripMargin = Math.round( stripMargin - 1 ); - totalWidth = Math.round( squareWidth + ( stripWidth * 2 ) + ( stripMargin * 2 ) ); - } - - - square.css( 'margin', '0' ); - strip.width( stripWidth ).css( 'margin-left', stripMargin + 'px' ); - } - }, - /** - * Callback to update the controls and the current color. - * - * @since 3.0.0 - * @access private - * - * @return {void} - */ - _change: function() { - var self = this, - active = self.active; - - self._super(); - - if ( self.alphaOptions.alphaEnabled ) { - var controls = self.controls, - alpha = parseInt( self._color._alpha * 100 ), - color = self._color.toRgb(), - gradient = [ - 'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%', - 'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%' - ], - target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' ); - - self.options.color = self._getColor(); - // Generate background slider alpha, only for CSS3. - controls.stripAlpha.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + backgroundImage + ')' } ); - // Update alpha value - if ( active ) { - controls.stripAlphaSlider.slider( 'value', alpha ); - } - - if ( ! self._color.error ) { - self.element.removeClass( 'iris-error' ).val( self.options.color ); - } - - self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() { - var color = $( this ).data( 'color' ); - if ( self.alphaOptions.alphaReset ) { - self._color._alpha = 1; - color = self._getColor(); - } - self._setOption( 'color', color ); - } ); - } - }, - /** - * Paint dimensions. - * - * @since 3.0.0 - * @access private - * - * @param {string} origin Origin (position). - * @param {string} control Type of the control, - * - * @return {void} - */ - _paintDimension: function( origin, control ) { - var self = this, - color = false; - - // Fix for slider hue opacity. - if ( self.alphaOptions.alphaEnabled && 'strip' === control ) { - color = self._color; - self._color = new Color( color.toString() ); - self.hue = self._color.h(); - } - - self._super( origin, control ); - - // Restore the color after paint. - if ( color ) { - self._color = color; - } - }, - /** - * To update the options, see original source to view the available options. - * - * @since 3.0.0 - * - * @param {string} key The Option name. - * @param {mixed} value The Option value to update. - * - * @return {void} - */ - _setOption: function( key, value ) { - var self = this; - if ( 'color' === key && self.alphaOptions.alphaEnabled ) { - // cast to string in case we have a number - value = '' + value; - newColor = new Color( value ).setHSpace( self.options.mode ); - // Check if error && Check the color to prevent callbacks with the same color. - if ( ! newColor.error && self._getColor( newColor ) !== self._getColor() ) { - self._color = newColor; - self.options.color = self._getColor(); - self.active = 'external'; - self._change(); - } - } else { - return self._super( key, value ); - } - }, - /** - * Returns the iris object if no new color is provided. If a new color is provided, it sets the new color. - * - * @param newColor {string|*} The new color to use. Can be undefined. - * - * @since 3.0.0 - * - * @return {string} The element's color. - */ - color: function( newColor ) { - if ( newColor === true ) { - return this._color.clone(); - } - if ( newColor === undef ) { - return this._getColor(); - } - this.option( 'color', newColor ); - }, - } ); - - /** - * wpColorPicker - */ - $.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, { - /** - * Alpha options - * - * @since 3.0.0 - * - * @type {Object} - */ - alphaOptions: { - alphaEnabled: false, - }, - /** - * Get the alpha options. - * - * @since 3.0.0 - * @access private - * - * @return {object} The current alpha options. - */ - _getAlphaOptions: function() { - var el = this.element, - type = ( el.data( 'type' ) || this.options.type ), - color = ( el.data( 'defaultColor' ) || el.val() ), - options = { - alphaEnabled: ( el.data( 'alphaEnabled' ) || false ), - alphaCustomWidth: 130, - alphaReset: false, - alphaColorType: 'rgb', - alphaColorWithSpace: false, - }; - - if ( options.alphaEnabled ) { - options.alphaEnabled = ( el.is( 'input' ) && 'full' === type ); - } - - if ( ! options.alphaEnabled ) { - return options; - } - - options.alphaColorWithSpace = ( color && color.match( /\s/ ) ); - - $.each( options, function( name, defaultValue ) { - var value = ( el.data( name ) || defaultValue ); - switch ( name ) { - case 'alphaCustomWidth': - value = ( value ? parseInt( value, 10 ) : 0 ); - value = ( isNaN( value ) ? defaultValue : value ); - break; - case 'alphaColorType': - if ( ! value.match( /^(hex|(rgb|hsl)a?)$/ ) ) { - if ( color && color.match( /^#/ ) ) { - value = 'hex'; - } else if ( color && color.match( /^hsla?/ ) ) { - value = 'hsl'; - } else { - value = defaultValue; - } - } - break; - default: - value = !!value; - break; - } - options[name] = value; - } ); - - return options; - }, - /** - * Create widget - * - * @since 3.0.0 - * @access private - * - * @return {void} - */ - _create: function() { - // Return early if Iris support is missing. - if ( ! $.support.iris ) { - return; - } - - // Set the alpha options for the current instance. - this.alphaOptions = this._getAlphaOptions(); - - // Create widget. - this._super(); - }, - /** - * Binds event listeners to the color picker and create options, etc... - * - * @since 3.0.0 - * @access private - * - * @return {void} - */ - _addListeners: function() { - if ( ! this.alphaOptions.alphaEnabled ) { - return this._super(); - } - - var self = this, - el = self.element, - isDeprecated = self.toggler.is( 'a' ); - - this.alphaOptions.defaultWidth = el.width(); - if ( this.alphaOptions.alphaCustomWidth ) { - el.width( parseInt( this.alphaOptions.defaultWidth + this.alphaOptions.alphaCustomWidth, 10 ) ); - } - - self.toggler.css( { - 'position': 'relative', - 'background-image' : 'url(' + backgroundImage + ')' - } ); - - if ( isDeprecated ) { - self.toggler.html( '' ); - } else { - self.toggler.append( '' ); - } - - self.colorAlpha = self.toggler.find( 'span.color-alpha' ).css( { - 'width' : '30px', - 'height' : '100%', - 'position' : 'absolute', - 'top' : 0, - 'background-color' : el.val(), - } ); - - // Define the correct position for ltr or rtl direction. - if ( 'ltr' === self.colorAlpha.css( 'direction' ) ) { - self.colorAlpha.css( { - 'border-bottom-left-radius' : '2px', - 'border-top-left-radius' : '2px', - 'left' : 0 - } ); - } else { - self.colorAlpha.css( { - 'border-bottom-right-radius' : '2px', - 'border-top-right-radius' : '2px', - 'right' : 0 - } ); - } - - - el.iris( { - /** - * @summary Handles the onChange event if one has been defined in the options. - * - * Handles the onChange event if one has been defined in the options and additionally - * sets the background color for the toggler element. - * - * @since 3.0.0 - * - * @param {Event} event The event that's being called. - * @param {HTMLElement} ui The HTMLElement containing the color picker. - * - * @returns {void} - */ - change: function( event, ui ) { - self.colorAlpha.css( { 'background-color': ui.color.to_s( self.alphaOptions.alphaColorType ) } ); - - // fire change callback if we have one - if ( $.isFunction( self.options.change ) ) { - self.options.change.call( this, event, ui ); - } - } - } ); - - - /** - * Prevent any clicks inside this widget from leaking to the top and closing it. - * - * @since 3.0.0 - * - * @param {Event} event The event that's being called. - * - * @return {void} - */ - self.wrap.on( 'click.wpcolorpicker', function( event ) { - event.stopPropagation(); - }); - - /** - * Open or close the color picker depending on the class. - * - * @since 3.0.0 - */ - self.toggler.click( function() { - if ( self.toggler.hasClass( 'wp-picker-open' ) ) { - self.close(); - } else { - self.open(); - } - }); - - /** - * Checks if value is empty when changing the color in the color picker. - * If so, the background color is cleared. - * - * @since 3.0.0 - * - * @param {Event} event The event that's being called. - * - * @return {void} - */ - el.change( function( event ) { - var val = $( this ).val(); - - if ( el.hasClass( 'iris-error' ) || val === '' || val.match( /^(#|(rgb|hsl)a?)$/ ) ) { - if ( isDeprecated ) { - self.toggler.removeAttr( 'style' ); - } - - self.colorAlpha.css( 'background-color', '' ); - - // fire clear callback if we have one - if ( $.isFunction( self.options.clear ) ) { - self.options.clear.call( this, event ); - } - } - } ); - - /** - * Enables the user to either clear the color in the color picker or revert back to the default color. - * - * @since 3.0.0 - * - * @param {Event} event The event that's being called. - * - * @return {void} - */ - self.button.click( function( event ) { - if ( $( this ).hasClass( 'wp-picker-default' ) ) { - el.val( self.options.defaultColor ).change(); - } else if ( $( this ).hasClass( 'wp-picker-clear' ) ) { - el.val( '' ); - if ( isDeprecated ) { - self.toggler.removeAttr( 'style' ); - } - - self.colorAlpha.css( 'background-color', '' ); - - // fire clear callback if we have one - if ( $.isFunction( self.options.clear ) ) { - self.options.clear.call( this, event ); - } - - el.trigger( 'change' ); - } - } ); - }, - } ); -} ( jQuery ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/alpha-color-picker/wp-color-picker-alpha.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/alpha-color-picker/wp-color-picker-alpha.min.js deleted file mode 100644 index fde8c833..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/alpha-color-picker/wp-color-picker-alpha.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/**! - * wp-color-picker-alpha - * - * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker - * Only run in input and is defined data alpha in true - * - * Version: 3.0.0 - * https://github.com/kallookoo/wp-color-picker-alpha - * Licensed under the GPLv2 license or later. - */ -!function(e,a){var l,o={version:300};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var t=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(t)&&o.version<=t)return}Color.fn.hasOwnProperty("to_s")||(Color.fn.to_s=function(o){"hex"===(o=o||"hex")&&this._alpha<1&&(o="rgba");var a="";return"hex"===o?a=this.toString():this.error||(a=this.toCSS(o).replace(/\(\s+/,"(").replace(/\s+\)/,")")),a},window.wpColorPickerAlpha=o,l="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(o){return o===a&&(o=this._color),this.alphaOptions.alphaEnabled?(o=o.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(o=o.replace(/\s+/g,"")),o):o.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(o){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(i){function o(o){var a=i.val(),t=new Color(a),a=a.replace(/^(#|(rgb|hsl)a?)/,""),r=l.alphaOptions.alphaColorType;i.removeClass("iris-error"),t.error?""!==a&&i.addClass("iris-error"):"hex"===r&&"keyup"===o.type&&a.match(/^[0-9a-fA-F]{3}$/)||t.toIEOctoHex()!==l._color.toIEOctoHex()&&l._setOption("color",l._getColor(t))}var l=this;i.on("change",o).on("keyup",l._debounce(o,100)),l.options.hide&&i.one("focus",function(){l.show()})},_initControls:function(){var t,o,a,r;this._super(),this.alphaOptions.alphaEnabled&&(a=(o=(t=this).controls.strip.clone(!1,!1)).find(".iris-slider-offset"),r={stripAlpha:o,stripAlphaSlider:a},o.addClass("iris-strip-alpha"),a.addClass("iris-slider-offset-alpha"),o.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,function(o,a){t.controls[o]=a}),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,a){t.active="strip",t._color._alpha=parseFloat(a.value/100),t._change.apply(t,arguments)}}))},_dimensions:function(o){if(this._super(o),this.alphaOptions.alphaEnabled){for(var a=this,t=a.options,r=a.controls.square,o=a.picker.find(".iris-strip"),i=Math.round(a.picker.outerWidth(!0)-(t.border?22:0)),l=Math.round(r.outerWidth()),e=Math.round((i-l)/2),s=Math.round(e/2),n=Math.round(l+2*e+2*s);i'):t.toggler.append(''),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":r.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),r.iris({change:function(o,a){t.colorAlpha.css({"background-color":a.color.to_s(t.alphaOptions.alphaColorType)}),e.isFunction(t.options.change)&&t.options.change.call(this,o,a)}}),t.wrap.on("click.wpcolorpicker",function(o){o.stopPropagation()}),t.toggler.click(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()}),r.change(function(o){var a=e(this).val();(r.hasClass("iris-error")||""===a||a.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o))}),t.button.click(function(o){e(this).hasClass("wp-picker-default")?r.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(r.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o),r.trigger("change"))})}}))}(jQuery); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/class-make-css.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/class-make-css.php deleted file mode 100644 index 19876b27..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/class-make-css.php +++ /dev/null @@ -1,202 +0,0 @@ -_selector !== '' ){ - $this->add_selector_rules_to_output(); - } - $this->_selector = $selector; - return $this; - } - - /** - * Adds a css property with value to the css output - * - * @access public - * @since 1.0 - * - * @param string $property - the css property - * @param string $value - the value to be placed with the property - * @param string $og_default - check to see if the value matches the default - * @param string $unit - the unit for the value (px) - * @return $this - */ - public function add_property( $property, $value, $og_default = false, $unit = false ) { - // Add our unit to our value if it exists - if ( $unit && '' !== $unit ) { - $value = $value . $unit; - if ( '' !== $og_default ) { - $og_default = $og_default . $unit; - } - } - - // If we don't have a value or our value is the same as our og default, bail - if ( empty( $value ) || $og_default == $value ) - return false; - - $this->_css .= $property . ':' . $value . ';'; - return $this; - } - - /** - * Sets a media query in the class - * - * @since 1.1 - * @param string $value - * @return $this - */ - public function start_media_query( $value ) { - // Add the current rules to the output - $this->add_selector_rules_to_output(); - - // Add any previous media queries to the output - if ( ! empty( $this->_media_query ) ) { - $this->add_media_query_rules_to_output(); - } - - // Set the new media query - $this->_media_query = $value; - return $this; - } - - /** - * Stops using a media query. - * - * @see start_media_query() - * - * @since 1.1 - * @return $this - */ - public function stop_media_query() { - return $this->start_media_query( null ); - } - - /** - * Adds the current media query's rules to the class' output variable - * - * @since 1.1 - * @return $this - */ - private function add_media_query_rules_to_output() { - if( !empty( $this->_media_query_output ) ) { - $this->_output .= sprintf( '@media %1$s{%2$s}', $this->_media_query, $this->_media_query_output ); - - // Reset the media query output string - $this->_media_query_output = ''; - } - return $this; - } - - /** - * Adds the current selector rules to the output variable - * - * @access private - * @since 1.0 - * - * @return $this - */ - private function add_selector_rules_to_output() { - if( !empty( $this->_css ) ) { - $this->_selector_output = $this->_selector; - $selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css ); - - // Add our CSS to the output - if ( ! empty( $this->_media_query ) ) { - $this->_media_query_output .= $selector_output; - $this->_css = ''; - } else { - $this->_output .= $selector_output; - } - - // Reset the css - $this->_css = ''; - } - - return $this; - } - - /** - * Returns the minified css in the $_output variable - * - * @access public - * @since 1.0 - * - * @return string - */ - public function css_output() - { - // Add current selector's rules to output - $this->add_selector_rules_to_output(); - - // Output minified css - return $this->_output; - } - -} -endif; diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/class-plugin-updater.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/class-plugin-updater.php deleted file mode 100644 index 42fb1e09..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/class-plugin-updater.php +++ /dev/null @@ -1,676 +0,0 @@ -api_url = trailingslashit( $_api_url ); - $this->api_data = $_api_data; - $this->plugin_file = $_plugin_file; - $this->name = plugin_basename( $_plugin_file ); - $this->slug = basename( $_plugin_file, '.php' ); - $this->version = $_api_data['version']; - $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false; - $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; - $this->failed_request_cache_key = 'edd_sl_failed_http_' . md5( $this->api_url ); - - $edd_plugin_data[ $this->slug ] = $this->api_data; - - /** - * Fires after the $edd_plugin_data is setup. - * - * @since x.x.x - * - * @param array $edd_plugin_data Array of EDD SL plugin data. - */ - do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data ); - - // Set up hooks. - $this->init(); - - } - - /** - * Set up WordPress filters to hook into WP's update process. - * - * @uses add_filter() - * - * @return void - */ - public function init() { - - add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) ); - add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 ); - add_action( 'after_plugin_row', array( $this, 'show_update_notification' ), 10, 2 ); - add_action( 'admin_init', array( $this, 'show_changelog' ) ); - - } - - /** - * Check for Updates at the defined API endpoint and modify the update array. - * - * This function dives into the update API just when WordPress creates its update array, - * then adds a custom API call and injects the custom plugin data retrieved from the API. - * It is reassembled from parts of the native WordPress plugin update code. - * See wp-includes/update.php line 121 for the original wp_update_plugins() function. - * - * @uses api_request() - * - * @param array $_transient_data Update array build by WordPress. - * @return array Modified update array with custom plugin data. - */ - public function check_update( $_transient_data ) { - - global $pagenow; - - if ( ! is_object( $_transient_data ) ) { - $_transient_data = new stdClass(); - } - - if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { - return $_transient_data; - } - - $current = $this->get_repo_api_data(); - if ( false !== $current && is_object( $current ) && isset( $current->new_version ) ) { - if ( version_compare( $this->version, $current->new_version, '<' ) ) { - $_transient_data->response[ $this->name ] = $current; - } else { - // Populating the no_update information is required to support auto-updates in WordPress 5.5. - $_transient_data->no_update[ $this->name ] = $current; - } - } - $_transient_data->last_checked = time(); - $_transient_data->checked[ $this->name ] = $this->version; - - return $_transient_data; - } - - /** - * Get repo API data from store. - * Save to cache. - * - * @return \stdClass - */ - public function get_repo_api_data() { - $version_info = $this->get_cached_version_info(); - - if ( false === $version_info ) { - $version_info = $this->api_request( - 'plugin_latest_version', - array( - 'slug' => $this->slug, - 'beta' => $this->beta, - ) - ); - if ( ! $version_info ) { - return false; - } - - // This is required for your plugin to support auto-updates in WordPress 5.5. - $version_info->plugin = $this->name; - $version_info->id = $this->name; - $version_info->tested = $this->get_tested_version( $version_info ); - - $this->set_version_info_cache( $version_info ); - } - - return $version_info; - } - - /** - * Gets the plugin's tested version. - * - * @since 1.9.2 - * @param object $version_info - * @return null|string - */ - private function get_tested_version( $version_info ) { - - // There is no tested version. - if ( empty( $version_info->tested ) ) { - return null; - } - - // Strip off extra version data so the result is x.y or x.y.z. - list( $current_wp_version ) = explode( '-', get_bloginfo( 'version' ) ); - - // The tested version is greater than or equal to the current WP version, no need to do anything. - if ( version_compare( $version_info->tested, $current_wp_version, '>=' ) ) { - return $version_info->tested; - } - $current_version_parts = explode( '.', $current_wp_version ); - $tested_parts = explode( '.', $version_info->tested ); - - // The current WordPress version is x.y.z, so update the tested version to match it. - if ( isset( $current_version_parts[2] ) && $current_version_parts[0] === $tested_parts[0] && $current_version_parts[1] === $tested_parts[1] ) { - $tested_parts[2] = $current_version_parts[2]; - } - - return implode( '.', $tested_parts ); - } - - /** - * Show the update notification on multisite subsites. - * - * @param string $file - * @param array $plugin - */ - public function show_update_notification( $file, $plugin ) { - - // Return early if in the network admin, or if this is not a multisite install. - if ( is_network_admin() || ! is_multisite() ) { - return; - } - - // Allow single site admins to see that an update is available. - if ( ! current_user_can( 'activate_plugins' ) ) { - return; - } - - if ( $this->name !== $file ) { - return; - } - - // Do not print any message if update does not exist. - $update_cache = get_site_transient( 'update_plugins' ); - - if ( ! isset( $update_cache->response[ $this->name ] ) ) { - if ( ! is_object( $update_cache ) ) { - $update_cache = new stdClass(); - } - $update_cache->response[ $this->name ] = $this->get_repo_api_data(); - } - - // Return early if this plugin isn't in the transient->response or if the site is running the current or newer version of the plugin. - if ( empty( $update_cache->response[ $this->name ] ) || version_compare( $this->version, $update_cache->response[ $this->name ]->new_version, '>=' ) ) { - return; - } - - printf( - '', - $this->slug, - $file, - in_array( $this->name, $this->get_active_plugins(), true ) ? 'active' : 'inactive' - ); - - echo ''; - echo '

'; - - $changelog_link = ''; - if ( ! empty( $update_cache->response[ $this->name ]->sections->changelog ) ) { - $changelog_link = add_query_arg( - array( - 'edd_sl_action' => 'view_plugin_changelog', - 'plugin' => urlencode( $this->name ), - 'slug' => urlencode( $this->slug ), - 'TB_iframe' => 'true', - 'width' => 77, - 'height' => 911, - ), - self_admin_url( 'index.php' ) - ); - } - $update_link = add_query_arg( - array( - 'action' => 'upgrade-plugin', - 'plugin' => urlencode( $this->name ), - ), - self_admin_url( 'update.php' ) - ); - - printf( - /* translators: the plugin name. */ - esc_html__( 'There is a new version of %1$s available.', 'easy-digital-downloads' ), - esc_html( $plugin['Name'] ) - ); - - if ( ! current_user_can( 'update_plugins' ) ) { - echo ' '; - esc_html_e( 'Contact your network administrator to install the update.', 'easy-digital-downloads' ); - } elseif ( empty( $update_cache->response[ $this->name ]->package ) && ! empty( $changelog_link ) ) { - echo ' '; - printf( - /* translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate. */ - __( '%1$sView version %2$s details%3$s.', 'easy-digital-downloads' ), - '', - esc_html( $update_cache->response[ $this->name ]->new_version ), - '' - ); - } elseif ( ! empty( $changelog_link ) ) { - echo ' '; - printf( - __( '%1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'easy-digital-downloads' ), - '', - esc_html( $update_cache->response[ $this->name ]->new_version ), - '', - '', - '' - ); - } else { - printf( - ' %1$s%2$s%3$s', - '', - esc_html__( 'Update now.', 'easy-digital-downloads' ), - '' - ); - } - - do_action( "in_plugin_update_message-{$file}", $plugin, $plugin ); - - echo '

'; - } - - /** - * Gets the plugins active in a multisite network. - * - * @return array - */ - private function get_active_plugins() { - $active_plugins = (array) get_option( 'active_plugins' ); - $active_network_plugins = (array) get_site_option( 'active_sitewide_plugins' ); - - return array_merge( $active_plugins, array_keys( $active_network_plugins ) ); - } - - /** - * Updates information on the "View version x.x details" page with custom data. - * - * @uses api_request() - * - * @param mixed $_data - * @param string $_action - * @param object $_args - * @return object $_data - */ - public function plugins_api_filter( $_data, $_action = '', $_args = null ) { - - if ( 'plugin_information' !== $_action ) { - - return $_data; - - } - - if ( ! isset( $_args->slug ) || ( $_args->slug !== $this->slug ) ) { - - return $_data; - - } - - $to_send = array( - 'slug' => $this->slug, - 'is_ssl' => is_ssl(), - 'fields' => array( - 'banners' => array(), - 'reviews' => false, - 'icons' => array(), - ), - ); - - // Get the transient where we store the api request for this plugin for 24 hours - $edd_api_request_transient = $this->get_cached_version_info(); - - //If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now. - if ( empty( $edd_api_request_transient ) ) { - - $api_response = $this->api_request( 'plugin_information', $to_send ); - - // Expires in 3 hours - $this->set_version_info_cache( $api_response ); - - if ( false !== $api_response ) { - $_data = $api_response; - } - } else { - $_data = $edd_api_request_transient; - } - - // Convert sections into an associative array, since we're getting an object, but Core expects an array. - if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { - $_data->sections = $this->convert_object_to_array( $_data->sections ); - } - - // Convert banners into an associative array, since we're getting an object, but Core expects an array. - if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { - $_data->banners = $this->convert_object_to_array( $_data->banners ); - } - - // Convert icons into an associative array, since we're getting an object, but Core expects an array. - if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) { - $_data->icons = $this->convert_object_to_array( $_data->icons ); - } - - // Convert contributors into an associative array, since we're getting an object, but Core expects an array. - if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) { - $_data->contributors = $this->convert_object_to_array( $_data->contributors ); - } - - if ( ! isset( $_data->plugin ) ) { - $_data->plugin = $this->name; - } - - return $_data; - } - - /** - * Convert some objects to arrays when injecting data into the update API - * - * Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON - * decoding, they are objects. This method allows us to pass in the object and return an associative array. - * - * @since 3.6.5 - * - * @param stdClass $data - * - * @return array - */ - private function convert_object_to_array( $data ) { - if ( ! is_array( $data ) && ! is_object( $data ) ) { - return array(); - } - $new_data = array(); - foreach ( $data as $key => $value ) { - $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value; - } - - return $new_data; - } - - /** - * Disable SSL verification in order to prevent download update failures - * - * @param array $args - * @param string $url - * @return object $array - */ - public function http_request_args( $args, $url ) { - - if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) { - $args['sslverify'] = $this->verify_ssl(); - } - return $args; - - } - - /** - * Calls the API and, if successfull, returns the object delivered by the API. - * - * @uses get_bloginfo() - * @uses wp_remote_post() - * @uses is_wp_error() - * - * @param string $_action The requested action. - * @param array $_data Parameters for the API action. - * @return false|object|void - */ - private function api_request( $_action, $_data ) { - $data = array_merge( $this->api_data, $_data ); - - if ( $data['slug'] !== $this->slug ) { - return; - } - - // Don't allow a plugin to ping itself - if ( trailingslashit( home_url() ) === $this->api_url ) { - return false; - } - - if ( $this->request_recently_failed() ) { - return false; - } - - return $this->get_version_from_remote(); - } - - /** - * Determines if a request has recently failed. - * - * @since 1.9.1 - * - * @return bool - */ - private function request_recently_failed() { - $failed_request_details = get_option( $this->failed_request_cache_key ); - - // Request has never failed. - if ( empty( $failed_request_details ) || ! is_numeric( $failed_request_details ) ) { - return false; - } - - /* - * Request previously failed, but the timeout has expired. - * This means we're allowed to try again. - */ - if ( time() > $failed_request_details ) { - delete_option( $this->failed_request_cache_key ); - - return false; - } - - return true; - } - - /** - * Logs a failed HTTP request for this API URL. - * We set a timestamp for 1 hour from now. This prevents future API requests from being - * made to this domain for 1 hour. Once the timestamp is in the past, API requests - * will be allowed again. This way if the site is down for some reason we don't bombard - * it with failed API requests. - * - * @see EDD_SL_Plugin_Updater::request_recently_failed - * - * @since 1.9.1 - */ - private function log_failed_request() { - update_option( $this->failed_request_cache_key, strtotime( '+1 hour' ) ); - } - - /** - * If available, show the changelog for sites in a multisite install. - */ - public function show_changelog() { - - if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { - return; - } - - if ( empty( $_REQUEST['plugin'] ) ) { - return; - } - - if ( empty( $_REQUEST['slug'] ) || $this->slug !== $_REQUEST['slug'] ) { - return; - } - - if ( ! current_user_can( 'update_plugins' ) ) { - wp_die( esc_html__( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $version_info = $this->get_repo_api_data(); - if ( isset( $version_info->sections ) ) { - $sections = $this->convert_object_to_array( $version_info->sections ); - if ( ! empty( $sections['changelog'] ) ) { - echo '
' . wp_kses_post( $sections['changelog'] ) . '
'; - } - } - - exit; - } - - /** - * Gets the current version information from the remote site. - * - * @return array|false - */ - private function get_version_from_remote() { - $api_params = array( - 'edd_action' => 'get_version', - 'license' => ! empty( $this->api_data['license'] ) ? $this->api_data['license'] : '', - 'item_name' => isset( $this->api_data['item_name'] ) ? $this->api_data['item_name'] : false, - 'item_id' => isset( $this->api_data['item_id'] ) ? $this->api_data['item_id'] : false, - 'version' => isset( $this->api_data['version'] ) ? $this->api_data['version'] : false, - 'slug' => $this->slug, - 'author' => $this->api_data['author'], - 'url' => home_url(), - 'beta' => $this->beta, - 'php_version' => phpversion(), - 'wp_version' => get_bloginfo( 'version' ), - ); - - /** - * Filters the parameters sent in the API request. - * - * @param array $api_params The array of data sent in the request. - * @param array $this->api_data The array of data set up in the class constructor. - * @param string $this->plugin_file The full path and filename of the file. - */ - $api_params = apply_filters( 'edd_sl_plugin_updater_api_params', $api_params, $this->api_data, $this->plugin_file ); - - $request = wp_remote_post( - $this->api_url, - array( - 'timeout' => 15, - 'sslverify' => $this->verify_ssl(), - 'body' => $api_params, - ) - ); - - if ( is_wp_error( $request ) || ( 200 !== wp_remote_retrieve_response_code( $request ) ) ) { - $this->log_failed_request(); - - return false; - } - - $request = json_decode( wp_remote_retrieve_body( $request ) ); - - if ( $request && isset( $request->sections ) ) { - $request->sections = maybe_unserialize( $request->sections ); - } else { - $request = false; - } - - if ( $request && isset( $request->banners ) ) { - $request->banners = maybe_unserialize( $request->banners ); - } - - if ( $request && isset( $request->icons ) ) { - $request->icons = maybe_unserialize( $request->icons ); - } - - if ( ! empty( $request->sections ) ) { - foreach ( $request->sections as $key => $section ) { - $request->$key = (array) $section; - } - } - - return $request; - } - - /** - * Get the version info from the cache, if it exists. - * - * @param string $cache_key - * @return object - */ - public function get_cached_version_info( $cache_key = '' ) { - - if ( empty( $cache_key ) ) { - $cache_key = $this->get_cache_key(); - } - - $cache = get_option( $cache_key ); - - // Cache is expired - if ( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) { - return false; - } - - // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point. - $cache['value'] = json_decode( $cache['value'] ); - if ( ! empty( $cache['value']->icons ) ) { - $cache['value']->icons = (array) $cache['value']->icons; - } - - return $cache['value']; - - } - - /** - * Adds the plugin version information to the database. - * - * @param string $value - * @param string $cache_key - */ - public function set_version_info_cache( $value = '', $cache_key = '' ) { - - if ( empty( $cache_key ) ) { - $cache_key = $this->get_cache_key(); - } - - $data = array( - 'timeout' => strtotime( '+3 hours', time() ), - 'value' => wp_json_encode( $value ), - ); - - update_option( $cache_key, $data, 'no' ); - - // Delete the duplicate option - delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) ); - } - - /** - * Returns if the SSL of the store should be verified. - * - * @since 1.6.13 - * @return bool - */ - private function verify_ssl() { - return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this ); - } - - /** - * Gets the unique key (option name) for a plugin. - * - * @since 1.9.0 - * @return string - */ - private function get_cache_key() { - $string = $this->slug . $this->api_data['license'] . $this->beta; - - return 'edd_sl_' . md5( serialize( $string ) ); - } - -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer-helpers.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer-helpers.php deleted file mode 100644 index 7bdb8f16..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer-helpers.php +++ /dev/null @@ -1,531 +0,0 @@ - wp_create_nonce( 'gp_customize_nonce' ) ) ); - wp_localize_script( 'generatepress-pro-typography-customizer', 'typography_defaults', generate_typography_default_fonts() ); - wp_localize_script( - 'generatepress-pro-typography-customizer', - 'generatePressTypography', - array( - 'googleFonts' => apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts( $number_of_fonts ) ) - ) - ); - } - - wp_enqueue_script( 'generatepress-pro-customizer-controls', plugin_dir_url( __FILE__ ) . 'customizer/controls/js/generatepress-controls.js', array( 'customize-controls', 'jquery' ), GP_PREMIUM_VERSION, true ); - - $overlay_defaults = apply_filters( 'generate_off_canvas_overlay_style_defaults', array( - 'backgroundColor' => 'rgba(10,10,10,0.95)', - 'textColor' => '#ffffff', - 'backgroundHoverColor' => 'rgba(0,0,0,0)', - 'backgroundCurrentColor' => 'rgba(0,0,0,0)', - 'subMenuBackgroundColor' => 'rgba(0,0,0,0)', - 'subMenuTextColor' => '#ffffff', - 'subMenuBackgroundHoverColor' => 'rgba(0,0,0,0)', - 'subMenuBackgroundCurrentColor' => 'rgba(0,0,0,0)', - 'fontWeight' => 200, - 'fontSize' => 25, - ) ); - - wp_localize_script( - 'gp-button-actions', - 'gpButtonActions', - array( - 'warning' => esc_html__( 'This will design your overlay by changing options in the Customizer for you. Once saved, this can not be undone.', 'gp-premium' ), - 'styling' => $overlay_defaults, - ) - ); - - $controls_a11y = array( - 'fontSizeLabel' => esc_html__( 'Font size', 'gp-premium' ), - 'mobileHeaderFontSizeLabel' => esc_html__( 'Mobile header font size', 'gp-premium' ), - ); - - if ( function_exists( 'generate_get_default_fonts' ) ) { - $font_defaults = generate_get_default_fonts(); - - $controls_a11y['siteTitleFontSize'] = $font_defaults['site_title_font_size']; - $controls_a11y['mobileSiteTitleFontSize'] = $font_defaults['mobile_site_title_font_size']; - } - - if ( function_exists( 'generate_get_color_defaults' ) ) { - $color_defaults = generate_get_color_defaults(); - - $controls_a11y['navigationTextColor'] = $color_defaults['navigation_text_color']; - $controls_a11y['siteTitleTextColor'] = $color_defaults['site_title_color']; - } - - if ( function_exists( 'generate_get_defaults' ) ) { - $defaults = generate_get_defaults(); - - $controls_a11y['navigationAlignment'] = $defaults['nav_alignment_setting']; - } - - wp_localize_script( - 'generatepress-pro-customizer-controls', - 'gpControls', - $controls_a11y - ); - - wp_enqueue_script( - 'generate-pro-customizer-controls', - GP_PREMIUM_DIR_URL . 'dist/customizer.js', - array( 'customize-controls', 'wp-i18n', 'wp-element', 'customize-base' ), - GP_PREMIUM_VERSION, - true - ); - - if ( function_exists( 'wp_set_script_translations' ) ) { - wp_set_script_translations( 'generate-pro-customizer-controls', 'gp-premium' ); - } - - wp_localize_script( - 'generate-pro-customizer-controls', - 'gpCustomizerControls', - array( - 'hasSecondaryNav' => generatepress_is_module_active( 'generate_package_secondary_nav', 'GENERATE_SECONDARY_NAV' ), - 'hasMenuPlus' => generatepress_is_module_active( 'generate_package_menu_plus', 'GENERATE_MENU_PLUS' ), - 'hasWooCommerce' => class_exists( 'WooCommerce' ) && generatepress_is_module_active( 'generate_package_woocommerce', 'GENERATE_WOOCOMMERCE' ), - ) - ); -} - -add_action( 'customize_register', 'generate_premium_customizer_shortcut_controls', 100 ); -/** - * Add shortcuts to sections we don't control in this plugin. - * - * @since 1.8 - */ -function generate_premium_customizer_shortcut_controls( $wp_customize ) { - if ( ! class_exists( 'WP_Customize_Panel' ) ) { - return; - } - - if ( ! $wp_customize->get_panel( 'generate_layout_panel' ) ) { - return; - } - - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_header_layout_shortcuts', - array( - 'section' => 'generate_layout_header', - 'element' => __( 'Header', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'header_color_section', - 'typography' => 'font_header_section', - 'backgrounds' => 'generate_backgrounds_header', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_primary_navigation_layout_shortcuts', - array( - 'section' => 'generate_layout_navigation', - 'element' => __( 'Primary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'navigation_color_section', - 'typography' => 'font_navigation_section', - 'backgrounds' => 'generate_backgrounds_navigation', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - if ( $wp_customize->get_control( 'blogname' ) ) { - $wp_customize->get_control( 'generate_settings[container_width]' )->priority = 1; - } - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_content_layout_shortcuts', - array( - 'section' => 'generate_layout_container', - 'element' => __( 'Content', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'content_color_section', - 'typography' => 'font_content_section', - 'backgrounds' => 'generate_backgrounds_content', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_sidebar_layout_shortcuts', - array( - 'section' => 'generate_layout_sidebars', - 'element' => __( 'Sidebar', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'sidebar_widget_color_section', - 'typography' => 'font_widget_section', - 'backgrounds' => 'generate_backgrounds_sidebars', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_footer_layout_shortcuts', - array( - 'section' => 'generate_layout_footer', - 'element' => __( 'Footer', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'footer_color_section', - 'typography' => 'font_footer_section', - 'backgrounds' => 'generate_backgrounds_footer', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_colors_shortcuts', - array( - 'section' => 'generate_colors_section', - 'element' => __( 'Colors', 'gp-premium' ), - 'shortcuts' => array(), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_typography_shortcuts', - array( - 'section' => 'generate_typography_section', - 'element' => __( 'Typography', 'gp-premium' ), - 'shortcuts' => array(), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); -} - -add_action( 'customize_register', 'generate_premium_layout_block_element_messages', 1000 ); -/** - * Add shortcuts to sections we don't control in this plugin. - * - * @since 1.8 - */ -function generate_premium_layout_block_element_messages( $wp_customize ) { - if ( ! class_exists( 'WP_Customize_Panel' ) ) { - return; - } - - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Information_Customize_Control' ); - } - - if ( version_compare( PHP_VERSION, '5.6', '>=' ) ) { - $footer_sections = array( - 'generate_layout_footer', - 'footer_color_section', - 'font_footer_section', - 'generate_backgrounds_footer', - ); - - foreach ( $footer_sections as $section ) { - if ( $wp_customize->get_section( $section ) ) { - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_using_site_footer_element_' . $section, - array( - 'section' => $section, - 'description' => sprintf( - /* translators: URL to the Elements dashboard. */ - __( 'This page is using a Site Footer Element. Some of the options below may not apply.', 'gp-premium' ), - admin_url( 'edit.php?post_type=gp_elements' ) - ), - 'notice' => true, - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => function() { - $has_block_element = generate_has_active_element( 'site-footer', true ); - - if ( $has_block_element ) { - return true; - } - - return false; - }, - 'priority' => 0, - ) - ) - ); - } - } - - $header_sections = array( - 'generate_layout_header', - 'header_color_section', - 'font_header_section', - 'generate_backgrounds_header', - ); - - foreach ( $header_sections as $section ) { - if ( $wp_customize->get_section( $section ) ) { - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_using_site_header_element_' . $section, - array( - 'section' => $section, - 'description' => sprintf( - /* translators: URL to the Elements dashboard. */ - __( 'This page is using a Site Header Element. Some of the options below may not apply.', 'gp-premium' ), - admin_url( 'edit.php?post_type=gp_elements' ) - ), - 'notice' => true, - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => function() { - $has_block_element = generate_has_active_element( 'site-header', true ); - - if ( $has_block_element ) { - return true; - } - - return false; - }, - 'priority' => 0, - ) - ) - ); - } - } - - $sidebar_sections = array( - 'generate_layout_sidebars', - 'sidebar_widget_color_section', - 'font_widget_section', - 'generate_backgrounds_sidebars', - ); - - foreach ( $sidebar_sections as $section ) { - if ( $wp_customize->get_section( $section ) ) { - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_using_sidebar_element_' . $section, - array( - 'section' => $section, - 'description' => sprintf( - /* translators: URL to the Elements dashboard. */ - __( 'This page is using a Sidebar Element. Some of the options below may not apply.', 'gp-premium' ), - admin_url( 'edit.php?post_type=gp_elements' ) - ), - 'notice' => true, - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => function() { - $has_right_sidebar_block_element = generate_has_active_element( 'right-sidebar', true ); - - if ( $has_right_sidebar_block_element ) { - return true; - } - - $has_left_sidebar_block_element = generate_has_active_element( 'left-sidebar', true ); - - if ( $has_left_sidebar_block_element ) { - return true; - } - - return false; - }, - 'priority' => 0, - ) - ) - ); - } - } - - if ( $wp_customize->get_section( 'generate_blog_section' ) ) { - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_using_post_loop_item_element', - array( - 'section' => 'generate_blog_section', - 'description' => sprintf( - /* translators: URL to the Elements dashboard. */ - __( 'This page is using a Content Template Element. Some of the options below may not apply.', 'gp-premium' ), - admin_url( 'edit.php?post_type=gp_elements' ) - ), - 'notice' => true, - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => function() { - $has_block_element = generate_has_active_element( 'content-template', true ); - - if ( $has_block_element ) { - return true; - } - - return false; - }, - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_using_page_hero_element', - array( - 'section' => 'generate_blog_section', - 'description' => sprintf( - /* translators: URL to the Elements dashboard. */ - __( 'This page is using a Page Hero Element. Some of the options below may not apply.', 'gp-premium' ), - admin_url( 'edit.php?post_type=gp_elements' ) - ), - 'notice' => true, - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => function() { - $has_block_element = generate_has_active_element( 'page-hero', true ); - - if ( $has_block_element ) { - return true; - } - - return false; - }, - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Information_Customize_Control( - $wp_customize, - 'generate_using_post_meta_area_element', - array( - 'section' => 'generate_blog_section', - 'description' => sprintf( - /* translators: URL to the Elements dashboard. */ - __( 'This page is using a Post Meta Template Element. Some of the options below may not apply.', 'gp-premium' ), - admin_url( 'edit.php?post_type=gp_elements' ) - ), - 'notice' => true, - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'active_callback' => function() { - $has_block_element = generate_has_active_element( 'post-meta-template', true ); - - if ( $has_block_element ) { - return true; - } - - return false; - }, - 'priority' => 0, - ) - ) - ); - } - } -} - -add_action( 'customize_controls_print_styles', 'generate_premium_customize_print_styles' ); -/** - * Print control styles for the Customizer. - * - * @since 1.9 - */ -function generate_premium_customize_print_styles() { - $sizes = apply_filters( 'generate_customizer_device_preview_sizes', array( - 'tablet' => 800, - 'mobile' => 411, - 'mobile_height' => 731, - ) ); - ?> - - json['data_type'] = $this->data_type; - $this->json['description'] = $this->description; - $this->json['nonce'] = $this->nonce; - } - - public function content_template() { - ?> - - <# if ( data.description ) { #> - -

{{{ data.description }}}

-
- <# } #> - json['palette'] = $this->palette; - $this->json['defaultValue'] = $this->setting->default; - $this->json[ 'link' ] = $this->get_link(); - $this->json[ 'show_opacity' ] = $this->show_opacity; - - if ( is_array( $this->json['palette'] ) ) { - $this->json['palette'] = implode( '|', $this->json['palette'] ); - } else { - // Default to true. - $this->json['palette'] = ( false === $this->json['palette'] || 'false' === $this->json['palette'] ) ? 'false' : 'true'; - } - - // Support passing show_opacity as string or boolean. Default to true. - $this->json[ 'show_opacity' ] = ( false === $this->json[ 'show_opacity' ] || 'false' === $this->json[ 'show_opacity' ] ) ? 'false' : 'true'; - } - - /** - * Render the control. - */ - public function render_content() {} - - public function content_template() { - ?> - <# if ( data.label && '' !== data.label ) { #> - {{ data.label }} - <# } #> - - json[ 'position_title' ] = esc_html__( 'left top, x% y%, xpos ypos (px)', 'gp-premium' ); - $this->json[ 'position_placeholder' ] = esc_html__( 'Position', 'gp-premium' ); - - foreach ( $this->settings as $setting_key => $setting_id ) { - $this->json[ $setting_key ] = array( - 'link' => $this->get_link( $setting_key ), - 'value' => $this->value( $setting_key ), - 'default' => isset( $setting_id->default ) ? $setting_id->default : '', - 'id' => isset( $setting_id->id ) ? $setting_id->id : '' - ); - - if ( 'repeat' === $setting_key ) { - $this->json[ $setting_key ]['choices'] = $this->get_repeat_choices(); - } - - if ( 'size' === $setting_key ) { - $this->json[ $setting_key ]['choices'] = $this->get_size_choices(); - } - - if ( 'attachment' === $setting_key ) { - $this->json[ $setting_key ]['choices'] = $this->get_attachment_choices(); - } - } - } - - public function content_template() { - ?> - <# if ( '' !== data.label ) { #> - {{ data.label }} - <# } #> - - <# if ( 'undefined' !== typeof ( data.repeat ) ) { #> -
- -
- <# } #> - - <# if ( 'undefined' !== typeof ( data.size ) ) { #> -
- -
- <# } #> - - <# if ( 'undefined' !== typeof ( data.attachment ) ) { #> -
- -
- <# } #> - - <# if ( 'undefined' !== typeof ( data.position ) ) { #> -
- -
- <# } #> - esc_html__( 'Repeat', 'gp-premium' ), - 'repeat-x' => esc_html__( 'Repeat x', 'gp-premium' ), - 'repeat-y' => esc_html__( 'Repeat y', 'gp-premium' ), - 'no-repeat' => esc_html__( 'No Repeat', 'gp-premium' ) - ); - } - - public function get_size_choices() { - return array( - '' => esc_html__( 'Size (Auto)', 'gp-premium' ), - '100' => esc_html__( '100% Width', 'gp-premium' ), - 'cover' => esc_html__( 'Cover', 'gp-premium' ), - 'contain' => esc_html__( 'Contain', 'gp-premium' ) - ); - } - - public function get_attachment_choices() { - return array( - '' => esc_html__( 'Attachment', 'gp-premium' ), - 'fixed' => esc_html__( 'Fixed', 'gp-premium' ), - 'local' => esc_html__( 'Local', 'gp-premium' ), - 'inherit' => esc_html__( 'Inherit', 'gp-premium' ) - ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/class-control-toggle.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/class-control-toggle.php deleted file mode 100644 index 7c893a6e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/class-control-toggle.php +++ /dev/null @@ -1,37 +0,0 @@ -json[ 'targets' ] = $this->targets; - - } - - public function content_template() { - ?> -
- <# jQuery.each( data.targets, function( index, value ) { #> - - <# } ); #> -
- json[ 'link' ] = $this->get_link(); - $this->json[ 'value' ] = $this->value(); - $this->json[ 'id' ] = $this->id; - $this->json[ 'current_year' ] = __( '%current_year% to update year automatically.', 'gp-premium' ); - $this->json[ 'copyright' ] = __( '%copy% to include the copyright symbol.', 'gp-premium' ); - $this->json[ 'html' ] = __( 'HTML is allowed.', 'gp-premium' ); - $this->json[ 'shortcodes' ] = __( 'Shortcodes are allowed.', 'gp-premium' ); - } - /** - * Render the control's content. - * - * Allows the content to be overriden without having to rewrite the wrapper. - * - * @since 10/16/2012 - * @return void - */ - public function content_template() { - ?> - - json[ 'link' ] = $this->get_link(); - $this->json[ 'value' ] = $this->value(); - $this->json[ 'id' ] = $this->id; - $this->json[ 'default_value' ] = $this->default_value; - $this->json[ 'reset_title' ] = esc_attr__( 'Reset','generate-spacing' ); - $this->json[ 'unit' ] = $this->unit; - $this->json[ 'edit_field' ] = $this->edit_field; - } - - public function content_template() { - ?> - -
- <# if ( '' !== data.default_value ) { #>{{ data.reset_title }}<# } #> - json[ 'link' ] = $this->get_link(); - $this->json[ 'value' ] = absint( $this->value() ); - $this->json[ 'description' ] = esc_html( $this->description ); - } - - public function content_template() { - ?> - - type ) { - default: - case 'text' : ?> - - label ) ) echo '' . esc_html( $this->label ) . ''; - if ( ! empty( $this->description ) ) echo '' . esc_html( $this->description ) . ''; - if ( ! empty( $this->areas ) ) : - echo '
'; - foreach ( $this->areas as $value => $label ) : - echo '' . esc_html( $label ) . ''; - endforeach; - endif; - break; - - case 'line' : - echo '
'; - break; - } - } -} -endif; - -if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'Generate_Backgrounds_Customize_Control' ) ) : -/* - * @deprecated 1.3 - */ -class Generate_Backgrounds_Customize_Control extends WP_Customize_Control { - public function render() {} -} -endif; - -if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'Generate_Backgrounds_Customize_Misc_Control' ) ) : -/* - * No longer used - * Kept for back compat purposes - * @deprecated 1.2.95 - */ -class Generate_Backgrounds_Customize_Misc_Control extends WP_Customize_Control { - public function render() {} -} -endif; - -if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'Generate_Blog_Customize_Control' ) ) : -/** - * Add our number input field for the featured image width - * @deprecated 1.3 - */ -class Generate_Blog_Customize_Control extends WP_Customize_Control { - public $type = 'gp-post-image-size'; - public $placeholder = ''; - - public function enqueue() { - wp_enqueue_script( 'gp-blog-customizer', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/blog-customizer.js', array( 'customize-controls' ), GENERATE_BLOG_VERSION, true ); - } - - public function to_json() { - parent::to_json(); - $this->json[ 'link' ] = $this->get_link(); - $this->json[ 'value' ] = $this->value(); - $this->json[ 'placeholder' ] = $this->placeholder; - } - public function content_template() { - ?> - - json[ 'link' ] = $this->get_link(); - $this->json[ 'value' ] = $this->value(); - $this->json[ 'placeholder' ] = $this->placeholder; - } - public function content_template() { - ?> - - json[ 'text' ] = __( 'Apply image sizes','page-header' ); - } - - public function content_template() { - ?> - {{{ data.text }}} - json[ 'link' ] = $this->get_link(); - $this->json[ 'value' ] = $this->value(); - $this->json[ 'id' ] = $this->id; - } - - public function content_template() { - ?> - - - - - - json['description'] = $this->description; - $this->json['notice'] = $this->notice; - } - - public function content_template() { - ?> - <# if ( data.notice ) { #> -
- <# } #> - - <# if ( data.label ) { #> - {{ data.label }} - <# } #> - <# if ( data.description ) { #> -

{{{ data.description }}}

- <# } #> - - <# if ( data.notice ) { #> -
- <# } #> - json['choices'][$device]['min'] = ( isset( $this->choices[$device]['min'] ) ) ? $this->choices[$device]['min'] : '0'; - $this->json['choices'][$device]['max'] = ( isset( $this->choices[$device]['max'] ) ) ? $this->choices[$device]['max'] : '100'; - $this->json['choices'][$device]['step'] = ( isset( $this->choices[$device]['step'] ) ) ? $this->choices[$device]['step'] : '1'; - $this->json['choices'][$device]['edit'] = ( isset( $this->choices[$device]['edit'] ) ) ? $this->choices[$device]['edit'] : false; - $this->json['choices'][$device]['unit'] = ( isset( $this->choices[$device]['unit'] ) ) ? $this->choices[$device]['unit'] : false; - } - - foreach ( $this->settings as $setting_key => $setting_id ) { - $this->json[ $setting_key ] = array( - 'link' => $this->get_link( $setting_key ), - 'value' => $this->value( $setting_key ), - 'default' => isset( $setting_id->default ) ? $setting_id->default : '', - ); - } - - $this->json['desktop_label'] = __( 'Desktop', 'gp-premium' ); - $this->json['tablet_label'] = __( 'Tablet', 'gp-premium' ); - $this->json['mobile_label'] = __( 'Mobile', 'gp-premium' ); - $this->json['reset_label'] = __( 'Reset', 'gp-premium' ); - - $this->json['description'] = $this->description; - $this->json['sub_description'] = $this->sub_description; - } - /** - * Enqueue control related scripts/styles. - * - * @access public - */ - public function enqueue() { - wp_enqueue_script( 'generatepress-pro-range-slider', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/slider-customizer.js', array( 'jquery', 'customize-base', 'jquery-ui-slider' ), GP_PREMIUM_VERSION, true ); - wp_enqueue_style( 'generatepress-pro-range-slider-css', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'css/slider-customizer.css', GP_PREMIUM_VERSION ); - } - /** - * An Underscore (JS) template for this control's content (but not its container). - * - * Class variables for this control class are available in the `data` JS object; - * export custom variables by overriding {@see WP_Customize_Control::to_json()}. - * - * @see WP_Customize_Control::print_template() - * - * @access protected - */ - protected function content_template() { - ?> -
-
- <# if ( data.label || data.description ) { #> -
- <# if ( data.label ) { #> - {{{ data.label }}} - <# } #> - - <# if ( data.description ) { #> -

{{{ data.description }}}

- <# } #> -
- <# } #> - -
- - <# if ( 'undefined' !== typeof ( data.desktop ) ) { #> - - <# } #> - - <# if ( 'undefined' !== typeof (data.tablet) ) { #> - - <# } #> - - <# if ( 'undefined' !== typeof (data.mobile) ) { #> - - <# } #> - - - -
-
- -
- <# if ( 'undefined' !== typeof ( data.desktop ) ) { #> - - <# } #> - - <# if ( 'undefined' !== typeof ( data.tablet ) ) { #> - - <# } #> - - <# if ( 'undefined' !== typeof ( data.mobile ) ) { #> - - <# } #> -
- - <# if ( data.sub_description ) { #> -

{{{ data.sub_description }}}

- <# } #> -
- - {{{ data.label }}} - shortcuts as $name => $id ) { - if ( 'colors' === $name ) { - $name = esc_html__( 'Colors', 'gp-premium' ); - - if ( version_compare( generate_premium_get_theme_version(), '3.1.0-alpha.1', '>=' ) && 'generate_woocommerce_colors' !== $id ) { - $id = 'generate_colors_section'; - } - - if ( ! generatepress_is_module_active( 'generate_package_colors', 'GENERATE_COLORS' ) ) { - $id = false; - $name = false; - } - } - - if ( 'typography' === $name ) { - $name = esc_html__( 'Typography', 'gp-premium' ); - - if ( function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography() ) { - $id = 'generate_typography_section'; - } - - if ( ! generatepress_is_module_active( 'generate_package_typography', 'GENERATE_TYPOGRAPHY' ) ) { - $id = false; - $name = false; - } - } - - if ( 'backgrounds' === $name ) { - $name = esc_html__( 'Backgrounds', 'gp-premium' ); - - if ( ! generatepress_is_module_active( 'generate_package_backgrounds', 'GENERATE_BACKGROUNDS' ) ) { - $id = false; - $name = false; - } - } - - if ( 'layout' === $name ) { - $name = esc_html__( 'Layout', 'gp-premium' ); - } - - if ( $id && $name ) { - $shortcuts[ $id ] = $name; - } - } - - if ( ! empty( $shortcuts ) ) { - $this->json['shortcuts'] = $shortcuts; - } else { - $this->json['shortcuts'] = false; - } - - if ( 'WooCommerce' !== $this->element ) { - $this->element = strtolower( $this->element ); - } - - $this->json['more'] = sprintf( - __( 'More %s controls:', 'gp-premium' ), - '' . $this->element . '' - ); - - $this->json['return'] = __( 'Go Back', 'gp-premium' ); - - $this->json['section'] = $this->section; - - if ( apply_filters( 'generate_disable_customizer_shortcuts', false ) ) { - $this->json['shortcuts'] = false; - } - } - - public function content_template() { - ?> -
- <# if ( data.shortcuts ) { #> -
- - {{{ data.more }}} - - - - <# _.each( data.shortcuts, function( label, section ) { #> - - {{{ label }}} - - <# } ) #> - -
- <# } #> - - -
- - settings as $setting_key => $setting_id ) { - $this->json[ $setting_key ] = array( - 'link' => $this->get_link( $setting_key ), - 'value' => $this->value( $setting_key ) - ); - } - - $this->json[ 'element' ] = $this->element; - $this->json[ 'title' ] = __( 'Link values', 'gp-premium' ); - $this->json[ 'unlink_title' ] = __( 'Un-link values', 'gp-premium' ); - - $this->json['label_top'] = esc_html__( 'Top', 'gp-premium' ); - $this->json['label_right'] = esc_html__( 'Right', 'gp-premium' ); - $this->json['label_bottom'] = esc_html__( 'Bottom', 'gp-premium' ); - $this->json['label_left'] = esc_html__( 'Left', 'gp-premium' ); - $this->json['desktop_label'] = esc_html__( 'Desktop', 'gp-premium' ); - $this->json['tablet_label'] = esc_html__( 'Tablet', 'gp-premium' ); - $this->json['mobile_label'] = esc_html__( 'Mobile', 'gp-premium' ); - } - - public function content_template() { - ?> -
-
- <# if ( data.label || data.description ) { #> -
- <# if ( data.label ) { #> - - <# } #> - - <# if ( data.description ) { #> - {{{ data.description }}} - <# } #> -
- <# } #> - -
- - <# if ( 'undefined' !== typeof ( data.desktop_top ) ) { #> - - <# } #> - - <# if ( 'undefined' !== typeof (data.tablet_top) ) { #> - - <# } #> - - <# if ( 'undefined' !== typeof (data.mobile_top) ) { #> - - <# } #> - -
-
- -
- - - <# if ( 'undefined' !== typeof ( data.mobile_top ) ) { #> - - <# } #> -
-
- json[ 'title' ] = esc_html( $this->title ); - } - - public function content_template() { - ?> -
- {{ data.title }} -
- json[ 'default_fonts_title'] = __( 'System Fonts', 'gp-premium' ); - $this->json[ 'google_fonts_title'] = __( 'Google Fonts', 'gp-premium' ); - $this->json[ 'default_fonts' ] = generate_typography_default_fonts(); - $this->json[ 'family_title' ] = esc_html__( 'Font family', 'gp-premium' ); - $this->json[ 'weight_title' ] = esc_html__( 'Font weight', 'gp-premium' ); - $this->json[ 'transform_title' ] = esc_html__( 'Text transform', 'gp-premium' ); - $this->json[ 'category_title' ] = ''; - $this->json[ 'variant_title' ] = esc_html__( 'Variants', 'gp-premium' ); - - foreach ( $this->settings as $setting_key => $setting_id ) { - $this->json[ $setting_key ] = array( - 'link' => $this->get_link( $setting_key ), - 'value' => $this->value( $setting_key ), - 'default' => isset( $setting_id->default ) ? $setting_id->default : '', - 'id' => isset( $setting_id->id ) ? $setting_id->id : '' - ); - - if ( 'weight' === $setting_key ) { - $this->json[ $setting_key ]['choices'] = $this->get_font_weight_choices(); - } - - if ( 'transform' === $setting_key ) { - $this->json[ $setting_key ]['choices'] = $this->get_font_transform_choices(); - } - } - } - - public function content_template() { - ?> - <# if ( '' !== data.label ) { #> - {{ data.label }} - <# } #> - <# if ( 'undefined' !== typeof ( data.family ) ) { #> -
- -
- <# } #> - - <# if ( 'undefined' !== typeof ( data.variant ) ) { #> - <# - var id = data.family.value.split(' ').join('_').toLowerCase(); - var font_data = generatePressTypography.googleFonts[id]; - var variants = ''; - if ( typeof font_data !== 'undefined' ) { - variants = font_data.variants; - } - - if ( null === data.variant.value ) { - data.variant.value = data.variant.default; - } - #> -
- -
- <# } #> - - <# if ( 'undefined' !== typeof ( data.category ) ) { #> -
- -
- <# } #> - -
- <# if ( 'undefined' !== typeof ( data.weight ) ) { #> -
- -
- <# } #> - - <# if ( 'undefined' !== typeof ( data.transform ) ) { #> -
- -
- <# } #> -
- esc_html__( 'inherit', 'gp-premium' ), - 'normal' => esc_html__( 'normal', 'gp-premium' ), - 'bold' => esc_html__( 'bold', 'gp-premium' ), - '100' => esc_html( '100' ), - '200' => esc_html( '200' ), - '300' => esc_html( '300' ), - '400' => esc_html( '400' ), - '500' => esc_html( '500' ), - '600' => esc_html( '600' ), - '700' => esc_html( '700' ), - '800' => esc_html( '800' ), - '900' => esc_html( '900' ), - ); - } - - public function get_font_transform_choices() { - return array( - '' => esc_html__( 'inherit', 'gp-premium' ), - 'none' => esc_html__( 'none', 'gp-premium' ), - 'capitalize' => esc_html__( 'capitalize', 'gp-premium' ), - 'uppercase' => esc_html__( 'uppercase', 'gp-premium' ), - 'lowercase' => esc_html__( 'lowercase', 'gp-premium' ), - ); - } -} -endif; diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/alpha-color-picker.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/alpha-color-picker.css deleted file mode 100644 index d820a935..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/alpha-color-picker.css +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Alpha Color Picker CSS - */ -.customize-control-gp-alpha-color .iris-picker .iris-square { - margin-right:10px; -} - -.customize-control-gp-alpha-color .alpha-slider.ui-widget-content, -.customize-control-gp-alpha-color .ui-widget-header{ - background: none; - border: 0; - box-shadow: 0 0 0 transparent; -} - -.alpha-color-picker-wrap a.iris-square-value:focus { - box-shadow: none; -} - -.gp-alpha-color-picker-container { - position: relative; - margin-left: 10px; - background-image: url(transparency-grid.png); -} - -.gp-alpha-color-picker-container .iris-picker .iris-strip .ui-slider-handle { - z-index: 100; -} - -.customize-control-gp-alpha-color .wp-picker-input-wrap .button.wp-picker-clear { - margin-left: 6px; - padding: 2px 8px; -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/button-actions.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/button-actions.css deleted file mode 100644 index 4c55423e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/button-actions.css +++ /dev/null @@ -1,19 +0,0 @@ -button[data-type="regenerate_external_css"]:before { - font: normal 20px/.5 dashicons; - display: inline-block; - padding: 0; - top: 9px; - left: -4px; - position: relative; - vertical-align: top; - content: "\f463"; -} - -button[data-type="regenerate_external_css"].loading:before { - animation: rotation 1s infinite linear; -} - -button[data-type="regenerate_external_css"].success:before { - content: "\f147"; - color: #46b450; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/control-toggle-customizer.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/control-toggle-customizer.css deleted file mode 100644 index b27e743b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/control-toggle-customizer.css +++ /dev/null @@ -1,21 +0,0 @@ -.generatepress-control-toggles { - display: flex; -} - -.generatepress-control-toggles button { - flex-basis: 100%; - background-color: #fafafa; - border: 1px solid #ddd; - cursor: pointer; - padding: 5px 10px; -} - -.generatepress-control-toggles button:last-child { - border-left: 0; -} - -.generatepress-control-toggles button.active { - background-color: #fff; - border: 1px solid #ccc; - font-weight: bold; -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/section-shortcuts.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/section-shortcuts.css deleted file mode 100644 index 71e4c4ec..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/section-shortcuts.css +++ /dev/null @@ -1,43 +0,0 @@ -.generatepress-shortcuts > div { - background: #fff; - padding: 10px 15px; - border-width: 0 1px 1px 0; - border-color: #ddd; - border-style: solid; - margin-bottom: 10px; -} - -.customize-control-gp_section_shortcut { - margin-bottom: 0; -} - -.generatepress-shortcuts .more-controls { - font-weight: 600; - margin-right: 5px; - display: block; - font-size: 12px; - margin-bottom: 3px; -} - -.generatepress-shortcuts .shortcuts .shortcut:not(:last-child):after { - content: "\2022"; - padding: 0 1px; -} - -.generatepress-shortcuts .shortcut a { - text-decoration: none; -} - -.generatepress-shortcuts .shortcut { - font-size: 12px; -} - -.return-shortcut .dashicons { - float: right; - cursor: pointer; -} - -.return-shortcut a { - font-size: 12px; - text-decoration: none; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/selectWoo.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/selectWoo.min.css deleted file mode 100644 index 59fa33d3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/selectWoo.min.css +++ /dev/null @@ -1 +0,0 @@ -.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[data-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[data-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[data-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/slider-customizer.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/slider-customizer.css deleted file mode 100644 index d7add5f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/slider-customizer.css +++ /dev/null @@ -1,131 +0,0 @@ -.customize-control-generatepress-pro-range-slider .generatepress-slider { - position: relative; - width: calc(100% - 60px); - height: 6px; - background-color: rgba(0,0,0,.10); - cursor: pointer; - transition: background .5s; -} - -.customize-control-generatepress-pro-range-slider .has-unit .generatepress-slider { - width: calc(100% - 90px); -} - -.customize-control-generatepress-pro-range-slider .gp_range_value.hide-value { - display: none; -} - -.customize-control-generatepress-pro-range-slider .gp_range_value.hide-value + .generatepress-slider { - width: 100%; -} - -.customize-control-generatepress-pro-range-slider .generatepress-slider .ui-slider-handle { - height: 16px; - width: 16px; - background-color: #3498D9; - display: inline-block; - position: absolute; - top: 50%; - transform: translateY(-50%) translateX(-4px); - border-radius: 50%; - cursor: pointer; -} - -.customize-control-generatepress-pro-range-slider .wrapper { - display: flex; - justify-content: space-between; - align-items: center; -} - -.customize-control-generatepress-pro-range-slider .gp_range_value { - font-size: 14px; - padding: 0; - font-weight: 400; - width: 50px; - display: flex; -} - -.customize-control-generatepress-pro-range-slider .has-unit .gp_range_value { - width: 80px; -} - -.customize-control-generatepress-pro-range-slider .gp_range_value span.value { - font-size: 12px; - width: calc(100% - 2px); - text-align: center; - min-height: 30px; - background: #FFF; - line-height: 30px; - border: 1px solid #DDD; -} - -.customize-control-generatepress-pro-range-slider .has-unit .gp_range_value span.value { - width: calc(100% - 32px); - display: block; -} - -.customize-control-generatepress-pro-range-slider .gp_range_value .unit { - width: 29px; - text-align: center; - font-size: 12px; - line-height: 30px; - background: #fff; - border: 1px solid #ddd; - margin-left: 1px; -} - -.customize-control-generatepress-pro-range-slider .generatepress-pro-range-slider-reset span { - font-size: 16px; - line-height: 22px; -} - -.customize-control-generatepress-pro-range-slider .gp_range_value input { - font-size: 12px; - padding: 0px; - text-align: center; - min-height: 30px; - height: auto; - border-radius: 0; - border-color: #ddd; -} - -.customize-control-generatepress-pro-range-slider .has-unit .gp_range_value input { - width: calc(100% - 30px); -} - -.customize-control-generatepress-pro-range-slider .gp-range-title-area .dashicons { - cursor: pointer; - font-size: 11px; - width: 20px; - height: 20px; - line-height: 20px; - color: #222; - text-align: center; - position: relative; - top: 2px; -} - -.customize-control-generatepress-pro-range-slider .gp-range-title-area .dashicons:hover { - background: #fafafa; -} - -.customize-control-generatepress-pro-range-slider .gp-range-title-area .dashicons.selected { - background: #fff; - color: #222; -} - -.gp-range-title-area { - display: flex; -} - -.gp-range-slider-controls { - margin-left: auto; -} - -.customize-control-generatepress-pro-range-slider .gp-device-controls > span:first-child:last-child { - display: none; -} - -.customize-control-generatepress-pro-range-slider .sub-description { - margin-top: 10px; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/spacing-customizer.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/spacing-customizer.css deleted file mode 100644 index 058e9c60..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/spacing-customizer.css +++ /dev/null @@ -1,101 +0,0 @@ -.gp-spacing-control-section-title-area { - display: flex; -} - -.gp-range-slider-controls { - margin-left: auto; -} - -.customize-control-spacing .description { - font-size: 10px; - text-transform: uppercase; - font-weight: bold; - font-style: normal; - opacity: 0.7; -} - -.spacing-values-area { - display: flex; -} - -.gp-spacing-section input { - min-height: 30px; - border-radius: 0; - border-color: #ddd; -} - -.gp-link-spacing-section span { - display: block; - color: #0073aa; - font-size: 14px; - cursor: pointer; - height: auto; - min-height: 28px; - line-height: 28px; - box-sizing: border-box; - width: 40px; - background: #fff; - border: 1px solid #ddd; -} - -.gp-link-spacing-section span.gp-unlink-spacing { - background-color: #0073aa; - color: #fff; -} - -.gp-spacing-section { - margin-right: 2px; - text-align:center -} - -.gp-link-spacing-section { - margin-right: 0; -} - -.gp-spacing-section .description { - font-size: 10px; - text-transform: uppercase; - font-weight: bold; - font-style: normal; - opacity: 0.7; -} - -.no-edit-field { - font-size: 11px; - opacity: 0.8; - font-weight: 600; -} - -/* - * Make sure slider is 100% wide. - * Old versions of Secondary Nav will have this set as 50% - * so we need to set !important to overwrite that. - */ -.customize-control.customize-control-gp-spacing-slider { - width: 100% !important; -} - -.customize-control-generatepress-spacing .gp-spacing-control-section-title-area .dashicons { - cursor: pointer; - font-size: 11px; - width: 20px; - height: 20px; - line-height: 20px; - color: #222; - text-align: center; - position: relative; - top: 2px; -} - -.customize-control-generatepress-spacing .gp-spacing-control-section-title-area .dashicons:hover { - background: #fafafa; -} - -.customize-control-generatepress-spacing .gp-spacing-control-section-title-area .dashicons.selected { - background: #fff; - color: #222; -} - -.customize-control-generatepress-spacing .gp-device-controls > span:first-child:last-child { - display: none; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/title-customizer.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/title-customizer.css deleted file mode 100644 index 9a1289e2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/title-customizer.css +++ /dev/null @@ -1,9 +0,0 @@ -.generatepress-customizer-title { - background: #FFF; - padding: 10px 12px; - font-weight: 600; - border-style: solid; - border-width: 0 1px 1px 0; - border-color: #ddd; - font-size: 15px; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/transparency-grid.png b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/transparency-grid.png deleted file mode 100644 index 20d0f653..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/transparency-grid.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/typography-customizer.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/typography-customizer.css deleted file mode 100644 index 53aadcda..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/css/typography-customizer.css +++ /dev/null @@ -1,60 +0,0 @@ -.generatepress-font-family { - margin-bottom: 12px; -} - -.generatepress-weight-transform-wrapper { - display: flex; - justify-content: space-between; -} - -.generatepress-font-weight, -.generatepress-font-transform { - width: calc(50% - 5px); -} - -span.select2-container.select2-container--default.select2-container--open li.select2-results__option { - margin:0; -} - -span.select2-container.select2-container--default.select2-container--open{ - z-index:999999; -} - -.select2-selection__rendered li { - margin-bottom: 0; -} - -.select2-container--default .select2-selection--single, -.select2-container--default.select2-container .select2-selection--multiple, -.select2-dropdown, -.select2-container--default .select2-selection--multiple .select2-selection__choice { - border-color: #ddd; - border-radius: 0; -} - -.select2-container--default .select2-results__option[aria-selected=true] { - color: rgba(0,0,0,0.4); -} - -.select2-container .select2-search--inline { - display: none; -} - -#customize-control-single_content_title_control, -#customize-control-font_heading_2_control, -#customize-control-archive_content_title_control, -#customize-control-font_heading_3_control, -#customize-control-font_heading_4_control, -#customize-control-font_heading_5_control, -#customize-control-font_heading_6_control { - margin-top: 20px; -} - -.generatepress-weight-transform-wrapper select option[value=""] { - display: none; -} - -#customize-control-single_content_title_control .generatepress-weight-transform-wrapper select option[value=""], -#customize-control-archive_content_title_control .generatepress-weight-transform-wrapper select option[value=""] { - display: block; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/alpha-color-picker.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/alpha-color-picker.js deleted file mode 100644 index 319f7a1a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/alpha-color-picker.js +++ /dev/null @@ -1,277 +0,0 @@ -/** - * Alpha Color Picker JS - * - * This file includes several helper functions and the core control JS. - */ - -/** - * Override the stock color.js toString() method to add support for - * outputting RGBa or Hex. - */ -Color.prototype.toString = function( flag ) { - - // If our no-alpha flag has been passed in, output RGBa value with 100% opacity. - // This is used to set the background color on the opacity slider during color changes. - if ( 'no-alpha' == flag ) { - return this.toCSS( 'rgba', '1' ).replace( /\s+/g, '' ); - } - - // If we have a proper opacity value, output RGBa. - if ( 1 > this._alpha ) { - return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' ); - } - - // Proceed with stock color.js hex output. - var hex = parseInt( this._color, 10 ).toString( 16 ); - if ( this.error ) { return ''; } - if ( hex.length < 6 ) { - for ( var i = 6 - hex.length - 1; i >= 0; i-- ) { - hex = '0' + hex; - } - } - - return '#' + hex; -}; - -/** - * Given an RGBa, RGB, or hex color value, return the alpha channel value. - */ -function generate_get_alpha_value_from_color( value ) { - var alphaVal; - - // Remove all spaces from the passed in value to help our RGBa regex. - value = value.toString().replace( / /g, '' ); - - if ( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ ) ) { - alphaVal = parseFloat( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ )[1] ).toFixed(2) * 100; - alphaVal = parseInt( alphaVal ); - } else { - alphaVal = 100; - } - - return alphaVal; -} - -/** - * Force update the alpha value of the color picker object and maybe the alpha slider. - */ - function generate_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, update_slider ) { - var iris, colorPicker, color; - - iris = $control.data( 'a8cIris' ); - colorPicker = $control.data( 'wpWpColorPicker' ); - - // Set the alpha value on the Iris object. - iris._color._alpha = alpha; - - // Store the new color value. - color = iris._color.toString(); - - // Set the value of the input. - $control.val( color ); - - // Update the background color of the color picker. - colorPicker.toggler.css({ - 'background-color': color - }); - - // Maybe update the alpha slider itself. - if ( update_slider ) { - generate_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ); - } - - // Update the color value of the color picker object. - $control.wpColorPicker( 'color', color ); -} - -/** - * Update the slider handle position and label. - */ -function generate_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ) { - $alphaSlider.slider( 'value', alpha ); - //$alphaSlider.find( '.ui-slider-handle' ).text( alpha.toString() ); -} - -/** - * Initialization trigger. - */ -jQuery( document ).ready( function( $ ) { - - // Loop over each control and transform it into our color picker. - $( '.gp-alpha-color-control' ).each( function() { - - // Scope the vars. - var $control, startingColor, paletteInput, showOpacity, defaultColor, palette, - colorPickerOptions, $container, $alphaSlider, alphaVal, sliderOptions, savedValue; - - // Store the control instance. - $control = $( this ); - - // Get our saved value - savedValue = wp.customize.value( $control.attr( 'data-customize-setting-link' ) )(); - - // Get a clean starting value for the option. - startingColor = savedValue.toString().replace( /\s+/g, '' ); - - // Get some data off the control. - paletteInput = $control.attr( 'data-palette' ); - showOpacity = $control.attr( 'data-show-opacity' ); - defaultColor = $control.attr( 'data-default-color' ); - - // Process the palette. - if ( paletteInput.indexOf( '|' ) !== -1 ) { - palette = paletteInput.split( '|' ); - } else if ( 'false' == paletteInput ) { - palette = false; - } else { - palette = true; - } - - // Set up the options that we'll pass to wpColorPicker(). - colorPickerOptions = { - change: function( event, ui ) { - var key, value, alpha, $transparency; - - key = $control.attr( 'data-customize-setting-link' ); - value = $control.wpColorPicker( 'color' ); - - // Send ajax request to wp.customize to trigger the Save action. - wp.customize( key, function( obj ) { - obj.set( value ); - }); - - $transparency = $container.find( '.transparency' ); - - // Always show the background color of the opacity slider at 100% opacity. - $alphaSlider.closest( '.gp-alpha-color-picker-container' ).css( 'background-color', ui.color.toString( 'no-alpha' ) ); - }, - palettes: palette - }; - - // Create the colorpicker. - $control.val( savedValue ).wpColorPicker( colorPickerOptions ); - - $container = $control.parents( '.wp-picker-container:first' ); - - // Insert our opacity slider. - $( '
' + - '
' + - '
' ).appendTo( $container.find( '.iris-picker-inner' ) ); - - $alphaSlider = $container.find( '.alpha-slider' ); - - // If starting value is in format RGBa, grab the alpha channel. - alphaVal = generate_get_alpha_value_from_color( startingColor ); - - // Get the solid color - solidColor = startingColor.toString().replace( '0.' + alphaVal, '100' ); - - // Set up jQuery UI slider() options. - sliderOptions = { - create: function( event, ui ) { - var value = $( this ).slider( 'value' ); - - // Set up initial values. - //$( this ).find( '.ui-slider-handle' ).text( value ); - $( this ).closest( '.iris-slider' ).css( 'background-color', solidColor ); - }, - value: alphaVal, - range: 'max', - step: 1, - min: 0, - max: 100, - animate: 300, - orientation: "vertical" - }; - - // Initialize jQuery UI slider with our options. - $alphaSlider.slider( sliderOptions ); - - // Bind event handler for clicking on a palette color. - $container.find( '.iris-palette' ).on( 'click', function() { - var color, alpha; - - color = $( this ).css( 'background-color' ); - alpha = generate_get_alpha_value_from_color( color ); - - generate_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ); - - // Sometimes Iris doesn't set a perfect background-color on the palette, - // for example rgba(20, 80, 100, 0.3) becomes rgba(20, 80, 100, 0.298039). - // To compensante for this we round the opacity value on RGBa colors here - // and save it a second time to the color picker object. - if ( alpha != 100 ) { - color = color.toString().replace( /[^,]+(?=\))/, ( alpha / 100 ).toFixed( 2 ) ); - } - - $control.wpColorPicker( 'color', color ); - }); - - // Bind event handler for clicking on the 'Clear' button. - $container.find( '.button.wp-picker-clear' ).on( 'click', function() { - var key = $control.attr( 'data-customize-setting-link' ); - - // The #fff color is delibrate here. This sets the color picker to white instead of the - // defult black, which puts the color picker in a better place to visually represent empty. - $control.wpColorPicker( 'color', '#ffffff' ); - - // Set the actual option value to empty string. - wp.customize( key, function( obj ) { - obj.set( '' ); - }); - - generate_update_alpha_value_on_alpha_slider( 100, $alphaSlider ); - }); - - // Bind event handler for clicking on the 'Default' button. - $container.find( '.button.wp-picker-default' ).on( 'click', function() { - var alpha = generate_get_alpha_value_from_color( defaultColor ); - - generate_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ); - }); - - // Bind event handler for typing or pasting into the input. - $control.on( 'input', function() { - var value = $( this ).val(); - - if ( '' === value ) { - var key = $control.attr( 'data-customize-setting-link' ); - - // The #fff color is delibrate here. This sets the color picker to white instead of the - // defult black, which puts the color picker in a better place to visually represent empty. - $control.wpColorPicker( 'color', '' ); - - // Set the actual option value to empty string. - wp.customize( key, function( obj ) { - obj.set( '' ); - }); - - generate_update_alpha_value_on_alpha_slider( 100, $alphaSlider ); - } else { - var alpha = generate_get_alpha_value_from_color( value ); - - generate_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ); - } - }); - - // Update all the things when the slider is interacted with. - $alphaSlider.slider().on( 'slide', function( event, ui ) { - var alpha = parseFloat( ui.value ) / 100.0; - - generate_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, false ); - }); - - }); -}); - -// Move the opacity bar next to the hue bar -jQuery( document ).ready( function( $ ) { - var container_width = $( '.customize-control-gp-alpha-color .iris-picker' ).width(); - var square_width = $( '.customize-control-gp-alpha-color .iris-square' ).width(); - var available_space = container_width - square_width; - var strip_width = ( available_space / 2 ) - 20; - var strip_height = $( '.customize-control-gp-alpha-color .iris-strip' ).height(); - $( '.customize-control-gp-alpha-color .iris-strip, .gp-alpha-color-picker-container' ).css( 'width', strip_width + 'px' ); - $( '.gp-alpha-color-picker-container' ).css( 'height', strip_height + 'px' ); - -}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/backgrounds-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/backgrounds-customizer.js deleted file mode 100644 index 74a4b2b7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/backgrounds-customizer.js +++ /dev/null @@ -1,31 +0,0 @@ -( function( api ) { - api.controlConstructor[ 'gp-background-images' ] = api.Control.extend( { - ready() { - var control = this; - - control.container.on( 'change', '.generatepress-backgrounds-repeat select', - function() { - control.settings.repeat.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change', '.generatepress-backgrounds-size select', - function() { - control.settings.size.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change', '.generatepress-backgrounds-attachment select', - function() { - control.settings.attachment.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'input', '.generatepress-backgrounds-position input', - function() { - control.settings.position.set( jQuery( this ).val() ); - } - ); - }, - } ); -}( wp.customize ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/button-actions.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/button-actions.js deleted file mode 100644 index 600c3072..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/button-actions.js +++ /dev/null @@ -1,43 +0,0 @@ -jQuery( function( $ ) { - $( '[data-type="overlay_design"]' ).on( 'click', function( e ) { - e.preventDefault(); - - // eslint-disable-next-line no-alert - if ( ! confirm( gpButtonActions.warning ) ) { - return; - } - - ( function( api ) { - 'use strict'; - - api.instance( 'generate_settings[slideout_background_color]' ).set( gpButtonActions.styling.backgroundColor ); - api.instance( 'generate_settings[slideout_text_color]' ).set( gpButtonActions.styling.textColor ); - api.instance( 'generate_settings[slideout_background_hover_color]' ).set( gpButtonActions.styling.backgroundHoverColor ); - api.instance( 'generate_settings[slideout_background_current_color]' ).set( gpButtonActions.styling.backgroundCurrentColor ); - - api.instance( 'generate_settings[slideout_submenu_background_color]' ).set( gpButtonActions.styling.subMenuBackgroundColor ); - api.instance( 'generate_settings[slideout_submenu_text_color]' ).set( gpButtonActions.styling.subMenuTextColor ); - api.instance( 'generate_settings[slideout_submenu_background_hover_color]' ).set( gpButtonActions.styling.subMenuBackgroundHoverColor ); - api.instance( 'generate_settings[slideout_submenu_background_current_color]' ).set( gpButtonActions.styling.subMenuBackgroundCurrentColor ); - - api.instance( 'generate_settings[slideout_font_weight]' ).set( gpButtonActions.styling.fontWeight ); - api.instance( 'generate_settings[slideout_font_size]' ).set( gpButtonActions.styling.fontSize ); - - $( '.wp-color-picker' ).wpColorPicker().change(); - }( wp.customize ) ); - } ); - - $( '[data-type="regenerate_external_css"]' ).on( 'click', function( e ) { - var $thisButton = $( this ); // eslint-disable-line no-var - e.preventDefault(); - - $thisButton.removeClass( 'success' ).addClass( 'loading' ); - - $.post( ajaxurl, { - action: 'generatepress_regenerate_css_file', - _nonce: $thisButton.data( 'nonce' ), - } ).done( function() { - $thisButton.removeClass( 'loading' ).addClass( 'success' ); - } ); - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/control-toggle-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/control-toggle-customizer.js deleted file mode 100644 index 76083b29..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/control-toggle-customizer.js +++ /dev/null @@ -1,35 +0,0 @@ -jQuery( function( $ ) { - $( '.generatepress-control-toggles' ).each( function() { - $( this ).find( 'button' ).first().addClass( 'active' ); - } ); - - $( document ).on( 'click', '.generatepress-control-toggles button', function( e ) { - e.preventDefault(); - var button = $( this ), - target = button.data( 'target' ), - otherTargets = button.siblings(); - - button.addClass( 'active' ); - button.siblings().removeClass( 'active' ); - - $( 'li[data-control-section="' + target + '"]' ).css( { - visibility: 'visible', - height: '', - width: '', - margin: '', - overflow: '', - } ); - - $.each( otherTargets, function() { - var otherTarget = $( this ).data( 'target' ); - - $( 'li[data-control-section="' + otherTarget + '"]' ).css( { - visibility: 'hidden', - height: '0', - width: '0', - margin: '0', - overflow: 'hidden', - } ); - } ); - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/copyright-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/copyright-customizer.js deleted file mode 100644 index 4d5b4eb8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/copyright-customizer.js +++ /dev/null @@ -1,12 +0,0 @@ -( function( $, api ) { - api.controlConstructor[ 'gp-copyright' ] = api.Control.extend( { - ready() { - var control = this; - $( '.gp-copyright-area', control.container ).on( 'change keyup', - function() { - control.setting.set( $( this ).val() ); - } - ); - }, - } ); -}( jQuery, wp.customize ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/generatepress-controls.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/generatepress-controls.js deleted file mode 100644 index 2b3f2e08..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/generatepress-controls.js +++ /dev/null @@ -1,151 +0,0 @@ -( function( $, api ) { - /** - * Set some controls when we're using the navigation as a header. - * - * @since 1.8 - */ - api( 'generate_menu_plus_settings[navigation_as_header]', function( value ) { - value.bind( function( newval ) { - var navAlignmentSetting = api.instance( 'generate_settings[nav_alignment_setting]' ), - navAlignment = gpControls.navigationAlignment, - siteTitleFontSizeSetting = api.instance( 'generate_settings[site_title_font_size]' ), - mobileSiteTitleFontSizeSetting = api.instance( 'generate_settings[mobile_site_title_font_size]' ), - siteTitleFontSize = gpControls.siteTitleFontSize, - mobileSiteTitleFontSize = gpControls.mobileSiteTitleFontSize, - mobileHeader = api.instance( 'generate_menu_plus_settings[mobile_header]' ).get(), - navTextColorSetting = api.instance( 'generate_settings[navigation_text_color]' ), - navTextColor = gpControls.navigationTextColor, - siteTitleTextColorSetting = api.instance( 'generate_settings[site_title_color]' ), - siteTitleTextColor = gpControls.siteTitleTextColor; - - if ( siteTitleFontSizeSetting && ! siteTitleFontSizeSetting._dirty && 25 !== siteTitleFontSizeSetting.get() ) { - siteTitleFontSize = siteTitleFontSizeSetting.get(); - } - - if ( mobileSiteTitleFontSizeSetting && ! mobileSiteTitleFontSizeSetting._dirty && 20 !== mobileSiteTitleFontSizeSetting.get() ) { - mobileSiteTitleFontSize = mobileSiteTitleFontSizeSetting.get(); - } - - if ( navTextColorSetting && ! navTextColorSetting._dirty ) { - navTextColor = navTextColorSetting.get(); - } - - if ( siteTitleTextColorSetting && ! siteTitleTextColorSetting._dirty ) { - siteTitleTextColor = siteTitleTextColorSetting.get(); - } - - if ( newval ) { - navAlignmentSetting.set( 'right' ); - - if ( siteTitleFontSizeSetting ) { - siteTitleFontSizeSetting.set( 25 ); - } - - if ( api.instance( 'generate_settings[site_title_color]' ) ) { - api.instance( 'generate_settings[site_title_color]' ).set( navTextColor ); - } - - if ( mobileSiteTitleFontSizeSetting && 'enable' !== mobileHeader ) { - mobileSiteTitleFontSizeSetting.set( 20 ); - } - } else { - navAlignmentSetting.set( navAlignment ); - - if ( siteTitleFontSizeSetting ) { - siteTitleFontSizeSetting.set( siteTitleFontSize ); - } - - if ( api.instance( 'generate_settings[site_title_color]' ) ) { - api.instance( 'generate_settings[site_title_color]' ).set( siteTitleTextColor ); - } - - if ( mobileSiteTitleFontSizeSetting && 'enable' !== mobileHeader ) { - mobileSiteTitleFontSizeSetting.set( mobileSiteTitleFontSize ); - } - } - } ); - - var showRegularHeader, - showRegularHeaderCallback; - - /** - * Determine whether we should display our header controls. - * - * @return {boolean} Whether we should show the regular header. - */ - showRegularHeader = function() { - if ( value.get() ) { - return false; - } - - return true; - }; - - /** - * Update a control's active state according to the navigation as header option. - * - * @param {wp.customize.Control} control The current control. - */ - showRegularHeaderCallback = function( control ) { - var setActiveState = function() { - control.active.set( showRegularHeader() ); - }; - - control.active.validate = showRegularHeader; - setActiveState(); - value.bind( setActiveState ); - }; - - api.control( 'generate_header_helper', showRegularHeaderCallback ); - api.control( 'generate_settings[header_layout_setting]', showRegularHeaderCallback ); - api.control( 'generate_settings[header_inner_width]', showRegularHeaderCallback ); - api.control( 'generate_settings[header_alignment_setting]', showRegularHeaderCallback ); - api.control( 'header_spacing', showRegularHeaderCallback ); - api.control( 'generate_settings[header_background_color]', showRegularHeaderCallback ); - api.control( 'header_text_color', showRegularHeaderCallback ); - api.control( 'header_link_color', showRegularHeaderCallback ); - api.control( 'header_link_hover_color', showRegularHeaderCallback ); - api.control( 'site_tagline_color', showRegularHeaderCallback ); - api.control( 'font_site_tagline_control', showRegularHeaderCallback ); - api.control( 'generate_settings[site_tagline_font_size]', showRegularHeaderCallback ); - api.control( 'generate_settings[nav_position_setting]', showRegularHeaderCallback ); - api.control( 'generate_settings[logo_width]', showRegularHeaderCallback ); - } ); - - /** - * Set the navigation branding font size label on mobile header branding change. - * - * @since 1.8 - */ - api( 'generate_menu_plus_settings[mobile_header_branding]', function( value ) { - value.bind( function( newval ) { - if ( api.instance( 'generate_settings[mobile_site_title_font_size]' ) && 'title' === newval ) { - api.instance( 'generate_settings[mobile_site_title_font_size]' ).set( 20 ); - } - } ); - } ); - - /** - * Set the navigation branding font size label on mobile header change. - * - * @since 1.8 - */ - api( 'generate_menu_plus_settings[mobile_header]', function( value ) { - value.bind( function( newval ) { - var mobileSiteTitleFontSizeSetting = api.instance( 'generate_settings[mobile_site_title_font_size]' ), - mobileSiteTitleFontSize = gpControls.mobileSiteTitleFontSize; - - if ( mobileSiteTitleFontSizeSetting && ! mobileSiteTitleFontSizeSetting._dirty && 20 !== mobileSiteTitleFontSizeSetting.get() ) { - mobileSiteTitleFontSize = mobileSiteTitleFontSizeSetting.get(); - } - - if ( api.instance( 'generate_settings[mobile_site_title_font_size]' ) ) { - if ( 'enable' === newval ) { - api.instance( 'generate_settings[mobile_site_title_font_size]' ).set( 20 ); - } else { - api.instance( 'generate_settings[mobile_site_title_font_size]' ).set( mobileSiteTitleFontSize ); - } - } - } ); - } ); -}( jQuery, wp.customize ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/section-shortcuts.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/section-shortcuts.js deleted file mode 100644 index f1d93985..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/section-shortcuts.js +++ /dev/null @@ -1,46 +0,0 @@ -jQuery( function( $ ) { - $( '.generatepress-shortcuts a' ).on( 'click', function( e ) { - e.preventDefault(); - var section = $( this ).attr( 'data-section' ), - currentSection = $( this ).attr( 'data-current-section' ), - destinationSectionElement = $( '[id$="' + section + '"]' ); - - if ( section ) { - wp.customize.section( section ).focus(); - - destinationSectionElement.find( '.show-shortcuts' ).hide(); - destinationSectionElement.find( '.return-shortcut' ).show(); - destinationSectionElement.find( '.return-shortcut a' ).attr( 'data-return', currentSection ); - } - } ); - - $( '.return-shortcut .dashicons' ).on( 'click', function() { - var container = $( this ).closest( '.generatepress-shortcuts' ); - - container.find( '.show-shortcuts' ).show(); - container.find( '.return-shortcut' ).hide(); - } ); - - $( '.return-shortcut a' ).on( 'click', function( e ) { - e.preventDefault(); - - var section = $( this ).attr( 'data-return' ); - var container = $( this ).closest( '.generatepress-shortcuts' ); - - if ( section ) { - wp.customize.section( section ).focus(); - - container.find( '.show-shortcuts' ).show(); - container.find( '.return-shortcut' ).hide(); - } - } ); - - var customizeSectionBack = $( '.customize-section-back' ); - - if ( customizeSectionBack ) { - customizeSectionBack.on( 'click', function() { - $( '.show-shortcuts' ).show(); - $( '.return-shortcut' ).hide(); - } ); - } -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/selectWoo.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/selectWoo.min.js deleted file mode 100644 index c2de789f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/selectWoo.min.js +++ /dev/null @@ -1 +0,0 @@ -/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.entityDecode=function(a){var b=document.createElement("textarea");return b.innerHTML=a,b.value},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
    ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(''),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],d=this.$selection.find(".select2-selection__rendered"),e=c.entityDecode(this.display(b,d));d.empty().text(e),d.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
      '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
    • ')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
    • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER||c===d.TAB?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js deleted file mode 100644 index d517ffc9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js +++ /dev/null @@ -1,137 +0,0 @@ -wp.customize.controlConstructor[ 'generatepress-pro-range-slider' ] = wp.customize.Control.extend( { - ready() { - 'use strict'; - - var control = this, - value, - controlClass = '.customize-control-generatepress-pro-range-slider', - footerActions = jQuery( '#customize-footer-actions' ); - - // Set up the sliders - jQuery( '.generatepress-slider' ).each( function() { - var _this = jQuery( this ); - var _input = _this.closest( 'label' ).find( 'input[type="number"]' ); - var _text = _input.next( '.value' ); - - _this.slider( { - value: _input.val(), - min: _this.data( 'min' ), - max: _this.data( 'max' ), - step: _this.data( 'step' ), - slide( event, ui ) { - _input.val( ui.value ).change(); - _text.text( ui.value ); - }, - } ); - } ); - - // Update the range value based on the input value - jQuery( controlClass + ' .gp_range_value input[type=number]' ).on( 'input', function() { - value = jQuery( this ).attr( 'value' ); - - if ( '' == value ) { - value = -1; - } - - jQuery( this ).closest( 'label' ).find( '.generatepress-slider' ).slider( 'value', parseFloat( value ) ).change(); - } ); - - // Handle the reset button - jQuery( controlClass + ' .generatepress-reset' ).on( 'click', function() { - var icon = jQuery( this ), - visibleArea = icon.closest( '.gp-range-title-area' ).next( '.gp-range-slider-areas' ).children( 'label:visible' ), - input = visibleArea.find( 'input[type=number]' ), - sliderValue = visibleArea.find( '.generatepress-slider' ), - visualValue = visibleArea.find( '.gp_range_value' ), - resetValue = input.attr( 'data-reset_value' ); - - input.val( resetValue ).change(); - visualValue.find( 'input' ).val( resetValue ); - visualValue.find( '.value' ).text( resetValue ); - - if ( '' == resetValue ) { - resetValue = -1; - } - - sliderValue.slider( 'value', parseFloat( resetValue ) ); - } ); - - // Figure out which device icon to make active on load - jQuery( controlClass + ' .generatepress-range-slider-control' ).each( function() { - var _this = jQuery( this ); - - _this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' ); - _this.find( '.range-option-area:first-child' ).show(); - } ); - - // Do stuff when device icons are clicked - jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) { - var device = jQuery( this ).data( 'option' ); - - jQuery( controlClass + ' .gp-device-controls span' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.addClass( 'selected' ); - _this.siblings().removeClass( 'selected' ); - } - } ); - - jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.show(); - _this.siblings().hide(); - } - } ); - - // Set the device we're currently viewing - wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) ); - } ); - - // Set the selected devices in our control when the Customizer devices are clicked - footerActions.find( '.devices button' ).on( 'click', function() { - var device = jQuery( this ).data( 'device' ); - - jQuery( controlClass + ' .gp-device-controls span' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.addClass( 'selected' ); - _this.siblings().removeClass( 'selected' ); - } - } ); - - jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.show(); - _this.siblings().hide(); - } - } ); - } ); - - // Apply changes when desktop slider is changed - control.container.on( 'input change', '.desktop-range', - function() { - control.settings.desktop.set( jQuery( this ).val() ); - } - ); - - // Apply changes when tablet slider is changed - control.container.on( 'input change', '.tablet-range', - function() { - control.settings.tablet.set( jQuery( this ).val() ); - } - ); - - // Apply changes when mobile slider is changed - control.container.on( 'input change', '.mobile-range', - function() { - control.settings.mobile.set( jQuery( this ).val() ); - } - ); - }, -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js deleted file mode 100644 index 35c205d4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js +++ /dev/null @@ -1,203 +0,0 @@ -( function( $, api ) { - // No longer needed as of 1.2.95 - // Keeping it here just in case - api.controlConstructor.spacing = api.Control.extend( { - ready() { - var control = this; - $( '.generate-number-control', control.container ).on( 'change keyup', - function() { - control.setting.set( $( this ).val() ); - } - ); - }, - } ); - - api.controlConstructor[ 'gp-spacing-slider' ] = api.Control.extend( { - ready() { - var control = this; - $( '.slider-input', control.container ).on( 'change keyup', - function() { - control.setting.set( $( this ).val() ); - } - ); - }, - } ); - - api.controlConstructor[ 'generatepress-spacing' ] = api.Control.extend( { - ready() { - var control = this, - controlClass = '.customize-control-generatepress-spacing', - footerActions = jQuery( '#customize-footer-actions' ); - - // Figure out which device icon to make active on load - jQuery( controlClass + ' .gp-spacing-control-section' ).each( function() { - var _this = jQuery( this ); - _this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' ); - _this.find( '.spacing-values-area:first-child' ).show(); - } ); - - // Do stuff when device icons are clicked - jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) { - var device = jQuery( this ).data( 'option' ); - - jQuery( controlClass + ' .gp-device-controls span' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.addClass( 'selected' ); - _this.siblings().removeClass( 'selected' ); - } - } ); - - jQuery( controlClass + ' .spacing-values-container .spacing-values-area' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.show(); - _this.siblings().hide(); - } - } ); - - // Set the device we're currently viewing - wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) ); - } ); - - // Set the selected devices in our control when the Customizer devices are clicked - footerActions.find( '.devices button' ).on( 'click', function() { - var device = jQuery( this ).data( 'device' ); - jQuery( controlClass + ' .gp-device-controls span' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.addClass( 'selected' ); - _this.siblings().removeClass( 'selected' ); - } - } ); - - jQuery( controlClass + ' .spacing-values-container .spacing-values-area' ).each( function() { - var _this = jQuery( this ); - - if ( device === _this.attr( 'data-option' ) ) { - _this.show(); - _this.siblings().hide(); - } - } ); - } ); - - control.container.on( 'change keyup', '.spacing-top', - function() { - control.settings.desktop_top.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.spacing-right', - function() { - control.settings.desktop_right.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.spacing-bottom', - function() { - control.settings.desktop_bottom.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.spacing-left', - function() { - control.settings.desktop_left.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.tablet-spacing-top', - function() { - control.settings.tablet_top.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.tablet-spacing-right', - function() { - control.settings.tablet_right.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.tablet-spacing-bottom', - function() { - control.settings.tablet_bottom.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.tablet-spacing-left', - function() { - control.settings.tablet_left.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.mobile-spacing-top', - function() { - control.settings.mobile_top.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.mobile-spacing-right', - function() { - control.settings.mobile_right.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.mobile-spacing-bottom', - function() { - control.settings.mobile_bottom.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change keyup', '.mobile-spacing-left', - function() { - control.settings.mobile_left.set( jQuery( this ).val() ); - } - ); - }, - } ); -}( jQuery, wp.customize ) ); - -jQuery( function( $ ) { - $( '.gp-link-spacing' ).on( 'click', function( e ) { - e.preventDefault(); - - // Set up variables - var _this = $( this ), - element = _this.data( 'element' ); - - // Add our linked-values class to the next 4 elements - _this.parent( '.gp-spacing-section' ).prevAll().slice( 0, 4 ).find( 'input' ).addClass( 'linked-values' ).attr( 'data-element', element ); - - // Change our link icon class - _this.hide(); - _this.next( 'span' ).show(); - } ); - - $( '.gp-unlink-spacing' ).on( 'click', function( e ) { - e.preventDefault(); - - // Set up variables - var _this = $( this ); - - // Remove our linked-values class to the next 4 elements - _this.parent( '.gp-spacing-section' ).prevAll().slice( 0, 4 ).find( 'input' ).removeClass( 'linked-values' ).attr( 'data-element', '' ); - - // Change our link icon class - _this.hide(); - _this.prev( 'span' ).show(); - } ); - - $( '.gp-spacing-section' ).on( 'input', '.linked-values', function() { - var _this = $( this ), - data = _this.attr( 'data-element' ), - val = _this.val(), - targetElements = _this.closest( '.spacing-values-area' ).find( '.linked-values[ data-element="' + data + '" ]' ); - - targetElements.each( function() { - var element = $( this ); - element.val( val ).change(); - } ); - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js deleted file mode 100644 index 1d8b2b3c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js +++ /dev/null @@ -1,148 +0,0 @@ -( function( api ) { - api.controlConstructor[ 'gp-pro-customizer-typography' ] = api.Control.extend( { - ready() { - var control = this; - - control.container.on( 'change', '.generatepress-font-family select', - function() { - var _this = jQuery( this ), - _value = _this.val(), - _categoryID = _this.attr( 'data-category' ), - _variantsID = _this.attr( 'data-variants' ); - - // Set our font family - control.settings.family.set( _this.val() ); - - // Bail if our controls don't exist - if ( 'undefined' === typeof control.settings.category || 'undefined' === typeof control.settings.variant ) { - return; - } - - setTimeout( function() { - // Send our request to the generate_get_all_google_fonts_ajax function - var response = jQuery.getJSON( { - type: 'POST', - url: ajaxurl, - data: { - action: 'generate_get_all_google_fonts_ajax', - gp_customize_nonce: gp_customize.nonce, - }, - async: false, - dataType: 'json', - } ); - - // Get our response - var fonts = response.responseJSON; - - // Create an ID from our selected font - var id = _value.split( ' ' ).join( '_' ).toLowerCase(); - - // Set our values if we have them - if ( id in fonts ) { - // Get existing variants if this font is already selected - var got_variants = false; - jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) { - var parent = jQuery( this ).closest( '.generatepress-font-family' ); - - if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) { - if ( ! got_variants ) { - updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val(); - got_variants = true; - } - } - } ); - - // We're using a Google font, so show the variants field - _this.closest( '.generatepress-font-family' ).next( 'div' ).show(); - - // Remove existing variants - jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); - - // Populate our select input with available variants - jQuery.each( fonts[ id ].variants, function( key, value ) { - jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '' ).attr( 'value', value ).text( value ) ); - } ); - - // Set our variants - if ( ! got_variants ) { - control.settings.variant.set( fonts[ id ].variants ); - } else { - control.settings.variant.set( updated_variants ); - } - - // Set our font category - control.settings.category.set( fonts[ id ].category ); - jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category ); - } else { - _this.closest( '.generatepress-font-family' ).next( 'div' ).hide(); - control.settings.category.set( '' ); - control.settings.variant.set( '' ); - jQuery( 'input[name="' + _categoryID + '"' ).val( '' ); - jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); - } - }, 25 ); - } - ); - - control.container.on( 'change', '.generatepress-font-variant select', - function() { - var _this = jQuery( this ); - var variants = _this.val(); - - control.settings.variant.set( variants ); - - jQuery( '.generatepress-font-variant select' ).each( function( key, value ) { - var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' ); - var parent = jQuery( this ).closest( '.generatepress-font-variant' ); - var font_val = api.control( this_control ).settings.family.get(); - - if ( font_val == control.settings.family.get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) { - jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' ); - api.control( this_control ).settings.variant.set( variants ); - } - } ); - } - ); - - control.container.on( 'change', '.generatepress-font-category input', - function() { - control.settings.category.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change', '.generatepress-font-weight select', - function() { - control.settings.weight.set( jQuery( this ).val() ); - } - ); - - control.container.on( 'change', '.generatepress-font-transform select', - function() { - control.settings.transform.set( jQuery( this ).val() ); - } - ); - }, - } ); -}( wp.customize ) ); - -jQuery( document ).ready( function( $ ) { - jQuery( '.generatepress-font-family select' ).selectWoo(); - jQuery( '.generatepress-font-variant' ).each( function( key, value ) { - var _this = $( this ); - value = _this.data( 'saved-value' ); - - if ( value ) { - value = value.toString().split( ',' ); - } - - _this.find( 'select' ).selectWoo().val( value ).trigger( 'change.select2' ); - } ); - - $( '.generatepress-font-family' ).each( function( key, value ) { - var _this = $( this ); - - if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) { - _this.next( '.generatepress-font-variant' ).hide(); - } - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/deprecated.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/deprecated.php deleted file mode 100644 index 00dd2f9e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/deprecated.php +++ /dev/null @@ -1,324 +0,0 @@ -manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); -} -endif; - -if ( ! function_exists( 'generate_backgrounds_is_top_bar_active' ) ) : -/** - * Check to see if the top bar is active - * - * @since 1.3.45 - */ -function generate_backgrounds_is_top_bar_active() -{ - $top_bar = is_active_sidebar( 'top-bar' ) ? true : false; - return apply_filters( 'generate_is_top_bar_active', $top_bar ); -} -endif; - -if ( ! function_exists( 'generate_blog_sanitize_choices' ) ) : -/** - * Sanitize choices - */ -function generate_blog_sanitize_choices( $input, $setting ) { - - // Ensure input is a slug - $input = sanitize_key( $input ); - - // Get list of choices from the control - // associated with the setting - $choices = $setting->manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); -} -endif; - -if ( ! function_exists( 'generate_blog_is_posts_page' ) ) : -/** - * Check to see if we're on a posts page - */ -function generate_blog_is_posts_page() -{ - $blog = ( is_home() || is_archive() || is_attachment() || is_tax() ) ? true : false; - - return $blog; -} -endif; - -if ( ! function_exists( 'generate_blog_is_posts_page_single' ) ) : -/** - * Check to see if we're on a posts page or a single post - */ -function generate_blog_is_posts_page_single() -{ - $blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; - - return $blog; -} -endif; - -if ( ! function_exists( 'generate_blog_is_excerpt' ) ) : -/** - * Check to see if we're displaying excerpts - */ -function generate_blog_is_excerpt() -{ - if ( ! function_exists( 'generate_get_defaults' ) ) - return; - - $generate_settings = wp_parse_args( - get_option( 'generate_settings', array() ), - generate_get_defaults() - ); - - return ( 'excerpt' == $generate_settings['post_content'] ) ? true : false; -} -endif; - -if ( ! function_exists( 'generate_colors_sanitize_hex_color' ) ) : -/** - * Sanitize hex colors - * We don't use the core function as we want to allow empty values - * @since 0.1 - */ -function generate_colors_sanitize_hex_color( $color ) { - if ( '' === $color ) - return ''; - - // 3 or 6 hex digits, or the empty string. - if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) - return $color; - - return ''; -} -endif; - -if ( ! function_exists( 'generate_colors_sanitize_rgba' ) ) : -/** - * Sanitize RGBA colors - * @since 1.3.42 - */ -function generate_colors_sanitize_rgba( $color ) { - if ( '' === $color ) - return ''; - - // If string does not start with 'rgba', then treat as hex - // sanitize the hex color and finally convert hex to rgba - if ( false === strpos( $color, 'rgba' ) ) { - return generate_colors_sanitize_hex_color( $color ); - } - - // By now we know the string is formatted as an rgba color so we need to further sanitize it. - $color = str_replace( ' ', '', $color ); - sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); - return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; - - return ''; -} -endif; - -if ( ! function_exists( 'generate_menu_plus_sanitize_choices' ) ) : -/** - * Sanitize choices - */ -function generate_menu_plus_sanitize_choices( $input, $setting ) { - - // Ensure input is a slug - $input = sanitize_key( $input ); - - // Get list of choices from the control - // associated with the setting - $choices = $setting->manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); -} -endif; - -if ( ! function_exists( 'generate_page_header_is_posts_page' ) ) : -/** - * This is an active_callback - * Check if we're on a posts page - */ -function generate_page_header_is_posts_page() -{ - $blog = ( is_home() || is_archive() || is_attachment() || is_tax() ) ? true : false; - - return $blog; -} -endif; - -if ( ! function_exists( 'generate_page_header_is_posts_page_single' ) ) : -/** - * Check to see if we're on a posts page or a single post - */ -function generate_page_header_is_posts_page_single() -{ - $blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; - - return $blog; -} -endif; - -if ( ! function_exists( 'generate_secondary_nav_sanitize_choices' ) ) : -/** - * Sanitize choices - */ -function generate_secondary_nav_sanitize_choices( $input, $setting ) { - - // Ensure input is a slug - $input = sanitize_key( $input ); - - // Get list of choices from the control - // associated with the setting - $choices = $setting->manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); -} -endif; - -if ( ! function_exists( 'generate_spacing_sanitize_choices' ) ) : -/** - * Sanitize choices - */ -function generate_spacing_sanitize_choices( $input, $setting ) { - - // Ensure input is a slug - $input = sanitize_key( $input ); - - // Get list of choices from the control - // associated with the setting - $choices = $setting->manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); -} -endif; - -if ( ! function_exists( 'generate_premium_sanitize_typography' ) ) : -/** - * Sanitize typography dropdown - * @since 1.1.10 - * @deprecated 1.2.95 - */ -function generate_premium_sanitize_typography( $input ) -{ - if ( ! function_exists( 'generate_get_all_google_fonts' ) || ! function_exists( 'generate_typography_default_fonts' ) ) { - return 'Open Sans'; - } - - // Grab all of our fonts - $fonts = generate_get_all_google_fonts(); - - // Loop through all of them and grab their names - $font_names = array(); - foreach ( $fonts as $k => $fam ) { - $font_names[] = $fam['name']; - } - - // Get all non-Google font names - $not_google = generate_typography_default_fonts(); - - // Merge them both into one array - $valid = array_merge( $font_names, $not_google ); - - // Sanitize - if ( in_array( $input, $valid ) ) { - return $input; - } else { - return 'Open Sans'; - } -} -endif; - -if ( ! function_exists( 'generate_typography_sanitize_choices' ) ) : -/** - * Sanitize choices - * @since 1.3.24 - */ -function generate_typography_sanitize_choices( $input, $setting ) { - - // Ensure input is a slug - $input = sanitize_key( $input ); - - // Get list of choices from the control - // associated with the setting - $choices = $setting->manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); -} -endif; - -if ( ! function_exists( 'generate_page_header_sanitize_choices' ) ) : -/** - * Sanitize our select inputs - */ -function generate_page_header_sanitize_choices( $input, $setting ) { - - // Ensure input is a slug - $input = sanitize_key( $input ); - - // Get list of choices from the control - // associated with the setting - $choices = $setting->manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); -} -endif; - -if ( ! function_exists( 'generate_page_header_sanitize_hex_color' ) ) : -/** - * Sanitize colors - * We don't use the core function as we want to allow empty values - */ -function generate_page_header_sanitize_hex_color( $color ) { - if ( '' === $color ) - return ''; - - // 3 or 6 hex digits, or the empty string. - if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) - return $color; - - return ''; -} -endif; - -if ( ! function_exists( 'generate_page_header_sanitize_html' ) ) : -/** - * Sanitize our fields that accept HTML - */ -function generate_page_header_sanitize_html( $input ) -{ - return wp_kses_post( $input ); -} -endif; \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/sanitize.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/sanitize.php deleted file mode 100644 index a0cb7efc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/sanitize.php +++ /dev/null @@ -1,131 +0,0 @@ -manager->get_control( $setting->id )->choices; - - // If the input is a valid key, return it; - // otherwise, return the default - return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); - } -} - -if ( ! function_exists( 'generate_premium_sanitize_checkbox' ) ) { - /** - * Sanitize checkbox - */ - function generate_premium_sanitize_checkbox( $checked ) { - // Boolean check. - return ( ( isset( $checked ) && true == $checked ) ? true : false ); - } -} - -if ( ! function_exists( 'generate_premium_sanitize_hex_color' ) ) { - /** - * Sanitize hex colors - * We don't use the core function as we want to allow empty values - * - * @since 0.1 - */ - function generate_premium_sanitize_hex_color( $color ) { - if ( '' === $color ) { - return ''; - } - - // 3 or 6 hex digits, or the empty string. - if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { - return $color; - } - - return ''; - } -} - -if ( ! function_exists( 'generate_premium_sanitize_rgba' ) ) { - /** - * Sanitize RGBA colors - * - * @since 1.3.42 - */ - function generate_premium_sanitize_rgba( $color ) { - if ( '' === $color ) { - return ''; - } - - // If string does not start with 'rgba', then treat as hex - // sanitize the hex color and finally convert hex to rgba - if ( false === strpos( $color, 'rgba' ) ) { - return generate_premium_sanitize_hex_color( $color ); - } - - // By now we know the string is formatted as an rgba color so we need to further sanitize it. - $color = str_replace( ' ', '', $color ); - sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); - return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; - - return ''; - } -} - -if ( ! function_exists( 'generate_premium_sanitize_decimal_integer' ) ) { - /** - * Sanitize integers that can use decimals - * - * @since 1.3.41 - */ - function generate_premium_sanitize_decimal_integer( $input ) { - return abs( floatval( $input ) ); - } -} - -/** - * Sanitize integers that can use decimals - * @since 1.4 - */ -function generate_premium_sanitize_decimal_integer_empty( $input ) { - if ( '' == $input ) { - return ''; - } - - return abs( floatval( $input ) ); -} - -if ( ! function_exists( 'generate_premium_sanitize_html' ) ) { - /** - * Sanitize our fields that accept HTML - */ - function generate_premium_sanitize_html( $input ) { - return wp_kses_post( $input ); - } -} - -function generate_premium_sanitize_variants( $input ) { - if ( is_array( $input ) ) { - $input = implode( ',', $input ); - } - - return sanitize_text_field( $input ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/select2/select2.full.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/select2/select2.full.min.js deleted file mode 100644 index fa781916..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/select2/select2.full.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ -!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w,l;function b(e,t){return r.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('
        ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):rthis.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
          '),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.isDisabled()){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('
        • ×
        • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×
          ');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
        • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i
          ');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a ` - - -1, - 'orderby' => 'title', - 'post_type' => 'generate_page_header', - 'suppress_filters' => false, - )); - - $options[ $type ] = ! isset( $options[ $type ] ) ? '' : $options[ $type ]; - - foreach( $page_headers as $header ) { - printf( '', - $header->ID, - selected( $options[ $type ], $header->ID ), - $header->post_title - ); - } - ?> - - ( window_height - offset ) ) { - jQuery( '.fullscreen-enabled' ).attr( 'style', 'height: initial !important' ); - } -} - -jQuery(document).ready(function($) { - - // Run the header height function - generateHeaderHeight(); - - // Set up the resize timer - var generateResizeTimer; - - if ( jQuery('.generate-page-header.fullscreen-enabled')[0] ) { - // Initiate full window height on resize - var width = $(window).width(); - $(window).resize(function() { - if($(window).width() != width){ - clearTimeout(generateResizeTimer); - generateResizeTimer = setTimeout(generateHeaderHeight, 200); - width = $(window).width(); - } - }); - - $( window ).on( "orientationchange", function( event ) { - if($(window).width() != width){ - clearTimeout(generateResizeTimer); - generateResizeTimer = setTimeout(generateHeaderHeight, 200); - width = $(window).width(); - } - }); - } - -}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/full-height.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/full-height.min.js deleted file mode 100644 index dd988e11..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/full-height.min.js +++ /dev/null @@ -1 +0,0 @@ -function generateHeaderHeight(){if(jQuery(".fullscreen-enabled").length){var a,b=jQuery(window).height();a=jQuery(".inside-page-header").length?jQuery(".inside-page-header"):jQuery(".generate-inside-combined-content").length?jQuery(".generate-inside-combined-content"):jQuery(".generate-inside-page-header-content");var c=jQuery(".fullscreen-enabled").offset().top;jQuery(".fullscreen-enabled").css("height",b-c+"px"),a.outerHeight()>b-c&&jQuery(".fullscreen-enabled").attr("style","height: initial !important")}}function generateHeaderParallax(){var a=jQuery(".menu-toggle");if(!a.is(":visible")&&jQuery(".generate-page-header.parallax-enabled")[0]){if(jQuery(".page-header-contained")[0])var b=jQuery(".generate-page-header.parallax-enabled .inside-content-header");else var b=jQuery(".generate-page-header.parallax-enabled");var c=jQuery(this).scrollTop(),d=jQuery(".generate-page-header.parallax-enabled").data("parallax-speed");return b.css("background-position","center "+parseInt(-c/d)+"px")}}jQuery(document).ready(function(a){generateHeaderHeight();var b;if(jQuery(".generate-page-header.parallax-enabled")[0]&&a(document).scroll(function(){generateHeaderParallax()}),jQuery(".generate-page-header.fullscreen-enabled")[0]){var c=a(window).width();a(window).resize(function(){a(window).width()!=c&&(clearTimeout(b),b=setTimeout(generateHeaderHeight,200),c=a(window).width())}),a(window).on("orientationchange",function(d){a(window).width()!=c&&(clearTimeout(b),b=setTimeout(generateHeaderHeight,200),c=a(window).width())})}}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js deleted file mode 100644 index d78004e0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Vide - v0.5.0 - * Easy as hell jQuery plugin for video backgrounds. - * http://vodkabears.github.io/vide/ - * - * Made by Ilya Makarov - * Under MIT License - */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery)}(this,function(a){"use strict";function b(a){var b,c,d,e,f,g,h,i={};for(f=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",").split(","),h=0,g=f.length;g>h&&(c=f[h],-1===c.search(/^(http|https|ftp):\/\//)&&-1!==c.search(":"));h++)b=c.indexOf(":"),d=c.substring(0,b),e=c.substring(b+1),e||(e=void 0),"string"==typeof e&&(e="true"===e||("false"===e?!1:e)),"string"==typeof e&&(e=isNaN(e)?e:+e),i[d]=e;return null==d&&null==e?a:i}function c(a){a=""+a;var b,c,d,e=a.split(/\s+/),f="50%",g="50%";for(d=0,b=e.length;b>d;d++)c=e[d],"left"===c?f="0%":"right"===c?f="100%":"top"===c?g="0%":"bottom"===c?g="100%":"center"===c?0===d?f="50%":g="50%":0===d?f=c:g=c;return{x:f,y:g}}function d(b,c){var d=function(){c(this.src)};a('').load(d),a('').load(d),a('').load(d),a('').load(d)}function e(c,d,e){if(this.$element=a(c),"string"==typeof d&&(d=b(d)),e?"string"==typeof e&&(e=b(e)):e={},"string"==typeof d)d=d.replace(/\.\w*$/,"");else if("object"==typeof d)for(var f in d)d.hasOwnProperty(f)&&(d[f]=d[f].replace(/\.\w*$/,""));this.settings=a.extend({},g,e),this.path=d;try{this.init()}catch(i){if(i.message!==h)throw i}}var f="vide",g={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:"50% 50%",posterType:"detect",resizing:!0,bgColor:"transparent",className:""},h="Not implemented";e.prototype.init=function(){var b,e,g=this,i=g.path,j=i,k="",l=g.$element,m=g.settings,n=c(m.position),o=m.posterType;e=g.$wrapper=a("
          ").addClass(m.className).css({position:"absolute","z-index":-1,top:0,left:0,bottom:0,right:0,overflow:"hidden","-webkit-background-size":"cover","-moz-background-size":"cover","-o-background-size":"cover","background-size":"cover","background-color":m.bgColor,"background-repeat":"no-repeat","background-position":n.x+" "+n.y}),"object"==typeof i&&(i.poster?j=i.poster:i.mp4?j=i.mp4:i.webm?j=i.webm:i.ogv&&(j=i.ogv)),"detect"===o?d(j,function(a){e.css("background-image","url("+a+")")}):"none"!==o&&e.css("background-image","url("+j+"."+o+")"),"static"===l.css("position")&&l.css("position","relative"),l.prepend(e),"object"==typeof i?(i.mp4&&(k+=''),i.webm&&(k+=''),i.ogv&&(k+=''),b=g.$video=a("")):b=g.$video=a('');try{b.prop({autoplay:m.autoplay,loop:m.loop,volume:m.volume,muted:m.muted,defaultMuted:m.muted,playbackRate:m.playbackRate,defaultPlaybackRate:m.playbackRate})}catch(p){throw new Error(h)}b.css({margin:"auto",position:"absolute","z-index":-1,top:n.y,left:n.x,"-webkit-transform":"translate(-"+n.x+", -"+n.y+")","-ms-transform":"translate(-"+n.x+", -"+n.y+")","-moz-transform":"translate(-"+n.x+", -"+n.y+")",transform:"translate(-"+n.x+", -"+n.y+")",visibility:"hidden",opacity:0}).one("canplaythrough."+f,function(){g.resize()}).one("playing."+f,function(){b.css({visibility:"visible",opacity:1}),e.css("background-image","none")}),l.on("resize."+f,function(){m.resizing&&g.resize()}),e.append(b)},e.prototype.getVideoObject=function(){return this.$video[0]},e.prototype.resize=function(){if(this.$video){var a=this.$wrapper,b=this.$video,c=b[0],d=c.videoHeight,e=c.videoWidth,f=a.height(),g=a.width();g/e>f/d?b.css({width:g+2,height:"auto"}):b.css({width:"auto",height:f+2})}},e.prototype.destroy=function(){delete a[f].lookup[this.index],this.$video&&this.$video.off(f),this.$element.off(f).removeData(f),this.$wrapper.remove()},a[f]={lookup:[]},a.fn[f]=function(b,c){var d;return this.each(function(){d=a.data(this,f),d&&d.destroy(),d=new e(this,b,c),d.index=a[f].lookup.push(d)-1,a.data(this,f,d)}),this},a(document).ready(function(){var b=a(window);b.on("resize."+f,function(){for(var b,c=a[f].lookup.length,d=0;c>d;d++)b=a[f].lookup[d],b&&b.settings.resizing&&b.resize()}),b.on("unload."+f,function(){return!1}),a(document).find("[data-"+f+"-bg]").each(function(b,c){var d=a(c),e=d.data(f+"-options"),g=d.data(f+"-bg");d[f](g,e)})})});jQuery(document).ready(function($) {var page_header_content = $( '.page-header-content' );if ( page_header_content.length ) {if ( page_header_content.hasClass( 'grid-container' ) ) {$( '.inside-page-header-container' ).data('vide').getVideoObject().play();} else {page_header_content.data('vide').getVideoObject().play();}}}); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/lc_switch.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/lc_switch.js deleted file mode 100644 index 89eae365..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/lc_switch.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * lc_switch.js - * Version: 1.0 - * Author: LCweb - Luca Montanari - * Website: http://www.lcweb.it - * Licensed under the MIT license - */ - -(function($){ - if(typeof($.fn.lc_switch) != 'undefined') {return false;} // prevent dmultiple scripts inits - - $.fn.lc_switch = function(on_text, off_text) { - - // destruct - $.fn.lcs_destroy = function() { - - $(this).each(function() { - var $wrap = $(this).parents('.lcs_wrap'); - - $wrap.children().not('input').remove(); - $(this).unwrap(); - }); - - return true; - }; - - - // set to ON - $.fn.lcs_on = function() { - - $(this).each(function() { - var $wrap = $(this).parents('.lcs_wrap'); - var $input = $wrap.find('input'); - - if(typeof($.fn.prop) == 'function') { - $wrap.find('input').prop('checked', true); - } else { - $wrap.find('input').attr('checked', true); - } - - $wrap.find('input').trigger('lcs-on'); - $wrap.find('input').trigger('lcs-statuschange'); - $wrap.find('.lcs_switch').removeClass('lcs_off').addClass('lcs_on'); - - // if radio - disable other ones - if( $wrap.find('.lcs_switch').hasClass('lcs_radio_switch') ) { - var f_name = $input.attr('name'); - $wrap.parents('form').find('input[name='+f_name+']').not($input).lcs_off(); - } - }); - - return true; - }; - - - // set to OFF - $.fn.lcs_off = function() { - - $(this).each(function() { - var $wrap = $(this).parents('.lcs_wrap'); - - if(typeof($.fn.prop) == 'function') { - $wrap.find('input').prop('checked', false); - } else { - $wrap.find('input').attr('checked', false); - } - - $wrap.find('input').trigger('lcs-off'); - $wrap.find('input').trigger('lcs-statuschange'); - $wrap.find('.lcs_switch').removeClass('lcs_on').addClass('lcs_off'); - }); - - return true; - }; - - - // construct - return this.each(function(){ - - // check against double init - if( !$(this).parent().hasClass('lcs_wrap') ) { - - // default texts - var ckd_on_txt = (typeof(on_text) == 'undefined') ? 'ON' : on_text; - var ckd_off_txt = (typeof(off_text) == 'undefined') ? 'OFF' : off_text; - - // labels structure - var on_label = (ckd_on_txt) ? '
          '+ ckd_on_txt +'
          ' : ''; - var off_label = (ckd_off_txt) ? '
          '+ ckd_off_txt +'
          ' : ''; - - - // default states - var disabled = ($(this).is(':disabled')) ? true: false; - var active = ($(this).is(':checked')) ? true : false; - - var status_classes = ''; - status_classes += (active) ? ' lcs_on' : ' lcs_off'; - if(disabled) {status_classes += ' lcs_disabled';} - - - // wrap and append - var structure = - '
          ' + - '
          ' + - on_label + off_label + - '
          '; - - if( $(this).is(':input') && ($(this).attr('type') == 'checkbox' || $(this).attr('type') == 'radio') ) { - - $(this).wrap('
          '); - $(this).parent().append(structure); - - $(this).parent().find('.lcs_switch').addClass('lcs_'+ $(this).attr('type') +'_switch'); - } - } - }); - }; - - - - // handlers - $(document).ready(function() { - - // on click - $(document).delegate('.lcs_switch:not(.lcs_disabled)', 'click tap', function(e) { - - if( $(this).hasClass('lcs_on') ) { - if( !$(this).hasClass('lcs_radio_switch') ) { // not for radio - $(this).lcs_off(); - } - } else { - $(this).lcs_on(); - } - }); - - - // on checkbox status change - $(document).delegate('.lcs_wrap input', 'change', function() { - - if( $(this).is(':checked') ) { - $(this).lcs_on(); - } else { - $(this).lcs_off(); - } - }); - - }); - -})(jQuery); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/metabox.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/metabox.js deleted file mode 100644 index f1c0f66e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/metabox.js +++ /dev/null @@ -1,220 +0,0 @@ -jQuery(document).ready(function($) { - $( '#generate-tabs-container input[type="checkbox"]' ).lc_switch( '', '' ); - - $( '.generate-tabs-menu a' ).on( 'click', function( event ) { - event.preventDefault(); - $( this ).parent().addClass( 'generate-current' ); - $( this ).parent().siblings().removeClass( 'generate-current' ); - var tab = $( this ).attr( 'href' ); - $( '.generate-tab-content' ).not(tab).css( 'display', 'none' ); - $( tab ).fadeIn( 100 ); - - if ( '#generate-image-tab' == tab || '#generate-content-tab' == tab ) { - $( '.show-in-excerpt' ).show(); - } else { - $( '.show-in-excerpt' ).hide(); - } - } ); - - $( '#_meta-generate-page-header-content' ).on( 'input change', function() { - if ( this.value.length ) { - $( '.page-header-content-required' ).hide(); - } else { - $( '.page-header-content-required' ).show(); - } - }); -}); - -jQuery(window).on('load', function() { - if ( jQuery( '#_meta-generate-page-header-enable-image-crop' ).val() == 'enable' ) { - jQuery( '#crop-enabled' ).show(); - } - - jQuery( '#_meta-generate-page-header-enable-image-crop' ).change(function () { - if ( jQuery( this ).val() === 'enable' ) { - jQuery( '#crop-enabled' ).show(); - } else { - jQuery( '#crop-enabled' ).hide(); - } - }); - - if ( jQuery( '#_meta-generate-page-header-image-background' ).is( ':checked' ) ) { - jQuery( '.parallax' ).show(); - } else { - jQuery( '.parallax' ).hide(); - } - - jQuery('body').delegate('.image-background', 'lcs-statuschange', function() { - if (jQuery(this).is(":checked")) { - jQuery('.parallax').show(); - } else { - jQuery('.parallax').hide(); - jQuery('#_meta-generate-page-header-image-background-fixed').lcs_off(); - } - }); - - if ( jQuery('#_meta-generate-page-header-full-screen').is(':checked')) { - jQuery('.vertical-center').show(); - } else { - jQuery('.vertical-center').hide(); - } - - jQuery('body').delegate('#_meta-generate-page-header-full-screen', 'lcs-statuschange', function() { - if (jQuery(this).is(":checked")) { - jQuery('.vertical-center').show(); - } else { - jQuery('.vertical-center').hide(); - jQuery('#_meta-generate-page-header-vertical-center').lcs_off(); - } - }); - - if ( jQuery('#_meta-generate-page-header-transparent-navigation').is(':checked')) { - jQuery('.navigation-colors').show(); - } else { - jQuery('.navigation-colors').hide(); - } - - jQuery('body').delegate('#_meta-generate-page-header-transparent-navigation', 'lcs-statuschange', function() { - if (jQuery(this).is(":checked")) { - jQuery('.navigation-colors').show(); - } else { - jQuery('.navigation-colors').hide(); - } - }); - - if ( jQuery('#_meta-generate-page-header-combine').is(':checked')) { - jQuery('.combination-options').show(); - } else { - jQuery('.combination-options').hide(); - } - - jQuery('body').delegate('#_meta-generate-page-header-combine', 'lcs-statuschange', function() { - if (jQuery(this).is(":checked")) { - jQuery('.combination-options').show(); - } else { - jQuery('.combination-options').hide(); - } - }); - - if ( jQuery('#_meta-generate-page-header-image-background-type').val() == '' ) { - jQuery('.vertical-center').hide(); - jQuery('.fullscreen').hide(); - } - jQuery('#_meta-generate-page-header-image-background-type').change(function () { - if (jQuery(this).val() === '') { - jQuery('.vertical-center').hide(); - jQuery('#_meta-generate-page-header-vertical-center').lcs_off(); - jQuery('.fullscreen').hide(); - jQuery('#_meta-generate-page-header-full-screen').lcs_off(); - } else { - //jQuery('.vertical-center').show(); - jQuery('.fullscreen').show(); - } - }); - - var $set_button = jQuery('.generate-upload-file'); - /** - * open the media manager - */ - $set_button.click(function (e) { - e.preventDefault(); - - var $thisbutton = jQuery(this); - var frame = wp.media({ - title : $thisbutton.data('title'), - multiple : false, - library : { type : $thisbutton.data('type') }, - button : { text : $thisbutton.data('insert') } - }); - // close event media manager - frame.on('select', function () { - var attachment = frame.state().get('selection').first().toJSON(); - // set the file - //set_dfi(attachment.url); - $thisbutton.prev('input').val(attachment.url); - $thisbutton.nextAll('input.image-id').val(attachment.id); - if ( $thisbutton.data('prev') === true ) { - $thisbutton.prev('input').prevAll('#preview-image').children('.saved-image').remove(); - $thisbutton.prev('input').prevAll('#preview-image').append(''); - } - $thisbutton.nextAll( '.generate-page-header-remove-image' ).show(); - if ( 'upload_image' == $thisbutton.prev( 'input' ).attr( 'id' ) ) { - jQuery( '.featured-image-message' ).hide(); - jQuery( '.page-header-image-settings' ).show(); - jQuery( '.generate-page-header-set-featured-image' ).hide(); - } - }); - - // everthing is set open the media manager - frame.open(); - }); -}); -jQuery(document).ready(function($) { - $('#generate-tabs-container .color-picker').wpColorPicker(); - - jQuery( '.generate-page-header-remove-image' ).on( 'click', function( e ) { - e.preventDefault(); - var input = jQuery( this ).data( 'input' ); - var input_id = jQuery( this ).data( 'input-id' ); - var preview = jQuery( this ).data( 'prev' ); - jQuery( input ).attr( 'value', '' ); - jQuery( input_id ).attr( 'value', '' ); - jQuery( preview ).children( '.saved-image' ).remove(); - jQuery( this ).hide(); - if ( '-1' == jQuery( '#_thumbnail_id' ).attr( 'value' ) ) { - jQuery( '.page-header-image-settings' ).hide(); - jQuery( '.generate-page-header-set-featured-image' ).show(); - - } else { - jQuery( '.generate-page-header-set-featured-image' ).hide(); - jQuery( '.page-header-image-settings' ).show(); - jQuery( '.featured-image-message' ).show(); - } - return false; - }); - - $('#postimagediv').on( 'click', '#remove-post-thumbnail', function() { - // The featured image is gone, so we can hide the message - jQuery( '.featured-image-message' ).hide(); - - // If there's no other image set, we can hide the image settings - if ( '' == jQuery( '#_meta-generate-page-header-image-id' ).attr( 'value' ) ) { - jQuery( '.page-header-image-settings' ).hide(); - jQuery( '.generate-page-header-set-featured-image' ).show(); - } - - // No more featured image means we can show the 'show excerpt' option - jQuery( '.show-in-excerpt' ).show(); - - return false; - }); - - wp.media.featuredImage.frame().on('select', function() { - - // We have a featured image, so the 'show excerpt' function isn't necessary - jQuery( '.show-in-excerpt' ).hide(); - - // We can stop here if we have a custom image set - if ( '' !== jQuery( '#_meta-generate-page-header-image-id' ).attr( 'value' ) ) - return; - - // Hide the set your featured image message - jQuery( '.generate-page-header-set-featured-image' ).hide(); - - // Show the "using feaured image" message - jQuery( '.featured-image-message' ).show(); - - // Show the image settings (image link, resizing etc..) - jQuery( '.page-header-image-settings' ).show(); - }); - - $( '.generate-featured-image, .generate-page-header-set-featured-image a' ).on( 'click', function( event ) { - event.preventDefault(); - - // Stop propagation to prevent thickbox from activating. - event.stopPropagation(); - - // Open the featured image modal - wp.media.featuredImage.frame().open(); - }); -}); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.js deleted file mode 100644 index 8fe3b26c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.js +++ /dev/null @@ -1,17 +0,0 @@ -function generate_parallax_element( selector, context ) { - context = context || document; - var elements = context.querySelectorAll( selector ); - return Array.prototype.slice.call( elements ); -} - -window.addEventListener( "scroll", function() { - var scrolledHeight= window.pageYOffset; - generate_parallax_element( ".parallax-enabled" ).forEach( function( el, index, array ) { - var limit = el.offsetTop + el.offsetHeight; - if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) { - el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / el.getAttribute( 'data-parallax-speed' ) + "px"; - } else { - el.style.backgroundPositionY = "0"; - } - }); -}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.min.js deleted file mode 100644 index 8263a901..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.min.js +++ /dev/null @@ -1 +0,0 @@ -function generate_parallax_element(e,t){var a=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(a)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_parallax_element(".parallax-enabled").forEach(function(t,a,o){var r=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=r?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-parallax-speed")+"px":t.style.backgroundPositionY="0"})}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/metabox.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/metabox.php deleted file mode 100644 index 76b25c4a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/metabox.php +++ /dev/null @@ -1,782 +0,0 @@ - true ); - $post_types = get_post_types( $args ); - - // Bail if we're not using the old Page Header meta box - if ( 'generate_page_header' !== get_post_type() && '' == $stored_meta['_meta-generate-page-header-content'][0] && '' == $stored_meta['_meta-generate-page-header-image'][0] && '' == $stored_meta['_meta-generate-page-header-image-id'][0] ) { - if ( ! defined( 'GENERATE_LAYOUT_META_BOX' ) ) { - foreach ( $post_types as $type ) { - if ( 'attachment' !== $type ) { - add_meta_box( - 'generate_select_page_header_meta_box', - __( 'Page Header', 'gp-premium' ), - 'generate_do_select_page_header_meta_box', - $type, - 'normal', - 'high' - ); - } - } - } - - if ( ! apply_filters( 'generate_page_header_legacy_metabox', false ) ) { - return; - } - } - - array_push( $post_types, 'generate_page_header' ); - foreach ($post_types as $type) { - if ( 'attachment' !== $type ) { - add_meta_box( - 'generate_page_header_meta_box', - __( 'Page Header', 'gp-premium' ), - 'show_generate_page_header_meta_box', - $type, - 'normal', - 'high' - ); - } - } - } -} - -if ( ! function_exists( 'generate_page_header_metabox_enqueue' ) ) { - add_action( 'admin_enqueue_scripts', 'generate_page_header_metabox_enqueue' ); - /** - * Add our metabox scripts - */ - function generate_page_header_metabox_enqueue( $hook ) { - // I prefer to enqueue the styles only on pages that are using the metaboxes - if ( in_array( $hook, array( "post.php", "post-new.php" ) ) ) { - $args = array( 'public' => true ); - $post_types = get_post_types( $args ); - - $screen = get_current_screen(); - $post_type = $screen->id; - - if ( in_array( $post_type, (array) $post_types ) || 'generate_page_header' == get_post_type() ){ - wp_enqueue_media(); - wp_enqueue_script( 'wp-color-picker' ); - wp_enqueue_style( 'wp-color-picker' ); - wp_enqueue_script( 'wp-color-picker-alpha', GP_LIBRARY_DIRECTORY_URL . 'alpha-color-picker/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '3.0.0', true ); - - wp_add_inline_script( - 'wp-color-picker-alpha', - 'jQuery( function() { jQuery( ".color-picker" ).wpColorPicker(); } );' - ); - - wp_enqueue_style( 'generate-page-header-metabox', plugin_dir_url( __FILE__ ) . 'css/metabox.css', array(), GENERATE_PAGE_HEADER_VERSION ); - wp_enqueue_script( 'generate-lc-switch', plugin_dir_url( __FILE__ ) . 'js/lc_switch.js', array( 'jquery' ), GENERATE_PAGE_HEADER_VERSION, false ); - wp_enqueue_script( 'generate-page-header-metabox', plugin_dir_url( __FILE__ ) . 'js/metabox.js', array( 'jquery','generate-lc-switch', 'wp-color-picker' ), GENERATE_PAGE_HEADER_VERSION, false ); - - if ( function_exists( 'wp_add_inline_script' ) && function_exists( 'generate_get_default_color_palettes' ) ) { - // Grab our palette array and turn it into JS - $palettes = json_encode( generate_get_default_color_palettes() ); - - // Add our custom palettes - // json_encode takes care of escaping - wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' ); - } - } - } - } -} - -/** - * Build our Select Page Header meta box. - * - * @since 1.4 - */ -function generate_do_select_page_header_meta_box( $post ) { - wp_nonce_field( basename( __FILE__ ), 'generate_page_header_nonce' ); - $stored_meta = get_post_meta( $post->ID ); - $stored_meta['_generate-select-page-header'][0] = ( isset( $stored_meta['_generate-select-page-header'][0] ) ) ? $stored_meta['_generate-select-page-header'][0] : ''; - - $page_headers = get_posts(array( - 'posts_per_page' => -1, - 'orderby' => 'title', - 'post_type' => 'generate_page_header', - )); - - if ( count( $page_headers ) > 0 ) : - ?> -

          - -

          - -

          - create one?', 'gp-premium' ), - esc_url( admin_url( 'post-new.php?post_type=generate_page_header' ) ) - ); - ?> -

          -

          %1$s

          ', - __( 'Content is required for the below settings to work.', 'gp-premium' ), - '' !== generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true ) ? 'style="display:none"' : '' - ); - - if ( '' !== generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true ) ) { - ?> - - -
          -
            -
          • - -
          • - -
          • - -
          • - -
          • - -
          • - - -
          • - -
          • - - -
          • - -
          • - - -
            > -

            -
            - /> -

            -
            - -
          -
          -
          - - - -
          - - - -
          - - - - - - - - -
          > -

          -
          - -

          - -

          -
          - -

          - - -
          -
          - -
          - - -

          - -
          - -
          -

          - /> - -

          - -

          - /> - -

          - -

          - /> - -

          - -

          - /> - -

          - -

          - /> - -

          - -

          - /> - -

          - -

          - /> - -

          -
          - -
          -

          -
          - -

          - -

          -
          - -

          - -

          -
          - -

          - -

          -
          - - -

          - -

          -
          - - -

          -
          - -
          -

          -
          - -

          - -

          -
          - -

          - -

          -
          - -

          - -

          -
          - -

          -
          -
          -
          -
          - - - - -
          - -

          - -

          - -
          - - - -
          - - - - - - - - -

          - -

          - -

          - -
          - - - -
          - - - - - - - - - -
          - - - -
          -
          - 'FILTER_CONTENT', - '_meta-generate-page-header-image' => 'FILTER_SANITIZE_URL', - '_meta-generate-page-header-image-id' => 'FILTER_SANITIZE_NUMBER_INT', - '_meta-generate-page-header-image-link' => 'FILTER_SANITIZE_URL', - '_meta-generate-page-header-enable-image-crop' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-crop' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-width' => 'FILTER_SANITIZE_NUMBER_INT', - '_meta-generate-page-header-image-height' => 'FILTER_SANITIZE_NUMBER_INT', - '_meta-generate-page-header-image-background-type' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-inner-container' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-alignment' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-spacing' => 'FILTER_SANITIZE_NUMBER_INT', - '_meta-generate-page-header-image-background-spacing-unit' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-left-right-padding' => 'FILTER_SANITIZE_NUMBER_INT', - '_meta-generate-page-header-left-right-padding-unit' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-color' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-text-color' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-link-color' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-link-color-hover' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-navigation-background' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-navigation-text' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-navigation-background-hover' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-navigation-text-hover' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-navigation-background-current' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-navigation-text-current' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-site-title' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-site-tagline' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-video' => 'FILTER_SANITIZE_URL', - '_meta-generate-page-header-video-ogv' => 'FILTER_SANITIZE_URL', - '_meta-generate-page-header-video-webm' => 'FILTER_SANITIZE_URL', - '_meta-generate-page-header-video-overlay' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-content-autop' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-content-padding' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-full-screen' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-vertical-center' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-fixed' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-image-background-overlay' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-combine' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-absolute-position' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-transparent-navigation' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-add-to-excerpt' => 'FILTER_SANITIZE_STRING', - '_meta-generate-page-header-logo' => 'FILTER_SANITIZE_URL', - '_meta-generate-page-header-logo-id' => 'FILTER_SANITIZE_NUMBER_INT', - '_meta-generate-page-header-navigation-logo' => 'FILTER_SANITIZE_URL', - '_meta-generate-page-header-navigation-logo-id' => 'FILTER_SANITIZE_NUMBER_INT', - ); - - if ( ! defined( 'GENERATE_LAYOUT_META_BOX' ) ) { - $options[ '_generate-select-page-header' ] = 'FILTER_SANITIZE_NUMBER_INT'; - } - - foreach ( $options as $key => $sanitize ) { - if ( 'FILTER_SANITIZE_STRING' == $sanitize ) { - $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING ); - } elseif ( 'FILTER_SANITIZE_URL' == $sanitize ) { - $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL ); - } elseif ( 'FILTER_SANITIZE_NUMBER_INT' == $sanitize ) { - $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT ); - } elseif ( 'FILTER_CONTENT' == $sanitize && isset( $_POST[ $key ] ) ) { - if ( current_user_can( 'unfiltered_html' ) ) { - $value = $_POST[ $key ]; - } else { - $value = wp_kses_post( $_POST[ $key ] ); - } - } else { - $value = filter_input( INPUT_POST, $key, FILTER_DEFAULT ); - } - - if ( $value ) { - update_post_meta( $post_id, $key, $value ); - } else { - delete_post_meta( $post_id, $key ); - } - } - } -} - -add_action( 'add_meta_boxes', 'generate_page_header_tags_add_meta_box' ); -/** - * Add our Template Tags meta box. - * - * @param WP_Post $post Current post object. - * - * @since 1.4 - */ -function generate_page_header_tags_add_meta_box( $post ) { - add_meta_box( 'generate_page_header_tags', __( 'Template Tags', 'gp-premium' ), 'generate_page_header_tags_do_meta_box', 'generate_page_header', 'side', 'low' ); -} - -/** - * Meta box display callback. - * - * @param WP_Post $post Current post object. - * - * @since 1.4 - */ -function generate_page_header_tags_do_meta_box( $post ) { - ?> - -

          - - -

          - - -

          - - -

          - - -

          - - - -
        • - ( ! empty( $options[ 'background_video' ] ) ) ? 'mp4:' . esc_url( $options[ 'background_video' ] ) : null, - 'ogv' => ( ! empty( $options[ 'background_video_ogv' ] ) ) ? 'ogv:' . esc_url( $options[ 'background_video_ogv' ] ) : null, - 'webm' => ( ! empty( $options[ 'background_video_webm' ] ) ) ? 'webm:' . esc_url( $options[ 'background_video_webm' ] ) : null, - 'poster' => ( ! empty( $image_url ) ) ? 'poster:' . esc_url( $image_url ) : null - ); - - // Add our videos to a string - $video_output = array(); - foreach( $video_types as $video => $val ) { - $video_output[] = $val; - } - - $video = null; - // Video variable - if ( $video_enabled && '' !== $options[ 'content' ] ) { - - $ext = ( ! empty( $image_url ) ) ? pathinfo( $image_url, PATHINFO_EXTENSION ) : false; - $video_options = array(); - - if ( $ext ) { - $video_options[ 'posterType' ] = 'posterType:' . $ext; - } else { - $video_options[ 'posterType' ] = 'posterType: none'; - } - - $video_options[ 'className' ] = 'className:generate-page-header-video'; - - if ( apply_filters( 'generate_page_header_video_loop', true ) ) { - $video_options[ 'loop' ] = 'loop:true'; - } else { - $video_options[ 'loop' ] = 'loop:false'; - } - - if ( apply_filters( 'generate_page_header_video_muted', true ) ) { - $video_options[ 'muted' ] = 'muted:true'; - } else { - $video_options[ 'muted' ] = 'muted:false'; - } - - $video_options[ 'autoplay' ] = 'autoplay:false'; - - $video = sprintf( ' data-vide-bg="%1$s" data-vide-options="%2$s"', - implode( ', ', array_filter( $video_output ) ), - implode( ', ', array_filter( $video_options ) ) - ); - } - - // Write a class if we're merging the header - $combined_content = ( '' !== $options[ 'merge' ] ) ? ' generate-combined-page-header' : ''; - - // If content is set, show it - if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { - printf( - '
          -
          ', - ( 'fluid' == $options[ 'container_type' ] ) ? $video : null, - $content_class . $parallax . $full_screen . $vertical_center_container . $container_type . $combined_content . ' generate-page-header generate-content-header', - ( 'fluid' !== $options[ 'container_type' ] ) ? $video : null, - $vertical_center, - ( '' !== $options[ 'merge' ] ) ? 'generate-merged-header' : '', - ( ! empty( $parallax ) ) ? 'data-parallax-speed="' . esc_attr( $parallax_speed ) . '"' : '', - $options[ 'page_header_id' ] - ); - } - - do_action( 'generate_inside_merged_page_header' ); - } -} - -if ( ! function_exists( 'generate_page_header_area' ) ) { - /** - * Build our entire page header. - * - * @since 0.1 - * - * @param $image_class The class to give our element if it's an image. - * @param $content_class The class to give our element if it's content. - */ - function generate_page_header_area( $image_class, $content_class ) { - // Get our options - $options = generate_page_header_get_options(); - - // Get out of here if we don't have content or an image - if ( '' == $options[ 'content' ] && ! generate_page_header_get_image( 'ALL' ) ) { - return; - } - - $inner_container = ( '' == $options[ 'inner_container' ] ) ? ' grid-container grid-parent' : ''; - - do_action( 'generate_before_page_header' ); - - // If an image is set and no content is set - if ( '' == $options[ 'content' ] && generate_page_header_get_image( 'ALL' ) ) { - - printf( - '
          - %2$s - %4$s - %3$s -
          ', - esc_attr( $image_class ) . $inner_container . ' generate-page-header', - ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, - ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, - generate_page_header_get_image_output() - ); - - } - - // If content is set, show it - if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { - // If we're not merging our header, we can start the container here - // If we were merging, the container would be added in the generate_before_header hook - if ( '' == $options[ 'merge' ] ) { - generate_page_header_area_start_container( 'page-header-image', 'page-header-content' ); - } - - // Replace any found template tags - $options[ 'content' ] = generate_page_header_template_tags( $options[ 'content' ] ); - - // Print the rest of our page header HTML - // The starting elements are inside generate_page_header_area_start_container() - printf ( '
          -
          - %4$s - %6$s - %5$s -
          -
          -
          -
          ', - ( '' !== $options[ 'merge' ] ) ? 'generate-combined-content' : '', - $inner_container, - ( '' !== $options[ 'merge' ] ) ? 'generate-inside-combined-content' : 'generate-inside-page-header-content', - ( ! empty( $options[ 'add_padding' ] ) ) ? '
          ' : null, - ( ! empty( $options[ 'add_padding' ] ) ) ? '
          ' : null, - ( ! empty( $options[ 'autop' ] ) ) ? do_shortcode( wpautop( $options[ 'content' ] ) ) : do_shortcode( $options[ 'content' ] ) - ); - } - - do_action( 'generate_after_page_header' ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-image.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-image.php deleted file mode 100644 index b88250ad..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-image.php +++ /dev/null @@ -1,60 +0,0 @@ - - %2$s - %4$s - %3$s - ', - 'post-image page-header-post-image', - ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, - ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, - generate_page_header_get_image_output() - ); - } - - // If content is set, show it - if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { - printf( - '
          -
          - %3$s - %5$s - %4$s -
          -
          ', - 'post-image generate-page-header generate-post-content-header page-header-post-image', - 'inside-page-header-container inside-post-content-header grid-container grid-parent', - ( ! empty( $options[ 'add_padding' ] ) ) ? '
          ' : null, - ( ! empty( $options[ 'add_padding' ] ) ) ? '
          ' : null, - ( ! empty( $options[ 'autop' ] ) ) ? do_shortcode( wpautop( $options[ 'content' ] ) ) : do_shortcode( $options[ 'content' ] ) - ); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-type.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-type.php deleted file mode 100644 index 9768b43c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-type.php +++ /dev/null @@ -1,236 +0,0 @@ - _x( 'Page Headers', 'Post Type General Name', 'gp-premium' ), - 'singular_name' => _x( 'Page Header', 'Post Type Singular Name', 'gp-premium' ), - 'menu_name' => __( 'Page Headers', 'gp-premium' ), - 'name_admin_bar' => __( 'Page Header', 'gp-premium' ), - 'archives' => __( 'Page Header Archives', 'gp-premium' ), - 'parent_item_colon' => __( 'Parent Page Header:', 'gp-premium' ), - 'all_items' => __( 'All Page Headers', 'gp-premium' ), - 'add_new_item' => __( 'Add New Page Header', 'gp-premium' ), - 'new_item' => __( 'New Page Header', 'gp-premium' ), - 'edit_item' => __( 'Edit Page Header', 'gp-premium' ), - 'update_item' => __( 'Update Page Header', 'gp-premium' ), - 'view_item' => __( 'View Page Header', 'gp-premium' ), - 'search_items' => __( 'Search Page Header', 'gp-premium' ), - 'insert_into_item' => __( 'Insert into Page Header', 'gp-premium' ), - 'uploaded_to_this_item' => __( 'Uploaded to this Page Header', 'gp-premium' ), - ); - $args = array( - 'label' => __( 'Page Header', 'gp-premium' ), - 'labels' => $labels, - 'supports' => array( 'title', 'thumbnail' ), - 'hierarchical' => false, - 'public' => false, - 'show_ui' => true, - 'show_in_menu' => function_exists( 'generate_premium_do_elements' ) ? false : true, - 'menu_position' => 100, - 'menu_icon' => 'dashicons-welcome-widgets-menus', - 'show_in_admin_bar' => false, - 'show_in_nav_menus' => false, - 'can_export' => true, - 'has_archive' => false, - 'exclude_from_search' => true, - 'publicly_queryable' => false, - 'capability_type' => 'page', - ); - register_post_type( 'generate_page_header', $args ); - - $post_types = get_post_types( array( 'public' => true ) ); - $term_args = array( - 'sanitize_callback' => 'int', - 'type' => 'string', - 'description' => '', - 'single' => true, - 'show_in_rest' => true, - ); - foreach ( $post_types as $type ) { - register_meta( $type, 'generate_page_header', $term_args ); - } - - $taxonomies = get_taxonomies( array( 'public' => true ) ); - if ( $taxonomies ) { - foreach ( $taxonomies as $taxonomy ) { - add_action( $taxonomy . '_add_form_fields', 'generate_page_header_tax_new_ph_field' ); - add_action( $taxonomy . '_edit_form_fields', 'generate_page_header_tax_edit_ph_field' ); - add_action( 'edit_' . $taxonomy, 'generate_page_header_tax_save_ph' ); - add_action( 'create_' . $taxonomy, 'generate_page_header_tax_save_ph' ); - } - } -} - -add_action( 'admin_menu', 'generate_old_page_header_options_page' ); -/** - * Add our submenu page to the Appearance tab. - * - * @since 1.7 - */ -function generate_old_page_header_options_page() { - if ( ! function_exists( 'generate_premium_do_elements' ) ) { - return; - } - - add_submenu_page( - 'themes.php', - esc_html__( 'Page Headers', 'gp-premium' ), - esc_html__( 'Page Headers', 'gp-premium' ), - 'manage_options', - 'edit.php?post_type=generate_page_header' - ); -} - -add_action( 'admin_head', 'generate_old_page_header_fix_menu' ); -/** - * Set our current menu in the admin while in the old Page Header pages. - * - * @since 1.7 - */ -function generate_old_page_header_fix_menu() { - if ( ! function_exists( 'generate_premium_do_elements' ) ) { - return; - } - - global $parent_file, $submenu_file, $post_type; - - $screen = get_current_screen(); - - if ( 'generate_page_header' === $post_type || 'appearance_page_page-header-global-locations' === $screen->base ) { - $parent_file = 'themes.php'; - $submenu_file = 'edit.php?post_type=gp_elements'; - } - - remove_submenu_page( 'themes.php', 'edit.php?post_type=generate_page_header' ); - remove_submenu_page( 'themes.php', 'page-header-global-locations' ); -} - -add_action( 'admin_head', 'generate_page_header_add_legacy_locations_button', 999 ); -/** - * Add legacy buttons to our new GP Elements post type. - * - * @since 1.7 - */ -function generate_page_header_add_legacy_locations_button() { - if ( ! function_exists( 'generate_premium_do_elements' ) ) { - return; - } - - $screen = get_current_screen(); - - if ( 'generate_page_header' === $screen->post_type ) : - ?> - - post_type && 'edit' === $screen->base ) : - ?> - - -
          - - -
          - - - - - - - - - - - tag in metabox -* Elements: Add generate_elements_metabox_ajax_allow_editors filter -* Elements: Add new 3.0 hooks to hook selector -* Elements: Re-add generate_elements_custom_args filter -* Menu Plus: Better prepare navigation as header for GP 3.0 -* Menu Plus: Better prepare Off-Canvas Panel for GP 3.0 -* Menu Plus: Better prepare sticky navigation for GP 3.0 -* Menu Plus: Add has-menu-bar-items class to mobile header if needed -* Menu Plus: Add is-logo-image class to all site logos -* Menu Plus: Fix mobile header alignment when it has menu bar items -* Secondary Nav: Better prepare sticky navigation for GP 3.0 -* Secondary Nav: Fix hidden navigation widget in top bar when merged with secondary nav -* Sites: Improve the option-only import feature -* Sites: Improve the refresh sites button functionality -* Sites: Improve the undo site import functionality -* Sites: Fix Elementor site import issues -* Sites: Re-add Elementor sites to library -* Spacing: Better prepare Customizer live preview for GP 3.0 -* Spacing: Fix blog column spacing Customizer live preview -* Spacing: Stop handling mobile header, widget and footer widget features added in GP 3.0 -* Typography: Add mobile font size control for H3 (when using GP 3.0) -* Typography: Add mobile font size control for H4 (when using GP 3.0) -* Typography: Add mobile font size control for H5 (when using GP 3.0) -* Typography: Allow empty tablet and mobile site title font size values -* Typography: Make menu toggle CSS selector specific to primary navigation -* WooCommerce: Use CSS for secondary product image functionality instead of JS -* WooCommerce: Only load .js file if needed -* WooCommerce: Fix quantity box functionality when multiple quantity boxes exist on the page -* General: Improve alpha color picker script for better 5.5 compatibility -* General: Move child theme stylesheet after dynamic stylesheet if enabled -* General: Update gp-premium-de_DE.mo -* General: Update gp-premium-es_ES.mo -* General: Update gp-premium-fi.mo -* General: Update gp-premium-pt_PT.mo -* General: Update gp-premium-sv_SE.mo - -= 1.11.3 = -* Blog: Set widths to grid-sizer element -* Elements: Fix legacy Page Header/Hooks buttons in the Elements dashboard -* Page Header: Replace .load() with .on('load') -* Page Header: Fix color picker error in WP 5.5 - -= 1.11.2 = -* Blog: Remove negative featured image top margin from columns when using one container -* Blog: Fix infinite scroll items loading above viewport when using columns -* Blog: Fix infinite scroll featured images not displaying in Safari -* Elements: Prevent error in editor when generate_get_option() function doesn't exist -* General: Load inline CSS in previews when using external CSS option -* General: Update gp-premium-es_ES.mo -* General: Update gp-premium-pt_PT.mo - -= 1.11.1 = -* Elements: Remove stray quote character in Layout Element metabox -* Sections: Fix color picker JS error in WP 5.5 -* General: Fix external CSS option not removing inline CSS in some cases - -= 1.11.0 = -* New: Block Elements -* New: Apply Layout Element options to the block editor if set -* New: Generate dynamic CSS in an external file -* Blog: Separate CSS and load only when needed -* Blog: Add column width classes to stylesheet -* Blog: Disable featured image itemprop if microdata is disabled -* Blog: Add generate_blog_masonry_init filter -* Blog: Add generate_blog_infinite_scroll_init filter -* Blog: Fix archive page header overlap when using no featured image padding/one container -* Blog: Replace screen reader text with aria-label in read more buttons -* Disable Elements: Add option to disable the Mobile Header -* Disable Elements: Disable top bar disables it even when combined with Secondary Nav -* Disable Elements: Use generate_show_post_navigation filter to disable single post navigation -* Elements: Use full hook name with generate_ prefix in dropdown -* Elements: Rebuild how Element types are chosen -* Elements: Add chosen hook under type column in edit.php -* Menu Plus: Add generate_after_mobile_header_menu_button filter -* Menu Plus: Add sticky placeholder only when nav becomes sticky -* Menu Plus: Add class to sticky nav when scrolling up -* Menu Plus: Fix navigation branding/mobile header layout when using RTL languages -* Page Header: Prevent PHP notices -* Secondary Nav: Clean up CSS -* Secondary Nav: Add generate_after_secondary_navigation hook -* Secondary Nav: Add generate_before_secondary_navigation hook -* Secondary Nav: Integrate with future flexbox option -* Secondary Nav: Add has-top-bar class if needed -* Secondary Nav: Add screen reader text to mobile menu toggle if no text exists -* Secondary Nav: Remove microdata if disabled -* Secondary Nav: Add generate_secondary_menu_bar_items hook -* Spacing: Set sidebar width in Customizer for future flexbox option -* WooCommerce: Add generate_woocommerce_show_add_to_cart_panel filter -* WooCommerce: Integrate with future flexbox option -* WooCommerce: Ensure WC()->cart is set -* WooCommerce: Remove left margin from SVG menu cart icon -* WooCommerce: Show sticky add to cart panel on sold individually products -* WooCommerce: Remove bottom margin from related/upsell products -* WooCommerce: Fix cart menu item spacing in RTL languages -* WooCommerce: Fix menu item cart dropdown design in RTL languages -* General: Update selectWoo -* General: Update select2 -* General: Run all CSS through PostCSS -* General: Fix various text domains -* General: Fix JS error when toggling nav as header option without Colors/Typography modules -* General: Update all translations over 90% complete -* General: PHP cleanup/coding standards -* General: Add off_canvas_desktop_toggle_label to wpml-config.xml - -= 1.10.0 = -* Blog: Remove existing on-the-fly featured image resizer (Image Processing Queue) -* Blog: Choose from existing image sizes for featured images -* Blog: Use CSS to further resize featured images if necessary -* Blog: Fix edge case persistent transient bug with old image resizer -* Elements: Fix broken closing element in metabox -* General: Change scroll variable to gpscroll in smooth scroll script to avoid conflicts -* General: Update responsive widths in Customizer -* General: Fix responsive Customizer views when using RTL -* Menu Plus: Don't output sticky nav branding if sticky nav is disabled -* Menu Plus: Fix focus when off canvas overlay is opened (a11y) -* Menu Plus: Fix sticky navigation jump when navigation branding is in use -* Sections: Fix visible block editor when Sections are enabled -* WooCommerce: Use minmax in grid template definitions to fix overflow issue -* WooCommerce: Prevent add to cart panel interfering with back to top button on mobile -* WooCommerce: WooCommerce: Fix secondary image position if HTML isn't ordered correctly -* General: Add/update all translations over 50% complete. Big thanks to all contributors! -* Translation: Added Arabic - thank you anass! -* Translation: Added Bengali - thank you gtmroy! -* Translation: Added Spanish (Spain) - thank you davidperez (closemarketing.es)! -* Translation: Added Spanish (Argentina) - thank you bratorr! -* Translation: Added Finnish - thank you Stedi! -* Translation: Add Dutch - thank you Robin! -* Translation: Added Ukrainian - thank you EUROMEDIA! -* Translation: Vietnamese added - thank you themevi! - -= 1.9.1 = -* Blog: Fix "null" in infinite scroll load more button text -* WooCommerce: Fix hidden added to cart panel on mobile when sticky nav active -* WooCommerce: Fix missing SVG icon in mobile added to cart panel - -= 1.9.0 = -* Blog: Support SVG icon feature -* Colors: Add navigation search color options -* Disable Elements: Disable mobile menu in Mobile Header if nav is disabled -* Elements: Add wp_body_open hook -* Elements: Allow 0 mobile padding in Elements -* Elements: Add generate_elements_admin_menu_capability filter -* Elements: Add generate_page_hero_css_output filter -* Elements: Prevent error in Header Element if taxonomy doesn't exist -* Elements: Fix double logo when Header Element has logo + using nav as header -* Elements: Fix mobile header logo not replacing if merge is disabled -* Elements: Fix missing arrow in Choose Element Type select in WP 5.3 -* Elements: Add generate_inside_site_container hook option -* Elements: Add generate_after_entry_content hook option -* Menu Plus: Add off canvas desktop toggle label option -* Menu Plus: Add generate_off_canvas_toggle_output filter -* Menu Plus: Support SVG icon feature -* Menu Plus: Fix sticky navigation overlapping BB controls -* Menu Plus: Add align-items: center to nav as header, mobile header and sticky nav with branding -* Sections: Fix text/visual switch bug in Firefox -* Sites: Add option to revert site import -* Sites: Increase site library limit to 100 -* Spacing: Add live preview to group container padding -* Typography: Add tablet site title/navigation font size options -* Typography: Add archive post title weight, transform, font size and line height -* Typography: Add single content title weight, transform, font size and line height -* Typography: Only call all google fonts once in the Customizer -* Typography: Get Google fonts from readable JSON list -* Typography: Make sure font settings aren't lost if list is changed -* Typography: Only call generate_get_all_google_fonts if needed -* WooCommerce: Add columns gap options (desktop, tablet, mobile) -* WooCommerce: Add tablet column options -* WooCommerce: Add related/upsell tablet column options -* WooCommerce: Support SVG icon feature -* WooCommerce: Prevent empty added to cart panel on single products -* WooCommerce: Fix woocommerce-ordering arrow in old FF versions -* WooCommerce: Make item/items string translatable -* General: Better customizer device widths -* General: Use generate_premium_get_media_query throughout modules -* General: Improve Customizer control styling - -= 1.8.3 = -* Menu Plus: Use flexbox for center aligned nav with nav branding -* Menu Plus: Center overlay off canvas exit button on mobile -* Menu Plus: Add alt tag to sticky nav logo -* Menu Plus: Set generate_not_mobile_menu_media_query filter based on mobile menu breakpoint -* Sections: Remember when text tab is active -* Sections: Disable visual editor if turned off in profile -* Typography: Add generate_google_font_display filter -* WooCommerce: Fix single product sidebar layout metabox option -* WooCommerce: Reduce carousel thumbnail max-width to 100px to match new thumbnail sizes - -= 1.8.2 = -* Elements: Use Page Hero site title color for mobile header site title -* Menu Plus: Give mobile header site title more left spacing -* Menu Plus: Fix nav search icon in sticky navigation when using nav branding in Firefox -* Site Library: Show Site Library tab even if no sites exist -* Site Library: Show an error message in Site Library if no sites exist -* Typography: Remove reference to generate_get_navigation_location() function -* WooCommerce: Remove quantity field arrows when using quantity buttons in Firefox -* WooCommerce: Remove extra border when loading quantity buttons -* WooCommerce: Use get_price_html() is sticky add to cart panel - -= 1.8.1 = -* Menu Plus: Revert sticky nav duplicate ID fix due to Cyrillic script bug - -= 1.8 = -* Blog: Apply columns filter to masonry grid sizer -* Colors: Merge Footer Widgets and Footer controls in Color panel -* Colors: Remove edit_theme_options capability to Customizer controls (set by default) -* Disable Elements: Make sure mobile header is disabled when primary navigation is disabled -* Elements: Add content width option in Layout Element -* Elements: Fix mobile header logo when mobile menu toggled -* Elements: Add generate_page_hero_location filter -* Elements: Add generate_elements_show_object_ids filter to show IDs in Display Rule values -* Elements: Prevent merged header wrap from conflicting with Elementor controls -* Elements: Change Container tab name to Content -* Elements: Add woocommerce_share option to Hooks -* Elements: Improve WPML compatibility -* Elements: Improve Polylang compatibility -* Elements: Prevent PHP notices when adding taxonomy locations to non-existent archives -* Elements: Add generate_mobile_cart_items hook to hook list -* Elements: Add generate_element_post_id filter -* Elements: Escape HTML elements inside Element textarea -* Elements: Add Beaver Builder templates to the Display Rules -* Menu Plus: Add mobile header breakpoint option -* Menu Plus: Add off canvas overlay option -* Menu Plus: Add navigation as header option -* Menu Plus: Remove navigation logo option if navigation as header set -* Menu Plus: Add sticky navigation logo option -* Menu Plus: Allow site title in mobile header instead of logo -* Menu Plus: Add option to move exit button inside the off canvas panel -* Menu Plus: Change Slideout Navigation name to Off Canvas Panel -* Menu Plus: Only re-focus after slideout close on escape key -* Menu Plus: Give close slideout event a name so it can be removed -* Menu Plus: Remove invalid transition-delay -* Menu Plus: Improve slideout overlay transition -* Menu Plus: Add mobile open/close icons to GPP font -* Menu Plus: Allow dynamic widget classes in off canvas panel (fixes WC range slider widget issue) -* Menu Plus: Basic compatibility with future SVG icons -* Menu Plus: Prevent duplicate IDs when sticky navigation is cloned -* Secondary Nav: Add dropdown direction option -* Secondary Nav: Basic compatibility with future SVG icons -* Sections: Fix section editor issues in WP 5.0 -* Sections: Show Better Font Awesome icon in editor -* Sites: Re-design UI -* Sites: Add option to activate as a module like all the other modules -* Sites: Don't show backup options button if no options exist -* Sites: Make JS action classes more specific to the site library -* Sites: Set mime types of content.xml and widgets.wie -* Spacing: Add header padding option for mobile -* Spacing: Add widget padding option for mobile -* Spacing: Add footer widgets padding option for mobile -* Spacing: Add content separator option -* Spacing: Apply mobile menu item width to mobile bar only -* WooCommerce: Add option for mini cart in the menu -* WooCommerce: Add option to open off overlay panel on add to cart -* WooCommerce: Add option to open sticky add to cart panel on single products -* WooCommerce: Add option to add +/- buttons to the quantity fields -* WooCommerce: Add option to show number of items in cart menu item -* WooCommerce: Add option to choose single product image area width -* WooCommerce: Add color options for price slider widget -* WooCommerce: Use CSS grid for the product archives -* WooCommerce: Horizontally align add to cart buttons -* WooCommerce: Re-design the cart widget -* WooCommerce: Tighten up product info spacing -* WooCommerce: Improve product tab design to look more like tabs -* WooCommerce: Simplify single product image display -* WooCommerce: Use flexbox for quantity/add to cart alignment -* WooCommerce: Improve rating star styles -* WooCommerce: Use product alignment setting for related/upsell products -* WooCommerce: Remove bottom margin from product image -* WooCommerce: Organize colors in the Customizer -* WooCommerce: Remove title attribute from menu cart item -* WooCommerce: Improve coupon field design -* WooCommerce: Improve result count/ordering styling -* WooCommerce: Add gap around WC single product images -* WooCommerce: Remove arrow from checkout button -* WooCommerce: Hide view cart link on add to cart click -* WooCommerce: Organize CSS -* Introduce in-Customizer shortcuts -* Add generate_disable_customizer_shortcuts filter diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/fields/secondary-navigation.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/fields/secondary-navigation.php deleted file mode 100644 index d2bffea0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/fields/secondary-navigation.php +++ /dev/null @@ -1,174 +0,0 @@ - a, .secondary-navigation .main-nav ul li:not([class*="current-menu-"]):focus > a, .secondary-navigation .main-nav ul li.sfHover:not([class*="current-menu-"]) > a, .secondary-navigation .menu-bar-item:hover > a, .secondary-navigation .menu-bar-item.sfHover > a'; - $menu_current_selectors = '.secondary-navigation .main-nav ul li[class*="current-menu-"] > a'; - $submenu_hover_selectors = '.secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):hover > a, .secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):focus > a, .secondary-navigation .main-nav ul ul li.sfHover:not([class*="current-menu-"]) > a'; - $submenu_current_selectors = '.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a'; - - GeneratePress_Customize_Field::add_title( - 'generate_secondary_navigation_colors_title', - array( - 'section' => 'generate_colors_section', - 'title' => __( 'Secondary Navigation', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'secondary-navigation-colors', - ), - ) - ); - - // Navigation background group. - GeneratePress_Customize_Field::add_color_field_group( - 'secondary_navigation_background', - 'generate_colors_section', - 'secondary-navigation-colors', - array( - 'generate_secondary_nav_settings[navigation_background_color]' => array( - 'default_value' => $secondary_color_defaults['navigation_background_color'], - 'label' => __( 'Navigation Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '.secondary-navigation', - 'property' => 'background-color', - 'hide_label' => false, - ), - 'generate_secondary_nav_settings[navigation_background_hover_color]' => array( - 'default_value' => $secondary_color_defaults['navigation_background_hover_color'], - 'label' => __( 'Navigation Background Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => $menu_hover_selectors, - 'property' => 'background-color', - 'hide_label' => true, - ), - 'generate_secondary_nav_settings[navigation_background_current_color]' => array( - 'default_value' => $secondary_color_defaults['navigation_background_current_color'], - 'label' => __( 'Navigation Background Current', 'gp-premium' ), - 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), - 'element' => $menu_current_selectors, - 'property' => 'background-color', - 'hide_label' => true, - ), - ) - ); - - // Navigation text group. - GeneratePress_Customize_Field::add_color_field_group( - 'secondary_navigation_text', - 'generate_colors_section', - 'secondary-navigation-colors', - array( - 'generate_secondary_nav_settings[navigation_text_color]' => array( - 'default_value' => $secondary_color_defaults['navigation_text_color'], - 'label' => __( 'Navigation Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '.secondary-navigation .main-nav ul li a, .secondary-navigation .menu-toggle, .secondary-navigation button.menu-toggle:hover, .secondary-navigation button.menu-toggle:focus, .secondary-navigation .mobile-bar-items a, .secondary-navigation .mobile-bar-items a:hover, .secondary-navigation .mobile-bar-items a:focus, .secondary-navigation .menu-bar-items', - 'property' => 'color', - 'hide_label' => false, - ), - 'generate_secondary_nav_settings[navigation_text_hover_color]' => array( - 'default_value' => $secondary_color_defaults['navigation_text_hover_color'], - 'label' => __( 'Navigation Text Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => $menu_hover_selectors, - 'property' => 'color', - 'hide_label' => true, - ), - 'generate_secondary_nav_settings[navigation_text_current_color]' => array( - 'default_value' => $secondary_color_defaults['navigation_text_current_color'], - 'label' => __( 'Navigation Text Current', 'gp-premium' ), - 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), - 'element' => $menu_current_selectors, - 'property' => 'color', - 'hide_label' => true, - ), - ) - ); - - // Sub-Menu background group. - GeneratePress_Customize_Field::add_color_field_group( - 'secondary_navigation_submenu_background', - 'generate_colors_section', - 'secondary-navigation-colors', - array( - 'generate_secondary_nav_settings[subnavigation_background_color]' => array( - 'default_value' => $secondary_color_defaults['subnavigation_background_color'], - 'label' => __( 'Sub-Menu Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '.secondary-navigation ul ul', - 'property' => 'background-color', - 'hide_label' => false, - ), - 'generate_secondary_nav_settings[subnavigation_background_hover_color]' => array( - 'default_value' => $secondary_color_defaults['subnavigation_background_hover_color'], - 'label' => __( 'Sub-Menu Background Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => $submenu_hover_selectors, - 'property' => 'background-color', - 'hide_label' => true, - ), - 'generate_secondary_nav_settings[subnavigation_background_current_color]' => array( - 'default_value' => $secondary_color_defaults['subnavigation_background_current_color'], - 'label' => __( 'Sub-Menu Background Current', 'gp-premium' ), - 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), - 'element' => $submenu_current_selectors, - 'property' => 'background-color', - 'hide_label' => true, - ), - ) - ); - - // Sub-Menu text group. - GeneratePress_Customize_Field::add_color_field_group( - 'secondary_navigation_submenu_text', - 'generate_colors_section', - 'secondary-navigation-colors', - array( - 'generate_secondary_nav_settings[subnavigation_text_color]' => array( - 'default_value' => $secondary_color_defaults['subnavigation_text_color'], - 'label' => __( 'Sub-Menu Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '.secondary-navigation .main-nav ul ul li a', - 'property' => 'color', - 'hide_label' => false, - ), - 'generate_secondary_nav_settings[subnavigation_text_hover_color]' => array( - 'default_value' => $secondary_color_defaults['subnavigation_text_hover_color'], - 'label' => __( 'Sub-Menu Text Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => $submenu_hover_selectors, - 'property' => 'color', - 'hide_label' => true, - ), - 'generate_secondary_nav_settings[subnavigation_text_current_color]' => array( - 'default_value' => $secondary_color_defaults['subnavigation_text_current_color'], - 'label' => __( 'Sub-Menu Text Current', 'gp-premium' ), - 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), - 'element' => $submenu_current_selectors, - 'property' => 'color', - 'hide_label' => true, - ), - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css.php deleted file mode 100644 index 370c5ef8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css.php +++ /dev/null @@ -1,138 +0,0 @@ -_selector ) { - $this->add_selector_rules_to_output(); - } - - $this->_selector = $selector; - return $this; - } - - /** - * Adds a css property with value to the css output. - * - * @access public - * @since 1.0 - * - * @param string $property - the css property. - * @param string $value - the value to be placed with the property. - * @param string $og_default - check to see if the value matches the default. - * @param string $unit - the unit for the value (px). - * @return $this - */ - public function add_property( $property, $value, $og_default = false, $unit = false ) { - // Add our unit to the value if it exists. - if ( $unit && '' !== $unit ) { - $value = $value . $unit; - if ( '' !== $og_default ) { - $og_default = $og_default . $unit; - } - } - - // If we don't have a value or our value is the same as our og default, bail. - if ( empty( $value ) || $og_default == $value ) { - return false; - } - - $this->_css .= $property . ':' . $value . ';'; - return $this; - } - - /** - * Adds the current selector rules to the output variable - * - * @access private - * @since 1.0 - * - * @return $this - */ - private function add_selector_rules_to_output() { - if ( ! empty( $this->_css ) ) { - $this->_selector_output = $this->_selector; - $selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css ); - - $this->_output .= $selector_output; - - // Reset the css. - $this->_css = ''; - } - - return $this; - } - - /** - * Returns the minified css in the $_output variable - * - * @access public - * @since 1.0 - * - * @return string - */ - public function css_output() { - // Add current selector's rules to output. - $this->add_selector_rules_to_output(); - - // Output minified css. - return $this->_output; - } - - } -endif; diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.css deleted file mode 100644 index ed9b708c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.css +++ /dev/null @@ -1,125 +0,0 @@ -.secondary-navigation.toggled ul ul { - transition: 0s; - visibility: hidden; - float: none; -} - -.secondary-navigation.toggled ul ul.toggled-on { - visibility: visible; -} - -.secondary-navigation.toggled .main-nav ul ul { - position: relative; - top: 0; - left: 0; - width: 100%; - box-shadow: none; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); -} - -.secondary-navigation.toggled .main-nav ul ul li:last-child > ul { - border-bottom: 0; -} - -.secondary-navigation.toggled .main-nav ul ul.toggled-on { - position: relative; - top: 0; - left: auto !important; - right: auto !important; - width: 100%; - pointer-events: auto; - height: auto; - opacity: 1; - display: block; -} - -.secondary-navigation.toggled .main-nav > ul { - display: block; -} - -.secondary-navigation.toggled .main-nav .sf-menu > li { - float: none; - clear: both; - display: block !important; - text-align: left !important; -} - -.secondary-navigation.toggled .main-nav .sf-menu > li.hide-on-mobile { - display: none !important; -} - -.secondary-navigation.toggled .dropdown-menu-toggle:before { - content: "\f107" !important; -} - -.secondary-navigation.toggled .sfHover > a .dropdown-menu-toggle:before { - content: "\f106" !important; -} - -.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle { - float: right; -} - -.dropdown-hover .secondary-navigation.toggled ul li:hover > ul, -.dropdown-hover .secondary-navigation.toggled ul li.sfHover > ul { - transition-delay: 0s; -} - -.rtl .secondary-navigation.toggled .main-nav .sf-menu > li { - text-align: right !important; -} - -@media (max-width: 768px) { - .secondary-navigation .menu-toggle { - display: block; - } - .secondary-navigation ul, - .secondary-navigation:not(.toggled) .main-nav > ul { - display: none; - } - .secondary-navigation.toggled .main-nav { - flex-basis: 100%; - order: 3; - } - .secondary-nav-aligned-left .secondary-navigation.has-top-bar .menu-toggle { - text-align: left; - } - .secondary-nav-aligned-left .secondary-navigation .top-bar { - order: 2; - } - .secondary-nav-aligned-right .secondary-navigation.has-top-bar .menu-toggle { - text-align: right; - } - .secondary-navigation.has-top-bar .top-bar .inside-top-bar .widget { - margin: 0 20px; - } - .secondary-nav-aligned-center .secondary-navigation .top-bar { - flex-basis: 100%; - } - .secondary-nav-float-right .secondary-navigation { - margin-left: 0; - width: 100%; - margin-top: 1.5em; - } - .secondary-nav-float-right .header-widget { - margin-left: auto; - } - .secondary-nav-float-left .secondary-navigation, - .secondary-nav-float-left .multi-navigation-wrapper { - margin-left: 0; - width: 100%; - margin-top: 1.5em; - } - .secondary-nav-float-left:not(.nav-float-right) .header-widget { - margin-left: auto; - margin-right: auto; - order: unset; - } - .secondary-nav-float-left .site-logo, - .secondary-nav-float-left .site-branding { - order: unset; - } - .secondary-navigation.has-top-bar .inside-navigation, .secondary-navigation.has-menu-bar-items .inside-navigation { - justify-content: space-between; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.min.css deleted file mode 100644 index 567c5024..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.min.css +++ /dev/null @@ -1 +0,0 @@ -.secondary-navigation.toggled ul ul{transition:0s;visibility:hidden;float:none}.secondary-navigation.toggled ul ul.toggled-on{visibility:visible}.secondary-navigation.toggled .main-nav ul ul{position:relative;top:0;left:0;width:100%;box-shadow:none;border-bottom:1px solid rgba(0,0,0,.05)}.secondary-navigation.toggled .main-nav ul ul li:last-child>ul{border-bottom:0}.secondary-navigation.toggled .main-nav ul ul.toggled-on{position:relative;top:0;left:auto!important;right:auto!important;width:100%;pointer-events:auto;height:auto;opacity:1;display:block}.secondary-navigation.toggled .main-nav>ul{display:block}.secondary-navigation.toggled .main-nav .sf-menu>li{float:none;clear:both;display:block!important;text-align:left!important}.secondary-navigation.toggled .main-nav .sf-menu>li.hide-on-mobile{display:none!important}.secondary-navigation.toggled .dropdown-menu-toggle:before{content:"\f107"!important}.secondary-navigation.toggled .sfHover>a .dropdown-menu-toggle:before{content:"\f106"!important}.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle{float:right}.dropdown-hover .secondary-navigation.toggled ul li.sfHover>ul,.dropdown-hover .secondary-navigation.toggled ul li:hover>ul{transition-delay:0s}.rtl .secondary-navigation.toggled .main-nav .sf-menu>li{text-align:right!important}@media (max-width:768px){.secondary-navigation .menu-toggle{display:block}.secondary-navigation ul,.secondary-navigation:not(.toggled) .main-nav>ul{display:none}.secondary-navigation.toggled .main-nav{flex-basis:100%;order:3}.secondary-nav-aligned-left .secondary-navigation.has-top-bar .menu-toggle{text-align:left}.secondary-nav-aligned-left .secondary-navigation .top-bar{order:2}.secondary-nav-aligned-right .secondary-navigation.has-top-bar .menu-toggle{text-align:right}.secondary-navigation.has-top-bar .top-bar .inside-top-bar .widget{margin:0 20px}.secondary-nav-aligned-center .secondary-navigation .top-bar{flex-basis:100%}.secondary-nav-float-right .secondary-navigation{margin-left:0;width:100%;margin-top:1.5em}.secondary-nav-float-right .header-widget{margin-left:auto}.secondary-nav-float-left .multi-navigation-wrapper,.secondary-nav-float-left .secondary-navigation{margin-left:0;width:100%;margin-top:1.5em}.secondary-nav-float-left:not(.nav-float-right) .header-widget{margin-left:auto;margin-right:auto;order:unset}.secondary-nav-float-left .site-branding,.secondary-nav-float-left .site-logo{order:unset}.secondary-navigation.has-menu-bar-items .inside-navigation,.secondary-navigation.has-top-bar .inside-navigation{justify-content:space-between}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.css deleted file mode 100644 index 9540b8a4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.css +++ /dev/null @@ -1,377 +0,0 @@ -.secondary-navigation { - z-index: 99; - padding: 0; -} - -.secondary-navigation .inside-navigation { - display: flex; - align-items: center; - flex-wrap: wrap; - justify-content: space-between; -} - -.secondary-navigation ul { - list-style: none; - margin: 0; - padding-left: 0; -} - -.secondary-navigation li { - position: relative; -} - -.secondary-navigation a { - display: block; - text-decoration: none; -} - -.secondary-navigation ul ul { - display: block; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - float: left; - position: absolute; - left: -99999px; - opacity: 0; - z-index: 99999; - width: 200px; - text-align: left; - top: auto; - transition: opacity 80ms linear; - transition-delay: 0s; - pointer-events: none; - height: 0; - overflow: hidden; -} - -.secondary-navigation ul ul li { - width: 100%; -} - -.secondary-navigation ul ul li a { - line-height: normal; - font-size: 90%; -} - -.secondary-navigation.sub-menu-left ul ul { - box-shadow: -1px 1px 0 rgba(0, 0, 0, 0.1); -} - -.secondary-navigation.sub-menu-left .sub-menu { - right: 0; -} - -.secondary-navigation .main-nav > ul { - display: flex; - flex-wrap: wrap; -} - -.secondary-navigation .main-nav ul ul li a { - line-height: normal; - font-size: 12px; - padding-left: 20px; - padding-right: 20px; - padding-top: 10px; - padding-bottom: 10px; -} - -.secondary-navigation .main-nav ul li.menu-item-has-children > a { - padding-right: 0; - position: relative; -} - -.secondary-navigation .main-nav ul li a { - font-family: inherit; - font-weight: normal; - text-transform: none; - font-size: 13px; - padding-left: 20px; - padding-right: 20px; - line-height: 40px; -} - -.secondary-navigation .menu-toggle { - font-family: inherit; - font-weight: normal; - text-transform: none; - font-size: 13px; - padding-left: 20px; - padding-right: 20px; - line-height: 40px; - margin: 0; -} - -.secondary-navigation .menu-item-has-children .dropdown-menu-toggle { - padding-right: 20px; -} - -.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { - padding-top: 10px; - padding-bottom: 10px; - margin-top: -10px; -} - -.secondary-navigation .secondary-menu-bar-items { - display: flex; - align-items: center; - font-size: 13px; -} - -.secondary-navigation .menu-bar-item { - position: relative; -} - -.secondary-navigation .menu-bar-item.search-item { - z-index: 20; -} - -.secondary-navigation .menu-bar-item > a { - font-family: inherit; - font-weight: normal; - text-transform: none; - font-size: 13px; - padding-left: 20px; - padding-right: 20px; - line-height: 40px; -} - -.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover > ul, -.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover > ul { - left: auto; - opacity: 1; - transition-delay: 150ms; - pointer-events: auto; - height: auto; - overflow: visible; -} - -.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover > ul, -.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover > ul { - left: 100%; - top: 0; -} - -.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover > ul, -.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover > ul { - right: 100%; - top: 0; - left: auto; -} - -.secondary-nav-float-right .header-widget { - margin-left: 20px; -} - -.secondary-nav-float-right .secondary-navigation { - margin-left: auto; -} - -.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a { - line-height: normal; -} - -.secondary-nav-float-right .secondary-navigation ul ul ul { - top: 0; -} - -.secondary-nav-float-right .multi-navigation-wrapper { - margin-left: auto; -} - -.secondary-nav-float-left .secondary-navigation, -.secondary-nav-float-left .multi-navigation-wrapper { - margin-right: auto; -} - -.secondary-nav-float-left .site-logo, -.secondary-nav-float-left .site-branding { - order: 5; -} - -.secondary-nav-float-left:not(.nav-float-right) .header-widget { - order: -10; - margin-left: 0; - margin-right: 20px; -} - -.secondary-nav-float-left.nav-float-right .site-branding, -.secondary-nav-float-left.nav-float-right .site-logo { - margin-left: auto; - margin-right: auto; -} - -.secondary-nav-float-left.nav-float-right .inside-header .main-navigation, -.secondary-nav-float-left.nav-float-right .header-widget { - order: 10; -} - -.secondary-nav-float-right.nav-float-left .secondary-navigation { - order: 10; -} - -.multi-navigation-wrapper { - display: flex; - flex-direction: column; -} - -.widget-area .secondary-navigation li { - display: block; - float: none; - margin: 0; - padding: 0; - width: 100%; -} - -.widget-area .secondary-navigation ul ul { - left: 100%; - top: 0; - width: 220px; -} - -.secondary-nav-aligned-right .secondary-navigation .inside-navigation { - justify-content: flex-end; -} - -.secondary-nav-aligned-right.rtl .secondary-navigation .inside-navigation { - justify-content: flex-start; -} - -.secondary-nav-aligned-center .secondary-navigation .inside-navigation { - justify-content: center; -} - -.secondary-nav-aligned-center .secondary-navigation .main-nav > ul { - justify-content: center; -} - -.secondary-nav-aligned-left.rtl .secondary-navigation .inside-navigation { - justify-content: flex-end; -} - -.dropdown-click .secondary-navigation ul ul { - visibility: hidden; - float: none; -} - -.dropdown-click .secondary-navigation ul.toggled-on, -.dropdown-click .secondary-navigation ul li.sfHover > ul.toggled-on { - left: auto; - opacity: 1; - visibility: visible; - pointer-events: auto; - height: auto; - overflow: visible; -} - -.dropdown-click .secondary-navigation ul ul ul.toggled-on { - left: 0; - top: auto; - position: relative; - box-shadow: none; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); -} - -.dropdown-click .secondary-navigation ul ul li:last-child > ul.toggled-on { - border-bottom: 0; -} - -.dropdown-click .widget-area .secondary-navigation ul ul { - top: auto; - position: absolute; - float: none; - width: 100%; - left: -99999px; -} - -.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on { - position: relative; - left: 0; - right: 0; -} - -.both-right .widget-area .secondary-navigation ul ul, -.right-sidebar .widget-area .secondary-navigation ul ul, -.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { - left: auto; - right: 100%; -} - -.dropdown-click.both-right .widget-area .secondary-navigation ul ul, -.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul, -.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { - right: 0; -} - -.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover > ul { - top: 0; - left: 100%; - width: 220px; -} - -.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, -.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, -.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul { - right: 100%; - left: auto; -} - -.rtl .secondary-navigation ul ul { - float: right; - left: auto; - right: 0; - text-align: right; -} - -.rtl .secondary-navigation ul ul ul { - left: auto; - right: 100%; -} - -.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { - transform: rotate(180deg); -} - -/* Top bar */ -.secondary-navigation.has-top-bar .menu-toggle, .secondary-navigation.has-menu-bar-items .menu-toggle { - flex-grow: 0; -} - -.secondary-navigation .top-bar { - background: transparent; -} - -.secondary-navigation .top-bar a { - display: inline; -} - -.secondary-navigation .inside-top-bar { - padding: 0; -} - -.secondary-nav-aligned-right .secondary-navigation .top-bar { - margin-right: auto; -} - -.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget { - margin: 0 10px; -} - -.secondary-nav-aligned-left .secondary-navigation .top-bar { - order: 2; - margin-left: auto; -} - -.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget { - margin-left: 10px; -} - -.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-top-bar { - justify-content: center; -} - -.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-navigation { - display: block; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.min.css deleted file mode 100644 index e21c11da..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.min.css +++ /dev/null @@ -1 +0,0 @@ -.secondary-navigation{z-index:99;padding:0}.secondary-navigation .inside-navigation{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}.secondary-navigation ul{list-style:none;margin:0;padding-left:0}.secondary-navigation li{position:relative}.secondary-navigation a{display:block;text-decoration:none}.secondary-navigation ul ul{display:block;box-shadow:0 1px 1px rgba(0,0,0,.1);float:left;position:absolute;left:-99999px;opacity:0;z-index:99999;width:200px;text-align:left;top:auto;transition:opacity 80ms linear;transition-delay:0s;pointer-events:none;height:0;overflow:hidden}.secondary-navigation ul ul li{width:100%}.secondary-navigation ul ul li a{line-height:normal;font-size:90%}.secondary-navigation.sub-menu-left ul ul{box-shadow:-1px 1px 0 rgba(0,0,0,.1)}.secondary-navigation.sub-menu-left .sub-menu{right:0}.secondary-navigation .main-nav>ul{display:flex;flex-wrap:wrap}.secondary-navigation .main-nav ul ul li a{line-height:normal;font-size:12px;padding-left:20px;padding-right:20px;padding-top:10px;padding-bottom:10px}.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-right:0;position:relative}.secondary-navigation .main-nav ul li a{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px}.secondary-navigation .menu-toggle{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px;margin:0}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:20px}.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{padding-top:10px;padding-bottom:10px;margin-top:-10px}.secondary-navigation .secondary-menu-bar-items{display:flex;align-items:center;font-size:13px}.secondary-navigation .menu-bar-item{position:relative}.secondary-navigation .menu-bar-item.search-item{z-index:20}.secondary-navigation .menu-bar-item>a{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px}.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover>ul{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible}.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover>ul{left:100%;top:0}.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover>ul{right:100%;top:0;left:auto}.secondary-nav-float-right .header-widget{margin-left:20px}.secondary-nav-float-right .secondary-navigation{margin-left:auto}.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a{line-height:normal}.secondary-nav-float-right .secondary-navigation ul ul ul{top:0}.secondary-nav-float-right .multi-navigation-wrapper{margin-left:auto}.secondary-nav-float-left .multi-navigation-wrapper,.secondary-nav-float-left .secondary-navigation{margin-right:auto}.secondary-nav-float-left .site-branding,.secondary-nav-float-left .site-logo{order:5}.secondary-nav-float-left:not(.nav-float-right) .header-widget{order:-10;margin-left:0;margin-right:20px}.secondary-nav-float-left.nav-float-right .site-branding,.secondary-nav-float-left.nav-float-right .site-logo{margin-left:auto;margin-right:auto}.secondary-nav-float-left.nav-float-right .header-widget,.secondary-nav-float-left.nav-float-right .inside-header .main-navigation{order:10}.secondary-nav-float-right.nav-float-left .secondary-navigation{order:10}.multi-navigation-wrapper{display:flex;flex-direction:column}.widget-area .secondary-navigation li{display:block;float:none;margin:0;padding:0;width:100%}.widget-area .secondary-navigation ul ul{left:100%;top:0;width:220px}.secondary-nav-aligned-right .secondary-navigation .inside-navigation{justify-content:flex-end}.secondary-nav-aligned-right.rtl .secondary-navigation .inside-navigation{justify-content:flex-start}.secondary-nav-aligned-center .secondary-navigation .inside-navigation{justify-content:center}.secondary-nav-aligned-center .secondary-navigation .main-nav>ul{justify-content:center}.secondary-nav-aligned-left.rtl .secondary-navigation .inside-navigation{justify-content:flex-end}.dropdown-click .secondary-navigation ul ul{visibility:hidden;float:none}.dropdown-click .secondary-navigation ul li.sfHover>ul.toggled-on,.dropdown-click .secondary-navigation ul.toggled-on{left:auto;opacity:1;visibility:visible;pointer-events:auto;height:auto;overflow:visible}.dropdown-click .secondary-navigation ul ul ul.toggled-on{left:0;top:auto;position:relative;box-shadow:none;border-bottom:1px solid rgba(0,0,0,.05)}.dropdown-click .secondary-navigation ul ul li:last-child>ul.toggled-on{border-bottom:0}.dropdown-click .widget-area .secondary-navigation ul ul{top:auto;position:absolute;float:none;width:100%;left:-99999px}.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on{position:relative;left:0;right:0}.both-right .widget-area .secondary-navigation ul ul,.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.right-sidebar .widget-area .secondary-navigation ul ul{left:auto;right:100%}.dropdown-click.both-right .widget-area .secondary-navigation ul ul,.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul{right:0}.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{top:0;left:100%;width:220px}.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{right:100%;left:auto}.rtl .secondary-navigation ul ul{float:right;left:auto;right:0;text-align:right}.rtl .secondary-navigation ul ul ul{left:auto;right:100%}.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{transform:rotate(180deg)}.secondary-navigation.has-menu-bar-items .menu-toggle,.secondary-navigation.has-top-bar .menu-toggle{flex-grow:0}.secondary-navigation .top-bar{background:0 0}.secondary-navigation .top-bar a{display:inline}.secondary-navigation .inside-top-bar{padding:0}.secondary-nav-aligned-right .secondary-navigation .top-bar{margin-right:auto}.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget{margin:0 10px}.secondary-nav-aligned-left .secondary-navigation .top-bar{order:2;margin-left:auto}.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget{margin-left:10px}.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-top-bar{justify-content:center}.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-navigation{display:block} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.css deleted file mode 100644 index 51b5e656..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.css +++ /dev/null @@ -1,97 +0,0 @@ -.secondary-navigation.toggled ul ul { - transition: 0s; - visibility: hidden; -} - -.secondary-navigation.toggled ul ul.toggled-on { - visibility: visible; -} - -.secondary-navigation.toggled .main-nav ul ul { - position: relative; - top: 0; - left: 0; - width: 100%; -} - -.secondary-navigation.toggled .main-nav ul ul.toggled-on { - position: relative; - top: 0; - left: auto !important; - right: auto !important; - width: 100%; - pointer-events: auto; - height: auto; - opacity: 1; - display: block; -} - -.secondary-navigation.toggled .main-nav > ul { - display: block; -} - -.secondary-navigation.toggled .main-nav .sf-menu > li { - float: none; - clear: both; - display: block !important; - text-align: left !important; -} - -.secondary-navigation.toggled .main-nav .sf-menu > li.hide-on-mobile { - display: none !important; -} - -.secondary-navigation.toggled .dropdown-menu-toggle:before { - content: "\f107" !important; -} - -.secondary-navigation.toggled .sfHover > a .dropdown-menu-toggle:before { - content: "\f106" !important; -} - -.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle { - float: right; -} - -.secondary-navigation.toggled .sf-menu > li.menu-item-float-right { - float: none !important; - display: inline-block; -} - -.dropdown-hover .secondary-navigation.toggled ul li:hover > ul, -.dropdown-hover .secondary-navigation.toggled ul li.sfHover > ul { - transition-delay: 0s; -} - -.rtl .secondary-navigation.toggled .main-nav .sf-menu > li { - text-align: right !important; -} - -@media (max-width: 768px) { - .secondary-nav-float-left .inside-header .secondary-navigation { - float: none; - } - .secondary-navigation .menu-toggle { - display: block; - } - .secondary-navigation ul { - display: none; - } - .secondary-nav-aligned-left .secondary-navigation .top-bar { - position: absolute; - right: 0; - } - .secondary-nav-aligned-left .secondary-navigation .top-bar + .menu-toggle { - text-align: left; - } - .secondary-nav-aligned-right .secondary-navigation .top-bar { - position: absolute; - left: 0; - } - .secondary-nav-aligned-right .secondary-navigation .top-bar + .menu-toggle { - text-align: right; - } - .secondary-nav-aligned-center .secondary-navigation .top-bar + .menu-toggle + div { - display: block; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.min.css deleted file mode 100644 index f1ded0a3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.min.css +++ /dev/null @@ -1 +0,0 @@ -.secondary-navigation.toggled ul ul{transition:0s;visibility:hidden}.secondary-navigation.toggled ul ul.toggled-on{visibility:visible}.secondary-navigation.toggled .main-nav ul ul{position:relative;top:0;left:0;width:100%}.secondary-navigation.toggled .main-nav ul ul.toggled-on{position:relative;top:0;left:auto!important;right:auto!important;width:100%;pointer-events:auto;height:auto;opacity:1;display:block}.secondary-navigation.toggled .main-nav>ul{display:block}.secondary-navigation.toggled .main-nav .sf-menu>li{float:none;clear:both;display:block!important;text-align:left!important}.secondary-navigation.toggled .main-nav .sf-menu>li.hide-on-mobile{display:none!important}.secondary-navigation.toggled .dropdown-menu-toggle:before{content:"\f107"!important}.secondary-navigation.toggled .sfHover>a .dropdown-menu-toggle:before{content:"\f106"!important}.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle{float:right}.secondary-navigation.toggled .sf-menu>li.menu-item-float-right{float:none!important;display:inline-block}.dropdown-hover .secondary-navigation.toggled ul li.sfHover>ul,.dropdown-hover .secondary-navigation.toggled ul li:hover>ul{transition-delay:0s}.rtl .secondary-navigation.toggled .main-nav .sf-menu>li{text-align:right!important}@media (max-width:768px){.secondary-nav-float-left .inside-header .secondary-navigation{float:none}.secondary-navigation .menu-toggle{display:block}.secondary-navigation ul{display:none}.secondary-nav-aligned-left .secondary-navigation .top-bar{position:absolute;right:0}.secondary-nav-aligned-left .secondary-navigation .top-bar+.menu-toggle{text-align:left}.secondary-nav-aligned-right .secondary-navigation .top-bar{position:absolute;left:0}.secondary-nav-aligned-right .secondary-navigation .top-bar+.menu-toggle{text-align:right}.secondary-nav-aligned-center .secondary-navigation .top-bar+.menu-toggle+div{display:block}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.css deleted file mode 100644 index e24c07f1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.css +++ /dev/null @@ -1,337 +0,0 @@ -.secondary-navigation { - clear: both; - z-index: 99; - padding: 0; -} - -.secondary-navigation ul { - list-style: none; - margin: 0; - padding-left: 0; -} - -.secondary-navigation li { - float: left; - position: relative; -} - -.secondary-navigation a { - display: block; - text-decoration: none; -} - -.secondary-navigation ul ul { - display: block; - box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1); - float: left; - position: absolute; - left: -99999px; - opacity: 0; - z-index: 99999; - width: 200px; - text-align: left; - top: auto; - transition: opacity 80ms linear; - transition-delay: 0s; - pointer-events: none; - height: 0; - overflow: hidden; -} - -.secondary-navigation ul ul li { - width: 100%; -} - -.secondary-navigation ul ul li a { - line-height: normal; - font-size: 90%; -} - -.secondary-navigation.sub-menu-left .sub-menu { - right: 0; -} - -.secondary-navigation .main-nav ul ul li a { - line-height: normal; - font-size: 12px; - padding-left: 20px; - padding-right: 20px; - padding-top: 10px; - padding-bottom: 10px; -} - -.secondary-navigation .main-nav ul li.menu-item-has-children > a { - padding-right: 0; - position: relative; -} - -.secondary-navigation .main-nav ul li a { - font-family: inherit; - font-weight: normal; - text-transform: none; - font-size: 13px; - padding-left: 20px; - padding-right: 20px; - line-height: 40px; -} - -.secondary-navigation .menu-toggle { - font-family: inherit; - font-weight: normal; - text-transform: none; - font-size: 13px; - padding-left: 20px; - padding-right: 20px; - line-height: 40px; - margin: 0; -} - -.secondary-navigation .menu-item-has-children .dropdown-menu-toggle { - padding-right: 20px; -} - -.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { - padding-top: 10px; - padding-bottom: 10px; - margin-top: -10px; -} - -.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover > ul, -.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover > ul { - left: auto; - opacity: 1; - transition-delay: 150ms; - pointer-events: auto; - height: auto; - overflow: visible; -} - -.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover > ul, -.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover > ul { - left: 100%; - top: 0; -} - -.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover > ul, -.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover > ul { - right: 100%; - top: 0; - left: auto; -} - -.secondary-nav-float-right .secondary-navigation { - float: right; -} - -.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a { - line-height: normal; -} - -.secondary-nav-float-right .secondary-navigation ul ul ul { - top: 0; -} - -.secondary-nav-float-left .inside-header .secondary-navigation { - float: left; - clear: left; -} - -.secondary-nav-float-left .inside-header:after { - clear: both; - content: ''; - display: table; -} - -.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-branding, -.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-logo { - float: right; - clear: right; -} - -.secondary-nav-float-left.nav-float-right .inside-header .site-branding, -.secondary-nav-float-left.nav-float-right .inside-header .site-logo { - float: none; - clear: none; -} - -.secondary-nav-float-left.nav-float-right .site-header { - text-align: center; -} - -.secondary-nav-float-right.nav-float-left .inside-header .site-branding, -.secondary-nav-float-right.nav-float-left .inside-header .site-logo { - float: none; - clear: none; -} - -.secondary-nav-float-right.nav-float-left .site-header { - text-align: center; -} - -.widget-area .secondary-navigation li { - display: block; - float: none; - margin: 0; - padding: 0; - width: 100%; -} - -.widget-area .secondary-navigation ul ul { - left: 100%; - top: 0; - width: 220px; -} - -.both-right .widget-area .secondary-navigation ul ul, -.right-sidebar .widget-area .secondary-navigation ul ul, -.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { - left: auto; - right: 100%; -} - -.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation .sf-menu > li, -.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation .sf-menu > li, -.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation .sf-menu > li, -.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation .sf-menu > li { - float: none; - display: inline-block; -} - -.secondary-nav-aligned-right .secondary-navigation ul.secondary-menu, -.secondary-nav-aligned-center .secondary-navigation ul.secondary-menu { - font-size: 0px; -} - -.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation, -.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation { - text-align: left; -} - -.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation:after, -.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation:after { - clear: both; - content: ''; - display: table; -} - -.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation, -.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation { - text-align: center; -} - -.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation, -.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation { - text-align: right; -} - -.dropdown-click .secondary-navigation ul ul { - visibility: hidden; -} - -.dropdown-click .secondary-navigation ul.toggled-on, -.dropdown-click .secondary-navigation ul li.sfHover > ul.toggled-on { - left: auto; - opacity: 1; - visibility: visible; - pointer-events: auto; - height: auto; - overflow: visible; -} - -.dropdown-click .secondary-navigation ul ul ul.toggled-on { - left: 0; - top: auto; - position: relative; -} - -.dropdown-click .widget-area .secondary-navigation ul ul { - top: auto; - position: absolute; - float: none; - width: 100%; - left: -99999px; -} - -.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on { - position: relative; - left: 0; - right: 0; -} - -.dropdown-click.both-right .widget-area .secondary-navigation ul ul, -.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul, -.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { - right: 0; -} - -.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover > ul { - top: 0; - left: 100%; - width: 220px; -} - -.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, -.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, -.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul, -.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul { - right: 100%; - left: auto; -} - -.rtl .secondary-navigation ul ul { - float: right; - left: auto; - right: 0; - text-align: right; -} - -.rtl .secondary-navigation ul ul ul { - left: auto; - right: 100%; -} - -.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { - transform: rotate(180deg); -} - -/* Top bar */ -.secondary-navigation .top-bar { - background: transparent; -} - -.secondary-navigation .inside-top-bar { - padding: 0; -} - -.secondary-navigation .top-bar a { - display: inline; -} - -.secondary-nav-aligned-right .secondary-navigation .top-bar { - float: left; -} - -.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget { - margin: 0 10px; -} - -.secondary-nav-aligned-left .secondary-navigation .top-bar { - float: right; -} - -.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget { - margin-left: 10px; -} - -.secondary-nav-aligned-center .secondary-navigation .top-bar, -.secondary-nav-aligned-center .secondary-navigation .top-bar + .menu-toggle + div { - display: inline-block; - vertical-align: middle; -} - -.secondary-nav-aligned-center .secondary-navigation .top-bar .widget:not(:first-child) { - margin-left: 10px; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.min.css deleted file mode 100644 index 88215e4e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.min.css +++ /dev/null @@ -1 +0,0 @@ -.secondary-navigation{clear:both;z-index:99;padding:0}.secondary-navigation ul{list-style:none;margin:0;padding-left:0}.secondary-navigation li{float:left;position:relative}.secondary-navigation a{display:block;text-decoration:none}.secondary-navigation ul ul{display:block;box-shadow:0 2px 2px rgba(0,0,0,.1);float:left;position:absolute;left:-99999px;opacity:0;z-index:99999;width:200px;text-align:left;top:auto;transition:opacity 80ms linear;transition-delay:0s;pointer-events:none;height:0;overflow:hidden}.secondary-navigation ul ul li{width:100%}.secondary-navigation ul ul li a{line-height:normal;font-size:90%}.secondary-navigation.sub-menu-left .sub-menu{right:0}.secondary-navigation .main-nav ul ul li a{line-height:normal;font-size:12px;padding-left:20px;padding-right:20px;padding-top:10px;padding-bottom:10px}.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-right:0;position:relative}.secondary-navigation .main-nav ul li a{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px}.secondary-navigation .menu-toggle{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px;margin:0}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:20px}.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{padding-top:10px;padding-bottom:10px;margin-top:-10px}.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover>ul{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible}.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover>ul{left:100%;top:0}.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover>ul{right:100%;top:0;left:auto}.secondary-nav-float-right .secondary-navigation{float:right}.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a{line-height:normal}.secondary-nav-float-right .secondary-navigation ul ul ul{top:0}.secondary-nav-float-left .inside-header .secondary-navigation{float:left;clear:left}.secondary-nav-float-left .inside-header:after{clear:both;content:'';display:table}.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-branding,.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-logo{float:right;clear:right}.secondary-nav-float-left.nav-float-right .inside-header .site-branding,.secondary-nav-float-left.nav-float-right .inside-header .site-logo{float:none;clear:none}.secondary-nav-float-left.nav-float-right .site-header{text-align:center}.secondary-nav-float-right.nav-float-left .inside-header .site-branding,.secondary-nav-float-right.nav-float-left .inside-header .site-logo{float:none;clear:none}.secondary-nav-float-right.nav-float-left .site-header{text-align:center}.widget-area .secondary-navigation li{display:block;float:none;margin:0;padding:0;width:100%}.widget-area .secondary-navigation ul ul{left:100%;top:0;width:220px}.both-right .widget-area .secondary-navigation ul ul,.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.right-sidebar .widget-area .secondary-navigation ul ul{left:auto;right:100%}.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation .sf-menu>li{float:none;display:inline-block}.secondary-nav-aligned-center .secondary-navigation ul.secondary-menu,.secondary-nav-aligned-right .secondary-navigation ul.secondary-menu{font-size:0}.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation{text-align:left}.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation:after,.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation:after{clear:both;content:'';display:table}.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation{text-align:center}.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation{text-align:right}.dropdown-click .secondary-navigation ul ul{visibility:hidden}.dropdown-click .secondary-navigation ul li.sfHover>ul.toggled-on,.dropdown-click .secondary-navigation ul.toggled-on{left:auto;opacity:1;visibility:visible;pointer-events:auto;height:auto;overflow:visible}.dropdown-click .secondary-navigation ul ul ul.toggled-on{left:0;top:auto;position:relative}.dropdown-click .widget-area .secondary-navigation ul ul{top:auto;position:absolute;float:none;width:100%;left:-99999px}.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on{position:relative;left:0;right:0}.dropdown-click.both-right .widget-area .secondary-navigation ul ul,.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul{right:0}.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{top:0;left:100%;width:220px}.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{right:100%;left:auto}.rtl .secondary-navigation ul ul{float:right;left:auto;right:0;text-align:right}.rtl .secondary-navigation ul ul ul{left:auto;right:100%}.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{transform:rotate(180deg)}.secondary-navigation .top-bar{background:0 0}.secondary-navigation .inside-top-bar{padding:0}.secondary-navigation .top-bar a{display:inline}.secondary-nav-aligned-right .secondary-navigation .top-bar{float:left}.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget{margin:0 10px}.secondary-nav-aligned-left .secondary-navigation .top-bar{float:right}.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget{margin-left:10px}.secondary-nav-aligned-center .secondary-navigation .top-bar,.secondary-nav-aligned-center .secondary-navigation .top-bar+.menu-toggle+div{display:inline-block;vertical-align:middle}.secondary-nav-aligned-center .secondary-navigation .top-bar .widget:not(:first-child){margin-left:10px} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/functions.php deleted file mode 100644 index 5738848a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/functions.php +++ /dev/null @@ -1,1356 +0,0 @@ - __( 'Secondary Menu', 'gp-premium' ), - ) - ); - } -} - -if ( ! function_exists( 'generate_secondary_nav_enqueue_scripts' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_secondary_nav_enqueue_scripts', 100 ); - /** - * Add our necessary scripts. - * - * @since 0.1 - */ - function generate_secondary_nav_enqueue_scripts() { - // Bail if no Secondary menu is set. - if ( ! has_nav_menu( 'secondary' ) ) { - return; - } - - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - wp_enqueue_style( 'generate-secondary-nav', plugin_dir_url( __FILE__ ) . "css/main{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION ); - wp_enqueue_style( 'generate-secondary-nav-mobile', plugin_dir_url( __FILE__ ) . "css/main-mobile{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION, 'all' ); - } else { - wp_enqueue_style( 'generate-secondary-nav', plugin_dir_url( __FILE__ ) . "css/style{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION ); - wp_enqueue_style( 'generate-secondary-nav-mobile', plugin_dir_url( __FILE__ ) . "css/style-mobile{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION, 'all' ); - } - - if ( ! defined( 'GENERATE_DISABLE_MOBILE' ) ) { - wp_add_inline_script( - 'generate-navigation', - "jQuery( document ).ready( function($) { - $( '.secondary-navigation .menu-toggle' ).on( 'click', function( e ) { - e.preventDefault(); - $( this ).closest( '.secondary-navigation' ).toggleClass( 'toggled' ); - $( this ).closest( '.secondary-navigation' ).attr( 'aria-expanded', $( this ).closest( '.secondary-navigation' ).attr( 'aria-expanded' ) === 'true' ? 'false' : 'true' ); - $( this ).toggleClass( 'toggled' ); - $( this ).children( 'i' ).toggleClass( 'fa-bars' ).toggleClass( 'fa-close' ); - $( this ).attr( 'aria-expanded', $( this ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); - }); - });" - ); - } - } -} - -if ( ! function_exists( 'generate_secondary_nav_enqueue_customizer_scripts' ) ) { - add_action( 'customize_preview_init', 'generate_secondary_nav_enqueue_customizer_scripts' ); - /** - * Add our Customizer preview JS. - * - * @since 0.1 - */ - function generate_secondary_nav_enqueue_customizer_scripts() { - wp_enqueue_script( 'generate-secondary-nav-customizer', plugin_dir_url( __FILE__ ) . 'js/customizer.js', array( 'jquery', 'customize-preview' ), GENERATE_SECONDARY_NAV_VERSION, true ); - - wp_localize_script( - 'generate-secondary-nav-customizer', - 'generateSecondaryNav', - array( - 'isFlex' => function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox(), - ) - ); - } -} - -if ( ! function_exists( 'generate_secondary_nav_get_defaults' ) ) { - /** - * Set default options. - * - * @since 0.1 - * @param bool $filter Whether to filter the defaults or not. - */ - function generate_secondary_nav_get_defaults( $filter = true ) { - $generate_defaults = array( - 'secondary_nav_mobile_label' => 'Menu', - 'secondary_nav_layout_setting' => 'secondary-fluid-nav', - 'secondary_nav_inner_width' => 'contained', - 'secondary_nav_position_setting' => 'secondary-nav-above-header', - 'secondary_nav_alignment' => 'right', - 'secondary_nav_dropdown_direction' => 'right', - 'navigation_background_color' => '#636363', - 'navigation_text_color' => '#ffffff', - 'navigation_background_hover_color' => '#303030', - 'navigation_text_hover_color' => '#ffffff', - 'navigation_background_current_color' => '#ffffff', - 'navigation_text_current_color' => '#222222', - 'subnavigation_background_color' => '#303030', - 'subnavigation_text_color' => '#ffffff', - 'subnavigation_background_hover_color' => '#474747', - 'subnavigation_text_hover_color' => '#ffffff', - 'subnavigation_background_current_color' => '#474747', - 'subnavigation_text_current_color' => '#ffffff', - 'secondary_menu_item' => '20', - 'secondary_menu_item_height' => '40', - 'secondary_sub_menu_item_height' => '10', - 'font_secondary_navigation' => 'inherit', - 'font_secondary_navigation_variants' => '', - 'font_secondary_navigation_category' => '', - 'secondary_navigation_font_weight' => 'normal', - 'secondary_navigation_font_transform' => 'none', - 'secondary_navigation_font_size' => '13', - 'nav_image' => '', - 'nav_repeat' => '', - 'nav_item_image' => '', - 'nav_item_repeat' => '', - 'nav_item_hover_image' => '', - 'nav_item_hover_repeat' => '', - 'nav_item_current_image' => '', - 'nav_item_current_repeat' => '', - 'sub_nav_image' => '', - 'sub_nav_repeat' => '', - 'sub_nav_item_image' => '', - 'sub_nav_item_repeat' => '', - 'sub_nav_item_hover_image' => '', - 'sub_nav_item_hover_repeat' => '', - 'sub_nav_item_current_image' => '', - 'sub_nav_item_current_repeat' => '', - 'merge_top_bar' => false, - ); - - if ( $filter ) { - return apply_filters( 'generate_secondary_nav_option_defaults', $generate_defaults ); - } - - return $generate_defaults; - } -} - -if ( ! function_exists( 'generate_secondary_nav_customize_register' ) ) { - add_action( 'customize_register', 'generate_secondary_nav_customize_register', 100 ); - /** - * Register our options. - * - * @since 0.1 - * @param object $wp_customize The Customizer object. - */ - function generate_secondary_nav_customize_register( $wp_customize ) { - $defaults = generate_secondary_nav_get_defaults(); - - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - if ( method_exists( $wp_customize, 'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Use the Layout panel in the free theme if it exists. - if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { - $layout_panel = 'generate_layout_panel'; - } else { - $layout_panel = 'secondary_navigation_panel'; - } - - // Add our secondary navigation panel. - // This shouldn't be used anymore if the theme is up to date. - if ( class_exists( 'WP_Customize_Panel' ) ) { - $wp_customize->add_panel( - 'secondary_navigation_panel', - array( - 'priority' => 100, - 'capability' => 'edit_theme_options', - 'theme_supports' => '', - 'title' => __( 'Secondary Navigation', 'gp-premium' ), - 'description' => '', - ) - ); - } - - $wp_customize->add_section( - 'secondary_nav_section', - array( - 'title' => __( 'Secondary Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 31, - 'panel' => $layout_panel, - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_secondary_navigation_layout_shortcuts', - array( - 'section' => 'secondary_nav_section', - 'element' => __( 'Secondary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'secondary_navigation_color_section', - 'typography' => 'secondary_font_section', - 'backgrounds' => 'secondary_bg_images_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_nav_mobile_label]', - array( - 'default' => $defaults['secondary_nav_mobile_label'], - 'type' => 'option', - 'sanitize_callback' => 'wp_kses_post', - ) - ); - - $wp_customize->add_control( - 'secondary_nav_mobile_label_control', - array( - 'label' => __( 'Mobile Menu Label', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'settings' => 'generate_secondary_nav_settings[secondary_nav_mobile_label]', - 'priority' => 10, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_nav_layout_setting]', - array( - 'default' => $defaults['secondary_nav_layout_setting'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[secondary_nav_layout_setting]', - array( - 'type' => 'select', - 'label' => __( 'Navigation Width', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'choices' => array( - 'secondary-fluid-nav' => _x( 'Full', 'Width', 'gp-premium' ), - 'secondary-contained-nav' => _x( 'Contained', 'Width', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[secondary_nav_layout_setting]', - 'priority' => 15, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_nav_inner_width]', - array( - 'default' => $defaults['secondary_nav_inner_width'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[secondary_nav_inner_width]', - array( - 'type' => 'select', - 'label' => __( 'Inner Navigation Width', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'choices' => array( - 'full-width' => _x( 'Full', 'Width', 'gp-premium' ), - 'contained' => _x( 'Contained', 'Width', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[secondary_nav_inner_width]', - 'priority' => 15, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_nav_alignment]', - array( - 'default' => $defaults['secondary_nav_alignment'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[secondary_nav_alignment]', - array( - 'type' => 'select', - 'label' => __( 'Navigation Alignment', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'choices' => array( - 'left' => __( 'Left', 'gp-premium' ), - 'center' => __( 'Center', 'gp-premium' ), - 'right' => __( 'Right', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[secondary_nav_alignment]', - 'priority' => 20, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_nav_position_setting]', - array( - 'default' => $defaults['secondary_nav_position_setting'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[secondary_nav_position_setting]', - array( - 'type' => 'select', - 'label' => __( 'Navigation Location', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'choices' => array( - 'secondary-nav-below-header' => __( 'Below Header', 'gp-premium' ), - 'secondary-nav-above-header' => __( 'Above Header', 'gp-premium' ), - 'secondary-nav-float-right' => __( 'Float Right', 'gp-premium' ), - 'secondary-nav-float-left' => __( 'Float Left', 'gp-premium' ), - 'secondary-nav-left-sidebar' => __( 'Left Sidebar', 'gp-premium' ), - 'secondary-nav-right-sidebar' => __( 'Right Sidebar', 'gp-premium' ), - '' => __( 'No Navigation', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[secondary_nav_position_setting]', - 'priority' => 30, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', - array( - 'default' => $defaults['secondary_nav_dropdown_direction'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', - array( - 'type' => 'select', - 'label' => __( 'Dropdown Direction', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'choices' => array( - 'right' => __( 'Right', 'gp-premium' ), - 'left' => __( 'Left', 'gp-premium' ), - ), - 'settings' => 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', - 'priority' => 35, - ) - ); - - $wp_customize->add_setting( - 'generate_secondary_nav_settings[merge_top_bar]', - array( - 'default' => $defaults['merge_top_bar'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - 'generate_secondary_nav_settings[merge_top_bar]', - array( - 'type' => 'checkbox', - 'label' => __( 'Merge with Secondary Navigation', 'gp-premium' ), - 'section' => 'generate_top_bar', - 'settings' => 'generate_secondary_nav_settings[merge_top_bar]', - 'priority' => 100, - 'active_callback' => 'generate_secondary_nav_show_merge_top_bar', - ) - ); - } -} - -if ( ! function_exists( 'generate_display_secondary_google_fonts' ) ) { - add_filter( 'generate_typography_google_fonts', 'generate_display_secondary_google_fonts', 50 ); - /** - * Add Google Fonts to wp_head if needed. - * - * @since 0.1 - * @param array $google_fonts Existing fonts. - */ - function generate_display_secondary_google_fonts( $google_fonts ) { - if ( ! has_nav_menu( 'secondary' ) ) { - return $google_fonts; - } - - $generate_secondary_nav_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( function_exists( 'generate_typography_default_fonts' ) ) { - $not_google = str_replace( ' ', '+', generate_typography_default_fonts() ); - } else { - $not_google = array( - 'inherit', - 'Arial,+Helvetica,+sans-serif', - 'Century+Gothic', - 'Comic+Sans+MS', - 'Courier+New', - 'Georgia,+Times+New+Roman,+Times,+serif', - 'Helvetica', - 'Impact', - 'Lucida+Console', - 'Lucida+Sans+Unicode', - 'Palatino+Linotype', - 'Tahoma,+Geneva,+sans-serif', - 'Trebuchet+MS,+Helvetica,+sans-serif', - 'Verdana,+Geneva,+sans-serif', - ); - } - - $secondary_google_fonts = array(); - - if ( function_exists( 'generate_get_google_font_variants' ) ) { - - // If our value is still using the old format, fix it. - if ( strpos( $generate_secondary_nav_settings['font_secondary_navigation'], ':' ) !== false ) { - $generate_secondary_nav_settings['font_secondary_navigation'] = current( explode( ':', $generate_secondary_nav_settings['font_secondary_navigation'] ) ); - } - - // Grab the variants using the plain name. - $variants = generate_get_google_font_variants( $generate_secondary_nav_settings['font_secondary_navigation'], 'font_secondary_navigation', generate_secondary_nav_get_defaults() ); - - } else { - $variants = ''; - } - - // Replace the spaces in the names with a plus. - $value = str_replace( ' ', '+', $generate_secondary_nav_settings['font_secondary_navigation'] ); - - // If we have variants, add them to our value. - $value = ! empty( $variants ) ? $value . ':' . $variants : $value; - - // Add our value to the array. - $secondary_google_fonts[] = $value; - - // Ignore any non-Google fonts. - $secondary_google_fonts = array_diff( $secondary_google_fonts, $not_google ); - - // Separate each different font with a bar. - $secondary_google_fonts = implode( '|', $secondary_google_fonts ); - - if ( ! empty( $secondary_google_fonts ) ) { - $print_secondary_fonts = '|' . $secondary_google_fonts; - } else { - $print_secondary_fonts = ''; - } - - // Remove any duplicates. - $return = $google_fonts . $print_secondary_fonts; - $return = implode( '|', array_unique( explode( '|', $return ) ) ); - return $return; - - } -} - -if ( ! function_exists( 'generate_add_secondary_navigation_after_header' ) ) { - add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 ); - /** - * Add the navigation after the header. - * - * @since 0.1 - */ - function generate_add_secondary_navigation_after_header() { - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( 'secondary-nav-below-header' === $generate_settings['secondary_nav_position_setting'] ) { - generate_secondary_navigation_position(); - } - - } -} - -if ( ! function_exists( 'generate_add_secondary_navigation_before_header' ) ) { - add_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 ); - /** - * Add the navigation before the header. - * - * @since 0.1 - */ - function generate_add_secondary_navigation_before_header() { - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( 'secondary-nav-above-header' === $generate_settings['secondary_nav_position_setting'] ) { - generate_secondary_navigation_position(); - } - - } -} - -if ( ! function_exists( 'generate_add_secondary_navigation_float_right' ) ) { - add_action( 'generate_before_header_content', 'generate_add_secondary_navigation_float_right', 7 ); - /** - * Add the navigation inside the header so it can float right. - * - * @since 0.1 - */ - function generate_add_secondary_navigation_float_right() { - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - return; - } - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] || 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] ) { - generate_secondary_navigation_position(); - } - - } -} - -add_action( 'generate_after_header_content', 'generate_do_secondary_navigation_float_right', 7 ); -/** - * Add the navigation inside the header so it can float right. - * - * @since 1.11.0 - */ -function generate_do_secondary_navigation_float_right() { - if ( ! function_exists( 'generate_is_using_flexbox' ) ) { - return; - } - - if ( ! generate_is_using_flexbox() ) { - return; - } - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] || 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] ) { - generate_secondary_navigation_position(); - } - -} - -add_action( 'generate_before_navigation', 'generate_do_multi_navigation_wrapper_open', 11 ); -/** - * Open our wrapper that puts both navigations inside one element. - * - * @since 1.11.0 - */ -function generate_do_multi_navigation_wrapper_open() { - if ( ! function_exists( 'generate_is_using_flexbox' ) ) { - return; - } - - if ( ! generate_is_using_flexbox() ) { - return; - } - - if ( ! function_exists( 'generate_get_option' ) ) { - return; - } - - if ( ! has_nav_menu( 'secondary' ) ) { - return; - } - - if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { - $menu_settings = wp_parse_args( - get_option( 'generate_menu_plus_settings', array() ), - generate_menu_plus_get_defaults() - ); - - if ( $menu_settings['navigation_as_header'] ) { - return; - } - } - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( - ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-right' === generate_get_option( 'nav_position_setting' ) ) || - ( 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-left' === generate_get_option( 'nav_position_setting' ) ) - ) { - echo '
          '; - } -} - -add_action( 'generate_after_secondary_navigation', 'generate_do_multi_navigation_wrapper_close', 7 ); -/** - * Close our wrapper that puts both navigations inside one element. - * - * @since 1.11.0 - */ -function generate_do_multi_navigation_wrapper_close() { - if ( ! function_exists( 'generate_is_using_flexbox' ) ) { - return; - } - - if ( ! generate_is_using_flexbox() ) { - return; - } - - if ( ! function_exists( 'generate_get_option' ) ) { - return; - } - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( - ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-right' === generate_get_option( 'nav_position_setting' ) ) || - ( 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-left' === generate_get_option( 'nav_position_setting' ) ) - ) { - echo '
          '; - } -} - -if ( ! function_exists( 'generate_add_secondary_navigation_before_right_sidebar' ) ) { - add_action( 'generate_before_right_sidebar_content', 'generate_add_secondary_navigation_before_right_sidebar', 7 ); - /** - * Add the navigation into the right sidebar. - * - * @since 0.1 - */ - function generate_add_secondary_navigation_before_right_sidebar() { - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( 'secondary-nav-right-sidebar' === $generate_settings['secondary_nav_position_setting'] ) { - echo '
          '; - generate_secondary_navigation_position(); - echo '
          '; - } - - } -} - -if ( ! function_exists( 'generate_add_secondary_navigation_before_left_sidebar' ) ) { - add_action( 'generate_before_left_sidebar_content', 'generate_add_secondary_navigation_before_left_sidebar', 7 ); - /** - * Add the navigation into the left sidebar. - * - * @since 0.1 - */ - function generate_add_secondary_navigation_before_left_sidebar() { - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( 'secondary-nav-left-sidebar' === $generate_settings['secondary_nav_position_setting'] ) { - echo '
          '; - generate_secondary_navigation_position(); - echo '
          '; - } - - } -} - -if ( ! function_exists( 'generate_secondary_navigation_position' ) ) { - /** - * Build our secondary navigation. - * Would like to change this function name. - * - * @since 0.1 - */ - function generate_secondary_navigation_position() { - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - if ( has_nav_menu( 'secondary' ) ) : - do_action( 'generate_before_secondary_navigation' ); - - $microdata = ' itemtype="https://schema.org/SiteNavigationElement" itemscope="itemscope"'; - - if ( function_exists( 'generate_get_schema_type' ) && 'microdata' !== generate_get_schema_type() ) { - $microdata = ''; - } - ?> - - - - '; - do_action( 'generate_secondary_menu_bar_items' ); - echo ''; - } - } -} - -if ( ! function_exists( 'generate_secondary_nav_body_classes' ) ) { - add_filter( 'body_class', 'generate_secondary_nav_body_classes' ); - /** - * Adds custom classes to the array of body classes. - * - * @since 0.1 - * @param array $classes Existing body classes. - */ - function generate_secondary_nav_body_classes( $classes ) { - if ( ! has_nav_menu( 'secondary' ) ) { - return $classes; - } - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - $classes[] = ( $generate_settings['secondary_nav_position_setting'] ) ? $generate_settings['secondary_nav_position_setting'] : 'secondary-nav-below-header'; - - if ( 'left' === $generate_settings['secondary_nav_alignment'] ) { - $classes[] = 'secondary-nav-aligned-left'; - } elseif ( 'center' === $generate_settings['secondary_nav_alignment'] ) { - $classes[] = 'secondary-nav-aligned-center'; - } elseif ( 'right' === $generate_settings['secondary_nav_alignment'] ) { - $classes[] = 'secondary-nav-aligned-right'; - } else { - $classes[] = 'secondary-nav-aligned-left'; - } - - return $classes; - } -} - -if ( ! function_exists( 'generate_secondary_menu_classes' ) ) { - add_filter( 'generate_secondary_menu_class', 'generate_secondary_menu_classes' ); - /** - * Adds custom classes to the menu. - * - * @since 0.1 - * @param array $classes Existing classes. - */ - function generate_secondary_menu_classes( $classes ) { - - $classes[] = 'secondary-menu'; - $classes[] = 'sf-menu'; - - return $classes; - - } -} - -if ( ! function_exists( 'generate_secondary_navigation_classes' ) ) { - add_filter( 'generate_secondary_navigation_class', 'generate_secondary_navigation_classes' ); - /** - * Adds custom classes to the navigation. - * - * @since 0.1 - * @param array $classes Existing classes. - */ - function generate_secondary_navigation_classes( $classes ) { - $classes[] = 'secondary-navigation'; - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - $nav_layout = $generate_settings['secondary_nav_layout_setting']; - - if ( 'secondary-contained-nav' === $nav_layout ) { - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - $navigation_location = $generate_settings['secondary_nav_position_setting']; - - if ( 'secondary-nav-float-right' !== $navigation_location && 'secondary-nav-float-left' !== $navigation_location ) { - $classes[] = 'grid-container'; - } - } else { - $classes[] = 'grid-container'; - $classes[] = 'grid-parent'; - } - } - - if ( 'left' === $generate_settings['secondary_nav_dropdown_direction'] ) { - $layout = $generate_settings['secondary_nav_position_setting']; - - switch ( $layout ) { - case 'secondary-nav-below-header': - case 'secondary-nav-above-header': - case 'secondary-nav-float-right': - case 'secondary-nav-float-left': - $classes[] = 'sub-menu-left'; - break; - } - } - - if ( $generate_settings['merge_top_bar'] && is_active_sidebar( 'top-bar' ) ) { - $classes[] = 'has-top-bar'; - } - - if ( generate_secondary_nav_has_menu_bar_items() ) { - $classes[] = 'has-menu-bar-items'; - } - - return $classes; - - } -} - -if ( ! function_exists( 'generate_inside_secondary_navigation_classes' ) ) { - add_filter( 'generate_inside_secondary_navigation_class', 'generate_inside_secondary_navigation_classes' ); - /** - * Adds custom classes to the inner navigation - * - * @since 1.3.41 - * @param array $classes Existing classes. - */ - function generate_inside_secondary_navigation_classes( $classes ) { - $classes[] = 'inside-navigation'; - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - $inner_nav_width = $generate_settings['secondary_nav_inner_width']; - - if ( 'full-width' !== $inner_nav_width ) { - $classes[] = 'grid-container'; - $classes[] = 'grid-parent'; - } - - return $classes; - - } -} - -if ( ! function_exists( 'generate_secondary_nav_css' ) ) { - /** - * Generate the CSS in the section using the Theme Customizer. - * - * @since 0.1 - */ - function generate_secondary_nav_css() { - - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( function_exists( 'generate_spacing_get_defaults' ) ) { - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - $separator = $spacing_settings['separator']; - } else { - $separator = 20; - } - - // Check if we're using our legacy typography system. - $using_dynamic_typography = function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography(); - $secondary_nav_family = ''; - - if ( ! $using_dynamic_typography ) { - if ( function_exists( 'generate_get_font_family_css' ) ) { - $secondary_nav_family = generate_get_font_family_css( 'font_secondary_navigation', 'generate_secondary_nav_settings', generate_secondary_nav_get_defaults() ); - } else { - $secondary_nav_family = current( explode( ':', $generate_settings['font_secondary_navigation'] ) ); - } - - if ( '""' === $secondary_nav_family ) { - $secondary_nav_family = 'inherit'; - } - } - - // Get our untouched defaults. - $og_defaults = generate_secondary_nav_get_defaults( false ); - - $css = new GeneratePress_Secondary_Nav_CSS(); - - $css->set_selector( '.secondary-navigation' ); - $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_color'] ) ); - $css->add_property( 'background-image', ! empty( $generate_settings['nav_image'] ) ? 'url(' . esc_url( $generate_settings['nav_image'] ) . ')' : '' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_repeat'] ) ); - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - if ( function_exists( 'generate_spacing_get_defaults' ) && function_exists( 'generate_get_option' ) && 'text' === generate_get_option( 'container_alignment' ) ) { - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - - $navigation_left_padding = absint( $spacing_settings['header_left'] ) - absint( $generate_settings['secondary_menu_item'] ); - $navigation_right_padding = absint( $spacing_settings['header_right'] ) - absint( $generate_settings['secondary_menu_item'] ); - - $css->set_selector( '.secondary-nav-below-header .secondary-navigation .inside-navigation.grid-container, .secondary-nav-above-header .secondary-navigation .inside-navigation.grid-container' ); - $css->add_property( 'padding', generate_padding_css( 0, $navigation_right_padding, 0, $navigation_left_padding ) ); - } - } - - if ( 'secondary-nav-above-header' === $generate_settings['secondary_nav_position_setting'] && has_nav_menu( 'secondary' ) && is_active_sidebar( 'top-bar' ) ) { - $css->set_selector( '.secondary-navigation .top-bar' ); - $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); - $css->add_property( 'line-height', absint( $generate_settings['secondary_menu_item_height'] ), false, 'px' ); - - if ( ! $using_dynamic_typography ) { - $css->add_property( 'font-family', $secondary_nav_family ); - $css->add_property( 'font-weight', esc_attr( $generate_settings['secondary_navigation_font_weight'] ) ); - $css->add_property( 'text-transform', esc_attr( $generate_settings['secondary_navigation_font_transform'] ) ); - $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] ), false, 'px' ); - } - - $css->set_selector( '.secondary-navigation .top-bar a' ); - $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); - - $css->set_selector( '.secondary-navigation .top-bar a:hover, .secondary-navigation .top-bar a:focus' ); - $css->add_property( 'color', esc_attr( $generate_settings['navigation_background_hover_color'] ) ); - } - - // Navigation text. - $css->set_selector( '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle,.secondary-menu-bar-items .menu-bar-item > a' ); - $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); - - if ( ! $using_dynamic_typography ) { - $css->add_property( 'font-family', ( 'inherit' !== $secondary_nav_family ) ? $secondary_nav_family : null ); - $css->add_property( 'font-weight', esc_attr( $generate_settings['secondary_navigation_font_weight'] ), $og_defaults['secondary_navigation_font_weight'] ); - $css->add_property( 'text-transform', esc_attr( $generate_settings['secondary_navigation_font_transform'] ), $og_defaults['secondary_navigation_font_transform'] ); - $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] ), $og_defaults['secondary_navigation_font_size'], 'px' ); - } - - $css->add_property( 'padding-left', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); - $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); - $css->add_property( 'line-height', absint( $generate_settings['secondary_menu_item_height'] ), $og_defaults['secondary_menu_item_height'], 'px' ); - $css->add_property( 'background-image', ! empty( $generate_settings['nav_item_image'] ) ? 'url(' . esc_url( $generate_settings['nav_item_image'] ) . ')' : '' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_repeat'] ) ); - - $css->set_selector( '.secondary-navigation .secondary-menu-bar-items' ); - $css->add_property( 'color', $generate_settings['navigation_text_color'] ); - - if ( ! $using_dynamic_typography ) { - $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] ), $og_defaults['secondary_navigation_font_size'], 'px' ); - } - - // Mobile menu text on hover. - $css->set_selector( 'button.secondary-menu-toggle:hover,button.secondary-menu-toggle:focus' ); - $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); - - // Widget area navigation. - $css->set_selector( '.widget-area .secondary-navigation' ); - $css->add_property( 'margin-bottom', absint( $separator ), false, 'px' ); - - // Sub-navigation background. - $css->set_selector( '.secondary-navigation ul ul' ); - $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_color'] ) ); - $css->add_property( 'top', 'auto' ); // Added for compatibility purposes on 22/12/2016. - - // Sub-navigation text. - $css->set_selector( '.secondary-navigation .main-nav ul ul li a' ); - $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_color'] ) ); - - if ( ! $using_dynamic_typography ) { - $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] - 1 ), absint( $og_defaults['secondary_navigation_font_size'] - 1 ), 'px' ); - } - - $css->add_property( 'padding-left', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); - $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); - $css->add_property( 'padding-top', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); - $css->add_property( 'padding-bottom', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); - $css->add_property( 'background-image', ! empty( $generate_settings['sub_nav_item_image'] ) ? 'url(' . esc_url( $generate_settings['sub_nav_item_image'] ) . ')' : '' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_repeat'] ) ); - - // Menu item padding on RTL. - if ( is_rtl() ) { - $css->set_selector( 'nav.secondary-navigation .main-nav ul li.menu-item-has-children > a' ); - $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); - } - - // Dropdown arrow. - $css->set_selector( '.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle' ); - $css->add_property( 'padding-top', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); - $css->add_property( 'padding-bottom', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); - $css->add_property( 'margin-top', '-' . absint( $generate_settings['secondary_sub_menu_item_height'] ), '-' . absint( $og_defaults['secondary_sub_menu_item_height'] ), 'px' ); - - // Dropdown arrow. - $css->set_selector( '.secondary-navigation .menu-item-has-children .dropdown-menu-toggle' ); - $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); - - // Sub-navigation dropdown arrow. - $css->set_selector( '.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle' ); - $css->add_property( 'padding-top', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); - $css->add_property( 'padding-bottom', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); - $css->add_property( 'margin-top', '-' . absint( $generate_settings['secondary_sub_menu_item_height'] ), '-' . absint( $og_defaults['secondary_sub_menu_item_height'] ), 'px' ); - - // Navigation background/text on hover. - $css->set_selector( '.secondary-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a, .secondary-navigation .main-nav ul li:not([class*="current-menu-"]):focus > a, .secondary-navigation .main-nav ul li.sfHover:not([class*="current-menu-"]) > a, .secondary-menu-bar-items .menu-bar-item:hover > a' ); - $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_hover_color'] ) ); - $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_hover_color'] ) ); - $css->add_property( 'background-image', ! empty( $generate_settings['nav_item_hover_image'] ) ? 'url(' . esc_url( $generate_settings['nav_item_hover_image'] ) . ')' : '' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_hover_repeat'] ) ); - - // Sub-Navigation background/text on hover. - $css->set_selector( '.secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):hover > a,.secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):focus > a,.secondary-navigation .main-nav ul ul li.sfHover:not([class*="current-menu-"]) > a' ); - $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_hover_color'] ) ); - $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_hover_color'] ) ); - $css->add_property( 'background-image', ! empty( $generate_settings['sub_nav_item_hover_image'] ) ? 'url(' . esc_url( $generate_settings['sub_nav_item_hover_image'] ) . ')' : '' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_hover_repeat'] ) ); - - // Navigation background / text current + hover. - $css->set_selector( '.secondary-navigation .main-nav ul li[class*="current-menu-"] > a' ); - $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_current_color'] ) ); - $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_current_color'] ) ); - $css->add_property( 'background-image', ! empty( $generate_settings['nav_item_current_image'] ) ? 'url(' . esc_url( $generate_settings['nav_item_current_image'] ) . ')' : '' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_current_repeat'] ) ); - - // Sub-Navigation background / text current + hover. - $css->set_selector( '.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a' ); - $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_current_color'] ) ); - $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_current_color'] ) ); - $css->add_property( 'background-image', ! empty( $generate_settings['sub_nav_item_current_image'] ) ? 'url(' . esc_url( $generate_settings['sub_nav_item_current_image'] ) . ')' : '' ); - $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_current_repeat'] ) ); - - // RTL menu item padding. - if ( is_rtl() ) { - $css->set_selector( '.secondary-navigation .main-nav ul li.menu-item-has-children > a' ); - $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), false, 'px' ); - } - - if ( function_exists( 'generate_get_option' ) && function_exists( 'generate_get_defaults' ) ) { - $theme_defaults = generate_get_defaults(); - - if ( isset( $theme_defaults['icons'] ) ) { - if ( 'svg' === generate_get_option( 'icons' ) ) { - $css->set_selector( '.secondary-navigation.toggled .dropdown-menu-toggle:before' ); - $css->add_property( 'display', 'none' ); - } - } - } - - $mobile_css = '@media ' . generate_premium_get_media_query( 'mobile-menu' ) . ' {.secondary-menu-bar-items .menu-bar-item:hover > a{background: none;color: ' . $generate_settings['navigation_text_color'] . ';}}'; - - // Return our dynamic CSS. - return $css->css_output() . $mobile_css; - } -} - -if ( ! function_exists( 'generate_secondary_color_scripts' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_secondary_color_scripts', 110 ); - /** - * Enqueue scripts and styles - */ - function generate_secondary_color_scripts() { - // Bail if no Secondary menu is set. - if ( ! has_nav_menu( 'secondary' ) ) { - return; - } - - wp_add_inline_style( 'generate-secondary-nav', generate_secondary_nav_css() ); - - if ( class_exists( 'GeneratePress_Typography' ) ) { - wp_add_inline_style( 'generate-secondary-nav', GeneratePress_Typography::get_css( 'secondary-nav' ) ); - } - } -} - -if ( ! function_exists( 'generate_secondary_navigation_class' ) ) { - /** - * Display the classes for the secondary navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - */ - function generate_secondary_navigation_class( $class = '' ) { - // Separates classes with a single space, collates classes for post DIV. - echo 'class="' . join( ' ', generate_get_secondary_navigation_class( $class ) ) . '"'; // phpcs:ignore -- Escaped in generate_get_secondary_navigation_class. - } -} - -if ( ! function_exists( 'generate_get_secondary_navigation_class' ) ) { - /** - * Retrieve the classes for the secondary navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - * @return array Array of classes. - */ - function generate_get_secondary_navigation_class( $class = '' ) { - $classes = array(); - - if ( ! empty( $class ) ) { - if ( ! is_array( $class ) ) { - $class = preg_split( '#\s+#', $class ); - } - - $classes = array_merge( $classes, $class ); - } - - $classes = array_map( 'esc_attr', $classes ); - - return apply_filters( 'generate_secondary_navigation_class', $classes, $class ); - } -} - -if ( ! function_exists( 'generate_secondary_menu_class' ) ) { - /** - * Display the classes for the secondary navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - */ - function generate_secondary_menu_class( $class = '' ) { - // Separates classes with a single space, collates classes for post DIV. - echo 'class="' . join( ' ', generate_get_secondary_menu_class( $class ) ) . '"'; // phpcs:ignore -- Escaped in generate_get_secondary_menu_class. - } -} - -if ( ! function_exists( 'generate_get_secondary_menu_class' ) ) { - /** - * Retrieve the classes for the secondary navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - * @return array Array of classes. - */ - function generate_get_secondary_menu_class( $class = '' ) { - $classes = array(); - - if ( ! empty( $class ) ) { - if ( ! is_array( $class ) ) { - $class = preg_split( '#\s+#', $class ); - } - - $classes = array_merge( $classes, $class ); - } - - $classes = array_map( 'esc_attr', $classes ); - - return apply_filters( 'generate_secondary_menu_class', $classes, $class ); - } -} - -if ( ! function_exists( 'generate_inside_secondary_navigation_class' ) ) { - /** - * Display the classes for the inner navigation. - * - * @since 0.1 - * @param string|array $class One or more classes to add to the class list. - */ - function generate_inside_secondary_navigation_class( $class = '' ) { - $classes = array(); - - if ( ! empty( $class ) ) { - if ( ! is_array( $class ) ) { - $class = preg_split( '#\s+#', $class ); - } - - $classes = array_merge( $classes, $class ); - } - - $classes = array_map( 'esc_attr', $classes ); - - $return = apply_filters( 'generate_inside_secondary_navigation_class', $classes, $class ); - - // Separates classes with a single space, collates classes for post DIV. - echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore -- Escaped above. - } -} - -if ( ! function_exists( 'generate_secondary_nav_remove_top_bar' ) ) { - add_action( 'wp', 'generate_secondary_nav_remove_top_bar' ); - /** - * Remove the top bar and add it to the Secondary Navigation if it's set - */ - function generate_secondary_nav_remove_top_bar() { - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - if ( $generate_settings['merge_top_bar'] && 'secondary-nav-above-header' === $generate_settings['secondary_nav_position_setting'] && has_nav_menu( 'secondary' ) && is_active_sidebar( 'top-bar' ) ) { - remove_action( 'generate_before_header', 'generate_top_bar', 5 ); - add_action( 'generate_inside_secondary_navigation', 'generate_secondary_nav_top_bar_widget', 5 ); - add_filter( 'generate_is_top_bar_active', '__return_false' ); - } - } -} - -if ( ! function_exists( 'generate_secondary_nav_top_bar_widget' ) ) { - /** - * Build the top bar widget area - * This is placed into the secondary navigation if set - */ - function generate_secondary_nav_top_bar_widget() { - if ( ! is_active_sidebar( 'top-bar' ) ) { - return; - } - ?> -
          -
          - -
          -
          - .secondary-navigation .main-nav ul li a, .secondary-navigation .menu-toggle, .secondary-menu-bar-items .menu-bar-item > a{padding: 0 ' + newval + 'px;}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:' + newval + 'px;}' ); - setTimeout(function() { - jQuery( 'style#secondary_menu_item' ).not( ':last' ).remove(); - }, 50); - } ); - } ); - - wp.customize( 'generate_secondary_nav_settings[secondary_menu_item_height]', function( value ) { - value.bind( function( newval ) { - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#secondary_menu_item_height' ).not( ':last' ).remove(); - }, 50); - } ); - } ); - - wp.customize( 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', function( value ) { - value.bind( function( newval ) { - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#secondary_sub_menu_item_height' ).not( ':last' ).remove(); - }, 50); - } ); - } ); - -})( jQuery ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/generate-secondary-nav.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/generate-secondary-nav.php deleted file mode 100644 index 7c3e48eb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/generate-secondary-nav.php +++ /dev/null @@ -1,23 +0,0 @@ - *:last-child { - margin-bottom: 0; -} - -.generate-sections-container { - background-size: cover; -} - -.generate-sections-container.no-padding .generate-sections-inside-container { - padding: 0px !important; -} - -.generate-sections-enabled.one-container .site-content { - padding: 0; -} - -.generate-sections-enabled.one-container .container { - background: transparent; -} - -.generate-sections-enabled.one-container .site-main { - margin: 0 !important; -} - -.generate-sections-enabled .entry-content { - text-align: center; -} - -.separate-containers .site-main > .generate-sections-container { - margin-bottom: 0; -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/css/style.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/css/style.min.css deleted file mode 100644 index 802b011a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/css/style.min.css +++ /dev/null @@ -1 +0,0 @@ -.sections-no-sidebars.generate-sections-enabled .container.grid-container,.sections-sidebars.no-sidebar.generate-sections-enabled .container.grid-container{max-width:100%}.sections-no-sidebars.generate-sections-enabled #primary.content-area,.sections-sidebars.no-sidebar.generate-sections-enabled #primary.content-area{width:100%}.sections-no-sidebars.generate-sections-enabled.separate-containers #main.site-main,.sections-no-sidebars.generate-sections-enabled.separate-containers .hentry,.sections-sidebars.no-sidebar.generate-sections-enabled.separate-containers #main.site-main,.sections-sidebars.no-sidebar.generate-sections-enabled.separate-containers .hentry{margin:0}.generate-sections-inside-container>:last-child{margin-bottom:0}.generate-sections-container{background-size:cover}.generate-sections-container.no-padding .generate-sections-inside-container{padding:0!important}.generate-sections-enabled.one-container .site-content{padding:0}.generate-sections-enabled.one-container .container{background:0 0}.generate-sections-enabled.one-container .site-main{margin:0!important}.generate-sections-enabled .entry-content{text-align:center}.separate-containers .site-main>.generate-sections-container{margin-bottom:0} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/generate-sections.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/generate-sections.php deleted file mode 100644 index 2703c8e4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/generate-sections.php +++ /dev/null @@ -1,329 +0,0 @@ -ID, '_generate_use_sections', TRUE) : ''; - - if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { - return $template; - } - - if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { - - $new_template = dirname( __FILE__ ) . '/templates/template.php'; - - if ( '' != $new_template ) { - return $new_template; - } - } - return $template; - - } -} - -if ( ! function_exists( 'generate_sections_show_excerpt' ) ) { - add_filter( 'generate_show_excerpt', 'generate_sections_show_excerpt' ); - /** - * If Sections is enabled on a post, make sure we use the excerpt field on the blog page - */ - function generate_sections_show_excerpt( $show_excerpt ) { - global $post; - $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; - - if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { - return true; - } - - return $show_excerpt; - } -} - -if ( ! function_exists( 'generate_sections_styles' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_sections_styles' ); - /** - * Enqueue necessary scripts if sections are enabled - */ - function generate_sections_styles() { - - global $post; - $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; - - // Bail if we're on a posts page - if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { - return; - } - - if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { - wp_enqueue_style( 'generate-sections-styles', plugin_dir_url( __FILE__ ) . 'css/style.min.css' ); - wp_enqueue_script( 'generate-sections-parallax', plugin_dir_url( __FILE__ ) . 'js/parallax.min.js', array(), GENERATE_SECTIONS_VERSION, true ); - } - } -} - -if ( ! function_exists( 'generate_sections_body_classes' ) ) { - add_filter( 'body_class', 'generate_sections_body_classes' ); - /** - * Add classes to our element when sections are enabled - */ - function generate_sections_body_classes( $classes ) { - global $post; - $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; - $sidebars = apply_filters( 'generate_sections_sidebars', false ); - - // Bail if we're on a posts page - if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { - return $classes; - } - - if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { - $classes[] = 'generate-sections-enabled'; - } - - if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && ! $sidebars ) { - $classes[] = 'sections-no-sidebars'; - } - - if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && $sidebars ) { - $classes[] = 'sections-sidebars'; - } - - return $classes; - } -} - -if ( ! function_exists( 'generate_sections_add_css' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_sections_add_css', 500 ); - /** - * Create the CSS for our sections - */ - function generate_sections_add_css() { - global $post; - $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; - - if ( ! isset( $use_sections['use_sections'] ) ) { - return; - } - - if ( 'true' !== $use_sections['use_sections'] ) { - return; - } - - if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { - return; - } - - if ( function_exists( 'generate_spacing_get_defaults' ) ) { - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - - $left_padding = $spacing_settings['content_left']; - $right_padding = $spacing_settings['content_right']; - $mobile_padding_left = ( isset( $spacing_settings[ 'mobile_content_left' ] ) ) ? $spacing_settings[ 'mobile_content_left' ] : 30; - $mobile_padding_right = ( isset( $spacing_settings[ 'mobile_content_right' ] ) ) ? $spacing_settings[ 'mobile_content_right' ] : 30; - } else { - $right_padding = 40; - $left_padding = 40; - $mobile_padding = 30; - } - - $sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_sections', TRUE) : ''; - - // check if the repeater field has rows of data - if ( $sections && '' !== $sections ) { - - $css = '.generate-sections-inside-container {padding-left:' . $left_padding . 'px;padding-right:' . $right_padding . 'px;}'; - // loop through the rows of data - $i = 0; - foreach ( $sections['sections'] as $section ) : - $i++; - - // Get image details - $image_id = ( isset( $section['background_image'] ) && '' !== $section['background_image'] ) ? intval( $section['background_image'] ) : ''; - $image_url = ( '' !== $image_id ) ? wp_get_attachment_image_src( $image_id, 'full' ) : ''; - - // Get the padding type - $padding_type = apply_filters( 'generate_sections_padding_type','px' ); - - // If someone has changed the padding type using a filter, use their value - if ( 'px' !== $padding_type ) { - $top_padding_type = $padding_type; - $bottom_padding_type = $padding_type; - } else { - $top_padding_type = ( isset( $section['top_padding_unit'] ) && '' !== $section['top_padding_unit'] ) ? $section['top_padding_unit'] : $padding_type; - $bottom_padding_type = ( isset( $section['bottom_padding_unit'] ) && '' !== $section['bottom_padding_unit'] ) ? $section['bottom_padding_unit'] : $padding_type; - } - - // Default padding top - $padding_top = apply_filters( 'generate_sections_default_padding_top','40' ); - - // Default padding bottom - $padding_bottom = apply_filters( 'generate_sections_default_padding_bottom','40' ); - - $custom_id = ( isset( $section['custom_id'] ) ) ? $section['custom_id'] : ''; - $custom_id = ( '' == $custom_id ) ? "generate-section-$i" : $custom_id; - - // Get the values - $background_color = ( isset( $section['background_color'] ) && '' !== $section['background_color'] ) ? 'background-color:' . esc_attr( $section['background_color'] ) . ';' : ''; - $background_image = ( ! empty( $image_url[0] ) ) ? 'background-image:url(' . esc_url( $image_url[0] ) . ');' : ''; - - if ( isset( $section['background_color_overlay'] ) && '' !== $section['background_color_overlay'] ) { - if ( '' !== $background_image && '' !== $background_color ) { - $background_image = 'background-image:linear-gradient(0deg, ' . $section['background_color'] . ',' . $section['background_color'] . '), url(' . esc_url( $image_url[0] ) . ');'; - $background_color = ''; - } - } - - $text_color = ( isset( $section['text_color'] ) && '' !== $section['text_color'] ) ? 'color:' . esc_attr( $section['text_color'] ) . ';' : ''; - $link_color = ( isset( $section['link_color'] ) && '' !== $section['link_color'] ) ? 'color:' . esc_attr( $section['link_color'] ) . ';' : ''; - $link_color_hover = ( isset( $section['link_color_hover'] ) && '' !== $section['link_color_hover'] ) ? 'color:' . esc_attr( $section['link_color_hover'] ) . ';' : ''; - $top_padding = ( isset( $section['top_padding'] ) && '' !== $section['top_padding'] ) ? 'padding-top:' . absint( $section['top_padding'] ) . $top_padding_type . ';' : 'padding-top:' . $padding_top . 'px;'; - $bottom_padding = ( isset( $section['bottom_padding'] ) && '' !== $section['bottom_padding'] ) ? 'padding-bottom:' . absint( $section['bottom_padding'] ) . $bottom_padding_type . ';' : 'padding-bottom:' . $padding_bottom . 'px;'; - - // Outer container - if ( '' !== $background_color || '' !== $background_image ) { - $css .= '#' . $custom_id . '.generate-sections-container{' . $background_color . $background_image . '}'; - } - - // Inner container - if ( '' !== $top_padding || '' !== $bottom_padding || '' !== $text_color ) { - $css .= '#' . $custom_id . ' .generate-sections-inside-container{' . $top_padding . $bottom_padding . $text_color . '}'; - } - - // Link color - if ( '' !== $link_color ) { - $css .= '#' . $custom_id . ' a,#generate-section-' . $i . ' a:visited{' . $link_color . '}'; - } - - // Link color hover - if ( '' !== $link_color_hover ) { - $css .= '#' . $custom_id . ' a:hover{' . $link_color_hover . '}'; - } - - $mobile = generate_premium_get_media_query( 'mobile' ); - $css .= '@media ' . esc_attr( $mobile ) . ' {.generate-sections-inside-container {padding-left: ' . $mobile_padding_left . 'px;padding-right: ' . $mobile_padding_right . 'px;}}'; - endforeach; - - // Build CSS - wp_add_inline_style( 'generate-style', $css ); - - } - } -} - -if ( ! function_exists( 'generate_sections_filter_admin_init' ) ) { - add_action( 'admin_init', 'generate_sections_filter_admin_init' ); - /* - * Recreate the default filters on the_content - * this will make it much easier to output the meta content with proper/expected formatting - */ - function generate_sections_filter_admin_init() { - if ( user_can_richedit() ) { - add_filter( 'generate_section_content', 'convert_smilies' ); - add_filter( 'generate_section_content', 'convert_chars' ); - add_filter( 'generate_section_content', 'wpautop' ); - add_filter( 'generate_section_content', 'shortcode_unautop' ); - add_filter( 'generate_section_content', 'prepend_attachment' ); - } - } -} - -if ( ! function_exists( 'generate_sections_filter' ) ) { - add_action( 'init', 'generate_sections_filter' ); - /* - * Recreate the default filters on the_content - * this will make it much easier to output the meta content with proper/expected formatting - */ - function generate_sections_filter() { - if ( is_admin() ) { - return; - } - - add_filter( 'generate_section_content', 'convert_smilies' ); - add_filter( 'generate_section_content', 'convert_chars' ); - add_filter( 'generate_section_content', 'wpautop' ); - add_filter( 'generate_section_content', 'shortcode_unautop' ); - add_filter( 'generate_section_content', 'prepend_attachment' ); - add_filter( 'generate_section_content', 'do_shortcode'); - - add_filter( 'generate_the_section_content', array($GLOBALS['wp_embed'], 'autoembed'), 9 ); - } -} - -if ( ! function_exists( 'generate_sections_save_content' ) ) { - add_action( 'save_post', 'generate_sections_save_content', 99, 4 ); - /* - * When we save our post, grab all of the section content and save it as regular content. - * - * This will prevent content loss/theme lock. - */ - function generate_sections_save_content( $post_id, $post ) { - - if ( ! isset( $_POST['_generate_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_nonce'], 'generate_sections_nonce' ) ) { - return; - } - - if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { - return; - } - - if ( ! current_user_can('edit_post', $post_id ) ) { - return; - } - - // See if we're using sections - $use_sections = get_post_meta( $post_id, '_generate_use_sections', true); - - // Make sure use sections exists and that we're not saving a revision - if ( ! isset( $use_sections['use_sections'] ) || wp_is_post_revision( $post_id ) ) { - return; - } - - // Return if sections are set to false - if ( 'true' !== $use_sections['use_sections'] ) { - return; - } - - // Get our sections - $sections = get_post_meta( $post_id, '_generate_sections', true ); - - // Return if there's nothing in our sections - if ( ! isset( $sections ) || '' == $sections ) { - return; - } - - // Prevent infinite loop - remove_action( 'save_post', 'generate_sections_save_content', 99, 4 ); - - // Let's do some stuff if sections aren't empty - if ( '' !== $sections ) { - // Set up our content variable - $content = ''; - - // Loop through each section and add our content to the content variable - foreach ( $sections['sections'] as $section ) { - $content .= ( isset( $section['content'] ) && '' !== $section['content'] ) ? $section['content'] . "\n\n" : ''; - } - - // Now update our post if we have section content - if ( '' !== $content ) { - $post->post_content = $content; - wp_update_post( $post, true ); - } - } - - // Re-hook the save_post action - add_action('save_post', 'generate_sections_save_content', 99, 4); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.js deleted file mode 100644 index 2c49e753..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.js +++ /dev/null @@ -1,17 +0,0 @@ -function generate_sections_parallax_element( selector, context ) { - context = context || document; - var elements = context.querySelectorAll( selector ); - return Array.prototype.slice.call( elements ); -} - -window.addEventListener( "scroll", function() { - var scrolledHeight= window.pageYOffset; - generate_sections_parallax_element( ".generate-sections-container.enable-parallax" ).forEach( function( el, index, array ) { - var limit = el.offsetTop + el.offsetHeight; - if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) { - el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / el.getAttribute( 'data-speed' ) + "px"; - } else { - el.style.backgroundPositionY = "0"; - } - }); -}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.min.js deleted file mode 100644 index 7004f63b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.min.js +++ /dev/null @@ -1 +0,0 @@ -function generate_sections_parallax_element(e,t){var o=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(o)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_sections_parallax_element(".generate-sections-container.enable-parallax").forEach(function(t,o,n){var a=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=a?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-speed")+"px":t.style.backgroundPositionY="0"})}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css deleted file mode 100644 index 6927a1b3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css +++ /dev/null @@ -1,348 +0,0 @@ -body { - -webkit-backface-visibility: hidden; -} -#_generate_sections_metabox { - opacity: 0; - height: 0; - overflow: hidden; -} - -#_generate_use_sections_metabox { - display: block !important; -} - -.generate_sections_control { - padding-top: 8px; -} - -.generate-sections-enabled #postdivrich { - opacity: 0; - height: 0; - overflow: hidden; -} -.generate-sections-enabled #_generate_sections_metabox { - opacity: 1; - height: auto; -} - -.generate_sections_control .warning { - color: red; -} -.generate_sections_control .dodelete-repeating_textareas { - float: right; -} -.generate_sections_control .section { - border: 1px solid #DFDFDF; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - margin: 6px 0px 8px; - overflow: hidden; - position: relative; - background: white; -} -.generate_sections_control .section .section-title { - font-size: 14px; - padding: 0 0 0 15px; - margin: 0; - max-height: 50px; -} -.generate_sections_control .section .section-title > span { - cursor: pointer; - overflow:hidden; - display:block; - max-height:50px; - line-height:50px; - width:100%; -} -.generate_sections_control .section .section-controls { - position: absolute; - top:0; - right:0; - text-align: right; -} -.rtl .generate_sections_control .section .section-controls { - right:auto;left:0; -} -.generate_sections_control .section .section-controls a { - color: #aaa; - display:block; - float:left; - border-left: 1px solid #efefef; -} -.generate_sections_control .section .section-controls a:hover { - color: #777; -} -.generate_sections_control .section textarea { - display: none; -} -.generate_sections_control .section h3 { - color: #999; - font-size: 1em; - margin: 15px 6px; - text-transform: uppercase; -} -.generate_sections_control .section .ui-sortable-placeholder { - line-height: 1.4em; - border: 3px dashed #DDD; -} -.generate-sections-modal .media-menu-item { - cursor: pointer; -} -.custom-classes input { - width:100%; -} -.js .generate_sections_control .move-section { - cursor: move; -} -.generate-sections-modal p { - margin-top:5px; -} -#_generate_sections_metabox { - box-shadow: 0 0 0 transparent; -} -.section-controls a { - line-height:50px; - padding: 0 15px; - width:initial; - height:initial; -} - -.generate_sections_control .section .section-controls a.delete-section:hover { - color: red; -} - -.generate_sections_control p { - margin: 5px; -} - -textarea#generate-sections-editor { - border:0; -} - -#generate-sections-editor_ifr { - min-height: 400px; -} - -a#generate-add-section, a#generate-delete-sections { - height: auto; - line-height: inherit; - padding: 10px 20px; -} - -#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > * { - display:none; -} - -#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .generate-sections-add-media, -#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .su-generator-button, -#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .envira-gallery-choose-gallery, -#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .gridable-insert-row-button { - display: inline-block; -} - -#custom-media-buttons > * { - display: none; -} - -#custom-media-buttons > .insert-media, -#custom-media-buttons > .su-generator-button, -#custom-media-buttons > .envira-gallery-choose-gallery, -#custom-media-buttons > .gridable-insert-row-button, -#custom-media-buttons > .bfa-iconpicker { - display: inline-block; -} - -#_generate_sections_metabox { - background: transparent; - border: 0; -} -#_generate_sections_metabox > .handlediv, #_generate_sections_metabox > .hndle { - display: none; -} -#_generate_sections_metabox > .inside { - padding-left: 0; - padding-right: 0; -} - -body.wp-admin .grid-container { - max-width: 100%; -} - -.generate-sections-modal h3 { - margin-top: 0; -} - -input#custom_classes, -input#custom_id { - width: 100%; - max-width: 300px; -} - -.box-type select, -.inner-box-type select, -.parallax-effect select, -.top-padding input, -.bottom-padding input { - width: 100%; - box-sizing: border-box; -} - -.send-to-editor { - display: inline-block; - margin-top: 15px !important; -} - -#generate-sections-modal-dialog .media-frame-title .dashicons-arrow-down { - display: none; -} - -.gs-grid-container { - margin-left: auto; - margin-right: auto; - max-width: 100%; - padding-left: 10px; - padding-right: 10px; -} - -.gs-grid-parent { - padding-left: 0; - padding-right: 0; -} - -.gs-grid-container:before, -.gs-grid-container:after { - content: "."; - display: block; - overflow: hidden; - visibility: hidden; - font-size: 0; - line-height: 0; - width: 0; - height: 0; - clear: both; -} - -@media screen and (min-width: 769px) { - .gs-grid-50:before, - .gs-grid-50:after, - .gs-grid-33:before, - .gs-grid-33:after, - .gs-grid-25:before, - .gs-grid-25:after - .gs-grid-20:before, - .gs-grid-20:after - .gs-grid-12:before, - .gs-grid-12:after { - content: "."; - display: block; - overflow: hidden; - visibility: hidden; - font-size: 0; - line-height: 0; - width: 0; - height: 0; - clear: both; - } - .gs-grid-50, - .gs-grid-33, - .gs-grid-25, - .gs-grid-20, - .gs-grid-12 { - box-sizing: border-box; - padding-left: 10px; - padding-right: 10px; - } - .gs-grid-50 { - width: 50% !important; - float: left; - } - .gs-grid-33 { - width: 33.333% !important; - float: left; - } - .gs-grid-25 { - width: 25% !important; - float: left; - } - .gs-grid-20 { - width: 20% !important; - float: left; - } - .gs-grid-12 { - width: 12.5% !important; - float: left; - } - .top-border { - border-top: 1px solid #EFEFEF; - } - .bottom-border { - border-bottom: 1px solid #EFEFEF; - } - .border-right { - border-right: 1px solid #EFEFEF; - } - .border-left { - border-left: 1px solid #EFEFEF; - } -} - -@media screen and (max-width: 768px) { - .gs-grid-50, .gs-grid-33, .gs-grid-25, .gs-grid-12 { - width: 100% !important; - } - .generate_sections_control .section .section-controls { - position: relative; - } -} - -@media screen and (max-width: 500px) { - .generate_sections_control .section .section-controls a:first-child { - border-left: 0; - } -} - -#generate-sections-modal-dialog .media-modal-close { - text-decoration: none; - text-align: center; -} -/* - The styles below were ripped from the Media Modal in WordPress 3.5 - ~~ Thanks for building a beautiful Modal UI ( that I could steal ) -*/ -body.generate-modal-open { overflow: hidden; } - -.generate-sections-modal .media-modal { z-index: 65535; } -.generate-sections-modal .media-modal-backdrop { z-index: 65534; } -.generate-sections-modal .media-frame-content .panel { display: none; padding: 2em; } -.generate-sections-modal .media-frame-content .panel.active { display: block; } -.generate-sections-modal .media-frame-content .panel .section-title input { width:100%;padding:10px; } -.generate-sections-modal .media-frame-content .panel .html-active .mce-panel { display: none; } -.generate-sections-modal .media-frame-content .panel .html-active .wp-editor-area { display: block !important; min-height: 300px; } -.generate-sections-modal .media-frame-content .panel .mce-wp-dfw, .generate-sections-modal .media-frame-content .panel .qt-dfw { display: none; } -.generate-sections-modal .media-frame-content .panel .generate-sections-remove-image { display: none; } - -textarea.no-rich-edit { - width: 100%; - min-height: 300px; -} - -.wp-picker-container .wp-color-result.button { - height: 24px; - margin: 0 6px 6px 0px; - padding: 0 0 0 30px; - font-size: 11px; -} - -.wp-color-result:after { - display: none; -} - -.wp-color-result-text { - background: #f7f7f7; - border-radius: 0 2px 2px 0; - border-left: 1px solid #ccc; - color: #555; - display: block; - line-height: 22px; - padding: 0 6px; - text-align: center; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css deleted file mode 100644 index 5f95b304..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css +++ /dev/null @@ -1,92 +0,0 @@ -.lcs_wrap { - display: inline-block; - direction: ltr; - height: 28px; - vertical-align: middle; -} -.lcs_wrap input { - display: none; -} - -.lcs_switch { - display: inline-block; - position: relative; - width: 73px; - height: 28px; - border-radius: 30px; - background: #ddd; - overflow: hidden; - cursor: pointer; - transition: all .2s ease-in-out; -} -.lcs_cursor { - display: inline-block; - position: absolute; - top: 3px; - width: 22px; - height: 22px; - border-radius: 100%; - background: #fff; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1); - z-index: 10; - transition: all .2s linear; -} -.lcs_label { - font-family: "Trebuchet MS", Helvetica, sans-serif; - font-size: 12px; - letter-spacing: 1px; - line-height: 18px; - color: #fff; - font-weight: bold; - position: absolute; - width: 33px; - top: 5px; - overflow: hidden; - text-align: center; - opacity: 0; - transition: all .2s ease-in-out .1s; -} -.lcs_label.lcs_label_on { - left: -70px; - z-index: 6; -} -.lcs_label.lcs_label_off { - right: -70px; - z-index: 5; -} - - -/* on */ -.lcs_switch.lcs_on { - background: #75b936; - box-shadow: 0 0 2px #579022 inset; -} -.lcs_switch.lcs_on .lcs_cursor { - left: 48px; -} -.lcs_switch.lcs_on .lcs_label_on { - left: 10px; - opacity: 1; -} - - -/* off */ -.lcs_switch.lcs_off { - background: #b2b2b2; - box-shadow: 0px 0px 2px #a4a4a4 inset; -} -.lcs_switch.lcs_off .lcs_cursor { - left: 3px; -} -.lcs_switch.lcs_off .lcs_label_off { - right: 10px; - opacity: 1; -} - - -/* disabled */ -.lcs_switch.lcs_disabled { - opacity: 0.65; - filter: alpha(opacity=65); - cursor: default; -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js deleted file mode 100644 index f9215062..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js +++ /dev/null @@ -1,835 +0,0 @@ -/*-----------------------------------------------------------------------------------*/ -/* Generate Sections Metabox -/* -/* © Kathy Darling http://www.kathyisawesome.com -/* 2016-07-19. */ -/*-----------------------------------------------------------------------------------*/ - -/** - * @type {Object} JavaScript namespace for our application. - */ -var Generate_Sections = { - backbone_modal: { - __instance: undefined - } -}; - -(function($, Generate_Sections) { - - - // Model - Generate_Sections.Section = Backbone.Model.extend({ - defaults: { - "title": "", - "box_type": "", - "inner_box_type": "", - "custom_classes": "", - "custom_id": "", - "top_padding": "", - "bottom_padding": "", - "top_padding_unit": "", - "bottom_padding_unit": "", - "background_color": "", - "background_image": "", - "background_image_preview": "", - "parallax_effect": "", - "background_color_overlay": "", - "text_color": "", - "link_color": "", - "link_color_hover": "", - "content": "" - } - }); - - - // Collection - Generate_Sections.SectionsCollection = Backbone.Collection.extend({ - model: Generate_Sections.Section, - el: "#generate_sections_container", - comparator: function(model) { - return model.get('index'); - } - }); - - - /** - * Primary Modal Application Class - */ - Generate_Sections.backbone_modal.Application = Backbone.View.extend({ - - attributes: { - id: "generate-sections-modal-dialog", - class: "generate-sections-modal", - role: "dialog" - }, - - template: wp.template("generate-sections-modal-window"), - - mediaUploader: null, - - /*-----------------------------------------------------------------------------------*/ - /* tinyMCE settings - /*-----------------------------------------------------------------------------------*/ - - tmc_settings: {}, - - /*-----------------------------------------------------------------------------------*/ - /* tinyMCE defaults - /*-----------------------------------------------------------------------------------*/ - - tmc_defaults: { - theme: "modern", - menubar: false, - wpautop: true, - indent: false, - toolbar1: "bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink,fullscreen", - plugins: "fullscreen,image,wordpress,wpeditimage,wplink", - max_height: 500 - }, - - /*-----------------------------------------------------------------------------------*/ - /* quicktags settings - /*-----------------------------------------------------------------------------------*/ - - qt_settings: {}, - - /*-----------------------------------------------------------------------------------*/ - /* quicktags defaults - /*-----------------------------------------------------------------------------------*/ - - qt_defaults: { - buttons: "strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen" - }, - - model: Generate_Sections.Section, - - events: { - "click .media-modal-backdrop, .media-modal-close, .media-button-close": "closeModal", - "click .media-button-insert": "saveModal", - "click .media-menu-item": "switchTab", - "keydown": "keydown", - "click .generate-sections-upload-button": "openMediaUploader", - "click .generate-sections-remove-image": "removeImage", - "click div.media-frame-title h1": "toggleMenu" - }, - - - - /** - * Simple object to store any UI elements we need to use over the life of the application. - */ - ui: { - nav: undefined, - content: undefined - }, - - - /** - * Instantiates the Template object and triggers load. - */ - initialize: function() { - _.bindAll(this, "render", "closeModal", "saveModal", "switchTab"); - - this.focusManager = new wp.media.view.FocusManager({ - el: this.el - }); - - this.changeInsertText(); - this.tinyMCEsettings(); - this.render(); - }, - - /** - * switch the insert button text to "insert section" - */ - changeInsertText: function(restore) { - - var restore = typeof restore !== 'undefined' && restore == true ? true : false; - - if (restore == false && typeof(wp.media.view.l10n.insertIntoPost) !== "undefined") { - this.insertIntoPost = wp.media.view.l10n.insertIntoPost; - wp.media.view.l10n.insertIntoPost = generate_sections_metabox_i18n.insert_into_section; - // switch the insert button text back - } else if (restore == true && typeof(this.insertIntoPost) !== "undefined") { - wp.media.view.l10n.insertIntoPost = this.insertIntoPost; - } - }, - - - /** - * Merge the default TinyMCE settings - */ - tinyMCEsettings: function() { - // get the #content"s tinyMCE settings or use default - var init_settings = typeof tinyMCEPreInit == "object" && "mceInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.mceInit ? tinyMCEPreInit.mceInit.content : this.tmc_defaults; - - // get the #content"s quicktags settings or use default - var qt_settings = typeof tinyMCEPreInit == "object" && "qtInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.qtInit ? tinyMCEPreInit.qtInit.content : this.qt_defaults; - - var _this = this; - var custom_settings = { - selector: "#generate-sections-editor", - wp_autoresize_on: false, - cache_suffix: "", - min_height: 400, - } - - // merge our settings with WordPress" and store for later use - this.tmc_settings = $.extend({}, init_settings, custom_settings); - - this.qt_settings = $.extend({}, qt_settings, { - id: "generate-sections-editor" - }); - }, - - - /** - * Assembles the UI from loaded template. - * @internal Obviously, if the template fail to load, our modal never launches. - */ - render: function() { - - "use strict"; - - // Build the base window and backdrop, attaching them to the $el. - // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus - this.$el.attr("tabindex", "0") - .html(this.template); - - // Handle any attempt to move focus out of the modal. - //jQuery(document).on("focusin", this.preserveFocus); - - // set overflow to "hidden" on the body so that it ignores any scroll events while the modal is active - // and append the modal to the body. - jQuery("body").addClass("generate-modal-open").prepend(this.$el); - - // aria hide the background - jQuery("#wpwrap").attr("aria-hidden", "true"); - - this.renderContent(); - - this.renderPreview(); - - this.selected(); - this.colorPicker(); - this.startTinyMCE(); - - // Set focus on the modal to prevent accidental actions in the underlying page - this.$el.focus(); - - return this; - }, - - /** - * Make the menu mobile-friendly - */ - toggleMenu: function() { - this.$el.find('.media-menu').toggleClass('visible'); - }, - - /** - * Create the nav tabs & panels - */ - renderContent: function() { - - var model = this.model; - - var menu_item = wp.template("generate-sections-modal-menu-item"); - - // Save a reference to the navigation bar"s unordered list and populate it with items. - this.ui.nav = this.$el.find(".media-menu"); - - // reference to content area - this.ui.panels = this.$el.find(".media-frame-content"); - - // loop through the tabs - if (generate_sections_metabox_i18n.tabs.length) { - - // for...of is nicer, but not supported by minify, so stay with for...in for now - for (var tab in generate_sections_metabox_i18n.tabs) { - - if (generate_sections_metabox_i18n.tabs.hasOwnProperty(tab)) { - - tab = generate_sections_metabox_i18n.tabs[tab]; - - var $new_tab = $(menu_item({ - target: tab.target, - name: tab.title - })); - - var panel = wp.template("generate-sections-edit-" + tab.target); - - var $new_panel = $(panel(model.toJSON())); - - if (tab.active == "true") { - $new_tab.addClass("active"); - $new_panel.addClass("active"); - } - - jQuery( 'body' ).on( 'generate_section_show_settings', function() { - jQuery( '.generate-sections-modal .media-menu-item' ).removeClass('active'); - jQuery( '.generate-sections-modal .panel' ).removeClass('active'); - jQuery( '.generate-section-item-style' ).addClass('active'); - jQuery( '.generate-section-settings' ).addClass('active'); - }); - - this.ui.nav.append($new_tab); - this.ui.panels.append($new_panel); - } - } - } - - }, - - - /** - * Render the background image preview - */ - renderPreview: function(image_id) { - - var image_id = typeof image_id !== 'undefined' ? image_id : this.model.get("background_image"); - - var $preview = $("#generate-section-image-preview"); - $preview.children().remove(); - - if (image_id > 0) { - this.background = new wp.media.model.Attachment.get(image_id); - - this.background.fetch({ - success: function(att) { - if (_.contains(['png', 'jpg', 'gif', 'jpeg'], att.get('subtype'))) { - $("").attr("src", att.attributes.sizes.thumbnail.url).appendTo($preview); - $preview.next().find(".generate-sections-remove-image").show(); - } - } - }); - } - - }, - - - /** - * Set the default option for the select boxes - */ - selected: function() { - - var _this = this; - - this.$el.find("select").each(function(index, select) { - - var attribute = jQuery(select).attr("name"); - var selected = _this.model.get(attribute); - jQuery(select).val(selected); - - }); - }, - - /** - * Start the colorpicker - */ - colorPicker: function() { - this.$el.find(".generate-sections-color").wpColorPicker(); - }, - - /** - * Start TinyMCE on the textarea - */ - startTinyMCE: function() { - - // set the default editor - this.ui.panels.find("#wp-generate-sections-editor-wrap").addClass(generate_sections_metabox_i18n.default_editor); - - // remove tool buttons if richedit disabled - if (!generate_sections_metabox_i18n.user_can_richedit) { - this.ui.panels.find(".wp-editor-tabs").remove(); - } - - // add our copy to the collection in the tinyMCEPreInit object because switch editors - if (typeof tinyMCEPreInit == 'object') { - tinyMCEPreInit.mceInit["generate-sections-editor"] = this.tmc_settings; - tinyMCEPreInit.qtInit["generate-sections-editor"] = this.qt_settings; - tinyMCEPreInit.mceInit["generate-sections-editor"].wp_keep_scroll_position = false; - } - - try { - - var rich = (typeof tinyMCE != "undefined"); - - // turn on the quicktags editor - quicktags(this.qt_settings); - - // attempt to fix problem of quicktags toolbar with no buttons - QTags._buttonsInit(); - - if (rich !== false) { - // turn on tinyMCE - tinyMCE.init(this.tmc_settings); - } - - } catch (e) {} - - }, - - /** - * Launch Media Uploader - */ - openMediaUploader: function(e) { - - var _this = this; - - $input = jQuery(e.currentTarget).prev("#generate-sections-background-image"); - - e.preventDefault(); - - // If the uploader object has already been created, reopen the dialog - if (this.mediaUploader) { - this.mediaUploader.open(); - return; - } - // Extend the wp.media object - this.mediaUploader = wp.media.frames.file_frame = wp.media({ - title: generate_sections_metabox_i18n.media_library_title, - button: { - text: generate_sections_metabox_i18n.media_library_button - }, - multiple: false - }); - - - // When a file is selected, grab the URL and set it as the text field"s value - this.mediaUploader.on("select", function() { - - attachment = _this.mediaUploader.state().get("selection").first().toJSON(); - - $input.val(attachment.id); - - _this.renderPreview(attachment.id); - }); - // Open the uploader dialog - this.mediaUploader.open(); - - }, - - /** - * Remove the background image - */ - removeImage: function(e) { - e.preventDefault(); - $("#generate-section-image-preview").children().remove(); - $("#generate-section-image-preview").next().find(".generate-sections-remove-image").hide(); - $("#generate-sections-background-image").val(""); - }, - - - /** - * Closes the modal and cleans up after the instance. - * @param e {object} A jQuery-normalized event object. - */ - closeModal: function(e) { - "use strict"; - - e.preventDefault(); - this.undelegateEvents(); - jQuery(document).off("focusin"); - jQuery("body").removeClass("generate-modal-open"); - jQuery("body").removeClass("generate-section-content"); - - // remove restricted media modal tab focus once it's closed - this.$el.undelegate('keydown'); - - // remove the tinymce editor - // this needs to be called before the modal is closed or it will fail in Firefox (that was fun to figure out...) - if (typeof tinyMCE != "undefined") { - tinymce.EditorManager.execCommand("mceRemoveEditor", true, "generate-sections-editor"); - } - - // remove modal and unset instances - this.remove(); - Generate_Sections.backbone_modal.__instance = undefined; - this.mediaUploader = null; - Generate_Sections.modalOpen = null; - - // switch the insert button text back - this.changeInsertText(true); - - // send focus back to where it was prior to modal open - Generate_Sections.lastFocus.focus(); - - // aria unhide the background - jQuery("#wpwrap").attr("aria-hidden", "false"); - - // Fix bug where the window scrolls down 50px on close - var topDistance = jQuery("body").offset().top; - if ( topDistance >= jQuery("body").scrollTop() ) { - jQuery("body").scrollTop(0); - } - - }, - - /** - * Responds to the btn-ok.click event - * @param e {object} A jQuery-normalized event object. - * @todo You should make this your own. - */ - saveModal: function(e) { - "use strict"; - - this.model.get("index"); - - var model = this.model; - - // send the tinymce content to the textarea - if (typeof tinyMCE != "undefined") { - tinymce.triggerSave(); - } - - var $inputs = this.ui.panels.find("input, select, textarea"); - - $inputs.each(function(index, input) { - - var name = $(input).attr("name"); - - if (model.attributes.hasOwnProperty(name)) { - var value = $(input).val(); - model.set(name, value); - } - - }); - - this.closeModal(e); - }, - - /** - * Handles tab clicks and switches to corresponding panel - * @param e {object} A jQuery-normalized event object. - */ - switchTab: function(e) { - "use strict"; - e.preventDefault(); - - // close lingering wp link windows - if (typeof tinyMCE != "undefined" && 'style' == jQuery( e.currentTarget ).data( 'target' ) && this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).hasClass( 'tmce-active' )) { - tinyMCE.activeEditor.execCommand('wp_link_cancel'); - tinyMCE.activeEditor.execCommand('wp_media_cancel'); - } - - this.ui.nav.children().removeClass("active"); - this.ui.panels.children().removeClass("active"); - - var target = jQuery(e.currentTarget).addClass("active").data("target"); - - this.ui.panels.find("div[data-id=" + target + "]").addClass("active"); - }, - - /** - * close on keyboard shortcuts - * @param {Object} event - */ - keydown: function(e) { - // Close the modal when escape is pressed. - if (27 === e.which && this.$el.is(':visible')) { - this.closeModal(e); - e.stopImmediatePropagation(); - } - } - - }); - - - // Singular View - Generate_Sections.sectionView = Backbone.View.extend({ - - model: Generate_Sections.Section, - tagName: 'div', - - initialize: function() { - // re-render on all changes EXCEPT index - this.listenTo(this.model, "change", this.maybeRender); - }, - - attributes: { - class: "ui-state-default section" - }, - - // Get the template from the DOM - template: wp.template("generate-sections-section"), - - events: { - 'click .edit-section': 'editSection', - 'click .section-title > span': 'editSection', - 'click .delete-section': 'removeSection', - 'click .toggle-section': 'toggleSection', - 'reorder': 'reorder', - }, - - maybeRender: function(e) { - if (this.model.hasChanged('index')) return; - this.render(); - }, - - // Render the single model - include an index. - render: function() { - this.model.set('index', this.model.collection.indexOf(this.model)); - this.$el.html(this.template(this.model.toJSON())); - - if (!this.model.get('title')) { - this.$el.find('h3.section-title > span').text(generate_sections_metabox_i18n.default_title); - } - this.$el.find('textarea').val(JSON.stringify(this.model)); - - return this; - }, - - - // launch the edit modal - editSection: function(e) { - - // stash the current focus - Generate_Sections.lastFocus = document.activeElement; - Generate_Sections.modalOpen = true; - - e.preventDefault(); - if (Generate_Sections.backbone_modal.__instance === undefined) { - Generate_Sections.backbone_modal.__instance = new Generate_Sections.backbone_modal.Application({ - model: this.model - }); - } - - }, - - // reorder after sort - reorder: function(event, index) { - this.$el.trigger('update-sort', [this.model, index]); - }, - - // remove/destroy a model - removeSection: function(e) { - e.preventDefault(); - if (confirm(generate_sections_metabox_i18n.confirm)) { - this.model.destroy(); - Generate_Sections.sectionList.render(); // manually calling instead of listening since listening interferes with sorting - } - }, - }); - - - // List View - Generate_Sections.sectionListView = Backbone.View.extend({ - - el: "#generate_sections_container", - events: { - 'update-sort': 'updateSort', - // 'add-section': 'addOne' - }, - - // callback for clone button - addSection: function(model) { - this.collection.add(model); - this.addOne(model); - }, - - addOne: function(model) { - var view = new Generate_Sections.sectionView({ - model: model - }); - this.$el.append(view.render().el); - }, - - render: function() { - this.$el.children().remove(); - this.collection.each(this.addOne, this); - return this; - }, - - updateSort: function(event, model, position) { - this.collection.remove(model); - - // renumber remaining models around missing model - this.collection.each(function(model, index) { - - var new_index = index; - if (index >= position) { - new_index += 1; - } - model.set('index', new_index); - }); - - // set the index of the missing model - model.set('index', position); - - // add the model back to the collection - this.collection.add(model, { - at: position - }); - - this.render(); - - }, - - }); - - - // The Buttons & Nonce - Generate_Sections.ButtonControls = Backbone.View.extend({ - - attributes: { - class: "generate_sections_buttons" - }, - - tagName: 'p', - - el: "#_generate_sections_metabox", - - template: wp.template("generate-sections-buttons"), - - // Attach events - events: { - "click .button-primary": "newSection", - "click #generate-delete-sections": "clearAll", - 'click .edit-section': 'editSection', - }, - - // create new - newSection: function(e) { - e.preventDefault(); - var newSection = new Generate_Sections.Section(); - Generate_Sections.sectionList.addSection(newSection); - }, - - // clear all models - clearAll: function(e) { - e.preventDefault(); - if (confirm(generate_sections_metabox_i18n.confirm)) { - Generate_Sections.sectionCollection.reset(); - Generate_Sections.sectionList.render(); - } - }, - - render: function() { - this.$el.find(".generate_sections_control").append(this.template); - return this; - }, - - }); - - - // init - Generate_Sections.initApplication = function() { - - // Create Collection From Existing Meta - Generate_Sections.sectionCollection = new Generate_Sections.SectionsCollection(generate_sections_metabox_i18n.sections); - - // Create the List View - Generate_Sections.sectionList = new Generate_Sections.sectionListView({ - collection: Generate_Sections.sectionCollection - }); - Generate_Sections.sectionList.render(); - - // Buttons - Generate_Sections.Buttons = new Generate_Sections.ButtonControls({ - collection: Generate_Sections.sectionCollection - }); - Generate_Sections.Buttons.render(); - - }; - - - /*-----------------------------------------------------------------------------------*/ - /* Execute the above methods in the Generate_Sections object. - /*-----------------------------------------------------------------------------------*/ - - jQuery(document).ready(function($) { - - Generate_Sections.initApplication(); - - $( '#generate_sections_container' ).sortable({ - axis: "y", - opacity: 0.5, - grid: [20, 10], - tolerance: "pointer", - handle: ".move-section", - update: function(event, ui) { - ui.item.trigger("reorder", ui.item.index()); - } - } ); - - if ( $( '.use-sections-switch' ).is( ':checked' ) ) { - setTimeout( function() { - generateShowSections(); - }, 200 ); - } else { - generateHideSections(); - } - - $( '.use-sections-switch' ).on( 'change', function( e ) { - var status = ( $(this).is( ':checked' ) ) ? 'checked' : 'unchecked'; - - if ( 'checked' == status ) { - generateShowSections(); - } else if ( 'unchecked' == status ) { - generateHideSections(); - } - } ); - - function generateShowSections() { - - // Hide send to editor button - $('.send-to-editor').css('display', 'none'); - - // Hide the editor - $('#postdivrich').css({ - 'opacity': '0', - 'height': '0', - 'overflow': 'hidden' - }); - - // Show the sections - $('#_generate_sections_metabox').css({ - 'opacity': '1', - 'height': 'auto' - }); - - // Remove and add the default editor - this removes any visible toolbars etc.. - // We need to set a timeout for this to work - // if (typeof tinyMCE != "undefined") { - // tinyMCE.EditorManager.execCommand("mceRemoveEditor", true, "content"); - // $( '.use-sections-cover' ).css( 'z-index','10000' ); - // setTimeout('tinyMCE.EditorManager.execCommand("mceAddEditor", true, "content");', 1); - // setTimeout('jQuery( ".use-sections-cover" ).css( "z-index","-1" );', 1000); - // } - - // Set a trigger - $('body').trigger('generate_show_sections'); - - } - - function generateHideSections() { - - // Show send to editor button - $('.send-to-editor').css('display', 'inline-block'); - - // Show the editor - $('#postdivrich').css({ - 'opacity': '1', - 'height': 'auto' - }); - - // Hide the sections - $('#_generate_sections_metabox').css({ - 'opacity': '0', - 'height': '0', - 'overflow': 'hidden' - }); - - $('body').trigger('generate_hide_sections'); - - } - - $( document ).on( 'click', '.edit-section.edit-settings', function() { - $( 'body' ).trigger( 'generate_section_show_settings' ); - }); - - }); - - -})(jQuery, Generate_Sections); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js deleted file mode 100644 index 4c498070..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js +++ /dev/null @@ -1,858 +0,0 @@ -/*-----------------------------------------------------------------------------------*/ -/* Generate Sections Metabox -/* -/* © Kathy Darling http://www.kathyisawesome.com -/* 2016-07-19. */ -/*-----------------------------------------------------------------------------------*/ - -/** - * @type {Object} JavaScript namespace for our application. - */ -var Generate_Sections = { - backbone_modal: { - __instance: undefined - } -}; - -(function($, Generate_Sections) { - - - // Model - Generate_Sections.Section = Backbone.Model.extend({ - defaults: { - "title": "", - "box_type": "", - "inner_box_type": "", - "custom_classes": "", - "custom_id": "", - "top_padding": "", - "bottom_padding": "", - "top_padding_unit": "", - "bottom_padding_unit": "", - "background_color": "", - "background_image": "", - "background_image_preview": "", - "parallax_effect": "", - "background_color_overlay": "", - "text_color": "", - "link_color": "", - "link_color_hover": "", - "content": "" - } - }); - - - // Collection - Generate_Sections.SectionsCollection = Backbone.Collection.extend({ - model: Generate_Sections.Section, - el: "#generate_sections_container", - comparator: function(model) { - return model.get('index'); - } - }); - - - /** - * Primary Modal Application Class - */ - Generate_Sections.backbone_modal.Application = Backbone.View.extend({ - - attributes: { - id: "generate-sections-modal-dialog", - class: "generate-sections-modal", - role: "dialog" - }, - - template: wp.template("generate-sections-modal-window"), - - mediaUploader: null, - - /*-----------------------------------------------------------------------------------*/ - /* tinyMCE settings - /*-----------------------------------------------------------------------------------*/ - - tmc_settings: {}, - - /*-----------------------------------------------------------------------------------*/ - /* tinyMCE defaults - /*-----------------------------------------------------------------------------------*/ - - tmc_defaults: { - theme: "modern", - menubar: false, - wpautop: true, - indent: false, - toolbar1: "bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink,fullscreen", - plugins: "fullscreen,image,wordpress,wpeditimage,wplink", - max_height: 500 - }, - - /*-----------------------------------------------------------------------------------*/ - /* quicktags settings - /*-----------------------------------------------------------------------------------*/ - - qt_settings: {}, - - /*-----------------------------------------------------------------------------------*/ - /* quicktags defaults - /*-----------------------------------------------------------------------------------*/ - - qt_defaults: { - buttons: "strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen" - }, - - model: Generate_Sections.Section, - - events: { - "click .media-modal-backdrop, .media-modal-close, .media-button-close": "closeModal", - "click .media-button-insert": "saveModal", - "click .media-menu-item": "switchTab", - "keydown": "keydown", - "click .generate-sections-upload-button": "openMediaUploader", - "click .generate-sections-remove-image": "removeImage", - "click div.media-frame-title h1": "toggleMenu" - }, - - - - /** - * Simple object to store any UI elements we need to use over the life of the application. - */ - ui: { - nav: undefined, - content: undefined - }, - - - /** - * Instantiates the Template object and triggers load. - */ - initialize: function() { - _.bindAll(this, "render", "closeModal", "saveModal", "switchTab"); - - this.focusManager = new wp.media.view.FocusManager({ - el: this.el - }); - - this.changeInsertText(); - //this.tinyMCEsettings(); - this.render(); - }, - - /** - * switch the insert button text to "insert section" - */ - changeInsertText: function(restore) { - - var restore = typeof restore !== 'undefined' && restore == true ? true : false; - - if (restore == false && typeof(wp.media.view.l10n.insertIntoPost) !== "undefined") { - this.insertIntoPost = wp.media.view.l10n.insertIntoPost; - wp.media.view.l10n.insertIntoPost = generate_sections_metabox_i18n.insert_into_section; - // switch the insert button text back - } else if (restore == true && typeof(this.insertIntoPost) !== "undefined") { - wp.media.view.l10n.insertIntoPost = this.insertIntoPost; - } - }, - - /** - * Assembles the UI from loaded template. - * @internal Obviously, if the template fail to load, our modal never launches. - */ - render: function() { - - "use strict"; - - // Build the base window and backdrop, attaching them to the $el. - // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus - this.$el.attr("tabindex", "0").html(this.template); - - // Handle any attempt to move focus out of the modal. - //jQuery(document).on("focusin", this.preserveFocus); - - // set overflow to "hidden" on the body so that it ignores any scroll events while the modal is active - // and append the modal to the body. - jQuery("body").addClass("generate-modal-open").prepend(this.$el); - - // aria hide the background - jQuery("#wpwrap").attr("aria-hidden", "true"); - - this.renderContent(); - - this.renderPreview(); - - this.selected(); - this.colorPicker(); - //this.startTinyMCE(); - this.launchEditor(); - - // Set focus on the modal to prevent accidental actions in the underlying page - this.$el.focus(); - - return this; - }, - - launchEditor: function() { - var id = this.ui.panels.find( ".generate-sections-editor-wrap" ).find( 'textarea' ).attr( 'id' ), - customButtonsContainer = this.ui.panels.find( '.generate-sections-editor-wrap' ).find( '#custom-media-buttons' ); - - customButtonsContainer.find( '.insert-media' ).remove(); - var customButtons = customButtonsContainer.html(); - customButtonsContainer.remove(); - - var init_settings = true; - - if ( typeof tinyMCEPreInit == "object" && "mceInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.mceInit ) { - init_settings = tinyMCEPreInit.mceInit.content; - } else if ( typeof window.wpEditorL10n !== "undefined" ) { - init_settings = window.wpEditorL10n.tinymce.settings; - } else { - init_settings = this.tmc_defaults; - } - - var thisPanel = this.ui.panels; - - var custom_settings = { - wp_autoresize_on: false, - cache_suffix: "", - min_height: 400, - wp_keep_scroll_position: false, - setup: function( editor ) { - editor.on( 'init', function( e ) { - if ( 'html-active' === generate_sections_metabox_i18n.default_editor && generate_sections_metabox_i18n.user_can_richedit ) { - thisPanel.find( '#wp-generate-sections-editor-wrap' ).removeClass( 'tmce-active' ).addClass( 'html-active' ); - editor.hidden = true; - } - } ); - } - } - - init_settings = $.extend({}, init_settings, custom_settings); - - var qt_settings = true; - - if ( typeof tinyMCEPreInit == "object" && "qtInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.qtInit ) { - qt_settings = tinyMCEPreInit.qtInit.content; - } else { - qt_settings = this.qt_defaults; - } - - if ( ! generate_sections_metabox_i18n.user_can_richedit ) { - init_settings = false; - } - - wp.sectionsEditor.initialize( id, { - tinymce: init_settings, - quicktags: qt_settings, - mediaButtons: true - } ); - - var buttonsElement = this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).find( '.wp-media-buttons' ); - buttonsElement.attr( 'id', 'custom-media-buttons' ); - $( customButtons ).appendTo( buttonsElement ); - - if ( ! generate_sections_metabox_i18n.user_can_richedit ) { - this.ui.panels.find( '#generate-sections-editor' ).addClass( 'no-rich-edit' ); - } - }, - - /** - * Make the menu mobile-friendly - */ - toggleMenu: function() { - this.$el.find('.media-menu').toggleClass('visible'); - }, - - /** - * Create the nav tabs & panels - */ - renderContent: function() { - - var model = this.model; - - var menu_item = wp.template("generate-sections-modal-menu-item"); - - // Save a reference to the navigation bar"s unordered list and populate it with items. - this.ui.nav = this.$el.find(".media-menu"); - - // reference to content area - this.ui.panels = this.$el.find(".media-frame-content"); - - // loop through the tabs - if (generate_sections_metabox_i18n.tabs.length) { - - // for...of is nicer, but not supported by minify, so stay with for...in for now - for (var tab in generate_sections_metabox_i18n.tabs) { - - if (generate_sections_metabox_i18n.tabs.hasOwnProperty(tab)) { - - tab = generate_sections_metabox_i18n.tabs[tab]; - - var $new_tab = $(menu_item({ - target: tab.target, - name: tab.title - })); - - var panel = wp.template("generate-sections-edit-" + tab.target); - - var $new_panel = $(panel(model.toJSON())); - - if (tab.active == "true") { - $new_tab.addClass("active"); - $new_panel.addClass("active"); - } - - jQuery( 'body' ).on( 'generate_section_show_settings', function() { - jQuery( '.generate-sections-modal .media-menu-item' ).removeClass('active'); - jQuery( '.generate-sections-modal .panel' ).removeClass('active'); - jQuery( '.generate-section-item-style' ).addClass('active'); - jQuery( '.generate-section-settings' ).addClass('active'); - }); - - this.ui.nav.append($new_tab); - this.ui.panels.append($new_panel); - } - } - } - - }, - - - /** - * Render the background image preview - */ - renderPreview: function(image_id) { - - var image_id = typeof image_id !== 'undefined' ? image_id : this.model.get("background_image"); - - var $preview = $("#generate-section-image-preview"); - $preview.children().remove(); - - if (image_id > 0) { - this.background = new wp.media.model.Attachment.get(image_id); - - this.background.fetch({ - success: function(att) { - if (_.contains(['png', 'jpg', 'gif', 'jpeg'], att.get('subtype'))) { - $("").attr("src", att.attributes.sizes.thumbnail.url).appendTo($preview); - $preview.next().find(".generate-sections-remove-image").show(); - } - } - }); - } - - }, - - - /** - * Set the default option for the select boxes - */ - selected: function() { - - var _this = this; - - this.$el.find("select").each(function(index, select) { - - var attribute = jQuery(select).attr("name"); - var selected = _this.model.get(attribute); - jQuery(select).val(selected); - - }); - }, - - /** - * Start the colorpicker - */ - colorPicker: function() { - this.$el.find(".generate-sections-color").wpColorPicker(); - }, - - /** - * Launch Media Uploader - */ - openMediaUploader: function(e) { - - var _this = this; - - $input = jQuery(e.currentTarget).prev("#generate-sections-background-image"); - - e.preventDefault(); - - // If the uploader object has already been created, reopen the dialog - if (this.mediaUploader) { - this.mediaUploader.open(); - return; - } - // Extend the wp.media object - this.mediaUploader = wp.media.frames.file_frame = wp.media({ - title: generate_sections_metabox_i18n.media_library_title, - button: { - text: generate_sections_metabox_i18n.media_library_button - }, - multiple: false - }); - - - // When a file is selected, grab the URL and set it as the text field"s value - this.mediaUploader.on("select", function() { - - attachment = _this.mediaUploader.state().get("selection").first().toJSON(); - - $input.val(attachment.id); - - _this.renderPreview(attachment.id); - }); - // Open the uploader dialog - this.mediaUploader.open(); - - }, - - /** - * Remove the background image - */ - removeImage: function(e) { - e.preventDefault(); - $("#generate-section-image-preview").children().remove(); - $("#generate-section-image-preview").next().find(".generate-sections-remove-image").hide(); - $("#generate-sections-background-image").val(""); - }, - - - /** - * Closes the modal and cleans up after the instance. - * @param e {object} A jQuery-normalized event object. - */ - closeModal: function(e) { - "use strict"; - - e.preventDefault(); - this.undelegateEvents(); - jQuery(document).off("focusin"); - jQuery("body").removeClass("generate-modal-open"); - jQuery("body").removeClass("generate-section-content"); - - // remove restricted media modal tab focus once it's closed - this.$el.undelegate('keydown'); - - // remove the tinymce editor - // this needs to be called before the modal is closed or it will fail in Firefox (that was fun to figure out...) - if (typeof tinyMCE != "undefined") { - tinymce.EditorManager.execCommand("mceRemoveEditor", true, "generate-sections-editor"); - } - - // remove modal and unset instances - this.remove(); - Generate_Sections.backbone_modal.__instance = undefined; - this.mediaUploader = null; - Generate_Sections.modalOpen = null; - - // switch the insert button text back - this.changeInsertText(true); - - // send focus back to where it was prior to modal open - Generate_Sections.lastFocus.focus(); - - // aria unhide the background - jQuery("#wpwrap").attr("aria-hidden", "false"); - - // Fix bug where the window scrolls down 50px on close - var topDistance = jQuery("body").offset().top; - if ( topDistance >= jQuery("body").scrollTop() ) { - jQuery("body").scrollTop(0); - } - - }, - - /** - * Responds to the btn-ok.click event - * @param e {object} A jQuery-normalized event object. - * @todo You should make this your own. - */ - saveModal: function(e) { - "use strict"; - - this.model.get("index"); - - var model = this.model; - - // send the tinymce content to the textarea - if (typeof tinyMCE != "undefined") { - tinymce.triggerSave(); - } - - var $inputs = this.ui.panels.find("input, select, textarea"); - - $inputs.each(function(index, input) { - - var name = $(input).attr("name"); - - if (model.attributes.hasOwnProperty(name)) { - var value = $(input).val(); - model.set(name, value); - } - - }); - - this.closeModal(e); - }, - - /** - * Handles tab clicks and switches to corresponding panel - * @param e {object} A jQuery-normalized event object. - */ - switchTab: function(e) { - "use strict"; - e.preventDefault(); - - // close lingering wp link windows - if (typeof tinyMCE != "undefined" && 'style' == jQuery( e.currentTarget ).data( 'target' ) && this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).hasClass( 'tmce-active' )) { - tinyMCE.activeEditor.execCommand('wp_link_cancel'); - tinyMCE.activeEditor.execCommand('wp_media_cancel'); - } - - this.ui.nav.children().removeClass("active"); - this.ui.panels.children().removeClass("active"); - - var target = jQuery(e.currentTarget).addClass("active").data("target"); - - this.ui.panels.find("div[data-id=" + target + "]").addClass("active"); - }, - - /** - * close on keyboard shortcuts - * @param {Object} event - */ - keydown: function(e) { - // Close the modal when escape is pressed. - if (27 === e.which && this.$el.is(':visible')) { - this.closeModal(e); - e.stopImmediatePropagation(); - } - } - - }); - - - // Singular View - Generate_Sections.sectionView = Backbone.View.extend({ - - model: Generate_Sections.Section, - tagName: 'div', - - initialize: function() { - // re-render on all changes EXCEPT index - this.listenTo(this.model, "change", this.maybeRender); - }, - - attributes: { - class: "ui-state-default section" - }, - - // Get the template from the DOM - template: wp.template("generate-sections-section"), - - events: { - 'click .edit-section': 'editSection', - 'click .section-title > span': 'editSection', - 'click .delete-section': 'removeSection', - 'click .toggle-section': 'toggleSection', - 'reorder': 'reorder', - }, - - maybeRender: function(e) { - if (this.model.hasChanged('index')) return; - this.render(); - }, - - // Render the single model - include an index. - render: function() { - this.model.set('index', this.model.collection.indexOf(this.model)); - this.$el.html(this.template(this.model.toJSON())); - - if (!this.model.get('title')) { - this.$el.find('h3.section-title > span').text(generate_sections_metabox_i18n.default_title); - } - this.$el.find('textarea').val(JSON.stringify(this.model)); - - return this; - }, - - - // launch the edit modal - editSection: function(e) { - - // stash the current focus - Generate_Sections.lastFocus = document.activeElement; - Generate_Sections.modalOpen = true; - - e.preventDefault(); - if (Generate_Sections.backbone_modal.__instance === undefined) { - Generate_Sections.backbone_modal.__instance = new Generate_Sections.backbone_modal.Application({ - model: this.model - }); - } - - }, - - // reorder after sort - reorder: function(event, index) { - this.$el.trigger('update-sort', [this.model, index]); - }, - - // remove/destroy a model - removeSection: function(e) { - e.preventDefault(); - if (confirm(generate_sections_metabox_i18n.confirm)) { - this.model.destroy(); - Generate_Sections.sectionList.render(); // manually calling instead of listening since listening interferes with sorting - } - }, - }); - - - // List View - Generate_Sections.sectionListView = Backbone.View.extend({ - - el: "#generate_sections_container", - events: { - 'update-sort': 'updateSort', - // 'add-section': 'addOne' - }, - - // callback for clone button - addSection: function(model) { - this.collection.add(model); - this.addOne(model); - }, - - addOne: function(model) { - var view = new Generate_Sections.sectionView({ - model: model - }); - this.$el.append(view.render().el); - }, - - render: function() { - this.$el.children().remove(); - this.collection.each(this.addOne, this); - return this; - }, - - updateSort: function(event, model, position) { - this.collection.remove(model); - - // renumber remaining models around missing model - this.collection.each(function(model, index) { - - var new_index = index; - if (index >= position) { - new_index += 1; - } - model.set('index', new_index); - }); - - // set the index of the missing model - model.set('index', position); - - // add the model back to the collection - this.collection.add(model, { - at: position - }); - - this.render(); - - }, - - }); - - - // The Buttons & Nonce - Generate_Sections.ButtonControls = Backbone.View.extend({ - - attributes: { - class: "generate_sections_buttons" - }, - - tagName: 'p', - - el: "#_generate_sections_metabox", - - template: wp.template("generate-sections-buttons"), - - // Attach events - events: { - "click .button-primary": "newSection", - "click #generate-delete-sections": "clearAll", - 'click .edit-section': 'editSection', - }, - - // create new - newSection: function(e) { - e.preventDefault(); - var newSection = new Generate_Sections.Section(); - Generate_Sections.sectionList.addSection(newSection); - }, - - // clear all models - clearAll: function(e) { - e.preventDefault(); - if (confirm(generate_sections_metabox_i18n.confirm)) { - Generate_Sections.sectionCollection.reset(); - Generate_Sections.sectionList.render(); - } - }, - - render: function() { - this.$el.find(".generate_sections_control").append(this.template); - return this; - }, - - }); - - - // init - Generate_Sections.initApplication = function() { - - // Create Collection From Existing Meta - Generate_Sections.sectionCollection = new Generate_Sections.SectionsCollection(generate_sections_metabox_i18n.sections); - - // Create the List View - Generate_Sections.sectionList = new Generate_Sections.sectionListView({ - collection: Generate_Sections.sectionCollection - }); - Generate_Sections.sectionList.render(); - - // Buttons - Generate_Sections.Buttons = new Generate_Sections.ButtonControls({ - collection: Generate_Sections.sectionCollection - }); - Generate_Sections.Buttons.render(); - - }; - - - /*-----------------------------------------------------------------------------------*/ - /* Execute the above methods in the Generate_Sections object. - /*-----------------------------------------------------------------------------------*/ - - jQuery( function( $ ) { - - Generate_Sections.initApplication(); - - $( '#generate_sections_container' ).sortable({ - axis: "y", - opacity: 0.5, - grid: [20, 10], - tolerance: "pointer", - handle: ".move-section", - update: function(event, ui) { - ui.item.trigger("reorder", ui.item.index()); - } - } ); - - if ( $( '.use-sections-switch' ).is( ':checked' ) ) { - setTimeout( function() { - generateShowSections(); - }, 200 ); - } else { - generateHideSections(); - } - - $( '.use-sections-switch' ).on( 'change', function( e ) { - var status = ( $(this).is( ':checked' ) ) ? 'checked' : 'unchecked'; - - if ( 'checked' == status ) { - generateShowSections(); - } else if ( 'unchecked' == status ) { - generateHideSections(); - } - } ); - - function generateShowSections() { - - // Hide send to editor button - $('.send-to-editor').css('display', 'none'); - - // Hide the editor - $('#postdivrich').css({ - 'opacity': '0', - 'height': '0', - 'overflow': 'hidden' - }); - - $( '.block-editor-block-list__layout' ).hide(); - - $( '.edit-post-layout .edit-post-visual-editor' ).css( { - 'flex-grow': 'unset', - 'flex-basis': '0' - } ); - - $( '.edit-post-visual-editor .block-editor-writing-flow__click-redirect' ).css( { - 'min-height': '0' - } ); - - $( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '0' ); - - // Show the sections - $('#_generate_sections_metabox').css({ - 'opacity': '1', - 'height': 'auto' - }); - - // Remove and add the default editor - this removes any visible toolbars etc.. - // We need to set a timeout for this to work - // if (typeof tinyMCE != "undefined") { - // tinyMCE.EditorManager.execCommand("mceRemoveEditor", true, "content"); - // $( '.use-sections-cover' ).css( 'z-index','10000' ); - // setTimeout('tinyMCE.EditorManager.execCommand("mceAddEditor", true, "content");', 1); - // setTimeout('jQuery( ".use-sections-cover" ).css( "z-index","-1" );', 1000); - // } - - // Set a trigger - $('body').trigger('generate_show_sections'); - - } - - function generateHideSections() { - - // Show send to editor button - $('.send-to-editor').css('display', 'inline-block'); - - // Show the editor - $('#postdivrich').css({ - 'opacity': '1', - 'height': 'auto' - }); - - $( '.block-editor-block-list__layout' ).show(); - - $( '.edit-post-layout .edit-post-visual-editor' ).css( { - 'flex-grow': '', - 'flex-basis': '' - } ); - - $( '.edit-post-visual-editor .block-editor-writing-flow__click-redirect' ).css( { - 'min-height': '' - } ); - - $( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '' ); - - // Hide the sections - $('#_generate_sections_metabox').css({ - 'opacity': '0', - 'height': '0', - 'overflow': 'hidden' - }); - - $('body').trigger('generate_hide_sections'); - - } - - $( document ).on( 'click', '.edit-section.edit-settings', function() { - $( 'body' ).trigger( 'generate_section_show_settings' ); - }); - - }); - - -})(jQuery, Generate_Sections); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/metabox-functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/metabox-functions.php deleted file mode 100644 index 402614ec..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/metabox-functions.php +++ /dev/null @@ -1,396 +0,0 @@ -ID, '_generate_use_sections', TRUE) : ''; - - if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { - $classes .= ' generate-sections-enabled'; - } - - return $classes; - } -} - -if ( ! function_exists( 'generate_sections_content_width' ) ) { - add_action( 'wp', 'generate_sections_content_width', 50 ); - /** - * Set our content width when sections are enabled - */ - function generate_sections_content_width() { - global $post; - $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; - - if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { - global $content_width; - $content_width = 2000; - } - } -} - -if ( ! function_exists( 'generate_sections_add_metaboxes' ) ) { - add_action( 'add_meta_boxes', 'generate_sections_add_metaboxes', 5 ); - /* - * Functions for creating the metaboxes - */ - function generate_sections_add_metaboxes() { - - $post_types = apply_filters( 'generate_sections_post_types', array( 'page', 'post' ) ); - - add_meta_box( - '_generate_use_sections_metabox', - __( 'Sections', 'gp-premium' ), - 'generate_sections_use_sections_metabox', - $post_types, - 'side', - 'high' - ); - - add_meta_box( - '_generate_sections_metabox', - __( 'Sections', 'gp-premium' ), - 'generate_sections_sections_metabox', - $post_types, - 'normal', - 'high' - ); - - } -} - -if ( ! function_exists( 'generate_sections_sanitize_function' ) ) { - /* - * Sanitize our settings - */ - function generate_sections_sanitize_function( $data, $post_id ) { - - $section = array(); - - if ( isset( $data['title'] ) ) { - $section['title'] = sanitize_text_field( $data['title'] ); - } - - if ( isset( $data['content'] ) ) { - $section['content'] = sanitize_post_field( 'post_content', $data['content'], $post_id, 'db' ); - } - - if ( isset( $data['custom_classes'] ) ) { - $section['custom_classes'] = sanitize_text_field( $data['custom_classes'] ); - } - - if ( isset( $data['custom_id'] ) ) { - $section['custom_id'] = sanitize_text_field( $data['custom_id'] ); - } - - if ( isset( $data['top_padding'] ) ) { - $section['top_padding'] = '' == $data['top_padding'] ? $data['top_padding'] : absint( $data['top_padding'] ); - } - - if ( isset( $data['bottom_padding'] ) ) { - $section['bottom_padding'] = '' == $data['bottom_padding'] ? $data['bottom_padding'] : absint( $data['bottom_padding'] ); - } - - if ( isset( $data['top_padding_unit'] ) ) { - $section['top_padding_unit'] = $data['top_padding_unit'] == '%' ? '%' : ''; - } - - if ( isset( $data['bottom_padding_unit'] ) ) { - $section['bottom_padding_unit'] = $data['bottom_padding_unit'] == '%' ? '%' : ''; - } - - if ( isset( $data['background_image'] ) ) { - $section['background_image'] = absint( $data['background_image'] ); - } - - if ( isset( $data['background_color'] ) ) { - $section['background_color'] = generate_sections_sanitize_rgba( $data['background_color'] ); - } - - if ( isset( $data['text_color'] ) ) { - $section['text_color'] = generate_sections_sanitize_hex_color( $data['text_color'] ); - } - - if ( isset( $data['link_color'] ) ) { - $section['link_color'] = generate_sections_sanitize_hex_color( $data['link_color'] ); - } - - if ( isset( $data['link_color_hover'] ) ) { - $section['link_color_hover'] = generate_sections_sanitize_hex_color( $data['link_color_hover'] ); - } - - if ( isset( $data['box_type'] ) ) { - $section['box_type'] = $data['box_type'] == 'contained' ? 'contained' : ''; - } - - if ( isset( $data['inner_box_type'] ) ) { - $section['inner_box_type'] = $data['inner_box_type'] == 'fluid' ? 'fluid' : ''; - } - - if ( isset( $data['parallax_effect'] ) ) { - $section['parallax_effect'] = $data['parallax_effect'] == 'enable' ? 'enable' : ''; - } - - if ( isset( $data['background_color_overlay'] ) ) { - $section['background_color_overlay'] = $data['background_color_overlay'] == 'enable' ? 'enable' : ''; - } - - return $section; - - } -} - -if ( ! function_exists( 'generate_sections_metabox_scripts' ) ) { - add_action( 'admin_enqueue_scripts', 'generate_sections_metabox_scripts', 20 ); - /* - * Enqueue styles and scripts specific to metaboxs - */ - function generate_sections_metabox_scripts( $hook ) { - // I prefer to enqueue the styles only on pages that are using the metaboxes - if ( in_array( $hook, array( "post.php", "post-new.php" ) ) ) { - - $post_types = apply_filters( 'generate_sections_post_types', array( 'page', 'post' ) ); - - $screen = get_current_screen(); - $post_type = $screen->id; - - if ( in_array( $post_type, (array) $post_types ) ) { - wp_enqueue_style( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'css/generate-sections-metabox.css', false, GENERATE_SECTIONS_VERSION ); - wp_enqueue_style( 'generate-lc-switch', plugin_dir_url( __FILE__ ) . 'css/lc_switch.css', false, GENERATE_SECTIONS_VERSION ); - - //make sure we enqueue some scripts just in case ( only needed for repeating metaboxes ) - wp_enqueue_script( 'jquery' ); - wp_enqueue_script( 'jquery-ui-core' ); - wp_enqueue_script( 'jquery-ui-widget' ); - wp_enqueue_script( 'jquery-ui-mouse' ); - wp_enqueue_script( 'jquery-ui-sortable' ); - wp_enqueue_script( 'editor' ); - wp_enqueue_script( 'media-upload' ); - wp_enqueue_script( 'wp-color-picker' ); - wp_enqueue_style( 'wp-color-picker' ); - wp_enqueue_script( 'wp-color-picker-alpha', GP_LIBRARY_DIRECTORY_URL . 'alpha-color-picker/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '3.0.0', true ); - - wp_add_inline_script( - 'wp-color-picker-alpha', - 'jQuery( function() { jQuery( ".color-picker" ).wpColorPicker(); } );' - ); - - wp_enqueue_media(); - - if ( function_exists( 'wp_enqueue_editor' ) ) { - wp_enqueue_editor(); - - wp_add_inline_script( - 'editor', - 'window.wp.sectionsEditor = window.wp.editor;', - 'after' - ); - } - - if ( version_compare( get_bloginfo( 'version' ), '5.0', '<' ) ) { - wp_enqueue_script( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'js/generate-sections-metabox-4.9.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'editor', 'media-upload', 'wp-color-picker' ), GENERATE_SECTIONS_VERSION, true ); - } else { - wp_enqueue_script( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'js/generate-sections-metabox.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'editor', 'media-upload', 'wp-color-picker' ), GENERATE_SECTIONS_VERSION, true ); - } - - if ( function_exists( 'wp_add_inline_script' ) ) { - if ( function_exists( 'generate_get_default_color_palettes' ) ) { - // Grab our palette array and turn it into JS - $palettes = json_encode( generate_get_default_color_palettes() ); - - // Add our custom palettes - // json_encode takes care of escaping - wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' ); - } - } - } - } - } -} - -if ( ! function_exists( 'generate_sections_admin_footer_scripts' ) ) { - add_action( 'admin_footer', 'generate_sections_admin_footer_scripts' ); - - function generate_sections_admin_footer_scripts() { - // We don't need this if wp_add_inline_script exists - if ( function_exists( 'wp_add_inline_script' ) ) { - return; - } - ?> - - ID, '_generate_sections', true ); - - $sections = isset( $meta['sections'] ) && is_array( $meta['sections' ] ) ? $meta['sections'] : array(); - - $translation_array = array( - 'confirm' => __( 'This action can not be undone, are you sure?', 'gp-premium' ), - 'post_id' => $post->ID, - 'sections' => $sections, - 'default_title' => __( 'Section', 'gp-premium' ), - 'default_content_title' => __( 'Content', 'gp-premium' ), - 'tabs' => array( - array( 'title' => __( 'Settings', 'gp-premium' ), 'target' => 'style', 'active' => 'false' ), - array( 'title' => __( 'Content', 'gp-premium' ), 'target' => 'content', 'active' => 'true' ), - //array( 'title' => __( 'Layout', 'gp-premium' ), 'target' => 'layout', 'active' => 'false' ), - ), - 'top_padding' => apply_filters( 'generate_sections_default_padding_top','40' ), - 'bottom_padding' => apply_filters( 'generate_sections_default_padding_bottom','40' ), - 'media_library_title' => __('Section Background', 'gp-premium' ), - 'media_library_button' => __( 'Set as Section Background', 'gp-premium' ), - 'generate_nonce' => wp_create_nonce( 'generate_sections_nonce' ), - 'default_editor' => user_can_richedit() && wp_default_editor() == 'tinymce' ? 'tmce-active' : 'html-active', - 'user_can_richedit' => user_can_richedit(), - 'insert_into_section' => __( 'Insert into Section', 'gp-premium' ), - 'edit_section' => __( 'Edit Section', 'gp-premium' ) - - ); - wp_localize_script( 'generate-sections-metabox', 'generate_sections_metabox_i18n', $translation_array ); - - include_once( plugin_dir_path( __FILE__ ) . 'views/sections.php' ); - include_once( plugin_dir_path( __FILE__ ) . 'views/sections-template.php' ); - add_action( 'print_media_templates', 'generate_sections_print_templates' ); - - do_action( 'generate_sections_metabox' ); - } -} - -if ( ! function_exists( 'generate_sections_save_use_metabox' ) ) { - add_action( 'save_post', 'generate_sections_save_use_metabox' ); - /* - * Save the "use" metabox - */ - function generate_sections_save_use_metabox( $post_id ) { - if ( ! isset( $_POST['_generate_sections_use_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_use_sections_nonce'], 'generate_sections_use_sections_nonce' ) ) { - return $post_id; - } - - if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { - return $post_id; - } - - if ( ! current_user_can('edit_post', $post_id ) ) { - return $post_id; - } - - if ( isset ( $_POST['_generate_use_sections'] ) && isset ( $_POST['_generate_use_sections']['use_sections'] ) && $_POST['_generate_use_sections']['use_sections'] == 'true' ) { - update_post_meta( $post_id, '_generate_use_sections', array( 'use_sections' => 'true' ) ); - } else { - delete_post_meta( $post_id, '_generate_use_sections' ); - } - } -} - -if ( ! function_exists( 'generate_sections_save_sections_metabox' ) ) { - add_action( 'save_post', 'generate_sections_save_sections_metabox', 20 ); - /* - * Save the sections metabox - */ - function generate_sections_save_sections_metabox( $post_id ) { - - if ( ! isset( $_POST['_generate_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_nonce'], 'generate_sections_nonce' ) ) { - return $post_id; - } - - if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { - return $post_id; - } - - if ( ! current_user_can('edit_post', $post_id ) ) { - return $post_id; - } - - $clean = array(); - - if ( isset ( $_POST['_generate_sections'] ) && isset( $_POST['_generate_sections']['sections'] ) && is_array( $_POST['_generate_sections']['sections'] ) ) { - - foreach( $_POST['_generate_sections']['sections'] as $section ) { - - $section = json_decode( stripslashes( trim($section) ), true); - - $section = generate_sections_sanitize_function( $section, $post_id ); - if ( ! empty( $section ) ){ - $clean[] = $section; - } - - } - - } - - // save data - if ( ! empty( $clean ) ) { - // this maintains data structure of previous version - $meta = array( 'sections' => $clean ); - update_post_meta( $post_id, '_generate_sections', $meta ); - } else { - delete_post_meta( $post_id, '_generate_sections' ); - } - - } -} - -if ( ! function_exists( 'generate_sections_sanitize_hex_color' ) ) { - /* - * Sanitize colors - * We don't use the built in function so we can use empty values - */ - function generate_sections_sanitize_hex_color( $color ) { - if ( '' === $color ) { - return ''; - } - - // 3 or 6 hex digits, or the empty string. - if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { - return $color; - } - - return null; - } -} - -if ( ! function_exists( 'generate_sections_sanitize_rgba' ) ) { - /** - * Sanitize RGBA colors - * @since 1.3.42 - */ - function generate_sections_sanitize_rgba( $color ) { - if ( '' === $color ) { - return ''; - } - - // If string does not start with 'rgba', then treat as hex - // sanitize the hex color and finally convert hex to rgba - if ( false === strpos( $color, 'rgba' ) ) { - return generate_sections_sanitize_hex_color( $color ); - } - - // By now we know the string is formatted as an rgba color so we need to further sanitize it. - $color = str_replace( ' ', '', $color ); - sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); - return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; - - return ''; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/sections-template.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/sections-template.php deleted file mode 100644 index 4fd904bf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/sections-template.php +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
          - - - -
          - -
          \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/use-sections.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/use-sections.php deleted file mode 100644 index d2aa993f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/use-sections.php +++ /dev/null @@ -1,17 +0,0 @@ - -
          - - ID, '_generate_use_sections', true ); - //$use_sections = isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ? true : false; - wp_nonce_field( 'generate_sections_use_sections_nonce', '_generate_sections_use_sections_nonce' ); - ?> - -
          diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/templates/template.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/templates/template.php deleted file mode 100644 index daf0d21e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/templates/template.php +++ /dev/null @@ -1,122 +0,0 @@ -ID, '_generate_sections', TRUE) : ''; -$sidebars = apply_filters( 'generate_sections_sidebars', false ); -?> - -
          > -
          > - - - -
          > -
          -
          - -
          -
          -
          - - - - '; - $container['after'] = '
          '; - else : - $container['before'] = '
          '; - $container['after'] = '
          '; - endif; - - // Create inner container - if ( 'fluid' == $inner_box_type ) : - $inner_container['before'] = '
          '; - $inner_container['after'] = '
          '; - else : - $inner_container['before'] = '
          '; - $inner_container['after'] = '
          '; - endif; - - // Output the container - $return .= $container['before']; - $return .= $inner_container['before']; - - // Output the content - // Add \n\n to fix issue where paragraph wrapping was off - $return .= "\n\n" . $content; - - // Output the closing containers - $return .= $container['after']; - $return .= $inner_container['after']; - - endforeach; - - // Return our sections through the_content filter - echo apply_filters( 'the_content', $return ); - else : - ?> -
          -
          - -
          -
          - - - - - - - - - $widgets ) { - // Skip inactive widgets (should not be in export file). - if ( 'wp_inactive_widgets' === $sidebar_id ) { - continue; - } - - if ( is_array( $widgets ) ) { - foreach ( $widgets as $widget_instance_id => $widget ) { - $all_widgets[] = $widget; - } - } - } - - $results['wp_inactive_widgets'] = $all_widgets; - - update_option( 'sidebars_widgets', $results ); - - } - - /** - * Checks to see whether options exist or not. - * - * @since 1.8 - * - * @return bool - */ - public static function do_options_exist() { - $theme_mods = self::get_theme_mods(); - $settings = self::get_theme_settings(); - - $has_data = array( - 'mods' => array(), - 'options' => array(), - ); - - foreach ( $theme_mods as $theme_mod ) { - if ( get_theme_mod( $theme_mod ) ) { - $has_data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); - } - } - - foreach ( $settings as $setting ) { - if ( get_option( $setting ) ) { - - // The blog module runs a migration script on activation for now. This checks if those migrated values have been changed. - if ( 'generate_blog_settings' === $setting && function_exists( 'generate_blog_get_defaults' ) ) { - $defaults = generate_blog_get_defaults(); - $options = get_option( $setting ); - $diff = array(); - - foreach ( $options as $option => $value ) { - if ( isset( $defaults[ $option ] ) && $value !== $defaults[ $option ] ) { - $diff[ $option ] = $value; - } - } - - if ( empty( $diff ) ) { - continue; - } - } - - $has_data['options'][ $setting ] = get_option( $setting ); - } - } - - if ( ! array_filter( $has_data ) ) { - return false; - } else { - return true; - } - } - - /** - * Imports our content and custom CSS. - * - * @since 1.6 - * @param string $path Path to the file. - * @param string $slug File slug. - */ - public static function import_xml( $path, $slug ) { - if ( ! class_exists( 'WP_Importer' ) ) { - require_once ABSPATH . '/wp-admin/includes/class-wp-importer.php'; - } - - require_once GP_PREMIUM_DIR_PATH . 'site-library/libs/wxr-importer/WXRImporter.php'; - require_once GP_PREMIUM_DIR_PATH . 'site-library/libs/wxr-importer/WPImporterLogger.php'; - require_once GP_PREMIUM_DIR_PATH . 'site-library/libs/wxr-importer/WXRImportInfo.php'; - require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-content-importer.php'; - - if ( ! function_exists( 'wp_crop_image' ) ) { - require_once ABSPATH . 'wp-admin/includes/image.php'; - } - - add_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); - add_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); - add_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); - - $options = array( - 'fetch_attachments' => true, - 'default_author' => 0, - ); - - $current_css = wp_get_custom_css_post(); - - $logger = new GeneratePress\WPContentImporter2\WPImporterLogger(); - $importer = new GeneratePress_Sites_Content_Importer( $options ); - $importer->set_logger( $logger ); - $result = $importer->import( $path ); - - // Get all mapped post and term data. - $existing_data = self::get_mapped_post_ids( $slug ); - $mapped_data = $importer->get_importer_data(); - $mapped_posts = $mapped_data['mapping']['post']; - - // Merge exiting mapped posts with any new ones. Existing posts don't get mapped, so we need to preserve them. - $all_data = $mapped_posts + $existing_data; - - // Set our site specific mapped posts with all of our data. - update_option( 'generatepress_sites_mapped_ids_' . $slug, $all_data, false ); - - // Set mapped term IDs. - // These are always the same, even if the site has been imported before. No fancy stuff needed. - $term_mapping = $mapped_data['mapping']['term_id']; - set_transient( 'generatepress_sites_mapped_term_ids', $term_mapping, 0.1 * HOUR_IN_SECONDS ); - - wp_update_custom_css_post( $current_css->post_content ); - - // Page builders need so much extra work. - self::update_page_builder_content(); - - remove_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); - remove_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); - remove_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); - } - - /** - * List plugins that have a pro version. - * - * We want to check to see if these exist before installing or activating - * the free versions. - * - * @since 1.6 - * - * @return array - */ - public static function check_for_pro_plugins() { - return apply_filters( - 'generate_sites_pro_plugins', - array( - 'beaver-builder-lite-version/fl-builder.php' => 'bb-plugin/fl-builder.php', - 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' => 'bb-ultimate-addon/bb-ultimate-addon.php', - 'powerpack-addon-for-beaver-builder/bb-powerpack-lite.php' => 'bbpowerpack/bb-powerpack.php', - ) - ); - } - - /** - * Check to see if required plugins are active. - * - * @since 1.6 - * - * @param string $plugin The plugin to check for. - */ - public static function is_plugin_installed( $plugin ) { - $pro_plugins = self::check_for_pro_plugins(); - - // Check to see if this plugin has a pro version. - if ( array_key_exists( $plugin, $pro_plugins ) ) { - if ( file_exists( WP_PLUGIN_DIR . '/' . $pro_plugins[ $plugin ] ) ) { - return true; - } - } - - if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin ) ) { - return true; - } - - return false; - - } - - /** - * Allow SVG images. - * - * @since 1.6 - * - * @param array $response Attachment response. - * @param object $attachment Attachment object. - * @param array $meta Attachment meta data. - */ - public static function add_svg_image_support( $response, $attachment, $meta ) { - if ( ! function_exists( 'simplexml_load_file' ) ) { - return $response; - } - - if ( ! empty( $response['sizes'] ) ) { - return $response; - } - - if ( 'image/svg+xml' !== $response['mime'] ) { - return $response; - } - - $svg_path = get_attached_file( $attachment->ID ); - - $dimensions = self::get_svg_dimensions( $svg_path ); - - $response['sizes'] = array( - 'full' => array( - 'url' => $response['url'], - 'width' => $dimensions->width, - 'height' => $dimensions->height, - 'orientation' => $dimensions->width > $dimensions->height ? 'landscape' : 'portrait', - ), - ); - - return $response; - } - - /** - * Get the dimensions of the uploaded SVG. - * - * @since 1.6 - * - * @param string $svg SVG file path. - * @return array Return SVG file height & width for valid SVG file. - */ - public static function get_svg_dimensions( $svg ) { - $svg = simplexml_load_file( $svg ); - - if ( false === $svg ) { - $width = '0'; - $height = '0'; - } else { - $attributes = $svg->attributes(); - $width = (string) $attributes->width; - $height = (string) $attributes->height; - } - - return (object) array( - 'width' => $width, - 'height' => $height, - ); - } - - /** - * Taken from the core media_sideload_image function and - * modified to return an array of data instead of html. - * - * @since 1.6 - * - * @param string $file The image file path. - * @return array An array of image data. - */ - public static function sideload_image( $file ) { - - $data = new stdClass(); - - if ( ! function_exists( 'media_handle_sideload' ) ) { - require_once ABSPATH . 'wp-admin/includes/media.php'; - require_once ABSPATH . 'wp-admin/includes/file.php'; - require_once ABSPATH . 'wp-admin/includes/image.php'; - } - - add_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); - add_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); - add_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); - - if ( ! empty( $file ) ) { - - // Set variables for storage, fix file filename for query strings. - preg_match( '/[^\?]+\.(jpe?g|jpe|svg|gif|png)\b/i', $file, $matches ); - $file_array = array(); - $file_array['name'] = basename( $matches[0] ); - - // Download file to temp location. - $file_array['tmp_name'] = download_url( $file ); - - // If error storing temporarily, return the error. - if ( is_wp_error( $file_array['tmp_name'] ) ) { - return $file_array['tmp_name']; - } - - // Do the validation and storage stuff. - $id = media_handle_sideload( $file_array, 0 ); - - // If error storing permanently, unlink. - if ( is_wp_error( $id ) ) { - @unlink( $file_array['tmp_name'] ); // phpcs:ignore - return $id; - } - - // Build the object to return. - $meta = wp_get_attachment_metadata( $id ); - $data->attachment_id = $id; - $data->url = wp_get_attachment_url( $id ); - $data->thumbnail_url = wp_get_attachment_thumb_url( $id ); - - if ( isset( $meta['height'] ) ) { - $data->height = $meta['height']; - } - - if ( isset( $meta['width'] ) ) { - $data->width = $meta['width']; - } - } - - remove_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); - remove_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); - remove_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); - - return $data; - - } - - /** - * Re-maps menu locations. - * - * @since 1.6 - * - * @param array $locations Incoming locations. - */ - public static function set_nav_menu_locations( $locations = array() ) { - $menu_locations = array(); - - $term_ids = self::get_mapped_term_ids(); - - if ( isset( $locations ) ) { - self::log( '== Start mapping menu locations ==' ); - - foreach ( $locations as $menu => $value ) { - if ( empty( $value ) ) { - continue; - } - - $menu_locations[ $menu ] = $term_ids[ $value ]; - self::log( $value . ' -> ' . $term_ids[ $value ] ); - } - - set_theme_mod( 'nav_menu_locations', $menu_locations ); - } - } - - /** - * Re-maps the front page and posts page. - * - * @since 1.6 - * - * @param string $name Name of the option to update. - * @param string $value Title of the page. - * @param string $slug Slug of the page. - */ - public static function set_reading_pages( $name, $value, $slug ) { - if ( empty( $value ) ) { - return; - } - - self::log( '== Start mapping front and blog pages ==' ); - - // Get import data, with new menu IDs. - $post_ids = self::get_mapped_post_ids( $slug ); - - update_option( $name, $post_ids[ $value ] ); - self::log( $value . ' -> ' . $post_ids[ $value ] ); - } - - /** - * Re-maps WooCommerce pages. - * - * @since 1.6 - * - * @param string $name Name of the option to update. - * @param string $value Title of the page. - * @param string $slug Slug of the page. - */ - public static function set_woocommerce_pages( $name, $value, $slug ) { - if ( empty( $value ) ) { - return; - } - - self::log( '== Start mapping WooCommerce pages ==' ); - - $post_ids = self::get_mapped_post_ids( $slug ); - - update_option( $name, $post_ids[ $value ] ); - self::log( $value . ' -> ' . $post_ids[ $value ] ); - } - - /** - * Change the menu IDs in the custom menu widgets in the widget import data. - * This solves the issue with custom menu widgets not having the correct (new) menu ID, because they - * have the old menu ID from the export site. - * - * @param array $widget The widget settings array. - */ - public static function fix_custom_menu_widget_ids( $widget ) { - // Skip (no changes needed), if this is not a custom menu widget. - if ( ! array_key_exists( 'nav_menu', $widget ) || empty( $widget['nav_menu'] ) || ! is_int( $widget['nav_menu'] ) ) { - return $widget; - } - - // Get import data, with new menu IDs. - $term_ids = self::get_mapped_term_ids(); - - if ( ! isset( $term_ids[ $widget['nav_menu'] ] ) ) { - return $widget; - } - - self::log( '== Start mapping navigation widgets ==' ); - self::log( $widget['nav_menu'] . ' -> ' . $term_ids[ $widget['nav_menu'] ] ); - - // Set the new menu ID for the widget. - $widget['nav_menu'] = $term_ids[ $widget['nav_menu'] ]; - - return $widget; - } - - /** - * Re-maps the element locations. - * - * @since 1.7 - * - * @param array $locations Incoming locations. - * @param string $slug Element slug. - */ - public static function set_element_locations( $locations, $slug ) { - $post_ids = self::get_mapped_post_ids( $slug ); - - if ( isset( $locations ) && ! empty( $locations ) ) { - self::log( '== Start mapping element locations ==' ); - - foreach ( (array) $locations as $key => $value ) { - $new_locations = array(); - if ( empty( $value ) ) { - continue; - } - - foreach ( (array) $value as $data ) { - if ( $data['object'] ) { - self::log( $data['object'] . ' -> ' . $post_ids[ $data['object'] ] ); - $data['object'] = $post_ids[ $data['object'] ]; - } - - $new_locations[] = $data; - } - - update_post_meta( $post_ids[ $key ], '_generate_element_display_conditions', $new_locations ); - } - } - } - - /** - * Re-maps the element exclusions. - * - * @since 1.7 - * - * @param array $locations Incoming locations. - * @param string $slug Element slug. - */ - public static function set_element_exclusions( $locations, $slug ) { - $post_ids = self::get_mapped_post_ids( $slug ); - - if ( isset( $locations ) && ! empty( $locations ) ) { - self::log( '== Start mapping element exclusions ==' ); - - foreach ( (array) $locations as $key => $value ) { - $new_locations = array(); - if ( empty( $value ) ) { - continue; - } - - foreach ( (array) $value as $data ) { - if ( $data['object'] ) { - self::log( $data['object'] . ' -> ' . $post_ids[ $data['object'] ] ); - $data['object'] = $post_ids[ $data['object'] ]; - } - - $new_locations[] = $data; - } - - update_post_meta( $post_ids[ $key ], '_generate_element_exclude_conditions', $new_locations ); - } - } - } - - /** - * Update menu URLs. - * - * @since 1.7.3 - * @param string $url Preview URL. - */ - public static function update_menu_urls( $url ) { - $args = array( - 'post_type' => 'nav_menu_item', - 'fields' => 'ids', - 'no_found_rows' => true, - 'post_status' => 'any', - 'numberposts' => 50, - ); - - $items = get_posts( $args ); - - foreach ( $items as $item_id ) { - $item_type = get_post_meta( $item_id, '_menu_item_type', true ); - - if ( 'custom' === $item_type ) { - $item_url = get_post_meta( $item_id, '_menu_item_url', true ); - - if ( $item_url && '#' !== $item_url ) { - $item_url = str_replace( $url, site_url(), $item_url ); - - update_post_meta( $item_id, '_menu_item_url', $item_url ); - } - } - } - } - - /** - * Allow other files types to be uploaded. - * - * @since 1.6 - * - * @param array $mimes Existing types. - * @return array Merged types. - */ - public static function mime_types( $mimes ) { - $mimes = array_merge( - $mimes, - array( - 'xml' => 'text/xml', - 'wie' => 'text/plain', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - ) - ); - - return $mimes; - } - - /** - * Different MIME type of different PHP version - * - * Filters the "real" file type of the given file. - * - * @since 1.8 - * - * @param array $defaults Default file types. - * @param string $file Full path to the file. - * @param string $filename The name of the file (may differ from $file due to $file being in a tmp directory). - * @param array $mimes Key is the file extension with value as the mime type. - */ - public static function check_real_mime_type( $defaults, $file, $filename, $mimes ) { - if ( 'content.xml' === $filename ) { - $defaults['ext'] = 'xml'; - $defaults['type'] = 'text/xml'; - } - - if ( 'widgets.wie' === $filename ) { - $defaults['ext'] = 'wie'; - $defaults['type'] = 'text/plain'; - } - - return $defaults; - } - - /** - * Download a file to WordPress from a URL. - * - * @since 1.6 - * - * @param string $file URL of the file. - * @return array - */ - public static function download_file( $file ) { - add_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); - add_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); - add_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); - - // Gives us access to the download_url() and wp_handle_sideload() functions. - require_once ABSPATH . 'wp-admin/includes/file.php'; - - // URL to the WordPress logo. - $url = $file; - $timeout_seconds = 10; - - // Download file to temp dir. - $temp_file = download_url( $url, $timeout_seconds ); - - if ( is_wp_error( $temp_file ) ) { - - return array( - 'success' => false, - 'data' => $temp_file->get_error_message(), - ); - - } - - // Array based on $_FILE as seen in PHP file uploads. - $file = array( - 'name' => basename( $url ), - 'tmp_name' => $temp_file, - 'error' => 0, - 'size' => filesize( $temp_file ), - ); - - $overrides = array( - 'test_form' => false, - 'test_size' => true, - ); - - // Move the temporary file into the uploads directory. - $results = wp_handle_sideload( $file, $overrides ); - - // Clean up. - remove_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); - remove_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); - remove_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); - - if ( empty( $results['error'] ) ) { - - return array( - 'success' => true, - 'data' => $results, - ); - - } else { - - return array( - 'success' => false, - 'error' => $results['error'], - ); - - } - - } - - /** - * Get data from the options.json file. - * - * @since 1.6 - * - * @param string $url URL of the file. - * @return array - */ - public static function get_options( $url ) { - $url = wp_safe_remote_get( esc_url( $url ) ); - - if ( is_wp_error( $url ) ) { - return false; - } - - return json_decode( wp_remote_retrieve_body( $url ), true ); - } - - /** - * Check to see if a remote file exists. - * - * @since 1.6 - * - * @param string $url URL of the file. - * @return bool - */ - public static function file_exists( $url ) { - $response = wp_safe_remote_get( esc_url( $url ) ); - - if ( is_wp_error( $response ) ) { - self::log( $response->get_error_message() ); - return false; - } - - return strlen( $response['body'] ) > 100 && ( '200' === (string) $response['response']['code'] || '301' === (string) $response['response']['code'] ) ? true : false; - } - - /** - * Log events to the debug.log file. - * - * @since 1.6 - * @param mixed $log Log data. - * @return void - */ - public static function log( $log ) { - if ( ! WP_DEBUG_LOG ) { - return; - } - - if ( is_array( $log ) || is_object( $log ) ) { - error_log( print_r( $log, true ) ); // phpcs:ignore -- Needed to log events. - } else { - error_log( $log ); // phpcs:ignore -- Needed to log events. - } - } - - /** - * Get all posts to run through batch processing. - * - * @since 1.6 - * - * @return object All posts. - */ - public static function get_all_posts() { - $args = array( - 'post_type' => 'any', - 'fields' => 'ids', - 'no_found_rows' => true, - 'post_status' => 'publish', - 'numberposts' => -1, - 'meta_query' => array( - 'relation' => 'OR', - array( - 'key' => '_fl_builder_data', - 'compare' => 'EXISTS', - ), - array( - 'key' => '_elementor_data', - 'compare' => 'EXISTS', - ), - ), - ); - - $posts = get_posts( $args ); - - if ( $posts ) { - return $posts; - } - - return false; - } - - /** - * Searches Elementor and Beaver Builder content for images to download. - * - * @since 1.6 - */ - public static function update_page_builder_content() { - include_once ABSPATH . 'wp-admin/includes/plugin.php'; - - // Add "bb-plugin" in import [queue]. - // Add "beaver-builder-lite-version" in import [queue]. - if ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) ) { - require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-beaver-builder-batch-processing.php'; - require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-site-import-image.php'; - - $beaver_builder = new GeneratePress_Sites_Process_Beaver_Builder(); - $beaver_builder->import(); - } - } - - /** - * Clear Elementor & Beaver Builder caches when needed. - * - * @since 1.6 - */ - public static function clear_page_builder_cache() { - - if ( class_exists( 'FLBuilderModel' ) && method_exists( 'FLBuilderModel', 'delete_asset_cache_for_all_posts' ) ) { - // Clear all cache. - FLBuilderModel::delete_asset_cache_for_all_posts(); - self::log( 'Cleared Beaver Builder cache.' ); - } - - if ( class_exists( 'Elementor\Plugin' ) && method_exists( 'Elementor\Posts_CSS_Manager', 'clear_cache' ) ) { - // !important, Clear the cache after images import. - Elementor\Plugin::instance()->posts_css_manager->clear_cache(); - self::log( 'Cleared Elementor cache.' ); - } - - } - - /** - * List out GP option names. - * - * @since 1.6 - * - * @return array - */ - public static function get_theme_settings() { - return array( - 'generate_settings', - 'generate_background_settings', - 'generate_blog_settings', - 'generate_page_header_settings', - 'generate_secondary_nav_settings', - 'generate_spacing_settings', - 'generate_menu_plus_settings', - 'generate_woocommerce_settings', - ); - } - - /** - * List out GP theme mods. - * - * @since 1.6 - * - * @return array - */ - public static function get_theme_mods() { - return array( - 'font_body_variants', - 'font_body_category', - 'font_site_title_variants', - 'font_site_title_category', - 'font_site_tagline_variants', - 'font_site_tagline_category', - 'font_navigation_variants', - 'font_navigation_category', - 'font_secondary_navigation_variants', - 'font_secondary_navigation_category', - 'font_buttons_variants', - 'font_buttons_category', - 'font_heading_1_variants', - 'font_heading_1_category', - 'font_heading_2_variants', - 'font_heading_2_category', - 'font_heading_3_variants', - 'font_heading_3_category', - 'font_heading_4_variants', - 'font_heading_4_category', - 'font_heading_5_variants', - 'font_heading_5_category', - 'font_heading_6_variants', - 'font_heading_6_category', - 'font_widget_title_variants', - 'font_widget_title_category', - 'font_footer_variants', - 'font_footer_category', - 'generate_copyright', - ); - } - - /** - * Build the loading icon. - * - * @since 1.6 - */ - public static function loading_icon() { - ?> - - - - - - - - - - - - - 'generate_package_backgrounds', - 'Blog' => 'generate_package_blog', - 'Colors' => 'generate_package_colors', - 'Copyright' => 'generate_package_copyright', - 'Elements' => 'generate_package_elements', - 'Disable Elements' => 'generate_package_disable_elements', - 'Hooks' => 'generate_package_hooks', - 'Menu Plus' => 'generate_package_menu_plus', - 'Page Header' => 'generate_package_page_header', - 'Secondary Nav' => 'generate_package_secondary_nav', - 'Sections' => 'generate_package_sections', - 'Spacing' => 'generate_package_spacing', - 'Typography' => 'generate_package_typography', - 'WooCommerce' => 'generate_package_woocommerce', - ); - } - - /** - * A list of options we shouldn't be able to touch. - */ - public static function disallowed_options() { - return array( - 'admin_email', - 'siteurl', - 'home', - 'blog_charset', - 'blog_public', - 'current_theme', - 'stylesheet', - 'template', - 'default_role', - 'mailserver_login', - 'mailserver_pass', - 'mailserver_port', - 'mailserver_url', - 'permalink_structure', - 'rewrite_rules', - 'users_can_register', - ); - } - - /** - * Track Imported Post - * - * @param int $post_id Post ID. - * @return void - */ - public static function track_post( $post_id ) { - update_post_meta( $post_id, '_generatepress_sites_imported_post', true ); - } - - /** - * Track Imported Term - * - * @param int $term_id Term ID. - * @return void - */ - public static function track_term( $term_id ) { - $term = get_term( $term_id ); - - update_term_meta( $term_id, '_generatepress_sites_imported_term', true ); - } - - /** - * Prevent WooCommerce from creating new pages if we're importing them. - * generate_woocommerce_no_create_pages is set during Site Library import. - */ - public static function woocommerce_no_new_pages() { - if ( ! function_exists( 'is_woocommerce' ) ) { - return; - } - - $woocommerce_version = get_option( 'woocommerce_db_version' ); - - if ( empty( $woocommerce_version ) ) { - $no_new_pages = get_option( 'generate_woocommerce_no_create_pages', false ); - - if ( $no_new_pages ) { - add_filter( 'woocommerce_create_pages', '__return_empty_array' ); - delete_option( 'generate_woocommerce_no_create_pages' ); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library-rest.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library-rest.php deleted file mode 100644 index 2f8e9284..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library-rest.php +++ /dev/null @@ -1,922 +0,0 @@ -namespace . $this->version; - - // Get Templates. - register_rest_route( - $namespace, - '/get_sites/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'get_sites' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/get_site_data/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'get_site_data' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/import_theme_options/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'import_options' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/activate_plugins/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'activate_plugins' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/import_content/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'import_content' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/import_site_options/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'import_site_options' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/import_widgets/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'import_widgets' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/restore_theme_options/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'restore_theme_options' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - - // Get Templates. - register_rest_route( - $namespace, - '/restore_content/', - array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'restore_content' ), - 'permission_callback' => array( $this, 'update_settings_permission' ), - ) - ); - } - - /** - * Get edit options permissions. - * - * @return bool - */ - public function update_settings_permission() { - return current_user_can( 'manage_options' ); - } - - /** - * Export a group of assets. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function get_sites( WP_REST_Request $request ) { - $force_refresh = $request->get_param( 'forceRefresh' ); - $sites = get_option( 'generatepress_sites', array() ); - - $time_now = strtotime( 'now' ); - $sites_expire = get_option( 'generatepress_sites_expiration', sanitize_text_field( $time_now ) ); - - if ( $force_refresh || empty( $sites ) || $sites_expire < $time_now ) { - $sites = array(); - - $data = wp_safe_remote_get( 'https://gpsites.co/wp-json/wp/v2/sites?per_page=100' ); - - if ( is_wp_error( $data ) ) { - update_option( 'generatepress_sites', 'no results', false ); - update_option( 'generatepress_sites_expiration', strtotime( '+5 minutes' ), false ); - return $this->failed( 'no results' ); - } - - $data = json_decode( wp_remote_retrieve_body( $data ), true ); - - if ( ! is_array( $data ) ) { - update_option( 'generatepress_sites', 'no results', false ); - update_option( 'generatepress_sites_expiration', strtotime( '+5 minutes' ), false ); - return $this->failed( 'no results' ); - } - - foreach ( (array) $data as $site ) { - $sites[ $site['name'] ] = array( - 'name' => $site['name'], - 'directory' => $site['directory'], - 'preview_url' => $site['preview_url'], - 'author_name' => $site['author_name'], - 'author_url' => $site['author_url'], - 'description' => $site['description'], - 'page_builder' => $site['page_builder'], - 'category' => $site['category'], - 'min_version' => $site['min_version'], - 'min_theme_version' => $site['min_theme_version'], - 'min_generateblocks_version' => $site['min_generateblocks_version'], - 'uploads_url' => $site['uploads_url'], - 'plugins' => $site['plugins'], - 'documentation' => $site['documentation'], - 'image_width' => ! empty( $site['image_width'] ) ? $site['image_width'] : 600, - 'image_height' => ! empty( $site['image_height'] ) ? $site['image_height'] : 600, - ); - } - - update_option( 'generatepress_sites', $sites, false ); - update_option( 'generatepress_sites_expiration', strtotime( '+1 day' ), false ); - } - - $sites = apply_filters( 'generate_add_sites', $sites ); - - return $this->success( $sites ); - } - - /** - * Export a group of assets. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function get_site_data( WP_REST_Request $request ) { - $site_data = $request->get_param( 'siteData' ); - - if ( GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/options.json' ) ) { - $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); - - $data['options'] = true; - $data['modules'] = $settings['modules']; - $data['plugins'] = $settings['plugins']; - - if ( is_array( $data['plugins'] ) ) { - include_once ABSPATH . 'wp-admin/includes/plugin.php'; - $plugin_data = array(); - - foreach ( $data['plugins'] as $name => $slug ) { - $basename = strtok( $slug, '/' ); - $plugin_data[ $name ] = array( - 'name' => $name, - 'slug' => $slug, - 'installed' => GeneratePress_Site_Library_Helper::is_plugin_installed( $slug ) ? true : false, - 'active' => is_plugin_active( $slug ) ? true : false, - 'repo' => GeneratePress_Site_Library_Helper::file_exists( 'https://api.wordpress.org/plugins/info/1.0/' . $basename ) ? true : false, - ); - } - - $data['plugin_data'] = $plugin_data; - } - } - - if ( GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/content.xml' ) ) { - $data['content'] = true; - } else { - $data['content'] = false; - } - - if ( GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/widgets.wie' ) ) { - $data['widgets'] = true; - } else { - $data['widgets'] = false; - } - - return $this->success( $data ); - } - - /** - * Export a group of assets. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function import_options( WP_REST_Request $request ) { - $site_data = $request->get_param( 'siteData' ); - - if ( ! GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/options.json' ) ) { - return $this->failed( 'No theme options exist.' ); - } - - // Delete existing backup. - delete_option( '_generatepress_site_library_backup' ); - - // Backup options. - $backup_data = get_option( '_generatepress_site_library_backup', array() ); - - $theme_mods = GeneratePress_Site_Library_Helper::get_theme_mods(); - $settings = GeneratePress_Site_Library_Helper::get_theme_settings(); - - $data = array( - 'mods' => array(), - 'options' => array(), - ); - - foreach ( $theme_mods as $theme_mod ) { - $data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); - } - - foreach ( $settings as $setting ) { - $data['options'][ $setting ] = get_option( $setting ); - } - - $backup_data['theme_options'] = $data; - - $modules = GeneratePress_Site_Library_Helper::premium_modules(); - - $active_modules = array(); - foreach ( $modules as $name => $key ) { - if ( 'activated' === get_option( $key ) ) { - $active_modules[ $name ] = $key; - } - } - - $backup_data['modules'] = $active_modules; - - $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); - - // Remove all existing theme options. - $option_keys = array( - 'generate_settings', - 'generate_background_settings', - 'generate_blog_settings', - 'generate_hooks', - 'generate_page_header_settings', - 'generate_secondary_nav_settings', - 'generate_spacing_settings', - 'generate_menu_plus_settings', - 'generate_woocommerce_settings', - ); - - foreach ( $option_keys as $key ) { - delete_option( $key ); - } - - // Need to backup these items before we remove all theme mods. - $backup_data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); - $backup_data['site_options']['custom_logo'] = get_theme_mod( 'custom_logo' ); - - // Remove existing theme mods. - remove_theme_mods(); - - // Remove existing activated premium modules. - $premium_modules = GeneratePress_Site_Library_Helper::premium_modules(); - - foreach ( $premium_modules as $name => $key ) { - delete_option( $key ); - } - - // Activate necessary modules. - foreach ( $settings['modules'] as $name => $key ) { - // Only allow valid premium modules. - if ( ! in_array( $key, $premium_modules ) ) { - GeneratePress_Site_Library_Helper::log( 'Bad premium module key: ' . $key ); - continue; - } - - update_option( $key, 'activated' ); - } - - // Set theme mods. - foreach ( $settings['mods'] as $key => $val ) { - // Only allow valid theme mods. - if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_mods() ) ) { - GeneratePress_Site_Library_Helper::log( 'Bad theme mod key: ' . $key ); - continue; - } - - set_theme_mod( $key, $val ); - } - - // Set theme options. - foreach ( $settings['options'] as $key => $val ) { - // Only allow valid options. - if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_settings() ) ) { - GeneratePress_Site_Library_Helper::log( 'Bad theme setting key: ' . $key ); - continue; - } - - if ( is_array( $val ) || is_object( $val ) ) { - foreach ( $val as $option_name => $option_value ) { - // Import any images. - if ( is_string( $option_value ) && preg_match( '/\.(jpg|jpeg|png|gif)/i', $option_value ) ) { - $data = GeneratePress_Site_Library_Helper::sideload_image( $option_value ); - - if ( ! is_wp_error( $data ) ) { - $val[ $option_name ] = $data->url; - } - } - - // Set these options if we import content. - unset( $val['hide_title'] ); - unset( $val['hide_tagline'] ); - unset( $val['logo_width'] ); - } - } - - update_option( $key, $val ); - } - - // Re-add non-theme option related theme mods. - set_theme_mod( 'nav_menu_locations', $backup_data['site_options']['nav_menu_locations'] ); - set_theme_mod( 'custom_logo', $backup_data['site_options']['custom_logo'] ); - - $existing_settings = get_option( 'generate_settings', array() ); - - if ( isset( $backup_data['theme_options']['options']['generate_settings']['hide_title'] ) ) { - $existing_settings['hide_title'] = $backup_data['theme_options']['options']['generate_settings']['hide_title']; - } - - if ( isset( $backup_data['theme_options']['options']['generate_settings']['hide_tagline'] ) ) { - $existing_settings['hide_tagline'] = $backup_data['theme_options']['options']['generate_settings']['hide_tagline']; - } - - if ( isset( $backup_data['theme_options']['options']['generate_settings']['logo_width'] ) ) { - $existing_settings['logo_width'] = $backup_data['theme_options']['options']['generate_settings']['logo_width']; - } - - update_option( 'generate_settings', $existing_settings ); - - // Remove dynamic CSS cache. - delete_option( 'generate_dynamic_css_output' ); - delete_option( 'generate_dynamic_css_cached_version' ); - - $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( isset( $dynamic_css_data['updated_time'] ) ) { - unset( $dynamic_css_data['updated_time'] ); - } - - update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); - - // Custom CSS. - $css = $settings['custom_css']; - $css = '/* GeneratePress Site CSS */ ' . $css . ' /* End GeneratePress Site CSS */'; - - $current_css = wp_get_custom_css_post(); - - if ( isset( $current_css->post_content ) ) { - $current_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $current_css->post_content ); - $css = $current_css->post_content . $css; - } - - wp_update_custom_css_post( $css ); - - update_option( '_generatepress_site_library_backup', $backup_data ); - - return $this->success( __( 'Options imported', 'gp-premium' ) ); - } - - /** - * Export a group of assets. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function activate_plugins( WP_REST_Request $request ) { - $site_data = $request->get_param( 'siteData' ); - $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); - $plugins = $settings['plugins']; - - // Backup plugins. - $backup_data = get_option( '_generatepress_site_library_backup', array() ); - $backup_data['plugins'] = get_option( 'active_plugins', array() ); - update_option( '_generatepress_site_library_backup', $backup_data ); - - if ( ! empty( $plugins ) ) { - $pro_plugins = GeneratePress_Site_Library_Helper::check_for_pro_plugins(); - include_once ABSPATH . 'wp-admin/includes/plugin.php'; - - foreach ( $plugins as $plugin ) { - // If the plugin has a pro version and it exists, activate it instead. - if ( array_key_exists( $plugin, $pro_plugins ) ) { - if ( file_exists( WP_PLUGIN_DIR . '/' . $pro_plugins[ $plugin ] ) ) { - $plugin = $pro_plugins[ $plugin ]; - } - } - - // Install BB lite if pro doesn't exist. - if ( 'bb-plugin/fl-builder.php' === $plugin && ! file_exists( WP_PLUGIN_DIR . '/bb-plugin/fl-builder.php' ) ) { - $plugin = 'beaver-builder-lite-version/fl-builder.php'; - } - - if ( ! is_plugin_active( $plugin ) ) { - activate_plugin( $plugin, '', false, true ); - - if ( 'woocommerce/woocommerce.php' === $plugin ) { - add_option( 'generate_woocommerce_no_create_pages', true ); - } - } - } - - return $this->success( __( 'Plugins activated', 'gp-premium' ) ); - } - } - - /** - * Export a group of assets. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function import_content( WP_REST_Request $request ) { - $site_data = $request->get_param( 'siteData' ); - $site_slug = $request->get_param( 'siteSlug' ); - $import_options = $request->get_param( 'importOptions' ); - $import_content = $request->get_param( 'importContent' ); - - // Increase PHP max execution time. - set_time_limit( apply_filters( 'generate_sites_content_import_time_limit', 300 ) ); - - $xml_path = $site_data['directory'] . '/content.xml'; - $xml_file = GeneratePress_Site_Library_Helper::download_file( $xml_path ); - $xml_path = $xml_file['data']['file']; - - if ( ! $xml_path ) { - return $this->failed( 'No content found.' ); - } - - // Increase PHP max execution time. - set_time_limit( apply_filters( 'generate_sites_content_import_time_limit', 300 ) ); - - // Disable import of authors. - add_filter( 'wxr_importer.pre_process.user', '__return_false' ); - - // Keep track of our progress. - add_action( 'wxr_importer.processed.post', array( 'GeneratePress_Site_Library_Helper', 'track_post' ) ); - add_action( 'wxr_importer.processed.term', array( 'GeneratePress_Site_Library_Helper', 'track_term' ) ); - - // Disables generation of multiple image sizes (thumbnails) in the content import step. - if ( ! apply_filters( 'generate_sites_regen_thumbnails', true ) ) { - add_filter( 'intermediate_image_sizes_advanced', '__return_null' ); - } - - $backup_data = get_option( '_generatepress_site_library_backup', array() ); - $backup_data['content'] = true; - update_option( '_generatepress_site_library_backup', $backup_data ); - - GeneratePress_Site_Library_Helper::import_xml( $xml_path, $site_slug ); - - return $this->success( 'Content imported' ); - } - - /** - * Export a group of assets. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function import_site_options( WP_REST_Request $request ) { - $site_data = $request->get_param( 'siteData' ); - $site_slug = $request->get_param( 'siteSlug' ); - $backup_data = get_option( '_generatepress_site_library_backup', array() ); - - $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); - - foreach ( $settings['site_options'] as $key => $val ) { - switch ( $key ) { - case 'page_for_posts': - case 'page_on_front': - $backup_data['site_options'][ $key ] = get_option( $key ); - GeneratePress_Site_Library_Helper::set_reading_pages( $key, $val, $site_slug ); - break; - - case 'woocommerce_shop_page_id': - case 'woocommerce_cart_page_id': - case 'woocommerce_checkout_page_id': - case 'woocommerce_myaccount_page_id': - $backup_data['site_options'][ $key ] = get_option( $key ); - GeneratePress_Site_Library_Helper::set_woocommerce_pages( $key, $val, $site_slug ); - break; - - case 'nav_menu_locations': - if ( ! isset( $backup_data['site_options']['nav_menu_location'] ) ) { - $backup_data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); - } - - GeneratePress_Site_Library_Helper::set_nav_menu_locations( $val ); - break; - - case 'element_locations': - GeneratePress_Site_Library_Helper::set_element_locations( $val, $site_slug ); - break; - - case 'element_exclusions': - GeneratePress_Site_Library_Helper::set_element_exclusions( $val, $site_slug ); - break; - - case 'custom_logo': - if ( ! isset( $backup_data['site_options']['custom_logo'] ) ) { - $backup_data['site_options']['custom_logo'] = get_theme_mod( 'custom_logo' ); - } - - $data = GeneratePress_Site_Library_Helper::sideload_image( $val ); - - if ( ! is_wp_error( $data ) && isset( $data->attachment_id ) ) { - set_theme_mod( 'custom_logo', $data->attachment_id ); - update_post_meta( $data->attachment_id, '_wp_attachment_is_custom_header', get_option( 'stylesheet' ) ); - } else { - remove_theme_mod( 'custom_logo' ); - } - - break; - - default: - if ( in_array( $key, (array) GeneratePress_Site_Library_Helper::disallowed_options() ) ) { - GeneratePress_Site_Library_Helper::log( 'Disallowed option: ' . $key ); - } else { - $backup_data['site_options'][ $key ] = get_option( $key ); - delete_option( $key ); - update_option( $key, $val ); - } - break; - } - } - - // Set theme options. - $theme_settings = get_option( 'generate_settings', array() ); - $update_theme_settings = false; - - foreach ( $settings['options'] as $key => $val ) { - if ( 'generate_settings' !== $key ) { - continue; - } - - if ( is_array( $val ) || is_object( $val ) ) { - foreach ( $val as $option_name => $option_value ) { - if ( 'hide_title' === $option_name ) { - $theme_settings['hide_title'] = $option_value; - $update_theme_settings = true; - } - - if ( 'hide_tagline' === $option_name ) { - $theme_settings['hide_tagline'] = $option_value; - $update_theme_settings = true; - } - - if ( 'logo_width' === $option_name ) { - $theme_settings['logo_width'] = $option_value; - $update_theme_settings = true; - } - } - } - } - - if ( $update_theme_settings ) { - update_option( 'generate_settings', $theme_settings ); - - // Remove dynamic CSS cache. - delete_option( 'generate_dynamic_css_output' ); - delete_option( 'generate_dynamic_css_cached_version' ); - - $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); - - if ( isset( $dynamic_css_data['updated_time'] ) ) { - unset( $dynamic_css_data['updated_time'] ); - } - - update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); - } - - // Set our backed up options. - update_option( '_generatepress_site_library_backup', $backup_data ); - - // Update any custom menu link URLs. - GeneratePress_Site_Library_Helper::update_menu_urls( $site_data['preview_url'] ); - - // Clear page builder cache. - GeneratePress_Site_Library_Helper::clear_page_builder_cache(); - - return $this->success( 'Site options imported' ); - } - - /** - * Export a group of assets. - * - * @param WP_REST_Request $request request object. - * - * @return mixed - */ - public function import_widgets( WP_REST_Request $request ) { - $site_data = $request->get_param( 'siteData' ); - - require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-site-widget-importer.php'; - - $widgets_path = $site_data['directory'] . '/widgets.wie'; - - $wie_file = GeneratePress_Site_Library_Helper::download_file( $widgets_path ); - $wie_path = $wie_file['data']['file']; - - $data = implode( '', file( $wie_path ) ); - $data = json_decode( $data ); - - GeneratePress_Site_Library_Helper::clear_widgets(); - - add_filter( 'wie_widget_settings_array', array( 'GeneratePress_Site_Library_Helper', 'fix_custom_menu_widget_ids' ) ); - $widgets_importer = GeneratePress_Sites_Widget_Importer::instance(); - $widgets_importer->wie_import_data( $data ); - remove_filter( 'wie_widget_settings_array', array( 'GeneratePress_Site_Library_Helper', 'fix_custom_menu_widget_ids' ) ); - - return $this->success( 'Widgets imported' ); - } - - /** - * Restore our theme options. - */ - public function restore_theme_options() { - $backup_data = get_option( '_generatepress_site_library_backup', array() ); - - if ( ! empty( $backup_data ) ) { - if ( ! empty( $backup_data['theme_options']['mods'] ) ) { - remove_theme_mods(); - } - - if ( ! empty( $backup_data['theme_options']['options'] ) ) { - $option_keys = array( - 'generate_settings', - 'generate_background_settings', - 'generate_blog_settings', - 'generate_hooks', - 'generate_page_header_settings', - 'generate_secondary_nav_settings', - 'generate_spacing_settings', - 'generate_menu_plus_settings', - 'generate_woocommerce_settings', - ); - - foreach ( $option_keys as $key ) { - delete_option( $key ); - } - } - - if ( ! empty( $backup_data['modules'] ) ) { - $modules = GeneratePress_Site_Library_Helper::premium_modules(); - - foreach ( $modules as $name => $key ) { - delete_option( $key ); - } - - foreach ( (array) $backup_data['modules'] as $name => $key ) { - update_option( $key, 'activated' ); - } - } - - if ( ! empty( $backup_data['theme_options']['mods'] ) ) { - foreach ( $backup_data['theme_options']['mods'] as $key => $val ) { - // Only allow valid theme mods. - if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_mods() ) ) { - GeneratePress_Site_Library_Helper::log( 'Bad theme mod key: ' . $key ); - continue; - } - - set_theme_mod( $key, $val ); - } - } - - if ( ! empty( $backup_data['theme_options']['options'] ) ) { - foreach ( $backup_data['theme_options']['options'] as $key => $val ) { - // Only allow valid options. - if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_settings() ) ) { - GeneratePress_Site_Library_Helper::log( 'Bad theme setting key: ' . $key ); - continue; - } - - update_option( $key, $val ); - } - } - - // Re-add non-theme option related theme mods. - if ( isset( $backup_data['site_options']['nav_menu_locations'] ) ) { - set_theme_mod( 'nav_menu_locations', $backup_data['site_options']['nav_menu_locations'] ); - } - - if ( isset( $backup_data['site_options']['custom_logo'] ) ) { - set_theme_mod( 'custom_logo', $backup_data['site_options']['custom_logo'] ); - } - } - - return $this->success( __( 'Theme options restored.', 'gp-premium' ) ); - } - - /** - * Restore content. - */ - public function restore_content() { - $backup_data = get_option( '_generatepress_site_library_backup', array() ); - - // Plugins. - if ( ! empty( $backup_data['plugins'] ) && ! empty( $backup_data['site_options'] ) ) { - update_option( 'active_plugins', $backup_data['plugins'] ); - } - - // Content. - if ( ! empty( $backup_data ) ) { - global $wpdb; - $post_ids = $wpdb->get_col( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_generatepress_sites_imported_post'" ); - $term_ids = $wpdb->get_col( "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='_generatepress_sites_imported_term'" ); - - foreach ( $post_ids as $id ) { - wp_delete_post( $id, true ); - } - } - - // Site options. - if ( ! empty( $backup_data['site_options'] ) ) { - foreach ( $backup_data['site_options'] as $key => $val ) { - if ( in_array( $key, (array) GeneratePress_Site_Library_Helper::disallowed_options() ) ) { - GeneratePress_Site_Library_Helper::log( 'Disallowed option: ' . $key ); - continue; - } - - if ( 'nav_menu_locations' === $key || 'custom_logo' === $key ) { - set_theme_mod( $key, $val ); - } else { - if ( ! $val && ! is_numeric( $val ) ) { - delete_option( $key ); - } else { - update_option( $key, $val ); - } - } - } - } - - // Widgets. - if ( ! empty( $backup_data['widgets'] ) ) { - update_option( 'sidebars_widgets', $backup_data['widgets'] ); - } - - // CSS. - $current_css = wp_get_custom_css_post(); - - if ( isset( $current_css->post_content ) ) { - // Remove existing library CSS. - $current_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $current_css->post_content ); - } - - wp_update_custom_css_post( $current_css->post_content ); - - // Clean up. - delete_option( 'generate_dynamic_css_output' ); - delete_option( 'generate_dynamic_css_cached_version' ); - delete_option( '_generatepress_site_library_backup' ); - - return $this->success( __( 'Content restored.', 'gp-premium' ) ); - } - - /** - * Success rest. - * - * @param mixed $response response data. - * @return mixed - */ - public function success( $response ) { - return new WP_REST_Response( - array( - 'success' => true, - 'response' => $response, - ), - 200 - ); - } - - /** - * Failed rest. - * - * @param mixed $response response data. - * @return mixed - */ - public function failed( $response ) { - return new WP_REST_Response( - array( - 'success' => false, - 'response' => $response, - ), - 200 - ); - } - - /** - * Error rest. - * - * @param mixed $code error code. - * @param mixed $response response data. - * @return mixed - */ - public function error( $code, $response ) { - return new WP_REST_Response( - array( - 'error' => true, - 'success' => false, - 'error_code' => $code, - 'response' => $response, - ), - 401 - ); - } -} - -GeneratePress_Site_Library_Rest::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library.php deleted file mode 100644 index e29438c6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library.php +++ /dev/null @@ -1,412 +0,0 @@ -id ) { - $parent_file = 'themes.php'; // phpcs:ignore -- Override necessary. - $submenu_file = 'generate-options'; // phpcs:ignore -- Override necessary. - } - - remove_submenu_page( 'themes.php', 'generatepress-library' ); - } - - /** - * Add our scripts. - */ - public function enqueue_scripts() { - $screen = get_current_screen(); - - if ( 'appearance_page_generatepress-library' === $screen->id ) { - wp_enqueue_script( - 'generatepress-pro-site-library', - GP_PREMIUM_DIR_URL . 'dist/site-library.js', - array( 'wp-api', 'wp-i18n', 'wp-components', 'wp-element', 'wp-api-fetch', 'wp-util', 'wp-html-entities', 'updates' ), - GP_PREMIUM_VERSION, - true - ); - - if ( function_exists( 'wp_set_script_translations' ) ) { - wp_set_script_translations( 'generatepress-pro-site-library', 'gp-premium', GP_PREMIUM_DIR_PATH . 'langs' ); - } - - if ( function_exists( 'wp_get_upload_dir' ) ) { - $uploads_url = wp_get_upload_dir(); - } else { - $uploads_url = wp_upload_dir( null, false ); - } - - wp_localize_script( - 'generatepress-pro-site-library', - 'gppSiteLibrary', - array( - 'homeUrl' => esc_url( home_url() ), - 'hasBackup' => ! empty( get_option( '_generatepress_site_library_backup', array() ) ), - 'gppVersion' => GP_PREMIUM_VERSION, - 'gpVersion' => generate_premium_get_theme_version(), - 'generateblocksVersion' => defined( 'GENERATEBLOCKS_VERSION' ) ? GENERATEBLOCKS_VERSION : '', - 'elementorReplaceUrls' => esc_url( admin_url( 'admin.php?page=elementor-tools#tab-replace_url' ) ), - 'uploadsUrl' => $uploads_url['baseurl'], - 'isDebugEnabled' => defined( 'WP_DEBUG' ) && true === WP_DEBUG, - ) - ); - - wp_enqueue_style( - 'generatepress-pro-site-library', - GP_PREMIUM_DIR_URL . 'dist/site-library.css', - array( 'wp-components' ), - GP_PREMIUM_VERSION - ); - - if ( ! class_exists( 'GeneratePress_Dashboard' ) ) { - wp_enqueue_style( - 'generate-premium-dashboard', - GP_PREMIUM_DIR_URL . 'inc/legacy/assets/dashboard.css', - array(), - GP_PREMIUM_VERSION - ); - } - } - } - - /** - * Add our page. - */ - public function library_page() { - if ( ! class_exists( 'GeneratePress_Dashboard' ) ) : - ?> -
          -
          -
          - -
          - - -
          -
          - - -
          - __( 'Site Library', 'gp-premium' ), - 'url' => admin_url( 'themes.php?page=generatepress-library' ), - 'class' => 'appearance_page_generatepress-library' === $screen->id ? 'active' : '', - ); - - return $tabs; - } - - /** - * Tell GeneratePress this is an admin page. - * - * @param array $screens Existing screens. - */ - public function add_dashboard_screen( $screens ) { - $screens[] = 'appearance_page_generatepress-library'; - - return $screens; - } - - /** - * Add our GeneratePress Site export checkbox to the Export module. - */ - public function add_export_checkbox() { - if ( ! apply_filters( 'generate_show_generatepress_site_export_option', false ) ) { - return; - } - ?> -
          - - - $key ) { - if ( 'activated' === get_option( $key ) ) { - $data['modules'][ $name ] = $key; - } - } - - // Site options. - $data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); - $data['site_options']['custom_logo'] = wp_get_attachment_url( get_theme_mod( 'custom_logo' ) ); - $data['site_options']['show_on_front'] = get_option( 'show_on_front' ); - $data['site_options']['page_on_front'] = get_option( 'page_on_front' ); - $data['site_options']['page_for_posts'] = get_option( 'page_for_posts' ); - - // Elements. - $data['site_options']['element_locations'] = $this->get_elements_locations(); - $data['site_options']['element_exclusions'] = $this->get_elements_exclusions(); - - // Custom CSS. - if ( function_exists( 'wp_get_custom_css_post' ) ) { - $data['custom_css'] = wp_get_custom_css_post()->post_content; - } - - // WooCommerce. - if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { - $data['site_options']['woocommerce_shop_page_id'] = get_option( 'woocommerce_shop_page_id' ); - $data['site_options']['woocommerce_cart_page_id'] = get_option( 'woocommerce_cart_page_id' ); - $data['site_options']['woocommerce_checkout_page_id'] = get_option( 'woocommerce_checkout_page_id' ); - $data['site_options']['woocommerce_myaccount_page_id'] = get_option( 'woocommerce_myaccount_page_id' ); - $data['site_options']['woocommerce_single_image_width'] = get_option( 'woocommerce_single_image_width' ); - $data['site_options']['woocommerce_thumbnail_image_width'] = get_option( 'woocommerce_thumbnail_image_width' ); - $data['site_options']['woocommerce_thumbnail_cropping'] = get_option( 'woocommerce_thumbnail_cropping' ); - $data['site_options']['woocommerce_shop_page_display'] = get_option( 'woocommerce_shop_page_display' ); - $data['site_options']['woocommerce_category_archive_display'] = get_option( 'woocommerce_category_archive_display' ); - $data['site_options']['woocommerce_default_catalog_orderby'] = get_option( 'woocommerce_default_catalog_orderby' ); - } - - // Elementor. - if ( is_plugin_active( 'elementor/elementor.php' ) ) { - $data['site_options']['elementor_container_width'] = get_option( 'elementor_container_width' ); - $data['site_options']['elementor_cpt_support'] = get_option( 'elementor_cpt_support' ); - $data['site_options']['elementor_css_print_method'] = get_option( 'elementor_css_print_method' ); - $data['site_options']['elementor_default_generic_fonts'] = get_option( 'elementor_default_generic_fonts' ); - $data['site_options']['elementor_disable_color_schemes'] = get_option( 'elementor_disable_color_schemes' ); - $data['site_options']['elementor_disable_typography_schemes'] = get_option( 'elementor_disable_typography_schemes' ); - $data['site_options']['elementor_editor_break_lines'] = get_option( 'elementor_editor_break_lines' ); - $data['site_options']['elementor_exclude_user_roles'] = get_option( 'elementor_exclude_user_roles' ); - $data['site_options']['elementor_global_image_lightbox'] = get_option( 'elementor_global_image_lightbox' ); - $data['site_options']['elementor_page_title_selector'] = get_option( 'elementor_page_title_selector' ); - $data['site_options']['elementor_scheme_color'] = get_option( 'elementor_scheme_color' ); - $data['site_options']['elementor_scheme_color-picker'] = get_option( 'elementor_scheme_color-picker' ); - $data['site_options']['elementor_scheme_typography'] = get_option( 'elementor_scheme_typography' ); - $data['site_options']['elementor_space_between_widgets'] = get_option( 'elementor_space_between_widgets' ); - $data['site_options']['elementor_stretched_section_container'] = get_option( 'elementor_stretched_section_container' ); - $data['site_options']['elementor_load_fa4_shim'] = get_option( 'elementor_load_fa4_shim' ); - $data['site_options']['elementor_active_kit'] = get_option( 'elementor_active_kit' ); - } - - // Beaver Builder. - if ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) ) { - $data['site_options']['_fl_builder_enabled_icons'] = get_option( '_fl_builder_enabled_icons' ); - $data['site_options']['_fl_builder_enabled_modules'] = get_option( '_fl_builder_enabled_modules' ); - $data['site_options']['_fl_builder_post_types'] = get_option( '_fl_builder_post_types' ); - $data['site_options']['_fl_builder_color_presets'] = get_option( '_fl_builder_color_presets' ); - $data['site_options']['_fl_builder_services'] = get_option( '_fl_builder_services' ); - $data['site_options']['_fl_builder_settings'] = get_option( '_fl_builder_settings' ); - $data['site_options']['_fl_builder_user_access'] = get_option( '_fl_builder_user_access' ); - $data['site_options']['_fl_builder_enabled_templates'] = get_option( '_fl_builder_enabled_templates' ); - } - - // Menu Icons. - if ( is_plugin_active( 'menu-icons/menu-icons.php' ) ) { - $data['site_options']['menu-icons'] = get_option( 'menu-icons' ); - } - - // Ninja Forms. - if ( is_plugin_active( 'ninja-forms/ninja-forms.php' ) ) { - $data['site_options']['ninja_forms_settings'] = get_option( 'ninja_forms_settings' ); - } - - // Social Warfare. - if ( is_plugin_active( 'social-warfare/social-warfare.php' ) ) { - $data['site_options']['socialWarfareOptions'] = get_option( 'socialWarfareOptions' ); - } - - // Elements Plus. - if ( is_plugin_active( 'elements-plus/elements-plus.php' ) ) { - $data['site_options']['elements_plus_settings'] = get_option( 'elements_plus_settings' ); - } - - // Ank Google Map. - if ( is_plugin_active( 'ank-google-map/ank-google-map.php' ) ) { - $data['site_options']['ank_google_map'] = get_option( 'ank_google_map' ); - } - - // GP Social Share. - if ( is_plugin_active( 'gp-social-share-svg/gp-social-share.php' ) ) { - $data['site_options']['gp_social_settings'] = get_option( 'gp_social_settings' ); - } - - // Active plugins. - $active_plugins = get_option( 'active_plugins' ); - $all_plugins = get_plugins(); - - $ignore = apply_filters( - 'generate_sites_ignore_plugins', - array( - 'gp-premium/gp-premium.php', - 'widget-importer-exporter/widget-importer-exporter.php', - ) - ); - - foreach ( $ignore as $plugin ) { - unset( $all_plugins[ $plugin ] ); - } - - $activated_plugins = array(); - - foreach ( $active_plugins as $p ) { - if ( isset( $all_plugins[ $p ] ) ) { - $activated_plugins[ $all_plugins[ $p ]['Name'] ] = $p; - } - } - - $data['plugins'] = $activated_plugins; - - return $data; - - } - - /** - * Get our Element display locations. - * - * @return array - */ - public function get_elements_locations() { - $args = array( - 'post_type' => 'gp_elements', - 'showposts' => -1, - ); - - $posts = get_posts( $args ); - $new_values = array(); - - foreach ( $posts as $post ) { - $display_conditions = get_post_meta( $post->ID, '_generate_element_display_conditions', true ); - - if ( $display_conditions ) { - $new_values[ $post->ID ] = $display_conditions; - } - } - - return $new_values; - } - - /** - * Get our Element display locations. - * - * @return array - */ - public function get_elements_exclusions() { - $args = array( - 'post_type' => 'gp_elements', - 'showposts' => -1, - ); - - $posts = get_posts( $args ); - $new_values = array(); - - foreach ( $posts as $post ) { - $display_conditions = get_post_meta( $post->ID, '_generate_element_exclude_conditions', true ); - - if ( $display_conditions ) { - $new_values[ $post->ID ] = $display_conditions; - } - } - - return $new_values; - } -} - -GeneratePress_Site_Library::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-beaver-builder-batch-processing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-beaver-builder-batch-processing.php deleted file mode 100644 index 6ec1cbdc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-beaver-builder-batch-processing.php +++ /dev/null @@ -1,163 +0,0 @@ -image_importer = new GeneratePress_Sites_Image_Importer(); - } - - /** - * Import - * - * @since 1.6 - * @return void - */ - public function import() { - GeneratePress_Site_Library_Helper::log( '== Start Processing Beaver Builder Images ==' ); - - $post_ids = GeneratePress_Site_Library_Helper::get_all_posts(); - - if ( is_array( $post_ids ) ) { - foreach ( $post_ids as $post_id ) { - $this->import_single_post( $post_id ); - } - } - } - - /** - * Update post meta. - * - * @param integer $post_id Post ID. - * @return void - */ - public function import_single_post( $post_id = 0 ) { - - if ( ! empty( $post_id ) ) { - - // Get page builder data. - $data = get_post_meta( $post_id, '_fl_builder_data', true ); - - if ( ! empty( $data ) ) { - foreach ( $data as $key => $el ) { - // Import background images. - if ( 'row' === $el->type || 'column' === $el->type ) { - $data[ $key ]->settings = $this->import_background_images( $el->settings ); - } - - // Import module images. - if ( 'module' === $el->type ) { - $data[ $key ]->settings = $this->import_module_images( $el->settings ); - } - } - - // Update page builder data. - update_post_meta( $post_id, '_fl_builder_data', $data ); - update_post_meta( $post_id, '_fl_builder_draft', $data ); - - // Clear all cache. - FLBuilderModel::delete_asset_cache_for_all_posts(); - } - } - } - - /** - * Import Module Images. - * - * @param object $settings Module settings object. - * @return object - */ - public function import_module_images( $settings ) { - - /** - * 1) Set photos. - */ - $settings = $this->import_photo( $settings ); - - /** - * 2) Set `$settings->data` for Only type 'image-icon' - * - * @todo Remove the condition `'image-icon' === $settings->type` if `$settings->data` is used only for the Image Icon. - */ - if ( isset( $settings->data ) && isset( $settings->photo ) && ! empty( $settings->photo ) && 'image-icon' === $settings->type ) { - $settings->data = FLBuilderPhoto::get_attachment_data( $settings->photo ); - } - - /** - * 3) Set `list item` module images - */ - if ( isset( $settings->add_list_item ) ) { - foreach ( $settings->add_list_item as $key => $value ) { - $settings->add_list_item[ $key ] = $this->import_photo( $value ); - } - } - - return $settings; - } - - /** - * Helper: Import BG Images. - * - * @param object $settings Row settings object. - * @return object - */ - public function import_background_images( $settings ) { - - if ( ! empty( $settings->bg_image ) && ! empty( $settings->bg_image_src ) ) { - $image = array( - 'url' => $settings->bg_image_src, - 'id' => $settings->bg_image, - ); - - $downloaded_image = $this->image_importer->import( $image ); - - $settings->bg_image_src = $downloaded_image['url']; - $settings->bg_image = $downloaded_image['id']; - } - - return $settings; - } - - /** - * Helper: Import Photo. - * - * @param object $settings Row settings object. - * @return object - */ - public function import_photo( $settings ) { - - if ( ! empty( $settings->photo ) && ! empty( $settings->photo_src ) ) { - $image = array( - 'url' => $settings->photo_src, - 'id' => $settings->photo, - ); - - $downloaded_image = $this->image_importer->import( $image ); - - $settings->photo_src = $downloaded_image['url']; - $settings->photo = $downloaded_image['id']; - } - - return $settings; - } - - -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-content-importer.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-content-importer.php deleted file mode 100644 index f2198499..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-content-importer.php +++ /dev/null @@ -1,49 +0,0 @@ -mapping['user_slug'][ $current_user_obj->user_login ] = $current_user_obj->ID; - } - - /** - * Get all protected variables from the WXR_Importer needed for continuing the import. - */ - public function get_importer_data() { - return array( - 'mapping' => $this->mapping, - ); - } - - /** - * Sets all protected variables from the WXR_Importer needed for continuing the import. - * - * @param array $data with set variables. - */ - public function set_importer_data( $data ) { - // phpcs:ignore -- Commented out code for now. - // $this->mapping = empty( $data['mapping'] ) ? array() : $data['mapping']; - // $this->requires_remapping = empty( $data['requires_remapping'] ) ? array() : $data['requires_remapping']; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-import-image.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-import-image.php deleted file mode 100644 index bd8226fe..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-import-image.php +++ /dev/null @@ -1,200 +0,0 @@ - $attachment ) { - $downloaded_images[] = $this->import( $attachment ); - } - - return $downloaded_images; - } - - /** - * Get Hash Image. - * - * @since 1.6 - * @param string $attachment_url Attachment URL. - * @return string Hash string. - */ - private function get_hash_image( $attachment_url ) { - return sha1( $attachment_url ); - } - - /** - * Get Saved Image. - * - * @since 1.6 - * @param string $attachment Attachment Data. - * @return string Hash string. - */ - private function get_saved_image( $attachment ) { - - global $wpdb; - - // Already imported? Then return! - if ( isset( $this->already_imported_ids[ $attachment['id'] ] ) ) { - GeneratePress_Site_Library_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); - - return $this->already_imported_ids[ $attachment['id'] ]; - } - - // 1. Is already imported in Batch Import Process? - $post_id = $wpdb->get_var( - $wpdb->prepare( - 'SELECT `post_id` FROM `' . $wpdb->postmeta . '` - WHERE `meta_key` = \'_generatepress_sites_image_hash\' - AND `meta_value` = %s - ;', - $this->get_hash_image( $attachment['url'] ) - ) - ); - - // 2. Is image already imported though XML? - if ( empty( $post_id ) ) { - // Get file name without extension. - // To check it exist in attachment. - $filename = preg_replace( '/\\.[^.\\s]{3,4}$/', '', basename( $attachment['url'] ) ); - - $post_id = $wpdb->get_var( - $wpdb->prepare( - 'SELECT `post_id` FROM `' . $wpdb->postmeta . '` - WHERE `meta_key` = \'_wp_attached_file\' - AND `meta_value` LIKE %s - ;', - '%' . $filename . '%' - ) - ); - - GeneratePress_Site_Library_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); - } - - if ( $post_id ) { - $new_attachment = array( - 'id' => $post_id, - 'url' => wp_get_attachment_url( $post_id ), - ); - - $this->already_imported_ids[ $attachment['id'] ] = $new_attachment; - - return $new_attachment; - } - - return false; - } - - /** - * Import Image - * - * @since 1.6 - * @param array $attachment Attachment array. - * @return array Attachment array. - */ - public function import( $attachment ) { - - $saved_image = $this->get_saved_image( $attachment ); - - if ( $saved_image ) { - return $saved_image; - } - - $file_content = wp_remote_retrieve_body( wp_safe_remote_get( $attachment['url'] ) ); - - // Empty file content? - if ( empty( $file_content ) ) { - GeneratePress_Site_Library_Helper::log( 'Failed to replace: ' . $attachment['url'] ); - GeneratePress_Site_Library_Helper::log( 'Error: Failed wp_remote_retrieve_body().' ); - - return $attachment; - } - - // Extract the file name and extension from the URL. - $filename = basename( $attachment['url'] ); - - $upload = wp_upload_bits( - $filename, - null, - $file_content - ); - - $post = array( - 'post_title' => $filename, - 'guid' => $upload['url'], - ); - - $info = wp_check_filetype( $upload['file'] ); - - if ( $info ) { - $post['post_mime_type'] = $info['type']; - } else { - // For now just return the origin attachment. - return $attachment; - } - - $post_id = wp_insert_attachment( $post, $upload['file'] ); - - wp_update_attachment_metadata( - $post_id, - wp_generate_attachment_metadata( $post_id, $upload['file'] ) - ); - - update_post_meta( $post_id, '_generatepress_sites_image_hash', $this->get_hash_image( $attachment['url'] ) ); - - $new_attachment = array( - 'id' => $post_id, - 'url' => $upload['url'], - ); - - GeneratePress_Site_Library_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); - - $this->already_imported_ids[ $attachment['id'] ] = $new_attachment; - - return $new_attachment; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-widget-importer.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-widget-importer.php deleted file mode 100644 index ed1b611a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-widget-importer.php +++ /dev/null @@ -1,275 +0,0 @@ - true, - ) - ); - } - - // Hook before import. - do_action( 'wie_before_import' ); // phpcs:ignore -- Keep the plugin prefix. - - $data = apply_filters( 'wie_import_data', $data ); // phpcs:ignore -- Keep the plugin prefix. - - // Get all available widgets site supports. - $available_widgets = $this->wie_available_widgets(); - - // Get all existing widget instances. - $widget_instances = array(); - - foreach ( $available_widgets as $widget_data ) { - $widget_instances[ $widget_data['id_base'] ] = get_option( 'widget_' . $widget_data['id_base'] ); - } - - // Begin results. - $results = array(); - - // Loop import data's sidebars. - foreach ( $data as $sidebar_id => $widgets ) { - // Skip inactive widgets (should not be in export file). - if ( 'wp_inactive_widgets' === $sidebar_id ) { - continue; - } - - // Check if sidebar is available on this site. - // Otherwise add widgets to inactive, and say so. - if ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ) { - $sidebar_available = true; - $use_sidebar_id = $sidebar_id; - $sidebar_message_type = 'success'; - $sidebar_message = ''; - } else { - $sidebar_available = false; - $use_sidebar_id = 'wp_inactive_widgets'; // Add to inactive if sidebar does not exist in theme. - $sidebar_message_type = 'error'; - $sidebar_message = esc_html__( 'Widget area does not exist in theme (using Inactive)', 'widget-importer-exporter' ); - } - - // Result for sidebar - // Sidebar name if theme supports it; otherwise ID. - $results[ $sidebar_id ]['name'] = ! empty( $wp_registered_sidebars[ $sidebar_id ]['name'] ) ? $wp_registered_sidebars[ $sidebar_id ]['name'] : $sidebar_id; - $results[ $sidebar_id ]['message_type'] = $sidebar_message_type; - $results[ $sidebar_id ]['message'] = $sidebar_message; - $results[ $sidebar_id ]['widgets'] = array(); - - // Loop widgets. - foreach ( $widgets as $widget_instance_id => $widget ) { - $fail = false; - - // Get id_base (remove -# from end) and instance ID number. - $id_base = preg_replace( '/-[0-9]+$/', '', $widget_instance_id ); - $instance_id_number = str_replace( $id_base . '-', '', $widget_instance_id ); - - // Does site support this widget? - if ( ! $fail && ! isset( $available_widgets[ $id_base ] ) ) { - $fail = true; - $widget_message_type = 'error'; - $widget_message = esc_html__( 'Site does not support widget', 'widget-importer-exporter' ); // Explain why widget not imported. - } - - // Filter to modify settings object before conversion to array and import - // Leave this filter here for backwards compatibility with manipulating objects (before conversion to array below) - // Ideally the newer wie_widget_settings_array below will be used instead of this. - $widget = apply_filters( 'wie_widget_settings', $widget ); // phpcs:ignore -- Keep the plugin prefix. - - // Convert multidimensional objects to multidimensional arrays - // Some plugins like Jetpack Widget Visibility store settings as multidimensional arrays - // Without this, they are imported as objects and cause fatal error on Widgets page - // If this creates problems for plugins that do actually intend settings in objects then may need to consider other approach: https://wordpress.org/support/topic/problem-with-array-of-arrays - // It is probably much more likely that arrays are used than objects, however. - $widget = json_decode( wp_json_encode( $widget ), true ); - - // Filter to modify settings array - // This is preferred over the older wie_widget_settings filter above - // Do before identical check because changes may make it identical to end result (such as URL replacements). - $widget = apply_filters( 'wie_widget_settings_array', $widget ); // phpcs:ignore -- Keep the plugin prefix. - - // Does widget with identical settings already exist in same sidebar? - if ( ! $fail && isset( $widget_instances[ $id_base ] ) ) { - // Get existing widgets in this sidebar. - $sidebars_widgets = get_option( 'sidebars_widgets' ); - $sidebar_widgets = isset( $sidebars_widgets[ $use_sidebar_id ] ) ? $sidebars_widgets[ $use_sidebar_id ] : array(); // Check Inactive if that's where will go. - - // Loop widgets with ID base. - $single_widget_instances = ! empty( $widget_instances[ $id_base ] ) ? $widget_instances[ $id_base ] : array(); - - foreach ( $single_widget_instances as $check_id => $check_widget ) { - // Is widget in same sidebar and has identical settings? - if ( in_array( "$id_base-$check_id", $sidebar_widgets, true ) && (array) $widget === $check_widget ) { - $fail = true; - $widget_message_type = 'warning'; - // Explain why widget not imported. - $widget_message = esc_html__( 'Widget already exists', 'widget-importer-exporter' ); - break; - } - } - } - - // No failure. - if ( ! $fail ) { - // Add widget instance. - $single_widget_instances = get_option( 'widget_' . $id_base ); // All instances for that widget ID base, get fresh every time. - - $single_widget_instances = ! empty( $single_widget_instances ) ? $single_widget_instances : array( - '_multiwidget' => 1, // Start fresh if have to. - ); - - $single_widget_instances[] = $widget; // Add it. - - // Get the key it was given. - end( $single_widget_instances ); - - $new_instance_id_number = key( $single_widget_instances ); - - // If key is 0, make it 1 - // When 0, an issue can occur where adding a widget causes data from other widget to load, - // and the widget doesn't stick (reload wipes it). - if ( '0' === strval( $new_instance_id_number ) ) { - $new_instance_id_number = 1; - $single_widget_instances[ $new_instance_id_number ] = $single_widget_instances[0]; - unset( $single_widget_instances[0] ); - } - - // Move _multiwidget to end of array for uniformity. - if ( isset( $single_widget_instances['_multiwidget'] ) ) { - $multiwidget = $single_widget_instances['_multiwidget']; - unset( $single_widget_instances['_multiwidget'] ); - $single_widget_instances['_multiwidget'] = $multiwidget; - } - - // Update option with new widget. - update_option( 'widget_' . $id_base, $single_widget_instances ); - - // Assign widget instance to sidebar. - // Which sidebars have which widgets, get fresh every time. - $sidebars_widgets = get_option( 'sidebars_widgets' ); - - // Avoid rarely fatal error when the option is an empty string - // https://github.com/stevengliebe/widget-importer-exporter/pull/11. - if ( ! $sidebars_widgets ) { - $sidebars_widgets = array(); - } - - // Use ID number from new widget instance. - $new_instance_id = $id_base . '-' . $new_instance_id_number; - - // Add new instance to sidebar. - $sidebars_widgets[ $use_sidebar_id ][] = $new_instance_id; - - // Save the amended data. - update_option( 'sidebars_widgets', $sidebars_widgets ); - - // After widget import action. - $after_widget_import = array( - 'sidebar' => $use_sidebar_id, - 'sidebar_old' => $sidebar_id, - 'widget' => $widget, - 'widget_type' => $id_base, - 'widget_id' => $new_instance_id, - 'widget_id_old' => $widget_instance_id, - 'widget_id_num' => $new_instance_id_number, - 'widget_id_num_old' => $instance_id_number, - ); - - do_action( 'wie_after_widget_import', $after_widget_import ); // phpcs:ignore -- Keep the plugin prefix. - - // Success message. - if ( $sidebar_available ) { - $widget_message_type = 'success'; - $widget_message = esc_html__( 'Imported', 'widget-importer-exporter' ); - } else { - $widget_message_type = 'warning'; - $widget_message = esc_html__( 'Imported to Inactive', 'widget-importer-exporter' ); - } - } - - // Result for widget instance. - $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['name'] = isset( $available_widgets[ $id_base ]['name'] ) ? $available_widgets[ $id_base ]['name'] : $id_base; // Widget name or ID if name not available (not supported by site). - $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['title'] = ! empty( $widget['title'] ) ? $widget['title'] : esc_html__( 'No Title', 'widget-importer-exporter' ); // Show "No Title" if widget instance is untitled. - $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message_type'] = $widget_message_type; - $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message'] = $widget_message; - } - } - - // Hook after import. - do_action( 'wie_after_import' ); // phpcs:ignore -- Keep the plugin prefix. - - // Return results. - return apply_filters( 'wie_import_results', $results ); // phpcs:ignore -- Keep the plugin prefix. - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WPImporterLogger.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WPImporterLogger.php deleted file mode 100644 index 08183915..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WPImporterLogger.php +++ /dev/null @@ -1,138 +0,0 @@ -log( 'emergency', $message, $context ); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * @return null - */ - public function alert( $message, array $context = array() ) { - return $this->log( 'alert', $message, $context ); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * @return null - */ - public function critical( $message, array $context = array() ) { - return $this->log( 'critical', $message, $context ); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * @return null - */ - public function error( $message, array $context = array()) { - return $this->log( 'error', $message, $context ); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * @return null - */ - public function warning( $message, array $context = array() ) { - return $this->log( 'warning', $message, $context ); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * @return null - */ - public function notice( $message, array $context = array() ) { - return $this->log( 'notice', $message, $context ); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * @return null - */ - public function info( $message, array $context = array() ) { - return $this->log( 'info', $message, $context ); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * @return null - */ - public function debug( $message, array $context = array() ) { - return $this->log( 'debug', $message, $context ); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * @return null - */ - public function log( $level, $message, array $context = array() ) { - $this->messages[] = array( - 'timestamp' => time(), - 'level' => $level, - 'message' => $message, - 'context' => $context, - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WXRImportInfo.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WXRImportInfo.php deleted file mode 100644 index a7e75aa0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WXRImportInfo.php +++ /dev/null @@ -1,16 +0,0 @@ -` tag at the start of the file. - * - * @var string - */ - protected $version = '1.0'; - - // information to import from WXR file - protected $categories = array(); - protected $tags = array(); - protected $base_url = ''; - - // TODO: REMOVE THESE - protected $processed_terms = array(); - protected $processed_posts = array(); - protected $processed_menu_items = array(); - protected $menu_item_orphans = array(); - protected $missing_menu_items = array(); - - // NEW STYLE - protected $mapping = array(); - protected $requires_remapping = array(); - protected $exists = array(); - protected $user_slug_override = array(); - - protected $url_remap = array(); - protected $featured_images = array(); - - /** - * Logger instance. - * - * @var WP_Importer_Logger - */ - protected $logger; - - /** - * Constructor - * - * @param array $options { - * @var bool $prefill_existing_posts Should we prefill `post_exists` calls? (True prefills and uses more memory, false checks once per imported post and takes longer. Default is true.) - * @var bool $prefill_existing_comments Should we prefill `comment_exists` calls? (True prefills and uses more memory, false checks once per imported comment and takes longer. Default is true.) - * @var bool $prefill_existing_terms Should we prefill `term_exists` calls? (True prefills and uses more memory, false checks once per imported term and takes longer. Default is true.) - * @var bool $update_attachment_guids Should attachment GUIDs be updated to the new URL? (True updates the GUID, which keeps compatibility with v1, false doesn't update, and allows deduplication and reimporting. Default is false.) - * @var bool $fetch_attachments Fetch attachments from the remote server. (True fetches and creates attachment posts, false skips attachments. Default is false.) - * @var bool $aggressive_url_search Should we search/replace for URLs aggressively? (True searches all posts' content for old URLs and replaces, false checks for `` only. Default is false.) - * @var int $default_author User ID to use if author is missing or invalid. (Default is null, which leaves posts unassigned.) - * } - */ - public function __construct( $options = array() ) { - // Initialize some important variables - $empty_types = array( - 'post' => array(), - 'comment' => array(), - 'term' => array(), - 'user' => array(), - ); - - $this->mapping = $empty_types; - $this->mapping['user_slug'] = array(); - $this->mapping['term_id'] = array(); - $this->requires_remapping = $empty_types; - $this->exists = $empty_types; - - $this->options = wp_parse_args( $options, array( - 'prefill_existing_posts' => true, - 'prefill_existing_comments' => true, - 'prefill_existing_terms' => true, - 'update_attachment_guids' => false, - 'fetch_attachments' => false, - 'aggressive_url_search' => false, - 'default_author' => null, - ) ); - } - - public function set_logger( $logger ) { - $this->logger = $logger; - } - - /** - * Get a stream reader for the file. - * - * @param string $file Path to the XML file. - * @return XMLReader|WP_Error Reader instance on success, error otherwise. - */ - protected function get_reader( $file ) { - // Avoid loading external entities for security - $old_value = null; - if ( function_exists( 'libxml_disable_entity_loader' ) ) { - // $old_value = libxml_disable_entity_loader( true ); - } - - $reader = new \XMLReader(); - $status = $reader->open( $file ); - - if ( ! is_null( $old_value ) ) { - // libxml_disable_entity_loader( $old_value ); - } - - if ( ! $status ) { - return new \WP_Error( 'wxr_importer.cannot_parse', __( 'Could not open the file for parsing', 'wordpress-importer' ) ); - } - - return $reader; - } - - /** - * The main controller for the actual import stage. - * - * @param string $file Path to the WXR file for importing - */ - public function get_preliminary_information( $file ) { - // Let's run the actual importer now, woot - $reader = $this->get_reader( $file ); - if ( is_wp_error( $reader ) ) { - return $reader; - } - - // Set the version to compatibility mode first - $this->version = '1.0'; - - // Start parsing! - $data = new WXRImportInfo(); - while ( $reader->read() ) { - // Only deal with element opens - if ( $reader->nodeType !== \XMLReader::ELEMENT ) { - continue; - } - - switch ( $reader->name ) { - case 'wp:wxr_version': - // Upgrade to the correct version - $this->version = $reader->readString(); - - if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { - $this->logger->warning( sprintf( - __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), - $this->version, - self::MAX_WXR_VERSION - ) ); - } - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'generator': - $data->generator = $reader->readString(); - $reader->next(); - break; - - case 'title': - $data->title = $reader->readString(); - $reader->next(); - break; - - case 'wp:base_site_url': - $data->siteurl = $reader->readString(); - $reader->next(); - break; - - case 'wp:base_blog_url': - $data->home = $reader->readString(); - $reader->next(); - break; - - case 'wp:author': - $node = $reader->expand(); - - $parsed = $this->parse_author_node( $node ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - $data->users[] = $parsed; - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'item': - $node = $reader->expand(); - $parsed = $this->parse_post_node( $node ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - if ( $parsed['data']['post_type'] === 'attachment' ) { - $data->media_count++; - } else { - $data->post_count++; - } - $data->comment_count += count( $parsed['comments'] ); - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'wp:category': - case 'wp:tag': - case 'wp:term': - $data->term_count++; - - // Handled everything in this node, move on to the next - $reader->next(); - break; - } - } - - $data->version = $this->version; - - return $data; - } - - /** - * The main controller for the actual import stage. - * - * @param string $file Path to the WXR file for importing - */ - public function parse_authors( $file ) { - // Let's run the actual importer now, woot - $reader = $this->get_reader( $file ); - if ( is_wp_error( $reader ) ) { - return $reader; - } - - // Set the version to compatibility mode first - $this->version = '1.0'; - - // Start parsing! - $authors = array(); - while ( $reader->read() ) { - // Only deal with element opens - if ( $reader->nodeType !== \XMLReader::ELEMENT ) { - continue; - } - - switch ( $reader->name ) { - case 'wp:wxr_version': - // Upgrade to the correct version - $this->version = $reader->readString(); - - if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { - $this->logger->warning( sprintf( - __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), - $this->version, - self::MAX_WXR_VERSION - ) ); - } - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'wp:author': - $node = $reader->expand(); - - $parsed = $this->parse_author_node( $node ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - $authors[] = $parsed; - - // Handled everything in this node, move on to the next - $reader->next(); - break; - } - } - - return $authors; - } - - /** - * The main controller for the actual import stage. - * - * @param string $file Path to the WXR file for importing - */ - public function import( $file ) { - add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) ); - add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) ); - - /* - * Elementor fix for excessive use of `wp_slash` after our update v3.0.2. - * Method in Elementor: \Elementor\Compatibility::register_actions - * https://wordpress.org/support/topic/version-2-6-0-breaks-every-elementor-theme/ - * - * This can be removed after Elementor skips the functionality in above method if our plugin is in use. - */ - if ( method_exists( '\Elementor\Compatibility', 'on_wxr_importer_pre_process_post_meta' ) ) { - remove_action( 'wxr_importer.pre_process.post_meta', array( 'Elementor\Compatibility', 'on_wxr_importer_pre_process_post_meta' ) ); - } - - $result = $this->import_start( $file ); - if ( is_wp_error( $result ) ) { - return $result; - } - - // Let's run the actual importer now, woot - $reader = $this->get_reader( $file ); - if ( is_wp_error( $reader ) ) { - return $reader; - } - - // Set the version to compatibility mode first - $this->version = '1.0'; - - // Reset other variables - $this->base_url = ''; - - // Start parsing! - while ( $reader->read() ) { - // Only deal with element opens - if ( $reader->nodeType !== \XMLReader::ELEMENT ) { - continue; - } - - switch ( $reader->name ) { - case 'wp:wxr_version': - // Upgrade to the correct version - $this->version = $reader->readString(); - - if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { - $this->logger->warning( sprintf( - __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), - $this->version, - self::MAX_WXR_VERSION - ) ); - } - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'wp:base_site_url': - $this->base_url = $reader->readString(); - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'item': - $node = $reader->expand(); - $parsed = $this->parse_post_node( $node ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - $this->process_post( $parsed['data'], $parsed['meta'], $parsed['comments'], $parsed['terms'] ); - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'wp:author': - $node = $reader->expand(); - - $parsed = $this->parse_author_node( $node ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - $status = $this->process_author( $parsed['data'], $parsed['meta'] ); - if ( is_wp_error( $status ) ) { - $this->log_error( $status ); - } - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'wp:category': - $node = $reader->expand(); - - $parsed = $this->parse_term_node( $node, 'category' ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - $status = $this->process_term( $parsed['data'], $parsed['meta'] ); - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'wp:tag': - $node = $reader->expand(); - - $parsed = $this->parse_term_node( $node, 'tag' ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - $status = $this->process_term( $parsed['data'], $parsed['meta'] ); - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - case 'wp:term': - $node = $reader->expand(); - - $parsed = $this->parse_term_node( $node ); - if ( is_wp_error( $parsed ) ) { - $this->log_error( $parsed ); - - // Skip the rest of this post - $reader->next(); - break; - } - - $status = $this->process_term( $parsed['data'], $parsed['meta'] ); - - // Handled everything in this node, move on to the next - $reader->next(); - break; - - default: - // Skip this node, probably handled by something already - break; - } - } - - // Now that we've done the main processing, do any required - // post-processing and remapping. - $this->post_process(); - - if ( $this->options['aggressive_url_search'] ) { - $this->replace_attachment_urls_in_content(); - } - - $this->remap_featured_images(); - - $this->import_end(); - } - - /** - * Log an error instance to the logger. - * - * @param WP_Error $error Error instance to log. - */ - protected function log_error( WP_Error $error ) { - $this->logger->warning( $error->get_error_message() ); - - // Log the data as debug info too - $data = $error->get_error_data(); - if ( ! empty( $data ) ) { - $this->logger->debug( var_export( $data, true ) ); - } - } - - /** - * Parses the WXR file and prepares us for the task of processing parsed data - * - * @param string $file Path to the WXR file for importing - */ - protected function import_start( $file ) { - if ( ! is_file( $file ) ) { - return new \WP_Error( 'wxr_importer.file_missing', __( 'The file does not exist, please try again.', 'wordpress-importer' ) ); - } - - // Suspend bunches of stuff in WP core - wp_defer_term_counting( true ); - wp_defer_comment_counting( true ); - wp_suspend_cache_invalidation( true ); - - // Prefill exists calls if told to - if ( $this->options['prefill_existing_posts'] ) { - $this->prefill_existing_posts(); - } - if ( $this->options['prefill_existing_comments'] ) { - $this->prefill_existing_comments(); - } - if ( $this->options['prefill_existing_terms'] ) { - $this->prefill_existing_terms(); - } - - /** - * Begin the import. - * - * Fires before the import process has begun. If you need to suspend - * caching or heavy processing on hooks, do so here. - */ - do_action( 'generate_import_start' ); - } - - /** - * Performs post-import cleanup of files and the cache - */ - protected function import_end() { - // Re-enable stuff in core - wp_suspend_cache_invalidation( false ); - wp_cache_flush(); - foreach ( get_taxonomies() as $tax ) { - delete_option( "{$tax}_children" ); - _get_term_hierarchy( $tax ); - } - - wp_defer_term_counting( false ); - wp_defer_comment_counting( false ); - - /** - * Complete the import. - * - * Fires after the import process has finished. If you need to update - * your cache or re-enable processing, do so here. - */ - do_action( 'generate_import_end' ); - } - - /** - * Set the user mapping. - * - * @param array $mapping List of map arrays (containing `old_slug`, `old_id`, `new_id`) - */ - public function set_user_mapping( $mapping ) { - foreach ( $mapping as $map ) { - if ( empty( $map['old_slug'] ) || empty( $map['old_id'] ) || empty( $map['new_id'] ) ) { - $this->logger->warning( __( 'Invalid author mapping', 'wordpress-importer' ) ); - $this->logger->debug( var_export( $map, true ) ); - continue; - } - - $old_slug = $map['old_slug']; - $old_id = $map['old_id']; - $new_id = $map['new_id']; - - $this->mapping['user'][ $old_id ] = $new_id; - $this->mapping['user_slug'][ $old_slug ] = $new_id; - } - } - - /** - * Set the user slug overrides. - * - * Allows overriding the slug in the import with a custom/renamed version. - * - * @param string[] $overrides Map of old slug to new slug. - */ - public function set_user_slug_overrides( $overrides ) { - foreach ( $overrides as $original => $renamed ) { - $this->user_slug_override[ $original ] = $renamed; - } - } - - /** - * Parse a post node into post data. - * - * @param DOMElement $node Parent node of post data (typically `item`). - * @return array|WP_Error Post data array on success, error otherwise. - */ - protected function parse_post_node( $node ) { - $data = array(); - $meta = array(); - $comments = array(); - $terms = array(); - - foreach ( $node->childNodes as $child ) { - // We only care about child elements - if ( $child->nodeType !== XML_ELEMENT_NODE ) { - continue; - } - - switch ( $child->tagName ) { - case 'wp:post_type': - $data['post_type'] = $child->textContent; - break; - - case 'title': - $data['post_title'] = $child->textContent; - break; - - case 'guid': - $data['guid'] = $child->textContent; - break; - - case 'dc:creator': - $data['post_author'] = $child->textContent; - break; - - case 'content:encoded': - $data['post_content'] = $child->textContent; - break; - - case 'excerpt:encoded': - $data['post_excerpt'] = $child->textContent; - break; - - case 'wp:post_id': - $data['post_id'] = $child->textContent; - break; - - case 'wp:post_date': - $data['post_date'] = $child->textContent; - break; - - case 'wp:post_date_gmt': - $data['post_date_gmt'] = $child->textContent; - break; - - case 'wp:comment_status': - $data['comment_status'] = $child->textContent; - break; - - case 'wp:ping_status': - $data['ping_status'] = $child->textContent; - break; - - case 'wp:post_name': - $data['post_name'] = $child->textContent; - break; - - case 'wp:status': - $data['post_status'] = $child->textContent; - - if ( $data['post_status'] === 'auto-draft' ) { - // Bail now - return new \WP_Error( - 'wxr_importer.post.cannot_import_draft', - __( 'Cannot import auto-draft posts' ), - $data - ); - } - break; - - case 'wp:post_parent': - $data['post_parent'] = $child->textContent; - break; - - case 'wp:menu_order': - $data['menu_order'] = $child->textContent; - break; - - case 'wp:post_password': - $data['post_password'] = $child->textContent; - break; - - case 'wp:is_sticky': - $data['is_sticky'] = $child->textContent; - break; - - case 'wp:attachment_url': - $data['attachment_url'] = $child->textContent; - break; - - case 'wp:postmeta': - $meta_item = $this->parse_meta_node( $child ); - if ( ! empty( $meta_item ) ) { - $meta[] = $meta_item; - } - break; - - case 'wp:comment': - $comment_item = $this->parse_comment_node( $child ); - if ( ! empty( $comment_item ) ) { - $comments[] = $comment_item; - } - break; - - case 'category': - $term_item = $this->parse_category_node( $child ); - if ( ! empty( $term_item ) ) { - $terms[] = $term_item; - } - break; - } - } - - return compact( 'data', 'meta', 'comments', 'terms' ); - } - - /** - * Create new posts based on import information - * - * Posts marked as having a parent which doesn't exist will become top level items. - * Doesn't create a new post if: the post type doesn't exist, the given post ID - * is already noted as imported or a post with the same title and date already exists. - * Note that new/updated terms, comments and meta are imported for the last of the above. - */ - protected function process_post( $data, $meta, $comments, $terms ) { - /** - * Pre-process post data. - * - * @param array $data Post data. (Return empty to skip.) - * @param array $meta Meta data. - * @param array $comments Comments on the post. - * @param array $terms Terms on the post. - */ - $data = apply_filters( 'wxr_importer.pre_process.post', $data, $meta, $comments, $terms ); - if ( empty( $data ) ) { - return false; - } - - $original_id = isset( $data['post_id'] ) ? (int) $data['post_id'] : 0; - $parent_id = isset( $data['post_parent'] ) ? (int) $data['post_parent'] : 0; - $author_id = isset( $data['post_author'] ) ? (int) $data['post_author'] : 0; - - // Have we already processed this? - if ( isset( $this->mapping['post'][ $original_id ] ) ) { - return; - } - - $post_type_object = get_post_type_object( $data['post_type'] ); - - // Is this type even valid? - if ( ! $post_type_object ) { - $this->logger->warning( sprintf( - __( 'Failed to import "%s": Invalid post type %s', 'wordpress-importer' ), - $data['post_title'], - $data['post_type'] - ) ); - return false; - } - - $post_exists = $this->post_exists( $data ); - if ( $post_exists ) { - $this->logger->info( sprintf( - __( '%s "%s" already exists.', 'wordpress-importer' ), - $post_type_object->labels->singular_name, - $data['post_title'] - ) ); - - /** - * Post processing already imported. - * - * @param array $data Raw data imported for the post. - */ - do_action( 'wxr_importer.process_already_imported.post', $data ); - - // Even though this post already exists, new comments might need importing - $this->process_comments( $comments, $original_id, $data, $post_exists ); - - return false; - } - - // Map the parent post, or mark it as one we need to fix - $requires_remapping = false; - if ( $parent_id ) { - if ( isset( $this->mapping['post'][ $parent_id ] ) ) { - $data['post_parent'] = $this->mapping['post'][ $parent_id ]; - } else { - $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); - $requires_remapping = true; - - $data['post_parent'] = 0; - } - } - - // Map the author, or mark it as one we need to fix - $author = sanitize_user( $data['post_author'], true ); - if ( empty( $author ) ) { - // Missing or invalid author, use default if available. - $data['post_author'] = $this->options['default_author']; - } elseif ( isset( $this->mapping['user_slug'][ $author ] ) ) { - $data['post_author'] = $this->mapping['user_slug'][ $author ]; - } else { - $meta[] = array( 'key' => '_wxr_import_user_slug', 'value' => $author ); - $requires_remapping = true; - - $data['post_author'] = (int) get_current_user_id(); - } - - // Does the post look like it contains attachment images? - if ( preg_match( self::REGEX_HAS_ATTACHMENT_REFS, $data['post_content'] ) ) { - $meta[] = array( 'key' => '_wxr_import_has_attachment_refs', 'value' => true ); - $requires_remapping = true; - } - - // Whitelist to just the keys we allow - $postdata = array( - 'import_id' => $data['post_id'], - ); - $allowed = array( - 'post_author' => true, - 'post_date' => true, - 'post_date_gmt' => true, - 'post_content' => true, - 'post_excerpt' => true, - 'post_title' => true, - 'post_status' => true, - 'post_name' => true, - 'comment_status' => true, - 'ping_status' => true, - 'guid' => true, - 'post_parent' => true, - 'menu_order' => true, - 'post_type' => true, - 'post_password' => true, - ); - foreach ( $data as $key => $value ) { - if ( ! isset( $allowed[ $key ] ) ) { - continue; - } - - $postdata[ $key ] = $data[ $key ]; - } - - $postdata = apply_filters( 'wp_import_post_data_processed', wp_slash( $postdata ), $data ); - - if ( 'attachment' === $postdata['post_type'] ) { - if ( ! $this->options['fetch_attachments'] ) { - $this->logger->notice( sprintf( - __( 'Skipping attachment "%s", fetching attachments disabled' ), - $data['post_title'] - ) ); - /** - * Post processing skipped. - * - * @param array $data Raw data imported for the post. - * @param array $meta Raw meta data, already processed by {@see process_post_meta}. - */ - do_action( 'wxr_importer.process_skipped.post', $data, $meta ); - return false; - } - $remote_url = ! empty( $data['attachment_url'] ) ? $data['attachment_url'] : $data['guid']; - $post_id = $this->process_attachment( $postdata, $meta, $remote_url ); - } else { - $post_id = wp_insert_post( $postdata, true ); - do_action( 'wp_import_insert_post', $post_id, $original_id, $postdata, $data ); - } - - if ( is_wp_error( $post_id ) ) { - $this->logger->error( sprintf( - __( 'Failed to import "%s" (%s)', 'wordpress-importer' ), - $data['post_title'], - $post_type_object->labels->singular_name - ) ); - $this->logger->debug( $post_id->get_error_message() ); - - /** - * Post processing failed. - * - * @param WP_Error $post_id Error object. - * @param array $data Raw data imported for the post. - * @param array $meta Raw meta data, already processed by {@see process_post_meta}. - * @param array $comments Raw comment data, already processed by {@see process_comments}. - * @param array $terms Raw term data, already processed. - */ - do_action( 'wxr_importer.process_failed.post', $post_id, $data, $meta, $comments, $terms ); - return false; - } - - // Ensure stickiness is handled correctly too - if ( $data['is_sticky'] === '1' ) { - stick_post( $post_id ); - } - - // map pre-import ID to local ID - $this->mapping['post'][ $original_id ] = (int) $post_id; - if ( $requires_remapping ) { - $this->requires_remapping['post'][ $post_id ] = true; - } - $this->mark_post_exists( $data, $post_id ); - - $this->logger->info( sprintf( - __( 'Imported "%s" (%s)', 'wordpress-importer' ), - $data['post_title'], - $post_type_object->labels->singular_name - ) ); - $this->logger->debug( sprintf( - __( 'Post %d remapped to %d', 'wordpress-importer' ), - $original_id, - $post_id - ) ); - - // Handle the terms too - $terms = apply_filters( 'wp_import_post_terms', $terms, $post_id, $data ); - - if ( ! empty( $terms ) ) { - $term_ids = array(); - foreach ( $terms as $term ) { - $taxonomy = $term['taxonomy']; - $key = sha1( $taxonomy . ':' . $term['slug'] ); - - if ( isset( $this->mapping['term'][ $key ] ) ) { - $term_ids[ $taxonomy ][] = (int) $this->mapping['term'][ $key ]; - } else { - $meta[] = array( 'key' => '_wxr_import_term', 'value' => $term ); - $requires_remapping = true; - } - } - - foreach ( $term_ids as $tax => $ids ) { - $tt_ids = wp_set_post_terms( $post_id, $ids, $tax ); - do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $data ); - } - } - - $this->process_comments( $comments, $post_id, $data ); - $this->process_post_meta( $meta, $post_id, $data ); - - if ( 'nav_menu_item' === $data['post_type'] ) { - $this->process_menu_item_meta( $post_id, $data, $meta ); - } - - /** - * Post processing completed. - * - * @param int $post_id New post ID. - * @param array $data Raw data imported for the post. - * @param array $meta Raw meta data, already processed by {@see process_post_meta}. - * @param array $comments Raw comment data, already processed by {@see process_comments}. - * @param array $terms Raw term data, already processed. - */ - do_action( 'wxr_importer.processed.post', $post_id, $data, $meta, $comments, $terms ); - } - - /** - * Attempt to create a new menu item from import data - * - * Fails for draft, orphaned menu items and those without an associated nav_menu - * or an invalid nav_menu term. If the post type or term object which the menu item - * represents doesn't exist then the menu item will not be imported (waits until the - * end of the import to retry again before discarding). - * - * @param array $item Menu item details from WXR file - */ - protected function process_menu_item_meta( $post_id, $data, $meta ) { - - $item_type = get_post_meta( $post_id, '_menu_item_type', true ); - $original_object_id = get_post_meta( $post_id, '_menu_item_object_id', true ); - $object_id = null; - - $this->logger->debug( sprintf( 'Processing menu item %s', $item_type ) ); - - $requires_remapping = false; - switch ( $item_type ) { - case 'taxonomy': - if ( isset( $this->mapping['term_id'][ $original_object_id ] ) ) { - $object_id = $this->mapping['term_id'][ $original_object_id ]; - } else { - add_post_meta( $post_id, '_wxr_import_menu_item', wp_slash( $original_object_id ) ); - $requires_remapping = true; - } - break; - - case 'post_type': - if ( isset( $this->mapping['post'][ $original_object_id ] ) ) { - $object_id = $this->mapping['post'][ $original_object_id ]; - } else { - add_post_meta( $post_id, '_wxr_import_menu_item', wp_slash( $original_object_id ) ); - $requires_remapping = true; - } - break; - - case 'custom': - // Custom refers to itself, wonderfully easy. - $object_id = $post_id; - break; - - default: - // associated object is missing or not imported yet, we'll retry later - $this->missing_menu_items[] = $item; - $this->logger->debug( 'Unknown menu item type' ); - break; - } - - if ( $requires_remapping ) { - $this->requires_remapping['post'][ $post_id ] = true; - } - - if ( empty( $object_id ) ) { - // Nothing needed here. - return; - } - - $this->logger->debug( sprintf( 'Menu item %d mapped to %d', $original_object_id, $object_id ) ); - update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $object_id ) ); - } - - /** - * If fetching attachments is enabled then attempt to create a new attachment - * - * @param array $post Attachment post details from WXR - * @param string $url URL to fetch attachment from - * @return int|WP_Error Post ID on success, WP_Error otherwise - */ - protected function process_attachment( $post, $meta, $remote_url ) { - // try to use _wp_attached file for upload folder placement to ensure the same location as the export site - // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload() - $post['upload_date'] = $post['post_date']; - foreach ( $meta as $meta_item ) { - if ( $meta_item['key'] !== '_wp_attached_file' ) { - continue; - } - - if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta_item['value'], $matches ) ) { - $post['upload_date'] = $matches[0]; - } - break; - } - - // if the URL is absolute, but does not contain address, then upload it assuming base_site_url - if ( preg_match( '|^/[\w\W]+$|', $remote_url ) ) { - $remote_url = rtrim( $this->base_url, '/' ) . $remote_url; - } - - $upload = $this->fetch_remote_file( $remote_url, $post ); - if ( is_wp_error( $upload ) ) { - return $upload; - } - - $info = wp_check_filetype( $upload['file'] ); - if ( ! $info ) { - return new \WP_Error( 'attachment_processing_error', __( 'Invalid file type', 'wordpress-importer' ) ); - } - - $post['post_mime_type'] = $info['type']; - - // WP really likes using the GUID for display. Allow updating it. - // See https://core.trac.wordpress.org/ticket/33386 - if ( $this->options['update_attachment_guids'] ) { - $post['guid'] = $upload['url']; - } - - // as per wp-admin/includes/upload.php - $post_id = wp_insert_attachment( $post, $upload['file'] ); - if ( is_wp_error( $post_id ) ) { - return $post_id; - } - - $attachment_metadata = wp_generate_attachment_metadata( $post_id, $upload['file'] ); - wp_update_attachment_metadata( $post_id, $attachment_metadata ); - - // Map this image URL later if we need to - $this->url_remap[ $remote_url ] = $upload['url']; - - // If we have a HTTPS URL, ensure the HTTP URL gets replaced too - if ( substr( $remote_url, 0, 8 ) === 'https://' ) { - $insecure_url = 'http' . substr( $remote_url, 5 ); - $this->url_remap[ $insecure_url ] = $upload['url']; - } - - if ( $this->options['aggressive_url_search'] ) { - // remap resized image URLs, works by stripping the extension and remapping the URL stub. - /*if ( preg_match( '!^image/!', $info['type'] ) ) { - $parts = pathinfo( $remote_url ); - $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2 - - $parts_new = pathinfo( $upload['url'] ); - $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" ); - - $this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new; - }*/ - } - - return $post_id; - } - - /** - * Parse a meta node into meta data. - * - * @param DOMElement $node Parent node of meta data (typically `wp:postmeta` or `wp:commentmeta`). - * @return array|null Meta data array on success, or null on error. - */ - protected function parse_meta_node( $node ) { - foreach ( $node->childNodes as $child ) { - // We only care about child elements - if ( $child->nodeType !== XML_ELEMENT_NODE ) { - continue; - } - - switch ( $child->tagName ) { - case 'wp:meta_key': - $key = $child->textContent; - break; - - case 'wp:meta_value': - $value = $child->textContent; - break; - } - } - - if ( empty( $key ) || empty( $value ) ) { - return null; - } - - return compact( 'key', 'value' ); - } - - /** - * Process and import post meta items. - * - * @param array $meta List of meta data arrays - * @param int $post_id Post to associate with - * @param array $post Post data - * @return int|WP_Error Number of meta items imported on success, error otherwise. - */ - protected function process_post_meta( $meta, $post_id, $post ) { - if ( empty( $meta ) ) { - return true; - } - - foreach ( $meta as $meta_item ) { - /** - * Pre-process post meta data. - * - * @param array $meta_item Meta data. (Return empty to skip.) - * @param int $post_id Post the meta is attached to. - */ - $meta_item = apply_filters( 'wxr_importer.pre_process.post_meta', $meta_item, $post_id ); - if ( empty( $meta_item ) ) { - return false; - } - - $key = apply_filters( 'import_post_meta_key', $meta_item['key'], $post_id, $post ); - $value = false; - - if ( '_edit_last' === $key ) { - $value = intval( $meta_item['value'] ); - if ( ! isset( $this->mapping['user'][ $value ] ) ) { - // Skip! - continue; - } - - $value = $this->mapping['user'][ $value ]; - } - - if ( $key ) { - // export gets meta straight from the DB so could have a serialized string - if ( ! $value ) { - $value = maybe_unserialize( $meta_item['value'] ); - } - - if ( function_exists( 'wp_slash_strings_only' ) ) { - add_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) ); - } else { - add_post_meta( $post_id, $key, $value ); - } - - do_action( 'import_post_meta', $post_id, $key, $value ); - - // if the post has a featured image, take note of this in case of remap - if ( '_thumbnail_id' === $key ) { - $this->featured_images[ $post_id ] = (int) $value; - } - } - } - - return true; - } - - /** - * Parse a comment node into comment data. - * - * @param DOMElement $node Parent node of comment data (typically `wp:comment`). - * @return array Comment data array. - */ - protected function parse_comment_node( $node ) { - $data = array( - 'commentmeta' => array(), - ); - - foreach ( $node->childNodes as $child ) { - // We only care about child elements - if ( $child->nodeType !== XML_ELEMENT_NODE ) { - continue; - } - - switch ( $child->tagName ) { - case 'wp:comment_id': - $data['comment_id'] = $child->textContent; - break; - case 'wp:comment_author': - $data['comment_author'] = $child->textContent; - break; - - case 'wp:comment_author_email': - $data['comment_author_email'] = $child->textContent; - break; - - case 'wp:comment_author_IP': - $data['comment_author_IP'] = $child->textContent; - break; - - case 'wp:comment_author_url': - $data['comment_author_url'] = $child->textContent; - break; - - case 'wp:comment_user_id': - $data['comment_user_id'] = $child->textContent; - break; - - case 'wp:comment_date': - $data['comment_date'] = $child->textContent; - break; - - case 'wp:comment_date_gmt': - $data['comment_date_gmt'] = $child->textContent; - break; - - case 'wp:comment_content': - $data['comment_content'] = $child->textContent; - break; - - case 'wp:comment_approved': - $data['comment_approved'] = $child->textContent; - break; - - case 'wp:comment_type': - $data['comment_type'] = $child->textContent; - break; - - case 'wp:comment_parent': - $data['comment_parent'] = $child->textContent; - break; - - case 'wp:commentmeta': - $meta_item = $this->parse_meta_node( $child ); - if ( ! empty( $meta_item ) ) { - $data['commentmeta'][] = $meta_item; - } - break; - } - } - - return $data; - } - - /** - * Process and import comment data. - * - * @param array $comments List of comment data arrays. - * @param int $post_id Post to associate with. - * @param array $post Post data. - * @return int|WP_Error Number of comments imported on success, error otherwise. - */ - protected function process_comments( $comments, $post_id, $post, $post_exists = false ) { - - $comments = apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ); - if ( empty( $comments ) ) { - return 0; - } - - $num_comments = 0; - - // Sort by ID to avoid excessive remapping later - usort( $comments, array( $this, 'sort_comments_by_id' ) ); - - foreach ( $comments as $key => $comment ) { - /** - * Pre-process comment data - * - * @param array $comment Comment data. (Return empty to skip.) - * @param int $post_id Post the comment is attached to. - */ - $comment = apply_filters( 'wxr_importer.pre_process.comment', $comment, $post_id ); - if ( empty( $comment ) ) { - return false; - } - - $original_id = isset( $comment['comment_id'] ) ? (int) $comment['comment_id'] : 0; - $parent_id = isset( $comment['comment_parent'] ) ? (int) $comment['comment_parent'] : 0; - $author_id = isset( $comment['comment_user_id'] ) ? (int) $comment['comment_user_id'] : 0; - - // if this is a new post we can skip the comment_exists() check - // TODO: Check comment_exists for performance - if ( $post_exists ) { - $existing = $this->comment_exists( $comment ); - if ( $existing ) { - - /** - * Comment processing already imported. - * - * @param array $comment Raw data imported for the comment. - */ - do_action( 'wxr_importer.process_already_imported.comment', $comment ); - - $this->mapping['comment'][ $original_id ] = $existing; - continue; - } - } - - // Remove meta from the main array - $meta = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array(); - unset( $comment['commentmeta'] ); - - // Map the parent comment, or mark it as one we need to fix - $requires_remapping = false; - if ( $parent_id ) { - if ( isset( $this->mapping['comment'][ $parent_id ] ) ) { - $comment['comment_parent'] = $this->mapping['comment'][ $parent_id ]; - } else { - // Prepare for remapping later - $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); - $requires_remapping = true; - - // Wipe the parent for now - $comment['comment_parent'] = 0; - } - } - - // Map the author, or mark it as one we need to fix - if ( $author_id ) { - if ( isset( $this->mapping['user'][ $author_id ] ) ) { - $comment['user_id'] = $this->mapping['user'][ $author_id ]; - } else { - // Prepare for remapping later - $meta[] = array( 'key' => '_wxr_import_user', 'value' => $author_id ); - $requires_remapping = true; - - // Wipe the user for now - $comment['user_id'] = 0; - } - } - - // Run standard core filters - $comment['comment_post_ID'] = $post_id; - $comment = wp_filter_comment( $comment ); - - // wp_insert_comment expects slashed data - $comment_id = wp_insert_comment( wp_slash( $comment ) ); - $this->mapping['comment'][ $original_id ] = $comment_id; - if ( $requires_remapping ) { - $this->requires_remapping['comment'][ $comment_id ] = true; - } - $this->mark_comment_exists( $comment, $comment_id ); - - /** - * Comment has been imported. - * - * @param int $comment_id New comment ID - * @param array $comment Comment inserted (`comment_id` item refers to the original ID) - * @param int $post_id Post parent of the comment - * @param array $post Post data - */ - do_action( 'wp_import_insert_comment', $comment_id, $comment, $post_id, $post ); - - // Process the meta items - foreach ( $meta as $meta_item ) { - $value = maybe_unserialize( $meta_item['value'] ); - add_comment_meta( $comment_id, wp_slash( $meta_item['key'] ), wp_slash( $value ) ); - } - - /** - * Post processing completed. - * - * @param int $post_id New post ID. - * @param array $comment Raw data imported for the comment. - * @param array $meta Raw meta data, already processed by {@see process_post_meta}. - * @param array $post_id Parent post ID. - */ - do_action( 'wxr_importer.processed.comment', $comment_id, $comment, $meta, $post_id ); - - $num_comments++; - } - - return $num_comments; - } - - protected function parse_category_node( $node ) { - $data = array( - // Default taxonomy to "category", since this is a `` tag - 'taxonomy' => 'category', - ); - $meta = array(); - - if ( $node->hasAttribute( 'domain' ) ) { - $data['taxonomy'] = $node->getAttribute( 'domain' ); - } - if ( $node->hasAttribute( 'nicename' ) ) { - $data['slug'] = $node->getAttribute( 'nicename' ); - } - - $data['name'] = $node->textContent; - - if ( empty( $data['slug'] ) ) { - return null; - } - - // Just for extra compatibility - if ( $data['taxonomy'] === 'tag' ) { - $data['taxonomy'] = 'post_tag'; - } - - return $data; - } - - /** - * Callback for `usort` to sort comments by ID - * - * @param array $a Comment data for the first comment - * @param array $b Comment data for the second comment - * @return int - */ - public static function sort_comments_by_id( $a, $b ) { - if ( empty( $a['comment_id'] ) ) { - return 1; - } - - if ( empty( $b['comment_id'] ) ) { - return -1; - } - - return $a['comment_id'] - $b['comment_id']; - } - - protected function parse_author_node( $node ) { - $data = array(); - $meta = array(); - foreach ( $node->childNodes as $child ) { - // We only care about child elements - if ( $child->nodeType !== XML_ELEMENT_NODE ) { - continue; - } - - switch ( $child->tagName ) { - case 'wp:author_login': - $data['user_login'] = $child->textContent; - break; - - case 'wp:author_id': - $data['ID'] = $child->textContent; - break; - - case 'wp:author_email': - $data['user_email'] = $child->textContent; - break; - - case 'wp:author_display_name': - $data['display_name'] = $child->textContent; - break; - - case 'wp:author_first_name': - $data['first_name'] = $child->textContent; - break; - - case 'wp:author_last_name': - $data['last_name'] = $child->textContent; - break; - } - } - - return compact( 'data', 'meta' ); - } - - protected function process_author( $data, $meta ) { - /** - * Pre-process user data. - * - * @param array $data User data. (Return empty to skip.) - * @param array $meta Meta data. - */ - $data = apply_filters( 'wxr_importer.pre_process.user', $data, $meta ); - if ( empty( $data ) ) { - return false; - } - - // Have we already handled this user? - $original_id = isset( $data['ID'] ) ? $data['ID'] : 0; - $original_slug = $data['user_login']; - - if ( isset( $this->mapping['user'][ $original_id ] ) ) { - $existing = $this->mapping['user'][ $original_id ]; - - // Note the slug mapping if we need to too - if ( ! isset( $this->mapping['user_slug'][ $original_slug ] ) ) { - $this->mapping['user_slug'][ $original_slug ] = $existing; - } - - return false; - } - - if ( isset( $this->mapping['user_slug'][ $original_slug ] ) ) { - $existing = $this->mapping['user_slug'][ $original_slug ]; - - // Ensure we note the mapping too - $this->mapping['user'][ $original_id ] = $existing; - - return false; - } - - // Allow overriding the user's slug - $login = $original_slug; - if ( isset( $this->user_slug_override[ $login ] ) ) { - $login = $this->user_slug_override[ $login ]; - } - - $userdata = array( - 'user_login' => sanitize_user( $login, true ), - 'user_pass' => wp_generate_password(), - ); - - $allowed = array( - 'user_email' => true, - 'display_name' => true, - 'first_name' => true, - 'last_name' => true, - ); - foreach ( $data as $key => $value ) { - if ( ! isset( $allowed[ $key ] ) ) { - continue; - } - - $userdata[ $key ] = $data[ $key ]; - } - - $user_id = wp_insert_user( wp_slash( $userdata ) ); - if ( is_wp_error( $user_id ) ) { - $this->logger->error( sprintf( - __( 'Failed to import user "%s"', 'wordpress-importer' ), - $userdata['user_login'] - ) ); - $this->logger->debug( $user_id->get_error_message() ); - - /** - * User processing failed. - * - * @param WP_Error $user_id Error object. - * @param array $userdata Raw data imported for the user. - */ - do_action( 'wxr_importer.process_failed.user', $user_id, $userdata ); - return false; - } - - if ( $original_id ) { - $this->mapping['user'][ $original_id ] = $user_id; - } - $this->mapping['user_slug'][ $original_slug ] = $user_id; - - $this->logger->info( sprintf( - __( 'Imported user "%s"', 'wordpress-importer' ), - $userdata['user_login'] - ) ); - $this->logger->debug( sprintf( - __( 'User %d remapped to %d', 'wordpress-importer' ), - $original_id, - $user_id - ) ); - - // TODO: Implement meta handling once WXR includes it - /** - * User processing completed. - * - * @param int $user_id New user ID. - * @param array $userdata Raw data imported for the user. - */ - do_action( 'wxr_importer.processed.user', $user_id, $userdata ); - } - - protected function parse_term_node( $node, $type = 'term' ) { - $data = array(); - $meta = array(); - - $tag_name = array( - 'id' => 'wp:term_id', - 'taxonomy' => 'wp:term_taxonomy', - 'slug' => 'wp:term_slug', - 'parent' => 'wp:term_parent', - 'name' => 'wp:term_name', - 'description' => 'wp:term_description', - ); - $taxonomy = null; - - // Special casing! - switch ( $type ) { - case 'category': - $tag_name['slug'] = 'wp:category_nicename'; - $tag_name['parent'] = 'wp:category_parent'; - $tag_name['name'] = 'wp:cat_name'; - $tag_name['description'] = 'wp:category_description'; - $tag_name['taxonomy'] = null; - - $data['taxonomy'] = 'category'; - break; - - case 'tag': - $tag_name['slug'] = 'wp:tag_slug'; - $tag_name['parent'] = null; - $tag_name['name'] = 'wp:tag_name'; - $tag_name['description'] = 'wp:tag_description'; - $tag_name['taxonomy'] = null; - - $data['taxonomy'] = 'post_tag'; - break; - } - - foreach ( $node->childNodes as $child ) { - // We only care about child elements - if ( $child->nodeType !== XML_ELEMENT_NODE ) { - continue; - } - - $key = array_search( $child->tagName, $tag_name ); - if ( $key ) { - $data[ $key ] = $child->textContent; - } - } - - if ( empty( $data['taxonomy'] ) ) { - return null; - } - - // Compatibility with WXR 1.0 - if ( $data['taxonomy'] === 'tag' ) { - $data['taxonomy'] = 'post_tag'; - } - - return compact( 'data', 'meta' ); - } - - protected function process_term( $data, $meta ) { - /** - * Pre-process term data. - * - * @param array $data Term data. (Return empty to skip.) - * @param array $meta Meta data. - */ - $data = apply_filters( 'wxr_importer.pre_process.term', $data, $meta ); - if ( empty( $data ) ) { - return false; - } - - $original_id = isset( $data['id'] ) ? (int) $data['id'] : 0; - $parent_id = isset( $data['parent'] ) ? (int) $data['parent'] : 0; - - $mapping_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); - $existing = $this->term_exists( $data ); - if ( $existing ) { - - /** - * Term processing already imported. - * - * @param array $data Raw data imported for the term. - */ - do_action( 'wxr_importer.process_already_imported.term', $data ); - - $this->mapping['term'][ $mapping_key ] = $existing; - $this->mapping['term_id'][ $original_id ] = $existing; - return false; - } - - // WP really likes to repeat itself in export files - if ( isset( $this->mapping['term'][ $mapping_key ] ) ) { - return false; - } - - $termdata = array(); - $allowed = array( - 'slug' => true, - 'description' => true, - ); - - // Map the parent comment, or mark it as one we need to fix - // TODO: add parent mapping and remapping - /*$requires_remapping = false; - if ( $parent_id ) { - if ( isset( $this->mapping['term'][ $parent_id ] ) ) { - $data['parent'] = $this->mapping['term'][ $parent_id ]; - } else { - // Prepare for remapping later - $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); - $requires_remapping = true; - - // Wipe the parent for now - $data['parent'] = 0; - } - }*/ - - foreach ( $data as $key => $value ) { - if ( ! isset( $allowed[ $key ] ) ) { - continue; - } - - $termdata[ $key ] = $data[ $key ]; - } - - $result = wp_insert_term( $data['name'], $data['taxonomy'], $termdata ); - if ( is_wp_error( $result ) ) { - $this->logger->warning( sprintf( - __( 'Failed to import %s %s', 'wordpress-importer' ), - $data['taxonomy'], - $data['name'] - ) ); - $this->logger->debug( $result->get_error_message() ); - do_action( 'wp_import_insert_term_failed', $result, $data ); - - /** - * Term processing failed. - * - * @param WP_Error $result Error object. - * @param array $data Raw data imported for the term. - * @param array $meta Meta data supplied for the term. - */ - do_action( 'wxr_importer.process_failed.term', $result, $data, $meta ); - return false; - } - - $term_id = $result['term_id']; - - $this->mapping['term'][ $mapping_key ] = $term_id; - $this->mapping['term_id'][ $original_id ] = $term_id; - - $this->logger->info( sprintf( - __( 'Imported "%s" (%s)', 'wordpress-importer' ), - $data['name'], - $data['taxonomy'] - ) ); - $this->logger->debug( sprintf( - __( 'Term %d remapped to %d', 'wordpress-importer' ), - $original_id, - $term_id - ) ); - - do_action( 'wp_import_insert_term', $term_id, $data ); - - /** - * Term processing completed. - * - * @param int $term_id New term ID. - * @param array $data Raw data imported for the term. - */ - do_action( 'wxr_importer.processed.term', $term_id, $data ); - } - - /** - * Attempt to download a remote file attachment - * - * @param string $url URL of item to fetch - * @param array $post Attachment details - * @return array|WP_Error Local file location details on success, WP_Error otherwise - */ - protected function fetch_remote_file( $url, $post ) { - // extract the file name and extension from the url - $file_name = basename( $url ); - - // get placeholder file in the upload dir with a unique, sanitized filename - $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] ); - if ( $upload['error'] ) { - return new \WP_Error( 'upload_dir_error', $upload['error'] ); - } - - // fetch the remote url and write it to the placeholder file - $response = wp_remote_get( $url, array( - 'stream' => true, - 'filename' => $upload['file'], - ) ); - - // request failed - if ( is_wp_error( $response ) ) { - unlink( $upload['file'] ); - return $response; - } - - $code = (int) wp_remote_retrieve_response_code( $response ); - - // make sure the fetch was successful - if ( $code !== 200 ) { - unlink( $upload['file'] ); - return new \WP_Error( - 'import_file_error', - sprintf( - __( 'Remote server returned %1$d %2$s for %3$s', 'wordpress-importer' ), - $code, - get_status_header_desc( $code ), - $url - ) - ); - } - - $filesize = filesize( $upload['file'] ); - $headers = wp_remote_retrieve_headers( $response ); - - if ( isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) { - unlink( $upload['file'] ); - return new \WP_Error( 'import_file_error', __( 'Remote file is incorrect size', 'wordpress-importer' ) ); - } - - if ( 0 === $filesize ) { - unlink( $upload['file'] ); - return new \WP_Error( 'import_file_error', __( 'Zero size file downloaded', 'wordpress-importer' ) ); - } - - $max_size = (int) $this->max_attachment_size(); - if ( ! empty( $max_size ) && $filesize > $max_size ) { - unlink( $upload['file'] ); - $message = sprintf( __( 'Remote file is too large, limit is %s', 'wordpress-importer' ), size_format( $max_size ) ); - return new \WP_Error( 'import_file_error', $message ); - } - - return $upload; - } - - protected function post_process() { - // Time to tackle any left-over bits - if ( ! empty( $this->requires_remapping['post'] ) ) { - $this->post_process_posts( $this->requires_remapping['post'] ); - } - if ( ! empty( $this->requires_remapping['comment'] ) ) { - $this->post_process_comments( $this->requires_remapping['comment'] ); - } - } - - protected function post_process_posts( $todo ) { - foreach ( $todo as $post_id => $_ ) { - $this->logger->debug( sprintf( - // Note: title intentionally not used to skip extra processing - // for when debug logging is off - __( 'Running post-processing for post %d', 'wordpress-importer' ), - $post_id - ) ); - - $data = array(); - - $parent_id = get_post_meta( $post_id, '_wxr_import_parent', true ); - if ( ! empty( $parent_id ) ) { - // Have we imported the parent now? - if ( isset( $this->mapping['post'][ $parent_id ] ) ) { - $data['post_parent'] = $this->mapping['post'][ $parent_id ]; - } else { - $this->logger->warning( sprintf( - __( 'Could not find the post parent for "%s" (post #%d)', 'wordpress-importer' ), - get_the_title( $post_id ), - $post_id - ) ); - $this->logger->debug( sprintf( - __( 'Post %d was imported with parent %d, but could not be found', 'wordpress-importer' ), - $post_id, - $parent_id - ) ); - } - } - - $author_slug = get_post_meta( $post_id, '_wxr_import_user_slug', true ); - if ( ! empty( $author_slug ) ) { - // Have we imported the user now? - if ( isset( $this->mapping['user_slug'][ $author_slug ] ) ) { - $data['post_author'] = $this->mapping['user_slug'][ $author_slug ]; - } else { - $this->logger->warning( sprintf( - __( 'Could not find the author for "%s" (post #%d)', 'wordpress-importer' ), - get_the_title( $post_id ), - $post_id - ) ); - $this->logger->debug( sprintf( - __( 'Post %d was imported with author "%s", but could not be found', 'wordpress-importer' ), - $post_id, - $author_slug - ) ); - } - } - - $has_attachments = get_post_meta( $post_id, '_wxr_import_has_attachment_refs', true ); - if ( ! empty( $has_attachments ) ) { - $post = get_post( $post_id ); - $content = $post->post_content; - - // Replace all the URLs we've got - $new_content = str_replace( array_keys( $this->url_remap ), $this->url_remap, $content ); - if ( $new_content !== $content ) { - $data['post_content'] = $new_content; - } - } - - if ( get_post_type( $post_id ) === 'nav_menu_item' ) { - $this->post_process_menu_item( $post_id ); - } - - // Do we have updates to make? - if ( empty( $data ) ) { - $this->logger->debug( sprintf( - __( 'Post %d was marked for post-processing, but none was required.', 'wordpress-importer' ), - $post_id - ) ); - continue; - } - - // Run the update - $data['ID'] = $post_id; - - if ( isset( $data['post_content'] ) ) { - $data['post_content'] = wp_slash( $data['post_content'] ); - } - - $result = wp_update_post( $data, true ); - - if ( is_wp_error( $result ) ) { - $this->logger->warning( sprintf( - __( 'Could not update "%s" (post #%d) with mapped data', 'wordpress-importer' ), - get_the_title( $post_id ), - $post_id - ) ); - $this->logger->debug( $result->get_error_message() ); - continue; - } - - // Clear out our temporary meta keys - delete_post_meta( $post_id, '_wxr_import_parent' ); - delete_post_meta( $post_id, '_wxr_import_user_slug' ); - delete_post_meta( $post_id, '_wxr_import_has_attachment_refs' ); - } - } - - protected function post_process_menu_item( $post_id ) { - $menu_object_id = get_post_meta( $post_id, '_wxr_import_menu_item', true ); - if ( empty( $menu_object_id ) ) { - // No processing needed! - return; - } - - $menu_item_type = get_post_meta( $post_id, '_menu_item_type', true ); - switch ( $menu_item_type ) { - case 'taxonomy': - if ( isset( $this->mapping['term_id'][ $menu_object_id ] ) ) { - $menu_object = $this->mapping['term_id'][ $menu_object_id ]; - } - break; - - case 'post_type': - if ( isset( $this->mapping['post'][ $menu_object_id ] ) ) { - $menu_object = $this->mapping['post'][ $menu_object_id ]; - } - break; - - default: - // Cannot handle this. - return; - } - - if ( ! empty( $menu_object ) ) { - update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $menu_object ) ); - } else { - $this->logger->warning( sprintf( - __( 'Could not find the menu object for "%s" (post #%d)', 'wordpress-importer' ), - get_the_title( $post_id ), - $post_id - ) ); - $this->logger->debug( sprintf( - __( 'Post %d was imported with object "%d" of type "%s", but could not be found', 'wordpress-importer' ), - $post_id, - $menu_object_id, - $menu_item_type - ) ); - } - - delete_post_meta( $post_id, '_wxr_import_menu_item' ); - } - - - protected function post_process_comments( $todo ) { - foreach ( $todo as $comment_id => $_ ) { - $data = array(); - - $parent_id = get_comment_meta( $comment_id, '_wxr_import_parent', true ); - if ( ! empty( $parent_id ) ) { - // Have we imported the parent now? - if ( isset( $this->mapping['comment'][ $parent_id ] ) ) { - $data['comment_parent'] = $this->mapping['comment'][ $parent_id ]; - } else { - $this->logger->warning( sprintf( - __( 'Could not find the comment parent for comment #%d', 'wordpress-importer' ), - $comment_id - ) ); - $this->logger->debug( sprintf( - __( 'Comment %d was imported with parent %d, but could not be found', 'wordpress-importer' ), - $comment_id, - $parent_id - ) ); - } - } - - $author_id = get_comment_meta( $comment_id, '_wxr_import_user', true ); - if ( ! empty( $author_id ) ) { - // Have we imported the user now? - if ( isset( $this->mapping['user'][ $author_id ] ) ) { - $data['user_id'] = $this->mapping['user'][ $author_id ]; - } else { - $this->logger->warning( sprintf( - __( 'Could not find the author for comment #%d', 'wordpress-importer' ), - $comment_id - ) ); - $this->logger->debug( sprintf( - __( 'Comment %d was imported with author %d, but could not be found', 'wordpress-importer' ), - $comment_id, - $author_id - ) ); - } - } - - // Do we have updates to make? - if ( empty( $data ) ) { - continue; - } - - // Run the update - $data['comment_ID'] = $comment_ID; - $result = wp_update_comment( wp_slash( $data ) ); - if ( empty( $result ) ) { - $this->logger->warning( sprintf( - __( 'Could not update comment #%d with mapped data', 'wordpress-importer' ), - $comment_id - ) ); - continue; - } - - // Clear out our temporary meta keys - delete_comment_meta( $comment_id, '_wxr_import_parent' ); - delete_comment_meta( $comment_id, '_wxr_import_user' ); - } - } - - /** - * Use stored mapping information to update old attachment URLs - */ - protected function replace_attachment_urls_in_content() { - global $wpdb; - // make sure we do the longest urls first, in case one is a substring of another - uksort( $this->url_remap, array( $this, 'cmpr_strlen' ) ); - - foreach ( $this->url_remap as $from_url => $to_url ) { - // remap urls in post_content - $query = $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ); - $wpdb->query( $query ); - - // remap enclosure urls - $query = $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url ); - $result = $wpdb->query( $query ); - } - } - - /** - * Update _thumbnail_id meta to new, imported attachment IDs - */ - function remap_featured_images() { - - if ( empty( $this->featured_images ) ) { - return; - } - - // cycle through posts that have a featured image - $this->logger->info( 'Starting remapping of featured images' ); - - foreach ( $this->featured_images as $post_id => $value ) { - if ( isset( $this->mapping['post'][ $value ] ) ) { - $new_id = $this->mapping['post'][ $value ]; - - // only update if there's a difference - if ( $new_id !== $value ) { - $this->logger->info( sprintf( 'Remapping featured image ID %d to new ID %d for post ID %d',$value, $new_id, $post_id ) ); - update_post_meta( $post_id, '_thumbnail_id', $new_id ); - } - } - } - } - - /** - * Decide if the given meta key maps to information we will want to import - * - * @param string $key The meta key to check - * @return string|bool The key if we do want to import, false if not - */ - public function is_valid_meta_key( $key ) { - // skip attachment metadata since we'll regenerate it from scratch - // skip _edit_lock as not relevant for import - if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) ) { - return false; - } - - return $key; - } - - /** - * Decide what the maximum file size for downloaded attachments is. - * Default is 0 (unlimited), can be filtered via import_attachment_size_limit - * - * @return int Maximum attachment file size to import - */ - protected function max_attachment_size() { - return apply_filters( 'import_attachment_size_limit', 0 ); - } - - /** - * Added to http_request_timeout filter to force timeout at 60 seconds during import - * - * @access protected - * @return int 60 - */ - function bump_request_timeout($val) { - return 60; - } - - // return the difference in length between two strings - function cmpr_strlen( $a, $b ) { - return strlen( $b ) - strlen( $a ); - } - - /** - * Prefill existing post data. - * - * This preloads all GUIDs into memory, allowing us to avoid hitting the - * database when we need to check for existence. With larger imports, this - * becomes prohibitively slow to perform SELECT queries on each. - * - * By preloading all this data into memory, it's a constant-time lookup in - * PHP instead. However, this does use a lot more memory, so for sites doing - * small imports onto a large site, it may be a better tradeoff to use - * on-the-fly checking instead. - */ - protected function prefill_existing_posts() { - global $wpdb; - $posts = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts}" ); - - foreach ( $posts as $item ) { - $this->exists['post'][ $item->guid ] = $item->ID; - } - } - - /** - * Does the post exist? - * - * @param array $data Post data to check against. - * @return int|bool Existing post ID if it exists, false otherwise. - */ - protected function post_exists( $data ) { - // Constant-time lookup if we prefilled - $exists_key = $data['guid']; - - $exists = null; - - if ( $this->options['prefill_existing_posts'] ) { - // Sites: fix for custom post types. The guids in the prefilled section are escaped, so these ones should be as well. - $exists_key = htmlentities( $exists_key ); - $exists = isset( $this->exists['post'][ $exists_key ] ) ? $this->exists['post'][ $exists_key ] : false; - } else if ( isset( $this->exists['post'][ $exists_key ] ) ) { - // No prefilling, but might have already handled it - $exists = $this->exists['post'][ $exists_key ]; - } else { - // Still nothing, try post_exists, and cache it - $exists = post_exists( $data['post_title'], $data['post_content'], $data['post_date'] ); - } - - /** - * Filter ID of the existing post corresponding to post currently importing. - * - * Return 0 to force the post to be imported. Filter the ID to be something else - * to override which existing post is mapped to the imported post. - * - * @see post_exists() - * - * @param int $post_exists Post ID, or 0 if post did not exist. - * @param array $data The post array to be inserted. - */ - $exists = apply_filters( 'wp_import_existing_post', $exists, $data ); - - $this->exists['post'][ $exists_key ] = $exists; - - return $exists; - } - - /** - * Mark the post as existing. - * - * @param array $data Post data to mark as existing. - * @param int $post_id Post ID. - */ - protected function mark_post_exists( $data, $post_id ) { - $exists_key = $data['guid']; - $this->exists['post'][ $exists_key ] = $post_id; - } - - /** - * Prefill existing comment data. - * - * @see self::prefill_existing_posts() for justification of why this exists. - */ - protected function prefill_existing_comments() { - global $wpdb; - $posts = $wpdb->get_results( "SELECT comment_ID, comment_author, comment_date FROM {$wpdb->comments}" ); - - foreach ( $posts as $item ) { - $exists_key = sha1( $item->comment_author . ':' . $item->comment_date ); - $this->exists['comment'][ $exists_key ] = $item->comment_ID; - } - } - - /** - * Does the comment exist? - * - * @param array $data Comment data to check against. - * @return int|bool Existing comment ID if it exists, false otherwise. - */ - protected function comment_exists( $data ) { - $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] ); - - // Constant-time lookup if we prefilled - if ( $this->options['prefill_existing_comments'] ) { - return isset( $this->exists['comment'][ $exists_key ] ) ? $this->exists['comment'][ $exists_key ] : false; - } - - // No prefilling, but might have already handled it - if ( isset( $this->exists['comment'][ $exists_key ] ) ) { - return $this->exists['comment'][ $exists_key ]; - } - - // Still nothing, try comment_exists, and cache it - $exists = comment_exists( $data['comment_author'], $data['comment_date'] ); - $this->exists['comment'][ $exists_key ] = $exists; - - return $exists; - } - - /** - * Mark the comment as existing. - * - * @param array $data Comment data to mark as existing. - * @param int $comment_id Comment ID. - */ - protected function mark_comment_exists( $data, $comment_id ) { - $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] ); - $this->exists['comment'][ $exists_key ] = $comment_id; - } - - /** - * Prefill existing term data. - * - * @see self::prefill_existing_posts() for justification of why this exists. - */ - protected function prefill_existing_terms() { - global $wpdb; - $query = "SELECT t.term_id, tt.taxonomy, t.slug FROM {$wpdb->terms} AS t"; - $query .= " JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id"; - $terms = $wpdb->get_results( $query ); - - foreach ( $terms as $item ) { - $exists_key = sha1( $item->taxonomy . ':' . $item->slug ); - $this->exists['term'][ $exists_key ] = $item->term_id; - } - } - - /** - * Does the term exist? - * - * @param array $data Term data to check against. - * @return int|bool Existing term ID if it exists, false otherwise. - */ - protected function term_exists( $data ) { - $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); - - // Constant-time lookup if we prefilled - if ( $this->options['prefill_existing_terms'] ) { - return isset( $this->exists['term'][ $exists_key ] ) ? $this->exists['term'][ $exists_key ] : false; - } - - // No prefilling, but might have already handled it - if ( isset( $this->exists['term'][ $exists_key ] ) ) { - return $this->exists['term'][ $exists_key ]; - } - - // Still nothing, try comment_exists, and cache it - $exists = term_exists( $data['slug'], $data['taxonomy'] ); - if ( is_array( $exists ) ) { - $exists = $exists['term_id']; - } - - $this->exists['term'][ $exists_key ] = $exists; - - return $exists; - } - - /** - * Mark the term as existing. - * - * @param array $data Term data to mark as existing. - * @param int $term_id Term ID. - */ - protected function mark_term_exists( $data, $term_id ) { - $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); - $this->exists['term'][ $exists_key ] = $term_id; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/content-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/content-spacing.php deleted file mode 100644 index 3b90e405..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/content-spacing.php +++ /dev/null @@ -1,244 +0,0 @@ -add_section( - 'generate_spacing_content', - array( - 'title' => __( 'Content', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 10, - 'panel' => 'generate_spacing_panel', - ) -); - -// If we don't have a layout panel, use our old spacing section. -if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { - $content_section = 'generate_layout_container'; -} else { - $content_section = 'generate_spacing_content'; -} - -// Take control of the container width control. -// This control is handled by the free theme, but we take control of it here for consistency between control styles. -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[container_width]', - array( - 'label' => __( 'Container Width', 'gp-premium' ), - 'section' => 'generate_layout_container', - 'settings' => array( - 'desktop' => 'generate_settings[container_width]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 700, - 'max' => 2000, - 'step' => 5, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 0, - ) - ) -); - -// Separating space. -$wp_customize->add_setting( - 'generate_spacing_settings[separator]', - array( - 'default' => $defaults['separator'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[separator]', - array( - 'label' => __( 'Separating Space', 'gp-premium' ), - 'section' => $content_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[separator]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) -); - -// Content padding top. -$wp_customize->add_setting( - 'generate_spacing_settings[content_top]', - array( - 'default' => $defaults['content_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Content padding right. -$wp_customize->add_setting( - 'generate_spacing_settings[content_right]', - array( - 'default' => $defaults['content_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Content padding bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[content_bottom]', - array( - 'default' => $defaults['content_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Content padding left. -$wp_customize->add_setting( - 'generate_spacing_settings[content_left]', - array( - 'default' => $defaults['content_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$content_padding_settings = array( - 'desktop_top' => 'generate_spacing_settings[content_top]', - 'desktop_right' => 'generate_spacing_settings[content_right]', - 'desktop_bottom' => 'generate_spacing_settings[content_bottom]', - 'desktop_left' => 'generate_spacing_settings[content_left]', -); - -// If mobile_content_top is set, the rest of them are too. -// We have to check as these defaults are set in the theme. -if ( isset( $defaults['mobile_content_top'] ) ) { - $content_padding_settings['mobile_top'] = 'generate_spacing_settings[mobile_content_top]'; - $content_padding_settings['mobile_right'] = 'generate_spacing_settings[mobile_content_right]'; - $content_padding_settings['mobile_bottom'] = 'generate_spacing_settings[mobile_content_bottom]'; - $content_padding_settings['mobile_left'] = 'generate_spacing_settings[mobile_content_left]'; - - // Mobile content padding top. - $wp_customize->add_setting( - 'generate_spacing_settings[mobile_content_top]', - array( - 'default' => $defaults['mobile_content_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - // Content padding right. - $wp_customize->add_setting( - 'generate_spacing_settings[mobile_content_right]', - array( - 'default' => $defaults['mobile_content_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - // Content padding bottom. - $wp_customize->add_setting( - 'generate_spacing_settings[mobile_content_bottom]', - array( - 'default' => $defaults['mobile_content_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - // Content padding left. - $wp_customize->add_setting( - 'generate_spacing_settings[mobile_content_left]', - array( - 'default' => $defaults['mobile_content_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); -} - -// Make use of the content padding settings. -$wp_customize->add_control( - new GeneratePress_Spacing_Control( - $wp_customize, - 'content_spacing', - array( - 'type' => 'generatepress-spacing', - 'label' => esc_html__( 'Content Padding', 'gp-premium' ), - 'section' => $content_section, - 'settings' => $content_padding_settings, - 'element' => 'content', - 'priority' => 99, - ) - ) -); - -$wp_customize->add_setting( - 'generate_spacing_settings[content_element_separator]', - array( - 'default' => $defaults['content_element_separator'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[content_element_separator]', - array( - 'label' => __( 'Content Separator', 'gp-premium' ), - 'sub_description' => __( 'The content separator controls the space between the featured image, title, content and entry meta.', 'gp-premium' ), - 'section' => $content_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[content_element_separator]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 10, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) -); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php deleted file mode 100644 index 3ffc54af..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php +++ /dev/null @@ -1,207 +0,0 @@ -add_section( - 'generate_spacing_footer', - array( - 'title' => __( 'Footer', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 20, - 'panel' => 'generate_spacing_panel', - ) -); - -// Use our layout panel if it exists. -if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { - $footer_section = 'generate_layout_footer'; -} else { - $footer_section = 'generate_spacing_footer'; -} - -// Footer widget area padding top. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_widget_container_top]', - array( - 'default' => $defaults['footer_widget_container_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer widget area padding right. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_widget_container_right]', - array( - 'default' => $defaults['footer_widget_container_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer widget area padding bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_widget_container_bottom]', - array( - 'default' => $defaults['footer_widget_container_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer widget area padding left. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_widget_container_left]', - array( - 'default' => $defaults['footer_widget_container_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer widget area padding top. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_footer_widget_container_top]', - array( - 'default' => $defaults['mobile_footer_widget_container_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer widget area padding right. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_footer_widget_container_right]', - array( - 'default' => $defaults['mobile_footer_widget_container_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer widget area padding bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_footer_widget_container_bottom]', - array( - 'default' => $defaults['mobile_footer_widget_container_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer widget area padding left. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_footer_widget_container_left]', - array( - 'default' => $defaults['mobile_footer_widget_container_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Make use of the Footer widget area padding settings. -$wp_customize->add_control( - new GeneratePress_Spacing_Control( - $wp_customize, - 'footer_widget_area_spacing', - array( - 'type' => 'generatepress-spacing', - 'label' => esc_html__( 'Footer Widget Area Padding', 'gp-premium' ), - 'section' => $footer_section, - 'settings' => array( - 'desktop_top' => 'generate_spacing_settings[footer_widget_container_top]', - 'desktop_right' => 'generate_spacing_settings[footer_widget_container_right]', - 'desktop_bottom' => 'generate_spacing_settings[footer_widget_container_bottom]', - 'desktop_left' => 'generate_spacing_settings[footer_widget_container_left]', - 'mobile_top' => 'generate_spacing_settings[mobile_footer_widget_container_top]', - 'mobile_right' => 'generate_spacing_settings[mobile_footer_widget_container_right]', - 'mobile_bottom' => 'generate_spacing_settings[mobile_footer_widget_container_bottom]', - 'mobile_left' => 'generate_spacing_settings[mobile_footer_widget_container_left]', - ), - 'element' => 'footer_widget_area', - 'priority' => 99, - ) - ) -); - -// Footer padding top. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_top]', - array( - 'default' => $defaults['footer_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer padding right. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_right]', - array( - 'default' => $defaults['footer_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer padding bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_bottom]', - array( - 'default' => $defaults['footer_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Footer padding left. -$wp_customize->add_setting( - 'generate_spacing_settings[footer_left]', - array( - 'default' => $defaults['footer_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Make use of the footer padding settings. -$wp_customize->add_control( - new GeneratePress_Spacing_Control( - $wp_customize, - 'footer_spacing', - array( - 'type' => 'generatepress-spacing', - 'label' => esc_html__( 'Footer Padding', 'gp-premium' ), - 'section' => $footer_section, - 'settings' => array( - 'desktop_top' => 'generate_spacing_settings[footer_top]', - 'desktop_right' => 'generate_spacing_settings[footer_right]', - 'desktop_bottom' => 'generate_spacing_settings[footer_bottom]', - 'desktop_left' => 'generate_spacing_settings[footer_left]', - ), - 'element' => 'footer', - 'priority' => 105, - ) - ) -); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/header-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/header-spacing.php deleted file mode 100644 index f937d91b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/header-spacing.php +++ /dev/null @@ -1,135 +0,0 @@ -add_section( - 'generate_spacing_header', - array( - 'title' => __( 'Header', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 5, - 'panel' => 'generate_spacing_panel', - ) -); - -// If we don't have a layout panel, use our old spacing section. -$header_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_header' : 'generate_spacing_header'; - -// Header top. -$wp_customize->add_setting( - 'generate_spacing_settings[header_top]', - array( - 'default' => $defaults['header_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Header right. -$wp_customize->add_setting( - 'generate_spacing_settings[header_right]', - array( - 'default' => $defaults['header_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Header bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[header_bottom]', - array( - 'default' => $defaults['header_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Header left. -$wp_customize->add_setting( - 'generate_spacing_settings[header_left]', - array( - 'default' => $defaults['header_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_header_top]', - array( - 'default' => $defaults['mobile_header_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Header right. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_header_right]', - array( - 'default' => $defaults['mobile_header_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Header bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_header_bottom]', - array( - 'default' => $defaults['mobile_header_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Header left. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_header_left]', - array( - 'default' => $defaults['mobile_header_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Do something with our header controls. -$wp_customize->add_control( - new GeneratePress_Spacing_Control( - $wp_customize, - 'header_spacing', - array( - 'type' => 'generatepress-spacing', - 'label' => esc_html__( 'Header Padding', 'gp-premium' ), - 'section' => $header_section, - 'settings' => array( - 'desktop_top' => 'generate_spacing_settings[header_top]', - 'desktop_right' => 'generate_spacing_settings[header_right]', - 'desktop_bottom' => 'generate_spacing_settings[header_bottom]', - 'desktop_left' => 'generate_spacing_settings[header_left]', - 'mobile_top' => 'generate_spacing_settings[mobile_header_top]', - 'mobile_right' => 'generate_spacing_settings[mobile_header_right]', - 'mobile_bottom' => 'generate_spacing_settings[mobile_header_bottom]', - 'mobile_left' => 'generate_spacing_settings[mobile_header_left]', - ), - 'element' => 'header', - ) - ) -); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/js/customizer.js deleted file mode 100644 index 966c3eaa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/js/customizer.js +++ /dev/null @@ -1,661 +0,0 @@ -function generate_spacing_live_update( name, id, selector, property, negative, divide, media, unit ) { - settings = typeof settings !== 'undefined' ? settings : 'generate_spacing_settings'; - wp.customize( settings + '[' + id + ']', function( value ) { - value.bind( function( newval ) { - negative = typeof negative !== 'undefined' ? negative : false; - media = typeof media !== 'undefined' ? media : ''; - divide = typeof divide !== 'undefined' ? divide : false; - unit = typeof unit !== 'undefined' ? unit : 'px'; - - // Get new value - newval = ( divide ) ? newval / 2 : newval; - - // Check if negative integer - negative = ( negative ) ? '-' : ''; - - var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false, - isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false; - - if ( isTablet ) { - if ( '' == wp.customize(settings + '[' + id + ']').get() ) { - var desktopID = id.replace( 'tablet_', '' ); - newval = wp.customize(settings + '[' + desktopID + ']').get(); - } - } - - if ( isMobile ) { - if ( '' == wp.customize(settings + '[' + id + ']').get() ) { - var desktopID = id.replace( 'mobile_', '' ); - newval = wp.customize(settings + '[' + desktopID + ']').get(); - } - } - - // We're using a desktop value - if ( ! isTablet && ! isMobile ) { - - var tabletValue = ( typeof wp.customize(settings + '[tablet_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[tablet_' + id + ']').get() : '', - mobileValue = ( typeof wp.customize(settings + '[mobile_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[mobile_' + id + ']').get() : ''; - - // The tablet setting exists, mobile doesn't - if ( '' !== tabletValue && '' == mobileValue ) { - media = gp_spacing.desktop + ', ' + gp_spacing.mobile; - } - - // The tablet setting doesn't exist, mobile does - if ( '' == tabletValue && '' !== mobileValue ) { - media = gp_spacing.desktop + ', ' + gp_spacing.tablet; - } - - // The tablet setting doesn't exist, neither does mobile - if ( '' == tabletValue && '' == mobileValue ) { - media = gp_spacing.desktop + ', ' + gp_spacing.tablet + ', ' + gp_spacing.mobile; - } - - } - - // Check if media query - media_query = ( '' !== media ) ? 'media="' + media + '"' : ''; - - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#' + name ).not( ':last' ).remove(); - }, 50 ); - - jQuery('body').trigger('generate_spacing_updated'); - } ); - } ); -} - -/** - * Top bar padding - */ -generate_spacing_live_update( 'top_bar_top', 'top_bar_top', '.inside-top-bar', 'padding-top' ); -generate_spacing_live_update( 'top_bar_right', 'top_bar_right', '.inside-top-bar', 'padding-right' ); -generate_spacing_live_update( 'top_bar_bottom', 'top_bar_bottom', '.inside-top-bar', 'padding-bottom' ); -generate_spacing_live_update( 'top_bar_left', 'top_bar_left', '.inside-top-bar', 'padding-left' ); - -/** - * Header padding - */ -generate_spacing_live_update( 'header_top', 'header_top', '.inside-header', 'padding-top', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'header_right', 'header_right', '.inside-header', 'padding-right', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'header_bottom', 'header_bottom', '.inside-header', 'padding-bottom', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'header_left', 'header_left', '.inside-header', 'padding-left', false, false, gp_spacing.desktop ); - -generate_spacing_live_update( 'mobile_header_top', 'mobile_header_top', '.inside-header', 'padding-top', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_header_right', 'mobile_header_right', '.inside-header', 'padding-right', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_header_bottom', 'mobile_header_bottom', '.inside-header', 'padding-bottom', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_header_left', 'mobile_header_left', '.inside-header', 'padding-left', false, false, gp_spacing.mobile ); - -jQuery( window ).on( 'load', function() { - var containerAlignment = wp.customize( 'generate_settings[container_alignment]' ); - - if ( gp_spacing.isFlex && containerAlignment && 'text' === containerAlignment.get() ) { - generate_spacing_live_update( 'header_left_sticky_nav', 'header_left', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-left', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'header_right_sticky_nav', 'header_right', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-right', false, false, gp_spacing.desktop ); - - generate_spacing_live_update( 'mobile_header_left_sticky_nav', 'mobile_header_left', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-left', false, false, gp_spacing.mobile ); - generate_spacing_live_update( 'mobile_header_right_sticky_nav', 'mobile_header_right', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-right', false, false, gp_spacing.mobile ); - } -} ); - -/** - * Content padding - */ -var content_areas = '.separate-containers .inside-article, \ - .separate-containers .comments-area, \ - .separate-containers .page-header, \ - .separate-containers .paging-navigation, \ - .one-container .site-content, \ - .inside-page-header, \ - .wp-block-group__inner-container'; - -generate_spacing_live_update( 'content_top', 'content_top', content_areas, 'padding-top', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'content_right', 'content_right', content_areas, 'padding-right', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'content_bottom', 'content_bottom', content_areas, 'padding-bottom', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'content_left', 'content_left', content_areas, 'padding-left', false, false, gp_spacing.desktop ); - -jQuery( window ).on( 'load', function() { - var containerAlignment = wp.customize( 'generate_settings[container_alignment]' ); - - if ( gp_spacing.isFlex && containerAlignment && 'text' === containerAlignment.get() ) { - generate_spacing_live_update( 'content_left_nav_as_header', 'content_left', '.main-navigation.has-branding .inside-navigation.grid-container, .main-navigation.has-branding .inside-navigation.grid-container', 'padding-left', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'content_right_nav_as_header', 'content_right', '.main-navigation.has-branding .inside-navigation.grid-container, .main-navigation.has-branding .inside-navigation.grid-container', 'padding-right', false, false, gp_spacing.desktop ); - } -} ); - -generate_spacing_live_update( 'one_container_post_content_bottom', 'content_bottom', '.one-container.archive .post:not(:last-child):not(.is-loop-template-item),.one-container.blog .post:not(:last-child):not(.is-loop-template-item)', 'padding-bottom' ); - -/* Mobile content padding */ -generate_spacing_live_update( 'mobile_content_top', 'mobile_content_top', content_areas, 'padding-top', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_content_right', 'mobile_content_right', content_areas, 'padding-right', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_content_bottom', 'mobile_content_bottom', content_areas, 'padding-bottom', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_content_left', 'mobile_content_left', content_areas, 'padding-left', false, false, gp_spacing.mobile ); - -generate_spacing_live_update( 'content-margin-right', 'content_right', '.one-container.right-sidebar .site-main,.one-container.both-right .site-main', 'margin-right' ); -generate_spacing_live_update( 'content-margin-left', 'content_left', '.one-container.left-sidebar .site-main,.one-container.both-left .site-main', 'margin-left' ); -generate_spacing_live_update( 'content-margin-right-both', 'content_right', '.one-container.both-sidebars .site-main', 'margin-right' ); -generate_spacing_live_update( 'content-margin-left-both', 'content_left', '.one-container.both-sidebars .site-main', 'margin-left' ); - -/* Content element separator */ - -generate_spacing_live_update( 'content_element_separator_top', 'content_element_separator', '.post-image:not(:first-child), .page-content:not(:first-child), .entry-content:not(:first-child), .entry-summary:not(:first-child), footer.entry-meta', 'margin-top', false, false, false, 'em' ); -generate_spacing_live_update( 'content_element_separator_bottom', 'content_element_separator', '.post-image-above-header .inside-article div.featured-image, .post-image-above-header .inside-article div.post-image', 'margin-bottom', false, false, false, 'em' ); - -/** - * Featured image padding - */ -var featured_image_no_padding_x = '.post-image-below-header.post-image-aligned-center .no-featured-image-padding .post-image, \ - .post-image-below-header.post-image-aligned-center .no-featured-image-padding .featured-image'; - -generate_spacing_live_update( 'featured_image_padding_right', 'content_right', featured_image_no_padding_x, 'margin-right', true, false, gp_spacing.desktop ); -generate_spacing_live_update( 'featured_image_padding_left', 'content_left', featured_image_no_padding_x, 'margin-left', true, false, gp_spacing.desktop ); -generate_spacing_live_update( 'mobile_featured_image_padding_right', 'mobile_content_right', featured_image_no_padding_x, 'margin-right', true, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_featured_image_padding_left', 'mobile_content_left', featured_image_no_padding_x, 'margin-left', true, false, gp_spacing.mobile ); - -var featured_image_no_padding_y = '.post-image-above-header.post-image-aligned-center .no-featured-image-padding .post-image, \ - .post-image-above-header.post-image-aligned-center .no-featured-image-padding .featured-image'; - -generate_spacing_live_update( 'featured_image_padding_top', 'content_top', featured_image_no_padding_y, 'margin-top', true, false, gp_spacing.desktop ); -generate_spacing_live_update( 'featured_image_padding_right', 'content_right', featured_image_no_padding_y, 'margin-right', true, false, gp_spacing.desktop ); -generate_spacing_live_update( 'featured_image_padding_left', 'content_left', featured_image_no_padding_y, 'margin-left', true, false, gp_spacing.desktop ); -generate_spacing_live_update( 'mobile_featured_image_padding_top', 'mobile_content_top', featured_image_no_padding_y, 'margin-top', true, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_featured_image_padding_right', 'mobile_content_right', featured_image_no_padding_y, 'margin-right', true, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_featured_image_padding_left', 'mobile_content_left', featured_image_no_padding_y, 'margin-left', true, false, gp_spacing.mobile ); - -/** - * Main navigation spacing - */ -var menu_items = '.main-navigation .main-nav ul li a,\ - .main-navigation .menu-toggle,\ - .main-navigation .mobile-bar-items a,\ - .main-navigation .menu-bar-item > a'; - -// Menu item width -generate_spacing_live_update( 'menu_item_padding_left', 'menu_item', menu_items + ', .slideout-navigation button.slideout-exit', 'padding-left', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'menu_item_padding_right', 'menu_item', menu_items + ', .slideout-navigation button.slideout-exit', 'padding-right', false, false, gp_spacing.desktop ); - -// Tablet menu item width -//generate_spacing_live_update( 'tablet_menu_item_padding_left', 'tablet_menu_item', menu_items, 'padding-left', false, false, gp_spacing.tablet ); -//generate_spacing_live_update( 'tablet_menu_item_padding_right', 'tablet_menu_item', menu_items, 'padding-right', false, false, gp_spacing.tablet ); - -// Mobile menu item width -generate_spacing_live_update( 'mobile_menu_item_padding_left', 'mobile_menu_item', '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a, .main-navigation .menu-bar-item > a', 'padding-left', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_menu_item_padding_right', 'mobile_menu_item', '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a, .main-navigation .menu-bar-item > a', 'padding-right', false, false, gp_spacing.mobile ); - -// Menu item height -generate_spacing_live_update( 'menu_item_height', 'menu_item_height', menu_items, 'line-height', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'navigation_logo_height', 'menu_item_height', '.main-navigation .navigation-logo img, .main-navigation .site-logo img', 'height', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'nav_title_height', 'menu_item_height', '.navigation-branding .main-title', 'line-height', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'mobile_header_logo_height', 'menu_item_height', '.mobile-header-navigation .mobile-header-logo img', 'height', false, false, gp_spacing.desktop ); - -//generate_spacing_live_update( 'tablet_menu_item_height', 'tablet_menu_item_height', menu_items, 'line-height', false, false, gp_spacing.tablet ); -//generate_spacing_live_update( 'tablet_navigation_logo_height', 'tablet_menu_item_height', '.main-navigation .navigation-logo img', 'height', false, false, gp_spacing.tablet ); -//generate_spacing_live_update( 'tablet_mobile_header_logo_height', 'tablet_menu_item_height', '.mobile-header-navigation .mobile-header-logo img', 'height', false, false, gp_spacing.tablet ); - -generate_spacing_live_update( 'mobile_menu_item_height', 'mobile_menu_item_height', menu_items, 'line-height', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_navigation_logo_height', 'mobile_menu_item_height', '.main-navigation .site-logo.navigation-logo img, .main-navigation .site-logo img, .main-navigation .navigation-branding img', 'height', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_nav_title_height', 'menu_item_height', '.navigation-branding .main-title', 'line-height', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_mobile_header_logo_height', 'mobile_menu_item_height', '.mobile-header-navigation .site-logo.mobile-header-logo img', 'height', false, false, gp_spacing.mobile ); - -// Off canvas menu item height -wp.customize( 'generate_spacing_settings[off_canvas_menu_item_height]', function( value ) { - value.bind( function( newval ) { - - if ( '' == newval ) { - newval = wp.customize('generate_spacing_settings[menu_item_height]').get(); - } - - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#off_canvas_menu_item_height' ).not( ':last' ).remove(); - }, 200 ); - - } ); -} ); - -/** - * Main sub-navigation spacing - */ -generate_spacing_live_update( 'sub_menu_item_height_top', 'sub_menu_item_height', '.main-navigation .main-nav ul ul li a', 'padding-top' ); -generate_spacing_live_update( 'sub_menu_item_height_right', 'menu_item', '.main-navigation .main-nav ul ul li a', 'padding-right', false, false, gp_spacing.desktop ); -//generate_spacing_live_update( 'tablet_sub_menu_item_height_right', 'tablet_menu_item', '.main-navigation .main-nav ul ul li a', 'padding-right', false, false, gp_spacing.tablet ); -generate_spacing_live_update( 'sub_menu_item_height_bottom', 'sub_menu_item_height', '.main-navigation .main-nav ul ul li a', 'padding-bottom' ); -generate_spacing_live_update( 'sub_menu_item_height_left', 'menu_item', '.main-navigation .main-nav ul ul li a', 'padding-left', false, false, gp_spacing.desktop ); -//generate_spacing_live_update( 'tablet_sub_menu_item_height_left', 'tablet_menu_item', '.main-navigation .main-nav ul ul li a', 'padding-left', false, false, gp_spacing.tablet ); -generate_spacing_live_update( 'sub_menu_item_offset', 'menu_item_height', '.main-navigation ul ul', 'top' ); - -/** - * Main navigation RTL arrow spacing - */ -generate_spacing_live_update( 'dropdown_menu_arrow', 'menu_item', '.menu-item-has-children .dropdown-menu-toggle', 'padding-right', false, false, gp_spacing.desktop ); -//generate_spacing_live_update( 'tablet_dropdown_menu_arrow', 'tablet_menu_item', '.menu-item-has-children .dropdown-menu-toggle', 'padding-right', false, false, gp_spacing.tablet ); - -/** - * Main sub-navigation arrow spacing - */ -generate_spacing_live_update( 'dropdown_submenu_arrow_top', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'padding-top' ); -generate_spacing_live_update( 'dropdown_submenu_arrow_bottom', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'padding-bottom' ); -generate_spacing_live_update( 'dropdown_submenu_arrow_margin', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'margin-top', true ); - -/** - * Sub-Menu Width - */ -generate_spacing_live_update( 'sub_menu_width', 'sub_menu_width', '.main-navigation ul ul', 'width' ); - -/** - - * Sticky menu item height - - */ -wp.customize( 'generate_spacing_settings[sticky_menu_item_height]', function( value ) { - value.bind( function( newval ) { - - if ( '' == newval ) { - newval = wp.customize('generate_spacing_settings[menu_item_height]').get(); - } - - jQuery( 'head' ).append( '' ); - jQuery( 'head' ).append( '' ); - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#sticky_menu_item_height' ).not( ':last' ).remove(); - jQuery( 'style#sticky_menu_item_logo_height' ).not( ':last' ).remove(); - jQuery( 'style#sticky_menu_item_height_transition' ).remove(); - }, 200 ); - - } ); -} ); - -// Disable the transition while we resize -wp.customize( 'generate_spacing_settings[menu_item_height]', function( value ) { - value.bind( function( newval ) { - - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#menu_item_height_transition' ).remove(); - }, 200 ); - - } ); -} ); - -wp.customize( 'generate_spacing_settings[off_canvas_menu_item_height]', function( value ) { - value.bind( function( newval ) { - - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#off_canvas_menu_item_height_transition' ).remove(); - }, 200 ); - - } ); -} ); - -/** - * Widget padding - */ -generate_spacing_live_update( 'widget_top', 'widget_top', '.widget-area .widget, .one-container .widget-area .widget', 'padding-top', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'widget_right', 'widget_right', '.widget-area .widget, .one-container .widget-area .widget', 'padding-right', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'widget_bottom', 'widget_bottom', '.widget-area .widget, .one-container .widget-area .widget', 'padding-bottom', false, false, gp_spacing.desktop ); -generate_spacing_live_update( 'widget_left', 'widget_left', '.widget-area .widget, .one-container .widget-area .widget', 'padding-left', false, false, gp_spacing.desktop ); - -generate_spacing_live_update( 'mobile_widget_top', 'mobile_widget_top', '.widget-area .widget', 'padding-top', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_widget_right', 'mobile_widget_right', '.widget-area .widget', 'padding-right', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_widget_bottom', 'mobile_widget_bottom', '.widget-area .widget', 'padding-bottom', false, false, gp_spacing.mobile ); -generate_spacing_live_update( 'mobile_widget_left', 'mobile_widget_left', '.widget-area .widget', 'padding-left', false, false, gp_spacing.mobile ); - - -if ( gp_spacing.isFlex ) { - /** - * Footer widget area - */ - generate_spacing_live_update( 'footer_widget_container_top', 'footer_widget_container_top', '.footer-widgets-container', 'padding-top', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'footer_widget_container_right', 'footer_widget_container_right', '.footer-widgets-container', 'padding-right', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'footer_widget_container_bottom', 'footer_widget_container_bottom', '.footer-widgets-container', 'padding-bottom', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'footer_widget_container_left', 'footer_widget_container_left', '.footer-widgets-container', 'padding-left', false, false, gp_spacing.desktop ); - - generate_spacing_live_update( 'mobile_footer_widget_container_top', 'mobile_footer_widget_container_top', '.footer-widgets-container', 'padding-top', false, false, gp_spacing.mobile ); - generate_spacing_live_update( 'mobile_footer_widget_container_right', 'mobile_footer_widget_container_right', '.footer-widgets-container', 'padding-right', false, false, gp_spacing.mobile ); - generate_spacing_live_update( 'mobile_footer_widget_container_bottom', 'mobile_footer_widget_container_bottom', '.footer-widgets-container', 'padding-bottom', false, false, gp_spacing.mobile ); - generate_spacing_live_update( 'mobile_footer_widget_container_left', 'mobile_footer_widget_container_left', '.footer-widgets-container', 'padding-left', false, false, gp_spacing.mobile ); - - /** - * Footer - */ - generate_spacing_live_update( 'footer_top', 'footer_top', '.inside-site-info', 'padding-top' ); - generate_spacing_live_update( 'footer_right', 'footer_right', '.inside-site-info', 'padding-right' ); - generate_spacing_live_update( 'footer_bottom', 'footer_bottom', '.inside-site-info', 'padding-bottom' ); - generate_spacing_live_update( 'footer_left', 'footer_left', '.inside-site-info', 'padding-left' ); -} else { - /** - * Footer widget area - */ - generate_spacing_live_update( 'footer_widget_container_top', 'footer_widget_container_top', '.footer-widgets', 'padding-top', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'footer_widget_container_right', 'footer_widget_container_right', '.footer-widgets', 'padding-right', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'footer_widget_container_bottom', 'footer_widget_container_bottom', '.footer-widgets', 'padding-bottom', false, false, gp_spacing.desktop ); - generate_spacing_live_update( 'footer_widget_container_left', 'footer_widget_container_left', '.footer-widgets', 'padding-left', false, false, gp_spacing.desktop ); - - generate_spacing_live_update( 'mobile_footer_widget_container_top', 'mobile_footer_widget_container_top', '.footer-widgets', 'padding-top', false, false, gp_spacing.mobile ); - generate_spacing_live_update( 'mobile_footer_widget_container_right', 'mobile_footer_widget_container_right', '.footer-widgets', 'padding-right', false, false, gp_spacing.mobile ); - generate_spacing_live_update( 'mobile_footer_widget_container_bottom', 'mobile_footer_widget_container_bottom', '.footer-widgets', 'padding-bottom', false, false, gp_spacing.mobile ); - generate_spacing_live_update( 'mobile_footer_widget_container_left', 'mobile_footer_widget_container_left', '.footer-widgets', 'padding-left', false, false, gp_spacing.mobile ); - - /** - * Footer - */ - generate_spacing_live_update( 'footer_top', 'footer_top', '.site-info', 'padding-top' ); - generate_spacing_live_update( 'footer_right', 'footer_right', '.site-info', 'padding-right' ); - generate_spacing_live_update( 'footer_bottom', 'footer_bottom', '.site-info', 'padding-bottom' ); - generate_spacing_live_update( 'footer_left', 'footer_left', '.site-info', 'padding-left' ); -} - - -/** - * Separator - */ - -/* Masonry */ -if ( jQuery( 'body' ).hasClass( 'masonry-enabled' ) ) { - generate_spacing_live_update( 'masonry_separator', 'separator', '.masonry-post .inside-article', 'margin-left' ); - generate_spacing_live_update( 'masonry_separator_bottom', 'separator', '.masonry-container > article', 'margin-bottom' ); - generate_spacing_live_update( 'masonry_separator_container', 'separator', '.masonry-container', 'margin-left', 'negative' ); - generate_spacing_live_update( 'masonry_separator_page_header_left', 'separator', '.masonry-enabled .page-header', 'margin-left' ); - generate_spacing_live_update( 'masonry_separator_page_header_bottom', 'separator', '.masonry-enabled .page-header', 'margin-bottom' ); - generate_spacing_live_update( 'masonry_separator_load_more', 'separator', '.separate-containers .site-main > .masonry-load-more', 'margin-bottom' ); -} - -/* Columns */ -if ( jQuery( 'body' ).hasClass( 'generate-columns-activated' ) ) { - generate_spacing_live_update( 'columns_bottom', 'separator', '.generate-columns', 'margin-bottom' ); - generate_spacing_live_update( 'columns_left', 'separator', '.generate-columns', 'padding-left' ); - generate_spacing_live_update( 'columns_container', 'separator', '.generate-columns-container', 'margin-left', 'negative' ); - generate_spacing_live_update( 'columns_page_header_bottom', 'separator', '.generate-columns-container .page-header', 'margin-bottom' ); - generate_spacing_live_update( 'columns_page_header_left', 'separator', '.generate-columns-container .page-header', 'margin-left' ); - generate_spacing_live_update( 'columns_pagination', 'separator', '.separate-containers .generate-columns-container > .paging-navigation', 'margin-left' ); -} - -/* Right sidebar */ -if ( jQuery( 'body' ).hasClass( 'right-sidebar' ) ) { - generate_spacing_live_update( 'right_sidebar_sepatator_top', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-top' ); - generate_spacing_live_update( 'right_sidebar_sepatator_right', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-right' ); - generate_spacing_live_update( 'right_sidebar_sepatator_bottom', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-bottom' ); -} - -/* Left sidebar */ -if ( jQuery( 'body' ).hasClass( 'left-sidebar' ) ) { - generate_spacing_live_update( 'left_sidebar_sepatator_top', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-top' ); - generate_spacing_live_update( 'left_sidebar_sepatator_left', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-left' ); - generate_spacing_live_update( 'left_sidebar_sepatator_bottom', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-bottom' ); -} - -/* Both sidebars */ -if ( jQuery( 'body' ).hasClass( 'both-sidebars' ) ) { - generate_spacing_live_update( 'both_sidebars_sepatator', 'separator', '.both-sidebars.separate-containers .site-main', 'margin' ); -} - -/* Both sidebars right */ -if ( jQuery( 'body' ).hasClass( 'both-right' ) ) { - generate_spacing_live_update( 'both_right_sidebar_sepatator_top', 'separator', '.both-right.separate-containers .site-main', 'margin-top' ); - generate_spacing_live_update( 'both_right_sidebar_sepatator_right', 'separator', '.both-right.separate-containers .site-main', 'margin-right' ); - generate_spacing_live_update( 'both_right_sidebar_sepatator_bottom', 'separator', '.both-right.separate-containers .site-main', 'margin-bottom' ); - - if ( gp_spacing.isFlex ) { - generate_spacing_live_update( 'both_right_left_sidebar', 'separator', '.both-right .inside-left-sidebar', 'margin-right', false, true ); - generate_spacing_live_update( 'both_right_right_sidebar', 'separator', '.both-right .inside-right-sidebar', 'margin-left', false, true ); - } else { - generate_spacing_live_update( 'both_right_left_sidebar', 'separator', '.both-right.separate-containers .inside-left-sidebar', 'margin-right', false, true ); - generate_spacing_live_update( 'both_right_right_sidebar', 'separator', '.both-right.separate-containers .inside-right-sidebar', 'margin-left', false, true ); - } -} - -/* Both sidebars left */ -if ( jQuery( 'body' ).hasClass( 'both-left' ) ) { - generate_spacing_live_update( 'both_left_sidebar_sepatator_top', 'separator', '.both-left.separate-containers .site-main', 'margin-top' ); - generate_spacing_live_update( 'both_left_sidebar_sepatator_right', 'separator', '.both-left.separate-containers .site-main', 'margin-bottom' ); - generate_spacing_live_update( 'both_left_sidebar_sepatator_bottom', 'separator', '.both-left.separate-containers .site-main', 'margin-left' ); - - if ( gp_spacing.isFlex ) { - generate_spacing_live_update( 'both_left_left_sidebar', 'separator', '.both-left .inside-left-sidebar', 'margin-right', false, true ); - generate_spacing_live_update( 'both_left_right_sidebar', 'separator', '.both-left .inside-right-sidebar', 'margin-left', false, true ); - } else { - generate_spacing_live_update( 'both_left_left_sidebar', 'separator', '.both-left.separate-containers .inside-left-sidebar', 'margin-right', false, true ); - generate_spacing_live_update( 'both_left_right_sidebar', 'separator', '.both-left.separate-containers .inside-right-sidebar', 'margin-left', false, true ); - } -} - -/* Main element margin */ -generate_spacing_live_update( 'site_main_separator_top', 'separator', '.separate-containers .site-main', 'margin-top' ); -generate_spacing_live_update( 'site_main_separator_bottom', 'separator', '.separate-containers .site-main', 'margin-bottom' ); - -/* Page header element */ -if ( gp_spacing.isFlex ) { - generate_spacing_live_update( 'page_header_separator_top', 'separator', '.separate-containers .featured-image', 'margin-top' ); -} else { - generate_spacing_live_update( 'page_header_separator_top', 'separator', - '.separate-containers .page-header-image, \ - .separate-containers .page-header-contained, \ - .separate-containers .page-header-image-single, \ - .separate-containers .page-header-content-single', 'margin-top' ); -} - -/* Top and bottom sidebar margin */ -generate_spacing_live_update( 'right_sidebar_separator_top', 'separator', '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar', 'margin-top' ); -generate_spacing_live_update( 'right_sidebar_separator_bottom', 'separator', '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar', 'margin-bottom' ); - -/* Element separators */ -if ( gp_spacing.isFlex ) { - generate_spacing_live_update( 'content_separator', 'separator', - '.sidebar .widget, \ - .site-main > *, \ - .page-header, \ - .widget-area .main-navigation', 'margin-bottom' ); -} else { - generate_spacing_live_update( 'content_separator', 'separator', - '.separate-containers .widget, \ - .separate-containers .site-main > *, \ - .separate-containers .page-header, \ - .widget-area .main-navigation', 'margin-bottom' ); -} - -/** - * Right sidebar width - */ -wp.customize( 'generate_spacing_settings[right_sidebar_width]', function( value ) { - value.bind( function( newval ) { - var body = jQuery( 'body' ); - - if ( jQuery( '#right-sidebar' ).length ) { - if ( gp_spacing.isFlex ) { - var contentWidth = 100, - leftSidebar = jQuery( '#left-sidebar' ).length ? wp.customize.value('generate_spacing_settings[left_sidebar_width]')() : 0; - - if ( body.hasClass( 'right-sidebar' ) ) { - contentWidth = ( Number( contentWidth ) - Number( newval ) ); - } else if ( ! body.hasClass( 'left-sidebar' ) && ! body.hasClass( 'no-sidebar' ) ) { - var totalSidebarWidth = ( Number( leftSidebar ) + Number( newval ) ); - - contentWidth = ( Number( contentWidth ) - Number( totalSidebarWidth ) ); - } - - jQuery( 'head' ).append( '' ); - - setTimeout(function() { - jQuery( 'style#right_sidebar_width' ).not( ':last' ).remove(); - }, 200 ); - } else { - // Left sidebar width - var left_sidebar = ( jQuery( '#left-sidebar' ).length ) ? wp.customize.value('generate_spacing_settings[left_sidebar_width]')() : 0; - - // Right sidebar class - jQuery( "#right-sidebar" ).removeClass(function (index, css) { - return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); - }).addClass( 'grid-' + newval ).addClass( 'tablet-grid-' + newval ).addClass( 'grid-parent' ); - - // Content area class - jQuery( ".content-area" ).removeClass(function (index, css) { - return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); - }).addClass( 'grid-' + ( 100 - newval - left_sidebar ) ).addClass( 'tablet-grid-' + ( 100 - newval - left_sidebar ) ).addClass( 'grid-parent' ); - - if ( body.hasClass( 'both-sidebars' ) ) { - var content_width = ( 100 - newval - left_sidebar ); - jQuery( '#left-sidebar' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)push-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); - }).addClass( 'pull-' + ( content_width ) ).addClass( 'tablet-pull-' + ( content_width ) ); - } - - if ( body.hasClass( 'both-left' ) ) { - var total_sidebar_width = ( parseInt( left_sidebar ) + parseInt( newval ) ); - - jQuery( '#right-sidebar' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); - - jQuery( '#left-sidebar' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); - - jQuery( '.content-area' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)push-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); - }).addClass( 'push-' + ( total_sidebar_width ) ).addClass( 'tablet-push-' + ( total_sidebar_width ) ); - } - } - jQuery('body').trigger('generate_spacing_updated'); - } - } ); -} ); - -/** - * Left sidebar width - */ -wp.customize( 'generate_spacing_settings[left_sidebar_width]', function( value ) { - value.bind( function( newval ) { - var body = jQuery( 'body' ); - if ( jQuery( '#left-sidebar' ).length ) { - if ( gp_spacing.isFlex ) { - var contentWidth = 100, - rightSidebar = jQuery( '#right-sidebar' ).length ? wp.customize.value('generate_spacing_settings[right_sidebar_width]')() : 0; - - if ( body.hasClass( 'left-sidebar' ) ) { - contentWidth = ( Number( contentWidth ) - Number( newval ) ); - } else if ( ! body.hasClass( 'right-sidebar' ) && ! body.hasClass( 'no-sidebar' ) ) { - var totalSidebarWidth = ( Number( rightSidebar ) + Number( newval ) ); - - contentWidth = ( Number( contentWidth ) - Number( totalSidebarWidth ) ); - } - - jQuery( 'head' ).append( '' ); - - setTimeout(function() { - jQuery( 'style#left_sidebar_width' ).not( ':last' ).remove(); - }, 200 ); - } else { - // Right sidebar width - var right_sidebar = ( jQuery( '#right-sidebar' ).length ) ? wp.customize.value('generate_spacing_settings[right_sidebar_width]')() : 0; - - // Right sidebar class - jQuery( "#left-sidebar" ).removeClass(function (index, css) { - return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); - }).addClass( 'grid-' + newval ).addClass( 'tablet-grid-' + newval ).addClass( 'grid-parent' ); - - // Content area class - jQuery( ".content-area" ).removeClass(function (index, css) { - return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); - }).addClass( 'grid-' + ( 100 - newval - right_sidebar ) ).addClass( 'tablet-grid-' + ( 100 - newval - right_sidebar ) ).addClass( 'grid-parent' ); - - if ( body.hasClass( 'left-sidebar' ) ) { - jQuery( '#left-sidebar' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)push-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); - }).addClass( 'pull-' + ( 100 - newval ) ).addClass( 'tablet-pull-' + ( 100 - newval ) ); - - jQuery( '.content-area' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)push-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); - }).addClass( 'push-' + newval ).addClass( 'tablet-push-' + newval ).addClass( 'grid-' + ( 100 - newval ) ).addClass( 'tablet-grid-' + ( 100 - newval ) ); - } - - if ( body.hasClass( 'both-sidebars' ) ) { - var content_width = ( 100 - newval - right_sidebar ); - jQuery( '#left-sidebar' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)push-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); - }).addClass( 'pull-' + ( content_width ) ).addClass( 'tablet-pull-' + ( content_width ) ); - - jQuery( '.content-area' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)push-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); - }).addClass( 'push-' + ( newval ) ).addClass( 'tablet-push-' + ( newval ) ); - } - - if ( body.hasClass( 'both-left' ) ) { - var content_width = ( 100 - newval - right_sidebar ); - var total_sidebar_width = ( parseInt( right_sidebar ) + parseInt( newval ) ); - - jQuery( '#right-sidebar' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); - - jQuery( '#left-sidebar' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); - - jQuery( '.content-area' ).removeClass(function (index, css) { - return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)push-\S+/g) || []).join(' '); - }).removeClass(function (index, css) { - return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); - }).addClass( 'push-' + ( total_sidebar_width ) ).addClass( 'tablet-push-' + ( total_sidebar_width ) ); - } - } - jQuery('body').trigger('generate_spacing_updated'); - } - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php deleted file mode 100644 index 09884e67..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php +++ /dev/null @@ -1,281 +0,0 @@ -add_section( - 'generate_spacing_navigation', - array( - 'title' => __( 'Primary Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 15, - 'panel' => 'generate_spacing_panel', - ) -); - -// If our new Layout section doesn't exist, use the old navigation section. -$navigation_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_navigation' : 'generate_spacing_navigation'; - -// Menu item width. -$wp_customize->add_setting( - 'generate_spacing_settings[menu_item]', - array( - 'default' => $defaults['menu_item'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_menu_item]', - array( - 'default' => $defaults['mobile_menu_item'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[menu_item]', - array( - 'label' => __( 'Menu Item Width', 'gp-premium' ), - 'section' => $navigation_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[menu_item]', - 'mobile' => 'generate_spacing_settings[mobile_menu_item]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 220, - ) - ) -); - -// Menu item height. -$wp_customize->add_setting( - 'generate_spacing_settings[menu_item_height]', - array( - 'default' => $defaults['menu_item_height'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_menu_item_height]', - array( - 'default' => $defaults['mobile_menu_item_height'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[menu_item_height]', - array( - 'label' => __( 'Menu Item Height', 'gp-premium' ), - 'section' => $navigation_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[menu_item_height]', - 'mobile' => 'generate_spacing_settings[mobile_menu_item_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 20, - 'max' => 150, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 20, - 'max' => 150, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 240, - ) - ) -); - -// Sub-menu item height. -$wp_customize->add_setting( - 'generate_spacing_settings[sub_menu_item_height]', - array( - 'default' => $defaults['sub_menu_item_height'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[sub_menu_item_height]', - array( - 'label' => __( 'Sub-Menu Item Height', 'gp-premium' ), - 'section' => $navigation_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[sub_menu_item_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 50, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 260, - ) - ) -); - -if ( isset( $defaults['sub_menu_width'] ) ) { - $wp_customize->add_setting( - 'generate_spacing_settings[sub_menu_width]', - array( - 'default' => $defaults['sub_menu_width'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[sub_menu_width]', - array( - 'label' => __( 'Sub-Menu Width', 'gp-premium' ), - 'section' => $navigation_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[sub_menu_width]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 100, - 'max' => 500, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 265, - ) - ) - ); -} - -// Sticky menu height. -$wp_customize->add_setting( - 'generate_spacing_settings[sticky_menu_item_height]', - array( - 'default' => $defaults['sticky_menu_item_height'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[sticky_menu_item_height]', - array( - 'label' => __( 'Menu Item Height', 'gp-premium' ), - 'section' => 'menu_plus_sticky_menu', - 'settings' => array( - 'desktop' => 'generate_spacing_settings[sticky_menu_item_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 20, - 'max' => 150, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 150, - 'active_callback' => 'generate_sticky_navigation_activated', - ) - ) -); - -// Off canvas menu height. -$wp_customize->add_setting( - 'generate_spacing_settings[off_canvas_menu_item_height]', - array( - 'default' => $defaults['off_canvas_menu_item_height'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[off_canvas_menu_item_height]', - array( - 'label' => __( 'Menu Item Height', 'gp-premium' ), - 'section' => 'menu_plus_slideout_menu', - 'settings' => array( - 'desktop' => 'generate_spacing_settings[off_canvas_menu_item_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 20, - 'max' => 150, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 200, - 'active_callback' => 'generate_slideout_navigation_activated', - ) - ) -); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php deleted file mode 100644 index dd565a57..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php +++ /dev/null @@ -1,159 +0,0 @@ -get_section( 'secondary_nav_section' ) ) { - return; - } - - // Get our controls. - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - // Get our defaults. - $defaults = generate_secondary_nav_get_defaults(); - - // Remove our old label control if it exists. - // It only would if the user is using an old Secondary Nav add-on version. - if ( $wp_customize->get_control( 'generate_secondary_navigation_spacing_title' ) ) { - $wp_customize->remove_control( 'generate_secondary_navigation_spacing_title' ); - } - - // Menu item width. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_menu_item]', - array( - 'default' => $defaults['secondary_menu_item'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_secondary_nav_settings[secondary_menu_item]', - array( - 'label' => __( 'Menu Item Width', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'settings' => array( - 'desktop' => 'generate_secondary_nav_settings[secondary_menu_item]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 220, - ) - ) - ); - - // Menu item height. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_menu_item_height]', - array( - 'default' => $defaults['secondary_menu_item_height'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_secondary_nav_settings[secondary_menu_item_height]', - array( - 'label' => __( 'Menu Item Height', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'settings' => array( - 'desktop' => 'generate_secondary_nav_settings[secondary_menu_item_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 20, - 'max' => 150, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 240, - ) - ) - ); - - // Sub-menu height. - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', - array( - 'default' => $defaults['secondary_sub_menu_item_height'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', - array( - 'label' => __( 'Sub-Menu Item Height', 'gp-premium' ), - 'section' => 'secondary_nav_section', - 'settings' => array( - 'desktop' => 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 50, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'priority' => 260, - ) - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php deleted file mode 100644 index b8c3b0c7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php +++ /dev/null @@ -1,211 +0,0 @@ -add_section( - 'generate_spacing_sidebar', - array( - 'title' => __( 'Sidebars', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 15, - 'panel' => 'generate_spacing_panel', - ) -); - -// Add our controls to the Layout panel if it exists. -// If not, use the old section. -$widget_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_sidebars' : 'generate_spacing_sidebar'; - -// Widget padding top. -$wp_customize->add_setting( - 'generate_spacing_settings[widget_top]', - array( - 'default' => $defaults['widget_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Widget padding right. -$wp_customize->add_setting( - 'generate_spacing_settings[widget_right]', - array( - 'default' => $defaults['widget_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Widget padding bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[widget_bottom]', - array( - 'default' => $defaults['widget_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Widget padding left. -$wp_customize->add_setting( - 'generate_spacing_settings[widget_left]', - array( - 'default' => $defaults['widget_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Widget padding top. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_widget_top]', - array( - 'default' => $defaults['mobile_widget_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Widget padding right. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_widget_right]', - array( - 'default' => $defaults['mobile_widget_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Widget padding bottom. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_widget_bottom]', - array( - 'default' => $defaults['mobile_widget_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Widget padding left. -$wp_customize->add_setting( - 'generate_spacing_settings[mobile_widget_left]', - array( - 'default' => $defaults['mobile_widget_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -// Make use of the widget padding settings. -$wp_customize->add_control( - new GeneratePress_Spacing_Control( - $wp_customize, - 'widget_spacing', - array( - 'type' => 'generatepress-spacing', - 'label' => esc_html__( 'Widget Padding', 'gp-premium' ), - 'section' => $widget_section, - 'settings' => array( - 'desktop_top' => 'generate_spacing_settings[widget_top]', - 'desktop_right' => 'generate_spacing_settings[widget_right]', - 'desktop_bottom' => 'generate_spacing_settings[widget_bottom]', - 'desktop_left' => 'generate_spacing_settings[widget_left]', - 'mobile_top' => 'generate_spacing_settings[mobile_widget_top]', - 'mobile_right' => 'generate_spacing_settings[mobile_widget_right]', - 'mobile_bottom' => 'generate_spacing_settings[mobile_widget_bottom]', - 'mobile_left' => 'generate_spacing_settings[mobile_widget_left]', - ), - 'element' => 'widget', - 'priority' => 99, - ) - ) -); - -// Left sidebar width. -$wp_customize->add_setting( - 'generate_spacing_settings[left_sidebar_width]', - array( - 'default' => $defaults['left_sidebar_width'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[left_sidebar_width]', - array( - 'label' => esc_html__( 'Left Sidebar Width', 'gp-premium' ), - 'section' => $widget_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[left_sidebar_width]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 15, - 'max' => 50, - 'step' => 5, - 'edit' => false, - 'unit' => '%', - ), - ), - 'priority' => 125, - ) - ) -); - -// Right sidebar width. -$wp_customize->add_setting( - 'generate_spacing_settings[right_sidebar_width]', - array( - 'default' => $defaults['right_sidebar_width'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) -); - -$wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_spacing_settings[right_sidebar_width]', - array( - 'label' => esc_html__( 'Right Sidebar Width', 'gp-premium' ), - 'section' => $widget_section, - 'settings' => array( - 'desktop' => 'generate_spacing_settings[right_sidebar_width]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 15, - 'max' => 50, - 'step' => 5, - 'edit' => false, - 'unit' => '%', - ), - ), - 'priority' => 125, - ) - ) -); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php deleted file mode 100644 index ecc0f085..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php +++ /dev/null @@ -1,73 +0,0 @@ -add_setting( - 'generate_spacing_settings[top_bar_top]', - array( - 'default' => $defaults['top_bar_top'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_spacing_settings[top_bar_right]', - array( - 'default' => $defaults['top_bar_right'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_spacing_settings[top_bar_bottom]', - array( - 'default' => $defaults['top_bar_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_spacing_settings[top_bar_left]', - array( - 'default' => $defaults['top_bar_left'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Spacing_Control( - $wp_customize, - 'top_bar_spacing', - array( - 'type' => 'generatepress-spacing', - 'label' => esc_html__( 'Top Bar Padding', 'gp-premium' ), - 'section' => 'generate_top_bar', - 'settings' => array( - 'desktop_top' => 'generate_spacing_settings[top_bar_top]', - 'desktop_right' => 'generate_spacing_settings[top_bar_right]', - 'desktop_bottom' => 'generate_spacing_settings[top_bar_bottom]', - 'desktop_left' => 'generate_spacing_settings[top_bar_left]', - ), - 'element' => 'top_bar', - 'priority' => 99, - 'active_callback' => 'generate_premium_is_top_bar_active', - ) - ) - ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/functions.php deleted file mode 100644 index a428989c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/functions.php +++ /dev/null @@ -1,362 +0,0 @@ -register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Spacing_Control' ); - } - - // Add our Spacing panel. - // This is only used if the Layout panel in the free theme doesn't exist. - if ( class_exists( 'WP_Customize_Panel' ) ) { - if ( ! $wp_customize->get_panel( 'generate_spacing_panel' ) ) { - $wp_customize->add_panel( - 'generate_spacing_panel', - array( - 'capability' => 'edit_theme_options', - 'theme_supports' => '', - 'title' => __( 'Spacing', 'gp-premium' ), - 'description' => __( 'Change the spacing for various elements using pixels.', 'gp-premium' ), - 'priority' => 35, - ) - ); - } - } - - require_once plugin_dir_path( __FILE__ ) . 'customizer/top-bar-spacing.php'; - require_once plugin_dir_path( __FILE__ ) . 'customizer/header-spacing.php'; - require_once plugin_dir_path( __FILE__ ) . 'customizer/content-spacing.php'; - require_once plugin_dir_path( __FILE__ ) . 'customizer/sidebar-spacing.php'; - require_once plugin_dir_path( __FILE__ ) . 'customizer/navigation-spacing.php'; - require_once plugin_dir_path( __FILE__ ) . 'customizer/footer-spacing.php'; - - } -} - -if ( ! function_exists( 'generate_right_sidebar_width' ) ) { - add_filter( 'generate_right_sidebar_width', 'generate_right_sidebar_width' ); - /** - * Set our right sidebar width. - * - * @param int $width The sidebar width. - */ - function generate_right_sidebar_width( $width ) { - // Bail if we don't have our defaults. - if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { - return $width; - } - - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - - return absint( $spacing_settings['right_sidebar_width'] ); - } -} - -if ( ! function_exists( 'generate_left_sidebar_width' ) ) { - add_filter( 'generate_left_sidebar_width', 'generate_left_sidebar_width' ); - /** - * Set our left sidebar width. - * - * @param int $width The sidebar width. - */ - function generate_left_sidebar_width( $width ) { - // Bail if we don't have our defaults. - if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { - return $width; - } - - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - - return absint( $spacing_settings['left_sidebar_width'] ); - } -} - -if ( ! function_exists( 'generate_spacing_customizer_live_preview' ) ) { - add_action( 'customize_preview_init', 'generate_spacing_customizer_live_preview' ); - /** - * Add our live preview JS - */ - function generate_spacing_customizer_live_preview() { - wp_enqueue_script( - 'generate-spacing-customizer', - trailingslashit( plugin_dir_url( __FILE__ ) ) . 'customizer/js/customizer.js', - array( 'jquery', 'customize-preview' ), - GENERATE_SPACING_VERSION, - true - ); - - wp_localize_script( - 'generate-spacing-customizer', - 'gp_spacing', - array( - 'mobile' => generate_premium_get_media_query( 'mobile' ), - 'tablet' => generate_premium_get_media_query( 'tablet' ), - 'desktop' => generate_premium_get_media_query( 'desktop' ), - 'isFlex' => function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox(), - ) - ); - } -} - -if ( ! function_exists( 'generate_include_spacing_defaults' ) ) { - /** - * Check if we should include our default.css file. - * - * @since 1.3.42 - */ - function generate_include_spacing_defaults() { - return true; - } -} - -if ( ! function_exists( 'generate_spacing_premium_defaults' ) ) { - add_filter( 'generate_spacing_option_defaults', 'generate_spacing_premium_defaults' ); - /** - * Add premium spacing defaults. - * - * @since 1.3 - * @param array $defaults The existing defaults. - */ - function generate_spacing_premium_defaults( $defaults ) { - $defaults['mobile_menu_item'] = ''; - $defaults['mobile_menu_item_height'] = ''; - $defaults['sticky_menu_item_height'] = ''; - $defaults['off_canvas_menu_item_height'] = ''; - $defaults['content_element_separator'] = '2'; // em. - - // These defaults were added to GeneratePress (free) in 3.0.0. - if ( defined( 'GENERATE_VERSION' ) && version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '<' ) ) { - $defaults['mobile_header_top'] = ''; - $defaults['mobile_header_right'] = ''; - $defaults['mobile_header_bottom'] = ''; - $defaults['mobile_header_left'] = ''; - - $defaults['mobile_widget_top'] = ''; - $defaults['mobile_widget_right'] = ''; - $defaults['mobile_widget_bottom'] = ''; - $defaults['mobile_widget_left'] = ''; - - $defaults['mobile_footer_widget_container_top'] = ''; - $defaults['mobile_footer_widget_container_right'] = ''; - $defaults['mobile_footer_widget_container_bottom'] = ''; - $defaults['mobile_footer_widget_container_left'] = ''; - } - - return $defaults; - } -} - -/** - * Build our premium CSS. - */ -function generate_spacing_do_premium_css() { - // Bail if we don't have our defaults. - if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { - return; - } - - $spacing_settings = wp_parse_args( - get_option( 'generate_spacing_settings', array() ), - generate_spacing_get_defaults() - ); - - require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; - $premium_css = new GeneratePress_Pro_CSS(); - $css_output = ''; - - // Mobile spacing. - $premium_css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); - - if ( '' !== $spacing_settings['mobile_menu_item'] ) { - $premium_css->set_selector( '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a,.main-navigation .menu-bar-item > a' ); - $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_menu_item'] ), false, 'px' ); - $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_menu_item'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_menu_item_height'] ) { - $premium_css->set_selector( '.main-navigation .main-nav ul li a,.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a,.main-navigation .menu-bar-item > a' ); - $premium_css->add_property( 'line-height', absint( $spacing_settings['mobile_menu_item_height'] ), false, 'px' ); - - $premium_css->set_selector( '.main-navigation .site-logo.navigation-logo img, .mobile-header-navigation .site-logo.mobile-header-logo img, .navigation-search input[type="search"]' ); - $premium_css->add_property( 'height', absint( $spacing_settings['mobile_menu_item_height'] ), false, 'px' ); - } - - $premium_css->stop_media_query(); - - // This CSS was added to GeneratePress (free) in 3.0.0. - if ( defined( 'GENERATE_VERSION' ) && version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '<' ) ) { - $premium_css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); - - $premium_css->set_selector( '.inside-header' ); - - if ( '' !== $spacing_settings['mobile_header_top'] ) { - $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_header_top'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_header_right'] ) { - $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_header_right'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_header_bottom'] ) { - $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_header_bottom'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_header_left'] ) { - $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_header_left'] ), false, 'px' ); - } - - $premium_css->set_selector( '.widget-area .widget' ); - - if ( '' !== $spacing_settings['mobile_widget_top'] ) { - $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_widget_top'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_widget_right'] ) { - $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_widget_right'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_widget_bottom'] ) { - $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_widget_bottom'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_widget_left'] ) { - $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_widget_left'] ), false, 'px' ); - } - - $premium_css->set_selector( '.footer-widgets' ); - - if ( '' !== $spacing_settings['mobile_footer_widget_container_top'] ) { - $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_footer_widget_container_top'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_footer_widget_container_right'] ) { - $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_footer_widget_container_right'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_footer_widget_container_bottom'] ) { - $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_footer_widget_container_bottom'] ), false, 'px' ); - } - - if ( '' !== $spacing_settings['mobile_footer_widget_container_left'] ) { - $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_footer_widget_container_left'] ), false, 'px' ); - } - - $premium_css->stop_media_query(); - - $premium_css->set_selector( '.post-image, .page-content, .entry-content, .entry-summary, footer.entry-meta' ); - $premium_css->add_property( 'margin-top', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); - } else { - $premium_css->set_selector( '.post-image:not(:first-child), .page-content:not(:first-child), .entry-content:not(:first-child), .entry-summary:not(:first-child), footer.entry-meta' ); - $premium_css->add_property( 'margin-top', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); - } - - $premium_css->set_selector( '.post-image-above-header .inside-article div.featured-image, .post-image-above-header .inside-article div.post-image' ); - $premium_css->add_property( 'margin-bottom', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); - - if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { - $menu_plus = wp_parse_args( - get_option( 'generate_menu_plus_settings', array() ), - generate_menu_plus_get_defaults() - ); - - if ( 'false' !== $menu_plus['sticky_menu'] && '' !== $spacing_settings['sticky_menu_item_height'] ) { - $premium_css->start_media_query( generate_premium_get_media_query( 'tablet' ) . ',' . generate_premium_get_media_query( 'desktop' ) ); - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .main-nav > ul > li > a,.sticky-navigation-transition .menu-toggle,.main-navigation.sticky-navigation-transition .menu-bar-item > a, .sticky-navigation-transition .navigation-branding .main-title' ); - } else { - $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .main-nav > ul > li > a,.sticky-navigation-transition .menu-toggle,.main-navigation.sticky-navigation-transition .mobile-bar-items a, .sticky-navigation-transition .navigation-branding .main-title' ); - } - - $premium_css->add_property( 'line-height', absint( $spacing_settings['sticky_menu_item_height'] ), false, 'px' ); - - $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .site-logo img, .main-navigation.sticky-navigation-transition .navigation-search input[type="search"], .main-navigation.sticky-navigation-transition .navigation-branding img' ); - $premium_css->add_property( 'height', absint( $spacing_settings['sticky_menu_item_height'] ), false, 'px' ); - - $premium_css->stop_media_query(); - } - - if ( 'false' !== $menu_plus['slideout_menu'] ) { - $premium_css->set_selector( '.main-navigation.slideout-navigation .main-nav > ul > li > a' ); - if ( '' !== $spacing_settings['off_canvas_menu_item_height'] ) { - $premium_css->add_property( 'line-height', absint( $spacing_settings['off_canvas_menu_item_height'] ), false, 'px' ); - } - } - } - - if ( '' !== $premium_css->css_output() ) { - $css_output = $premium_css->css_output(); - } - - return $css_output; -} - -if ( ! function_exists( 'generate_spacing_premium_css' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_spacing_premium_css', 105 ); - /** - * Add premium spacing CSS - * - * @since 1.3 - */ - function generate_spacing_premium_css() { - $css = generate_spacing_do_premium_css(); - - if ( 'inline' === generate_get_css_print_method() && $css ) { - wp_add_inline_style( 'generate-style', $css ); - } - } -} - -add_filter( 'generate_external_dynamic_css_output', 'generate_spacing_add_to_external_stylesheet' ); -/** - * Add CSS to the external stylesheet. - * - * @since 1.11.0 - * @param string $css Existing CSS. - */ -function generate_spacing_add_to_external_stylesheet( $css ) { - if ( 'inline' === generate_get_css_print_method() ) { - return $css; - } - - $css .= generate_spacing_do_premium_css(); - - return $css; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/migration.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/migration.php deleted file mode 100644 index 1eac04b6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/migration.php +++ /dev/null @@ -1,102 +0,0 @@ -register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Add the typography panel. - if ( class_exists( 'WP_Customize_Panel' ) ) { - $wp_customize->add_panel( - 'generate_typography_panel', - array( - 'priority' => 30, - 'capability' => 'edit_theme_options', - 'theme_supports' => '', - 'title' => __( 'Typography', 'gp-premium' ), - 'description' => '', - ) - ); - } - - // Body section. - $wp_customize->add_section( - 'font_section', - array( - 'title' => __( 'Body', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 30, - 'panel' => 'generate_typography_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_body_typography_shortcuts', - array( - 'section' => 'font_section', - 'element' => __( 'Body', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'body_section', - 'backgrounds' => 'generate_backgrounds_body', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_body]', - array( - 'default' => $defaults['font_body'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_body_variants', - array( - 'default' => $defaults['font_body_variants'], - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'font_body_category', - array( - 'default' => $defaults['font_body_category'], - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[body_font_weight]', - array( - 'default' => $defaults['body_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[body_font_transform]', - array( - 'default' => $defaults['body_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'body_typography', - array( - 'section' => 'font_section', - 'priority' => 1, - 'settings' => array( - 'family' => 'generate_settings[font_body]', - 'variant' => 'font_body_variants', - 'category' => 'font_body_category', - 'weight' => 'generate_settings[body_font_weight]', - 'transform' => 'generate_settings[body_font_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[body_font_size]', - array( - 'default' => $defaults['body_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[body_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_section', - 'priority' => 40, - 'settings' => array( - 'desktop' => 'generate_settings[body_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 25, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[body_line_height]', - array( - 'default' => $defaults['body_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[body_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_section', - 'priority' => 45, - 'settings' => array( - 'desktop' => 'generate_settings[body_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 1, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => '', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[paragraph_margin]', - array( - 'default' => $defaults['paragraph_margin'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[paragraph_margin]', - array( - 'description' => __( 'Paragraph margin', 'gp-premium' ), - 'section' => 'font_section', - 'priority' => 47, - 'settings' => array( - 'desktop' => 'generate_settings[paragraph_margin]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - - $wp_customize->add_section( - 'generate_top_bar_typography', - array( - 'title' => __( 'Top Bar', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 30, - 'panel' => 'generate_typography_panel', - ) - ); - - if ( isset( $defaults['font_top_bar'] ) && function_exists( 'generate_is_top_bar_active' ) ) { - $wp_customize->add_setting( - 'generate_settings[font_top_bar]', - array( - 'default' => $defaults['font_top_bar'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_top_bar_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_top_bar_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[top_bar_font_weight]', - array( - 'default' => $defaults['top_bar_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[top_bar_font_transform]', - array( - 'default' => $defaults['top_bar_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'top_bar_typography', - array( - 'section' => 'generate_top_bar_typography', - 'settings' => array( - 'family' => 'generate_settings[font_top_bar]', - 'variant' => 'font_top_bar_variants', - 'category' => 'font_top_bar_category', - 'weight' => 'generate_settings[top_bar_font_weight]', - 'transform' => 'generate_settings[top_bar_font_transform]', - ), - 'active_callback' => 'generate_premium_is_top_bar_active', - ) - ) - ); - - } - - if ( isset( $defaults['top_bar_font_size'] ) && function_exists( 'generate_is_top_bar_active' ) ) { - $wp_customize->add_setting( - 'generate_settings[top_bar_font_size]', - array( - 'default' => $defaults['top_bar_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[top_bar_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'generate_top_bar_typography', - 'priority' => 75, - 'settings' => array( - 'desktop' => 'generate_settings[top_bar_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 25, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - 'active_callback' => 'generate_premium_is_top_bar_active', - ) - ) - ); - } - - $wp_customize->add_section( - 'font_header_section', - array( - 'title' => __( 'Header', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 40, - 'panel' => 'generate_typography_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_header_typography_shortcuts', - array( - 'section' => 'font_header_section', - 'element' => __( 'Header', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_header', - 'colors' => 'header_color_section', - 'backgrounds' => 'generate_backgrounds_header', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_site_title]', - array( - 'default' => $defaults['font_site_title'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_site_title_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_site_title_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[site_title_font_weight]', - array( - 'default' => $defaults['site_title_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[site_title_font_transform]', - array( - 'default' => $defaults['site_title_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'site_title_typography', - array( - 'label' => __( 'Site Title', 'gp-premium' ), - 'section' => 'font_header_section', - 'settings' => array( - 'family' => 'generate_settings[font_site_title]', - 'variant' => 'font_site_title_variants', - 'category' => 'font_site_title_category', - 'weight' => 'generate_settings[site_title_font_weight]', - 'transform' => 'generate_settings[site_title_font_transform]', - ), - 'priority' => 50, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[site_title_font_size]', - array( - 'default' => $defaults['site_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[tablet_site_title_font_size]', - array( - 'default' => $defaults['tablet_site_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[mobile_site_title_font_size]', - array( - 'default' => $defaults['mobile_site_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[site_title_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_header_section', - 'priority' => 75, - 'settings' => array( - 'desktop' => 'generate_settings[site_title_font_size]', - 'tablet' => 'generate_settings[tablet_site_title_font_size]', - 'mobile' => 'generate_settings[mobile_site_title_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 10, - 'max' => 200, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'tablet' => array( - 'min' => 10, - 'max' => 200, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 10, - 'max' => 200, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_site_tagline]', - array( - 'default' => $defaults['font_site_tagline'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_site_tagline_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_site_tagline_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[site_tagline_font_weight]', - array( - 'default' => $defaults['site_tagline_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[site_tagline_font_transform]', - array( - 'default' => $defaults['site_tagline_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_site_tagline_control', - array( - 'label' => __( 'Site Tagline', 'gp-premium' ), - 'section' => 'font_header_section', - 'settings' => array( - 'family' => 'generate_settings[font_site_tagline]', - 'variant' => 'font_site_tagline_variants', - 'category' => 'font_site_tagline_category', - 'weight' => 'generate_settings[site_tagline_font_weight]', - 'transform' => 'generate_settings[site_tagline_font_transform]', - ), - 'priority' => 80, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[site_tagline_font_size]', - array( - 'default' => $defaults['site_tagline_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[site_tagline_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_header_section', - 'priority' => 105, - 'settings' => array( - 'desktop' => 'generate_settings[site_tagline_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 50, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_section( - 'font_navigation_section', - array( - 'title' => __( 'Primary Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 50, - 'panel' => 'generate_typography_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_primary_navigation_typography_shortcuts', - array( - 'section' => 'font_navigation_section', - 'element' => __( 'Primary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_navigation', - 'colors' => 'navigation_color_section', - 'backgrounds' => 'generate_backgrounds_navigation', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_navigation]', - array( - 'default' => $defaults['font_navigation'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_navigation_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_navigation_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_font_weight]', - array( - 'default' => $defaults['navigation_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_font_transform]', - array( - 'default' => $defaults['navigation_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'google_font_site_navigation_control', - array( - 'section' => 'font_navigation_section', - 'settings' => array( - 'family' => 'generate_settings[font_navigation]', - 'variant' => 'font_navigation_variants', - 'category' => 'font_navigation_category', - 'weight' => 'generate_settings[navigation_font_weight]', - 'transform' => 'generate_settings[navigation_font_transform]', - ), - 'priority' => 120, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[navigation_font_size]', - array( - 'default' => $defaults['navigation_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[tablet_navigation_font_size]', - array( - 'default' => $defaults['tablet_navigation_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[mobile_navigation_font_size]', - array( - 'default' => $defaults['mobile_navigation_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[navigation_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_navigation_section', - 'priority' => 165, - 'settings' => array( - 'desktop' => 'generate_settings[navigation_font_size]', - 'tablet' => 'generate_settings[tablet_navigation_font_size]', - 'mobile' => 'generate_settings[mobile_navigation_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 30, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'tablet' => array( - 'min' => 6, - 'max' => 30, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 6, - 'max' => 30, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_section( - 'font_buttons_section', - array( - 'title' => __( 'Buttons', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 55, - 'panel' => 'generate_typography_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_buttons_typography_shortcuts', - array( - 'section' => 'font_buttons_section', - 'element' => __( 'Button', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'buttons_color_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - if ( isset( $defaults['font_buttons'] ) ) { - $wp_customize->add_setting( - 'generate_settings[font_buttons]', - array( - 'default' => $defaults['font_buttons'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_buttons_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_buttons_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[buttons_font_weight]', - array( - 'default' => $defaults['buttons_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[buttons_font_transform]', - array( - 'default' => $defaults['buttons_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_buttons_control', - array( - 'section' => 'font_buttons_section', - 'settings' => array( - 'family' => 'generate_settings[font_buttons]', - 'variant' => 'font_buttons_variants', - 'category' => 'font_buttons_category', - 'weight' => 'generate_settings[buttons_font_weight]', - 'transform' => 'generate_settings[buttons_font_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[buttons_font_size]', - array( - 'default' => $defaults['buttons_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'buttons_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_buttons_section', - 'settings' => array( - 'desktop' => 'generate_settings[buttons_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 5, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } - - $wp_customize->add_section( - 'font_content_section', - array( - 'title' => __( 'Headings', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 60, - 'panel' => 'generate_typography_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_headings_typography_shortcuts', - array( - 'section' => 'font_content_section', - 'element' => __( 'Content', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_container', - 'colors' => 'content_color_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_heading_1]', - array( - 'default' => $defaults['font_heading_1'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_1_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_1_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_1_weight]', - array( - 'default' => $defaults['heading_1_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_1_transform]', - array( - 'default' => $defaults['heading_1_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_heading_1_control', - array( - 'label' => __( 'Heading 1 (H1)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'family' => 'generate_settings[font_heading_1]', - 'variant' => 'font_heading_1_variants', - 'category' => 'font_heading_1_category', - 'weight' => 'generate_settings[heading_1_weight]', - 'transform' => 'generate_settings[heading_1_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_1_font_size]', - array( - 'default' => $defaults['heading_1_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[mobile_heading_1_font_size]', - array( - 'default' => $defaults['mobile_heading_1_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'h1_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_1_font_size]', - 'mobile' => 'generate_settings[mobile_heading_1_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 15, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 15, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - if ( isset( $defaults['heading_1_line_height'] ) ) { - $wp_customize->add_setting( - 'generate_settings[heading_1_line_height]', - array( - 'default' => $defaults['heading_1_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_1_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_1_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - } - - if ( isset( $defaults['heading_1_margin_bottom'] ) ) { - $wp_customize->add_setting( - 'generate_settings[heading_1_margin_bottom]', - array( - 'default' => $defaults['heading_1_margin_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_1_margin_bottom]', - array( - 'description' => __( 'Bottom margin', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_1_margin_bottom]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } - - $wp_customize->add_setting( - 'generate_settings[single_post_title_weight]', - array( - 'default' => $defaults['single_post_title_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[single_post_title_transform]', - array( - 'default' => $defaults['single_post_title_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'single_content_title_control', - array( - 'label' => __( 'Single Content Title (H1)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'weight' => 'generate_settings[single_post_title_weight]', - 'transform' => 'generate_settings[single_post_title_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[single_post_title_font_size]', - array( - 'default' => $defaults['single_post_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[single_post_title_font_size_mobile]', - array( - 'default' => $defaults['single_post_title_font_size_mobile'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'single_post_title_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[single_post_title_font_size]', - 'mobile' => 'generate_settings[single_post_title_font_size_mobile]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 15, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 15, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[single_post_title_line_height]', - array( - 'default' => $defaults['single_post_title_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[single_post_title_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[single_post_title_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_heading_2]', - array( - 'default' => $defaults['font_heading_2'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_2_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_2_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_2_weight]', - array( - 'default' => $defaults['heading_2_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_2_transform]', - array( - 'default' => $defaults['heading_2_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_heading_2_control', - array( - 'label' => __( 'Heading 2 (H2)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'family' => 'generate_settings[font_heading_2]', - 'variant' => 'font_heading_2_variants', - 'category' => 'font_heading_2_category', - 'weight' => 'generate_settings[heading_2_weight]', - 'transform' => 'generate_settings[heading_2_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_2_font_size]', - array( - 'default' => $defaults['heading_2_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[mobile_heading_2_font_size]', - array( - 'default' => $defaults['mobile_heading_2_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'h2_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_2_font_size]', - 'mobile' => 'generate_settings[mobile_heading_2_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - if ( isset( $defaults['heading_2_line_height'] ) ) { - $wp_customize->add_setting( - 'generate_settings[heading_2_line_height]', - array( - 'default' => $defaults['heading_2_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_2_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_2_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - } - - if ( isset( $defaults['heading_2_margin_bottom'] ) ) { - $wp_customize->add_setting( - 'generate_settings[heading_2_margin_bottom]', - array( - 'default' => $defaults['heading_2_margin_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_2_margin_bottom]', - array( - 'description' => __( 'Bottom margin', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_2_margin_bottom]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } - - $wp_customize->add_setting( - 'generate_settings[archive_post_title_weight]', - array( - 'default' => $defaults['archive_post_title_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[archive_post_title_transform]', - array( - 'default' => $defaults['archive_post_title_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'archive_content_title_control', - array( - 'label' => __( 'Archive Content Title (H2)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'weight' => 'generate_settings[archive_post_title_weight]', - 'transform' => 'generate_settings[archive_post_title_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[archive_post_title_font_size]', - array( - 'default' => $defaults['archive_post_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[archive_post_title_font_size_mobile]', - array( - 'default' => $defaults['archive_post_title_font_size_mobile'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'archive_post_title_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[archive_post_title_font_size]', - 'mobile' => 'generate_settings[archive_post_title_font_size_mobile]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 15, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 15, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[archive_post_title_line_height]', - array( - 'default' => $defaults['archive_post_title_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[archive_post_title_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[archive_post_title_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_heading_3]', - array( - 'default' => $defaults['font_heading_3'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_3_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_3_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_3_weight]', - array( - 'default' => $defaults['heading_3_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_3_transform]', - array( - 'default' => $defaults['heading_3_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_heading_3_control', - array( - 'label' => __( 'Heading 3 (H3)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'family' => 'generate_settings[font_heading_3]', - 'variant' => 'font_heading_3_variants', - 'category' => 'font_heading_3_category', - 'weight' => 'generate_settings[heading_3_weight]', - 'transform' => 'generate_settings[heading_3_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_3_font_size]', - array( - 'default' => $defaults['heading_3_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $h3_font_size_options = array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ); - - $h3_font_size_settings = array( - 'desktop' => 'generate_settings[heading_3_font_size]', - ); - - if ( isset( $defaults['mobile_heading_3_font_size'] ) ) { - $wp_customize->add_setting( - 'generate_settings[mobile_heading_3_font_size]', - array( - 'default' => $defaults['mobile_heading_3_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $h3_font_size_options['mobile'] = array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ); - - $h3_font_size_settings['mobile'] = 'generate_settings[mobile_heading_3_font_size]'; - } - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'h3_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => $h3_font_size_settings, - 'choices' => $h3_font_size_options, - ) - ) - ); - - if ( isset( $defaults['heading_3_line_height'] ) ) { - $wp_customize->add_setting( - 'generate_settings[heading_3_line_height]', - array( - 'default' => $defaults['heading_3_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_3_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_3_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - } - - if ( isset( $defaults['heading_3_margin_bottom'] ) ) { - $wp_customize->add_setting( - 'generate_settings[heading_3_margin_bottom]', - array( - 'default' => $defaults['heading_3_margin_bottom'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_3_margin_bottom]', - array( - 'description' => __( 'Bottom margin', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_3_margin_bottom]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } - - if ( isset( $defaults['font_heading_4'] ) ) { - $wp_customize->add_setting( - 'generate_settings[font_heading_4]', - array( - 'default' => $defaults['font_heading_4'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_4_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_4_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_4_weight]', - array( - 'default' => $defaults['heading_4_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_4_transform]', - array( - 'default' => $defaults['heading_4_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_heading_4_control', - array( - 'label' => __( 'Heading 4 (H4)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'family' => 'generate_settings[font_heading_4]', - 'variant' => 'font_heading_4_variants', - 'category' => 'font_heading_4_category', - 'weight' => 'generate_settings[heading_4_weight]', - 'transform' => 'generate_settings[heading_4_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_4_font_size]', - array( - 'default' => $defaults['heading_4_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $h4_font_size_options = array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ); - - $h4_font_size_settings = array( - 'desktop' => 'generate_settings[heading_4_font_size]', - ); - - if ( isset( $defaults['mobile_heading_4_font_size'] ) ) { - $wp_customize->add_setting( - 'generate_settings[mobile_heading_4_font_size]', - array( - 'default' => $defaults['mobile_heading_4_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $h4_font_size_options['mobile'] = array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ); - - $h4_font_size_settings['mobile'] = 'generate_settings[mobile_heading_4_font_size]'; - } - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'h4_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => $h4_font_size_settings, - 'choices' => $h4_font_size_options, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_4_line_height]', - array( - 'default' => $defaults['heading_4_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_4_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_4_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - } - - if ( isset( $defaults['font_heading_5'] ) ) { - $wp_customize->add_setting( - 'generate_settings[font_heading_5]', - array( - 'default' => $defaults['font_heading_5'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_5_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_5_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_5_weight]', - array( - 'default' => $defaults['heading_5_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_5_transform]', - array( - 'default' => $defaults['heading_5_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_heading_5_control', - array( - 'label' => __( 'Heading 5 (H5)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'family' => 'generate_settings[font_heading_5]', - 'variant' => 'font_heading_5_variants', - 'category' => 'font_heading_5_category', - 'weight' => 'generate_settings[heading_5_weight]', - 'transform' => 'generate_settings[heading_5_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_5_font_size]', - array( - 'default' => $defaults['heading_5_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $h5_font_size_options = array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ); - - $h5_font_size_settings = array( - 'desktop' => 'generate_settings[heading_5_font_size]', - ); - - if ( isset( $defaults['mobile_heading_5_font_size'] ) ) { - $wp_customize->add_setting( - 'generate_settings[mobile_heading_5_font_size]', - array( - 'default' => $defaults['mobile_heading_5_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $h5_font_size_options['mobile'] = array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ); - - $h5_font_size_settings['mobile'] = 'generate_settings[mobile_heading_5_font_size]'; - } - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'h5_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => $h5_font_size_settings, - 'choices' => $h5_font_size_options, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_5_line_height]', - array( - 'default' => $defaults['heading_5_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_5_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_5_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - } - - if ( isset( $defaults['font_heading_6'] ) ) { - $wp_customize->add_setting( - 'generate_settings[font_heading_6]', - array( - 'default' => $defaults['font_heading_6'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_6_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_heading_6_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_6_weight]', - array( - 'default' => $defaults['heading_6_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_6_transform]', - array( - 'default' => $defaults['heading_6_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_heading_6_control', - array( - 'label' => __( 'Heading 6 (H6)', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'family' => 'generate_settings[font_heading_6]', - 'variant' => 'font_heading_6_variants', - 'category' => 'font_heading_6_category', - 'weight' => 'generate_settings[heading_6_weight]', - 'transform' => 'generate_settings[heading_6_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_6_font_size]', - array( - 'default' => $defaults['heading_6_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'h6_font_sizes', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_6_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[heading_6_line_height]', - array( - 'default' => $defaults['heading_6_line_height'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[heading_6_line_height]', - array( - 'description' => __( 'Line height', 'gp-premium' ), - 'section' => 'font_content_section', - 'settings' => array( - 'desktop' => 'generate_settings[heading_6_line_height]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 5, - 'step' => .1, - 'edit' => true, - 'unit' => 'em', - ), - ), - ) - ) - ); - } - - $wp_customize->add_section( - 'font_widget_section', - array( - 'title' => __( 'Widgets', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 60, - 'panel' => 'generate_typography_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_widgets_typography_shortcuts', - array( - 'section' => 'font_widget_section', - 'element' => __( 'Widgets', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_sidebars', - 'colors' => 'sidebar_widget_color_section', - 'backgrounds' => 'generate_backgrounds_sidebars', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[font_widget_title]', - array( - 'default' => $defaults['font_widget_title'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_widget_title_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_widget_title_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[widget_title_font_weight]', - array( - 'default' => $defaults['widget_title_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[widget_title_font_transform]', - array( - 'default' => $defaults['widget_title_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'google_font_widget_title_control', - array( - 'label' => __( 'Widget Titles', 'gp-premium' ), - 'section' => 'font_widget_section', - 'settings' => array( - 'family' => 'generate_settings[font_widget_title]', - 'variant' => 'font_widget_title_variants', - 'category' => 'font_widget_title_category', - 'weight' => 'generate_settings[widget_title_font_weight]', - 'transform' => 'generate_settings[widget_title_font_transform]', - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[widget_title_font_size]', - array( - 'default' => $defaults['widget_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[widget_title_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_widget_section', - 'settings' => array( - 'desktop' => 'generate_settings[widget_title_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 30, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - if ( isset( $defaults['widget_title_separator'] ) ) { - $wp_customize->add_setting( - 'generate_settings[widget_title_separator]', - array( - 'default' => $defaults['widget_title_separator'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[widget_title_separator]', - array( - 'description' => __( 'Bottom margin', 'gp-premium' ), - 'section' => 'font_widget_section', - 'settings' => array( - 'desktop' => 'generate_settings[widget_title_separator]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } - - $wp_customize->add_setting( - 'generate_settings[widget_content_font_size]', - array( - 'default' => $defaults['widget_content_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[widget_content_font_size]', - array( - 'description' => __( 'Content font size', 'gp-premium' ), - 'section' => 'font_widget_section', - 'priority' => 240, - 'settings' => array( - 'desktop' => 'generate_settings[widget_content_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 30, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_section( - 'font_footer_section', - array( - 'title' => __( 'Footer', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 70, - 'panel' => 'generate_typography_panel', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_footer_typography_shortcuts', - array( - 'section' => 'font_footer_section', - 'element' => __( 'Footer', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_layout_footer', - 'colors' => 'footer_color_section', - 'backgrounds' => 'generate_backgrounds_footer', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - if ( isset( $defaults['font_footer'] ) ) { - $wp_customize->add_setting( - 'generate_settings[font_footer]', - array( - 'default' => $defaults['font_footer'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_footer_category', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - - $wp_customize->add_setting( - 'font_footer_variants', - array( - 'default' => '', - 'sanitize_callback' => 'generate_premium_sanitize_variants', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[footer_weight]', - array( - 'default' => $defaults['footer_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_setting( - 'generate_settings[footer_transform]', - array( - 'default' => $defaults['footer_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'font_footer_control', - array( - 'section' => 'font_footer_section', - 'settings' => array( - 'family' => 'generate_settings[font_footer]', - 'variant' => 'font_footer_variants', - 'category' => 'font_footer_category', - 'weight' => 'generate_settings[footer_weight]', - 'transform' => 'generate_settings[footer_transform]', - ), - ) - ) - ); - } - - $wp_customize->add_setting( - 'generate_settings[footer_font_size]', - array( - 'default' => $defaults['footer_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[footer_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'font_footer_section', - 'settings' => array( - 'desktop' => 'generate_settings[footer_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 30, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } -} - -if ( ! function_exists( 'generate_enqueue_google_fonts' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_enqueue_google_fonts', 0 ); - /** - * Enqueue Google Fonts. - * - * @since 0.1 - */ - function generate_enqueue_google_fonts() { - // Bail if we don't have our defaults function. - if ( ! function_exists( 'generate_get_default_fonts' ) ) { - return; - } - - $generate_settings = wp_parse_args( - get_option( 'generate_settings', array() ), - generate_get_default_fonts() - ); - - // List our non-Google fonts. - $not_google = str_replace( ' ', '+', generate_typography_default_fonts() ); - - // Grab our font family settings. - $font_settings = array( - 'font_body', - 'font_top_bar', - 'font_site_title', - 'font_site_tagline', - 'font_navigation', - 'font_widget_title', - 'font_buttons', - 'font_heading_1', - 'font_heading_2', - 'font_heading_3', - 'font_heading_4', - 'font_heading_5', - 'font_heading_6', - 'font_footer', - ); - - // Create our Google Fonts array. - $google_fonts = array(); - if ( ! empty( $font_settings ) ) { - foreach ( $font_settings as $key ) { - // If the key isn't set, move on. - if ( ! isset( $generate_settings[ $key ] ) ) { - continue; - } - - // If our value is still using the old format, fix it. - if ( strpos( $generate_settings[ $key ], ':' ) !== false ) { - $generate_settings[ $key ] = current( explode( ':', $generate_settings[ $key ] ) ); - } - - // Replace the spaces in the names with a plus. - $value = str_replace( ' ', '+', $generate_settings[ $key ] ); - - // Grab the variants using the plain name. - $variants = generate_get_google_font_variants( $generate_settings[ $key ], $key, generate_get_default_fonts() ); - - // If we have variants, add them to our value. - $value = ! empty( $variants ) ? $value . ':' . $variants : $value; - - // Make sure we don't add the same font twice. - if ( ! in_array( $value, $google_fonts ) ) { - $google_fonts[] = $value; - } - } - } - - // Ignore any non-Google fonts. - $google_fonts = array_diff( $google_fonts, $not_google ); - - // Separate each different font with a bar. - $google_fonts = implode( '|', $google_fonts ); - - // Apply a filter to the output. - $google_fonts = apply_filters( 'generate_typography_google_fonts', $google_fonts ); - - // Get the subset. - $subset = apply_filters( 'generate_fonts_subset', '' ); - - // Set up our arguments. - $font_args = array(); - $font_args['family'] = $google_fonts; - if ( '' !== $subset ) { - $font_args['subset'] = urlencode( $subset ); // phpcs:ignore -- Keeping legacy urlencode(). - } - - $display = apply_filters( 'generate_google_font_display', '' ); - - if ( $display ) { - $font_args['display'] = $display; - } - - // Create our URL using the arguments. - $fonts_url = add_query_arg( $font_args, '//fonts.googleapis.com/css' ); - - // Enqueue our fonts. - if ( $google_fonts ) { - wp_enqueue_style( 'generate-fonts', $fonts_url, array(), null, 'all' ); // phpcs:ignore -- Version not needed. - } - } -} - -if ( ! function_exists( 'generate_get_all_google_fonts' ) ) { - /** - * Return an array of all of our Google Fonts. - * - * @since 1.3.0 - * @param string $amount The number of fonts to load. - */ - function generate_get_all_google_fonts( $amount = 'all' ) { - ob_start(); - include wp_normalize_path( dirname( __FILE__ ) . '/google-fonts.json' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude - $fonts_json = ob_get_clean(); - $google_fonts = json_decode( $fonts_json ); - - // Loop through them and put what we need into our fonts array. - $fonts = array(); - foreach ( (array) $google_fonts as $item ) { - - // Grab what we need from our big list. - $atts = array( - 'name' => $item->family, - 'category' => $item->category, - 'variants' => $item->variants, - ); - - // Create an ID using our font family name. - $id = strtolower( str_replace( ' ', '_', $item->family ) ); - - // Add our attributes to our new array. - $fonts[ $id ] = $atts; - } - - if ( 'all' !== $amount ) { - $fonts = array_slice( $fonts, 0, $amount ); - } - - // Alphabetize our fonts. - if ( apply_filters( 'generate_alphabetize_google_fonts', true ) ) { - asort( $fonts ); - } - - // Filter to allow us to modify the fonts array. - return apply_filters( 'generate_google_fonts_array', $fonts ); - } -} - -if ( ! function_exists( 'generate_get_all_google_fonts_ajax' ) ) { - add_action( 'wp_ajax_generate_get_all_google_fonts_ajax', 'generate_get_all_google_fonts_ajax' ); - /** - * Return an array of all of our Google Fonts. - * - * @since 1.3.0 - */ - function generate_get_all_google_fonts_ajax() { - // Bail if the nonce doesn't check out. - if ( ! isset( $_POST['gp_customize_nonce'] ) || ! wp_verify_nonce( $_POST['gp_customize_nonce'], 'gp_customize_nonce' ) ) { - wp_die(); - } - - // Do another nonce check. - check_ajax_referer( 'gp_customize_nonce', 'gp_customize_nonce' ); - - // Bail if user can't edit theme options. - if ( ! current_user_can( 'edit_theme_options' ) ) { - wp_die(); - } - - // Get all of our fonts. - $fonts = apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts() ); - - // Send all of our fonts in JSON format. - echo wp_json_encode( $fonts ); - - die(); - } -} - -if ( ! function_exists( 'generate_get_google_font_variants' ) ) { - /** - * Wrapper function to find variants for chosen Google Fonts - * Example: generate_get_google_font_variation( 'Open Sans' ) - * - * @since 1.3.0 - * @param string $font The font we're checking. - * @param string $key The key we're checking. - * @param array $default The defaults we're checking. - */ - function generate_get_google_font_variants( $font, $key = '', $default = '' ) { - // Bail if we don't have our defaults function. - if ( ! function_exists( 'generate_get_default_fonts' ) ) { - return; - } - - // Don't need variants if we're using a system font. - if ( in_array( $font, generate_typography_default_fonts() ) ) { - return; - } - - // Return if we have our variants saved. - if ( '' !== $key && get_theme_mod( $key . '_variants' ) ) { - return get_theme_mod( $key . '_variants' ); - } - - // Make sure we have defaults. - if ( '' == $default ) { // phpcs:ignore -- Non-strict allowed. - $default = generate_get_default_fonts(); - } - - // If our default font is selected and the category isn't saved, we already know the category. - if ( $default[ $key ] == $font ) { // phpcs:ignore -- Non-strict allowed. - return $default[ $key . '_variants' ]; - } - - // Grab all of our fonts. - // It's a big list, so hopefully we're not even still reading. - $fonts = generate_get_all_google_fonts(); - - // Get the ID from our font. - $id = strtolower( str_replace( ' ', '_', $font ) ); - - // If the ID doesn't exist within our fonts, we can bail. - if ( ! array_key_exists( $id, $fonts ) ) { - return; - } - - // Grab all of the variants associated with our font. - $variants = $fonts[ $id ]['variants']; - - // Loop through them and put them into an array, then turn them into a comma separated list. - $output = array(); - if ( $variants ) { - foreach ( $variants as $variant ) { - $output[] = $variant; - } - - return implode( ',', apply_filters( 'generate_typography_variants', $output ) ); - } - } -} - -if ( ! function_exists( 'generate_get_google_font_category' ) ) { - /** - * Wrapper function to find the category for chosen Google Font - * Example: generate_get_google_font_category( 'Open Sans' ) - * - * @since 1.3.0 - * @param string $font The font we're checking. - * @param string $key The key we're checking. - * @param array $default The defaults we're checking. - */ - function generate_get_google_font_category( $font, $key = '', $default = '' ) { - // Bail if we don't have our defaults function. - if ( ! function_exists( 'generate_get_default_fonts' ) ) { - return; - } - - // Don't need a category if we're using a system font. - if ( in_array( $font, generate_typography_default_fonts() ) ) { - return; - } - - // Return if we have our variants saved. - if ( '' !== $key && get_theme_mod( $key . '_category' ) ) { - return ', ' . get_theme_mod( $key . '_category' ); - } - - // Make sure we have defaults. - if ( '' == $default ) { // phpcs:ignore -- Non-strict allowed. - $default = generate_get_default_fonts(); - } - - // If our default font is selected and the category isn't saved, we already know the category. - if ( $default[ $key ] == $font ) { // phpcs:ignore -- Non-strict allowed. - return ', ' . $default[ $key . '_category' ]; - } - - // Get all of our fonts. - // It's a big list, so hopefully we're not even still reading. - $fonts = generate_get_all_google_fonts(); - - // Get the ID from our font. - $id = strtolower( str_replace( ' ', '_', $font ) ); - - // If the ID doesn't exist within our fonts, we can bail. - if ( ! array_key_exists( $id, $fonts ) ) { - return; - } - - // Let's grab our category to go with our font. - $category = ! empty( $fonts[ $id ]['category'] ) ? ', ' . $fonts[ $id ]['category'] : ''; - - // Return it to be used by our function. - return $category; - - } -} - -if ( ! function_exists( 'generate_get_font_family_css' ) ) { - /** - * Wrapper function to create font-family value for CSS. - * - * @since 1.3.0 - * @param string $font The font we're checking. - * @param array $settings The settings we're checking. - * @param array $default The defaults we're checking. - */ - function generate_get_font_family_css( $font, $settings, $default ) { - $generate_settings = wp_parse_args( - get_option( $settings, array() ), - $default - ); - - // We don't want to wrap quotes around these values. - $no_quotes = array( - 'inherit', - 'Arial, Helvetica, sans-serif', - 'Georgia, Times New Roman, Times, serif', - 'Helvetica', - 'Impact', - 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', - 'Tahoma, Geneva, sans-serif', - 'Trebuchet MS, Helvetica, sans-serif', - 'Verdana, Geneva, sans-serif', - apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ), - ); - - // Get our font. - $font_family = $generate_settings[ $font ]; - - if ( 'System Stack' === $font_family ) { - $font_family = apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ); - } - - // If our value is still using the old format, fix it. - if ( strpos( $font_family, ':' ) !== false ) { - $font_family = current( explode( ':', $font_family ) ); - } - - // Set up our wrapper. - if ( in_array( $font_family, $no_quotes ) ) { - $wrapper_start = null; - $wrapper_end = null; - } else { - $wrapper_start = '"'; - $wrapper_end = '"' . generate_get_google_font_category( $font_family, $font, $default ); - } - - // Output the CSS. - $output = ( 'inherit' === $font_family ) ? 'inherit' : $wrapper_start . $font_family . $wrapper_end; - return $output; - } -} - -if ( ! function_exists( 'generate_typography_customizer_live_preview' ) ) { - add_action( 'customize_preview_init', 'generate_typography_customizer_live_preview' ); - /** - * Add our live preview JS - */ - function generate_typography_customizer_live_preview() { - wp_enqueue_script( - 'generate-typography-customizer', - trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/customizer.js', - array( 'jquery', 'customize-preview' ), - GENERATE_FONT_VERSION, - true - ); - - wp_localize_script( - 'generate-typography-customizer', - 'gp_typography', - array( - 'mobile' => generate_premium_get_media_query( 'mobile' ), - 'tablet' => generate_premium_get_media_query( 'tablet' ), - 'desktop' => generate_premium_get_media_query( 'desktop' ), - ) - ); - } -} - -if ( ! function_exists( 'generate_typography_default_fonts' ) ) { - /** - * Get our system fonts - */ - function generate_typography_default_fonts() { - $fonts = array( - 'inherit', - 'System Stack', - 'Arial, Helvetica, sans-serif', - 'Century Gothic', - 'Comic Sans MS', - 'Courier New', - 'Georgia, Times New Roman, Times, serif', - 'Helvetica', - 'Impact', - 'Lucida Console', - 'Lucida Sans Unicode', - 'Palatino Linotype', - 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', - 'Tahoma, Geneva, sans-serif', - 'Trebuchet MS, Helvetica, sans-serif', - 'Verdana, Geneva, sans-serif', - ); - - return apply_filters( 'generate_typography_default_fonts', $fonts ); - } -} - -if ( ! function_exists( 'generate_include_typography_defaults' ) ) { - /** - * Check if we should include our default.css file. - * - * @since 1.3.42 - */ - function generate_include_typography_defaults() { - return true; - } -} - -if ( ! function_exists( 'generate_typography_premium_css_defaults' ) ) { - add_filter( 'generate_font_option_defaults', 'generate_typography_premium_css_defaults' ); - /** - * Add premium control defaults - * - * @since 1.3 - * @param array $defaults The existing defaults. - */ - function generate_typography_premium_css_defaults( $defaults ) { - $defaults['tablet_site_title_font_size'] = ''; - $defaults['tablet_navigation_font_size'] = ''; - $defaults['mobile_navigation_font_size'] = ''; - - $defaults['single_post_title_weight'] = ''; - $defaults['single_post_title_transform'] = ''; - $defaults['single_post_title_font_size'] = ''; - $defaults['single_post_title_font_size_mobile'] = ''; - $defaults['single_post_title_line_height'] = ''; - - $defaults['archive_post_title_weight'] = ''; - $defaults['archive_post_title_transform'] = ''; - $defaults['archive_post_title_font_size'] = ''; - $defaults['archive_post_title_font_size_mobile'] = ''; - $defaults['archive_post_title_line_height'] = ''; - - return $defaults; - } -} - -/** - * Premium typography CSS output. - */ -function generate_typography_get_premium_css() { - if ( ! function_exists( 'generate_get_default_fonts' ) ) { - return; - } - - $generate_settings = wp_parse_args( - get_option( 'generate_settings', array() ), - generate_get_default_fonts() - ); - - // Initiate our CSS class. - require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; - - $premium_css = new GeneratePress_Pro_CSS(); - - $site_title_family = false; - if ( function_exists( 'generate_get_font_family_css' ) ) { - $site_title_family = generate_get_font_family_css( 'font_site_title', 'generate_settings', generate_get_default_fonts() ); - } - - $premium_css->set_selector( 'h1.entry-title' ); - $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['single_post_title_weight'] ) ); - $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['single_post_title_transform'] ) ); - - if ( '' !== $generate_settings['single_post_title_font_size'] ) { - $premium_css->add_property( 'font-size', absint( $generate_settings['single_post_title_font_size'] ), false, 'px' ); - } - - if ( '' !== $generate_settings['single_post_title_line_height'] ) { - $premium_css->add_property( 'line-height', floatval( $generate_settings['single_post_title_line_height'] ), false, 'em' ); - } - - $premium_css->set_selector( 'h2.entry-title' ); - $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['archive_post_title_weight'] ) ); - $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['archive_post_title_transform'] ) ); - - if ( '' !== $generate_settings['archive_post_title_font_size'] ) { - $premium_css->add_property( 'font-size', absint( $generate_settings['archive_post_title_font_size'] ), false, 'px' ); - } - - if ( '' !== $generate_settings['archive_post_title_line_height'] ) { - $premium_css->add_property( 'line-height', floatval( $generate_settings['archive_post_title_line_height'] ), false, 'em' ); - } - - if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { - $menu_settings = wp_parse_args( - get_option( 'generate_menu_plus_settings', array() ), - generate_menu_plus_get_defaults() - ); - - if ( $menu_settings['navigation_as_header'] || $menu_settings['sticky_navigation_logo'] || 'enable' === $menu_settings['mobile_header'] ) { - $premium_css->set_selector( '.navigation-branding .main-title' ); - $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['site_title_font_weight'] ) ); - $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['site_title_font_transform'] ) ); - $premium_css->add_property( 'font-size', absint( $generate_settings['site_title_font_size'] ), false, 'px' ); - - if ( $site_title_family ) { - $premium_css->add_property( 'font-family', 'inherit' !== $generate_settings['font_site_title'] ? $site_title_family : null ); - } - } - } - - $premium_css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); - - if ( '' !== $generate_settings['tablet_navigation_font_size'] ) { - $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items' ); - $premium_css->add_property( 'font-size', absint( $generate_settings['tablet_navigation_font_size'] ), false, 'px' ); - - $tablet_subnav_font_size = $generate_settings['tablet_navigation_font_size'] - 1; - - if ( $generate_settings['tablet_navigation_font_size'] >= 17 ) { - $tablet_subnav_font_size = $generate_settings['tablet_navigation_font_size'] - 3; - } - - $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) .main-nav ul ul li a' ); - $premium_css->add_property( 'font-size', absint( $tablet_subnav_font_size ), false, 'px' ); - } - - if ( '' !== $generate_settings['tablet_site_title_font_size'] ) { - $premium_css->set_selector( '.main-title, .navigation-branding .main-title' ); - $premium_css->add_property( 'font-size', absint( $generate_settings['tablet_site_title_font_size'] ), false, 'px' ); - } - - $premium_css->stop_media_query(); - - $premium_css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); - - $premium_css->set_selector( 'h1.entry-title' ); - - if ( '' !== $generate_settings['single_post_title_font_size_mobile'] ) { - $premium_css->add_property( 'font-size', absint( $generate_settings['single_post_title_font_size_mobile'] ), false, 'px' ); - } - - $premium_css->set_selector( 'h2.entry-title' ); - - if ( '' !== $generate_settings['archive_post_title_font_size_mobile'] ) { - $premium_css->add_property( 'font-size', absint( $generate_settings['archive_post_title_font_size_mobile'] ), false, 'px' ); - } - - $premium_css->stop_media_query(); - - $premium_css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); - - if ( ! empty( $generate_settings['mobile_navigation_font_size'] ) ) { - $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items' ); - $premium_css->add_property( 'font-size', absint( $generate_settings['mobile_navigation_font_size'] ), false, 'px' ); - - $mobile_subnav_font_size = $generate_settings['mobile_navigation_font_size'] - 1; - - if ( $generate_settings['mobile_navigation_font_size'] >= 17 ) { - $mobile_subnav_font_size = $generate_settings['mobile_navigation_font_size'] - 3; - } - - $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) .main-nav ul ul li a' ); - $premium_css->add_property( 'font-size', absint( $mobile_subnav_font_size ), false, 'px' ); - } - - if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { - $menu_settings = wp_parse_args( - get_option( 'generate_menu_plus_settings', array() ), - generate_menu_plus_get_defaults() - ); - - if ( $menu_settings['navigation_as_header'] || $menu_settings['sticky_navigation_logo'] || 'enable' === $menu_settings['mobile_header'] ) { - if ( ! empty( $generate_settings['mobile_site_title_font_size'] ) ) { - $premium_css->set_selector( '.navigation-branding .main-title' ); - $premium_css->add_property( 'font-size', absint( $generate_settings['mobile_site_title_font_size'] ), false, 'px' ); - } - } - } - - $premium_css->stop_media_query(); - - return $premium_css->css_output(); -} - -if ( ! function_exists( 'generate_typography_premium_css' ) ) { - add_action( 'wp_enqueue_scripts', 'generate_typography_premium_css', 100 ); - /** - * Add premium control CSS - * - * @since 1.3 - */ - function generate_typography_premium_css() { - if ( 'inline' === generate_get_css_print_method() ) { - wp_add_inline_style( 'generate-style', generate_typography_get_premium_css() ); - } - } -} - -add_filter( 'generate_external_dynamic_css_output', 'generate_typography_add_to_external_stylesheet' ); -/** - * Add CSS to the external stylesheet. - * - * @since 1.11.0 - * @param string $css Existing CSS. - */ -function generate_typography_add_to_external_stylesheet( $css ) { - if ( 'inline' === generate_get_css_print_method() ) { - return $css; - } - - $css .= generate_typography_get_premium_css(); - - return $css; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/google-fonts.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/google-fonts.json deleted file mode 100644 index a574abcf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/google-fonts.json +++ /dev/null @@ -1,6835 +0,0 @@ -[ - { - "family": "Roboto", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Open Sans", - "category": "sans-serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic" - ] - }, - { - "family": "Lato", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "300", - "300italic", - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Slabo 27px", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Oswald", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Roboto Condensed", - "category": "sans-serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Source Sans Pro", - "category": "sans-serif", - "variants": [ - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Montserrat", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Raleway", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "PT Sans", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Roboto Slab", - "category": "serif", - "variants": [ - "100", - "300", - "regular", - "700" - ] - }, - { - "family": "Merriweather", - "category": "serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Open Sans Condensed", - "category": "sans-serif", - "variants": [ - "300", - "300italic", - "700" - ] - }, - { - "family": "Droid Sans", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Lora", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Ubuntu", - "category": "sans-serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "700", - "700italic" - ] - }, - { - "family": "Droid Serif", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Playfair Display", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Arimo", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Noto Sans", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "PT Serif", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Titillium Web", - "category": "sans-serif", - "variants": [ - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic", - "900" - ] - }, - { - "family": "PT Sans Narrow", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Muli", - "category": "sans-serif", - "variants": [ - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Indie Flower", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Bitter", - "category": "serif", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Poppins", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Inconsolata", - "category": "monospace", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Dosis", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Fjalla One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Oxygen", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "700" - ] - }, - { - "family": "Hind", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Cabin", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Anton", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Arvo", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Noto Serif", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Crimson Text", - "category": "serif", - "variants": [ - "regular", - "italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Lobster", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Yanone Kaffeesatz", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "700" - ] - }, - { - "family": "Nunito", - "category": "sans-serif", - "variants": [ - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Bree Serif", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Catamaran", - "category": "sans-serif", - "variants": [ - "100", - "200", - "300", - "regular", - "500", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Libre Baskerville", - "category": "serif", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Abel", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Josefin Sans", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Fira Sans", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Gloria Hallelujah", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Abril Fatface", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Exo 2", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Merriweather Sans", - "category": "sans-serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "700", - "700italic", - "800", - "800italic" - ] - }, - { - "family": "Pacifico", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Roboto Mono", - "category": "monospace", - "variants": [ - "100", - "100italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "700", - "700italic" - ] - }, - { - "family": "Varela Round", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Asap", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "500", - "500italic", - "700", - "700italic" - ] - }, - { - "family": "Amatic SC", - "category": "handwriting", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Quicksand", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "700" - ] - }, - { - "family": "Karla", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Ubuntu Condensed", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Signika", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "600", - "700" - ] - }, - { - "family": "Alegreya", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Questrial", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Rubik", - "category": "sans-serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Shadows Into Light", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "PT Sans Caption", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Archivo Narrow", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Play", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Cuprum", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Dancing Script", - "category": "handwriting", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Rokkitt", - "category": "serif", - "variants": [ - "100", - "200", - "300", - "regular", - "500", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Work Sans", - "category": "sans-serif", - "variants": [ - "100", - "200", - "300", - "regular", - "500", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Francois One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Vollkorn", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Source Code Pro", - "category": "monospace", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700", - "900" - ] - }, - { - "family": "Exo", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Maven Pro", - "category": "sans-serif", - "variants": [ - "regular", - "500", - "700", - "900" - ] - }, - { - "family": "Architects Daughter", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Orbitron", - "category": "sans-serif", - "variants": [ - "regular", - "500", - "700", - "900" - ] - }, - { - "family": "Pathway Gothic One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Acme", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Ropa Sans", - "category": "sans-serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Patua One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "EB Garamond", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Lobster Two", - "category": "display", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Crete Round", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Cinzel", - "category": "serif", - "variants": [ - "regular", - "700", - "900" - ] - }, - { - "family": "Josefin Slab", - "category": "serif", - "variants": [ - "100", - "100italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Source Serif Pro", - "category": "serif", - "variants": [ - "regular", - "600", - "700" - ] - }, - { - "family": "Alegreya Sans", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Comfortaa", - "category": "display", - "variants": [ - "300", - "regular", - "700" - ] - }, - { - "family": "Russo One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "News Cycle", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "ABeeZee", - "category": "sans-serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Yellowtail", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Noticia Text", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Monda", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Quattrocento Sans", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Hammersmith One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Libre Franklin", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Satisfy", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Pontano Sans", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Righteous", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Poiret One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "BenchNine", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "700" - ] - }, - { - "family": "Arapey", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Kaushan Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Economica", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Kanit", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Old Standard TT", - "category": "serif", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Sanchez", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Courgette", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Quattrocento", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Domine", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Gudea", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Permanent Marker", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Armata", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Cantarell", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Archivo Black", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Istok Web", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Cardo", - "category": "serif", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Playfair Display SC", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Passion One", - "category": "display", - "variants": [ - "regular", - "700", - "900" - ] - }, - { - "family": "Tinos", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Cookie", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Cormorant Garamond", - "category": "serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Philosopher", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Yantramanav", - "category": "sans-serif", - "variants": [ - "100", - "300", - "regular", - "500", - "700", - "900" - ] - }, - { - "family": "Chewy", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Antic Slab", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Handlee", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Teko", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Boogaloo", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Vidaloka", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Audiowide", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Coming Soon", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Alfa Slab One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Cabin Condensed", - "category": "sans-serif", - "variants": [ - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Ruda", - "category": "sans-serif", - "variants": [ - "regular", - "700", - "900" - ] - }, - { - "family": "Ek Mukta", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Changa One", - "category": "display", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Tangerine", - "category": "handwriting", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Great Vibes", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Sintony", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Khand", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Bevan", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Kalam", - "category": "handwriting", - "variants": [ - "300", - "regular", - "700" - ] - }, - { - "family": "Days One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Bangers", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rajdhani", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Droid Sans Mono", - "category": "monospace", - "variants": [ - "regular" - ] - }, - { - "family": "Kreon", - "category": "serif", - "variants": [ - "300", - "regular", - "700" - ] - }, - { - "family": "Rambla", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Shrikhand", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fredoka One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Shadows Into Light Two", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Playball", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Neuton", - "category": "serif", - "variants": [ - "200", - "300", - "regular", - "italic", - "700", - "800" - ] - }, - { - "family": "Copse", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Didact Gothic", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Signika Negative", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "600", - "700" - ] - }, - { - "family": "Amiri", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Gentium Book Basic", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Glegoo", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Oleo Script", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Voltaire", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Actor", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Amaranth", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Paytone One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Volkhov", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Sorts Mill Goudy", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Bad Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Coda", - "category": "display", - "variants": [ - "regular", - "800" - ] - }, - { - "family": "Damion", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Sacramento", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Squada One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rock Salt", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Adamina", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Alice", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Cantata One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Luckiest Guy", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rochester", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Covered By Your Grace", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Heebo", - "category": "sans-serif", - "variants": [ - "100", - "300", - "regular", - "500", - "700", - "800", - "900" - ] - }, - { - "family": "VT323", - "category": "monospace", - "variants": [ - "regular" - ] - }, - { - "family": "Nothing You Could Do", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Patrick Hand", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Gentium Basic", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Nobile", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Rancho", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Marck Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Special Elite", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Julius Sans One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Varela", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "PT Mono", - "category": "monospace", - "variants": [ - "regular" - ] - }, - { - "family": "Alex Brush", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Homemade Apple", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Scada", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Jura", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600" - ] - }, - { - "family": "Antic", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Gochi Hand", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Sarala", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Electrolize", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sigmar One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Candal", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Prata", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Homenaje", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Pinyon Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Unica One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Basic", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Neucha", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Convergence", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Molengo", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Caveat Brush", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Monoton", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Calligraffitti", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Kameron", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Share", - "category": "display", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Alegreya Sans SC", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Enriqueta", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Martel", - "category": "serif", - "variants": [ - "200", - "300", - "regular", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Black Ops One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Just Another Hand", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Caveat", - "category": "handwriting", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "PT Serif Caption", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Ultra", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Ubuntu Mono", - "category": "monospace", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Carme", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Cousine", - "category": "monospace", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Cherry Cream Soda", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Reenie Beanie", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Hind Siliguri", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Bubblegum Sans", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Aldrich", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Lustria", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Alef", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Freckle Face", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fanwood Text", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Advent Pro", - "category": "sans-serif", - "variants": [ - "100", - "200", - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Allura", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Ceviche One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Press Start 2P", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Overlock", - "category": "display", - "variants": [ - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Niconne", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Limelight", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Frank Ruhl Libre", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "700", - "900" - ] - }, - { - "family": "Allerta Stencil", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Marcellus", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Pragati Narrow", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Michroma", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Fauna One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Syncopate", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Telex", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Marvel", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Cabin Sketch", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Hanuman", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Cairo", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "600", - "700", - "900" - ] - }, - { - "family": "Chivo", - "category": "sans-serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Allerta", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Fugaz One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Viga", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Ruslan Display", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Nixie One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Marmelad", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Average", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Spinnaker", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Leckerli One", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Judson", - "category": "serif", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Lusitana", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Montserrat Alternates", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Contrail One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Oranienbaum", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Hind Vadodara", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Rufina", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Quantico", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Concert One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Marcellus SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Jockey One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Parisienne", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Carter One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Arbutus Slab", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Slabo 13px", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Tauri", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Goudy Bookletter 1911", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Carrois Gothic", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sue Ellen Francisco", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Walter Turncoat", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Annie Use Your Telescope", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Puritan", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Grand Hotel", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Yesteryear", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Jaldi", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Khula", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "600", - "700", - "800" - ] - }, - { - "family": "Cinzel Decorative", - "category": "display", - "variants": [ - "regular", - "700", - "900" - ] - }, - { - "family": "Crafty Girls", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Merienda", - "category": "handwriting", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Hind Guntur", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Cutive", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Prompt", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Coustard", - "category": "serif", - "variants": [ - "regular", - "900" - ] - }, - { - "family": "Arima Madurai", - "category": "display", - "variants": [ - "100", - "200", - "300", - "regular", - "500", - "700", - "800", - "900" - ] - }, - { - "family": "Doppio One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Radley", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Fontdiner Swanky", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Iceland", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Alegreya SC", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic", - "900", - "900italic" - ] - }, - { - "family": "Halant", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Schoolbell", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Waiting for the Sunrise", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Italianno", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Fredericka the Great", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Average Sans", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Rosario", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Mr Dafoe", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Port Lligat Slab", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Aclonica", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Graduate", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Racing Sans One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Berkshire Swash", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Forum", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Anonymous Pro", - "category": "monospace", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Love Ya Like A Sister", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Nunito Sans", - "category": "sans-serif", - "variants": [ - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Magra", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Lateef", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Assistant", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "600", - "700", - "800" - ] - }, - { - "family": "Six Caps", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Gilda Display", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Oregano", - "category": "display", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Metrophobic", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Lalezar", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Caudex", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Kelly Slab", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Reem Kufi", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Cambay", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Gruppo", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Give You Glory", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "GFS Didot", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Duru Sans", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Andika", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Tenor Sans", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Knewave", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Averia Serif Libre", - "category": "display", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Eczar", - "category": "serif", - "variants": [ - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Inder", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Martel Sans", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Trocchi", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Wire One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Petit Formal Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Mako", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Frijole", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Zeyada", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Slackey", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Karma", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Mate", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Belleza", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Montez", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Quando", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Capriola", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Lilita One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Trirong", - "category": "serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Lekton", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Just Me Again Down Here", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Bowlby One SC", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "The Girl Next Door", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Happy Monkey", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Merienda One", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Alike", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Chelsea Market", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Unkempt", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Anaheim", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Strait", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Brawler", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Clicker Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Delius", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Mouse Memoirs", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "IM Fell Double Pica", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Crushed", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rammetto One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Prosto One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Kranky", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "IM Fell English", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Aladin", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Mr De Haviland", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "NTR", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Londrina Solid", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Skranji", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Allan", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Baumans", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ovo", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Changa", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Lemon", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Federo", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Herr Von Muellerhoff", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Arizonia", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Bowlby One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Orienta", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Short Stack", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Bungee Inline", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Andada", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Baloo Paaji", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Oxygen Mono", - "category": "monospace", - "variants": [ - "regular" - ] - }, - { - "family": "Yeseva One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "UnifrakturMaguntia", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Bentham", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Londrina Outline", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Pompiere", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Gabriela", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Qwigley", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Square", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Poly", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Sniglet", - "category": "display", - "variants": [ - "regular", - "800" - ] - }, - { - "family": "Patrick Hand SC", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Gravitas One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Khmer", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Shojumaru", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Kurale", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Gafata", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Biryani", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Cambo", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Titan One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Carrois Gothic SC", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "La Belle Aurore", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Holtwood One SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Oleo Script Swash Caps", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Headland One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Cherry Swash", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Belgrano", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Norican", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Mountains of Christmas", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Julee", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Ramabhadra", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Mallanna", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Kristi", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Imprima", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Lily Script One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Chau Philomene One", - "category": "sans-serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Bilbo Swash Caps", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Finger Paint", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Voces", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Itim", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Megrim", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Simonetta", - "category": "display", - "variants": [ - "regular", - "italic", - "900", - "900italic" - ] - }, - { - "family": "Cutive Mono", - "category": "monospace", - "variants": [ - "regular" - ] - }, - { - "family": "Stardos Stencil", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "IM Fell DW Pica", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Unna", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Loved by the King", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Prociono", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Corben", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Amiko", - "category": "sans-serif", - "variants": [ - "regular", - "600", - "700" - ] - }, - { - "family": "Denk One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Palanquin", - "category": "sans-serif", - "variants": [ - "100", - "200", - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Baloo", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fondamento", - "category": "handwriting", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Seaweed Script", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Shanti", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Wendy One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Raleway Dots", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Amethysta", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Vast Shadow", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Stalemate", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Fira Mono", - "category": "monospace", - "variants": [ - "regular", - "500", - "700" - ] - }, - { - "family": "Expletus Sans", - "category": "display", - "variants": [ - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Scheherazade", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Fenix", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Delius Swash Caps", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Rouge Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Life Savers", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "IM Fell English SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Meddon", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Tienne", - "category": "serif", - "variants": [ - "regular", - "700", - "900" - ] - }, - { - "family": "Over the Rainbow", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Share Tech Mono", - "category": "monospace", - "variants": [ - "regular" - ] - }, - { - "family": "Abhaya Libre", - "category": "serif", - "variants": [ - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Kotta One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Pridi", - "category": "serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Euphoria Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Engagement", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Podkova", - "category": "serif", - "variants": [ - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Salsa", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Sofia", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Suranna", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Mada", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "900" - ] - }, - { - "family": "Chonburi", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ledger", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Italiana", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Dawning of a New Day", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Nokora", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Angkor", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Medula One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Taviraj", - "category": "serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Vampiro One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Englebert", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Mono", - "category": "monospace", - "variants": [ - "regular" - ] - }, - { - "family": "Dorsa", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Averia Sans Libre", - "category": "display", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Cedarville Cursive", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Geo", - "category": "sans-serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Rationale", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Balthazar", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sunshiney", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Aguafina Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Mystery Quest", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fjord One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Fira Sans Extra Condensed", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Kadwa", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "McLaren", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rye", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Sail", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Athiti", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Rosarivo", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Kite One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Odor Mean Chey", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Numans", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Artifika", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Poller One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Gurajada", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Inika", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Mandali", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Bungee Shade", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Suwannaphum", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Mate SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Creepster", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Arsenal", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Montserrat Subrayada", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Metamorphous", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Palanquin Dark", - "category": "sans-serif", - "variants": [ - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Coda Caption", - "category": "sans-serif", - "variants": [ - "800" - ] - }, - { - "family": "Dynalight", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Maitree", - "category": "serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "IM Fell French Canon", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Amarante", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Quintessential", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Codystar", - "category": "display", - "variants": [ - "300", - "regular" - ] - }, - { - "family": "Cantora One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Aref Ruqaa", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Griffy", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Revalia", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Buenard", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Donegal One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "IM Fell DW Pica SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Habibi", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Share Tech", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Flamenco", - "category": "display", - "variants": [ - "300", - "regular" - ] - }, - { - "family": "Mitr", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Maiden Orange", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Diplomata SC", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Cormorant", - "category": "serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Delius Unicase", - "category": "handwriting", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Stoke", - "category": "serif", - "variants": [ - "300", - "regular" - ] - }, - { - "family": "Vibur", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Sarpanch", - "category": "sans-serif", - "variants": [ - "regular", - "500", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Baloo Bhaina", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Baloo Tamma", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Averia Libre", - "category": "display", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Esteban", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Battambang", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Bokor", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Wallpoet", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "IM Fell Great Primer", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Tulpen One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Proza Libre", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic" - ] - }, - { - "family": "IM Fell French Canon SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Vesper Libre", - "category": "serif", - "variants": [ - "regular", - "500", - "700", - "900" - ] - }, - { - "family": "Rozha One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sansita", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Kavoon", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Della Respira", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Milonga", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Condiment", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Junge", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "New Rocker", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Chicle", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Mrs Saint Delafield", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "League Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Miniver", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Galindo", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Moul", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Amatica SC", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Stint Ultra Expanded", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Yrsa", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Stint Ultra Condensed", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Suez One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Text Me One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Buda", - "category": "display", - "variants": [ - "300" - ] - }, - { - "family": "Ruluko", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sonsie One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Krona One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Elsie", - "category": "display", - "variants": [ - "regular", - "900" - ] - }, - { - "family": "Pangolin", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Linden Hill", - "category": "serif", - "variants": [ - "regular", - "italic" - ] - }, - { - "family": "Secular One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "IM Fell Double Pica SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Alike Angular", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sancreek", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Bilbo", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Antic Didone", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Paprika", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Asul", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "David Libre", - "category": "serif", - "variants": [ - "regular", - "500", - "700" - ] - }, - { - "family": "Almendra", - "category": "serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Sriracha", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Miriam Libre", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Ribeye", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Swanky and Moo Moo", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Trade Winds", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Overlock SC", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Round", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Cagliostro", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Glass Antiqua", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Offside", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "El Messiri", - "category": "sans-serif", - "variants": [ - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Bigshot One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "IM Fell Great Primer SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Akronim", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fira Sans Condensed", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Nosifer", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Autour One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Pirata One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Port Lligat Sans", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Scope One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sumana", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Lemonada", - "category": "display", - "variants": [ - "300", - "regular", - "600", - "700" - ] - }, - { - "family": "Montaga", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Iceberg", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ruthie", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Content", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Henny Penny", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Slim", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Hind Madurai", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Harmattan", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "UnifrakturCook", - "category": "display", - "variants": [ - "700" - ] - }, - { - "family": "Sarina", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Bubbler One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Dekko", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Redressed", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Laila", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Faster One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Arya", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Peralta", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Meie Script", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Overpass", - "category": "sans-serif", - "variants": [ - "100", - "100italic", - "200", - "200italic", - "300", - "300italic", - "regular", - "italic", - "600", - "600italic", - "700", - "700italic", - "800", - "800italic", - "900", - "900italic" - ] - }, - { - "family": "Monsieur La Doulaise", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Bungee", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Snippet", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Emilys Candy", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Trykker", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "MedievalSharp", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Space Mono", - "category": "monospace", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Croissant One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Monofett", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Lovers Quarrel", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Oldenburg", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Galdeano", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Spicy Rice", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Wellfleet", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Germania One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "GFS Neohellenic", - "category": "sans-serif", - "variants": [ - "regular", - "italic", - "700", - "700italic" - ] - }, - { - "family": "Baloo Thambi", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Jolly Lodger", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rubik Mono One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Pattaya", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Joti One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Siemreap", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ranga", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Chango", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Miltonian Tattoo", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Koulen", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Eagle Lake", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Flat", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Petrona", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Jacques Francois", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Amita", - "category": "handwriting", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Plaster", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ramaraja", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Sura", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Kenia", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fresca", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Jomhuria", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Lancelot", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Pavanam", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Rum Raisin", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Almendra SC", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Purple Purse", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Kumar One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Modern Antiqua", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Piedra", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Irish Grover", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Molle", - "category": "handwriting", - "variants": [ - "italic" - ] - }, - { - "family": "Cormorant Infant", - "category": "serif", - "variants": [ - "300", - "300italic", - "regular", - "italic", - "500", - "500italic", - "600", - "600italic", - "700", - "700italic" - ] - }, - { - "family": "Margarine", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Sahitya", - "category": "serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Mukta Vaani", - "category": "sans-serif", - "variants": [ - "200", - "300", - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Astloch", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Snowburst One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rhodium Libre", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Smythe", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Asset", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ewert", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Keania One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ranchers", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Gorditas", - "category": "display", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Sirin Stencil", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Averia Gruesa Libre", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Trochut", - "category": "display", - "variants": [ - "regular", - "italic", - "700" - ] - }, - { - "family": "Baloo Chettan", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Kdam Thmor", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Timmana", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Original Surfer", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Supermercado One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Mirza", - "category": "display", - "variants": [ - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Passero One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Oval", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Caesar Dressing", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Taprom", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fascinate", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Seymour One", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Freehand", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ravi Prakash", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Coiny", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Atomic Age", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Jacques Francois Shadow", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Diplomata", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Dr Sugiyama", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Miltonian", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ribeye Marrow", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Elsie Swash Caps", - "category": "display", - "variants": [ - "regular", - "900" - ] - }, - { - "family": "Felipa", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Galada", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Script", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Bayon", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Underdog", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Devonshire", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Atma", - "category": "display", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Londrina Shadow", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Sofadi One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Tillana", - "category": "handwriting", - "variants": [ - "regular", - "500", - "600", - "700", - "800" - ] - }, - { - "family": "Inknut Antiqua", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700", - "800", - "900" - ] - }, - { - "family": "Goblin One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rakkas", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Metal", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Farsan", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Londrina Sketch", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Nova Cut", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "BioRhyme", - "category": "serif", - "variants": [ - "200", - "300", - "regular", - "700", - "800" - ] - }, - { - "family": "Warnes", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Romanesco", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Fascinate Inline", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Mrs Sheppards", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Princess Sofia", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Modak", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Spirax", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Cormorant Upright", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Geostar Fill", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Cormorant SC", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Baloo Bhai", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Sree Krushnadevaraya", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Smokum", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Arbutus", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fruktur", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Geostar", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Marko One", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Erica One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Yatra One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Uncial Antiqua", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Combo", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Gidugu", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Aubrey", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Jim Nightshade", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Butterfly Kids", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Metal Mania", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Macondo", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Chenla", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Miss Fajardose", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Macondo Swash Caps", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Barrio", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Sevillana", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Bigelow Rules", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Rasa", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Risque", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Federant", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Dangrek", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Chathura", - "category": "sans-serif", - "variants": [ - "100", - "300", - "regular", - "700", - "800" - ] - }, - { - "family": "Almendra Display", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Chela One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Bonbon", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Stalinist One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Mr Bedfort", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Eater", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Fasthand", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Mogra", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Padauk", - "category": "sans-serif", - "variants": [ - "regular", - "700" - ] - }, - { - "family": "Preahvihear", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Flavors", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Ruge Boogie", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Tenali Ramakrishna", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Unlock", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Butcherman", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Baloo Da", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Lakki Reddy", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Cormorant Unicase", - "category": "serif", - "variants": [ - "300", - "regular", - "500", - "600", - "700" - ] - }, - { - "family": "Katibeh", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Asar", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Emblema One", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Moulpali", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Meera Inimai", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Kantumruy", - "category": "sans-serif", - "variants": [ - "300", - "regular", - "700" - ] - }, - { - "family": "Suravaram", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Bungee Hairline", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Overpass Mono", - "category": "monospace", - "variants": [ - "300", - "regular", - "600", - "700" - ] - }, - { - "family": "Peddana", - "category": "serif", - "variants": [ - "regular" - ] - }, - { - "family": "Bahiana", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Kumar One Outline", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Hanalei Fill", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Dhurjati", - "category": "sans-serif", - "variants": [ - "regular" - ] - }, - { - "family": "Hanalei", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "Kavivanar", - "category": "handwriting", - "variants": [ - "regular" - ] - }, - { - "family": "Bungee Outline", - "category": "display", - "variants": [ - "regular" - ] - }, - { - "family": "BioRhyme Expanded", - "category": "serif", - "variants": [ - "200", - "300", - "regular", - "700", - "800" - ] - } -] diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/js/customizer.js deleted file mode 100644 index f214b655..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/js/customizer.js +++ /dev/null @@ -1,250 +0,0 @@ -function gp_premium_typography_live_update( id, selector, property, unit, media, settings ) { - settings = typeof settings !== 'undefined' ? settings : 'generate_settings'; - wp.customize( settings + '[' + id + ']', function( value ) { - value.bind( function( newval ) { - // Get our unit if applicable - unit = typeof unit !== 'undefined' ? unit : ''; - - var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false, - isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false; - - if ( isTablet ) { - if ( '' == wp.customize(settings + '[' + id + ']').get() ) { - var desktopID = id.replace( 'tablet_', '' ); - newval = wp.customize(settings + '[' + desktopID + ']').get(); - } - } - - if ( isMobile ) { - if ( '' == wp.customize(settings + '[' + id + ']').get() ) { - var desktopID = id.replace( 'mobile_', '' ); - newval = wp.customize(settings + '[' + desktopID + ']').get(); - } - } - - if ( 'buttons_font_size' == id && '' == wp.customize('generate_settings[buttons_font_size]').get() ) { - newval = wp.customize('generate_settings[body_font_size]').get(); - } - - if ( 'single_post_title_weight' == id && '' == wp.customize('generate_settings[single_post_title_weight]').get() ) { - newval = wp.customize('generate_settings[heading_1_weight]').get(); - } - - if ( 'single_post_title_transform' == id && '' == wp.customize('generate_settings[single_post_title_transform]').get() ) { - newval = wp.customize('generate_settings[heading_1_transform]').get(); - } - - if ( 'archive_post_title_weight' == id && '' == wp.customize('generate_settings[archive_post_title_weight]').get() ) { - newval = wp.customize('generate_settings[heading_2_weight]').get(); - } - - if ( 'archive_post_title_transform' == id && '' == wp.customize('generate_settings[archive_post_title_transform]').get() ) { - newval = wp.customize('generate_settings[heading_2_transform]').get(); - } - - // We're using a desktop value - if ( ! isTablet && ! isMobile ) { - - var tabletValue = ( typeof wp.customize(settings + '[tablet_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[tablet_' + id + ']').get() : '', - mobileValue = ( typeof wp.customize(settings + '[mobile_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[mobile_' + id + ']').get() : ''; - - // The tablet setting exists, mobile doesn't - if ( '' !== tabletValue && '' == mobileValue ) { - media = gp_typography.desktop + ', ' + gp_typography.mobile; - } - - // The tablet setting doesn't exist, mobile does - if ( '' == tabletValue && '' !== mobileValue ) { - media = gp_typography.desktop + ', ' + gp_typography.tablet; - } - - // The tablet setting doesn't exist, neither does mobile - if ( '' == tabletValue && '' == mobileValue ) { - media = gp_typography.desktop + ', ' + gp_typography.tablet + ', ' + gp_typography.mobile; - } - - } - - // Check if media query - media_query = typeof media !== 'undefined' ? 'media="' + media + '"' : ''; - - jQuery( 'head' ).append( '' ); - setTimeout(function() { - jQuery( 'style#' + id ).not( ':last' ).remove(); - }, 1000); - - setTimeout("jQuery('body').trigger('generate_spacing_updated');", 1000); - } ); - } ); -} - -/** - * Body font size, weight and transform - */ -gp_premium_typography_live_update( 'body_font_size', 'body, button, input, select, textarea', 'font-size', 'px' ); -gp_premium_typography_live_update( 'body_line_height', 'body', 'line-height', '' ); -gp_premium_typography_live_update( 'paragraph_margin', 'p, .entry-content > [class*="wp-block-"]:not(:last-child)', 'margin-bottom', 'em' ); -gp_premium_typography_live_update( 'body_font_weight', 'body, button, input, select, textarea', 'font-weight' ); -gp_premium_typography_live_update( 'body_font_transform', 'body, button, input, select, textarea', 'text-transform' ); - -/** - * Top bar font size, weight and transform - */ -gp_premium_typography_live_update( 'top_bar_font_size', '.top-bar', 'font-size', 'px' ); -gp_premium_typography_live_update( 'top_bar_font_weight', '.top-bar', 'font-weight' ); -gp_premium_typography_live_update( 'top_bar_font_transform', '.top-bar', 'text-transform' ); - -/** - * Site title font size, weight and transform - */ -gp_premium_typography_live_update( 'site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'tablet_site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.tablet ); -gp_premium_typography_live_update( 'mobile_site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'site_title_font_weight', '.main-title, .navigation-branding .main-title', 'font-weight' ); -gp_premium_typography_live_update( 'site_title_font_transform', '.main-title, .navigation-branding .main-title', 'text-transform' ); - -/** - * Site description font size, weight and transform - */ -gp_premium_typography_live_update( 'site_tagline_font_size', '.site-description', 'font-size', 'px' ); -gp_premium_typography_live_update( 'site_tagline_font_weight', '.site-description', 'font-weight' ); -gp_premium_typography_live_update( 'site_tagline_font_transform', '.site-description', 'text-transform' ); - -/** - * Main navigation font size, weight and transform - */ -gp_premium_typography_live_update( 'navigation_font_size', '.main-navigation a, .menu-toggle, .main-navigation .menu-bar-items', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'tablet_navigation_font_size', '.main-navigation a, .menu-toggle, .main-navigation .menu-bar-items', 'font-size', 'px', gp_typography.tablet ); -gp_premium_typography_live_update( 'mobile_navigation_font_size', '.main-navigation:not(.slideout-navigation) a, .menu-toggle, .main-navigation .menu-bar-items', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'navigation_font_weight', '.main-navigation a, .menu-toggle', 'font-weight' ); -gp_premium_typography_live_update( 'navigation_font_transform', '.main-navigation a, .menu-toggle', 'text-transform' ); - -/** - * Site title when in navigation. - */ - gp_premium_typography_live_update( 'navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.desktop ); - gp_premium_typography_live_update( 'tablet_navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.tablet ); - gp_premium_typography_live_update( 'mobile_navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.mobile ); - -/** - * Secondary navigation font size, weight and transform - */ -gp_premium_typography_live_update( 'secondary_navigation_font_size', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar, .secondary-navigation .secondary-menu-bar-items', 'font-size', 'px', '', 'generate_secondary_nav_settings' ); -gp_premium_typography_live_update( 'secondary_navigation_font_weight', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar', 'font-weight', '', '', 'generate_secondary_nav_settings' ); -gp_premium_typography_live_update( 'secondary_navigation_font_transform', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar', 'text-transform', '', '', 'generate_secondary_nav_settings' ); - -/** - * Buttons - */ -gp_premium_typography_live_update( 'buttons_font_size', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'font-size', 'px' ); -gp_premium_typography_live_update( 'buttons_font_weight', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'font-weight' ); -gp_premium_typography_live_update( 'buttons_font_transform', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'text-transform' ); - -/** - * H1 font size, weight and transform - */ -gp_premium_typography_live_update( 'heading_1_font_size', 'h1', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'mobile_heading_1_font_size', 'h1', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'heading_1_weight', 'h1', 'font-weight' ); -gp_premium_typography_live_update( 'heading_1_transform', 'h1', 'text-transform' ); -gp_premium_typography_live_update( 'heading_1_line_height', 'h1', 'line-height', 'em' ); -gp_premium_typography_live_update( 'heading_1_margin_bottom', 'h1', 'margin-bottom', 'px' ); - -/** - * Single content title (h1) - */ -gp_premium_typography_live_update( 'single_post_title_font_size', 'h1.entry-title', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'single_post_title_font_size_mobile', 'h1.entry-title', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'single_post_title_weight', 'h1.entry-title', 'font-weight' ); -gp_premium_typography_live_update( 'single_post_title_transform', 'h1.entry-title', 'text-transform' ); -gp_premium_typography_live_update( 'single_post_title_line_height', 'h1.entry-title', 'line-height', 'em' ); - -/** - * H2 font size, weight and transform - */ -gp_premium_typography_live_update( 'heading_2_font_size', 'h2', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'mobile_heading_2_font_size', 'h2', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'heading_2_weight', 'h2', 'font-weight' ); -gp_premium_typography_live_update( 'heading_2_transform', 'h2', 'text-transform' ); -gp_premium_typography_live_update( 'heading_2_line_height', 'h2', 'line-height', 'em' ); -gp_premium_typography_live_update( 'heading_2_margin_bottom', 'h2', 'margin-bottom', 'px' ); - -/** - * Archive post title (h1) - */ -gp_premium_typography_live_update( 'archive_post_title_font_size', 'h2.entry-title', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'archive_post_title_font_size_mobile', 'h2.entry-title', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'archive_post_title_weight', 'h2.entry-title', 'font-weight' ); -gp_premium_typography_live_update( 'archive_post_title_transform', 'h2.entry-title', 'text-transform' ); -gp_premium_typography_live_update( 'archive_post_title_line_height', 'h2.entry-title', 'line-height', 'em' ); - -/** - * H3 font size, weight and transform - */ -gp_premium_typography_live_update( 'heading_3_font_size', 'h3', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'mobile_heading_3_font_size', 'h3', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'heading_3_weight', 'h3', 'font-weight' ); -gp_premium_typography_live_update( 'heading_3_transform', 'h3', 'text-transform' ); -gp_premium_typography_live_update( 'heading_3_line_height', 'h3', 'line-height', 'em' ); -gp_premium_typography_live_update( 'heading_3_margin_bottom', 'h3', 'margin-bottom', 'px' ); - -/** - * H4 font size, weight and transform - */ -gp_premium_typography_live_update( 'heading_4_font_size', 'h4', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'mobile_heading_4_font_size', 'h4', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'heading_4_weight', 'h4', 'font-weight' ); -gp_premium_typography_live_update( 'heading_4_transform', 'h4', 'text-transform' ); -gp_premium_typography_live_update( 'heading_4_line_height', 'h4', 'line-height', 'em' ); - -/** - * H5 font size, weight and transform - */ -gp_premium_typography_live_update( 'heading_5_font_size', 'h5', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'mobile_heading_5_font_size', 'h5', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'heading_5_weight', 'h5', 'font-weight' ); -gp_premium_typography_live_update( 'heading_5_transform', 'h5', 'text-transform' ); -gp_premium_typography_live_update( 'heading_5_line_height', 'h5', 'line-height', 'em' ); - -/** - * H6 font size, weight and transform - */ -gp_premium_typography_live_update( 'heading_6_font_size', 'h6', 'font-size', 'px' ); -gp_premium_typography_live_update( 'heading_6_weight', 'h6', 'font-weight' ); -gp_premium_typography_live_update( 'heading_6_transform', 'h6', 'text-transform' ); -gp_premium_typography_live_update( 'heading_6_line_height', 'h6', 'line-height', 'em' ); - -/** - * Widget title font size, weight and transform - */ -gp_premium_typography_live_update( 'widget_title_font_size', '.widget-title', 'font-size', 'px' ); -gp_premium_typography_live_update( 'widget_title_font_weight', '.widget-title', 'font-weight' ); -gp_premium_typography_live_update( 'widget_title_font_transform', '.widget-title', 'text-transform' ); -gp_premium_typography_live_update( 'widget_title_separator', '.widget-title', 'margin-bottom', 'px' ); -gp_premium_typography_live_update( 'widget_content_font_size', '.sidebar .widget, .footer-widgets .widget', 'font-size', 'px' ); - -/** - * Footer font size, weight and transform - */ -gp_premium_typography_live_update( 'footer_font_size', '.site-info', 'font-size', 'px' ); -gp_premium_typography_live_update( 'footer_weight', '.site-info', 'font-weight' ); -gp_premium_typography_live_update( 'footer_transform', '.site-info', 'text-transform' ); -gp_premium_typography_live_update( 'footer_line_height', '.site-info', 'line-height', 'em' ); - -/** - * WooCommerce product title - */ -gp_premium_typography_live_update( 'wc_product_title_font_size', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'mobile_wc_product_title_font_size', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'wc_product_title_font_weight', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-weight' ); -gp_premium_typography_live_update( 'wc_product_title_font_transform', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'text-transform' ); - -gp_premium_typography_live_update( 'wc_related_product_title_font_size', '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2', 'font-size', 'px' ); - -/** - * Slideout navigation font size, weight and transform - */ -gp_premium_typography_live_update( 'slideout_font_size', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-size', 'px', gp_typography.desktop ); -gp_premium_typography_live_update( 'slideout_mobile_font_size', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-size', 'px', gp_typography.mobile ); -gp_premium_typography_live_update( 'slideout_font_weight', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-weight' ); -gp_premium_typography_live_update( 'slideout_font_transform', '.slideout-navigation.main-navigation .main-nav ul li a', 'text-transform' ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/migration.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/migration.php deleted file mode 100644 index c2ea0e08..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/migration.php +++ /dev/null @@ -1,359 +0,0 @@ - $generate_settings[ $setting ], - 'variants' => $variants, - 'category' => $category ? $category : 'sans-serif', - ); - } - - if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) { - $secondary_nav_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - - $secondary_nav_id = strtolower( str_replace( ' ', '_', $secondary_nav_settings[ 'font_secondary_navigation' ] ) ); - - if ( ! array_key_exists( $secondary_nav_id, $select_fonts ) && ! in_array( $secondary_nav_settings[ 'font_secondary_navigation' ], generate_typography_default_fonts() ) ) { - $variants = get_theme_mod( 'font_secondary_navigation_variants', array() ); - $category = get_theme_mod( 'font_secondary_navigation_category' ); - - if ( ! empty( $variants ) && ! is_array( $variants ) ) { - $variants = explode( ',', $variants ); - } - - if ( ! $variants ) { - if ( ! $all_fonts ) { - $all_fonts = generate_get_all_google_fonts(); - } - - if ( array_key_exists( $secondary_nav_id, $all_fonts ) ) { - $variants = $all_fonts[ $secondary_nav_id ]['variants']; - } - } - - if ( ! $category ) { - if ( ! $all_fonts ) { - $all_fonts = generate_get_all_google_fonts(); - } - - if ( array_key_exists( $secondary_nav_id, $all_fonts ) ) { - $category = $all_fonts[ $secondary_nav_id ]['category']; - } - } - - $fonts[ $secondary_nav_id ] = array( - 'name' => $secondary_nav_settings[ 'font_secondary_navigation' ], - 'variants' => $variants, - 'category' => $category ? $category : 'sans-serif', - ); - } - } - - return $fonts; - } -} - -if ( ! function_exists( 'generate_typography_set_font_data' ) ) { - add_action( 'admin_init', 'generate_typography_set_font_data' ); - /** - * This function will check to see if your category and variants are saved - * If not, it will set them for you, and won't run again - * - * @since 1.2.90 - */ - function generate_typography_set_font_data() { - // Bail if we don't have our defaults - if ( ! function_exists( 'generate_get_default_fonts' ) ) { - return; - } - - // Get our defaults - $defaults = generate_get_default_fonts(); - - // Get our settings - $generate_settings = wp_parse_args( - get_option( 'generate_settings', array() ), - generate_get_default_fonts() - ); - - // We need to loop through these settings - $font_settings = array( - 'font_body', - 'font_site_title', - 'font_site_tagline', - 'font_navigation', - 'font_widget_title', - 'font_heading_1', - 'font_heading_2', - 'font_heading_3' - ); - - // Add secondary navigation to the array last if it exists - if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) { - $font_settings[ 'font_secondary_navigation' ] = 'font_secondary_navigation'; - } - - // Start looping - foreach( $font_settings as $setting ) { - - // Change our variables for the secondary navigation - this will run last - if ( function_exists( 'generate_secondary_nav_get_defaults' ) && 'font_secondary_navigation' == $setting ) { - $generate_settings = wp_parse_args( - get_option( 'generate_secondary_nav_settings', array() ), - generate_secondary_nav_get_defaults() - ); - $defaults = generate_secondary_nav_get_defaults(); - } - - // We don't need to do this if we're using the default font, as these values have defaults already - if ( $defaults[ $setting ] == $generate_settings[ $setting ] ) { - continue; - } - - // Don't need to continue if we're using a system font or our default font - if ( in_array( $generate_settings[ $setting ], generate_typography_default_fonts() ) || 'Open Sans' == $generate_settings[ $setting ] ) { - continue; - } - - // Don't continue if our category and variants are already set - if ( get_theme_mod( $setting . '_category' ) && get_theme_mod( $setting . '_variants' ) ) { - continue; - } - - // Get all of our fonts - $fonts = generate_get_all_google_fonts(); - - // Get the ID from our font - $id = strtolower( str_replace( ' ', '_', $generate_settings[ $setting ] ) ); - - // If the ID doesn't exist within our fonts, we can bail - if ( ! array_key_exists( $id, $fonts ) ) { - continue; - } - - // Let's grab our category to go with our font - $category = ! empty( $fonts[$id]['category'] ) ? $fonts[$id]['category'] : ''; - - // Grab all of the variants associated with our font - $variants = $fonts[$id]['variants']; - - // Loop through our variants and put them into an array, then turn them into a comma separated list - $output = array(); - if ( $variants ) { - foreach ( $variants as $variant ) { - $output[] = $variant; - } - - $variants = implode( ',', $output ); - } - - // Set our theme mods with our new settings - if ( '' !== $category ) { - set_theme_mod( $setting . '_category', $category ); - } - - if ( '' !== $variants ) { - set_theme_mod( $setting . '_variants', $variants ); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/secondary-nav-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/secondary-nav-fonts.php deleted file mode 100644 index 76081000..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/secondary-nav-fonts.php +++ /dev/null @@ -1,176 +0,0 @@ -get_section( 'secondary_nav_section' ) ) { - return; - } - - // Get our controls - require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; - - // Get our defaults - $defaults = generate_secondary_nav_get_defaults(); - - // Register our custom controls - if ( method_exists( $wp_customize,'register_control_type' ) ) { - $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Add our section - $wp_customize->add_section( - 'secondary_font_section', - array( - 'title' => __( 'Secondary Navigation', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'description' => '', - 'priority' => 51, - 'panel' => 'generate_typography_panel' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_secondary_navigation_typography_shortcuts', - array( - 'section' => 'secondary_font_section', - 'element' => __( 'Secondary Navigation', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'secondary_nav_section', - 'colors' => 'secondary_navigation_color_section', - 'backgrounds' => 'secondary_bg_images_section', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - // Font family - $wp_customize->add_setting( - 'generate_secondary_nav_settings[font_secondary_navigation]', - array( - 'default' => $defaults['font_secondary_navigation'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_text_field' - ) - ); - - // Category - $wp_customize->add_setting( - 'font_secondary_navigation_category', - array( - 'default' => $defaults['font_secondary_navigation_category'], - 'sanitize_callback' => 'sanitize_text_field' - ) - ); - - // Variants - $wp_customize->add_setting( - 'font_secondary_navigation_variants', - array( - 'default' => $defaults['font_secondary_navigation_variants'], - 'sanitize_callback' => 'generate_premium_sanitize_variants' - ) - ); - - // Font weight - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_navigation_font_weight]', - array( - 'default' => $defaults['secondary_navigation_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage' - ) - ); - - // Font transform - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_navigation_font_transform]', - array( - 'default' => $defaults['secondary_navigation_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'google_font_site_secondary_navigation_control', - array( - 'section' => 'secondary_font_section', - 'settings' => array( - 'family' => 'generate_secondary_nav_settings[font_secondary_navigation]', - 'variant' => 'font_secondary_navigation_variants', - 'category' => 'font_secondary_navigation_category', - 'weight' => 'generate_secondary_nav_settings[secondary_navigation_font_weight]', - 'transform' => 'generate_secondary_nav_settings[secondary_navigation_font_transform]', - ), - ) - ) - ); - - // Font size - $wp_customize->add_setting( - 'generate_secondary_nav_settings[secondary_navigation_font_size]', - array( - 'default' => $defaults['secondary_navigation_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_secondary_nav_settings[secondary_navigation_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'secondary_font_section', - 'priority' => 165, - 'settings' => array( - 'desktop' => 'generate_secondary_nav_settings[secondary_navigation_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 6, - 'max' => 30, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/slideout-nav-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/slideout-nav-fonts.php deleted file mode 100644 index a6619549..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/slideout-nav-fonts.php +++ /dev/null @@ -1,149 +0,0 @@ -register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Bail if Menu Plus isn't activated - if ( ! $wp_customize->get_section( 'menu_plus_slideout_menu' ) ) { - return; - } - - $wp_customize->add_section( - 'generate_slideout_typography', - array( - 'title' => __( 'Off Canvas Panel', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 52, - 'panel' => 'generate_typography_panel' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_off_canvas_panel_typography_shortcuts', - array( - 'section' => 'generate_slideout_typography', - 'element' => esc_html__( 'Off Canvas Panel', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'slideout_color_section', - 'layout' => 'menu_plus_slideout_menu', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 1, - ) - ) - ); - - $wp_customize->add_setting( - 'generate_settings[slideout_font_weight]', - array( - 'default' => $defaults['slideout_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage' - ) - ); - - // Text transform - $wp_customize->add_setting( - 'generate_settings[slideout_font_transform]', - array( - 'default' => $defaults['slideout_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'slideout_navigation_typography', - array( - 'label' => esc_html__( 'Menu Items', 'gp-premium' ), - 'section' => 'generate_slideout_typography', - 'settings' => array( - 'weight' => 'generate_settings[slideout_font_weight]', - 'transform' => 'generate_settings[slideout_font_transform]', - ), - ) - ) - ); - - // Font size - $wp_customize->add_setting( - 'generate_settings[slideout_font_size]', - array( - 'default' => $defaults['slideout_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_setting( - 'generate_settings[slideout_mobile_font_size]', - array( - 'default' => $defaults['slideout_mobile_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[slideout_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'generate_slideout_typography', - 'settings' => array( - 'desktop' => 'generate_settings[slideout_font_size]', - 'mobile' => 'generate_settings[slideout_mobile_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/woocommerce-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/woocommerce-fonts.php deleted file mode 100644 index b1d0b3c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/woocommerce-fonts.php +++ /dev/null @@ -1,179 +0,0 @@ -register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - // Bail if WooCommerce isn't activated - if ( ! $wp_customize->get_section( 'generate_woocommerce_typography' ) ) { - return; - } - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_woocommerce_typography_shortcuts', - array( - 'section' => 'generate_woocommerce_typography', - 'element' => __( 'WooCommerce', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_woocommerce_layout', - 'colors' => 'generate_woocommerce_colors', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 0, - ) - ) - ); - - // WooCommerce - $wp_customize->add_setting( - 'generate_settings[wc_product_title_font_weight]', - array( - 'default' => $defaults['wc_product_title_font_weight'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage' - ) - ); - - // Text transform - $wp_customize->add_setting( - 'generate_settings[wc_product_title_font_transform]', - array( - 'default' => $defaults['wc_product_title_font_transform'], - 'type' => 'option', - 'sanitize_callback' => 'sanitize_key', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Typography_Customize_Control( - $wp_customize, - 'google_wc_product_title_control', - array( - 'label' => __( 'Shop Product Titles', 'gp-premium' ), - 'section' => 'generate_woocommerce_typography', - 'settings' => array( - 'weight' => 'generate_settings[wc_product_title_font_weight]', - 'transform' => 'generate_settings[wc_product_title_font_transform]', - ), - ) - ) - ); - - // Font size - $wp_customize->add_setting( - 'generate_settings[wc_product_title_font_size]', - array( - 'default' => $defaults['wc_product_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_setting( - 'generate_settings[mobile_wc_product_title_font_size]', - array( - 'default' => $defaults['mobile_wc_product_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[wc_product_title_font_size]', - array( - 'description' => __( 'Font size', 'gp-premium' ), - 'section' => 'generate_woocommerce_typography', - 'priority' => 240, - 'settings' => array( - 'desktop' => 'generate_settings[wc_product_title_font_size]', - 'mobile' => 'generate_settings[mobile_wc_product_title_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - // Font size - $wp_customize->add_setting( - 'generate_settings[wc_related_product_title_font_size]', - array( - 'default' => $defaults['wc_related_product_title_font_size'], - 'type' => 'option', - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'generate_settings[wc_related_product_title_font_size]', - array( - 'description' => __( 'Related/upsell title font size', 'gp-premium' ), - 'section' => 'generate_woocommerce_typography', - 'priority' => 240, - 'settings' => array( - 'desktop' => 'generate_settings[wc_related_product_title_font_size]', - 'mobile' => 'generate_settings[mobile_wc_product_title_font_size]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 10, - 'max' => 80, - 'step' => 1, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/generate-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/generate-fonts.php deleted file mode 100644 index fd8a9939..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/generate-fonts.php +++ /dev/null @@ -1,20 +0,0 @@ -add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_woocommerce_colors_shortcuts', - array( - 'section' => 'generate_woocommerce_colors', - 'element' => __( 'WooCommerce', 'gp-premium' ), - 'shortcuts' => array( - 'layout' => 'generate_woocommerce_layout', - 'typography' => 'generate_woocommerce_typography', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 0, - ) - ) - ); - - $color_defaults = generate_get_color_defaults(); - - $wp_customize->add_section( - 'generate_woocommerce_colors', - array( - 'title' => __( 'Colors', 'gp-premium' ), - 'priority' => 40, - 'panel' => 'woocommerce', - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_woocommerce_button_colors_title', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Buttons', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'woocommerce-button-colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_alt_button_background', - 'generate_woocommerce_colors', - 'woocommerce-button-colors', - array( - 'generate_settings[wc_alt_button_background]' => array( - 'default_value' => $color_defaults['wc_alt_button_background'], - 'label' => __( 'Alt Button Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover', - 'property' => 'background-color', - 'hide_label' => false, - ), - 'generate_settings[wc_alt_button_background_hover]' => array( - 'default_value' => $color_defaults['wc_alt_button_background_hover'], - 'label' => __( 'Alt Button Background Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover', - 'property' => 'background-color', - 'hide_label' => true, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_alt_button_text', - 'generate_woocommerce_colors', - 'woocommerce-button-colors', - array( - 'generate_settings[wc_alt_button_text]' => array( - 'default_value' => $color_defaults['wc_alt_button_text'], - 'label' => __( 'Alt Button Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover', - 'property' => 'color', - 'hide_label' => false, - ), - 'generate_settings[wc_alt_button_text_hover]' => array( - 'default_value' => $color_defaults['wc_alt_button_text_hover'], - 'label' => __( 'Alt Button Text Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover', - 'property' => 'color', - 'hide_label' => true, - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_woocommerce_product_colors_title', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Products', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'woocommerce-product-colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_product_title', - 'generate_woocommerce_colors', - 'woocommerce-product-colors', - array( - 'generate_settings[wc_product_title_color]' => array( - 'default_value' => $color_defaults['wc_product_title_color'], - 'label' => __( 'Product Title', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '.woocommerce ul.products li.product .woocommerce-LoopProduct-link', - 'property' => 'color', - 'hide_label' => false, - ), - 'generate_settings[wc_product_title_color_hover]' => array( - 'default_value' => $color_defaults['wc_product_title_color_hover'], - 'label' => __( 'Product Title Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover', - 'property' => 'color', - 'hide_label' => true, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_rating_stars', - 'generate_woocommerce_colors', - 'woocommerce-product-colors', - array( - 'generate_settings[wc_rating_stars]' => array( - 'default_value' => $color_defaults['wc_rating_stars'], - 'label' => __( 'Star Ratings', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce .star-rating span:before, .woocommerce p.stars:hover a::before', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_sale_sticker_background', - 'generate_woocommerce_colors', - 'woocommerce-product-colors', - array( - 'generate_settings[wc_sale_sticker_background]' => array( - 'default_value' => $color_defaults['wc_sale_sticker_background'], - 'label' => __( 'Sale Sticker Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce span.onsale', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_sale_sticker_text', - 'generate_woocommerce_colors', - 'woocommerce-product-colors', - array( - 'generate_settings[wc_sale_sticker_text]' => array( - 'default_value' => $color_defaults['wc_sale_sticker_text'], - 'label' => __( 'Sale Sticker Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce span.onsale', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_price_text', - 'generate_woocommerce_colors', - 'woocommerce-product-colors', - array( - 'generate_settings[wc_price_color]' => array( - 'default_value' => $color_defaults['wc_price_color'], - 'label' => __( 'Price', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce ul.products li.product .price, .woocommerce div.product p.price', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_woocommerce_panel_cart_colors_title', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Sticky Panel Cart', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'woocommerce-panel-cart-colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_panel_cart_background', - 'generate_woocommerce_colors', - 'woocommerce-panel-cart-colors', - array( - 'generate_settings[wc_panel_cart_background_color]' => array( - 'default_value' => $color_defaults['wc_panel_cart_background_color'], - 'label' => __( 'Background Color', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.add-to-cart-panel', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_panel_cart_text', - 'generate_woocommerce_colors', - 'woocommerce-panel-cart-colors', - array( - 'generate_settings[wc_panel_cart_text_color]' => array( - 'default_value' => $color_defaults['wc_panel_cart_text_color'], - 'label' => __( 'Text Color', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.add-to-cart-panel, .add-to-cart-panel a:not(.button)', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_panel_cart_button_background', - 'generate_woocommerce_colors', - 'woocommerce-panel-cart-colors', - array( - 'generate_settings[wc_panel_cart_button_background]' => array( - 'default_value' => $color_defaults['wc_panel_cart_button_background'], - 'label' => __( 'Button Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '#wc-sticky-cart-panel .button', - 'property' => 'background-color', - 'hide_label' => false, - ), - 'generate_settings[wc_panel_cart_button_background_hover]' => array( - 'default_value' => $color_defaults['wc_panel_cart_button_background_hover'], - 'label' => __( 'Button Background Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', - 'property' => 'background-color', - 'hide_label' => true, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_panel_cart_button_text', - 'generate_woocommerce_colors', - 'woocommerce-panel-cart-colors', - array( - 'generate_settings[wc_panel_cart_button_text]' => array( - 'default_value' => $color_defaults['wc_panel_cart_button_text'], - 'label' => __( 'Button Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '#wc-sticky-cart-panel .button', - 'property' => 'color', - 'hide_label' => false, - ), - 'generate_settings[wc_panel_cart_button_text_hover]' => array( - 'default_value' => $color_defaults['wc_panel_cart_button_text_hover'], - 'label' => __( 'Button Text Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', - 'property' => 'color', - 'hide_label' => true, - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_woocommerce_mini_cart_colors_title', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Menu Mini Cart', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'woocommerce-mini-cart-colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_mini_cart_background', - 'generate_woocommerce_colors', - 'woocommerce-mini-cart-colors', - array( - 'generate_settings[wc_mini_cart_background_color]' => array( - 'default_value' => $color_defaults['wc_mini_cart_background_color'], - 'label' => __( 'Background Color', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '#wc-mini-cart', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_mini_cart_text', - 'generate_woocommerce_colors', - 'woocommerce-mini-cart-colors', - array( - 'generate_settings[wc_mini_cart_text_color]' => array( - 'default_value' => $color_defaults['wc_mini_cart_text_color'], - 'label' => __( 'Text Color', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '#wc-mini-cart', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_mini_cart_button_background', - 'generate_woocommerce_colors', - 'woocommerce-mini-cart-colors', - array( - 'generate_settings[wc_mini_cart_button_background]' => array( - 'default_value' => $color_defaults['wc_mini_cart_button_background'], - 'label' => __( 'Button Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '#wc-mini-cart .button', - 'property' => 'background-color', - 'hide_label' => false, - ), - 'generate_settings[wc_mini_cart_button_background_hover]' => array( - 'default_value' => $color_defaults['wc_mini_cart_button_background_hover'], - 'label' => __( 'Button Background Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active', - 'property' => 'background-color', - 'hide_label' => true, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_mini_cart_button_text', - 'generate_woocommerce_colors', - 'woocommerce-mini-cart-colors', - array( - 'generate_settings[wc_mini_cart_button_text]' => array( - 'default_value' => $color_defaults['wc_mini_cart_button_text'], - 'label' => __( 'Button Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), - 'element' => '#wc-mini-cart .button', - 'property' => 'color', - 'hide_label' => false, - ), - 'generate_settings[wc_mini_cart_button_text_hover]' => array( - 'default_value' => $color_defaults['wc_mini_cart_button_text_hover'], - 'label' => __( 'Button Text Hover', 'gp-premium' ), - 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), - 'element' => '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active', - 'property' => 'color', - 'hide_label' => true, - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_woocommerce_price_slider_colors_title', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Price Slider Widget', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'woocommerce-price-slider-colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_price_slider_background', - 'generate_woocommerce_colors', - 'woocommerce-price-slider-colors', - array( - 'generate_settings[wc_price_slider_background_color]' => array( - 'default_value' => $color_defaults['wc_price_slider_background_color'], - 'label' => __( 'Slider Background Color', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_price_slider_bar', - 'generate_woocommerce_colors', - 'woocommerce-price-slider-colors', - array( - 'generate_settings[wc_price_slider_bar_color]' => array( - 'default_value' => $color_defaults['wc_price_slider_bar_color'], - 'label' => __( 'Slider Bar Color', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_woocommerce_product_tabs_colors_title', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Product Tabs', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'woocommerce-product-tabs-colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_product_tab_text', - 'generate_woocommerce_colors', - 'woocommerce-product-tabs-colors', - array( - 'generate_settings[wc_product_tab]' => array( - 'default_value' => $color_defaults['wc_product_tab'], - 'label' => __( 'Product Tab Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce div.product .woocommerce-tabs ul.tabs li a', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_product_tab_text', - 'generate_woocommerce_colors', - 'woocommerce-product-tabs-colors', - array( - 'generate_settings[wc_product_tab_highlight]' => array( - 'default_value' => $color_defaults['wc_product_tab_highlight'], - 'label' => __( 'Product Tab Active', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_woocommerce_messages_colors_title', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Messages', 'gp-premium' ), - 'choices' => array( - 'toggleId' => 'woocommerce-messages-colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_success_message_background', - 'generate_woocommerce_colors', - 'woocommerce-messages-colors', - array( - 'generate_settings[wc_success_message_background]' => array( - 'default_value' => $color_defaults['wc_success_message_background'], - 'label' => __( 'Success Message Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce-message', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_success_message_text', - 'generate_woocommerce_colors', - 'woocommerce-messages-colors', - array( - 'generate_settings[wc_success_message_text]' => array( - 'default_value' => $color_defaults['wc_success_message_text'], - 'label' => __( 'Success Message Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce-message', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_info_message_background', - 'generate_woocommerce_colors', - 'woocommerce-messages-colors', - array( - 'generate_settings[wc_info_message_background]' => array( - 'default_value' => $color_defaults['wc_info_message_background'], - 'label' => __( 'Info Message Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce-info', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_info_message_text', - 'generate_woocommerce_colors', - 'woocommerce-messages-colors', - array( - 'generate_settings[wc_info_message_text]' => array( - 'default_value' => $color_defaults['wc_info_message_text'], - 'label' => __( 'Info Message Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce-info', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_error_message_background', - 'generate_woocommerce_colors', - 'woocommerce-messages-colors', - array( - 'generate_settings[wc_error_message_background]' => array( - 'default_value' => $color_defaults['wc_error_message_background'], - 'label' => __( 'Error Message Background', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce-error', - 'property' => 'background-color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_color_field_group( - 'woocommerce_error_message_text', - 'generate_woocommerce_colors', - 'woocommerce-messages-colors', - array( - 'generate_settings[wc_error_message_text]' => array( - 'default_value' => $color_defaults['wc_error_message_text'], - 'label' => __( 'Error Message Text', 'gp-premium' ), - 'tooltip' => __( 'Choose Color', 'gp-premium' ), - 'element' => '.woocommerce-error', - 'property' => 'color', - 'hide_label' => false, - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'woocommerce_colors_redirect', - array( - 'section' => 'generate_colors_section', - 'title' => __( 'WooCommerce', 'gp-premium' ), - 'choices' => array( - 'sectionRedirect' => true, - 'toggleId' => 'generate_woocommerce_colors', - ), - ) - ); - - GeneratePress_Customize_Field::add_title( - 'generate_colors_redirect', - array( - 'section' => 'generate_woocommerce_colors', - 'title' => __( 'Other Theme Colors', 'gp-premium' ), - 'choices' => array( - 'sectionRedirect' => true, - 'toggleId' => 'generate_colors_section', - ), - ) - ); -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.css deleted file mode 100644 index bb3462da..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.css +++ /dev/null @@ -1,201 +0,0 @@ -.woocommerce-product-gallery { - margin-right: 0; -} - -.woocommerce .woocommerce-ordering, -.woocommerce-page .woocommerce-ordering { - float: none; -} - -.woocommerce .woocommerce-ordering select { - max-width: 100%; -} - -.woocommerce #wc-column-container.wc-mobile-columns-1 .products, -.wc-related-upsell-mobile-columns-1 .related ul.products, -.wc-related-upsell-mobile-columns-1 .up-sells ul.products { - -ms-grid-columns: 1fr; - grid-template-columns: repeat(1, minmax(0, 1fr)); -} - -.woocommerce #wc-column-container.wc-mobile-columns-2 .products, -.wc-related-upsell-mobile-columns-2 .related ul.products, -.wc-related-upsell-mobile-columns-2 .up-sells ul.products { - -ms-grid-columns: 1fr 1fr; - grid-template-columns: repeat(2, minmax(0, 1fr)); -} - -.woocommerce #wc-column-container.wc-mobile-columns-3 .products, -.wc-related-upsell-mobile-columns-3 .related ul.products, -.wc-related-upsell-mobile-columns-3 .up-sells ul.products { - -ms-grid-columns: 1fr 1fr 1fr; - grid-template-columns: repeat(3, minmax(0, 1fr)); -} - -.woocommerce ul.products li.product a img { - width: auto; - margin-left: auto; - margin-right: auto; -} - -.woocommerce div.product .woocommerce-tabs ul.tabs, -.woocommerce div.product .woocommerce-tabs .panel { - float: none; - width: 100%; -} - -.woocommerce div.product .woocommerce-tabs .panel { - margin-top: 20px; -} - -.wc-tabs .active a:after { - transform: rotate(90deg); - padding-right: 3px; -} - -.woocommerce .col2-set, -.woocommerce-page .col2-set { - width: 100%; - float: none; - margin-right: 0; -} - -#customer_details + #wc_checkout_add_ons, -#order_review, -#order_review_heading { - width: 100%; - float: none; - margin-right: 0; -} - -.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image, -.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image { - float: none; - margin: 0; -} - -.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img, -.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img { - width: 100%; -} - -.woocommerce .related ul.products li.product, -.woocommerce-page .related ul.products li.product, -.woocommerce-page[class*=columns-] .related ul.products li.product, -.woocommerce[class*=columns-] .related ul.products li.product, -.woocommerce .up-sells ul.products li.product, -.woocommerce-page .up-sells ul.products li.product, -.woocommerce-page[class*=columns-] .up-sells ul.products li.product, -.woocommerce[class*=columns-] .up-sells ul.products li.product { - width: 100%; - margin-left: 0; - margin-right: 0; -} - -.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first, -.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last, -.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first, -.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last { - float: none; - width: 100%; -} - -.woocommerce-account .woocommerce-MyAccount-navigation { - width: 100%; -} - -.woocommerce-MyAccount-navigation li.is-active a:after { - content: "\e901"; -} - -#wc-mini-cart { - display: none; -} - -.do-quantity-buttons div.quantity { - justify-content: flex-end; -} - -.woocommerce div.product .woocommerce-tabs ul.tabs { - flex-direction: column; -} - -.woocommerce div.product .woocommerce-tabs ul.tabs li { - border-left-width: 1px; -} - -.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child { - border-bottom-color: rgba(0, 0, 0, 0.08); - border-bottom-width: 1px; -} - -.woocommerce .coupon .button { - font-size: 14px; - padding: 10px; -} - -.woocommerce .woocommerce-ordering { - margin-bottom: 0; -} - -.add-to-cart-panel { - bottom: 0; - top: auto; - transform: translateY(0px) !important; -} - -.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before { - content: "\f00d"; - font-family: 'GP Premium'; - line-height: 1em; - width: 1.28571429em; - text-align: center; - display: inline-block; - padding: 10px; -} - -#wc-sticky-cart-panel .quantity, -.add-to-cart-panel .continue-shopping-link { - display: none; -} - -.add-to-cart-panel .continue-shopping { - order: 5; - margin-left: auto; - margin-right: 0; - position: absolute; - top: -20px; - left: 10px; - height: 50px; - width: 50px; - text-align: center; - border-radius: 50%; - line-height: 50px; - cursor: pointer; -} - -.add-to-cart-panel .continue-shopping .gp-icon { - display: block; -} - -.add-to-cart-panel .product-image, -.add-to-cart-panel .cart { - flex-shrink: 0; -} - -.add-to-cart-panel .product-title { - padding-right: 20px; - margin-left: 10px; -} - -.add-to-cart-panel .cart-info { - margin-right: auto; -} - -.add-to-cart-panel .product-price { - font-size: 13px; -} - -.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart) { - pointer-events: none; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.min.css deleted file mode 100644 index 489a04fd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.min.css +++ /dev/null @@ -1 +0,0 @@ -.woocommerce-product-gallery{margin-right:0}.woocommerce .woocommerce-ordering,.woocommerce-page .woocommerce-ordering{float:none}.woocommerce .woocommerce-ordering select{max-width:100%}.wc-related-upsell-mobile-columns-1 .related ul.products,.wc-related-upsell-mobile-columns-1 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-1 .products{-ms-grid-columns:1fr;grid-template-columns:repeat(1,minmax(0,1fr))}.wc-related-upsell-mobile-columns-2 .related ul.products,.wc-related-upsell-mobile-columns-2 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-2 .products{-ms-grid-columns:1fr 1fr;grid-template-columns:repeat(2,minmax(0,1fr))}.wc-related-upsell-mobile-columns-3 .related ul.products,.wc-related-upsell-mobile-columns-3 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-3 .products{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:repeat(3,minmax(0,1fr))}.woocommerce ul.products li.product a img{width:auto;margin-left:auto;margin-right:auto}.woocommerce div.product .woocommerce-tabs .panel,.woocommerce div.product .woocommerce-tabs ul.tabs{float:none;width:100%}.woocommerce div.product .woocommerce-tabs .panel{margin-top:20px}.wc-tabs .active a:after{transform:rotate(90deg);padding-right:3px}.woocommerce .col2-set,.woocommerce-page .col2-set{width:100%;float:none;margin-right:0}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading{width:100%;float:none;margin-right:0}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:100%}.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product,.woocommerce-page .related ul.products li.product,.woocommerce-page .up-sells ul.products li.product,.woocommerce-page[class*=columns-] .related ul.products li.product,.woocommerce-page[class*=columns-] .up-sells ul.products li.product,.woocommerce[class*=columns-] .related ul.products li.product,.woocommerce[class*=columns-] .up-sells ul.products li.product{width:100%;margin-left:0;margin-right:0}.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last{float:none;width:100%}.woocommerce-account .woocommerce-MyAccount-navigation{width:100%}.woocommerce-MyAccount-navigation li.is-active a:after{content:"\e901"}#wc-mini-cart{display:none}.do-quantity-buttons div.quantity{justify-content:flex-end}.woocommerce div.product .woocommerce-tabs ul.tabs{flex-direction:column}.woocommerce div.product .woocommerce-tabs ul.tabs li{border-left-width:1px}.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child{border-bottom-color:rgba(0,0,0,.08);border-bottom-width:1px}.woocommerce .coupon .button{font-size:14px;padding:10px}.woocommerce .woocommerce-ordering{margin-bottom:0}.add-to-cart-panel{bottom:0;top:auto;transform:translateY(0)!important}.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before{content:"\f00d";font-family:'GP Premium';line-height:1em;width:1.28571429em;text-align:center;display:inline-block;padding:10px}#wc-sticky-cart-panel .quantity,.add-to-cart-panel .continue-shopping-link{display:none}.add-to-cart-panel .continue-shopping{order:5;margin-left:auto;margin-right:0;position:absolute;top:-20px;left:10px;height:50px;width:50px;text-align:center;border-radius:50%;line-height:50px;cursor:pointer}.add-to-cart-panel .continue-shopping .gp-icon{display:block}.add-to-cart-panel .cart,.add-to-cart-panel .product-image{flex-shrink:0}.add-to-cart-panel .product-title{padding-right:20px;margin-left:10px}.add-to-cart-panel .cart-info{margin-right:auto}.add-to-cart-panel .product-price{font-size:13px}.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart){pointer-events:none} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.css deleted file mode 100644 index a7eb7ad8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.css +++ /dev/null @@ -1,1284 +0,0 @@ -@supports (display: grid) { - .woocommerce ul.products li.product { - display: flex; - flex-direction: column; - } -} - -.woocommerce ul.products li.product.woocommerce-image-align-left, -.woocommerce ul.products li.product.woocommerce-image-align-right { - display: block; -} - -.woocommerce ul.products li.product .woocommerce-LoopProduct-link { - display: block; - margin-bottom: auto; -} - -.woocommerce ul.products li.product .button { - margin-left: auto; - margin-right: auto; -} - -.woocommerce ul.products li.product.woocommerce-text-align-left .button { - margin-left: 0; -} - -.woocommerce ul.products li.product.woocommerce-text-align-right .button { - margin-right: 0; -} - -.woocommerce ul.products li.product .woocommerce-LoopProduct-link > *:not(:first-child) { - margin-top: 10px; - margin-bottom: 0; -} - -.woocommerce ul.products li.product .woocommerce-LoopProduct-link > .secondary-image + img { - margin-top: 0; -} - -.woocommerce ul.products li.product .onsale, -.woocommerce span.onsale { - position: relative; - border-radius: 0; - min-height: 15px; - min-width: initial; - font-weight: inherit; - font-size: inherit; - padding: 8px 13px; - line-height: 1; - display: inline-block; - top: auto; - left: auto; - font-size: 80%; - text-transform: uppercase; - font-weight: bold; -} - -.woocommerce ul.products li.product.sales-flash-overlay .onsale { - position: absolute; - top: 0; - right: 0; - margin: 0; -} - -.single-product span.onsale { - margin-bottom: 15px; -} - -.woocommerce-product-gallery { - margin-right: 4%; -} - -.rtl .woocommerce-product-gallery { - margin-right: 0; - margin-left: 4%; -} - -.woocommerce div.product div.images .flex-control-thumbs li { - max-width: 100px; - padding-top: 5px; - padding-right: 5px; - box-sizing: border-box; -} - -.woocommerce ul.products li.product .woocommerce-loop-product__title { - padding: 0; -} - -.woocommerce .page-header-image-single { - display: none; -} - -.woocommerce .entry-content, -.woocommerce .product .entry-summary { - margin-top: 0; -} - -.related.products { - clear: both; -} - -.checkout-subscribe-prompt.clear { - visibility: visible; - height: initial; - width: initial; -} - -.woocommerce .add_to_cart_button + .added_to_cart { - display: none; -} - -.woocommerce-result-count { - font-size: 14px; - padding: 10px 0; - border: 1px solid transparent; -} - -.woocommerce-ordering select { - font-size: 14px; - font-weight: 500; - padding: 10px 40px 10px 12px; - -webkit-appearance: none; - -moz-appearance: none; - width: 100%; - background: transparent; - border-color: rgba(0, 0, 0, 0.1); - color: inherit; - cursor: pointer; -} - -.woocommerce-ordering select::-ms-expand { - display: none; -} - -.woocommerce-ordering:after { - content: "\e903"; - font-family: "GP Premium"; - display: inline-block; - position: absolute; - pointer-events: none; - color: inherit; - top: 10px; - right: 15px; - font-size: 16px; -} - -.woocommerce-ordering select option { - color: initial; -} - -.woocommerce .woocommerce-ordering, -.woocommerce .woocommerce-result-count { - margin-bottom: 30px; -} - -.woocommerce-variation-add-to-cart { - display: flex; - flex-wrap: wrap; -} - -/* Columns */ -@supports (display: grid) { - #wc-column-container .product { - float: none; - width: auto; - margin: 0; - } - .woocommerce .wc-columns-container .products::after, - .woocommerce .wc-columns-container .products::before, - .woocommerce .related ul.products::after, - .woocommerce .related ul.products::before, - .woocommerce .up-sells ul.products::after, - .woocommerce .up-sells ul.products::before { - display: none; - } - .wc-columns-container .products, - .woocommerce .related ul.products, - .woocommerce .up-sells ul.products { - display: -ms-grid; - display: grid; - grid-gap: 50px; - width: 100%; - } - .wc-columns-container.wc-columns-6 .products, - .wc-related-upsell-columns-6 .related ul.products, - .wc-related-upsell-columns-6 .up-sells ul.products { - grid-template-columns: repeat(6, minmax(0, 1fr)); - } - .wc-columns-container.wc-columns-5 .products, - .wc-related-upsell-columns-5 .related ul.products, - .wc-related-upsell-columns-5 .up-sells ul.products { - grid-template-columns: repeat(5, minmax(0, 1fr)); - } - .woocommerce .wc-columns-container.wc-columns-4 .products, - .wc-related-upsell-columns-4 .related ul.products, - .wc-related-upsell-columns-4 .up-sells ul.products { - grid-template-columns: repeat(4, minmax(0, 1fr)); - } - .woocommerce .wc-columns-container.wc-columns-3 .products, - .wc-related-upsell-columns-3 .related ul.products, - .wc-related-upsell-columns-3 .up-sells ul.products { - grid-template-columns: repeat(3, minmax(0, 1fr)); - } - .woocommerce .wc-columns-container.wc-columns-2 .products, - .wc-related-upsell-columns-2 .related ul.products, - .wc-related-upsell-columns-2 .up-sells ul.products { - grid-template-columns: repeat(2, minmax(0, 1fr)); - } - .woocommerce .wc-columns-container.wc-columns-1 .products, - .wc-related-upsell-columns-1 .related ul.products, - .wc-related-upsell-columns-1 .up-sells ul.products { - width: 100%; - } - .woocommerce .wc-columns-1 ul.products li.product, - .woocommerce-page .wc-columns-1 ul.products li.product { - margin-left: 0; - margin-right: 0; - } -} - -/* Mini Cart */ -#wc-mini-cart ul.woocommerce-mini-cart { - position: relative; - left: auto; - right: auto; - opacity: 1; - pointer-events: auto; - height: auto; - width: auto; - float: none; - background-color: transparent; - box-shadow: 0 0 0; - visibility: visible; -} - -.wc-mini-cart { - position: absolute; - width: 300px; - right: 0; - box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1); - z-index: 99999; - left: -99999px; - opacity: 0; - height: 0; - overflow: hidden; - pointer-events: none; - transition: opacity 80ms linear; - transition-delay: 0s; - visibility: hidden; -} - -.wc-menu-item:hover .wc-mini-cart, -.wc-menu-item.sfHover .wc-mini-cart { - left: auto; - opacity: 1; - transition-delay: 150ms; - pointer-events: auto; - height: auto; - overflow: visible; - visibility: visible; -} - -.dropdown-click ul li.wc-menu-item:hover ul { - display: block; -} - -.sidebar .wc-mini-cart { - right: 100%; - top: 0; -} - -.sidebar .wc-mini-cart .widget { - background: none; -} - -body:not(.using-mouse) .wc-menu-item.sfHover .wc-mini-cart { - display: none; -} - -.wc-menu-item .sub-menu { - left: auto; - right: 0; - width: 300px; -} - -.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li:hover a, -.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li.sfHover a { - background: none; -} - -.wc-menu-item .wc-mini-cart .widget_shopping_cart { - padding: 15px; -} - -.woocommerce.widget_shopping_cart .cart_list li { - padding: 0 0 0 4em; - margin: 0; - box-sizing: border-box; - min-height: 3em; -} - -.woocommerce.widget_shopping_cart { - font-size: 14px; -} - -.widget_shopping_cart .woocommerce-mini-cart__buttons { - margin-bottom: 0; - display: flex; -} - -.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a { - margin: 0; - width: calc(50% - 10px); - text-align: center; - padding: 10px 15px; - line-height: inherit; - font-size: 14px; -} - -.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:first-child { - margin-right: 2px; -} - -.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:last-child { - margin-left: 2px; -} - -.woocommerce.widget_shopping_cart .cart_list li a.remove { - right: 0; - left: auto; - height: 20px; - width: 20px; - border-width: 1px; - border-style: solid; - border-radius: 50%; - padding: 0; - font-size: 16px; - line-height: 17px; - font-weight: normal; - position: relative; - float: right; -} - -.woocommerce ul.cart_list li img { - position: absolute; - left: 0; - width: 3em; - height: auto; - top: 0; - margin-left: 0; -} - -#wc-mini-cart .woocommerce-mini-cart-item a { - padding: 0; -} - -.woocommerce-mini-cart-item .quantity { - font-size: 12px; - display: block; -} - -.woocommerce.widget_shopping_cart .total { - margin: 15px 0; - padding: 15px; - background: rgba(0, 0, 0, 0.05); - border: 0; - font-size: 14px; -} - -#wc-mini-cart .total { - padding: 15px; - margin: 15px -15px 15px; - text-align: left; -} - -#generate-slideout-menu .total { - padding: 10px 20px; - margin: 20px -20px 20px; -} - -#generate-slideout-menu.do-overlay .total { - margin: 20px 0; -} - -.woocommerce.widget_shopping_cart a.button.wc-forward:after { - display: none; -} - -.woocommerce.widget_shopping_cart .cart_list li.woocommerce-mini-cart-item:not(:last-child) { - margin-bottom: 15px; -} - -.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li { - padding: 0 4em 0 0; -} - -.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li a.remove { - float: left; -} - -.rtl .wc-mini-cart .woocommerce ul.cart_list li img { - right: 0; -} - -.slideout-widget .widget_shopping_cart_content, -.slideout-widget .widget_shopping_cart_content a { - font-size: 14px; -} - -#generate-slideout-menu.do-overlay li.woocommerce-mini-cart-item { - text-align: left; -} - -#wc-mini-cart a:not(.button) { - font-family: inherit; -} - -.wc-menu-item:not(.has-items) .wc-mini-cart { - display: none; -} - -.woocommerce-mini-cart__empty-message { - margin-bottom: 0; -} - -.secondary-nav-aligned-right .secondary-navigation ul.woocommerce-mini-cart, -.secondary-nav-aligned-center .secondary-navigation ul.woocommerce-mini-cart { - font-size: inherit; -} - -#wc-mini-cart .widgettitle { - display: none; -} - -/* Related/Upsell products */ -@supports (display: grid) { - .woocommerce .related ul.products li.product, - .woocommerce .up-sells ul.products li.product { - width: auto; - margin-left: 0; - margin-right: 0; - margin-bottom: 0; - } -} - -.woocommerce #respond input#submit, -.woocommerce a.button, -.woocommerce button.button, -.woocommerce input.button { - border-radius: 0px; - font-weight: inherit; - font-size: inherit; - line-height: inherit; - padding: 10px 20px; -} - -ul.products .woocommerce-text-align-center { - text-align: center; -} - -ul.products li.product.woocommerce-text-align-center .price, -ul.products li.product.woocommerce-text-align-center .star-rating { - margin-left: auto; - margin-right: auto; -} - -ul.products li.product.woocommerce-text-align-right .price, -ul.products li.product.woocommerce-text-align-right .star-rating { - margin-left: auto; -} - -.woocommerce .star-rating:before { - color: rgba(0, 0, 0, 0.4); -} - -.woocommerce p.stars a { - color: rgba(0, 0, 0, 0.4); -} - -.woocommerce p.stars.selected a:before { - color: #ffa200; -} - -.woocommerce ul.products li.product .price del { - display: inline; - padding-right: 10px; -} - -ul.products .woocommerce-text-align-right { - text-align: right; -} - -/*-------------------------------------------------------------- -# Single Product ---------------------------------------------------------------*/ -.woocommerce #content div.product div.images, -.woocommerce div.product div.images, -.woocommerce-page #content div.product div.images, -.woocommerce-page div.product div.images { - width: 50%; -} - -.woocommerce #content div.product div.summary, -.woocommerce div.product div.summary, -.woocommerce-page #content div.product div.summary, -.woocommerce-page div.product div.summary { - width: auto; - float: none; - overflow: hidden; -} - -.product_meta { - font-size: 80%; - border-top: 1px solid rgba(0, 0, 0, 0.1); - padding-top: 30px; -} - -.product_meta > span { - display: block; -} - -.up-sells { - margin-top: 40px; -} - -.woocommerce div.product.do-quantity-buttons form.cart, -.add-to-cart-panel form.cart { - display: flex; - flex-wrap: wrap; -} - -.woocommerce div.product form.cart > *:not(.quantity):not(.single_add_to_cart_button) { - width: 100%; -} - -.add-to-cart-panel form.cart { - flex-shrink: 0; -} - -.woocommerce .quantity .qty { - height: 100%; - width: auto; - max-width: 80px; - background: transparent; - border: 1px solid rgba(0, 0, 0, 0.1); - padding: 0 10px; - height: 50px; -} - -.do-quantity-buttons .quantity:not(.buttons-added) .qty { - width: 50px; -} - -.do-quantity-buttons div.quantity, -.add-to-cart-panel .cart.do-quantity-buttons div.quantity { - display: flex; - align-items: center; -} - -.woocommerce form .quantity.buttons-added .qty, -.woocommerce form .quantity.buttons-added .minus, -.woocommerce form .quantity.buttons-added .plus, -.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before, -.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after { - display: block; - width: 50px; - height: 100%; - min-height: 50px; - background-color: transparent; - border: 1px solid rgba(0, 0, 0, 0.1); - margin: 0; - padding: 0; - text-align: center; - vertical-align: middle; - -moz-appearance: textfield !important; - -webkit-appearance: none; - border-radius: 0; - color: inherit; - box-sizing: border-box; - text-decoration: none; -} - -.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before, -.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after, -.woocommerce form .quantity.buttons-added .minus, -.woocommerce form .quantity.buttons-added .plus { - display: flex; - align-items: center; - justify-content: center; -} - -.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before { - content: "-"; - border-right: 0; -} - -.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after { - content: "+"; - border-left: 0; -} - -.woocommerce form .quantity.buttons-added .qty:focus { - border-color: rgba(0, 0, 0, 0.1); -} - -.do-quantity-buttons form .quantity input[type=number]::-webkit-inner-spin-button, -.do-quantity-buttons form .quantity input[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} - -.woocommerce form .quantity.buttons-added .minus, -.do-quantity-buttons form .quantity:not(.buttons-added):before { - border-right-width: 0; -} - -.woocommerce form .quantity.buttons-added .plus, -.do-quantity-buttons form .quantity:not(.buttons-added):after { - border-left-width: 0; -} - -.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):before, -.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):after, -.do-quantity-buttons form .quantity.hidden { - display: none; -} - -.woocommerce div.product form.cart div.quantity.hidden { - margin: 0; -} - -/*-------------------------------------------------------------- -## Tabs ---------------------------------------------------------------*/ -.woocommerce div.product .woocommerce-tabs ul.tabs li::after, -.woocommerce div.product .woocommerce-tabs ul.tabs li::before, -.woocommerce div.product .woocommerce-tabs ul.tabs::before { - display: none; - border: 0; -} - -.woocommerce div.product .woocommerce-tabs ul.tabs { - display: flex; - margin-left: 0; - padding-left: 0; -} - -.woocommerce div.product .woocommerce-tabs ul.tabs li { - background-color: rgba(0, 0, 0, 0.02); - margin: 0; - border-radius: 0; - border-width: 1px 1px 0 0; - border-color: rgba(0, 0, 0, 0.08); -} - -.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child { - border-left-width: 1px; -} - -.woocommerce-ordering { - float: left; - margin-right: 1em; - margin-bottom: 0; - position: relative; - padding: 0; -} - -/*-------------------------------------------------------------- -# Menu Item ---------------------------------------------------------------*/ -nav li.wc-menu-item { - float: right; -} - -.cart-contents > span { - line-height: 0; -} - -.cart-contents > span:not(:empty) { - margin-left: 10px; -} - -.rtl .cart-contents > span:not(:empty) { - margin-left: 0; - margin-right: 10px; -} - -.cart-contents > span.gp-icon { - margin-left: 0; -} - -.rtl .cart-contents > span.gp-icon { - margin-right: 0; -} - -nav span.count { - font-size: 0.8em; - opacity: 0.5; -} - -/*-------------------------------------------------------------- -# Cart ---------------------------------------------------------------*/ -.woocommerce a.remove { - color: inherit !important; - background: transparent !important; - border: 1px solid !important; - border-color: inherit; - font-weight: normal; - font-size: 16px; - width: 20px; - height: 20px; - line-height: 17px; - font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important; -} - -.woocommerce a.remove:hover { - color: inherit !important; - background: transparent !important; - opacity: 0.7; -} - -.woocommerce .star-rating:before { - opacity: 0.25; - content: "SSSSS"; -} - -.woocommerce div.product .woocommerce-product-rating { - margin: 1em 0; -} - -.woocommerce div.product p.price, -.woocommerce div.product span.price { - color: inherit; -} - -.wc-has-gallery .secondary-image { - position: absolute; - opacity: 0; - transition: opacity 100ms ease-in-out; - left: 50%; - transform: translate(-50%, 0px); - top: 0; -} - -.wc-has-gallery picture.secondary-image { - width: 100%; - height: 100%; -} - -.wc-product-image:hover .secondary-image { - opacity: 1; -} - -.woocommerce ul.products li.product a img { - margin-bottom: 0; -} - -.woocommerce div.product .woocommerce-tabs ul.tabs li a, -.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { - color: initial; -} - -.woocommerce ul.products li.product .price, .woocommerce div.product p.price { - font-weight: bold; -} - -div.woocommerce-message a.button, -div.woocommerce-message a.button:hover, -div.woocommerce-message a.button:focus, -div.woocommerce-info a.button, -div.woocommerce-info a.button:hover, -div.woocommerce-info a.button:focus, -div.woocommerce-error a.button, -div.woocommerce-error a.button:hover, -div.woocommerce-error a.button:focus { - background: transparent; - padding: 0; -} - -.woocommerce-error a, -.woocommerce-info a, -.woocommerce-message a { - font-weight: bold; -} - -.woocommerce-error, -.woocommerce-info, -.woocommerce-message { - padding: 20px 30px; - border: 0; - border-left: 10px solid rgba(0, 0, 0, 0.3); -} - -.woocommerce-message::before, -.woocommerce-info::before, -.woocommerce-error::before { - display: none; -} - -a.button.wc-forward:after { - content: "\e901"; - font-family: "GP Premium"; - line-height: 1em; - padding-left: 10px; - position: relative; - top: 2px; -} - -.rtl a.button.wc-forward:after { - display: none; -} - -.woocommerce-checkout .col2-set .col-2, -.woocommerce-checkout .col2-set .col-1 { - float: none; - width: 100%; - margin: 0; -} - -.woocommerce-checkout .col2-set { - width: 52.9411764706%; - float: left; - margin-right: 5.8823529412%; -} - -.rtl.woocommerce-checkout .col2-set { - float: right; - margin-right: 0; - margin-left: 5.8823529412%; -} - -#customer_details + #wc_checkout_add_ons, -#order_review, -#order_review_heading { - width: 41.1764705882%; - float: right; - margin-right: 0; -} - -.woocommerce-additional-fields > h3 { - margin-top: 20px; -} - -.woocommerce table.shop_table, -.woocommerce table.shop_table tfoot th, -.woocommerce table.shop_table tfoot td { - border: 0; - border-radius: 0; -} - -.woocommerce table.shop_table th { - background-color: rgba(0, 0, 0, 0.03); -} - -.woocommerce table.shop_table th, -.woocommerce table.shop_table td { - padding: 20px; - border: 0; -} - -.woocommerce table.shop_table td { - background-color: rgba(0, 0, 0, 0.005); - border-bottom: 1px solid rgba(0, 0, 0, 0.1); -} - -#add_payment_method .cart-collaterals .cart_totals tr td, -#add_payment_method .cart-collaterals .cart_totals tr th, -.woocommerce-cart .cart-collaterals .cart_totals tr td, -.woocommerce-cart .cart-collaterals .cart_totals tr th, -.woocommerce-checkout .cart-collaterals .cart_totals tr td, -.woocommerce-checkout .cart-collaterals .cart_totals tr th { - border-top: 0; -} - -#add_payment_method #payment, -.woocommerce-cart #payment, -.woocommerce-checkout #payment, -#add_payment_method #payment div.payment_box, -.woocommerce-cart #payment div.payment_box, -.woocommerce-checkout #payment div.payment_box { - background-color: transparent; - color: inherit; -} - -#add_payment_method #payment div.payment_box:before, -.woocommerce-cart #payment div.payment_box:before, -.woocommerce-checkout #payment div.payment_box:before { - display: none; -} - -#payment .payment_methods > .wc_payment_method > label { - padding: 20px; - background-color: rgba(0, 0, 0, 0.04); - display: block; - cursor: pointer; -} - -#payment .payment_methods li.wc_payment_method > input[type=radio]:first-child:checked + label { - font-weight: bold; - background-color: rgba(0, 0, 0, 0.07); -} - -#payment .payment_methods li.wc_payment_method > input[type=radio]:first-child { - clip: rect(1px, 1px, 1px, 1px); - position: absolute !important; -} - -#payment .payment_methods > .wc_payment_method > label:before { - display: inline-block; - font-size: inherit; - -webkit-font-smoothing: antialiased; - content: "\e902"; - margin-right: .5407911001em; - transition: color,ease,.2s; - font-family: "GP Premium"; -} - -#payment .payment_methods li.wc_payment_method > input[type=radio]:first-child:checked + label:before { - content: "\e904"; -} - -#add_payment_method #payment ul.payment_methods, -.woocommerce-cart #payment ul.payment_methods, -.woocommerce-checkout #payment ul.payment_methods { - padding: 0; - border: 0; -} - -.woocommerce #payment #place_order, -.woocommerce-page #payment #place_order { - float: none; - width: 100%; - padding-top: 20px; - padding-bottom: 20px; - font-weight: bold; - font-size: 150%; -} - -#add_payment_method #payment div.form-row, -.woocommerce-cart #payment div.form-row, -.woocommerce-checkout #payment div.form-row { - padding-left: 0; - padding-right: 0; - padding-top: 0; -} - -#add_payment_method #payment ul.payment_methods li img, -.woocommerce-cart #payment ul.payment_methods li img, -.woocommerce-checkout #payment ul.payment_methods li img { - float: right; -} - -#add_payment_method #payment .payment_method_paypal .about_paypal, -.woocommerce-cart #payment .payment_method_paypal .about_paypal, -.woocommerce-checkout #payment .payment_method_paypal .about_paypal { - float: none; - display: inline-block; - line-height: 1; -} - -a.checkout-button:after { - display: none; -} - -.woocommerce #content table.cart td.actions .input-text, -.woocommerce table.cart td.actions .input-text, -.woocommerce-page #content table.cart td.actions .input-text, -.woocommerce-page table.cart td.actions .input-text { - width: 150px; - padding: 10px 15px; -} - -.woocommerce .coupon .button { - border: 1px solid transparent; -} - -.woocommerce ul.products li.product .woocommerce-product-details__short-description p:last-child { - margin-bottom: 0; -} - -.wc-product-image { - text-align: center; -} - -.woocommerce-text-align-left .wc-product-image { - text-align: left; -} - -.woocommerce-text-align-right .wc-product-image { - text-align: right; -} - -.inside-wc-product-image { - position: relative; - display: inline-block; -} - -.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image { - float: left; - margin-right: 2em; -} - -.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image { - float: right; - margin-left: 2em; -} - -.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img, -.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img { - width: auto; -} - -.woocommerce-cart ul.products li.product.woocommerce-image-align-left .wc-product-image, -.woocommerce-cart ul.products li.product.woocommerce-image-align-right .wc-product-image { - float: none; - margin: 0; -} - -.woocommerce-cart ul.products li.product.woocommerce-image-align-left a .wc-product-image img, -.woocommerce-cart ul.products li.product.woocommerce-image-align-right a .wc-product-image img { - width: 100%; -} - -.woocommerce .widget_price_filter .price_slider_amount .button { - font-size: 1em; - line-height: normal; -} - -.woocommerce .related ul.products li.product a img, -.woocommerce .up-sells ul.products li.product a img { - margin-bottom: 0; -} - -.woocommerce-review-link { - font-size: 80%; -} - -.woocommerce-Reviews .comment-reply-title { - font-size: 120%; - font-weight: bold; - display: block; - margin-bottom: 10px; -} - -.woocommerce-MyAccount-navigation ul { - margin: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -.site-main .woocommerce-MyAccount-navigation li { - margin: 0; - padding: 0; -} - -.woocommerce-MyAccount-navigation li a { - display: block; - padding: 20px 0; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - font-size: 85%; -} - -.woocommerce-MyAccount-navigation li.is-active a { - font-weight: bold; -} - -.woocommerce-MyAccount-navigation li a:hover { - border-bottom: 1px solid rgba(0, 0, 0, 0.2); -} - -.woocommerce-MyAccount-navigation li.is-active a:after { - font-family: "GP Premium"; - content: "\e901"; - float: right; - font-weight: bold; - font-size: 115%; -} - -.woocommerce-account .woocommerce-MyAccount-navigation { - width: 25%; -} - -.woocommerce #payment .terms { - padding: 20px; -} - -h2.woocommerce-loop-category__title mark { - background: none; - font-size: 80%; - opacity: 0.5; -} - -.woocommerce form.checkout_coupon, -.woocommerce form.login, -.woocommerce form.register { - padding: 0; - margin: 0 0 1.5em; - border: 0; -} - -#ship-to-different-address { - padding: 3px; - font-size: inherit; -} - -.woocommerce-image-align-left .products ul, -.woocommerce-image-align-left ul.products, -.woocommerce-image-align-left .products ul:after, -.woocommerce-image-align-left ul.products:after, -.woocommerce-image-align-right .products ul, -.woocommerce-image-align-right ul.products, -.woocommerce-image-align-right .products ul:after, -.woocommerce-image-align-right ul.products:after { - clear: none; -} - -.woocommerce nav.woocommerce-pagination { - margin-top: 60px; - clear: both; -} - -.woocommerce input.button:disabled, -.woocommerce input.button:disabled[disabled], -.woocommerce input.button:disabled:hover, -.woocommerce input.button:disabled[disabled]:hover { - background-color: transparent; - color: initial; - opacity: 0.3; -} - -.entry-summary + .up-sells { - clear: both; -} - -.woocommerce form .form-row input.input-text, -.woocommerce form .form-row textarea { - line-height: 1.5; -} - -.main-navigation a.cart-contents:not(.has-svg-icon):before, -.secondary-navigation a.cart-contents:not(.has-svg-icon):before { - content: "\f07a"; - display: inline-block; - font-family: "GP Premium"; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.main-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before, -.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before { - content: "\f290"; -} - -.main-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before, -.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before { - content: "\f291"; -} - -.cart-contents > span.number-of-items { - font-size: 11px; - display: inline-block; - background: rgba(255, 255, 255, 0.1); - line-height: 1.7em; - height: 1.7em; - width: 1.7em; - text-align: center; - border-radius: 50%; - margin-left: 5px; - position: relative; - top: -5px; - display: none; -} - -.cart-contents > span.number-of-items.no-items { - display: none; -} - -.woocommerce-MyAccount-navigation ul { - list-style-type: none; -} - -/* Fix BlockUI */ -form.checkout:after, -form.checkout:before { - content: ''; - display: table; -} - -form.checkout:after { - clear: both; -} - -/* Add to Cart panel */ -.add-to-cart-panel { - position: fixed; - top: 0; - left: 0; - right: 0; - background: #fff; - padding: 20px; - opacity: 0; - transition: opacity 500ms ease-in-out, transform 500ms ease-in-out; - box-shadow: 0 2px 2px -2px rgba(0, 0, 0, 0.2); - z-index: 101; - font-size: 90%; - box-sizing: border-box; - transform: translateY(-100%); -} - -.add-to-cart-panel.item-added, -.add-to-cart-panel.show-sticky-add-to-cart { - opacity: 1; -} - -.add-to-cart-panel > div { - display: flex; - align-items: center; -} - -.add-to-cart-panel .continue-shopping { - margin-right: auto; -} - -.add-to-cart-panel .continue-shopping .gp-icon { - display: none; -} - -.add-to-cart-panel .cart-info { - margin-right: 20px; -} - -.add-to-cart-panel img { - height: 50px; - width: auto; - vertical-align: middle; -} - -.add-to-cart-panel .product-title { - margin-left: 20px; - margin-right: auto; - font-weight: 600; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.add-to-cart-panel .product-price { - margin-right: 20px; -} - -.add-to-cart-panel div.quantity { - margin-right: 4px; -} - -.add-to-cart-panel .cart-data { - font-size: 12px; -} - -.add-to-cart-panel del { - opacity: 0.4; -} - -.do-quantity-buttons input.qty::-webkit-outer-spin-button, -.do-quantity-buttons input.qty::-webkit-inner-spin-button { - -webkit-appearance: none; -} - -.wc-menu-cart-activated .menu-toggle { - text-align: left; -} - -.woocommerce-order-received .woocommerce-customer-details .col2-set { - float: none; - width: auto; -} - -.woocommerce-order-received .woocommerce-customer-details .col2-set .col-1 { - margin-bottom: 1.5em; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css deleted file mode 100644 index 4533dae1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css +++ /dev/null @@ -1 +0,0 @@ -@supports (display:grid){.woocommerce ul.products li.product{display:flex;flex-direction:column}}.woocommerce ul.products li.product.woocommerce-image-align-left,.woocommerce ul.products li.product.woocommerce-image-align-right{display:block}.woocommerce ul.products li.product .woocommerce-LoopProduct-link{display:block;margin-bottom:auto}.woocommerce ul.products li.product .button{margin-left:auto;margin-right:auto}.woocommerce ul.products li.product.woocommerce-text-align-left .button{margin-left:0}.woocommerce ul.products li.product.woocommerce-text-align-right .button{margin-right:0}.woocommerce ul.products li.product .woocommerce-LoopProduct-link>:not(:first-child){margin-top:10px;margin-bottom:0}.woocommerce ul.products li.product .woocommerce-LoopProduct-link>.secondary-image+img{margin-top:0}.woocommerce span.onsale,.woocommerce ul.products li.product .onsale{position:relative;border-radius:0;min-height:15px;min-width:initial;font-weight:inherit;font-size:inherit;padding:8px 13px;line-height:1;display:inline-block;top:auto;left:auto;font-size:80%;text-transform:uppercase;font-weight:700}.woocommerce ul.products li.product.sales-flash-overlay .onsale{position:absolute;top:0;right:0;margin:0}.single-product span.onsale{margin-bottom:15px}.woocommerce-product-gallery{margin-right:4%}.rtl .woocommerce-product-gallery{margin-right:0;margin-left:4%}.woocommerce div.product div.images .flex-control-thumbs li{max-width:100px;padding-top:5px;padding-right:5px;box-sizing:border-box}.woocommerce ul.products li.product .woocommerce-loop-product__title{padding:0}.woocommerce .page-header-image-single{display:none}.woocommerce .entry-content,.woocommerce .product .entry-summary{margin-top:0}.related.products{clear:both}.checkout-subscribe-prompt.clear{visibility:visible;height:initial;width:initial}.woocommerce .add_to_cart_button+.added_to_cart{display:none}.woocommerce-result-count{font-size:14px;padding:10px 0;border:1px solid transparent}.woocommerce-ordering select{font-size:14px;font-weight:500;padding:10px 40px 10px 12px;-webkit-appearance:none;-moz-appearance:none;width:100%;background:0 0;border-color:rgba(0,0,0,.1);color:inherit;cursor:pointer}.woocommerce-ordering select::-ms-expand{display:none}.woocommerce-ordering:after{content:"\e903";font-family:"GP Premium";display:inline-block;position:absolute;pointer-events:none;color:inherit;top:10px;right:15px;font-size:16px}.woocommerce-ordering select option{color:initial}.woocommerce .woocommerce-ordering,.woocommerce .woocommerce-result-count{margin-bottom:30px}.woocommerce-variation-add-to-cart{display:flex;flex-wrap:wrap}@supports (display:grid){#wc-column-container .product{float:none;width:auto;margin:0}.woocommerce .related ul.products::after,.woocommerce .related ul.products::before,.woocommerce .up-sells ul.products::after,.woocommerce .up-sells ul.products::before,.woocommerce .wc-columns-container .products::after,.woocommerce .wc-columns-container .products::before{display:none}.wc-columns-container .products,.woocommerce .related ul.products,.woocommerce .up-sells ul.products{display:-ms-grid;display:grid;grid-gap:50px;width:100%}.wc-columns-container.wc-columns-6 .products,.wc-related-upsell-columns-6 .related ul.products,.wc-related-upsell-columns-6 .up-sells ul.products{grid-template-columns:repeat(6,minmax(0,1fr))}.wc-columns-container.wc-columns-5 .products,.wc-related-upsell-columns-5 .related ul.products,.wc-related-upsell-columns-5 .up-sells ul.products{grid-template-columns:repeat(5,minmax(0,1fr))}.wc-related-upsell-columns-4 .related ul.products,.wc-related-upsell-columns-4 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-4 .products{grid-template-columns:repeat(4,minmax(0,1fr))}.wc-related-upsell-columns-3 .related ul.products,.wc-related-upsell-columns-3 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-3 .products{grid-template-columns:repeat(3,minmax(0,1fr))}.wc-related-upsell-columns-2 .related ul.products,.wc-related-upsell-columns-2 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-2 .products{grid-template-columns:repeat(2,minmax(0,1fr))}.wc-related-upsell-columns-1 .related ul.products,.wc-related-upsell-columns-1 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-1 .products{width:100%}.woocommerce .wc-columns-1 ul.products li.product,.woocommerce-page .wc-columns-1 ul.products li.product{margin-left:0;margin-right:0}}#wc-mini-cart ul.woocommerce-mini-cart{position:relative;left:auto;right:auto;opacity:1;pointer-events:auto;height:auto;width:auto;float:none;background-color:transparent;box-shadow:0 0 0;visibility:visible}.wc-mini-cart{position:absolute;width:300px;right:0;box-shadow:0 2px 2px rgba(0,0,0,.1);z-index:99999;left:-99999px;opacity:0;height:0;overflow:hidden;pointer-events:none;transition:opacity 80ms linear;transition-delay:0s;visibility:hidden}.wc-menu-item.sfHover .wc-mini-cart,.wc-menu-item:hover .wc-mini-cart{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible;visibility:visible}.dropdown-click ul li.wc-menu-item:hover ul{display:block}.sidebar .wc-mini-cart{right:100%;top:0}.sidebar .wc-mini-cart .widget{background:0 0}body:not(.using-mouse) .wc-menu-item.sfHover .wc-mini-cart{display:none}.wc-menu-item .sub-menu{left:auto;right:0;width:300px}.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li.sfHover a,.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li:hover a{background:0 0}.wc-menu-item .wc-mini-cart .widget_shopping_cart{padding:15px}.woocommerce.widget_shopping_cart .cart_list li{padding:0 0 0 4em;margin:0;box-sizing:border-box;min-height:3em}.woocommerce.widget_shopping_cart{font-size:14px}.widget_shopping_cart .woocommerce-mini-cart__buttons{margin-bottom:0;display:flex}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a{margin:0;width:calc(50% - 10px);text-align:center;padding:10px 15px;line-height:inherit;font-size:14px}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:first-child{margin-right:2px}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:last-child{margin-left:2px}.woocommerce.widget_shopping_cart .cart_list li a.remove{right:0;left:auto;height:20px;width:20px;border-width:1px;border-style:solid;border-radius:50%;padding:0;font-size:16px;line-height:17px;font-weight:400;position:relative;float:right}.woocommerce ul.cart_list li img{position:absolute;left:0;width:3em;height:auto;top:0;margin-left:0}#wc-mini-cart .woocommerce-mini-cart-item a{padding:0}.woocommerce-mini-cart-item .quantity{font-size:12px;display:block}.woocommerce.widget_shopping_cart .total{margin:15px 0;padding:15px;background:rgba(0,0,0,.05);border:0;font-size:14px}#wc-mini-cart .total{padding:15px;margin:15px -15px 15px;text-align:left}#generate-slideout-menu .total{padding:10px 20px;margin:20px -20px 20px}#generate-slideout-menu.do-overlay .total{margin:20px 0}.woocommerce.widget_shopping_cart a.button.wc-forward:after{display:none}.woocommerce.widget_shopping_cart .cart_list li.woocommerce-mini-cart-item:not(:last-child){margin-bottom:15px}.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li{padding:0 4em 0 0}.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li a.remove{float:left}.rtl .wc-mini-cart .woocommerce ul.cart_list li img{right:0}.slideout-widget .widget_shopping_cart_content,.slideout-widget .widget_shopping_cart_content a{font-size:14px}#generate-slideout-menu.do-overlay li.woocommerce-mini-cart-item{text-align:left}#wc-mini-cart a:not(.button){font-family:inherit}.wc-menu-item:not(.has-items) .wc-mini-cart{display:none}.woocommerce-mini-cart__empty-message{margin-bottom:0}.secondary-nav-aligned-center .secondary-navigation ul.woocommerce-mini-cart,.secondary-nav-aligned-right .secondary-navigation ul.woocommerce-mini-cart{font-size:inherit}#wc-mini-cart .widgettitle{display:none}@supports (display:grid){.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product{width:auto;margin-left:0;margin-right:0;margin-bottom:0}}.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{border-radius:0;font-weight:inherit;font-size:inherit;line-height:inherit;padding:10px 20px}ul.products .woocommerce-text-align-center{text-align:center}ul.products li.product.woocommerce-text-align-center .price,ul.products li.product.woocommerce-text-align-center .star-rating{margin-left:auto;margin-right:auto}ul.products li.product.woocommerce-text-align-right .price,ul.products li.product.woocommerce-text-align-right .star-rating{margin-left:auto}.woocommerce .star-rating:before{color:rgba(0,0,0,.4)}.woocommerce p.stars a{color:rgba(0,0,0,.4)}.woocommerce p.stars.selected a:before{color:#ffa200}.woocommerce ul.products li.product .price del{display:inline;padding-right:10px}ul.products .woocommerce-text-align-right{text-align:right}.woocommerce #content div.product div.images,.woocommerce div.product div.images,.woocommerce-page #content div.product div.images,.woocommerce-page div.product div.images{width:50%}.woocommerce #content div.product div.summary,.woocommerce div.product div.summary,.woocommerce-page #content div.product div.summary,.woocommerce-page div.product div.summary{width:auto;float:none;overflow:hidden}.product_meta{font-size:80%;border-top:1px solid rgba(0,0,0,.1);padding-top:30px}.product_meta>span{display:block}.up-sells{margin-top:40px}.add-to-cart-panel form.cart,.woocommerce div.product.do-quantity-buttons form.cart{display:flex;flex-wrap:wrap}.woocommerce div.product form.cart>:not(.quantity):not(.single_add_to_cart_button){width:100%}.add-to-cart-panel form.cart{flex-shrink:0}.woocommerce .quantity .qty{height:100%;width:auto;max-width:80px;background:0 0;border:1px solid rgba(0,0,0,.1);padding:0 10px;height:50px}.do-quantity-buttons .quantity:not(.buttons-added) .qty{width:50px}.add-to-cart-panel .cart.do-quantity-buttons div.quantity,.do-quantity-buttons div.quantity{display:flex;align-items:center}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after,.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before,.woocommerce form .quantity.buttons-added .minus,.woocommerce form .quantity.buttons-added .plus,.woocommerce form .quantity.buttons-added .qty{display:block;width:50px;height:100%;min-height:50px;background-color:transparent;border:1px solid rgba(0,0,0,.1);margin:0;padding:0;text-align:center;vertical-align:middle;-moz-appearance:textfield!important;-webkit-appearance:none;border-radius:0;color:inherit;box-sizing:border-box;text-decoration:none}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after,.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before,.woocommerce form .quantity.buttons-added .minus,.woocommerce form .quantity.buttons-added .plus{display:flex;align-items:center;justify-content:center}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before{content:"-";border-right:0}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after{content:"+";border-left:0}.woocommerce form .quantity.buttons-added .qty:focus{border-color:rgba(0,0,0,.1)}.do-quantity-buttons form .quantity input[type=number]::-webkit-inner-spin-button,.do-quantity-buttons form .quantity input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.do-quantity-buttons form .quantity:not(.buttons-added):before,.woocommerce form .quantity.buttons-added .minus{border-right-width:0}.do-quantity-buttons form .quantity:not(.buttons-added):after,.woocommerce form .quantity.buttons-added .plus{border-left-width:0}.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):after,.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):before,.do-quantity-buttons form .quantity.hidden{display:none}.woocommerce div.product form.cart div.quantity.hidden{margin:0}.woocommerce div.product .woocommerce-tabs ul.tabs li::after,.woocommerce div.product .woocommerce-tabs ul.tabs li::before,.woocommerce div.product .woocommerce-tabs ul.tabs::before{display:none;border:0}.woocommerce div.product .woocommerce-tabs ul.tabs{display:flex;margin-left:0;padding-left:0}.woocommerce div.product .woocommerce-tabs ul.tabs li{background-color:rgba(0,0,0,.02);margin:0;border-radius:0;border-width:1px 1px 0 0;border-color:rgba(0,0,0,.08)}.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child{border-left-width:1px}.woocommerce-ordering{float:left;margin-right:1em;margin-bottom:0;position:relative;padding:0}nav li.wc-menu-item{float:right}.cart-contents>span{line-height:0}.cart-contents>span:not(:empty){margin-left:10px}.rtl .cart-contents>span:not(:empty){margin-left:0;margin-right:10px}.cart-contents>span.gp-icon{margin-left:0}.rtl .cart-contents>span.gp-icon{margin-right:0}nav span.count{font-size:.8em;opacity:.5}.woocommerce a.remove{color:inherit!important;background:0 0!important;border:1px solid!important;border-color:inherit;font-weight:400;font-size:16px;width:20px;height:20px;line-height:17px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"!important}.woocommerce a.remove:hover{color:inherit!important;background:0 0!important;opacity:.7}.woocommerce .star-rating:before{opacity:.25;content:"SSSSS"}.woocommerce div.product .woocommerce-product-rating{margin:1em 0}.woocommerce div.product p.price,.woocommerce div.product span.price{color:inherit}.wc-has-gallery .secondary-image{position:absolute;opacity:0;transition:opacity .1s ease-in-out;left:50%;transform:translate(-50%,0);top:0}.wc-has-gallery picture.secondary-image{width:100%;height:100%}.wc-product-image:hover .secondary-image{opacity:1}.woocommerce ul.products li.product a img{margin-bottom:0}.woocommerce div.product .woocommerce-tabs ul.tabs li a,.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:initial}.woocommerce div.product p.price,.woocommerce ul.products li.product .price{font-weight:700}div.woocommerce-error a.button,div.woocommerce-error a.button:focus,div.woocommerce-error a.button:hover,div.woocommerce-info a.button,div.woocommerce-info a.button:focus,div.woocommerce-info a.button:hover,div.woocommerce-message a.button,div.woocommerce-message a.button:focus,div.woocommerce-message a.button:hover{background:0 0;padding:0}.woocommerce-error a,.woocommerce-info a,.woocommerce-message a{font-weight:700}.woocommerce-error,.woocommerce-info,.woocommerce-message{padding:20px 30px;border:0;border-left:10px solid rgba(0,0,0,.3)}.woocommerce-error::before,.woocommerce-info::before,.woocommerce-message::before{display:none}a.button.wc-forward:after{content:"\e901";font-family:"GP Premium";line-height:1em;padding-left:10px;position:relative;top:2px}.rtl a.button.wc-forward:after{display:none}.woocommerce-checkout .col2-set .col-1,.woocommerce-checkout .col2-set .col-2{float:none;width:100%;margin:0}.woocommerce-checkout .col2-set{width:52.9411764706%;float:left;margin-right:5.8823529412%}.rtl.woocommerce-checkout .col2-set{float:right;margin-right:0;margin-left:5.8823529412%}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading{width:41.1764705882%;float:right;margin-right:0}.woocommerce-additional-fields>h3{margin-top:20px}.woocommerce table.shop_table,.woocommerce table.shop_table tfoot td,.woocommerce table.shop_table tfoot th{border:0;border-radius:0}.woocommerce table.shop_table th{background-color:rgba(0,0,0,.03)}.woocommerce table.shop_table td,.woocommerce table.shop_table th{padding:20px;border:0}.woocommerce table.shop_table td{background-color:rgba(0,0,0,.005);border-bottom:1px solid rgba(0,0,0,.1)}#add_payment_method .cart-collaterals .cart_totals tr td,#add_payment_method .cart-collaterals .cart_totals tr th,.woocommerce-cart .cart-collaterals .cart_totals tr td,.woocommerce-cart .cart-collaterals .cart_totals tr th,.woocommerce-checkout .cart-collaterals .cart_totals tr td,.woocommerce-checkout .cart-collaterals .cart_totals tr th{border-top:0}#add_payment_method #payment,#add_payment_method #payment div.payment_box,.woocommerce-cart #payment,.woocommerce-cart #payment div.payment_box,.woocommerce-checkout #payment,.woocommerce-checkout #payment div.payment_box{background-color:transparent;color:inherit}#add_payment_method #payment div.payment_box:before,.woocommerce-cart #payment div.payment_box:before,.woocommerce-checkout #payment div.payment_box:before{display:none}#payment .payment_methods>.wc_payment_method>label{padding:20px;background-color:rgba(0,0,0,.04);display:block;cursor:pointer}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label{font-weight:700;background-color:rgba(0,0,0,.07)}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child{clip:rect(1px,1px,1px,1px);position:absolute!important}#payment .payment_methods>.wc_payment_method>label:before{display:inline-block;font-size:inherit;-webkit-font-smoothing:antialiased;content:"\e902";margin-right:.5407911001em;transition:color,ease,.2s;font-family:"GP Premium"}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label:before{content:"\e904"}#add_payment_method #payment ul.payment_methods,.woocommerce-cart #payment ul.payment_methods,.woocommerce-checkout #payment ul.payment_methods{padding:0;border:0}.woocommerce #payment #place_order,.woocommerce-page #payment #place_order{float:none;width:100%;padding-top:20px;padding-bottom:20px;font-weight:700;font-size:150%}#add_payment_method #payment div.form-row,.woocommerce-cart #payment div.form-row,.woocommerce-checkout #payment div.form-row{padding-left:0;padding-right:0;padding-top:0}#add_payment_method #payment ul.payment_methods li img,.woocommerce-cart #payment ul.payment_methods li img,.woocommerce-checkout #payment ul.payment_methods li img{float:right}#add_payment_method #payment .payment_method_paypal .about_paypal,.woocommerce-cart #payment .payment_method_paypal .about_paypal,.woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;display:inline-block;line-height:1}a.checkout-button:after{display:none}.woocommerce #content table.cart td.actions .input-text,.woocommerce table.cart td.actions .input-text,.woocommerce-page #content table.cart td.actions .input-text,.woocommerce-page table.cart td.actions .input-text{width:150px;padding:10px 15px}.woocommerce .coupon .button{border:1px solid transparent}.woocommerce ul.products li.product .woocommerce-product-details__short-description p:last-child{margin-bottom:0}.wc-product-image{text-align:center}.woocommerce-text-align-left .wc-product-image{text-align:left}.woocommerce-text-align-right .wc-product-image{text-align:right}.inside-wc-product-image{position:relative;display:inline-block}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image{float:left;margin-right:2em}.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:right;margin-left:2em}.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:auto}.woocommerce-cart ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce-cart ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce-cart ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce-cart ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:100%}.woocommerce .widget_price_filter .price_slider_amount .button{font-size:1em;line-height:normal}.woocommerce .related ul.products li.product a img,.woocommerce .up-sells ul.products li.product a img{margin-bottom:0}.woocommerce-review-link{font-size:80%}.woocommerce-Reviews .comment-reply-title{font-size:120%;font-weight:700;display:block;margin-bottom:10px}.woocommerce-MyAccount-navigation ul{margin:0;border-top:1px solid rgba(0,0,0,.1)}.site-main .woocommerce-MyAccount-navigation li{margin:0;padding:0}.woocommerce-MyAccount-navigation li a{display:block;padding:20px 0;border-bottom:1px solid rgba(0,0,0,.1);font-size:85%}.woocommerce-MyAccount-navigation li.is-active a{font-weight:700}.woocommerce-MyAccount-navigation li a:hover{border-bottom:1px solid rgba(0,0,0,.2)}.woocommerce-MyAccount-navigation li.is-active a:after{font-family:"GP Premium";content:"\e901";float:right;font-weight:700;font-size:115%}.woocommerce-account .woocommerce-MyAccount-navigation{width:25%}.woocommerce #payment .terms{padding:20px}h2.woocommerce-loop-category__title mark{background:0 0;font-size:80%;opacity:.5}.woocommerce form.checkout_coupon,.woocommerce form.login,.woocommerce form.register{padding:0;margin:0 0 1.5em;border:0}#ship-to-different-address{padding:3px;font-size:inherit}.woocommerce-image-align-left .products ul,.woocommerce-image-align-left .products ul:after,.woocommerce-image-align-left ul.products,.woocommerce-image-align-left ul.products:after,.woocommerce-image-align-right .products ul,.woocommerce-image-align-right .products ul:after,.woocommerce-image-align-right ul.products,.woocommerce-image-align-right ul.products:after{clear:none}.woocommerce nav.woocommerce-pagination{margin-top:60px;clear:both}.woocommerce input.button:disabled,.woocommerce input.button:disabled:hover,.woocommerce input.button:disabled[disabled],.woocommerce input.button:disabled[disabled]:hover{background-color:transparent;color:initial;opacity:.3}.entry-summary+.up-sells{clear:both}.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea{line-height:1.5}.main-navigation a.cart-contents:not(.has-svg-icon):before,.secondary-navigation a.cart-contents:not(.has-svg-icon):before{content:"\f07a";display:inline-block;font-family:"GP Premium";font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.main-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before,.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before{content:"\f290"}.main-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before,.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before{content:"\f291"}.cart-contents>span.number-of-items{font-size:11px;display:inline-block;background:rgba(255,255,255,.1);line-height:1.7em;height:1.7em;width:1.7em;text-align:center;border-radius:50%;margin-left:5px;position:relative;top:-5px;display:none}.cart-contents>span.number-of-items.no-items{display:none}.woocommerce-MyAccount-navigation ul{list-style-type:none}form.checkout:after,form.checkout:before{content:'';display:table}form.checkout:after{clear:both}.add-to-cart-panel{position:fixed;top:0;left:0;right:0;background:#fff;padding:20px;opacity:0;transition:opacity .5s ease-in-out,transform .5s ease-in-out;box-shadow:0 2px 2px -2px rgba(0,0,0,.2);z-index:101;font-size:90%;box-sizing:border-box;transform:translateY(-100%)}.add-to-cart-panel.item-added,.add-to-cart-panel.show-sticky-add-to-cart{opacity:1}.add-to-cart-panel>div{display:flex;align-items:center}.add-to-cart-panel .continue-shopping{margin-right:auto}.add-to-cart-panel .continue-shopping .gp-icon{display:none}.add-to-cart-panel .cart-info{margin-right:20px}.add-to-cart-panel img{height:50px;width:auto;vertical-align:middle}.add-to-cart-panel .product-title{margin-left:20px;margin-right:auto;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.add-to-cart-panel .product-price{margin-right:20px}.add-to-cart-panel div.quantity{margin-right:4px}.add-to-cart-panel .cart-data{font-size:12px}.add-to-cart-panel del{opacity:.4}.do-quantity-buttons input.qty::-webkit-inner-spin-button,.do-quantity-buttons input.qty::-webkit-outer-spin-button{-webkit-appearance:none}.wc-menu-cart-activated .menu-toggle{text-align:left}.woocommerce-order-received .woocommerce-customer-details .col2-set{float:none;width:auto}.woocommerce-order-received .woocommerce-customer-details .col2-set .col-1{margin-bottom:1.5em} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/customizer.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/customizer.php deleted file mode 100644 index a03e0370..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/customizer.php +++ /dev/null @@ -1,1031 +0,0 @@ -register_control_type( 'GeneratePress_Title_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Information_Customize_Control' ); - $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); - } - - $wp_customize->add_section( - 'generate_woocommerce_layout', - array( - 'title' => __( 'WooCommerce', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 100, - 'panel' => 'generate_layout_panel' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Section_Shortcut_Control( - $wp_customize, - 'generate_woocommerce_layout_shortcuts', - array( - 'section' => 'generate_woocommerce_layout', - 'element' => __( 'WooCommerce', 'gp-premium' ), - 'shortcuts' => array( - 'colors' => 'generate_woocommerce_colors', - 'typography' => 'generate_woocommerce_typography', - ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', - 'priority' => 0, - ) - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_general_title', - array( - 'section' => 'generate_woocommerce_layout', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'General', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[cart_menu_item]', - array( - 'default' => $defaults['cart_menu_item'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[cart_menu_item]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display cart in menu', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[cart_menu_item]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[menu_mini_cart]', - array( - 'default' => $defaults['menu_mini_cart'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[menu_mini_cart]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display mini cart sub-menu', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[menu_mini_cart]', - 'active_callback' => 'generate_premium_wc_menu_item_active', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[cart_menu_item_icon]', - array( - 'default' => $defaults['cart_menu_item_icon'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[cart_menu_item_icon]', - array( - 'type' => 'select', - 'label' => __( 'Menu Item Icon', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'choices' => array( - 'shopping-cart' => __( 'Shopping Cart', 'gp-premium' ), - 'shopping-bag' => __( 'Shopping Bag', 'gp-premium' ), - 'shopping-basket' => __( 'Shopping Basket', 'gp-premium' ), - ), - 'settings' => 'generate_woocommerce_settings[cart_menu_item_icon]', - 'active_callback' => 'generatepress_wc_menu_cart_active', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[cart_menu_item_content]', - array( - 'default' => $defaults['cart_menu_item_content'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[cart_menu_item_content]', - array( - 'type' => 'select', - 'label' => __( 'Menu Item Content', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'choices' => array( - 'amount' => __( 'Amount', 'gp-premium' ), - 'number' => __( 'Number of Items', 'gp-premium' ), - ), - 'settings' => 'generate_woocommerce_settings[cart_menu_item_content]', - 'active_callback' => 'generatepress_wc_menu_cart_active', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[breadcrumbs]', - array( - 'default' => $defaults['breadcrumbs'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[breadcrumbs]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display breadcrumbs', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[breadcrumbs]', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_shop_page_title', - array( - 'section' => 'generate_woocommerce_layout', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Shop', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[sidebar_layout]', - array( - 'default' => $defaults['sidebar_layout'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[sidebar_layout]', - array( - 'type' => 'select', - 'label' => __( 'Sidebar Layout', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'choices' => array( - 'left-sidebar' => __( 'Sidebar / Content', 'gp-premium' ), - 'right-sidebar' => __( 'Content / Sidebar', 'gp-premium' ), - 'no-sidebar' => __( 'Content (no sidebars)', 'gp-premium' ), - 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'gp-premium' ), - 'both-left' => __( 'Sidebar / Sidebar / Content', 'gp-premium' ), - 'both-right' => __( 'Content / Sidebar / Sidebar', 'gp-premium' ) - ), - 'settings' => 'generate_woocommerce_settings[sidebar_layout]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[columns]', array( - 'default' => $defaults['columns'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[tablet_columns]', array( - 'default' => $defaults['tablet_columns'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[mobile_columns]', array( - 'default' => $defaults['mobile_columns'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'gp_woocommerce_columns', - array( - 'label' => __( 'Product Columns', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => array( - 'desktop' => 'generate_woocommerce_settings[columns]', - 'tablet' => 'generate_woocommerce_settings[tablet_columns]', - 'mobile' => 'generate_woocommerce_settings[mobile_columns]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 1, - 'max' => 6, - 'step' => 1, - 'edit' => false, - 'unit' => 'Col', - ), - 'tablet' => array( - 'min' => 1, - 'max' => 3, - 'step' => 1, - 'edit' => false, - 'unit' => 'Col', - ), - 'mobile' => array( - 'min' => 1, - 'max' => 3, - 'step' => 1, - 'edit' => false, - 'unit' => 'Col', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[columns_gap]', array( - 'default' => $defaults['columns_gap'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[tablet_columns_gap]', array( - 'default' => $defaults['tablet_columns_gap'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint' - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[mobile_columns_gap]', array( - 'default' => $defaults['mobile_columns_gap'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'generate_premium_sanitize_empty_absint' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'gp_woocommerce_column_gap', - array( - 'label' => __( 'Column Gap', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => array( - 'desktop' => 'generate_woocommerce_settings[columns_gap]', - 'tablet' => 'generate_woocommerce_settings[tablet_columns_gap]', - 'mobile' => 'generate_woocommerce_settings[mobile_columns_gap]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 0, - 'max' => 100, - 'step' => 5, - 'edit' => true, - 'unit' => 'px', - ), - 'tablet' => array( - 'min' => 0, - 'max' => 100, - 'step' => 5, - 'edit' => true, - 'unit' => 'px', - ), - 'mobile' => array( - 'min' => 0, - 'max' => 100, - 'step' => 5, - 'edit' => true, - 'unit' => 'px', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_image_alignment]', - array( - 'default' => $defaults['product_archive_image_alignment'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_image_alignment]', - array( - 'type' => 'radio', - 'label' => __( 'Image Alignment', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'choices' => array( - 'left' => __( 'Left', 'gp-premium' ), - 'center' => __( 'Center', 'gp-premium' ), - 'right' => __( 'Right', 'gp-premium' ), - ), - 'settings' => 'generate_woocommerce_settings[product_archive_image_alignment]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[products_per_page]', - array( - 'default' => $defaults['products_per_page'], - 'type' => 'option', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[products_per_page]', - array( - 'type' => 'text', - 'label' => __( 'Products Per Page', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[products_per_page]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_alignment]', - array( - 'default' => $defaults['product_archive_alignment'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_alignment]', - array( - 'type' => 'radio', - 'label' => __( 'Text Alignment', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'choices' => array( - 'left' => __( 'Left', 'gp-premium' ), - 'center' => __( 'Center', 'gp-premium' ), - 'right' => __( 'Right', 'gp-premium' ), - ), - 'settings' => 'generate_woocommerce_settings[product_archive_alignment]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', - array( - 'default' => $defaults['off_canvas_panel_on_add_to_cart'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display cart panel on add to cart', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[shop_page_title]', - array( - 'default' => $defaults['shop_page_title'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[shop_page_title]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display page title', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[shop_page_title]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_results_count]', - array( - 'default' => $defaults['product_results_count'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_results_count]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display product results count', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_results_count]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_sorting]', - array( - 'default' => $defaults['product_sorting'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_sorting]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display product sorting', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_sorting]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_image]', - array( - 'default' => $defaults['product_archive_image'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_image]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display product image', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_image]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_secondary_image]', - array( - 'default' => $defaults['product_secondary_image'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_secondary_image]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display secondary image on hover', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_secondary_image]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_title]', - array( - 'default' => $defaults['product_archive_title'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_title]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display product title', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_title]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_sale_flash]', - array( - 'default' => $defaults['product_archive_sale_flash'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_sale_flash]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display sale flash', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_sale_flash]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', - array( - 'default' => $defaults['product_archive_sale_flash_overlay'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', - array( - 'type' => 'checkbox', - 'label' => __( 'Sale flash over image', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_rating]', - array( - 'default' => $defaults['product_archive_rating'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_rating]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display rating', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_rating]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_price]', - array( - 'default' => $defaults['product_archive_price'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_price]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display price', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_price]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_add_to_cart]', - array( - 'default' => $defaults['product_archive_add_to_cart'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_add_to_cart]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display add to cart button', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_add_to_cart]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_archive_description]', - array( - 'default' => $defaults['product_archive_description'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_archive_description]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display short description', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_archive_description]', - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_single_product_title', - array( - 'section' => 'generate_woocommerce_layout', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Single Product', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[single_sidebar_layout]', - array( - 'default' => $defaults['single_sidebar_layout'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_choices' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[single_sidebar_layout]', - array( - 'type' => 'select', - 'label' => __( 'Sidebar Layout', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'choices' => array( - 'inherit' => __( 'Inherit', 'gp-premium' ), - 'left-sidebar' => __( 'Sidebar / Content', 'gp-premium' ), - 'right-sidebar' => __( 'Content / Sidebar', 'gp-premium' ), - 'no-sidebar' => __( 'Content (no sidebars)', 'gp-premium' ), - 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'gp-premium' ), - 'both-left' => __( 'Sidebar / Sidebar / Content', 'gp-premium' ), - 'both-right' => __( 'Content / Sidebar / Sidebar', 'gp-premium' ) - ), - 'settings' => 'generate_woocommerce_settings[single_sidebar_layout]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[single_product_image_width]', array( - 'default' => $defaults['single_product_image_width'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'gp_woocommerce_single_product_image_width', - array( - 'label' => __( 'Product Image Area Width', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => array( - 'desktop' => 'generate_woocommerce_settings[single_product_image_width]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 10, - 'max' => 100, - 'step' => 5, - 'edit' => true, - 'unit' => '%', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[sticky_add_to_cart_panel]', - array( - 'default' => $defaults['sticky_add_to_cart_panel'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[sticky_add_to_cart_panel]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display add to cart panel on scroll', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[sticky_add_to_cart_panel]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[quantity_buttons]', - array( - 'default' => $defaults['quantity_buttons'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[quantity_buttons]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display quantity buttons', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[quantity_buttons]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[single_product_sale_flash]', - array( - 'default' => $defaults['single_product_sale_flash'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[single_product_sale_flash]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display sale flash', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[single_product_sale_flash]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_tabs]', - array( - 'default' => $defaults['product_tabs'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_tabs]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display product tabs', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_tabs]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_related]', - array( - 'default' => $defaults['product_related'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_related]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display related products', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_related]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_upsells]', - array( - 'default' => $defaults['product_upsells'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_upsells]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display upsell products', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_upsells]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[related_upsell_columns]', array( - 'default' => $defaults['related_upsell_columns'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[tablet_related_upsell_columns]', array( - 'default' => $defaults['tablet_related_upsell_columns'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[mobile_related_upsell_columns]', array( - 'default' => $defaults['mobile_related_upsell_columns'], - 'type' => 'option', - 'capability' => 'edit_theme_options', - 'sanitize_callback' => 'absint' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Pro_Range_Slider_Control( - $wp_customize, - 'gp_woocommerce_related_upsell_columns', - array( - 'label' => __( 'Related/Upsell Columns', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => array( - 'desktop' => 'generate_woocommerce_settings[related_upsell_columns]', - 'tablet' => 'generate_woocommerce_settings[tablet_related_upsell_columns]', - 'mobile' => 'generate_woocommerce_settings[mobile_related_upsell_columns]', - ), - 'choices' => array( - 'desktop' => array( - 'min' => 1, - 'max' => 6, - 'step' => 1, - 'edit' => false, - 'unit' => 'Col', - ), - 'tablet' => array( - 'min' => 1, - 'max' => 3, - 'step' => 1, - 'edit' => false, - 'unit' => 'Col', - ), - 'mobile' => array( - 'min' => 1, - 'max' => 3, - 'step' => 1, - 'edit' => false, - 'unit' => 'Col', - ), - ), - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_meta]', - array( - 'default' => $defaults['product_meta'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_meta]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display product meta data', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_meta]', - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[product_description]', - array( - 'default' => $defaults['product_description'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[product_description]', - array( - 'type' => 'checkbox', - 'label' => __( 'Display short description', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[product_description]', - ) - ); - - $wp_customize->add_section( - 'generate_woocommerce_colors', - array( - 'title' => __( 'WooCommerce', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 200, - 'panel' => 'generate_colors_panel' - ) - ); - - $wp_customize->add_section( - 'generate_woocommerce_typography', - array( - 'title' => __( 'WooCommerce', 'gp-premium' ), - 'capability' => 'edit_theme_options', - 'priority' => 200, - 'panel' => 'generate_typography_panel' - ) - ); - - $wp_customize->add_control( - new GeneratePress_Title_Customize_Control( - $wp_customize, - 'generate_woocommerce_checkout_title', - array( - 'section' => 'generate_woocommerce_layout', - 'type' => 'generatepress-customizer-title', - 'title' => __( 'Checkout', 'gp-premium' ), - 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' - ) - ) - ); - - $wp_customize->add_setting( - 'generate_woocommerce_settings[distraction_free]', - array( - 'default' => $defaults['distraction_free'], - 'type' => 'option', - 'sanitize_callback' => 'generate_premium_sanitize_checkbox' - ) - ); - - $wp_customize->add_control( - 'generate_woocommerce_settings[distraction_free]', - array( - 'type' => 'checkbox', - 'label' => __( 'Distraction-free mode', 'gp-premium' ), - 'description' => __( 'Remove unnecessary distractions like sidebars, footer widgets and sticky menus.', 'gp-premium' ), - 'section' => 'generate_woocommerce_layout', - 'settings' => 'generate_woocommerce_settings[distraction_free]', - ) - ); - -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js deleted file mode 100644 index a455a2f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js +++ /dev/null @@ -1,6 +0,0 @@ -jQuery( function( $ ) { - $( '#customize-control-generate_woocommerce_primary_button_message a' ).on( 'click', function( e ) { - e.preventDefault(); - wp.customize.control( 'generate_settings[form_button_background_color]' ).focus(); - } ); -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/functions.php deleted file mode 100644 index 7451494a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/functions.php +++ /dev/null @@ -1,1532 +0,0 @@ - true, - 'cart_menu_item_icon' => 'shopping-cart', - 'cart_menu_item_content' => 'amount', - 'menu_mini_cart' => false, - 'off_canvas_panel_on_add_to_cart' => false, - 'sticky_add_to_cart_panel' => false, - 'sidebar_layout' => 'right-sidebar', - 'single_sidebar_layout' => 'inherit', - 'products_per_page' => 9, - 'columns' => 4, - 'tablet_columns' => 2, - 'mobile_columns' => 1, - 'columns_gap' => 50, - 'tablet_columns_gap' => '', - 'mobile_columns_gap' => '', - 'related_upsell_columns' => 4, - 'tablet_related_upsell_columns' => 2, - 'mobile_related_upsell_columns' => 1, - 'product_archive_image_alignment' => 'center', - 'product_archive_alignment' => 'center', - 'shop_page_title' => true, - 'product_results_count' => true, - 'product_sorting' => true, - 'product_archive_image' => true, - 'product_secondary_image' => true, - 'product_archive_title' => true, - 'product_archive_sale_flash' => true, - 'product_archive_sale_flash_overlay' => true, - 'product_archive_rating' => true, - 'product_archive_price' => true, - 'product_archive_add_to_cart' => true, - 'single_product_sale_flash' => true, - 'single_product_image_width' => '50', - 'product_tabs' => true, - 'product_related' => true, - 'product_upsells' => true, - 'product_meta' => true, - 'product_description' => true, - 'quantity_buttons' => true, - 'breadcrumbs' => true, - 'distraction_free' => true, - 'product_archive_description' => false, - ) ); -} - -add_filter( 'generate_color_option_defaults', 'generatepress_wc_color_defaults' ); -/** - * Set the WC color option defaults. - * - * @since 1.3 - */ -function generatepress_wc_color_defaults( $defaults ) { - $defaults[ 'wc_alt_button_background' ] = '#1e73be'; - $defaults[ 'wc_alt_button_background_hover' ] = '#377fbf'; - $defaults[ 'wc_alt_button_text' ] = '#ffffff'; - $defaults[ 'wc_alt_button_text_hover' ] = '#ffffff'; - $defaults[ 'wc_rating_stars' ] = '#ffa200'; - $defaults[ 'wc_sale_sticker_background' ] = '#222222'; - $defaults[ 'wc_sale_sticker_text' ] = '#ffffff'; - $defaults[ 'wc_price_color' ] = '#222222'; - $defaults[ 'wc_product_tab' ] = '#222222'; - $defaults[ 'wc_product_tab_highlight' ] = '#1e73be'; - $defaults[ 'wc_success_message_background' ] = '#0b9444'; - $defaults[ 'wc_success_message_text' ] = '#ffffff'; - $defaults[ 'wc_info_message_background' ] = '#1e73be'; - $defaults[ 'wc_info_message_text' ] = '#ffffff'; - $defaults[ 'wc_error_message_background' ] = '#e8626d'; - $defaults[ 'wc_error_message_text' ] = '#ffffff'; - $defaults[ 'wc_product_title_color' ] = ''; - $defaults[ 'wc_product_title_color_hover' ] = ''; - - $defaults['wc_mini_cart_background_color'] = '#ffffff'; - $defaults['wc_mini_cart_text_color'] = '#000000'; - $defaults['wc_mini_cart_button_background'] = ''; - $defaults['wc_mini_cart_button_text'] = ''; - $defaults['wc_mini_cart_button_background_hover'] = ''; - $defaults['wc_mini_cart_button_text_hover'] = ''; - - $defaults['wc_panel_cart_background_color'] = '#ffffff'; - $defaults['wc_panel_cart_text_color'] = '#000000'; - $defaults['wc_panel_cart_button_background'] = ''; - $defaults['wc_panel_cart_button_text'] = ''; - $defaults['wc_panel_cart_button_background_hover'] = ''; - $defaults['wc_panel_cart_button_text_hover'] = ''; - - $defaults['wc_price_slider_background_color'] = '#dddddd'; - $defaults['wc_price_slider_bar_color'] = '#666666'; - - return $defaults; -} - -add_filter( 'generate_font_option_defaults', 'generatepress_wc_typography_defaults' ); -/** - * Set the WC typography option defaults. - * - * @since 1.3 - */ -function generatepress_wc_typography_defaults( $defaults ) { - $defaults[ 'wc_product_title_font_weight' ] = 'normal'; - $defaults[ 'wc_product_title_font_transform' ] = 'none'; - $defaults[ 'wc_product_title_font_size' ] = '20'; - $defaults[ 'mobile_wc_product_title_font_size' ] = ''; - $defaults[ 'wc_related_product_title_font_size' ] = '20'; - return $defaults; -} - -add_filter( 'generate_navigation_class', 'generatepress_wc_navigation_class' ); -/** - * Add navigation class when the menu icon is enabled. - * - * @since 1.3 - */ -function generatepress_wc_navigation_class( $classes ) { - $classes[] = ( generatepress_wc_get_setting( 'cart_menu_item' ) ) ? 'wc-menu-cart-activated' : ''; - return $classes; -} - -add_filter( 'post_class', 'generatepress_wc_post_class' ); -add_filter( 'product_cat_class', 'generatepress_wc_post_class' ); -/** - * Add post classes to the products. - * - * @since 1.3 - * - * @param array $classes Existing product classes. - * @return array - */ -function generatepress_wc_post_class( $classes ) { - if ( 'product' == get_post_type() ) { - $classes[] = ( generatepress_wc_get_setting( 'product_archive_sale_flash_overlay' ) && generatepress_wc_get_setting( 'product_archive_image' ) ) ? 'sales-flash-overlay' : ''; - $classes[] = 'woocommerce-text-align-' . generatepress_wc_get_setting( 'product_archive_alignment' ); - - if ( is_single() ) { - $classes[] = 'wc-related-upsell-columns-' . generatepress_wc_get_setting( 'related_upsell_columns' ); - $classes[] = 'wc-related-upsell-tablet-columns-' . generatepress_wc_get_setting( 'tablet_related_upsell_columns' ); - $classes[] = 'wc-related-upsell-mobile-columns-' . generatepress_wc_get_setting( 'mobile_related_upsell_columns' ); - } else { - $classes[] = 'woocommerce-image-align-' . generatepress_wc_get_setting( 'product_archive_image_alignment' ); - } - } - - if ( 'product' === get_post_type() || is_cart() ) { - if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) { - $classes[] = 'do-quantity-buttons'; - $product = wc_get_product( get_the_ID() ); - - $check_stock = is_callable( array( $product, 'managing_stock' ) ) && - is_callable( array( $product, 'get_stock_quantity' ) ) && - is_callable( array( $product, 'backorders_allowed' ) ) && - is_callable( array( $product, 'is_sold_individually' ) ) && - function_exists( 'is_product' ) && - is_product() && - defined( 'WC_VERSION' ); - - if ( $check_stock && version_compare( WC_VERSION, '7.4.0', '>=' ) ) { - $managing_stock = $product->managing_stock(); - $stock_quantity = $product->get_stock_quantity(); - $backorders_allowed = $product->backorders_allowed(); - $sold_individually = $product->is_sold_individually(); - - if ( $sold_individually || ( $managing_stock && $stock_quantity < 2 && ! $backorders_allowed ) ) { - $classes = array_diff( $classes, array( 'do-quantity-buttons' ) ); - } - } - } - } - - return $classes; -} - -add_action( 'woocommerce_before_shop_loop', 'generatepress_wc_before_shop_loop' ); -/** - * Add opening element inside shop page. - * - * @since 1.3 - */ -function generatepress_wc_before_shop_loop() { - $classes = apply_filters( 'generate_woocommerce_container_classes', array( - 'wc-columns-container', - 'wc-columns-' . generatepress_wc_get_setting( 'columns' ), - 'wc-tablet-columns-' . generatepress_wc_get_setting( 'tablet_columns' ), - 'wc-mobile-columns-' . generatepress_wc_get_setting( 'mobile_columns' ), - ) ); - - $classes = array_map('esc_attr', $classes); - echo '
          '; -} - -add_action( 'woocommerce_after_shop_loop', 'generatepress_wc_after_shop_loop' ); -/** - * Add closing element inside shop page. - * - * @since 1.3 - */ -function generatepress_wc_after_shop_loop() { - echo '
          '; -} - -add_action( 'wp_enqueue_scripts', 'generatepress_wc_scripts', 100 ); -/** - * Add scripts and styles. - * - * @since 1.3 - */ -function generatepress_wc_scripts() { - if ( ! function_exists( 'is_checkout' ) ) { - return; - } - - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - wp_enqueue_style( 'generate-woocommerce', plugin_dir_url( __FILE__ ) . "css/woocommerce{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION ); - wp_enqueue_style( 'generate-woocommerce-mobile', plugin_dir_url( __FILE__ ) . "css/woocommerce-mobile{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION, generate_premium_get_media_query( 'mobile' ) ); - - if ( - generatepress_wc_get_setting( 'cart_menu_item' ) || - generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ) || - generatepress_wc_show_sticky_add_to_cart() || - generatepress_wc_get_setting( 'quantity_buttons' ) - ) { - wp_enqueue_script( 'generate-woocommerce', plugin_dir_url( __FILE__ ) . "js/woocommerce{$suffix}.js", array( 'jquery' ), GENERATE_WOOCOMMERCE_VERSION, true ); - } - - $show_add_to_cart_panel = false; - - if ( ! is_singular() && generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ) ) { - $show_add_to_cart_panel = true; - } - - wp_localize_script( - 'generate-woocommerce', - 'generateWooCommerce', - array( - 'quantityButtons' => generatepress_wc_get_setting( 'quantity_buttons' ), - 'stickyAddToCart' => generatepress_wc_show_sticky_add_to_cart(), - 'addToCartPanel' => apply_filters( 'generate_woocommerce_show_add_to_cart_panel', $show_add_to_cart_panel ), - ) - ); - - if ( generatepress_wc_get_setting( 'distraction_free' ) && is_checkout() ) { - wp_dequeue_script( 'generate-advanced-sticky' ); - wp_dequeue_script( 'generate-sticky' ); - } - - $font_icons = true; - - if ( function_exists( 'generate_get_option' ) ) { - if ( 'font' !== generate_get_option( 'icons' ) ) { - $font_icons = false; - } - } - - if ( $font_icons ) { - wp_enqueue_style( 'gp-premium-icons' ); - } -} - -/** - * Wrapper class to get the options. - * - * @since 1.3 - * - * @return string $setting The option name. - * @return string The value. - */ -function generatepress_wc_get_setting( $setting ) { - $settings = wp_parse_args( - get_option( 'generate_woocommerce_settings', array() ), - generatepress_wc_defaults() - ); - - return $settings[ $setting ]; -} - -add_filter( 'generate_sidebar_layout', 'generatepress_wc_sidebar_layout' ); -/** - * Set the WC sidebars. - * - * @since 1.3 - * - * @param string Existing layout - * @return string New layout - */ -function generatepress_wc_sidebar_layout( $layout ) { - if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) { - $layout = generatepress_wc_get_setting( 'sidebar_layout' ); - - if ( is_single() ) { - if ( 'inherit' !== generatepress_wc_get_setting( 'single_sidebar_layout' ) ) { - $layout = generatepress_wc_get_setting( 'single_sidebar_layout' ); - } - - if ( get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true ) ) { - $layout = get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true ); - } - } - } - - return $layout; -} - -add_filter( 'loop_shop_columns', 'generatepress_wc_product_columns', 999 ); -/** - * Set the WC column number. - * - * @since 1.3 - */ -function generatepress_wc_product_columns() { - return generatepress_wc_get_setting( 'columns' ); -} - -add_filter( 'loop_shop_per_page', 'generatepress_wc_products_per_page', 20 ); -/** - * Set the WC products per page. - * - * @since 1.3 - */ -function generatepress_wc_products_per_page() { - return generatepress_wc_get_setting( 'products_per_page' ); -} - -add_action( 'wp', 'generatepress_wc_setup' ); -/** - * Set up WC. - * - * @since 1.3 - */ -function generatepress_wc_setup() { - - // Add support for WC features - add_theme_support( 'wc-product-gallery-zoom' ); - add_theme_support( 'wc-product-gallery-lightbox' ); - add_theme_support( 'wc-product-gallery-slider' ); - - remove_action( 'wp_enqueue_scripts', 'generate_woocommerce_css', 100 ); - - remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); - add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); - - add_action( 'woocommerce_before_shop_loop_item_title', 'generatepress_wc_image_wrapper_open', 8 ); - add_action( 'woocommerce_before_subcategory_title', 'generatepress_wc_image_wrapper_open', 8 ); - add_action( 'woocommerce_shop_loop_item_title', 'generatepress_wc_image_wrapper_close', 8 ); - add_action( 'woocommerce_before_subcategory_title', 'generatepress_wc_image_wrapper_close', 20 ); - - $archive_results_count = generatepress_wc_get_setting( 'product_results_count' ); - $archive_sorting = generatepress_wc_get_setting( 'product_sorting' ); - $archive_image = generatepress_wc_get_setting( 'product_archive_image' ); - $archive_sale_flash = generatepress_wc_get_setting( 'product_archive_sale_flash' ); - $archive_sale_flash_overlay = generatepress_wc_get_setting( 'product_archive_sale_flash_overlay' ); - $archive_rating = generatepress_wc_get_setting( 'product_archive_rating' ); - $archive_price = generatepress_wc_get_setting( 'product_archive_price' ); - $archive_add_to_cart = generatepress_wc_get_setting( 'product_archive_add_to_cart' ); - $archive_title = generatepress_wc_get_setting( 'product_archive_title' ); - $single_product_sale_flash = generatepress_wc_get_setting( 'single_product_sale_flash' ); - $product_tabs = generatepress_wc_get_setting( 'product_tabs' ); - $product_related = generatepress_wc_get_setting( 'product_related' ); - $product_upsells = generatepress_wc_get_setting( 'product_upsells' ); - $product_meta = generatepress_wc_get_setting( 'product_meta' ); - $product_description = generatepress_wc_get_setting( 'product_description' ); - $breadcrumbs = generatepress_wc_get_setting( 'breadcrumbs' ); - $page_title = generatepress_wc_get_setting( 'shop_page_title' ); - $distraction_free = generatepress_wc_get_setting( 'distraction_free' ); - $archive_description = generatepress_wc_get_setting( 'product_archive_description' ); - - if ( false === $page_title ) { - add_filter( 'woocommerce_show_page_title', '__return_false' ); - } - - if ( false === $archive_results_count ) { - remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 ); - remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); - } - - if ( false === $archive_sorting ) { - remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); - } - - if ( false === $archive_image ) { - remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); - } - - if ( false === $archive_sale_flash_overlay ) { - remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); - add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6 ); - } - - if ( false === $archive_sale_flash ) { - if ( false === $archive_sale_flash_overlay ) { - remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6 ); - } else { - remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); - } - } - - if ( false === $single_product_sale_flash ) { - remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 ); - } - - if ( false === $archive_rating ) { - remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); - } - - if ( false === $archive_price ) { - remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); - } - - if ( false === $archive_add_to_cart ) { - remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); - } - - if ( false === $archive_title ) { - remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); - } - - if ( false === $product_tabs ) { - remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); - } - - if ( false === $product_related ) { - remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); - } - - if ( false === $product_upsells ) { - remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); - } - - if ( false === $product_meta ) { - remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); - } - - if ( false === $product_description ) { - remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); - } - - if ( false === $breadcrumbs ) { - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); - } - - if ( true === $distraction_free ) { - add_filter( 'generate_sidebar_layout', 'generatepress_wc_checkout_sidebar_layout' ); - add_filter( 'generate_footer_widgets', 'generatepress_wc_checkout_footer_widgets' ); - } - - if ( true === $archive_description && ! is_single() && ! is_cart() ) { - add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 5 ); - add_action( 'woocommerce_after_subcategory_title', 'generatepress_wc_category_description', 12 ); - } -} - -/** - * Set the WC checkout sidebar layout. - * - * @since 1.3 - * - * @param string $layout Existing sidebar layout. - * @return string New sidebar layout. - */ -function generatepress_wc_checkout_sidebar_layout( $layout ) { - if ( ! function_exists( 'is_checkout' ) ) { - return $layout; - } - - if ( is_checkout() ) { - return 'no-sidebar'; - } - - return $layout; -} - -/** - * Set the WC checkout footer widgets. - * - * @since 1.3 - * - * @param int $widgets Existing number of widgets. - * @return int New number of widgets. - */ -function generatepress_wc_checkout_footer_widgets( $widgets ) { - if ( ! function_exists( 'is_checkout' ) ) { - return $widgets; - } - - if ( is_checkout() ) { - return '0'; - } - - return $widgets; -} - -add_filter( 'wp_nav_menu_items', 'generatepress_wc_menu_cart', 10, 2 ); -/** - * Add the WC cart menu item. - * - * @since 1.3 - * - * @param string $nav The HTML list content for the menu items. - * @param stdClass $args An object containing wp_nav_menu() arguments. - * @return string The search icon menu item. - */ -function generatepress_wc_menu_cart( $nav, $args ) { - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - return $nav; - } - - // If our primary menu is set, add the search icon. - if ( apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) === $args->theme_location && generatepress_wc_get_setting( 'cart_menu_item' ) ) { - if ( ! class_exists( 'WooCommerce' ) ) { - return; - } - - if ( ! isset( WC()->cart ) ) { - return; - } - - $has_items = false; - - if ( ! WC()->cart->is_empty() ) { - $has_items = 'has-items'; - } - - return sprintf( - '%1$s - ', - $nav, - generatepress_wc_cart_link(), - is_cart() ? 'current-menu-item' : '', - $has_items - ); - } - - // Our primary menu isn't set, return the regular nav. - return $nav; -} - -add_action( 'wp', 'generatepress_wc_add_menu_bar_items' ); -/** - * Add to the menu bar items. - * - * @since 1.11.0 - */ -function generatepress_wc_add_menu_bar_items() { - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - if ( 'secondary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { - add_action( 'generate_secondary_menu_bar_items', 'generate_wc_do_cart_secondary_menu_item', 5 ); - } - - if ( 'primary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { - add_action( 'generate_menu_bar_items', 'generate_wc_do_cart_menu_item', 5 ); - } - } -} - -/** - * Add the cart menu item to the secondary navigation. - */ -function generate_wc_do_cart_secondary_menu_item() { - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - if ( 'secondary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { - if ( ! class_exists( 'WooCommerce' ) ) { - return; - } - - if ( ! isset( WC()->cart ) ) { - return; - } - - $has_items = false; - - if ( ! WC()->cart->is_empty() ) { - $has_items = 'has-items'; - } - - printf( - ' - %1$s - ', - generatepress_wc_cart_link(), - is_cart() ? 'current-menu-item' : '', - $has_items - ); - } - } -} - -/** - * Add the cart menu item to the navigation. - * - * @since 1.11.0 - */ -function generate_wc_do_cart_menu_item() { - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - if ( 'primary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { - if ( ! class_exists( 'WooCommerce' ) ) { - return; - } - - if ( ! isset( WC()->cart ) ) { - return; - } - - $has_items = false; - - if ( ! WC()->cart->is_empty() ) { - $has_items = 'has-items'; - } - - printf( - ' - %1$s - ', - generatepress_wc_cart_link(), - is_cart() ? 'current-menu-item' : '', - $has_items - ); - } - } -} - -/** - * Build the menu cart link. - * - * @since 1.3 - */ -function generatepress_wc_cart_link() { - // Kept for backward compatibility. - $legacy_icon = apply_filters( 'generate_woocommerce_menu_cart_icon', '' ); - - // Get the icon type. - $icon_type = generatepress_wc_get_setting( 'cart_menu_item_icon' ); - - $icon = ''; - - if ( function_exists( 'generate_get_svg_icon' ) ) { - $icon = generate_get_svg_icon( $icon_type ); - } - - ob_start(); - - if ( ! class_exists( 'WooCommerce' ) ) { - return; - } - - if ( ! isset( WC()->cart ) ) { - return; - } - - $no_items = ''; - - if ( ! WC()->cart->get_cart_contents_count() > 0 ) { - $no_items = 'no-items'; - } - - printf( - '%5$s%6$s%7$s%8$s', - esc_url( wc_get_cart_url() ), - esc_attr( $icon_type ), - $icon ? 'has-svg-icon' : '', - esc_attr__( 'View your shopping cart', 'gp-premium' ), - $icon, - sprintf( - '%2$s', - $no_items, - WC()->cart->get_cart_contents_count() - ), - $legacy_icon, - WC()->cart->subtotal > 0 ? wp_kses_data( WC()->cart->get_cart_subtotal() ) : '' - ); - - if ( generatepress_wc_get_setting( 'menu_mini_cart' ) && ! is_cart() ) : ?> - - cart ) ) { - $fragments['.cart-contents span.amount'] = ( WC()->cart->subtotal > 0 ) ? '' . wp_kses_data( WC()->cart->get_cart_subtotal() ) . '' : ''; - $fragments['.cart-contents span.number-of-items'] = ( WC()->cart->get_cart_contents_count() > 0 ) ? '' . wp_kses_data( WC()->cart->get_cart_contents_count() ) . '' : ''; - } - - return $fragments; -} - -/** - * Add the cart icon in the mobile menu. - * - * @since 1.3 - */ -function generatepress_wc_mobile_cart_link() { - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - return; - } - - if ( ! generatepress_wc_get_setting( 'cart_menu_item' ) || 'primary' !== apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) ) { - return; - } - - if ( ! class_exists( 'WooCommerce' ) ) { - return; - } - - if ( ! isset( WC()->cart ) ) { - return; - } - - $has_items = false; - - if ( ! WC()->cart->is_empty() ) { - $has_items = ' has-items'; - } - ?> -
          - - -
          - set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link' ); - $css->add_property( 'color', esc_attr( $settings['wc_product_title_color'] ) ); - - // Product title color hover. - $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover' ); - $css->add_property( 'color', esc_attr( $settings['wc_product_title_color_hover'] ) ); - - if ( ! $using_dynamic_typography ) { - // Product title font size. - $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title' ); - $css->add_property( 'font-weight', esc_attr( $settings['wc_product_title_font_weight'] ) ); - $css->add_property( 'text-transform', esc_attr( $settings['wc_product_title_font_transform'] ) ); - $css->add_property( 'font-size', esc_attr( $settings['wc_product_title_font_size'] ), false, 'px' ); - - $css->set_selector( '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2' ); - if ( '' !== $settings['wc_related_product_title_font_size'] ) { - $css->add_property( 'font-size', esc_attr( $settings['wc_related_product_title_font_size'] ), false, 'px' ); - } - } - - // Primary button. - $css->set_selector( '.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button' ); - $css->add_property( 'color', esc_attr( $settings['form_button_text_color'] ) ); - $css->add_property( 'background-color', esc_attr( $settings['form_button_background_color'] ) ); - - if ( ! $using_dynamic_typography && isset( $settings['buttons_font_size'] ) ) { - $css->add_property( 'font-weight', esc_attr( $settings['buttons_font_weight'] ) ); - $css->add_property( 'text-transform', esc_attr( $settings['buttons_font_transform'] ) ); - - if ( '' !== $settings['buttons_font_size'] ) { - $css->add_property( 'font-size', absint( $settings['buttons_font_size'] ), false, 'px' ); - } - } - - if ( $using_dynamic_typography && class_exists( 'GeneratePress_Typography' ) ) { - $typography = generate_get_option( 'typography' ); - - foreach ( (array) $typography as $key => $data ) { - if ( 'buttons' === $data['selector'] ) { - $unit = isset( $data['fontSizeUnit'] ) ? $data['fontSizeUnit'] : 'px'; - - if ( ! empty( $data['fontSize'] ) ) { - $css->add_property( 'font-size', floatval( $data['fontSize'] ), false, $unit ); - } - - if ( ! empty( $data['fontWeight'] ) ) { - $css->add_property( 'font-weight', esc_attr( $data['fontWeight'] ) ); - } - - if ( ! empty( $data['textTransform'] ) ) { - $css->add_property( 'text-transform', esc_attr( $data['textTransform'] ) ); - } - - if ( ! empty( $data['fontSizeTablet'] ) ) { - $css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); - $css->add_property( 'font-size', floatval( $data['fontSizeTablet'] ), false, $unit ); - $css->stop_media_query(); - } - - if ( ! empty( $data['fontSizeMobile'] ) ) { - $css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); - $css->add_property( 'font-size', floatval( $data['fontSizeMobile'] ), false, $unit ); - $css->stop_media_query(); - } - } - } - } - - // Primary button hover. - $css->set_selector( '.woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover' ); - $css->add_property( 'color', esc_attr( $settings['form_button_text_color_hover'] ) ); - $css->add_property( 'background-color', esc_attr( $settings['form_button_background_color_hover'] ) ); - - // Alt button. - $css->set_selector( '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover' ); - $css->add_property( 'color', esc_attr( $settings['wc_alt_button_text'] ) ); - $css->add_property( 'background-color', esc_attr( $settings['wc_alt_button_background'] ) ); - - // Alt button hover. - $css->set_selector( '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover' ); - $css->add_property( 'color', esc_attr( $settings['wc_alt_button_text_hover'] ) ); - $css->add_property( 'background-color', esc_attr( $settings['wc_alt_button_background_hover'] ) ); - - // Star rating. - $css->set_selector( '.woocommerce .star-rating span:before, .woocommerce p.stars:hover a::before' ); - $css->add_property( 'color', esc_attr( $settings['wc_rating_stars'] ) ); - - // Sale sticker. - $css->set_selector( '.woocommerce span.onsale' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_sale_sticker_background'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_sale_sticker_text'] ) ); - - // Price. - $css->set_selector( '.woocommerce ul.products li.product .price, .woocommerce div.product p.price' ); - $css->add_property( 'color', esc_attr( $settings['wc_price_color'] ) ); - - // Product tab. - $css->set_selector( '.woocommerce div.product .woocommerce-tabs ul.tabs li a' ); - $css->add_property( 'color', esc_attr( $settings['wc_product_tab'] ) ); - - // Highlight product tab. - $css->set_selector( '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a' ); - $css->add_property( 'color', esc_attr( $settings['wc_product_tab_highlight'] ) ); - - // Success message. - $css->set_selector( '.woocommerce-message' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_success_message_background'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_success_message_text'] ) ); - - $css->set_selector( 'div.woocommerce-message a.button, div.woocommerce-message a.button:focus, div.woocommerce-message a.button:hover, div.woocommerce-message a, div.woocommerce-message a:focus, div.woocommerce-message a:hover' ); - $css->add_property( 'color', esc_attr( $settings['wc_success_message_text'] ) ); - - // Info message. - $css->set_selector( '.woocommerce-info' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_info_message_background'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_info_message_text'] ) ); - - $css->set_selector( 'div.woocommerce-info a.button, div.woocommerce-info a.button:focus, div.woocommerce-info a.button:hover, div.woocommerce-info a, div.woocommerce-info a:focus, div.woocommerce-info a:hover' ); - $css->add_property( 'color', esc_attr( $settings['wc_info_message_text'] ) ); - - // Info message. - $css->set_selector( '.woocommerce-error' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_error_message_background'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_error_message_text'] ) ); - - $css->set_selector( 'div.woocommerce-error a.button, div.woocommerce-error a.button:focus, div.woocommerce-error a.button:hover, div.woocommerce-error a, div.woocommerce-error a:focus, div.woocommerce-error a:hover' ); - $css->add_property( 'color', esc_attr( $settings['wc_error_message_text'] ) ); - - // Archive short description. - $css->set_selector( '.woocommerce-product-details__short-description' ); - if ( '' !== $settings['content_text_color'] ) { - $css->add_property( 'color', esc_attr( $settings['content_text_color'] ) ); - } else { - $css->add_property( 'color', esc_attr( $settings['text_color'] ) ); - } - - $css->set_selector( '#wc-mini-cart' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_background_color'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_text_color'] ) ); - - $css->set_selector( '#wc-mini-cart a:not(.button), #wc-mini-cart a.remove' ); - $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_text_color'] ) ); - - $css->set_selector( '#wc-mini-cart .button' ); - if ( $settings['wc_mini_cart_button_background'] ) { - $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_button_background'] ) ); - } - - if ( $settings['wc_mini_cart_button_text'] ) { - $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_button_text'] ) ); - } else { - $css->add_property( 'color', esc_attr( $settings['form_button_text_color'] ) ); - } - - $css->set_selector( '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_button_background_hover'] ) ); - - if ( $settings['wc_mini_cart_button_text_hover'] ) { - $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_button_text_hover'] ) ); - } else { - $css->add_property( 'color', esc_attr( $settings['form_button_text_color_hover'] ) ); - } - - $css->set_selector( '.woocommerce #content div.product div.images, .woocommerce div.product div.images, .woocommerce-page #content div.product div.images, .woocommerce-page div.product div.images' ); - $css->add_property( 'width', absint( generatepress_wc_get_setting( 'single_product_image_width' ) ), false, '%' ); - - if ( ! $using_dynamic_typography && function_exists( 'generate_get_font_family_css' ) ) { - $buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() ); - $css->set_selector( '.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a' ); - $css->add_property( 'font-family', $buttons_family ); - } - - $css->set_selector( '.add-to-cart-panel' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_background_color'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_text_color'] ) ); - - $css->set_selector( '.add-to-cart-panel a:not(.button)' ); - $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_text_color'] ) ); - - $css->set_selector( '#wc-sticky-cart-panel .button' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_button_background'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_button_text'] ) ); - - $css->set_selector( '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_button_background_hover'] ) ); - $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_button_text_hover'] ) ); - - $transparent_border_color = $settings['text_color']; - - if ( $settings['content_text_color'] ) { - $transparent_border_color = $settings['content_text_color']; - } - - $transparent_border_color = generate_premium_check_text_color( $transparent_border_color ); - - if ( 'light' === $transparent_border_color ) { - $transparent_border_elements = '.woocommerce-ordering select, .variations .value select'; - - if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) { - $transparent_border_elements = '.woocommerce form .quantity.buttons-added .qty, .woocommerce form .quantity.buttons-added .minus, .woocommerce form .quantity.buttons-added .plus, .do-quantity-buttons form .quantity:not(.buttons-added):before, .do-quantity-buttons form .quantity:not(.buttons-added):after, .woocommerce-ordering select, .variations .value select'; - } - - $css->set_selector( $transparent_border_elements ); - $css->add_property( 'border-color', 'rgba(255,255,255,0.1)' ); - - if ( generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) ) { - $css->set_selector( '#wc-sticky-cart-panel .quantity.buttons-added .qty, #wc-sticky-cart-panel .quantity.buttons-added .minus, #wc-sticky-cart-panel .quantity.buttons-added .plus' ); - $css->add_property( 'border-color', 'rgba(255,255,255,0.1)' ); - } - } - - $css->set_selector( '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_price_slider_background_color'] ) ); - - $css->set_selector( '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_price_slider_bar_color'] ) ); - - if ( 'number' === generatepress_wc_get_setting( 'cart_menu_item_content' ) ) { - $nav_text_color = generate_premium_check_text_color( $settings['navigation_text_color'] ); - - $css->set_selector( '.cart-contents > span.number-of-items' ); - if ( 'light' === $nav_text_color ) { - $css->add_property( 'background-color', 'rgba(255,255,255,0.1)' ); - } else { - $css->add_property( 'background-color', 'rgba(0,0,0,0.05)' ); - } - - $css->set_selector( '.cart-contents .amount' ); - $css->add_property( 'display', 'none' ); - - $css->set_selector( '.cart-contents > span.number-of-items' ); - $css->add_property( 'display', 'inline-block' ); - } - - $font_icons = true; - - if ( function_exists( 'generate_get_option' ) ) { - if ( 'font' !== generate_get_option( 'icons' ) ) { - $font_icons = false; - } - } - - if ( ! $font_icons ) { - $css->set_selector( '.woocommerce-MyAccount-navigation li.is-active a:after, a.button.wc-forward:after' ); - $css->add_property( 'display', 'none' ); - - $css->set_selector( '#payment .payment_methods>.wc_payment_method>label:before' ); - $css->add_property( 'font-family', 'WooCommerce' ); - $css->add_property( 'content', '"\e039"' ); - - $css->set_selector( '#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label:before' ); - $css->add_property( 'content', '"\e03c"' ); - - $css->set_selector( '.woocommerce-ordering:after' ); - $css->add_property( 'font-family', 'WooCommerce' ); - $css->add_property( 'content', '"\e00f"' ); - } - - $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); - - if ( '' !== generatepress_wc_get_setting( 'columns_gap' ) ) { - $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'columns_gap' ), false, 'px' ); - } - - $css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); - $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); - - if ( '' !== generatepress_wc_get_setting( 'tablet_columns_gap' ) ) { - $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'tablet_columns_gap' ), false, 'px' ); - } - - if ( 3 === generatepress_wc_get_setting( 'tablet_columns' ) ) { - $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-3 .products' ); - $css->add_property( '-ms-grid-columns', '(1fr)[3]' ); - $css->add_property( 'grid-template-columns', 'repeat(3, 1fr)' ); - } - - if ( 2 === generatepress_wc_get_setting( 'tablet_columns' ) ) { - $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-2 .products' ); - $css->add_property( '-ms-grid-columns', '(1fr)[2]' ); - $css->add_property( 'grid-template-columns', 'repeat(2, 1fr)' ); - } - - if ( 1 === generatepress_wc_get_setting( 'tablet_columns' ) ) { - $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-1 .products' ); - $css->add_property( 'width', '100%' ); - $css->add_property( '-ms-grid-columns', '1fr' ); - $css->add_property( 'grid-template-columns', '1fr' ); - } - - if ( 3 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { - $css->set_selector( '.wc-related-upsell-tablet-columns-3 .related ul.products, .wc-related-upsell-tablet-columns-3 .up-sells ul.products' ); - $css->add_property( '-ms-grid-columns', '(1fr)[3]' ); - $css->add_property( 'grid-template-columns', 'repeat(3, 1fr)' ); - } - - if ( 2 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { - $css->set_selector( '.wc-related-upsell-tablet-columns-2 .related ul.products, .wc-related-upsell-tablet-columns-2 .up-sells ul.products' ); - $css->add_property( '-ms-grid-columns', '(1fr)[2]' ); - $css->add_property( 'grid-template-columns', 'repeat(2, 1fr)' ); - } - - if ( 1 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { - $css->set_selector( '.wc-related-upsell-tablet-columns-1 .related ul.products, .wc-related-upsell-tablet-columns-1 .up-sells ul.products' ); - $css->add_property( 'width', '100%' ); - $css->add_property( '-ms-grid-columns', '1fr' ); - $css->add_property( 'grid-template-columns', '1fr' ); - } - $css->stop_media_query(); - - $css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); - if ( ! $using_dynamic_typography ) { - $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title' ); - if ( '' !== $settings[ 'mobile_wc_product_title_font_size' ] ) { - $css->add_property( 'font-size', esc_attr( $settings[ 'mobile_wc_product_title_font_size' ] ), false, 'px' ); - } - } - - $css->set_selector( '.add-to-cart-panel .continue-shopping' ); - $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_background_color'] ) ); - - $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); - - if ( '' !== generatepress_wc_get_setting( 'mobile_columns_gap' ) ) { - $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'mobile_columns_gap' ), false, 'px' ); - } - - $css->set_selector( '.woocommerce #content div.product div.images,.woocommerce div.product div.images,.woocommerce-page #content div.product div.images,.woocommerce-page div.product div.images' ); - $css->add_property( 'width', '100%' ); - $css->stop_media_query(); - - $using_flex = false; - - if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { - $using_flex = true; - } - - $css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); - if ( ! $using_flex ) { - $css->set_selector( '.mobile-bar-items + .menu-toggle' ); - $css->add_property( 'text-align', 'left' ); - } - - $css->set_selector( 'nav.toggled .main-nav li.wc-menu-item' ); - $css->add_property( 'display', 'none !important' ); - - if ( ! $using_flex ) { - $css->set_selector( 'body.nav-search-enabled .wc-menu-cart-activated:not(#mobile-header) .mobile-bar-items' ); - $css->add_property( 'float', 'right' ); - $css->add_property( 'position', 'relative' ); - - $css->set_selector( '.nav-search-enabled .wc-menu-cart-activated:not(#mobile-header) .menu-toggle' ); - $css->add_property( 'float', 'left' ); - $css->add_property( 'width', 'auto' ); - } - - $css->set_selector( '.mobile-bar-items.wc-mobile-cart-items' ); - $css->add_property( 'z-index', '1' ); - $css->stop_media_query(); - - return $css->css_output(); -} - -add_action( 'wp_enqueue_scripts', 'generatepress_wc_enqueue_css', 100 ); -/** - * Enqueue our dynamic CSS. - * - * @since 1.3 - */ -function generatepress_wc_enqueue_css() { - wp_add_inline_style( 'generate-woocommerce', generatepress_wc_css() ); - - if ( class_exists( 'GeneratePress_Typography' ) ) { - wp_add_inline_style( 'generate-woocommerce', GeneratePress_Typography::get_css( 'woocommerce' ) ); - } -} - -/** - * Open WC image wrapper. - * - * @since 1.3 - */ -function generatepress_wc_image_wrapper_open() { - if ( generatepress_wc_get_setting( 'product_archive_image' ) ) { - echo '
          '; - } -} - -/** - * Close WC image wrapper. - * - * @since 1.3 - */ -function generatepress_wc_image_wrapper_close() { - if ( generatepress_wc_get_setting( 'product_archive_image' ) ) { - echo '
          '; - } -} - -add_filter( 'post_class', 'generatepress_wc_product_has_gallery' ); -add_filter( 'product_cat_class', 'generatepress_wc_product_has_gallery' ); -/** - * Add product image post classes to products. - * - * @since 1.3 - * - * @param array $classes Existing classes. - * @return array New classes. - */ -function generatepress_wc_product_has_gallery( $classes ) { - - $post_type = get_post_type( get_the_ID() ); - - if ( 'product' === $post_type && method_exists( 'WC_Product', 'get_gallery_image_ids' ) ) { - $product = wc_get_product( get_the_ID() ); - $attachment_ids = $product->get_gallery_image_ids(); - - if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) { - $classes[] = 'wc-has-gallery'; - } - } - - return $classes; -} - -add_action( 'woocommerce_before_shop_loop_item_title', 'generatepress_wc_secondary_product_image' ); -/** - * Add secondary product image. - * - * @since 1.3 - */ -function generatepress_wc_secondary_product_image() { - $post_type = get_post_type( get_the_ID() ); - - if ( 'product' === $post_type && method_exists( 'WC_Product', 'get_gallery_image_ids' ) ) { - $product = wc_get_product( get_the_ID() ); - $attachment_ids = $product->get_gallery_image_ids(); - - if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) { - $secondary_image_id = $attachment_ids['0']; - echo wp_get_attachment_image( $secondary_image_id, 'woocommerce_thumbnail', '', $attr = array( 'class' => 'secondary-image attachment-shop-catalog' ) ); - } - } -} - -add_filter( 'woocommerce_product_get_rating_html', 'generatepress_wc_rating_html', 10, 2 ); -/** - * Always show ratings area to make sure products are similar heights. - * - * @since 1.3.1 - * - * @param string $rating_html - * @param int $rating - * @return string - */ -function generatepress_wc_rating_html( $rating_html, $rating ) { - if ( $rating > 0 ) { - $title = sprintf( __( 'Rated %s out of 5', 'gp-premium' ), $rating ); - } else { - $title = __( 'Not yet rated', 'gp-premium' ); - $rating = 0; - } - - $rating_html = '
          '; - $rating_html .= '' . $rating . ' ' . __( 'out of 5', 'gp-premium' ) . ''; - $rating_html .= '
          '; - - return $rating_html; -} - -/** - * Add WC category description. - * - * @since 1.3 - * - * @param array $category - * @return string - */ -function generatepress_wc_category_description( $category ) { - $prod_term = get_term( $category->term_id, 'product_cat' ); - $description = $prod_term->description; - echo '
          ' . $description . '
          '; -} - -add_action( 'generate_after_footer', 'generatepress_wc_add_to_cart_helper' ); -/** - * Adds a sticky/slide down navigation with add to cart details. - * - * @since 1.8 - */ -function generatepress_wc_add_to_cart_helper() { - if ( ! generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ) && ! generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) ) { - return; - } - - $outer_classes = array( - 'add-to-cart-panel', - ); - - $inner_classes = array( - 'inside-add-to-cart-panel', - ); - - if ( function_exists( 'generate_get_option' ) ) { - if ( 'contained-nav' === generate_get_option( 'nav_layout_setting' ) ) { - $outer_classes[] = 'grid-container grid-parent'; - } - - if ( 'contained' === generate_get_option( 'nav_inner_width' ) ) { - $inner_classes[] = 'grid-container grid-parent'; - } - } - ?> -
          -
          - - -
          - - -
          - -
          -
          - -
          - -
          - cart ) ) { - echo sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'gp-premium' ), WC()->cart->get_cart_contents_count() ); ?> - cart->get_cart_total(); - } - ?> -
          -
          - - - %s -
          ', - esc_url( wc_get_checkout_url() ), - esc_html__( 'Checkout', 'gp-premium' ) - ) - ); - ?> - -
          - -
          - -
          - -
          - - get_price() ) : ?> -
          - get_price_html(); ?> -
          - is_type( 'simple' ) ) { - $args = array( - 'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ), - 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ), - ); - - $action = sprintf( - '
          - %3$s - -
          ', - esc_url( $product->add_to_cart_url() ), - $quantity_buttons, - woocommerce_quantity_input( $args, $product, false ), - esc_html( $product->add_to_cart_text() ) - ); - } - - if ( $product->is_type( 'variable' ) ) { - $action = sprintf( - '', - esc_html( $product->add_to_cart_text() ) - ); - } - - if ( $product->is_type( 'external' ) ) { - $action = sprintf( - '
          - -
          ', - esc_url( $product->add_to_cart_url() ), - esc_html( $product->add_to_cart_text() ) - ); - } - - echo apply_filters( 'generate_wc_sticky_add_to_cart_action', $action, $product ); // phpcs:ignore -- No escaping needed. - endif; - ?> - -
          - - cart ) ) { - $fragments['.add-to-cart-panel .cart-data'] = '
          ' . sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'gp-premium' ), WC()->cart->get_cart_contents_count() ) . ' - ' . WC()->cart->get_cart_total() . '
          '; - } - - return $fragments; -} - -/** - * If we should display the sticky add to cart panel. - * - * @since 1.8 - */ -function generatepress_wc_show_sticky_add_to_cart() { - if ( ! function_exists( 'wc_get_product' ) ) { - return false; - } - - $product = wc_get_product( get_the_ID() ); - $show = false; - - if ( ! $product || ! generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) || ! is_singular( 'product' ) ) { - return false; - } - - if ( ( $product->is_type( 'simple' ) || $product->is_type( 'variable' ) ) && $product->is_purchasable() && $product->is_in_stock() ) { - $show = true; - } - - if ( $product->is_type( 'external' ) ) { - $show = true; - } - - return apply_filters( 'generate_wc_show_sticky_add_to_cart', $show ); -} - -/** - * Checks if a color is light or dark. - * - * @since 1.8 - * @param string $color The color to check. - */ -function generate_premium_check_text_color( $color ) { - // Get the hex value if we're using variables. - if ( function_exists( 'generate_get_option' ) && strpos( $color, 'var(' ) !== false ) { - $global_colors = generate_get_option( 'global_colors' ); - $found_color = false; - - // Remove whitespace if it's been added. - $color = str_replace( ' ', '', $color ); - - foreach ( (array) $global_colors as $key => $data ) { - // Check for the full variable - var(--color) - or a variable with a fallback - var(--color,#fff). - if ( 'var(--' . $data['slug'] . ')' === $color || strpos( $color, 'var(--' . $data['slug'] . ',' ) !== false ) { - $color = $data['color']; - $found_color = true; - break; - } - } - - // If we didn't find the hex value, bail. - if ( ! $found_color ) { - return; - } - } - - $r = hexdec( substr( $color, 1, 2 ) ); - $g = hexdec( substr( $color, 3, 2 ) ); - $b = hexdec( substr( $color, 5, 2 ) ); - $yiq = ( ( $r * 299 ) + ( $g * 587 ) + ( $b * 114 ) ) / 1000; - - return ( $yiq >= 128 ) ? 'light' : 'dark'; -} - -add_filter( 'generate_typography_css_selector', 'generate_woocommerce_typography_selectors' ); -/** - * Add the WooCommerce typography CSS selectors. - * - * @since 2.1.0 - * @param string $selector The selector we're targeting. - */ -function generate_woocommerce_typography_selectors( $selector ) { - switch ( $selector ) { - case 'woocommerce-catalog-product-titles': - $selector = '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title'; - break; - - case 'woocommerce-related-product-titles': - $selector = '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2'; - break; - } - - return $selector; -} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.js deleted file mode 100644 index 6950977f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.js +++ /dev/null @@ -1,285 +0,0 @@ -jQuery( function( $ ) { - var debounce = function( callback, wait ) { - var timeout; - - return function() { - clearTimeout( timeout ); - - timeout = setTimeout( function() { - timeout = undefined; - callback.call(); - }, wait ); - }; - }; - - $( 'body' ).on( 'added_to_cart', function() { - if ( ! $( '.wc-menu-item' ).hasClass( 'has-items' ) ) { - $( '.wc-menu-item' ).addClass( 'has-items' ); - } - - if ( ! $( '.wc-mobile-cart-items' ).hasClass( 'has-items' ) ) { - $( '.wc-mobile-cart-items' ).addClass( 'has-items' ); - } - } ); - - $( 'body' ).on( 'removed_from_cart', function() { - var numberOfItems = $( '.number-of-items' ); - - if ( numberOfItems.length ) { - if ( numberOfItems.hasClass( 'no-items' ) ) { - $( '.wc-menu-item' ).removeClass( 'has-items' ); - $( '.wc-mobile-cart-items' ).removeClass( 'has-items' ); - } - } - } ); - - if ( generateWooCommerce.addToCartPanel ) { - $( document.body ).on( 'added_to_cart', function() { - var adminBar = $( '#wpadminbar' ), - stickyNav = $( '.navigation-stick' ), - top = 0; - - if ( adminBar.length ) { - top = adminBar.outerHeight(); - } - - if ( stickyNav.length && '0px' === stickyNav.css( 'top' ) ) { - top = top + stickyNav.outerHeight(); - } - - $( '.add-to-cart-panel' ).addClass( 'item-added' ).css( { - '-webkit-transform': 'translateY(' + top + 'px)', - '-ms-transform': 'translateY(' + top + 'px)', - transform: 'translateY(' + top + 'px)', - } ); - } ); - - $( '.add-to-cart-panel .continue-shopping' ).on( 'click', function( e ) { - e.preventDefault(); - - $( '.add-to-cart-panel' ).removeClass( 'item-added' ).css( { - '-webkit-transform': 'translateY(-100%)', - '-ms-transform': 'translateY(-100%)', - transform: 'translateY(-100%)', - } ); - } ); - - $( window ).on( 'scroll', debounce( function() { - var panel = $( '.add-to-cart-panel' ); - - if ( panel.hasClass( 'item-added' ) ) { - panel.removeClass( 'item-added' ).css( { - '-webkit-transform': 'translateY(-100%)', - '-ms-transform': 'translateY(-100%)', - transform: 'translateY(-100%)', - } ); - } - }, 250 ) ); - } - - if ( generateWooCommerce.stickyAddToCart ) { - var lastScroll = 0; - var scrollDownTimeout = 300; - - $( window ).on( 'scroll', debounce( function() { - var adminBar = $( '#wpadminbar' ), - stickyNav = $( '.navigation-stick' ), - stuckElement = $( '.stuckElement' ), - top = 0, - scrollTop = $( window ).scrollTop(), - panel = $( '.add-to-cart-panel' ), - panelPosition = panel.offset().top + panel.outerHeight(), - button = $( '.single_add_to_cart_button' ), - buttonTop = button.offset().top, - buttonHeight = button.outerHeight(), - footerTop = $( '.site-footer' ).offset().top; - - if ( stuckElement.length === 0 ) { - scrollDownTimeout = 0; - } - - if ( scrollTop > ( buttonTop + buttonHeight ) && panelPosition < footerTop ) { - setTimeout( function() { - if ( adminBar.length ) { - top = adminBar.outerHeight(); - } - - if ( stickyNav.length ) { - if ( stickyNav.hasClass( 'auto-hide-sticky' ) ) { - if ( scrollTop < lastScroll && '0px' === stickyNav.css( 'top' ) ) { - top = top + stickyNav.outerHeight(); - } else { - top = top; - } - - lastScroll = scrollTop; - } else { - top = top + stickyNav.outerHeight(); - } - } - - panel.addClass( 'show-sticky-add-to-cart' ).css( { - '-webkit-transform': 'translateY(' + top + 'px)', - '-ms-transform': 'translateY(' + top + 'px)', - transform: 'translateY(' + top + 'px)', - } ); - }, scrollDownTimeout ); - } else { - panel.removeClass( 'show-sticky-add-to-cart' ).css( { - '-webkit-transform': '', - '-ms-transform': '', - transform: '', - } ); - } - }, 50 ) ); - - $( '.go-to-variables' ).on( 'click', function( e ) { - e.preventDefault(); - - var offset = 0, - stickyNav = $( '.navigation-stick' ), - adminBar = $( '#wpadminbar' ); - - if ( stickyNav.length ) { - offset = stickyNav.outerHeight(); - } - - if ( adminBar.length ) { - offset = offset + adminBar.outerHeight(); - } - - $( 'html, body' ).animate( { - scrollTop: $( '.variations' ).offset().top - offset, - }, 250 ); - } ); - } - - $( function() { - 'use strict'; - - if ( generateWooCommerce.quantityButtons ) { - generateQuantityButtons(); - } - } ); - - $( document ).ajaxComplete( function() { - 'use strict'; - - if ( generateWooCommerce.quantityButtons ) { - generateQuantityButtons(); - } - } ); - - function generateQuantityButtons() { - // Check if we have an overwrite hook for this function - try { - return generateWooCommerce.hooks.generateQuantityButtons(); - } catch ( e ) { - // No hook in place, carry on - } - - // Grab the FIRST available cart form on the page - var cart = $( '.woocommerce div.product form.cart' ).first(); - - // Check if we see elementor style classes - if ( cart.closest( '.elementor-add-to-cart' ).length ) { - // Found classes, remove them and finish here - $( '.elementor.product' ).removeClass( 'do-quantity-buttons' ); - return; - } - - // Grab all the quantity boxes that need dynamic buttons adding - var quantityBoxes; - - try { - // Is there a hook available? - quantityBoxes = generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes; - } catch ( e ) { - // Use the default plugin selector functionality - quantityBoxes = $( '.cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)' ).find( '.qty' ); - } - - // Test the elements have length and greater than 0 - // Try, catch here to provide basic error checking on hooked data - try { - // Nothing found... stop here - if ( quantityBoxes.length === 0 ) { - return false; - } - } catch ( e ) { - return false; - } - - // Allow the each loop callback to be completely overwritten - var quantityBoxesCallback; - - try { - // Try assign a hooked callback - quantityBoxesCallback = generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes; - } catch ( e ) { - // Use the default callback handler - quantityBoxesCallback = function( key, value ) { - var box = $( value ); - - // Check allowed types - if ( [ 'date', 'hidden' ].indexOf( box.prop( 'type' ) ) !== -1 ) { - return; - } - - // Add plus and minus icons - box.parent().addClass( 'buttons-added' ).prepend( '-' ); - box.after( '+' ); - - // Enforce min value on the input - var min = parseFloat( $( this ).attr( 'min' ) ); - - if ( min && min > 0 && parseFloat( $( this ).val() ) < min ) { - $( this ).val( min ); - } - - // Add event handlers to plus and minus (within this scope) - box.parent().find( '.plus, .minus' ).on( 'click', function() { - // Get values - var currentQuantity = parseFloat( box.val() ), - maxQuantity = parseFloat( box.attr( 'max' ) ), - minQuantity = parseFloat( box.attr( 'min' ) ), - step = box.attr( 'step' ); - - // Fallback default values - if ( ! currentQuantity || '' === currentQuantity || 'NaN' === currentQuantity ) { - currentQuantity = 0; - } - - if ( '' === maxQuantity || 'NaN' === maxQuantity ) { - maxQuantity = ''; - } - - if ( '' === minQuantity || 'NaN' === minQuantity ) { - minQuantity = 0; - } - - if ( 'any' === step || '' === step || undefined === step || 'NaN' === parseFloat( step ) ) { - step = 1; - } - - if ( $( this ).is( '.plus' ) ) { - if ( maxQuantity && ( maxQuantity === currentQuantity || currentQuantity > maxQuantity ) ) { - box.val( maxQuantity ); - } else { - box.val( currentQuantity + parseFloat( step ) ); - } - } else if ( minQuantity && ( minQuantity === currentQuantity || currentQuantity < minQuantity ) ) { - box.val( minQuantity ); - } else if ( currentQuantity > 0 ) { - box.val( currentQuantity - parseFloat( step ) ); - } - - // Trigger change event - box.trigger( 'change' ); - } ); - }; - } - - $.each( quantityBoxes, quantityBoxesCallback ); - } -} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js deleted file mode 100644 index 97f0e7aa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(function(d){function t(t,a){var e;return function(){clearTimeout(e),e=setTimeout(function(){e=void 0,t.call()},a)}}var m,u;function a(){try{return generateWooCommerce.hooks.generateQuantityButtons()}catch(t){}var a,e;if(d(".woocommerce div.product form.cart").first().closest(".elementor-add-to-cart").length)d(".elementor.product").removeClass("do-quantity-buttons");else{try{a=generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes}catch(t){a=d(".cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)").find(".qty")}try{if(0===a.length)return}catch(t){return}try{e=generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes}catch(t){e=function(t,a){var s=d(a);-1===["date","hidden"].indexOf(s.prop("type"))&&(s.parent().addClass("buttons-added").prepend('-'),s.after('+'),(a=parseFloat(d(this).attr("min")))&&0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - gp_elements - - - _generate_element_content - _generate_element_type - _generate_block_type - _generate_element_display_conditions - _generate_element_exclude_conditions - _generate_element_user_conditions - _generate_hook - _generate_hook_execute_shortcodes - _generate_hook_execute_php - _generate_hook_priority - _generate_hook_disable_site_header - _generate_hook_disable_site_footer - _generate_hero_custom_classes - _generate_hero_container - _generate_hero_inner_container - _generate_hero_horizontal_alignment - _generate_hero_padding_top - _generate_hero_padding_right - _generate_hero_padding_bottom - _generate_hero_padding_left - _generate_hero_padding_top_unit - _generate_hero_padding_right_unit - _generate_hero_padding_bottom_unit - _generate_hero_padding_left_unit - _generate_hero_padding_top_mobile - _generate_hero_padding_right_mobile - _generate_hero_padding_bottom_mobile - _generate_hero_padding_left_mobile - _generate_hero_padding_top_unit_mobile - _generate_hero_padding_right_unit_mobile - _generate_hero_padding_bottom_unit_mobile - _generate_hero_padding_left_unit_mobile - _generate_hero_background_image - _generate_hero_background_position - _generate_hero_background_parallax - _generate_hero_disable_featured_image - _generate_hero_background_overlay - _generate_hero_background_color - _generate_hero_text_color - _generate_hero_link_color - _generate_hero_background_link_color_hover - _generate_site_header_merge - _generate_site_header_height - _generate_site_header_height_mobile - _generate_site_header_background_color - _generate_site_header_title_color - _generate_site_header_tagline_color - _generate_site_logo - _generate_retina_logo - _generate_navigation_logo - _generate_mobile_logo - _generate_navigation_location - _generate_navigation_colors - _generate_navigation_background_color - _generate_navigation_text_color - _generate_navigation_background_color_hover - _generate_navigation_text_color_hover - _generate_navigation_background_color_current - _generate_navigation_text_color_current - _generate_sidebar_layout - _generate_footer_widgets - _generate_disable_site_header - _generate_disable_top_bar - _generate_disable_primary_navigation - _generate_disable_secondary_navigation - _generate_disable_featured_image - _generate_disable_content_title - _generate_disable_footer - _generate_content_area - _generate_content_width - - diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md deleted file mode 100644 index 42243dac..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md +++ /dev/null @@ -1,252 +0,0 @@ -# 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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 51f012dd..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.eot and /dev/null 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 deleted file mode 100644 index 51e14560..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - -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 deleted file mode 100644 index c44c262f..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.ttf and /dev/null 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 deleted file mode 100644 index dc898ac5..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.woff and /dev/null 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 deleted file mode 100644 index d194c5b1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/jetpack-protect.css +++ /dev/null @@ -1,30 +0,0 @@ -@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-db145d62b5ef09c05ad7.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-db145d62b5ef09c05ad7.png deleted file mode 100644 index 21176718..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-db145d62b5ef09c05ad7.png and /dev/null 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 deleted file mode 100644 index a6409cd3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('moment', 'react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'fe97d1535658daaa9984'); 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 deleted file mode 100644 index 75197f7f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.css +++ /dev/null @@ -1 +0,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 #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)}.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)}: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-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}.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)}.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)}.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}.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}.sexr0jUxC1jVixdKiDnC{margin-left:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-left:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.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}}.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}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}._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)}.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)}.DM4b8iQ0ewvRYdIPxvZ8{max-width:calc(744px + var(--spacing-base)*6);width:100%}.bW6ZuNzJBYU5PVPktE2S{display:flex}.bW6ZuNzJBYU5PVPktE2S:not(:first-child){margin-top:calc(var(--spacing-base)*7)}.di3wjXHrX1rk_H6rlxKM{margin-right:calc(var(--spacing-base)*2);padding-top:calc(var(--spacing-base)/2)}@media(min-width:600px){.di3wjXHrX1rk_H6rlxKM{margin-right:calc(var(--spacing-base)*5)}}.IrzHnNkRvORtyCL0yiWa{width:100%}.sU82bpLEYPC9n_CFAKoz{align-items:center;display:flex}.ZZc0LldcbJpcftqCe43T .IrzHnNkRvORtyCL0yiWa{opacity:.5}.T17WOOJI7XHN7KRmYaCe>:last-child{margin-top:calc(var(--spacing-base)*2)}@media(min-width:600px){.T17WOOJI7XHN7KRmYaCe{display:flex;justify-content:space-between}}.typbjN2keZ97hj2TmuMC{display:flex;flex-wrap:wrap;margin-top:calc(var(--spacing-base)*2)}.UUXAN8VTAZY0h8t9rCHG{color:var(--jp-green-50);margin-right:calc(var(--spacing-base)/2)}.eFjcadLMEXY5O61vsTrx{color:var(--jp-gray-50)}.Tr5uYvclUiwlC5kuGk7E{color:var(--jp-red-50)}.zPZcNgYx2X5778nHHtlH{display:flex;flex-wrap:wrap}.lNtkRXnB1z_kYB28MUWq{color:var(--jp-gray-50)}.JgH5ykcLynEgqXYurT78{margin-right:calc(var(--spacing-base)/2)}.JgH5ykcLynEgqXYurT78,.xlWW0IoKZwTZt1Ti0tcQ{color:var(--jp-green-50)}.zhBcgCUGgyC7PvWk8ewB{margin-top:calc(var(--spacing-base)*3)}@media(min-width:600px){.zhBcgCUGgyC7PvWk8ewB{padding-left:calc(var(--spacing-base)*11)}}.mah_f2OWxZ3Vqt_jRFdR{margin-bottom:calc(var(--spacing-base)*4)}.pRMFiIODonlw4XMdNHaU{margin-bottom:calc(var(--spacing-base)*2);margin-top:calc(var(--spacing-base)*6)}.Ax2SmW57c0U5xOTjZuAA{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-2)}.xGZeYQr0_nPJTFmd8pW4{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)}.RYTIt8kwLbKcUbWOfG4g{padding:calc(var(--spacing-base)*3);width:304px}.BqXge2rIUP0a_74yvYbr{display:flex;justify-content:space-between}.Lr10UUCcSLF3T_0QqoPr{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-3)}.Lr10UUCcSLF3T_0QqoPr:focus,.Lr10UUCcSLF3T_0QqoPr:focus:not(:disabled){box-shadow:none}.th_VukMuODIOVLC7oJo6{display:flex;justify-content:flex-end}.Gxtap1Zcl5X5UEHfSdQ4{color:var(--jp-gray-50)}.Gxtap1Zcl5X5UEHfSdQ4:before{background:var(--jp-gray-50);border-radius:50%;content:"";display:inline-block;height:8px;margin-right:var(--spacing-base);width:8px}.Gxtap1Zcl5X5UEHfSdQ4.dSfmCVUK_Ez7sxdqOIdy{color:var(--jp-green-40)}.Gxtap1Zcl5X5UEHfSdQ4.dSfmCVUK_Ez7sxdqOIdy:before{background:var(--jp-green-40)}.e6JXg_theht0XwCBgqdA{margin-bottom:calc(var(--spacing-base)*3);margin-top:calc(var(--spacing-base)*2)}.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)}._Wc3apZobag_9Ag_THTb{display:flex;justify-content:space-between}.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)}.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}.EU0Rvu4PDqVtnCAmbgHg{height:56px;margin-bottom:calc(var(--spacing-base)*8);width:48px}.EU0Rvu4PDqVtnCAmbgHg>svg{left:-40px;position:relative;top:-36px}.vzMlFr1AXWqefpRrb976{align-items:center;display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*3)}.gYSOMa4xxLXmsNzvFPkW{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)}.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}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box}.ZMBDiTLzs27F012iOsMK>:first-child{flex:1}@media(min-width:960px){.ZMBDiTLzs27F012iOsMK{align-items:center;display:flex}}.zI2DKzqRc1MhF6aq5eHt{align-items:center;color:var(--jp-black);display:flex}.iHgPFku9KaLz8FIQV1Qw{margin-left:-4px;margin-right:var(--spacing-base)}.ctq2nQkzIfSoMkldF9t9{margin-top:calc(var(--spacing-base)*2);width:100%}@media(min-width:960px){.ctq2nQkzIfSoMkldF9t9{margin-left:calc(var(--spacing-base)*2);margin-top:0;width:auto}}.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);border-radius:50%!important}.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);border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.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}.r4Id5qht2FD68jCAH2Cl{margin-left: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)}.ZSZPabDoB8MVVPttP0tu{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%}.ZSZPabDoB8MVVPttP0tu>span:first-child{grid-column:1/7}.ZSZPabDoB8MVVPttP0tu>span:not(:first-child){text-align:center}.iJ_biSBRDribuNKX0Zuw{margin:calc(var(--spacing-base)*4) calc(var(--spacing-base)*8);text-align:center}.iJ_biSBRDribuNKX0Zuw>button span{color:var(--jp-gray-70);font-size:var(--font-body-small);font-weight:400}.iJ_biSBRDribuNKX0Zuw button:hover:not(:disabled){text-decoration-line:none}.iJ_biSBRDribuNKX0Zuw button:focus:not(:disabled){box-shadow:none}@media(max-width:599px){.uym7dGHhp6ifjF57yOAO{margin-bottom:calc(var(--spacing-base)*3)}.e_2eFTR8RyHwmfeqJL4F{display:none}.r4Id5qht2FD68jCAH2Cl{flex:1}.r4Id5qht2FD68jCAH2Cl:first-of-type{margin-left:0}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:center}.pkw2LnOTd8VvQ3oT8sXQ>*{width:50%}}.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;margin-bottom:var(--spacing-base);margin-left:calc(var(--spacing-base)*4)}.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)}@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}}.A6a9HOtaZnLUleNgxQrX{padding:calc(var(--spacing-base)*7) 0}.CGT5fOs6LDTFHWCAgIiT,.RFKxbzQ8N58qEyVO0yzW{align-items:center;display:flex}.RFKxbzQ8N58qEyVO0yzW{height:100%}.RFKxbzQ8N58qEyVO0yzW img{object-fit:cover;width:100%}.SvMuuouOkDt2sE0PAn_D{margin-top:calc(var(--spacing-base)*3 + 1px)}.urouayitSUT8zW0V3p_0{margin-bottom:0}.iXXJlk08gFDeCvsTTlNQ{border:1px solid var(--jp-gray);border-left:6px solid var(--jp-red-50);border-radius:var(--jp-border-radius);box-shadow:0 4px 8px #00000008,0 1px 2px #0000000f;box-sizing:border-box;color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.iXXJlk08gFDeCvsTTlNQ.is-error{background-color:var(--jp-white)}.iXXJlk08gFDeCvsTTlNQ .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.iXXJlk08gFDeCvsTTlNQ .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.iXXJlk08gFDeCvsTTlNQ .components-notice__dismiss{align-self:center}.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:visited{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-left:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:visited{margin-left:0;margin-top:0;white-space:nowrap}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .components-notice__content{align-items:center;flex-direction:row}.e6hHy8BZ7ZKPSXbIC0UG{margin-bottom:25px}.jXz8LnXNzMDdtHqkG0sZ{display:flex;flex-grow:1;margin-right:var(--spacing-base)}.jXz8LnXNzMDdtHqkG0sZ>svg{align-self:flex-start;flex-shrink:0}.jXz8LnXNzMDdtHqkG0sZ .jp-components-spinner,.jXz8LnXNzMDdtHqkG0sZ>svg{margin-right:calc(var(--spacing-base)*2)}*{box-sizing:border-box} \ 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 deleted file mode 100644 index 94ad082c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/*! For license information please see index.js.LICENSE.txt */ -(()=>{var e={9487:(e,t,a)=>{"use strict";a.d(t,{X:()=>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}}},8899:(e,t,a)=>{"use strict";a.d(t,{LR:()=>r});var n=a(9487),c=a(2003);function r(e,t,a={}){const r=(0,n.X)(t);if(!r||isNaN(e))return null;const{decimal:s,grouping:i,precision:o,symbol:l}={...r,...a},p=e<0?"-":"",d=Math.abs(e),u=Math.floor(d);return{sign:p,symbol:l,integer:(0,c.Z)(d,o,s,i).split(s)[0],fraction:o>0?(0,c.Z)(d-u,o,s,i).slice(1):""}}},2003:(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})},1074:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(9307);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})}))},3259:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}))},495:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},9201:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))},2229:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(c.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}))},7489:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(c.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}))},6163:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},9517:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}))},4160:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(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"}))},8960:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(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"}))},5381:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},6376:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},1646:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},496:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},7663:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},797:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,n.createElement)(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"}))},2817:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,n.createElement)(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"}))},4769:e=>{"use strict";function t(e){return e&&"object"==typeof e?c(e)||r(e)?e:n(e)?function(e,t){if(e.map)return e.map(t);for(var a=[],n=0;n{var a;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e=[],t=0;t{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(1741)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},1741:(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";t.G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.split(/\r\n|[\n\v\f\r\x85]/),n=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],c=[],r=0;function s(){var e={};for(c.push(e);r{"use strict";a.d(t,{Ep:()=>m,aU:()=>n,cP:()=>h,q_:()=>l});var n,c=a(255);!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));var r=function(e){return e};var s="beforeunload",i="hashchange",o="popstate";function l(e){void 0===e&&(e={});var t=e.window,a=void 0===t?document.defaultView:t,l=a.history;function g(){var e=h(a.location.hash.substr(1)),t=e.pathname,n=void 0===t?"/":t,c=e.search,s=void 0===c?"":c,i=e.hash,o=void 0===i?"":i,p=l.state||{};return[p.idx,r({pathname:n,search:s,hash:o,state:p.usr||null,key:p.key||"default"})]}var f=null;function v(){if(f)_.call(f),f=null;else{var e=n.Pop,t=g(),a=t[0],c=t[1];if(_.length){if(null!=a){var r=b-a;r&&(f={action:e,location:c,retry:function(){N(-1*r)}},N(r))}}else S(e)}}a.addEventListener(o,v),a.addEventListener(i,(function(){m(g()[1])!==m(y)&&v()}));var E=n.Pop,k=g(),b=k[0],y=k[1],Z=d(),_=d();function w(e){return function(){var e=document.querySelector("base"),t="";if(e&&e.getAttribute("href")){var n=a.location.href,c=n.indexOf("#");t=-1===c?n:n.slice(0,c)}return t}()+"#"+("string"==typeof e?e:m(e))}function C(e,t){return void 0===t&&(t=null),r((0,c.Z)({pathname:y.pathname,hash:"",search:""},"string"==typeof e?h(e):e,{state:t,key:u()}))}function R(e,t){return[{usr:e.state,key:e.key,idx:t},w(e)]}function j(e,t,a){return!_.length||(_.call({action:e,location:t,retry:a}),!1)}function S(e){E=e;var t=g();b=t[0],y=t[1],Z.call({action:E,location:y})}function N(e){l.go(e)}null==b&&(b=0,l.replaceState((0,c.Z)({},l.state,{idx:b}),""));var P={get action(){return E},get location(){return y},createHref:w,push:function e(t,c){var r=n.Push,s=C(t,c);if(j(r,s,(function(){e(t,c)}))){var i=R(s,b+1),o=i[0],p=i[1];try{l.pushState(o,"",p)}catch(e){a.location.assign(p)}S(r)}},replace:function e(t,a){var c=n.Replace,r=C(t,a);if(j(c,r,(function(){e(t,a)}))){var s=R(r,b),i=s[0],o=s[1];l.replaceState(i,"",o),S(c)}},go:N,back:function(){N(-1)},forward:function(){N(1)},listen:function(e){return Z.push(e)},block:function(e){var t=_.push(e);return 1===_.length&&a.addEventListener(s,p),function(){t(),_.length||a.removeEventListener(s,p)}}};return P}function p(e){e.preventDefault(),e.returnValue=""}function d(){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 u(){return Math.random().toString(36).substr(2,8)}function m(e){var t=e.pathname,a=void 0===t?"/":t,n=e.search,c=void 0===n?"":n,r=e.hash,s=void 0===r?"":r;return c&&"?"!==c&&(a+="?"===c.charAt(0)?c:"?"+c),s&&"#"!==s&&(a+="#"===s.charAt(0)?s:"#"+s),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 n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}},7329:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={wrapper:"GqFcAwJvIrg1v7f6QUfw",header:"OENx8kmm62tkWGukzP2S",title:"KnqJLKwSceJTwFJrPGHq","close-button":"PJU0_yA9jNf7ao0jhHut",footer:"rrORM3zqHfGvqiPduEXY",steps:"Q7fUcDUGhteXEr18rZPC","action-button":"S5LAeskUiEQ0JlPhr0Ze"}},1494:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"admin-page":"sexr0jUxC1jVixdKiDnC",background:"vKQ11sLeAM45M04P1ccj"}},281:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"section-hero":"vMa4i_Dza2t5Zi_Bw9Nf"}},3466:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},1489:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={cut:"msOlyh2T7D6uhbM6AROg",icon:"cPN7USVqSBpxUswfDtUZ",cta:"EmnJAyEzzn1QpA8HtypY",iconContainer:"vV7YZikAz0oHYsuvtxMq",description:"T1YaMupeZmBIpXZHY9EZ"}},5785:()=>{},1275:()=>{},5612:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},9054:()=>{},3247:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)"}},3080:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},8730:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",container:"SqdhUZkXCRuIpErj1B3z",fluid:"OZC_9a1LhpWF9dv15Gdh"}},7703:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},9929:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},9184:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},1683:()=>{},514:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={status:"bZ4b33s2MdcOjaDKBbeV",status__indicator:"UzkzDaqt2mXprJh2OXRz",status__label:"QuS0vdcr87FsiBvSSrvA","is-active":"bGx0wbQAwuY7k8P3PHVQ","is-inactive":"wR8Cz8uHgObTQavolv5y","is-error":"IzbBYGwBKhSYFUQlIMww","is-action":"Kdvp_HJf89IBrZuCaLm8","is-initializing":"hVf5vsbBWm8OFye7cy7a"}},7920:()=>{},3280:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},3591:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={global:"_fUXxnSp5pagKBp9gSN7"}},9836:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={heading:"urouayitSUT8zW0V3p_0",notice:"iXXJlk08gFDeCvsTTlNQ",button:"MWqRqr7q6fgvLxitcWYk","bigger-than-medium":"YLcXAoc82nypTPaKSAcd",error:"e6hHy8BZ7ZKPSXbIC0UG",message:"jXz8LnXNzMDdtHqkG0sZ"}},3900:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={navigation:"vvXnRXxrU1kP1KsdSr4J",badge:"aDCTkUFaJEeZzYYE6qv5"}},9993:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={container:"EU0Rvu4PDqVtnCAmbgHg"}},4424:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={loading:"kdsaL7c4bpTwf_A4fIUT",loading__message:"b0eN3as5AgxQW7EAkarg"}},3064:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={footer:"_Wc3apZobag_9Ag_THTb"}},9137:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"diff-viewer":"LumryWNddoF092fZgN2O","diff-viewer__filename":"NFMwU3H5k2qArZe2TTp9","diff-viewer__file":"G5W9M8qfo3sGl2OIbwg9","diff-viewer__line-numbers":"Bx4RDCUR316fm_jgGS8N","diff-viewer__lines":"GhN0JvAyRQI3SnVWp2Ot"}},3932:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"footer-checkbox":"uQlXhcfYn9tbnK27_Gct","standalone-mode-section":"e5YHJiYcvfgdEEJsS_YM","share-data-section":"PO9zDOaSkcv_RqpfZF_v"}},8452:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={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"}},4854:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={container:"DM4b8iQ0ewvRYdIPxvZ8","toggle-section":"bW6ZuNzJBYU5PVPktE2S","toggle-section__control":"di3wjXHrX1rk_H6rlxKM","toggle-section__content":"IrzHnNkRvORtyCL0yiWa","toggle-section__title":"sU82bpLEYPC9n_CFAKoz","toggle-section--disabled":"ZZc0LldcbJpcftqCe43T","toggle-section__details":"T17WOOJI7XHN7KRmYaCe","automatic-rules-stats":"typbjN2keZ97hj2TmuMC","automatic-rules-stats__version":"UUXAN8VTAZY0h8t9rCHG","automatic-rules-stats__last-updated":"eFjcadLMEXY5O61vsTrx","automatic-rules-stats__failed-install":"Tr5uYvclUiwlC5kuGk7E","manual-rules-stats":"zPZcNgYx2X5778nHHtlH","manual-rules-stats__no-rules":"lNtkRXnB1z_kYB28MUWq","manual-rules-stats__block-list-count":"JgH5ykcLynEgqXYurT78","manual-rules-stats__allow-list-count":"xlWW0IoKZwTZt1Ti0tcQ","upgrade-trigger-section":"zhBcgCUGgyC7PvWk8ewB","manual-rules-section":"mah_f2OWxZ3Vqt_jRFdR","brute-force-rules-section":"pRMFiIODonlw4XMdNHaU","go-back-button":"Ax2SmW57c0U5xOTjZuAA",badge:"xGZeYQr0_nPJTFmd8pW4",popover:"RYTIt8kwLbKcUbWOfG4g",popover__header:"BqXge2rIUP0a_74yvYbr",popover__button:"Lr10UUCcSLF3T_0QqoPr",popover__footer:"th_VukMuODIOVLC7oJo6",status:"Gxtap1Zcl5X5UEHfSdQ4",active:"dSfmCVUK_Ez7sxdqOIdy","current-ip-text":"e6JXg_theht0XwCBgqdA"}},5823:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={list:"sQkG5Cu80gPaeFj3L_wa",footer:"oIl6GCMeUnzE0inXbuj9"}},7279:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={list:"RP2MVoGqaCFXPKZhhxQ1",footer:"YpEs8b7KE7fzVuXUbOEb"}},1234:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"form-toggle":"IunwKwdvL271DxBIniPb","form-toggle__switch":"svA9WxEcOByd5S2fZonA","is-compact":"wOd7DeP76v1fczKfah5n"}},9122:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={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"}},6983:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={threat:"EqpwvErHtRi_WQkJKgi1",threat__icon:"EicvN1QaJu5OJLzdUN5A",threat__summary:"b7ynAmUwGlxK_vxyIN0y",threat__summary__label:"uSV9HYRxjL4S6zIZDlqP",threat__summary__title:"XpW8Mvw_XFEbqxUdw155",threat__severity:"Fkj60BmQ5sUo9zHcJwVv",footer:"XLzPr74ad3osCq9kxy2q"}},2951:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"protect-header":"UL3B1tQ854mN7r6taB61","get-started-button":"IG56Hw7ZR_7rKVsM78qw"}},8735:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"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"}},9980:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={modal:"WtVEv641JBaLl929sZq2",modal__window:"G0aPt7WmA1rkUE0wcTno",modal__close:"VkrhWjfEIlIwYEumycbP",modal__close__icon:"yFzeV4cmWRbZKk5tIyEw"}},513:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={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"}},8212:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={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"}},7324:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={accordion:"sfXsfklfkeSRtE9ivQwF","accordion-item":"ozRrKPlj1QFGUyd3oVke","accordion-header":"PyvnSHQuuUkZvVsArigy","accordion-header-label":"u9Xod5s8bCRNj9MR1Drl","accordion-header-label-icon":"IbeyulkpO9kjYJ4OkYUD","accordion-header-description":"KiCgmjHm2f0JDU3cMsgf","accordion-header-button":"kJ8t3FAtd5VAYjk31SfA","accordion-body":"JP0IJZcYRohfgntEozjm","accordion-body-close":"y7c6zi2wjEnbW3F29fmP","accordion-body-open":"wQWiN_J0SqgduvadyGnm","icon-check":"v1fUFCBPmd6miSCf_ehK"}},6067:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"progress-bar":"vzMlFr1AXWqefpRrb976","progress-bar__wrapper":"gYSOMa4xxLXmsNzvFPkW","progress-bar__bar":"hNJWdt5qmZkWYAH_vjIp","progress-bar__percent":"DHMUfGyHbl5BgD5vjxVz"}},8383:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"product-section":"Clxt94RgGnDrhORZZyPr","info-section":"K2OG1vK5PSOYDWKtqKKG"}},61:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"main-content":"A6a9HOtaZnLUleNgxQrX","loading-content":"CGT5fOs6LDTFHWCAgIiT",illustration:"RFKxbzQ8N58qEyVO0yzW","connection-error-col":"SvMuuouOkDt2sE0PAn_D"}},8131:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"threat-severity-badge":"JiJhrZaThvWCpM2AfGen","is-critical":"_7SGksgOpcPbHfPPpQTV","is-high":"pGNquShR54adQ61sx3lP","is-low":"IM5kkexAfwGLM6zz0Exd"}},8911:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={mark:"jNlU3vgp4xEGwmX5aTyK",list:"gE8s4nh3f7iGIBrFeyCT"}},6561:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={summary:"ZMBDiTLzs27F012iOsMK",summary__title:"zI2DKzqRc1MhF6aq5eHt",summary__icon:"iHgPFku9KaLz8FIQV1Qw","summary__scan-button":"ctq2nQkzIfSoMkldF9t9"}},5714:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={tabs:"lyrXe0pA852TUmyekDb5",tab:"KgEeDTKgTC5ZjzYlbTqN","tab--active":"Lv4WoNVkeJntqvUyG4dX"}},8063:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={textarea:"rigH8UdiDrmmSLQMUurD",label:"V8FDM08CpcwQs4UwN2nI"}},9971:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={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"}},9709:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={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-button":"r4Id5qht2FD68jCAH2Cl","accordion-heading":"ZSZPabDoB8MVVPttP0tu","manual-scan":"iJ_biSBRDribuNKX0Zuw"}},541:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={footer:"uUEJGMrSV3XoBwX5xEwA"}},1155:()=>{},3171: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,o){o=o||{};var l=typeof e;if("string"===l&&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 o=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"weeks":case"week":case"w":return o*r;case"days":case"day":case"d":return o*c;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*a;case"seconds":case"second":case"secs":case"sec":case"s":return o*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===l&&isFinite(e))return o.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))}},469:(e,t,a)=>{"use strict";var n=a(758);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}},5162:(e,t,a)=>{e.exports=a(469)()},758:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},554:(e,t,a)=>{"use strict";a.d(t,{OL:()=>u,UT:()=>p});var n=a(9196),c=a(5250),r=a(5439);function s(){return s=Object.assign||function(e){for(var t=1;t=0||(c[a]=e[a]);return c}const o=["onClick","reloadDocument","replace","state","target","to"],l=["aria-current","caseSensitive","className","end","style","to","children"];function p(e){let{basename:t,children:a,window:s}=e,i=(0,n.useRef)();null==i.current&&(i.current=(0,c.q_)({window:s}));let o=i.current,[l,p]=(0,n.useState)({action:o.action,location:o.location});return(0,n.useLayoutEffect)((()=>o.listen(p)),[o]),(0,n.createElement)(r.F0,{basename:t,children:a,location:l.location,navigationType:l.action,navigator:o})}const d=(0,n.forwardRef)((function(e,t){let{onClick:a,reloadDocument:l,replace:p=!1,state:d,target:u,to:m}=e,h=i(e,o),g=(0,r.oQ)(m),f=function(e,t){let{target:a,replace:s,state:i}=void 0===t?{}:t,o=(0,r.s0)(),l=(0,r.TH)(),p=(0,r.WU)(e);return(0,n.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=!!s||(0,c.Ep)(l)===(0,c.Ep)(p);o(e,{replace:a,state:i})}}),[l,o,p,s,i,a,e])}(m,{replace:p,state:d,target:u});return(0,n.createElement)("a",s({},h,{href:g,onClick:function(e){a&&a(e),e.defaultPrevented||l||f(e)},ref:t,target:u}))}));const u=(0,n.forwardRef)((function(e,t){let{"aria-current":a="page",caseSensitive:c=!1,className:o="",end:p=!1,style:u,to:m,children:h}=e,g=i(e,l),f=(0,r.TH)(),v=(0,r.WU)(m),E=f.pathname,k=v.pathname;c||(E=E.toLowerCase(),k=k.toLowerCase());let b,y=E===k||!p&&E.startsWith(k)&&"/"===E.charAt(k.length),Z=y?a:void 0;b="function"==typeof o?o({isActive:y}):[o,y?"active":null].filter(Boolean).join(" ");let _="function"==typeof u?u({isActive:y}):u;return(0,n.createElement)(d,s({},g,{"aria-current":Z,className:b,ref:t,style:_,to:m}),"function"==typeof h?h({isActive:y}):h)}))},5439:(e,t,a)=>{"use strict";a.d(t,{AW:()=>l,F0:()=>p,TH:()=>h,WU:()=>f,Z5:()=>d,oQ:()=>u,s0:()=>g});var n=a(9196),c=a(5250);function r(e,t){if(!e)throw new Error(t)}const s=(0,n.createContext)(null);const i=(0,n.createContext)(null);const o=(0,n.createContext)({outlet:null,matches:[]});function l(e){r(!1)}function p(e){let{basename:t="/",children:a=null,location:o,navigationType:l=c.aU.Pop,navigator:p,static:d=!1}=e;m()&&r(!1);let u=L(t),h=(0,n.useMemo)((()=>({basename:u,navigator:p,static:d})),[u,p,d]);"string"==typeof o&&(o=(0,c.cP)(o));let{pathname:g="/",search:f="",hash:v="",state:E=null,key:k="default"}=o,b=(0,n.useMemo)((()=>{let e=x(g,u);return null==e?null:{pathname:e,search:f,hash:v,state:E,key:k}}),[u,g,f,v,E,k]);return null==b?null:(0,n.createElement)(s.Provider,{value:h},(0,n.createElement)(i.Provider,{children:a,value:{location:b,navigationType:l}}))}function d(e){let{children:t,location:a}=e;return function(e,t){m()||r(!1);let{matches:a}=(0,n.useContext)(o),s=a[a.length-1],i=s?s.params:{},l=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;0;let p,d=h();if(t){var u;let e="string"==typeof t?(0,c.cP)(t):t;"/"===l||(null==(u=e.pathname)?void 0:u.startsWith(l))||r(!1),p=e}else p=d;let g=p.pathname||"/",f="/"===l?g:g.slice(l.length)||"/",v=function(e,t,a){void 0===a&&(a="/");let n="string"==typeof t?(0,c.cP)(t):t,r=x(n.pathname||"/",a);if(null==r)return null;let s=E(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)))))}(s);let i=null;for(let e=0;null==i&&eObject.assign({},e,{params:Object.assign({},i,e.params),pathname:I([l,e.pathname]),pathnameBase:"/"===e.pathnameBase?l:I([l,e.pathnameBase])}))),a)}(v(t),a)}function u(e){m()||r(!1);let{basename:t,navigator:a}=(0,n.useContext)(s),{hash:i,pathname:o,search:l}=f(e),p=o;if("/"!==t){let a=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?(0,c.cP)(e).pathname:e.pathname}(e),n=null!=a&&a.endsWith("/");p="/"===o?t+(n?"/":""):I([t,o])}return a.createHref({pathname:p,search:l,hash:i})}function m(){return null!=(0,n.useContext)(i)}function h(){return m()||r(!1),(0,n.useContext)(i).location}function g(){m()||r(!1);let{basename:e,navigator:t}=(0,n.useContext)(s),{matches:a}=(0,n.useContext)(o),{pathname:c}=h(),i=JSON.stringify(a.map((e=>e.pathnameBase))),l=(0,n.useRef)(!1);return(0,n.useEffect)((()=>{l.current=!0})),(0,n.useCallback)((function(a,n){if(void 0===n&&(n={}),!l.current)return;if("number"==typeof a)return void t.go(a);let r=P(a,JSON.parse(i),c);"/"!==e&&(r.pathname=I([e,r.pathname])),(n.replace?t.replace:t.push)(r,n.state)}),[e,t,i,c])}function f(e){let{matches:t}=(0,n.useContext)(o),{pathname:a}=h(),c=JSON.stringify(t.map((e=>e.pathnameBase)));return(0,n.useMemo)((()=>P(e,JSON.parse(c),a)),[e,c,a])}function v(e){let t=[];return n.Children.forEach(e,(e=>{if(!(0,n.isValidElement)(e))return;if(e.type===n.Fragment)return void t.push.apply(t,v(e.props.children));e.type!==l&&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=v(e.props.children)),t.push(a)})),t}function E(e,t,a,n){return void 0===t&&(t=[]),void 0===a&&(a=[]),void 0===n&&(n=""),e.forEach(((e,c)=>{let s={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:c,route:e};s.relativePath.startsWith("/")&&(s.relativePath.startsWith(n)||r(!1),s.relativePath=s.relativePath.slice(n.length));let i=I([n,s.relativePath]),o=a.concat(s);e.children&&e.children.length>0&&(!0===e.index&&r(!1),E(e.children,t,o,i)),(null!=e.path||e.index)&&t.push({path:i,score:R(i,e.index),routesMeta:o})})),t}const k=/^:\w+$/,b=3,y=2,Z=1,_=10,w=-2,C=e=>"*"===e;function R(e,t){let a=e.split("/"),n=a.length;return a.some(C)&&(n+=w),t&&(n+=y),a.filter((e=>!C(e))).reduce(((e,t)=>e+(k.test(t)?b:""===t?Z:_)),n)}function j(e,t){let{routesMeta:a}=e,n={},c="/",r=[];for(let e=0;e(0,n.createElement)(o.Provider,{children:void 0!==c.route.element?c.route.element:a,value:{outlet:a,matches:t.concat(e.slice(0,r+1))}})),null)}function N(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,n]=function(e,t,a){void 0===t&&(t=!1);void 0===a&&(a=!0);let n=[],c="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(n.push(t),"([^\\/]+)")));e.endsWith("*")?(n.push("*"),c+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):c+=a?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)";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(t){return e}}(i[a]||""),e}),{}),pathname:r,pathnameBase:s,pattern:e}}function P(e,t,a){let n,r="string"==typeof e?(0,c.cP)(e):e,s=""===e||""===r.pathname?"/":r.pathname;if(null==s)n=a;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}n=e>=0?t[e]:"/"}let i=function(e,t){void 0===t&&(t="/");let{pathname:a,search:n="",hash:r=""}="string"==typeof e?(0,c.cP)(e):e,s=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:s,search:M(n),hash:T(r)}}(r,n);return s&&"/"!==s&&s.endsWith("/")&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i}function x(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 I=e=>e.join("/").replace(/\/\/+/g,"/"),L=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),M=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",T=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},6975:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(951);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"])}},o=i},4743:(e,t,a)=>{"use strict";a.d(t,{ZP:()=>d});var n=a(1132),c=a(6483);function r(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const s=r("JsonParseError"),i=r("JsonParseAfterRedirectError"),o=r("Api404Error"),l=r("Api404AfterRedirectError"),p=r("FetchNetworkError");const d=new function(e,t){let a=e,r=e,s={"X-WP-Nonce":t},i={credentials:"same-origin",headers:s},o={method:"post",credentials:"same-origin",headers:Object.assign({},s,{"Content-type":"application/json"})},l=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 p={setApiRoot(e){a=e},setWpcomOriginApiUrl(e){r=e},setApiNonce(e){s={"X-WP-Nonce":e},i={credentials:"same-origin",headers:s},o={method:"post",credentials:"same-origin",headers:Object.assign({},s,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=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`,o,{body:JSON.stringify(r)}).then(u).then(m)},fetchAuthorizationUrl:e=>d((0,c.addQueryArgs)(`${a}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),i).then(u).then(m),fetchSiteConnectionData:()=>d(`${a}jetpack/v4/connection/data`,i).then(m),fetchSiteConnectionStatus:()=>d(`${a}jetpack/v4/connection`,i).then(m),fetchSiteConnectionTest:()=>d(`${a}jetpack/v4/connection/test`,i).then(u).then(m),fetchUserConnectionData:()=>d(`${a}jetpack/v4/connection/data`,i).then(m),fetchUserTrackingSettings:()=>d(`${a}jetpack/v4/tracking/settings`,i).then(u).then(m),updateUserTrackingSettings:e=>h(`${a}jetpack/v4/tracking/settings`,o,{body:JSON.stringify(e)}).then(u).then(m),disconnectSite:()=>h(`${a}jetpack/v4/connection`,o,{body:JSON.stringify({isActive:!1})}).then(u).then(m),fetchConnectUrl:()=>d(`${a}jetpack/v4/connection/url`,i).then(u).then(m),unlinkUser:()=>h(`${a}jetpack/v4/connection/user`,o,{body:JSON.stringify({linked:!1})}).then(u).then(m),reconnect:()=>h(`${a}jetpack/v4/connection/reconnect`,o).then(u).then(m),fetchConnectedPlugins:()=>d(`${a}jetpack/v4/connection/plugins`,i).then(u).then(m),setHasSeenWCConnectionModal:()=>h(`${a}jetpack/v4/seen-wc-connection-modal`,o).then(u).then(m),fetchModules:()=>d(`${a}jetpack/v4/module/all`,i).then(u).then(m),fetchModule:e=>d(`${a}jetpack/v4/module/${e}`,i).then(u).then(m),activateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,o,{body:JSON.stringify({active:!0})}).then(u).then(m),deactivateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,o,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${a}jetpack/v4/module/${e}`,o,{body:JSON.stringify(t)}).then(u).then(m),updateSettings:e=>h(`${a}jetpack/v4/settings`,o,{body:JSON.stringify(e)}).then(u).then(m),getProtectCount:()=>d(`${a}jetpack/v4/module/protect/data`,i).then(u).then(m),resetOptions:e=>h(`${a}jetpack/v4/options/${e}`,o,{body:JSON.stringify({reset:!0})}).then(u).then(m),activateVaultPress:()=>h(`${a}jetpack/v4/plugins`,o,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(u).then(m),getVaultPressData:()=>d(`${a}jetpack/v4/module/vaultpress/data`,i).then(u).then(m),installPlugin:(e,t)=>{const n={slug:e,status:"active"};return t&&(n.source=t),h(`${a}jetpack/v4/plugins`,o,{body:JSON.stringify(n)}).then(u).then(m)},activateAkismet:()=>h(`${a}jetpack/v4/plugins`,o,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(u).then(m),getAkismetData:()=>d(`${a}jetpack/v4/module/akismet/data`,i).then(u).then(m),checkAkismetKey:()=>d(`${a}jetpack/v4/module/akismet/key/check`,i).then(u).then(m),checkAkismetKeyTyped:e=>h(`${a}jetpack/v4/module/akismet/key/check`,o,{body:JSON.stringify({api_key:e})}).then(u).then(m),fetchStatsData:e=>d(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(u).then(m).then(f),getPluginUpdates:()=>d(`${a}jetpack/v4/updates/plugins`,i).then(u).then(m),getPlans:()=>d(`${a}jetpack/v4/plans`,i).then(u).then(m),fetchSettings:()=>d(`${a}jetpack/v4/settings`,i).then(u).then(m),updateSetting:e=>h(`${a}jetpack/v4/settings`,o,{body:JSON.stringify(e)}).then(u).then(m),fetchSiteData:()=>d(`${a}jetpack/v4/site`,i).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>d(`${a}jetpack/v4/site/features`,i).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>d(`${a}jetpack/v4/site/products`,i).then(u).then(m),fetchSitePurchases:()=>d(`${a}jetpack/v4/site/purchases`,i).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>d(`${a}jetpack/v4/site/benefits`,i).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>d(`${a}jetpack/v4/site/discount`,i).then(u).then(m).then((e=>e.data)),fetchSetupQuestionnaire:()=>d(`${a}jetpack/v4/setup/questionnaire`,i).then(u).then(m),fetchRecommendationsData:()=>d(`${a}jetpack/v4/recommendations/data`,i).then(u).then(m),fetchRecommendationsProductSuggestions:()=>d(`${a}jetpack/v4/recommendations/product-suggestions`,i).then(u).then(m),fetchRecommendationsUpsell:()=>d(`${a}jetpack/v4/recommendations/upsell`,i).then(u).then(m),fetchRecommendationsConditional:()=>d(`${a}jetpack/v4/recommendations/conditional`,i).then(u).then(m),saveRecommendationsData:e=>h(`${a}jetpack/v4/recommendations/data`,o,{body:JSON.stringify({data:e})}).then(u),fetchProducts:()=>d(`${a}jetpack/v4/products`,i).then(u).then(m),fetchRewindStatus:()=>d(`${a}jetpack/v4/rewind`,i).then(u).then(m).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>d(`${a}jetpack/v4/scan`,i).then(u).then(m).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${a}jetpack/v4/notice/${e}`,o,{body:JSON.stringify({dismissed:!0})}).then(u).then(m),fetchPluginsData:()=>d(`${a}jetpack/v4/plugins`,i).then(u).then(m),fetchIntroOffers:()=>d(`${a}jetpack/v4/intro-offers`,i).then(u).then(m),fetchVerifySiteGoogleStatus:e=>d(null!==e?`${a}jetpack/v4/verify-site/google/${e}`:`${a}jetpack/v4/verify-site/google`,i).then(u).then(m),verifySiteGoogle:e=>h(`${a}jetpack/v4/verify-site/google`,o,{body:JSON.stringify({keyring_id:e})}).then(u).then(m),submitSurvey:e=>h(`${a}jetpack/v4/marketing/survey`,o,{body:JSON.stringify(e)}).then(u).then(m),saveSetupQuestionnaire:e=>h(`${a}jetpack/v4/setup/questionnaire`,o,{body:JSON.stringify(e)}).then(u).then(m),updateLicensingError:e=>h(`${a}jetpack/v4/licensing/error`,o,{body:JSON.stringify(e)}).then(u).then(m),updateLicenseKey:e=>h(`${a}jetpack/v4/licensing/set-license`,o,{body:JSON.stringify({license:e})}).then(u).then(m),getUserLicensesCounts:()=>d(`${a}jetpack/v4/licensing/user/counts`,i).then(u).then(m),getUserLicenses:()=>d(`${a}jetpack/v4/licensing/user/licenses`,i).then(u).then(m),updateLicensingActivationNoticeDismiss:e=>h(`${a}jetpack/v4/licensing/user/activation-notice-dismiss`,o,{body:JSON.stringify({last_detached_count:e})}).then(u).then(m),updateRecommendationsStep:e=>h(`${a}jetpack/v4/recommendations/step`,o,{body:JSON.stringify({step:e})}).then(u),confirmIDCSafeMode:()=>h(`${a}jetpack/v4/identity-crisis/confirm-safe-mode`,o).then(u),startIDCFresh:e=>h(`${a}jetpack/v4/identity-crisis/start-fresh`,o,{body:JSON.stringify({redirect_uri:e})}).then(u).then(m),migrateIDC:()=>h(`${a}jetpack/v4/identity-crisis/migrate`,o).then(u),attachLicenses:e=>h(`${a}jetpack/v4/licensing/attach-licenses`,o,{body:JSON.stringify({licenses:e})}).then(u).then(m),fetchSearchPlanInfo:()=>d(`${r}jetpack/v4/search/plan`,i).then(u).then(m),fetchSearchSettings:()=>d(`${r}jetpack/v4/search/settings`,i).then(u).then(m),updateSearchSettings:e=>h(`${r}jetpack/v4/search/settings`,o,{body:JSON.stringify(e)}).then(u).then(m),fetchSearchStats:()=>d(`${r}jetpack/v4/search/stats`,i).then(u).then(m),fetchWafSettings:()=>d(`${a}jetpack/v4/waf`,i).then(u).then(m),updateWafSettings:e=>h(`${a}jetpack/v4/waf`,o,{body:JSON.stringify(e)}).then(u).then(m),fetchWordAdsSettings:()=>d(`${a}jetpack/v4/wordads/settings`,i).then(u).then(m),updateWordAdsSettings:e=>h(`${a}jetpack/v4/wordads/settings`,o,{body:JSON.stringify(e)}),fetchSearchPricing:()=>d(`${r}jetpack/v4/search/pricing`,i).then(u).then(m),fetchMigrationStatus:()=>d(`${a}jetpack/v4/migration/status`,i).then(u).then(m),fetchBackupUndoEvent:()=>d(`${a}jetpack/v4/site/backup/undo-event`,i).then(u).then(m),fetchBackupPreflightStatus:()=>d(`${a}jetpack/v4/site/backup/preflight`,i).then(u).then(m)};function d(e,t){return fetch(l(e),t)}function h(e,t,a){return fetch(e,Object.assign({},t,a)).catch(g)}function f(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,p)};function u(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new o})):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 m(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 p}},4471:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5609),c=a(5736),r=a(9517),s=a(526),i=a(2054),o=a(5106),l=a(8275),p=a(7329);const __=c.__,d=({hideCloseButton:e=!1,title:t,children:a,step:d=null,totalSteps:u=null,buttonContent:m=null,buttonDisabled:h=!1,buttonHref:g=null,buttonExternalLink:f=!1,offset:v=32,onClose:E,onClick:k,...b})=>{const[y]=(0,i.Z)("sm");if(!t||!a||!m)return null;b.position||(b.position=y?"top center":"middle right");const Z={...b,offset:v,onClose:E},_=Number.isFinite(d)&&Number.isFinite(u);let w=null;return _&&(w=(0,c.sprintf)(/* translators: 1 Current step, 2 Total steps */ -__("%1$d of %2$d","jetpack-protect"),d,u)),React.createElement(n.Popover,Z,React.createElement(l.ZP,null,React.createElement("div",{className:p.Z.wrapper},React.createElement("div",{className:p.Z.header},React.createElement(o.ZP,{variant:"title-small",className:p.Z.title},t),!e&&React.createElement(React.Fragment,null,React.createElement(s.Z,{size:"small",variant:"tertiary","aria-label":"close",className:p.Z["close-button"],icon:r.Z,iconSize:16,onClick:E}))),a,React.createElement("div",{className:p.Z.footer},_&&React.createElement(o.ZP,{variant:"body",className:p.Z.steps},w),React.createElement(s.Z,{variant:"primary",className:p.Z["action-button"],disabled:h,onClick:k,isExternalLink:f,href:g},m)))))}},9105:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5736),c=a(5235),r=a.n(c),s=a(8237),i=a(8868),o=a(3846),l=a(3363),p=a(1494);const __=n.__,d=({children:e,moduleName:t=__("Jetpack","jetpack-protect"),moduleNameHref:a,showHeader:n=!0,showFooter:c=!0,showBackground:d=!0,header:u})=>{const m=r()(p.Z["admin-page"],{[p.Z.background]:d});return React.createElement("div",{className:m},n&&React.createElement(l.Z,{horizontalSpacing:5},React.createElement(o.Z,null,u||React.createElement(i.Z,null))),React.createElement(l.Z,{fluid:!0,horizontalSpacing:0},React.createElement(o.Z,null,e)),c&&React.createElement(l.Z,{horizontalSpacing:5},React.createElement(o.Z,null,React.createElement(s.Z,{moduleName:t,moduleNameHref:a}))))}},216:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9196),c=a.n(n),r=a(281);const s=({children:e})=>c().createElement("div",{className:r.Z["section-hero"]},e)},7525:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(2674),c=a.n(n),r=a(5736),s=a(5235),i=a.n(s),o=a(9196),l=a.n(o);const __=r.__,p=({title:e=__("An Automattic Airline","jetpack-protect"),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:i()("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"}))},526:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(2674),c=a.n(n),r=a(5609),s=a(5736),i=a(1074),o=a(5381),l=a(5235),p=a.n(l),d=a(9196),u=a.n(d),m=a(3466);const __=s.__,h=(0,d.forwardRef)(((e,t)=>{const{children:a,variant:n="primary",size:s="normal",weight:l="bold",icon:d,iconSize:h,disabled:g,isDestructive:f,isLoading:v,isExternalLink:E,className:k,text:b,fullWidth:y,...Z}=e,_=p()(m.Z.button,k,{[m.Z.normal]:"normal"===s,[m.Z.small]:"small"===s,[m.Z.icon]:Boolean(d),[m.Z.loading]:v,[m.Z.regular]:"regular"===l,[m.Z["full-width"]]:y,[m.Z["is-icon-button"]]:Boolean(d)&&!a});Z.ref=t;const w="normal"===s?20:16,C=E&&u().createElement(u().Fragment,null,u().createElement(i.Z,{size:w,icon:o.Z,className:m.Z["external-icon"]}),u().createElement(r.VisuallyHidden,{as:"span"},/* translators: accessibility text */ -__("(opens in a new tab)","jetpack-protect"))),R=E?"_blank":void 0,j=a?.[0]&&null!==a[0]&&"components-tooltip"!==a?.[0]?.props?.className;return u().createElement(r.Button,c()({target:R,variant:n,className:p()(_,{"has-text":!!d&&j}),icon:E?void 0:d,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:f,text:b},Z),v&&u().createElement(r.Spinner,null),u().createElement("span",null,a),C)}));h.displayName="Button";const g=h},857:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(1074),c=a(495),r=a(5235),s=a.n(r),i=a(9665),o=a(5106),l=a(1489);const p=({description:e,cta:t,onClick:a,href:r,openInNewTab:p=!1,className:d,tooltipText:u=""})=>{const m=void 0!==r?"a":"button",h="a"===m?{href:r,...p&&{target:"_blank"}}:{onClick:a};return React.createElement("div",{className:s()(l.Z.cut,d)},React.createElement("div",null,React.createElement("div",null,React.createElement(o.ZP,{className:l.Z.description},e),u&&React.createElement(i.Z,{className:l.Z.iconContainer,iconSize:16,offset:4},React.createElement(o.ZP,{variant:"body-small"},u))),React.createElement("div",null,React.createElement(m,h,React.createElement(o.ZP,{className:l.Z.cta},t)))),React.createElement(n.Z,{icon:c.Z,className:l.Z.icon,size:30}))}},7172:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(5235),r=a.n(c),s=a(9196);a(5785);const __=n.__;class i extends s.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,n=this.props.width||e,c=this.props.style||{height:a,width:n},s="gridicons-"+this.props.icon,i=r()("gridicon",s,t,{"needs-offset":this.needsOffset(s,e)}),o=this.getSVGDescription(s);return React.createElement("svg",{className:i,focusable:this.props.focusable,height:a,onClick:this.props.onClick,style:c,viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg","aria-hidden":this.props["aria-hidden"]},o?React.createElement("desc",null,o):null,this.renderIcon(s))}}const o=i},9665:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5609),c=a(5235),r=a.n(c),s=a(9196),i=a.n(s),o=a(526),l=a(7172);a(1275);const p=e=>({"top-end":"top left",top:"top center","top-start":"top right","bottom-end":"bottom left",bottom:"bottom center","bottom-start":"bottom right"}[e]),d=({className:e="",iconClassName:t="",placement:a="bottom-end",animate:c=!0,iconCode:d="info-outline",iconSize:u=18,offset:m=10,title:h,children:g,popoverAnchorStyle:f="icon",forceShow:v=!1,wide:E=!1,inline:k=!0,shift:b=!1})=>{const[y,Z]=(0,s.useState)(!1),_=(0,s.useCallback)((()=>Z(!1)),[Z]),w=(0,s.useCallback)((e=>{e.preventDefault(),Z(!y)}),[y,Z]),C={position:p(a),placement:a,animate:c,noArrow:!1,resize:!1,flip:!1,offset:m,focusOnMount:"container",onClose:_,className:"icon-tooltip-container",inline:k,shift:b},R="wrapper"===f,j=r()("icon-tooltip-wrapper",e),S={left:R?0:-(62-u/2)+"px"},N=R&&v;return i().createElement("div",{className:j,"data-testid":"icon-tooltip_wrapper"},!R&&i().createElement(o.Z,{variant:"link",onMouseDown:w},i().createElement(l.Z,{className:t,icon:d,size:u})),i().createElement("div",{className:r()("icon-tooltip-helper",{"is-wide":E}),style:S},(N||y)&&i().createElement(n.Popover,C,i().createElement("div",null,h&&i().createElement("div",{className:"icon-tooltip-title"},h),i().createElement("div",{className:"icon-tooltip-content"},g)))))}},3396:(e,t,a)=>{"use strict";a.d(t,{VS:()=>d});var n=a(2674),c=a.n(n),r=a(5609),s=a(5235),i=a.n(s),o=(a(4311),a(5612));const l=({className:e,size:t=24,viewBox:a="0 0 24 24",opacity:n=1,color:s="#2C3338",children:l})=>{const p={className:i()(o.Z.iconWrapper,e),width:t,height:t,viewBox:a,opacity:n,fill:void 0};return s&&(p.fill=s),React.createElement(r.SVG,c()({},p,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg"}),React.createElement(r.G,{opacity:n},l))},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:({size:e,className:t=o.Z["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"})),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:({size:e,className:t=o.Z.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"})),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:({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"}))}};function d(e){return p[e]?p[e]:null}},8237:(e,t,a)=>{"use strict";a.d(t,{Z:()=>y});var n=a(2674),c=a.n(n),r=a(9818),s=a(5736),i=a(1074),o=a(5381),l=a(5235),p=a.n(l),d=a(9196),u=a.n(d),m=a(6895),h=a(428),g=a(2497),f=a(7525),v=(a(9054),a(8868)),E=a(2054);const __=s.__,_x=s._x,k=()=>u().createElement(v.Z,{logoColor:"#000",showText:!1,height:16,"aria-hidden":"true"}),b=()=>u().createElement(u().Fragment,null,u().createElement(i.Z,{icon:o.Z,size:16}),u().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:n,onAboutClick:s,onPrivacyClick:i,onTermsClick:o,...l})=>{const[d]=(0,E.Z)("sm","<="),[v]=(0,E.Z)("md","<="),[y]=(0,E.Z)("lg",">"),{isActive:Z,connectedPlugins:_}=(0,r.useSelect)((e=>{const t=e(h.t);return{connectedPlugins:t?.getConnectedPlugins(),...t.getConnectionStatus()}}),[h.t]),w=(0,g.Z)(),C=w&&Z&&_?.some((({slug:e})=>"jetpack"===e));let R=[{label:_x("About","Link to learn more about Jetpack.","jetpack-protect"),title:__("About Jetpack","jetpack-protect"),href:C?new URL("admin.php?page=jetpack_about",w).href:(0,m.Z)("jetpack-about"),target:C?"_self":"_blank",onClick:s},{label:_x("Privacy","Shorthand for Privacy Policy.","jetpack-protect"),title:__("Automattic's Privacy Policy","jetpack-protect"),href:C?new URL("admin.php?page=jetpack#/privacy",w).href:(0,m.Z)("a8c-privacy"),target:C?"_self":"_blank",onClick:i},{label:_x("Terms","Shorthand for Terms of Service.","jetpack-protect"),title:__("WordPress.com Terms of Service","jetpack-protect"),href:(0,m.Z)("wpcom-tos"),target:"_blank",onClick:o}];n&&(R=[...R,...n]);const j=u().createElement(u().Fragment,null,u().createElement(k,null),e);return u().createElement("footer",c()({className:p()("jp-dashboard-footer",{"is-sm":d,"is-md":v,"is-lg":y},t),"aria-label":__("Jetpack","jetpack-protect")},l),u().createElement("ul",null,u().createElement("li",{className:"jp-dashboard-footer__jp-item"},a?u().createElement("a",{href:a},j):j),R.map((e=>{const t="button"===e.role,a=!t&&"_blank"===e.target;return u().createElement("li",{key:e.label},u().createElement("a",{href:e.href,title:e.title,target:e.target,onClick:e.onClick,onKeyDown:e.onKeyDown,className:p()("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&&u().createElement(b,null)))})),u().createElement("li",{className:"jp-dashboard-footer__a8c-item"},u().createElement("a",{href:C?new URL("admin.php?page=jetpack_about",w).href:(0,m.Z)("a8c-about"),"aria-label":__("An Automattic Airline","jetpack-protect")},u().createElement(f.Z,{"aria-hidden":"true"})))))}},8868:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(2674),c=a.n(n),r=a(5736),s=a(5235),i=a.n(s),o=a(9196),l=a.n(o);const __=r.__,p=({logoColor:e="#069e08",showText:t=!0,className:a,height:n=32,...r})=>{const s=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:s,className:i()("jetpack-logo",a),"aria-labelledby":"jetpack-logo-title",height:n},r,{role:"img"}),l().createElement("title",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-protect")),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"})))}},3846:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(5235),c=a.n(n),r=a(9196),s=a(3080);const i=Number(s.Z.smCols),o=Number(s.Z.mdCols),l=Number(s.Z.lgCols),p=e=>{const{children:t,tagName:a="div",className:n}=e,p=Math.min(i,"number"==typeof e.sm?e.sm:i),d=Math.min(i,"object"==typeof e.sm?e.sm.start:0),u=Math.min(i,"object"==typeof e.sm?e.sm.end:0),m=Math.min(o,"number"==typeof e.md?e.md:o),h=Math.min(o,"object"==typeof e.md?e.md.start:0),g=Math.min(o,"object"==typeof e.md?e.md.end:0),f=Math.min(l,"number"==typeof e.lg?e.lg:l),v=Math.min(l,"object"==typeof e.lg?e.lg.start:0),E=Math.min(l,"object"==typeof e.lg?e.lg.end:0),k=c()(n,{[s.Z[`col-sm-${p}`]]:!(d&&u),[s.Z[`col-sm-${d}-start`]]:d>0,[s.Z[`col-sm-${u}-end`]]:u>0,[s.Z[`col-md-${m}`]]:!(h&&g),[s.Z[`col-md-${h}-start`]]:h>0,[s.Z[`col-md-${g}-end`]]:g>0,[s.Z[`col-lg-${f}`]]:!(v&&E),[s.Z[`col-lg-${v}-start`]]:v>0,[s.Z[`col-lg-${E}-end`]]:E>0});return(0,r.createElement)(a,{className:k},t)}},3363:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5235),c=a.n(n),r=a(9196),s=a(8730);const i=({children:e,fluid:t=!1,tagName:a="div",className:n,horizontalGap:i=1,horizontalSpacing:o=1})=>{const l=(0,r.useMemo)((()=>{const e=`calc( var(--horizontal-spacing) * ${o} )`;return{paddingTop:e,paddingBottom:e,rowGap:`calc( var(--horizontal-spacing) * ${i} )`}}),[i,o]),p=c()(n,s.Z.container,{[s.Z.fluid]:t});return(0,r.createElement)(a,{className:p,style:l},e)}},2054:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(4333),c=a(3247);const r=["sm","md","lg"],s=(e,t)=>{const a=Array.isArray(e)?e:[e],s=Array.isArray(t)?t:[t],[i,o,l]=r,p={sm:(0,n.useMediaQuery)(c.Z[i]),md:(0,n.useMediaQuery)(c.Z[o]),lg:(0,n.useMediaQuery)(c.Z[l])};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,p):p[e]}))}},1342:(e,t,a)=>{"use strict";a.d(t,{Z:()=>h});var n=a(797),c=a(496),r=a(9201),s=a(1074),i=a(9517),o=a(5235),l=a.n(o),p=a(9196),d=a.n(p),u=a(7703);const m=e=>{switch(e){case"error":case"warning":default:return n.Z;case"info":return c.Z;case"success":return r.Z}},h=({level:e="info",title:t,children:a,actions:n,hideCloseButton:c=!1,onClose:r})=>{const o=l()(u.Z.container,u.Z[`is-${e}`]);return d().createElement("div",{className:o},d().createElement("div",{className:u.Z["icon-wrapper"]},d().createElement(s.Z,{icon:m(e),className:u.Z.icon})),d().createElement("div",{className:u.Z["main-content"]},t&&d().createElement("div",{className:u.Z.title},t),a,n&&n.length>0&&d().createElement("div",{className:u.Z["action-bar"]},n.map(((e,t)=>d().createElement("div",{key:t,className:u.Z.action},e))))),!c&&d().createElement("button",{"aria-label":"close",className:u.Z["close-button"],onClick:r},d().createElement(s.Z,{icon:i.Z})))}},9608:(e,t,a)=>{"use strict";a.d(t,{NE:()=>y,ZP:()=>_,kF:()=>b,oK:()=>Z});var n=a(5736),c=a(1074),r=a(9201),s=a(6163),i=a(5235),o=a.n(i),l=a(9196),p=a.n(l),d=a(9665),u=a(2054),m=a(7325),h=a(5106),g=a(9929);const __=n.__,f=__("Included","jetpack-protect"),v=__("Not included","jetpack-protect"),E=__("Coming soon","jetpack-protect"),k=(0,l.createContext)(void 0),b=({isIncluded:e=!1,isComingSoon:t=!1,index:a=0,label:i=null,tooltipInfo:m,tooltipTitle:b,tooltipClassName:y=""})=>{const[Z]=(0,u.Z)("lg"),_=(0,l.useContext)(k)[a],w=t||e,C=_.name,R=_.tooltipInfo,j=_.tooltipTitle,S=m||!Z&&R,N=((e,t,a)=>e?{lg:E, -// translators: Name of the current feature -default:(0,n.sprintf)(__("%s coming soon","jetpack-protect"),a)}:{lg:t?f:v,default:t?a:(0,n.sprintf)(/* translators: Name of the current feature */ -__("%s not included","jetpack-protect"),a)})(t,e,C),P=Z?N.lg:N.default;return p().createElement("div",{className:o()(g.Z.item,g.Z.value)},p().createElement(c.Z,{className:o()(g.Z.icon,w?g.Z["icon-check"]:g.Z["icon-cross"]),size:32,icon:w?r.Z:s.Z}),p().createElement(h.ZP,{variant:"body-small"},i||P),S&&p().createElement(d.Z,{title:b||j,iconClassName:g.Z["popover-icon"],className:o()(g.Z.popover,y),placement:"bottom-end",iconSize:14,offset:4,wide:Boolean(b&&m)},p().createElement(h.ZP,{variant:"body-small",component:"div"},m||R)))},y=({children:e})=>p().createElement("div",{className:g.Z.header},e),Z=({primary:e=!1,children:t})=>{let a=0;return p().createElement("div",{className:o()(g.Z.card,{[g.Z["is-primary"]]:e})},l.Children.map(t,(e=>{const t=e;return t.type===b?(a++,(0,l.cloneElement)(t,{index:a-1})):t})))},_=({title:e,items:t,children:a,showIntroOfferDisclaimer:n=!1})=>{const[c]=(0,u.Z)("lg");return p().createElement(k.Provider,{value:t},p().createElement("div",{className:o()(g.Z.container,{[g.Z["is-viewport-large"]]:c}),style:{"--rows":t.length+1,"--columns":l.Children.toArray(a).length+1}},p().createElement("div",{className:g.Z.table},p().createElement(h.ZP,{variant:"headline-small"},e),c&&t.map(((e,a)=>p().createElement("div",{className:o()(g.Z.item,{[g.Z["last-feature"]]:a===t.length-1}),key:a},p().createElement(h.ZP,{variant:"body-small"},p().createElement("strong",null,e.name)),e.tooltipInfo&&p().createElement(d.Z,{title:e.tooltipTitle,iconClassName:g.Z["popover-icon"],className:g.Z.popover,placement:e.tooltipPlacement?e.tooltipPlacement:"bottom-end",iconSize:14,offset:4,wide:Boolean(e.tooltipTitle&&e.tooltipInfo)},p().createElement(h.ZP,{variant:"body-small"},e.tooltipInfo))))),a)),p().createElement("div",{className:g.Z["tos-container"]},p().createElement("div",{className:g.Z.tos},n&&p().createElement(h.ZP,{variant:"body-small"},__("Reduced pricing is a limited offer for the first year and renews at regular price.","jetpack-protect")),p().createElement(m.Z,{multipleButtons:!0}))))}},5347:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5736),c=a(5235),r=a.n(c),s=a(5106),i=a(3789),o=a(9184);const __=n.__,l=({price:e,offPrice:t,currency:a="",showNotOffPrice:n=!0,hideDiscountLabel:c=!0,promoLabel:l="",legend:p=__("/month, paid yearly","jetpack-protect"),isNotConvenientPrice:d=!1,hidePriceFraction:u=!1,children:m})=>{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=!c&&h&&h>0?h+__("% off","jetpack-protect"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:o.Z.container},React.createElement("div",{className:r()(o.Z["price-container"],"product-price_container")},React.createElement(i.t,{value:t??e,currency:a,isOff:!d,hidePriceFraction:u}),n&&React.createElement(i.t,{value:e,currency:a,isOff:!1,hidePriceFraction:u}),g&&React.createElement(s.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},g))),React.createElement("div",{className:o.Z.footer},m||React.createElement(s.ZP,{className:r()(o.Z.legend,"product-price_legend")},p),l&&React.createElement(s.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},l)))}},3789:(e,t,a)=>{"use strict";a.d(t,{t:()=>o});var n=a(8899),c=a(5235),r=a.n(c),s=a(5106),i=a(9184);const o=({value:e,currency:t,isOff:a,hidePriceFraction:c})=>{const o=r()(i.Z.price,"product-price_price",{[i.Z["is-not-off-price"]]:!a}),{symbol:l,integer:p,fraction:d}=(0,n.LR)(e,t),u=!c||!d.endsWith("00");return React.createElement(s.ZP,{className:o,variant:"headline-medium",component:"p"},React.createElement(s.ZP,{className:i.Z.symbol,component:"sup",variant:"title-medium"},l),p,u&&React.createElement(s.ZP,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,d)))}},5033:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5162),c=a.n(n),r=a(9196),s=a.n(r);a(1683);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 o=i},3474:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(5235),r=a.n(c),s=a(5106),i=a(514);const __=n.__,o=({className:e,label:t,status:a="inactive"})=>{const n={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(s.ZP,{variant:"body-extra-small",className:r()(i.Z.status,{[i.Z[`is-${a}`]]:a},e)},React.createElement("span",{className:i.Z.status__indicator}),React.createElement("span",{className:i.Z.status__label},t||""===t?t:n[a]))}},7325:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(9307),c=a(5736),r=a(5235),s=a.n(r),i=a(6895),o=a(5106);a(7920);const __=c.__,l=()=>(0,n.createInterpolateElement)(__("By clicking the buttons above, you agree to our Terms of Service and to share details with WordPress.com.","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,n.createInterpolateElement)((0,c.sprintf)(/* translators: %s is a button label */ -__("By clicking the %s button, you agree to our Terms of Service and to share details with WordPress.com.","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.Z)(e),rel:"noopener noreferrer",target:"_blank"},t),u=({className:e,multipleButtons:t,agreeButtonLabel:a})=>React.createElement(o.ZP,{className:s()(e,"terms-of-service")},t?React.createElement(l,null):React.createElement(p,{agreeButtonLabel:a}))},6017:(e,t,a)=>{"use strict";a.d(t,{h:()=>n,s:()=>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"]},5106:(e,t,a)=>{"use strict";a.d(t,{Dx:()=>h,H3:()=>m,ZP:()=>u});var n=a(2674),c=a.n(n),r=a(5235),s=a.n(r),i=a(9196),o=a.n(i),l=a(6017),p=a(3280);const d=(0,i.forwardRef)((({variant:e="body",children:t,component:a,className:n,...r},d)=>{const u=a||l.h[e]||"span",m=(0,i.useMemo)((()=>l.s.reduce(((e,t)=>(void 0!==r[t]&&(e+=p.Z[`${t}-${r[t]}`]+" ",delete r[t]),e)),"")),[r]);return r.ref=d,o().createElement(u,c()({className:s()(p.Z.reset,p.Z[e],n,m)},r),t)}));d.displayName="Text";const u=d,m=({children:e,weight:t="bold",...a})=>{const n="headline-small"+("bold"===t?"":`-${t}`);return o().createElement(d,c()({variant:n,mb:3},a),e)},h=({children:e,size:t="medium",...a})=>o().createElement(d,c()({variant:`title-${t}`,mb:1},a),e)},8275:(e,t,a)=>{"use strict";a.d(t,{ZP:()=>u});var n=a(9196),c=a.n(n),r=a(3591);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 )"},o={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},l={"--spacing-base":"8px"},p={},d=(e,t,a)=>{const n={...s,...i,...o,...l};for(const t in n)e.style.setProperty(t,n[t]);a&&e.classList.add(r.Z.global),t&&(p[t]={provided:!0,root:e})},u=({children:e=null,targetDom:t,id:a,withGlobalStyles:r=!0})=>{const s=(0,n.useRef)(),i=p?.[a]?.provided;return(0,n.useLayoutEffect)((()=>{if(!i)return t?d(t,a,r):void(s?.current&&d(s.current,a,r))}),[t,s,i,a,r]),t?c().createElement(c().Fragment,null,e):c().createElement("div",{ref:s},e)}},2497:(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,{Z:()=>n})},6895:(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&&jetpack_redirects.hasOwnProperty("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,{Z:()=>n})},1132:(e,t,a)=>{let n={};try{n=a(6436)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),n={missingConfig:!0}}const c=e=>n.hasOwnProperty(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]}}},6186:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(2054),c=a(5033),r=a(5609),s=a(5736),i=a(5162),o=a.n(i),l=a(9196),p=a.n(l),d=a(9836);const __=s.__,u=e=>{const{message:t,isRestoringConnection:a,restoreConnectionCallback:i,restoreConnectionError:o}=e,[l]=(0,n.Z)(["md"],[">"]),u=d.Z.notice+(l?" "+d.Z["bigger-than-medium"]:""),m=p().createElement(r.Icon,{icon:p().createElement(r.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p().createElement(r.Path,{d:"M11.7815 4.93772C11.8767 4.76626 12.1233 4.76626 12.2185 4.93772L20.519 19.8786C20.6116 20.0452 20.4911 20.25 20.3005 20.25H3.69951C3.50889 20.25 3.3884 20.0452 3.48098 19.8786L11.7815 4.93772Z",stroke:"#D63638",strokeWidth:"1.5"}),p().createElement(r.Path,{d:"M13 10H11V15H13V10Z",fill:"#D63638"}),p().createElement(r.Path,{d:"M13 16H11V18H13V16Z",fill:"#D63638"}))});if(!t)return null;if(a)return p().createElement(r.Notice,{status:"error",isDismissible:!1,className:u},p().createElement("div",{className:d.Z.message},p().createElement(c.Z,{color:"#B32D2E",size:24}),__("Reconnecting Jetpack","jetpack-protect")));const h=o?p().createElement(r.Notice,{status:"error",isDismissible:!1,className:u+" "+d.Z.error},p().createElement("div",{className:d.Z.message},m,(0,s.sprintf)(/* translators: placeholder is the error. */ -__("There was an error reconnecting Jetpack. Error: %s","jetpack-protect"),o))):null;return p().createElement(p().Fragment,null,h,p().createElement(r.Notice,{status:"error",isDismissible:!1,className:u},p().createElement("div",{className:d.Z.message},m,t),i&&p().createElement("a",{onClick:i,onKeyDown:i,className:d.Z.button,href:"#"},__("Restore Connection","jetpack-protect"))))};u.propTypes={message:o().string.isRequired,restoreConnectionCallback:o().func,isRestoringConnection:o().bool,restoreConnectionError:o().string};const m=u},1294:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(4743),c=a(9818),r=a(9196),s=a(428);const i=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{},o=({registrationNonce:e=i.registrationNonce,apiRoot:t=i.apiRoot,apiNonce:a=i.apiNonce,redirectUri:o,autoTrigger:l,from:p,skipUserConnection:d}={})=>{const{registerSite:u,connectUser:m,refreshConnectedPlugins:h}=(0,c.useDispatch)(s.t),g=(0,c.useSelect)((e=>e(s.t).getRegistrationError())),{siteIsRegistering:f,userIsConnecting:v,userConnectionData:E,connectedPlugins:k,connectionErrors:b,isRegistered:y,isUserConnected:Z,hasConnectedOwner:_,isOfflineMode:w}=(0,c.useSelect)((e=>({siteIsRegistering:e(s.t).getSiteIsRegistering(),userIsConnecting:e(s.t).getUserIsConnecting(),userConnectionData:e(s.t).getUserConnectionData(),connectedPlugins:e(s.t).getConnectedPlugins(),connectionErrors:e(s.t).getConnectionErrors(),isOfflineMode:e(s.t).getIsOfflineMode(),...e(s.t).getConnectionStatus()}))),C=()=>d?o?(window.location=o,Promise.resolve(o)):Promise.resolve():m({from:p,redirectUri:o}),R=t=>(t&&t.preventDefault(),y?C():u({registrationNonce:e,redirectUri:o,from:p}).then((()=>C())));return(0,r.useEffect)((()=>{n.ZP.setApiRoot(t),n.ZP.setApiNonce(a)}),[t,a]),(0,r.useEffect)((()=>{!l||f||v||R()}),[]),{handleRegisterSite:R,handleConnectUser:C,refreshConnectedPlugins:h,isRegistered:y,isUserConnected:Z,siteIsRegistering:f,userIsConnecting:v,registrationError:g,userConnectionData:E,hasConnectedOwner:_,connectedPlugins:k,connectionErrors:b,isOfflineMode:w}}},7711:(e,t,a)=>{"use strict";function n(){switch("undefined"!=typeof window&&window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv){case"development":return"http://calypso.localhost:3000/";case"wpcalypso":return"https://wpcalypso.wordpress.com/";case"horizon":return"https://horizon.wordpress.com/";default:return"https://wordpress.com/"}}a.d(t,{Z:()=>n})},3329:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s,h:()=>i});var n=a(6186),c=a(1294),r=a(1045);function s(){const{connectionErrors:e}=(0,c.Z)({}),t=Object.values(e).shift(),a=t&&Object.values(t).length&&Object.values(t).shift().error_message;return{hasConnectionError:Boolean(a),connectionErrorMessage:a}}const i=()=>{const{hasConnectionError:e,connectionErrorMessage:t}=s(),{restoreConnection:a,isRestoringConnection:c,restoreConnectionError:i}=(0,r.Z)();return e?React.createElement(n.Z,{isRestoringConnection:c,restoreConnectionError:i,restoreConnectionCallback:a,message:t}):null}},8258:(e,t,a)=>{"use strict";a.d(t,{Z:()=>v});var n=a(4743),c=a(7711),r=a(9818),s=a(951),i=a.n(s),o=a(9196),l=a(1294),p=a(428);const d=i()("jetpack:connection:useProductCheckoutWorkflow"),{registrationNonce:u,apiRoot:m,apiNonce:h,siteSuffix:g}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{},f="undefined"!=typeof window?window?.myJetpackInitialState?.adminUrl:null;function v({productSlug:e,redirectUrl:t,siteSuffix:a=g,adminUrl:s=f,connectAfterCheckout:i=!1,siteProductAvailabilityHandler:v=null,quantity:E=null,from:k,useBlogIdSuffix:b=!1}={}){d("productSlug is %s",e),d("redirectUrl is %s",t),d("siteSuffix is %s",a),d("from is %s",k);const[y,Z]=(0,o.useState)(!1),{registerSite:_}=(0,r.useDispatch)(p.t),w=(0,r.useSelect)((e=>e(p.t).getBlogId()),[p.t]);d("blogID is %s",w??"undefined"),b=b&&!!w;const{isUserConnected:C,isRegistered:R,handleConnectUser:j}=(0,l.Z)({redirectUri:t,from:k}),S=(0,o.useMemo)((()=>{const n=(0,c.Z)(),r=(!R||!C)&&i,o=r?"checkout/jetpack/":`checkout/${b?w.toString():a}/`,l=new URL(`${n}${o}${e}${null!=E?`:-q-${E}`:""}`);return r?(l.searchParams.set("connect_after_checkout",!0),l.searchParams.set("admin_url",s),l.searchParams.set("from_site_slug",a)):l.searchParams.set("site",a),l.searchParams.set("source",k),l.searchParams.set("redirect_to",t),C||l.searchParams.set("unlinked","1"),l}),[R,C,i,a,E,e,k,t,s,b,w]);d("isRegistered is %s",R),d("isUserConnected is %s",C),d("connectAfterCheckout is %s",i),d("checkoutUrl is %s",S);const N=(e=null)=>Promise.resolve(v&&v()).then((t=>{if(e&&S.searchParams.set("redirect_to",e),t)return d("handleAfterRegistration: Site has a product associated"),j();d("handleAfterRegistration: Site does not have a product associated. Redirecting to checkout %s",S),window.location.href=S}));return(0,o.useEffect)((()=>{n.ZP.setApiRoot(m),n.ZP.setApiNonce(h)}),[]),{run:(e,a=null)=>(e&&e.preventDefault(),Z(!0),i?((e=null)=>{e&&S.searchParams.set("redirect_to",e),d("Redirecting to connectAfterCheckout flow: %s",S),window.location.href=S})(a):R?N(a):void _({registrationNonce:u,redirectUri:t}).then((()=>N(a)))),isRegistered:R,hasCheckoutStarted:y}}},1045:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(4743),c=a(9818),r=a(9196),s=a(428);const{apiRoot:i,apiNonce:o}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function l(){const[e,t]=(0,r.useState)(!1),[a,l]=(0,r.useState)(null),{disconnectUserSuccess:p,setConnectionErrors:d}=(0,c.useDispatch)(s.t);return(0,r.useEffect)((()=>{n.ZP.setApiRoot(i),n.ZP.setApiNonce(o)}),[]),{restoreConnection:(e=!0)=>(t(!0),l(null),n.ZP.reconnect().then((t=>("in_progress"===t.status?(p(),d({}),e&&(window.location.href="/wp-admin/admin.php?page=my-jetpack#/connection")):window.location.reload(),t))).catch((e=>{throw l(e),t(!1),e}))),isRestoringConnection:e,restoreConnectionError:a}}},7523:(e,t,a)=>{"use strict";a.d(t,{LI:()=>r,N4:()=>i,Qo:()=>d,T1:()=>l,TS:()=>p,ZP:()=>Z,b5:()=>m,i6:()=>c,qJ:()=>h,qV:()=>o,r7:()=>s,wQ:()=>u});var n=a(4743);const c="SET_CONNECTION_STATUS",r="SET_CONNECTION_STATUS_IS_FETCHING",s="SET_SITE_IS_REGISTERING",i="SET_USER_IS_CONNECTING",o="SET_REGISTRATION_ERROR",l="CLEAR_REGISTRATION_ERROR",p="SET_AUTHORIZATION_URL",d="DISCONNECT_USER_SUCCESS",u="SET_CONNECTED_PLUGINS",m="SET_CONNECTION_ERRORS",h="SET_IS_OFFLINE_MODE",g=e=>({type:c,connectionStatus:e}),f=e=>({type:s,isRegistering:e}),v=e=>({type:i,isConnecting:e}),E=e=>({type:o,registrationError:e}),k=()=>({type:l}),b=e=>({type:p,authorizationUrl:e}),y=e=>({type:u,connectedPlugins:e});const Z={setConnectionStatus:g,setConnectionStatusIsFetching:e=>({type:r,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:f,setUserIsConnecting:v,setRegistrationError:E,clearRegistrationError:k,setAuthorizationUrl:b,registerSite:function*({registrationNonce:e,redirectUri:t,from:a=""}){yield k(),yield f(!0);try{const n=yield{type:"REGISTER_SITE",registrationNonce:e,redirectUri:t,from:a};return yield g({isRegistered:!0}),yield b(n.authorizeUrl),yield f(!1),Promise.resolve(n)}catch(e){return yield E(e),yield f(!1),Promise.reject(e)}},connectUser:function*({from:e,redirectFunc:t,redirectUri:a}={}){yield v(!0),yield{type:"CONNECT_USER",from:e,redirectFunc:t,redirectUri:a}},disconnectUserSuccess:()=>({type:d}),setConnectedPlugins:y,refreshConnectedPlugins:()=>async({dispatch:e})=>await new Promise((t=>n.ZP.fetchConnectedPlugins().then((a=>{e(y(a)),t(a)})))),setConnectionErrors:e=>({type:m,connectionErrors:e}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})}},1432:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(4743),c=a(9818),r=a(7057);const s={FETCH_AUTHORIZATION_URL:({redirectUri:e})=>n.ZP.fetchAuthorizationUrl(e),REGISTER_SITE:({registrationNonce:e,redirectUri:t,from:a})=>n.ZP.registerSite(e,t,a),CONNECT_USER:(0,c.createRegistryControl)((({resolveSelect:e})=>({from:t,redirectFunc:a,redirectUri:n}={})=>new Promise(((c,s)=>{e(r.Z).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)}))}))))}},1479:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9818),c=a(7523);const r=(0,n.combineReducers)({connectionStatus:(e={},t)=>{switch(t.type){case c.i6:return{...e,...t.connectionStatus};case c.Qo:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:(e=!1,t)=>t.type===c.LI?t.isFetching:e,siteIsRegistering:(e=!1,t)=>t.type===c.r7?t.isRegistering:e,userIsConnecting:(e=!1,t)=>t.type===c.N4?t.isConnecting:e,registrationError:(e,t)=>{switch(t.type){case c.T1:return!1;case c.qV:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===c.TS?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:(e={},t)=>t.type===c.wQ?t.connectedPlugins:e,connectionErrors:(e={},t)=>t.type===c.b5?t.connectionErrors:e,isOfflineMode:(e=!1,t)=>t.type===c.qJ?t.isConnecting:e})},7728:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9818),c=a(7523),r=a(7057);const s={...{getAuthorizationUrl:{isFulfilled:(e,...t)=>{const a=Boolean(e.authorizationUrl),c=(0,n.select)(r.Z).hasFinishedResolution("getAuthorizationUrl",t);return a&&!c&&(0,n.dispatch)(r.Z).finishResolution("getAuthorizationUrl",t),a},*fulfill(e){const t=yield c.ZP.fetchAuthorizationUrl(e);yield c.ZP.setAuthorizationUrl(t.authorizeUrl)}}}}},2725:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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}}},3535:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9818);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},7057:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n="jetpack-connection"},428:(e,t,a)=>{"use strict";a.d(t,{t:()=>l.Z});var n=a(7523),c=a(1432),r=a(1479),s=a(7728),i=a(2725),o=a(3535),l=a(7057);const p=window.JP_CONNECTION_INITIAL_STATE;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.Z.mayBeInit(l.Z,{__experimentalUseThunks:!0,reducer:r.Z,actions:n.ZP,selectors:i.Z,resolvers:s.Z,controls:c.Z,initialState:p||{}})},4311:(e,t,a)=>{"use strict";a(9906),a(838)},838:(e,t,a)=>{"use strict"},9906:(e,t,a)=>{"use strict";a(2674);var n=a(5162),c=a.n(n);a(9196),a(838);c().string.isRequired,c().number,c().func,c().string},1827:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(6989),c=a.n(n),r=a(4769),s=a.n(r);const i={fetchWaf:()=>c()({path:"jetpack-protect/v1/waf",method:"GET"}).then(s()),toggleWaf:()=>c()({method:"POST",path:"jetpack-protect/v1/toggle-waf"}),updateWaf:e=>c()({method:"POST",path:"jetpack/v4/waf",data:e}),wafSeen:()=>c()({path:"jetpack-protect/v1/waf-seen",method:"POST"}),wafUpgradeSeen:()=>c()({path:"jetpack-protect/v1/waf-upgrade-seen",method:"POST"}),fetchOnboardingProgress:()=>c()({path:"jetpack-protect/v1/onboarding-progress",method:"GET"}),completeOnboardingSteps:e=>c()({path:"jetpack-protect/v1/onboarding-progress",method:"POST",data:{step_ids:e}})}},7267:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(2674),c=a.n(n),r=a(9105),s=a(3363),i=a(8258),o=a(6989),l=a.n(o),p=a(9818),d=a(5736),u=a(6483),m=a(9196),h=a.n(m),g=a(3898),f=a(8963),v=a(4633),E=a(6402),k=a(8266),b=a(291),y=a(3324),Z=a(3900),_=a(2770);const __=d.__,w=({children:e})=>{(0,_.Z)();const{isSeen:t}=(0,f.Z)(),a=(0,p.useSelect)((e=>e(v.t).getNotice())),{refreshPlan:n,startScanOptimistically:o,refreshStatus:d}=(0,p.useDispatch)(v.t),{adminUrl:w}=window.jetpackProtectInitialState||{},{run:C,isRegistered:R,hasCheckoutStarted:j}=(0,i.Z)({productSlug:g.o,redirectUrl:(0,u.addQueryArgs)(w,{checkPlan:!0}),siteProductAvailabilityHandler:async()=>l()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((e=>e)),useBlogIdSuffix:!0});return(0,m.useEffect)((()=>{(0,u.getQueryArg)(window.location.search,"checkPlan")&&(o(),setTimeout((()=>{n(),d(!0)}),5e3))}),[n,d,o]),!R||j?h().createElement(E.Z,{onScanAdd:C}):h().createElement(r.Z,{moduleName:__("Jetpack Protect","jetpack-protect"),header:h().createElement(k.Z,null)},a.message&&h().createElement(b.Z,c()({floating:!0,dismissable:!0},a)),h().createElement(s.Z,{horizontalSpacing:0},h().createElement(y.Z,{className:Z.Z.navigation},h().createElement(y.O,{link:"/",label:__("Scan","jetpack-protect")}),h().createElement(y.O,{link:"/firewall",label:h().createElement(h().Fragment,null,__("Firewall","jetpack-protect"),!1===t&&h().createElement("span",{className:Z.Z.badge},__("New","jetpack-protect")))}))),e)}},2770:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(1294),c=a(9818),r=a(9196),s=a(4633);const i=()=>{const{isRegistered:e}=(0,n.Z)(),{refreshStatus:t}=(0,c.useDispatch)(s.t),a=(0,c.useSelect)((e=>e(s.t).getStatus()));(0,r.useEffect)((()=>{e&&!a.status&&t()}),[e])}},4948:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5609),c=a(9196),r=a.n(c),s=a(9993);function i({className:e,color:t="#D63638"}){return r().createElement("div",{className:s.Z.container},r().createElement(n.SVG,{className:e,width:"127",height:"136",viewBox:"0 0 127 136",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r().createElement(n.G,{filter:"url(#filter0_d_2716_19567)"},r().createElement(n.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(n.Rect,{x:"59.8953",y:"72.1666",width:"7.02184",height:"7",rx:"3.5",fill:"white"}),r().createElement(n.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"})))))}},9974:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5033),c=a(9818),r=a(5736),s=a(4633),i=a(9886),o=a(4424);const __=r.__,l=({children:e})=>{const{checkCredentials:t}=(0,c.useDispatch)(s.t),{credentials:a,credentialsIsFetching:r}=(0,c.useSelect)((e=>({credentials:e(s.t).getCredentials(),credentialsIsFetching:e(s.t).getCredentialsIsFetching()})));return a||r||t(),a?0===a.length?React.createElement(i.Z,null):e:React.createElement("div",{className:o.Z.loading},React.createElement(n.Z,{color:"black",style:{color:"black",marginTop:0,marginLeft:0}}),React.createElement("p",{className:o.Z.loading__message},__("Checking credentials…","jetpack-protect")))}},9886:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(5106),c=a(526),r=a(6895),s=a(9818),i=a(5736),o=a(9196),l=a(4633),p=a(291),d=a(3064);const __=i.__,u=()=>{const{setModal:e}=(0,s.useDispatch)(l.t),{siteSuffix:t,blogID:a}=window.jetpackProtectInitialState,{checkCredentials:i}=(0,s.useDispatch)(l.t),u=(0,s.useSelect)((e=>e(l.t).getCredentials()));return(0,o.useEffect)((()=>{const e=setInterval((()=>{u&&0!==u.length||i()}),3e3);return()=>clearInterval(e)}),[i,u]),React.createElement(React.Fragment,null,React.createElement(n.ZP,{variant:"title-medium",mb:2},__("Site credentials needed","jetpack-protect")),React.createElement(p.Z,{type:"info",message:__("Before Jetpack Protect can auto-fix threats on your site, it needs your server credentials.","jetpack-protect")}),React.createElement(n.ZP,{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(n.ZP,{mb:3},__("Once you’ve entered server credentials, Jetpack Protect will be fixing the selected threats.","jetpack-protect")),React.createElement("div",{className:d.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-protect")),React.createElement(c.Z,{isExternalLink:!0,weight:"regular",href:(0,r.Z)("jetpack-settings-security-credentials",{site:a??t})},__("Enter server credentials","jetpack-protect"))))}},7127:(e,t,a)=>{"use strict";a.d(t,{C:()=>i});var n=a(7470),c=a(9196),r=a(9137);const s=e=>{const t=e.lastIndexOf("/");return t>-1?[e.slice(0,t),e.slice(t)]:["",e]},i=({diff:e})=>React.createElement("div",{className:r.Z["diff-viewer"]},(0,n.G)(e).map(((e,t)=>React.createElement(c.Fragment,{key:t},React.createElement("div",{key:`file-${t}`,className:r.Z["diff-viewer__filename"]},(({oldFileName:e,newFileName:t})=>{const a="a"===e[0]&&"/"===e[1]&&"b"===t[0]&&"/"===t[1],[n,i]=a?[e.slice(2),t.slice(2)]:[e,t];if(n===i){const[e,t]=s(n);return React.createElement(c.Fragment,null,e&&React.createElement("span",{className:r.Z["diff-viewer__path-prefix"]},e),React.createElement("span",{className:r.Z["diff-viewer__path"]},t))}const o=Math.max(n.length,i.length);for(let e=0,t=0;e{let a=0;return e.lines.map(((n,c)=>React.createElement("div",{key:`${t}-${c}`},"+"===n[0]?" ":e.oldStart+a++)))}))),React.createElement("div",{key:"right-numbers",className:r.Z["diff-viewer__line-numbers"]},e.hunks.map(((e,t)=>{let a=0;return e.lines.map(((n,c)=>React.createElement("div",{key:`${t}-${c}`},"-"===n[0]?" ":e.newStart+a++)))}))),React.createElement("div",{className:r.Z["diff-viewer__lines"]},e.hunks.map(((e,t)=>e.lines.map(((e,a)=>{const n=e.slice(1).replace(/^\s*$/," "),c=`${t}-${a}`;switch(e[0]){case" ":return React.createElement("div",{key:c},n);case"-":return React.createElement("del",{key:c},n);case"+":return React.createElement("ins",{key:c},n)}}))))))))))},8431:(e,t,a)=>{"use strict";a.d(t,{Z:()=>k});var n=a(5106),c=a(526),r=a(216),s=a(5609),i=a(9818),o=a(9307),l=a(5736),p=a(9196),d=a(3898),u=a(8963),m=a(4633),h=a(9909),g=a(3932);const __=l.__,f=()=>{const{setModal:e}=(0,i.useDispatch)(m.t);return React.createElement("div",{className:g.Z["standalone-mode-section"]},React.createElement(n.Dx,null,__("Standalone mode","jetpack-protect")),React.createElement(n.ZP,{mb:2},__("Learn how you can execute the firewall before WordPress initializes. This mode offers the most protection.","jetpack-protect")),React.createElement(c.Z,{variant:"link",isExternalLink:!0,weight:"regular",onClick:t=>{t.preventDefault(),e({type:"STANDALONE_MODE"})}},__("Learn more","jetpack-protect")))},v=()=>{const{config:e,isUpdating:t,toggleShareDebugData:a}=(0,u.Z)(),{jetpackWafShareDebugData:c}=e||{},{setNotice:r}=(0,i.useDispatch)(m.t),[l,h]=(0,p.useState)({jetpack_waf_share_debug_data:c}),f=(0,p.useCallback)((()=>{h({...l,jetpack_waf_share_debug_data:!l.jetpack_waf_share_debug_data}),a().then((()=>r({type:"success",duration:5e3,dismissable:!0,message:__("Changes saved.","jetpack-protect")}))).catch((()=>{r({type:"error",dismissable:!0,message:(0,o.createInterpolateElement)(__("An error ocurred. Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(s.ExternalLink,{href:d.K})})})}))}),[l,a,r]);return(0,p.useEffect)((()=>{h({jetpack_waf_share_debug_data:c})}),[c]),React.createElement("div",{className:g.Z["share-data-section"]},React.createElement(n.Dx,{mb:2},__(" Share detailed data with Jetpack","jetpack-protect")),React.createElement("div",{className:g.Z["footer-checkbox"]},React.createElement(s.CheckboxControl,{checked:Boolean(l.jetpack_waf_share_debug_data),onChange:f,disabled:t}),React.createElement(n.ZP,null,__("Allow Jetpack to collect detailed data from blocked requests to enhance firewall protection and accuracy.","jetpack-protect"))))},E=()=>{const{config:e,isUpdating:t,toggleShareData:a}=(0,u.Z)(),{jetpackWafShareData:c}=e||{},{setNotice:r}=(0,i.useDispatch)(m.t),[l,h]=(0,p.useState)({jetpack_waf_share_data:c}),f=(0,p.useCallback)((()=>{h({...l,jetpack_waf_share_data:!l.jetpack_waf_share_data}),a().then((()=>r({type:"success",duration:5e3,dismissable:!0,message:__("Changes saved.","jetpack-protect")}))).catch((()=>{r({type:"error",dismissable:!0,message:(0,o.createInterpolateElement)(__("An error ocurred. Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(s.ExternalLink,{href:d.K})})})}))}),[l,a,r]);return(0,p.useEffect)((()=>{h({jetpack_waf_share_data:c})}),[c]),React.createElement("div",{className:g.Z["share-data-section"]},React.createElement(n.Dx,{mb:2},__(" Share basic data with Jetpack","jetpack-protect")),React.createElement("div",{className:g.Z["footer-checkbox"]},React.createElement(s.CheckboxControl,{checked:Boolean(l.jetpack_waf_share_data),onChange:f,disabled:t}),React.createElement(n.ZP,null,__("Allow Jetpack to collect basic data from blocked requests to improve firewall protection and accuracy.","jetpack-protect"))))},k=()=>{const{isEnabled:e}=(0,u.Z)();return React.createElement(r.Z,null,React.createElement(h.Z,{main:React.createElement(f,null),secondary:e&&React.createElement(React.Fragment,null,React.createElement(E,null),React.createElement(v,null)),preserveSecondaryOnMobile:!0}))}},2651:(e,t,a)=>{"use strict";a.d(t,{Z:()=>R});var n=a(526),c=a(5106),r=a(216),s=a(3363),i=a(3846),o=a(3474),l=a(8258),p=a(5609),d=a(5736),u=a(1074),m=a(1646),h=a(9196),g=a.n(h),f=a(3898),v=a(6477),E=a(5773),k=a(8963),b=a(8452);const __=d.__,y=()=>{const{adminUrl:e}=window.jetpackProtectInitialState||{},t=e+"#/firewall",{config:{automaticRulesAvailable:a}}=(0,k.Z)(),{run:c}=(0,l.Z)({productSlug:f.o,redirectUrl:t,useBlogIdSuffix:!0}),{recordEventHandler:r}=(0,v.Z)(),s=r("jetpack_protect_waf_header_get_scan_link_click",c);return g().createElement(n.Z,{className:b.Z["upgrade-button"],onClick:s},a?__("Upgrade to update automatic security rules","jetpack-protect",0):__("Upgrade to enable automatic firewall protection","jetpack-protect"))},Z=({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),n=(0,h.useCallback)((()=>{a(!0)}),[]),r=(0,h.useCallback)((()=>{a(!1)}),[]);return g().createElement("div",{className:b.Z["icon-popover"],onMouseLeave:r,onMouseEnter:n,onClick:n,onFocus:n,onBlur:r,role:"presentation"},g().createElement(u.Z,{icon:m.Z}),t&&g().createElement(p.Popover,{noArrow:!1,offset:5,inline:!0},g().createElement(c.ZP,{className:b.Z["popover-text"],variant:"body-small"},e)))},_=({className:e,text:t="",popover:a=!1,children:n})=>g().createElement("div",{className:b.Z["firewall-subheading__content"]},g().createElement(c.ZP,{className:b.Z[e],weight:600},t),a&&g().createElement(Z,{children:n})),w=({hasRequiredPlan:e,automaticRulesAvailable:t,jetpackWafIpList:a,jetpackWafAutomaticRules:n,bruteForceProtectionIsEnabled:c,wafSupported:r})=>{const s=r&&n&&a,i=r&&n&&!a,o=r&&!n&&a,l=r&&!n&&!a;return g().createElement(g().Fragment,null,g().createElement("div",{className:b.Z["firewall-subheading"]},r&&c&&g().createElement(_,{className:"brute-force-protection-subheading",text:__("Brute force protection is active.","jetpack-protect")}),l&&g().createElement(_,{text:__("There are no firewall rules applied.","jetpack-protect")}),i&&g().createElement(_,{text:__("Automatic firewall protection is enabled.","jetpack-protect"),popover:!e}),o&&g().createElement(_,{text:__("Only manual IP list rules apply.","jetpack-protect"),popover:!e&&!t,children:__("The free version of the firewall only allows for use of manual rules.","jetpack-protect")}),s&&g().createElement(_,{text:__("All firewall rules apply.","jetpack-protect"),popover:!e})),!e&&g().createElement(y,null))},C=({status:e,hasRequiredPlan:t,automaticRulesEnabled:a,automaticRulesAvailable:n,jetpackWafIpList:l,jetpackWafAutomaticRules:d,bruteForceProtectionIsEnabled:u,wafSupported:m,standaloneMode:h})=>g().createElement(r.Z,null,g().createElement(s.Z,{className:b.Z["firewall-header"],horizontalSpacing:7,horizontalGap:0},g().createElement(i.Z,null,"on"===e&&g().createElement(g().Fragment,null,g().createElement(o.Z,{status:"active",label:h?__("Standalone mode","jetpack-protect"):__("Active","jetpack-protect",0)})," ",g().createElement(c.H3,{className:b.Z["firewall-heading"],mb:1,mt:2},!m&&__("Brute force protection is active","jetpack-protect"),m&&(a?__("Automatic firewall is on","jetpack-protect"):__("Firewall is on","jetpack-protect",0))),g().createElement(w,{jetpackWafIpList:l,jetpackWafAutomaticRules:d,bruteForceProtectionIsEnabled:u,hasRequiredPlan:t,automaticRulesAvailable:n,wafSupported:m})),"off"===e&&g().createElement(g().Fragment,null,g().createElement(o.Z,{status:"inactive",label:__("Inactive","jetpack-protect")}),g().createElement(c.H3,{className:b.Z["firewall-heading"],mb:1,mt:2},!m&&__("Brute force protection is disabled","jetpack-protect"),m&&(n?__("Automatic firewall is off","jetpack-protect"):__("Firewall is off","jetpack-protect",0))),g().createElement(w,{jetpackWafIpList:l,jetpackWafAutomaticRules:d,bruteForceProtectionIsEnabled:u,hasRequiredPlan:t,automaticRulesAvailable:n,wafSupported:m})),"loading"===e&&g().createElement(g().Fragment,null,g().createElement(p.Spinner,{className:b.Z.spinner}),g().createElement(c.H3,{className:b.Z["firewall-heading"],mb:2,mt:2},__("Automatic firewall is being set up","jetpack-protect")),g().createElement(c.ZP,{className:b.Z["loading-text"],weight:600},__("Please wait…","jetpack-protect")))),g().createElement(i.Z,null,g().createElement("div",{className:b.Z["stat-card-wrapper"]})))),R=()=>{const{config:{jetpackWafAutomaticRules:e,jetpackWafIpList:t,standaloneMode:a,automaticRulesAvailable:n,bruteForceProtection:c},isToggling:r,wafSupported:s,isEnabled:i}=(0,k.Z)(),{hasRequiredPlan:o}=(0,E.Z)(),l=(s?i:c)?"on":"off";return g().createElement(C,{status:r?"loading":l,hasRequiredPlan:o,automaticRulesEnabled:e,automaticRulesAvailable:n,jetpackWafIpList:t,jetpackWafAutomaticRules:e,bruteForceProtectionIsEnabled:c,wafSupported:s,standaloneMode:a})}},5975:(e,t,a)=>{"use strict";a.d(t,{Z:()=>A});var n=a(2054),c=a(1342),r=a(5106),s=a(526),i=a(857),o=a(3363),l=a(3846),p=a(8258),d=a(5609),u=a(9818),m=a(9307),h=a(5736),g=a(1074),f=a(6163),v=a(3259),E=a(6292),k=a.n(E),b=a(9196),y=a(1827),Z=a(3898),_=a(6477),w=a(5773),C=a(8963),R=a(4633),j=a(7267),S=a(8431),N=a(2651),P=a(5678),x=a(5800),I=a(9265),L=a(4854);const __=h.__,_n=h._n,M=window?.jetpackProtectInitialState?.adminUrl,T=5e3,A=()=>{const[e]=(0,n.Z)(["sm","lg"],[null,"<"]),{setWafIsSeen:t,setWafUpgradeIsSeen:a,setNotice:E}=(0,u.useDispatch)(R.t),{config:{jetpackWafAutomaticRules:A,jetpackWafIpList:z,jetpackWafIpBlockList:F,jetpackWafIpAllowList:O,automaticRulesAvailable:D,bruteForceProtection:V},currentIp:U,isEnabled:H,isSeen:B,upgradeIsSeen:W,displayUpgradeBadge:J,wafSupported:G,isUpdating:$,stats:{ipAllowListCount:q,ipBlockListCount:K,automaticRulesLastUpdated:X},toggleAutomaticRules:Q,toggleManualRules:Y,toggleBruteForceProtection:ee,toggleWaf:te,updateConfig:ae}=(0,C.Z)(),{hasRequiredPlan:ne}=(0,w.Z)(),{run:ce}=(0,p.Z)({productSlug:Z.o,redirectUrl:`${M}#/firewall`,useBlogIdSuffix:!0}),{recordEventHandler:re,recordEvent:se}=(0,_.Z)(),ie=H&&(ne||D),[oe,le]=(0,b.useState)(!1),[pe,de]=(0,b.useState)({jetpack_waf_automatic_rules:A,jetpack_waf_ip_list:z,jetpack_waf_ip_block_list:F,jetpack_waf_ip_allow_list:O,brute_force_protection:V}),[ue,me]=(0,b.useState)(!1),[he,ge]=(0,b.useState)(!1),fe=(0,b.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}}),[]),ve=(0,b.useCallback)((e=>{const t=fe(e)||__("An error occurred.","jetpack-protect"),a=(0,m.createInterpolateElement)(__("Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(d.ExternalLink,{href:Z.K})});E({type:"error",message:React.createElement(React.Fragment,null,t," ",a)})}),[fe,E]),Ee=re("jetpack_protect_waf_page_get_scan_link_click",ce),ke=(0,b.useCallback)((()=>{me(!0),ae(pe).then((()=>E({type:"success",duration:T,message:__("Changes saved.","jetpack-protect")}))).catch(ve).finally((()=>me(!1)))}),[ae,pe,ve,E]),be=(0,b.useCallback)((e=>{const{value:t,id:a}=e.target;de({...pe,[a]:t})}),[pe]),ye=(0,b.useCallback)((()=>{me(!0);const e=!pe.jetpack_waf_automatic_rules;de({...pe,jetpack_waf_automatic_rules:e}),Q().then((()=>{le(!1),E({type:"success",duration:T,message:e?__("Automatic firewall protection is enabled.","jetpack-protect"):__("Automatic firewall protection is disabled.","jetpack-protect",0)}),se(e?"jetpack_protect_automatic_rules_enabled":"jetpack_protect_automatic_rules_disabled")})).then((()=>{W||(a(!0),y.Z.wafUpgradeSeen())})).catch((e=>{le(!0),ve(e)})).finally((()=>me(!1)))}),[pe,Q,E,se,W,a,ve]),Ze=(0,b.useCallback)((()=>{me(!0);const e=!pe.brute_force_protection;de({...pe,brute_force_protection:e}),ee().then((()=>{E({type:"success",duration:T,message:e?__("Brute force protection is enabled.","jetpack-protect"):__("Brute force protection is disabled.","jetpack-protect",0)}),se(e?"jetpack_protect_brute_force_protection_enabled":"jetpack_protect_brute_force_protection_disabled")})).catch(ve).finally((()=>me(!1)))}),[pe,ee,ve,E,se]),_e=(0,b.useCallback)((()=>{const e=!pe.jetpack_waf_ip_list;me(!0),de({...pe,jetpack_waf_ip_list:e}),Y().then((()=>{E({type:"success",duration:T,message:e?__("Manual rules are active.","jetpack-protect"):__("Manual rules are disabled.","jetpack-protect",0)}),se(e?"jetpack_protect_manual_rules_enabled":"jetpack_protect_manual_rules_disabled")})).catch(ve).finally((()=>me(!1)))}),[pe,Y,ve,E,se]),we=(0,b.useCallback)((()=>{ge(!he)}),[he,ge]),Ce=(0,b.useCallback)((()=>{a(!0),y.Z.wafUpgradeSeen()}),[a]),Re=(0,b.useMemo)((()=>pe.jetpack_waf_ip_allow_list.includes(U)),[pe.jetpack_waf_ip_allow_list,U]),je=(0,b.useCallback)((()=>{const e=pe.jetpack_waf_ip_allow_list.length>0?`${pe.jetpack_waf_ip_allow_list}\n${U}`:U;de((t=>({...t,jetpack_waf_ip_allow_list:e})))}),[pe.jetpack_waf_ip_allow_list,U]);(0,b.useEffect)((()=>{$||de({jetpack_waf_automatic_rules:A,jetpack_waf_ip_list:z,jetpack_waf_ip_block_list:F,jetpack_waf_ip_allow_list:O,brute_force_protection:V})}),[z,F,O,A,V,$]),(0,b.useEffect)((()=>{B||(t(!0),y.Z.wafSeen())}),[B,t]),(0,_.Z)({pageViewEventName:"protect_waf",pageViewEventProperties:{has_plan:ne}});const Se=React.createElement(c.Z,{level:"error",title:"Jetpack Firewall is currently disabled.",children:React.createElement(r.ZP,null,__("Re-enable the Firewall to continue.","jetpack-protect")),actions:[React.createElement(s.Z,{variant:"link",onClick:te,isLoading:$,disabled:$},__("Enable Firewall","jetpack-protect"))],hideCloseButton:!0}),Ne=React.createElement(React.Fragment,null,React.createElement("div",{className:`${L.Z["toggle-section"]} ${ie?"":L.Z["toggle-section--disabled"]}`},React.createElement("div",{className:L.Z["toggle-section__control"]},React.createElement(P.Z,{checked:!!ie&&pe.jetpack_waf_automatic_rules,onChange:ye,disabled:!H||ue||!ie}),ne&&!1===W&&React.createElement(d.Popover,{noArrow:!1,offset:8,position:"top right",inline:!0},React.createElement("div",{className:L.Z.popover},React.createElement("div",{className:L.Z.popover__header},React.createElement(r.ZP,{className:L.Z.popover__title,variant:"title-small"},__("Thanks for upgrading!","jetpack-protect")),React.createElement(s.Z,{className:L.Z.popover__button,variant:"icon"},React.createElement(g.Z,{onClick:Ce,icon:f.Z,size:24,"aria-label":__("Close Window","jetpack-protect")}))),React.createElement(r.ZP,{className:L.Z.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.Z.popover__footer},React.createElement(s.Z,{onClick:Ce},__("Got it","jetpack-protect")))))),React.createElement("div",{className:L.Z["toggle-section__content"]},React.createElement("div",{className:L.Z["toggle-section__title"]},React.createElement(r.ZP,{variant:"title-medium",mb:2},__("Enable automatic firewall protection","jetpack-protect")),!e&&ne&&J&&React.createElement("span",{className:L.Z.badge},__("NOW AVAILABLE","jetpack-protect"))),React.createElement(r.ZP,null,__("Block untrusted traffic sources by scanning every request made to your site. Jetpack’s advanced security rules are automatically kept up-to-date to protect your site from the latest threats.","jetpack-protect")),React.createElement("div",{className:L.Z["toggle-section__details"]},A&&X&&!oe&&React.createElement("div",{className:L.Z["automatic-rules-stats"]},React.createElement(r.ZP,{className:L.Z["automatic-rules-stats__version"],variant:"body-small"},__("Automatic security rules installed.","jetpack-protect")),React.createElement(r.ZP,{className:L.Z["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"),k().unix(X).format("MMMM D, YYYY")))),oe&&React.createElement(React.Fragment,null,React.createElement(r.ZP,{className:L.Z["automatic-rules-stats__failed-install"],variant:"body-small",mt:2},__("Failed to update automatic firewall rules.","jetpack-protect")," ",fe(oe)),React.createElement(s.Z,{variant:"link",href:Z.K},React.createElement(r.ZP,{variant:"body-small"},__("Contact support","jetpack-protect"))))))),!ne&&React.createElement("div",{className:L.Z["upgrade-trigger-section"]},React.createElement(i.Z,{className:L.Z["upgrade-trigger"],description:ie?__("Your site is not receiving the latest updates to automatic rules","jetpack-protect",0):__("Set up automatic rules with one click","jetpack-protect"),cta:ie?__("Upgrade to keep your site secure with up-to-date firewall rules","jetpack-protect",0):__("Upgrade to enable automatic firewall protection","jetpack-protect"),onClick:Ee}))),Pe=React.createElement(React.Fragment,null,React.createElement("div",{className:L.Z["brute-force-rules-section"]},React.createElement(I.Z,{id:"jetpack_waf_ip_allow_list",label:__("Always allowed IP addresses","jetpack-protect"),description:React.createElement(React.Fragment,null,React.createElement(r.ZP,{mb:1},__("IP addresses added to this list will never be blocked by Jetpack's brute force protection.","jetpack-protect")),React.createElement("div",{className:L.Z["current-ip-text"]},React.createElement(r.ZP,{variant:"body-small",mb:1},(0,m.createInterpolateElement)((0,h.sprintf)( -// translators: placeholder is the user's current IP address. -__("Your current IP: %s","jetpack-protect"),U),{strong:React.createElement("strong",null)})),React.createElement(s.Z,{variant:"secondary",size:"small",onClick:je,disabled:ue||Re},__("+ Add to Allow List","jetpack-protect")))),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:pe.jetpack_waf_ip_allow_list,onChange:be,disabled:ue})),React.createElement(s.Z,{onClick:ke,isLoading:ue,disabled:ue},__("Save changes","jetpack-protect"))),xe=React.createElement(React.Fragment,null,React.createElement("div",{className:L.Z["toggle-section"]},React.createElement("div",{className:L.Z["toggle-section__control"]},React.createElement(P.Z,{id:"brute_force_protection",checked:pe.brute_force_protection,onChange:Ze,disabled:ue})),React.createElement("div",{className:L.Z["toggle-section__content"]},React.createElement(r.ZP,{variant:"title-medium",mb:2},__("Enable brute force protection","jetpack-protect")),React.createElement(r.ZP,null,__("Prevent bots and hackers from attempting to log in to your website with common username and password combinations.","jetpack-protect")))),!G&&pe.brute_force_protection&&Pe),Ie=React.createElement("div",{className:L.Z["toggle-wrapper"]},G&&Ne,xe,G&&React.createElement("div",{className:`${L.Z["toggle-section"]} ${V||H?"":L.Z["toggle-section--disabled"]}`},React.createElement("div",{className:L.Z["toggle-section__control"]},React.createElement(P.Z,{id:"jetpack_waf_ip_list",checked:(H||V)&&pe.jetpack_waf_ip_list,onChange:_e,disabled:ue||!H&&!V})),React.createElement("div",{className:L.Z["toggle-section__content"]},React.createElement(r.ZP,{variant:"title-medium",mb:2},__("Enable manual block and allow lists","jetpack-protect")),React.createElement(r.ZP,null,__("Manually block or allow traffic from specific IP addresses.","jetpack-protect")),z&&React.createElement("div",{className:L.Z["toggle-section__details"]},React.createElement("div",{className:L.Z["manual-rules-stats"]},0===q&&0===K&&React.createElement(r.ZP,{className:L.Z["manual-rules-stats__no-rules"],variant:"body-small",mt:2},__("No manual rules are being applied.","jetpack-protect")),K>0&&React.createElement(r.ZP,{className:L.Z["manual-rules-stats__block-list-count"],variant:"body-small",mt:2},(0,h.sprintf)( -// translators: placeholder is a number of blocked IP addresses i.e. "5 IPs are being blocked". -_n("%s IP is being blocked. ","%s IPs are being blocked. ",K,"jetpack-protect"),1===K?"One":K)),q>0&&React.createElement(r.ZP,{className:L.Z["manual-rules-stats__allow-list-count"],variant:"body-small",mt:2},(0,h.sprintf)( -// translators: placeholder is a number of allowed IP addresses i.e. "5 IPs are being allowed". -_n("%s IP is being allowed.","%s IPs are being allowed.",q,"jetpack-protect"),1===q?"One":q))),React.createElement(s.Z,{variant:"link",disabled:!H&&!V},React.createElement(r.ZP,{variant:"body-small",onClick:we},__("Edit manual rules","jetpack-protect"))))))),Le=React.createElement("div",null,React.createElement(s.Z,{className:L.Z["go-back-button"],variant:"icon",icon:v.Z,onClick:we},React.createElement(r.ZP,null,__("Go back","jetpack-protect"))),React.createElement(r.ZP,{variant:"title-medium",mt:4,mb:2},__("Manual rules","jetpack-protect")),React.createElement(r.ZP,{mb:4},__("Add manual rules for what IP traffic the Jetpack Firewall and brute force protection should block or allow.","jetpack-protect")),G&&React.createElement("div",{className:L.Z["manual-rules-section"]},React.createElement(I.Z,{id:"jetpack_waf_ip_block_list",label:__("Blocked IP addresses","jetpack-protect"),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:pe.jetpack_waf_ip_block_list,onChange:be,disabled:ue})),React.createElement("div",{className:L.Z["manual-rules-section"]},React.createElement(I.Z,{id:"jetpack_waf_ip_allow_list",label:__("Always allowed IP addresses","jetpack-protect"),description:React.createElement("div",{className:L.Z["current-ip-text"]},React.createElement(r.ZP,{variant:"body-small",mb:1},(0,m.createInterpolateElement)((0,h.sprintf)( -// translators: placeholder is the user's current IP address. -__("Your current IP: %s","jetpack-protect"),U),{strong:React.createElement("strong",null)})),React.createElement(s.Z,{variant:"secondary",size:"small",onClick:je,disabled:ue||Re},__("+ Add to Allow List","jetpack-protect"))),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:pe.jetpack_waf_ip_allow_list,onChange:be,disabled:ue})),React.createElement(s.Z,{onClick:ke,isLoading:ue,disabled:ue},__("Save changes","jetpack-protect")));return React.createElement(j.Z,null,React.createElement(N.Z,null),React.createElement(o.Z,{className:L.Z.container,horizontalSpacing:8,horizontalGap:4},G&&!H&&React.createElement(l.Z,null,Se," "),React.createElement(l.Z,null,he?Le:Ie)),G?React.createElement(S.Z,null):React.createElement(x.Z,null))}},8840:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(5106),c=a(526),r=a(9818),s=a(5736),i=a(9196),o=a(4633),l=a(9974),p=a(8891),d=a(2854),u=a(5823);const __=s.__,m=({threatList:e=[]})=>{const{setModal:t,fixThreats:a}=(0,r.useDispatch)(o.t),{threatsUpdating:s}=(0,r.useSelect)((e=>e(o.t).getThreatsUpdating())),[m,h]=(0,i.useState)(e.map((({id:e})=>e))),g=(0,i.useCallback)(((e,t)=>{h(e?m.push(t.id):m.filter((e=>e!==t.id)))}),[m]);return React.createElement(d.Z,null,React.createElement(l.Z,null,React.createElement(n.ZP,{variant:"title-medium",mb:2},__("Fix all threats","jetpack-protect")),React.createElement(n.ZP,{mb:3},__("Jetpack will be fixing the selected threats:","jetpack-protect")),React.createElement("div",{className:u.Z.list},e.map((e=>React.createElement(p.Z,{key:e.id,threat:e,fixAllDialog:!0,onCheckFix:g})))),React.createElement("div",{className:u.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),t({type:null})}},__("Cancel","jetpack-protect")),React.createElement(c.Z,{isLoading:Boolean(s)&&s[m[0]],onClick:async e=>{e.preventDefault(),a(m,(()=>{t({type:null})}))}},__("Fix all threats","jetpack-protect")))))}},1593:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(5106),c=a(526),r=a(9818),s=a(5736),i=a(4633),o=a(9974),l=a(8891),p=a(2854),d=a(7279);const __=s.__,u=({id:e,fixable:t,label:a,icon:s,severity:u})=>{const{setModal:m,fixThreats:h}=(0,r.useDispatch)(i.t),g=(0,r.useSelect)((e=>e(i.t).getThreatsUpdating()));return React.createElement(p.Z,null,React.createElement(o.Z,null,React.createElement(n.ZP,{variant:"title-medium",mb:2},__("Fix Threat","jetpack-protect")),React.createElement(n.ZP,{mb:3},__("Jetpack will be fixing the selected threat:","jetpack-protect")),React.createElement("div",{className:d.Z.list},React.createElement(l.Z,{threat:{id:e,fixable:t,label:a,icon:s,severity:u},fixAllDialog:!1})),React.createElement("div",{className:d.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),m({type:null})}},__("Cancel","jetpack-protect")),React.createElement(c.Z,{isLoading:Boolean(g&&g[e]),onClick:async t=>{t.preventDefault(),h([e],(()=>{m({type:null})}))}},__("Fix threat","jetpack-protect")))))}},5678:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(1234);const r=({ariaLabel:e,checked:t=!1,className:a="",disabled:r=!1,id:s,onChange:i=(()=>{}),onKeyDown:o=(()=>{}),switchClassNames:l="",toggling:p})=>{const d=(0,n.useCallback)((e=>{r||i(e)}),[r,i]),u=(0,n.useCallback)((e=>{r||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i(e)),o(e))}),[r,i,o]);return React.createElement(React.Fragment,null,React.createElement("div",null,React.createElement("input",{className:`${c.Z["form-toggle"]} ${a} ${p?c.Z["is-toggling"]:""}`,type:"checkbox",checked:t,readOnly:!0,disabled:r}),React.createElement("span",{className:`${c.Z["form-toggle__switch"]} ${l}`,disabled:r,id:s,onClick:d,onKeyDown:u,role:"checkbox","aria-checked":t,"aria-label":e,tabIndex:r?-1:0})))}},3584:(e,t,a)=>{"use strict";a.d(t,{U:()=>m,Z:()=>h});var n=a(5106),c=a(1074),r=a(7489),s=a(2229),i=a(5235),o=a.n(i),l=a(9196),p=a.n(l),d=a(9122);const u=p().createContext(),m=({id:e,title:t,label:a,icon:i,children:m,onOpen:h})=>{const g=(0,l.useContext)(u),f=g?.open===e,v=g?.setOpen,E=o()(d.Z["accordion-body"],{[d.Z["accordion-body-open"]]:f,[d.Z["accordion-body-close"]]:!f}),k=(0,l.useCallback)((()=>{f||h?.(),v((t=>t===e?null:e))}),[f,h,v,e]);return p().createElement("div",{className:d.Z["accordion-item"]},p().createElement("button",{className:d.Z["accordion-header"],onClick:k},p().createElement("div",null,p().createElement(n.ZP,{className:d.Z["accordion-header-label"],mb:1},p().createElement(c.Z,{icon:i,className:d.Z["accordion-header-label-icon"]}),a),p().createElement(n.ZP,{className:d.Z["accordion-header-description"],variant:f?"title-small":"body"},t)),p().createElement("div",{className:d.Z["accordion-header-button"]},p().createElement(c.Z,{icon:f?r.Z:s.Z,size:38}))),p().createElement("div",{className:E,"aria-hidden":f?"false":"true"},m))},h=({children:e})=>{const[t,a]=(0,l.useState)();return p().createElement(u.Provider,{value:{open:t,setOpen:a}},p().createElement("div",{className:d.Z.accordion},e))}},3116:(e,t,a)=>{"use strict";a.d(t,{Z:()=>h});var n=a(6895),c=a(5106),r=a(526),s=a(9818),i=a(9307),o=a(5736),l=a(1074),p=a(4633),d=a(2251),u=a(2854),m=a(6983);const __=o.__,h=({id:e,title:t,label:a,icon:o,severity:h})=>{const{setModal:g,ignoreThreat:f}=(0,s.useDispatch)(p.t),v=(0,s.useSelect)((e=>e(p.t).getThreatsUpdating())),E=(0,n.Z)("jetpack-protect-codeable-referral");return React.createElement(u.Z,null,React.createElement(c.ZP,{variant:"title-medium",mb:2},__("Do you really want to ignore this threat?","jetpack-protect")),React.createElement(c.ZP,{mb:3},__("Jetpack will ignore the threat:","jetpack-protect")),React.createElement("div",{className:m.Z.threat},React.createElement(l.Z,{icon:o,className:m.Z.threat__icon}),React.createElement("div",{className:m.Z.threat__summary},React.createElement(c.ZP,{className:m.Z.threat__summary__label,mb:1},a),React.createElement(c.ZP,{className:m.Z.threat__summary__title},t)),React.createElement("div",{className:m.Z.threat__severity},React.createElement(d.Z,{severity:h}))),React.createElement(c.ZP,{mb:4},(0,i.createInterpolateElement)(__("By ignoring this threat you confirm that you have reviewed the detected code and assume the risks of keeping 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.Z,{variant:"link",isExternalLink:!0,href:E})})),React.createElement("div",{className:m.Z.footer},React.createElement(r.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),g({type:null})}},__("Cancel","jetpack-protect")),React.createElement(r.Z,{isDestructive:!0,isLoading:Boolean(v&&v[e]),onClick:async t=>{t.preventDefault(),f(e,(()=>{g({type:null})}))}},__("Ignore threat","jetpack-protect"))))}},6402:(e,t,a)=>{"use strict";a.d(t,{Z:()=>f});var n=a(9105),c=a(5106),r=a(216),s=a(3363),i=a(3846),o=a(9307),l=a(5736),p=a(9196),d=a.n(p),u=a(6477),m=a(8266),h=a(9401),g=a(2951);const __=l.__,f=({onScanAdd:e})=>((0,u.Z)({pageViewEventName:"protect_interstitial"}),d().createElement(n.Z,{moduleName:__("Jetpack Protect","jetpack-protect"),header:d().createElement("div",{className:g.Z["protect-header"]},d().createElement(m.Z,null),d().createElement(c.ZP,{variant:"body-small"},(0,o.createInterpolateElement)(__("Already have an existing plan or license key? Click here to get started","jetpack-protect"),{a:d().createElement("a",{href:"admin.php?page=my-jetpack#/add-license"})})))},d().createElement(r.Z,null,d().createElement(s.Z,{horizontalSpacing:3,horizontalGap:3},d().createElement(i.Z,{sm:4,md:8,lg:12},d().createElement(h.Z,{onScanAdd:e}))))))},8266:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(5609),c=a(9196),r=a.n(c);function s({iconColor:e="#069E08",color:t="#000"}){return r().createElement(n.SVG,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 245 41",width:245},r().createElement(n.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(n.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(n.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(n.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(n.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(n.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(n.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(n.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(n.Path,{d:"M21.104 16.7295V36.2209L31.1571 16.7295H21.104Z",fill:"white"}),r().createElement(n.Path,{d:"M19.0701 23.4444V3.99023L9.05566 23.4444H19.0701Z",fill:"white"}),r().createElement(n.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(n.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(n.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(n.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(n.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(n.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(n.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}))}},4257:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(8735);const c=e=>React.createElement("mark",{key:e,className:n.Z["marked-lines__mark"]},e),r=({context:e})=>{const{marks:t,...a}=e;return React.createElement("div",{className:n.Z["marked-lines"]},React.createElement("div",{className:n.Z["marked-lines__line-numbers"]},Object.keys(a).map((e=>{const a=t.hasOwnProperty(e);return React.createElement("div",{key:e,className:`${n.Z["marked-lines__line-number"]} ${a?n.Z["marked-lines__marked-line"]:""}`},e)}))),React.createElement("div",{className:n.Z["marked-lines__lines"]},Object.keys(a).map((e=>{const r=a[e]||" ",s=t.hasOwnProperty(e);return React.createElement("div",{key:e,className:`${n.Z["marked-lines__line"]} ${s?n.Z["marked-lines__marked-line"]:""} `},React.createElement(React.Fragment,null,s?((e,t)=>{const[a,n]=e.reduce((([e,a],[n,r])=>{const s=t.slice(n,r);return[[...e,...n>a?[t.slice(a,n),c(s)]:[c(s)]],r]}),[[],0]);return n{"use strict";a.d(t,{Z:()=>g});var n=a(9818),c=a(5736),r=a(1074),s=a(9517),i=a(4633),o=a(9886),l=a(8840),p=a(1593),d=a(3116),u=a(8959),m=a(9980);const __=c.__,h={IGNORE_THREAT:d.Z,FIX_THREAT:p.Z,FIX_ALL_THREATS:l.Z,CREDENTIALS_NEEDED:o.Z,STANDALONE_MODE:u.Z},g=()=>{const e=(0,n.useSelect)((e=>e(i.t).getModalType())),t=(0,n.useSelect)((e=>e(i.t).getModalProps())),{setModal:a}=(0,n.useDispatch)(i.t);if(!e)return null;const c=h[e];return React.createElement("div",{className:m.Z.modal},React.createElement("div",{className:m.Z.modal__window},React.createElement("button",{onClick:e=>{e.preventDefault(),a({type:null})},className:m.Z.modal__close,title:__("Close Modal Window","jetpack-protect")},React.createElement(r.Z,{icon:s.Z,size:24,className:m.Z.modal__close__icon,"aria-label":__("Close Modal Window","jetpack-protect")})),React.createElement(c,t)))}},5167:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(5106),c=a(5609),r=a(5736),s=a(1074),i=a(496),o=a(9201),l=a(5162),p=a.n(l),d=a(9196),u=a.n(d),m=a(513);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:u().createElement(s.Z,{icon:o.Z,size:28,className:m.Z["navigation-item-check-badge"]})}:{popoverText:null,badgeElement:u().createElement(n.ZP,{variant:"body-extra-small",className:m.Z["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:u().createElement(s.Z,{icon:i.Z,size:28,className:m.Z["navigation-item-info-badge"]})})(e,t),[l,p]=(0,d.useState)(!1),h=(0,d.useCallback)((()=>{p(!0)}),[]),g=(0,d.useCallback)((()=>{p(!1)}),[]);return u().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,l&&u().createElement(c.Popover,{noArrow:!1,inline:!0},u().createElement(n.ZP,{variant:"body-small",className:m.Z["popover-text"]},a)))};h.propTypes={count:p().number,checked:p().bool};const g=h},2328:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(526),c=a(5736),r=a(9196),s=a.n(r),i=a(2389),o=a(513),l=a(246);const __=c.__,p=({icon:e,label:t,children:a})=>{const[p,d]=(0,r.useState)(!0),{mode:u}=(0,r.useContext)(l.k),m=Array.isArray(a)&&a?.length>=8&&"list"===u,h=m&&p?a.slice(0,8):a,g=m?a?.length-8:0,f=(0,r.useCallback)((()=>{d((e=>!e))}),[]);return s().createElement("li",{tabIndex:-1,role:"menuitem",className:o.Z["navigation-group"]},s().createElement(i.Z,{icon:e,className:o.Z["navigation-group-label"]},t),s().createElement("div",{className:o.Z["navigation-group-list"]},s().createElement("ul",{className:o.Z["navigation-group-content"]},h),m&&s().createElement("div",{className:o.Z["navigation-group-truncate"]},s().createElement(n.Z,{variant:"link",onClick:f},p?(0,c.sprintf)(/* translators: %s: Number of hide items */ -__("Show %s more","jetpack-protect"),g):(0,c.sprintf)(/* translators: %s: Number of hide items */ -__("Hide %s items","jetpack-protect"),g)))))}},5338:(e,t,a)=>{"use strict";a.d(t,{Dx:()=>u.Z,KB:()=>d.Z,ZP:()=>v});var n=a(5106),c=a(5609),r=a(5736),s=a(1074),i=a(7489),o=a(2229),l=a(9196),p=a.n(l),d=a(2328),u=a(6119),m=a(513),h=a(246);const __=r.__,g=({children:e})=>p().createElement("ul",{className:m.Z.navigation,role:"menu"},e),f=({children:e,data:t})=>{const a=(0,l.useRef)(),[r,d]=(0,l.useState)(!1),u=t?.items?.find((e=>e?.id===t?.selectedItem))??{label:__("See all results","jetpack-protect")},{label:h,icon:g}=u,f=(0,l.useCallback)((()=>{d((e=>!e))}),[]);return p().createElement("button",{className:m.Z["navigation-dropdown-button"],onClick:f,ref:a},p().createElement("div",{className:m.Z["navigation-dropdown-label"]},g&&p().createElement(s.Z,{icon:g,className:m.Z["navigation-dropdown-icon"]}),p().createElement(n.ZP,null,h)),p().createElement(s.Z,{icon:r?i.Z:o.Z,size:32}),p().createElement(c.Popover,{position:"bottom center",anchorRef:a?.current,inline:!0},p().createElement("div",{style:{display:r?"block":"none",width:a?.current?.getBoundingClientRect?.()?.width}},e)))},v=({children:e,selected:t,onSelect:a,mode:n="list"})=>{const c=(0,h.Z)({selected:t,onSelect:a}),r=(e=>{switch(e){case"list":default:return g;case"dropdown":return f}})(n);return p().createElement(h.k.Provider,{value:{...c,mode:n}},p().createElement(r,{data:c},e))}},6119:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5235),c=a.n(n),r=a(9196),s=a.n(r),i=a(5167),o=a(2389),l=a(513),p=a(246);const d=({id:e,label:t,icon:a,badge:n,disabled:d,onClick:u,onKeyDown:m,onFocus:h,checked:g})=>{const f=(0,r.useContext)(p.k),v=f?.selectedItem===e,E=f?.registerItem,k=f?.registerRef,b=f?.handleClickItem,y=f?.handleKeyDownItem,Z=f?.handleFocusItem,_=c()(l.Z["navigation-item"],{[l.Z.clickable]:!d,[l.Z.selected]:v}),w=(0,r.useCallback)((t=>{u?.(t),b?.(e)}),[b,e,u]),C=(0,r.useCallback)((e=>{m?.(e),y?.(e)}),[y,m]),R=(0,r.useCallback)((t=>{k(t,e)}),[k,e]),j=(0,r.useCallback)((t=>{h?.(t),Z?.(e)}),[Z,e,h]);return(0,r.useEffect)((()=>{E({id:e,disabled:d,label:t,icon:a})}),[]),s().createElement("li",{className:_,onClick:d?null:w,onKeyDown:C,onFocus:d?null:j,role:"menuitem",tabIndex:d?-1:0,ref:R},s().createElement(o.Z,{icon:a},t),s().createElement(i.Z,{count:n,checked:g}))}},2389:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(5106),c=a(1074),r=a(5235),s=a.n(r),i=a(5162),o=a.n(i),l=a(9196),p=a.n(l),d=a(513);const u=({icon:e,children:t,className:a})=>p().createElement(n.ZP,{className:s()(d.Z["navigation-item-label"],a)},e&&p().createElement(c.Z,{icon:e,className:d.Z["navigation-item-icon"],size:28}),p().createElement("span",{className:d.Z["navigation-item-label-content"]},t));u.propTypes={icon:o().node,children:o().node.isRequired};const m=u},246:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r,k:()=>c});var n=a(9196);const c=a.n(n)().createContext(),r=({selected:e,onSelect:t})=>{const[a,c]=(0,n.useState)([]),[r,s]=(0,n.useState)([]),[i,o]=(0,n.useState)(),l=(e,t)=>{const n=e-1,c=n<0?t:n,r=a[c];return r?.disabled?l(c,t):r},p=(e,t)=>{const n=e+1,c=n>t?0:n,r=a[c];return r?.disabled?p(c,t):r};return{selectedItem:e,handleClickItem:e=>{t(e)},handleKeyDownItem:n=>{const c=n?.code,s=a.findIndex((t=>t?.id===e)),o=a.length-1;let d;if("ArrowUp"===c){const e=l(s,o);d=e?.id}else if("ArrowDown"===c){const e=p(s,o);d=e?.id}else"Enter"!==c&&"Space"!==c||!i||(d=i);if(d){const e=r[d];e?.focus(),t(d)}},handleFocusItem:e=>{o(e)},registerRef:(e,t)=>{s((a=>!a[t]&&e?{...a,[t]:e}:a))},registerItem:e=>{c((t=>{const a=[...t],n=e?.id,c=a.findIndex((e=>e?.id===n));return c>=0?a[c]=e:a.push(e),a}))},items:a}}},291:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(9818),c=a(5736),r=a(9201),s=a(797),i=a(496),o=a(1074),l=a(9517),p=a(9196),d=a(4633),u=a(8212);const __=c.__,m=({dismissable:e=!1,duration:t=null,floating:a=!1,message:c,type:m="success"})=>{const{clearNotice:h}=(0,n.useDispatch)(d.t);let g;switch(m){case"success":g=r.Z;break;case"error":g=s.Z;break;default:g=i.Z}const f=(0,p.useCallback)((()=>{h()}),[h]);return(0,p.useEffect)((()=>{let e;return t&&(e=setTimeout(h,t)),()=>clearTimeout(e)}),[h,t,c]),React.createElement("div",{className:`${u.Z.notice} ${u.Z[`notice--${m}`]} ${a?u.Z["notice--floating"]:""}`},React.createElement("div",{className:u.Z.notice__icon},React.createElement(o.Z,{icon:g})),React.createElement("div",{className:u.Z.notice__message},c),e&&React.createElement("button",{className:u.Z.notice__close,"aria-label":__("Dismiss notice.","jetpack-protect"),onClick:f},React.createElement(o.Z,{icon:l.Z})))}},1707:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(4471),c=a(5736),r=a(9196),s=a(2218);const __=c.__,i=({id:e,anchor:t,position:a})=>{const{stepsCount:c,currentStep:i,currentStepCount:o,completeCurrentStep:l,completeAllCurrentSteps:p}=(0,s.ZP)(),{setRenderedSteps:d}=(0,r.useContext)(s.Yx);return(0,r.useEffect)((()=>(d((t=>[...t,e])),()=>{d((t=>t.filter((t=>t!==e))))})),[e,d]),i?.id!==e?null:React.createElement(n.Z,{anchor:t,title:i.title,noArrow:!1,children:i.description,buttonContent:o{"use strict";a.d(t,{Z:()=>y,c:()=>b});var n=a(2054),c=a(5106),r=a(5033),s=a(9818),i=a(5736),o=a(1074),l=a(9201),p=a(7489),d=a(2229),u=a(5235),m=a.n(u),h=a(9196),g=a.n(h),f=a(4633),v=a(2251),E=a(7324);const __=i.__,k=g().createContext(),b=({id:e,title:t,label:a,icon:i,fixable:u,severity:b,children:y,onOpen:Z})=>{const _=(0,h.useContext)(k),w=_?.open===e,C=_?.setOpen,R=(0,s.useSelect)((e=>e(f.t).getThreatsAreFixing())),j=m()(E.Z["accordion-body"],{[E.Z["accordion-body-open"]]:w,[E.Z["accordion-body-close"]]:!w}),S=(0,h.useCallback)((()=>{w||Z?.(),C((t=>t===e?null:e))}),[w,Z,C,e]),[N]=(0,n.Z)(["sm","lg"],[null,"<"]);return g().createElement("div",{className:E.Z["accordion-item"]},g().createElement("button",{className:E.Z["accordion-header"],onClick:S},g().createElement("div",null,g().createElement(c.ZP,{className:E.Z["accordion-header-label"],mb:1},g().createElement(o.Z,{icon:i,className:E.Z["accordion-header-label-icon"]}),a),g().createElement(c.ZP,{className:E.Z["accordion-header-description"],variant:w?"title-small":"body"},t)),g().createElement("div",null,g().createElement(v.Z,{severity:b})),g().createElement("div",null,u&&g().createElement(g().Fragment,null,R.indexOf(e)>=0?g().createElement(r.Z,{color:"black"}):g().createElement(o.Z,{icon:l.Z,className:E.Z["icon-check"],size:28}),N&&g().createElement("span",null,__("Auto-fix","jetpack-protect")))),g().createElement("div",{className:E.Z["accordion-header-button"]},g().createElement(o.Z,{icon:w?p.Z:d.Z,size:38}))),g().createElement("div",{className:j,"aria-hidden":w?"false":"true"},y))},y=({children:e})=>{const[t,a]=(0,h.useState)();return g().createElement(k.Provider,{value:{open:t,setOpen:a}},g().createElement("div",{className:E.Z.accordion},e))}},9401:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(9608),c=a(5347),r=a(526),s=a(1294),i=a(9818),o=a(5736),l=a(9196),p=a.n(l),d=a(6477),u=a(5773),m=a(8963),h=a(4633);const __=o.__,g=({onScanAdd:e})=>{const{handleRegisterSite:t,registrationError:a}=(0,s.Z)({skipUserConnection:!0}),{refreshPlan:o,refreshStatus:g}=(0,i.useDispatch)(h.t),[f,v]=(0,l.useState)(!1),[E,k]=(0,l.useState)(!1),{jetpackScan:b}=(0,u.Z)(),{refreshWaf:y}=(0,m.Z)(),{pricingForUi:Z}=b,{introductoryOffer:_,currencyCode:w="USD"}=Z,C=Z.cost?Math.ceil(Z.cost/12*100)/100:null,R=_?.costPerInterval?Math.ceil(_.costPerInterval/12*100)/100:null,{recordEvent:j,recordEventHandler:S}=(0,d.Z)(),N=S("jetpack_protect_pricing_table_get_scan_link_click",(()=>{k(!0),e()})),P=(0,l.useCallback)((()=>{j("jetpack_protect_connected_product_activated"),v(!0),t().then((()=>v(!1))).then((()=>{o(),y(),g(!0)}))}),[t,j,y,o,g]),x={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 p().createElement(p().Fragment,null,p().createElement(n.ZP,x,p().createElement(n.oK,{primary:!0},p().createElement(n.NE,null,p().createElement(c.Z,{price:C,offPrice:R,leyend:__("/month, billed yearly","jetpack-protect"),currency:w,hideDiscountLabel:!1}),p().createElement(r.Z,{fullWidth:!0,onClick:N,isLoading:E,disabled:f||E},__("Get Jetpack Protect","jetpack-protect"))),p().createElement(n.kF,{isIncluded:!0,label:p().createElement("strong",null,__("Line by line malware scanning","jetpack-protect"))}),p().createElement(n.kF,{isIncluded:!0,label:p().createElement("strong",null,__("Plus on-demand manual scans","jetpack-protect"))}),p().createElement(n.kF,{isIncluded:!0,label:p().createElement("strong",null,__("Automatic protection and rule updates","jetpack-protect"))}),p().createElement(n.kF,{isIncluded:!0}),p().createElement(n.kF,{isIncluded:!0}),p().createElement(n.kF,{isIncluded:!0}),p().createElement(n.kF,{isIncluded:!0}),p().createElement(n.kF,{isIncluded:!0})),p().createElement(n.oK,null,p().createElement(n.NE,null,p().createElement(c.Z,{price:0,leyend:__("Free forever","jetpack-protect"),currency:w,hidePriceFraction:!0}),p().createElement(r.Z,{fullWidth:!0,variant:"secondary",onClick:P,isLoading:f,disabled:f||E,error:a?__("An error occurred. Please try again.","jetpack-protect"):null},__("Start for free","jetpack-protect"))),p().createElement(n.kF,{isIncluded:!0,label:__("Check items against database","jetpack-protect")}),p().createElement(n.kF,{isIncluded:!0}),p().createElement(n.kF,{isIncluded:!0,label:__("Manual rules only","jetpack-protect")}),p().createElement(n.kF,{isIncluded:!0}),p().createElement(n.kF,{isIncluded:!1}),p().createElement(n.kF,{isIncluded:!1}),p().createElement(n.kF,{isIncluded:!1}),p().createElement(n.kF,{isIncluded:!1}))))}},1233:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(5235),c=a.n(n),r=a(6067);const s=({className:e,total:t=100,value:a})=>{if(null==a)return null;const n=Math.min(Math.round(a/t*100),100),s={width:`${n}%`};return React.createElement("div",{className:c()(e,r.Z["progress-bar"])},React.createElement("div",{className:r.Z["progress-bar__wrapper"]},React.createElement("div",{"aria-valuemax":t,"aria-valuemin":0,"aria-valuenow":Math.min(a,t),className:r.Z["progress-bar__bar"],role:"progressbar",style:s})),React.createElement("p",{className:r.Z["progress-bar__percent"]},`${n}%`))}},5800:(e,t,a)=>{"use strict";a.d(t,{Z:()=>b});var n=a(6895),c=a(5106),r=a(526),s=a(857),i=a(3363),o=a(3846),l=a(8258),p=a(5736),d=a(9196),u=a.n(d),m=a(3898),h=a(6477),g=a(5773),f=a(9909),v=a(8383);const __=p.__,E=()=>{const{adminUrl:e,siteSuffix:t,blogID:a}=window.jetpackProtectInitialState||{},{run:i}=(0,l.Z)({productSlug:m.o,redirectUrl:e,useBlogIdSuffix:!0}),{recordEventHandler:o}=(0,h.Z)(),p=o("jetpack_protect_footer_get_scan_link_click",i),{hasRequiredPlan:d}=(0,g.Z)();if(d){const e=(0,n.Z)("jetpack-scan-dash",{site:a??t});return u().createElement("div",{className:v.Z["product-section"]},u().createElement(c.Dx,null,__("Get access to our Cloud","jetpack-protect")),u().createElement(c.ZP,{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")),u().createElement(r.Z,{variant:"secondary",weight:"regular",href:e},__("Go to Cloud","jetpack-protect")))}return u().createElement("div",{className:v.Z["product-section"]},u().createElement(c.Dx,null,__("Advanced scan results","jetpack-protect")),u().createElement(c.ZP,{mb:3},__("Upgrade Jetpack Protect to get advanced scan tools, including one-click fixes for most threats and malware scanning.","jetpack-protect")),u().createElement(s.Z,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:p}))},k=()=>{const{hasRequiredPlan:e}=(0,g.Z)();if(e){const e=(0,n.Z)("protect-footer-learn-more-scan");return u().createElement("div",{className:v.Z["info-section"]},u().createElement(c.Dx,null,__("Line-by-line scanning","jetpack-protect")),u().createElement(c.ZP,{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"),u().createElement(r.Z,{variant:"link",target:"_blank",weight:"regular",href:e},__("Learn more","jetpack-protect"))))}const t=(0,n.Z)("jetpack-protect-footer-learn-more");return u().createElement("div",{className:v.Z["info-section"]},u().createElement(c.Dx,null,__("Over 22,000 listed vulnerabilities","jetpack-protect")),u().createElement(c.ZP,{mb:3},__("Every day we check your plugin, theme, and WordPress versions against our 22,000 listed vulnerabilities powered by WPScan, an Automattic brand.","jetpack-protect")),u().createElement(r.Z,{variant:"link",isExternalLink:!0,href:t,weight:"regular"},__("Learn more","jetpack-protect")))},b=()=>{const{waf:e}=window.jetpackProtectInitialState||{};return e.wafSupported?u().createElement(f.Z,{main:u().createElement(E,null),secondary:u().createElement(k,null),preserveSecondaryOnMobile:!0}):u().createElement(i.Z,{horizontalSpacing:0,horizontalGap:0,fluid:!1},u().createElement(o.Z,null,u().createElement(k,null)))}},8686:(e,t,a)=>{"use strict";a.d(t,{Z:()=>N});var n=a(216),c=a(3363),r=a(3846),s=a(5106),i=a(3329),o=a(5609),l=a(9818),p=a(5736),d=a(9196),u=a.n(d),m=a(6477),h=a(2218),g=a(5773),f=a(4633),v=a(7267),E=a(4948),k=a(1233),b=a(5800),y=a(9909),Z=a(4910),_=a(5207),w=a(5983),C=a(6809),R=a(61),j=a(8264),S=a(6165);const __=p.__,N=()=>{const{lastChecked:e,currentStatus:t,errorCode:a,errorMessage:p,hasRequiredPlan:N}=(0,g.Z)(),{hasConnectionError:P}=(0,i.Z)(),{refreshStatus:x}=(0,l.useDispatch)(f.t),{statusIsFetching:I,scanIsUnavailable:L,status:M}=(0,l.useSelect)((e=>({statusIsFetching:e(f.t).getStatusIsFetching(),scanIsUnavailable:e(f.t).getScanIsUnavailable(),status:e(f.t).getStatus()}))),{currentProgress:T}=M;let A;if(A="error"===t||L?"error":e?"active":"in_progress",(0,S.Z)(),(0,j.Z)(),(0,d.useEffect)((()=>{I||"unavailable"!==M.status||L||x(!0)}),[I,M.status,x,L]),(0,m.Z)({pageViewEventName:"protect_admin",pageViewEventProperties:{check_status:A,has_plan:N}}),"error"===t||L){let e=p?`${p} (${a}).`:__("We are having problems scanning your site.","jetpack-protect");return e+=" "+__("Try again in a few minutes.","jetpack-protect"),u().createElement(v.Z,null,u().createElement(n.Z,null,u().createElement(c.Z,{horizontalSpacing:0},P&&u().createElement(r.Z,{className:R.Z["connection-error-col"]},u().createElement(i.h,null)),u().createElement(r.Z,null,u().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),u().createElement(y.Z,{main:u().createElement("div",{className:R.Z["main-content"]},u().createElement(E.Z,{className:R.Z["alert-icon-wrapper"]}),u().createElement(s.H3,null,__("We’re having problems scanning your site","jetpack-protect")),u().createElement(s.ZP,null,e)),secondary:u().createElement("div",{className:R.Z.illustration},u().createElement("img",{src:w,alt:""})),preserveSecondaryOnMobile:!1})),u().createElement(b.Z,null))}return["scheduled","scanning","optimistically_scanning"].indexOf(M.status)>=0||!e?u().createElement(v.Z,null,u().createElement(n.Z,null,u().createElement(c.Z,{horizontalSpacing:0},P&&u().createElement(r.Z,{className:R.Z["connection-error-col"]},u().createElement(i.h,null)),u().createElement(r.Z,null,u().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),u().createElement(y.Z,{main:u().createElement("div",{className:R.Z["main-content"]},u().createElement(c.Z,{horizontalSpacing:3,horizontalGap:7},u().createElement(r.Z,{className:R.Z["loading-content"]},u().createElement(o.Spinner,{style:{color:"black",marginTop:0,marginLeft:0}}),u().createElement("span",null,__("Scanning your site…","jetpack-protect"))),u().createElement(r.Z,null,u().createElement(s.H3,{style:{textWrap:"balance"}},__("Your results will be ready soon","jetpack-protect")),null!==T&&T>=0&&u().createElement(k.Z,{value:T}),u().createElement(s.ZP,null,__("We are scanning for security threats from our more than 22,000 listed vulnerabilities, powered by WPScan. This could take a minute or two.","jetpack-protect"))))),secondary:u().createElement("div",{className:R.Z.illustration},u().createElement("img",{src:w,alt:""})),preserveSecondaryOnMobile:!1})),u().createElement(b.Z,null)):u().createElement(h.em.Provider,{value:C.Z},u().createElement(v.Z,null,u().createElement(n.Z,null,u().createElement(c.Z,{horizontalSpacing:0},P&&u().createElement(r.Z,{className:R.Z["connection-error-col"]},u().createElement(i.h,null)),u().createElement(r.Z,null,u().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),u().createElement(c.Z,{horizontalSpacing:3,horizontalGap:7},u().createElement(r.Z,null,u().createElement(Z.Z,null)),u().createElement(r.Z,null,u().createElement(_.Z,null)))),u().createElement(b.Z,null)))}},6809:(e,t,a)=>{"use strict";a.d(t,{Z:()=>E});var n=a(2674),c=a.n(n),r=a(5106),s=a(526),i=a(6895),o=a(8258),l=a(9307),p=a(5736),d=a(3898),u=a(6477);const __=p.__,{adminUrl:m,siteSuffix:h}=window.jetpackProtectInitialState,g=__("Your scan results","jetpack-protect"),f=React.createElement(r.ZP,null,__("Navigate through the results of the scan on your WordPress installation, plugins, themes, and other files","jetpack-protect")),v=e=>{const{run:t}=(0,o.Z)({productSlug:d.o,redirectUrl:m}),{recordEventHandler:a}=(0,u.Z)(),n=a("jetpack_protect_onboarding_get_scan_link_click",t);return React.createElement(s.Z,c()({variant:"link",weight:"regular",onClick:n},e))},E=[{id:"free-scan-results",title:g,description:f},{id:"free-daily-scans",title:__("Daily automated scans","jetpack-protect"),description:React.createElement(r.ZP,null,(0,l.createInterpolateElement)(__("We run daily automated scans. Do you want ot be able to scan manually? Upgrade","jetpack-protect"),{upgradeLink:React.createElement(v,null)}))},{id:"paid-scan-results",title:g,description:f},{id:"paid-fix-all-threats",title:__("Auto-fix with one click","jetpack-protect"),description:React.createElement(r.ZP,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,l.createInterpolateElement)(__("Note that you'll have to input your server credentials first.","jetpack-protect"),{credentialsLink:React.createElement(s.Z,{variant:"link",weight:"regular",href:(0,i.Z)("jetpack-settings-security-credentials",{site:h})})}))},{id:"paid-understand-severity",title:__("Understand severity","jetpack-protect"),description:React.createElement(r.ZP,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.ZP,null,__("We run daily automated scans but you can also run on-demand scans if you want to check the latest status.","jetpack-protect"))}]},8264:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9818),c=a(9196),r=a(4633);const s=()=>{const{checkCredentials:e}=(0,n.useDispatch)(r.t),t=(0,n.useSelect)((e=>e(r.t).getCredentials()));(0,c.useEffect)((()=>{t||e()}),[e,t])}},6165:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(6989),c=a.n(n),r=a(9818),s=a(4769),i=a.n(s),o=a(9196),l=a(6477),p=a(4633);const d=()=>{const{recordEvent:e}=(0,l.Z)(),t=(0,r.useSelect)((e=>e(p.t).getStatus())),{setStatus:a,setStatusProgress:n,setStatusIsFetching:s,setScanIsUnavailable:d}=(0,r.useDispatch)(p.t);(0,o.useEffect)((()=>{let r;const o=e=>["scheduled","scanning"].indexOf(e)>=0,l=(e,t)=>!t&&"idle"===e,p=()=>new Promise(((e,t)=>{c()({path:"jetpack-protect/v1/status?hard_refresh=true",method:"GET"}).then((a=>{if(a?.error)throw a?.error_message;if(o(a?.status)||l(a?.status,a?.last_checked))return n(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(o(t?.status)||l(t?.status,t?.lastChecked))return r=setTimeout((()=>{s(!0),p().then((t=>{d("unavailable"===t.status),a(i()(t)),e("jetpack_protect_scan_completed",{scan_status:t.status})})).finally((()=>{s(!1)}))}),1e4),()=>clearTimeout(r)}),[t?.status,t?.lastChecked,d,a,n,s,e])}},9909:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(2054),c=a(3363),r=a(3846),s=a(9196),i=a.n(s);const o=({main:e,secondary:t,preserveSecondaryOnMobile:a=!1})=>{const[s,o]=(0,n.Z)(["sm","lg"]),l=!a&&s;return i().createElement(c.Z,{horizontalSpacing:0,horizontalGap:0,fluid:!1},!l&&i().createElement(i().Fragment,null,i().createElement(r.Z,{sm:12,md:4,lg:6},e),o&&i().createElement(r.Z,{lg:1}),i().createElement(r.Z,{sm:12,md:4,lg:5},t)),l&&i().createElement(r.Z,null,e))}},2251:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(5736),c=a(8131);const __=n.__,r=e=>e>=5?"is-critical":e>=3&&e<5?"is-high":"is-low",s=({severity:e})=>React.createElement("div",{className:`${c.Z["threat-severity-badge"]} ${c.Z[r(e)]}`},(e=>{const t=__("Critical","jetpack-protect"),a=__("High","jetpack-protect"),n=__("Low","jetpack-protect");return e>=5?t:e>=3&&e<5?a:n})(e))},8959:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5106),c=a(9307),r=a(5736),s=a(8911);const __=r.__,i=()=>React.createElement(React.Fragment,null,React.createElement(n.ZP,{variant:"title-medium-semi-bold",mb:2},__("Enhanced protection","jetpack-protect")),React.createElement(n.ZP,{mb:2},__("Learn how you can execute Jetpack Firewall before WordPress initializes. This mode offers the most protection.","jetpack-protect")),React.createElement("ul",{className:s.Z.list},React.createElement("li",{className:s.Z["list-item"]},React.createElement(n.ZP,{variant:"body-small"},(0,c.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:s.Z.mark})}))),React.createElement("li",{className:s.Z["list-item"]},React.createElement(n.ZP,{variant:"body-small"},__("Don't forget to undo this action when Firewall is turned off, or when you uninstall Jetpack.","jetpack-protect")))))},4910:(e,t,a)=>{"use strict";a.d(t,{Z:()=>E});var n=a(2054),c=a(3396),r=a(3363),s=a(3846),i=a(5106),o=a(526),l=a(9818),p=a(9771),d=a(5736),u=a(9196),m=a.n(u),h=a(5773),g=a(4633),f=a(1707),v=a(6561);const __=d.__,E=()=>{const[e]=(0,n.Z)("sm"),{numThreats:t,lastChecked:a,hasRequiredPlan:E}=(0,h.Z)(),k=(0,l.useSelect)((e=>e(g.t).getScanIsEnqueuing())),{scan:b}=(0,l.useDispatch)(g.t),y=(0,c.VS)("protect"),[Z,_]=(0,u.useState)(null),[w,C]=(0,u.useState)(null);return m().createElement(r.Z,{fluid:!0},m().createElement(s.Z,null,m().createElement("div",{className:v.Z.summary},m().createElement("div",null,m().createElement(i.Dx,{size:"small",className:v.Z.summary__title},m().createElement(y,{size:32,className:v.Z.summary__icon}),m().createElement("div",{ref:_},(0,d.sprintf)(/* translators: %s: Latest check date */ -__("Latest results as of %s","jetpack-protect"),(0,p.dateI18n)("F jS",a))),!E&&m().createElement(f.Z,{id:"free-daily-scans",position:e?"bottom":"middle right",anchor:Z})),t>0&&m().createElement(i.ZP,{variant:"headline-small",component:"h1"},(0,d.sprintf)(/* translators: %s: Total number of threats */ -__("%1$s %2$s found","jetpack-protect"),t,1===t?"threat":"threats"))),E&&0===t&&m().createElement(m().Fragment,null,m().createElement(o.Z,{ref:C,variant:"secondary",className:v.Z["summary__scan-button"],isLoading:k,onClick:e=>{e.preventDefault(),b()}},__("Scan now","jetpack-protect")),m().createElement(f.Z,{id:"paid-daily-and-manual-scans",position:"middle left",anchor:w})))))}},3324:(e,t,a)=>{"use strict";a.d(t,{O:()=>r,Z:()=>s});var n=a(554),c=a(5714);const r=({label:e,link:t})=>React.createElement(n.OL,{to:t,className:({isActive:e})=>e?`${c.Z.tab} ${c.Z["tab--active"]}`:c.Z.tab},e),s=({children:e,className:t=""})=>React.createElement("nav",{className:`${c.Z.tabs} ${t}`},e)},9265:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(8063);const c=({disabled:e=!1,id:t,label:a="",description:c="",placeholder:r="",rows:s=3,value:i="",onChange:o=(()=>{})})=>React.createElement("div",null,Boolean(a)&&React.createElement("label",{className:n.Z.label,htmlFor:t},a),Boolean(c)&&c,React.createElement("textarea",{className:n.Z.textarea,disabled:e,placeholder:r,rows:s,id:t,name:t,onChange:o,value:i||""}))},8891:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5106),c=a(5736),r=a(1074),s=a(9196),i=a.n(s),o=a(2251),l=a(9971);const __=c.__,p=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,c.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,c.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 d({threat:e,fixAllDialog:t,onCheckFix:a}){const[c,d]=(0,s.useState)(!0),u=(0,s.useCallback)((t=>{d(t.target.checked),a(t.target.checked,e)}),[a,e]);return i().createElement(i().Fragment,null,i().createElement("div",{className:l.Z.threat},i().createElement(r.Z,{icon:e.icon,className:l.Z.threat__icon}),i().createElement("div",{className:l.Z.threat__summary},i().createElement(n.ZP,{className:l.Z.threat__summary__label,mb:1},e.label),i().createElement(n.ZP,{className:l.Z.threat__summary__title},p(e.fixable))),i().createElement("div",{className:l.Z.threat__severity},i().createElement(o.Z,{severity:e.severity})),t&&i().createElement("div",{className:l.Z.threat__checkbox},i().createElement("input",{type:"checkbox",checked:c,onChange:u,value:e.id}))))}},5658:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(5106),c=a(9307),r=a(5736),s=a(9196),i=a(5773),o=a(9709);const __=r.__,_n=r._n,l=()=>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"})),p=()=>{const{lastChecked:e}=(0,i.Z)(),t=(0,s.useMemo)((()=>e?(e=>{const t=new Date,a=6e4*t.getTimezoneOffset(),n=Math.floor((new Date(t.getTime()+a).getTime()-e)/1e3);let c=n/31536e3;return c>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(c),"jetpack-protect"),Math.floor(c)):(c=n/2592e3,c>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(c),"jetpack-protect"),Math.floor(c)):(c=n/86400,c>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(c),"jetpack-protect"),Math.floor(c)):(c=n/3600,c>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(c),"jetpack-protect"),Math.floor(c)):(c=n/60,c>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(c),"jetpack-protect"),Math.floor(c)):__("a few seconds ago","jetpack-protect")))))})(Date.parse(e)):null),[e]);return React.createElement("div",{className:o.Z.empty},React.createElement(l,null),React.createElement(n.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(n.ZP,null,(0,c.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"),t),{strong:React.createElement("strong",null)})))}},2831:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(526),c=a(5106),r=a(857),s=a(8258),i=a(5736),o=a(9196),l=a.n(o),p=a(3898),d=a(6477),u=a(3584),m=a(9709);const __=i.__,h=({description:e,filename:t,fixedIn:a,icon:h,id:g,name:f,source:v,table:E,title:k,type:b,version:y})=>{const{adminUrl:Z}=window.jetpackProtectInitialState||{},{run:_}=(0,s.Z)({productSlug:p.o,redirectUrl:Z,useBlogIdSuffix:!0}),{recordEventHandler:w}=(0,d.Z)(),C=w("jetpack_protect_threat_list_get_scan_link_click",_),R=v?l().createElement(n.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:v},__("See more technical details of this threat","jetpack-protect")):null,j=(0,o.useCallback)((()=>f&&y?`${f} (${y})`:t?t.split("/").pop():E||void 0),[t,f,E,y]);return l().createElement(u.U,{id:g,label:j(),title:k,icon:h,onOpen:(0,o.useCallback)((()=>{["core","plugin","theme"].includes(b)&&w(`jetpack_protect_${b}_threat_open`)}),[w,b])},e&&l().createElement("div",{className:m.Z["threat-section"]},l().createElement(c.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),l().createElement(c.ZP,{mb:2},e),R),a&&l().createElement("div",{className:m.Z["threat-section"]},l().createElement(c.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),l().createElement(c.ZP,{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,i.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),f,a)),l().createElement(r.Z,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:C,className:m.Z["threat-item-cta"]})),!e&&l().createElement("div",{className:m.Z["threat-section"]},R))},g=({list:e})=>l().createElement(u.Z,null,e.map((({description:e,fixedIn:t,icon:a,id:n,name:c,source:r,table:s,title:i,type:o,version:p})=>l().createElement(h,{description:e,fixedIn:t,icon:a,id:n,key:n,name:c,source:r,table:s,title:i,type:o,version:p}))))},5207:(e,t,a)=>{"use strict";a.d(t,{Z:()=>y});var n=a(2054),c=a(3363),r=a(3846),s=a(5106),i=a(526),o=a(9818),l=a(5736),p=a(9196),d=a.n(p),u=a(5773),m=a(4633),h=a(1707),g=a(5658),f=a(2831),v=a(4289),E=a(1400),k=a(9709),b=a(7930);const __=l.__,y=()=>{const{hasRequiredPlan:e}=(0,u.Z)(),{item:t,list:a,selected:y,setSelected:Z}=(0,b.Z)(),_=a.filter((e=>e.fixable)),[w]=(0,n.Z)("sm"),{setModal:C}=(0,o.useDispatch)(m.t),{scan:R}=(0,o.useDispatch)(m.t),j=(0,o.useSelect)((e=>e(m.t).getScanIsEnqueuing())),[S,N]=(0,p.useState)(null),[P,x]=(0,p.useState)(null),[I,L]=(0,p.useState)(null),[M,T]=(0,p.useState)(null),A=(0,p.useCallback)((()=>{switch(y){case"all":return 1===a.length?__("All threats","jetpack-protect"):(0,l.sprintf)(/* translators: placeholder is the amount of threats found on the site. */ -__("All %s threats","jetpack-protect"),a.length);case"files":return(0,l.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,l.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,l.sprintf)(/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ -__("%1$s %2$s in your %3$s %4$s","jetpack-protect"),a.length,1===a.length?"threat":"threats",t?.name,t?.version)}}),[y,a,t]);return d().createElement(c.Z,{fluid:!0,horizontalSpacing:0,horizontalGap:3},d().createElement(r.Z,{lg:4},d().createElement("div",{ref:N},d().createElement(v.Z,{selected:y,onSelect:Z})),d().createElement(h.Z,{id:e?"paid-scan-results":"free-scan-results",position:"top",anchor:S})),d().createElement(r.Z,{lg:8},a?.length>0?d().createElement(d().Fragment,null,d().createElement("div",{className:k.Z["list-header"]},d().createElement(s.Dx,{className:k.Z["list-title"]},A()),e&&d().createElement(d().Fragment,null,_.length>0&&d().createElement(d().Fragment,null,d().createElement(i.Z,{ref:x,variant:"primary",className:k.Z["list-header-button"],onClick:(z=_,e=>{e.preventDefault(),C({type:"FIX_ALL_THREATS",props:{threatList:z}})})},(0,l.sprintf)(/* translators: Translates to Auto fix all. $s: Number of fixable threats. */ -__("Auto fix all (%s)","jetpack-protect"),_.length)),d().createElement(h.Z,{id:"paid-fix-all-threats",position:w?"bottom right":"middle left",anchor:P})),d().createElement(i.Z,{ref:T,variant:"secondary",className:k.Z["list-header-button"],isLoading:j,onClick:e=>{e.preventDefault(),R()}},__("Scan now","jetpack-protect")),d().createElement(h.Z,{id:"paid-daily-and-manual-scans",position:w?"bottom left":"middle left",anchor:M}))),e?d().createElement(d().Fragment,null,d().createElement("div",{ref:L},d().createElement(E.Z,{list:a})),d().createElement(h.Z,{id:"paid-understand-severity",position:"top",anchor:I})):d().createElement(f.Z,{list:a})):d().createElement(g.Z,null)));var z}},4289:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(2054),c=a(5736),r=a(797),s=a(2817),i=a(7663),o=a(8960),l=a(4160),p=a(6376),d=a(9196),u=a(6477),m=a(5773),h=a(5338);const __=c.__,g=({selected:e,onSelect:t})=>{const{plugins:a,themes:c,numThreats:g,numCoreThreats:f,numFilesThreats:v,numDatabaseThreats:E,hasRequiredPlan:k}=(0,m.Z)(),{recordEvent:b}=(0,u.Z)(),[y]=(0,n.Z)("lg","<"),Z=(0,d.useCallback)((()=>{b("jetpack_protect_navigation_all_click")}),[b]),_=(0,d.useCallback)((()=>{b("jetpack_protect_navigation_core_click")}),[b]),w=(0,d.useCallback)((()=>{b("jetpack_protect_navigation_plugin_click")}),[b]),C=(0,d.useCallback)((()=>{b("jetpack_protect_navigation_theme_click")}),[b]),R=(0,d.useCallback)((()=>{b("jetpack_protect_navigation_file_click")}),[b]),j=(0,d.useCallback)((()=>{b("jetpack_protect_navigation_database_click")}),[b]);return React.createElement(h.ZP,{selected:e,onSelect:t,mode:y?"dropdown":"list"},React.createElement(h.Dx,{initial:!0,id:"all",label:__("All threats","jetpack-protect"),icon:r.Z,badge:g,disabled:g<=0,onClick:Z,checked:!0}),React.createElement(h.Dx,{id:"wordpress",label:__("WordPress","jetpack-protect"),icon:s.Z,badge:f,disabled:f<=0,onClick:_,checked:!0}),React.createElement(h.KB,{label:__("Plugins","jetpack-protect"),icon:i.Z},a.map((({name:e,threats:t,checked:a})=>React.createElement(h.Dx,{key:e,id:e,label:e,checked:a,badge:t?.length,disabled:t?.length<=0,onClick:w})))),React.createElement(h.KB,{label:__("Themes","jetpack-protect"),icon:o.Z},c.map((({name:e,threats:t,checked:a})=>React.createElement(h.Dx,{key:e,id:e,label:e,checked:a,badge:t?.length,disabled:t?.length<=0,onClick:C})))),k&&React.createElement(React.Fragment,null,React.createElement(h.Dx,{id:"files",label:__("Files","jetpack-protect"),icon:l.Z,badge:v,disabled:v<=0,onClick:R,checked:!0}),React.createElement(h.Dx,{id:"database",label:__("Database","jetpack-protect"),icon:p.Z,badge:E,disabled:E<=0,onClick:j,checked:!0})))}},1400:(e,t,a)=>{"use strict";a.d(t,{Z:()=>E});var n=a(526),c=a(5106),r=a(2054),s=a(9818),i=a(9307),o=a(5736),l=a(9196),p=a.n(l),d=a(6477),u=a(4633),m=a(7127),h=a(4257),g=a(289),f=a(9709);const __=o.__,v=({context:e,description:t,diff:a,filename:r,fixedIn:i,icon:v,fixable:E,id:k,label:b,name:y,source:Z,title:_,type:w,severity:C})=>{const{setModal:R}=(0,s.useDispatch)(u.t),{recordEvent:j}=(0,d.Z)(),S=Z?p().createElement(n.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:Z},__("See more technical details of this threat","jetpack-protect")):null;return p().createElement(g.c,{id:k,label:b,title:_,icon:v,fixable:E,severity:C,onOpen:(0,l.useCallback)((()=>{["core","plugin","theme","file","database"].includes(w)&&j(`jetpack_protect_${w}_threat_open`)}),[j,w])},t&&p().createElement("div",{className:f.Z["threat-section"]},p().createElement(c.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),p().createElement(c.ZP,{mb:2},t),S),(r||e||a)&&p().createElement(c.ZP,{variant:"title-small",mb:2},__("The technical details","jetpack-protect")),r&&p().createElement(p().Fragment,null,p().createElement(c.ZP,{mb:2},/* translators: filename follows in separate line; e.g. "PHP.Injection.5 in: `post.php`" */ -__("Threat found in file:","jetpack-protect")),p().createElement("pre",{className:f.Z["threat-filename"]},r)),e&&p().createElement(h.Z,{context:e}),a&&p().createElement(m.C,{diff:a}),i&&p().createElement("div",{className:f.Z["threat-section"]},p().createElement(c.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),p().createElement(c.ZP,{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,o.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),y,i))),!t&&p().createElement("div",{className:f.Z["threat-section"]},S),p().createElement("div",{className:f.Z["threat-footer"]},p().createElement(n.Z,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),R({type:"IGNORE_THREAT",props:{id:k,label:b,title:_,icon:v,severity:C}})}},__("Ignore threat","jetpack-protect")),E&&p().createElement(n.Z,{onClick:e=>{e.preventDefault(),R({type:"FIX_THREAT",props:{id:k,label:b,title:_,icon:v,severity:C,fixable:E}})}},__("Fix threat","jetpack-protect"))))},E=({list:e})=>{const{scan:t}=(0,s.useDispatch)(u.t),a=(0,i.createInterpolateElement)(__("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"),{manualScanLink:p().createElement(n.Z,{variant:"link",onClick:e=>{e.preventDefault(),t()}})}),[o]=(0,r.Z)(["sm","lg"],[null,"<"]),l=e=>e.name&&e.version?`${e.name} (${e.version})`:e.filename?e.filename.split("/").pop():e.table?e.table:void 0;return e=e.map((e=>({label:l(e),...e}))),p().createElement(p().Fragment,null,!o&&p().createElement("div",{className:f.Z["accordion-heading"]},p().createElement("span",null,__("Details","jetpack-protect")),p().createElement("span",null,__("Severity","jetpack-protect")),p().createElement("span",null,__("Auto-fix","jetpack-protect")),p().createElement("span",null)),p().createElement(g.Z,null,e.map((({context:e,description:t,diff:a,filename:n,fixedIn:c,icon:r,fixable:s,id:i,label:o,name:l,severity:d,source:u,table:m,title:h,type:g,version:f})=>p().createElement(v,{context:e,description:t,diff:a,filename:n,fixedIn:c,icon:r,fixable:s,id:i,key:i,label:o,name:l,severity:d,source:u,table:m,title:h,type:g,version:f})))),p().createElement(c.ZP,{className:f.Z["manual-scan"],variant:"body-small"},a))}},7930:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(2817),c=a(4160),r=a(6376),s=a(7663),i=a(8960),o=a(9196),l=a(5773);const p=(e,t)=>t.severity-e.severity,d=(e,t)=>"object"==typeof e&&0===Object.keys(e).length?[]:Array.isArray(e)?e.map((e=>d(e,t))).flat():e?.threats.map((a=>({...a,...e,...t}))),u=()=>{const[e,t]=(0,o.useState)("all"),{plugins:a,themes:u,core:m,files:h,database:g}=(0,l.Z)(),{unsortedList:f,item:v}=(0,o.useMemo)((()=>{if(e&&"all"!==e){switch(e){case"wordpress":return{unsortedList:d(m,{icon:n.Z}),item:m};case"files":return{unsortedList:d(h,{icon:c.Z}),item:h};case"database":return{unsortedList:d(g,{icon:r.Z}),item:g}}const t=a.find((t=>t?.name===e));if(t)return{unsortedList:d(t,{icon:s.Z}),item:t};const o=u.find((t=>t?.name===e));if(o)return{unsortedList:d(o,{icon:i.Z}),item:o}}return{unsortedList:[...d(m,{icon:n.Z}),...d(a,{icon:s.Z}),...d(u,{icon:i.Z}),...d(h,{icon:c.Z}),...d(g,{icon:r.Z})],item:null}}),[m,g,h,a,e,u]);return{item:v,list:(0,o.useMemo)((()=>[...f].sort(p)),[f]),selected:e,setSelected:t}}},2854:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(1294),c=a(8227);const r=({children:e})=>{const{isUserConnected:t,hasConnectedOwner:a}=(0,n.Z)();return t&&a?e:React.createElement(c.Z,null)}},8227:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5106),c=a(526),r=a(1294),s=a(9818),i=a(5736),o=a(4633),l=a(291),p=a(541);const __=i.__,d=()=>{const{setModal:e}=(0,s.useDispatch)(o.t),{userIsConnecting:t,handleConnectUser:a}=(0,r.Z)({redirectUri:"admin.php?page=jetpack-protect"});return React.createElement(React.Fragment,null,React.createElement(n.ZP,{variant:"title-medium",mb:2},__("User connection needed","jetpack-protect")),React.createElement(l.Z,{type:"info",message:__("Before Jetpack Protect can ignore and auto-fix threats on your site, a user connection is needed.","jetpack-protect")}),React.createElement(n.ZP,{mb:3},__("A user connection provides Jetpack Protect the access necessary to perform these tasks.","jetpack-protect")),React.createElement(n.ZP,{mb:3},__("Once you’ve secured a user connection, all Jetpack Protect features will be available for use.","jetpack-protect")),React.createElement("div",{className:p.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-protect")),React.createElement(c.Z,{isExternalLink:!0,weight:"regular",isLoading:t,onClick:a},__("Connect your user account","jetpack-protect"))))}},3898:(e,t,a)=>{"use strict";a.d(t,{K:()=>n,o:()=>c});const n="https://wordpress.org/support/plugin/jetpack-protect/",c="jetpack_scan"},6477:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(6975),c=a(1294),r=a(9196);const s=({pageViewEventName:e,pageViewNamespace:t="jetpack",pageViewSuffix:a="page_view",pageViewEventProperties:s={}}={})=>{const{isUserConnected:i,isRegistered:o,userConnectionData:l}=(0,c.Z)(),{login:p,ID:d}=l.currentUser?.wpcomUser||{},{tracks:u}=n.Z,{recordEvent:m}=u,h=(0,r.useCallback)((async(e,t)=>{m(e,t)}),[m]),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)((()=>{i&&d&&p&&n.Z.initialize(d,p)}),[i,d,p]);const f=e?`${t}_${e}_${a}`:null;return(0,r.useEffect)((()=>{o&&f&&m(f,s)}),[]),{recordEvent:h,recordEventHandler:g}}},2218:(e,t,a)=>{"use strict";a.d(t,{Yx:()=>o,ZP:()=>p,em:()=>i,um:()=>l});var n=a(9818),c=a(9196),r=a(1827),s=a(4633);const i=(0,c.createContext)([]),o=(0,c.createContext)([]),l=({children:e})=>{const[t,a]=(0,c.useState)([]);return React.createElement(o.Provider,{value:{renderedSteps:t,setRenderedSteps:a}},e)},p=()=>{const{completeOnboardingSteps:e,fetchOnboardingProgress:t}=r.Z,a=(0,c.useContext)(i),{renderedSteps:l}=(0,c.useContext)(o),p=(0,n.useSelect)((e=>e(s.t).getOnboardingProgress())),{setOnboardingProgress:d}=(0,n.useDispatch)(s.t),{currentStep:u,currentStepCount:m,stepsCount:h}=(0,c.useMemo)((()=>a.reduce(((e,t)=>(l.includes(t.id)&&(e.stepsCount++,e.currentStep||-1!==(p||[]).indexOf(t.id)||(e.currentStep=t,e.currentStepCount=e.stepsCount)),e)),{currentStep:null,currentStepCount:null,stepsCount:0})),[p,l,a]),g=(0,c.useCallback)((()=>{u&&(d([...p,u.id]),e([u.id]))}),[u,d,p,e]),f=(0,c.useCallback)((()=>{const t=a.reduce(((e,t)=>(t.id.startsWith("free-")&&e.push(t.id),e)),[]),n=[...p,...t];d([...new Set(n)]),e(t)}),[a,p,d,e]),v=(0,c.useCallback)((()=>{const t=a.reduce(((e,t)=>(t.id.startsWith("paid-")&&e.push(t.id),e)),[]),n=[...p,...t];d([...new Set(n)]),e(t)}),[a,p,d,e]),E=(0,c.useCallback)((()=>{u.id.startsWith("paid-")?v():f()}),[f,v,u]);return(0,c.useEffect)((()=>{null===p&&t().then((e=>d(e)))}),[t,p,d]),{progress:p,stepsCount:h,currentStep:u,currentStepCount:m,completeCurrentStep:g,completeAllCurrentSteps:E}}},5773:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9818),c=a(9196),r=a(4633);function s(){const{statusIsFetching:e,status:t,jetpackScan:a,hasRequiredPlan:s}=(0,n.useSelect)((e=>({statusIsFetching:e(r.t).getStatusIsFetching(),status:e(r.t).getStatus(),jetpackScan:e(r.t).getJetpackScan(),hasRequiredPlan:e(r.t).hasRequiredPlan()})));let i="error";!0===e?i="loading":t.status&&(i=t.status);const o=(0,c.useMemo)((()=>t.core?.threats?.length||0),[t.core]),l=(0,c.useMemo)((()=>(t.plugins||[]).reduce(((e,t)=>e+t.threats.length),0)),[t.plugins]),p=(0,c.useMemo)((()=>(t.themes||[]).reduce(((e,t)=>e+t.threats.length),0)),[t.themes]),d=(0,c.useMemo)((()=>t.files?.length||0),[t.files]),u=(0,c.useMemo)((()=>t.database?.length||0),[t.database]);return{numThreats:o+l+p+d+u,numCoreThreats:o,numPluginsThreats:l,numThemesThreats:p,numFilesThreats:d,numDatabaseThreats:u,lastChecked:t.lastChecked||null,errorCode:t.errorCode||null,errorMessage:t.errorMessage||null,core:t.core||{},plugins:t.plugins||[],themes:t.themes||[],files:{threats:t.files||[]},database:{threats:t.database||[]},currentStatus:i,hasUncheckedItems:t.hasUncheckedItems,jetpackScan:a,hasRequiredPlan:s}}},8963:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(9818),c=a(9196),r=a(1827),s=a(4633);const i=()=>{const{setWafConfig:e,setWafStats:t,setWafIsEnabled:a,setWafIsUpdating:i,setWafIsToggling:o}=(0,n.useDispatch)(s.t),l=(0,n.useSelect)((e=>e(s.t).getWaf())),p=(0,c.useCallback)((()=>(i(!0),r.Z.fetchWaf().then((n=>{a(n?.isEnabled),e(n?.config),t(n?.stats)})).finally((()=>i(!1))))),[e,t,a,i]),d=(0,c.useCallback)((()=>(l.isEnabled||o(!0),i(!0),r.Z.toggleWaf().then(p).finally((()=>{o(!1),i(!1)})))),[p,l.isEnabled,o,i]),u=(0,c.useCallback)((()=>l.isEnabled?Promise.resolve():d()),[d,l.isEnabled]),m=(0,c.useCallback)((()=>(i(!0),u().then((()=>r.Z.updateWaf({jetpack_waf_automatic_rules:!l.config.jetpackWafAutomaticRules}))).then(p).finally((()=>i(!1))))),[u,p,i,l.config.jetpackWafAutomaticRules]),h=(0,c.useCallback)((()=>(i(!0),r.Z.updateWaf({jetpack_waf_ip_list:!l.config.jetpackWafIpList}).then(p).finally((()=>i(!1))))),[p,i,l.config.jetpackWafIpList]),g=(0,c.useCallback)((()=>(i(!0),r.Z.updateWaf({brute_force_protection:!l.config.bruteForceProtection}).then(p).finally((()=>i(!1))))),[p,i,l.config.bruteForceProtection]),f=(0,c.useCallback)((()=>(i(!0),u().then((()=>r.Z.updateWaf({jetpack_waf_share_data:!l.config.jetpackWafShareData}))).then(p).finally((()=>i(!1))))),[u,p,i,l.config.jetpackWafShareData]),v=(0,c.useCallback)((()=>(i(!0),u().then((()=>r.Z.updateWaf({jetpack_waf_share_debug_data:!l.config.jetpackWafShareDebugData}))).then(p).finally((()=>i(!1))))),[u,p,i,l.config.jetpackWafShareDebugData]),E=(0,c.useCallback)((e=>(i(!0),r.Z.updateWaf(e).then(p).finally((()=>i(!1))))),[p,i]);return(0,c.useEffect)((()=>{void 0!==l.config||l.isFetching||p()}),[l.config,l.isFetching,i,p]),{...l,refreshWaf:p,toggleWaf:d,toggleAutomaticRules:m,toggleManualRules:h,toggleBruteForceProtection:g,toggleShareData:f,toggleShareDebugData:v,updateConfig:E}}},5230:(e,t,a)=>{"use strict";a.d(t,{Au:()=>R,BZ:()=>y,Gk:()=>m,Oc:()=>P,Ot:()=>N,PF:()=>x,P_:()=>E,RR:()=>f,Rj:()=>j,U2:()=>v,VF:()=>_,Xm:()=>b,Y2:()=>u,ZP:()=>q,_N:()=>o,d0:()=>p,dG:()=>w,eG:()=>h,hI:()=>g,i0:()=>Z,jA:()=>l,kd:()=>S,l:()=>L,o9:()=>d,r0:()=>C,tu:()=>k,y:()=>I});var n=a(6989),c=a.n(n),r=a(5736),s=a(4769),i=a.n(s);const _n=r._n,__=r.__,o="SET_CREDENTIALS_STATE_IS_FETCHING",l="SET_CREDENTIALS_STATE",p="SET_STATUS",d="SET_STATUS_PROGRESS",u="START_SCAN_OPTIMISTICALLY",m="SET_STATUS_IS_FETCHING",h="SET_SCAN_IS_UNAVAILABLE",g="SET_SCAN_IS_ENQUEUING",f="SET_INSTALLED_PLUGINS",v="SET_INSTALLED_THEMES",E="SET_WP_VERSION",k="SET_JETPACK_SCAN",b="SET_THREAT_IS_UPDATING",y="SET_THREATS_ARE_FIXING",Z="SET_MODAL",_="SET_NOTICE",w="CLEAR_NOTICE",C="SET_HAS_REQUIRED_PLAN",R="SET_ONBOARDING_PROGRESS",j="SET_WAF_IS_SEEN",S="SET_WAF_UPGRADE_IS_SEEN",N="SET_WAF_IS_ENABLED",P="SET_WAF_IS_UPDATING",x="SET_WAF_IS_TOGGLING",I="SET_WAF_CONFIG",L="SET_WAF_STATS",M=e=>({type:p,status:e}),T=()=>({type:u}),A=e=>c()({path:"jetpack-protect/v1/status"+(e?"?hard_refresh=true":""),method:"GET"}),z=(e=!1)=>async({dispatch:t})=>(t(V(!0)),await new Promise(((a,n)=>A(e).then(F).then((e=>{t(U("unavailable"===e.status)),t(M(i()(e))),a(e)})).catch((e=>{n(e)})).finally((()=>{t(V(!1))}))))),F=(e,t=0)=>new Promise(((a,n)=>{"unavailable"===e.status&&t<3?A(!0).then((e=>{setTimeout((()=>{F(e,t+1).then((e=>a(e))).catch((e=>n(e)))}),5e3)})).catch(n):a(e)})),O=e=>({type:o,isFetching:e}),D=e=>({type:l,credentials:e}),V=e=>({type:m,status:e}),U=e=>({type:h,status:e}),H=e=>({type:g,isEnqueuing:e}),B=(e,t)=>({type:b,payload:{threatId:e,isUpdating:t}}),W=e=>({type:y,threatIds:e}),J=e=>async({dispatch:t})=>{const a=e.reduce(((e,t)=>`${e}threat_ids[]=${t}&`),"jetpack-protect/v1/fix-threats-status?");return t(W(e)),await c()({path:a,method:"GET"}).then((async a=>{const n=Object.values(a.threats);if(n.filter((e=>"in_progress"===e.status)).length>0)return await new Promise((()=>{setTimeout((()=>{t(J(e))}),1e3)}));if(!n.filter((e=>"fixed"===e.status)).length===e.length)throw"Not all threats could be fixed."})).then((()=>{t(z()),t(G({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(G({type:"error",message:__("Not all threats could be fixed. Please contact our support.","jetpack-protect")}))})).finally((()=>{t(W([]))}))},G=e=>({type:_,payload:e}),$=e=>({type:C,hasRequiredPlan:e}),q={checkCredentials:()=>async({dispatch:e})=>await new Promise(((t,a)=>(e(O(!0)),c()({path:"jetpack-protect/v1/check-credentials",method:"POST"}).then((a=>{e(D(a)),t(a)})).catch((e=>{a(e)})).finally((()=>{e(O(!1))}))))),setCredentials:D,setCredentialsIsFetching:O,setStatus:M,setStatusProgress:e=>({type:d,currentProgress:e}),startScanOptimistically:T,refreshStatus:z,setStatusIsFetching:V,setScanIsEnqueuing:H,setInstalledPlugins:e=>({type:f,plugins:e}),setInstalledThemes:e=>({type:v,themes:e}),setwpVersion:e=>({type:E,version:e}),setJetpackScan:e=>({type:k,scan:e}),ignoreThreat:(e,t=(()=>{}))=>async({dispatch:a})=>(a(B(e,!0)),await new Promise((()=>c()({path:`jetpack-protect/v1/ignore-threat?threat_id=${e}`,method:"POST"}).then((()=>a(z()))).then((()=>a(G({type:"success",message:__("Threat ignored","jetpack-protect")})))).catch((()=>a(G({type:"error",message:__("An error ocurred ignoring the threat.","jetpack-protect")})))).finally((()=>{a(B(e,!1)),t()}))))),setModal:e=>({type:Z,payload:e}),setNotice:G,clearNotice:()=>({type:w}),fixThreats:(e,t=(()=>{}))=>async({dispatch:a})=>(e.forEach((e=>{a(B(e,!0))})),await new Promise((()=>c()({path:`jetpack-protect/v1/fix-threats?threat_ids=${e}`,method:"POST",data:{threatIds:e}}).then((()=>a(G({type:"success",message:__("We're hard at work fixing this threat in the background. Please check back shortly.","jetpack-protect")})))).then((()=>{setTimeout((()=>a(J(e))),1e3)})).catch((()=>a(G({type:"error",message:__("Error fixing threats. Please contact support.","jetpack-protect")})))).finally((()=>{e.forEach((e=>{a(B(e,!1))})),t()}))))),scan:(e=(()=>{}))=>async({dispatch:t})=>(t(H(!0)),await new Promise((()=>c()({path:"jetpack-protect/v1/scan",method:"POST"}).then((()=>{t(T()),setTimeout((()=>t(z(!0))),5e3)})).catch((()=>t(G({type:"error",message:__("An error ocurred enqueuing the scan","jetpack-protect")})))).finally((()=>{t(H(!1)),e()}))))),setThreatsAreFixing:W,refreshPlan:()=>({dispatch:e})=>{c()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((t=>e($(t))))},setHasRequiredPlan:$,setScanIsUnavailable:U,setOnboardingProgress:e=>({type:R,progress:e}),setWafIsEnabled:e=>({type:N,isEnabled:e}),setWafIsSeen:e=>({type:j,isSeen:e}),setWafUpgradeIsSeen:e=>({type:S,upgradeIsSeen:e}),setWafIsUpdating:e=>({type:P,isUpdating:e}),setWafIsToggling:e=>({type:x,isToggling:e}),setWafConfig:e=>({type:I,config:e}),setWafStats:e=>({type:L,stats:e})}},3638:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9818),c=a(5230);const r={wafSupported:null,bruteForceSupported:null,isSeen:!1,upgradeIsSeen:!1,isEnabled:!1,isUpdating:!1,isToggling:!1,config:void 0,stats:void 0},s=(0,n.combineReducers)({credentials:(e=null,t)=>t.type===c.jA?t.credentials:e,credentialsIsFetching:(e=!1,t)=>t.type===c._N?t.isFetching:e,status:(e={},t)=>{switch(t.type){case c.d0:return t.status;case c.o9:return{...e,currentProgress:t.currentProgress};case c.Y2:return{...e,currentProgress:0,status:"optimistically_scanning"}}return e},statusIsFetching:(e=!1,t)=>t.type===c.Gk?t.status:e,scanIsUnavailable:(e=!1,t)=>t.type===c.eG?t.status:e,scanIsEnqueuing:(e=!1,t)=>t.type===c.hI?t.isEnqueuing:e,installedPlugins:(e={},t)=>t.type===c.RR?t.plugins:e,installedThemes:(e={},t)=>t.type===c.U2?t.themes:e,wpVersion:(e={},t)=>t.type===c.P_?t.version:e,jetpackScan:(e={},t)=>t.type===c.tu?t.scan:e,threatsUpdating:(e={},t)=>t.type===c.Xm?{...e,[t.payload.threatId]:t.payload.isUpdating}:e,modal:(e={},t)=>t.type===c.i0?{...e,...t.payload}:e,notice:(e={},t)=>{switch(t.type){case c.VF:return{...e,...t.payload};case c.dG:return{}}return e},setThreatsFixing:(e=[],t)=>t.type===c.BZ?t.threatIds:e,hasRequiredPlan:(e=!1,t)=>t.type===c.r0?t.hasRequiredPlan:e,onboardingProgress:(e=null,t)=>t.type===c.Au?t.progress:e,waf:(e=r,t)=>{switch(t.type){case c.Rj:return{...e,isSeen:t.isSeen};case c.kd:return{...e,upgradeIsSeen:t.upgradeIsSeen};case c.Ot:return{...e,isEnabled:t.isEnabled};case c.y:return{...e,config:t.config};case c.l:return{...e,stats:t.stats};case c.Oc:return{...e,isUpdating:t.isUpdating};case c.PF:return{...e,isToggling:t.isToggling}}return e}})},1056:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(6989),c=a.n(n),r=a(5230);const s={getJetpackScan:{isFulfilled:e=>Object.keys(e?.jetpackScan).length>0,fulfill:()=>async({dispatch:e})=>{const t=await c()({path:"/my-jetpack/v1/site/products/scan",method:"GET"});e(r.ZP.setJetpackScan(t))}}}},6850:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={getCredentials:e=>e.credentials||null,getCredentialsIsFetching:e=>e.credentialsIsFetching||!1,getInstalledPlugins:e=>e.installedPlugins||{},getInstalledThemes:e=>e.installedThemes||{},getStatus:e=>e.status||{},getStatusIsFetching:e=>e.statusIsFetching||!1,getScanIsUnavailable:e=>e.scanIsUnavailable||!1,getScanIsEnqueuing:e=>e.scanIsEnqueuing||!1,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}},5217:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9818);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},4633:(e,t,a)=>{"use strict";a.d(t,{N:()=>d,t:()=>p});var n=a(4769),c=a.n(n),r=a(5230),s=a(3638),i=a(1056),o=a(6850),l=a(5217);const p="jetpack-protect";function d(){l.Z.mayBeInit(p,{__experimentalUseThunks:!0,reducer:s.Z,actions:r.ZP,selectors:o.Z,resolvers:i.Z,initialState:c()(window.jetpackProtectInitialState)||{}})}},5983:(e,t,a)=>{"use strict";e.exports=a.p+"images/in-progress-db145d62b5ef09c05ad7.png"},6436: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"}},9196:e=>{"use strict";e.exports=window.React},6292:e=>{"use strict";e.exports=window.moment},6989:e=>{"use strict";e.exports=window.wp.apiFetch},5609:e=>{"use strict";e.exports=window.wp.components},4333:e=>{"use strict";e.exports=window.wp.compose},9818:e=>{"use strict";e.exports=window.wp.data},9771:e=>{"use strict";e.exports=window.wp.date},9307:e=>{"use strict";e.exports=window.wp.element},5736:e=>{"use strict";e.exports=window.wp.i18n},444:e=>{"use strict";e.exports=window.wp.primitives},6483:e=>{"use strict";e.exports=window.wp.url},2674:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tn})}},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&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].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(8275),t=a(9307),n=a(9196),c=a.n(n),r=a(5439),s=a(554),i=a(5975),o=a(8257),l=a(8686),p=a(2218),d=a(4633);a(1155);function u(){const e=(0,r.TH)();return(0,n.useEffect)((()=>window.scrollTo(0,0)),[e]),null}(0,d.N)(),function(){const a=document.getElementById("jetpack-protect-root");if(null===a)return;const n=c().createElement(e.ZP,null,c().createElement(p.um,{value:{renderedSteps:[]}},c().createElement(s.UT,null,c().createElement(u,null),c().createElement(r.Z5,null,c().createElement(r.AW,{path:"/",element:c().createElement(l.Z,null)}),c().createElement(r.AW,{path:"/firewall",element:c().createElement(i.Z,null)}))),c().createElement(o.Z,null)));t.createRoot(a).render(n)}()})()})(); \ 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 deleted file mode 100644 index 84a0513f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js.LICENSE.txt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 - */ - -/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ - -/** - * 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 deleted file mode 100644 index b197694b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.rtl.css +++ /dev/null @@ -1 +0,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 #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)}.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)}: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-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}.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)}.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)}.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}.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}.sexr0jUxC1jVixdKiDnC{margin-right:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-right:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.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}}.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}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}._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)}.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)}.DM4b8iQ0ewvRYdIPxvZ8{max-width:calc(744px + var(--spacing-base)*6);width:100%}.bW6ZuNzJBYU5PVPktE2S{display:flex}.bW6ZuNzJBYU5PVPktE2S:not(:first-child){margin-top:calc(var(--spacing-base)*7)}.di3wjXHrX1rk_H6rlxKM{margin-left:calc(var(--spacing-base)*2);padding-top:calc(var(--spacing-base)/2)}@media(min-width:600px){.di3wjXHrX1rk_H6rlxKM{margin-left:calc(var(--spacing-base)*5)}}.IrzHnNkRvORtyCL0yiWa{width:100%}.sU82bpLEYPC9n_CFAKoz{align-items:center;display:flex}.ZZc0LldcbJpcftqCe43T .IrzHnNkRvORtyCL0yiWa{opacity:.5}.T17WOOJI7XHN7KRmYaCe>:last-child{margin-top:calc(var(--spacing-base)*2)}@media(min-width:600px){.T17WOOJI7XHN7KRmYaCe{display:flex;justify-content:space-between}}.typbjN2keZ97hj2TmuMC{display:flex;flex-wrap:wrap;margin-top:calc(var(--spacing-base)*2)}.UUXAN8VTAZY0h8t9rCHG{color:var(--jp-green-50);margin-left:calc(var(--spacing-base)/2)}.eFjcadLMEXY5O61vsTrx{color:var(--jp-gray-50)}.Tr5uYvclUiwlC5kuGk7E{color:var(--jp-red-50)}.zPZcNgYx2X5778nHHtlH{display:flex;flex-wrap:wrap}.lNtkRXnB1z_kYB28MUWq{color:var(--jp-gray-50)}.JgH5ykcLynEgqXYurT78{margin-left:calc(var(--spacing-base)/2)}.JgH5ykcLynEgqXYurT78,.xlWW0IoKZwTZt1Ti0tcQ{color:var(--jp-green-50)}.zhBcgCUGgyC7PvWk8ewB{margin-top:calc(var(--spacing-base)*3)}@media(min-width:600px){.zhBcgCUGgyC7PvWk8ewB{padding-right:calc(var(--spacing-base)*11)}}.mah_f2OWxZ3Vqt_jRFdR{margin-bottom:calc(var(--spacing-base)*4)}.pRMFiIODonlw4XMdNHaU{margin-bottom:calc(var(--spacing-base)*2);margin-top:calc(var(--spacing-base)*6)}.Ax2SmW57c0U5xOTjZuAA{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-2)}.xGZeYQr0_nPJTFmd8pW4{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)}.RYTIt8kwLbKcUbWOfG4g{padding:calc(var(--spacing-base)*3);width:304px}.BqXge2rIUP0a_74yvYbr{display:flex;justify-content:space-between}.Lr10UUCcSLF3T_0QqoPr{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-3)}.Lr10UUCcSLF3T_0QqoPr:focus,.Lr10UUCcSLF3T_0QqoPr:focus:not(:disabled){box-shadow:none}.th_VukMuODIOVLC7oJo6{display:flex;justify-content:flex-end}.Gxtap1Zcl5X5UEHfSdQ4{color:var(--jp-gray-50)}.Gxtap1Zcl5X5UEHfSdQ4:before{background:var(--jp-gray-50);border-radius:50%;content:"";display:inline-block;height:8px;margin-left:var(--spacing-base);width:8px}.Gxtap1Zcl5X5UEHfSdQ4.dSfmCVUK_Ez7sxdqOIdy{color:var(--jp-green-40)}.Gxtap1Zcl5X5UEHfSdQ4.dSfmCVUK_Ez7sxdqOIdy:before{background:var(--jp-green-40)}.e6JXg_theht0XwCBgqdA{margin-bottom:calc(var(--spacing-base)*3);margin-top:calc(var(--spacing-base)*2)}.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)}._Wc3apZobag_9Ag_THTb{display:flex;justify-content:space-between}.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)}.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}.EU0Rvu4PDqVtnCAmbgHg{height:56px;margin-bottom:calc(var(--spacing-base)*8);width:48px}.EU0Rvu4PDqVtnCAmbgHg>svg{position:relative;right:-40px;top:-36px}.vzMlFr1AXWqefpRrb976{align-items:center;display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*3)}.gYSOMa4xxLXmsNzvFPkW{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)}.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}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box}.ZMBDiTLzs27F012iOsMK>:first-child{flex:1}@media(min-width:960px){.ZMBDiTLzs27F012iOsMK{align-items:center;display:flex}}.zI2DKzqRc1MhF6aq5eHt{align-items:center;color:var(--jp-black);display:flex}.iHgPFku9KaLz8FIQV1Qw{margin-left:var(--spacing-base);margin-right:-4px}.ctq2nQkzIfSoMkldF9t9{margin-top:calc(var(--spacing-base)*2);width:100%}@media(min-width:960px){.ctq2nQkzIfSoMkldF9t9{margin-right:calc(var(--spacing-base)*2);margin-top:0;width:auto}}.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);border-radius:50%!important}.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);border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.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}.r4Id5qht2FD68jCAH2Cl{margin-right: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)}.ZSZPabDoB8MVVPttP0tu{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%}.ZSZPabDoB8MVVPttP0tu>span:first-child{grid-column:1/7}.ZSZPabDoB8MVVPttP0tu>span:not(:first-child){text-align:center}.iJ_biSBRDribuNKX0Zuw{margin:calc(var(--spacing-base)*4) calc(var(--spacing-base)*8);text-align:center}.iJ_biSBRDribuNKX0Zuw>button span{color:var(--jp-gray-70);font-size:var(--font-body-small);font-weight:400}.iJ_biSBRDribuNKX0Zuw button:hover:not(:disabled){text-decoration-line:none}.iJ_biSBRDribuNKX0Zuw button:focus:not(:disabled){box-shadow:none}@media(max-width:599px){.uym7dGHhp6ifjF57yOAO{margin-bottom:calc(var(--spacing-base)*3)}.e_2eFTR8RyHwmfeqJL4F{display:none}.r4Id5qht2FD68jCAH2Cl{flex:1}.r4Id5qht2FD68jCAH2Cl:first-of-type{margin-right:0}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:center}.pkw2LnOTd8VvQ3oT8sXQ>*{width:50%}}.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;margin-bottom:var(--spacing-base);margin-right:calc(var(--spacing-base)*4)}.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)}@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}}.A6a9HOtaZnLUleNgxQrX{padding:calc(var(--spacing-base)*7) 0}.CGT5fOs6LDTFHWCAgIiT,.RFKxbzQ8N58qEyVO0yzW{align-items:center;display:flex}.RFKxbzQ8N58qEyVO0yzW{height:100%}.RFKxbzQ8N58qEyVO0yzW img{object-fit:cover;width:100%}.SvMuuouOkDt2sE0PAn_D{margin-top:calc(var(--spacing-base)*3 + 1px)}.urouayitSUT8zW0V3p_0{margin-bottom:0}.iXXJlk08gFDeCvsTTlNQ{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);border-right:6px solid var(--jp-red-50);box-shadow:0 4px 8px #00000008,0 1px 2px #0000000f;box-sizing:border-box;color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.iXXJlk08gFDeCvsTTlNQ.is-error{background-color:var(--jp-white)}.iXXJlk08gFDeCvsTTlNQ .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.iXXJlk08gFDeCvsTTlNQ .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.iXXJlk08gFDeCvsTTlNQ .components-notice__dismiss{align-self:center}.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:visited{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-right:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:visited{margin-right:0;margin-top:0;white-space:nowrap}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .components-notice__content{align-items:center;flex-direction:row}.e6hHy8BZ7ZKPSXbIC0UG{margin-bottom:25px}.jXz8LnXNzMDdtHqkG0sZ{display:flex;flex-grow:1;margin-left:var(--spacing-base)}.jXz8LnXNzMDdtHqkG0sZ>svg{align-self:flex-start;flex-shrink:0}.jXz8LnXNzMDdtHqkG0sZ .jp-components-spinner,.jXz8LnXNzMDdtHqkG0sZ>svg{margin-left:calc(var(--spacing-base)*2)}*{box-sizing:border-box} \ 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 deleted file mode 100644 index 7cc972fd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/composer.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "automattic/jetpack-protect", - "description": "Social plugin", - "type": "wordpress-plugin", - "license": "GPL-2.0-or-later", - "require": { - "ext-json": "*", - "automattic/jetpack-assets": "^2.1.11", - "automattic/jetpack-admin-ui": "^0.4.2", - "automattic/jetpack-autoloader": "^3.0.7", - "automattic/jetpack-composer-plugin": "^2.0.1", - "automattic/jetpack-config": "^2.0.2", - "automattic/jetpack-identity-crisis": "^0.20.0", - "automattic/jetpack-my-jetpack": "^4.24.1", - "automattic/jetpack-plugins-installer": "^0.4.0", - "automattic/jetpack-sync": "^2.16.6", - "automattic/jetpack-transport-helper": "^0.2.3", - "automattic/jetpack-plans": "^0.4.7", - "automattic/jetpack-waf": "^0.16.8", - "automattic/jetpack-status": "^3.2.0" - }, - "require-dev": { - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.4", - "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ⓥ2_2_0" - } -} 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 deleted file mode 100644 index 00c15ce0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack-protect.php +++ /dev/null @@ -1,140 +0,0 @@ - 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 deleted file mode 100644 index ee8ebb51..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/CHANGELOG.md +++ /dev/null @@ -1,166 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 27b72455..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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.0", - "automattic/jetpack-changelogger": "^4.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" - ] - }, - "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 deleted file mode 100644 index 9e573cd7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php +++ /dev/null @@ -1,181 +0,0 @@ -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 deleted file mode 100644 index 5cec974f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/CHANGELOG.md +++ /dev/null @@ -1,183 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index bd8028f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "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.0", - "automattic/jetpack-changelogger": "^4.2.2", - "automattic/jetpack-logo": "^2.0.2", - "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 deleted file mode 100644 index 24951e19..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php +++ /dev/null @@ -1,208 +0,0 @@ -get_base64_logo() - : 'dashicons-admin-plugins'; - - if ( ! $jetpack_plugin_present ) { - add_menu_page( - 'Jetpack', - 'Jetpack', - 'read', - '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/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md deleted file mode 100644 index 676b0748..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md +++ /dev/null @@ -1,553 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 1c8becda..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/actions.php +++ /dev/null @@ -1,19 +0,0 @@ - 1, - 'function' => array( Automattic\Jetpack\Assets::class, 'wp_default_scripts_hook' ), - ); -} 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 deleted file mode 100644 index bf326283..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-i18n'), 'version' => 'b5d2a25bb8ad1698db1c'); 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 deleted file mode 100644 index f3903315..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var e={356: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(736),{default:o}=n(356),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)}}},736: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}(618);(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/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json deleted file mode 100644 index 6be01374..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "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.2" - }, - "require-dev": { - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.4", - "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.1.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 deleted file mode 100644 index c72e6f61..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php +++ /dev/null @@ -1,754 +0,0 @@ - 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 deleted file mode 100644 index 9b38e4f4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php +++ /dev/null @@ -1,779 +0,0 @@ - [ - * $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' ) ); - - $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 deleted file mode 100644 index cc32b536..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php +++ /dev/null @@ -1,310 +0,0 @@ -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 deleted file mode 100644 index 5d23562d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php +++ /dev/null @@ -1,61 +0,0 @@ - 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(), - ); - } - - /** - * 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 deleted file mode 100644 index 635f2d9d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php +++ /dev/null @@ -1,2656 +0,0 @@ -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. - @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 $user (optional) defaults to the current logged in user. - * @param string $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 when 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 deleted file mode 100644 index 48e14a15..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php +++ /dev/null @@ -1,212 +0,0 @@ -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 deleted file mode 100644 index 2d1b3743..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php +++ /dev/null @@ -1,176 +0,0 @@ -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 deleted file mode 100644 index 22119228..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php +++ /dev/null @@ -1,30 +0,0 @@ - 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 deleted file mode 100644 index cfb7bb7e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php +++ /dev/null @@ -1,215 +0,0 @@ -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 deleted file mode 100644 index 55dec5c8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php +++ /dev/null @@ -1,297 +0,0 @@ -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 deleted file mode 100644 index 10b5c7b9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php +++ /dev/null @@ -1,122 +0,0 @@ -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 deleted file mode 100644 index 196a0991..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php +++ /dev/null @@ -1,222 +0,0 @@ -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 deleted file mode 100644 index cc5f8733..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php +++ /dev/null @@ -1,1024 +0,0 @@ -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->is_staging_site(), - '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 deleted file mode 100644 index 6f5de990..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php +++ /dev/null @@ -1,282 +0,0 @@ - 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 deleted file mode 100644 index a9ca288e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php +++ /dev/null @@ -1,243 +0,0 @@ - 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 deleted file mode 100644 index b208123f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100644 index e6819a7c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100644 index 1b10356d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php +++ /dev/null @@ -1,687 +0,0 @@ -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 deleted file mode 100644 index 28f2d910..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php +++ /dev/null @@ -1,318 +0,0 @@ -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' ), - ); - - $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 deleted file mode 100644 index f8c22cee..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php +++ /dev/null @@ -1,192 +0,0 @@ -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 deleted file mode 100644 index de580c06..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php +++ /dev/null @@ -1,213 +0,0 @@ -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 deleted file mode 100644 index bc525104..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php +++ /dev/null @@ -1,106 +0,0 @@ - [ - * $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 deleted file mode 100644 index a5693cf2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php +++ /dev/null @@ -1,85 +0,0 @@ -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/interface-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php deleted file mode 100644 index 804f3848..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 2fdf7369..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php +++ /dev/null @@ -1,387 +0,0 @@ - $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 deleted file mode 100644 index ab3f8aed..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php +++ /dev/null @@ -1,241 +0,0 @@ -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 - * - * @param string $message Error message. - * - * @return string - */ - public static function sso_not_allowed_in_staging( $message ) { - $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( 'jetpack_sso_disallowed_staging_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 deleted file mode 100644 index 0ce73e1e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php +++ /dev/null @@ -1,1283 +0,0 @@ -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() )->is_staging_site() ) { - /** - * 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; - } - - /** - * Checks to determine if the user has indicated they want to use the wp-admin interface. - */ - private function use_wp_admin_interface() { - return 'wp-admin' === get_option( 'wpcom_admin_interface' ); - } - - /** - * 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() )->is_staging_site() ) { - add_filter( 'login_message', array( Notices::class, 'sso_not_allowed_in_staging' ) ); - } 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 ( ! $this->use_wp_admin_interface() && 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() )->is_staging_site() ) { - add_filter( 'login_message', array( Notices::class, 'sso_not_allowed_in_staging' ) ); - 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 deleted file mode 100644 index 94fc775a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php +++ /dev/null @@ -1,1321 +0,0 @@ - '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; - } - } - } - - /** - * 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 deleted file mode 100644 index 980741be..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 242786a9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js +++ /dev/null @@ -1,64 +0,0 @@ -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 deleted file mode 100644 index be6e886d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php +++ /dev/null @@ -1,211 +0,0 @@ -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 deleted file mode 100644 index e4a7fc6d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/CHANGELOG.md +++ /dev/null @@ -1,204 +0,0 @@ -# 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-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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index a6b631f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "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.0", - "automattic/jetpack-changelogger": "^4.2.2" - }, - "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 deleted file mode 100644 index ce237079..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php +++ /dev/null @@ -1,124 +0,0 @@ -= 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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 12aa1e91..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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.0", - "automattic/jetpack-changelogger": "^4.1.2" - }, - "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 deleted file mode 100644 index 767a552c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php +++ /dev/null @@ -1,224 +0,0 @@ - (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 deleted file mode 100644 index 96fb68cd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php +++ /dev/null @@ -1,1755 +0,0 @@ -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 deleted file mode 100644 index a530e7f9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/functions.php +++ /dev/null @@ -1,36 +0,0 @@ -= 7.0. [#34192] - -## [0.11.3] - 2023-11-14 -### Changed -- Updated package dependencies. [#34093] - -## [0.11.2] - 2023-11-03 - -## [0.11.1] - 2023-10-19 -### Changed -- Updated package dependencies. [#33687] - -### Fixed -- Fix possible use of an undefined variable. [#33668] - -## [0.11.0] - 2023-10-17 -### Changed -- Updated package dependencies. [#33646] - -### Fixed -- Added search and replace protection for wpcom urls stored in the database. [#33412] - -## [0.10.7] - 2023-10-16 -### Changed -- Updated package dependencies. [#33429] - -## [0.10.6] - 2023-10-10 -### Changed -- Updated package dependencies. [#33428] - -## [0.10.5] - 2023-09-19 -### Changed -- Updated package dependencies. [#33001] - -## [0.10.4] - 2023-09-11 -### Changed -- General: remove WP 6.1 backwards compatibility checks [#32772] - -## [0.10.3] - 2023-09-04 -### Changed -- Updated package dependencies. [#32803] -- Updated package dependencies. [#32804] - -## [0.10.2] - 2023-08-23 -### Changed -- Updated package dependencies. [#32605] - -## [0.10.1] - 2023-08-09 -### Changed -- Updated package dependencies. [#32166] - -## [0.10.0] - 2023-08-07 -### Changed -- Make IDC container ID adjustable. - -## [0.9.0] - 2023-08-01 -### Added -- URL secret to detect multi-domain sites. [#32005] - -## [0.8.52] - 2023-07-25 -### Changed -- Updated package dependencies. [#32040] - -## [0.8.51] - 2023-07-17 -### Changed -- Updated package dependencies. [#31785] - -## [0.8.50] - 2023-07-05 -### Changed -- Updated package dependencies. [#31659] - -## [0.8.49] - 2023-06-26 -### Changed -- Updated package dependencies. [#31468] - -## [0.8.48] - 2023-06-06 -### Changed -- Updated package dependencies. [#31129] - -## [0.8.47] - 2023-05-15 -### Changed -- Internal updates. - -## [0.8.46] - 2023-05-02 -### Changed -- Updated package dependencies. - -## [0.8.45] - 2023-05-01 -### Changed -- Internal updates. - -## [0.8.44] - 2023-04-17 -### Changed -- Updated package dependencies. [#30019] - -## [0.8.43] - 2023-04-10 -### Added -- Add Jetpack Autoloader package suggestion. [#29988] - -## [0.8.42] - 2023-04-04 -### Changed -- Updated package dependencies. [#29854] - -## [0.8.41] - 2023-04-03 -### Changed -- Internal updates. - -## [0.8.40] - 2023-03-20 -### Changed -- Updated package dependencies. [#29471] - -## [0.8.39] - 2023-03-08 -### Changed -- Updated package dependencies. [#29216] - -## [0.8.38] - 2023-02-20 -### Changed -- Minor internal updates. - -## [0.8.37] - 2023-02-15 -### Changed -- Update to React 18. [#28710] - -## [0.8.36] - 2023-02-08 -### Changed -- Updated package dependencies. [#28682] - -## [0.8.35] - 2023-01-25 -### Changed -- Minor internal updates. - -## [0.8.34] - 2023-01-11 -### Changed -- Updated package dependencies. [#28127] - -## [0.8.33] - 2022-12-02 -### Changed -- Updated package dependencies. [#27688] - -## [0.8.32] - 2022-11-22 -### Changed -- Updated package dependencies. [#27043] - -## [0.8.31] - 2022-11-10 -### Changed -- Updated package dependencies. [#27319] - -## [0.8.30] - 2022-11-08 -### Changed -- Updated package dependencies. [#27289] - -## [0.8.29] - 2022-11-07 -### Changed -- Updated package dependencies. [#27278] - -## [0.8.28] - 2022-11-01 -### Changed -- Updated package dependencies. [#27196] - -## [0.8.27] - 2022-10-25 -### Changed -- Updated package dependencies. [#26705] - -## [0.8.26] - 2022-10-13 -### Changed -- Updated package dependencies. [#26791] - -## [0.8.25] - 2022-10-05 -### Changed -- Updated package dependencies. [#26568] - -## [0.8.24] - 2022-09-20 -### Changed -- Updated package dependencies. - -## [0.8.23] - 2022-09-08 -### Changed -- Updated package dependencies. - -## [0.8.22] - 2022-08-29 -### Changed -- Updated package dependencies. - -## [0.8.21] - 2022-08-25 -### Changed -- Updated package dependencies. [#25814] - -## [0.8.20] - 2022-08-23 -### Changed -- Updated package dependencies. [#25338, #25339, #25628, #25762] - -## [0.8.19] - 2022-08-03 -### Changed -- Updated package dependencies. [#25300, #25315] - -## [0.8.18] - 2022-07-26 -### Changed -- Updated package dependencies. [#25158] - -## [0.8.17] - 2022-07-12 -### Changed -- Updated package dependencies. - -## [0.8.16] - 2022-07-06 -### Changed -- Updated package dependencies. [#24923] - -## [0.8.15] - 2022-06-21 -### Changed -- Renaming master to trunk. [#24661] - -## [0.8.14] - 2022-06-14 -### Changed -- Updated package dependencies. [#24529] - -## [0.8.13] - 2022-06-08 -### Changed -- Reorder JS imports for `import/order` eslint rule. [#24601] - -## [0.8.12] - 2022-05-30 -### Changed -- Updated package dependencies - -## [0.8.11] - 2022-05-18 -### Changed -- Updated package dependencies [#24372] - -## [0.8.10] - 2022-05-10 -### Changed -- Updated package dependencies. [#24302] - -## [0.8.9] - 2022-05-04 -### Added -- Add missing JavaScript dependencies. [#24096] - -### Changed -- Updated package dependencies. [#24095] [#24198] - -### Deprecated -- Moved the options class into Connection. [#24095] - -## [0.8.8] - 2022-04-26 -### Changed -- Updated package dependencies. -- Update package.json metadata. - -## [0.8.7] - 2022-04-19 -### Changed -- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` - -## [0.8.6] - 2022-04-12 -### Changed -- Updated package dependencies. - -## [0.8.5] - 2022-04-06 -### Changed -- Updated package dependencies - -### Removed -- Removed tracking dependency. - -## [0.8.4] - 2022-03-29 -### Changed -- Microperformance: Use === null instead of is_null -- Updated package dependencies. - -## [0.8.3] - 2022-03-23 -### Changed -- Updated package dependencies - -## [0.8.2] - 2022-03-15 -### Changed -- Updated package dependencies. - -## [0.8.1] - 2022-03-08 -### Changed -- Updated package dependencies. - -## [0.8.0] - 2022-03-02 -### Added -- IDC: add detection for possibly dynamic HTTP_HOST being used in WP_SITEURL or WP_HOME. - -### Changed -- Bring back the IDC screen in Staging mode. -- Updated package dependencies. - -## [0.7.4] - 2022-02-22 -### Added -- Add blog ID to event tracking. - -## [0.7.3] - 2022-02-16 -### Changed -- Updated package dependencies. - -## [0.7.2] - 2022-02-09 -### Changed -- Updated package dependencies - -## [0.7.1] - 2022-02-02 -### Changed -- Updated package dependencies. - -## [0.7.0] - 2022-01-27 -### Changed -- IDC "Safe Mode" admin bar button redesign. - -## [0.6.4] - 2022-01-25 -### Changed -- Add class notice to the IDC container div. -- Add missing JS peer dependency. -- Updated package dependencies. - -## [0.6.3] - 2022-01-18 -### Changed -- General: update required node version to v16.13.2 - -## [0.6.2] - 2022-01-11 -### Changed -- Updated package dependencies. - -## [0.6.1] - 2022-01-11 -### Fixed -- Do not add IDC query args to authenticated request when in offline or staging mode. - -## [0.6.0] - 2022-01-04 -### Added -- Build and display the new RNA IDC banner. - -### Changed -- Switch to pcov for code coverage. -- Updated package dependencies. -- Updated package textdomain from `jetpack` to `jetpack-idc`. -- Updated references to '.jp-recommendations__app-badge' to its new name '.apps-badge' - -## [0.5.0] - 2021-12-14 -### Added -- Add a method to determine the safe mode status. - -### Changed -- Updated package dependencies. - -## [0.4.4] - 2021-11-30 -### Changed -- Colors: update Jetpack Primary color to match latest brand book. -- Remove now-redundant `output.filename` from Webpack config. - -## [0.4.3] - 2021-11-23 -### Changed -- Updated package dependencies. - -## [0.4.2] - 2021-11-17 - -## [0.4.1] - 2021-11-16 -### Added -- Use monorepo `validate-es` script to validate Webpack builds. - -### Changed -- Updated package dependencies - -## [0.4.0] - 2021-11-09 -### Added -- Add a method to unambiguously determine whether the site is experiencing identity crisis. - -### Changed -- Updated package dependencies. -- Update webpack build config. Removes IE 11 support in the JavaScript. - -## [0.3.1] - 2021-11-02 -### Changed -- Add the idc url query args to remote requests -- 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.3.0] - 2021-10-26 -### Added -- Add redirect_uri parameter for IDC Start Fresh endpoint. -- Delete the migrate_for_idc option when a remote request returns migrated_for_idc - -### Changed -- Updated package dependencies - -## [0.2.8] - 2021-10-13 -### Changed -- Updated package dependencies. - -## [0.2.7] - 2021-10-12 -### Added -- Add the new check_response_for_idc method to the Identity_Crisis class - -### Changed -- Updated package dependencies - -## [0.2.6] - 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. -- IDC: Rename the Identity_Crisis::sync_idc_optin method to Identity_Crisis:should_handle_idc. Add a new filter and constant that use the new name. -- Updated package dependencies. - -## [0.2.5] - 2021-08-31 -### Changed -- Updated package dependencies. - -## [0.2.4] - 2021-08-30 -### Changed -- Bump changelogger version -- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). -- update annotations versions -- Update to latest webpack, webpack-cli and calypso-build -- Use Node 16.7.0 in tooling. This shouldn't change the behavior of the code itself. - -## [0.2.3] - 2021-08-12 -### Changed -- Updated package dependencies - -## [0.2.2] - 2021-07-27 -### Added -- Add jetpack_connection_disconnect_site_wpcom filter. - -## [0.2.1] - 2021-07-13 -### Changed -- Updated package dependencies. - -## [0.2.0] - 2021-06-29 -### Added -- Add jetpack_idc_disconnect hook to properly disconnect based on IDC settings and clear IDC options. - -### Changed -- Migrate jetpack/v4/identity-crisis endpoints into package. -- Update node version requirement to 14.16.1 - -## 0.1.0 - 2021-06-15 -### Added -- Sync: Adding the Identity_Crisis package. - -### Changed -- Updated package dependencies. -- Use Connection/Urls for home_url and site_url functions migrated from Sync. - -[0.20.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.19.0...v0.20.0 -[0.19.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.6...v0.19.0 -[0.18.6]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.5...v0.18.6 -[0.18.5]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.4...v0.18.5 -[0.18.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.3...v0.18.4 -[0.18.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.2...v0.18.3 -[0.18.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.1...v0.18.2 -[0.18.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.0...v0.18.1 -[0.18.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.17.6...v0.18.0 -[0.17.6]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.17.5...v0.17.6 -[0.17.5]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.17.4...v0.17.5 -[0.17.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.17.3...v0.17.4 -[0.17.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.17.2...v0.17.3 -[0.17.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.17.1...v0.17.2 -[0.17.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.17.0...v0.17.1 -[0.17.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.16.0...v0.17.0 -[0.16.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.15.1...v0.16.0 -[0.15.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.15.0...v0.15.1 -[0.15.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.14.1...v0.15.0 -[0.14.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.14.0...v0.14.1 -[0.14.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.13.0...v0.14.0 -[0.13.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.12.1...v0.13.0 -[0.12.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.12.0...v0.12.1 -[0.12.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.11.3...v0.12.0 -[0.11.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.11.2...v0.11.3 -[0.11.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.11.1...v0.11.2 -[0.11.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.11.0...v0.11.1 -[0.11.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.7...v0.11.0 -[0.10.7]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.6...v0.10.7 -[0.10.6]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.5...v0.10.6 -[0.10.5]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.4...v0.10.5 -[0.10.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.3...v0.10.4 -[0.10.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.2...v0.10.3 -[0.10.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.1...v0.10.2 -[0.10.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.10.0...v0.10.1 -[0.10.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.9.0...v0.10.0 -[0.9.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.52...v0.9.0 -[0.8.52]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.51...v0.8.52 -[0.8.51]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.50...v0.8.51 -[0.8.50]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.49...v0.8.50 -[0.8.49]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.48...v0.8.49 -[0.8.48]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.47...v0.8.48 -[0.8.47]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.46...v0.8.47 -[0.8.46]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.45...v0.8.46 -[0.8.45]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.44...v0.8.45 -[0.8.44]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.43...v0.8.44 -[0.8.43]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.42...v0.8.43 -[0.8.42]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.41...v0.8.42 -[0.8.41]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.40...v0.8.41 -[0.8.40]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.39...v0.8.40 -[0.8.39]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.38...v0.8.39 -[0.8.38]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.37...v0.8.38 -[0.8.37]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.36...v0.8.37 -[0.8.36]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.35...v0.8.36 -[0.8.35]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.34...v0.8.35 -[0.8.34]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.33...v0.8.34 -[0.8.33]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.32...v0.8.33 -[0.8.32]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.31...v0.8.32 -[0.8.31]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.30...v0.8.31 -[0.8.30]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.29...v0.8.30 -[0.8.29]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.28...v0.8.29 -[0.8.28]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.27...v0.8.28 -[0.8.27]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.26...v0.8.27 -[0.8.26]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.25...v0.8.26 -[0.8.25]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.24...v0.8.25 -[0.8.24]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.23...v0.8.24 -[0.8.23]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.22...v0.8.23 -[0.8.22]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.21...v0.8.22 -[0.8.21]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.20...v0.8.21 -[0.8.20]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.19...v0.8.20 -[0.8.19]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.18...v0.8.19 -[0.8.18]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.17...v0.8.18 -[0.8.17]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.16...v0.8.17 -[0.8.16]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.15...v0.8.16 -[0.8.15]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.14...v0.8.15 -[0.8.14]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.13...v0.8.14 -[0.8.13]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.12...v0.8.13 -[0.8.12]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.11...v0.8.12 -[0.8.11]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.10...v0.8.11 -[0.8.10]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.9...v0.8.10 -[0.8.9]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.8...v0.8.9 -[0.8.8]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.7...v0.8.8 -[0.8.7]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.6...v0.8.7 -[0.8.6]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.5...v0.8.6 -[0.8.5]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.4...v0.8.5 -[0.8.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.3...v0.8.4 -[0.8.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.2...v0.8.3 -[0.8.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.1...v0.8.2 -[0.8.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.8.0...v0.8.1 -[0.8.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.7.4...v0.8.0 -[0.7.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.7.3...v0.7.4 -[0.7.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.7.2...v0.7.3 -[0.7.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.7.1...v0.7.2 -[0.7.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.7.0...v0.7.1 -[0.7.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.6.4...v0.7.0 -[0.6.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.6.3...v0.6.4 -[0.6.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.6.2...v0.6.3 -[0.6.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.6.1...v0.6.2 -[0.6.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.6.0...v0.6.1 -[0.6.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.5.0...v0.6.0 -[0.5.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.4.4...v0.5.0 -[0.4.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.4.3...v0.4.4 -[0.4.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.4.2...v0.4.3 -[0.4.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.4.1...v0.4.2 -[0.4.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.4.0...v0.4.1 -[0.4.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.3.1...v0.4.0 -[0.3.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.3.0...v0.3.1 -[0.3.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.8...v0.3.0 -[0.2.8]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.7...v0.2.8 -[0.2.7]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.6...v0.2.7 -[0.2.6]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.5...v0.2.6 -[0.2.5]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.4...v0.2.5 -[0.2.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.3...v0.2.4 -[0.2.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.2...v0.2.3 -[0.2.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.1...v0.2.2 -[0.2.1]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.2.0...v0.2.1 -[0.2.0]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.1.0...v0.2.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/LICENSE.txt deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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-identity-crisis/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/SECURITY.md deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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-identity-crisis/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.asset.php deleted file mode 100644 index 3b292381..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '4b5c20bc6fc08deb6c73'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.css deleted file mode 100644 index 1a3c127e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.css +++ /dev/null @@ -1 +0,0 @@ -#wpadminbar #wp-admin-bar-jetpack-idc{margin-right:5px}#wpadminbar #wp-admin-bar-jetpack-idc .jp-idc-admin-bar{border-radius:2px;color:#efeff0;font-size:14px;font-weight:500;line-height:20px;padding:6px 8px}#wpadminbar #wp-admin-bar-jetpack-idc.hide{display:none}#wpadminbar #wp-admin-bar-jetpack-idc .dashicons{font-family:dashicons;margin-top:-6px}#wpadminbar #wp-admin-bar-jetpack-idc .dashicons:before{font-size:18px}#wpadminbar #wp-admin-bar-jetpack-idc .ab-item{background:#e68b28;padding:0}#jp-identity-crisis-container .jp-idc__idc-screen{margin-bottom:40px;margin-top:40px}#jp-identity-crisis-container.notice{background:none;border:none}.jp-idc__idc-screen{background:#fff;border-left:4px solid #e68b28;border-radius:4px;box-shadow:0 0 40px #0000000a;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0 auto;max-width:1128px;padding:10px}.jp-idc__idc-screen.jp-idc__idc-screen__success{border-color:#069e08}@media(min-width:600px){.jp-idc__idc-screen{padding:48px}}.jp-idc__idc-screen .jp-idc__idc-screen__header{align-items:center;display:flex}.jp-idc__idc-screen .jp-idc__idc-screen__header .jp-idc__idc-screen__logo-image{max-height:100px;max-width:100px}.jp-idc__idc-screen .jp-idc__idc-screen__header .jp-idc__idc-screen__logo-label{font-size:14px;line-height:22px;margin:-7px 0 0 8px}.jp-idc__idc-screen h2{font-size:24px;font-weight:600;line-height:28px;margin:32px 0 0}.jp-idc__idc-screen h3{font-size:20px;font-weight:600;line-height:28px;margin:24px 0 0}.jp-idc__idc-screen p{color:#2c3338;font-size:16px;line-height:24px;margin:16px 0 0;max-width:710px}.jp-idc__idc-screen a{color:#2c3338}.jp-idc__idc-screen .jp-idc__idc-screen__cards{align-items:center;display:flex;flex-direction:column;flex-wrap:wrap}@media only screen and (min-width:1403px){.jp-idc__idc-screen .jp-idc__idc-screen__cards{align-items:normal;flex-direction:row}}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__cards-separator{align-self:center;color:#23282d;font-size:20px;font-weight:600;line-height:28px;margin:0 24px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base{border:1px solid #c3c4c7;border-radius:4px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;margin:24px 0;max-width:100%;padding:10px;width:480px}@media(min-width:600px){.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base{padding:24px}}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base h4{font-size:20px;font-weight:400;line-height:28px;margin:0 0 8px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base p{margin:0 0 24px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-sitename{background:#f9f9f6;border-radius:33px;box-sizing:border-box;color:#2c3338;font-size:16px;font-weight:700;line-height:24px;overflow-wrap:anywhere;padding:16px;text-align:center;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-separator{display:block;margin:12px auto}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-button{padding:8px 24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-action-button{background:#000;border-radius:4px;color:#fff;font-size:16px;font-weight:600;height:auto;justify-content:center;line-height:24px;margin-top:24px;min-height:40px;padding:8px}.jp-idc__idc-screen .jp-idc__idc-screen__card-action-button-migrated{margin-top:64px;width:141px}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated{align-items:center;display:flex;flex-direction:column;flex-wrap:wrap;margin-top:24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-hostname{border:1px solid #c3c4c7;border-radius:4px;color:#2c3338;flex-grow:1;font-size:16px;font-weight:700;line-height:24px;padding:24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{display:none}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator{display:block}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator,.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{margin:28px}@media only screen and (min-width:1400px){.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated{flex-direction:row;width:auto}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator{display:none}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{display:block}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-hostname{width:auto}}@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%}: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-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}.jp-idc__idc-screen .jp-idc__error-message{align-items:center;color:var(--jp-red);display:flex;flex-direction:row;justify-content:center;margin:15px 0}.jp-idc__idc-screen .jp-idc__error-message .error-gridicon{margin-right:8px;fill:var(--jp-red)}.jp-idc__idc-screen .jp-idc__error-message a,.jp-idc__idc-screen .jp-idc__error-message span{color:var(--jp-red);font-size:var(--font-body)}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__error-message{margin-top:5px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base{padding-bottom:75px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base.jp-idc__idc-screen__card-action-error{padding-bottom:5px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base .jp-idc__error-message{height:40px}.jp-idc__idc-screen .jp-idc__safe-mode{text-align:center}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__safe-mode__staying-safe{display:flex;justify-content:center;padding:6px}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__safe-mode__staying-safe .jp-components-spinner{margin:0 10px}.jp-idc__idc-screen .jp-idc__safe-mode,.jp-idc__idc-screen .jp-idc__safe-mode button{color:#2c3338;font-size:16px;line-height:24px}.jp-idc__idc-screen .jp-idc__safe-mode button{padding:0;text-decoration:underline} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js deleted file mode 100644 index 5df5c3f2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! For license information please see index.js.LICENSE.txt */ -(()=>{var e={235:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e=[],t=0;t{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 n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))})),t.splice(s,0,n)},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=n(741)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},741:(e,t,n)=>{e.exports=function(e){function t(e){let n,s,a,i=null;function o(...e){if(!o.enabled)return;const r=o,s=Number(new Date),a=s-(n||s);r.diff=a,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";i++;const a=t.formatters[s];if("function"==typeof a){const t=e[i];n=a.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=r,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,a=t.enabled(e)),a),set:e=>{i=e}}),"function"==typeof t.init&&t.init(o),o}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(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(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{},611:()=>{},724:()=>{},310:()=>{},171:e=>{var t=1e3,n=60*t,r=60*n,s=24*r,a=7*s,i=365.25*s;function o(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}e.exports=function(e,c){c=c||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var o=/^(-?(?:\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(!o)return;var c=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===l&&isFinite(e))return c.long?function(e){var a=Math.abs(e);if(a>=s)return o(e,a,s,"day");if(a>=r)return o(e,a,r,"hour");if(a>=n)return o(e,a,n,"minute");if(a>=t)return o(e,a,t,"second");return e+" ms"}(e):function(e){var a=Math.abs(e);if(a>=s)return Math.round(e/s)+"d";if(a>=r)return Math.round(e/r)+"h";if(a>=n)return Math.round(e/n)+"m";if(a>=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))}},469:(e,t,n)=>{"use strict";var r=n(758);function s(){}function a(){}a.resetWarningCache=s,e.exports=function(){function e(e,t,n,s,a,i){if(i!==r){var o=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 o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={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:a,resetWarningCache:s};return n.PropTypes=n,n}},162:(e,t,n)=>{e.exports=n(469)()},758:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},975:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(951);const s=n.n(r)()("dops:analytics");let a,i;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const o={initialize:function(e,t,n){o.setUser(e,t),o.setSuperProps(n),o.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){i={ID:e,username:t}},setSuperProps:function(e){a=e},assignSuperProps:function(e){a=Object.assign(a||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);o.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Built stat "%s" in group "%s"',t,e);return n}(e,t);o.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){o.tracks.recordPageView(e),o.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,r,s,a,i){o.ga.recordPurchase(e,t,n,r,s,a,i)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(a&&(s("- Super Props: %o",a),t=Object.assign(t,a)),s('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):s('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};o.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){o.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){s("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};o.ga.initialized||(i&&(e={userId:"u-"+i.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),o.ga.initialized=!0)},recordPageView:function(e,t){o.ga.initialize(),s("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,n,r){o.ga.initialize();let a="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(a+=" [Option Label: "+n+"]"),void 0!==r&&(a+=" [Option Value: "+r+"]"),s(a),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,r)},recordPurchase:function(e,t,n,r,s,a,i){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:r,currency:i}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:s,quantity:a}),window.ga("ecommerce:send")}},identifyUser:function(){i&&window._tkq.push(["identifyUser",i.ID,i.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},c=o},743:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p});var r=n(132),s=n(483);function a(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const i=a("JsonParseError"),o=a("JsonParseAfterRedirectError"),c=a("Api404Error"),l=a("Api404AfterRedirectError"),d=a("FetchNetworkError");const p=new function(e,t){let n=e,a=e,i={"X-WP-Nonce":t},o={credentials:"same-origin",headers:i},c={method:"post",credentials:"same-origin",headers:Object.assign({},i,{"Content-type":"application/json"})},l=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",r=n.length?n.split("&"):[];return r.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+r.join("&")};const d={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){a=e},setApiNonce(e){i={"X-WP-Nonce":e},o={credentials:"same-origin",headers:i},c={method:"post",credentials:"same-origin",headers:Object.assign({},i,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=e},registerSite:(e,t,s)=>{const a={registration_nonce:e,no_iframe:!0};return(0,r.jetpackConfigHas)("consumer_slug")&&(a.plugin_slug=(0,r.jetpackConfigGet)("consumer_slug")),null!==t&&(a.redirect_uri=t),s&&(a.from=s),h(`${n}jetpack/v4/connection/register`,c,{body:JSON.stringify(a)}).then(u).then(m)},fetchAuthorizationUrl:e=>p((0,s.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),o).then(u).then(m),fetchSiteConnectionData:()=>p(`${n}jetpack/v4/connection/data`,o).then(m),fetchSiteConnectionStatus:()=>p(`${n}jetpack/v4/connection`,o).then(m),fetchSiteConnectionTest:()=>p(`${n}jetpack/v4/connection/test`,o).then(u).then(m),fetchUserConnectionData:()=>p(`${n}jetpack/v4/connection/data`,o).then(m),fetchUserTrackingSettings:()=>p(`${n}jetpack/v4/tracking/settings`,o).then(u).then(m),updateUserTrackingSettings:e=>h(`${n}jetpack/v4/tracking/settings`,c,{body:JSON.stringify(e)}).then(u).then(m),disconnectSite:()=>h(`${n}jetpack/v4/connection`,c,{body:JSON.stringify({isActive:!1})}).then(u).then(m),fetchConnectUrl:()=>p(`${n}jetpack/v4/connection/url`,o).then(u).then(m),unlinkUser:()=>h(`${n}jetpack/v4/connection/user`,c,{body:JSON.stringify({linked:!1})}).then(u).then(m),reconnect:()=>h(`${n}jetpack/v4/connection/reconnect`,c).then(u).then(m),fetchConnectedPlugins:()=>p(`${n}jetpack/v4/connection/plugins`,o).then(u).then(m),setHasSeenWCConnectionModal:()=>h(`${n}jetpack/v4/seen-wc-connection-modal`,c).then(u).then(m),fetchModules:()=>p(`${n}jetpack/v4/module/all`,o).then(u).then(m),fetchModule:e=>p(`${n}jetpack/v4/module/${e}`,o).then(u).then(m),activateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!0})}).then(u).then(m),deactivateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${n}jetpack/v4/module/${e}`,c,{body:JSON.stringify(t)}).then(u).then(m),updateSettings:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(u).then(m),getProtectCount:()=>p(`${n}jetpack/v4/module/protect/data`,o).then(u).then(m),resetOptions:e=>h(`${n}jetpack/v4/options/${e}`,c,{body:JSON.stringify({reset:!0})}).then(u).then(m),activateVaultPress:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(u).then(m),getVaultPressData:()=>p(`${n}jetpack/v4/module/vaultpress/data`,o).then(u).then(m),installPlugin:(e,t)=>{const r={slug:e,status:"active"};return t&&(r.source=t),h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify(r)}).then(u).then(m)},activateAkismet:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(u).then(m),getAkismetData:()=>p(`${n}jetpack/v4/module/akismet/data`,o).then(u).then(m),checkAkismetKey:()=>p(`${n}jetpack/v4/module/akismet/key/check`,o).then(u).then(m),checkAkismetKeyTyped:e=>h(`${n}jetpack/v4/module/akismet/key/check`,c,{body:JSON.stringify({api_key:e})}).then(u).then(m),fetchStatsData:e=>p(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),o).then(u).then(m).then(f),getPluginUpdates:()=>p(`${n}jetpack/v4/updates/plugins`,o).then(u).then(m),getPlans:()=>p(`${n}jetpack/v4/plans`,o).then(u).then(m),fetchSettings:()=>p(`${n}jetpack/v4/settings`,o).then(u).then(m),updateSetting:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(u).then(m),fetchSiteData:()=>p(`${n}jetpack/v4/site`,o).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>p(`${n}jetpack/v4/site/features`,o).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>p(`${n}jetpack/v4/site/products`,o).then(u).then(m),fetchSitePurchases:()=>p(`${n}jetpack/v4/site/purchases`,o).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>p(`${n}jetpack/v4/site/benefits`,o).then(u).then(m).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>p(`${n}jetpack/v4/site/discount`,o).then(u).then(m).then((e=>e.data)),fetchSetupQuestionnaire:()=>p(`${n}jetpack/v4/setup/questionnaire`,o).then(u).then(m),fetchRecommendationsData:()=>p(`${n}jetpack/v4/recommendations/data`,o).then(u).then(m),fetchRecommendationsProductSuggestions:()=>p(`${n}jetpack/v4/recommendations/product-suggestions`,o).then(u).then(m),fetchRecommendationsUpsell:()=>p(`${n}jetpack/v4/recommendations/upsell`,o).then(u).then(m),fetchRecommendationsConditional:()=>p(`${n}jetpack/v4/recommendations/conditional`,o).then(u).then(m),saveRecommendationsData:e=>h(`${n}jetpack/v4/recommendations/data`,c,{body:JSON.stringify({data:e})}).then(u),fetchProducts:()=>p(`${n}jetpack/v4/products`,o).then(u).then(m),fetchRewindStatus:()=>p(`${n}jetpack/v4/rewind`,o).then(u).then(m).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>p(`${n}jetpack/v4/scan`,o).then(u).then(m).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${n}jetpack/v4/notice/${e}`,c,{body:JSON.stringify({dismissed:!0})}).then(u).then(m),fetchPluginsData:()=>p(`${n}jetpack/v4/plugins`,o).then(u).then(m),fetchIntroOffers:()=>p(`${n}jetpack/v4/intro-offers`,o).then(u).then(m),fetchVerifySiteGoogleStatus:e=>p(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,o).then(u).then(m),verifySiteGoogle:e=>h(`${n}jetpack/v4/verify-site/google`,c,{body:JSON.stringify({keyring_id:e})}).then(u).then(m),submitSurvey:e=>h(`${n}jetpack/v4/marketing/survey`,c,{body:JSON.stringify(e)}).then(u).then(m),saveSetupQuestionnaire:e=>h(`${n}jetpack/v4/setup/questionnaire`,c,{body:JSON.stringify(e)}).then(u).then(m),updateLicensingError:e=>h(`${n}jetpack/v4/licensing/error`,c,{body:JSON.stringify(e)}).then(u).then(m),updateLicenseKey:e=>h(`${n}jetpack/v4/licensing/set-license`,c,{body:JSON.stringify({license:e})}).then(u).then(m),getUserLicensesCounts:()=>p(`${n}jetpack/v4/licensing/user/counts`,o).then(u).then(m),getUserLicenses:()=>p(`${n}jetpack/v4/licensing/user/licenses`,o).then(u).then(m),updateLicensingActivationNoticeDismiss:e=>h(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,c,{body:JSON.stringify({last_detached_count:e})}).then(u).then(m),updateRecommendationsStep:e=>h(`${n}jetpack/v4/recommendations/step`,c,{body:JSON.stringify({step:e})}).then(u),confirmIDCSafeMode:()=>h(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,c).then(u),startIDCFresh:e=>h(`${n}jetpack/v4/identity-crisis/start-fresh`,c,{body:JSON.stringify({redirect_uri:e})}).then(u).then(m),migrateIDC:()=>h(`${n}jetpack/v4/identity-crisis/migrate`,c).then(u),attachLicenses:e=>h(`${n}jetpack/v4/licensing/attach-licenses`,c,{body:JSON.stringify({licenses:e})}).then(u).then(m),fetchSearchPlanInfo:()=>p(`${a}jetpack/v4/search/plan`,o).then(u).then(m),fetchSearchSettings:()=>p(`${a}jetpack/v4/search/settings`,o).then(u).then(m),updateSearchSettings:e=>h(`${a}jetpack/v4/search/settings`,c,{body:JSON.stringify(e)}).then(u).then(m),fetchSearchStats:()=>p(`${a}jetpack/v4/search/stats`,o).then(u).then(m),fetchWafSettings:()=>p(`${n}jetpack/v4/waf`,o).then(u).then(m),updateWafSettings:e=>h(`${n}jetpack/v4/waf`,c,{body:JSON.stringify(e)}).then(u).then(m),fetchWordAdsSettings:()=>p(`${n}jetpack/v4/wordads/settings`,o).then(u).then(m),updateWordAdsSettings:e=>h(`${n}jetpack/v4/wordads/settings`,c,{body:JSON.stringify(e)}),fetchSearchPricing:()=>p(`${a}jetpack/v4/search/pricing`,o).then(u).then(m),fetchMigrationStatus:()=>p(`${n}jetpack/v4/migration/status`,o).then(u).then(m),fetchBackupUndoEvent:()=>p(`${n}jetpack/v4/site/backup/undo-event`,o).then(u).then(m),fetchBackupPreflightStatus:()=>p(`${n}jetpack/v4/site/backup/preflight`,o).then(u).then(m)};function p(e,t){return fetch(l(e),t)}function h(e,t,n){return fetch(e,Object.assign({},t,n)).catch(g)}function f(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,d)};function u(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new c})):e.json().catch((e=>h(e))).then((t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n}))}function m(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,n){throw t?new o(n):new i}function g(){throw new d}},868:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(674),s=n.n(r),a=n(736),i=n(235),o=n.n(i),c=n(196),l=n.n(c);const __=a.__,d=({logoColor:e="#069e08",showText:t=!0,className:n,height:r=32,...a})=>{const i=t?"0 0 118 32":"0 0 32 32";return l().createElement("svg",s()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:i,className:o()("jetpack-logo",n),"aria-labelledby":"jetpack-logo-title",height:r},a,{role:"img"}),l().createElement("title",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-idc")),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"})))}},33:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(162),s=n.n(r),a=n(196),i=n.n(a);n(683);const o=({color:e="#FFFFFF",className:t="",size:n=20})=>{const r=t+" jp-components-spinner",s={width:n,height:n,fontSize:n,borderTopColor:e},a={borderTopColor:e,borderRightColor:e};return i().createElement("div",{className:r},i().createElement("div",{className:"jp-components-spinner__outer",style:s},i().createElement("div",{className:"jp-components-spinner__inner",style:a})))};o.propTypes={color:s().string,className:s().string,size:s().number};const c=o},895:(e,t,n)=>{"use strict";function r(e,t={}){const n={};let r;if("undefined"!=typeof window&&(r=window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv),0===e.search("https://")){const t=new URL(e);e=`https://${t.host}${t.pathname}`,n.url=encodeURIComponent(e)}else n.source=encodeURIComponent(e);for(const e in t)n[e]=encodeURIComponent(t[e]);!Object.keys(n).includes("site")&&"undefined"!=typeof jetpack_redirects&&jetpack_redirects.hasOwnProperty("currentSiteRawUrl")&&(n.site=jetpack_redirects.currentBlogID??jetpack_redirects.currentSiteRawUrl),r&&(n.calypso_env=r);return"https://jetpack.com/redirect/?"+Object.keys(n).map((e=>e+"="+n[e])).join("&")}n.d(t,{Z:()=>r})},132:(e,t,n)=>{let r={};try{r=n(510)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),r={missingConfig:!0}}const s=e=>r.hasOwnProperty(e);e.exports={jetpackConfigHas:s,jetpackConfigGet:e=>{if(!s(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 r[e]}}},477:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(895),s=n(33),a=n(609),i=n(818),o=n(307),c=n(736),l=n(162),d=n.n(l),p=n(196),u=n.n(p),m=n(678),h=n(144),g=n(115),f=n(637);const __=c.__,y=e=>{const{isStartingFresh:t=!1,startFreshCallback:n=(()=>{}),customContent:l={},hasError:d=!1}=e,p=(0,g.Z)(e.wpcomHomeUrl),h=(0,g.Z)(e.currentUrl),y=(0,i.useSelect)((e=>e(m.t).getIsActionInProgress()),[]),k=l.startFreshButtonLabel||__("Create a fresh connection","jetpack-idc");return u().createElement("div",{className:"jp-idc__idc-screen__card-action-base"+(d?" jp-idc__idc-screen__card-action-error":"")},u().createElement("div",{className:"jp-idc__idc-screen__card-action-top"},u().createElement("h4",null,l.startFreshCardTitle?(0,o.createInterpolateElement)(l.startFreshCardTitle,{em:u().createElement("em",null)}):__("Treat each site as independent sites","jetpack-idc")),u().createElement("p",null,(0,o.createInterpolateElement)(l.startFreshCardBodyText||(0,c.sprintf)(/* translators: %1$s: The current site domain name. %2$s: The original site domain name. */ -__("%1$s settings, stats, and subscribers will start fresh. %2$s will keep its data as is.","jetpack-idc"),h,p),{hostname:u().createElement("strong",null),em:u().createElement("em",null),strong:u().createElement("strong",null)}))),u().createElement("div",{className:"jp-idc__idc-screen__card-action-bottom"},u().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},p),u().createElement(a.Dashicon,{icon:"minus",className:"jp-idc__idc-screen__card-action-separator"}),u().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},h),u().createElement(a.Button,{className:"jp-idc__idc-screen__card-action-button",label:k,onClick:n,disabled:y},t?u().createElement(s.Z,null):k),d&&(v=l.supportURL,u().createElement(f.Z,null,(0,o.createInterpolateElement)(__("Could not create the connection. Retry or find out more here.","jetpack-idc"),{a:u().createElement("a",{href:v||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})})))));var v};y.propTypes={wpcomHomeUrl:d().string.isRequired,currentUrl:d().string.isRequired,isStartingFresh:d().bool,startFreshCallback:d().func,customContent:d().shape(h.Z),hasError:d().bool};const k=y},596:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(895),s=n(33),a=n(609),i=n(818),o=n(307),c=n(736),l=n(162),d=n.n(l),p=n(196),u=n.n(p),m=n(678),h=n(144),g=n(115),f=n(637);const __=c.__,y=e=>{const t=(0,g.Z)(e.wpcomHomeUrl),n=(0,g.Z)(e.currentUrl),l=(0,i.useSelect)((e=>e(m.t).getIsActionInProgress()),[]),{isMigrating:d=!1,migrateCallback:p=(()=>{}),customContent:h={},hasError:y=!1}=e,k=h.migrateButtonLabel||__("Move your settings","jetpack-idc");return u().createElement("div",{className:"jp-idc__idc-screen__card-action-base"+(y?" jp-idc__idc-screen__card-action-error":"")},u().createElement("div",{className:"jp-idc__idc-screen__card-action-top"},u().createElement("h4",null,h.migrateCardTitle?(0,o.createInterpolateElement)(h.migrateCardTitle,{em:u().createElement("em",null)}):__("Move Jetpack data","jetpack-idc")),u().createElement("p",null,(0,o.createInterpolateElement)(h.migrateCardBodyText||(0,c.sprintf)(/* translators: %1$s: The current site domain name. %2$s: The original site domain name. */ -__("Move all your settings, stats and subscribers to your other URL, %1$s. %2$s will be disconnected from Jetpack.","jetpack-idc"),n,t),{hostname:u().createElement("strong",null),em:u().createElement("em",null),strong:u().createElement("strong",null)}))),u().createElement("div",{className:"jp-idc__idc-screen__card-action-bottom"},u().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},t),u().createElement(a.Dashicon,{icon:"arrow-down-alt",className:"jp-idc__idc-screen__card-action-separator"}),u().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},n),u().createElement(a.Button,{className:"jp-idc__idc-screen__card-action-button",label:k,onClick:p,disabled:l},d?u().createElement(s.Z,null):k),y&&(v=h.supportURL,u().createElement(f.Z,null,(0,o.createInterpolateElement)(__("Could not move your settings. Retry or find out more here.","jetpack-idc"),{a:u().createElement("a",{href:v||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})})))));var v};y.propTypes={wpcomHomeUrl:d().string.isRequired,currentUrl:d().string.isRequired,isMigrating:d().bool,migrateCallback:d().func,customContent:d().shape(h.Z),hasError:d().bool};const k=y},489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(196),s=n.n(r);const a=()=>s().createElement("svg",{className:"error-gridicon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24},s().createElement("rect",{x:"0",fill:"none",width:"24",height:"24"}),s().createElement("g",null,s().createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))},637:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(196),s=n.n(r),a=n(489);n(611);const i=e=>{const{children:t}=e;return s().createElement("div",{className:"jp-idc__error-message"},s().createElement(a.Z,null),s().createElement("span",null,t))}},381:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(743),s=n(818),a=n(162),i=n.n(a),o=n(196),c=n.n(o),l=n(970),d=n(272),p=n(105),u=n(678),m=n(144),h=n(521),g=n(567);const f=e=>{const{logo:t,customContent:n={},wpcomHomeUrl:a,currentUrl:i,apiNonce:m,apiRoot:f,redirectUri:y,tracksUserData:k,tracksEventData:v,isAdmin:C,possibleDynamicSiteUrlDetected:_}=e,[b,w]=(0,o.useState)(!1),E=(0,s.useSelect)((e=>e(u.t).getErrorType()),[]),{isMigrating:j,migrateCallback:S}=(0,l.Z)((0,o.useCallback)((()=>{w(!0)}),[w])),{isStartingFresh:F,startFreshCallback:I}=(0,p.Z)(y),{isFinishingMigration:U,finishMigrationCallback:T}=(0,d.Z)();return(0,o.useEffect)((()=>{r.ZP.setApiRoot(f),r.ZP.setApiNonce(m),(0,h.M)(v,k),v&&(v.hasOwnProperty("isAdmin")&&v.isAdmin?(0,h.Z)("notice_view"):(0,h.Z)("non_admin_notice_view",{page:!!v.hasOwnProperty("currentScreen")&&v.currentScreen}))}),[f,m,k,v]),c().createElement(g.Z,{logo:t,customContent:n,wpcomHomeUrl:a,currentUrl:i,redirectUri:y,isMigrating:j,migrateCallback:S,isMigrated:b,finishMigrationCallback:T,isFinishingMigration:U,isStartingFresh:F,startFreshCallback:I,isAdmin:C,hasStaySafeError:"safe-mode"===E,hasFreshError:"start-fresh"===E,hasMigrateError:"migrate"===E,possibleDynamicSiteUrlDetected:_})};f.propTypes={logo:i().object,customContent:i().shape(m.Z),wpcomHomeUrl:i().string.isRequired,currentUrl:i().string.isRequired,redirectUri:i().string.isRequired,apiRoot:i().string.isRequired,apiNonce:i().string.isRequired,tracksUserData:i().object,tracksEventData:i().object,isAdmin:i().bool.isRequired,possibleDynamicSiteUrlDetected:i().bool};const y=f},533:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(895),s=n(307),a=n(736),i=n(162),o=n.n(i),c=n(196),l=n.n(c),d=n(144),p=n(477),u=n(596),m=n(899);const __=a.__,h=e=>{const{wpcomHomeUrl:t,currentUrl:n,isMigrating:a=!1,migrateCallback:i,isStartingFresh:o=!1,startFreshCallback:c,customContent:d={},hasMigrateError:h=!1,hasFreshError:g=!1,hasStaySafeError:f=!1,possibleDynamicSiteUrlDetected:y=!1}=e;return l().createElement(l().Fragment,null,l().createElement("h2",null,d.mainTitle?(0,s.createInterpolateElement)(d.mainTitle,{em:l().createElement("em",null)}):__("Safe Mode has been activated","jetpack-idc")),l().createElement("p",null,(0,s.createInterpolateElement)(d.mainBodyText||__("Your site is in Safe Mode because you have 2 Jetpack-powered sites that appear to be duplicates. 2 sites that are telling Jetpack they’re the same site. Learn more about safe mode.","jetpack-idc"),{safeModeLink:l().createElement("a",{href:d.supportURL||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"}),em:l().createElement("em",null),strong:l().createElement("strong",null)})),y&&l().createElement("p",null,(0,s.createInterpolateElement)(d.dynamicSiteUrlText||__("Notice: It appears that your 'wp-config.php' file might be using dynamic site URL values. Dynamic site URLs could cause Jetpack to enter Safe Mode. Learn how to set a static site URL.","jetpack-idc"),{dynamicSiteUrlSupportLink:l().createElement("a",{href:d.dynamicSiteUrlSupportLink||(0,r.Z)("jetpack-idcscreen-dynamic-site-urls"),rel:"noopener noreferrer",target:"_blank"}),em:l().createElement("em",null),strong:l().createElement("strong",null)})),l().createElement("h3",null,__("Please select an option","jetpack-idc")),l().createElement("div",{className:"jp-idc__idc-screen__cards"+(h||g?" jp-idc__idc-screen__cards-error":"")},l().createElement(u.Z,{wpcomHomeUrl:t,currentUrl:n,isMigrating:a,migrateCallback:i,customContent:d,hasError:h}),l().createElement("div",{className:"jp-idc__idc-screen__cards-separator"},"or"),l().createElement(p.Z,{wpcomHomeUrl:t,currentUrl:n,isStartingFresh:o,startFreshCallback:c,customContent:d,hasError:g})),l().createElement(m.Z,{hasError:f,customContent:d}))};h.propTypes={wpcomHomeUrl:o().string.isRequired,currentUrl:o().string.isRequired,isMigrating:o().bool,migrateCallback:o().func,isStartingFresh:o().bool,startFreshCallback:o().func,customContent:o().shape(d.Z),hasMigrateError:o().bool,hasFreshError:o().bool,hasStaySafeError:o().bool,possibleDynamicSiteUrlDetected:o().bool};const g=h},52:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(33),s=n(609),a=n(307),i=n(736),o=n(162),c=n.n(o),l=n(196),d=n.n(l),p=n(144),u=n(115);const __=i.__,m=e=>{const{finishCallback:t=(()=>{}),isFinishing:n=!1,customContent:o={}}=e,c=(0,u.Z)(e.wpcomHomeUrl),l=(0,u.Z)(e.currentUrl),p=__("Got it, thanks","jetpack-idc");return d().createElement(d().Fragment,null,d().createElement("h2",null,o.migratedTitle?(0,a.createInterpolateElement)(o.migratedTitle,{em:d().createElement("em",null)}):__("Your Jetpack settings have migrated successfully","jetpack-idc")),d().createElement("p",null,(0,a.createInterpolateElement)(o.migratedBodyText||(0,i.sprintf)(/* translators: %1$s: The current site domain name. */ -__("Safe Mode has been switched off for %1$s website and Jetpack is fully functional.","jetpack-idc"),l),{hostname:d().createElement("strong",null),em:d().createElement("em",null),strong:d().createElement("strong",null)})),d().createElement("div",{className:"jp-idc__idc-screen__card-migrated"},d().createElement("div",{className:"jp-idc__idc-screen__card-migrated-hostname"},c),d().createElement(s.Dashicon,{icon:"arrow-down-alt",className:"jp-idc__idc-screen__card-migrated-separator"}),d().createElement(s.Dashicon,{icon:"arrow-right-alt",className:"jp-idc__idc-screen__card-migrated-separator-wide"}),d().createElement("div",{className:"jp-idc__idc-screen__card-migrated-hostname"},l)),d().createElement(s.Button,{className:"jp-idc__idc-screen__card-action-button jp-idc__idc-screen__card-action-button-migrated",onClick:t,label:p},n?d().createElement(r.Z,null):p))};m.propTypes={wpcomHomeUrl:c().string.isRequired,currentUrl:c().string.isRequired,finishCallback:c().func,isFinishing:c().bool,customContent:c().shape(p.Z)};const h=m},64:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(895),s=n(307),a=n(736),i=n(162),o=n.n(i),c=n(196),l=n.n(c),d=n(144);const __=a.__,p=e=>{const{customContent:t={}}=e;return l().createElement(l().Fragment,null,l().createElement("h2",null,t.nonAdminTitle?(0,s.createInterpolateElement)(t.nonAdminTitle,{em:l().createElement("em",null)}):__("Safe Mode has been activated","jetpack-idc")),l().createElement("p",null,(0,s.createInterpolateElement)(t.nonAdminBodyText||__("This site is in Safe Mode because there are 2 Jetpack-powered sites that appear to be duplicates. 2 sites that are telling Jetpack they’re the same site. Learn more about safe mode.","jetpack-idc"),{safeModeLink:l().createElement("a",{href:t.supportURL||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"}),em:l().createElement("em",null),strong:l().createElement("strong",null)})),t.nonAdminBodyText?"":l().createElement("p",null,__("An administrator of this site can take Jetpack out of Safe Mode.","jetpack-idc")))};p.propTypes={customContent:o().shape(d.Z)};const u=p},567:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(868),s=n(307),a=n(736),i=n(162),o=n.n(i),c=n(196),l=n.n(c),d=n(144),p=n(533),u=n(52),m=n(64);n(724);const __=a.__,h=e=>{const{logo:t=l().createElement(r.Z,{height:24}),customContent:n={},wpcomHomeUrl:a,currentUrl:i,redirectUri:o,isMigrating:c=!1,migrateCallback:d,isMigrated:h=!1,finishMigrationCallback:g,isFinishingMigration:f=!1,isStartingFresh:y=!1,startFreshCallback:k,isAdmin:v,hasMigrateError:C=!1,hasFreshError:_=!1,hasStaySafeError:b=!1,possibleDynamicSiteUrlDetected:w=!1}=e,E=v?"":l().createElement(m.Z,{customContent:n});let j="";return v&&(j=h?l().createElement(u.Z,{wpcomHomeUrl:a,currentUrl:i,finishCallback:g,isFinishing:f,customContent:n}):l().createElement(p.Z,{wpcomHomeUrl:a,currentUrl:i,redirectUri:o,customContent:n,isMigrating:c,migrateCallback:d,isStartingFresh:y,startFreshCallback:k,hasMigrateError:C,hasFreshError:_,hasStaySafeError:b,possibleDynamicSiteUrlDetected:w})),l().createElement("div",{className:"jp-idc__idc-screen"+(h?" jp-idc__idc-screen__success":"")},l().createElement("div",{className:"jp-idc__idc-screen__header"},l().createElement("div",{className:"jp-idc__idc-screen__logo"},((e,t)=>"string"==typeof e||e instanceof String?l().createElement("img",{src:e,alt:t,className:"jp-idc__idc-screen__logo-image"}):e)(t,n.logoAlt||"")),l().createElement("div",{className:"jp-idc__idc-screen__logo-label"},n.headerText?(0,s.createInterpolateElement)(n.headerText,{em:l().createElement("em",null),strong:l().createElement("strong",null)}):__("Safe Mode","jetpack-idc"))),E,j)};h.propTypes={logo:o().object,customContent:o().shape(d.Z),wpcomHomeUrl:o().string.isRequired,currentUrl:o().string.isRequired,redirectUri:o().string.isRequired,isMigrating:o().bool,migrateCallback:o().func,isMigrated:o().bool,finishMigrationCallback:o().func,isFinishingMigration:o().bool,isStartingFresh:o().bool,startFreshCallback:o().func,isAdmin:o().bool.isRequired,hasMigrateError:o().bool,hasFreshError:o().bool,hasStaySafeError:o().bool,possibleDynamicSiteUrlDetected:o().bool};const g=h},899:(e,t,n)=>{"use strict";n.d(t,{Z:()=>_});var r=n(743),s=n(33),a=n(895),i=n(609),o=n(333),c=n(818),l=n(307),d=n(736),p=n(483),u=n(162),m=n.n(u),h=n(196),g=n.n(h),f=n(678),y=n(144),k=n(521),v=n(637);n(310);const __=d.__,C=e=>{const{isActionInProgress:t,setIsActionInProgress:n,setErrorType:o,clearErrorType:c,hasError:d=!1,customContent:u}=e,[m,f]=(0,h.useState)(!1),y=(0,h.useCallback)((()=>{t||(f(!0),n(!0),c(),(0,k.Z)("confirm_safe_mode"),r.ZP.confirmIDCSafeMode().then((()=>{window.location.href=(0,p.removeQueryArgs)(window.location.href,"jetpack_idc_clear_confirmation","_wpnonce")})).catch((e=>{throw n(!1),f(!1),o("safe-mode"),e})))}),[t,n,o,c]);return g().createElement("div",{className:"jp-idc__safe-mode"},m?g().createElement("div",{className:"jp-idc__safe-mode__staying-safe"},g().createElement(s.Z,{color:"black"}),g().createElement("span",null,__("Finishing setting up Safe mode…","jetpack-idc"))):(_=y,b=t,(0,l.createInterpolateElement)(__("Or decide later and stay in ","jetpack-idc"),{button:g().createElement(i.Button,{label:__("Safe mode","jetpack-idc"),variant:"link",onClick:_,disabled:b})})),d&&(C=u.supportURL,g().createElement(v.Z,null,(0,l.createInterpolateElement)(__("Could not stay in safe mode. Retry or find out more here.","jetpack-idc"),{a:g().createElement("a",{href:C||(0,a.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})}))));var C,_,b};C.propTypes={isActionInProgress:m().bool,setIsActionInProgress:m().func.isRequired,setErrorType:m().func.isRequired,clearErrorType:m().func.isRequired,hasError:m().bool,customContent:m().shape(y.Z)};const _=(0,o.compose)([(0,c.withSelect)((e=>({isActionInProgress:e(f.t).getIsActionInProgress()}))),(0,c.withDispatch)((e=>({setIsActionInProgress:e(f.t).setIsActionInProgress,setErrorType:e(f.t).setErrorType,clearErrorType:e(f.t).clearErrorType})))])(C)},272:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(196);const s=()=>{const[e,t]=(0,r.useState)(!1),n=(0,r.useCallback)((()=>{e||(t(!0),window.location.reload())}),[e,t]);return{isFinishingMigration:e,finishMigrationCallback:n}}},970:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(743),s=n(818),a=n(196),i=n(678),o=n(521);const c=e=>{const[t,n]=(0,a.useState)(!1),c=(0,s.useSelect)((e=>e(i.t).getIsActionInProgress()),[]),{setIsActionInProgress:l,setErrorType:d,clearErrorType:p}=(0,s.useDispatch)(i.t);return{isMigrating:t,migrateCallback:(0,a.useCallback)((()=>{c||((0,o.Z)("migrate"),l(!0),n(!0),p(),r.ZP.migrateIDC().then((()=>{n(!1),e&&"[object Function]"==={}.toString.call(e)&&e()})).catch((e=>{throw l(!1),n(!1),d("migrate"),e})))}),[n,e,c,l,d,p])}}},105:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(743),s=n(818),a=n(196),i=n(678),o=n(521);const c=e=>{const[t,n]=(0,a.useState)(!1),c=(0,s.useSelect)((e=>e(i.t).getIsActionInProgress()),[]),{setIsActionInProgress:l,setErrorType:d,clearErrorType:p}=(0,s.useDispatch)(i.t);return{isStartingFresh:t,startFreshCallback:(0,a.useCallback)((()=>{c||((0,o.Z)("start_fresh"),l(!0),n(!0),p(),r.ZP.startIDCFresh(e).then((e=>{window.location.href=e+"&from=idc-notice"})).catch((e=>{throw l(!1),n(!1),d("start-fresh"),e})))}),[n,c,l,e,d,p])}}},136:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>i,hG:()=>r,jk:()=>a,vC:()=>s});const r="SET_IS_ACTION_IN_PROGRESS",s="SET_ERROR_TYPE",a="CLEAR_ERROR_TYPE",i={setIsActionInProgress:e=>({type:r,isInProgress:e}),setErrorType:e=>({type:s,errorType:e}),clearErrorType:()=>({type:a})}},773:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(818),s=n(136);const a=(0,r.combineReducers)({isActionInProgress:(e=!1,t)=>t.type===s.hG?t.isInProgress:e,errorType:(e=null,t)=>{switch(t.type){case s.vC:return t.errorType;case s.jk:return null}return e}})},416:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getIsActionInProgress:e=>e.isActionInProgress||!1,getErrorType:e=>e.errorType||null}},943:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(818);class s{static store=null;static mayBeInit(e,t){null===s.store&&(s.store=(0,r.createReduxStore)(e,t),(0,r.register)(s.store))}}const a=s},678:(e,t,n)=>{"use strict";n.d(t,{t:()=>o});var r=n(136),s=n(773),a=n(416),i=n(943);const o="jetpack-idc";i.Z.mayBeInit(o,{reducer:s.Z,actions:r.ZP,selectors:a.Z})},144:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(162),s=n.n(r);const a={headerText:s().string,logoAlt:s().string,mainTitle:s().string,mainBodyText:s().string,migratedTitle:s().string,migratedBodyText:s().string,migrateCardTitle:s().string,migrateButtonLabel:s().string,migrateCardBodyText:s().string,startFreshCardTitle:s().string,startFreshCardBodyText:s().string,startFreshButtonLabel:s().string,nonAdminTitle:s().string,nonAdminBodyText:s().string,supportURL:s().string}},115:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=e=>/^https?:\/\//.test(e)?new URL(e).hostname:e.replace(/\/$/,"")},521:(e,t,n)=>{"use strict";n.d(t,{M:()=>s,Z:()=>a});var r=n(975);function s(e,t){t&&t.hasOwnProperty("userid")&&t.hasOwnProperty("username")&&r.Z.initialize(t.userid,t.username),e&&(e.hasOwnProperty("blogID")&&r.Z.assignSuperProps({blog_id:e.blogID}),e.hasOwnProperty("platform")&&r.Z.assignSuperProps({platform:e.platform})),r.Z.setMcAnalyticsEnabled(!0)}function a(e,t={}){void 0!==t&&"object"==typeof t||(t={}),e&&e.length&&void 0!==r.Z&&r.Z.tracks&&r.Z.mc&&(e=0!==(e=e.replace(/-/g,"_")).indexOf("jetpack_idc_")?"jetpack_idc_"+e:e,r.Z.tracks.recordEvent(e,t),e=(e=e.replace("jetpack_idc_","")).replace(/_/g,"-"),r.Z.mc.bumpStat("jetpack-idc",e))}},510:e=>{"use strict";if(void 0==={consumer_slug:"identity_crisis"}){var t=new Error('Cannot find module \'{"consumer_slug":"identity_crisis"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"identity_crisis"}},196:e=>{"use strict";e.exports=window.React},609:e=>{"use strict";e.exports=window.wp.components},333:e=>{"use strict";e.exports=window.wp.compose},818:e=>{"use strict";e.exports=window.wp.data},307:e=>{"use strict";e.exports=window.wp.element},736:e=>{"use strict";e.exports=window.wp.i18n},483:e=>{"use strict";e.exports=window.wp.url},674:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{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),(()=>{"use strict";var e=n(381),t=n(307),r=n(196),s=n.n(r);window.addEventListener("load",(()=>function(){if(!window.hasOwnProperty("JP_IDENTITY_CRISIS__INITIAL_STATE"))return;const n=document.getElementById(window.JP_IDENTITY_CRISIS__INITIAL_STATE.containerID||"jp-identity-crisis-container");if(null===n)return;const{WP_API_root:r,WP_API_nonce:a,wpcomHomeUrl:i,currentUrl:o,redirectUri:c,tracksUserData:l,tracksEventData:d,isSafeModeConfirmed:p,consumerData:u,isAdmin:m,possibleDynamicSiteUrlDetected:h}=window.JP_IDENTITY_CRISIS__INITIAL_STATE;if(!p){const p=s().createElement(e.Z,{wpcomHomeUrl:i,currentUrl:o,apiRoot:r,apiNonce:a,redirectUri:c,tracksUserData:l||{},tracksEventData:d,customContent:u.hasOwnProperty("customContent")?u.customContent:{},isAdmin:m,logo:u.hasOwnProperty("logo")?u.logo:void 0,possibleDynamicSiteUrlDetected:h});t.createRoot(n).render(p)}}()))})()})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js.LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js.LICENSE.txt deleted file mode 100644 index 827f2732..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js.LICENSE.txt +++ /dev/null @@ -1,5 +0,0 @@ -/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.rtl.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.rtl.css deleted file mode 100644 index 2a9d49c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.rtl.css +++ /dev/null @@ -1 +0,0 @@ -#wpadminbar #wp-admin-bar-jetpack-idc{margin-left:5px}#wpadminbar #wp-admin-bar-jetpack-idc .jp-idc-admin-bar{border-radius:2px;color:#efeff0;font-size:14px;font-weight:500;line-height:20px;padding:6px 8px}#wpadminbar #wp-admin-bar-jetpack-idc.hide{display:none}#wpadminbar #wp-admin-bar-jetpack-idc .dashicons{font-family:dashicons;margin-top:-6px}#wpadminbar #wp-admin-bar-jetpack-idc .dashicons:before{font-size:18px}#wpadminbar #wp-admin-bar-jetpack-idc .ab-item{background:#e68b28;padding:0}#jp-identity-crisis-container .jp-idc__idc-screen{margin-bottom:40px;margin-top:40px}#jp-identity-crisis-container.notice{background:none;border:none}.jp-idc__idc-screen{background:#fff;border-radius:4px;border-right:4px solid #e68b28;box-shadow:0 0 40px #0000000a;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0 auto;max-width:1128px;padding:10px}.jp-idc__idc-screen.jp-idc__idc-screen__success{border-color:#069e08}@media(min-width:600px){.jp-idc__idc-screen{padding:48px}}.jp-idc__idc-screen .jp-idc__idc-screen__header{align-items:center;display:flex}.jp-idc__idc-screen .jp-idc__idc-screen__header .jp-idc__idc-screen__logo-image{max-height:100px;max-width:100px}.jp-idc__idc-screen .jp-idc__idc-screen__header .jp-idc__idc-screen__logo-label{font-size:14px;line-height:22px;margin:-7px 8px 0 0}.jp-idc__idc-screen h2{font-size:24px;font-weight:600;line-height:28px;margin:32px 0 0}.jp-idc__idc-screen h3{font-size:20px;font-weight:600;line-height:28px;margin:24px 0 0}.jp-idc__idc-screen p{color:#2c3338;font-size:16px;line-height:24px;margin:16px 0 0;max-width:710px}.jp-idc__idc-screen a{color:#2c3338}.jp-idc__idc-screen .jp-idc__idc-screen__cards{align-items:center;display:flex;flex-direction:column;flex-wrap:wrap}@media only screen and (min-width:1403px){.jp-idc__idc-screen .jp-idc__idc-screen__cards{align-items:normal;flex-direction:row}}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__cards-separator{align-self:center;color:#23282d;font-size:20px;font-weight:600;line-height:28px;margin:0 24px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base{border:1px solid #c3c4c7;border-radius:4px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;margin:24px 0;max-width:100%;padding:10px;width:480px}@media(min-width:600px){.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base{padding:24px}}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base h4{font-size:20px;font-weight:400;line-height:28px;margin:0 0 8px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base p{margin:0 0 24px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-sitename{background:#f9f9f6;border-radius:33px;box-sizing:border-box;color:#2c3338;font-size:16px;font-weight:700;line-height:24px;overflow-wrap:anywhere;padding:16px;text-align:center;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-separator{display:block;margin:12px auto}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-button{padding:8px 24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-action-button{background:#000;border-radius:4px;color:#fff;font-size:16px;font-weight:600;height:auto;justify-content:center;line-height:24px;margin-top:24px;min-height:40px;padding:8px}.jp-idc__idc-screen .jp-idc__idc-screen__card-action-button-migrated{margin-top:64px;width:141px}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated{align-items:center;display:flex;flex-direction:column;flex-wrap:wrap;margin-top:24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-hostname{border:1px solid #c3c4c7;border-radius:4px;color:#2c3338;flex-grow:1;font-size:16px;font-weight:700;line-height:24px;padding:24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{display:none}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator{display:block}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator,.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{margin:28px}@media only screen and (min-width:1400px){.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated{flex-direction:row;width:auto}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator{display:none}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{display:block}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-hostname{width:auto}}@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%}: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-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}.jp-idc__idc-screen .jp-idc__error-message{align-items:center;color:var(--jp-red);display:flex;flex-direction:row;justify-content:center;margin:15px 0}.jp-idc__idc-screen .jp-idc__error-message .error-gridicon{margin-left:8px;fill:var(--jp-red)}.jp-idc__idc-screen .jp-idc__error-message a,.jp-idc__idc-screen .jp-idc__error-message span{color:var(--jp-red);font-size:var(--font-body)}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__error-message{margin-top:5px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base{padding-bottom:75px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base.jp-idc__idc-screen__card-action-error{padding-bottom:5px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base .jp-idc__error-message{height:40px}.jp-idc__idc-screen .jp-idc__safe-mode{text-align:center}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__safe-mode__staying-safe{display:flex;justify-content:center;padding:6px}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__safe-mode__staying-safe .jp-components-spinner{margin:0 10px}.jp-idc__idc-screen .jp-idc__safe-mode,.jp-idc__idc-screen .jp-idc__safe-mode button{color:#2c3338;font-size:16px;line-height:24px}.jp-idc__idc-screen .jp-idc__safe-mode button{padding:0;text-decoration:underline} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/composer.json deleted file mode 100644 index 6aebdb84..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/composer.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "automattic/jetpack-identity-crisis", - "description": "Identity Crisis.", - "type": "jetpack-library", - "license": "GPL-2.0-or-later", - "require": { - "php": ">=7.0", - "automattic/jetpack-connection": "^2.8.3", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-status": "^3.1.0", - "automattic/jetpack-logo": "^2.0.3", - "automattic/jetpack-assets": "^2.1.11" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "yoast/phpunit-polyfills": "1.1.0", - "automattic/wordbless": "@dev" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "scripts": { - "build-development": [ - "pnpm run build" - ], - "build-production": [ - "NODE_ENV='production' pnpm run build" - ], - "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", - "watch": [ - "Composer\\Config::disableProcessTimeout", - "pnpm run watch" - ] - }, - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "autotagger": true, - "mirror-repo": "Automattic/jetpack-identity-crisis", - "textdomain": "jetpack-idc", - "version-constants": { - "::PACKAGE_VERSION": "src/class-identity-crisis.php" - }, - "changelogger": { - "link-template": "https://github.com/Automattic/jetpack-identity-crisis/compare/v${old}...v${new}" - }, - "branch-alias": { - "dev-trunk": "0.20.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-identity-crisis/src/_inc/admin-bar.scss b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/admin-bar.scss deleted file mode 100644 index 262b0819..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/admin-bar.scss +++ /dev/null @@ -1,30 +0,0 @@ -#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-identity-crisis/src/_inc/admin.jsx b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/admin.jsx deleted file mode 100644 index bec5ead0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/admin.jsx +++ /dev/null @@ -1,60 +0,0 @@ -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 ( ! window.hasOwnProperty( '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, - } = 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-identity-crisis/src/_inc/style.scss b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/style.scss deleted file mode 100644 index 14f09db9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/style.scss +++ /dev/null @@ -1,9 +0,0 @@ -#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-identity-crisis/src/class-exception.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-exception.php deleted file mode 100644 index 5305208e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-exception.php +++ /dev/null @@ -1,13 +0,0 @@ -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-idc' ); - - $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 ) ) { - return false; - } - - 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'] - ) { - $is_valid = false; - // 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-idc' ), - $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-identity-crisis/src/class-rest-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php deleted file mode 100644 index ea2d05b8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php +++ /dev/null @@ -1,321 +0,0 @@ - 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-idc' ), - '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-idc' ), - '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-idc' ), - 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-idc' ), - 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-idc' ), - 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-idc' - ); - - 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-idc' ) ); - } - - 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-idc' ), - 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-idc' ), - array( 'status' => 403 ) - ) - : true; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php deleted file mode 100644 index 7fb75b73..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php +++ /dev/null @@ -1,201 +0,0 @@ - true, - 'textdomain' => 'jetpack-idc', - ) - ); - 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, - - /** - * 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-identity-crisis/src/class-url-secret.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-url-secret.php deleted file mode 100644 index 9e159840..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-url-secret.php +++ /dev/null @@ -1,159 +0,0 @@ -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' => 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-idc' ) ); - } - - $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 - */ - public static function create_secret( $flow = 'generating_secret_failed' ) { - $secret = null; - try { - - $secret = new self(); - $secret->create(); - - if ( $secret->exists() ) { - $secret = $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; - } -} 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 deleted file mode 100644 index 812a1281..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/CHANGELOG.md +++ /dev/null @@ -1,58 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index bb4decf0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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.0", - "automattic/jetpack-changelogger": "^4.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" - ] - }, - "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 deleted file mode 100644 index 53dd3323..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php +++ /dev/null @@ -1,209 +0,0 @@ -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 deleted file mode 100644 index 3717b321..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md +++ /dev/null @@ -1,878 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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-165b2f00927a762c8cf4.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-165b2f00927a762c8cf4.png deleted file mode 100644 index c2d50e1b..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-165b2f00927a762c8cf4.png and /dev/null 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 deleted file mode 100644 index 80931e68..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('jquery', 'wp-polyfill'), 'version' => '42733b29f872f13c5451'); 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 deleted file mode 100644 index 97507d07..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.css +++ /dev/null @@ -1 +0,0 @@ -.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;background-image:url(images/background-165b2f00927a762c8cf4.png);background-position:100%;background-repeat:no-repeat;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:0;margin-right:0}#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__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 deleted file mode 100644 index 3ada5cc7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var t,a={567:t=>{t.exports=window.jQuery}},e={};function n(t){var i=e[t];if(void 0!==i)return i.exports;var c=e[t]={exports:{}};return a[t](c,c.exports,n),c.exports}n.n=t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return n.d(a,{a:a}),a},n.d=(t,a)=>{for(var e in a)n.o(a,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:a[e]})},n.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a),t=n(567),n.n(t)()(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+='
          '+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 s=a.CTA.ajax_action,r=a.CTA.newWindow&&!s;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 s=!!t(".jetpack-logo__masthead").length;t.get(window.jitm_config.api_root+"jetpack/v4/jitm",{message_path:n,query:i,full_jp_logo_exists:s,_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,s=a[c](n);s.find(".jitm-banner__dismiss").on("click",(o=s,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=s,t("#jp-admin-notices").find(".jitm-card")&&t(".jitm-card").replaceWith(s),s.prependTo(t("#jp-admin-notices"))):e.replaceWith(s),s.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(){s.fadeOut("slow")}),2e3)}))})),s.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(){s.fadeOut("slow")})).fail((function(){n.attr("disabled",!1)})),!1})),s.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 deleted file mode 100644 index ce1294c9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.rtl.css +++ /dev/null @@ -1 +0,0 @@ -.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;background-image:url(images/background-165b2f00927a762c8cf4.png);background-position:0;background-repeat:no-repeat;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:0;margin-left:0}#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__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 deleted file mode 100644 index 5911bc7f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/composer.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "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.1", - "automattic/jetpack-assets": "^2.1.10", - "automattic/jetpack-connection": "^2.8.2", - "automattic/jetpack-device-detection": "^2.1.3", - "automattic/jetpack-logo": "^2.0.2", - "automattic/jetpack-redirect": "^2.0.2", - "automattic/jetpack-status": "^3.0.3" - }, - "require-dev": { - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.3" - }, - "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 deleted file mode 100644 index 56afbc31..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php +++ /dev/null @@ -1,347 +0,0 @@ -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 deleted file mode 100644 index 8ab43298..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php +++ /dev/null @@ -1,417 +0,0 @@ -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 deleted file mode 100644 index 6a779873..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php +++ /dev/null @@ -1,171 +0,0 @@ -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 deleted file mode 100644 index 8e0a127e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php +++ /dev/null @@ -1,98 +0,0 @@ - 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 deleted file mode 100644 index f36beefe..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/css/jetpack-admin-jitm.scss +++ /dev/null @@ -1,501 +0,0 @@ -// 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; - background-image: url( "../images/background.png" ); - background-repeat: no-repeat; - background-position: right center; - 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: 0; - } -} - -// 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__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 deleted file mode 100644 index c2d50e1b..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/images/background.png and /dev/null 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 deleted file mode 100644 index 5990ffa3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/CHANGELOG.md +++ /dev/null @@ -1,335 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index dd49a081..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/composer.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "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": "^2.7.2" - }, - "require-dev": { - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.2" - }, - "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 deleted file mode 100644 index 0972505a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php +++ /dev/null @@ -1,449 +0,0 @@ - \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 deleted file mode 100644 index 13982d71..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php +++ /dev/null @@ -1,359 +0,0 @@ -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 deleted file mode 100644 index f5925e49..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/CHANGELOG.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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-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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 6bd8c453..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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.0", - "automattic/jetpack-changelogger": "^4.2.4" - }, - "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 deleted file mode 100644 index 31b5b501..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php +++ /dev/null @@ -1,122 +0,0 @@ - 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 deleted file mode 100644 index f49e4844..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md +++ /dev/null @@ -1,1670 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 478fcfd9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/apple-92dacafad84e79708a74.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png deleted file mode 100644 index dd818e46..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png and /dev/null 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 deleted file mode 100644 index a033545d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/cloud-81ac85ba680343200f54.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-f27775ac15cf885713c2.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-f27775ac15cf885713c2.png deleted file mode 100644 index 66f8710a..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-f27775ac15cf885713c2.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-7e7684ae2c40327d8fed.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-7e7684ae2c40327d8fed.png deleted file mode 100644 index cfec3eed..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-7e7684ae2c40327d8fed.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg deleted file mode 100644 index 13f5651c..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-thanks-5873bfac56a9bd7322cd.jpg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-thanks-5873bfac56a9bd7322cd.jpg deleted file mode 100644 index a191ec9e..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-thanks-5873bfac56a9bd7322cd.jpg and /dev/null 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 deleted file mode 100644 index d648cc87..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/empty-avatar-fea23feddfa99b07c2e8.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png deleted file mode 100644 index d4d49627..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png and /dev/null differ 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 deleted file mode 100644 index 5794583d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/google-dec2a429bf1d8e83f9ad.svg +++ /dev/null @@ -1 +0,0 @@ - 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 deleted file mode 100644 index f8dbeb91..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-9de1caef5eb5c22da5d6.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-ai-1a265a198f75543e342e.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-ai-1a265a198f75543e342e.png deleted file mode 100644 index bff62ed5..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-ai-1a265a198f75543e342e.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png deleted file mode 100644 index ea421dc0..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png and /dev/null 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-cad524ede4e793cc0ece.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png deleted file mode 100644 index a2562d9b..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png and /dev/null 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 deleted file mode 100644 index 1cbd2e82..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-manage-3a7ecaa604823c98c3cf.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png deleted file mode 100644 index 0f77309b..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/site-cards-143fca7aec7a8c370e82.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/site-cards-143fca7aec7a8c370e82.png deleted file mode 100644 index ac5b9981..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/site-cards-143fca7aec7a8c370e82.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/social-e3fb80b2f32534fefe63.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/social-e3fb80b2f32534fefe63.png deleted file mode 100644 index ed91b93e..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/social-e3fb80b2f32534fefe63.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/stats-9802380852610a4d5908.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/stats-9802380852610a4d5908.png deleted file mode 100644 index 0c6ae45e..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/stats-9802380852610a4d5908.png and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9591093a9a238cc48a35.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9591093a9a238cc48a35.png deleted file mode 100644 index 9a8f1dfb..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9591093a9a238cc48a35.png and /dev/null 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 deleted file mode 100644 index b1cd75b6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/wordpress-1fc3e0ba6c52e9707900.svg +++ /dev/null @@ -1 +0,0 @@ - \ 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 deleted file mode 100644 index 9ca0484a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'cc72b3b90919a178b53e'); 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 deleted file mode 100644 index 0c4db15a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.css +++ /dev/null @@ -1 +0,0 @@ -#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}.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}.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}.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)}.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)}.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:calc(var(--spacing-base)*3);min-height:28px;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}.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}}@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}}.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}.sexr0jUxC1jVixdKiDnC{margin-left:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-left:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.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}.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}.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}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}.biqv3OiSCRunE35s4DC6{position:relative}.biqv3OiSCRunE35s4DC6>.T0VRsfCJrRslmORTYa8X{overflow:hidden;padding:0}.biqv3OiSCRunE35s4DC6>.T0VRsfCJrRslmORTYa8X: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}.biqv3OiSCRunE35s4DC6>.v77JdlkwyPAXfzeRW4DQ{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)}.biqv3OiSCRunE35s4DC6>.v77JdlkwyPAXfzeRW4DQ:focus,.biqv3OiSCRunE35s4DC6>.v77JdlkwyPAXfzeRW4DQ:hover{background-color:var(--jp-white)}.UQccyTHMg7XnAWr5VSGt{margin-top:24px}.SpY2tzcf1aTWPaBpAaQU{padding:0}._G5mdH1mZpQzrtTJKHAO{padding:24px 16px}@media screen and (min-width:600){._G5mdH1mZpQzrtTJKHAO{padding:32px 24px}}@media screen and (min-width:960px){._G5mdH1mZpQzrtTJKHAO{padding:48px 12px 48px 48px}}.g2nzjIQcPzgwZqW4523t{background-image:url(images/site-cards-143fca7aec7a8c370e82.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){.g2nzjIQcPzgwZqW4523t{background-image:url(images/site-cards-143fca7aec7a8c370e82.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}}.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%}.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%}.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}.wm7Alh6CwbsWkVSODgI2{margin-top:calc(var(--spacing-base)/2)}.qpN923qyxjI06NCgFC8j>li{margin-bottom: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__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>button{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>button: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}.components-popover{max-width:340px;min-height:150px;width:calc(100% - 63px)}@media(min-width:783px){.components-popover{width:100%}}.components-popover__content{padding:24px;width:100%}.components-popover__content 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)}@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%}.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)}.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)}@keyframes R2i0K45dEF157drbVRPI{0%{opacity:.6}50%{opacity:1}to{opacity:.6}}.NisihrgiIKl_knpYJtfg{animation:R2i0K45dEF157drbVRPI 1.5s infinite;background-color:var(--jp-gray);height:100%;width:100%}.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}.cAbGtJDGgLubucBnz7vM{background-color:var(--jp-white)}.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}.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}.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);border-radius:50%!important}.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);border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.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}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .MdTRfQ3eo5qZKChZlzNj{width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .PbEpL02SEH9VNAlbKCfV{width:30px}.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 .rq8YRaj9OyUUXJUHiUgI{border-color:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .YZ7FNKEm9qpvQ4ZkbAz5{transform:rotate(180deg)}.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)}.jp-connection__manage-dialog{--spacing-base:8px;border-radius:3px;margin:auto;width:1200px}.jp-connection__manage-dialog__content{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:center;padding:80px;text-align:center}.jp-connection__manage-dialog__content h1{font-size:var(--font-title-large);font-weight:700;line-height:1.2;margin:0}.jp-connection__manage-dialog__large-text{font-size:1.25rem;font-weight:600;margin-bottom:calc(var(--spacing-base)*4);margin-top:calc(var(--spacing-base)*3);max-width:60%}.jp-connection__manage-dialog__actions{align-items:center;background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;box-sizing:border-box;margin:0!important;max-width:1200px!important;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*5);position:sticky}.jp-connection__manage-dialog__link{color:var(--jp-black)}.jp-connection__manage-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__manage-dialog__link:focus{color:var(--jp-black)}.jp-connection__manage-dialog__button-wrap button{float:right}.jp-connection__manage-dialog__action-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:var(--spacing-base) auto;max-width:100%;padding:1rem 2rem;text-align:left;width:750px}.jp-connection__manage-dialog__action-card__card-headline{font-size:var(--font-body);font-weight:600;line-height:calc(var(--spacing-base)*3);text-decoration:none}.jp-connection__manage-dialog__action-card__icon{float:right}.jp-connection__manage-dialog__action-card .transfer{color:var(--jp-black);fill:var(--jp-black)}.jp-connection__manage-dialog__action-card .disconnect{color:var(--jp-red);fill:var(--jp-red)}.jp-connection__manage-dialog .components-modal__header{display:none}.jp-connection__manage-dialog .components-modal__content{margin:0;padding:0}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-small);font-weight:600;line-height:1.2;margin-top:0}.jp-connection__disconnect-dialog h2{font-size:var(--font-title-small);font-weight:400;line-height:1.2;margin:0}.jp-connection__disconnect-dialog p{font-size:var(--font-body);margin-top:0}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.25rem}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link,.jp-connection__disconnect-dialog__link{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:hover,.jp-connection__disconnect-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:focus,.jp-connection__disconnect-dialog__link:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link--bold,.jp-connection__disconnect-dialog__link--bold{font-weight:700}.jp-connection__disconnect-dialog .components-button{border-radius:4px;font-size:var(--font-body-small);height:40px}.jp-connection__disconnect-dialog .components-modal__content{display:flex;flex-direction:column;flex-grow:1;margin:0;padding:0}.jp-connection__disconnect-dialog .components-modal__content:before,.jp-connection__disconnect-dialog .components-modal__header{display:none}.jp-connection__disconnect-dialog .jp-row{align-items:center;width:calc(100% - 48px)}.jp-connection__disconnect-dialog__content{align-items:center;background:var(--jp-white-off);border-radius:4px;display:flex;flex-direction:column;flex-grow:1;justify-content:center;margin:0;padding:2rem 1rem;text-align:center}.jp-connection__disconnect-dialog__actions{background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;padding:2rem 0;position:sticky}.jp-connection__disconnect-dialog__actions p{margin-bottom:0}.jp-connection__disconnect-dialog__actions:before{background:linear-gradient(to bottom,transparent,var(--jp-white-off));bottom:calc(100% + 1px);content:"";display:block;height:80px;left:0;position:absolute;width:100%}.jp-connection__disconnect-dialog__btn-dismiss,.jp-connection__disconnect-dialog__btn-dismiss.components-button{background:var(--jp-black)!important;margin-right:10px}.jp-connection__disconnect-dialog__btn-disconnect{background:var(--jp-red)!important}.jp-connection__disconnect-dialog__btn-back-to-wp{background:var(--jp-black)!important}.jp-connection__disconnect-dialog__button-wrap{text-align:left}@media(min-width:960px){.jp-connection__disconnect-dialog__button-wrap{text-align:center}}.jp-connection__disconnect-dialog__error{color:var(--jp-red)}.jp-connection__disconnect-dialog__survey{margin-bottom:1.5rem;max-width:100%}.jp-connection__disconnect-dialog__step-copy{margin:0 auto;max-width:800px}.jp-connection__disconnect-dialog__step-copy--narrow{max-width:600px}@media(max-height:900px){.jp-connection__disconnect-dialog__content .jp-components__decorative-card{display:none}}@media(min-width:600px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{max-width:calc(100% - 32px);width:100%}.jp-connection__disconnect-dialog__actions,.jp-connection__disconnect-dialog__content{padding:2rem}}@media(min-width:960px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{display:flex;flex-direction:column;height:900px;width:1200px}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-large)}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.5rem}.jp-connection__disconnect-dialog__content{padding:80px}.jp-connection__disconnect-dialog__actions{padding:2rem 3rem}.jp-row{margin-left:0}}.jp-connection__disconnect-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:0 auto 1rem;max-width:100%;padding:1rem 2rem;text-align:left;width:800px}.jp-connection__disconnect-card__group{margin-bottom:1rem;max-width:100%}.jp-connection__disconnect-card__card-content{display:block;font-size:.875rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-content{align-items:center;display:flex;justify-content:space-between}}.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{flex-shrink:0;font-size:1.25rem;font-weight:600;margin-bottom:0;margin-top:0}@media only screen and (min-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{font-size:1.5rem;margin-right:1.5rem}}@media only screen and (max-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block,.jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block{margin-top:.5rem}}.jp-connection__disconnect-card__card-stat-block{align-items:baseline;display:flex;flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat-block{flex-direction:row-reverse}}.jp-connection__disconnect-card__card-description{flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-description{text-align:right}}.jp-connection__disconnect-card__card-stat{font-size:1rem;font-weight:600;margin-right:.5rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat{font-size:1.5rem;margin-left:1rem;margin-right:0}}.jp-components__decorative-card{border-radius:8px;box-shadow:0 0 15px var(--jp-gray);display:flex;height:280px;margin:0 auto 3rem;max-width:100%;overflow:hidden;position:relative;width:360px}.jp-components__decorative-card__content,.jp-components__decorative-card__image{width:50%}.jp-components__decorative-card__image{background:var(--jp-gray);background-size:cover;position:relative}.jp-components__decorative-card__image:before{background-image:url('data:image/svg+xml;uf8,');content:"";display:block;height:8px;left:24px;position:absolute;top:24px;width:38px}.jp-components__decorative-card__content{background:#fff;padding:2rem}.jp-components__decorative-card__icon-container{background:var(--jp-red);border-radius:50px;height:80px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:80px}.jp-components__decorative-card__icon{background-position:50%,50%;background-repeat:no-repeat;height:40px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:40px}.jp-components__decorative-card__icon--unlink{background-image:url('data:image/svg+xml;uf8, ')}.jp-components__decorative-card__lines,.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{background:#e9eff5;border-radius:6px;display:block;height:12px;position:relative;width:100%}.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{content:"";top:calc(100% + 16px)}.jp-components__decorative-card__lines:after{top:calc(100% + 32px);width:75%}.jp-components__decorative-card--vertical{flex-direction:column}.jp-components__decorative-card--vertical .jp-components__decorative-card__content,.jp-components__decorative-card--vertical .jp-components__decorative-card__image{height:50%;width:100%}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines{margin-left:auto;margin-right:auto;max-width:135px}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:after,.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:before{margin-left:auto;margin-right:auto}.jp-connect__disconnect-survey-card{border:2px solid transparent;border-radius:4px;box-shadow:0 0 15px var(--jp-gray-off);margin-left:auto;margin-right:auto;max-width:100%;padding:1rem;position:relative;text-align:left;width:800px}.jp-connect__disconnect-survey-card--selected{background:var(--jp-gray-off);border-color:var(--jp-black)}.jp-connect__disconnect-survey-card:after{border-right:2px solid var(--jp-black);border-top:2px solid var(--jp-black);content:"";display:block;height:5px;position:absolute;right:1.5rem;top:50%;transform:translateY(-50%) rotate(45deg);width:5px}.jp-connect__disconnect-survey-card:hover{cursor:pointer}.jp-connect__disconnect-survey-card:focus:not(.jp-disconnect-survey-card--selected),.jp-connect__disconnect-survey-card:hover:not(.jp-disconnect-survey-card--selected){border-color:var(--jp-black-80)}.jp-connect__disconnect-survey-card__answer{align-items:center;display:flex;font-weight:700;margin:0}input.jp-connect__disconnect-survey-card__input{-webkit-appearance:none;background-color:transparent;border:none;color:var(--jp-black-80);flex-grow:1;max-width:calc(100% - 40px);padding-right:40px}.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:16px;width:60%}._RT41NE3LU4R0ubcij2y{align-items:center;display:flex}._RT41NE3LU4R0ubcij2y li{background:none!important;margin:0!important;padding:0!important}.cFGWJeRiGHjAr8D7CWJW{margin-right:8px;max-width:110px}.Iz3l7a05TP6HK9S92TIL{width:16px}.lmQ0wFmnk4kKkGVjokPA{height:18px;margin-left:8px}.AoIs8wD92wKR8RpQj6Uc{align-items:center;display:inline-flex}.rV_5QyvhDnsVjCX4pb0h{--gray-90:#1e1e1e;fill:var(--gray-90);width:24px}.MO1jDNY8VPqeNS9xL8jE{align-items:center;display:flex;text-decoration:none}.jp-connection__connect-screen{--spacing-base:8px}.jp-connection__connect-screen__loading{display:none}.jp-connection__connect-screen .terms-of-service{margin-bottom:calc(var(--spacing-base)*3);margin-top:calc(var(--spacing-base)*4);max-width:360px}.jp-connection__connect-screen .terms-of-service a{text-decoration:underline}.jp-connection__connect-screen .jp-action-button{margin-top:40px}.jp-connection__connect-screen .jp-action-button--button{border-radius:4px;font-weight:600}.jp-connection__connect-screen .jp-action-button button{max-width:100%}.jp-connection__connect-screen .jp-action-button button:disabled{color:hsla(0,0%,100%,.4)}@media(max-width:782px){.jp-connection__connect-screen .jp-action-button button{max-width:none;width:100%}}.jp-connection__connect-screen__loading-message{position:absolute;clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}.jp-connection__connect-screen__loading-message:empty{display:none}.jp-connection__connect-screen__footer{margin-top:32px}.jp-connection__connect-screen-layout{background:var(--jp-white);border-radius:4px;box-shadow:0 0 40px rgba(0,0,0,.08)}.jp-connection__connect-screen-layout__loading{display:none}.jp-connection__connect-screen-layout__left,.jp-connection__connect-screen-layout__right{box-sizing:border-box}.jp-connection__connect-screen-layout__left{padding:calc(var(--spacing-base)*3)}@media(min-width:600px){.jp-connection__connect-screen-layout__left{padding:64px 96px}}.jp-connection__connect-screen-layout__left .jetpack-logo{margin-bottom:24px}.jp-connection__connect-screen-layout__left h2{color:var(--jp-black);font-size:36px;font-style:normal;font-weight:700;line-height:40px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left h3{color:var(--jp-black);font-size:24px;font-style:normal;font-weight:500;line-height:32px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left li,.jp-connection__connect-screen-layout__left p{font-size:16px;font-style:normal;font-weight:400;line-height:24px}.jp-connection__connect-screen-layout__left p{color:#101517;margin:16px 0}.jp-connection__connect-screen-layout__left a{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__connect-screen-layout__left a:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__connect-screen-layout__left a:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__connect-screen-layout__left ul{list-style-type:none;padding:0}.jp-connection__connect-screen-layout__left ul li{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEwFnwUInggGnggGnggHnAcAnwUFnQcAnwcGnwkFnQgGnQgFnwcGnQYFnQcFnAcGnQkDnwdhiL0pAAAAEnRSTlMAMF//f2Aw7yBQ3+9gcIBgcED+HDbkAAAAZklEQVR4Ae3LNwICARDDQC0+cv7/Y8mwV9odSfWIcf/+VegnGkIvDaGXKvTTn/Gz+Uf5xTL0K1XotS7fs5H6GHvvaO8d7c3j7rdgHne/A/PYt/cO+R42oYdN6OEQetiFHo4A//6dAXqtBEkmtWutAAAAAElFTkSuQmCC) no-repeat;background-size:24px;color:var(--jp-black);margin-bottom:9px;padding-left:30px}.jp-connection__connect-screen-layout__right{padding:64px 0}.jp-connection__connect-screen-layout__right img{max-width:100%}.jp-connection__connect-screen-layout__two-columns{display:flex;flex-wrap:wrap}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:100%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:52%}}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{background:#f9f9f6;display:none;flex-basis:47%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{display:block}}.rna{overflow:hidden}.rna .jp-connection__connect-screen-layout__left{position:relative;z-index:2}.rna .jp-connection__connect-screen-layout__left h2{font-weight:700;margin-top:0}.rna .jp-connection__connect-screen-layout__left h3{margin-top:24px}@media(min-width:600px){.rna .jp-connection__connect-screen-layout__left{padding:4rem 6rem 4rem 4rem}}@media(min-width:1080px){.rna .jp-connection__connect-screen-required-plan__pricing-card{position:absolute;right:calc(var(--spacing-base)*-45);top:calc(var(--spacing-base)*9.25)}}.rna .jp-connection__connect-screen-required-plan__pricing-card .jp-components__pricing-card{border-radius:var(--jp-border-radius-rna);max-width:100%;width:425px}.rna .jp-connection__connect-screen-required-plan__pricing-card .jp-components__pricing-card__title{margin-top:.625rem}@media(min-width:960px){.rna .jp-connection__connect-screen-required-plan__pricing-card .jp-components__pricing-card{padding:3rem}}.rna .jp-connection__connect-screen-required-plan__pricing-card .components-button{margin-bottom:0}.rna .jp-backup-dashboard-promotion ul.jp-product-promote li{margin-bottom:.75rem}.rna .jp-connection__connect-screen-layout__color-blobs{clip-path:polygon(100% 0,100% 100%,0 0,0 0);display:none;height:677px;position:absolute;right:0;top:0;width:363px;z-index:1}.rna .jp-connection__connect-screen-layout__color-blobs__blue,.rna .jp-connection__connect-screen-layout__color-blobs__green,.rna .jp-connection__connect-screen-layout__color-blobs__yellow{border-radius:50%;filter:blur(50px);position:absolute}.rna .jp-connection__connect-screen-layout__color-blobs__blue{background-color:var(--jp-blue-5);height:400px;right:-100px;top:-275px;width:400px;z-index:3}.rna .jp-connection__connect-screen-layout__color-blobs__yellow{background-color:var(--jp-yellow-5);height:250px;right:-25px;top:10px;width:250px;z-index:2}.rna .jp-connection__connect-screen-layout__color-blobs__green{background-color:var(--jp-green-5);height:300px;right:0;top:175px;width:300px;z-index:1}@media(min-width:1080px){.rna .jp-connection__connect-screen-layout__color-blobs{display:initial}}.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)}.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}.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)}.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}.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}.q0T8YyQxRawhpDtvJjxI{background-color:var(--jp-white);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)}.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)}.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:400;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}.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%}.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-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}.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}}: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-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}.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)}}.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}} \ 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 deleted file mode 100644 index 84062003..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! For license information please see index.js.LICENSE.txt */ -(()=>{var e={9487:(e,t,a)=>{"use strict";a.d(t,{X:()=>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}}},8899:(e,t,a)=>{"use strict";a.d(t,{LR:()=>r});var n=a(9487),c=a(2003);function r(e,t,a={}){const r=(0,n.X)(t);if(!r||isNaN(e))return null;const{decimal:s,grouping:i,precision:o,symbol:l}={...r,...a},u=e<0?"-":"",d=Math.abs(e),m=Math.floor(d);return{sign:u,symbol:l,integer:(0,c.Z)(d,o,s,i).split(s)[0],fraction:o>0?(0,c.Z)(d-m,o,s,i).slice(1):""}}},2003:(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})},3170:(e,t,a)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;td,RQ:()=>A,WK:()=>B,Zn:()=>z,Zq:()=>L,aU:()=>c,cP:()=>m,fp:()=>v,kG:()=>i,pC:()=>P,q_:()=>s}),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=""}=m(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:d(t))}),(function(e,t){o("/"===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 o(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function l(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?m(t):t,{state:a,key:t&&t.key||c||Math.random().toString(36).substr(2,8)})}function d(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 m(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:d(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,o=s.history,m=c.Pop,h=null;function g(){m=c.Pop,h&&h({action:m,location:v.location})}let v={get action(){return m},get location(){return e(s,o)},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:d(e));return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){m=c.Push;let n=u(v.location,e,t);a&&a(n,e);let r=l(n),d=v.createHref(n);try{o.pushState(r,"",d)}catch(e){s.location.assign(d)}i&&h&&h({action:m,location:v.location})},replace:function(e,t){m=c.Replace;let n=u(v.location,e,t);a&&a(n,e);let r=l(n),s=v.createHref(n);o.replaceState(r,"",s),i&&h&&h({action:m,location:v.location})},go:e=>o.go(e)};return v}var g;function v(e,t,a){void 0===a&&(a="/");let n=z(("string"==typeof t?m(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 o=A([n,s.relativePath]),l=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 "'+o+'".'),f(e.children,t,l,o)),(null!=e.path||e.index)&&t.push({path:o,score:N(o,e.index),routesMeta:l})};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 k=/^:\w+$/,E=3,y=2,b=1,_=10,j=-2,C=e=>"*"===e;function N(e,t){let a=e.split("/"),n=a.length;return a.some(C)&&(n+=j),t&&(n+=y),a.filter((e=>!C(e))).reduce(((e,t)=>e+(k.test(t)?E:""===t?b:_)),n)}function R(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 S(!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 x(e){try{return decodeURI(e)}catch(t){return S(!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 S(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function M(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 P(e,t,a,c){let r;void 0===c&&(c=!1),"string"==typeof e?r=m(e):(r=n({},e),i(!r.pathname||!r.pathname.includes("?"),M("?","pathname","search",r)),i(!r.pathname||!r.pathname.includes("#"),M("#","pathname","hash",r)),i(!r.search||!r.search.includes("#"),M("#","search","hash",r)));let s,o=""===e||""===r.pathname,l=o?"/":r.pathname;if(c||null==l)s=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("/")}s=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:a,search:n="",hash:c=""}="string"==typeof e?m(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:H(n),hash:O(c)}}(r,s),d=l&&"/"!==l&&l.endsWith("/"),p=(o||"."===l)&&a.endsWith("/");return u.pathname.endsWith("/")||!d&&!p||(u.pathname+="/"),u}const A=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",O=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;class I{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 B(e){return e instanceof I}const T=["post","put","patch","delete"],U=(new Set(T),["get",...T]);new Set(U),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement},1074:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(9307);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})}))},9404:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.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"}))},3259:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}))},986:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"}))},9201:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))},2229:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(c.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}))},6936:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}))},6163:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},9517:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}))},5316:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(c.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"}))},5381:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},1646:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},496:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(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"}))},4955:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.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"}))},1908:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"}))},6514:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(c.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"}))},797:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(444);const r=(0,n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,n.createElement)(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"}))},5235:(e,t)=>{var a;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e=[],t=0;t{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(1741)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},1741:(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.Z=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=o(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(9196)),s=(c=a(5844))&&c.__esModule?c:{default:c},i=["size","onClick","icon","className"];function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(o=function(e){return e?a:t})(e)}function l(){return l=Object.assign||function(e){for(var t,a=1;a{"use strict";a.d(t,{Z:()=>n});const n={error:"TcCZnGE6mad8Dvz9pCZi",button:"_mn6o2Dtm5pfFWc8_A1K"}},1494:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"admin-page":"sexr0jUxC1jVixdKiDnC",background:"vKQ11sLeAM45M04P1ccj"}},511:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={section:"cAbGtJDGgLubucBnz7vM"}},281:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"section-hero":"vMa4i_Dza2t5Zi_Bw9Nf"}},9171:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={container:"demNsMJjhi7BLY7xhjU5","icon-wrapper":"QiUjdjJSkqh6nH7YMG5A","is-error":"Q080AHcq29J2fc68Hhk5",icon:"hYWbIwhppukXmGnsiT9H","is-warning":"JjHuxWly0HI9C60gorbq","is-info":"Cm8ZFHi3mngl4cj9Gatx","is-success":"ytGBsU015p3LGwOPwFDx"}},6923:()=>{},3466:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},2404:()=>{},5785:()=>{},1275:()=>{},5612:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},9054:()=>{},3247:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)"}},3080:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},8730:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",container:"SqdhUZkXCRuIpErj1B3z",fluid:"OZC_9a1LhpWF9dv15Gdh"}},7946:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={placeholder:"NisihrgiIKl_knpYJtfg",pulse:"R2i0K45dEF157drbVRPI"}},7703:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},9929:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},9184:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},1683:()=>{},7920:()=>{},3280:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},3591:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={global:"_fUXxnSp5pagKBp9gSN7"}},2541:()=>{},1510:()=>{},9610:()=>{},4220:()=>{},287:()=>{},9823:()=>{},7664:()=>{},1008:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},5893:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={container:"OpMBda4vebhRbW8Fm6YC","is-link":"BghJAx9hSagUdHWOUaYE","has-error":"IWsEW5nnNWUqqcT3K5L1",title:"r3UCwgwCthua6lDCvIBI",name:"vpluqUMgmwx9_f8wCVIn"}},6234:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={icon:"rV_5QyvhDnsVjCX4pb0h",link:"MO1jDNY8VPqeNS9xL8jE"}},8578:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"relative-col":"zvd4dCB_bBDiXJKKDqXm","close-link":"ly4o9lSswAGHFXqGUEIO","account-description":"u64Go3kwEZ7MD9eji0H1","account-images":"_RT41NE3LU4R0ubcij2y",wordpress:"cFGWJeRiGHjAr8D7CWJW",google:"Iz3l7a05TP6HK9S92TIL",apple:"lmQ0wFmnk4kKkGVjokPA","all-features":"AoIs8wD92wKR8RpQj6Uc"}},6322:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={"connection-status-card":"kezuOHNvu9vdvlJ86Fwg",status:"qJizORs2q_CVCj9L6XLe","avatar-wrapper":"VmtuLc2xRqmsO6cK8qjF",cloud:"MdTRfQ3eo5qZKChZlzNj",jetpack:"PbEpL02SEH9VNAlbKCfV",avatar:"TD4AUM9gcTVAB6JHB5ZR",line:"yjl73qv0VWoPP8IhGreh",disconnected:"rq8YRaj9OyUUXJUHiUgI",info:"YZ7FNKEm9qpvQ4ZkbAz5","list-item":"oH9tzGE80LnB6Og69RFz","list-item-text":"xXVEWvQllVsFGmJY8WEp",error:"J0GIu2rNR7rXocQTyd8p"}},197:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={icon:"hdasSNj9k3Sc5PwXK4uE",link:"eWN8Hj0SBRDq1F48n_Fg"}},1854:()=>{},4416:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},73:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={modal:"HeJe1crc9XaWWpLvIPit",container:"or0JUScxkJPmNsfrxkEK"}},1017:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={heading:"jErCC9oKHSM15BxzFyQK",notice:"oVoYbwbFB6U2o90Njusk","bigger-than-medium":"Snc8NEmDelsbhlH4285s",cta:"R5tvcsARTGN0A_z3DygA",message:"wBVXH4OTNwLHPRpN4nsq",nofill:"F1qvEnFfHs5nz3zFZUOV"}},6891:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={container:"wiobThfXJCuhGNrbFIT6","expire-date":"VgAxgahF9bC2M__FiIgV","expire-date--with-icon":"dbRwkMLqcMF67njPoAF7","actions-list-item":"Doju0RxvvN9JS12mf489"}},9720:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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_",status:"f5VJYwuJmjxH8PVxEbbv",active:"ry3pxoGtmQ0ZeSwp7F_3",inactive:"LZzE3EG7m3CDR46wwwEr",warning:"TZUP7W6QYGajITiMNYas",error:"Vx_jpT02r8W6NfsRSB02","is-fetching":"PdsJCfyyjSgrNDheF2qi","blink-animation":"dWP7ypkVXudMbAa38W5Z"}},8840:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},1200:()=>{},523:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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","loading-placeholder":"wm7Alh6CwbsWkVSODgI2",cardlist:"qpN923qyxjI06NCgFC8j"}},8429:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},1514:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={container:"svE2cJL5t2FarzcDQYNe",imageContainer:"dvEJEDNTnmVfVxtLa4uU",aiImageContainer:"K1VY4DNP8PHMWAEVBC_h","product-interstitial__header":"nk_COGPrkBNLp7lVt4sQ","product-interstitial__license-activation-link":"ukgQ5TmLablG3svUKjdw",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"}},1287:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={container:"SWwV4Pw6OZ5vU3PqPXmr",imageContainer:"r7tUofa9Z3A5ziKVR1H7",aiImageContainer:"i_AnOR3MaQLraGvb2QU5","product-interstitial__header":"YcYvLvdvWrb1EUZoVsE8","product-interstitial__license-activation-link":"uGTTsKoIOoZdYhk6uPnl"}},2091:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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"}},9473:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n={banner:"biqv3OiSCRunE35s4DC6","banner-card":"T0VRsfCJrRslmORTYa8X",dismiss:"v77JdlkwyPAXfzeRW4DQ","banner-container":"UQccyTHMg7XnAWr5VSGt","banner-content":"SpY2tzcf1aTWPaBpAaQU","banner-description":"_G5mdH1mZpQzrtTJKHAO","banner-image":"g2nzjIQcPzgwZqW4523t"}},5878:()=>{},3171: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,o){o=o||{};var l=typeof e;if("string"===l&&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 o=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"weeks":case"week":case"w":return o*r;case"days":case"day":case"d":return o*c;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*a;case"seconds":case"second":case"secs":case"sec":case"s":return o*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===l&&isFinite(e))return o.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))}},7556:(e,t,a)=>{"use strict";var n=a(3713);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}},3059:(e,t,a)=>{e.exports=a(7556)()},3713:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},469:(e,t,a)=>{"use strict";var n=a(758);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}},5844:(e,t,a)=>{e.exports=a(469)()},758:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9997:(e,t,a)=>{"use strict";a.d(t,{UT:()=>u,lr:()=>h,rU:()=>d});var n=a(9196),c=a(6417),r=a(3170);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(c[a]=e[a]);return c}function o(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 l=["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.q_)({window:s,v5Compat:!0}));let o=i.current,[l,u]=n.useState({action:o.action,location:o.location});return n.useLayoutEffect((()=>o.listen(u)),[o]),n.createElement(c.F0,{basename:t,children:a,location:l.location,navigationType:l.action,navigator:o})}const d=n.forwardRef((function(e,t){let{onClick:a,relative:o,reloadDocument:u,replace:d,state:m,target:p,to:h,preventScrollReset:g}=e,v=i(e,l),f=(0,c.oQ)(h,{relative:o}),w=function(e,t){let{target:a,replace:s,state:i,preventScrollReset:o,relative:l}=void 0===t?{}:t,u=(0,c.s0)(),d=(0,c.TH)(),m=(0,c.WU)(e,{relative:l});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.Ep)(d)===(0,r.Ep)(m);u(e,{replace:a,state:i,preventScrollReset:o,relative:l})}}),[d,u,m,s,i,a,e,o,l])}(h,{replace:d,state:m,target:p,preventScrollReset:g,relative:o});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 m,p;function h(e){let t=n.useRef(o(e)),a=(0,c.TH)(),r=n.useMemo((()=>function(e,t){let a=o(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.s0)(),i=n.useCallback(((e,t)=>{const a=o("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"})(m||(m={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(p||(p={}))},6417:(e,t,a)=>{"use strict";a.d(t,{AW:()=>L,F0:()=>P,Fg:()=>M,TH:()=>y,WU:()=>_,Z5:()=>A,oQ:()=>k,s0:()=>b});var n=a(3170),c=a(9196);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{c.value=n,c.getSnapshot=t,d(c)&&r({inst:c})}),[e,n,t]),o((()=>{d(c)&&r({inst:c});return e((()=>{d(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 k(e,t){let{relative:a}=void 0===t?{}:t;E()||(0,n.kG)(!1);let{basename:r,navigator:s}=c.useContext(g),{hash:i,pathname:o,search:l}=_(e,{relative:a}),u=o;return"/"!==r&&(u="/"===o?r:(0,n.RQ)([r,o])),s.createHref({pathname:u,search:l,hash:i})}function E(){return null!=c.useContext(v)}function y(){return E()||(0,n.kG)(!1),c.useContext(v).location}function b(){E()||(0,n.kG)(!1);let{basename:e,navigator:t}=c.useContext(g),{matches:a}=c.useContext(f),{pathname:r}=y(),s=JSON.stringify((0,n.Zq)(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 o=(0,n.pC)(a,JSON.parse(s),r,"path"===c.relative);"/"!==e&&(o.pathname="/"===o.pathname?e:(0,n.RQ)([e,o.pathname])),(c.replace?t.replace:t.push)(o,c.state,c)}),[e,t,s,r])}function _(e,t){let{relative:a}=void 0===t?{}:t,{matches:r}=c.useContext(f),{pathname:s}=y(),i=JSON.stringify((0,n.Zq)(r).map((e=>e.pathnameBase)));return c.useMemo((()=>(0,n.pC)(e,JSON.parse(i),s,"path"===a)),[e,i,s,a])}function j(){let e=function(){var e;let t=c.useContext(w),a=z(x.UseRouteError),n=S(x.UseRouteError);if(t)return t;return null==(e=a.errors)?void 0:e[n]}(),t=(0,n.WK)(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 N(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 R(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.kG)(!1),r=r.slice(0,Math.min(r.length,e+1))}return r.reduceRight(((e,n,i)=>{let o=n.route.id?null==s?void 0:s[n.route.id]:null,l=a?n.route.errorElement||c.createElement(j,null):null,u=t.concat(r.slice(0,i+1)),d=()=>c.createElement(N,{match:n,routeContext:{outlet:e,matches:u}},o?l:void 0!==n.route.element?n.route.element:e);return a&&(n.route.errorElement||0===i)?c.createElement(C,{location:a.location,component:l,error:o,children:d(),routeContext:{outlet:null,matches:u}}):d()}),null)}var Z,x;function z(e){let t=c.useContext(h);return t||(0,n.kG)(!1),t}function S(e){let t=function(e){let t=c.useContext(f);return t||(0,n.kG)(!1),t}(),a=t.matches[t.matches.length-1];return a.route.id||(0,n.kG)(!1),a.route.id}!function(e){e.UseRevalidator="useRevalidator"}(Z||(Z={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(x||(x={}));function M(e){let{to:t,replace:a,state:r,relative:s}=e;E()||(0,n.kG)(!1);let i=c.useContext(h),o=b();return c.useEffect((()=>{i&&"idle"!==i.navigation.state||o(t,{replace:a,state:r,relative:s})})),null}function L(e){(0,n.kG)(!1)}function P(e){let{basename:t="/",children:a=null,location:r,navigationType:s=n.aU.Pop,navigator:i,static:o=!1}=e;E()&&(0,n.kG)(!1);let l=t.replace(/^\/*/,"/"),u=c.useMemo((()=>({basename:l,navigator:i,static:o})),[l,i,o]);"string"==typeof r&&(r=(0,n.cP)(r));let{pathname:d="/",search:m="",hash:p="",state:h=null,key:f="default"}=r,w=c.useMemo((()=>{let e=(0,n.Zn)(d,l);return null==e?null:{pathname:e,search:m,hash:p,state:h,key:f}}),[l,d,m,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 A(e){let{children:t,location:a}=e,s=c.useContext(p);return function(e,t){E()||(0,n.kG)(!1);let{navigator:a}=c.useContext(g),s=c.useContext(h),{matches:i}=c.useContext(f),o=i[i.length-1],l=o?o.params:{},u=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let d,m=y();if(t){var p;let e="string"==typeof t?(0,n.cP)(t):t;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||(0,n.kG)(!1),d=e}else d=m;let w=d.pathname||"/",k="/"===u?w:w.slice(u.length)||"/",b=(0,n.fp)(e,{pathname:k}),_=R(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:(0,n.RQ)([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:(0,n.RQ)([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,s||void 0);return t&&_?c.createElement(v.Provider,{value:{location:r({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:n.aU.Pop}},_):_}(s&&!t?s.router.routes:H(t),a)}var V;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(V||(V={}));new Promise((()=>{}));c.Component;function H(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,H(e.props.children,t));e.type!==L&&(0,n.kG)(!1),e.props.index&&e.props.children&&(0,n.kG)(!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=H(e.props.children,s)),a.push(i)})),a}},4561:(e,t,a)=>{"use strict";var n=a(9196),c=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,a){var n,r={},l=null,u=null;for(n in void 0!==a&&(l=""+a),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,n)&&!o.hasOwnProperty(n)&&(r[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===r[n]&&(r[n]=t[n]);return{$$typeof:c,type:e,key:l,ref:u,props:r,_owner:i.current}}t.jsx=l},275:(e,t,a)=>{"use strict";e.exports=a(4561)},6975:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(951);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"])}},o=i},4743:(e,t,a)=>{"use strict";a.d(t,{ZP:()=>d});var n=a(1132),c=a(6483);function r(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const s=r("JsonParseError"),i=r("JsonParseAfterRedirectError"),o=r("Api404Error"),l=r("Api404AfterRedirectError"),u=r("FetchNetworkError");const d=new function(e,t){let a=e,r=e,s={"X-WP-Nonce":t},i={credentials:"same-origin",headers:s},o={method:"post",credentials:"same-origin",headers:Object.assign({},s,{"Content-type":"application/json"})},l=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},o={method:"post",credentials:"same-origin",headers:Object.assign({},s,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=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`,o,{body:JSON.stringify(r)}).then(m).then(p)},fetchAuthorizationUrl:e=>d((0,c.addQueryArgs)(`${a}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),i).then(m).then(p),fetchSiteConnectionData:()=>d(`${a}jetpack/v4/connection/data`,i).then(p),fetchSiteConnectionStatus:()=>d(`${a}jetpack/v4/connection`,i).then(p),fetchSiteConnectionTest:()=>d(`${a}jetpack/v4/connection/test`,i).then(m).then(p),fetchUserConnectionData:()=>d(`${a}jetpack/v4/connection/data`,i).then(p),fetchUserTrackingSettings:()=>d(`${a}jetpack/v4/tracking/settings`,i).then(m).then(p),updateUserTrackingSettings:e=>h(`${a}jetpack/v4/tracking/settings`,o,{body:JSON.stringify(e)}).then(m).then(p),disconnectSite:()=>h(`${a}jetpack/v4/connection`,o,{body:JSON.stringify({isActive:!1})}).then(m).then(p),fetchConnectUrl:()=>d(`${a}jetpack/v4/connection/url`,i).then(m).then(p),unlinkUser:()=>h(`${a}jetpack/v4/connection/user`,o,{body:JSON.stringify({linked:!1})}).then(m).then(p),reconnect:()=>h(`${a}jetpack/v4/connection/reconnect`,o).then(m).then(p),fetchConnectedPlugins:()=>d(`${a}jetpack/v4/connection/plugins`,i).then(m).then(p),setHasSeenWCConnectionModal:()=>h(`${a}jetpack/v4/seen-wc-connection-modal`,o).then(m).then(p),fetchModules:()=>d(`${a}jetpack/v4/module/all`,i).then(m).then(p),fetchModule:e=>d(`${a}jetpack/v4/module/${e}`,i).then(m).then(p),activateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,o,{body:JSON.stringify({active:!0})}).then(m).then(p),deactivateModule:e=>h(`${a}jetpack/v4/module/${e}/active`,o,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${a}jetpack/v4/module/${e}`,o,{body:JSON.stringify(t)}).then(m).then(p),updateSettings:e=>h(`${a}jetpack/v4/settings`,o,{body:JSON.stringify(e)}).then(m).then(p),getProtectCount:()=>d(`${a}jetpack/v4/module/protect/data`,i).then(m).then(p),resetOptions:e=>h(`${a}jetpack/v4/options/${e}`,o,{body:JSON.stringify({reset:!0})}).then(m).then(p),activateVaultPress:()=>h(`${a}jetpack/v4/plugins`,o,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(m).then(p),getVaultPressData:()=>d(`${a}jetpack/v4/module/vaultpress/data`,i).then(m).then(p),installPlugin:(e,t)=>{const n={slug:e,status:"active"};return t&&(n.source=t),h(`${a}jetpack/v4/plugins`,o,{body:JSON.stringify(n)}).then(m).then(p)},activateAkismet:()=>h(`${a}jetpack/v4/plugins`,o,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(m).then(p),getAkismetData:()=>d(`${a}jetpack/v4/module/akismet/data`,i).then(m).then(p),checkAkismetKey:()=>d(`${a}jetpack/v4/module/akismet/key/check`,i).then(m).then(p),checkAkismetKeyTyped:e=>h(`${a}jetpack/v4/module/akismet/key/check`,o,{body:JSON.stringify({api_key:e})}).then(m).then(p),fetchStatsData:e=>d(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(m).then(p).then(v),getPluginUpdates:()=>d(`${a}jetpack/v4/updates/plugins`,i).then(m).then(p),getPlans:()=>d(`${a}jetpack/v4/plans`,i).then(m).then(p),fetchSettings:()=>d(`${a}jetpack/v4/settings`,i).then(m).then(p),updateSetting:e=>h(`${a}jetpack/v4/settings`,o,{body:JSON.stringify(e)}).then(m).then(p),fetchSiteData:()=>d(`${a}jetpack/v4/site`,i).then(m).then(p).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>d(`${a}jetpack/v4/site/features`,i).then(m).then(p).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>d(`${a}jetpack/v4/site/products`,i).then(m).then(p),fetchSitePurchases:()=>d(`${a}jetpack/v4/site/purchases`,i).then(m).then(p).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>d(`${a}jetpack/v4/site/benefits`,i).then(m).then(p).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>d(`${a}jetpack/v4/site/discount`,i).then(m).then(p).then((e=>e.data)),fetchSetupQuestionnaire:()=>d(`${a}jetpack/v4/setup/questionnaire`,i).then(m).then(p),fetchRecommendationsData:()=>d(`${a}jetpack/v4/recommendations/data`,i).then(m).then(p),fetchRecommendationsProductSuggestions:()=>d(`${a}jetpack/v4/recommendations/product-suggestions`,i).then(m).then(p),fetchRecommendationsUpsell:()=>d(`${a}jetpack/v4/recommendations/upsell`,i).then(m).then(p),fetchRecommendationsConditional:()=>d(`${a}jetpack/v4/recommendations/conditional`,i).then(m).then(p),saveRecommendationsData:e=>h(`${a}jetpack/v4/recommendations/data`,o,{body:JSON.stringify({data:e})}).then(m),fetchProducts:()=>d(`${a}jetpack/v4/products`,i).then(m).then(p),fetchRewindStatus:()=>d(`${a}jetpack/v4/rewind`,i).then(m).then(p).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>d(`${a}jetpack/v4/scan`,i).then(m).then(p).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${a}jetpack/v4/notice/${e}`,o,{body:JSON.stringify({dismissed:!0})}).then(m).then(p),fetchPluginsData:()=>d(`${a}jetpack/v4/plugins`,i).then(m).then(p),fetchIntroOffers:()=>d(`${a}jetpack/v4/intro-offers`,i).then(m).then(p),fetchVerifySiteGoogleStatus:e=>d(null!==e?`${a}jetpack/v4/verify-site/google/${e}`:`${a}jetpack/v4/verify-site/google`,i).then(m).then(p),verifySiteGoogle:e=>h(`${a}jetpack/v4/verify-site/google`,o,{body:JSON.stringify({keyring_id:e})}).then(m).then(p),submitSurvey:e=>h(`${a}jetpack/v4/marketing/survey`,o,{body:JSON.stringify(e)}).then(m).then(p),saveSetupQuestionnaire:e=>h(`${a}jetpack/v4/setup/questionnaire`,o,{body:JSON.stringify(e)}).then(m).then(p),updateLicensingError:e=>h(`${a}jetpack/v4/licensing/error`,o,{body:JSON.stringify(e)}).then(m).then(p),updateLicenseKey:e=>h(`${a}jetpack/v4/licensing/set-license`,o,{body:JSON.stringify({license:e})}).then(m).then(p),getUserLicensesCounts:()=>d(`${a}jetpack/v4/licensing/user/counts`,i).then(m).then(p),getUserLicenses:()=>d(`${a}jetpack/v4/licensing/user/licenses`,i).then(m).then(p),updateLicensingActivationNoticeDismiss:e=>h(`${a}jetpack/v4/licensing/user/activation-notice-dismiss`,o,{body:JSON.stringify({last_detached_count:e})}).then(m).then(p),updateRecommendationsStep:e=>h(`${a}jetpack/v4/recommendations/step`,o,{body:JSON.stringify({step:e})}).then(m),confirmIDCSafeMode:()=>h(`${a}jetpack/v4/identity-crisis/confirm-safe-mode`,o).then(m),startIDCFresh:e=>h(`${a}jetpack/v4/identity-crisis/start-fresh`,o,{body:JSON.stringify({redirect_uri:e})}).then(m).then(p),migrateIDC:()=>h(`${a}jetpack/v4/identity-crisis/migrate`,o).then(m),attachLicenses:e=>h(`${a}jetpack/v4/licensing/attach-licenses`,o,{body:JSON.stringify({licenses:e})}).then(m).then(p),fetchSearchPlanInfo:()=>d(`${r}jetpack/v4/search/plan`,i).then(m).then(p),fetchSearchSettings:()=>d(`${r}jetpack/v4/search/settings`,i).then(m).then(p),updateSearchSettings:e=>h(`${r}jetpack/v4/search/settings`,o,{body:JSON.stringify(e)}).then(m).then(p),fetchSearchStats:()=>d(`${r}jetpack/v4/search/stats`,i).then(m).then(p),fetchWafSettings:()=>d(`${a}jetpack/v4/waf`,i).then(m).then(p),updateWafSettings:e=>h(`${a}jetpack/v4/waf`,o,{body:JSON.stringify(e)}).then(m).then(p),fetchWordAdsSettings:()=>d(`${a}jetpack/v4/wordads/settings`,i).then(m).then(p),updateWordAdsSettings:e=>h(`${a}jetpack/v4/wordads/settings`,o,{body:JSON.stringify(e)}),fetchSearchPricing:()=>d(`${r}jetpack/v4/search/pricing`,i).then(m).then(p),fetchMigrationStatus:()=>d(`${a}jetpack/v4/migration/status`,i).then(m).then(p),fetchBackupUndoEvent:()=>d(`${a}jetpack/v4/site/backup/undo-event`,i).then(m).then(p),fetchBackupPreflightStatus:()=>d(`${a}jetpack/v4/site/backup/preflight`,i).then(m).then(p)};function d(e,t){return fetch(l(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 m(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new o})):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}},2264:(e,t,a)=>{"use strict";a.d(t,{M:()=>s});var n=a(5736),c=a(5146),r=a(6873);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.b)(this.body)?JSON.stringify(this.body,null," "):(0,c.x)(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")}}},8426:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(2264),r=a(259);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 o=function(e,t){return t+r.N+r.L+e}(a,t);let l;try{l=await fetch(o,i)}catch(e){const t=i;delete t.body,delete t.headers["X-WP-Nonce"];const a={requestInitiator:window.location.href,requestUrl:o,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 l}async function i(e,t,a,n=null,r){const i=await s(e,t,a,n,r);let o,l;try{o=await i.text()}catch(e){throw new c.M(i.status,null,e)}try{l=JSON.parse(o)}catch(e){throw new c.M(i.status,o,e)}if(!i.ok)throw new c.M(i.status,l,null);return l}const o={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)}}},259:(e,t,a)=>{"use strict";a.d(t,{L:()=>c,N:()=>n});const n="jetpack-boost/v1",c=""},128:(e,t,a)=>{"use strict";a.d(t,{Fr:()=>g,tZ:()=>m,yn:()=>h});var n=a(5736),c=a(8426),r=a(1061),s=a(5146),i=a(6873),o=a(2653),l=a(2893);const __=n.__,u=12e4,d=5e3;async function m(e=!1,t,a,n){const r=p(await c.Z.post(t,e?"/speed-scores/refresh":"/speed-scores",{url:a},n));return r.scores?r.scores:await async function(e,t,a){return(0,o.Z)({timeout:u,interval:d,timeoutError:__("Timed out while waiting for speed-score.","jetpack-my-jetpack"),callback:async n=>{const r=p(await c.Z.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,l.V)(e.error,t)}if((0,i.b)(e.scores))return{status:"success",scores:{current:(0,i.b)(e.scores.current)?{mobile:(0,r.W)(e.scores.current.mobile,0),desktop:(0,r.W)(e.scores.current.desktop,0)}:{mobile:0,desktop:0},noBoost:(0,i.b)(e.scores.noBoost)?{mobile:(0,r.W)(e.scores.noBoost.mobile,0),desktop:(0,r.W)(e.scores.noBoost.desktop,0)}:null,isStale:!!e.scores.isStale}};const t=(0,s.x)(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)}},1061:(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,{W:()=>n})},5146:(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,{x:()=>n})},6873:(e,t,a)=>{"use strict";function n(e){return!!e&&e instanceof Object&&!(e instanceof Array)}a.d(t,{b:()=>n})},2653:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(5736);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)}))}},2893:(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,{V:()=>n})},7121:(e,t,a)=>{"use strict";a.d(t,{Z:()=>h});var n=a(5609),c=a(5736),r=a(5235),s=a.n(r),i=a(5844),o=a.n(i),l=a(9196),u=a.n(l),d=a(526),m=a(2289);const __=c.__,p=e=>{const{label:t,onClick:a,isLoading:c=!1,loadingText:r,isDisabled:i,displayError:o=!1,errorMessage:l=__("An error occurred. Please try again.","jetpack-my-jetpack"),customClass:p}=e,h=r||u().createElement(n.Spinner,null);return u().createElement(u().Fragment,null,u().createElement(d.Z,{className:s()(m.Z.button,"jp-action-button--button",p),label:t,onClick:a,variant:"primary",disabled:c||i},c?h:t),o&&u().createElement("p",{className:s()(m.Z.error,"jp-action-button__error")},l))};p.propTypes={label:o().string.isRequired,onClick:o().func,isLoading:o().bool,isDisabled:o().bool,displayError:o().bool,errorMessage:o().oneOfType([o().string,o().element])};const h=p},9105:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5736),c=a(5235),r=a.n(c),s=a(8237),i=a(8868),o=a(3846),l=a(3363),u=a(1494);const __=n.__,d=({children:e,moduleName:t=__("Jetpack","jetpack-my-jetpack"),moduleNameHref:a,showHeader:n=!0,showFooter:c=!0,showBackground:d=!0,header:m})=>{const p=r()(u.Z["admin-page"],{[u.Z.background]:d});return React.createElement("div",{className:p},n&&React.createElement(l.Z,{horizontalSpacing:5},React.createElement(o.Z,null,m||React.createElement(i.Z,null))),React.createElement(l.Z,{fluid:!0,horizontalSpacing:0},React.createElement(o.Z,null,e)),c&&React.createElement(l.Z,{horizontalSpacing:5},React.createElement(o.Z,null,React.createElement(s.Z,{moduleName:t,moduleNameHref:a}))))}},6579:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9196),c=a.n(n),r=a(511);const s=({children:e})=>c().createElement("div",{className:r.Z.section},e)},216:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9196),c=a.n(n),r=a(281);const s=({children:e})=>c().createElement("div",{className:r.Z["section-hero"]},e)},4972:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(797),c=a(496),r=a(9201),s=a(1074),i=a(5235),o=a.n(i),l=a(9196),u=a.n(l),d=a(9171);const m=e=>{switch(e){case"error":case"warning":default:return n.Z;case"info":return c.Z;case"success":return r.Z}},p=({level:e="warning",children:t,showIcon:a=!0})=>{const n=o()(d.Z.container,d.Z[`is-${e}`]);return u().createElement("div",{className:n},a&&u().createElement("div",{className:d.Z["icon-wrapper"]},u().createElement(s.Z,{icon:m(e),className:d.Z.icon})),u().createElement("div",null,t))}},7525:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(2674),c=a.n(n),r=a(5736),s=a(5235),i=a.n(s),o=a(9196),l=a.n(o);const __=r.__,u=({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:i()("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"}))},4186:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5736),c=a(5235),r=a.n(c),s=a(7172);a(6923);const __=n.__,i=({score:e,isLoading:t,showPrevScores:a,active:n,prevScore:c=0,scoreBarType:i,noBoostScoreTooltip:o})=>{if(!n)return null;const l=c/e*100,u=__("Desktop score","jetpack-my-jetpack"),d=__("Mobile score","jetpack-my-jetpack");return React.createElement("div",{className:r()("jb-score-bar",`jb-score-bar--${i}`)},React.createElement("div",{className:"jb-score-bar__label"},"desktop"===i?React.createElement(s.Z,{icon:"computer",size:24}):React.createElement(s.Z,{icon:"phone",size:24}),React.createElement("div",null,"desktop"===i?u:d)),React.createElement("div",{className:"jb-score-bar__bounds"},React.createElement("div",{className:r()("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&&!!c&&c{"use strict";a.d(t,{Z:()=>g});var n=a(2674),c=a.n(n),r=a(5609),s=a(5736),i=a(1074),o=a(5381),l=a(5235),u=a.n(l),d=a(9196),m=a.n(d),p=a(3466);const __=s.__,h=(0,d.forwardRef)(((e,t)=>{const{children:a,variant:n="primary",size:s="normal",weight:l="bold",icon:d,iconSize:h,disabled:g,isDestructive:v,isLoading:f,isExternalLink:w,className:k,text:E,fullWidth:y,...b}=e,_=u()(p.Z.button,k,{[p.Z.normal]:"normal"===s,[p.Z.small]:"small"===s,[p.Z.icon]:Boolean(d),[p.Z.loading]:f,[p.Z.regular]:"regular"===l,[p.Z["full-width"]]:y,[p.Z["is-icon-button"]]:Boolean(d)&&!a});b.ref=t;const j="normal"===s?20:16,C=w&&m().createElement(m().Fragment,null,m().createElement(i.Z,{size:j,icon:o.Z,className:p.Z["external-icon"]}),m().createElement(r.VisuallyHidden,{as:"span"},/* translators: accessibility text */ -__("(opens in a new tab)","jetpack-my-jetpack"))),N=w?"_blank":void 0,R=a?.[0]&&null!==a[0]&&"components-tooltip"!==a?.[0]?.props?.className;return m().createElement(r.Button,c()({target:N,variant:n,className:u()(_,{"has-text":!!d&&R}),icon:w?void 0:d,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:v,text:E},b),f&&m().createElement(r.Spinner,null),m().createElement("span",null,a),C)}));h.displayName="Button";const g=h},9026:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});a(2404);const n=({format:e="horizontal",icon:t,imageUrl:a})=>React.createElement("div",{className:"jp-components__decorative-card "+(e?"jp-components__decorative-card--"+e:"")},React.createElement("div",{className:"jp-components__decorative-card__image",style:{backgroundImage:a?`url( ${a} )`:""}}),React.createElement("div",{className:"jp-components__decorative-card__content"},React.createElement("div",{className:"jp-components__decorative-card__lines"})),t?React.createElement("div",{className:"jp-components__decorative-card__icon-container"},React.createElement("span",{className:"jp-components__decorative-card__icon jp-components__decorative-card__icon--"+t})):null)},7172:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(5235),r=a.n(c),s=a(9196);a(5785);const __=n.__;class i extends s.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,c=this.props.style||{height:a,width:n},s="gridicons-"+this.props.icon,i=r()("gridicon",s,t,{"needs-offset":this.needsOffset(s,e)}),o=this.getSVGDescription(s);return React.createElement("svg",{className:i,focusable:this.props.focusable,height:a,onClick:this.props.onClick,style:c,viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg","aria-hidden":this.props["aria-hidden"]},o?React.createElement("desc",null,o):null,this.renderIcon(s))}}const o=i},9665:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5609),c=a(5235),r=a.n(c),s=a(9196),i=a.n(s),o=a(526),l=a(7172);a(1275);const u=e=>({"top-end":"top left",top:"top center","top-start":"top right","bottom-end":"bottom left",bottom:"bottom center","bottom-start":"bottom right"}[e]),d=({className:e="",iconClassName:t="",placement:a="bottom-end",animate:c=!0,iconCode:d="info-outline",iconSize:m=18,offset:p=10,title:h,children:g,popoverAnchorStyle:v="icon",forceShow:f=!1,wide:w=!1,inline:k=!0,shift:E=!1})=>{const[y,b]=(0,s.useState)(!1),_=(0,s.useCallback)((()=>b(!1)),[b]),j=(0,s.useCallback)((e=>{e.preventDefault(),b(!y)}),[y,b]),C={position:u(a),placement:a,animate:c,noArrow:!1,resize:!1,flip:!1,offset:p,focusOnMount:"container",onClose:_,className:"icon-tooltip-container",inline:k,shift:E},N="wrapper"===v,R=r()("icon-tooltip-wrapper",e),Z={left:N?0:-(62-m/2)+"px"},x=N&&f;return i().createElement("div",{className:R,"data-testid":"icon-tooltip_wrapper"},!N&&i().createElement(o.Z,{variant:"link",onMouseDown:j},i().createElement(l.Z,{className:t,icon:d,size:m})),i().createElement("div",{className:r()("icon-tooltip-helper",{"is-wide":w}),style:Z},(x||y)&&i().createElement(n.Popover,C,i().createElement("div",null,h&&i().createElement("div",{className:"icon-tooltip-title"},h),i().createElement("div",{className:"icon-tooltip-content"},g)))))}},3396:(e,t,a)=>{"use strict";a.d(t,{KM:()=>d,VS:()=>g,_1:()=>m,pJ:()=>p,r7:()=>u});var n=a(2674),c=a.n(n),r=a(5609),s=a(5235),i=a.n(s),o=(a(4311),a(5612));const l=({className:e,size:t=24,viewBox:a="0 0 24 24",opacity:n=1,color:s="#2C3338",children:l})=>{const u={className:i()(o.Z.iconWrapper,e),width:t,height:t,viewBox:a,opacity:n,fill:void 0};return s&&(u.fill=s),React.createElement(r.SVG,c()({},u,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg"}),React.createElement(r.G,{opacity:n},l))},u=({size:e,className:t=o.Z["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"})),d=({size:e,className:t=o.Z["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=o.Z.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"})),p=({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"})),h={...{"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:u,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:p}};function g(e){return h[e]?h[e]:null}},8237:(e,t,a)=>{"use strict";a.d(t,{Z:()=>y});var n=a(2674),c=a.n(n),r=a(9818),s=a(5736),i=a(1074),o=a(5381),l=a(5235),u=a.n(l),d=a(9196),m=a.n(d),p=a(6895),h=a(428),g=a(2497),v=a(7525),f=(a(9054),a(8868)),w=a(2054);const __=s.__,_x=s._x,k=()=>m().createElement(f.Z,{logoColor:"#000",showText:!1,height:16,"aria-hidden":"true"}),E=()=>m().createElement(m().Fragment,null,m().createElement(i.Z,{icon:o.Z,size:16}),m().createElement("span",{className:"jp-dashboard-footer__accessible-external-link"},/* translators: accessibility text */ -__("(opens in a new tab)","jetpack-my-jetpack"))),y=({moduleName:e=__("Jetpack","jetpack-my-jetpack"),className:t,moduleNameHref:a="https://jetpack.com",menu:n,onAboutClick:s,onPrivacyClick:i,onTermsClick:o,...l})=>{const[d]=(0,w.Z)("sm","<="),[f]=(0,w.Z)("md","<="),[y]=(0,w.Z)("lg",">"),{isActive:b,connectedPlugins:_}=(0,r.useSelect)((e=>{const t=e(h.t);return{connectedPlugins:t?.getConnectedPlugins(),...t.getConnectionStatus()}}),[h.t]),j=(0,g.Z)(),C=j&&b&&_?.some((({slug:e})=>"jetpack"===e));let N=[{label:_x("About","Link to learn more about Jetpack.","jetpack-my-jetpack"),title:__("About Jetpack","jetpack-my-jetpack"),href:C?new URL("admin.php?page=jetpack_about",j).href:(0,p.Z)("jetpack-about"),target:C?"_self":"_blank",onClick:s},{label:_x("Privacy","Shorthand for Privacy Policy.","jetpack-my-jetpack"),title:__("Automattic's Privacy Policy","jetpack-my-jetpack"),href:C?new URL("admin.php?page=jetpack#/privacy",j).href:(0,p.Z)("a8c-privacy"),target:C?"_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,p.Z)("wpcom-tos"),target:"_blank",onClick:o}];n&&(N=[...N,...n]);const R=m().createElement(m().Fragment,null,m().createElement(k,null),e);return m().createElement("footer",c()({className:u()("jp-dashboard-footer",{"is-sm":d,"is-md":f,"is-lg":y},t),"aria-label":__("Jetpack","jetpack-my-jetpack")},l),m().createElement("ul",null,m().createElement("li",{className:"jp-dashboard-footer__jp-item"},a?m().createElement("a",{href:a},R):R),N.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:u()("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:C?new URL("admin.php?page=jetpack_about",j).href:(0,p.Z)("a8c-about"),"aria-label":__("An Automattic Airline","jetpack-my-jetpack")},m().createElement(v.Z,{"aria-hidden":"true"})))))}},8868:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(2674),c=a.n(n),r=a(5736),s=a(5235),i=a.n(s),o=a(9196),l=a.n(o);const __=r.__,u=({logoColor:e="#069e08",showText:t=!0,className:a,height:n=32,...r})=>{const s=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:s,className:i()("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"})))}},3846:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(5235),c=a.n(n),r=a(9196),s=a(3080);const i=Number(s.Z.smCols),o=Number(s.Z.mdCols),l=Number(s.Z.lgCols),u=e=>{const{children:t,tagName:a="div",className:n}=e,u=Math.min(i,"number"==typeof e.sm?e.sm:i),d=Math.min(i,"object"==typeof e.sm?e.sm.start:0),m=Math.min(i,"object"==typeof e.sm?e.sm.end:0),p=Math.min(o,"number"==typeof e.md?e.md:o),h=Math.min(o,"object"==typeof e.md?e.md.start:0),g=Math.min(o,"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),k=c()(n,{[s.Z[`col-sm-${u}`]]:!(d&&m),[s.Z[`col-sm-${d}-start`]]:d>0,[s.Z[`col-sm-${m}-end`]]:m>0,[s.Z[`col-md-${p}`]]:!(h&&g),[s.Z[`col-md-${h}-start`]]:h>0,[s.Z[`col-md-${g}-end`]]:g>0,[s.Z[`col-lg-${v}`]]:!(f&&w),[s.Z[`col-lg-${f}-start`]]:f>0,[s.Z[`col-lg-${w}-end`]]:w>0});return(0,r.createElement)(a,{className:k},t)}},3363:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5235),c=a.n(n),r=a(9196),s=a(8730);const i=({children:e,fluid:t=!1,tagName:a="div",className:n,horizontalGap:i=1,horizontalSpacing:o=1})=>{const l=(0,r.useMemo)((()=>{const e=`calc( var(--horizontal-spacing) * ${o} )`;return{paddingTop:e,paddingBottom:e,rowGap:`calc( var(--horizontal-spacing) * ${i} )`}}),[i,o]),u=c()(n,s.Z.container,{[s.Z.fluid]:t});return(0,r.createElement)(a,{className:u,style:l},e)}},2054:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(4333),c=a(3247);const r=["sm","md","lg"],s=(e,t)=>{const a=Array.isArray(e)?e:[e],s=Array.isArray(t)?t:[t],[i,o,l]=r,u={sm:(0,n.useMediaQuery)(c.Z[i]),md:(0,n.useMediaQuery)(c.Z[o]),lg:(0,n.useMediaQuery)(c.Z[l])};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]}))}},2636:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5235),c=a.n(n),r=a(9196),s=a.n(r),i=a(7946);const o=({children:e=null,width:t=null,height:a=null,className:n=""})=>s().createElement("div",{className:c()(i.Z.placeholder,n),style:{width:t,height:a}},e)},1342:(e,t,a)=>{"use strict";a.d(t,{Z:()=>h});var n=a(797),c=a(496),r=a(9201),s=a(1074),i=a(9517),o=a(5235),l=a.n(o),u=a(9196),d=a.n(u),m=a(7703);const p=e=>{switch(e){case"error":case"warning":default:return n.Z;case"info":return c.Z;case"success":return r.Z}},h=({level:e="info",title:t,children:a,actions:n,hideCloseButton:c=!1,onClose:r})=>{const o=l()(m.Z.container,m.Z[`is-${e}`]);return d().createElement("div",{className:o},d().createElement("div",{className:m.Z["icon-wrapper"]},d().createElement(s.Z,{icon:p(e),className:m.Z.icon})),d().createElement("div",{className:m.Z["main-content"]},t&&d().createElement("div",{className:m.Z.title},t),a,n&&n.length>0&&d().createElement("div",{className:m.Z["action-bar"]},n.map(((e,t)=>d().createElement("div",{key:t,className:m.Z.action},e))))),!c&&d().createElement("button",{"aria-label":"close",className:m.Z["close-button"],onClick:r},d().createElement(s.Z,{icon:i.Z})))}},2947:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(8709);const c=(e,t={})=>{const a=(0,n.X)();return new Intl.NumberFormat(a,t).format(e)}},9608:(e,t,a)=>{"use strict";a.d(t,{NE:()=>y,ZP:()=>_,kF:()=>E,oK:()=>b});var n=a(5736),c=a(1074),r=a(9201),s=a(6163),i=a(5235),o=a.n(i),l=a(9196),u=a.n(l),d=a(9665),m=a(2054),p=a(7325),h=a(5106),g=a(9929);const __=n.__,v=__("Included","jetpack-my-jetpack"),f=__("Not included","jetpack-my-jetpack"),w=__("Coming soon","jetpack-my-jetpack"),k=(0,l.createContext)(void 0),E=({isIncluded:e=!1,isComingSoon:t=!1,index:a=0,label:i=null,tooltipInfo:p,tooltipTitle:E,tooltipClassName:y=""})=>{const[b]=(0,m.Z)("lg"),_=(0,l.useContext)(k)[a],j=t||e,C=_.name,N=_.tooltipInfo,R=_.tooltipTitle,Z=p||!b&&N,x=((e,t,a)=>e?{lg:w, -// translators: Name of the current feature -default:(0,n.sprintf)(__("%s coming soon","jetpack-my-jetpack"),a)}:{lg:t?v:f,default:t?a:(0,n.sprintf)(/* translators: Name of the current feature */ -__("%s not included","jetpack-my-jetpack"),a)})(t,e,C),z=b?x.lg:x.default;return u().createElement("div",{className:o()(g.Z.item,g.Z.value)},u().createElement(c.Z,{className:o()(g.Z.icon,j?g.Z["icon-check"]:g.Z["icon-cross"]),size:32,icon:j?r.Z:s.Z}),u().createElement(h.ZP,{variant:"body-small"},i||z),Z&&u().createElement(d.Z,{title:E||R,iconClassName:g.Z["popover-icon"],className:o()(g.Z.popover,y),placement:"bottom-end",iconSize:14,offset:4,wide:Boolean(E&&p)},u().createElement(h.ZP,{variant:"body-small",component:"div"},p||N)))},y=({children:e})=>u().createElement("div",{className:g.Z.header},e),b=({primary:e=!1,children:t})=>{let a=0;return u().createElement("div",{className:o()(g.Z.card,{[g.Z["is-primary"]]:e})},l.Children.map(t,(e=>{const t=e;return t.type===E?(a++,(0,l.cloneElement)(t,{index:a-1})):t})))},_=({title:e,items:t,children:a,showIntroOfferDisclaimer:n=!1})=>{const[c]=(0,m.Z)("lg");return u().createElement(k.Provider,{value:t},u().createElement("div",{className:o()(g.Z.container,{[g.Z["is-viewport-large"]]:c}),style:{"--rows":t.length+1,"--columns":l.Children.toArray(a).length+1}},u().createElement("div",{className:g.Z.table},u().createElement(h.ZP,{variant:"headline-small"},e),c&&t.map(((e,a)=>u().createElement("div",{className:o()(g.Z.item,{[g.Z["last-feature"]]:a===t.length-1}),key:a},u().createElement(h.ZP,{variant:"body-small"},u().createElement("strong",null,e.name)),e.tooltipInfo&&u().createElement(d.Z,{title:e.tooltipTitle,iconClassName:g.Z["popover-icon"],className:g.Z.popover,placement:e.tooltipPlacement?e.tooltipPlacement:"bottom-end",iconSize:14,offset:4,wide:Boolean(e.tooltipTitle&&e.tooltipInfo)},u().createElement(h.ZP,{variant:"body-small"},e.tooltipInfo))))),a)),u().createElement("div",{className:g.Z["tos-container"]},u().createElement("div",{className:g.Z.tos},n&&u().createElement(h.ZP,{variant:"body-small"},__("Reduced pricing is a limited offer for the first year and renews at regular price.","jetpack-my-jetpack")),u().createElement(p.Z,{multipleButtons:!0}))))}},5347:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5736),c=a(5235),r=a.n(c),s=a(5106),i=a(3789),o=a(9184);const __=n.__,l=({price:e,offPrice:t,currency:a="",showNotOffPrice:n=!0,hideDiscountLabel:c=!0,promoLabel:l="",legend:u=__("/month, paid yearly","jetpack-my-jetpack"),isNotConvenientPrice:d=!1,hidePriceFraction:m=!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=!c&&h&&h>0?h+__("% off","jetpack-my-jetpack"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:o.Z.container},React.createElement("div",{className:r()(o.Z["price-container"],"product-price_container")},React.createElement(i.t,{value:t??e,currency:a,isOff:!d,hidePriceFraction:m}),n&&React.createElement(i.t,{value:e,currency:a,isOff:!1,hidePriceFraction:m}),g&&React.createElement(s.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},g))),React.createElement("div",{className:o.Z.footer},p||React.createElement(s.ZP,{className:r()(o.Z.legend,"product-price_legend")},u),l&&React.createElement(s.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},l)))}},3789:(e,t,a)=>{"use strict";a.d(t,{t:()=>o});var n=a(8899),c=a(5235),r=a.n(c),s=a(5106),i=a(9184);const o=({value:e,currency:t,isOff:a,hidePriceFraction:c})=>{const o=r()(i.Z.price,"product-price_price",{[i.Z["is-not-off-price"]]:!a}),{symbol:l,integer:u,fraction:d}=(0,n.LR)(e,t),m=!c||!d.endsWith("00");return React.createElement(s.ZP,{className:o,variant:"headline-medium",component:"p"},React.createElement(s.ZP,{className:i.Z.symbol,component:"sup",variant:"title-medium"},l),u,m&&React.createElement(s.ZP,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,d)))}},5033:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r);a(1683);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 o=i},7325:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(9307),c=a(5736),r=a(5235),s=a.n(r),i=a(6895),o=a(5106);a(7920);const __=c.__,l=()=>(0,n.createInterpolateElement)(__("By clicking the buttons above, you agree to our Terms of Service and to share details with WordPress.com.","jetpack-my-jetpack"),{tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),u=({agreeButtonLabel:e})=>(0,n.createInterpolateElement)((0,c.sprintf)(/* translators: %s is a button label */ -__("By clicking the %s button, you agree to our Terms of Service and to share details with WordPress.com.","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,i.Z)(e),rel:"noopener noreferrer",target:"_blank"},t),m=({className:e,multipleButtons:t,agreeButtonLabel:a})=>React.createElement(o.ZP,{className:s()(e,"terms-of-service")},t?React.createElement(l,null):React.createElement(u,{agreeButtonLabel:a}))},6017:(e,t,a)=>{"use strict";a.d(t,{h:()=>n,s:()=>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"]},5106:(e,t,a)=>{"use strict";a.d(t,{Dx:()=>h,H3:()=>p,ZP:()=>m});var n=a(2674),c=a.n(n),r=a(5235),s=a.n(r),i=a(9196),o=a.n(i),l=a(6017),u=a(3280);const d=(0,i.forwardRef)((({variant:e="body",children:t,component:a,className:n,...r},d)=>{const m=a||l.h[e]||"span",p=(0,i.useMemo)((()=>l.s.reduce(((e,t)=>(void 0!==r[t]&&(e+=u.Z[`${t}-${r[t]}`]+" ",delete r[t]),e)),"")),[r]);return r.ref=d,o().createElement(m,c()({className:s()(u.Z.reset,u.Z[e],n,p)},r),t)}));d.displayName="Text";const m=d,p=({children:e,weight:t="bold",...a})=>{const n="headline-small"+("bold"===t?"":`-${t}`);return o().createElement(d,c()({variant:n,mb:3},a),e)},h=({children:e,size:t="medium",...a})=>o().createElement(d,c()({variant:`title-${t}`,mb:1},a),e)},8275:(e,t,a)=>{"use strict";a.d(t,{ZP:()=>m});var n=a(9196),c=a.n(n),r=a(3591);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 )"},o={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},l={"--spacing-base":"8px"},u={},d=(e,t,a)=>{const n={...s,...i,...o,...l};for(const t in n)e.style.setProperty(t,n[t]);a&&e.classList.add(r.Z.global),t&&(u[t]={provided:!0,root:e})},m=({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?d(t,a,r):void(s?.current&&d(s.current,a,r))}),[t,s,i,a,r]),t?c().createElement(c().Fragment,null,e):c().createElement("div",{ref:s},e)}},4706:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(526),c=a(5609),r=a(9307),s=a(9196),i=a.n(s);a(2541);const o=e=>{const{icon:t,title:a,description:s,primaryCtaLabel:o,primaryCtaURL:l,primaryCtaIsExternalLink:u,primaryCtaOnClick:d,secondaryCtaLabel:m,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"},m&&p&&i().createElement(n.Z,{className:"upsell-banner--content-cta-button secondary",href:p,onClick:g??void 0,isExternalLink:h},m),o&&l&&i().createElement(n.Z,{className:"upsell-banner--content-cta-button primary",href:l,onClick:d??void 0,isExternalLink:u},o)))))}},5905:(e,t,a)=>{"use strict";a.d(t,{O:()=>n});const n="d729d42c-b547-4750-a6f6-8b30534a5f12"},4164:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(5905);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"})}},8709:(e,t,a)=>{"use strict";a.d(t,{X:()=>c});var n=a(9771);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"}},2497:(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,{Z:()=>n})},6895:(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&&jetpack_redirects.hasOwnProperty("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,{Z:()=>n})},1132:(e,t,a)=>{let n={};try{n=a(4462)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),n={missingConfig:!0}}const c=e=>n.hasOwnProperty(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]}}},6183:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(9196),r=a.n(c),s=a(1294),i=a(7851);const __=n.__,o=({title:e,buttonLabel:t,loadingLabel:a,apiRoot:n,apiNonce:c,registrationNonce:o,from:l,redirectUri:u,images:d,children:m,assetBaseUrl:p,autoTrigger:h,footer:g,skipUserConnection:v,logo:f})=>{const{handleRegisterSite:w,siteIsRegistering:k,userIsConnecting:E,registrationError:y,isOfflineMode:b}=(0,s.Z)({registrationNonce:o,redirectUri:u,apiRoot:n,apiNonce:c,autoTrigger:h,from:l,skipUserConnection:v}),_=Boolean(y),j=k||E,C=y?.response?.code;return r().createElement(i.Z,{title:e||__("Over 5 million WordPress sites are faster and more secure","jetpack-my-jetpack"),images:d||[],assetBaseUrl:p,buttonLabel:t||__("Set up Jetpack","jetpack-my-jetpack"),loadingLabel:a,handleButtonClick:w,displayButtonError:_,errorCode:C,buttonIsLoading:j,footer:g,isOfflineMode:b,logo:f},m)}},7851:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(7325),c=a(7121),r=a(6895),s=a(9307),i=a(5736),o=a(9196),l=a.n(o),u=a(16);a(1510);const __=i.__,d=(e,t)=>{switch(e){case"fail_domain_forbidden":case"fail_ip_forbidden":case"fail_domain_tld":case"fail_subdomain_wpcom":case"siteurl_private_ip":return __("Your site host is on a private network. Jetpack can only connect to public sites.","jetpack-my-jetpack")}if(t)return(0,s.createInterpolateElement)(__("Unavailable in Offline Mode","jetpack-my-jetpack"),{a:l().createElement("a",{href:(0,r.Z)("jetpack-support-development-mode"),target:"_blank",rel:"noopener noreferrer"})})},m=({title:e,images:t,children:a,assetBaseUrl:r,isLoading:s,buttonLabel:i,handleButtonClick:o,displayButtonError:m,errorCode:p,buttonIsLoading:h,loadingLabel:g,footer:v,isOfflineMode:f,logo:w})=>l().createElement(u.Z,{title:e,assetBaseUrl:r,images:t,className:"jp-connection__connect-screen"+(s?" jp-connection__connect-screen__loading":""),logo:w},l().createElement("div",{className:"jp-connection__connect-screen__content"},a,l().createElement("div",{className:"jp-connection__connect-screen__tos"},l().createElement(n.Z,{agreeButtonLabel:i})),l().createElement(c.Z,{label:i,onClick:o,displayError:m||f,errorMessage:d(p,f),isLoading:h,isDisabled:f}),l().createElement("span",{className:"jp-connection__connect-screen__loading-message",role:"status"},h?g||__("Loading","jetpack-my-jetpack"):""),v&&l().createElement("div",{className:"jp-connection__connect-screen__footer"},v)))},7593:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a.n(n);const r=({images:e,assetBaseUrl:t=""})=>{if(!e?.length)return null;const a=e.map(((e,a)=>c().createElement(c().Fragment,{key:a},c().createElement("img",{src:t+e,alt:""}))));return c().createElement("div",{className:"jp-connection__connect-screen__image-slider"},a)}},16:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(8868),c=a(5235),r=a.n(c),s=a(9196),i=a.n(s),o=a(7593);a(9610);const l=({title:e,children:t,className:a,assetBaseUrl:c,images:s,logo:l,rna:u=!1})=>{const d=s?.length;return i().createElement("div",{className:r()("jp-connection__connect-screen-layout",d?"jp-connection__connect-screen-layout__two-columns":"",a?" "+a:"")},u&&i().createElement("div",{className:"jp-connection__connect-screen-layout__color-blobs"},i().createElement("div",{className:"jp-connection__connect-screen-layout__color-blobs__green"}),i().createElement("div",{className:"jp-connection__connect-screen-layout__color-blobs__yellow"}),i().createElement("div",{className:"jp-connection__connect-screen-layout__color-blobs__blue"})),i().createElement("div",{className:"jp-connection__connect-screen-layout__left"},l||i().createElement(n.Z,null),i().createElement("h2",null,e),t),d?i().createElement("div",{className:"jp-connection__connect-screen-layout__right"},i().createElement(o.Z,{images:s,assetBaseUrl:c})):null)}},7879:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(5736),c=a(5844),r=a.n(c),s=a(9196),i=a.n(s),o=a(4322);const __=n.__,l=e=>{const{connectedPlugins:t,disconnectingPlugin:a}=e,n=(0,s.useMemo)((()=>{if(t){return Object.keys(t).map((e=>Object.assign({slug:e},t[e]))).filter((e=>a!==e.slug))}return[]}),[t,a]);return t&&n.length>0?i().createElement(i().Fragment,null,i().createElement("div",{className:"jp-connection__disconnect-dialog__step-copy"},i().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},__("Jetpack is powering other plugins on your site. If you disconnect, these plugins will no longer work.","jetpack-my-jetpack"))),i().createElement("div",{className:"jp-connection__disconnect-card__group"},n.map((e=>i().createElement(o.Z,{title:e.name,key:e.slug}))))):null};l.propTypes={connectedPlugins:r().array,disconnectingPlugin:r().string};const u=l},4322:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r);a(4220);const i=e=>{const{title:t,value:a,description:n}=e;return s().createElement("div",{className:"jp-connection__disconnect-card card"},s().createElement("div",{className:"jp-connection__disconnect-card__card-content"},s().createElement("p",{className:"jp-connection__disconnect-card__card-headline"},t),(a||n)&&s().createElement("div",{className:"jp-connection__disconnect-card__card-stat-block"},s().createElement("span",{className:"jp-connection__disconnect-card__card-stat"},a),s().createElement("div",{className:"jp-connection__disconnect-card__card-description"},n))))};i.propTypes={title:c().string,value:c().oneOfType([c().string,c().number]),description:c().string};const o=i},6168:(e,t,a)=>{"use strict";a.d(t,{Z:()=>f});var n=a(6975),c=a(4743),r=a(1132),s=a(5609),i=a(5736),o=a(5844),l=a.n(o),u=a(9196),d=a.n(u),m=(a(287),a(9015)),p=a(5995),h=a(1702),g=a(1166);const __=i.__,v=e=>{const[t,a]=(0,u.useState)(!1),[i,o]=(0,u.useState)(!1),[l,v]=(0,u.useState)(!1),[f,w]=(0,u.useState)(!1),[k,E]=(0,u.useState)(!1),[y,b]=(0,u.useState)(!1),{apiRoot:_,apiNonce:j,connectedPlugins:C,title:N=__("Are you sure you want to disconnect?","jetpack-my-jetpack"),pluginScreenDisconnectCallback:R,onDisconnected:Z,onError:x,disconnectStepComponent:z,context:S="jetpack-dashboard",connectedUser:M={},connectedSiteId:L,isOpen:P,onClose:A}=e;let V="";(0,r.jetpackConfigHas)("consumer_slug")&&(V=(0,r.jetpackConfigGet)("consumer_slug"));const H=(0,u.useMemo)((()=>({context:S,plugin:V})),[S,V]);(0,u.useEffect)((()=>{c.ZP.setApiRoot(_),c.ZP.setApiNonce(j)}),[_,j]),(0,u.useEffect)((()=>{M&&M.ID&&M.login&&n.Z.initialize(M.ID,M.login)}),[M,M.ID,M.login]),(0,u.useEffect)((()=>{P&&n.Z.tracks.recordEvent("jetpack_disconnect_dialog_open",H)}),[P,H]),(0,u.useEffect)((()=>{P&&(i?!i||f||k?f&&!k?n.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"survey"},H)):k&&n.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"thank_you"},H)):n.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"disconnect_confirm"},H)):n.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"disconnect"},H)))}),[P,i,f,k,H]);const O=(0,u.useCallback)((()=>{c.ZP.disconnectSite().then((()=>{a(!1),o(!0)})).catch((e=>{a(!1),v(e),x&&x(e)}))}),[a,o,v,x]),I=(0,u.useCallback)(((e,t)=>{b(!0),fetch("https://public-api.wordpress.com/wpcom/v2/marketing/feedback-survey",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)}).then((e=>e.json())).then((e=>{if(!0!==e.success)throw new Error("Survey endpoint returned error code "+e.code);n.Z.tracks.recordEvent("jetpack_disconnect_survey_submit",t),E(!0),b(!1)})).catch((e=>{n.Z.tracks.recordEvent("jetpack_disconnect_survey_error",Object.assign({},{error:e.message},t)),E(!0),b(!1)}))}),[b,E]),B=(0,u.useCallback)((e=>{e&&e.preventDefault(),v(!1),a(!0),"plugins"!==S?O():R&&R(e)}),[v,a,R,S,O]),T=(0,u.useCallback)((e=>n.Z.tracks.recordEvent(e,H)),[H]),U=(0,u.useCallback)((()=>!(!M.ID||!L)),[M,L]),F=(0,u.useCallback)(((e,t,a)=>{if(a&&a.preventDefault(),!U())return void E(!0);const n={site_id:L,user_id:M.ID,survey_id:"jetpack-plugin-disconnect",survey_responses:{"why-cancel":{response:e,text:t||null}}},c=Object.assign({},H,{disconnect_reason:e});I(n,c)}),[I,E,U,L,M,H]),D=(0,u.useCallback)((e=>{e&&e.preventDefault(),Z&&Z(),A()}),[Z,A]),q=(0,u.useCallback)((e=>{e&&e.preventDefault(),w(!0)}),[w]);return d().createElement(d().Fragment,null,P&&d().createElement(s.Modal,{title:"",contentLabel:N,aria:{labelledby:"jp-connection__disconnect-dialog__heading"},onRequestClose:A,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"jp-connection__disconnect-dialog"+(i?" jp-connection__disconnect-dialog__success":"")},i?!i||f||k?f&&!k?d().createElement(h.Z,{isSubmittingFeedback:y,onFeedBackProvided:F,onExit:D}):k?d().createElement(g.Z,{onExit:D}):void 0:d().createElement(p.Z,{canProvideFeedback:U(),onProvideFeedback:q,onExit:D}):d().createElement(m.Z,{title:N,connectedPlugins:C,disconnectStepComponent:z,isDisconnecting:t,closeModal:A,onDisconnect:B,disconnectError:l,context:S,disconnectingPlugin:V,trackModalClick:T})))};v.propTypes={apiRoot:l().string.isRequired,apiNonce:l().string.isRequired,title:l().string,onDisconnected:l().func,onError:l().func,context:l().string,connectedPlugins:l().oneOfType([l().array,l().object]),pluginScreenDisconnectCallback:l().func,disconnectStepComponent:l().element,connectedUser:l().object,connectedSiteId:l().number,isOpen:l().bool,onClose:l().func};const f=v},5995:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(9026),c=a(5609),r=a(9307),s=a(5736),i=a(5844),o=a.n(i),l=a(9196),u=a.n(l),d=a(2042);const __=s.__,m=e=>{const{onExit:t,canProvideFeedback:a,onProvideFeedback:s}=e;return u().createElement("div",{className:"jp-connection__disconnect-dialog__content"},u().createElement(n.Z,{icon:"unlink",imageUrl:d}),u().createElement("div",{className:"jp-connection__disconnect-dialog__step-copy jp-connection__disconnect-dialog__step-copy--narrow"},u().createElement("h1",null,(0,r.createInterpolateElement)(__("Jetpack has been
          successfully disconnected.","jetpack-my-jetpack"),{br:u().createElement("br",null)})),a&&u().createElement(u().Fragment,null,u().createElement("p",null,__("We’re sorry to see you go. Here at Jetpack, we’re always striving to provide the best experience for our customers. Please take our short survey (2 minutes, promise).","jetpack-my-jetpack")),u().createElement("p",null,u().createElement(c.Button,{variant:"primary",onClick:s,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},__("Help us improve","jetpack-my-jetpack"))),u().createElement("a",{className:"jp-connection__disconnect-dialog__link jp-connection__disconnect-dialog__link--bold",href:"#",onClick:t},__("No thank you","jetpack-my-jetpack"))),!a&&u().createElement(u().Fragment,null,u().createElement("p",null,u().createElement(c.Button,{variant:"primary",onClick:t,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},__("Back to my website","jetpack-my-jetpack"))))))};m.propTypes={onExit:o().func,onProvideFeedback:o().func,canProvideFeedback:o().bool};const p=m},9015:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(6895),c=a(5609),r=a(9307),s=a(5736),i=a(5844),o=a.n(i),l=a(9196),u=a.n(l),d=a(7879);const __=s.__,m=e=>{const{title:t,isDisconnecting:a,onDisconnect:s,disconnectError:i,disconnectStepComponent:o,connectedPlugins:m,disconnectingPlugin:p,closeModal:h,context:g,trackModalClick:v}=e,f=(0,l.useCallback)((()=>v("jetpack_disconnect_dialog_click_learn_about")),[v]),w=(0,l.useCallback)((()=>v("jetpack_disconnect_dialog_click_support")),[v]),k=(0,l.useCallback)((()=>{v("jetpack_disconnect_dialog_click_stay_connected"),h()}),[v,h]),E=(0,l.useCallback)((e=>{v("jetpack_disconnect_dialog_click_disconnect"),s(e)}),[v,s]),y=(0,l.useCallback)((e=>{"Escape"!==e.key||a||k()}),[k,a]);(0,l.useEffect)((()=>(document.addEventListener("keydown",y,!1),()=>{document.removeEventListener("keydown",y,!1)})),[]);return u().createElement(u().Fragment,null,u().createElement("div",{className:"jp-connection__disconnect-dialog__content"},u().createElement("h1",{id:"jp-connection__disconnect-dialog__heading"},t),u().createElement(d.Z,{connectedPlugins:m,disconnectingPlugin:p}),o,(()=>{if(!(m&&Object.keys(m).filter((e=>e!==p)).length)&&!o)return u().createElement("div",{className:"jp-connection__disconnect-dialog__step-copy"},u().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},__("Jetpack is currently powering multiple products on your site.","jetpack-my-jetpack"),u().createElement("br",null),__("Once you disconnect Jetpack, these will no longer work.","jetpack-my-jetpack")))})()),u().createElement("div",{className:"jp-connection__disconnect-dialog__actions"},u().createElement("div",{className:"jp-row"},u().createElement("div",{className:"lg-col-span-8 md-col-span-9 sm-col-span-4"},u().createElement("p",null,(0,r.createInterpolateElement)(__("Need help? Learn more about the Jetpack connection or contact Jetpack support.","jetpack-my-jetpack"),{strong:u().createElement("strong",null),jpConnectionInfoLink:u().createElement(c.ExternalLink,{href:(0,n.Z)("why-the-wordpress-com-connection-is-important-for-jetpack"),className:"jp-connection__disconnect-dialog__link",onClick:f}),jpSupportLink:u().createElement(c.ExternalLink,{href:(0,n.Z)("jetpack-support"),className:"jp-connection__disconnect-dialog__link",onClick:w})}))),u().createElement("div",{className:"jp-connection__disconnect-dialog__button-wrap lg-col-span-4 md-col-span-7 sm-col-span-4"},u().createElement(c.Button,{variant:"primary",disabled:a,onClick:k,className:"jp-connection__disconnect-dialog__btn-dismiss"},"plugins"===g?__("Cancel","jetpack-my-jetpack"):__("Stay connected","jetpack-my-jetpack",0)),(()=>{let e=__("Disconnect","jetpack-my-jetpack");return a?e=__("Disconnecting…","jetpack-my-jetpack"):"plugins"===g&&(e=__("Deactivate","jetpack-my-jetpack")),u().createElement(c.Button,{variant:"primary",disabled:a,onClick:E,className:"jp-connection__disconnect-dialog__btn-disconnect"},e)})())),i&&u().createElement("p",{className:"jp-connection__disconnect-dialog__error"},i)))};m.propTypes={title:o().string,isDisconnecting:o().bool,onDisconnect:o().func,disconnectError:o().bool,disconnectStepComponent:o().element,connectedPlugins:o().array,disconnectingPlugin:o().string,closeModal:o().func,context:o().string,trackModalClick:o().func};const p=m},1702:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(5736),c=a(5844),r=a.n(c),s=a(9196),i=a.n(s),o=(a(9823),a(6336));const __=n.__,l=e=>{const{onExit:t,onFeedBackProvided:a,isSubmittingFeedback:n}=e;return i().createElement("div",{className:"jp-connection__disconnect-dialog__content"},i().createElement("h1",null,__("Before you go, help us improve Jetpack","jetpack-my-jetpack")),i().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},__("Let us know what didn‘t work for you","jetpack-my-jetpack")),i().createElement(o.Z,{onSubmit:a,isSubmittingFeedback:n}),i().createElement("a",{className:"jp-connection__disconnect-dialog__link jp-connection__disconnect-dialog__link--bold",href:"#",onClick:t},__("Skip for now","jetpack-my-jetpack")))};l.PropTypes={onExit:r().func,onFeedBackProvided:r().func,isSubmittingFeedback:r().bool};const u=l},1166:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(9026),c=a(5609),r=a(9307),s=a(5736),i=a(5844),o=a.n(i),l=a(9196),u=a.n(l),d=a(724);const __=s.__,m=e=>{const{onExit:t}=e;return u().createElement("div",{className:"jp-connection__disconnect-dialog__content"},u().createElement(n.Z,{format:"vertical",imageUrl:d}),u().createElement("div",{className:"jp-connection__disconnect-dialog__copy"},u().createElement("h1",null,__("Thank you!","jetpack-my-jetpack")),u().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},(0,r.createInterpolateElement)(__("Your answer has been submitted.
          Thanks for your input on how we can improve Jetpack.","jetpack-my-jetpack"),{br:u().createElement("br",null)})),u().createElement(c.Button,{variant:"primary",onClick:t,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},__("Back to my website","jetpack-my-jetpack"))))};m.PropTypes={onExit:o().func,assetBaseUrl:o().string};const p=m},6336:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5609),c=a(5736),r=a(5844),s=a.n(r),i=a(9196),o=a.n(i),l=a(4372);const __=c.__,u=e=>{const{onSubmit:t,isSubmittingFeedback:a}=e,[c,r]=(0,i.useState)(),[s,u]=(0,i.useState)(),d=[{id:"troubleshooting",answerText:__("Troubleshooting - I'll be reconnecting afterwards.","jetpack-my-jetpack")},{id:"not-working",answerText:__("I can't get it to work.","jetpack-my-jetpack")},{id:"slowed-down-site",answerText:__("It slowed down my site.","jetpack-my-jetpack")},{id:"buggy",answerText:__("It's buggy.","jetpack-my-jetpack")},{id:"what-does-it-do",answerText:__("I don't know what it does.","jetpack-my-jetpack")}],m="another-reason",p=(0,i.useCallback)((()=>{t(c,c===m?s:"")}),[t,m,s,c]),h=(0,i.useCallback)((e=>{const t=e.target.value;e.stopPropagation(),u(t)}),[u]),g=e=>e===c?"jp-connect__disconnect-survey-card--selected":"",v=(0,i.useCallback)(((e,t)=>{switch(t.key){case"Enter":case"Space":case"Spacebar":case" ":r(e)}}),[r]);return o().createElement(o().Fragment,null,o().createElement("div",{className:"jp-connection__disconnect-dialog__survey"},d.map((e=>o().createElement(l.Z,{id:e.id,onClick:r,onKeyDown:v,className:"card jp-connect__disconnect-survey-card "+g(e.id)},o().createElement("p",{className:"jp-connect__disconnect-survey-card__answer"},e.answerText)))),o().createElement(l.Z,{id:m,key:m,onClick:r,onKeyDown:v,className:"card jp-connect__disconnect-survey-card "+g(m)},o().createElement("p",{className:"jp-connect__disconnect-survey-card__answer"},__("Other:","jetpack-my-jetpack")," ",o().createElement("input",{placeholder:__("share your experience","jetpack-my-jetpack"),className:"jp-connect__disconnect-survey-card__input",type:"text",value:s,onChange:h,maxLength:1e3})))),o().createElement("p",null,o().createElement(n.Button,{disabled:!c||a,variant:"primary",onClick:p,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},a?__("Submitting…","jetpack-my-jetpack"):__("Submit Feedback","jetpack-my-jetpack",0))))};u.PropTypes={onSubmit:s().func,isSubmittingFeedback:s().bool};const d=u},4372:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a.n(n);a(9823);const r=e=>{const{id:t,onClick:a,onKeyDown:r,children:s,className:i}=e,o=(0,n.useCallback)((()=>{a(t)}),[t,a]),l=(0,n.useCallback)((e=>{r(t,e)}),[t,r]);return c().createElement("div",{tabIndex:"0",role:"button",onClick:o,onKeyDown:l,className:"card jp-connect__disconnect-survey-card "+i},s)}},8137:(e,t,a)=>{"use strict";a.d(t,{Z:()=>b});var n=a(5106),c=a(6895),r=a(526),s=a(5609),i=a(9307),o=a(5736),l=a(1074),u=a(6936),d=a(5381),m=a(5235),p=a.n(m),h=a(5844),g=a.n(h),v=a(9196),f=a.n(v),w=a(6168);a(7664);const __=o.__,k=e=>{const{title:t=__("Manage your Jetpack connection","jetpack-my-jetpack"),apiRoot:a,apiNonce:r,connectedPlugins:i,onDisconnected:o,context:l="jetpack-dashboard",connectedUser:u={},connectedSiteId:d,isOpen:m=!1,onClose:p}=e,[h,g]=(0,v.useState)(!1),k=(0,v.useCallback)((e=>{e&&e.preventDefault(),g(!0)}),[g]),b=(0,v.useCallback)((e=>{e&&e.preventDefault(),g(!1)}),[g]);return f().createElement(f().Fragment,null,m&&f().createElement(f().Fragment,null,f().createElement(s.Modal,{title:"",contentLabel:t,aria:{labelledby:"jp-connection__manage-dialog__heading"},shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"jp-connection__manage-dialog"},f().createElement("div",{className:"jp-connection__manage-dialog__content"},f().createElement("h1",{id:"jp-connection__manage-dialog__heading"},t),f().createElement(n.ZP,{className:"jp-connection__manage-dialog__large-text"},__("At least one user must be connected for your Jetpack products to work properly.","jetpack-my-jetpack")),f().createElement(E,{title:__("Transfer ownership to another admin","jetpack-my-jetpack"),link:(0,c.Z)("calypso-settings-manage-connection",{site:window?.myJetpackInitialState?.siteSuffix}),key:"transfer",action:"transfer"}),f().createElement(E,{title:__("Disconnect Jetpack","jetpack-my-jetpack"),onClick:k,key:"disconnect",action:"disconnect"})),f().createElement(y,{onClose:p})),f().createElement(w.Z,{apiRoot:a,apiNonce:r,onDisconnected:o,connectedPlugins:i,connectedSiteId:d,connectedUser:u,isOpen:h,onClose:b,context:l})))},E=({title:e,onClick:t=(()=>null),link:a="#",action:n})=>f().createElement("div",{className:"jp-connection__manage-dialog__action-card card"},f().createElement("div",{className:"jp-connection__manage-dialog__action-card__card-content"},f().createElement("a",{href:a,className:p()("jp-connection__manage-dialog__action-card__card-headline",n),onClick:t},e,f().createElement(l.Z,{icon:"disconnect"===n?u.Z:d.Z,className:"jp-connection__manage-dialog__action-card__icon"})))),y=({onClose:e})=>f().createElement("div",{className:"jp-row jp-connection__manage-dialog__actions"},f().createElement("div",{className:"jp-connection__manage-dialog__text-wrap lg-col-span-9 md-col-span-7 sm-col-span-3"},f().createElement(n.ZP,null,(0,i.createInterpolateElement)(__("Need help? Learn more about the Jetpack connection or contact Jetpack support","jetpack-my-jetpack"),{strong:f().createElement("strong",null),connectionInfoLink:f().createElement(s.ExternalLink,{href:(0,c.Z)("why-the-wordpress-com-connection-is-important-for-jetpack"),className:"jp-connection__manage-dialog__link"}),supportLink:f().createElement(s.ExternalLink,{href:(0,c.Z)("jetpack-support"),className:"jp-connection__manage-dialog__link"})}))),f().createElement("div",{className:"jp-connection__manage-dialog__button-wrap lg-col-span-3 md-col-span-1 sm-col-span-1"},f().createElement(r.Z,{weight:"regular",variant:"secondary",onClick:e,className:"jp-connection__manage-dialog__btn-dismiss"},__("Cancel","jetpack-my-jetpack"))));k.propTypes={title:g().string,apiRoot:g().string.isRequired,apiNonce:g().string.isRequired,connectedPlugins:g().oneOfType([g().array,g().object]),onDisconnected:g().func,context:g().string,connectedUser:g().object,connectedSiteId:g().number,isOpen:g().bool,onClose:g().func};const b=k},1294:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(4743),c=a(9818),r=a(9196),s=a(428);const i=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{},o=({registrationNonce:e=i.registrationNonce,apiRoot:t=i.apiRoot,apiNonce:a=i.apiNonce,redirectUri:o,autoTrigger:l,from:u,skipUserConnection:d}={})=>{const{registerSite:m,connectUser:p,refreshConnectedPlugins:h}=(0,c.useDispatch)(s.t),g=(0,c.useSelect)((e=>e(s.t).getRegistrationError())),{siteIsRegistering:v,userIsConnecting:f,userConnectionData:w,connectedPlugins:k,connectionErrors:E,isRegistered:y,isUserConnected:b,hasConnectedOwner:_,isOfflineMode:j}=(0,c.useSelect)((e=>({siteIsRegistering:e(s.t).getSiteIsRegistering(),userIsConnecting:e(s.t).getUserIsConnecting(),userConnectionData:e(s.t).getUserConnectionData(),connectedPlugins:e(s.t).getConnectedPlugins(),connectionErrors:e(s.t).getConnectionErrors(),isOfflineMode:e(s.t).getIsOfflineMode(),...e(s.t).getConnectionStatus()}))),C=()=>d?o?(window.location=o,Promise.resolve(o)):Promise.resolve():p({from:u,redirectUri:o}),N=t=>(t&&t.preventDefault(),y?C():m({registrationNonce:e,redirectUri:o,from:u}).then((()=>C())));return(0,r.useEffect)((()=>{n.ZP.setApiRoot(t),n.ZP.setApiNonce(a)}),[t,a]),(0,r.useEffect)((()=>{!l||v||f||N()}),[]),{handleRegisterSite:N,handleConnectUser:C,refreshConnectedPlugins:h,isRegistered:y,isUserConnected:b,siteIsRegistering:v,userIsConnecting:f,registrationError:g,userConnectionData:w,hasConnectedOwner:_,connectedPlugins:k,connectionErrors:E,isOfflineMode:j}}},7711:(e,t,a)=>{"use strict";function n(){switch("undefined"!=typeof window&&window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv){case"development":return"http://calypso.localhost:3000/";case"wpcalypso":return"https://wpcalypso.wordpress.com/";case"horizon":return"https://horizon.wordpress.com/";default:return"https://wordpress.com/"}}a.d(t,{Z:()=>n})},3329:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(1294);function c(){const{connectionErrors:e}=(0,n.Z)({}),t=Object.values(e).shift(),a=t&&Object.values(t).length&&Object.values(t).shift().error_message;return{hasConnectionError:Boolean(a),connectionErrorMessage:a}}},8258:(e,t,a)=>{"use strict";a.d(t,{Z:()=>f});var n=a(4743),c=a(7711),r=a(9818),s=a(951),i=a.n(s),o=a(9196),l=a(1294),u=a(428);const d=i()("jetpack:connection:useProductCheckoutWorkflow"),{registrationNonce:m,apiRoot:p,apiNonce:h,siteSuffix:g}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{},v="undefined"!=typeof window?window?.myJetpackInitialState?.adminUrl:null;function f({productSlug:e,redirectUrl:t,siteSuffix:a=g,adminUrl:s=v,connectAfterCheckout:i=!1,siteProductAvailabilityHandler:f=null,quantity:w=null,from:k,useBlogIdSuffix:E=!1}={}){d("productSlug is %s",e),d("redirectUrl is %s",t),d("siteSuffix is %s",a),d("from is %s",k);const[y,b]=(0,o.useState)(!1),{registerSite:_}=(0,r.useDispatch)(u.t),j=(0,r.useSelect)((e=>e(u.t).getBlogId()),[u.t]);d("blogID is %s",j??"undefined"),E=E&&!!j;const{isUserConnected:C,isRegistered:N,handleConnectUser:R}=(0,l.Z)({redirectUri:t,from:k}),Z=(0,o.useMemo)((()=>{const n=(0,c.Z)(),r=(!N||!C)&&i,o=r?"checkout/jetpack/":`checkout/${E?j.toString():a}/`,l=new URL(`${n}${o}${e}${null!=w?`:-q-${w}`:""}`);return r?(l.searchParams.set("connect_after_checkout",!0),l.searchParams.set("admin_url",s),l.searchParams.set("from_site_slug",a)):l.searchParams.set("site",a),l.searchParams.set("source",k),l.searchParams.set("redirect_to",t),C||l.searchParams.set("unlinked","1"),l}),[N,C,i,a,w,e,k,t,s,E,j]);d("isRegistered is %s",N),d("isUserConnected is %s",C),d("connectAfterCheckout is %s",i),d("checkoutUrl is %s",Z);const x=(e=null)=>Promise.resolve(f&&f()).then((t=>{if(e&&Z.searchParams.set("redirect_to",e),t)return d("handleAfterRegistration: Site has a product associated"),R();d("handleAfterRegistration: Site does not have a product associated. Redirecting to checkout %s",Z),window.location.href=Z}));return(0,o.useEffect)((()=>{n.ZP.setApiRoot(p),n.ZP.setApiNonce(h)}),[]),{run:(e,a=null)=>(e&&e.preventDefault(),b(!0),i?((e=null)=>{e&&Z.searchParams.set("redirect_to",e),d("Redirecting to connectAfterCheckout flow: %s",Z),window.location.href=Z})(a):N?x(a):void _({registrationNonce:m,redirectUri:t}).then((()=>x(a)))),isRegistered:N,hasCheckoutStarted:y}}},1045:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(4743),c=a(9818),r=a(9196),s=a(428);const{apiRoot:i,apiNonce:o}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function l(){const[e,t]=(0,r.useState)(!1),[a,l]=(0,r.useState)(null),{disconnectUserSuccess:u,setConnectionErrors:d}=(0,c.useDispatch)(s.t);return(0,r.useEffect)((()=>{n.ZP.setApiRoot(i),n.ZP.setApiNonce(o)}),[]),{restoreConnection:(e=!0)=>(t(!0),l(null),n.ZP.reconnect().then((t=>("in_progress"===t.status?(u(),d({}),e&&(window.location.href="/wp-admin/admin.php?page=my-jetpack#/connection")):window.location.reload(),t))).catch((e=>{throw l(e),t(!1),e}))),isRestoringConnection:e,restoreConnectionError:a}}},7523:(e,t,a)=>{"use strict";a.d(t,{LI:()=>r,N4:()=>i,Qo:()=>d,T1:()=>l,TS:()=>u,ZP:()=>b,b5:()=>p,i6:()=>c,qJ:()=>h,qV:()=>o,r7:()=>s,wQ:()=>m});var n=a(4743);const c="SET_CONNECTION_STATUS",r="SET_CONNECTION_STATUS_IS_FETCHING",s="SET_SITE_IS_REGISTERING",i="SET_USER_IS_CONNECTING",o="SET_REGISTRATION_ERROR",l="CLEAR_REGISTRATION_ERROR",u="SET_AUTHORIZATION_URL",d="DISCONNECT_USER_SUCCESS",m="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:o,registrationError:e}),k=()=>({type:l}),E=e=>({type:u,authorizationUrl:e}),y=e=>({type:m,connectedPlugins:e});const b={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:k,setAuthorizationUrl:E,registerSite:function*({registrationNonce:e,redirectUri:t,from:a=""}){yield k(),yield v(!0);try{const n=yield{type:"REGISTER_SITE",registrationNonce:e,redirectUri:t,from:a};return yield g({isRegistered:!0}),yield E(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:d}),setConnectedPlugins:y,refreshConnectedPlugins:()=>async({dispatch:e})=>await new Promise((t=>n.ZP.fetchConnectedPlugins().then((a=>{e(y(a)),t(a)})))),setConnectionErrors:e=>({type:p,connectionErrors:e}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})}},1432:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(4743),c=a(9818),r=a(7057);const s={FETCH_AUTHORIZATION_URL:({redirectUri:e})=>n.ZP.fetchAuthorizationUrl(e),REGISTER_SITE:({registrationNonce:e,redirectUri:t,from:a})=>n.ZP.registerSite(e,t,a),CONNECT_USER:(0,c.createRegistryControl)((({resolveSelect:e})=>({from:t,redirectFunc:a,redirectUri:n}={})=>new Promise(((c,s)=>{e(r.Z).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)}))}))))}},1479:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9818),c=a(7523);const r=(0,n.combineReducers)({connectionStatus:(e={},t)=>{switch(t.type){case c.i6:return{...e,...t.connectionStatus};case c.Qo:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:(e=!1,t)=>t.type===c.LI?t.isFetching:e,siteIsRegistering:(e=!1,t)=>t.type===c.r7?t.isRegistering:e,userIsConnecting:(e=!1,t)=>t.type===c.N4?t.isConnecting:e,registrationError:(e,t)=>{switch(t.type){case c.T1:return!1;case c.qV:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===c.TS?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:(e={},t)=>t.type===c.wQ?t.connectedPlugins:e,connectionErrors:(e={},t)=>t.type===c.b5?t.connectionErrors:e,isOfflineMode:(e=!1,t)=>t.type===c.qJ?t.isConnecting:e})},7728:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(9818),c=a(7523),r=a(7057);const s={...{getAuthorizationUrl:{isFulfilled:(e,...t)=>{const a=Boolean(e.authorizationUrl),c=(0,n.select)(r.Z).hasFinishedResolution("getAuthorizationUrl",t);return a&&!c&&(0,n.dispatch)(r.Z).finishResolution("getAuthorizationUrl",t),a},*fulfill(e){const t=yield c.ZP.fetchAuthorizationUrl(e);yield c.ZP.setAuthorizationUrl(t.authorizeUrl)}}}}},2725:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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}}},3535:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9818);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},7057:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});const n="jetpack-connection"},428:(e,t,a)=>{"use strict";a.d(t,{t:()=>l.Z});var n=a(7523),c=a(1432),r=a(1479),s=a(7728),i=a(2725),o=a(3535),l=a(7057);const u=window.JP_CONNECTION_INITIAL_STATE;u||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.Z.mayBeInit(l.Z,{__experimentalUseThunks:!0,reducer:r.Z,actions:n.ZP,selectors:i.Z,resolvers:s.Z,controls:c.Z,initialState:u||{}})},8728:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(6975),c=a(8868),r=a(5033),s=a(5609),i=a(9307),o=a(5736),l=a(1074),u=a(797),d=a(3059),m=a.n(d),p=a(9196),h=a.n(p);const __=o.__,g=e=>{const{className:t,disabled:a,onChange:n,value:c}=e;return h().createElement(s.TextControl,{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,l]=(0,p.useState)(""),u=null===a,d=(0,p.useMemo)((()=>u?[{label:__("Fetching available licenses…","jetpack-my-jetpack"),value:""}]:[...a.map((({product:e,license_key:t})=>({label:(0,o.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)((()=>{l(d?.length?d[0].value:"")}),[d]);const m=(0,p.useCallback)((e=>{l(e),c(e)}),[c]);return h().createElement(h().Fragment,null,h().createElement(s.SelectControl,{className:t,disabled:n,label:__("Select a license key","jetpack-my-jetpack"),value:i,options:d,onChange:m}),!u&&!i&&h().createElement(s.TextControl,{className:t,label:__("Input a license key","jetpack-my-jetpack"),value:r,onChange:c,disabled:n}))},f=e=>{const{activateLicense:t,availableLicenses:a,fetchingAvailableLicenses:o,isActivating:d,license:m,licenseError:f,onLicenseChange:w}=e,k=null!=f;(0,p.useEffect)((()=>{n.Z.tracks.recordEvent("jetpack_wpa_license_key_activation_view")}),[]);const E=k?"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.Z,{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)})),o||y?h().createElement(v,{className:E,disabled:o||d,onChange:w,availableLicenses:o?null:a,value:m}):h().createElement(g,{className:E,disabled:d,onChange:w,value:m}),k&&h().createElement("div",{className:"jp-license-activation-screen-controls--license-field-error"},h().createElement(l.Z,{icon:u.Z}),h().createElement("span",null,f))),h().createElement("div",null,h().createElement(s.Button,{className:"jp-license-activation-screen-controls--button",onClick:t,disabled:!m},d?h().createElement(r.Z,null):__("Activate","jetpack-my-jetpack"))))};f.propTypes={activateLicense:m().func.isRequired,availableLicenses:m().array,fetchingAvailableLicenses:m().bool,isActivating:m().bool.isRequired,license:m().string.isRequired,licenseError:m().string,onLicenseChange:m().func.isRequired,siteUrl:m().string.isRequired};const w=f},8781:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(6895),c=a(9307),r=a(5736),s=a(3059),i=a.n(s),o=a(9196),l=a.n(o);const __=r.__,u=e=>{const{imageUrl:t,showSupportLink:a=!1}=e;return l().createElement("div",{className:"jp-license-activation-screen-illustration"},l().createElement("div",{className:"jp-license-activation-screen-illustration--wrapper"},l().createElement("img",{className:"jp-license-activation-screen-illustration--img",src:t,alt:""})),a&&l().createElement("p",{className:"jp-license-activation-screen-illustration--support-link"},(0,c.createInterpolateElement)(__("Do you need help? Contact us.","jetpack-my-jetpack"),{a:l().createElement("a",{href:(0,n.Z)("jetpack-support-license-activation")})})))};u.propTypes={imageUrl:i().string.isRequired,showSupportLink:i().bool};const d=u},7554:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(8868),c=a(3059),r=a.n(c),s=a(9196),i=a.n(s),o=a(3157),l=a(8288),u=a(4172);const d=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.Z,{showText:!1,height:48})),i().createElement(l.Z,{siteRawUrl:a,productId:t}),i().createElement("div",{className:"jp-license-activation-screen-success-info--buttons"},i().createElement(o.c,{currentRecommendationsStep:r,siteAdminUrl:c,siteRawUrl:a,productId:t}),i().createElement(u.o,{siteRawUrl:a,productId:t})))};d.propTypes={siteRawUrl:r().string,productId:r().number,siteAdminUrl:r().string,currentRecommendationsStep:r().string};const m=d},3157:(e,t,a)=>{"use strict";a.d(t,{c:()=>p});var n=a(5033),c=a(6895),r=a(5609),s=a(5736),i=a(3059),o=a.n(i),l=a(9196),u=a.n(l),d=a(2180),m=a(9430);const __=s.__,p=e=>{const{currentRecommendationsStep:t,siteAdminUrl:a,siteRawUrl:s,productId:i}=e,[o,l]=(0,d.Z)(),p=e=>o.map((e=>e.name)).includes(e),h=(0,m.F)(i),g=p("Jetpack"),v=p("Jetpack Social"),f="jetpack_social_advanced"===h||"jetpack_social_basic"===h;return l?u().createElement(r.Button,{className:"jp-license-activation-screen-success-info--button"},u().createElement(n.Z,null)):f&&(g||v)?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")):"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.Z)("license-activation-view-my-plans",{site:s})},__("View my plans","jetpack-my-jetpack"))};p.propTypes={siteAdminUrl:o().string.isRequired,currentRecommendationsStep:o().string,siteRawUrl:o().string.isRequired}},4172:(e,t,a)=>{"use strict";a.d(t,{o:()=>d});var n=a(6895),c=a(5609),r=a(5736),s=a(3059),i=a.n(s),o=a(9196),l=a.n(o),u=a(9430);const __=r.__,d=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 scan results","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-scan"},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.F)(t)];return l().createElement(l().Fragment,null,r&&l().createElement(c.ExternalLink,{className:"jp-license-activation-screen-success-info--external-link",href:(0,n.Z)(r.redirectSource,{site:a})},r.text))};d.propTypes={siteRawUrl:i().string,productId:i().number}},468:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(6975),c=a(4743),r=a(9307),s=a(5736),i=a(3059),o=a.n(i),l=a(9196),u=a.n(l),d=a(8728),m=a(8781),p=a(7554),h=a(9644),g=a(8702),v=a(1160);const __=s.__,f=e=>{const{availableLicenses:t=[],currentRecommendationsStep:a,fetchingAvailableLicenses:s=!1,onActivationSuccess:i=(()=>null),siteAdminUrl:o,siteRawUrl:f,startingLicense:w,displayName:k=""}=e,[E,y]=(0,l.useState)(w??""),[b,_]=(0,l.useState)(null),[j,C]=(0,l.useState)(!1),[N,R]=(0,l.useState)(null);(0,l.useEffect)((()=>{t&&t[0]&&y(t[0].license_key)}),[t]);const Z=(0,l.useCallback)((()=>j?Promise.resolve():E.length<1?(_(__("This is not a valid license key. Please try again.","jetpack-my-jetpack")),Promise.resolve()):(_(null),C(!0),n.Z.tracks.recordJetpackClick({target:"license_activation_button"}),c.ZP.attachLicenses([E]).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);R(t),i(t),n.Z.tracks.recordEvent("jetpack_wpa_license_activation_success")})).catch((e=>{n.Z.tracks.recordEvent("jetpack_wpa_license_activation_error");"invalid_permission_manage_user_licenses"===e.response?.code?_((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"})})):_(e.message)})).finally((()=>{C(!1)})))),[j,E,i]);return null!==N&&E.startsWith("jetpack-golden-token")?u().createElement(h.Z,{tokenRedeemed:!0,displayName:k}):null!==N?u().createElement("div",{className:"jp-license-activation-screen"},u().createElement(p.Z,{siteRawUrl:f,productId:N,siteAdminUrl:o,currentRecommendationsStep:a}),u().createElement(m.Z,{imageUrl:v,showSupportLink:!1})):u().createElement("div",{className:"jp-license-activation-screen"},u().createElement(d.Z,{availableLicenses:t,activateLicense:Z,fetchingAvailableLicenses:s,isActivating:j,license:E,licenseError:b,onLicenseChange:y,siteUrl:f}),u().createElement(m.Z,{imageUrl:g,showSupportLink:!0}))};f.propTypes={availableLicenses:o().array,currentRecommendationsStep:o().string,fetchingAvailableLicenses:o().bool,onActivationSuccess:o().func,siteAdminUrl:o().string.isRequired,siteRawUrl:o().string.isRequired,startingLicense:o().string,displayName:o().string};const w=f},9644:(e,t,a)=>{"use strict";a.d(t,{Z:()=>k});var n=a(3396),c=a(3363),r=a(3846),s=a(8868),i=a(526),o=a(5609),l=a(5736),u=a(5235),d=a.n(u),m=a(3059),p=a.n(m),h=a(9196),g=a.n(h),v=a(1008);const __=l.__,_x=l._x,f=e=>{document.referrer.includes(window.location.host)?(e.preventDefault(),history.back()):(e.preventDefault(),window.location.href=window?.myJetpackInitialState?.myJetpackUrl)};function w({redeemClick:e,displayName:t,onModalClose:a=f,tokenRedeemed:u=!1}){const[m,p]=(0,h.useState)(!1),w=(0,h.useRef)(null);(0,h.useEffect)((()=>{setTimeout((()=>{w?.current?.play()}),500)}),[w]);const k=(0,n.VS)("scan"),E=(0,n.VS)("backup"),y=(0,h.useCallback)((t=>{e?.(t),p(!0),w.current.play()}),[w,e]),b=(0,h.useCallback)((()=>{m&&w.current.play()}),[m]),_=d()(v.Z.modal,{[v.Z.animating]:m});return g().createElement("div",null,g().createElement(o.Modal,{className:_,onRequestClose:a,isDismissible:!1,__experimentalHideHeader:!0},g().createElement(c.Z,{horizontalSpacing:3,horizontalGap:3},g().createElement(r.Z,null,g().createElement(s.Z,{className:v.Z["jetpack-logo"]}),g().createElement("div",{className:v.Z["video-wrap"],onClick:b,role:"presentation"},g().createElement("video",{ref:w,src:"https://videos.files.wordpress.com/oSlNIBQO/jetpack-golden-token.mp4",muted:"muted"})),g().createElement("div",{className:v.Z["content-wrap"]},g().createElement("div",{className:v.Z["content-wrap-text"]},t.length>0&&g().createElement("p",{className:v.Z["hi-user"]},(0,l.sprintf)(/* Translators: %s is the user's display name. */ -__("Hey, %s","jetpack-my-jetpack"),t)),g().createElement("h2",{className:v.Z.headline},__("You have been gifted a Jetpack Golden Token.","jetpack-my-jetpack")),g().createElement("p",null,u&&__("This unlocked a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience is already active.","jetpack-my-jetpack"),!u&&__("This unlocks a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience awaits.","jetpack-my-jetpack"))),g().createElement(i.Z,{variant:"primary",weight:"regular",onClick:y,className:v.Z.button},u&&__("Awesome!","jetpack-my-jetpack"),!u&&__("Redeem your token","jetpack-my-jetpack"))),g().createElement("div",{className:`${v.Z["powers-wrap"]} ${v.Z["content-wrap"]}`},g().createElement("div",{className:v.Z["content-wrap-text"]},g().createElement("h2",{className:v.Z.headline},__("Super powers are ready!","jetpack-my-jetpack")),g().createElement("p",{className:v.Z.paragraph},__("Your Jetpack Golden Token provides a lifetime license for this website and includes the following products:","jetpack-my-jetpack"))),g().createElement("div",{className:v.Z["jetpack-products"]},g().createElement("div",null,g().createElement(E,null),g().createElement("h3",null,__("VaultPress Backup","jetpack-my-jetpack")),g().createElement("p",null,__("Save every change and get back online quickly with one‑click restores.","jetpack-my-jetpack"))),g().createElement("div",null,g().createElement(k,null),g().createElement("h3",null,_x("Scan","Plugin name (noun).","jetpack-my-jetpack")),g().createElement("p",null,__("Automated scanning and one‑click fixes to keep your site ahead of security threats.","jetpack-my-jetpack")))),g().createElement(i.Z,{variant:"primary",weight:"regular",onClick:y,href:window?.myJetpackInitialState?.myJetpackUrl,className:v.Z.button},__("Explore your new powers","jetpack-my-jetpack")))))))}w.propTypes={redeemClick:p().func,tokenRedeemed:p().bool,displayName:p().string,onModalClose:p().func};const k=w},3281:(e,t,a)=>{"use strict";a.d(t,{H:()=>c.Z,I:()=>n.Z});var n=a(468),c=a(9644)},4311:(e,t,a)=>{"use strict";a(9906),a(838)},838:(e,t,a)=>{"use strict"},9906:(e,t,a)=>{"use strict";a(2674);var n=a(5844),c=a.n(n);a(9196),a(838);c().string.isRequired,c().number,c().func,c().string},1899:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(9105),c=a(3363),r=a(3846),s=a(1294),i=a(3281),o=a(9196),l=a.n(o),u=a(5544),d=a(6178),m=a(1838),p=a(4848),h=a(5626);function g(){const{recordEvent:e}=(0,p.Z)(),{data:t=[],isLoading:a}=(0,d.Z)({name:u.nF,queryFn:async e=>(await e.getUserLicenses())?.items}),{userConnectionData:g}=(0,s.Z)(),[v,f]=(0,o.useState)(!1),w=g?.currentUser?.wpcomUser?.display_name||g?.currentUser?.wpcomUser?.login||g?.currentUser?.username,k=(0,o.useCallback)((()=>{e("jetpack_myjetpack_license_activation_back_link_click")}),[e]),E=(0,o.useCallback)((()=>{f(!0)}),[]),y=(0,o.useMemo)((()=>t.filter((({attached_at:e,revoked_at:t})=>null===e&&null===t))),[t]),{siteSuffix:b="",adminUrl:_=""}=(0,m.$9)();return l().createElement(n.Z,{showHeader:!1,showBackground:!1},l().createElement(c.Z,{horizontalSpacing:3,horizontalGap:3},l().createElement(r.Z,null,l().createElement(h.Z,{onClick:k,reload:v})),l().createElement(r.Z,null,l().createElement(i.I,{currentRecommendationsStep:null,availableLicenses:y,fetchingAvailableLicenses:a,onActivationSuccess:E,siteAdminUrl:_,siteRawUrl:b,displayName:w}))))}},1062:(e,t,a)=>{"use strict";a.d(t,{U:()=>d,Z:()=>p});var n=a(5106),c=a(5235),r=a.n(c),s=a(5844),i=a.n(s),o=a(9196),l=a.n(o),u=a(5893);const d=e=>{const{children:t,className:a}=e,n=r()(u.Z.container,a);return l().createElement("div",{className:n},t)},m=e=>{const{title:t,headerRightContent:a,className:c,children:r}=e;return l().createElement(d,{className:c},l().createElement("div",{className:u.Z.title},l().createElement("div",{className:u.Z.name},l().createElement(n.ZP,{variant:"title-medium"},t)),a),r)};m.propTypes={children:i().node,title:i().string.isRequired,className:i().string,headerRightContent:i().node};const p=m},3890:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(1074),c=a(9517),r=a(5235),s=a.n(r),i=a(9196),o=a.n(i),l=a(9997),u=a(6234);const d=({className:e,accessibleName:t})=>o().createElement(l.rU,{to:"/",className:s()(u.Z.link,e),"aria-label":t||null},o().createElement(n.Z,{icon:c.Z,className:u.Z.icon}))},5745:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(5106),c=a(1294),r=a(5844),s=a.n(r),i=a(9196),o=a(8209),l=a(7363),u=a(5595),d=a(4598),m=a(7555),p=a(2728);const h=({admin:e,slug:t,children:a,isDataLoading:r,Description:s=null,additionalActions:h=null,secondaryAction:g=null,upgradeInInterstitial:v=!1,primaryActionOverride:f})=>{const{isRegistered:w,isUserConnected:k}=(0,c.Z)(),{install:E,isPending:y}=(0,u.Z)(t),{activate:b,isPending:_}=(0,l.Z)(t),{detail:j}=(0,d.Z)(t),{name:C,description:N,requiresUserConnection:R,status:Z}=j,x=(0,m.Z)(o.xB.Connection),z=(0,i.useCallback)((()=>{w&&k||!R?b():x()}),[b,w,k,R,x]);return React.createElement(p.ZP,{name:C,Description:s||(()=>{const e=N.replace(/\s(?=[^\s]*$)/," ");return React.createElement(n.ZP,{variant:"body-small",style:{flexGrow:1}},e)}),status:Z,admin:e,isFetching:_||y,isDataLoading:r,isInstallingStandalone:y,additionalActions:h,primaryActionOverride:f,secondaryAction:g,slug:t,onActivate:z,onInstallStandalone:E,onActivateStandalone:E,upgradeInInterstitial:v},a)};h.propTypes={children:s().node,admin:s().bool.isRequired,slug:s().string.isRequired,isDataLoading:s().bool,additionalActions:s().array,primaryActionOverride:s().object,secondaryAction:s().object};const g=h},489:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(2674),c=a.n(n),r=a(6895),s=a(6183),i=a(5609),o=a(5736),l=a(1074),u=a(5381),d=a(6790),m=a(8578);const __=o.__,p=e=>{const{title:t}=e;return React.createElement(s.Z,c()({buttonLabel:__("Connect your user account","jetpack-my-jetpack"),loadingLabel:__("Connecting your account…","jetpack-my-jetpack"),images:[d],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.Z)("jetpack-features"),target:"_blank",className:m.Z["all-features"],rel:"noreferrer"},__("See all Jetpack features","jetpack-my-jetpack"),React.createElement(l.Z,{icon:u.Z}),React.createElement(i.VisuallyHidden,{as:"span"},/* translators: accessibility text */ -__("(opens in a new tab)","jetpack-my-jetpack"))))))}},3256:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(5242),r=a(184),s=a(8578),i=a(4403);const __=n.__,o=()=>React.createElement(React.Fragment,null,React.createElement("div",{className:s.Z["account-description"]},__("You can use your existing account on any of these services:","jetpack-my-jetpack")),React.createElement("ul",{className:s.Z["account-images"],role:"list"},React.createElement("li",null,React.createElement("img",{src:i,className:s.Z.wordpress,alt:"WordPress.com"})),React.createElement("li",null,React.createElement("img",{src:r,className:s.Z.google,alt:"Google"})),React.createElement("li",null,React.createElement("img",{src:c,className:s.Z.apple,alt:"Apple"}))))},6317:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(9105),c=a(3363),r=a(3846),s=a(5736),i=a(5162),o=a(1607),l=a(3890),u=a(489),d=a(3256),m=a(8578);const __=s.__,p=()=>{const e=(0,o.Z)(),{apiRoot:t,apiNonce:a,registrationNonce:s}=(0,i.Z)();return React.createElement(n.Z,{showHeader:!1,showBackground:!1},React.createElement(c.Z,{horizontalSpacing:8,horizontalGap:0},React.createElement(r.Z,{className:m.Z["relative-col"]},React.createElement(l.Z,{className:m.Z["close-link"],accessibleName:__("Go back to previous screen","jetpack-my-jetpack")})),React.createElement(r.Z,null,React.createElement(u.Z,{from:"my-jetpack",redirectUri:e,apiRoot:t,apiNonce:a,registrationNonce:s,footer:React.createElement(d.Z,null)}))))}},247:(e,t,a)=>{"use strict";a.d(t,{Z:()=>R});var n=a(5106),c=a(526),r=a(6895),s=a(1294),i=a(428),o=a(8137),l=a(9818),u=a(5736),d=a(1074),m=a(496),p=a(9201),h=a(5235),g=a.n(h),v=a(5844),f=a.n(v),w=a(9196),k=a.n(w),E=a(4848),y=a(5050),b=a(3815),_=a(9182),j=a(6322);const __=u.__,C=({text:e,actionText:t,onClick:a,status:r})=>k().createElement("div",{className:j.Z["list-item"]},k().createElement(n.ZP,{className:g()(j.Z["list-item-text"],{[j.Z.error]:"error"===r})},k().createElement(d.Z,{icon:"error"===r?m.Z:p.Z,className:g()({[j.Z.info]:"error"===r})}),e),t&&k().createElement(c.Z,{variant:"link",weight:"regular",onClick:a},t)),N=e=>{const{apiRoot:t,apiNonce:a,redirectUri:d=null,title:m=__("Connection","jetpack-my-jetpack"),connectionInfoText:p=__("Jetpack connects your site and user account to the WordPress.com cloud to provide more powerful features.","jetpack-my-jetpack"),onDisconnected:h,connectedPlugins:v,connectedSiteId:f,context:N,onConnectUser:R=null}=e,{isRegistered:Z,isUserConnected:x,userConnectionData:z}=(0,s.Z)({apiRoot:t,apiNonce:a,redirectUri:d}),{recordEvent:S}=(0,E.Z)(),[M,L]=(0,w.useState)(!1),{setConnectionStatus:P,setUserIsConnecting:A}=(0,l.useDispatch)(i.t),V=R||A,H=z.currentUser?.wpcomUser?.avatar,O=(0,w.useMemo)((()=>({isUserConnected:x,isRegistered:Z})),[x,Z]),I=(0,w.useCallback)((e=>t=>{t&&t.preventDefault(),S("jetpack_myjetpack_connection_manage_dialog_click",{...O,connectionType:e}),L(!0)}),[S,L,O]),B=I("user"),T=I("site"),U=(0,w.useCallback)((e=>{e&&e.preventDefault(),L(!1)}),[L]),F=(0,w.useCallback)((e=>{e&&e.preventDefault(),P({isActive:!1,isRegistered:!1,isUserConnected:!1}),h?.()}),[h,P]),D=(0,w.useCallback)((()=>{S("jetpack_myjetpack_connection_learnmore_link_click",O)}),[S,O]),q=(0,w.useCallback)((e=>{e&&e.preventDefault(),S("jetpack_myjetpack_connection_connect_user_click",O),V()}),[V,S,O]);return k().createElement("div",{className:j.Z["connection-status-card"]},k().createElement(n.H3,null,m),k().createElement(n.ZP,{variant:"body",mb:3},`${p} `,k().createElement(c.Z,{href:(0,r.Z)("why-the-wordpress-com-connection-is-important-for-jetpack"),variant:"link",weight:"regular",isExternalLink:!0,onClick:D},__("Learn more about connections","jetpack-my-jetpack"))),k().createElement("div",{className:j.Z.status},k().createElement("img",{src:y,alt:"",className:j.Z.cloud}),k().createElement("div",{className:g()(j.Z.line,{[j.Z.disconnected]:!Z||!x})}),k().createElement("div",{className:j.Z["avatar-wrapper"]},k().createElement("img",{src:_,alt:"",className:j.Z.jetpack}),k().createElement("img",{src:x&&H?H:b,alt:"",className:j.Z.avatar}))),k().createElement("div",null,Z?k().createElement(k().Fragment,null,k().createElement(C,{onClick:T,text:__("Site connected.","jetpack-my-jetpack"),actionText:x&&z.currentUser?.isMaster?__("Manage","jetpack-my-jetpack"):null}),x&&k().createElement(C,{onClick:B,actionText:__("Manage","jetpack-my-jetpack"),text:(0,u.sprintf)(/* translators: first placeholder is user name, second is either the (Owner) string or an empty string */ -__("Connected as %1$s%2$s.","jetpack-my-jetpack"),z.currentUser?.wpcomUser?.display_name,z.currentUser?.isMaster?__(" (Owner)","jetpack-my-jetpack"):"")}),x&&z?.connectionOwner&&!z.currentUser?.isMaster&&k().createElement(C,{text:(0,u.sprintf)(/* translators: placeholder is the username of the Jetpack connection owner */ -__("Also connected: %s (Owner).","jetpack-my-jetpack"),z.connectionOwner)}),!x&&k().createElement(C,{onClick:q,text:__("User account not connected.","jetpack-my-jetpack"),actionText:__("Connect","jetpack-my-jetpack"),status:"error"})):k().createElement(C,{onClick:q,text:__("Jetpack is not connected.","jetpack-my-jetpack"),actionText:__("Connect","jetpack-my-jetpack"),status:"error"})),k().createElement(o.Z,{apiRoot:t,apiNonce:a,onDisconnected:F,connectedPlugins:v,connectedSiteId:f,connectedUser:z,isOpen:M,onClose:U,context:N}))};N.propTypes={apiRoot:f().string.isRequired,apiNonce:f().string.isRequired,redirectUri:f().string,connectedPlugins:f().array,connectedSiteId:f().number,title:f().string,connectionInfoText:f().string,onDisconnected:f().func,context:f().string,onConnectUser:f().func,requiresUserConnection:f().bool};const R=N},5784:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(8209),c=a(4598),r=a(1950),s=a(5162),i=a(7555),o=a(247);function l(){const{apiRoot:e,apiNonce:t,topJetpackMenuItemUrl:a,connectedPlugins:l}=(0,s.Z)(),u=(0,i.Z)(n.xB.Connection),d=(0,c.B)(),m=(0,r.Z)(d);return React.createElement(o.Z,{apiRoot:e,apiNonce:t,redirectUri:a,onConnectUser:u,connectedPlugins:l,requiresUserConnection:m.length>0,onDisconnected:()=>document?.location?.reload(!0)})}},5626:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(5736),c=a(1074),r=a(3259),s=a(9196),i=a.n(s),o=a(9997),l=a(197);const __=n.__;const u=function({onClick:e=(()=>{}),reload:t}){const a=t?"/?reload=true":"/";return i().createElement(o.rU,{to:a,className:l.Z.link,onClick:e},i().createElement(c.Z,{icon:r.Z,className:l.Z.icon}),__("Go back","jetpack-my-jetpack"))}},8607:(e,t,a)=>{"use strict";a.d(t,{r:()=>m});var n=a(526),c=a(3396),r=a(5609),s=a(9771),i=a(5736),o=a(5235),l=a.n(o),u=a(9196),d=a(4416);a(1854);const __=i.__;function m({productName:e,giftedDate:t}){const[a,o]=(0,u.useState)(!1),m=(0,u.useCallback)((()=>o(!0)),[o]),p={position:"top center",placement:"top",animate:!0,noArrow:!1,resize:!1,flip:!1,offset:6,focusOnMount:"container",onClose:(0,u.useCallback)((()=>o(!1)),[o]),className:d.Z.container},h=l()(d.Z.wrapper,"golden-token-icon-tooltip");return React.createElement("div",{className:h},React.createElement(n.Z,{variant:"link",onClick:m},React.createElement(c._1,{className:d.Z.logo})),React.createElement("div",{className:d.Z.helper},a&&React.createElement(r.Popover,p,React.createElement("div",null,React.createElement("div",{className:d.Z.title},e),React.createElement("div",{className:d.Z.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)))))))}},4159:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5609),c=a(9196),r=a.n(c),s=a(73);const i=function(){const[e,t]=(0,c.useState)(!0),a=(0,c.useCallback)((()=>t(!1)),[]);if(!e)return null;if(!window.hasOwnProperty("JP_IDENTITY_CRISIS__INITIAL_STATE"))return null;const{containerID:i,isSafeModeConfirmed:o}=window.JP_IDENTITY_CRISIS__INITIAL_STATE;return!i||o?null:r().createElement(n.Modal,{onRequestClose:a,overlayClassName:s.Z.modal},r().createElement("div",{id:i,className:s.Z.container}))}},642:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(4706),c=a(6895),r=a(5736),s=a(9196),i=a.n(s),o=a(4848),l=a(4730);const __=r.__,u=e=>{const{isAgencyAccount:t=!1}=e,{recordEvent:a}=(0,o.Z)();(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.Z,{icon:l,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:__("Register your interest","jetpack-my-jetpack"),primaryCtaURL:(0,c.Z)("jetpack-for-agencies-register-interest"),primaryCtaIsExternalLink:!0,primaryCtaOnClick:u})}},8966:(e,t,a)=>{"use strict";a.d(t,{Z:()=>H});var n=a(2674),c=a.n(n),r=a(2054),s=a(7121),i=a(1342),o=a(9105),l=a(216),u=a(3363),d=a(3846),m=a(5106),p=a(6579),h=a(4164),g=a(5736),v=a(5235),f=a.n(v),w=a(9196),k=a(8437),E=a(5544),y=a(4598),b=a(7108),_=a(1838),j=a(8059),C=a(4848),N=a(8064),R=a(5784),Z=a(4159),x=a(642),z=a(6800),S=a(2307),M=a(5943),L=a(9593),P=a(3851),A=a(1017);const __=g.__,V=({message:e,title:t,options:a})=>{const{recordEvent:n}=(0,C.Z)();(0,w.useEffect)((()=>{n("jetpack_myjetpack_global_notice_view",{noticeId:a.id})}),[a.id,n]);const[o]=(0,r.Z)(["md"],[">"]),l=a.actions?.map((e=>React.createElement(s.Z,c()({customClass:A.Z.cta},e))));return React.createElement("div",{className:f()(A.Z.notice,{[A.Z["bigger-than-medium"]]:o})},React.createElement(i.Z,c()({hideCloseButton:!0},a,{title:t,actions:l}),React.createElement("div",{className:A.Z.message},e)))};function H(){(0,N.Z)();const{redBubbleAlerts:e}=(0,_.$9)(),{showFullJetpackStatsCard:t=!1}=(0,_.$9)("myJetpackFlags"),{jetpackManage:a={},adminUrl:n}=(0,_.$9)(),{isWelcomeBannerVisible:c}=(0,j.Z)(),{currentNotice:r}=(0,w.useContext)(k.T),{message:s,title:i,options:g}=r||{},{data:v,isLoading:H}=(0,b.Z)({name:E.gb,query:{path:E.Hq}}),{detail:O}=(0,y.Z)("stats"),{data:I,isLoading:B}=(0,b.Z)({name:E.kl,query:{path:E.xD}}),T=v?.is_available,U=I?.user?.jwt,F=!B&&!H&&T&&U,D="1"===(0,_.$9)("userIsNewToJetpack"),{recordEvent:q}=(0,C.Z)(),[J,G]=(0,w.useState)(!1);return(0,w.useLayoutEffect)((()=>{q("jetpack_myjetpack_page_view",{red_bubble_alerts:Object.keys(e).join(",")})}),[q,e]),window.location.hash.includes("?reload=true")&&(window.history.replaceState(null,"",window.location.href.replace("?reload=true","")),window.location.reload(),G(!0)),J?null:React.createElement(o.Z,{siteAdminUrl:n},React.createElement(Z.Z,null),React.createElement(l.Z,null,!D&&React.createElement(u.Z,{horizontalSpacing:0},React.createElement(d.Z,null,React.createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),React.createElement(P.Z,null),React.createElement(u.Z,{horizontalSpacing:5,horizontalGap:s?3:6},React.createElement(d.Z,{sm:4,md:8,lg:12},React.createElement(m.ZP,{variant:"headline-small"},__("Discover all Jetpack Products","jetpack-my-jetpack"))),s&&!c&&React.createElement(d.Z,null,React.createElement(V,{message:s,title:i,options:g})),t&&React.createElement(d.Z,{className:f()({[A.Z.stats]:O?.status!==S.N.ERROR})},React.createElement(L.Z,null)),React.createElement(d.Z,null,React.createElement(M.Z,null)),a.isEnabled&&React.createElement(d.Z,null,React.createElement(x.Z,{isAgencyAccount:a.isAgencyAccount})))),React.createElement(p.Z,null,React.createElement(u.Z,{horizontalSpacing:8},React.createElement(d.Z,{sm:4,md:4,lg:6},React.createElement(z.Z,null)),React.createElement(d.Z,{sm:4,md:4,lg:6},React.createElement(R.Z,null)))),F&&React.createElement(h.Z,{jwt_token:U}))}},6800:(e,t,a)=>{"use strict";a.d(t,{Z:()=>_});var n=a(5106),c=a(526),r=a(5736),s=a(9196),i=a(8209),o=a(5544),l=a(7108),u=a(1838),d=a(4848),m=a(5162),p=a(7555),h=a(6864),g=a(7356),v=a(7111),f=a(8607),w=a(6891);const __=r.__,_n=r._n;function k({purchase:e={}}){const{product_name:t}=e;return React.createElement(React.Fragment,null,React.createElement(n.Dx,null,t),React.createElement(E,e))}function E(e){const{expiry_message:t,product_name:a,subscribed_date:c}=e;return(0,v.h)(e)?React.createElement(n.ZP,{variant:"body",className:w.Z["expire-date"]},React.createElement("span",{className:w.Z["expire-date--with-icon"]},__("Never Expires","jetpack-my-jetpack")),React.createElement(f.r,{productName:a,giftedDate:c})):React.createElement(n.ZP,{variant:"body",className:w.Z["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.ZP,{variant:"body"},__("Want to power up your Jetpack?","jetpack-my-jetpack")))}function b({numberOfPurchases:e}){const{recordEvent:t}=(0,d.Z)(),{isUserConnected:a}=(0,m.Z)();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]),o=(0,p.Z)(i.xB.Connection),l=(0,s.useCallback)((()=>{t("jetpack_myjetpack_activate_license_click"),a||o()}),[o,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:k=""}=(0,u.$9)();return React.createElement("ul",null,React.createElement("li",{className:w.Z["actions-list-item"]},React.createElement(c.Z,{onClick:r,href:e?(0,h.Z)():(0,g.Z)(),weight:"regular",variant:"link",isExternalLink:!0},n)),f&&React.createElement("li",{className:w.Z["actions-list-item"]},React.createElement(c.Z,{onClick:l,href:a?`${k}admin.php?page=my-jetpack#/add-license`:void 0,variant:"link",weight:"regular"},v)))}function _(){const e=!!(0,u.$9)("userIsAdmin"),{data:t,isLoading:a,isError:n}=(0,l.Z)({name:o.h3,query:{path:o.LQ}}),c=t&&!a&&!n,r=c?t.length:0;return React.createElement("div",{className:w.Z.container},React.createElement(y,{numberOfPurchases:r}),React.createElement("div",{className:w.Z.purchasesSection},c&&t.map((e=>React.createElement(k,{key:`purchase-${e.product_name}`,purchase:e})))),e&&React.createElement(b,{numberOfPurchases:r}))}},2307:(e,t,a)=>{"use strict";a.d(t,{N:()=>w,Z:()=>k});var n=a(2674),c=a.n(n),r=a(526),s=a(5736),i=a(1074),o=a(5381),l=a(9201),u=a(2229),d=a(5235),m=a.n(d),p=a(9196),h=a(4598),g=a(4848),v=a(938),f=a(9720);const __=s.__,w={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_PURCHASE:"needs_purchase",NEEDS_PURCHASE_OR_FREE:"needs_purchase_or_free",NEEDS_FIRST_SITE_CONNECTION:"needs_first_site_connection",USER_CONNECTION_ERROR:"user_connection_error",CAN_UPGRADE:"can_upgrade"},k=({status:e,admin:t,name:a,slug:n,onActivate:d,additionalActions:k,primaryActionOverride:E,onManage:y,onFixConnection:b,isFetching:_,isInstallingStandalone:j,className:C,onAdd:N,onInstall:R,onLearnMore:Z,upgradeInInterstitial:x})=>{const[z,S]=(0,p.useState)(!1),[M,L]=(0,p.useState)({}),{detail:P}=(0,h.Z)(n),{manageUrl:A,purchaseUrl:V}=P,H=!A,O=(0,p.useRef)(null),I=(0,p.useRef)(null),{recordEvent:B}=(0,g.Z)(),T=_||j,U=k?.length>0,F=(0,p.useMemo)((()=>({variant:T?void 0:"primary",disabled:T,className:C})),[T,C]),D=(0,p.useCallback)((()=>{switch(e){case w.ABSENT:{const e=__("Learn more","jetpack-my-jetpack");return{...F,href:`#/add-${n}`,size:"small",variant:"primary",weight:"regular",label:e,onClick:Z,...E&&w.ABSENT in E&&E[w.ABSENT]}}case w.ABSENT_WITH_PLAN:{const e=__("Install Plugin","jetpack-my-jetpack");return{...F,href:"",size:"small",variant:"primary",weight:"regular",label:e,onClick:R,...E&&w.ABSENT_WITH_PLAN in E&&E[w.ABSENT_WITH_PLAN]}}case w.NEEDS_FIRST_SITE_CONNECTION:return{...F,href:V||`#/add-${n}`,size:"small",variant:"primary",weight:"regular",label:__("Learn more","jetpack-my-jetpack"),onClick:N,...E&&w.NEEDS_FIRST_SITE_CONNECTION in E&&E[w.NEEDS_FIRST_SITE_CONNECTION]};case w.NEEDS_PURCHASE:return{...F,href:V||`#/add-${n}`,size:"small",variant:"primary",weight:"regular",label:__("Learn more","jetpack-my-jetpack"),onClick:N,...E&&w.NEEDS_PURCHASE in E&&E[w.NEEDS_PURCHASE]};case w.CAN_UPGRADE:{const e=__("Upgrade","jetpack-my-jetpack"),t=__("Learn more","jetpack-my-jetpack"),a=V||x?e:t;return{...F,href:V||`#/add-${n}`,size:"small",variant:"primary",weight:"regular",label:a,onClick:N,...E&&w.CAN_UPGRADE in E&&E[w.CAN_UPGRADE]}}case w.NEEDS_PURCHASE_OR_FREE:return{...F,href:`#/add-${n}`,size:"small",variant:"primary",weight:"regular",label:__("Learn more","jetpack-my-jetpack"),onClick:N,...E&&w.NEEDS_PURCHASE_OR_FREE in E&&E[w.NEEDS_PURCHASE_OR_FREE]};case w.ACTIVE:{const e=__("View","jetpack-my-jetpack");return{...F,disabled:H||F?.disabled,href:A,size:"small",variant:"secondary",weight:"regular",label:e,onClick:y,...E&&w.ACTIVE in E&&E[w.ACTIVE]}}case w.SITE_CONNECTION_ERROR:return{...F,href:"#/connection",size:"small",variant:"primary",weight:"regular",label:__("Fix connection","jetpack-my-jetpack"),onClick:b,...E&&w.ERROR in E&&E[w.ERROR]};case w.USER_CONNECTION_ERROR:return{href:"#/connection",size:"small",variant:"primary",weight:"regular",label:__("Connect","jetpack-my-jetpack"),onClick:b,...E&&w.USER_CONNECTION_ERROR in E&&E[w.USER_CONNECTION_ERROR]};case w.INACTIVE:case w.MODULE_DISABLED:return{...F,href:"",size:"small",variant:"secondary",weight:"regular",label:__("Activate","jetpack-my-jetpack"),onClick:d,...E&&w.INACTIVE in E&&E[w.INACTIVE]};default:return null}}),[e,F,n,N,b,d,R,Z,V,x,H,A,y,E]),q=(0,p.useMemo)((()=>U?[...k,D()]:[D()]),[k,D,U]),J=(0,p.useCallback)((()=>{B("jetpack_myjetpack_product_card_dropdown_toggle",{product:n,state:z?"closed":"open"})}),[z,B,n]),G=(0,p.useCallback)((()=>{S(!z),J()}),[z,J]);if((0,p.useEffect)((()=>{L(q[0])}),[q]),(0,v.Z)(O,(e=>{I.current.contains(e.target)||(S(!1),J())})),!t)return React.createElement(r.Z,c()({},F,{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 W=U&&React.createElement("div",{ref:O,className:f.Z["action-button-dropdown"]},React.createElement("ul",{className:f.Z["dropdown-menu"]},[...k,D()].map((({label:e,isExternalLink:t},a)=>React.createElement("li",{key:a},React.createElement("button",{onClick:()=>{L(q[a]),S(!1),B("jetpack_myjetpack_product_card_dropdown_action_click",{product:n,action:e})},className:f.Z["dropdown-item"]},React.createElement("div",{className:f.Z["dropdown-item-label"]},e,t&&React.createElement(i.Z,{icon:o.Z,size:16})),e===M.label&&React.createElement("div",{className:f.Z["active-action-checkmark"]},React.createElement(i.Z,{icon:l.Z,size:24,fill:"white"}))))))));return React.createElement(React.Fragment,null,React.createElement("div",{className:m()(f.Z["action-button"],U?f.Z["has-additional-actions"]:null)},React.createElement(r.Z,c()({},F,M),M.label),U&&React.createElement("button",{className:m()(f.Z["dropdown-chevron"],"primary"===M.variant?f.Z.primary:f.Z.secondary),onClick:G,ref:I},React.createElement(i.Z,{icon:u.Z,size:24,fill:"primary"===M.variant?"white":"black"})),z&&W))}},2728:(e,t,a)=>{"use strict";a.d(t,{ZP:()=>E,bY:()=>f});var n=a(2674),c=a.n(n),r=a(526),s=a(5736),i=a(5235),o=a.n(i),l=a(5844),u=a.n(l),d=a(9196),m=a(4848),p=a(1062),h=a(2307),g=a(6086),v=a(9720);const __=s.__,f={[h.N.ACTIVE]:__("Active","jetpack-my-jetpack"),[h.N.INACTIVE]:__("Inactive","jetpack-my-jetpack"),[h.N.MODULE_DISABLED]:__("Inactive","jetpack-my-jetpack"),[h.N.NEEDS_PURCHASE]:__("Inactive","jetpack-my-jetpack"),[h.N.NEEDS_PURCHASE_OR_FREE]:__("Inactive","jetpack-my-jetpack"),[h.N.ABSENT]:__("Inactive","jetpack-my-jetpack"),[h.N.ABSENT_WITH_PLAN]:__("Needs Plugin","jetpack-my-jetpack"),[h.N.NEEDS_FIRST_SITE_CONNECTION]:__("Inactive","jetpack-my-jetpack"),[h.N.USER_CONNECTION_ERROR]:__("Needs user account","jetpack-my-jetpack"),[h.N.SITE_CONNECTION_ERROR]:__("Needs connection","jetpack-my-jetpack"),[h.N.CAN_UPGRADE]:__("Active","jetpack-my-jetpack")},w=e=>{const{shouldShowButton:t=(()=>!0),positionFirst:a,...n}={size:"small",variant:"secondary",weight:"regular",label:__("Learn more","jetpack-my-jetpack"),...e};return!!t()&&React.createElement(r.Z,n,n.label)};w.propTypes={href:u().string,size:u().oneOf(["normal","small"]),variant:u().oneOf(["primary","secondary","link","tertiary"]),weight:u().oneOf(["bold","regular"]),label:u().string,shouldShowButton:u().func,onClick:u().func,positionFirst:u().bool,isExternalLink:u().bool,icon:u().node,iconSize:u().number,disabled:u().bool,isLoading:u().bool,className:u().string};const k=e=>{const t={isFetching:!1,isInstallingStandalone:!1,onActivate:()=>{},...e},{name:a,Description:n,status:r,onActivate:s,isFetching:i,isDataLoading:l,isInstallingStandalone:u,slug:f,additionalActions:k,primaryActionOverride:E,secondaryAction:y,children:b,onInstallStandalone:_,onActivateStandalone:j}=t,C=r===h.N.ERROR,N=r===h.N.ABSENT||r===h.N.ABSENT_WITH_PLAN,R=r===h.N.NEEDS_PURCHASE||r===h.N.NEEDS_PURCHASE_OR_FREE,Z=o()({[v.Z.plugin_absent]:N,[v.Z["is-purchase-required"]]:R,[v.Z["is-link"]]:N,[v.Z["has-error"]]:C}),{recordEvent:x}=(0,m.Z)(),z=(0,d.useCallback)((e=>{e.preventDefault(),x("jetpack_myjetpack_product_card_activate_click",{product:f}),s()}),[f,s,x]),S=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_add_click",{product:f})}),[f,x]),M=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_manage_click",{product:f})}),[f,x]),L=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_fixconnection_click",{product:f})}),[f,x]),P=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_learnmore_click",{product:f})}),[f,x]),A=(0,d.useCallback)((e=>{e.preventDefault(),x("jetpack_myjetpack_product_card_install_standalone_plugin_click",{product:f}),_()}),[f,_,x]);(0,d.useCallback)((e=>{e.preventDefault(),x("jetpack_myjetpack_product_card_activate_standalone_plugin_click",{product:f}),j()}),[f,j,x]);return(0,d.useEffect)((()=>{x("jetpack_myjetpack_product_card_loaded",{product:f,status:r})}),[x,f,r]),React.createElement(p.Z,{title:a,className:o()(v.Z.container,Z),headerRightContent:null},React.createElement(n,null),l?React.createElement("span",{className:v.Z.loading},__("Loading…","jetpack-my-jetpack")):b,React.createElement("div",{className:v.Z.actions},React.createElement("div",{className:v.Z.buttons},y&&y?.positionFirst&&React.createElement(w,y),React.createElement(h.Z,c()({},t,{onActivate:z,onFixConnection:L,onManage:M,onAdd:S,onInstall:A,onLearnMore:P,className:v.Z.button,additionalActions:k,primaryActionOverride:E})),y&&!y?.positionFirst&&React.createElement(w,y)),React.createElement(g.Z,{status:r,isFetching:i,isInstallingStandalone:u})))};k.propTypes={children:u().node,name:u().string.isRequired,Description:u().func.isRequired,admin:u().bool.isRequired,isFetching:u().bool,isInstallingStandalone:u().bool,isManageDisabled:u().bool,onActivate:u().func,slug:u().string.isRequired,additionalActions:u().array,primaryActionOverride:u().object,secondaryAction:u().object,onInstallStandalone:u().func,onActivateStandalone:u().func,status:u().oneOf([h.N.ACTIVE,h.N.INACTIVE,h.N.SITE_CONNECTION_ERROR,h.N.ABSENT,h.N.ABSENT_WITH_PLAN,h.N.NEEDS_PURCHASE,h.N.NEEDS_PURCHASE_OR_FREE,h.N.NEEDS_FIRST_SITE_CONNECTION,h.N.USER_CONNECTION_ERROR,h.N.CAN_UPGRADE,h.N.MODULE_DISABLED]).isRequired};const E=k},6086:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5106),c=a(5235),r=a.n(c),s=a(2307),i=a(9720),o=a(2728);const l=({status:e,isFetching:t,isInstallingStandalone:a})=>{const c=o.bY[e],l=r()(i.Z.status,(e=>{switch(e){case s.N.ACTIVE:case s.N.CAN_UPGRADE:return i.Z.active;case s.N.ABSENT_WITH_PLAN:case s.N.SITE_CONNECTION_ERROR:case s.N.USER_CONNECTION_ERROR:return i.Z.warning;case s.N.INACTIVE:case s.N.NEEDS_PURCHASE:case s.N.NEEDS_PURCHASE_OR_FREE:case s.N.NEEDS_FIRST_SITE_CONNECTION:default:return i.Z.inactive}})(e),{[i.Z["is-fetching"]]:t||a});return React.createElement(n.ZP,{variant:"label",className:l},c)}},8777:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(1294),c=a(5736),r=a(5844),s=a.n(r),i=a(9196),o=a(5745),l=a(2307);const __=c.__,u=({admin:e})=>{const{userConnectionData:t}=(0,n.Z)(),{currentUser:a}=t,{wpcomUser:c}=a,r=`jetpack_ai_optfree_${a?.id||0}_${a?.blogId||0}_${c?.ID||0}`,s=(0,i.useRef)(localStorage.getItem(r)),u={[l.N.CAN_UPGRADE]:{href:"#/jetpack-ai",label:__("View","jetpack-my-jetpack")},[l.N.NEEDS_PURCHASE]:{href:s.current?"#/jetpack-ai":"#/add-jetpack-ai"}};return React.createElement(o.Z,{admin:e,slug:"jetpack-ai",upgradeInInterstitial:!0,primaryActionOverride:u})};u.propTypes={admin:s().bool.isRequired};const d=u},1640:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"anti-spam"});o.propTypes={admin:c().bool.isRequired};const l=o},7427:(e,t,a)=>{"use strict";a.d(t,{Z:()=>C});var n=a(6895),c=a(5106),r=a(2947),s=a(5609),i=a(5736),o=a(5235),l=a.n(o),u=a(3079),d=a(5844),m=a.n(d),p=a(9196),h=a(5544),g=a(4598),v=a(7108),f=a(1838),w=a(4848),k=a(5745),E=a(2307),y=a(8840);const __=i.__,_n=i._n,b=({admin:e})=>{const t="backup",{detail:a}=(0,g.Z)(t),{status:n}=a;return n===E.N.ACTIVE||n===E.N.CAN_UPGRADE?React.createElement(_,{admin:e,slug:t}):React.createElement(j,{admin:e,slug:t})},_=({admin:e,slug:t})=>{const{data:a,isLoading:r}=(0,v.Z)({name:h.Kf,query:{path:h._H}}),s=a?.last_rewindable_event,o=s?.published,l=a?.undo_backup_id,{recordEvent:d}=(0,w.Z)(),{siteSuffix:m=""}=(0,f.$9)(),p={href:(0,n.Z)("jetpack-backup-undo-cta",{path:l,site:m}),size:"small",variant:"primary",weight:"regular",label:__("Undo","jetpack-my-jetpack"),onClick:()=>{d("jetpack_myjetpack_backup_card_undo_click",{product:t,undo_backup_id:l})},isExternalLink:!0};return React.createElement(k.Z,{admin:e,slug:t,showMenu:!0,isDataLoading:r,Description:s?()=>React.createElement(c.ZP,{variant:"body-small",className:y.Z.description},React.createElement("span",null,__("Activity Detected","jetpack-my-jetpack")),React.createElement("span",{className:y.Z.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,i.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,i.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,i.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,i.sprintf)( -// translators: %s is the number of seconds since the last backup -_n("%s second ago","%s seconds ago",c,"jetpack-my-jetpack"),c)}})(o))):null,additionalActions:s?[p]:[]},s?React.createElement("div",{className:y.Z.activity},React.createElement(u.Z,{icon:s.gridicon,size:24}),React.createElement("p",{className:y.Z.summary},s.summary)):null)},j=({admin:e,slug:t})=>{const[a,n]=(0,p.useState)(3),{data:c,isLoading:o}=(0,v.Z)({name:h.RQ,query:{path:h.hd}}),d=(0,p.useMemo)((()=>{const e=[];return c?(Object.keys(c).forEach((t=>{0!==c[t]&&e.push([t,c[t]])})),e.sort(((e,t)=>e[1](window.onresize=()=>{window.innerWidth>=961&&window.innerWidth<=1070||window.innerWidth<290?n(2):n(3)},()=>{window.onresize=null})),[]);const m=d.length>a?d.length-a:0,g={maximumFractionDigits:1,notation:"compact"};return React.createElement(k.Z,{admin:e,slug:t,showMenu:!0,isDataLoading:o},React.createElement("div",{className:y.Z["no-backup-stats"]},React.createElement("ul",{className:y.Z["main-stats"],role:"list"},d.map(((e,t)=>{const n=e[0].split("_")[1],c=e[1];return React.createElement("li",{className:l()(y.Z["main-stat"],`main-stat-${t}`),key:t+n},React.createElement(React.Fragment,null,t{switch(e){case"post":return React.createElement(u.Z,{icon:"posts",size:24});case"page":return React.createElement(u.Z,{icon:"pages",size:24});default:return React.createElement(u.Z,{icon:e,size:24})}})(n),React.createElement("span",null,(0,r.Z)(c,g))),React.createElement(s.VisuallyHidden,null,({comment:e=>(0,i.sprintf)( -// translators: %d is the number of comments -_n("%d comment","%d comments",e,"jetpack-my-jetpack"),e),post:e=>(0,i.sprintf)( -// translators: %d is the number of posts -_n("%d post","%d posts",e,"jetpack-my-jetpack"),e),page:e=>(0,i.sprintf)( -// translators: %d is the number of pages -_n("%d page","%d pages",e,"jetpack-my-jetpack"),e),image:e=>(0,i.sprintf)( -// translators: %d is the number of images -_n("%d image","%d images",e,"jetpack-my-jetpack"),e),video:e=>(0,i.sprintf)( -// translators: %d is the number of videos -_n("%d video","%d videos",e,"jetpack-my-jetpack"),e),audio:e=>(0,i.sprintf)( -// translators: %d is the number of files -_n("%d audio file","%d audio files",e,"jetpack-my-jetpack"),e)}[o=n]||(e=>`${e} ${o}`))(c))));var o}))),m>0&&React.createElement("span",{className:y.Z["more-stats"],"aria-hidden":"true"}, -// translators: %s is the number of items that are not shown -// translators: %s is the number of items that are not shown -(0,i.sprintf)(__("+%s more","jetpack-my-jetpack"),m))))};b.propTypes={admin:m().bool.isRequired},j.propTypes={productData:m().object};const C=b},8489:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(128),c=a(5033),r=a(4186),s=a(5609),i=a(4333),o=a(5736),l=a(1074),u=a(986),d=a(9196),m=a(4598),p=a(1838),h=a(4848),g=a(5162),v=a(2307),f=a(9578);a(1200);const __=o.__,w=()=>{const{recordEvent:e}=(0,h.Z)(),[t,a]=(0,d.useState)(!1),[o,w]=(0,d.useState)(""),[k,E]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[_,j]=(0,d.useState)(!1),[C,N]=(0,d.useState)(!1),R=(0,i.useViewportMatch)("medium","<"),{siteUrl:Z="",latestBoostSpeedScores:x}=(0,p.$9)(),{apiRoot:z,apiNonce:S,isSiteConnected:M}=(0,g.Z)(),{detail:L}=(0,m.Z)("boost"),{status:P}=L,A=P===v.N.ACTIVE||P===v.N.CAN_UPGRADE,V=(e,t)=>{const{mobile:a,desktop:n}=t||{};var c,r;a&&n&&e((c=a,r=n,Math.round((c+r)/2)))},H=e=>{const{scores:t,previousScores:a}=e||{};V(E,t),V(b,a),(e=>{const{mobile:t,desktop:a}=e||{};t&&a&&w((0,n.yn)(t,a))})(t)},O=async()=>{M?(a(!0),(0,n.tZ)(!0,z,Z,S).then((e=>{const t=(0,n.yn)(e.current.mobile,e.current.desktop);w(t),V(E,e.current),V(b,x.scores),a(!1)})).catch((t=>{e("jetpack_boost_speed_score_error",{feature:"jetpack-boost",position:"my-jetpack",error:t}),x&&x.scores?H(x):j(!0),a(!1)}))):j(!0)},I=(0,d.useMemo)((()=>y&&k?k{N(!0)}),[N]),U=(0,d.useCallback)((()=>{N(!1)}),[N]);return(0,d.useEffect)((()=>{x?A?(0,n.Fr)(1e3*x.timestamp)<1?H(x):O():(0,n.Fr)(1e3*x.timestamp)<14?H(x):O():O()}),[]),!_&&React.createElement("div",{className:"mj-boost-speed-score"},t?React.createElement(c.Z,{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"},React.createElement("button",{onMouseEnter:T,onFocus:T,onMouseLeave:U,onBlur:U},o,C&&React.createElement(s.Popover,{placement:R?"top-end":"right",noArrow:!1,offset:10},React.createElement("p",{className:"boost-score-tooltip__heading"},__("Site speed performance:","jetpack-my-jetpack")," ",o),React.createElement("p",{className:"boost-score-tooltip__content"},B))))),React.createElement("div",{className:"mj-boost-speed-score__bar"},React.createElement(r.Z,{score:k,active:k>0,isLoading:t,showPrevScores:!1,scoreBarType:"desktop",noBoostScoreTooltip:null})),!!I&&React.createElement("div",{className:"mj-boost-speed-score__increase"},React.createElement(l.Z,{size:18,icon:u.Z}),React.createElement("span",null,I))))}},6631:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5736),c=a(5745),r=a(2307),s=a(8489);const __=n.__,i=({admin:e})=>{const t={[r.N.ABSENT]:{label:__("Boost your site","jetpack-my-jetpack")}};return React.createElement(c.Z,{admin:e,slug:"boost",primaryActionOverride:t},React.createElement(s.Z,null))}},9578:(e,t,a)=>{"use strict";a.d(t,{c:()=>r});var n=a(5736),c=a(4598);const __=n.__;function r({speedLetterGrade:e,boostScoreIncrease:t}){const{detail:a}=(0,c.Z)("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")}}},8112:(e,t,a)=>{"use strict";a.d(t,{G:()=>w,X:()=>f});var n=a(2947),c=a(5106),r=a(2636),s=a(5736),i=a(986),o=a(9404),l=a(1074),u=a(5235),d=a.n(u),m=a(5844),p=a.n(m),h=a(9196),g=a.n(h),v=a(523);const __=s.__,f=({change:e,changePercentage:t})=>{if(!Number.isFinite(e))return null;const a=e>0?i.Z:o.Z,r=(0,n.Z)(Math.abs(e),{notation:"compact",compactDisplay:"short"});return g().createElement("div",{className:d()(v.Z["contextual-percentage-change"],{[v.Z.neutral]:0===e,[v.Z.positive]:e>0,[v.Z.negative]:e<0})},!!e&&g().createElement(l.Z,{icon:a,size:14,className:v.Z["change-icon"]}),g().createElement(c.ZP,{className:v.Z["change-values"]},(0,s.sprintf)(/* translators: both placeholders are numbers */ -__("%1$s (%2$s%%)","jetpack-my-jetpack"),r,t)))};f.propTypes={change:p().number,changePercentage:p().number};const w=({description:e,value:t,context:a,loading:n})=>n?g().createElement("div",{className:v.Z["single-contextual-info-placeholder"]},g().createElement(r.Z,{height:24}),g().createElement(r.Z,{height:36})):g().createElement(g().Fragment,null,g().createElement(c.ZP,null,e),g().createElement("div",{className:v.Z["single-contextual-info"]},g().createElement(c.ZP,{className:v.Z["main-value"]},t),a));w.propTypes={description:p().string.isRequired,value:p().string,context:p().node,loading:p().bool}},9963:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"creator",upgradeInInterstitial:!0});o.propTypes={admin:c().bool.isRequired};const l=o},5996:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"crm"});o.propTypes={admin:c().bool.isRequired};const l=o},5943:(e,t,a)=>{"use strict";a.d(t,{Z:()=>E});var n=a(3363),c=a(3846),r=a(9196),s=a.n(r),i=a(1838),o=a(8777),l=a(1640),u=a(7427),d=a(6631),m=a(9963),p=a(5996),h=a(3232),g=a(687),v=a(419),f=a(6217),w=a(523),k=a(9894);const E=()=>{const{isAtomic:e=!1,userIsAdmin:t=!1}=(0,i.$9)(),{showFullJetpackStatsCard:a=!1}=(0,i.$9)("myJetpackFlags"),r={backups:u.Z,protect:h.Z,antispam:l.Z,boost:d.Z,search:g.Z,videopress:k.Z,stats:a?null:f.Z,crm:p.Z,creator:e?null:m.Z,social:v.Z,ai:o.Z};return s().createElement(n.Z,{className:w.Z.cardlist,tagName:"ul",fluid:!0,horizontalSpacing:0,horizontalGap:3},Object.entries(r).map((([e,a])=>a?s().createElement(c.Z,{tagName:"li",sm:4,md:4,lg:4,key:e},s().createElement(a,{admin:!!t})):null)))}},3232:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"protect"});o.propTypes={admin:c().bool.isRequired};const l=o},687:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"search",showMenu:!0});o.propTypes={admin:c().bool.isRequired};const l=o},419:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"social",showMenu:!0});o.propTypes={admin:c().bool.isRequired};const l=o},6217:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"stats",showMenu:!0});o.propTypes={admin:c().bool.isRequired};const l=o},9894:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(2947),c=a(5736),r=a(5844),s=a.n(r),i=a(5544),o=a(7108),l=a(1838),u=a(5745),d=a(8112);const __=c.__,m=({admin:e})=>{const{videoPressStats:t=!1}=(0,l.$9)("myJetpackFlags"),{loading:a,hasError:c,change:r,currentFormatted:s,changePercentage:m}=(()=>{const{data:e,isLoading:t,isError:a}=(0,o.Z)({name:i.db,query:{path:i.n2}}),c=e?.data?.views??{},{previous:r=null,current:s=null}=c,l=null!==s?(0,n.Z)(s,{notation:"compact",compactDisplay:"short"}):null,u=null!==s&&null!==r?s-r:null;let d=null;return null!==u&&(d=0===u?0:0===r?100:Math.round(u/r*100)),{isLoading:t,isError:a,currentFormatted:l,change:u,changePercentage:d}})();if(!t||c)return React.createElement(u.Z,{admin:e,slug:"videopress",showMenu:!0});const p=__("Views, last 7 days","jetpack-my-jetpack");return React.createElement(u.Z,{admin:e,slug:"videopress",showMenu:!0},React.createElement(d.G,{loading:a,description:p,value:s,context:React.createElement(d.X,{change:r,changePercentage:m})}))};m.propTypes={admin:s().bool.isRequired};const p=m},2667:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5609),c=a(5844),r=a.n(c),s=a(9196),i=a.n(s);const o=({children:e,className:t,href:a,isLoading:c=!1,onClick:r,isPrimary:s=!0,disabled:o=!1})=>i().createElement(n.Button,{onClick:r,className:t,href:a,variant:s?"primary":"secondary",disabled:c||o},c?i().createElement(n.Spinner,null):e);o.propTypes={className:r().string,isLoading:r().bool,isPrimary:r().bool,disabled:r().bool};const l=o},968:(e,t,a)=>{"use strict";a.d(t,{Z:()=>C});var n=a(8899),c=a(5106),r=a(3396),s=a(4972),i=a(7325),o=a(8258),l=a(5609),u=a(5736),d=a(1074),m=a(1908),p=a(9201),h=a(5235),g=a.n(h),v=a(9196),f=a.n(v),w=a(4598),k=a(1838),E=a(4848),y=a(199),b=a(2667),_=a(8429);const __=u.__;function j({value:e,currency:t,isOld:a}){if(!e||!t)return null;const r=(0,n.LR)(e,t),s=g()(_.Z.price,{[_.Z["is-old"]]:a});return f().createElement(c.ZP,{className:s,variant:"headline-medium",component:"p"},f().createElement(c.ZP,{component:"sup",variant:"title-medium"},r.symbol),r.integer,f().createElement(c.ZP,{component:"sup",variant:"title-medium"},r.fraction))}const C=({slug:e,onClick:t,trackButtonClick:a=(()=>{}),className:n,preferProductName:h,supportingInfo:C,ctaButtonLabel:N=null,hideTOS:R=!1,quantity:Z=null,highlightLastFeature:x=!1,isFetching:z=!1})=>{const{fileSystemWriteAccess:S="no",siteSuffix:M="",adminUrl:L="",myJetpackCheckoutUri:P=""}=(0,k.$9)(),{detail:A}=(0,w.Z)(e),{name:V,title:H,longDescription:O,features:I,disclaimers:B,pricingForUi:T,isBundle:U,supportedProducts:F,hasPaidPlanForProduct:D,status:q,pluginSlug:J,postCheckoutUrl:G}=A,W="plugin_absent"===q&&"no"===S,{isFree:Q,trialAvailable:K,fullPricePerMonth:$,currencyCode:Y,discountPricePerMonth:X,wpcomProductSlug:ee,wpcomFreeProductSlug:te,introductoryOffer:ae,productTerm:ne}=T,{recordEvent:ce}=(0,E.Z)(),re=!Q&&!D||null!=Z,se=(0,y.a)(),ie=(0,v.useCallback)((()=>G||(se||P)),[G,se,P])(),{run:oe,hasCheckoutStarted:le}=(0,o.Z)({productSlug:ee,redirectUrl:ie,siteSuffix:M,adminUrl:L,connectAfterCheckout:!0,from:"my-jetpack",quantity:Z,useBlogIdSuffix:!0}),{run:ue,hasCheckoutStarted:de}=(0,o.Z)({productSlug:te,redirectUrl:ie,siteSuffix:M,adminUrl:L,connectAfterCheckout:!0,from:"my-jetpack",quantity:Z,useBlogIdSuffix:!0}),me=U?F.join("_plus_").split("_").map(((e,t)=>{if("plus"===e)return f().createElement(d.Z,{className:_.Z["plus-icon"],key:`icon-plugs${t}`,icon:m.Z,size:14});const a=(0,r.VS)(e);return f().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"),$):"year"===ne?__("/month, paid yearly","jetpack-my-jetpack"):__("/month","jetpack-my-jetpack",0);const he=(0,v.useCallback)((()=>{a(),t?.(oe,A)}),[t,a,oe,A]),ge=(0,v.useCallback)((()=>{a(!0,te,A),t?.(ue,A)}),[t,a,ue,te,A]),ve=(0,v.useCallback)((t=>{ce("jetpack_myjetpack_product_card_disclaimer_click",{id:t,product:e})}),[e,ce]);function fe({slug:e}){const t=(0,r.VS)(e);return t?f().createElement("div",{className:_.Z["product-icon"]},f().createElement(t,null)):null}const we=(!U||U&&!D)&&K,ke=V&&h?V:H,Ee=!U&&D?(0,u.sprintf)(/* translators: placeholder is product name. */ -__("Install %s","jetpack-my-jetpack"),ke):(0,u.sprintf)(/* translators: placeholder is product name. */ -__("Get %s","jetpack-my-jetpack"),ke),ye=N||Ee;return f().createElement("div",{className:g()(_.Z.card,n,{[_.Z["is-bundle-card"]]:U})},U&&f().createElement("div",{className:_.Z["card-header"]},f().createElement(r.r7,{className:_.Z["product-bundle-icon"],size:16}),f().createElement(c.ZP,{variant:"label"},__("Popular upgrade","jetpack-my-jetpack"))),f().createElement("div",{className:_.Z.container},U&&f().createElement("div",{className:_.Z["product-bundle-icons"]},me),f().createElement(fe,{slug:e}),f().createElement(c.H3,null,ke),f().createElement(c.ZP,{mb:3},O),f().createElement("ul",{className:g()(_.Z.features,{[_.Z["highlight-last-feature"]]:x})},I.map(((e,t)=>f().createElement(c.ZP,{component:"li",key:`feature-${t}`,variant:"body"},f().createElement(d.Z,{icon:p.Z,size:24}),e)))),re&&X&&f().createElement(f().Fragment,null,f().createElement("div",{className:_.Z["price-container"]},f().createElement(j,{value:X,currency:Y,isOld:!1}),X<$&&f().createElement(j,{value:$,currency:Y,isOld:!0})),f().createElement(c.ZP,{className:_.Z["price-description"]},pe)),Q&&f().createElement(c.H3,null,__("Free","jetpack-my-jetpack")),W&&f().createElement(s.Z,null,f().createElement(c.ZP,null,(0,u.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"),ke)," ",f().createElement(l.ExternalLink,{href:`https://wordpress.org/plugins/${J}`},__("Get plugin","jetpack-my-jetpack")))),!R&&f().createElement("div",{className:_.Z["tos-container"]},f().createElement(i.Z,{agreeButtonLabel:we?(0,u.sprintf)(/* translators: placeholder is cta label. */ -__("%s or Start for free","jetpack-my-jetpack"),ye):ye})),(!U||U&&!D)&&f().createElement(c.ZP,{component:b.Z,onClick:he,isLoading:z||le,disabled:W,isPrimary:!U,className:_.Z["checkout-button"],variant:"body"},ye),!U&&K&&!D&&f().createElement(c.ZP,{component:b.Z,onClick:ge,isLoading:z||de,disabled:W,isPrimary:!1,className:[_.Z["checkout-button"],_.Z["free-product-checkout-button"]],variant:"body"},__("Start for free","jetpack-my-jetpack")),B.length>0&&f().createElement("div",{className:_.Z.disclaimers},B.map(((e,t)=>{const{text:a,link_text:n=null,url:r=null}=e;return f().createElement(c.ZP,{key:`disclaimer-${t}`,component:"p",variant:"body-small"},`${a} `,r&&n&&f().createElement(l.ExternalLink,{onClick:()=>ve(t),href:r,target:"_blank",rel:"noopener noreferrer"},n))}))),U&&D&&f().createElement("div",{className:_.Z["product-has-required-plan"]},f().createElement(r.KM,{size:36}),f().createElement(c.ZP,null,__("Active on your site","jetpack-my-jetpack"))),C&&f().createElement(c.ZP,{className:_.Z["supporting-info"],variant:"body-extra-small"},C)))}},9144:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(9608),c=a(5347),r=a(526),s=a(1342),i=a(5106),o=a(8258),l=a(5736),u=a(5844),d=a.n(u),m=a(9196),p=a(4598),h=a(1838),g=a(199);const __=l.__,v=({cantInstallPlugin:e,onProductButtonClick:t,detail:a,isFetching:s,tier:i,trackProductButtonClick:u,preferProductName:d})=>{const{siteSuffix:p="",myJetpackCheckoutUri:v=""}=(0,h.$9)(),{name:f,featuresByTier:w=[],pricingForUi:{tiers:k},title:E,postCheckoutUrl:y,isBundle:b,hasPaidPlanForProduct:_}=a,{callToAction:j,currencyCode:C,fullPrice:N,introductoryOffer:R,isFree:Z,wpcomProductSlug:x,quantity:z=null}=k[i],S=(0,g.a)(),M=(0,m.useCallback)((()=>y||(S||v)),[y,S,v])(),{run:L,hasCheckoutStarted:P}=(0,o.Z)({from:"my-jetpack",productSlug:x,redirectUrl:M,connectAfterCheckout:!0,siteSuffix:p,useBlogIdSuffix:!0,quantity:z}),A=(0,m.useCallback)((()=>{u(Z),t?.(L,a,i)}),[u,t,L,a,i,Z]),V=N?Math.round(N/12*100)/100:null,H=R?.costPerInterval?Math.round(R.costPerInterval/12*100)/100:null,O="month"===R?.intervalUnit&&1===R?.intervalCount,I=O?(0,l.sprintf)( -// translators: %s is the monthly price for a product -__("trial for the first month, then $%s /month, billed yearly","jetpack-my-jetpack"),V):__("/month, paid yearly","jetpack-my-jetpack",0),B=f&&d?f:E,T=!b&&_?(0,l.sprintf)(/* translators: placeholder is product name. */ -__("Install %s","jetpack-my-jetpack"),B):(0,l.sprintf)(/* translators: placeholder is product name. */ -__("Get %s","jetpack-my-jetpack"),B),U=j||(Z?__("Start for Free","jetpack-my-jetpack"):T);return React.createElement(n.oK,{primary:!Z},React.createElement(n.NE,null,Z?React.createElement(c.Z,{price:0,legend:"",currency:"USD",hidePriceFraction:!0}):!_&&React.createElement(c.Z,{price:V,offPrice:H,legend:I,currency:C,hideDiscountLabel:O,hidePriceFraction:!0}),React.createElement(r.Z,{fullWidth:!0,variant:Z?"secondary":"primary",onClick:A,isLoading:P||s,disabled:P||e||s},U)),w.map(((e,t)=>{const{included:a,description:c,struck_description:r,info:s}=e.tiers[i],o=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.kF,{key:t,isIncluded:a,label:o,tooltipTitle:s?.title,tooltipInfo:s?.content?React.createElement("div",{dangerouslySetInnerHTML:{__html:s?.content}}):null,tooltipClassName:s?.class})})))};v.propTypes={cantInstallPlugin:d().bool.isRequired,onProductButtonClick:d().func.isRequired,detail:d().object.isRequired,tier:d().string.isRequired,trackProductButtonClick:d().func.isRequired,preferProductName:d().bool.isRequired};const f=({slug:e,onProductButtonClick:t,trackProductButtonClick:a,isFetching:c,preferProductName:o})=>{const{fileSystemWriteAccess:u="no"}=(0,h.$9)(),{detail:d}=(0,p.Z)(e),{description:g,featuresByTier:f=[],pluginSlug:w,status:k,tiers:E=[],hasPaidPlanForProduct:y,title:b,pricingForUi:{tiers:_}}=d,j="plugin_absent"===k&&"no"===u,C=j&&React.createElement(s.Z,{level:"error",hideCloseButton:!0,title:React.createElement(i.ZP,null,(0,l.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.Z,{variant:"secondary",href:`https://wordpress.org/plugins/${w}`,isExternalLink:!0},__("Get plugin","jetpack-my-jetpack"))]}),N=(0,m.useMemo)((()=>f.map((e=>({name:e?.name,tooltipTitle:e?.info?.title,tooltipInfo:e?.info?.content?React.createElement("div",{dangerouslySetInnerHTML:{__html:e?.info?.content}}):null})))),[f]);return React.createElement(React.Fragment,null,C,React.createElement(n.ZP,{title:g,items:N},E.map(((e,n)=>y&&(e=>{const{isFree:t}=_[e];return t})(e)?null:React.createElement(v,{key:n,tier:e,detail:d,isFetching:c,onProductButtonClick:t,trackProductButtonClick:a,primary:0===n,cantInstallPlugin:j,preferProductName:o})))))};f.propTypes={slug:d().string.isRequired,onProductButtonClick:d().func.isRequired,trackProductButtonClick:d().func.isRequired,isFetching:d().bool.isRequired,preferProductName:d().bool.isRequired};const w=f},8093:(e,t,a)=>{"use strict";a.d(t,{B$:()=>O,Jw:()=>q,Q5:()=>T,WJ:()=>V,Wf:()=>H,Yi:()=>I,ZP:()=>L,jO:()=>B,q:()=>P,qA:()=>A,r:()=>D,uw:()=>F,y$:()=>U});var n=a(9105),c=a(3363),r=a(3846),s=a(5106),i=a(526),o=a(1294),l=a(9307),u=a(5736),d=a(5235),m=a.n(d),p=a(9196),h=a.n(p),g=a(8209),v=a(7363),f=a(4598),w=a(1838),k=a(4848),E=a(3629),y=a(7555),b=a(5626),_=a(968),j=a(9144),C=a(5610),N=a(4763),R=a(2605),Z=a(720),x=a(1657),z=a(7690),S=a(1287),M=a(1439);const __=u.__;function L({bundle:e,existingLicenseKeyUrl:t="admin.php?page=my-jetpack#/add-license",installsPlugin:a=!1,slug:u,supportingInfo:d,preferProductName:C=!1,children:N=null,imageContainerClassName:R="",ctaButtonLabel:Z=null,hideTOS:x=!1,quantity:z=null,directCheckout:M=!1,highlightLastFeature:L=!1,ctaCallback:P=null}){const{detail:A}=(0,f.Z)(u),{activate:V,isPending:H}=(0,v.Z)(u),{isUpgradableByBundle:O,tiers:I,pricingForUi:B}=A,{recordEvent:T}=(0,k.Z)(),{onClickGoBack:U}=(0,E.U)({slug:u}),{myJetpackCheckoutUri:F=""}=(0,w.$9)(),{siteIsRegistering:D,handleRegisterSite:q}=(0,o.Z)({skipUserConnection:!0,redirectUri:A.postActivationUrl?A.postActivationUrl:null});(0,p.useEffect)((()=>{T("jetpack_myjetpack_product_interstitial_view",{product:u})}),[T,u]);const J=(0,p.useCallback)(((e=!1)=>e?"":"crm"===u?"jetpack-crm":B?.tiers?.upgraded?.wpcomProductSlug?B.tiers.upgraded.wpcomProductSlug:B.wpcomProductSlug),[u,B]),G=(0,p.useCallback)(((e=!1,t=null)=>{T("jetpack_myjetpack_product_interstitial_add_link_click",{product:t??u,product_slug:J(e)})}),[T,u,J]),W=(0,p.useCallback)(((t=!1)=>{T("jetpack_myjetpack_product_interstitial_add_link_click",{product:e,product_slug:J(t)})}),[T,e,J]),Q=(0,y.Z)(g.xB.Home),K=(0,p.useCallback)(((e,t,a)=>{let n=t?.postCheckoutUrl?t?.postCheckoutUrl:F;P?.({slug:u,product:t,tier:a}),t?.isBundle||M?e?.():V({productId:u},{onSettled:({productId:c})=>{n=c?.post_checkout_url?c.post_checkout_url:F;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,n):q().then((e=>{if(!e)return Q()})):window.location.href="https://jetpackcrm.com/pricing/"}})}),[M,V,Q,u,F,P,q]);return h().createElement(n.Z,{showHeader:!1,showBackground:!1},h().createElement(c.Z,{horizontalSpacing:3,horizontalGap:3},h().createElement(r.Z,{className:S.Z["product-interstitial__header"]},h().createElement(b.Z,{onClick:U}),t&&h().createElement(s.ZP,{variant:"body-small"},(0,l.createInterpolateElement)(__("Already have an existing plan or license key? Get started.","jetpack-my-jetpack"),{a:h().createElement(i.Z,{className:S.Z["product-interstitial__license-activation-link"],href:t,variant:"link"})}))),h().createElement(r.Z,null,I&&I.length?h().createElement(j.Z,{slug:u,clickHandler:K,onProductButtonClick:K,trackProductButtonClick:G,preferProductName:C,isFetching:H||D}):h().createElement(c.Z,{className:O?null:S.Z.container,horizontalSpacing:0,horizontalGap:0,fluid:!0},h().createElement(r.Z,{sm:4,md:4,lg:7},h().createElement(_.Z,{slug:u,trackButtonClick:G,onClick:a?K:void 0,className:O?S.Z.container:null,supportingInfo:d,preferProductName:C,ctaButtonLabel:Z,hideTOS:x,quantity:z,highlightLastFeature:L,isFetching:H||D})),h().createElement(r.Z,{sm:4,md:4,lg:5,className:m()(S.Z.imageContainer,R)},e?h().createElement(_.Z,{slug:e,trackButtonClick:W,onClick:K,className:O?S.Z.container:null,quantity:z,highlightLastFeature:L,isFetching:H}):N)))))}function P(){const e="anti-spam",{detail:t}=(0,f.Z)(e),{isPluginActive:a}=t;return h().createElement(L,{slug:e,installsPlugin:!0,bundle:"security",existingLicenseKeyUrl:a?"admin.php?page=akismet-key-config":null,preferProductName:!0})}function A(){return h().createElement(L,{slug:"backup",installsPlugin:!0,bundle:"security"})}function V(){return h().createElement(L,{slug:"boost",installsPlugin:!0},h().createElement("img",{src:C,alt:"Boost"}))}function H(){return h().createElement(L,{slug:"creator",installsPlugin:!0})}function O(){return h().createElement(L,{slug:"crm",installsPlugin:!0},h().createElement("img",{src:N,alt:"CRM"}))}function I(){return h().createElement(L,{slug:"extras",installsPlugin:!0},h().createElement("img",{src:R,alt:"Extras"}))}function B(){return h().createElement(L,{slug:"protect",installsPlugin:!0})}function T(){return h().createElement(L,{slug:"scan",installsPlugin:!0,bundle:"security"})}function U(){return h().createElement(L,{slug:"social",installsPlugin:!0},h().createElement("img",{src:x,alt:__("Image displaying logos of social media platforms supported by Jetpack Social.","jetpack-my-jetpack")}))}function F(){const{detail:e}=(0,f.Z)("search");return h().createElement(L,{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")},h().createElement("img",{src:Z,alt:"Search"}))}function D(){return h().createElement(L,{slug:"stats",directCheckout:!0,installsPlugin:!0,ctaButtonLabel:__("Get Stats","jetpack-my-jetpack")},h().createElement("img",{src:z,alt:__("Illustration showing the Stats feature, highlighting important statistics for your site.","jetpack-my-jetpack")}))}function q(){return h().createElement(L,{slug:"videopress",installsPlugin:!0},h().createElement("img",{src:M,alt:"VideoPress"}))}},4257:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(1294),c=a(951),r=a.n(c),s=a(9196),i=a(8093),o=a(4598),l=a(1488),u=a(1514);const d=r()("my-jetpack:product-interstitial:jetpack-ai");function m(){const{detail:e}=(0,o.Z)("jetpack-ai");d(e);const{userConnectionData:t}=(0,n.Z)(),{currentUser:a}=t,{wpcomUser:c}=a,r=`jetpack_ai_optfree_${a?.id||0}_${a?.blogId||0}_${c?.ID||0}`,m=(0,s.useCallback)((({tier:e})=>{"free"===e&&localStorage.setItem(r,!0)}),[r]);return React.createElement(i.ZP,{slug:"jetpack-ai",installsPlugin:!0,imageContainerClassName:u.Z.aiImageContainer,hideTOS:!0,directCheckout:!1,ctaCallback:m},React.createElement("img",{src:l,alt:"Search"}))}},4517:(e,t,a)=>{"use strict";a.d(t,{Z:()=>x});var n=a(6895),c=a(9105),r=a(3363),s=a(3846),i=a(8868),o=a(3396),l=a(1342),u=a(1294),d=a(5609),m=a(5736),p=a(1074),h=a(9201),g=a(1908),v=a(1646),f=a(5235),w=a.n(f),k=a(951),E=a.n(k),y=a(9196),b=a(4598),_=a(4848),j=a(3629),C=a(7555),N=a(5626),R=a(1514);const __=m.__,Z=E()("my-jetpack:product-interstitial:jetpack-ai-product-page");function x(){const{onClickGoBack:e}=(0,j.U)("jetpack-ai"),{detail:t}=(0,b.Z)("jetpack-ai"),{description:a,aiAssistantFeature:f}=t,[k,E]=(0,y.useState)(!1),{isRegistered:x}=(0,u.Z)(),z=__("Generate and edit content faster with Jetpack AI Assistant","jetpack-my-jetpack"),S=__("Create featured images with one click","jetpack-my-jetpack"),M=__("Build forms using prompts","jetpack-my-jetpack"),L=__("Get feedback on posts","jetpack-my-jetpack");Z(f);const{requestsCount:P=0,currentTier:A,nextTier:V,usagePeriod:H,isOverLimit:O}=f||{},I=1===A?.value,B=0===A?.value,T=!B&&!I,U=!I&&T&&!V&&A,F=B&&20-P>=0?20-P:0,D=T&&!B&&H,q=T||I,J=(0,n.Z)("jetpack-ai-tiers-more-requests-contact"),G=(0,n.Z)("jetpack-ai-feedback"),W=(0,n.Z)("jetpack-ai-product-page-featured-image-link"),Q=(0,n.Z)("jetpack-ai-product-page-form-link"),K=(0,n.Z)("jetpack-ai-product-page-content-feedback-link"),$=x?"post-new.php?use_ai_block=1&_wpnonce="+window?.jetpackAi?.nonce:"#/connection",Y=__("Create new post","jetpack-my-jetpack"),X=__("Connect to Jetpack to start using the AI Assistant","jetpack-my-jetpack"),ee=O&&T,te=O&&B,ae=A?.value||0,ne=H?.["requests-count"]||0,ce=ae-ne>=0?ae-ne:0,re=__("You've reached your request limit for this month","jetpack-my-jetpack"),se=__("You've used all your free requests","jetpack-my-jetpack"),ie=(0,m.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(H?.["next-start"])-new Date)/864e5)),oe=__("Reach for More with Jetpack AI! Upgrade now for additional requests and keep your momentum going.","jetpack-my-jetpack"),le=(0,m.sprintf)( -// translators: %s is the next upgrade value -__("Get %s requests","jetpack-my-jetpack"),V?.value||"more"),ue=__("Upgrade now","jetpack-my-jetpack"),de=(0,C.Z)("/add-jetpack-ai"),{recordEvent:me}=(0,_.Z)(),pe=(0,y.useCallback)((()=>{me("jetpack_ai_upgrade_contact_us",{placement:"product-page"})}),[me]),he=(0,y.useCallback)((()=>{me("jetpack_ai_upgrade_button",{placement:"product-page",context:"my-jetpack",current_tier_slug:A?.slug||"",requests_count:P}),de()}),[me,P,A,de]),ge=(0,y.useCallback)((()=>E(!1)),[]);(0,y.useEffect)((()=>{me("jetpack_ai_myjetpack_product_page_view",{current_tier_slug:A?.slug||"",requests_count:P})}),[P,A?.slug,me]),(0,y.useEffect)((()=>{E(ee||te)}),[ee,te]);const ve=React.createElement("span",{className:R.Z["product-interstitial__new-badge"]},__("New","jetpack-my-jetpack")," ");return React.createElement(c.Z,{showHeader:!1,showBackground:!0},React.createElement(r.Z,{fluid:!0,horizontalSpacing:3,horizontalGap:2},React.createElement(s.Z,{className:w()(R.Z["product-interstitial__section"])},React.createElement("div",{className:R.Z["product-interstitial__section-wrapper-wide"]},React.createElement(N.Z,{onClick:e})),React.createElement("div",{className:w()(R.Z["product-interstitial__section-wrapper-wide"],R.Z["product-interstitial__product-header"])},React.createElement(i.Z,null),React.createElement("div",{className:R.Z["product-interstitial__product-header-name"]},__("AI Assistant","jetpack-my-jetpack")))),React.createElement(s.Z,{className:w()(R.Z["product-interstitial__section"])},React.createElement("div",{className:R.Z["product-interstitial__hero-section"]},React.createElement("div",{className:R.Z["product-interstitial__hero-content"]},React.createElement("h1",{className:R.Z["product-interstitial__hero-heading"]},a),React.createElement("div",{className:R.Z["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")),!U&&!I&&React.createElement(d.Button,{variant:"primary",onClick:he,className:R.Z["product-interstitial__hero-cta"]},__("Get more requests","jetpack-my-jetpack")),U&&React.createElement(d.Button,{variant:"primary",onClick:pe,href:J,className:R.Z["product-interstitial__hero-cta"]},__("Contact Us","jetpack-my-jetpack"))),React.createElement("div",{className:R.Z["product-interstitial__hero-side"]},D&&React.createElement(d.Card,{className:R.Z["stats-card"]},React.createElement(o.pJ,null),React.createElement("div",null,React.createElement("div",{className:R.Z["product-interstitial__stats-card-text"]},__("Requests for this month","jetpack-my-jetpack")),React.createElement("div",{className:R.Z["product-interstitial__stats-card-value"]},ce))),q&&React.createElement(d.Card,{className:R.Z["stats-card"]},React.createElement(p.Z,{icon:h.Z,className:R.Z["stats-card-icon-check"]}),React.createElement("div",null,React.createElement("div",{className:R.Z["product-interstitial__stats-card-text"]},__("All-time requests used","jetpack-my-jetpack")),React.createElement("div",{className:R.Z["product-interstitial__stats-card-value"]},P))),B&&React.createElement(d.Card,{className:R.Z["stats-card"]},React.createElement(p.Z,{icon:h.Z,className:R.Z["stats-card-icon-check"]}),React.createElement("div",null,React.createElement("div",{className:R.Z["product-interstitial__stats-card-text"]},__("Free requests available","jetpack-my-jetpack")),React.createElement("div",{className:R.Z["product-interstitial__stats-card-value"]},F)))))),React.createElement(s.Z,{className:R.Z["product-interstitial__section"]},React.createElement("div",{className:R.Z["product-interstitial__section-wrapper"]},k&&React.createElement("div",{className:R.Z["product-interstitial__ai-notice"]},React.createElement(l.Z,{actions:[React.createElement(d.Button,{isPrimary:!0,onClick:he},ee?le:ue)],onClose:ge,level:ee?"warning":"error",title:ee?re:se},ee?ie:oe)),React.createElement("h2",{className:R.Z["product-interstitial__section-heading"]},__("AI Features","jetpack-my-jetpack")),React.createElement("p",{className:R.Z["product-interstitial__section-sub-heading"]},__("Discover all the Jetpack features powered by AI","jetpack-my-jetpack")),React.createElement("div",{className:R.Z["product-interstitial__usage-videos"]},React.createElement("div",{className:R.Z["product-interstitial__usage-videos-item"]},React.createElement("div",{className:R.Z["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:z}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:R.Z["product-interstitial__usage-videos-content"]},React.createElement("div",{className:R.Z["product-interstitial__usage-videos-heading"]},z),React.createElement("div",{className:R.Z["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(d.Button,{className:R.Z["product-interstitial__usage-videos-link"],icon:g.Z,href:$},x?Y:X))),React.createElement("div",{className:R.Z["product-interstitial__usage-videos-item"]},React.createElement("div",{className:R.Z["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:R.Z["product-interstitial__usage-videos-content"]},React.createElement("div",{className:R.Z["product-interstitial__usage-videos-heading"]},S,ve),React.createElement("div",{className:R.Z["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(d.Button,{className:R.Z["product-interstitial__usage-videos-link"],icon:v.Z,target:"_blank",href:W},__("Learn about featured images","jetpack-my-jetpack")))),React.createElement("div",{className:R.Z["product-interstitial__usage-videos-item"]},React.createElement("div",{className:R.Z["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:M}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:R.Z["product-interstitial__usage-videos-content"]},React.createElement("div",{className:R.Z["product-interstitial__usage-videos-heading"]},M),React.createElement("div",{className:R.Z["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(d.Button,{className:R.Z["product-interstitial__usage-videos-link"],icon:v.Z,target:"_blank",href:Q},__("Learn about forms","jetpack-my-jetpack")))),React.createElement("div",{className:R.Z["product-interstitial__usage-videos-item"]},React.createElement("div",{className:R.Z["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:L}),React.createElement("script",{src:"https://videopress.com/videopress-iframe.js"})),React.createElement("div",{className:R.Z["product-interstitial__usage-videos-content"]},React.createElement("div",{className:R.Z["product-interstitial__usage-videos-heading"]},L),React.createElement("div",{className:R.Z["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(d.Button,{className:R.Z["product-interstitial__usage-videos-link"],icon:v.Z,target:"_blank",href:K},__("Learn more","jetpack-my-jetpack"))))))),React.createElement(s.Z,{className:R.Z["product-interstitial__section"]},React.createElement("div",{className:R.Z["product-interstitial__section-wrapper"]},React.createElement("div",{className:R.Z["product-interstitial__section-emoji"]},"👋"),React.createElement("h2",{className:R.Z["product-interstitial__section-heading"]},__("Do you have any feedback?","jetpack-my-jetpack")),React.createElement("p",{className:R.Z["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(d.ExternalLink,{href:G},__("Share your feedback!","jetpack-my-jetpack")))))))}},673:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(1294),c=a(3281),r=a(5736),s=a(9196),i=a.n(s),o=a(5544),l=a(7108),u=a(7111);const __=r.__;function d(){const{userConnectionData:e}=(0,n.Z)(),t=e?.currentUser?.wpcomUser?.display_name||e?.currentUser?.wpcomUser?.login||e?.currentUser?.username,{isLoading:a,data:r}=(0,l.Z)({name:o.h3,query:{path:o.LQ}}),s=(0,u.o)(r);return a?i().createElement(i().Fragment,null,__("Checking gold status…","jetpack-my-jetpack")):i().createElement(i().Fragment,null,i().createElement(c.H,{tokenRedeemed:s,displayName:t}))}},2889:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(5736),c=a(1074),r=a(4955),s=a(6514),i=a(5316),o=a(9196),l=a.n(o),u=a(5090),d=a(5026),m=a(2091);const __=n.__,p=({counts:e,previousCounts:t})=>l().createElement("div",{className:m.Z["section-stats-highlights"]},l().createElement("h3",{className:m.Z["section-title"]},l().createElement("span",null,__("7-day highlights","jetpack-my-jetpack")),l().createElement("small",{className:m.Z["section-description"]},__("Compared to previous period","jetpack-my-jetpack"))),l().createElement("div",{className:m.Z["cards-list"]},l().createElement(u.Z,{heading:__("Views","jetpack-my-jetpack"),icon:l().createElement(c.Z,{icon:d.Z}),count:e?.views,previousCount:t?.views}),l().createElement(u.Z,{heading:__("Visitors","jetpack-my-jetpack"),icon:l().createElement(c.Z,{icon:r.Z}),count:e?.visitors,previousCount:t?.visitors}),l().createElement(u.Z,{heading:__("Likes","jetpack-my-jetpack"),icon:l().createElement(c.Z,{icon:s.Z}),count:e?.likes,previousCount:t?.likes}),l().createElement(u.Z,{heading:__("Comments","jetpack-my-jetpack"),icon:l().createElement(c.Z,{icon:i.Z}),count:e?.comments,previousCount:t?.comments})))},5090:(e,t,a)=>{"use strict";a.d(t,{Z:()=>f});var n=a(2947),c=a(5609),r=a(1074),s=a(9404),i=a(986),o=a(5235),l=a.n(o),u=a(5844),d=a.n(u),m=a(9196),p=a.n(m),h=a(2091);const g=(e,t={})=>null!==e&&Number.isFinite(e)?(0,n.Z)(e,t):"-",v=({count:e=0,previousCount:t=0,icon:a,heading:n})=>{const o=(d=t,"number"!=typeof(u=e)||"number"!=typeof d?null:u-d);var u,d;const m=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)})(m,t):null,f={maximumFractionDigits:1,notation:"compact"};return p().createElement(c.Card,{className:h.Z["stats-card"]},a&&p().createElement("div",{className:h.Z["stats-card-icon"]},a),n&&p().createElement("div",{className:h.Z["stats-card-heading"]},n),p().createElement("div",{className:h.Z["stats-card-count"]},p().createElement("span",{className:h.Z["stats-card-count-value"],title:Number.isFinite(e)?String(e):void 0},g(e,f)),null!==o?p().createElement("span",{className:l()(h.Z["stats-card-difference"],{[h.Z["stats-card-difference--positive"]]:o<0,[h.Z["stats-card-difference--negative"]]:o>0})},p().createElement("span",{className:h.Z["stats-card-difference-icon"],title:String(o)},o<0&&p().createElement(r.Z,{size:18,icon:s.Z}),o>0&&p().createElement(r.Z,{size:18,icon:i.Z})),p().createElement("span",{className:h.Z["stats-card-difference-absolute-value"]},g(m,m>9999?f:{})),null!==v&&p().createElement("span",{className:h.Z["stats-card-difference-absolute-percentage"]},"(",v,"%)")):null))};v.propTypes={count:d().number,heading:d().node,icon:d().node,previousCount:d().number};const f=v},5026:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(5609);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"}))},9593:(e,t,a)=>{"use strict";a.d(t,{Z:()=>h});var n=a(5736),c=a(9196),r=a(5544),s=a(4598),i=a(7108),o=a(1838),l=a(4848),u=a(5162),d=a(5745),m=a(2307),p=a(2889);const __=n.__,h=()=>{const e="stats",{blogID:t}=(0,u.Z)(),{detail:a}=(0,s.Z)(e),{status:n}=a,h=!!(0,o.$9)("userIsAdmin"),{data:g}=(0,i.Z)({name:r.m2,query:{path:(0,r.Vx)(t)}}),v=g?.past_seven_days||{},f=g?.between_past_eight_and_fifteen_days||{},{recordEvent:w}=(0,l.Z)(),k=(0,c.useCallback)((()=>{w("jetpack_myjetpack_stats_card_seedetailedstats_click",{product:e})}),[w]),E=(0,c.useCallback)((()=>!(n!==m.N.CAN_UPGRADE)),[n]),y={href:"admin.php?page=stats",label:__("View detailed stats","jetpack-my-jetpack"),onClick:k,shouldShowButton:E},b={[m.N.ACTIVE]:{label:__("View detailed stats","jetpack-my-jetpack")},[m.N.ERROR]:{label:__("Connect Jetpack to use Stats","jetpack-my-jetpack")}};return React.createElement(d.Z,{admin:h,slug:e,primaryActionOverride:b,secondaryAction:y,showMenu:!0},React.createElement(p.Z,{counts:v,previousCounts:f}))}},3851:(e,t,a)=>{"use strict";a.d(t,{Z:()=>f});var n=a(3363),c=a(3846),r=a(5106),s=a(526),i=a(1294),o=a(5736),l=a(9517),u=a(9196),d=a(8209),m=a(8059),p=a(4848),h=a(7555),g=a(1062),v=a(9473);const __=o.__,f=()=>{const{recordEvent:e}=(0,p.Z)(),{isWelcomeBannerVisible:t,dismissWelcomeBanner:a}=(0,m.Z)(),{isRegistered:o,isUserConnected:f}=(0,i.Z)(),w=(0,h.Z)(d.xB.Connection),[k,E]=(0,u.useState)(t),y=!o||!f;(0,u.useEffect)((()=>{k&&e("jetpack_myjetpack_welcome_banner_view")}),[k,e]);const b=(0,u.useCallback)((()=>{e("jetpack_myjetpack_welcome_banner_dismiss_click"),E(!1),a()}),[e,a]),_=(0,u.useCallback)((()=>{e("jetpack_myjetpack_welcome_banner_finish_connection_click"),w()}),[e,w]);return k?React.createElement(n.Z,{horizontalSpacing:3,className:v.Z["banner-container"]},React.createElement(c.Z,{lg:12,className:v.Z.banner},React.createElement(g.U,{className:v.Z["banner-card"]},React.createElement(n.Z,{horizontalSpacing:0,horizontalGap:0,className:v.Z["banner-content"]},React.createElement(c.Z,{sm:6,md:8,lg:6,className:v.Z["banner-description"]},React.createElement(r.ZP,{variant:"headline-small",mb:3},__("Welcome to Jetpack!","jetpack-my-jetpack")),React.createElement(r.ZP,{variant:"body",mb:2},__("Jetpack is a suite of security, performance, and growth tools made for WordPress sites by the WordPress experts.","jetpack-my-jetpack")),React.createElement(r.ZP,{variant:"body",mb:y?4:0},__("It’s the ultimate toolkit for best-in-class websites, with everything you need to grow your business. Choose a plan below to get started.","jetpack-my-jetpack")),y&&React.createElement(s.Z,{variant:"primary",onClick:_},__("Finish setting up Jetpack","jetpack-my-jetpack"))),React.createElement(c.Z,{sm:6,md:8,lg:6,className:v.Z["banner-image"]}))),React.createElement(s.Z,{className:v.Z.dismiss,variant:"secondary","aria-label":__("Don’t show the welcome message again","jetpack-my-jetpack"),size:"small",icon:l.Z,onClick:b}))):null}},8209:(e,t,a)=>{"use strict";a.d(t,{f6:()=>c,w6:()=>n,xB:()=>r});const n="my-jetpack-my-plans-manage",c="my-jetpack-my-plans-purchase",r={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",AddScan:"/add-scan",AddSocial:"/add-social",AddSearch:"/add-search",AddVideoPress:"/add-videopress",AddStats:"/add-stats",AddLicense:"/add-license",RedeemToken:"/redeem-token"}},1647:(e,t,a)=>{"use strict";a.d(t,{E3:()=>n,dR:()=>c,hg:()=>r});const n=100,c=200,r=300},8437:(e,t,a)=>{"use strict";a.d(t,{T:()=>r,Z:()=>s});var n=a(9196);const c={message:"",title:null,options:{level:"",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)((e=>{(!t.message||e.options.priority>t.options.priority)&&a(e)}),[t.message,t.options.priority]),i=(0,n.useCallback)((()=>{a(c)}),[]);return React.createElement(r.Provider,{value:{currentNotice:t,setNotice:s,resetNotice:i}},e)}},5544:(e,t,a)=>{"use strict";a.d(t,{Hq:()=>i,Jk:()=>l,Kf:()=>E,LQ:()=>c,RQ:()=>y,Vu:()=>_,Vx:()=>m,YF:()=>d,_H:()=>r,db:()=>v,gb:()=>w,h3:()=>j,hd:()=>s,iG:()=>h,kl:()=>k,m2:()=>b,n2:()=>u,nF:()=>f,q9:()=>p,xD:()=>o,yv:()=>g});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`,o=`${n}/chat/authentication`,l=`${n}/site/products`,u="videopress/v1/stats/featured",d=`${n}/site/dismiss-welcome-banner`,m=e=>`jetpack/v4/stats-app/sites/${e}/stats/highlights`,p="product",h="activate product",g="install product",v="videopress stats",f="available licenses",w="chat availability",k="chat authentication",E="backup history",y="backup stats",b="stats counts",_="dismiss welcome banner",j="purchases"},6916:(e,t,a)=>{"use strict";a.d(t,{o:()=>l});var n=a(5736),c=a(9196),r=a(1647),s=a(8437),i=a(5544);const __=n.__,o=[i.h3,i.iG,i.yv],l=({infoName:e,isError:t,overrideMessage:a})=>{const{setNotice:i}=(0,c.useContext)(s.T),l=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&&o.includes(e)&&i({message:l,options:{id:"fetching-error-notice",level:"error",priority:r.E3}})}),[l,i,t,e])}},7363:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5736),c=a(4848),r=a(5544),s=a(7296),i=a(1838),o=a(4598);const __=n.__,l=e=>{const{detail:t,refetch:a}=(0,o.Z)(e),{recordEvent:l}=(0,c.Z)(),{mutate:u,isPending:d}=(0,s.Z)({name:r.iG,query:{path:`${r.Jk}/${e}`,method:"POST"},options:{onSuccess:()=>{(e=>{const{standalonePluginInfo:t,isPluginActive:a}=e;return t?.hasStandalonePlugin?t?.isStandaloneActive:a})(t)||(l("jetpack_myjetpack_product_activated",{product:e}),(e=>{const{items:t}=(0,i.$9)("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:d}}},5595:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5736),c=a(5544),r=a(7296),s=a(4598);const __=n.__,i=e=>{const{detail:t,refetch:a}=(0,s.Z)(e),{mutate:i,isPending:o}=(0,r.Z)({name:c.yv,query:{path:`${c.Jk}/${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:o}}},4598:(e,t,a)=>{"use strict";a.d(t,{B:()=>o,Z:()=>u});var n=a(9196),c=a(5544),r=a(7108),s=a(1838),i=a(466);const o=()=>{const{items:e}=(0,s.$9)("products");return Object.entries(e).reduce(((e,[t,a])=>({...e,[t]:l(a)})),{})},l=e=>{const t=(0,i.Z)(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=o(),a=t?.[e],{refetch:s,isLoading:i}=(e=>(0,r.Z)({name:c.q9,query:{path:`${c.Jk}/${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}}},6178:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(4743),c=a(5885),r=a(6916),s=a(1838);const i=({name:e,queryFn:t,errorMessage:a})=>{const i=(0,c.a)({queryKey:[e],queryFn:()=>{const{apiRoot:e,apiNonce:a}=(0,s.M_)();return n.ZP.setApiRoot(e),n.ZP.setApiNonce(a),t(n.ZP)},refetchOnWindowFocus:!1,refetchIntervalInBackground:!1}),{isError:o,isLoading:l}=i;return(0,r.o)({infoName:e,isError:!l&&o,overrideMessage:a}),i}},7296:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(2016),c=a(6989),r=a.n(c),s=a(6916);const i=({name:e,query:t,options:a,errorMessage:c})=>{const i=(0,n.D)({mutationKey:[e],mutationFn:()=>r()(t),...a}),{isError:o,isPending:l}=i;return(0,s.o)({infoName:e,isError:!l&&o,overrideMessage:c}),i}},7108:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5885),c=a(6989),r=a.n(c),s=a(6916);const i=({name:e,query:t,options:a,errorMessage:c})=>{const i=(0,n.a)({queryKey:[e],queryFn:()=>r()(t),refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,...a}),{error:o,isError:l,isLoading:u}=i;return(0,s.o)({infoName:e,isError:!u&&l&&"not_connected"!==o.code,overrideMessage:c}),i}},1838:(e,t,a)=>{"use strict";a.d(t,{$9:()=>n,M_:()=>c,vH:()=>r});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},1950:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(2307);const c=e=>Object.values(e).filter((({requiresUserConnection:e,status:t})=>e&&(t===n.N.ACTIVE||t===n.N.ERROR))).map((({name:e})=>e))},466:(e,t,a)=>{"use strict";a.d(t,{Z:()=>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},8059:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5736),c=a(5544),r=a(7296),s=a(1838);const __=n.__,i=()=>{const{redBubbleAlerts:e}=(0,s.$9)(),t=Object.keys(e).includes("welcome-banner-active"),{mutate:a}=(0,r.Z)({name:c.Vu,query:{path:c.YF,method:"POST"},errorMessage:__("Failed to dismiss the welcome banner. Please try again","jetpack-my-jetpack")});return{dismissWelcomeBanner:a,isWelcomeBannerVisible:t}}},4848:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(6975),c=a(9196),r=a(1838),s=a(5162);const i=()=>{const{isUserConnected:e,connectedPlugins:t,userConnectionData:a={}}=(0,s.Z)(),{login:i,ID:o}=a.currentUser?.wpcomUser||{},{myJetpackVersion:l=""}=(0,r.$9)();(0,c.useEffect)((()=>{e&&o&&i&&n.Z.initialize(o,i)}),[o,e,i]);const u=Object.keys(t||{}).sort().join(",").replaceAll("jetpack-","");return{recordEvent:(0,c.useCallback)(((e,t)=>{n.Z.tracks.recordEvent(e,{...t,version:l,referring_plugins:u})}),[])}}},3629:(e,t,a)=>{"use strict";a.d(t,{U:()=>i});var n=a(9196),c=a(8209),r=a(4848),s=a(7555);function i({slug:e}){const{recordEvent:t}=(0,r.Z)(),a=(0,s.Z)(c.xB.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])}}},5162:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(1294),c=a(1838);const r=()=>{const{apiRoot:e,apiNonce:t}=(0,c.M_)(),{topJetpackMenuItemUrl:a,blogID:r}=(0,c.$9)(),s=(0,n.Z)({apiRoot:e,apiNonce:t}),{registrationNonce:i}=(0,c.vH)(),o=s.isRegistered;return{apiNonce:t,apiRoot:e,blogID:r,registrationNonce:i,...s,isSiteConnected:o,topJetpackMenuItemUrl:a}}},7555:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(9196),c=a(6417);function r(e){const t=(0,c.s0)();return(0,n.useCallback)((a=>t(e,a)),[t,e])}},1607:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(9997);const c=()=>{const[e]=(0,n.lr)(),t=e.get("returnTo");return t?`admin.php?page=my-jetpack#/${t}`:"admin.php?page=my-jetpack"}},8064:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(1838),c=a(8184),r=a(8505),s=a(4307);const i=()=>{const{redBubbleAlerts:e}=(0,n.$9)();(0,c.Z)(e),(0,s.Z)(e),(0,r.Z)()}},8184:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(9196),r=a(1647),s=a(8437),i=a(4848);const __=n.__,o=e=>{const{setNotice:t}=(0,c.useContext)(s.T),{recordEvent:a}=(0,i.Z)();(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,o=(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),l={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.dR};t({message:o,options:l})}),[e,t,a])}},8505:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(3846),c=a(5106),r=a(3329),s=a(1045),i=a(5736),o=a(9196),l=a(1647),u=a(8437),d=a(4848);const __=i.__,m=()=>{const{setNotice:e,resetNotice:t}=(0,o.useContext)(u.T),{hasConnectionError:a,connectionErrorMessage:m}=(0,r.Z)(),{restoreConnection:p,isRestoringConnection:h,restoreConnectionError:g}=(0,s.Z)(),{recordEvent:v}=(0,d.Z)();(0,o.useEffect)((()=>{t()}),[t,g]),(0,o.useEffect)((()=>{if(!a)return;let t=m;g&&(t=React.createElement(n.Z,null,React.createElement(c.ZP,{mb:2},(0,i.sprintf)(/* translators: placeholder is the error. */ -__("There was an error reconnecting Jetpack. Error: %s","jetpack-my-jetpack"),g)),React.createElement(c.ZP,{mb:2},m)));const r=__("Reconnecting Jetpack…","jetpack-my-jetpack"),s={id:"connection-error-notice",level:"error",actions:[{label:__("Restore Connection","jetpack-my-jetpack"),onClick:()=>{p(),v("jetpack_my_jetpack_connection_error_notice_reconnect_cta_click")},isLoading:h,loadingText:r,noDefaultClasses:!0}],priority:l.hg+(h?1:0)};e({message:t,options:s})}),[e,v,a,m,p,h,g,t])}},4307:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(3846),c=a(5106),r=a(7325),s=a(1294),i=a(5736),o=a(9196),l=a(8209),u=a(1647),d=a(8437),m=a(4598),p=a(1838),h=a(1950),g=a(4848),v=a(5162),f=a(7555);const __=i.__,w=e=>{const{recordEvent:t}=(0,g.Z)(),{setNotice:a,resetNotice:w}=(0,o.useContext)(d.T),{apiRoot:k,apiNonce:E}=(0,p.M_)(),{isRegistered:y,isUserConnected:b,hasConnectedOwner:_}=(0,v.Z)(),{siteIsRegistering:j,handleRegisterSite:C}=(0,s.Z)({skipUserConnection:!0,apiRoot:k,apiNonce:E,from:"my-jetpack"}),N=(0,m.B)(),R=(0,f.Z)(l.xB.Connection);(0,o.useEffect)((()=>{if(!Object.keys(e).includes("missing-site-connection"))return;const s=(0,h.Z)(N),o=!_&&!b&&s.length>0;if(!o&&y)return;const l=(0,i.sprintf)(/* translators: placeholder is product name. */ -__("Jetpack %s needs a user connection to WordPress.com to be able to work.","jetpack-my-jetpack"),s[0]),d={message:1===s.length?l:__("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")},m={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")},p={id:o?"user-connection-notice":"site-connection-notice",level:"info",actions:[{label:o?d.buttonLabel:m.buttonLabel,isLoading:j,loadingText:__("Connecting…","jetpack-my-jetpack"),onClick:()=>{o&&(t("jetpack_my_jetpack_user_connection_notice_cta_click"),R()),t("jetpack_my_jetpack_site_connection_notice_cta_click"),C().then((()=>{w(),a({message:__("Your site has been successfully connected.","jetpack-my-jetpack"),options:{id:"site-connection-success-notice",level:"success",actions:[],priority:u.hg,hideCloseButton:!1,onClose:w}})}))},noDefaultClasses:!0}],priority:u.hg+(j?1:0),isRedBubble:!0},g=o?d.message:React.createElement(n.Z,null,React.createElement(c.ZP,{mb:2},m.message),React.createElement(r.Z,{agreeButtonLabel:m.buttonLabel}));a({message:g,title:o?d.title:m.title,options:p})}),[C,_,y,b,R,N,t,e,w,a,j])}},938:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(9196);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])}},199:(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,{a:()=>n})},6864:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(6895),c=a(8209),r=a(1838);const s=()=>{const{siteSuffix:e="",blogID:t}=(0,r.$9)();return(0,n.Z)(c.w6,{site:t??e})}},7356:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(6895),c=a(8209),r=a(1838);const s=()=>{const{siteSuffix:e="",blogID:t,myJetpackCheckoutUri:a}=(0,r.$9)(),s=a?`redirect_to=${a}`:null;return(0,n.Z)(c.f6,{site:t??e,query:s})}},7111:(e,t,a)=>{"use strict";a.d(t,{h:()=>n,o:()=>c});const n=({partner_slug:e})=>!!e&&"goldenticket"===e;function c(e){return!!Array.isArray(e)&&e.filter((e=>n(e))).length>0}},2042:(e,t,a)=>{"use strict";e.exports=a.p+"images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg"},724:(e,t,a)=>{"use strict";e.exports=a.p+"images/disconnect-thanks-5873bfac56a9bd7322cd.jpg"},8702:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png"},1160:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png"},5242:(e,t,a)=>{"use strict";e.exports=a.p+"images/apple-92dacafad84e79708a74.svg"},6790:(e,t,a)=>{"use strict";e.exports=a.p+"images/connect-f27775ac15cf885713c2.png"},184:(e,t,a)=>{"use strict";e.exports=a.p+"images/google-dec2a429bf1d8e83f9ad.svg"},4403:(e,t,a)=>{"use strict";e.exports=a.p+"images/wordpress-1fc3e0ba6c52e9707900.svg"},5050:(e,t,a)=>{"use strict";e.exports=a.p+"images/cloud-81ac85ba680343200f54.svg"},3815:(e,t,a)=>{"use strict";e.exports=a.p+"images/empty-avatar-fea23feddfa99b07c2e8.svg"},9182:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-9de1caef5eb5c22da5d6.svg"},4730:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-manage-3a7ecaa604823c98c3cf.svg"},5610:(e,t,a)=>{"use strict";e.exports=a.p+"images/boost-a54137485af36fdffe9c.png"},4763:(e,t,a)=>{"use strict";e.exports=a.p+"images/crm-7e7684ae2c40327d8fed.png"},2605:(e,t,a)=>{"use strict";e.exports=a.p+"images/extras-26daf36507504c96d066.png"},1488:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-ai-1a265a198f75543e342e.png"},720:(e,t,a)=>{"use strict";e.exports=a.p+"images/search-f9756bd9c926d905fe70.png"},1657:(e,t,a)=>{"use strict";e.exports=a.p+"images/social-e3fb80b2f32534fefe63.png"},7690:(e,t,a)=>{"use strict";e.exports=a.p+"images/stats-9802380852610a4d5908.png"},1439:(e,t,a)=>{"use strict";e.exports=a.p+"images/videopress-9591093a9a238cc48a35.png"},4462: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"}},9196:e=>{"use strict";e.exports=window.React},6989:e=>{"use strict";e.exports=window.wp.apiFetch},5609:e=>{"use strict";e.exports=window.wp.components},4333:e=>{"use strict";e.exports=window.wp.compose},9818:e=>{"use strict";e.exports=window.wp.data},9771:e=>{"use strict";e.exports=window.wp.date},9307:e=>{"use strict";e.exports=window.wp.element},5736:e=>{"use strict";e.exports=window.wp.i18n},444:e=>{"use strict";e.exports=window.wp.primitives},6483:e=>{"use strict";e.exports=window.wp.url},2674:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";a.d(t,{j:()=>r});var n=a(2486),c=a(1356),r=new class extends n.l{#e;#t;#a;constructor(){super(),this.#a=e=>{if(!c.sk&&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}}},2344:(e,t,a)=>{"use strict";a.d(t,{Gm:()=>c});var n=a(1356);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||[],o=t.state.data?.pageParams||[],l={pages:[],pageParams:[]};let u=!1;const d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),m=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 d(r),{maxPages:o}=t.options,l=c?n.Ht:n.VX;return{pages:l(e.pages,i,o),pageParams:l(e.pageParams,a,o)}};let p;if(c&&i.length){const e="backward"===c,t={pages:i,pageParams:o},n=(e?s:r)(a,t);p=await m(t,n,e)}else{p=await m(l,o[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)}},4133:(e,t,a)=>{"use strict";a.d(t,{R:()=>i,m:()=>s});var n=a(6673),c=a(9992),r=a(3963),s=class extends c.F{#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.Mz)({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.Kw)(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.V.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}}},9344:(e,t,a)=>{"use strict";a.d(t,{L:()=>i});var n=a(6673),c=a(4133),r=a(1356),s=a(2486),i=class extends s.l{constructor(e={}){super(),this.config=e,this.#o=[],this.#l=0}#o;#l;#u;build(e,t,a){const n=new c.m({mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:a});return this.add(n),n}add(e){this.#o.push(e),this.notify({type:"added",mutation:e})}remove(e){this.#o=this.#o.filter((t=>t!==e)),this.notify({type:"removed",mutation:e})}clear(){n.V.batch((()=>{this.#o.forEach((e=>{this.remove(e)}))}))}getAll(){return this.#o}find(e){const t={exact:!0,...e};return this.#o.find((e=>(0,r.X7)(t,e)))}findAll(e={}){return this.#o.filter((t=>(0,r.X7)(e,t)))}notify(e){n.V.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){return this.#u=(this.#u??Promise.resolve()).then((()=>{const e=this.#o.filter((e=>e.state.isPaused));return n.V.batch((()=>e.reduce(((e,t)=>e.then((()=>t.continue().catch(r.ZT)))),Promise.resolve())))})).then((()=>{this.#u=void 0})),this.#u}}},8507:(e,t,a)=>{"use strict";a.d(t,{X:()=>i});var n=a(4133),c=a(6673),r=a(2486),s=a(1356),i=class extends r.l{#d;#m=void 0;#p;#h;constructor(e,t){super(),this.#d=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.#d.defaultMutationOptions(e),(0,s.VS)(t,this.options)||this.#d.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#p,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.Ym)(t.mutationKey)!==(0,s.Ym)(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.#m}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.#d.getMutationCache().build(this.#d,this.options),this.#p.addObserver(this),this.#p.execute(e)}#g(){const e=this.#p?.state??(0,n.R)();this.#m={...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.V.batch((()=>{if(this.#h&&this.hasListeners()){const t=this.#m.variables,a=this.#m.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.#m)}))}))}}},6673:(e,t,a)=>{"use strict";a.d(t,{V:()=>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}}}()},5433:(e,t,a)=>{"use strict";a.d(t,{N:()=>r});var n=a(2486),c=a(1356),r=new class extends n.l{#f=!0;#t;#a;constructor(){super(),this.#a=e=>{if(!c.sk&&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}}},3749:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(1356),c=a(6673),r=a(3963),s=a(9992),i=class extends s.F{#w;#k;#E;#y;#s;#n;#c;#b;constructor(e){super(),this.#b=!1,this.#c=e.defaultOptions,this.#_(e.options),this.#n=[],this.#E=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}#_(e){this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.#n.length||"idle"!==this.state.fetchStatus||this.#E.remove(this)}setData(e,t){const a=(0,n.oE)(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.ZT).catch(n.ZT):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.Kp)(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.#E.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.#b?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#E.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.#_(e),!this.options.queryFn){const e=this.#n.find((e=>e.options.queryFn));e&&this.#_(e.options)}const a=new AbortController,n={queryKey:this.queryKey,meta:this.meta},c=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#b=!0,a.signal)})};c(n);const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.#b=!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.#k=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.DV)(e)&&e.silent||this.#i({type:"error",error:e}),(0,r.DV)(e)||(this.#E.config.onError?.(e,this),this.#E.config.onSettled?.(this.state.data,e,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#s=(0,r.Mz)({fn:s.fetchFn,abort:a.abort.bind(a),onSuccess:e=>{void 0!==e?(this.setData(e),this.#E.config.onSuccess?.(e,this),this.#E.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.Kw)(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.DV)(a)&&a.revert&&this.#k?{...this.#k,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.V.batch((()=>{this.#n.forEach((e=>{e.onQueryUpdate()})),this.#E.notify({query:this,type:"updated",action:e})}))}}},77:(e,t,a)=>{"use strict";a.d(t,{t:()=>i});var n=a(1356),c=a(3749),r=a(6673),s=a(2486),i=class extends s.l{constructor(e={}){super(),this.config=e,this.#j=new Map}#j;build(e,t,a){const r=t.queryKey,s=t.queryHash??(0,n.Rm)(r,t);let i=this.get(s);return i||(i=new c.A({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.V.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.MD)(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>(0,n.MD)(e,t))):t}notify(e){r.V.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){r.V.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){r.V.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}}},5229:(e,t,a)=>{"use strict";a.d(t,{S:()=>u});var n=a(1356),c=a(77),r=a(9344),s=a(3355),i=a(5433),o=a(6673),l=a(2344),u=class{#C;#r;#c;#N;#R;#Z;#x;#z;constructor(e={}){this.#C=e.queryCache||new c.t,this.#r=e.mutationCache||new r.L,this.#c=e.defaultOptions||{},this.#N=new Map,this.#R=new Map,this.#Z=0}mount(){this.#Z++,1===this.#Z&&(this.#x=s.j.subscribe((()=>{s.j.isFocused()&&(this.resumePausedMutations(),this.#C.onFocus())})),this.#z=i.N.subscribe((()=>{i.N.isOnline()&&(this.resumePausedMutations(),this.#C.onOnline())})))}unmount(){this.#Z--,0===this.#Z&&(this.#x?.(),this.#x=void 0,this.#z?.(),this.#z=void 0)}isFetching(e){return this.#C.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){return this.#C.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.#C.find({queryKey:e}),r=c?.state.data,s=(0,n.SE)(t,r);if(void 0===s)return;const i=this.defaultQueryOptions({queryKey:e});return this.#C.build(this,i).setData(s,{...a,manual:!0})}setQueriesData(e,t,a){return o.V.batch((()=>this.getQueryCache().findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,a)]))))}getQueryState(e){return this.#C.find({queryKey:e})?.state}removeQueries(e){const t=this.#C;o.V.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const a=this.#C,n={type:"active",...e};return o.V.batch((()=>(a.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries(n,t))))}cancelQueries(e={},t={}){const a={revert:!0,...t},c=o.V.batch((()=>this.#C.findAll(e).map((e=>e.cancel(a)))));return Promise.all(c).then(n.ZT).catch(n.ZT)}invalidateQueries(e={},t={}){return o.V.batch((()=>{if(this.#C.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=o.V.batch((()=>this.#C.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,a);return a.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(c).then(n.ZT)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const a=this.#C.build(this,t);return a.isStaleByTime(t.staleTime)?a.fetch(t):Promise.resolve(a.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=(0,l.Gm)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}resumePausedMutations(){return this.#r.resumePausedMutations()}getQueryCache(){return this.#C}getMutationCache(){return this.#r}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#N.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#N.values()];let a={};return t.forEach((t=>{(0,n.to)(e,t.queryKey)&&(a={...a,...t.defaultOptions})})),a}setMutationDefaults(e,t){this.#R.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#R.values()];let a={};return t.forEach((t=>{(0,n.to)(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.Rm)(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.#C.clear(),this.#r.clear()}}},4e3:(e,t,a)=>{"use strict";a.d(t,{z:()=>o});var n=a(1356),c=a(6673),r=a(3355),s=a(2486),i=a(3963),o=class extends s.l{constructor(e,t){super(),this.options=t,this.#d=e,this.#S=null,this.bindMethods(),this.setOptions(t)}#d;#M=void 0;#L=void 0;#m=void 0;#P;#A;#S;#V;#H;#O;#I;#B;#T;#U=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#M.addObserver(this),l(this.#M,this.options)?this.#F():this.updateResult(),this.#D())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return u(this.#M,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return u(this.#M,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#q(),this.#J(),this.#M.removeObserver(this)}setOptions(e,t){const a=this.options,c=this.#M;if(this.options=this.#d.defaultQueryOptions(e),(0,n.VS)(a,this.options)||this.#d.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#M,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.#G();const r=this.hasListeners();r&&d(this.#M,c,this.options,a)&&this.#F(),this.updateResult(t),!r||this.#M===c&&this.options.enabled===a.enabled&&this.options.staleTime===a.staleTime||this.#W();const s=this.#Q();!r||this.#M===c&&this.options.enabled===a.enabled&&s===this.#T||this.#K(s)}getOptimisticResult(e){const t=this.#d.getQueryCache().build(this.#d,e),a=this.createResult(t,e);return function(e,t){if(!(0,n.VS)(e.getCurrentResult(),t))return!0;return!1}(this,a)&&(this.#m=a,this.#A=this.options,this.#P=this.#M.state),a}getCurrentResult(){return this.#m}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.#M}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#d.defaultQueryOptions(e),a=this.#d.getQueryCache().build(this.#d,t);return a.isFetchingOptimistic=!0,a.fetch().then((()=>this.createResult(a,t)))}fetch(e){return this.#F({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#m)))}#F(e){this.#G();let t=this.#M.fetch(this.options,e);return e?.throwOnError||(t=t.catch(n.ZT)),t}#W(){if(this.#q(),n.sk||this.#m.isStale||!(0,n.PN)(this.options.staleTime))return;const e=(0,n.Kp)(this.#m.dataUpdatedAt,this.options.staleTime)+1;this.#I=setTimeout((()=>{this.#m.isStale||this.updateResult()}),e)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#M):this.options.refetchInterval)??!1}#K(e){this.#J(),this.#T=e,!n.sk&&!1!==this.options.enabled&&(0,n.PN)(this.#T)&&0!==this.#T&&(this.#B=setInterval((()=>{(this.options.refetchIntervalInBackground||r.j.isFocused())&&this.#F()}),this.#T))}#D(){this.#W(),this.#K(this.#Q())}#q(){this.#I&&(clearTimeout(this.#I),this.#I=void 0)}#J(){this.#B&&(clearInterval(this.#B),this.#B=void 0)}createResult(e,t){const a=this.#M,c=this.options,r=this.#m,s=this.#P,o=this.#A,u=e!==a?e.state:this.#L,{state:p}=e;let h,{error:g,errorUpdatedAt:v,fetchStatus:f,status:w}=p,k=!1;if(t._optimisticResults){const n=this.hasListeners(),r=!n&&l(e,t),s=n&&d(e,a,t,c);(r||s)&&(f=(0,i.Kw)(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.#V)h=this.#H;else try{this.#V=t.select,h=t.select(p.data),h=(0,n.oE)(r?.data,h,t),this.#H=h,this.#S=null}catch(e){this.#S=e}else h=p.data;if(void 0!==t.placeholderData&&void 0===h&&"pending"===w){let e;if(r?.isPlaceholderData&&t.placeholderData===o?.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.#S=null}catch(e){this.#S=e}void 0!==e&&(w="success",h=(0,n.oE)(r?.data,e,t),k=!0)}this.#S&&(g=this.#S,h=this.#H,v=Date.now(),w="error");const E="fetching"===f,y="pending"===w,b="error"===w,_=y&&E;return{status:w,fetchStatus:f,isPending:y,isSuccess:"success"===w,isError:b,isInitialLoading:_,isLoading:_,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:E,isRefetching:E&&!y,isLoadingError:b&&0===p.dataUpdatedAt,isPaused:"paused"===f,isPlaceholderData:k,isRefetchError:b&&0!==p.dataUpdatedAt,isStale:m(e,t),refetch:this.refetch}}updateResult(e){const t=this.#m,a=this.createResult(this.#M,this.options);if(this.#P=this.#M.state,this.#A=this.options,void 0!==this.#P.data&&(this.#O=this.#M),(0,n.VS)(a,t))return;this.#m=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.#m).some((e=>{const a=e;return this.#m[a]!==t[a]&&n.has(a)}))})()&&(c.listeners=!0),this.#v({...c,...e})}#G(){const e=this.#d.getQueryCache().build(this.#d,this.options);if(e===this.#M)return;const t=this.#M;this.#M=e,this.#L=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#D()}#v(e){c.V.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#m)})),this.#d.getQueryCache().notify({query:this.#M,type:"observerResultsUpdated"})}))}};function l(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&&m(e,t)}return!1}function d(e,t,a,n){return!1!==a.enabled&&(e!==t||!1===n.enabled)&&(!a.suspense||"error"!==e.state.status)&&m(e,a)}function m(e,t){return e.isStaleByTime(t.staleTime)}},9992:(e,t,a)=>{"use strict";a.d(t,{F:()=>c});var n=a(1356),c=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.PN)(this.gcTime)&&(this.#$=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.sk?1/0:3e5))}clearGcTimeout(){this.#$&&(clearTimeout(this.#$),this.#$=void 0)}}},3963:(e,t,a)=>{"use strict";a.d(t,{DV:()=>l,Kw:()=>i,Mz:()=>u});var n=a(3355),c=a(5433),r=a(1356);function s(e){return Math.min(1e3*2**e,3e4)}function i(e){return"online"!==(e??"online")||c.N.isOnline()}var o=class{constructor(e){this.revert=e?.revert,this.silent=e?.silent}};function l(e){return e instanceof o}function u(e){let t,a,l,u=!1,d=0,m=!1;const p=new Promise(((e,t)=>{a=e,l=t})),h=()=>!n.j.isFocused()||"always"!==e.networkMode&&!c.N.isOnline(),g=n=>{m||(m=!0,e.onSuccess?.(n),t?.(),a(n))},v=a=>{m||(m=!0,e.onError?.(a),t?.(),l(a))},f=()=>new Promise((a=>{t=e=>{const t=m||!h();return t&&a(e),t},e.onPause?.()})).then((()=>{t=void 0,m||e.onContinue?.()})),w=()=>{if(m)return;let t;try{t=e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(g).catch((t=>{if(m)return;const a=e.retry??(r.sk?0:3),n=e.retryDelay??s,c="function"==typeof n?n(d,t):n,i=!0===a||"number"==typeof a&&d{if(h())return f()})).then((()=>{u?v(t):w()}))):v(t)}))};return i(e.networkMode)?w():f().then(w),{promise:p,cancel:t=>{m||(v(new o(t)),e.abort?.())},continue:()=>{const e=t?.();return e?p:Promise.resolve()},cancelRetry:()=>{u=!0},continueRetry:()=>{u=!1}}}},2486:(e,t,a)=>{"use strict";a.d(t,{l:()=>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(){}}},1356:(e,t,a)=>{"use strict";a.d(t,{Ht:()=>y,Kp:()=>i,MD:()=>o,PN:()=>s,Rm:()=>u,SE:()=>r,VS:()=>h,VX:()=>E,X7:()=>l,Ym:()=>d,ZT:()=>c,_v:()=>w,oE:()=>k,sk:()=>n,to:()=>m});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 o(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(!m(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 l(e,t){const{exact:a,status:n,predicate:c,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(a){if(d(t.options.mutationKey)!==d(r))return!1}else if(!m(t.options.mutationKey,r))return!1}return(!n||t.state.status===n)&&!(c&&!c(t))}function u(e,t){return(t?.queryKeyHashFn||d)(e)}function d(e){return JSON.stringify(e,((e,t)=>v(t)?Object.keys(t).sort().reduce(((e,a)=>(e[a]=t[a],e)),{}):t))}function m(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((a=>!m(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 o=0;for(let c=0;c{setTimeout(t,e)}))}function k(e,t,a){return"function"==typeof a.structuralSharing?a.structuralSharing(e,t):!1!==a.structuralSharing?p(e,t):t}function E(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}},1696:(e,t,a)=>{"use strict";a.d(t,{NL:()=>s,aH:()=>i});var n=a(9196),c=a(275),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}))},7503:(e,t,a)=>{"use strict";a.d(t,{_:()=>s});var n=a(9196);a(275);function c(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var r=n.createContext(c()),s=()=>n.useContext(r)},4974:(e,t,a)=>{"use strict";a.d(t,{JN:()=>s,KJ:()=>i,pf:()=>r});var n=a(9196),c=a(4966),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.L)(a,[e.error,n])},5826:(e,t,a)=>{"use strict";a.d(t,{S:()=>r});var n=a(9196),c=n.createContext(!1),r=()=>n.useContext(c);c.Provider},4243:(e,t,a)=>{"use strict";a.d(t,{Fb:()=>n,SB:()=>c,j8:()=>r});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()}))},1841:(e,t,a)=>{"use strict";a.d(t,{r:()=>u});var n=a(9196),c=a(6673),r=a(7503),s=a(1696),i=a(5826),o=a(4974),l=a(4243);function u(e,t,a){const u=(0,s.NL)(a),d=(0,i.S)(),m=(0,r._)(),p=u.defaultQueryOptions(e);p._optimisticResults=d?"isRestoring":"optimistic",(0,l.Fb)(p),(0,o.pf)(p,m),(0,o.JN)(m);const[h]=n.useState((()=>new t(u,p))),g=h.getOptimisticResult(p);if(n.useSyncExternalStore(n.useCallback((e=>{const t=d?()=>{}:h.subscribe(c.V.batchCalls(e));return h.updateResult(),t}),[h,d]),(()=>h.getCurrentResult()),(()=>h.getCurrentResult())),n.useEffect((()=>{h.setOptions(p,{listeners:!1})}),[p,h]),(0,l.SB)(p,g))throw(0,l.j8)(p,h,m);if((0,o.KJ)({result:g,errorResetBoundary:m,throwOnError:p.throwOnError,query:u.getQueryCache().get(p.queryHash)}))throw g.error;return p.notifyOnChangeProps?g:h.trackResult(g)}},2016:(e,t,a)=>{"use strict";a.d(t,{D:()=>o});var n=a(9196),c=a(8507),r=a(6673),s=a(1696),i=a(4966);function o(e,t){const a=(0,s.NL)(t),[o]=n.useState((()=>new c.X(a,e)));n.useEffect((()=>{o.setOptions(e)}),[o,e]);const u=n.useSyncExternalStore(n.useCallback((e=>o.subscribe(r.V.batchCalls(e))),[o]),(()=>o.getCurrentResult()),(()=>o.getCurrentResult())),d=n.useCallback(((e,t)=>{o.mutate(e,t).catch(l)}),[o]);if(u.error&&(0,i.L)(o.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:d,mutateAsync:u.mutate}}function l(){}},5885:(e,t,a)=>{"use strict";a.d(t,{a:()=>r});var n=a(4e3),c=a(1841);function r(e,t){return(0,c.r)(e,n.z,t)}},4966:(e,t,a)=>{"use strict";function n(e,t){return"function"==typeof e?e(...t):!!e}a.d(t,{L:()=>n})},8288:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(6895),c=a(9307),r=a(5736),s=a(3059),i=a(9196),o=a(9430);const __=r.__,l=e=>{const{productId:t,siteRawUrl:a}=e,r=`https://cloud.jetpack.com/landing/${a}`,s=(0,o.F)(t),l={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.Z)("jetpack-social-sig-support-page"),target:"_blank",rel:"noreferrer"}),br:i.createElement("br",null),link:i.createElement("a",{href:(0,n.Z)("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.Z)("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,l[s].title," ",String.fromCodePoint(127881)),i.createElement("p",null,l[s].text))};l.propTypes={dashboardUrl:s.string,productId:s.number};const u=l},9430:(e,t,a)=>{"use strict";a.d(t,{F:()=>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"}},2180:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(6989),c=a(9307);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&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].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(8275),t=a(5229),n=a(1696),c=a(9307),r=a(9196),s=a.n(r),i=a(6417),o=a(9997),l=a(1899),u=a(6317),d=a(8966),m=a(8093),p=a(4257),h=a(4517),g=a(673),v=a(8209),f=a(8437),w=a(1838);a(5878);function k(){const e=(0,i.TH)();return(0,r.useEffect)((()=>window.scrollTo(0,0)),[e]),null}const E=()=>{const a=new t.S,{loadAddLicenseScreen:c}=(0,w.$9)();return s().createElement(e.ZP,null,s().createElement(f.Z,null,s().createElement(n.aH,{client:a},s().createElement(o.UT,null,s().createElement(k,null),s().createElement(i.Z5,null,s().createElement(i.AW,{path:v.xB.Home,element:s().createElement(d.Z,null)}),s().createElement(i.AW,{path:v.xB.Connection,element:s().createElement(u.Z,null)}),s().createElement(i.AW,{path:v.xB.AddAkismet,element:s().createElement(m.q,null)}),s().createElement(i.AW,{path:v.xB.AddAntiSpam,element:s().createElement(i.Fg,{replace:!0,to:v.xB.AddAkismet})}),s().createElement(i.AW,{path:v.xB.AddBackup,element:s().createElement(m.qA,null)}),s().createElement(i.AW,{path:v.xB.AddBoost,element:s().createElement(m.WJ,null)}),s().createElement(i.AW,{path:v.xB.AddCRM,element:s().createElement(m.B$,null)}),s().createElement(i.AW,{path:v.xB.AddCreator,element:s().createElement(m.Wf,null)}),s().createElement(i.AW,{path:v.xB.AddJetpackAI,element:s().createElement(p.Z,null)}),s().createElement(i.AW,{path:v.xB.AddExtras,element:s().createElement(m.Yi,null)}),s().createElement(i.AW,{path:v.xB.AddProtect,element:s().createElement(m.jO,null)}),s().createElement(i.AW,{path:v.xB.AddScan,element:s().createElement(m.Q5,null)}),s().createElement(i.AW,{path:v.xB.AddSocial,element:s().createElement(m.y$,null)}),s().createElement(i.AW,{path:v.xB.AddSearch,element:s().createElement(m.uw,null)}),s().createElement(i.AW,{path:v.xB.AddVideoPress,element:s().createElement(m.Jw,null)}),s().createElement(i.AW,{path:v.xB.AddStats,element:s().createElement(m.r,null)}),c&&s().createElement(i.AW,{path:v.xB.AddLicense,element:s().createElement(l.Z,null)}),s().createElement(i.AW,{path:v.xB.RedeemToken,element:s().createElement(g.Z,null)}),s().createElement(i.AW,{path:"/redeem-token",element:s().createElement(g.Z,null)}),s().createElement(i.AW,{path:"/jetpack-ai",element:s().createElement(h.Z,null)}))))))};!function(){const e=document.getElementById("my-jetpack-container");null!==e&&(0,c.createRoot)(e).render(s().createElement(E,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 deleted file mode 100644 index f10fd1af..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js.LICENSE.txt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 - */ - -/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ - -/** - * @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. - */ - -/** - * @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 deleted file mode 100644 index a691547a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.rtl.css +++ /dev/null @@ -1 +0,0 @@ -#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}.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}.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}.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)}.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)}.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:calc(var(--spacing-base)*3);min-height:28px;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}.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}}@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}}.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}.sexr0jUxC1jVixdKiDnC{margin-right:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-right:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.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}.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}.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}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off);padding-top:1px}.biqv3OiSCRunE35s4DC6{position:relative}.biqv3OiSCRunE35s4DC6>.T0VRsfCJrRslmORTYa8X{overflow:hidden;padding:0}.biqv3OiSCRunE35s4DC6>.T0VRsfCJrRslmORTYa8X: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}.biqv3OiSCRunE35s4DC6>.v77JdlkwyPAXfzeRW4DQ{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)}.biqv3OiSCRunE35s4DC6>.v77JdlkwyPAXfzeRW4DQ:focus,.biqv3OiSCRunE35s4DC6>.v77JdlkwyPAXfzeRW4DQ:hover{background-color:var(--jp-white)}.UQccyTHMg7XnAWr5VSGt{margin-top:24px}.SpY2tzcf1aTWPaBpAaQU{padding:0}._G5mdH1mZpQzrtTJKHAO{padding:24px 16px}@media screen and (min-width:600){._G5mdH1mZpQzrtTJKHAO{padding:32px 24px}}@media screen and (min-width:960px){._G5mdH1mZpQzrtTJKHAO{padding:48px 48px 48px 12px}}.g2nzjIQcPzgwZqW4523t{background-image:url(images/site-cards-143fca7aec7a8c370e82.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){.g2nzjIQcPzgwZqW4523t{background-image:url(images/site-cards-143fca7aec7a8c370e82.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}}.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%}.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%}.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}.wm7Alh6CwbsWkVSODgI2{margin-top:calc(var(--spacing-base)/2)}.qpN923qyxjI06NCgFC8j>li{margin-bottom: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__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>button{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>button: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}.components-popover{max-width:340px;min-height:150px;width:calc(100% - 63px)}@media(min-width:783px){.components-popover{width:100%}}.components-popover__content{padding:24px;width:100%}.components-popover__content 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)}@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%}.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)}.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)}@keyframes R2i0K45dEF157drbVRPI{0%{opacity:.6}50%{opacity:1}to{opacity:.6}}.NisihrgiIKl_knpYJtfg{animation:R2i0K45dEF157drbVRPI 1.5s infinite;background-color:var(--jp-gray);height:100%;width:100%}.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}.cAbGtJDGgLubucBnz7vM{background-color:var(--jp-white)}.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}.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}.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);border-radius:50%!important}.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);border-radius:50%}.cbOwD8Y4tFjwimmtchQI.cL3m0xBYTYhIKI7lCqDB{fill:var(--color-instagram)}.cbOwD8Y4tFjwimmtchQI.fftumuc_lJ6v0tq4UMVR{fill:var(--color-whatsapp)}.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}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .MdTRfQ3eo5qZKChZlzNj{width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .PbEpL02SEH9VNAlbKCfV{width:30px}.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 .rq8YRaj9OyUUXJUHiUgI{border-color:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .YZ7FNKEm9qpvQ4ZkbAz5{transform:rotate(-180deg)}.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)}.jp-connection__manage-dialog{--spacing-base:8px;border-radius:3px;margin:auto;width:1200px}.jp-connection__manage-dialog__content{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:center;padding:80px;text-align:center}.jp-connection__manage-dialog__content h1{font-size:var(--font-title-large);font-weight:700;line-height:1.2;margin:0}.jp-connection__manage-dialog__large-text{font-size:1.25rem;font-weight:600;margin-bottom:calc(var(--spacing-base)*4);margin-top:calc(var(--spacing-base)*3);max-width:60%}.jp-connection__manage-dialog__actions{align-items:center;background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;box-sizing:border-box;margin:0!important;max-width:1200px!important;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*5);position:sticky}.jp-connection__manage-dialog__link{color:var(--jp-black)}.jp-connection__manage-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__manage-dialog__link:focus{color:var(--jp-black)}.jp-connection__manage-dialog__button-wrap button{float:left}.jp-connection__manage-dialog__action-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:var(--spacing-base) auto;max-width:100%;padding:1rem 2rem;text-align:right;width:750px}.jp-connection__manage-dialog__action-card__card-headline{font-size:var(--font-body);font-weight:600;line-height:calc(var(--spacing-base)*3);text-decoration:none}.jp-connection__manage-dialog__action-card__icon{float:left}.jp-connection__manage-dialog__action-card .transfer{color:var(--jp-black);fill:var(--jp-black)}.jp-connection__manage-dialog__action-card .disconnect{color:var(--jp-red);fill:var(--jp-red)}.jp-connection__manage-dialog .components-modal__header{display:none}.jp-connection__manage-dialog .components-modal__content{margin:0;padding:0}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-small);font-weight:600;line-height:1.2;margin-top:0}.jp-connection__disconnect-dialog h2{font-size:var(--font-title-small);font-weight:400;line-height:1.2;margin:0}.jp-connection__disconnect-dialog p{font-size:var(--font-body);margin-top:0}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.25rem}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link,.jp-connection__disconnect-dialog__link{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:hover,.jp-connection__disconnect-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:focus,.jp-connection__disconnect-dialog__link:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link--bold,.jp-connection__disconnect-dialog__link--bold{font-weight:700}.jp-connection__disconnect-dialog .components-button{border-radius:4px;font-size:var(--font-body-small);height:40px}.jp-connection__disconnect-dialog .components-modal__content{display:flex;flex-direction:column;flex-grow:1;margin:0;padding:0}.jp-connection__disconnect-dialog .components-modal__content:before,.jp-connection__disconnect-dialog .components-modal__header{display:none}.jp-connection__disconnect-dialog .jp-row{align-items:center;width:calc(100% - 48px)}.jp-connection__disconnect-dialog__content{align-items:center;background:var(--jp-white-off);border-radius:4px;display:flex;flex-direction:column;flex-grow:1;justify-content:center;margin:0;padding:2rem 1rem;text-align:center}.jp-connection__disconnect-dialog__actions{background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;padding:2rem 0;position:sticky}.jp-connection__disconnect-dialog__actions p{margin-bottom:0}.jp-connection__disconnect-dialog__actions:before{background:linear-gradient(to bottom,transparent,var(--jp-white-off));bottom:calc(100% + 1px);content:"";display:block;height:80px;position:absolute;right:0;width:100%}.jp-connection__disconnect-dialog__btn-dismiss,.jp-connection__disconnect-dialog__btn-dismiss.components-button{background:var(--jp-black)!important;margin-left:10px}.jp-connection__disconnect-dialog__btn-disconnect{background:var(--jp-red)!important}.jp-connection__disconnect-dialog__btn-back-to-wp{background:var(--jp-black)!important}.jp-connection__disconnect-dialog__button-wrap{text-align:right}@media(min-width:960px){.jp-connection__disconnect-dialog__button-wrap{text-align:center}}.jp-connection__disconnect-dialog__error{color:var(--jp-red)}.jp-connection__disconnect-dialog__survey{margin-bottom:1.5rem;max-width:100%}.jp-connection__disconnect-dialog__step-copy{margin:0 auto;max-width:800px}.jp-connection__disconnect-dialog__step-copy--narrow{max-width:600px}@media(max-height:900px){.jp-connection__disconnect-dialog__content .jp-components__decorative-card{display:none}}@media(min-width:600px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{max-width:calc(100% - 32px);width:100%}.jp-connection__disconnect-dialog__actions,.jp-connection__disconnect-dialog__content{padding:2rem}}@media(min-width:960px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{display:flex;flex-direction:column;height:900px;width:1200px}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-large)}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.5rem}.jp-connection__disconnect-dialog__content{padding:80px}.jp-connection__disconnect-dialog__actions{padding:2rem 3rem}.jp-row{margin-right:0}}.jp-connection__disconnect-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:0 auto 1rem;max-width:100%;padding:1rem 2rem;text-align:right;width:800px}.jp-connection__disconnect-card__group{margin-bottom:1rem;max-width:100%}.jp-connection__disconnect-card__card-content{display:block;font-size:.875rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-content{align-items:center;display:flex;justify-content:space-between}}.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{flex-shrink:0;font-size:1.25rem;font-weight:600;margin-bottom:0;margin-top:0}@media only screen and (min-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{font-size:1.5rem;margin-left:1.5rem}}@media only screen and (max-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block,.jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block{margin-top:.5rem}}.jp-connection__disconnect-card__card-stat-block{align-items:baseline;display:flex;flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat-block{flex-direction:row-reverse}}.jp-connection__disconnect-card__card-description{flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-description{text-align:left}}.jp-connection__disconnect-card__card-stat{font-size:1rem;font-weight:600;margin-left:.5rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat{font-size:1.5rem;margin-left:0;margin-right:1rem}}.jp-components__decorative-card{border-radius:8px;box-shadow:0 0 15px var(--jp-gray);display:flex;height:280px;margin:0 auto 3rem;max-width:100%;overflow:hidden;position:relative;width:360px}.jp-components__decorative-card__content,.jp-components__decorative-card__image{width:50%}.jp-components__decorative-card__image{background:var(--jp-gray);background-size:cover;position:relative}.jp-components__decorative-card__image:before{background-image:url('data:image/svg+xml;uf8,');content:"";display:block;height:8px;position:absolute;right:24px;top:24px;width:38px}.jp-components__decorative-card__content{background:#fff;padding:2rem}.jp-components__decorative-card__icon-container{background:var(--jp-red);border-radius:50px;height:80px;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);width:80px}.jp-components__decorative-card__icon{background-position:50%,50%;background-repeat:no-repeat;height:40px;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);width:40px}.jp-components__decorative-card__icon--unlink{background-image:url('data:image/svg+xml;uf8, ')}.jp-components__decorative-card__lines,.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{background:#e9eff5;border-radius:6px;display:block;height:12px;position:relative;width:100%}.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{content:"";top:calc(100% + 16px)}.jp-components__decorative-card__lines:after{top:calc(100% + 32px);width:75%}.jp-components__decorative-card--vertical{flex-direction:column}.jp-components__decorative-card--vertical .jp-components__decorative-card__content,.jp-components__decorative-card--vertical .jp-components__decorative-card__image{height:50%;width:100%}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines{margin-left:auto;margin-right:auto;max-width:135px}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:after,.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:before{margin-left:auto;margin-right:auto}.jp-connect__disconnect-survey-card{border:2px solid transparent;border-radius:4px;box-shadow:0 0 15px var(--jp-gray-off);margin-left:auto;margin-right:auto;max-width:100%;padding:1rem;position:relative;text-align:right;width:800px}.jp-connect__disconnect-survey-card--selected{background:var(--jp-gray-off);border-color:var(--jp-black)}.jp-connect__disconnect-survey-card:after{border-left:2px solid var(--jp-black);border-top:2px solid var(--jp-black);content:"";display:block;height:5px;left:1.5rem;position:absolute;top:50%;transform:translateY(-50%) rotate(-45deg);width:5px}.jp-connect__disconnect-survey-card:hover{cursor:pointer}.jp-connect__disconnect-survey-card:focus:not(.jp-disconnect-survey-card--selected),.jp-connect__disconnect-survey-card:hover:not(.jp-disconnect-survey-card--selected){border-color:var(--jp-black-80)}.jp-connect__disconnect-survey-card__answer{align-items:center;display:flex;font-weight:700;margin:0}input.jp-connect__disconnect-survey-card__input{-webkit-appearance:none;background-color:transparent;border:none;color:var(--jp-black-80);flex-grow:1;max-width:calc(100% - 40px);padding-left:40px}.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:16px;width:60%}._RT41NE3LU4R0ubcij2y{align-items:center;display:flex}._RT41NE3LU4R0ubcij2y li{background:none!important;margin:0!important;padding:0!important}.cFGWJeRiGHjAr8D7CWJW{margin-left:8px;max-width:110px}.Iz3l7a05TP6HK9S92TIL{width:16px}.lmQ0wFmnk4kKkGVjokPA{height:18px;margin-right:8px}.AoIs8wD92wKR8RpQj6Uc{align-items:center;display:inline-flex}.rV_5QyvhDnsVjCX4pb0h{--gray-90:#1e1e1e;fill:var(--gray-90);width:24px}.MO1jDNY8VPqeNS9xL8jE{align-items:center;display:flex;text-decoration:none}.jp-connection__connect-screen{--spacing-base:8px}.jp-connection__connect-screen__loading{display:none}.jp-connection__connect-screen .terms-of-service{margin-bottom:calc(var(--spacing-base)*3);margin-top:calc(var(--spacing-base)*4);max-width:360px}.jp-connection__connect-screen .terms-of-service a{text-decoration:underline}.jp-connection__connect-screen .jp-action-button{margin-top:40px}.jp-connection__connect-screen .jp-action-button--button{border-radius:4px;font-weight:600}.jp-connection__connect-screen .jp-action-button button{max-width:100%}.jp-connection__connect-screen .jp-action-button button:disabled{color:hsla(0,0%,100%,.4)}@media(max-width:782px){.jp-connection__connect-screen .jp-action-button button{max-width:none;width:100%}}.jp-connection__connect-screen__loading-message{position:absolute;clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}.jp-connection__connect-screen__loading-message:empty{display:none}.jp-connection__connect-screen__footer{margin-top:32px}.jp-connection__connect-screen-layout{background:var(--jp-white);border-radius:4px;box-shadow:0 0 40px rgba(0,0,0,.08)}.jp-connection__connect-screen-layout__loading{display:none}.jp-connection__connect-screen-layout__left,.jp-connection__connect-screen-layout__right{box-sizing:border-box}.jp-connection__connect-screen-layout__left{padding:calc(var(--spacing-base)*3)}@media(min-width:600px){.jp-connection__connect-screen-layout__left{padding:64px 96px}}.jp-connection__connect-screen-layout__left .jetpack-logo{margin-bottom:24px}.jp-connection__connect-screen-layout__left h2{color:var(--jp-black);font-size:36px;font-style:normal;font-weight:700;line-height:40px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left h3{color:var(--jp-black);font-size:24px;font-style:normal;font-weight:500;line-height:32px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left li,.jp-connection__connect-screen-layout__left p{font-size:16px;font-style:normal;font-weight:400;line-height:24px}.jp-connection__connect-screen-layout__left p{color:#101517;margin:16px 0}.jp-connection__connect-screen-layout__left a{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__connect-screen-layout__left a:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__connect-screen-layout__left a:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__connect-screen-layout__left ul{list-style-type:none;padding:0}.jp-connection__connect-screen-layout__left ul li{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEwFnwUInggGnggGnggHnAcAnwUFnQcAnwcGnwkFnQgGnQgFnwcGnQYFnQcFnAcGnQkDnwdhiL0pAAAAEnRSTlMAMF//f2Aw7yBQ3+9gcIBgcED+HDbkAAAAZklEQVR4Ae3LNwICARDDQC0+cv7/Y8mwV9odSfWIcf/+VegnGkIvDaGXKvTTn/Gz+Uf5xTL0K1XotS7fs5H6GHvvaO8d7c3j7rdgHne/A/PYt/cO+R42oYdN6OEQetiFHo4A//6dAXqtBEkmtWutAAAAAElFTkSuQmCC) no-repeat;background-size:24px;color:var(--jp-black);margin-bottom:9px;padding-right:30px}.jp-connection__connect-screen-layout__right{padding:64px 0}.jp-connection__connect-screen-layout__right img{max-width:100%}.jp-connection__connect-screen-layout__two-columns{display:flex;flex-wrap:wrap}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:100%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:52%}}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{background:#f9f9f6;display:none;flex-basis:47%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{display:block}}.rna{overflow:hidden}.rna .jp-connection__connect-screen-layout__left{position:relative;z-index:2}.rna .jp-connection__connect-screen-layout__left h2{font-weight:700;margin-top:0}.rna .jp-connection__connect-screen-layout__left h3{margin-top:24px}@media(min-width:600px){.rna .jp-connection__connect-screen-layout__left{padding:4rem 4rem 4rem 6rem}}@media(min-width:1080px){.rna .jp-connection__connect-screen-required-plan__pricing-card{left:calc(var(--spacing-base)*-45);position:absolute;top:calc(var(--spacing-base)*9.25)}}.rna .jp-connection__connect-screen-required-plan__pricing-card .jp-components__pricing-card{border-radius:var(--jp-border-radius-rna);max-width:100%;width:425px}.rna .jp-connection__connect-screen-required-plan__pricing-card .jp-components__pricing-card__title{margin-top:.625rem}@media(min-width:960px){.rna .jp-connection__connect-screen-required-plan__pricing-card .jp-components__pricing-card{padding:3rem}}.rna .jp-connection__connect-screen-required-plan__pricing-card .components-button{margin-bottom:0}.rna .jp-backup-dashboard-promotion ul.jp-product-promote li{margin-bottom:.75rem}.rna .jp-connection__connect-screen-layout__color-blobs{clip-path:polygon(100% 0,100% 100%,0 0,0 0);display:none;height:677px;left:0;position:absolute;top:0;width:363px;z-index:1}.rna .jp-connection__connect-screen-layout__color-blobs__blue,.rna .jp-connection__connect-screen-layout__color-blobs__green,.rna .jp-connection__connect-screen-layout__color-blobs__yellow{border-radius:50%;filter:blur(50px);position:absolute}.rna .jp-connection__connect-screen-layout__color-blobs__blue{background-color:var(--jp-blue-5);height:400px;left:-100px;top:-275px;width:400px;z-index:3}.rna .jp-connection__connect-screen-layout__color-blobs__yellow{background-color:var(--jp-yellow-5);height:250px;left:-25px;top:10px;width:250px;z-index:2}.rna .jp-connection__connect-screen-layout__color-blobs__green{background-color:var(--jp-green-5);height:300px;left:0;top:175px;width:300px;z-index:1}@media(min-width:1080px){.rna .jp-connection__connect-screen-layout__color-blobs{display:initial}}.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)}.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}.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)}.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}.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}.q0T8YyQxRawhpDtvJjxI{background-color:var(--jp-white);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)}.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)}.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:400;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}.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%}.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-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}.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}}: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-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}.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)}}.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}} \ 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 deleted file mode 100644 index f59e0249..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/composer.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "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.2", - "automattic/jetpack-assets": "^2.1.11", - "automattic/jetpack-boost-speed-score": "^0.3.11", - "automattic/jetpack-connection": "^2.8.4", - "automattic/jetpack-jitm": "^3.1.11", - "automattic/jetpack-licensing": "^2.0.5", - "automattic/jetpack-plugins-installer": "^0.4.0", - "automattic/jetpack-redirect": "^2.0.2", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-plans": "^0.4.7", - "automattic/jetpack-status": "^3.2.0" - }, - "require-dev": { - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.4", - "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.24.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 deleted file mode 100644 index f5dece03..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/global.d.ts +++ /dev/null @@ -1,266 +0,0 @@ -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/i18n'; -declare module '@wordpress/icons'; - -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: { - isSiteConnected: boolean; - isUserConnected: boolean; - jetpackPlugins: Array< string >; - 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_paid_plan_for_product: boolean; - features_by_tier: Array< string >; - is_bundle: boolean; - is_plugin_active: 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; - 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; - }; - }; - 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: string; - supported_products: string[]; - tiers: string[]; - title: string; - wpcom_product_slug: string; - }; - }; - }; - 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-site-connection'?: null; - 'welcome-banner-active'?: null; - [ key: `${ string }-bad-installation` ]: { - data: { - plugin: string; - }; - }; - }; - topJetpackMenuItemUrl: string; - 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 deleted file mode 100644 index 0e59226d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php +++ /dev/null @@ -1,57 +0,0 @@ -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, - 1 - ); - } -} 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 deleted file mode 100644 index 1587410a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php +++ /dev/null @@ -1,689 +0,0 @@ -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' ) ); - // This is later than the admin-ui package, which runs on 1000 - add_action( 'admin_init', array( __CLASS__, 'maybe_show_red_bubble' ), 1001 ); - - // 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(); - - wp_localize_script( - 'my_jetpack_main_app', - 'myJetpackInitialState', - array( - 'products' => array( - 'items' => Products::get_products(), - ), - 'purchases' => array( - 'items' => array(), - ), - 'plugins' => Plugins_Installer::get_plugins(), - '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(), - 'isSiteConnected' => $connection->is_connected(), - 'isUserConnected' => $connection->is_user_connected(), - 'purchases' => self::get_purchases(), - 'modules' => self::get_active_modules(), - ), - 'redBubbleAlerts' => self::get_red_bubble_alerts(), - '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, - ) - ); - - 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 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; - }, - $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 $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? - $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() ); - } - 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(); - - 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 ); - } - - /** - * 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, 200 ); - } - - /** - * 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 - */ - 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 ), 200 ); - } - - /** - * Returns true if the site has file write access to the plugins folder, false otherwise. - * - * @return bool - **/ - 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 = self::get_red_bubble_alerts(); - - // 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; - } - - /** - * 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 ) { - $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'] = null; - return $red_bubble_slugs; - } else { - return self::alert_if_missing_site_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_site_connection( array $red_bubble_slugs ) { - if ( ! ( new Connection_Manager() )->is_connected() ) { - $red_bubble_slugs[ self::MISSING_SITE_CONNECTION_NOTIFICATION_KEY ] = null; - } - - 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 deleted file mode 100644 index be328394..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php +++ /dev/null @@ -1,124 +0,0 @@ - $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, - 100 - ); - } - - /** - * 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 deleted file mode 100644 index 35f798ac..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php +++ /dev/null @@ -1,195 +0,0 @@ - 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 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' => array( 'active', 'inactive', 'plugin_absent', 'needs_purchase', 'needs_purchase_or_free', 'needs_first_site_connection', 'user_connection_error', 'site_connection_error' ), - ), - '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 deleted file mode 100644 index 39698107..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php +++ /dev/null @@ -1,90 +0,0 @@ - \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 deleted file mode 100644 index d49585ca..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php +++ /dev/null @@ -1,147 +0,0 @@ - \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, 200 ); - } - - /** - * 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 array - */ - 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, 200 ); - } -} 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 deleted file mode 100644 index cb253ce1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php +++ /dev/null @@ -1,249 +0,0 @@ - \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 deleted file mode 100644 index ead44934..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php +++ /dev/null @@ -1,77 +0,0 @@ - \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-zendesk-chat.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php deleted file mode 100644 index f852433b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php +++ /dev/null @@ -1,122 +0,0 @@ - \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 deleted file mode 100644 index e4439084..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php +++ /dev/null @@ -1,273 +0,0 @@ -get_ip( true ); - $headers = array( - 'X-Forwarded-For' => $ip, - ); - - // If has a blog id, use connected endpoint. - - if ( $blog_id ) { - $endpoint = sprintf( '/sites/%d/products/?_locale=%s&type=jetpack', $blog_id, get_user_locale() ); - - $wpcom_request = Client::wpcom_json_api_request_as_blog( - $endpoint, - '1.1', - array( - 'method' => 'GET', - 'headers' => $headers, - ) - ); - } else { - $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 { - return 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 ) - ); - } - } - - /** - * 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() ); - 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; - } - $cache_date = get_user_meta( get_current_user_id(), self::CACHE_DATE_META_NAME, true ); - return time() - (int) $cache_date > ( 7 * 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; - } - - $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 ) ) { - return new WP_Error( 'purchases_state_fetch_failed' ); - } - - $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; - } -} 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 deleted file mode 100644 index b18bb5b1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php +++ /dev/null @@ -1,177 +0,0 @@ -product_slug, 'jetpack_anti_spam' ) !== false || - str_starts_with( $purchase->product_slug, 'jetpack_complete' ) || - str_starts_with( $purchase->product_slug, 'jetpack_security' ) - ) { - 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 deleted file mode 100644 index 32de7db9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php +++ /dev/null @@ -1,241 +0,0 @@ - _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 ) ) { - return new WP_Error( 'rewind_state_fetch_failed' ); - } - - $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 deleted file mode 100644 index 922403de..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php +++ /dev/null @@ -1,330 +0,0 @@ - __( '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 deleted file mode 100644 index c41557ad..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php +++ /dev/null @@ -1,350 +0,0 @@ - __( '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 deleted file mode 100644 index 052633c9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php +++ /dev/null @@ -1,168 +0,0 @@ - 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 deleted file mode 100644 index 2dec5713..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php +++ /dev/null @@ -1,141 +0,0 @@ - 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 deleted file mode 100644 index 0fb93d67..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 966b6768..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php +++ /dev/null @@ -1,604 +0,0 @@ - __( '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() ) { - return 100; - } - - $info = self::get_ai_assistant_feature(); - - // Bail early if it's not possible to fetch the feature data. - if ( is_wp_error( $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 __( 'The most powerful AI tool for WordPress', '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 ) { - $features = array( - 1 => array( - __( 'Artificial intelligence chatbot', 'jetpack-my-jetpack' ), - __( 'Generate text, tables, lists, and forms', 'jetpack-my-jetpack' ), - __( 'Refine the tone and content to your liking', 'jetpack-my-jetpack' ), - __( 'Get feedback about your post', 'jetpack-my-jetpack' ), - __( 'Seamless WordPress editor integration', '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 isset( $features[ $tier ] ) ? $features[ $tier ] : $tiered_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(); - } - - // get info about the feature. - $info = self::get_ai_assistant_feature(); - - // flag to indicate if the tiers are enabled, case the info is available. - $tier_plans_enabled = ( ! is_wp_error( $info ) && isset( $info['tier-plans-enabled'] ) ) ? boolval( $info['tier-plans-enabled'] ) : false; - - /* - * 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() { - $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' ); - $current_tier = self::get_current_usage_tier(); - - // 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 '/wp-admin/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#/add-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(); - } - - /** - * 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 deleted file mode 100644 index 37f98601..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php +++ /dev/null @@ -1,133 +0,0 @@ - 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(), - 'standalone_plugin_info' => static::get_standalone_info(), - 'class' => static::class, - 'post_checkout_url' => static::get_post_checkout_url(), - ); - } - - /** - * 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 ) ) { - return new WP_Error( 'site_features_fetch_failed' ); - } - - $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 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 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(); - } - - /** - * Undocumented function - * - * @return string - */ - public static function get_status() { - if ( ! static::is_plugin_installed() ) { - $status = 'plugin_absent'; - if ( static::has_paid_plan_for_product() ) { - $status = 'plugin_absent_with_plan'; - } - } elseif ( static::is_active() ) { - $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' ) ) { - $status = 'needs_first_site_connection'; - } else { - $status = 'site_connection_error'; - } - } elseif ( static::$requires_user_connection && ! ( new Connection_Manager() )->has_connected_owner() ) { - $status = 'user_connection_error'; - } elseif ( static::is_upgradable() ) { - $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 = '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::$has_free_offering ? 'needs_purchase_or_free' : 'needs_purchase'; - } elseif ( static::$requires_site_connection && ! ( new Connection_Manager() )->is_connected() ) { - // Site has never been connected before - if ( ! \Jetpack_Options::get_option( 'id' ) ) { - $status = 'needs_first_site_connection'; - } else { - $status = 'site_connection_error'; - } - } elseif ( static::$requires_user_connection && ! ( new Connection_Manager() )->has_connected_owner() ) { - $status = 'user_connection_error'; - } - } elseif ( ! static::has_any_plan_for_product() ) { - $status = static::$has_free_offering ? 'needs_purchase_or_free' : 'needs_purchase'; - } else { - $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 deleted file mode 100644 index 331ea2b4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php +++ /dev/null @@ -1,297 +0,0 @@ - 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 if the site has a paid plan for the product - * - * @return bool - */ - public static function has_paid_plan_for_product() { - $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; - } - - /** - * 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 where the user manages the product - * - * @return ?string - */ - public static function get_manage_url() { - return admin_url( 'admin.php?page=jetpack-protect' ); - } - - /** - * Return product bundles list - * that supports the product. - * - * @return array Products bundle list. - */ - public static function is_upgradable_by_bundle() { - return array( 'security' ); - } -} 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 deleted file mode 100644 index 52058f17..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php +++ /dev/null @@ -1,231 +0,0 @@ - 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 ) ) { - return new WP_Error( 'scan_state_fetch_failed' ); - } - - $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 deleted file mode 100644 index 8d363a3b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php +++ /dev/null @@ -1,150 +0,0 @@ - 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 deleted file mode 100644 index c8cfe509..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php +++ /dev/null @@ -1,382 +0,0 @@ - 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_purchase_or_free` when status is `needs_purchase`. - */ - 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(); - - if ( isset( $pricings[ $record_count ] ) ) { - return $pricings[ $record_count ]; - } - - if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { - // For simple sites fetch the response directly. - $response = Client::wpcom_json_api_request_as_blog( - sprintf( '/jetpack-search/pricing?record_count=%1$d&locale=%2$s', $record_count, get_user_locale() ), - '2', - array( 'timeout' => 5 ), - null, - 'wpcom' - ); - } else { - // For non-simple sites we have to use the wp_remote_get, as connection might not be available. - $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 deleted file mode 100644 index 866899cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php +++ /dev/null @@ -1,212 +0,0 @@ - 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 deleted file mode 100644 index 5d88d187..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php +++ /dev/null @@ -1,190 +0,0 @@ - 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_basic_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() { - // 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 ) { - // Social is available as standalone bundle and as part of the Complete plan. - if ( strpos( $purchase->product_slug, 'jetpack_social' ) !== false || str_starts_with( $purchase->product_slug, 'jetpack_complete' ) ) { - 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 deleted file mode 100644 index 700a07c2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php +++ /dev/null @@ -1,203 +0,0 @@ - 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 deleted file mode 100644 index 6960c7e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php +++ /dev/null @@ -1,309 +0,0 @@ - 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 ( '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 = 'needs_purchase_or_free'; - } - 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 deleted file mode 100644 index 238e8ee4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php +++ /dev/null @@ -1,195 +0,0 @@ - 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() { - $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_videopress' ) || 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-password-checker/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md deleted file mode 100644 index 9867f0d7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md +++ /dev/null @@ -1,143 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 6bcf598d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "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.1.1", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "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 deleted file mode 100644 index 79c369c2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php +++ /dev/null @@ -1,1313 +0,0 @@ -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 deleted file mode 100644 index 93655676..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/CHANGELOG.md +++ /dev/null @@ -1,106 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 742d9230..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "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.1", - "automattic/jetpack-status": "^3.1.0" - }, - "require-dev": { - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.4" - }, - "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 deleted file mode 100644 index f68a526e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php +++ /dev/null @@ -1,157 +0,0 @@ -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 deleted file mode 100644 index ece16583..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php +++ /dev/null @@ -1,255 +0,0 @@ -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 $next-version$ - * - * @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 $next-version$ - * - * @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-redirect/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md deleted file mode 100644 index 36f315ca..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md +++ /dev/null @@ -1,247 +0,0 @@ -# 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-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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 271c7146..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "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": "^3.0.0" - }, - "require-dev": { - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.2" - }, - "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 deleted file mode 100644 index 7e1ee79e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100644 index 851aa949..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/CHANGELOG.md +++ /dev/null @@ -1,205 +0,0 @@ -# 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-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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index f0aacf96..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "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.0", - "automattic/jetpack-changelogger": "^4.2.2" - }, - "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 deleted file mode 100644 index 7bce3462..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php +++ /dev/null @@ -1,81 +0,0 @@ - '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 deleted file mode 100644 index 99a0b57b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/CHANGELOG.md +++ /dev/null @@ -1,440 +0,0 @@ -# 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.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 - -[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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index b69bcb04..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/composer.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "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.2" - }, - "require-dev": { - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/jetpack-connection": "@dev", - "automattic/jetpack-identity-crisis": "@dev", - "automattic/jetpack-plans": "@dev", - "automattic/jetpack-ip": "^0.2.2" - }, - "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": "3.2.x-dev" - }, - "dependencies": { - "test-only": [ - "packages/connection", - "packages/identity-crisis", - "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 deleted file mode 100644 index e28f69f5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-cache.php +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100644 index 4e120eac..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-errors.php +++ /dev/null @@ -1,47 +0,0 @@ -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 deleted file mode 100644 index 670b658f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-modules.php +++ /dev/null @@ -1,601 +0,0 @@ -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. - */ - public function get_active() { - $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 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() && ! $status->is_onboarding() ) { - 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 deleted file mode 100644 index 7ef200b4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-paths.php +++ /dev/null @@ -1,81 +0,0 @@ - '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 deleted file mode 100644 index 4d455acc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-status.php +++ /dev/null @@ -1,374 +0,0 @@ -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. - * - * @todo Add IDC detection to a package. - * - * @return bool - */ - public function is_staging_site() { - $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; - } - - /** - * 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 - * - * @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 deleted file mode 100644 index fae08755..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php +++ /dev/null @@ -1,56 +0,0 @@ -= 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 - -[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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 53646dae..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/composer.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "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": "^2.8.4", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-identity-crisis": "^0.20.0", - "automattic/jetpack-password-checker": "^0.3.1", - "automattic/jetpack-ip": "^0.2.2", - "automattic/jetpack-roles": "^2.0.2", - "automattic/jetpack-status": "^3.2.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-search": "@dev", - "automattic/jetpack-waf": "^0.16.8", - "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": "2.16.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 deleted file mode 100644 index a08265f8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php +++ /dev/null @@ -1,1193 +0,0 @@ -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; - } - - if ( ( new Status() )->is_staging_site() ) { - return false; - } - - $connection = new Jetpack_Connection(); - if ( ! $connection->is_connected() ) { - if ( ! doing_action( 'jetpack_site_registered' ) ) { - 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() )->is_staging_site() ) { - $debug['debug_details']['is_staging_site'] = 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 deleted file mode 100644 index 2ce2cb6e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php +++ /dev/null @@ -1,419 +0,0 @@ - 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', - ), - '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' ), - '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_connection_active_plugins', - 'jetpack_package_versions', - /** - * Generic site options - */ - 'blog_charset', - 'blog_public', - 'blogdescription', - 'blogname', - 'permalink_structure', - 'stylesheet', - 'time_format', - 'timezone_string', - ), - ); - - 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 deleted file mode 100644 index 8c15dd37..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php +++ /dev/null @@ -1,408 +0,0 @@ -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 $$next_version$$ - * - * @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 deleted file mode 100644 index 81946fe8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php +++ /dev/null @@ -1,80 +0,0 @@ - '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 deleted file mode 100644 index db78e1f8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php +++ /dev/null @@ -1,1340 +0,0 @@ - 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' ), - ); - - /** - * 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', - ); - - /** - * 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-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 deleted file mode 100644 index 3e2e5a5e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php +++ /dev/null @@ -1,712 +0,0 @@ -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 $$next_version$$ - * - * @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 $$next_version$$ - * - * @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; - } -} 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 deleted file mode 100644 index 41d7f788..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-health.php +++ /dev/null @@ -1,188 +0,0 @@ - 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 deleted file mode 100644 index a2f443af..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php +++ /dev/null @@ -1,96 +0,0 @@ -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 deleted file mode 100644 index c2789c17..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php +++ /dev/null @@ -1,485 +0,0 @@ -:( - */ - 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 deleted file mode 100644 index 61b89a1c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php +++ /dev/null @@ -1,77 +0,0 @@ - $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 deleted file mode 100644 index f48e2c66..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-main.php +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100644 index aea37af4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php +++ /dev/null @@ -1,163 +0,0 @@ -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_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 deleted file mode 100644 index 949619a1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100644 index 094e72d1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php +++ /dev/null @@ -1,678 +0,0 @@ -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 deleted file mode 100644 index 7548fffd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php +++ /dev/null @@ -1,1457 +0,0 @@ -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. - * Currently that is posts, comments, post meta and comment meta. - * - * @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; - } - } - - 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 deleted file mode 100644 index 1f825401..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php +++ /dev/null @@ -1,881 +0,0 @@ - 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 endges 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 $$next_version$$ - * - * @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 deleted file mode 100644 index 2221b850..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php +++ /dev/null @@ -1,144 +0,0 @@ -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 deleted file mode 100644 index c36179ba..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php +++ /dev/null @@ -1,1032 +0,0 @@ -:( - * - * @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 deleted file mode 100644 index d0a0bb3a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-server.php +++ /dev/null @@ -1,195 +0,0 @@ -:( - * - * @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 deleted file mode 100644 index 862e71e6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php +++ /dev/null @@ -1,717 +0,0 @@ - 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 deleted file mode 100644 index cd6f2c37..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100644 index 316df9ce..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-users.php +++ /dev/null @@ -1,152 +0,0 @@ -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 deleted file mode 100644 index 23f24e95..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100644 index 7653f26d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php +++ /dev/null @@ -1,44 +0,0 @@ -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 deleted file mode 100644 index 6aceead8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php +++ /dev/null @@ -1,666 +0,0 @@ - '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 deleted file mode 100644 index 1fcf7c8b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php +++ /dev/null @@ -1,504 +0,0 @@ -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 deleted file mode 100644 index ec913477..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php +++ /dev/null @@ -1,338 +0,0 @@ -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 deleted file mode 100644 index b6fd6508..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php +++ /dev/null @@ -1,471 +0,0 @@ -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 ) ) { - $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 deleted file mode 100644 index c7b5501d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php +++ /dev/null @@ -1,730 +0,0 @@ -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 deleted file mode 100644 index f5f8543a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php +++ /dev/null @@ -1,220 +0,0 @@ - '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 deleted file mode 100644 index bf6c5620..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php +++ /dev/null @@ -1,146 +0,0 @@ -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 deleted file mode 100644 index de293a9b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100644 index 008443ab..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php +++ /dev/null @@ -1,649 +0,0 @@ -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 deleted file mode 100644 index 4fbfa3be..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php +++ /dev/null @@ -1,251 +0,0 @@ -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 deleted file mode 100644 index d21dee9b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php +++ /dev/null @@ -1,480 +0,0 @@ -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 deleted file mode 100644 index dea8ed19..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php +++ /dev/null @@ -1,416 +0,0 @@ -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( 'admin_action_update', array( $this, 'check_plugin_edit' ) ); - 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 edit in the administration. - * - * @access public - * - * @todo The `admin_action_update` hook is called only for logged in users, but maybe implement nonce verification? - */ - public function check_plugin_edit() { - $screen = get_current_screen(); - // phpcs:ignore WordPress.Security.NonceVerification.Missing - if ( 'plugin-editor' !== $screen->base || ! isset( $_POST['newcontent'] ) || ! isset( $_POST['plugin'] ) ) { - return; - } - - // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated manually just after. - $plugin = wp_unslash( $_POST['plugin'] ); - $plugins = get_plugins(); - if ( ! isset( $plugins[ $plugin ] ) ) { - return; - } - - /** - * Helps Sync log that a plugin was edited - * - * @since 1.6.3 - * @since-jetpack 4.9.0 - * - * @param string $plugin, Plugin slug - * @param mixed $plugins[ $plugin ], Array of plugin data - */ - do_action( 'jetpack_edited_plugin', $plugin, $plugins[ $plugin ] ); - } - - /** - * 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 deleted file mode 100644 index 0c087cee..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php +++ /dev/null @@ -1,957 +0,0 @@ - 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 deleted file mode 100644 index fb1ae729..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100644 index 16db3d73..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php +++ /dev/null @@ -1,1875 +0,0 @@ - [ '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 deleted file mode 100644 index 83479d1d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php +++ /dev/null @@ -1,68 +0,0 @@ - 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 deleted file mode 100644 index 55c11be2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php +++ /dev/null @@ -1,313 +0,0 @@ -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 deleted file mode 100644 index 01b5ebf9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php +++ /dev/null @@ -1,874 +0,0 @@ - $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 deleted file mode 100644 index 570e24a4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php +++ /dev/null @@ -1,589 +0,0 @@ -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 deleted file mode 100644 index a85510b7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php +++ /dev/null @@ -1,934 +0,0 @@ - '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 deleted file mode 100644 index d9e20c0f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php +++ /dev/null @@ -1,370 +0,0 @@ -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. - * - * @access private - * - * @param bool $prefixed Whether to return prefixed types with shop_ or not. - * - * @return array Order types to sync. - */ - private function get_order_types_to_sync( $prefixed = false ) { - $types = array( 'order', 'order_refund' ); - 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 ( $this->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 ) { - return $ids; - } - $orders = wc_get_orders( - array( - 'include' => $ids, - 'type' => $this->get_order_types_to_sync( true ), - ) - ); - $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'; - } - - return $filtered_order_data; - } - - /** - * 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 = $this->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 deleted file mode 100644 index a6b53caa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php +++ /dev/null @@ -1,638 +0,0 @@ -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', - '_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', - - // 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 deleted file mode 100644 index af4aec41..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php +++ /dev/null @@ -1,156 +0,0 @@ -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 deleted file mode 100644 index c880a4ee..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php +++ /dev/null @@ -1,209 +0,0 @@ -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 deleted file mode 100644 index c36b0e3d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php +++ /dev/null @@ -1,185 +0,0 @@ -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 deleted file mode 100644 index 12216587..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php +++ /dev/null @@ -1,927 +0,0 @@ -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_text_fields' => array( 'type', 'status', 'payment_method_title' ), - 'filter_values' => array(), - 'is_table_enabled_callback' => array( $this, 'enable_woocommerce_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' ), - 'filter_values' => array(), - 'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ), - ), - 'wc_order_operational_data' => array( - 'table' => "{$wpdb->prefix}wc_order_operational_data", - 'range_field' => 'order_id', - 'key_fields' => array( 'order_id' ), - 'checksum_text_fields' => array( 'order_key', 'cart_hash' ), - 'filter_values' => array(), - 'is_table_enabled_callback' => array( $this, 'enable_woocommerce_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 ( '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 ( '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; - } - - /** - * 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 deleted file mode 100644 index 865d6b3b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-options.php +++ /dev/null @@ -1,291 +0,0 @@ -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 deleted file mode 100644 index 7fd459b9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php +++ /dev/null @@ -1,691 +0,0 @@ -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 deleted file mode 100644 index 06e9ff92..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/CHANGELOG.md +++ /dev/null @@ -1,75 +0,0 @@ -# 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-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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 9621437e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/actions.php +++ /dev/null @@ -1,32 +0,0 @@ - $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 deleted file mode 100644 index 942ff4bd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/composer.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "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.6", - "automattic/jetpack-connection": "^2.8.4" - }, - "require-dev": { - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.4", - "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 deleted file mode 100644 index c14ec470..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version-compat.php +++ /dev/null @@ -1,25 +0,0 @@ - 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 deleted file mode 100644 index 1f06d810..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/CHANGELOG.md +++ /dev/null @@ -1,391 +0,0 @@ -# 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.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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 54b71688..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/cli.php +++ /dev/null @@ -1,13 +0,0 @@ -=7.0", - "automattic/jetpack-connection": "^2.8.3", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-ip": "^0.2.2", - "automattic/jetpack-status": "^3.1.0", - "wikimedia/aho-corasick": "^1.0" - }, - "require-dev": { - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.4", - "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.16.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 deleted file mode 100644 index 90976bbd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php +++ /dev/null @@ -1,774 +0,0 @@ -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 deleted file mode 100644 index ebd79e03..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php +++ /dev/null @@ -1,63 +0,0 @@ - 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 deleted file mode 100644 index 08a0b12d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php +++ /dev/null @@ -1,1159 +0,0 @@ -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; - } - - /** - * 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 = 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 deleted file mode 100644 index 1adc7e94..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php +++ /dev/null @@ -1,232 +0,0 @@ -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', '<' ); - } -} 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 deleted file mode 100644 index 30759fc2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php +++ /dev/null @@ -1,193 +0,0 @@ - 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, (bool) $request->get_param( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME ) ); - } - - // IP Lists Enabled - if ( isset( $request[ Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME ] ) ) { - update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, (bool) $request->get_param( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME ) ); - } - - // 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 ] ); - } - - // 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 ] ); - } - - // 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 ( false === $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ) { - update_option( Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME, false ); - } - - update_option( Waf_Runner::SHARE_DATA_OPTION_NAME, (bool) $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ); - } - - // 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 ( true === $request[ Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME ] ) { - update_option( Waf_Runner::SHARE_DATA_OPTION_NAME, true ); - } - - update_option( Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME, (bool) $request[ Waf_Runner::SHARE_DEBUG_DATA_OPTION_NAME ] ); - } - - // 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 deleted file mode 100644 index e7e2c01a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php +++ /dev/null @@ -1,166 +0,0 @@ -] - * : 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 deleted file mode 100644 index b4c368bb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php +++ /dev/null @@ -1,117 +0,0 @@ -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 deleted file mode 100644 index ac004481..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php +++ /dev/null @@ -1,245 +0,0 @@ -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(); - - Waf_Constants::define_mode(); - if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) { - return new WP_Error( 'waf_mode_invalid', 'Invalid firewall mode.' ); - } - - 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 deleted file mode 100644 index 6e2bdceb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php +++ /dev/null @@ -1,286 +0,0 @@ -= 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 deleted file mode 100644 index 61be3d6d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php +++ /dev/null @@ -1,373 +0,0 @@ -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() { - // Attempt to decode JSON requests. - if ( strpos( $this->get_header( 'content-type' ), 'application/json' ) !== false ) { - $decoded_json = json_decode( $this->get_body(), true ) ?? array(); - return flatten_array( $decoded_json, 'json', true ); - } - - return flatten_array( $_POST ); - } - - /** - * 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 deleted file mode 100644 index 2c9f8901..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php +++ /dev/null @@ -1,323 +0,0 @@ -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() { - Waf_Constants::define_mode(); - if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) { - throw new Waf_Exception( 'Invalid firewall mode.' ); - } - $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 ( get_option( self::AUTOMATIC_RULES_ENABLED_OPTION_NAME ) ) { - $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 => get_option( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME ), - Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME => get_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME ), - Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME => get_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ), - Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME => get_option( Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME ), - 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(), - ); - } - - /** - * 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' ); - // phpcs:ignore - ini_set( 'display_errors', 'Off' ); - // phpcs:ignore - set_error_handler( array( self::class, 'errorHandler' ) ); - - 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(); - // phpcs:ignore - ini_set( 'display_errors', $display_errors ); - } - - /** - * 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() { - Waf_Constants::define_mode(); - if ( ! self::is_allowed_mode( JETPACK_WAF_MODE ) ) { - throw new Waf_Exception( 'Invalid firewall mode.' ); - } - - $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 deleted file mode 100644 index 355ac508..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php +++ /dev/null @@ -1,173 +0,0 @@ -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 deleted file mode 100644 index f48dda52..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100644 index 59631e8c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index 7d60cd28..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/functions.php +++ /dev/null @@ -1,72 +0,0 @@ - [ "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 deleted file mode 100644 index c72d23bf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/i18n-map.php +++ /dev/null @@ -1,72 +0,0 @@ - 'jetpack-protect', - 'type' => 'plugins', - 'packages' => array( - 'jetpack-admin-ui' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-admin-ui', - 'ver' => '0.4.2', - ), - 'jetpack-assets' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-assets', - 'ver' => '2.1.11', - ), - 'jetpack-boost-core' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-boost-core', - 'ver' => '0.2.7', - ), - 'jetpack-boost-speed-score' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-boost-speed-score', - 'ver' => '0.3.11', - ), - 'jetpack-config' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-config', - 'ver' => '2.0.2', - ), - 'jetpack-connection' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-connection', - 'ver' => '2.8.4', - ), - 'jetpack-idc' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-identity-crisis', - 'ver' => '0.20.0', - ), - 'jetpack-ip' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-ip', - 'ver' => '0.2.2', - ), - 'jetpack-jitm' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-jitm', - 'ver' => '3.1.11', - ), - 'jetpack-licensing' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-licensing', - 'ver' => '2.0.5', - ), - 'jetpack-my-jetpack' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-my-jetpack', - 'ver' => '4.24.1', - ), - 'jetpack-password-checker' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-password-checker', - 'ver' => '0.3.1', - ), - 'jetpack-plugins-installer' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-plugins-installer', - 'ver' => '0.4.0', - ), - 'jetpack-sync' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-sync', - 'ver' => '2.16.6', - ), - 'jetpack-transport-helper' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-transport-helper', - 'ver' => '0.2.3', - ), - 'jetpack-waf' => array( - 'path' => 'jetpack_vendor/automattic/jetpack-waf', - 'ver' => '0.16.8', - ), - ), -); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt deleted file mode 100644 index c817f684..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt +++ /dev/null @@ -1,172 +0,0 @@ -=== 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.4 -Requires PHP: 7.0 -Tested up to: 6.5 -Stable tag: 2.2.0 -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/) - -== 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 38,393 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 (38,393) 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 == -### 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. -- Trigger a red bubble notification when a bad install is detected. - -#### Changed -- Update WordPress minimum version requirement to WordPress 6.4. -- Only show installation errors on the plugins page. - -#### Fixed -- Jetpack Protect Footer: ensure that "Go to cloud" links are not shown when on a platform with no firewall support. - 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 deleted file mode 100644 index 1e72b467..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-credentials.php +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100644 index db069369..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-jetpack-protect.php +++ /dev/null @@ -1,458 +0,0 @@ -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' ) - ); - - 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 ), - '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(), - ), - ); - - $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(); - - Status::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 deleted file mode 100644 index cacd4768..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-onboarding.php +++ /dev/null @@ -1,80 +0,0 @@ - - */ - 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-plan.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-plan.php deleted file mode 100644 index 936f2885..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-plan.php +++ /dev/null @@ -1,111 +0,0 @@ - ( 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' ), - 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/src/class-protect-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-protect-status.php deleted file mode 100644 index 97d4b3a2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-protect-status.php +++ /dev/null @@ -1,258 +0,0 @@ - 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/src/class-rest-controller.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php deleted file mode 100644 index 469ac99c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php +++ /dev/null @@ -1,483 +0,0 @@ - \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' ); - }, - ) - ); - - register_rest_route( - 'jetpack-protect/v1', - 'ignore-threat', - array( - 'methods' => \WP_REST_Server::EDITABLE, - 'callback' => __CLASS__ . '::api_ignore_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' ); - }, - ) - ); - } - - /** - * 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.' ); - } - - /** - * 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.' ); - } - - /** - * 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.' ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-status.php deleted file mode 100644 index 125bf550..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-status.php +++ /dev/null @@ -1,359 +0,0 @@ - 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/src/class-site-health.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php deleted file mode 100644 index 9c62ea01..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php +++ /dev/null @@ -1,111 +0,0 @@ - __( '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-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-status.php deleted file mode 100644 index 41b574c5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-status.php +++ /dev/null @@ -1,306 +0,0 @@ - (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/src/class-threats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php deleted file mode 100644 index bc56e62b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php +++ /dev/null @@ -1,202 +0,0 @@ -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( $threat_id ); - 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(); - - 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 ) ); - } - - /** - * 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(); - - $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(); - - 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(); - - return true; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-extension-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-extension-model.php deleted file mode 100644 index c0b93ce9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-extension-model.php +++ /dev/null @@ -1,110 +0,0 @@ - - */ - 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/src/models/class-status-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-status-model.php deleted file mode 100644 index 34a58e08..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-status-model.php +++ /dev/null @@ -1,141 +0,0 @@ - - */ - 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/src/models/class-threat-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-threat-model.php deleted file mode 100644 index 4a5cb6c8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-threat-model.php +++ /dev/null @@ -1,115 +0,0 @@ - $value ) { - if ( property_exists( $this, $property ) ) { - $this->$property = $value; - } - } - } -} 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 deleted file mode 100644 index d79e542d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/autoload.php +++ /dev/null @@ -1,25 +0,0 @@ -= 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.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 deleted file mode 100644 index e82774c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ -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 deleted file mode 100644 index 98f48dd1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/SECURITY.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 2f814528..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/composer.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "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": "^2.7.6" - }, - "require-dev": { - "yoast/phpunit-polyfills": "1.1.0", - "automattic/jetpack-changelogger": "^4.2.3", - "automattic/jetpack-status": "^3.0.2", - "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 deleted file mode 100644 index f6e7c6e3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-current-plan.php +++ /dev/null @@ -1,393 +0,0 @@ - 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 deleted file mode 100644 index 130cf09b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-plans.php +++ /dev/null @@ -1,82 +0,0 @@ - '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 deleted file mode 100644 index 7824d8f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,579 +0,0 @@ - - * 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 deleted file mode 100644 index 51e734a7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,359 +0,0 @@ - - * 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 deleted file mode 100644 index f27399a0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -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 deleted file mode 100644 index 5c1ccd31..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,234 +0,0 @@ - $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\\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_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\\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-identity-crisis/src/class-exception.php', - 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php', - 'Automattic\\Jetpack\\IdentityCrisis\\UI' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php', - 'Automattic\\Jetpack\\IdentityCrisis\\URL_Secret' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-url-secret.php', - 'Automattic\\Jetpack\\Identity_Crisis' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/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_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\\Extension_Model' => $baseDir . '/src/models/class-extension-model.php', - 'Automattic\\Jetpack\\Protect\\Onboarding' => $baseDir . '/src/class-onboarding.php', - 'Automattic\\Jetpack\\Protect\\Plan' => $baseDir . '/src/class-plan.php', - 'Automattic\\Jetpack\\Protect\\Protect_Status' => $baseDir . '/src/class-protect-status.php', - 'Automattic\\Jetpack\\Protect\\REST_Controller' => $baseDir . '/src/class-rest-controller.php', - 'Automattic\\Jetpack\\Protect\\Scan_Status' => $baseDir . '/src/class-scan-status.php', - 'Automattic\\Jetpack\\Protect\\Site_Health' => $baseDir . '/src/class-site-health.php', - 'Automattic\\Jetpack\\Protect\\Status' => $baseDir . '/src/class-status.php', - 'Automattic\\Jetpack\\Protect\\Status_Model' => $baseDir . '/src/models/class-status-model.php', - 'Automattic\\Jetpack\\Protect\\Threat_Model' => $baseDir . '/src/models/class-threat-model.php', - 'Automattic\\Jetpack\\Protect\\Threats' => $baseDir . '/src/class-threats.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 deleted file mode 100644 index 190ac33c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_files.php +++ /dev/null @@ -1,12 +0,0 @@ - $baseDir . '/jetpack_vendor/automattic/jetpack-assets/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 deleted file mode 100644 index 15a2ff3a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - 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 deleted file mode 100644 index 9d79c506..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_real.php +++ /dev/null @@ -1,51 +0,0 @@ -setClassMapAuthoritative(true); - $loader->register(true); - - $filesToLoad = \Composer\Autoload\ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ2_2_0::$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 deleted file mode 100644 index 3aeb07ff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_static.php +++ /dev/null @@ -1,266 +0,0 @@ - __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/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\\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_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\\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-identity-crisis/src/class-exception.php', - 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php', - 'Automattic\\Jetpack\\IdentityCrisis\\UI' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php', - 'Automattic\\Jetpack\\IdentityCrisis\\URL_Secret' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-url-secret.php', - 'Automattic\\Jetpack\\Identity_Crisis' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/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_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\\Extension_Model' => __DIR__ . '/../..' . '/src/models/class-extension-model.php', - 'Automattic\\Jetpack\\Protect\\Onboarding' => __DIR__ . '/../..' . '/src/class-onboarding.php', - 'Automattic\\Jetpack\\Protect\\Plan' => __DIR__ . '/../..' . '/src/class-plan.php', - 'Automattic\\Jetpack\\Protect\\Protect_Status' => __DIR__ . '/../..' . '/src/class-protect-status.php', - 'Automattic\\Jetpack\\Protect\\REST_Controller' => __DIR__ . '/../..' . '/src/class-rest-controller.php', - 'Automattic\\Jetpack\\Protect\\Scan_Status' => __DIR__ . '/../..' . '/src/class-scan-status.php', - 'Automattic\\Jetpack\\Protect\\Site_Health' => __DIR__ . '/../..' . '/src/class-site-health.php', - 'Automattic\\Jetpack\\Protect\\Status' => __DIR__ . '/../..' . '/src/class-status.php', - 'Automattic\\Jetpack\\Protect\\Status_Model' => __DIR__ . '/../..' . '/src/models/class-status-model.php', - 'Automattic\\Jetpack\\Protect\\Threat_Model' => __DIR__ . '/../..' . '/src/models/class-threat-model.php', - 'Automattic\\Jetpack\\Protect\\Threats' => __DIR__ . '/../..' . '/src/class-threats.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ⓥ2_2_0::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ2_2_0::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ2_2_0::$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 deleted file mode 100644 index 24ef45e4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.json +++ /dev/null @@ -1,1706 +0,0 @@ -{ - "packages": [ - { - "name": "automattic/jetpack-a8c-mc-stats", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-a8c-mc-stats.git", - "reference": "64748d02bf646e6b000f79dc8e4ea127bbd8df14" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-a8c-mc-stats/zipball/64748d02bf646e6b000f79dc8e4ea127bbd8df14", - "reference": "64748d02bf646e6b000f79dc8e4ea127bbd8df14", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.1.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-03-12T22:00:11+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.1" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-a8c-mc-stats" - }, - { - "name": "automattic/jetpack-admin-ui", - "version": "v0.4.2", - "version_normalized": "0.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-admin-ui.git", - "reference": "cc7062363464f53bb3ae5745754f353c248d6278" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-admin-ui/zipball/cc7062363464f53bb3ae5745754f353c248d6278", - "reference": "cc7062363464f53bb3ae5745754f353c248d6278", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.2", - "automattic/jetpack-logo": "^2.0.2", - "automattic/wordbless": "dev-master", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-22T18:47:32+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.2" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-admin-ui" - }, - { - "name": "automattic/jetpack-assets", - "version": "v2.1.11", - "version_normalized": "2.1.11.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-assets.git", - "reference": "07e0d2e02d4a0188fc932fdb58b568800ee1897c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-assets/zipball/07e0d2e02d4a0188fc932fdb58b568800ee1897c", - "reference": "07e0d2e02d4a0188fc932fdb58b568800ee1897c", - "shasum": "" - }, - "require": { - "automattic/jetpack-constants": "^2.0.2", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "brain/monkey": "2.6.1", - "wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-20T18:04:19+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.1.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.1.11" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-assets" - }, - { - "name": "automattic/jetpack-autoloader", - "version": "v3.0.7", - "version_normalized": "3.0.7.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-autoloader.git", - "reference": "2a3ab8c22cefdb7a48f1c704696c821d1e9a5ebb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/2a3ab8c22cefdb7a48f1c704696c821d1e9a5ebb", - "reference": "2a3ab8c22cefdb7a48f1c704696c821d1e9a5ebb", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1 || ^2.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.3", - "composer/composer": "^1.1 || ^2.0", - "yoast/phpunit-polyfills": "1.1.0" - }, - "time": "2024-05-06T17:33:09+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.0.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.0.7" - }, - "install-path": "../automattic/jetpack-autoloader" - }, - { - "name": "automattic/jetpack-backup-helper-script-manager", - "version": "v0.2.6", - "version_normalized": "0.2.6.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-backup-helper-script-manager.git", - "reference": "b048d0a63fbe37f3355b00f77cbec7416e4eaa2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-backup-helper-script-manager/zipball/b048d0a63fbe37f3355b00f77cbec7416e4eaa2e", - "reference": "b048d0a63fbe37f3355b00f77cbec7416e4eaa2e", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.1.2", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-08T18:32: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.6" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-backup-helper-script-manager" - }, - { - "name": "automattic/jetpack-boost-core", - "version": "v0.2.7", - "version_normalized": "0.2.7.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-boost-core.git", - "reference": "fc90a8e543855068d52bcdad5eb7cc29b152ec2f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-boost-core/zipball/fc90a8e543855068d52bcdad5eb7cc29b152ec2f", - "reference": "fc90a8e543855068d52bcdad5eb7cc29b152ec2f", - "shasum": "" - }, - "require": { - "automattic/jetpack-connection": "^2.7.6", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.3", - "automattic/wordbless": "dev-master", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-06T17:33:57+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.7" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-boost-core" - }, - { - "name": "automattic/jetpack-boost-speed-score", - "version": "v0.3.11", - "version_normalized": "0.3.11.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-boost-speed-score.git", - "reference": "5bcf759dfb18ef98aa8e998028e25960a20e551d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-boost-speed-score/zipball/5bcf759dfb18ef98aa8e998028e25960a20e551d", - "reference": "5bcf759dfb18ef98aa8e998028e25960a20e551d", - "shasum": "" - }, - "require": { - "automattic/jetpack-boost-core": "^0.2.6", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.2", - "brain/monkey": "^2.6", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-22T18:47:36+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.11" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-boost-speed-score" - }, - { - "name": "automattic/jetpack-composer-plugin", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-composer-plugin.git", - "reference": "4c14db8b90c82b02b6530dacfc02f14e3432515b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-composer-plugin/zipball/4c14db8b90c82b02b6530dacfc02f14e3432515b", - "reference": "4c14db8b90c82b02b6530dacfc02f14e3432515b", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^2.1.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.1.1", - "composer/composer": "^2.2 || ^2.4", - "yoast/phpunit-polyfills": "1.1.0" - }, - "time": "2024-03-14T20:42:33+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.1" - }, - "install-path": "../automattic/jetpack-composer-plugin" - }, - { - "name": "automattic/jetpack-config", - "version": "v2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-config.git", - "reference": "5790b6e9335abb316fe123610e6bdf89baae0ca9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-config/zipball/5790b6e9335abb316fe123610e6bdf89baae0ca9", - "reference": "5790b6e9335abb316fe123610e6bdf89baae0ca9", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.3", - "automattic/jetpack-connection": "@dev", - "automattic/jetpack-identity-crisis": "@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-05-06T17:32:13+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/identity-crisis", - "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.2" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-config" - }, - { - "name": "automattic/jetpack-connection", - "version": "v2.8.4", - "version_normalized": "2.8.4.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-connection.git", - "reference": "cc0cfb694137a09d0da253e41477157a61fdf8db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-connection/zipball/cc0cfb694137a09d0da253e41477157a61fdf8db", - "reference": "cc0cfb694137a09d0da253e41477157a61fdf8db", - "shasum": "" - }, - "require": { - "automattic/jetpack-a8c-mc-stats": "^2.0.1", - "automattic/jetpack-admin-ui": "^0.4.2", - "automattic/jetpack-assets": "^2.1.11", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-redirect": "^2.0.2", - "automattic/jetpack-roles": "^2.0.2", - "automattic/jetpack-status": "^3.2.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/wordbless": "@dev", - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-22T17:28:59+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": "2.8.x-dev" - }, - "dependencies": { - "test-only": [ - "packages/licensing", - "packages/sync" - ] - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "legacy", - "src/", - "src/webhooks" - ] - }, - "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/v2.8.4" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-connection" - }, - { - "name": "automattic/jetpack-constants", - "version": "v2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-constants.git", - "reference": "6f7991f9e4475d4e2c3fd843111abfadb8a8c187" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/6f7991f9e4475d4e2c3fd843111abfadb8a8c187", - "reference": "6f7991f9e4475d4e2c3fd843111abfadb8a8c187", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.2", - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-30T19:01:57+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.2" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-constants" - }, - { - "name": "automattic/jetpack-device-detection", - "version": "v2.1.3", - "version_normalized": "2.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-device-detection.git", - "reference": "178cb2d0215d7446743a1654b0964a1d4ddfca8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-device-detection/zipball/178cb2d0215d7446743a1654b0964a1d4ddfca8a", - "reference": "178cb2d0215d7446743a1654b0964a1d4ddfca8a", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.1.2", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-08T18:32:53+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.3" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-device-detection" - }, - { - "name": "automattic/jetpack-identity-crisis", - "version": "v0.20.0", - "version_normalized": "0.20.0.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-identity-crisis.git", - "reference": "c3a9c61250efb0292583e8797a5abb2b4209d7b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-identity-crisis/zipball/c3a9c61250efb0292583e8797a5abb2b4209d7b6", - "reference": "c3a9c61250efb0292583e8797a5abb2b4209d7b6", - "shasum": "" - }, - "require": { - "automattic/jetpack-assets": "^2.1.11", - "automattic/jetpack-connection": "^2.8.3", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-logo": "^2.0.3", - "automattic/jetpack-status": "^3.1.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-20T18:04:48+00:00", - "type": "jetpack-library", - "extra": { - "autotagger": true, - "mirror-repo": "Automattic/jetpack-identity-crisis", - "textdomain": "jetpack-idc", - "version-constants": { - "::PACKAGE_VERSION": "src/class-identity-crisis.php" - }, - "changelogger": { - "link-template": "https://github.com/Automattic/jetpack-identity-crisis/compare/v${old}...v${new}" - }, - "branch-alias": { - "dev-trunk": "0.20.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "description": "Identity Crisis.", - "support": { - "source": "https://github.com/Automattic/jetpack-identity-crisis/tree/v0.20.0" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-identity-crisis" - }, - { - "name": "automattic/jetpack-ip", - "version": "v0.2.2", - "version_normalized": "0.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-ip.git", - "reference": "b3efffb57901e236c3c1e7299b575563e1937013" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-ip/zipball/b3efffb57901e236c3c1e7299b575563e1937013", - "reference": "b3efffb57901e236c3c1e7299b575563e1937013", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.1.1", - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-03-12T22:00: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.2" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-ip" - }, - { - "name": "automattic/jetpack-jitm", - "version": "v3.1.11", - "version_normalized": "3.1.11.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-jitm.git", - "reference": "24750516a396a323fdf63f56bacbf1148557dff8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-jitm/zipball/24750516a396a323fdf63f56bacbf1148557dff8", - "reference": "24750516a396a323fdf63f56bacbf1148557dff8", - "shasum": "" - }, - "require": { - "automattic/jetpack-a8c-mc-stats": "^2.0.1", - "automattic/jetpack-assets": "^2.1.10", - "automattic/jetpack-connection": "^2.8.2", - "automattic/jetpack-device-detection": "^2.1.3", - "automattic/jetpack-logo": "^2.0.2", - "automattic/jetpack-redirect": "^2.0.2", - "automattic/jetpack-status": "^3.0.3", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.3", - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-16T10:58:29+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.11" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-jitm" - }, - { - "name": "automattic/jetpack-licensing", - "version": "v2.0.5", - "version_normalized": "2.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-licensing.git", - "reference": "b16c55f13f5bc3a0b00d93960126f0de743bcb30" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-licensing/zipball/b16c55f13f5bc3a0b00d93960126f0de743bcb30", - "reference": "b16c55f13f5bc3a0b00d93960126f0de743bcb30", - "shasum": "" - }, - "require": { - "automattic/jetpack-connection": "^2.7.2", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.2", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-22T18:48:10+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.5" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-licensing" - }, - { - "name": "automattic/jetpack-logo", - "version": "v2.0.3", - "version_normalized": "2.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-logo.git", - "reference": "5edc913ab10e222e95ef7f60073cc0ef4d90bdb4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-logo/zipball/5edc913ab10e222e95ef7f60073cc0ef4d90bdb4", - "reference": "5edc913ab10e222e95ef7f60073cc0ef4d90bdb4", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-20T18:03:57+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.3" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-logo" - }, - { - "name": "automattic/jetpack-my-jetpack", - "version": "v4.24.1", - "version_normalized": "4.24.1.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-my-jetpack.git", - "reference": "0bec9f5e31019c128459dca3b6aad4388da519b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-my-jetpack/zipball/0bec9f5e31019c128459dca3b6aad4388da519b0", - "reference": "0bec9f5e31019c128459dca3b6aad4388da519b0", - "shasum": "" - }, - "require": { - "automattic/jetpack-admin-ui": "^0.4.2", - "automattic/jetpack-assets": "^2.1.11", - "automattic/jetpack-boost-speed-score": "^0.3.11", - "automattic/jetpack-connection": "^2.8.4", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-jitm": "^3.1.11", - "automattic/jetpack-licensing": "^2.0.5", - "automattic/jetpack-plans": "^0.4.7", - "automattic/jetpack-plugins-installer": "^0.4.0", - "automattic/jetpack-redirect": "^2.0.2", - "automattic/jetpack-status": "^3.2.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-24T19:12:01+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.24.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.24.1" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-my-jetpack" - }, - { - "name": "automattic/jetpack-password-checker", - "version": "v0.3.1", - "version_normalized": "0.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-password-checker.git", - "reference": "d9be23791e6f38debeacbf74174903f223ddfd89" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-password-checker/zipball/d9be23791e6f38debeacbf74174903f223ddfd89", - "reference": "d9be23791e6f38debeacbf74174903f223ddfd89", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.1.1", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-03-14T20:42:38+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.1" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-password-checker" - }, - { - "name": "automattic/jetpack-plans", - "version": "v0.4.7", - "version_normalized": "0.4.7.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-plans.git", - "reference": "ae0e8d754c7e2ade0b7b1a7a24f9681ce40c9ca6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-plans/zipball/ae0e8d754c7e2ade0b7b1a7a24f9681ce40c9ca6", - "reference": "ae0e8d754c7e2ade0b7b1a7a24f9681ce40c9ca6", - "shasum": "" - }, - "require": { - "automattic/jetpack-connection": "^2.7.6", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.3", - "automattic/jetpack-status": "^3.0.2", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-06T17:33:52+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.7" - }, - "install-path": "../automattic/jetpack-plans" - }, - { - "name": "automattic/jetpack-plugins-installer", - "version": "v0.4.0", - "version_normalized": "0.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-plugins-installer.git", - "reference": "f463cff030940a24d4eb0edfe1fec7a926cf55c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-plugins-installer/zipball/f463cff030940a24d4eb0edfe1fec7a926cf55c6", - "reference": "f463cff030940a24d4eb0edfe1fec7a926cf55c6", - "shasum": "" - }, - "require": { - "automattic/jetpack-a8c-mc-stats": "^2.0.1", - "automattic/jetpack-status": "^3.1.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-20T18:04: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.0" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-plugins-installer" - }, - { - "name": "automattic/jetpack-redirect", - "version": "v2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-redirect.git", - "reference": "7214fcd3684eb99178d6368c01f8778a182444cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-redirect/zipball/7214fcd3684eb99178d6368c01f8778a182444cb", - "reference": "7214fcd3684eb99178d6368c01f8778a182444cb", - "shasum": "" - }, - "require": { - "automattic/jetpack-status": "^3.0.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.2", - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-25T07:24:30+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.2" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-redirect" - }, - { - "name": "automattic/jetpack-roles", - "version": "v2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-roles.git", - "reference": "7d452c94509612e94e045b66bbfabee43fdf8728" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-roles/zipball/7d452c94509612e94e045b66bbfabee43fdf8728", - "reference": "7d452c94509612e94e045b66bbfabee43fdf8728", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.2", - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-04-22T18:47:11+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.2" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-roles" - }, - { - "name": "automattic/jetpack-status", - "version": "v3.2.0", - "version_normalized": "3.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-status.git", - "reference": "795f4fa778daa6139c88ba5f62e09dea93bdd93c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-status/zipball/795f4fa778daa6139c88ba5f62e09dea93bdd93c", - "reference": "795f4fa778daa6139c88ba5f62e09dea93bdd93c", - "shasum": "" - }, - "require": { - "automattic/jetpack-constants": "^2.0.2", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/jetpack-connection": "@dev", - "automattic/jetpack-identity-crisis": "@dev", - "automattic/jetpack-ip": "^0.2.2", - "automattic/jetpack-plans": "@dev", - "brain/monkey": "2.6.1", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-22T17:28:26+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": "3.2.x-dev" - }, - "dependencies": { - "test-only": [ - "packages/connection", - "packages/identity-crisis", - "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/v3.2.0" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-status" - }, - { - "name": "automattic/jetpack-sync", - "version": "v2.16.6", - "version_normalized": "2.16.6.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-sync.git", - "reference": "ef2e5e203fa4e19c8e670224146973195a28150e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-sync/zipball/ef2e5e203fa4e19c8e670224146973195a28150e", - "reference": "ef2e5e203fa4e19c8e670224146973195a28150e", - "shasum": "" - }, - "require": { - "automattic/jetpack-connection": "^2.8.4", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-identity-crisis": "^0.20.0", - "automattic/jetpack-ip": "^0.2.2", - "automattic/jetpack-password-checker": "^0.3.1", - "automattic/jetpack-roles": "^2.0.2", - "automattic/jetpack-status": "^3.2.0", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/jetpack-search": "@dev", - "automattic/jetpack-waf": "^0.16.8", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-23T15:20:00+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": "2.16.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/v2.16.6" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-sync" - }, - { - "name": "automattic/jetpack-transport-helper", - "version": "v0.2.3", - "version_normalized": "0.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-transport-helper.git", - "reference": "1ad7d19d4c5189dc78fcb5154a67c8a74f0c3efd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-transport-helper/zipball/1ad7d19d4c5189dc78fcb5154a67c8a74f0c3efd", - "reference": "1ad7d19d4c5189dc78fcb5154a67c8a74f0c3efd", - "shasum": "" - }, - "require": { - "automattic/jetpack-backup-helper-script-manager": "^0.2.6", - "automattic/jetpack-connection": "^2.8.4", - "php": ">=7.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/wordbless": "dev-master", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-24T19:11:44+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.3" - }, - "install-path": "../../jetpack_vendor/automattic/jetpack-transport-helper" - }, - { - "name": "automattic/jetpack-waf", - "version": "v0.16.8", - "version_normalized": "0.16.8.0", - "source": { - "type": "git", - "url": "https://github.com/Automattic/jetpack-waf.git", - "reference": "7570239d2dc2d300dd9b051d375d5acec18fba70" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-waf/zipball/7570239d2dc2d300dd9b051d375d5acec18fba70", - "reference": "7570239d2dc2d300dd9b051d375d5acec18fba70", - "shasum": "" - }, - "require": { - "automattic/jetpack-connection": "^2.8.3", - "automattic/jetpack-constants": "^2.0.2", - "automattic/jetpack-ip": "^0.2.2", - "automattic/jetpack-status": "^3.1.0", - "php": ">=7.0", - "wikimedia/aho-corasick": "^1.0" - }, - "require-dev": { - "automattic/jetpack-changelogger": "^4.2.4", - "automattic/wordbless": "@dev", - "yoast/phpunit-polyfills": "1.1.0" - }, - "suggest": { - "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." - }, - "time": "2024-05-20T18:04:33+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.16.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.16.8" - }, - "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 deleted file mode 100644 index 7b848532..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.php +++ /dev/null @@ -1,275 +0,0 @@ - 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.1', - 'version' => '2.0.1.0', - 'reference' => '64748d02bf646e6b000f79dc8e4ea127bbd8df14', - '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.2', - 'version' => '0.4.2.0', - 'reference' => 'cc7062363464f53bb3ae5745754f353c248d6278', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-admin-ui', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-assets' => array( - 'pretty_version' => 'v2.1.11', - 'version' => '2.1.11.0', - 'reference' => '07e0d2e02d4a0188fc932fdb58b568800ee1897c', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-assets', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-autoloader' => array( - 'pretty_version' => 'v3.0.7', - 'version' => '3.0.7.0', - 'reference' => '2a3ab8c22cefdb7a48f1c704696c821d1e9a5ebb', - '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.6', - 'version' => '0.2.6.0', - 'reference' => 'b048d0a63fbe37f3355b00f77cbec7416e4eaa2e', - '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.7', - 'version' => '0.2.7.0', - 'reference' => 'fc90a8e543855068d52bcdad5eb7cc29b152ec2f', - '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.11', - 'version' => '0.3.11.0', - 'reference' => '5bcf759dfb18ef98aa8e998028e25960a20e551d', - '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.1', - 'version' => '2.0.1.0', - 'reference' => '4c14db8b90c82b02b6530dacfc02f14e3432515b', - 'type' => 'composer-plugin', - 'install_path' => __DIR__ . '/../automattic/jetpack-composer-plugin', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-config' => array( - 'pretty_version' => 'v2.0.2', - 'version' => '2.0.2.0', - 'reference' => '5790b6e9335abb316fe123610e6bdf89baae0ca9', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-config', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-connection' => array( - 'pretty_version' => 'v2.8.4', - 'version' => '2.8.4.0', - 'reference' => 'cc0cfb694137a09d0da253e41477157a61fdf8db', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-connection', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-constants' => array( - 'pretty_version' => 'v2.0.2', - 'version' => '2.0.2.0', - 'reference' => '6f7991f9e4475d4e2c3fd843111abfadb8a8c187', - '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.3', - 'version' => '2.1.3.0', - 'reference' => '178cb2d0215d7446743a1654b0964a1d4ddfca8a', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-device-detection', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-identity-crisis' => array( - 'pretty_version' => 'v0.20.0', - 'version' => '0.20.0.0', - 'reference' => 'c3a9c61250efb0292583e8797a5abb2b4209d7b6', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-identity-crisis', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-ip' => array( - 'pretty_version' => 'v0.2.2', - 'version' => '0.2.2.0', - 'reference' => 'b3efffb57901e236c3c1e7299b575563e1937013', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-ip', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-jitm' => array( - 'pretty_version' => 'v3.1.11', - 'version' => '3.1.11.0', - 'reference' => '24750516a396a323fdf63f56bacbf1148557dff8', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-jitm', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-licensing' => array( - 'pretty_version' => 'v2.0.5', - 'version' => '2.0.5.0', - 'reference' => 'b16c55f13f5bc3a0b00d93960126f0de743bcb30', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-licensing', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-logo' => array( - 'pretty_version' => 'v2.0.3', - 'version' => '2.0.3.0', - 'reference' => '5edc913ab10e222e95ef7f60073cc0ef4d90bdb4', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-logo', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-my-jetpack' => array( - 'pretty_version' => 'v4.24.1', - 'version' => '4.24.1.0', - 'reference' => '0bec9f5e31019c128459dca3b6aad4388da519b0', - '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.1', - 'version' => '0.3.1.0', - 'reference' => 'd9be23791e6f38debeacbf74174903f223ddfd89', - '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.7', - 'version' => '0.4.7.0', - 'reference' => 'ae0e8d754c7e2ade0b7b1a7a24f9681ce40c9ca6', - 'type' => 'library', - 'install_path' => __DIR__ . '/../automattic/jetpack-plans', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-plugins-installer' => array( - 'pretty_version' => 'v0.4.0', - 'version' => '0.4.0.0', - 'reference' => 'f463cff030940a24d4eb0edfe1fec7a926cf55c6', - '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-redirect' => array( - 'pretty_version' => 'v2.0.2', - 'version' => '2.0.2.0', - 'reference' => '7214fcd3684eb99178d6368c01f8778a182444cb', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-redirect', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-roles' => array( - 'pretty_version' => 'v2.0.2', - 'version' => '2.0.2.0', - 'reference' => '7d452c94509612e94e045b66bbfabee43fdf8728', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-roles', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-status' => array( - 'pretty_version' => 'v3.2.0', - 'version' => '3.2.0.0', - 'reference' => '795f4fa778daa6139c88ba5f62e09dea93bdd93c', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-status', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-sync' => array( - 'pretty_version' => 'v2.16.6', - 'version' => '2.16.6.0', - 'reference' => 'ef2e5e203fa4e19c8e670224146973195a28150e', - '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.3', - 'version' => '0.2.3.0', - 'reference' => '1ad7d19d4c5189dc78fcb5154a67c8a74f0c3efd', - 'type' => 'jetpack-library', - 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-transport-helper', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'automattic/jetpack-waf' => array( - 'pretty_version' => 'v0.16.8', - 'version' => '0.16.8.0', - 'reference' => '7570239d2dc2d300dd9b051d375d5acec18fba70', - '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 deleted file mode 100644 index a89145dc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_classmap.php +++ /dev/null @@ -1,961 +0,0 @@ - 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.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader.php' - ), - 'Autoloader_Handler' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-handler.php' - ), - 'Autoloader_Locator' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-locator.php' - ), - 'Automattic\\Jetpack\\A8c_Mc_Stats' => array( - 'version' => '2.0.1.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.2.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php' - ), - 'Automattic\\Jetpack\\Assets' => array( - 'version' => '2.1.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php' - ), - 'Automattic\\Jetpack\\Assets\\Logo' => array( - 'version' => '2.0.3.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php' - ), - 'Automattic\\Jetpack\\Assets\\Semver' => array( - 'version' => '2.1.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php' - ), - 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php' - ), - 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php' - ), - 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php' - ), - 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php' - ), - 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php' - ), - 'Automattic\\Jetpack\\Automatic_Install_Skin' => array( - 'version' => '0.4.0.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.6.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.6.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.6.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.7.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.7.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.7.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-cacheable.php' - ), - 'Automattic\\Jetpack\\Boost_Core\\Lib\\Transient' => array( - 'version' => '0.2.7.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-transient.php' - ), - 'Automattic\\Jetpack\\Boost_Core\\Lib\\Url' => array( - 'version' => '0.2.7.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-core/src/lib/class-url.php' - ), - 'Automattic\\Jetpack\\Boost_Core\\Lib\\Utils' => array( - 'version' => '0.2.7.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.7.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.11.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.11.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.11.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.11.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.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-boost-speed-score/src/class-speed-score-request.php' - ), - 'Automattic\\Jetpack\\Composer\\Manager' => array( - 'version' => '2.0.1.0', - 'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-manager.php' - ), - 'Automattic\\Jetpack\\Composer\\Plugin' => array( - 'version' => '2.0.1.0', - 'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-plugin.php' - ), - 'Automattic\\Jetpack\\Config' => array( - 'version' => '2.0.2.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php' - ), - 'Automattic\\Jetpack\\Connection\\Authorize_Json_Api' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-authorize-json-api.php' - ), - 'Automattic\\Jetpack\\Connection\\Client' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php' - ), - 'Automattic\\Jetpack\\Connection\\Connection_Notice' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php' - ), - 'Automattic\\Jetpack\\Connection\\Error_Handler' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php' - ), - 'Automattic\\Jetpack\\Connection\\Initial_State' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php' - ), - 'Automattic\\Jetpack\\Connection\\Manager' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php' - ), - 'Automattic\\Jetpack\\Connection\\Manager_Interface' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php' - ), - 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php' - ), - 'Automattic\\Jetpack\\Connection\\Package_Version' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php' - ), - 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php' - ), - 'Automattic\\Jetpack\\Connection\\Plugin' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php' - ), - 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php' - ), - 'Automattic\\Jetpack\\Connection\\REST_Connector' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php' - ), - 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php' - ), - 'Automattic\\Jetpack\\Connection\\SSO' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-sso.php' - ), - 'Automattic\\Jetpack\\Connection\\SSO\\Force_2FA' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-force-2fa.php' - ), - 'Automattic\\Jetpack\\Connection\\SSO\\Helpers' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-helpers.php' - ), - 'Automattic\\Jetpack\\Connection\\SSO\\Notices' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-notices.php' - ), - 'Automattic\\Jetpack\\Connection\\SSO\\User_Admin' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/sso/class-user-admin.php' - ), - 'Automattic\\Jetpack\\Connection\\Secrets' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php' - ), - 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php' - ), - 'Automattic\\Jetpack\\Connection\\Tokens' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php' - ), - 'Automattic\\Jetpack\\Connection\\Tokens_Locks' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php' - ), - 'Automattic\\Jetpack\\Connection\\Urls' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php' - ), - 'Automattic\\Jetpack\\Connection\\Utils' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php' - ), - 'Automattic\\Jetpack\\Connection\\Webhooks' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php' - ), - 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php' - ), - 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php' - ), - 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php' - ), - 'Automattic\\Jetpack\\Constants' => array( - 'version' => '2.0.2.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php' - ), - 'Automattic\\Jetpack\\CookieState' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php' - ), - 'Automattic\\Jetpack\\Current_Plan' => array( - 'version' => '0.4.7.0', - 'path' => $vendorDir . '/automattic/jetpack-plans/src/class-current-plan.php' - ), - 'Automattic\\Jetpack\\Device_Detection' => array( - 'version' => '2.1.3.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.3.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php' - ), - 'Automattic\\Jetpack\\Errors' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php' - ), - 'Automattic\\Jetpack\\Files' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php' - ), - 'Automattic\\Jetpack\\Heartbeat' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php' - ), - 'Automattic\\Jetpack\\IP\\Utils' => array( - 'version' => '0.2.2.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php' - ), - 'Automattic\\Jetpack\\IdentityCrisis\\Exception' => array( - 'version' => '0.20.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-exception.php' - ), - 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => array( - 'version' => '0.20.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php' - ), - 'Automattic\\Jetpack\\IdentityCrisis\\UI' => array( - 'version' => '0.20.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php' - ), - 'Automattic\\Jetpack\\IdentityCrisis\\URL_Secret' => array( - 'version' => '0.20.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-url-secret.php' - ), - 'Automattic\\Jetpack\\Identity_Crisis' => array( - 'version' => '0.20.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php' - ), - 'Automattic\\Jetpack\\JITMS\\JITM' => array( - 'version' => '3.1.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php' - ), - 'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => array( - 'version' => '3.1.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php' - ), - 'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => array( - 'version' => '3.1.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php' - ), - 'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => array( - 'version' => '3.1.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php' - ), - 'Automattic\\Jetpack\\Licensing' => array( - 'version' => '2.0.5.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php' - ), - 'Automattic\\Jetpack\\Licensing\\Endpoints' => array( - 'version' => '2.0.5.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php' - ), - 'Automattic\\Jetpack\\Modules' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Activitylog' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-activitylog.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Initializer' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Jetpack_Manage' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-jetpack-manage.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Product' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Creator' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-creator.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Jetpack_Ai' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Starter' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-starter.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Stats' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-stats.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\REST_AI' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-ai.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\REST_Product_Data' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-product-data.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\REST_Zendesk_Chat' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-zendesk-chat.php' - ), - 'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => array( - 'version' => '4.24.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php' - ), - 'Automattic\\Jetpack\\Partner' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php' - ), - 'Automattic\\Jetpack\\Partner_Coupon' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner-coupon.php' - ), - 'Automattic\\Jetpack\\Password_Checker' => array( - 'version' => '0.3.1.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php' - ), - 'Automattic\\Jetpack\\Paths' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php' - ), - 'Automattic\\Jetpack\\Plans' => array( - 'version' => '0.4.7.0', - 'path' => $vendorDir . '/automattic/jetpack-plans/src/class-plans.php' - ), - 'Automattic\\Jetpack\\Plugins_Installer' => array( - 'version' => '0.4.0.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\\Extension_Model' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/models/class-extension-model.php' - ), - 'Automattic\\Jetpack\\Protect\\Onboarding' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-onboarding.php' - ), - 'Automattic\\Jetpack\\Protect\\Plan' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-plan.php' - ), - 'Automattic\\Jetpack\\Protect\\Protect_Status' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-protect-status.php' - ), - 'Automattic\\Jetpack\\Protect\\REST_Controller' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-rest-controller.php' - ), - 'Automattic\\Jetpack\\Protect\\Scan_Status' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-scan-status.php' - ), - 'Automattic\\Jetpack\\Protect\\Site_Health' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-site-health.php' - ), - 'Automattic\\Jetpack\\Protect\\Status' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-status.php' - ), - 'Automattic\\Jetpack\\Protect\\Status_Model' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/models/class-status-model.php' - ), - 'Automattic\\Jetpack\\Protect\\Threat_Model' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/models/class-threat-model.php' - ), - 'Automattic\\Jetpack\\Protect\\Threats' => array( - 'version' => 'dev-trunk', - 'path' => $baseDir . '/src/class-threats.php' - ), - 'Automattic\\Jetpack\\Redirect' => array( - 'version' => '2.0.2.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php' - ), - 'Automattic\\Jetpack\\Roles' => array( - 'version' => '2.0.2.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php' - ), - 'Automattic\\Jetpack\\Status' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php' - ), - 'Automattic\\Jetpack\\Status\\Cache' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php' - ), - 'Automattic\\Jetpack\\Status\\Host' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php' - ), - 'Automattic\\Jetpack\\Status\\Visitor' => array( - 'version' => '3.2.0.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php' - ), - 'Automattic\\Jetpack\\Sync\\Actions' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php' - ), - 'Automattic\\Jetpack\\Sync\\Codec_Interface' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php' - ), - 'Automattic\\Jetpack\\Sync\\Data_Settings' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php' - ), - 'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php' - ), - 'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php' - ), - 'Automattic\\Jetpack\\Sync\\Defaults' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php' - ), - 'Automattic\\Jetpack\\Sync\\Functions' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php' - ), - 'Automattic\\Jetpack\\Sync\\Health' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php' - ), - 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php' - ), - 'Automattic\\Jetpack\\Sync\\Listener' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php' - ), - 'Automattic\\Jetpack\\Sync\\Lock' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php' - ), - 'Automattic\\Jetpack\\Sync\\Main' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Import' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Menus' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Meta' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Module' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Options' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Protect' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Search' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Stats' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Terms' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Themes' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Updates' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\Users' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php' - ), - 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce_HPOS_Orders' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php' - ), - 'Automattic\\Jetpack\\Sync\\Package_Version' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php' - ), - 'Automattic\\Jetpack\\Sync\\Queue' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php' - ), - 'Automattic\\Jetpack\\Sync\\Queue\\Queue_Storage_Options' => array( - 'version' => '2.16.6.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' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/sync-queue/class-queue-storage-table.php' - ), - 'Automattic\\Jetpack\\Sync\\Queue_Buffer' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php' - ), - 'Automattic\\Jetpack\\Sync\\REST_Endpoints' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php' - ), - 'Automattic\\Jetpack\\Sync\\REST_Sender' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php' - ), - 'Automattic\\Jetpack\\Sync\\Replicastore' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php' - ), - 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php' - ), - 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php' - ), - 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php' - ), - 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php' - ), - 'Automattic\\Jetpack\\Sync\\Sender' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php' - ), - 'Automattic\\Jetpack\\Sync\\Server' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php' - ), - 'Automattic\\Jetpack\\Sync\\Settings' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php' - ), - 'Automattic\\Jetpack\\Sync\\Simple_Codec' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php' - ), - 'Automattic\\Jetpack\\Sync\\Users' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php' - ), - 'Automattic\\Jetpack\\Sync\\Utils' => array( - 'version' => '2.16.6.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php' - ), - 'Automattic\\Jetpack\\Terms_Of_Service' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php' - ), - 'Automattic\\Jetpack\\Tracking' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php' - ), - 'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => array( - 'version' => '0.2.3.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.3.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.3.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.16.8.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.16.8.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.16.8.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.16.8.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.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php' - ), - 'Automattic\\Jetpack\\Waf\\CLI' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php' - ), - 'Automattic\\Jetpack\\Waf\\File_System_Exception' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php' - ), - 'Automattic\\Jetpack\\Waf\\REST_Controller' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php' - ), - 'Automattic\\Jetpack\\Waf\\Rules_API_Exception' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-rules-api-exception.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Constants' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Exception' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Initializer' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Operators' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Request' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Rules_Manager' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Runner' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Runtime' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Stats' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php' - ), - 'Automattic\\Jetpack\\Waf\\Waf_Transforms' => array( - 'version' => '0.16.8.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php' - ), - 'Container' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-container.php' - ), - 'Hook_Manager' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-hook-manager.php' - ), - 'Jetpack_IXR_Client' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php' - ), - 'Jetpack_IXR_ClientMulticall' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php' - ), - 'Jetpack_Options' => array( - 'version' => '2.8.4.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' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php' - ), - 'Jetpack_Tracks_Client' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php' - ), - 'Jetpack_Tracks_Event' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php' - ), - 'Jetpack_XMLRPC_Server' => array( - 'version' => '2.8.4.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php' - ), - 'Latest_Autoloader_Guard' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php' - ), - 'Manifest_Reader' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-manifest-reader.php' - ), - 'PHP_Autoloader' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-php-autoloader.php' - ), - 'Path_Processor' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-path-processor.php' - ), - 'Plugin_Locator' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugin-locator.php' - ), - 'Plugins_Handler' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugins-handler.php' - ), - 'Shutdown_Handler' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-shutdown-handler.php' - ), - 'Version_Loader' => array( - 'version' => '3.0.7', - 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-version-loader.php' - ), - 'Version_Selector' => array( - 'version' => '3.0.7', - '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 deleted file mode 100644 index 0f364af9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_filemap.php +++ /dev/null @@ -1,21 +0,0 @@ - array( - 'version' => '2.1.11.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/actions.php' - ), - '590147edb63acb03b2852d5c4db13ce8' => array( - 'version' => '0.2.3.0', - 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php' - ), - '3d45c7e6a7f0e71849e33afe4b3b3ede' => array( - 'version' => '0.16.8.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 deleted file mode 100644 index f79e574b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 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 deleted file mode 100644 index f6143fa3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-handler.php +++ /dev/null @@ -1,147 +0,0 @@ -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 deleted file mode 100644 index 601358c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-locator.php +++ /dev/null @@ -1,90 +0,0 @@ -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 ( ! $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 deleted file mode 100644 index f497bb38..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader.php +++ /dev/null @@ -1,90 +0,0 @@ -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 ) ); - - // 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 deleted file mode 100644 index 397f6fbd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-container.php +++ /dev/null @@ -1,150 +0,0 @@ - '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 deleted file mode 100644 index 9d81abef..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-hook-manager.php +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100644 index 3d2d5a5f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-latest-autoloader-guard.php +++ /dev/null @@ -1,86 +0,0 @@ -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; - } -} 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 deleted file mode 100644 index b9f0b679..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-manifest-reader.php +++ /dev/null @@ -1,99 +0,0 @@ -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 deleted file mode 100644 index 5792d8b3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-path-processor.php +++ /dev/null @@ -1,194 +0,0 @@ -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 deleted file mode 100644 index 5475a344..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-php-autoloader.php +++ /dev/null @@ -1,93 +0,0 @@ -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; - } - - $file = $jetpack_autoloader_loader->find_class_file( $class_name ); - if ( ! isset( $file ) ) { - return false; - } - - 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 deleted file mode 100644 index c0d1b428..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugin-locator.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index cf1c0ef7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugins-handler.php +++ /dev/null @@ -1,164 +0,0 @@ -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 deleted file mode 100644 index 6f31e3bd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-shutdown-handler.php +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 43c9c262..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-loader.php +++ /dev/null @@ -1,164 +0,0 @@ -version_selector = $version_selector; - $this->classmap = $classmap; - $this->psr4_map = $psr4_map; - $this->filemap = $filemap; - } - - /** - * 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( - isset( $this->classmap[ $class_name ] ) ? $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 deleted file mode 100644 index b8377566..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-selector.php +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100644 index d6456956..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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 deleted file mode 100644 index 344d6275..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/NOTICE +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 499899a8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/bench.php +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100644 index 1cb6384e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/check.php +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100644 index b2953c4d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringMatcher.php +++ /dev/null @@ -1,230 +0,0 @@ - - * - * 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 deleted file mode 100644 index 6b7891f6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringReplacer.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * 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/wp-webauthn/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/LICENSE deleted file mode 100644 index f288702d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. 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 -them 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 prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. 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. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey 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; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If 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 convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - 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. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -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. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - 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 -state 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 3 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, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program 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, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU 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. But first, please read -. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/blocks.build.js b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/blocks.build.js deleted file mode 100644 index e2b2005c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/blocks.build.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){function t(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var a=n(2),o=(n.n(a),wp.i18n.__),r=wp.blocks.registerBlockType;r("wp-webauthn/login",{title:o("WebAuthn Login Form","wp-webauthn"),icon:"admin-network",category:"widgets",keywords:["WebAuthn",o("Login Form","wp-webauthn")],attributes:{traditional:{type:"boolean",default:!0},username:{type:"string"},autoHide:{type:"boolean",default:!0},to:{type:"string"}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className;return wp.element.createElement("div",{className:r,style:{padding:"20px",boxSizing:"border-box",backgroundColor:"#F4F4F4",borderRadius:"3px"}},wp.element.createElement("span",{style:{fontSize:"15px",marginBottom:"20px",opacity:".5"}},o("WebAuthn Login Form","wp-webauthn")),wp.element.createElement(a.TextControl,{label:o("Default username","wp-webauthn"),value:t.username,onChange:function(e){n({username:e})}}),wp.element.createElement(a.TextControl,{label:o("Redirect to","wp-webauthn"),value:t.to,onChange:function(e){n({to:e})}}),wp.element.createElement(a.CheckboxControl,{label:o("Show password form as well","wp-webauthn"),checked:t.traditional,onChange:function(e){n({traditional:e})}}),wp.element.createElement(a.CheckboxControl,{label:o("Hide for logged-in users","wp-webauthn"),checked:t.autoHide,onChange:function(e){n({autoHide:e})}}))},save:function(e){var t=e.attributes;return'[wwa_login_form traditional="'+t.traditional+'" username="'+t.username+'" auto_hide="'+t.autoHide+'" to="'+t.to+'"]'}}),r("wp-webauthn/register",{title:o("WebAuthn Register Form","wp-webauthn"),icon:"plus-alt",category:"widgets",keywords:["WebAuthn",o("Register Form","wp-webauthn")],attributes:{display:{type:"boolean",default:!0}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className;return wp.element.createElement("div",{className:r,style:{padding:"20px",boxSizing:"border-box",backgroundColor:"#F4F4F4",borderRadius:"3px"}},wp.element.createElement("span",{style:{fontSize:"15px",marginBottom:"20px",opacity:".5"}},o("WebAuthn Register Form","wp-webauthn")),wp.element.createElement("div",{className:r,style:{height:"150px",display:"flex",justifyContent:"center",alignItems:"center"}},wp.element.createElement(a.CheckboxControl,{label:o("Show a message for users who doesn't logged-in","wp-webauthn"),checked:t.display,onChange:function(e){n({display:e})}})))},save:function(e){return'[wwa_register_form display="'+e.attributes.display+'"]'}}),r("wp-webauthn/verify",{title:o("WebAuthn Verify Buttons","wp-webauthn"),icon:"sos",category:"widgets",keywords:["WebAuthn",o("Verify Buttons","wp-webauthn")],attributes:{display:{type:"boolean",default:!0}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className;return wp.element.createElement("div",{className:r,style:{padding:"20px",boxSizing:"border-box",backgroundColor:"#F4F4F4",borderRadius:"3px"}},wp.element.createElement("span",{style:{fontSize:"15px",marginBottom:"20px",opacity:".5"}},o("WebAuthn Verify Buttons","wp-webauthn")),wp.element.createElement("div",{className:r,style:{height:"50px",display:"flex",justifyContent:"center",alignItems:"center"}},wp.element.createElement(a.CheckboxControl,{label:o("Show a message for users who doesn't logged-in","wp-webauthn"),checked:t.display,onChange:function(e){n({display:e})}})))},save:function(e){return'[wwa_verify_button display="'+e.attributes.display+'"]'}}),r("wp-webauthn/list",{title:o("WebAuthn Authenticator List","wp-webauthn"),icon:"menu",category:"widgets",keywords:["WebAuthn",o("Authenticator List","wp-webauthn")],attributes:{display:{type:"boolean",default:!0}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className;return wp.element.createElement("div",{className:r,style:{padding:"20px",boxSizing:"border-box",backgroundColor:"#F4F4F4",borderRadius:"3px"}},wp.element.createElement("span",{style:{fontSize:"15px",marginBottom:"20px",opacity:".5"}},o("WebAuthn Authenticator List","wp-webauthn")),wp.element.createElement("div",{className:r,style:{height:"150px",display:"flex",justifyContent:"center",alignItems:"center"}},wp.element.createElement(a.CheckboxControl,{label:o("Show a message for users who doesn't logged-in","wp-webauthn"),checked:t.display,onChange:function(e){n({display:e})}})))},save:function(e){return'[wwa_list display="'+e.attributes.display+'"]'}})},function(e,t){e.exports=wp.components}]); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-tr_TR-wwa_block_js.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-tr_TR-wwa_block_js.json deleted file mode 100644 index 319ee248..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-tr_TR-wwa_block_js.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"2021-04-23 19:43+0300","generator":"WP-CLI\/2.4.0","source":"wp-webauthn.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"tr_TR","plural-forms":"nplurals=2; plural=(n != 1);"},"WebAuthn Login Form":["WebAuthn Giri\u015f Formu"],"Login Form":["Giri\u015f Formu"],"Default username":["Varsay\u0131lan kullan\u0131c\u0131 ad\u0131"],"Redirect to":["\u015euraya y\u00f6nlendir"],"Show password form as well":["\u015eifre formunu da g\u00f6ster"],"Hide for logged-in users":["Giri\u015f yapm\u0131\u015f kullan\u0131c\u0131lar i\u00e7in gizle"],"WebAuthn Register Form":["WebAuthn Kay\u0131t Formu"],"Register Form":["Kay\u0131t Formu"],"Show a message for users who doesn't logged-in":["Giri\u015f yapmayan kullan\u0131c\u0131lar i\u00e7in bir mesaj g\u00f6ster"],"WebAuthn Verify Buttons":["WebAuthn Butonlar\u0131 Do\u011frula"],"Verify Buttons":["Butonlar\u0131 Do\u011frula"],"WebAuthn Authenticator List":["WebAuthn Kimlik Do\u011frulay\u0131c\u0131 Listesi"],"Authenticator List":["Kimlik Do\u011frulay\u0131c\u0131 Listesi"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_CN-wwa_block_js.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_CN-wwa_block_js.json deleted file mode 100644 index 059a1a62..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_CN-wwa_block_js.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"YEAR-MO-DA HO:MI+ZONE","generator":"WP-CLI\/2.4.0","source":"wp-webauthn.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en","plural-forms":"nplurals=2; plural=(n != 1);"},"WebAuthn Login Form":["WebAuthn \u767b\u5f55\u8868\u5355"],"Login Form":["\u767b\u5f55\u8868\u5355"],"Default username":["\u9ed8\u8ba4\u7528\u6237\u540d"],"Redirect to":["\u91cd\u5b9a\u5411\u5230"],"Show password form as well":["\u5305\u542b\u5bc6\u7801\u767b\u5f55\u8868\u5355"],"Hide for logged-in users":["\u5bf9\u5df2\u767b\u5f55\u7528\u6237\u9690\u85cf"],"WebAuthn Register Form":["WebAuthn \u7ed1\u5b9a\u8868\u5355"],"Register Form":["\u7ed1\u5b9a\u8868\u5355"],"Show a message for users who doesn't logged-in":["\u5411\u672a\u767b\u5f55\u7528\u6237\u663e\u793a\u4e00\u6761\u63d0\u793a"],"WebAuthn Verify Buttons":["WebAuthn \u6d4b\u8bd5\u6309\u94ae"],"Verify Buttons":["\u6d4b\u8bd5\u6309\u94ae"],"WebAuthn Authenticator List":["WebAuthn \u8ba4\u8bc1\u5668\u5217\u8868"],"Authenticator List":["\u8ba4\u8bc1\u5668\u5217\u8868"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_HK-wwa_block_js.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_HK-wwa_block_js.json deleted file mode 100644 index 27512220..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_HK-wwa_block_js.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"YEAR-MO-DA HO:MI+ZONE","generator":"WP-CLI\/2.4.0","source":"wp-webauthn.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en","plural-forms":"nplurals=2; plural=(n != 1);"},"WebAuthn Login Form":["WebAuthn \u767b\u5165\u8868\u55ae"],"Login Form":["\u767b\u5165\u8868\u55ae"],"Default username":["\u9810\u8a2d\u4f7f\u7528\u8005\u540d\u7a31"],"Redirect to":["\u91cd\u5b9a\u5411\u5230"],"Show password form as well":["\u5305\u542b\u5bc6\u78bc\u767b\u9304\u8868\u55ae"],"Hide for logged-in users":["\u5c0d\u5df2\u767b\u5165\u7684\u4f7f\u7528\u8005\u96b1\u85cf"],"WebAuthn Register Form":["WebAuthn \u7d81\u5b9a\u8868\u55ae"],"Register Form":["\u7d81\u5b9a\u8868\u55ae"],"Show a message for users who doesn't logged-in":["\u5411\u672a\u767b\u5165\u7684\u4f7f\u7528\u8005\u986f\u793a\u4e00\u689d\u63d0\u793a"],"WebAuthn Verify Buttons":["WebAuthn \u6e2c\u8a66\u6309\u9215"],"Verify Buttons":["\u6e2c\u8a66\u6309\u9215"],"WebAuthn Authenticator List":["WebAuthn \u8a8d\u8b49\u5668\u5217\u8868"],"Authenticator List":["\u8a8d\u8b49\u5668\u5217\u8868"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_TW-wwa_block_js.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_TW-wwa_block_js.json deleted file mode 100644 index 3de719e9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/blocks/languages/wp-webauthn-zh_TW-wwa_block_js.json +++ /dev/null @@ -1 +0,0 @@ -{"translation-revision-date":"YEAR-MO-DA HO:MI+ZONE","generator":"WP-CLI\/2.4.0","source":"wp-webauthn.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en","plural-forms":"nplurals=2; plural=(n != 1);"},"WebAuthn Login Form":["WebAuthn \u767b\u5165\u8868\u55ae"],"Login Form":["\u767b\u5165\u8868\u55ae"],"Default username":["\u9810\u8a2d\u4f7f\u7528\u8005\u540d\u7a31"],"Redirect to":["\u91cd\u5b9a\u5411\u5230"],"Show password form as well":["\u5305\u542b\u5bc6\u78bc\u767b\u9304\u8868\u55ae"],"Hide for logged-in users":["\u5c0d\u5df2\u767b\u5165\u7684\u4f7f\u7528\u8005\u96b1\u85cf"],"WebAuthn Register Form":["WebAuthn \u8a3b\u518a\u8868\u55ae"],"Register Form":["\u8a3b\u518a\u8868\u55ae"],"Show a message for users who doesn't logged-in":["\u5411\u672a\u767b\u5165\u7684\u4f7f\u7528\u8005\u986f\u793a\u4e00\u689d\u63d0\u793a"],"WebAuthn Verify Buttons":["WebAuthn \u6e2c\u8a66\u6309\u9215"],"Verify Buttons":["\u6e2c\u8a66\u6309\u9215"],"WebAuthn Authenticator List":["WebAuthn \u9a57\u8b49\u5668\u5217\u8868"],"Authenticator List":["\u9a57\u8b49\u5668\u5217\u8868"]}}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/admin.css b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/admin.css deleted file mode 100644 index 73f3bc3b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/admin.css +++ /dev/null @@ -1,54 +0,0 @@ -.wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) { - display: table-cell; -} -#wwa-show-progress .wwa-success, #wwa-show-test .wwa-success, #wwa-show-test-usernameless .wwa-success { - color: #2C8D46; -} -#wwa-show-progress .wwa-failed, #wwa-show-test .wwa-failed, #wwa-show-test-usernameless .wwa-failed { - color: #CA4A1F; -} -#wwa-show-progress, #wwa-show-test, #wwa-show-test-usernameless { - vertical-align: sub; -} -#wwa_log { - max-width: 100%; - font-family: Consolas,"Source Code Pro","Liberation Mono","Courier New",Courier,"Noto Sans", "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Source Han Sans CN", "Microsoft YaHei",monospace; - white-space: pre; -} -#clear_log { - margin-top: 3px; -} -.wwa-table { - overflow-x: auto; -} -.wwa-table table { - min-width: 650px; -} -.wwa-table td a:nth-child(2) { - color: #a00; -} -.wwa-usernameless-th, .wwa-usernameless-td { - display: none; -} -#wwa-add-new-btn, #wwa-verify-btn, #wwa-test { - margin-top: 10px; -} -#wwa-show-test { - margin-top: 15px; - display: inline-block; -} -#wwa-new-block, #wwa-verify-block { - display: none; - padding: 0 20px 20px; - border: 1px solid #CCD0D4; - margin-top: 15px; - border-radius: 3px; - background-color: #ececec; -} -.wwa-cancel { - margin-top: 20px!important; - float: right; -} -#wp-webauthn-uv-warning { - margin: 15px 0 0; -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/frontend.css b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/frontend.css deleted file mode 100644 index e4ecfba0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/frontend.css +++ /dev/null @@ -1,264 +0,0 @@ -.wwa-list-table { - table-layout: fixed; - border: 1px solid rgba(204, 208, 212, 0.7); - box-shadow: 0 1px 1px rgba(0,0,0,.04); - border-spacing: 0; - width: 100%; - clear: both; - margin: 0!important; - min-width: 700px; -} -.wwa-list-table * { - word-wrap: break-word; -} -.wwa-list-table td, .wwa-list-table th { - padding: 8px 10px; -} -.wwa-list-table tfoot td, .wwa-list-table tfoot th, .wwa-list-table thead td, .wwa-list-table thead th{ - line-height: 1.4em; -} -.wwa-list-table thead td, .wwa-list-table thead th { - border-bottom: 1px solid rgba(204, 208, 212, 0.7); -} -.wwa-list-table tfoot td, .wwa-list-table tfoot th { - border-top: 1px solid rgba(204, 208, 212, 0.7); - border-bottom: none; -} -.wwa-list-table tfoot td, .wwa-list-table th, .wwa-list-table thead td { - font-weight: 400; -} -.wwa-list-table tfoot td, .wwa-list-table th, .wwa-list-table thead td { - text-align: left; - line-height: 1.3em; - font-size: 14px; -} -.wwa-list-table > tbody > :nth-child(odd) { - background-color: rgba(127, 127, 127, .15); -} -.wwa-list-table td { - font-size: 13px; - line-height: 1.5em; -} -.wwa-list-table td { - vertical-align: top; -} -.wwa-bind-name-description, .wwa-bind-name-description, .wwa-bind-usernameless-description, .wwa-authenticator-list-usernameless-tip, .wwa-authenticator-list-type-tip { - opacity: .7; - font-size: 14px; -} -.wwa-authenticator-type, .wwa-authenticator-name { - margin-left: 15px; -} -.wwa-login-form { - max-width: 350px; - margin: 0 auto; - padding: 20px; - padding-bottom: 40px; -} -.wwa-login-form form p, .wwa-login-form-webauthn p { - margin-bottom: 0; - line-height: 1.5; -} -.wwa-login-form * { - margin: 0; - padding: 0; -} -.wwa-login-form label { - font-size: 14px; - line-height: 1.5; - display: inline-block; - margin-bottom: 3px; - vertical-align: middle; - cursor: pointer; -} -.wwa-login-form form .input, .wwa-login-form input[type="password"], .wwa-login-form input[type="text"] { - font-size: 24px; - line-height: 1.33333333; - width: 100%; - border-width: .0625rem; - padding: .1875rem .3125rem; - margin: 0 6px 16px 0; - min-height: 40px; - max-height: none; -} -.wwa-login-form input[type="password"], .wwa-login-form input[type="text"] { - padding: 0 8px; - line-height: 2; - height: 30px; - box-sizing: border-box; -} -.wwa-login-form input[type="password"], .wwa-login-form input[type="text"], .wwa-login-form select, .wwa-login-form textarea { - box-shadow: 0 0 0 transparent; - border-radius: 4px; - border: 1px solid rgba(126, 137, 147, 0.7); - color: #32373c; -} -.wwa-login-form form .login-remember { - font-weight: 400; - float: left; - display: block; - margin-bottom: 0; -} -.wwa-login-form input[type="checkbox"] { - border: 1px solid #7e8993; - border-radius: 4px; - background: #fff; - color: #555; - clear: none; - cursor: pointer; - display: inline-block; - line-height: 0; - height: 1rem; - margin: -.25rem .25rem 0 0; - outline: 0; - padding: 0 !important; - text-align: center; - vertical-align: middle; - width: 1rem; - min-width: 1rem; - -webkit-appearance: none; - box-shadow: inset 0 1px 2px rgba(0,0,0,.1); - transition: .05s border-color ease-in-out; -} -.wwa-login-form input[type="checkbox"]:checked::before { - content: url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%231e8cbe%27%2F%3E%3C%2Fsvg%3E); - margin: -.1875rem 0 0 -.25rem; - height: 1.3125rem; - width: 1.3125rem; - float: left; -} -.wwa-login-form .button-primary { - border-width: 0; - border-style: none; - padding: 0; - min-height: 32px; - line-height: 2.30769231; - padding: 0 12px; - vertical-align: baseline; - float: right; - background: #007cba; - border-color: #007cba; - color: #fff; - text-decoration: none; - text-shadow: none; -} -.wwa-login-form .button-primary, .wwa-login-form .button-secondary { - display: inline-block; - text-decoration: none; - font-size: 13px; - line-height: 2.15384615; - height: 30px; - margin: 0; - padding: 0 10px; - cursor: pointer; - border-width: 1px; - border-style: solid; - -webkit-appearance: none; - border-radius: 3px; - white-space: nowrap; - box-sizing: border-box; - margin-left: 5px; -} -.wwa-login-form .button-primary:focus, .wwa-login-form .button-primary:hover { - background: #0071a1; - border-color: #0071a1; - color: #fff; - outline: 2px solid transparent; - outline-offset: 0; -} -.wwa-login-form .button-primary:focus { - box-shadow: 0 0 0 1px #fff,0 0 0 3px #007cba; -} -.wwa-login-form .button-primary:active { - background: #00669b; - border-color: #00669b; - box-shadow: none; - color: #fff; -} -.wwa-login-form .button-primary:disabled, .wwa-login-form .button-primary[disabled] { - color: #66c6e4 !important; - background: #008ec2 !important; - border-color: #008ec2 !important; - box-shadow: none !important; - text-shadow: none !important; - cursor: default; -} -.wwa-show-test .success, .wwa-show-test-usernameless .success, .wwa-show-progress .success, .wwa-login-form .wwa-success { - color: #2C8D46; -} -.wwa-show-test .failed, .wwa-show-test-usernameless .failed, .wwa-show-progress .failed, .wwa-login-form .wwa-failed { - color: #CA4A1F; -} -.wwa-hide-form { - display: none; -} -.wwa-login-form-webauthn .wp-webauthn-notice { - text-align: center; - color: #72777c; - font-size: 18px; - padding-bottom: 20px; - justify-content: center; - align-items: center; - flex-direction: column; - display: flex; - line-height: 1; -} -.wp-webauthn-notice span { - line-height: 1; -} -.wp-webauthn-notice { - pointer-events: none; -} -.wwa-login-form-webauthn { - margin-bottom: 30px; -} -.wwa-t2w { - font-size: 14px; - color: #00719F; - text-decoration: underline; -} -.wwa-t2w > span { - cursor: pointer; -} -.wwa-w2t { - font-size: 14px; - float: left; - color: #00719F; - text-decoration: underline; - cursor: pointer; -} -.wwa-try-username { - margin-top: 3px; - font-size: 14px; - opacity: .7; - color: black; - pointer-events: none; -} -.wwa-table-container { - width: 100%; - overflow-y: auto; -} -.wwa-usernameless-th, .wwa-usernameless-td { - display: none; -} -#wwa-rememberme { - vertical-align: text-bottom; -} -.wwa-remember-label { - margin-bottom: 10px!important; - margin-top: 2px!important; -} -.wwa-form-left { - display: inline-flex; - flex-direction: column; -} -@media(max-width: 720px){ - .wwa-login-form .button-primary, .wwa-login-form .button-secondary { - padding: 0 14px; - line-height: 2.71428571; - font-size: 14px; - vertical-align: middle; - min-height: 40px; - margin-bottom: 4px; - } -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/login.css b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/login.css deleted file mode 100644 index bb1f8895..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/css/login.css +++ /dev/null @@ -1,54 +0,0 @@ -#wp-webauthn { - margin-right: 5px; -} -#wp-webauthn span { - line-height: 30px; -} -#wp-webauthn-check { - display: none!important; -} -.wp-webauthn-notice { - font-size: 18px; - text-align: center; - height: 74.25px; - justify-content: center; - align-items: center; - flex-direction: column; - margin-bottom: 10px; - opacity: .8; - display: none; - pointer-events: none; -} -.wp-webauthn-notice .wwa-success { - color: #2C8D46; -} -.wp-webauthn-notice .wwa-failed { - color: #CA4A1F; -} -.wwa-try-username { - margin-top: 3px; - font-size: 12px; - opacity: .7; - color: black; - pointer-events: none; -} -#loginform p.submit { - display: flex; - flex-direction: row-reverse; - width: max-content; - float: right; -} -#loginform .login .button-primary { - float: none; -} -#loginform .forgetmenot { - margin-bottom: 8px; -} -#loginform.wwa-webauthn-only { - padding-bottom: 30px; -} -@media(max-width: 782px){ - #wp-webauthn span { - line-height: 38px; - } -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/admin.js b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/admin.js deleted file mode 100644 index b2d0a6cf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/admin.js +++ /dev/null @@ -1,85 +0,0 @@ -jQuery(() => { - let div = document.getElementById('wwa_log'); - if (div !== null) { - div.scrollTop = div.scrollHeight; - if (jQuery('#wwa-remove-log').length === 0) { - setInterval(() => { - updateLog(); - }, 5000); - } - } - - jQuery('input[name=user_verification]').on('change', () => { - if (jQuery('input[name=user_verification]:checked').val() === 'false') { - jQuery('#wwa-uv-field').after(``); - } else { - jQuery('#wp-webauthn-uv-warning').remove(); - } - }); - - setTimeout(() => { - if (jQuery('input[name=user_verification]:checked').val() === 'false') { - jQuery('#wwa-uv-field').after(``); - } - }, 0); -}) - -// Update log -function updateLog() { - if (jQuery('#wwa_log').length === 0) { - return; - } - jQuery.ajax({ - url: php_vars.ajax_url, - type: 'GET', - data: { - action: 'wwa_get_log' - }, - success: function (data) { - if (typeof data === 'string') { - console.warn(data); - jQuery('#wwa_log').text(php_vars.i18n_3); - return; - } - if (data.length === 0) { - document.getElementById('clear_log').disabled = true; - jQuery('#wwa_log').text(''); - jQuery('#wwa-remove-log').remove(); - jQuery('#log-count').text(php_vars.i18n_2 + '0'); - return; - } - document.getElementById('clear_log').disabled = false; - let data_str = data.join('\n'); - if (data_str !== jQuery('#wwa_log').text()) { - jQuery('#wwa_log').text(data_str); - jQuery('#log-count').text(php_vars.i18n_2 + data.length); - let div = document.getElementById('wwa_log'); - div.scrollTop = div.scrollHeight; - } - }, - error: function () { - jQuery('#wwa_log').text(php_vars.i18n_3); - } - }) -} - -// Clear log -jQuery('#clear_log').click((e) => { - e.preventDefault(); - document.getElementById('clear_log').disabled = true; - jQuery.ajax({ - url: php_vars.ajax_url, - type: 'GET', - data: { - action: 'wwa_clear_log' - }, - success: function () { - updateLog(); - }, - error: function (data) { - document.getElementById('clear_log').disabled = false; - alert(`Error: ${data}`); - updateLog(); - } - }) -}) diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/default_wa.js b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/default_wa.js deleted file mode 100644 index ca8632b7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/default_wa.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -document.addEventListener('DOMContentLoaded', () => { - if (document.querySelectorAll('#lostpasswordform, #registerform, .admin-email-confirm-form, #resetpassform').length > 0) { - return; - } - if (document.getElementById('loginform') === null || document.getElementById('loginform').getAttribute('name') !== 'loginform') { - return; - } - window.onload = () => { - if (php_vars.webauthn_only === 'true') { - if ((window.PublicKeyCredential === undefined || navigator.credentials.create === undefined || typeof navigator.credentials.create !== 'function')) { - // Not support, show a message - if (document.querySelectorAll('#login > h1').length > 0) { - let dom = document.createElement('p'); - dom.className = 'message'; - dom.innerHTML = php_vars.i18n_8; - document.querySelectorAll('#login > h1')[0].parentNode.insertBefore(dom, document.querySelectorAll('#login > h1')[0].nextElementSibling) - } - } - wwa_dom('#loginform', (dom) => { dom.classList.add('wwa-webauthn-only') }); - if (document.getElementsByClassName('user-pass-wrap').length > 0) { - wwa_dom('.user-pass-wrap, #wp-submit', (dom) => { dom.parentNode.removeChild(dom) }); - if (php_vars.remember_me === 'false' ) { - wwa_dom('.forgetmenot', (dom) => { dom.parentNode.removeChild(dom) }); - } - } else { - // WordPress 5.2- - wwa_dom('#wp-submit', (dom) => { dom.parentNode.removeChild(dom) }); - if (php_vars.remember_me === 'false' ) { - wwa_dom('.forgetmenot', (dom) => { dom.parentNode.removeChild(dom) }); - } - const targetDOM = document.getElementById('loginform').getElementsByTagName('p')[1]; - targetDOM.parentNode.removeChild(targetDOM); - } - } - if (!(window.PublicKeyCredential === undefined || navigator.credentials.create === undefined || typeof navigator.credentials.create !== 'function') || php_vars.webauthn_only === 'true') { - // If supported, toggle - if (php_vars.webauthn_only !== 'true') { - if (document.getElementsByClassName('user-pass-wrap').length > 0) { - wwa_dom('.user-pass-wrap, #wp-submit', (dom) => { dom.style.display = 'none' }); - if (php_vars.remember_me === 'false' ) { - wwa_dom('.forgetmenot', (dom) => { dom.style.display = 'none' }); - } - } else { - // WordPress 5.2- - wwa_dom('#wp-submit', (dom) => { dom.style.display = 'none' }); - if (php_vars.remember_me === 'false' ) { - wwa_dom('.forgetmenot', (dom) => { dom.style.display = 'none' }); - } - document.getElementById('loginform').getElementsByTagName('p')[1].style.display = 'none'; - } - } - wwa_dom('wp-webauthn-notice', (dom) => { dom.style.display = 'flex' }, 'class'); - wwa_dom('wp-webauthn-check', (dom) => { dom.style.cssText = `${dom.style.cssText}display: block !important` }, 'id'); - wwa_dom('user_login', (dom) => { dom.focus() }, 'id'); - wwa_dom('wp-submit', (dom) => { dom.disabled = true }, 'id'); - } - if (document.querySelectorAll('#lostpasswordform, #registerform, .admin-email-confirm-form, #resetpassform').length > 0) { - return; - } - wwa_dom('user_pass', (dom) => { dom.disabled = false }, 'id'); - let dom = document.querySelectorAll('#loginform label'); - if (dom.length > 0) { - if (dom[0].getElementsByTagName('input').length > 0) { - // WordPress 5.2- - dom[0].innerHTML = `${php_vars.email_login === 'true' ? php_vars.i18n_10 : php_vars.i18n_9}${dom[0].innerHTML.split('
          ')[1]}`; - } else { - dom[0].innerText = php_vars.email_login === 'true' ? php_vars.i18n_10 : php_vars.i18n_9; - } - } - } -}) \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/frontend.js b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/frontend.js deleted file mode 100644 index 5cd61d97..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/frontend.js +++ /dev/null @@ -1,635 +0,0 @@ -'use strict'; - -// Send an AJAX request and get the response -const wwa_ajax = function () { - let xmlHttpReq = new XMLHttpRequest(); - return { - /** Send an AJAX GET request and get the response - * - * @param {string} url URL - * @param {string} data Attached data - * @param {object} callback Callback function - */ - get: (url, data = '', callback = () => { }) => { - xmlHttpReq.open('GET', url + data, true); - xmlHttpReq.send(); - xmlHttpReq.onreadystatechange = () => { - if (xmlHttpReq.readyState === 4 && xmlHttpReq.status === 200) { - callback(xmlHttpReq.responseText, true); - } else if (xmlHttpReq.readyState === 4) { - callback('Network Error.', false); - } - } - }, - /** Send an AJAX POST request and get the response - * - * @param {string} url URL - * @param {string} data Attached data - * @param {object} callback Callback function - */ - post: (url, data = '', callback = () => { }) => { - xmlHttpReq.open('POST', url, true); - xmlHttpReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); - xmlHttpReq.send(data); - xmlHttpReq.onreadystatechange = () => { - if (xmlHttpReq.readyState === 4 && xmlHttpReq.status === 200) { - callback(xmlHttpReq.responseText, true); - } else if (xmlHttpReq.readyState === 4) { - callback('Network Error.', false); - } - } - } - } -}; - -/** Operate selected DOMs - * - * @param {string} selector DOM selector - * @param {object} callback Callbck function - * @param {string} method Selecte method - */ -const wwa_dom = (selector, callback = () => { }, method = 'query') => { - let dom_list = []; - if (method === 'id') { - let dom = document.getElementById(selector); - if (dom) { - callback(dom); - } - return; - } else if (method === 'class') { - dom_list = document.getElementsByClassName(selector); - } else if (method === 'tag') { - dom_list = document.getElementsByTagName(selector); - } else { - dom_list = document.querySelectorAll(selector); - } - for (let dom of dom_list) { - callback(dom); - } - return; -} - -/** Code Base64URL into Base64 - * - * @param {string} input Base64URL coded string - */ -function base64url2base64(input) { - input = input.replace(/=/g, '').replace(/-/g, '+').replace(/_/g, '/'); - const pad = input.length % 4; - if (pad) { - if (pad === 1) { - throw new Error('InvalidLengthError: Input base64url string is the wrong length to determine padding'); - } - input += new Array(5 - pad).join('='); - } - return input; -} - -/** Code Uint8Array into Base64 string - * - * @param {Uint8Array} a The Uint8Array needed to be coded into Base64 string - */ -function arrayToBase64String(a) { - return btoa(String.fromCharCode(...a)); -} - -// Disable all WP-Webauthn buttons -function wwa_disable_buttons() { - wwa_dom('wwa-test-submit', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wwa-test-usernameless-submit', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wwa-bind-submit', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wwa-login-submit', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wp-submit', (dom) => { dom.disabled = true }, 'id'); -} - -// Enable all WP-Webauthn buttons -function wwa_enable_buttons() { - wwa_dom('wwa-test-submit', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-test-usernameless-submit', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-bind-submit', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-login-submit', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wp-submit', (dom) => { dom.disabled = false }, 'id'); -} - -document.addEventListener('DOMContentLoaded', () => { - wwa_dom('wwa-login-submit', (dom) => { dom.addEventListener('click', wwa_auth, false) }, 'class'); - // If traditional form exists - if (document.getElementsByClassName('wwa-login-form-traditional').length > 0) { - wwa_dom('.wwa-login-form-traditional .login-password', (dom) => { - let height = dom.clientHeight; - wwa_dom('.wwa-login-form-webauthn .wp-webauthn-notice', (ele) => { - ele.style.height = height - 40.4 + 'px'; - }); - }); - wwa_dom('wwa-w2t', (dom) => { dom.addEventListener('click', wwa_toggle, false) }, 'class'); - wwa_dom('wwa-t2w', (dom) => { dom.addEventListener('click', wwa_toggle, false) }, 'class'); - } else { - wwa_dom('.wwa-login-form-webauthn .wp-webauthn-notice', (ele) => { - ele.style.height = '40.6px'; - }); - wwa_dom('wwa-w2t', (dom) => { dom.parentNode.removeChild(document.getElementsByClassName('wwa-w2t')[0]) }, 'class'); - } - // If not support - if (window.PublicKeyCredential === undefined || navigator.credentials.create === undefined || typeof navigator.credentials.create !== 'function') { - wwa_dom('wwa-test-submit', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wwa-test-usernameless-submit', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wwa-bind-submit', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wwa-show-test', (dom) => { dom.innerText = wwa_php_vars.i18n_31 }, 'class'); - wwa_dom('wwa-show-progress', (dom) => { dom.innerText = wwa_php_vars.i18n_31 }, 'class'); - if (document.getElementsByClassName('wwa-login-form-traditional').length > 0) { - wwa_dom('wwa-login-form-webauthn', (dom) => { dom.classList.add('wwa-hide-form') }, 'class'); - } - return; - } - wwa_dom('wwa-login-form-traditional', (dom) => { dom.classList.add('wwa-hide-form') }, 'class'); - wwa_dom('wwa-bind-submit', (dom) => { dom.addEventListener('click', wwa_bind, false) }, 'class'); - wwa_dom('wwa-test-submit', (dom) => { dom.addEventListener('click', wwa_verify, false) }, 'class'); - wwa_dom('wwa-test-usernameless-submit', (dom) => { dom.addEventListener('click', wwa_verify, false) }, 'class'); - updateList(); -}); - -// Toggle form -function wwa_toggle(e) { - e.preventDefault(); - if (document.getElementsByClassName('wwa-login-form-traditional').length > 0) { - // Disable buttons if it is not shown - if (document.getElementsByClassName('wwa-login-form-traditional')[0].className.indexOf('wwa-hide-form') !== -1) { - wwa_dom('wp-submit', (dom) => { dom.disabled = false }, 'id'); - wwa_dom('wwa-login-submit', (dom) => { dom.disabled = true }, 'class'); - setTimeout(() => { - wwa_dom('user_login', (dom) => { dom.focus() }, 'id'); - }, 0); - } else { - wwa_dom('wp-submit', (dom) => { dom.disabled = true }, 'id'); - wwa_dom('wwa-login-submit', (dom) => { dom.disabled = false }, 'class'); - setTimeout(() => { - wwa_dom('wwa-user-name', (dom) => { dom.focus() }, 'id'); - }, 0); - } - document.getElementsByClassName('wwa-login-form-traditional')[0].classList.toggle('wwa-hide-form'); - document.getElementsByClassName('wwa-login-form-webauthn')[0].classList.toggle('wwa-hide-form'); - } -} - -// Auth -function wwa_auth() { - if (window.PublicKeyCredential === undefined || navigator.credentials.create === undefined || typeof navigator.credentials.create !== 'function') { - alert(wwa_php_vars.i18n_31); - return; - } - let wwa_username = this.parentNode.previousElementSibling.previousElementSibling.getElementsByClassName('wwa-user-name')[0].value; - if (wwa_username === '' && wwa_php_vars.usernameless !== 'true') { - alert(wwa_php_vars.i18n_11); - return; - } - wwa_dom('wwa-user-name', (dom) => { dom.readOnly = true }, 'class'); - wwa_disable_buttons(); - let button_dom = this; - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_3; - let request = wwa_ajax(); - request.get(wwa_php_vars.ajax_url, `?action=wwa_auth_start&user=${encodeURIComponent(wwa_username)}&type=auth`, (rawData, status) => { - if (status) { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_4; - let data = rawData; - try { - data = JSON.parse(rawData); - } catch (e) { - console.warn(rawData); - wwa_enable_buttons(); - if (wwa_php_vars.usernameless === 'true' && wwa_username === '') { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7 + wwa_php_vars.i18n_33; - } else { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7; - } - wwa_dom('wwa-user-name', (dom) => { dom.readOnly = false }, 'class'); - return; - } - data.challenge = Uint8Array.from(window.atob(base64url2base64(data.challenge)), (c) => c.charCodeAt(0)); - - if (data.allowCredentials) { - data.allowCredentials = data.allowCredentials.map((item) => { - item.id = Uint8Array.from(window.atob(base64url2base64(item.id)), (c) => c.charCodeAt(0)); - return item; - }); - } - - // Save client ID - const clientID = data.clientID; - delete data.clientID; - - navigator.credentials.get({ 'publicKey': data }).then((credentialInfo) => { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_5; - return credentialInfo; - }).then((data) => { - const publicKeyCredential = { - id: data.id, - type: data.type, - rawId: arrayToBase64String(new Uint8Array(data.rawId)), - response: { - authenticatorData: arrayToBase64String(new Uint8Array(data.response.authenticatorData)), - clientDataJSON: arrayToBase64String(new Uint8Array(data.response.clientDataJSON)), - signature: arrayToBase64String(new Uint8Array(data.response.signature)), - userHandle: data.response.userHandle ? arrayToBase64String(new Uint8Array(data.response.userHandle)) : null - } - }; - return publicKeyCredential; - }).then(JSON.stringify).then((AuthenticatorResponse) => { - let response = wwa_ajax(); - response.post(`${wwa_php_vars.ajax_url}?action=wwa_auth`, `data=${encodeURIComponent(window.btoa(AuthenticatorResponse))}&type=auth&clientid=${clientID}&user=${encodeURIComponent(wwa_username)}&remember=${wwa_php_vars.remember_me === 'false' ? 'false' : (document.getElementById('wwa-rememberme') ? (document.getElementById('wwa-rememberme').checked ? 'true' : 'false') : 'false')}`, (data, status) => { - if (status) { - if (data === 'true') { - wwa_enable_buttons(); - wwa_dom('wwa-user-name', (dom) => { dom.readOnly = false }, 'class'); - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_6; - if (document.querySelectorAll('p.login-submit input[name="redirect_to"]').length > 0) { - setTimeout(() => { - window.location.href = document.querySelectorAll('p.login-submit input[name="redirect_to"]')[0].value; - }, 200); - } else { - if (document.getElementsByClassName('wwa-redirect-to').length > 0) { - setTimeout(() => { - window.location.href = document.getElementsByClassName('wwa-redirect-to')[0].value; - }, 200); - } else { - setTimeout(() => { - window.location.reload(); - }, 200); - } - } - } else { - wwa_enable_buttons(); - if (wwa_php_vars.usernameless === 'true' && wwa_username === '') { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7 + wwa_php_vars.i18n_33; - } else { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7; - } - wwa_dom('wwa-user-name', (dom) => { dom.readOnly = false }, 'class'); - } - } else { - wwa_enable_buttons(); - if (wwa_php_vars.usernameless === 'true' && wwa_username === '') { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7 + wwa_php_vars.i18n_33; - } else { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7; - } - wwa_dom('wwa-user-name', (dom) => { dom.readOnly = false }, 'class'); - } - }) - }).catch((error) => { - console.warn(error); - wwa_enable_buttons(); - if (wwa_php_vars.usernameless === 'true' && wwa_username === '') { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7 + wwa_php_vars.i18n_33; - } else { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7; - } - wwa_dom('wwa-user-name', (dom) => { dom.readOnly = false }, 'class'); - }) - } else { - wwa_enable_buttons(); - if (wwa_php_vars.usernameless === 'true' && wwa_username === '') { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7 + wwa_php_vars.i18n_33; - } else { - button_dom.parentNode.previousElementSibling.innerHTML = wwa_php_vars.i18n_7; - } - wwa_dom('wwa-user-name', (dom) => { dom.readOnly = false }, 'class'); - } - }) -} - -// Bind -function wwa_bind() { - let button_dom = this; - let wwa_name = this.parentNode.parentNode.getElementsByClassName('wwa-authenticator-name')[0].value; - if (wwa_name === '') { - alert(wwa_php_vars.i18n_12); - return; - } - let wwa_type = this.parentNode.parentNode.getElementsByClassName('wwa-authenticator-type')[0].value; - let wwa_usernameless = this.parentNode.parentNode.querySelectorAll('.wwa-authenticator-usernameless:checked')[0] ? this.parentNode.parentNode.querySelectorAll('.wwa-authenticator-usernameless:checked')[0].value : 'false'; - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_3; - wwa_disable_buttons(); - // Lock options - wwa_dom('wwa-authenticator-name', (dom) => { dom.readOnly = true }, 'class'); - wwa_dom('wwa-authenticator-type', (dom) => { dom.disabled = true }, 'class'); - wwa_dom('wwa-authenticator-usernameless', (dom) => { dom.disabled = true }, 'class'); - let request = wwa_ajax(); - request.get(wwa_php_vars.ajax_url, `?action=wwa_create&name=${encodeURIComponent(wwa_name)}&type=${encodeURIComponent(wwa_type)}&usernameless=${wwa_usernameless}`, (rawData, status) => { - if (status) { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_28; - let data = rawData; - try { - data = JSON.parse(rawData); - } catch (e) { - console.warn(rawData); - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_30; - wwa_enable_buttons(); - wwa_dom('wwa-authenticator-name', (dom) => { dom.readOnly = false }, 'class'); - wwa_dom('wwa-authenticator-type', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-authenticator-usernameless', (dom) => { dom.disabled = false }, 'class'); - updateList(); - return; - } - let challenge = new Uint8Array(32); - let user_id = new Uint8Array(32); - challenge = Uint8Array.from(window.atob(base64url2base64(data.challenge)), (c) => c.charCodeAt(0)); - user_id = Uint8Array.from(window.atob(base64url2base64(data.user.id)), (c) => c.charCodeAt(0)); - - let public_key = { - challenge: challenge, - rp: { - id: data.rp.id, - name: data.rp.name - }, - user: { - id: user_id, - name: data.user.name, - displayName: data.user.displayName - }, - pubKeyCredParams: data.pubKeyCredParams, - authenticatorSelection: data.authenticatorSelection, - timeout: data.timeout - } - - // If some authenticators are already registered, exclude - if (data.excludeCredentials) { - public_key.excludeCredentials = data.excludeCredentials.map((item) => { - item.id = Uint8Array.from(window.atob(base64url2base64(item.id)), (c) => c.charCodeAt(0)); - return item; - }) - } - - // Save client ID - const clientID = data.clientID; - delete data.clientID; - - // Create, a pop-up window should appear - navigator.credentials.create({ 'publicKey': public_key }).then((newCredentialInfo) => { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_32; - return newCredentialInfo; - }).then((data) => { - // Code Uint8Array into string for transmission - const publicKeyCredential = { - id: data.id, - type: data.type, - rawId: arrayToBase64String(new Uint8Array(data.rawId)), - response: { - clientDataJSON: arrayToBase64String(new Uint8Array(data.response.clientDataJSON)), - attestationObject: arrayToBase64String(new Uint8Array(data.response.attestationObject)) - } - }; - return publicKeyCredential; - }).then(JSON.stringify).then((AuthenticatorAttestationResponse) => { - let response = wwa_ajax(); - response.post(`${wwa_php_vars.ajax_url}?action=wwa_create_response`, `data=${encodeURIComponent(window.btoa(AuthenticatorAttestationResponse))}&name=${encodeURIComponent(wwa_name)}&type=${encodeURIComponent(wwa_type)}&usernameless=${wwa_usernameless}&clientid=${clientID}`, (rawData, status) => { - if (status) { - if (rawData === 'true') { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_29; - wwa_enable_buttons(); - wwa_dom('wwa-authenticator-name', (dom) => { dom.readOnly = false; dom.value = '' }, 'class'); - wwa_dom('wwa-authenticator-type', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-authenticator-usernameless', (dom) => { dom.disabled = false }, 'class'); - updateList(); - } else { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_30; - wwa_enable_buttons(); - wwa_dom('wwa-authenticator-name', (dom) => { dom.readOnly = false }, 'class'); - wwa_dom('wwa-authenticator-type', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-authenticator-usernameless', (dom) => { dom.disabled = false }, 'class'); - updateList(); - } - } else { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_30; - wwa_enable_buttons(); - wwa_dom('wwa-authenticator-name', (dom) => { dom.readOnly = false }, 'class'); - wwa_dom('wwa-authenticator-type', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-authenticator-usernameless', (dom) => { dom.disabled = false }, 'class'); - updateList(); - } - }) - }).catch((error) => { - console.warn(error); - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_30; - wwa_enable_buttons(); - wwa_dom('wwa-authenticator-name', (dom) => { dom.readOnly = false }, 'class'); - wwa_dom('wwa-authenticator-type', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-authenticator-usernameless', (dom) => { dom.disabled = false }, 'class'); - updateList(); - }) - } else { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_30; - wwa_enable_buttons(); - wwa_dom('wwa-authenticator-name', (dom) => { dom.readOnly = false }, 'class'); - wwa_dom('wwa-authenticator-type', (dom) => { dom.disabled = false }, 'class'); - wwa_dom('wwa-authenticator-usernameless', (dom) => { dom.disabled = false }, 'class'); - updateList(); - } - }) -} - -// Verify -function wwa_verify() { - let button_dom = this; - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_3; - let usernameless = this.className.indexOf('wwa-test-usernameless-submit') === -1 ? false : true; - wwa_disable_buttons(); - let request = wwa_ajax(); - request.get(wwa_php_vars.ajax_url, `?action=wwa_auth_start&type=test&usernameless=${usernameless ? 'true' : 'false'}`, (rawData, status) => { - if (status) { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_4; - if (rawData === 'User not inited.') { - wwa_enable_buttons(); - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_15; - return; - } - let data = rawData; - try { - data = JSON.parse(rawData); - } catch (e) { - console.warn(rawData); - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_15; - wwa_enable_buttons(); - return; - } - data.challenge = Uint8Array.from(window.atob(base64url2base64(data.challenge)), (c) => c.charCodeAt(0)); - - if (data.allowCredentials) { - data.allowCredentials = data.allowCredentials.map((item) => { - item.id = Uint8Array.from(window.atob(base64url2base64(item.id)), (c) => c.charCodeAt(0)); - return item; - }); - } - - if (data.allowCredentials && wwa_php_vars.allow_authenticator_type && wwa_php_vars.allow_authenticator_type !== 'none') { - for (let credential of data.allowCredentials) { - if (wwa_php_vars.allow_authenticator_type === 'cross-platform') { - credential.transports = ['usb', 'nfc', 'ble']; - } else if (wwa_php_vars.allow_authenticator_type === 'platform') { - credential.transports = ['internal']; - } - } - } - - // Save client ID - const clientID = data.clientID; - delete data.clientID; - - navigator.credentials.get({ 'publicKey': data }).then((credentialInfo) => { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_13; - return credentialInfo; - }).then((data) => { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_14; - const publicKeyCredential = { - id: data.id, - type: data.type, - rawId: arrayToBase64String(new Uint8Array(data.rawId)), - response: { - authenticatorData: arrayToBase64String(new Uint8Array(data.response.authenticatorData)), - clientDataJSON: arrayToBase64String(new Uint8Array(data.response.clientDataJSON)), - signature: arrayToBase64String(new Uint8Array(data.response.signature)), - userHandle: data.response.userHandle ? arrayToBase64String(new Uint8Array(data.response.userHandle)) : null - } - }; - return publicKeyCredential; - }).then(JSON.stringify).then((AuthenticatorResponse) => { - let response = wwa_ajax(); - response.post(`${wwa_php_vars.ajax_url}?action=wwa_auth`, `data=${encodeURIComponent(window.btoa(AuthenticatorResponse))}&type=test&remember=false&clientid=${clientID}`, (rawData, status) => { - if (status) { - if (rawData === 'true') { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_16; - wwa_enable_buttons(); - updateList(); - } else { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_15; - wwa_enable_buttons(); - } - } else { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_15; - wwa_enable_buttons(); - } - }) - }).catch((error) => { - console.warn(error); - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_15; - wwa_enable_buttons(); - }) - } else { - button_dom.nextElementSibling.innerHTML = wwa_php_vars.i18n_15; - wwa_enable_buttons(); - } - }) -} - -// Update authenticator list -function updateList() { - if (document.getElementsByClassName('wwa-authenticator-list').length === 0) { - return; - } - let request = wwa_ajax(); - request.get(wwa_php_vars.ajax_url, '?action=wwa_authenticator_list', (rawData, status) => { - if (status) { - let data = rawData; - try { - data = JSON.parse(rawData); - } catch (e) { - console.warn(rawData); - wwa_dom('wwa-authenticator-list', (dom) => { dom.innerHTML = `${wwa_php_vars.i18n_17}` }, 'class'); - return; - } - if (data.length === 0) { - if (wwa_php_vars.usernameless === 'true') { - wwa_dom('.wwa-usernameless-th, .wwa-usernameless-td', (dom) => { dom.style.display = 'table-cell' }); - } else { - wwa_dom('.wwa-usernameless-th, .wwa-usernameless-td', (dom) => { dom.style.display = 'none' }); - } - wwa_dom('wwa-authenticator-list', (dom) => { dom.innerHTML = `${wwa_php_vars.i18n_23}` }, 'class'); - wwa_dom('wwa-authenticator-list-usernameless-tip', (dom) => { dom.innerText = '' }, 'class'); - wwa_dom('wwa-authenticator-list-type-tip', (dom) => { dom.innerText = '' }, 'class'); - return; - } - let htmlStr = ''; - let has_usernameless = false; - let has_disabled_type = false; - for (let item of data) { - let item_type_disabled = false; - if (item.usernameless) { - has_usernameless = true; - } - if (wwa_php_vars.allow_authenticator_type !== 'none') { - if (wwa_php_vars.allow_authenticator_type !== item.type) { - has_disabled_type = true; - item_type_disabled = true; - } - } - htmlStr += `${item.name}${item.type === 'none' ? wwa_php_vars.i18n_24 : (item.type === 'platform' ? wwa_php_vars.i18n_25 : wwa_php_vars.i18n_26)}${item_type_disabled ? wwa_php_vars.i18n_35 : ''}${item.added}${item.last_used}${item.usernameless ? wwa_php_vars.i18n_1 + (wwa_php_vars.usernameless === 'true' ? '' : wwa_php_vars.i18n_9) : wwa_php_vars.i18n_8}${wwa_php_vars.i18n_20} | ${wwa_php_vars.i18n_27}`; - } - wwa_dom('wwa-authenticator-list', (dom) => { dom.innerHTML = htmlStr }, 'class'); - if (has_usernameless || wwa_php_vars.usernameless === 'true') { - wwa_dom('.wwa-usernameless-th, .wwa-usernameless-td', (dom) => { dom.style.display = 'table-cell' }); - } else { - wwa_dom('.wwa-usernameless-th, .wwa-usernameless-td', (dom) => { dom.style.display = 'none' }); - } - if (has_usernameless && wwa_php_vars.usernameless !== 'true') { - wwa_dom('wwa-authenticator-list-usernameless-tip', (dom) => { dom.innerText = wwa_php_vars.i18n_10 }, 'class'); - wwa_dom('wwa-authenticator-list-usernameless-tip', (dom) => { dom.style.display = 'block'; }, 'class'); - } else { - wwa_dom('wwa-authenticator-list-usernameless-tip', (dom) => { dom.innerText = ''; dom.style.display = 'none' }, 'class'); - } - if (has_disabled_type && wwa_php_vars.allow_authenticator_type !== 'none') { - if (wwa_php_vars.allow_authenticator_type === 'platform') { - wwa_dom('wwa-authenticator-list-type-tip', (dom) => { dom.innerText = wwa_php_vars.i18n_36 }, 'class'); - } else { - wwa_dom('wwa-authenticator-list-type-tip', (dom) => { dom.innerText = wwa_php_vars.i18n_37 }, 'class'); - } - wwa_dom('wwa-authenticator-list-type-tip', (dom) => { dom.style.display = 'block'; }, 'class'); - } else { - wwa_dom('wwa-authenticator-list-type-tip', (dom) => { dom.innerText = ''; dom.style.display = 'none' }, 'class'); - } - } else { - wwa_dom('wwa-authenticator-list', (dom) => { dom.innerHTML = `${wwa_php_vars.i18n_17}` }, 'class'); - } - }) -} - -/** Rename an authenticator - * - * @param {string} id Authenticator ID - * @param {string} name Current authenticator name - */ -function renameAuthenticator(id, name) { - let new_name = prompt(wwa_php_vars.i18n_21, name); - if (new_name === '') { - alert(wwa_php_vars.i18n_12); - } else if (new_name !== null && new_name !== name) { - let request = wwa_ajax(); - wwa_dom(`wwa-key-${id}`, (dom) => { dom.innerText = wwa_php_vars.i18n_22 }, 'class'); - request.get(wwa_php_vars.ajax_url, `?action=wwa_modify_authenticator&id=${encodeURIComponent(id)}&name=${encodeURIComponent(new_name)}&target=rename`, (data, status) => { - if (status) { - updateList(); - } else { - alert(`Error: ${data}`); - updateList(); - } - }) - } -} - -/** Remove an authenticator - * - * @param {string} id Authenticator ID - * @param {string} name Authenticator name - */ -function removeAuthenticator(id, name) { - if (confirm(wwa_php_vars.i18n_18 + name + (document.getElementsByClassName('wwa-authenticator-list')[0].children.length === 1 ? '\n' + wwa_php_vars.i18n_34 : ''))) { - wwa_dom(`wwa-key-${id}`, (dom) => { dom.innerText = wwa_php_vars.i18n_19 }, 'class'); - let request = wwa_ajax(); - request.get(wwa_php_vars.ajax_url, `?action=wwa_modify_authenticator&id=${encodeURIComponent(id)}&target=remove`, (data, status) => { - if (status) { - updateList(); - } else { - alert(`Error: ${data}`); - updateList(); - } - }) - } -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/login.js b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/login.js deleted file mode 100644 index 4a0c1284..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/login.js +++ /dev/null @@ -1,417 +0,0 @@ -'use strict'; - -// Send an AJAX request and get the response -const wwa_ajax = function () { - let xmlHttpReq = new XMLHttpRequest(); - return { - /** Send an AJAX GET request and get the response - * - * @param {string} url URL - * @param {string} data Attached data - * @param {object} callback Callback function - */ - get: (url, data = '', callback = () => { }) => { - xmlHttpReq.open('GET', url + data, true); - xmlHttpReq.send(); - xmlHttpReq.onreadystatechange = () => { - if (xmlHttpReq.readyState === 4 && xmlHttpReq.status === 200) { - callback(xmlHttpReq.responseText, true); - } else if (xmlHttpReq.readyState === 4) { - callback('Network Error.', false); - } - } - }, - /** Send an AJAX POST request and get the response - * - * @param {string} url URL - * @param {string} data Attached data - * @param {object} callback Callback function - */ - post: (url, data = '', callback = () => { }) => { - xmlHttpReq.open('POST', url, true); - xmlHttpReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); - xmlHttpReq.send(data); - xmlHttpReq.onreadystatechange = () => { - if (xmlHttpReq.readyState === 4 && xmlHttpReq.status === 200) { - callback(xmlHttpReq.responseText, true); - } else if (xmlHttpReq.readyState === 4) { - callback('Network Error.', false); - } - } - } - } -}; - -/** Operate selected DOMs - * - * @param {string} selector DOM selector - * @param {object} callback Callbck function - * @param {string} method Selecte method - */ -const wwa_dom = (selector, callback = () => { }, method = 'query') => { - let dom_list = []; - if (method === 'id') { - let dom = document.getElementById(selector); - if (dom) { - callback(dom); - } - return; - } else if (method === 'class') { - dom_list = document.getElementsByClassName(selector); - } else if (method === 'tag') { - dom_list = document.getElementsByTagName(selector); - } else { - dom_list = document.querySelectorAll(selector); - } - for (let dom of dom_list) { - callback(dom); - } - return; -} - -let wwaSupported = true; -document.addEventListener('DOMContentLoaded', () => { - if (document.querySelector('p#nav') && php_vars.password_reset !== 'false') { - const placeholder = document.getElementById('wwa-lost-password-link-placeholder'); - if (placeholder) { - const previous = placeholder.previousSibling; - const next = placeholder.nextElementSibling; - if (previous && previous.nodeType === Node.TEXT_NODE && previous.data.trim() === php_vars.separator.trim()) { - previous.remove(); - } else if (next && next.nodeType === Node.TEXT_NODE && next.data.trim() === php_vars.separator.trim()) { - next.remove(); - } - } - placeholder.remove(); - } - if (document.querySelectorAll('#lostpasswordform, #registerform, .admin-email-confirm-form, #resetpassform').length > 0) { - return; - } - if (document.getElementById('loginform') === null || document.getElementById('loginform').getAttribute('name') !== 'loginform') { - return; - } - document.addEventListener('keydown', parseKey, false); - let button_check = document.createElement('button'); - button_check.id = 'wp-webauthn-check'; - button_check.type = 'button'; - button_check.className = 'button button-large button-primary'; - button_check.innerHTML = php_vars.i18n_1; - let button_toggle = document.createElement('button'); - if (php_vars.webauthn_only !== 'true') { - button_toggle.id = 'wp-webauthn'; - button_toggle.type = 'button'; - button_toggle.className = 'button button-large'; - button_toggle.innerHTML = ''; - } - let submit = document.getElementById('wp-submit'); - if (submit) { - if (php_vars.webauthn_only !== 'true') { - submit.parentNode.insertBefore(button_toggle, submit.nextElementSibling); - } - submit.parentNode.insertBefore(button_check, submit.nextElementSibling); - } - let notice = document.createElement('div'); - notice.className = 'wp-webauthn-notice'; - notice.innerHTML = ` ${php_vars.i18n_2}`; - let forgetmenot = document.getElementsByClassName('forgetmenot'); - if (forgetmenot.length > 0) { - forgetmenot[0].parentNode.insertBefore(notice, forgetmenot[0]); - } - wwa_dom('wp-webauthn-notice', (dom) => { - const passwordInput = document.getElementsByClassName('user-pass-wrap'); - if (passwordInput.length > 0) { - dom.style.height = (passwordInput[0].offsetHeight - 10) + 'px'; - } else { - // WordPress 5.2- - const legacyPasswordInput = document.getElementById('loginform').getElementsByTagName('p')[1]; - dom.style.height = (legacyPasswordInput.offsetHeight - 10) + 'px'; - } - }, 'class'); - let btnWidth = document.getElementById('wp-submit') ? document.getElementById('wp-submit').clientWidth : 0; - if (btnWidth < 20 || btnWidth === undefined) { - wwa_dom('wp-webauthn-check', (dom) => { dom.style.width = 'auto' }, 'id'); - } else { - wwa_dom('wp-webauthn-check', (dom) => { dom.style.width = btnWidth }, 'id'); - } - if (window.PublicKeyCredential === undefined || navigator.credentials.create === undefined || typeof navigator.credentials.create !== 'function') { - wwaSupported = false; - wwa_dom('wp-webauthn', (dom) => { dom.style.display = 'none' }, 'id'); - } - wwa_dom('wp-webauthn-check', (dom) => { dom.addEventListener('click', check, false) }, 'id'); - wwa_dom('wp-webauthn', (dom) => { dom.addEventListener('click', toggle, false) }, 'id'); -}) - -window.onresize = function () { - if (document.querySelectorAll('#lostpasswordform, #registerform, .admin-email-confirm-form, #resetpassform').length > 0) { - return; - } - let btnWidth = document.getElementById('wp-submit').clientWidth; - if (btnWidth < 20 || btnWidth === undefined) { - wwa_dom('wp-webauthn-check', (dom) => { dom.style.width = 'auto' }, 'id'); - } else { - wwa_dom('wp-webauthn-check', (dom) => { dom.style.width = btnWidth }, 'id'); - } -} - -function parseKey(event) { - if (event.keyCode === 13) { - if (wwaSupported && document.getElementById('wp-webauthn-check').style.display === 'block') { - event.preventDefault(); - wwa_dom('wp-webauthn-check', (dom) => { dom.click() }, 'id'); - } - } -} - -function base64url2base64(input) { - input = input.replace(/=/g, '').replace(/-/g, '+').replace(/_/g, '/'); - const pad = input.length % 4; - if (pad) { - if (pad === 1) { - throw new Error('InvalidLengthError: Input base64url string is the wrong length to determine padding'); - } - input += new Array(5 - pad).join('='); - } - return input; -} - -function arrayToBase64String(a) { - return btoa(String.fromCharCode(...a)); -} - -function getQueryString(name) { - let reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`, 'i'); - let reg_rewrite = new RegExp(`(^|/)${name}/([^/]*)(/|$)`, 'i'); - let r = window.location.search.substr(1).match(reg); - let q = window.location.pathname.substr(1).match(reg_rewrite); - if (r != null) { - return unescape(r[2]); - } else if (q != null) { - return unescape(q[2]); - } else { - return null; - } -} - -function toggle() { - if (document.querySelectorAll('#lostpasswordform, #registerform, .admin-email-confirm-form, #resetpassform').length > 0) { - return; - } - if (document.getElementById('loginform') === null || document.getElementById('loginform').getAttribute('name') !== 'loginform') { - return; - } - if (wwaSupported) { - if (document.getElementsByClassName('wp-webauthn-notice')[0].style.display === 'flex') { - if (document.getElementsByClassName('user-pass-wrap').length > 0) { - wwa_dom('.user-pass-wrap, .forgetmenot, #wp-submit', (dom) => { dom.style.display = 'block' }); - } else { - // WordPress 5.2- - wwa_dom('.forgetmenot, #wp-submit', (dom) => { dom.style.display = 'block' }); - document.getElementById('loginform').getElementsByTagName('p')[1].style.display = 'block'; - } - wwa_dom('wp-webauthn-notice', (dom) => { dom.style.display = 'none' }, 'class'); - wwa_dom('wp-webauthn-check', (dom) => { dom.style.cssText = `${dom.style.cssText.split('display: block !important')[0]}display: none !important` }, 'id'); - wwa_dom('user_pass', (dom) => { dom.disabled = false }, 'id'); - wwa_dom('user_login', (dom) => { dom.focus() }, 'id'); - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = ` ${php_vars.i18n_2}` }, 'class'); - wwa_dom('wp-submit', (dom) => { dom.disabled = false }, 'id'); - let inputDom = document.querySelectorAll('#loginform label') - if (inputDom.length > 0) { - if (document.getElementById('wwa-username-label')) { - // WordPress 5.2- - document.getElementById('wwa-username-label').innerText = php_vars.i18n_10; - } else { - inputDom[0].innerText = php_vars.i18n_10; - } - } - } else { - if (document.getElementsByClassName('user-pass-wrap').length > 0) { - wwa_dom('.user-pass-wrap, #wp-submit', (dom) => { dom.style.display = 'none' }); - if (php_vars.remember_me === 'false' ) { - wwa_dom('.forgetmenot', (dom) => { dom.style.display = 'none' }); - } - } else { - // WordPress 5.2- - wwa_dom('#wp-submit', (dom) => { dom.style.display = 'none' }); - if (php_vars.remember_me === 'false' ) { - wwa_dom('.forgetmenot', (dom) => { dom.style.display = 'none' }); - } - document.getElementById('loginform').getElementsByTagName('p')[1].style.display = 'none'; - } - wwa_dom('wp-webauthn-notice', (dom) => { dom.style.display = 'flex' }, 'class'); - wwa_dom('wp-webauthn-check', (dom) => { dom.style.cssText = `${dom.style.cssText.split('display: none !important')[0]}display: block !important` }, 'id'); - wwa_dom('user_login', (dom) => { dom.focus() }, 'id'); - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = ` ${php_vars.i18n_2}` }, 'class'); - wwa_dom('wp-submit', (dom) => { dom.disabled = true }, 'id'); - let inputDom = document.querySelectorAll('#loginform label') - if (inputDom.length > 0) { - if (document.getElementById('wwa-username-label')) { - // WordPress 5.2- - document.getElementById('wwa-username-label').innerText = php_vars.email_login === 'true' ? php_vars.i18n_10 : php_vars.i18n_9; - } else { - inputDom[0].innerText = php_vars.email_login === 'true' ? php_vars.i18n_10 : php_vars.i18n_9; - } - } - } - } -} - -// Shake the login form, code from WordPress -function wwa_shake(id, a, d) { - const c = a.shift(); - document.getElementById(id).style.left = c + 'px'; - if (a.length > 0) { - setTimeout(() => { - wwa_shake(id, a, d); - }, d); - } else { - try { - document.getElementById(id).style.position = 'static'; - wwa_dom('user_login', (dom) => { dom.focus() }, 'id'); - } catch (e) { } - } -} - -function check() { - if (document.querySelectorAll('#lostpasswordform, #registerform, .admin-email-confirm-form, #resetpassform').length > 0) { - return; - } - if (wwaSupported) { - if (document.getElementById('user_login').value === '' && php_vars.usernameless !== 'true') { - wwa_dom('login_error', (dom) => { dom.remove() }, 'id'); - wwa_dom('p.message', (dom) => { dom.remove() }); - if (document.querySelectorAll('#login > h1').length > 0) { - let dom = document.createElement('div'); - dom.id = 'login_error'; - dom.innerHTML = php_vars.i18n_11; - document.querySelectorAll('#login > h1')[0].parentNode.insertBefore(dom, document.querySelectorAll('#login > h1')[0].nextElementSibling) - } - // Shake the login form, code from WordPress - let shake = new Array(15, 30, 15, 0, -15, -30, -15, 0); - shake = shake.concat(shake.concat(shake)); - var form = document.forms[0].id; - document.getElementById(form).style.position = 'relative'; - wwa_shake(form, shake, 20); - return; - } - wwa_dom('user_login', (dom) => { dom.readOnly = true }, 'id'); - wwa_dom('#wp-webauthn-check, #wp-webauthn', (dom) => { dom.disabled = true }); - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_3 }, 'class'); - let request = wwa_ajax(); - request.get(php_vars.ajax_url, `?action=wwa_auth_start&user=${encodeURIComponent(document.getElementById('user_login').value)}&type=auth`, (rawData, status) => { - if (status) { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_4 }, 'class'); - let data = rawData; - try { - data = JSON.parse(rawData); - } catch (e) { - console.warn(rawData); - if (php_vars.usernameless === 'true' && document.getElementById('user_login').value === '') { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 + php_vars.i18n_12 }, 'class'); - } else { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 }, 'class'); - } - wwa_dom('user_login', (dom) => { dom.readOnly = false }, 'id'); - wwa_dom('#wp-webauthn-check, #wp-webauthn', (dom) => { dom.disabled = false }); - return; - } - data.challenge = Uint8Array.from(window.atob(base64url2base64(data.challenge)), (c) => c.charCodeAt(0)); - - if (data.allowCredentials) { - data.allowCredentials = data.allowCredentials.map((item) => { - item.id = Uint8Array.from(window.atob(base64url2base64(item.id)), (c) => c.charCodeAt(0)); - return item; - }); - } - - if (data.allowCredentials && php_vars.allow_authenticator_type && php_vars.allow_authenticator_type !== 'none') { - for (let credential of data.allowCredentials) { - if (php_vars.allow_authenticator_type === 'cross-platform') { - credential.transports = ['usb', 'nfc', 'ble']; - } else if (php_vars.allow_authenticator_type === 'platform') { - credential.transports = ['internal']; - } - } - } - - // Save client ID - const clientID = data.clientID; - delete data.clientID; - - navigator.credentials.get({ 'publicKey': data }).then((credentialInfo) => { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_5 }, 'class'); - return credentialInfo; - }).then((data) => { - const publicKeyCredential = { - id: data.id, - type: data.type, - rawId: arrayToBase64String(new Uint8Array(data.rawId)), - response: { - authenticatorData: arrayToBase64String(new Uint8Array(data.response.authenticatorData)), - clientDataJSON: arrayToBase64String(new Uint8Array(data.response.clientDataJSON)), - signature: arrayToBase64String(new Uint8Array(data.response.signature)), - userHandle: data.response.userHandle ? arrayToBase64String(new Uint8Array(data.response.userHandle)) : null - } - }; - return publicKeyCredential; - }).then(JSON.stringify).then((AuthenticatorResponse) => { - let response = wwa_ajax(); - response.post(`${php_vars.ajax_url}?action=wwa_auth`, `data=${encodeURIComponent(window.btoa(AuthenticatorResponse))}&type=auth&clientid=${clientID}&user=${encodeURIComponent(document.getElementById('user_login').value)}&remember=${php_vars.remember_me === 'false' ? 'false' : (document.getElementById('rememberme') ? (document.getElementById('rememberme').checked ? 'true' : 'false') : 'false')}`, (data, status) => { - if (status) { - if (data === 'true') { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_6 }, 'class'); - if (document.querySelectorAll('p.submit input[name="redirect_to"]').length > 0) { - setTimeout(() => { - window.location.href = document.querySelectorAll('p.submit input[name="redirect_to"]')[0].value; - }, 200); - } else { - if (getQueryString('redirect_to')) { - setTimeout(() => { - window.location.href = getQueryString('redirect_to'); - }, 200); - } else { - setTimeout(() => { - window.location.href = php_vars.admin_url - }, 200); - } - } - } else { - if (php_vars.usernameless === 'true' && document.getElementById('user_login').value === '') { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 + php_vars.i18n_12 }, 'class'); - } else { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 }, 'class'); - } - wwa_dom('user_login', (dom) => { dom.readOnly = false }, 'id'); - wwa_dom('#wp-webauthn-check, #wp-webauthn', (dom) => { dom.disabled = false }); - } - } else { - if (php_vars.usernameless === 'true' && document.getElementById('user_login').value === '') { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 + php_vars.i18n_12 }, 'class'); - } else { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 }, 'class'); - } - wwa_dom('user_login', (dom) => { dom.readOnly = false }, 'id'); - wwa_dom('#wp-webauthn-check, #wp-webauthn', (dom) => { dom.disabled = false }); - } - }) - }).catch((error) => { - console.warn(error); - if (php_vars.usernameless === 'true' && document.getElementById('user_login').value === '') { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 + php_vars.i18n_12 }, 'class'); - } else { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 }, 'class'); - } - wwa_dom('user_login', (dom) => { dom.readOnly = false }, 'id'); - wwa_dom('#wp-webauthn-check, #wp-webauthn', (dom) => { dom.disabled = false }); - }) - } else { - if (php_vars.usernameless === 'true' && document.getElementById('user_login').value === '') { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 + php_vars.i18n_12 }, 'class'); - } else { - wwa_dom('wp-webauthn-notice', (dom) => { dom.innerHTML = php_vars.i18n_7 }, 'class'); - } - wwa_dom('user_login', (dom) => { dom.readOnly = false }, 'id'); - wwa_dom('#wp-webauthn-check, #wp-webauthn', (dom) => { dom.disabled = false }); - } - }) - } -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/profile.js b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/profile.js deleted file mode 100644 index 2673d0e0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/js/profile.js +++ /dev/null @@ -1,470 +0,0 @@ -// Whether the broswer supports WebAuthn -if (window.PublicKeyCredential === undefined || navigator.credentials.create === undefined || typeof navigator.credentials.create !== 'function') { - jQuery('#wwa-bind, #wwa-test').attr('disabled', 'disabled'); - jQuery('#wwa-show-progress').html(php_vars.i18n_5); -} - -jQuery(() => { - updateList(); -}) - -window.addEventListener('load', () => { - if (document.getElementById('wp-webauthn-error-container')) { - document.getElementById('wp-webauthn-error-container').insertBefore(document.getElementById('wp-webauthn-error'), null); - } - if (document.getElementById('wp-webauthn-message-container')) { - document.getElementById('wp-webauthn-message-container').insertBefore(document.getElementById('wp-webauthn-message'), null); - } -}) - -// Update authenticator list -function updateList() { - jQuery.ajax({ - url: php_vars.ajax_url, - type: 'GET', - data: { - action: 'wwa_authenticator_list', - user_id: php_vars.user_id - }, - success: function (data) { - if (typeof data === 'string') { - console.warn(data); - jQuery('#wwa-authenticator-list').html(`${php_vars.i18n_8}`); - return; - } - if (data.length === 0) { - if (configs.usernameless === 'true') { - jQuery('.wwa-usernameless-th, .wwa-usernameless-td').show(); - } else { - jQuery('.wwa-usernameless-th, .wwa-usernameless-td').hide(); - } - jQuery('#wwa-authenticator-list').html(`${php_vars.i18n_17}`); - jQuery('#wwa_usernameless_tip').text(''); - jQuery('#wwa_usernameless_tip').hide(); - jQuery('#wwa_type_tip').text(''); - jQuery('#wwa_type_tip').hide(); - return; - } - let htmlStr = ''; - let has_usernameless = false; - let has_disabled_type = false; - for (item of data) { - let item_type_disabled = false; - if (item.usernameless) { - has_usernameless = true; - } - if (configs.allow_authenticator_type !== 'none') { - if (configs.allow_authenticator_type !== item.type) { - has_disabled_type = true; - item_type_disabled = true; - } - } - htmlStr += `${item.name}${item.type === 'none' ? php_vars.i18n_9 : (item.type === 'platform' ? php_vars.i18n_10 : php_vars.i18n_11)}${item_type_disabled ? php_vars.i18n_29 : ''}${item.added}${item.last_used}${item.usernameless ? php_vars.i18n_24 + (configs.usernameless === 'true' ? '' : php_vars.i18n_26) : php_vars.i18n_25}${php_vars.i18n_20} | ${php_vars.i18n_12}`; - } - jQuery('#wwa-authenticator-list').html(htmlStr); - if (has_usernameless || configs.usernameless === 'true') { - jQuery('.wwa-usernameless-th, .wwa-usernameless-td').show(); - } else { - jQuery('.wwa-usernameless-th, .wwa-usernameless-td').hide(); - } - if (has_usernameless && configs.usernameless !== 'true') { - jQuery('#wwa_usernameless_tip').text(php_vars.i18n_27); - jQuery('#wwa_usernameless_tip').show(); - } else { - jQuery('#wwa_usernameless_tip').text(''); - jQuery('#wwa_usernameless_tip').hide(); - } - if (has_disabled_type && configs.allow_authenticator_type !== 'none') { - if (configs.allow_authenticator_type === 'platform') { - jQuery('#wwa_type_tip').text(php_vars.i18n_30); - } else { - jQuery('#wwa_type_tip').text(php_vars.i18n_31); - } - jQuery('#wwa_type_tip').show(); - } else { - jQuery('#wwa_type_tip').text(''); - jQuery('#wwa_type_tip').hide(); - } - }, - error: function () { - jQuery('#wwa-authenticator-list').html(`${php_vars.i18n_8}`); - } - }) -} - -/** Code Base64URL into Base64 - * - * @param {string} input Base64URL coded string - */ -function base64url2base64(input) { - input = input.replace(/=/g, '').replace(/-/g, '+').replace(/_/g, '/'); - const pad = input.length % 4; - if (pad) { - if (pad === 1) { - throw new Error('InvalidLengthError: Input base64url string is the wrong length to determine padding'); - } - input += new Array(5 - pad).join('='); - } - return input; -} - -/** Code Uint8Array into Base64 string - * - * @param {Uint8Array} a The Uint8Array needed to be coded into Base64 string - */ -function arrayToBase64String(a) { - return btoa(String.fromCharCode(...a)); -} - -jQuery('#wwa-add-new-btn').click((e) => { - e.preventDefault(); - jQuery('#wwa-new-block').show(); - jQuery('#wwa-verify-block').hide(); - setTimeout(() => { - jQuery('#wwa-new-block').focus(); - }, 0); -}) - -jQuery('#wwa-verify-btn').click((e) => { - e.preventDefault(); - jQuery('#wwa-new-block').hide(); - jQuery('#wwa-verify-block').show(); - setTimeout(() => { - jQuery('#wwa-verify-block').focus(); - }, 0); -}) - -jQuery('.wwa-cancel').click((e) => { - e.preventDefault(); - jQuery('#wwa-new-block').hide(); - jQuery('#wwa-verify-block').hide(); -}) - -jQuery('#wwa_authenticator_name').keydown((e) => { - if (e.keyCode === 13) { - jQuery('#wwa-bind').trigger('click'); - e.preventDefault(); - } - }); - -// Bind an authenticator -jQuery('#wwa-bind').click((e) => { - e.preventDefault(); - if (jQuery('#wwa_authenticator_name').val() === '') { - alert(php_vars.i18n_7); - return; - } - - // Disable inputs to avoid changing in process - jQuery('#wwa-show-progress').html(php_vars.i18n_1); - jQuery('#wwa-bind').attr('disabled', 'disabled'); - jQuery('#wwa_authenticator_name').attr('disabled', 'disabled'); - jQuery('.wwa_authenticator_usernameless').attr('disabled', 'disabled'); - jQuery('#wwa_authenticator_type').attr('disabled', 'disabled'); - jQuery.ajax({ - url: php_vars.ajax_url, - type: 'GET', - data: { - action: 'wwa_create', - name: jQuery('#wwa_authenticator_name').val(), - type: jQuery('#wwa_authenticator_type').val(), - usernameless: jQuery('.wwa_authenticator_usernameless:checked').val() ? jQuery('.wwa_authenticator_usernameless:checked').val() : 'false', - user_id: php_vars.user_id - }, - success: function (data) { - if (typeof data === 'string') { - console.warn(data); - jQuery('#wwa-show-progress').html(`${php_vars.i18n_4}: ${data}`); - jQuery('#wwa-bind').removeAttr('disabled'); - jQuery('#wwa_authenticator_name').removeAttr('disabled'); - jQuery('.wwa_authenticator_usernameless').removeAttr('disabled'); - jQuery('#wwa_authenticator_type').removeAttr('disabled'); - updateList(); - return; - } - // Get the args, code string into Uint8Array - jQuery('#wwa-show-progress').text(php_vars.i18n_2); - let challenge = new Uint8Array(32); - let user_id = new Uint8Array(32); - challenge = Uint8Array.from(window.atob(base64url2base64(data.challenge)), (c) => c.charCodeAt(0)); - user_id = Uint8Array.from(window.atob(base64url2base64(data.user.id)), (c) => c.charCodeAt(0)); - - let public_key = { - challenge: challenge, - rp: { - id: data.rp.id, - name: data.rp.name - }, - user: { - id: user_id, - name: data.user.name, - displayName: data.user.displayName - }, - pubKeyCredParams: data.pubKeyCredParams, - authenticatorSelection: data.authenticatorSelection, - timeout: data.timeout - } - - // If some authenticators are already registered, exclude - if (data.excludeCredentials) { - public_key.excludeCredentials = data.excludeCredentials.map((item) => { - item.id = Uint8Array.from(window.atob(base64url2base64(item.id)), (c) => c.charCodeAt(0)); - return item; - }) - } - - // Save client ID - const clientID = data.clientID; - delete data.clientID; - - // Create, a pop-up window should appear - navigator.credentials.create({ 'publicKey': public_key }).then((newCredentialInfo) => { - jQuery('#wwa-show-progress').html(php_vars.i18n_6); - return newCredentialInfo; - }).then((data) => { - // Code Uint8Array into string for transmission - const publicKeyCredential = { - id: data.id, - type: data.type, - rawId: arrayToBase64String(new Uint8Array(data.rawId)), - response: { - clientDataJSON: arrayToBase64String(new Uint8Array(data.response.clientDataJSON)), - attestationObject: arrayToBase64String(new Uint8Array(data.response.attestationObject)) - } - }; - return publicKeyCredential; - }).then(JSON.stringify).then((AuthenticatorAttestationResponse) => { - // Send attestation back to RP - jQuery.ajax({ - url: `${php_vars.ajax_url}?action=wwa_create_response`, - type: 'POST', - data: { - data: window.btoa(AuthenticatorAttestationResponse), - name: jQuery('#wwa_authenticator_name').val(), - type: jQuery('#wwa_authenticator_type').val(), - usernameless: jQuery('.wwa_authenticator_usernameless:checked').val() ? jQuery('.wwa_authenticator_usernameless:checked').val() : 'false', - clientid: clientID, - user_id: php_vars.user_id - }, - success: function (data) { - if (data === 'true') { - // Registered - jQuery('#wwa-show-progress').html(php_vars.i18n_3); - jQuery('#wwa-bind').removeAttr('disabled'); - jQuery('#wwa_authenticator_name').removeAttr('disabled'); - jQuery('#wwa_authenticator_name').val(''); - jQuery('.wwa_authenticator_usernameless').removeAttr('disabled'); - jQuery('#wwa_authenticator_type').removeAttr('disabled'); - updateList(); - } else { - // Register failed - jQuery('#wwa-show-progress').html(php_vars.i18n_4); - jQuery('#wwa-bind').removeAttr('disabled'); - jQuery('#wwa_authenticator_name').removeAttr('disabled'); - jQuery('.wwa_authenticator_usernameless').removeAttr('disabled'); - jQuery('#wwa_authenticator_type').removeAttr('disabled'); - updateList(); - } - }, - error: function () { - jQuery('#wwa-show-progress').html(php_vars.i18n_4); - jQuery('#wwa-bind').removeAttr('disabled'); - jQuery('#wwa_authenticator_name').removeAttr('disabled'); - jQuery('.wwa_authenticator_usernameless').removeAttr('disabled'); - jQuery('#wwa_authenticator_type').removeAttr('disabled'); - updateList(); - } - }) - }).catch((error) => { - // Creation abort - console.warn(error); - jQuery('#wwa-show-progress').html(`${php_vars.i18n_4}: ${error}`); - jQuery('#wwa-bind').removeAttr('disabled'); - jQuery('#wwa_authenticator_name').removeAttr('disabled'); - jQuery('.wwa_authenticator_usernameless').removeAttr('disabled'); - jQuery('#wwa_authenticator_type').removeAttr('disabled'); - updateList(); - }) - }, - error: function () { - jQuery('#wwa-show-progress').html(php_vars.i18n_4); - jQuery('#wwa-bind').removeAttr('disabled'); - jQuery('#wwa_authenticator_name').removeAttr('disabled'); - jQuery('.wwa_authenticator_usernameless').removeAttr('disabled'); - jQuery('#wwa_authenticator_type').removeAttr('disabled'); - updateList(); - } - }) -}); - -// Test WebAuthn -jQuery('#wwa-test, #wwa-test_usernameless').click((e) => { - e.preventDefault(); - jQuery('#wwa-test, #wwa-test_usernameless').attr('disabled', 'disabled'); - let button_id = e.target.id; - let usernameless = 'false'; - let tip_id = '#wwa-show-test'; - if (button_id === 'wwa-test_usernameless') { - usernameless = 'true'; - tip_id = '#wwa-show-test-usernameless'; - } - jQuery(tip_id).text(php_vars.i18n_1); - jQuery.ajax({ - url: php_vars.ajax_url, - type: 'GET', - data: { - action: 'wwa_auth_start', - type: 'test', - usernameless: usernameless, - user_id: php_vars.user_id - }, - success: function (data) { - if (typeof data === 'string') { - console.warn(data); - jQuery(tip_id).html(`${php_vars.i18n_15}: ${data}`); - jQuery('#wwa-test, #wwa-test_usernameless').removeAttr('disabled'); - return; - } - if (data === 'User not inited.') { - jQuery(tip_id).html(`${php_vars.i18n_15}: ${php_vars.i18n_17}`); - jQuery('#wwa-test, #wwa-test_usernameless').removeAttr('disabled'); - return; - } - jQuery(tip_id).text(php_vars.i18n_13); - data.challenge = Uint8Array.from(window.atob(base64url2base64(data.challenge)), (c) => c.charCodeAt(0)); - - if (data.allowCredentials) { - data.allowCredentials = data.allowCredentials.map((item) => { - item.id = Uint8Array.from(window.atob(base64url2base64(item.id)), (c) => c.charCodeAt(0)); - return item; - }); - } - - if (data.allowCredentials && configs.allow_authenticator_type && configs.allow_authenticator_type !== 'none') { - for (let credential of data.allowCredentials) { - if (configs.allow_authenticator_type === 'cross-platform') { - credential.transports = ['usb', 'nfc', 'ble']; - } else if (configs.allow_authenticator_type === 'platform') { - credential.transports = ['internal']; - } - } - } - - // Save client ID - const clientID = data.clientID; - delete data.clientID; - - navigator.credentials.get({ 'publicKey': data }).then((credentialInfo) => { - jQuery(tip_id).html(php_vars.i18n_14); - return credentialInfo; - }).then((data) => { - const publicKeyCredential = { - id: data.id, - type: data.type, - rawId: arrayToBase64String(new Uint8Array(data.rawId)), - response: { - authenticatorData: arrayToBase64String(new Uint8Array(data.response.authenticatorData)), - clientDataJSON: arrayToBase64String(new Uint8Array(data.response.clientDataJSON)), - signature: arrayToBase64String(new Uint8Array(data.response.signature)), - userHandle: data.response.userHandle ? arrayToBase64String(new Uint8Array(data.response.userHandle)) : null - } - }; - return publicKeyCredential; - }).then(JSON.stringify).then((AuthenticatorResponse) => { - jQuery.ajax({ - url: `${php_vars.ajax_url}?action=wwa_auth`, - type: 'POST', - data: { - data: window.btoa(AuthenticatorResponse), - type: 'test', - remember: 'false', - clientid: clientID, - user_id: php_vars.user_id - }, - success: function (data) { - if (data === 'true') { - jQuery(tip_id).html(php_vars.i18n_16); - jQuery('#wwa-test, #wwa-test_usernameless').removeAttr('disabled'); - updateList(); - } else { - jQuery(tip_id).html(php_vars.i18n_15); - jQuery('#wwa-test, #wwa-test_usernameless').removeAttr('disabled'); - } - }, - error: function () { - jQuery(tip_id).html(php_vars.i18n_15); - jQuery('#wwa-test, #wwa-test_usernameless').removeAttr('disabled'); - } - }) - }).catch((error) => { - console.warn(error); - jQuery(tip_id).html(`${php_vars.i18n_15}: ${error}`); - jQuery('#wwa-test, #wwa-test_usernameless').removeAttr('disabled'); - }) - }, - error: function () { - jQuery(tip_id).html(php_vars.i18n_15); - jQuery('#wwa-test, #wwa-test_usernameless').removeAttr('disabled'); - } - }) -}); - -/** - * Rename an authenticator - * @param {string} id Authenticator ID - * @param {string} name Current authenticator name - */ -function renameAuthenticator(id, name) { - let new_name = prompt(php_vars.i18n_21, name); - if (new_name === '') { - alert(php_vars.i18n_7); - } else if (new_name !== null && new_name !== name) { - jQuery(`#${id}`).text(php_vars.i18n_22) - jQuery.ajax({ - url: php_vars.ajax_url, - type: 'GET', - data: { - action: 'wwa_modify_authenticator', - id: id, - name: new_name, - target: 'rename', - user_id: php_vars.user_id - }, - success: function () { - updateList(); - }, - error: function (data) { - alert(`Error: ${data}`); - updateList(); - } - }) - } -} - -/** - * Remove an authenticator - * @param {string} id Authenticator ID - * @param {string} name Authenticator name - */ -function removeAuthenticator(id, name) { - if (confirm(php_vars.i18n_18 + name + (jQuery('#wwa-authenticator-list > tr').length === 1 ? '\n' + php_vars.i18n_28 : ''))) { - jQuery(`#${id}`).text(php_vars.i18n_19) - jQuery.ajax({ - url: php_vars.ajax_url, - type: 'GET', - data: { - action: 'wwa_modify_authenticator', - id: id, - target: 'remove', - user_id: php_vars.user_id - }, - success: function () { - updateList(); - }, - error: function (data) { - alert(`Error: ${data}`); - updateList(); - } - }) - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/template.pot b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/template.pot deleted file mode 100644 index fa35e789..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/template.pot +++ /dev/null @@ -1,646 +0,0 @@ -# Copyright (C) 2023 Axton -# This file is distributed under the same license as the WP-WebAuthn plugin. -msgid "" -msgstr "" -"Project-Id-Version: WP-WebAuthn 1.3.1\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-webauthn\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" -"X-Poedit-SourceCharset: UTF-8\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Domain: wp-webauthn\n" - -#. Plugin Name of the plugin -msgid "WP-WebAuthn" -msgstr "" - -#. Plugin URI of the plugin -msgid "https://flyhigher.top" -msgstr "" - -#. Description of the plugin -msgid "WP-WebAuthn allows you to safely login to your WordPress site without password." -msgstr "" - -#. Author of the plugin -msgid "Axton" -msgstr "" - -#. Author URI of the plugin -msgid "https://axton.cc" -msgstr "" - -#: wwa-admin-content.php:6 -msgid "User verification is disabled by default because some mobile devices do not support it (especially on Android devices). But we recommend you to enable it if possible to further secure your login." -msgstr "" - -#: wwa-admin-content.php:7 -#: wwa-admin-content.php:303 -msgid "Log count: " -msgstr "" - -#: wwa-admin-content.php:8 -#: wwa-profile-content.php:14 -#: wwa-shortcodes.php:26 -msgid "Loading failed, maybe try refreshing?" -msgstr "" - -#: wwa-admin-content.php:16 -msgid "PHP extension gmp doesn't seem to exist, rendering WP-WebAuthn unable to function." -msgstr "" - -#: wwa-admin-content.php:20 -msgid "PHP extension mbstring doesn't seem to exist, rendering WP-WebAuthn unable to function." -msgstr "" - -#: wwa-admin-content.php:24 -msgid "PHP extension sodium doesn't seem to exist, rendering WP-WebAuthn unable to function." -msgstr "" - -#: wwa-admin-content.php:28 -msgid "WebAuthn features are restricted to websites in secure contexts. Please make sure your website is served over HTTPS or locally with localhost." -msgstr "" - -#: wwa-admin-content.php:127 -msgid "Settings saved." -msgstr "" - -#: wwa-admin-content.php:129 -msgid "Settings NOT saved." -msgstr "" - -#: wwa-admin-content.php:144 -msgid "Preferred login method" -msgstr "" - -#: wwa-admin-content.php:148 -msgid "Prefer WebAuthn" -msgstr "" - -#: wwa-admin-content.php:149 -msgid "Prefer password" -msgstr "" - -#: wwa-admin-content.php:150 -#: wwa-profile-content.php:81 -msgid "WebAuthn Only" -msgstr "" - -#: wwa-admin-content.php:152 -msgid "When using \"WebAuthn Only\", password login will be completely disabled. Please make sure your browser supports WebAuthn, otherwise you may unable to login.
          User that doesn't have any registered authenticator (e.g. new user) will unable to login when using \"WebAuthn Only\".
          When the browser does not support WebAuthn, the login method will default to password if password login is not disabled." -msgstr "" - -#: wwa-admin-content.php:156 -msgid "Website identifier" -msgstr "" - -#: wwa-admin-content.php:159 -msgid "This identifier is for identification purpose only and DOES NOT affect the authentication process in anyway." -msgstr "" - -#: wwa-admin-content.php:163 -msgid "Website domain" -msgstr "" - -#: wwa-admin-content.php:166 -msgid "This field MUST be exactly the same with the current domain or parent domain." -msgstr "" - -#: wwa-admin-content.php:173 -msgid "Allow to remember login" -msgstr "" - -#: wwa-admin-content.php:182 -#: wwa-admin-content.php:198 -#: wwa-admin-content.php:209 -#: wwa-admin-content.php:225 -#: wwa-admin-content.php:300 -#: wwa-profile-content.php:155 -#: wwa-shortcodes.php:118 -msgid "Enable" -msgstr "" - -#: wwa-admin-content.php:183 -#: wwa-admin-content.php:199 -#: wwa-admin-content.php:210 -#: wwa-admin-content.php:226 -#: wwa-admin-content.php:301 -#: wwa-profile-content.php:156 -#: wwa-shortcodes.php:118 -msgid "Disable" -msgstr "" - -#: wwa-admin-content.php:184 -msgid "Show the 'Remember Me' checkbox beside the login form when using WebAuthn." -msgstr "" - -#: wwa-admin-content.php:189 -msgid "Allow to login with email addresses" -msgstr "" - -#: wwa-admin-content.php:200 -msgid "Allow to find users via email addresses when logging in.
          Note that if enabled attackers may be able to brute force the correspondences between email addresses and users." -msgstr "" - -#: wwa-admin-content.php:205 -msgid "Require user verification" -msgstr "" - -#: wwa-admin-content.php:211 -msgid "User verification can improve security, but is not fully supported by mobile devices.
          If you cannot register or verify your authenticators, please consider disabling user verification." -msgstr "" - -#: wwa-admin-content.php:216 -msgid "Allow to login without username" -msgstr "" - -#: wwa-admin-content.php:227 -msgid "Allow users to register authenticator with usernameless authentication feature and login without username.
          User verification will be enabled automatically when authenticating with usernameless authentication feature.
          Some authenticators and some browsers DO NOT support this feature." -msgstr "" - -#: wwa-admin-content.php:232 -msgid "Allow a specific type of authenticator" -msgstr "" - -#: wwa-admin-content.php:241 -#: wwa-profile-content.php:15 -#: wwa-profile-content.php:136 -#: wwa-shortcodes.php:33 -#: wwa-shortcodes.php:118 -msgid "Any" -msgstr "" - -#: wwa-admin-content.php:242 -msgid "Platform (e.g. Passkey or built-in sensors)" -msgstr "" - -#: wwa-admin-content.php:243 -#: wwa-profile-content.php:138 -#: wwa-shortcodes.php:118 -msgid "Roaming (e.g. USB security keys)" -msgstr "" - -#: wwa-admin-content.php:245 -msgid "If a type is selected, the browser will only prompt for authenticators of selected type when authenticating and user can only register authenticators of selected type." -msgstr "" - -#: wwa-admin-content.php:252 -msgid "Disable password reset for" -msgstr "" - -#: wwa-admin-content.php:261 -msgid "Off" -msgstr "" - -#: wwa-admin-content.php:262 -msgid "Everyone except administrators" -msgstr "" - -#: wwa-admin-content.php:263 -msgid "Everyone" -msgstr "" - -#: wwa-admin-content.php:265 -msgid "Disable the \"Set new password\" and \"Forgot password\" features, and remove the \"Forgot password\" link on the login page. This may be useful when enabling \"WebAuthn Only\".
          If \"Everyone except administrators\" is selected, only administrators with the \"Edit user\" permission will be able to update passwords (for all users)." -msgstr "" - -#: wwa-admin-content.php:272 -msgid "After User Registration" -msgstr "" - -#: wwa-admin-content.php:281 -msgid "No action" -msgstr "" - -#: wwa-admin-content.php:282 -msgid "Log user in and redirect to user's profile" -msgstr "" - -#: wwa-admin-content.php:284 -msgid "What to do when a new user registered.
          By default, new users have to login manually after registration. If \"WebAuthn Only\" is enabled, they will not be able to login.
          When using \"Log user in\", new users will be logged in automatically and redirected to their profile settings so that they can set up WebAuthn authenticators." -msgstr "" - -#: wwa-admin-content.php:291 -msgid "Logging" -msgstr "" - -#: wwa-admin-content.php:303 -msgid "Clear log" -msgstr "" - -#: wwa-admin-content.php:305 -msgid "For debugging only. Enable only when needed.
          Note: Logs may contain sensitive information." -msgstr "" - -#: wwa-admin-content.php:314 -msgid "Log" -msgstr "" - -#: wwa-admin-content.php:316 -msgid "Automatic update every 5 seconds." -msgstr "" - -#: wwa-admin-content.php:320 -msgid "To register a new authenticator or edit your authenticators, please go to your profile." -msgstr "" - -#: wwa-functions.php:159 -#: wwa-shortcodes.php:88 -msgid "Auth" -msgstr "" - -#: wwa-functions.php:160 -#: wwa-shortcodes.php:11 -#: wwa-shortcodes.php:85 -#: wwa-shortcodes.php:88 -msgid "Authenticate with WebAuthn" -msgstr "" - -#: wwa-functions.php:161 -#: wwa-shortcodes.php:12 -msgid "Hold on..." -msgstr "" - -#: wwa-functions.php:162 -#: wwa-shortcodes.php:13 -msgid "Please proceed..." -msgstr "" - -#: wwa-functions.php:163 -#: wwa-shortcodes.php:14 -msgid "Authenticating..." -msgstr "" - -#: wwa-functions.php:164 -#: wwa-shortcodes.php:15 -msgid "Authenticated" -msgstr "" - -#: wwa-functions.php:165 -#: wwa-shortcodes.php:16 -msgid "Auth failed" -msgstr "" - -#: wwa-functions.php:166 -msgid "It looks like your browser doesn't support WebAuthn, which means you may unable to login." -msgstr "" - -#: wwa-functions.php:167 -#: wwa-shortcodes.php:88 -msgid "Username" -msgstr "" - -#: wwa-functions.php:169 -msgid "Error: The username field is empty." -msgstr "" - -#: wwa-functions.php:170 -#: wwa-shortcodes.php:42 -msgid "Try to enter the username" -msgstr "" - -#: wwa-functions.php:185 -msgid "Logging in with password has been disabled by the site manager." -msgstr "" - -#: wwa-functions.php:191 -msgid "Logging in with password has been disabled for this account." -msgstr "" - -#: wwa-functions.php:275 -msgid "Logging in with password has been disabled for %s but you haven't register any WebAuthn authenticator yet. You may unable to login again once you log out. Register" -msgstr "" - -#: wwa-functions.php:275 -#: wwa-functions.php:320 -msgid "the site" -msgstr "" - -#: wwa-functions.php:275 -msgid "your account" -msgstr "" - -#: wwa-functions.php:320 -msgid "Logging in with password has been disabled for %s but this account haven't register any WebAuthn authenticator yet. This user may unable to login." -msgstr "" - -#: wwa-functions.php:320 -msgid "this account" -msgstr "" - -#: wwa-functions.php:348 -msgid "Settings" -msgstr "" - -#: wwa-functions.php:356 -msgid "GitHub" -msgstr "" - -#: wwa-functions.php:357 -msgid "Documentation" -msgstr "" - -#: wwa-profile-content.php:7 -msgid "Initializing..." -msgstr "" - -#: wwa-profile-content.php:8 -#: wwa-shortcodes.php:37 -msgid "Please follow instructions to finish registration..." -msgstr "" - -#: wwa-profile-content.php:9 -#: wwa-shortcodes.php:38 -msgctxt "action" -msgid "Registered" -msgstr "" - -#: wwa-profile-content.php:10 -#: wwa-shortcodes.php:39 -msgid "Registration failed" -msgstr "" - -#: wwa-profile-content.php:11 -#: wwa-shortcodes.php:40 -msgid "Your browser does not support WebAuthn" -msgstr "" - -#: wwa-profile-content.php:12 -#: wwa-shortcodes.php:41 -msgid "Registrating..." -msgstr "" - -#: wwa-profile-content.php:13 -#: wwa-shortcodes.php:21 -msgid "Please enter the authenticator identifier" -msgstr "" - -#: wwa-profile-content.php:16 -#: wwa-shortcodes.php:34 -msgid "Platform authenticator" -msgstr "" - -#: wwa-profile-content.php:17 -#: wwa-shortcodes.php:35 -msgid "Roaming authenticator" -msgstr "" - -#: wwa-profile-content.php:18 -#: wwa-shortcodes.php:36 -msgid "Remove" -msgstr "" - -#: wwa-profile-content.php:19 -#: wwa-shortcodes.php:22 -msgid "Please follow instructions to finish verification..." -msgstr "" - -#: wwa-profile-content.php:20 -#: wwa-shortcodes.php:23 -msgid "Verifying..." -msgstr "" - -#: wwa-profile-content.php:21 -#: wwa-shortcodes.php:24 -msgid "Verification failed" -msgstr "" - -#: wwa-profile-content.php:22 -#: wwa-shortcodes.php:25 -msgid "Verification passed! You can now log in through WebAuthn" -msgstr "" - -#: wwa-profile-content.php:23 -#: wwa-shortcodes.php:32 -msgid "No registered authenticators" -msgstr "" - -#: wwa-profile-content.php:24 -#: wwa-shortcodes.php:27 -msgid "Confirm removal of authenticator: " -msgstr "" - -#: wwa-profile-content.php:25 -#: wwa-shortcodes.php:28 -msgid "Removing..." -msgstr "" - -#: wwa-profile-content.php:26 -#: wwa-shortcodes.php:29 -msgid "Rename" -msgstr "" - -#: wwa-profile-content.php:27 -#: wwa-shortcodes.php:30 -msgid "Rename the authenticator" -msgstr "" - -#: wwa-profile-content.php:28 -#: wwa-shortcodes.php:31 -msgid "Renaming..." -msgstr "" - -#: wwa-profile-content.php:29 -#: wwa-shortcodes.php:10 -msgid "Ready" -msgstr "" - -#: wwa-profile-content.php:30 -#: wwa-shortcodes.php:17 -msgid "No" -msgstr "" - -#: wwa-profile-content.php:31 -#: wwa-shortcodes.php:18 -msgid " (Unavailable)" -msgstr "" - -#: wwa-profile-content.php:32 -#: wwa-shortcodes.php:19 -msgid "The site administrator has disabled usernameless login feature." -msgstr "" - -#: wwa-profile-content.php:33 -#: wwa-shortcodes.php:43 -msgid "After removing this authenticator, you will not be able to login with WebAuthn" -msgstr "" - -#: wwa-profile-content.php:34 -#: wwa-shortcodes.php:44 -msgid " (Disabled)" -msgstr "" - -#: wwa-profile-content.php:35 -#: wwa-shortcodes.php:45 -msgid "The site administrator only allow platform authenticators currently." -msgstr "" - -#: wwa-profile-content.php:36 -#: wwa-shortcodes.php:46 -msgid "The site administrator only allow roaming authenticators currently." -msgstr "" - -#: wwa-profile-content.php:63 -msgid "You've successfully registered! Now you can register your authenticators below." -msgstr "" - -#: wwa-profile-content.php:75 -msgid "This site is not correctly configured to use WebAuthn. Please contact the site administrator." -msgstr "" - -#: wwa-profile-content.php:85 -msgid "Disable password login for this account" -msgstr "" - -#: wwa-profile-content.php:87 -msgid "When checked, password login will be completely disabled. Please make sure your browser supports WebAuthn and you have a registered authenticator, otherwise you may unable to login." -msgstr "" - -#: wwa-profile-content.php:87 -msgid "The site administrator has disabled password login for the whole site." -msgstr "" - -#: wwa-profile-content.php:91 -msgid "Registered WebAuthn Authenticators" -msgstr "" - -#: wwa-profile-content.php:96 -#: wwa-profile-content.php:111 -#: wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Identifier" -msgstr "" - -#: wwa-profile-content.php:97 -#: wwa-profile-content.php:112 -#: wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Type" -msgstr "" - -#: wwa-profile-content.php:98 -#: wwa-profile-content.php:113 -#: wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgctxt "time" -msgid "Registered" -msgstr "" - -#: wwa-profile-content.php:99 -#: wwa-profile-content.php:114 -msgid "Last used" -msgstr "" - -#: wwa-profile-content.php:100 -#: wwa-profile-content.php:115 -#: wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Usernameless" -msgstr "" - -#: wwa-profile-content.php:101 -#: wwa-profile-content.php:116 -#: wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Action" -msgstr "" - -#: wwa-profile-content.php:106 -#: wwa-shortcodes.php:157 -msgid "Loading..." -msgstr "" - -#: wwa-profile-content.php:123 -#: wwa-profile-content.php:126 -msgid "Register New Authenticator" -msgstr "" - -#: wwa-profile-content.php:123 -#: wwa-profile-content.php:167 -msgid "Verify Authenticator" -msgstr "" - -#: wwa-profile-content.php:127 -msgid "You are about to associate an authenticator with the current account %s.
          You can register multiple authenticators for an account." -msgstr "" - -#: wwa-profile-content.php:130 -#: wwa-shortcodes.php:118 -msgid "Type of authenticator" -msgstr "" - -#: wwa-profile-content.php:137 -#: wwa-shortcodes.php:118 -msgid "Platform (e.g. built-in fingerprint sensors)" -msgstr "" - -#: wwa-profile-content.php:140 -#: wwa-shortcodes.php:118 -msgid "If a type is selected, the browser will only prompt for authenticators of selected type.
          Regardless of the type, you can only log in with the very same authenticators you've registered." -msgstr "" - -#: wwa-profile-content.php:144 -msgid "Authenticator Identifier" -msgstr "" - -#: wwa-profile-content.php:147 -#: wwa-shortcodes.php:118 -msgid "An easily identifiable name for the authenticator. DOES NOT affect the authentication process in anyway." -msgstr "" - -#: wwa-profile-content.php:152 -#: wwa-shortcodes.php:118 -msgid "Login without username" -msgstr "" - -#: wwa-profile-content.php:157 -#: wwa-shortcodes.php:118 -msgid "If registered authenticator with this feature, you can login without enter your username.
          Some authenticators like U2F-only authenticators and some browsers DO NOT support this feature.
          A record will be stored in the authenticator permanently untill you reset it." -msgstr "" - -#: wwa-profile-content.php:163 -msgid "Start Registration" -msgstr "" - -#: wwa-profile-content.php:168 -msgid "Click Test Login to verify that the registered authenticators are working." -msgstr "" - -#: wwa-profile-content.php:169 -#: wwa-shortcodes.php:144 -msgid "Test Login" -msgstr "" - -#: wwa-profile-content.php:171 -#: wwa-shortcodes.php:144 -msgid "Test Login (usernameless)" -msgstr "" - -#: wwa-shortcodes.php:20 -msgid "Error: The username field is empty." -msgstr "" - -#: wwa-shortcodes.php:88 -msgid "Authenticate with password" -msgstr "" - -#: wwa-shortcodes.php:105 -#: wwa-shortcodes.php:133 -#: wwa-shortcodes.php:166 -msgid "You haven't logged in yet." -msgstr "" - -#: wwa-shortcodes.php:118 -msgid "Authenticator identifier" -msgstr "" - -#: wwa-shortcodes.php:118 -msgid "Start registration" -msgstr "" diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-ca_ES.mo b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-ca_ES.mo deleted file mode 100644 index d4966d58..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-ca_ES.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-ca_ES.po b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-ca_ES.po deleted file mode 100644 index 14584c8d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-ca_ES.po +++ /dev/null @@ -1,708 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: WP-WebAuthn 1.2.8\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-webauthn\n" -"POT-Creation-Date: 2022-06-08 12:21+0000\n" -"PO-Revision-Date: 2022-06-08 12:56+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Unknown\n" -"Language: zxx\n" -"Plural-Forms: nplurals=2; plural=n!=1;\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Loco-Source-Locale: ca_ES\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:" -"1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;" -"esc_html_x:1,2c\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Domain: wp-webauthn\n" -"\n" -"X-Loco-Parser: loco_parse_po\n" -"X-Generator: Loco https://localise.biz/" - -#. Plugin Name of the plugin -msgctxt "WP-WebAuthn" -msgid "WP-WebAuthn" -msgstr "WP-WebAuthn" - -#. Plugin URI of the plugin -msgctxt "https://flyhigher.top" -msgid "https://flyhigher.top" -msgstr "https://flyhigher.top" - -#. Description of the plugin -msgctxt "" -"WP-WebAuthn et permet iniciar sessió de forma segura al teu lloc de " -"WordPress sense contrasenya." -msgid "" -"WP-WebAuthn allows you to safely login to your WordPress site without " -"password." -msgstr "" -"WP-WebAuthn et permet iniciar sessió de forma segura al teu lloc de " -"WordPress sense contrasenya." - -#. Author of the plugin -msgctxt "Axton" -msgid "Axton" -msgstr "Axton" - -#. Author URI of the plugin -msgctxt "https://axton.cc" -msgid "https://axton.cc" -msgstr "https://axton.cc" - -#: wwa-admin-content.php:6 -msgctxt "" -"La verificació d'usuari està desactivada per defecte perquè alguns " -"dispositius mòbils no la suporten (especialment a dispositius Android). Però " -"et recomanem que l'activis si és possible per protegir " -"encara més l'inici de sessió." -msgid "" -"User verification is disabled by default because some mobile devices do not " -"support it (especially on Android devices). But we recommend you to " -"enable it if possible to further secure your login." -msgstr "" -"La verificació d'usuari està desactivada per defecte perquè alguns " -"dispositius mòbils no la suporten (especialment a dispositius Android). Però " -"et recomanem que l'activis si és possible per protegir " -"encara més l'inici de sessió." - -#: wwa-admin-content.php:7 wwa-admin-content.php:245 -msgid "Log count: " -msgstr "Recompte de registres: " - -#: wwa-admin-content.php:8 wwa-profile-content.php:14 wwa-shortcodes.php:26 -msgid "Loading failed, maybe try refreshing?" -msgstr "Ha fallat la càrrega, prova de refrescar la pàgina" - -#: wwa-admin-content.php:16 -msgid "" -"PHP extension gmp doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"L'extensió gmp de PHP sembla que no existeix, WP-WebAuthn no pot funcionar." - -#: wwa-admin-content.php:20 -msgid "" -"PHP extension mbstring doesn't seem to exist, rendering WP-WebAuthn unable " -"to function." -msgstr "" -"L'extensió mbsting de PHP sembla que no existeix, WP-WebAuthn no pot " -"funcionar." - -#: wwa-admin-content.php:24 -msgid "" -"PHP extension sodium doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"L'extensió sodium de PHP sembla que no existeix, WP-WebAuthn no pot " -"funcionar." - -#: wwa-admin-content.php:28 -msgid "" -"WebAuthn features are restricted to websites in secure contexts. Please make " -"sure your website is served over HTTPS or locally with localhost" -"." -msgstr "" -"Les funcionalitats de WebAuthn estan restringides a contextos segurs. Si us " -"plau, comprova que el teu lloc web està servit per HTTPS o localment amb " -"localhost." - -#: wwa-admin-content.php:104 -msgid "Settings saved." -msgstr "Configuració desada." - -#: wwa-admin-content.php:106 -msgid "Settings NOT saved." -msgstr "Configuració NO desada." - -#: wwa-admin-content.php:121 -msgid "Preferred login method" -msgstr "Mètode d'inici de sessió preferit" - -#: wwa-admin-content.php:125 -msgid "Prefer WebAuthn" -msgstr "Preferir WebAuthn" - -#: wwa-admin-content.php:126 -msgid "Prefer password" -msgstr "Preferir contrasenya" - -#: wwa-admin-content.php:127 wwa-profile-content.php:56 -msgid "WebAuthn Only" -msgstr "Només WebAuthn" - -#: wwa-admin-content.php:129 -msgid "" -"When using \"WebAuthn Only\", password login will be completely disabled. " -"Please make sure your browser supports WebAuthn, otherwise you may unable to " -"login.
          User that doesn't have any registered authenticator (e.g. new user)" -" will unable to login when using \"WebAuthn Only\".
          When the browser does " -"not support WebAuthn, the login method will default to password if password " -"login is not disabled." -msgstr "" -"Quan utilitzeu \"Només WebAuthn\", l'inici de sessió amb contrasenya es " -"desactivarà completament. Assegureu-vos que el vostre navegador admeti " -"WebAuthn, en cas contrari és possible que no pugueu iniciar la sessió.
          " -"L'usuari que no tingui cap autenticador registrat (per exemple, un usuari " -"nou) no podrà iniciar sessió quan utilitzeu \"Només WebAuthn\".
          Si el " -"navegador no és compatible amb WebAuthn, el mètode d'inici de sessió tindrà " -"la contrasenya per defecte si l'inici de sessió amb contrasenya no està " -"desactivat." - -#: wwa-admin-content.php:133 -msgid "Website identifier" -msgstr "Identificador del lloc web" - -#: wwa-admin-content.php:136 -msgid "" -"This identifier is for identification purpose only and DOES " -"NOT affect the authentication process in anyway." -msgstr "" -"Aquest identificador és només per a efectes d'identificació i " -"NO afecta el procés d'autenticació en cap manera." - -#: wwa-admin-content.php:140 -msgid "Website domain" -msgstr "Domini del lloc web" - -#: wwa-admin-content.php:143 -msgid "" -"This field MUST be exactly the same with the current domain " -"or parent domain." -msgstr "" -"Aquest camp HA de ser exactement el domini actual o el " -"domini arrel." - -#: wwa-admin-content.php:150 -msgid "Allow to remember login" -msgstr "Permetre recordar la sessió" - -#: wwa-admin-content.php:159 wwa-admin-content.php:170 -#: wwa-admin-content.php:186 wwa-admin-content.php:242 -#: wwa-profile-content.php:130 wwa-shortcodes.php:118 -msgid "Enable" -msgstr "Activar" - -#: wwa-admin-content.php:160 wwa-admin-content.php:171 -#: wwa-admin-content.php:187 wwa-admin-content.php:243 -#: wwa-profile-content.php:131 wwa-shortcodes.php:118 -msgid "Disable" -msgstr "Desactivar" - -#: wwa-admin-content.php:161 -msgid "" -"Show the 'Remember Me' checkbox beside the login form when using WebAuthn." -msgstr "" -"Mostrar la casella \"Recorda'm\" al formulari d'inici de sessió quan " -"s'utilitzi WebAuthn." - -#: wwa-admin-content.php:166 -msgid "Require user verification" -msgstr "Requerir verificació de l'usuari" - -#: wwa-admin-content.php:172 -msgid "" -"User verification can improve security, but is not fully supported by mobile " -"devices.
          If you cannot register or verify your authenticators, please " -"consider disabling user verification." -msgstr "" -"La verificació d'usuari pot millorar la seguretat, però no està totalment " -"suportada en alguns dispositius mòbils.
          Si no pots registrar o " -"verificar els teus autenticadors, considera desactivar la verificació " -"d'usuari." - -#: wwa-admin-content.php:177 -msgid "Allow to login without username" -msgstr "Permetre iniciar sessió sense un usuari" - -#: wwa-admin-content.php:188 -msgid "" -"Allow users to register authenticator with usernameless authentication " -"feature and login without username.
          User verification will be " -"enabled automatically when authenticating with usernameless authentication " -"feature.
          Some authenticators and some browsers DO " -"NOT support this feature." -msgstr "" -"Permet als usuaris registrar un autenticador amb la funcionalitat sense " -"usuari i iniciar sessió sense escriure el nom d'usuari.
          La verificació " -"d'usuari s'activarà automaticament quan utilitzis aquesta funcionalitat." -"
          Alguns autenticadors i alguns navegadors NO " -"suporten aquesta funció." - -#: wwa-admin-content.php:193 -msgid "Allow a specific type of authenticator" -msgstr "Permet un tipus d'autenticador específic" - -#: wwa-admin-content.php:202 wwa-profile-content.php:15 -#: wwa-profile-content.php:111 wwa-shortcodes.php:33 wwa-shortcodes.php:118 -msgid "Any" -msgstr "Qualsevol" - -#: wwa-admin-content.php:203 wwa-profile-content.php:112 wwa-shortcodes.php:118 -msgid "Platform (e.g. built-in fingerprint sensors)" -msgstr "Plataforma (p. ex., sensors d'empremtes digitals integrats)" - -#: wwa-admin-content.php:204 wwa-profile-content.php:113 wwa-shortcodes.php:118 -msgid "Roaming (e.g. USB security keys)" -msgstr "Itinerància (p. ex., claus de seguretat USB)" - -#: wwa-admin-content.php:206 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type when authenticating and user can only register authenticators " -"of selected type." -msgstr "" -"Si se selecciona un tipus, el navegador només demanarà un autenticador del " -"tipus seleccionat quan s'autentiqui i l'usuari només pot registrar " -"autenticadors del tipus seleccionat." - -#: wwa-admin-content.php:213 -msgid "After User Registration" -msgstr "Després del registre d'usuari" - -#: wwa-admin-content.php:222 -msgid "No action" -msgstr "Cap acció" - -#: wwa-admin-content.php:223 -msgid "Log user in immediately" -msgstr "Inicieu sessió immediatament a l'usuari" - -#: wwa-admin-content.php:224 -msgid "Redirect to WP-WebAuthn guide page" -msgstr "Redirigeix a la pàgina de guia de WP-WebAuthn" - -#: wwa-admin-content.php:226 -msgid "" -"What to do when a new user registered. Useful when \"WebAuthn Only\" is " -"enabled." -msgstr "" -"Què fer quan es registra un nou usuari. Útil quan \"Només WebAuthn\" està " -"habilitat." - -#: wwa-admin-content.php:233 -msgid "Logging" -msgstr "Enregistrant" - -#: wwa-admin-content.php:245 -msgid "Clear log" -msgstr "Buidar registre" - -#: wwa-admin-content.php:247 -msgid "" -"For debugging only. Enable only when needed.
          Note: Logs may " -"contain sensitive information." -msgstr "" -"Només per a la depuració. Activa només quan sigui necessari.
          Nota:" -" els registres poden contenir informació sensible." - -#: wwa-admin-content.php:256 -msgid "Log" -msgstr "Registre" - -#: wwa-admin-content.php:258 -msgid "Automatic update every 5 seconds." -msgstr "Actualització automàtica cada 5 segons." - -#: wwa-admin-content.php:262 -msgid "" -"To register a new authenticator or edit your authenticators, please go to your profile." -msgstr "" -"Per registrar un nou autenticador o editar els vostres autenticadors, aneu a " -"el vostre perfil." - -#: wwa-functions.php:148 wwa-shortcodes.php:88 -msgid "Auth" -msgstr "Autenticació" - -#: wwa-functions.php:149 wwa-shortcodes.php:11 wwa-shortcodes.php:85 -#: wwa-shortcodes.php:88 -msgid "Authenticate with WebAuthn" -msgstr "Autenticar-se amb WebAuthn" - -#: wwa-functions.php:150 wwa-shortcodes.php:12 -msgid "Hold on..." -msgstr "Espera..." - -#: wwa-functions.php:151 wwa-shortcodes.php:13 -msgid "Please proceed..." -msgstr "Si us plau, continueu..." - -#: wwa-functions.php:152 wwa-shortcodes.php:14 -msgid "Authenticating..." -msgstr "S'està autenticant..." - -#: wwa-functions.php:153 wwa-shortcodes.php:15 -msgid "Authenticated" -msgstr "Autenticat" - -#: wwa-functions.php:154 wwa-shortcodes.php:16 -msgid "Auth failed" -msgstr "L'autenticació ha fallat" - -#: wwa-functions.php:155 -msgid "" -"It looks like your browser doesn't support WebAuthn, which means you may " -"unable to login." -msgstr "" -"Sembla que el vostre navegador no és compatible amb WebAuthn, el que " -"significa que és possible que no pugueu iniciar sessió." - -#: wwa-functions.php:156 wwa-shortcodes.php:88 -msgid "Username" -msgstr "Nom d'usuari" - -#: wwa-functions.php:158 -msgid "Error: The username field is empty." -msgstr "Error: el camp del nom d'usuari està buit." - -#: wwa-functions.php:159 wwa-shortcodes.php:42 -msgid "Try to enter the username" -msgstr "Intenta introduir el nom d'usuari" - -#: wwa-functions.php:174 -msgid "Logging in with password has been disabled by the site manager." -msgstr "" -"L'administrador del lloc ha desactivat l'inici de sessió amb contrasenya." - -#: wwa-functions.php:180 -msgid "Logging in with password has been disabled for this account." -msgstr "S'ha desactivat l'inici de sessió amb contrasenya per a aquest compte." - -#: wwa-functions.php:218 -msgid "" -"Logging in with password has been disabled for %s but you haven't register " -"any WebAuthn authenticator yet. You may unable to login again once you log " -"out. Register" -msgstr "" -"L'inici de sessió amb contrasenya s'ha desactivat per a %s, però encara no " -"heu registrat cap autenticador WebAuthn. És possible que no pugueu tornar a " -"iniciar sessió un cop tanqueu la sessió. " -"Registreu-vos" - -#: wwa-functions.php:218 wwa-functions.php:263 -msgid "the site" -msgstr "el lloc web" - -#: wwa-functions.php:218 -msgid "your account" -msgstr "el teu compte" - -#: wwa-functions.php:263 -msgid "" -"Logging in with password has been disabled for %s but this " -"account haven't register any WebAuthn authenticator yet. This user " -"may unable to login." -msgstr "" -"L'inici de sessió amb contrasenya s'ha desactivat per a %s, però " -"aquest compte encara no ha registrat cap autenticador WebAuthn. És " -"possible que aquest usuari no pugui iniciar sessió." - -#: wwa-functions.php:263 -msgid "this account" -msgstr "aquest compte" - -#: wwa-functions.php:291 -msgid "Settings" -msgstr "Configuració" - -#: wwa-functions.php:299 -msgid "GitHub" -msgstr "GitHub" - -#: wwa-functions.php:300 -msgid "Documentation" -msgstr "Documentació" - -#: wwa-profile-content.php:7 -msgid "Initializing..." -msgstr "Inicialitzant..." - -#: wwa-profile-content.php:8 wwa-shortcodes.php:37 -msgid "Please follow instructions to finish registration..." -msgstr "Si us plau, seguiu les instruccions per finalitzar el registre..." - -#: wwa-profile-content.php:9 wwa-shortcodes.php:38 -msgctxt "action" -msgid "Registered" -msgstr "Registrat" - -#: wwa-profile-content.php:10 wwa-shortcodes.php:39 -msgid "Registration failed" -msgstr "El registre ha fallat" - -#: wwa-profile-content.php:11 wwa-shortcodes.php:40 -msgid "Your browser does not support WebAuthn" -msgstr "El vostre navegador no admet WebAuthn" - -#: wwa-profile-content.php:12 wwa-shortcodes.php:41 -msgid "Registrating..." -msgstr "S'està registrant..." - -#: wwa-profile-content.php:13 wwa-shortcodes.php:21 -msgid "Please enter the authenticator identifier" -msgstr "Introduïu l'identificador de l'autenticador" - -#: wwa-profile-content.php:16 wwa-shortcodes.php:34 -msgid "Platform authenticator" -msgstr "Autenticador de plataforma" - -#: wwa-profile-content.php:17 wwa-shortcodes.php:35 -msgid "Roaming authenticator" -msgstr "Autenticador d'itinerància" - -#: wwa-profile-content.php:18 wwa-shortcodes.php:36 -msgid "Remove" -msgstr "Eliminar" - -#: wwa-profile-content.php:19 wwa-shortcodes.php:22 -msgid "Please follow instructions to finish verification..." -msgstr "Si us plau, seguiu les instruccions per acabar la verificació..." - -#: wwa-profile-content.php:20 wwa-shortcodes.php:23 -msgid "Verifying..." -msgstr "S'està verificant..." - -#: wwa-profile-content.php:21 wwa-shortcodes.php:24 -msgid "Verification failed" -msgstr "La verificació ha fallat" - -#: wwa-profile-content.php:22 wwa-shortcodes.php:25 -msgid "Verification passed! You can now log in through WebAuthn" -msgstr "Verificació superada! Ara podeu iniciar sessió mitjançant WebAuthn" - -#: wwa-profile-content.php:23 wwa-shortcodes.php:32 -msgid "No registered authenticators" -msgstr "No hi ha autenticadors registrats" - -#: wwa-profile-content.php:24 wwa-shortcodes.php:27 -msgid "Confirm removal of authenticator: " -msgstr "Confirmeu l'eliminació de l'autenticador:" - -#: wwa-profile-content.php:25 wwa-shortcodes.php:28 -msgid "Removing..." -msgstr "Eliminant..." - -#: wwa-profile-content.php:26 wwa-shortcodes.php:29 -msgid "Rename" -msgstr "Canvia el nom" - -#: wwa-profile-content.php:27 wwa-shortcodes.php:30 -msgid "Rename the authenticator" -msgstr "Canvieu el nom de l'autenticador" - -#: wwa-profile-content.php:28 wwa-shortcodes.php:31 -msgid "Renaming..." -msgstr "S'està canviant el nom..." - -#: wwa-profile-content.php:29 wwa-shortcodes.php:10 -msgid "Ready" -msgstr "A punt" - -#: wwa-profile-content.php:30 wwa-shortcodes.php:17 -msgid "No" -msgstr "No" - -#: wwa-profile-content.php:31 wwa-shortcodes.php:18 -msgid " (Unavailable)" -msgstr "(No disponible)" - -#: wwa-profile-content.php:32 wwa-shortcodes.php:19 -msgid "The site administrator has disabled usernameless login feature." -msgstr "" -"L'administrador del lloc ha desactivat la funció d'inici de sessió sense nom " -"d'usuari." - -#: wwa-profile-content.php:33 wwa-shortcodes.php:43 -msgid "" -"After removing this authenticator, you will not be able to login with " -"WebAuthn" -msgstr "" -"Després d'eliminar aquest autenticador, no podreu iniciar sessió amb WebAuthn" - -#: wwa-profile-content.php:34 wwa-shortcodes.php:44 -msgid " (Disabled)" -msgstr "(Desactivat)" - -#: wwa-profile-content.php:35 wwa-shortcodes.php:45 -msgid "The site administrator only allow platform authenticators currently." -msgstr "" -"Actualment, l'administrador del lloc només permet autenticadors de " -"plataforma." - -#: wwa-profile-content.php:36 wwa-shortcodes.php:46 -msgid "The site administrator only allow roaming authenticators currently." -msgstr "" -"Actualment, l'administrador del lloc només permet autenticadors " -"d'itinerància." - -#: wwa-profile-content.php:50 -msgid "" -"This site is not correctly configured to use WebAuthn. Please contact the " -"site administrator." -msgstr "" -"Aquest lloc no està configurat correctament per utilitzar WebAuthn. Poseu-" -"vos en contacte amb l'administrador del lloc." - -#: wwa-profile-content.php:60 -msgid "Disable password login for this account" -msgstr "Desactiveu l'inici de sessió amb contrasenya per a aquest compte" - -#: wwa-profile-content.php:62 -msgid "" -"When checked, password login will be completely disabled. Please make sure " -"your browser supports WebAuthn and you have a registered authenticator, " -"otherwise you may unable to login." -msgstr "" -"Quan estigui marcat, l'inici de sessió amb contrasenya es desactivarà " -"completament. Assegureu-vos que el vostre navegador admet WebAuthn i que " -"teniu un autenticador registrat, en cas contrari, és possible que no pugueu " -"iniciar sessió." - -#: wwa-profile-content.php:62 -msgid "The site administrator has disabled password login for the whole site." -msgstr "" -"L'administrador del lloc ha desactivat l'inici de sessió amb contrasenya per " -"a tot el lloc." - -#: wwa-profile-content.php:66 -msgid "Registered WebAuthn Authenticators" -msgstr "Autenticadors WebAuthn registrats" - -#: wwa-profile-content.php:71 wwa-profile-content.php:86 -#: wwa-shortcodes.php:156 wwa-shortcodes.php:158 -msgid "Identifier" -msgstr "Identificador" - -#: wwa-profile-content.php:72 wwa-profile-content.php:87 -#: wwa-shortcodes.php:156 wwa-shortcodes.php:158 -msgid "Type" -msgstr "Tipus" - -#: wwa-profile-content.php:73 wwa-profile-content.php:88 -#: wwa-shortcodes.php:156 wwa-shortcodes.php:158 -msgctxt "time" -msgid "Registered" -msgstr "Registrat" - -#: wwa-profile-content.php:74 wwa-profile-content.php:89 -msgid "Last used" -msgstr "Darrera utilització" - -#: wwa-profile-content.php:75 wwa-profile-content.php:90 -#: wwa-shortcodes.php:156 wwa-shortcodes.php:158 -msgid "Usernameless" -msgstr "Sense nom d'usuari" - -#: wwa-profile-content.php:76 wwa-profile-content.php:91 -#: wwa-shortcodes.php:156 wwa-shortcodes.php:158 -msgid "Action" -msgstr "Acció" - -#: wwa-profile-content.php:81 wwa-shortcodes.php:157 -msgid "Loading..." -msgstr "Carregant..." - -#: wwa-profile-content.php:98 wwa-profile-content.php:101 -msgid "Register New Authenticator" -msgstr "Registrar un nou autenticador" - -#: wwa-profile-content.php:98 wwa-profile-content.php:142 -msgid "Verify Authenticator" -msgstr "Verificar l'autenticador" - -#: wwa-profile-content.php:102 -msgid "" -"You are about to associate an authenticator with the current account " -"%s.
          You can register multiple authenticators for an account." -msgstr "" -"Esteu a punt d'associar un autenticador amb el compte actual " -"%s.
          Podeu registrar diversos autenticadors per a un compte." - -#: wwa-profile-content.php:105 wwa-shortcodes.php:118 -msgid "Type of authenticator" -msgstr "Tipus d'autenticador" - -#: wwa-profile-content.php:115 wwa-shortcodes.php:118 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type.
          Regardless of the type, you can only log in with the " -"very same authenticators you've registered." -msgstr "" -"Si se selecciona un tipus, el navegador només demanarà autenticadors del " -"tipus seleccionat.
          Independentment del tipus, només podeu iniciar " -"sessió amb els mateixos autenticadors que heu registrat." - -#: wwa-profile-content.php:119 -msgid "Authenticator Identifier" -msgstr "Identificador de l'autenticador" - -#: wwa-profile-content.php:122 wwa-shortcodes.php:118 -msgid "" -"An easily identifiable name for the authenticator. DOES NOT " -"affect the authentication process in anyway." -msgstr "" -"Un nom fàcilment identificable per a l'autenticador. NO " -"afecta el procés d'autenticació de cap manera." - -#: wwa-profile-content.php:127 wwa-shortcodes.php:118 -msgid "Login without username" -msgstr "Inicieu sessió sense nom d'usuari" - -#: wwa-profile-content.php:132 wwa-shortcodes.php:118 -msgid "" -"If registered authenticator with this feature, you can login without enter " -"your username.
          Some authenticators like U2F-only authenticators and some " -"browsers DO NOT support this feature.
          A record will be " -"stored in the authenticator permanently untill you reset it." -msgstr "" -"Si teniu un autenticador registrat amb aquesta funció, podeu iniciar sessió " -"sense introduir el vostre nom d'usuari.
          Alguns autenticadors com ara " -"autenticadors només U2F i alguns navegadors NO admeten " -"aquesta funció.
          S'emmagatzemarà un registre a l'autenticador de manera " -"permanent fins que el reinicieu." - -#: wwa-profile-content.php:138 -msgid "Start Registration" -msgstr "Inicieu el registre" - -#: wwa-profile-content.php:143 -msgid "" -"Click Test Login to verify that the registered authenticators are working." -msgstr "" -"Feu clic a Prova l'inici de sessió per verificar que els autenticadors " -"registrats funcionen." - -#: wwa-profile-content.php:144 wwa-shortcodes.php:144 -msgid "Test Login" -msgstr "Prova l'inici de sessió" - -#: wwa-profile-content.php:146 wwa-shortcodes.php:144 -msgid "Test Login (usernameless)" -msgstr "Prova l'inici de sessió (sense nom d'usuari)" - -#: wwa-shortcodes.php:20 -msgid "Error: The username field is empty." -msgstr "Error: el camp del nom d'usuari està buit." - -#: wwa-shortcodes.php:88 -msgid "Authenticate with password" -msgstr "Autenticar-se amb contrasenya" - -#: wwa-shortcodes.php:105 wwa-shortcodes.php:133 wwa-shortcodes.php:166 -msgid "You haven't logged in yet." -msgstr "Encara no has iniciat sessió." - -#: wwa-shortcodes.php:118 -msgid "Authenticator identifier" -msgstr "Identificador de l'autenticador" - -#: wwa-shortcodes.php:118 -msgid "Start registration" -msgstr "Inicieu el registre" diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-es_ES.mo b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-es_ES.mo deleted file mode 100644 index 811937f2..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-es_ES.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-es_ES.po b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-es_ES.po deleted file mode 100644 index ba2b85cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-es_ES.po +++ /dev/null @@ -1,697 +0,0 @@ -# Copyright (C) 2022 Axton -# This file is distributed under the same license as the WP-WebAuthn plugin. -msgid "" -msgstr "" -"Project-Id-Version: WP-WebAuthn 1.2.8\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-webauthn\n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: es_ES\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;" -"_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;" -"esc_html_e;esc_html_x:1,2c\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Domain: wp-webauthn\n" -"X-Generator: Poedit 3.0.1\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" - -#. Plugin Name of the plugin -msgid "WP-WebAuthn" -msgstr "WP-WebAuthn" - -#. Plugin URI of the plugin -msgid "https://flyhigher.top" -msgstr "https://flyhigher.top" - -#. Description of the plugin -msgid "" -"WP-WebAuthn allows you to safely login to your WordPress site without " -"password." -msgstr "" -"WP-WebAuthn le permite iniciar sesión de forma segura en su sitio de " -"WordPress sin contraseña." - -#. Author of the plugin -msgid "Axton" -msgstr "Axton" - -#. Author URI of the plugin -msgid "https://axton.cc" -msgstr "https://axton.cc" - -#: wwa-admin-content.php:6 -msgid "" -"User verification is disabled by default because some mobile devices do not " -"support it (especially on Android devices). But we recommend you to " -"enable it if possible to further secure your login." -msgstr "" -"La verificación del usuario está desactivada por defecto porque algunos " -"dispositivos móviles no la admiten (especialmente en los dispositivos " -"Android). Pero le recomendamos que lo habilite si es " -"posible para asegurar aún más su inicio de sesión." - -#: wwa-admin-content.php:7 wwa-admin-content.php:245 -msgid "Log count: " -msgstr "Cuenta de registro: " - -#: wwa-admin-content.php:8 wwa-profile-content.php:14 wwa-shortcodes.php:26 -msgid "Loading failed, maybe try refreshing?" -msgstr "La carga ha fallado, ¿intenta refrescar la pestaña?" - -#: wwa-admin-content.php:16 -msgid "" -"PHP extension gmp doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"La extensión PHP gmp no parece existir, haciendo que WP-WebAuthn no pueda " -"funcionar." - -#: wwa-admin-content.php:20 -msgid "" -"PHP extension mbstring doesn't seem to exist, rendering WP-WebAuthn unable " -"to function." -msgstr "" -"La extensión PHP mbstring no parece existir, haciendo que WP-WebAuthn no " -"pueda funcionar." - -#: wwa-admin-content.php:24 -msgid "" -"PHP extension sodium doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"La extensión PHP sodium no parece existir, haciendo que WP-WebAuthn no pueda " -"funcionar." - -#: wwa-admin-content.php:28 -msgid "" -"WebAuthn features are restricted to websites in secure contexts. Please make " -"sure your website is served over HTTPS or locally with localhost." -msgstr "" -"Las funciones de WebAuthn están restringidas a los sitios web en contextos " -"seguros. Asegúrese de que su sitio web se sirve a través de HTTPS o " -"localmente con localhost." - -#: wwa-admin-content.php:104 -msgid "Settings saved." -msgstr "Ajustes guardados." - -#: wwa-admin-content.php:106 -msgid "Settings NOT saved." -msgstr "Ajustes NO guardados." - -#: wwa-admin-content.php:121 -msgid "Preferred login method" -msgstr "Método de inicio de sesión preferido" - -#: wwa-admin-content.php:125 -msgid "Prefer WebAuthn" -msgstr "Preferir WebAuthn" - -#: wwa-admin-content.php:126 -msgid "Prefer password" -msgstr "Preferir contraseña" - -#: wwa-admin-content.php:127 wwa-profile-content.php:56 -msgid "WebAuthn Only" -msgstr "Sólo WebAuthn" - -#: wwa-admin-content.php:129 -msgid "" -"When using \"WebAuthn Only\", password login will be completely disabled. " -"Please make sure your browser supports WebAuthn, otherwise you may unable to " -"login.
          User that doesn't have any registered authenticator (e.g. new " -"user) will unable to login when using \"WebAuthn Only\".
          When the browser " -"does not support WebAuthn, the login method will default to password if " -"password login is not disabled." -msgstr "" -"Cuando se utiliza “Sólo WebAuthn”, el inicio de sesión con contraseña estará " -"completamente deshabilitado. Por favor, asegúrese de que su navegador es " -"compatible con WebAuthn, de lo contrario no podrá iniciar la sesión.
          El " -"usuario que no tenga ningún autentificador registrado (por ejemplo, un nuevo " -"usuario) no podrá iniciar sesión cuando utilice “Sólo WebAuthn”.
          Cuando " -"el navegador no admite WebAuthn, el método de inicio de sesión será por " -"defecto la contraseña si el inicio de sesión con contraseña no está " -"desactivado." - -#: wwa-admin-content.php:133 -msgid "Website identifier" -msgstr "Identificador del sitio web" - -#: wwa-admin-content.php:136 -msgid "" -"This identifier is for identification purpose only and DOES NOT affect the authentication process in anyway." -msgstr "" -"Este identificador es sólo para fines de identificación y NO afecta al proceso de autenticación de ninguna manera." - -#: wwa-admin-content.php:140 -msgid "Website domain" -msgstr "Dominio del sitio web" - -#: wwa-admin-content.php:143 -msgid "" -"This field MUST be exactly the same with the current domain " -"or parent domain." -msgstr "" -"Este campo DEBE ser exactamente el mismo con el dominio " -"actual o el dominio principal." - -#: wwa-admin-content.php:150 -msgid "Allow to remember login" -msgstr "Permitir recordar el inicio de sesión" - -#: wwa-admin-content.php:159 wwa-admin-content.php:170 -#: wwa-admin-content.php:186 wwa-admin-content.php:242 -#: wwa-profile-content.php:130 wwa-shortcodes.php:118 -msgid "Enable" -msgstr "Activar" - -#: wwa-admin-content.php:160 wwa-admin-content.php:171 -#: wwa-admin-content.php:187 wwa-admin-content.php:243 -#: wwa-profile-content.php:131 wwa-shortcodes.php:118 -msgid "Disable" -msgstr "Desactivar" - -#: wwa-admin-content.php:161 -msgid "" -"Show the 'Remember Me' checkbox beside the login form when using WebAuthn." -msgstr "" -"Mostrar la casilla “Recuérdame” al lado del formulario de acceso cuando se " -"utiliza WebAuthn." - -#: wwa-admin-content.php:166 -msgid "Require user verification" -msgstr "Requerir la verificación del usuario" - -#: wwa-admin-content.php:172 -msgid "" -"User verification can improve security, but is not fully supported by mobile " -"devices.
          If you cannot register or verify your authenticators, please " -"consider disabling user verification." -msgstr "" -"La verificación de usuario puede mejorar la seguridad, pero no es totalmente " -"compatible con los dispositivos móviles.
          Si no puedes registrar o " -"verificar tus autenticadores, considera desactivar la verificación de " -"usuario." - -#: wwa-admin-content.php:177 -msgid "Allow to login without username" -msgstr "Permitir el acceso sin nombre de usuario" - -#: wwa-admin-content.php:188 -msgid "" -"Allow users to register authenticator with usernameless authentication " -"feature and login without username.
          User verification will be " -"enabled automatically when authenticating with usernameless authentication " -"feature.
          Some authenticators and some browsers DO NOT support this feature." -msgstr "" -"Permitir a los usuarios registrar el autentificador con la función de " -"autentificación sin nombre de usuario y conectarse sin nombre de usuario." -"
          La verificación del usuario se activará automáticamente cuando " -"se autentique con la función de autenticación sin nombre.
          Algunos autenticadores y algunos navegadores NO " -"soportan esta función." - -#: wwa-admin-content.php:193 -msgid "Allow a specific type of authenticator" -msgstr "Permitir un tipo específico de autentificador" - -#: wwa-admin-content.php:202 wwa-profile-content.php:15 -#: wwa-profile-content.php:111 wwa-shortcodes.php:33 wwa-shortcodes.php:118 -msgid "Any" -msgstr "Cualquier" - -#: wwa-admin-content.php:203 wwa-profile-content.php:112 wwa-shortcodes.php:118 -msgid "Platform (e.g. built-in fingerprint sensors)" -msgstr "Plataforma (por ejemplo, sensores de huellas dactilares integrados)" - -#: wwa-admin-content.php:204 wwa-profile-content.php:113 wwa-shortcodes.php:118 -msgid "Roaming (e.g. USB security keys)" -msgstr "Roaming (por ejemplo, llaves de seguridad USB)" - -#: wwa-admin-content.php:206 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type when authenticating and user can only register authenticators " -"of selected type." -msgstr "" -"Si se selecciona un tipo, el navegador sólo pedirá autenticadores del tipo " -"seleccionado cuando se autentique y el usuario sólo podrá registrar " -"autenticadores del tipo seleccionado." - -#: wwa-admin-content.php:213 -msgid "After User Registration" -msgstr "Tras el registro del usuario" - -#: wwa-admin-content.php:222 -msgid "No action" -msgstr "Ninguna acción" - -#: wwa-admin-content.php:223 -msgid "Log user in immediately" -msgstr "Iniciar la sesión del usuario inmediatamente" - -#: wwa-admin-content.php:224 -msgid "Redirect to WP-WebAuthn guide page" -msgstr "Redirigir a la página de la guía de WP-WebAuthn" - -#: wwa-admin-content.php:226 -msgid "" -"What to do when a new user registered. Useful when \"WebAuthn Only\" is " -"enabled." -msgstr "" -"Qué hacer cuando se registra un nuevo usuario. Útil cuando se habilita “Sólo " -"WebAuthn”." - -#: wwa-admin-content.php:233 -msgid "Logging" -msgstr "Registrando" - -#: wwa-admin-content.php:245 -msgid "Clear log" -msgstr "Borrar registro" - -#: wwa-admin-content.php:247 -msgid "" -"For debugging only. Enable only when needed.
          Note: Logs may " -"contain sensitive information." -msgstr "" -"Sólo para depuración. Habilitar sólo cuando sea necesario.
          Nota: " -"Los registros pueden contener información sensible." - -#: wwa-admin-content.php:256 -msgid "Log" -msgstr "Registro" - -#: wwa-admin-content.php:258 -msgid "Automatic update every 5 seconds." -msgstr "Actualización automática cada 5 segundos." - -#: wwa-admin-content.php:262 -msgid "" -"To register a new authenticator or edit your authenticators, please go to your profile." -msgstr "" -"Para registrar un nuevo autentificador o editar sus autentificadores, vaya a " -"su perfil." - -#: wwa-functions.php:148 wwa-shortcodes.php:88 -msgid "Auth" -msgstr "Auténtico" - -#: wwa-functions.php:149 wwa-shortcodes.php:11 wwa-shortcodes.php:85 -#: wwa-shortcodes.php:88 -msgid "Authenticate with WebAuthn" -msgstr "Autenticación con WebAuthn" - -#: wwa-functions.php:150 wwa-shortcodes.php:12 -msgid "Hold on..." -msgstr "Espere…" - -#: wwa-functions.php:151 wwa-shortcodes.php:13 -msgid "Please proceed..." -msgstr "Por favor, proceda…" - -#: wwa-functions.php:152 wwa-shortcodes.php:14 -msgid "Authenticating..." -msgstr "Autenticación…" - -#: wwa-functions.php:153 wwa-shortcodes.php:15 -msgid "Authenticated" -msgstr "Autenticado" - -#: wwa-functions.php:154 wwa-shortcodes.php:16 -msgid "Auth failed" -msgstr "Autorización fallida" - -#: wwa-functions.php:155 -msgid "" -"It looks like your browser doesn't support WebAuthn, which means you may " -"unable to login." -msgstr "" -"Parece que tu navegador no es compatible con WebAuthn, lo que significa que " -"no puedes iniciar sesión." - -#: wwa-functions.php:156 wwa-shortcodes.php:88 -msgid "Username" -msgstr "Nombre de usuario" - -#: wwa-functions.php:158 -msgid "Error: The username field is empty." -msgstr "Error: El campo del nombre de usuario está vacío." - -#: wwa-functions.php:159 wwa-shortcodes.php:42 -msgid "Try to enter the username" -msgstr "Intenta introducir el nombre de usuario" - -#: wwa-functions.php:174 -msgid "Logging in with password has been disabled by the site manager." -msgstr "" -"El administrador del sitio ha desactivado el inicio de sesión con contraseña." - -#: wwa-functions.php:180 -msgid "Logging in with password has been disabled for this account." -msgstr "Se ha desactivado el inicio de sesión con contraseña para esta cuenta." - -#: wwa-functions.php:218 -msgid "" -"Logging in with password has been disabled for %s but you haven't register " -"any WebAuthn authenticator yet. You may unable to login again once you log " -"out. Register" -msgstr "" -"El inicio de sesión con contraseña se ha desactivado para %s pero aún no ha " -"registrado ningún autentificador WebAuthn. Es posible que no pueda volver a " -"conectarse una vez que haya cerrado la sesión. Registrar" - -#: wwa-functions.php:218 wwa-functions.php:263 -msgid "the site" -msgstr "el sitio" - -#: wwa-functions.php:218 -msgid "your account" -msgstr "su cuenta" - -#: wwa-functions.php:263 -msgid "" -"Logging in with password has been disabled for %s but this account haven't register any WebAuthn authenticator yet. This user may " -"unable to login." -msgstr "" -"El inicio de sesión con contraseña se ha desactivado para %s pero " -"esta cuenta aún no ha registrado ningún autentificador " -"WebAuthn. Es posible que este usuario no pueda iniciar sesión." - -#: wwa-functions.php:263 -msgid "this account" -msgstr "esta cuenta" - -#: wwa-functions.php:291 -msgid "Settings" -msgstr "Ajustes" - -#: wwa-functions.php:299 -msgid "GitHub" -msgstr "GitHub" - -#: wwa-functions.php:300 -msgid "Documentation" -msgstr "Documentación" - -#: wwa-profile-content.php:7 -msgid "Initializing..." -msgstr "Iniciando…" - -#: wwa-profile-content.php:8 wwa-shortcodes.php:37 -msgid "Please follow instructions to finish registration..." -msgstr "Por favor, siga las instrucciones para finalizar el registro…" - -#: wwa-profile-content.php:9 wwa-shortcodes.php:38 -msgctxt "action" -msgid "Registered" -msgstr "Registrado" - -#: wwa-profile-content.php:10 wwa-shortcodes.php:39 -msgid "Registration failed" -msgstr "Registro fallido" - -#: wwa-profile-content.php:11 wwa-shortcodes.php:40 -msgid "Your browser does not support WebAuthn" -msgstr "Su navegador no soporta WebAuthn" - -#: wwa-profile-content.php:12 wwa-shortcodes.php:41 -msgid "Registrating..." -msgstr "Registrándose…" - -#: wwa-profile-content.php:13 wwa-shortcodes.php:21 -msgid "Please enter the authenticator identifier" -msgstr "Por favor, introduzca el identificador del autentificador" - -#: wwa-profile-content.php:16 wwa-shortcodes.php:34 -msgid "Platform authenticator" -msgstr "Autentificador de plataforma" - -#: wwa-profile-content.php:17 wwa-shortcodes.php:35 -msgid "Roaming authenticator" -msgstr "Autentificador itinerante" - -#: wwa-profile-content.php:18 wwa-shortcodes.php:36 -msgid "Remove" -msgstr "Eliminar" - -#: wwa-profile-content.php:19 wwa-shortcodes.php:22 -msgid "Please follow instructions to finish verification..." -msgstr "Por favor, siga las instrucciones para terminar la verificación…" - -#: wwa-profile-content.php:20 wwa-shortcodes.php:23 -msgid "Verifying..." -msgstr "Verificando…" - -#: wwa-profile-content.php:21 wwa-shortcodes.php:24 -msgid "Verification failed" -msgstr "Verificación fallida" - -#: wwa-profile-content.php:22 wwa-shortcodes.php:25 -msgid "Verification passed! You can now log in through WebAuthn" -msgstr "¡Verificación superada! Ahora puede conectarse a través de WebAuthn" - -#: wwa-profile-content.php:23 wwa-shortcodes.php:32 -msgid "No registered authenticators" -msgstr "No hay autentificadores registrados" - -#: wwa-profile-content.php:24 wwa-shortcodes.php:27 -msgid "Confirm removal of authenticator: " -msgstr "Confirme la retirada del autentificador: " - -#: wwa-profile-content.php:25 wwa-shortcodes.php:28 -msgid "Removing..." -msgstr "Quitando…" - -#: wwa-profile-content.php:26 wwa-shortcodes.php:29 -msgid "Rename" -msgstr "Renombrar" - -#: wwa-profile-content.php:27 wwa-shortcodes.php:30 -msgid "Rename the authenticator" -msgstr "Cambiar el nombre del autentificador" - -#: wwa-profile-content.php:28 wwa-shortcodes.php:31 -msgid "Renaming..." -msgstr "Renombrar…" - -#: wwa-profile-content.php:29 wwa-shortcodes.php:10 -msgid "Ready" -msgstr "Listo" - -#: wwa-profile-content.php:30 wwa-shortcodes.php:17 -msgid "No" -msgstr "No" - -#: wwa-profile-content.php:31 wwa-shortcodes.php:18 -msgid " (Unavailable)" -msgstr " (No disponible)" - -#: wwa-profile-content.php:32 wwa-shortcodes.php:19 -msgid "The site administrator has disabled usernameless login feature." -msgstr "" -"El administrador del sitio ha desactivado la función de inicio de sesión sin " -"nombre." - -#: wwa-profile-content.php:33 wwa-shortcodes.php:43 -msgid "" -"After removing this authenticator, you will not be able to login with " -"WebAuthn" -msgstr "" -"Después de eliminar este autentificador, no podrá iniciar sesión con WebAuthn" - -#: wwa-profile-content.php:34 wwa-shortcodes.php:44 -msgid " (Disabled)" -msgstr " (Desactivado)" - -#: wwa-profile-content.php:35 wwa-shortcodes.php:45 -msgid "The site administrator only allow platform authenticators currently." -msgstr "" -"El administrador del sitio sólo permite actualmente autenticadores de " -"plataforma." - -#: wwa-profile-content.php:36 wwa-shortcodes.php:46 -msgid "The site administrator only allow roaming authenticators currently." -msgstr "" -"El administrador del sitio sólo permite actualmente autenticadores " -"itinerantes." - -#: wwa-profile-content.php:50 -msgid "" -"This site is not correctly configured to use WebAuthn. Please contact the " -"site administrator." -msgstr "" -"Este sitio no está correctamente configurado para utilizar WebAuthn. Por " -"favor, póngase en contacto con el administrador del sitio." - -#: wwa-profile-content.php:60 -msgid "Disable password login for this account" -msgstr "Desactivar el inicio de sesión con contraseña para esta cuenta" - -#: wwa-profile-content.php:62 -msgid "" -"When checked, password login will be completely disabled. Please make sure " -"your browser supports WebAuthn and you have a registered authenticator, " -"otherwise you may unable to login." -msgstr "" -"Cuando se marca, el inicio de sesión con contraseña estará completamente " -"deshabilitado. Asegúrese de que su navegador es compatible con WebAuthn y de " -"que tiene un autentificador registrado; de lo contrario, es posible que no " -"pueda iniciar sesión." - -#: wwa-profile-content.php:62 -msgid "The site administrator has disabled password login for the whole site." -msgstr "" -"El administrador del sitio ha desactivado el inicio de sesión con contraseña " -"para todo el sitio." - -#: wwa-profile-content.php:66 -msgid "Registered WebAuthn Authenticators" -msgstr "Autenticadores WebAuthn registrados" - -#: wwa-profile-content.php:71 wwa-profile-content.php:86 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Identifier" -msgstr "Identificador" - -#: wwa-profile-content.php:72 wwa-profile-content.php:87 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Type" -msgstr "Tipo" - -#: wwa-profile-content.php:73 wwa-profile-content.php:88 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgctxt "time" -msgid "Registered" -msgstr "Registrado" - -#: wwa-profile-content.php:74 wwa-profile-content.php:89 -msgid "Last used" -msgstr "Última vez que se utilizó" - -#: wwa-profile-content.php:75 wwa-profile-content.php:90 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Usernameless" -msgstr "Sin nombre de usuario" - -#: wwa-profile-content.php:76 wwa-profile-content.php:91 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Action" -msgstr "Ación" - -#: wwa-profile-content.php:81 wwa-shortcodes.php:157 -msgid "Loading..." -msgstr "Cargando…" - -#: wwa-profile-content.php:98 wwa-profile-content.php:101 -msgid "Register New Authenticator" -msgstr "Registrar un nuevo autentificador" - -#: wwa-profile-content.php:98 wwa-profile-content.php:142 -msgid "Verify Authenticator" -msgstr "Verificar Authenticator" - -#: wwa-profile-content.php:102 -msgid "" -"You are about to associate an authenticator with the current account " -"%s.
          You can register multiple authenticators for an account." -msgstr "" -"Va a asociar un autentificador a la cuenta actual %s." -"
          Puede registrar varios autentificadores para una cuenta." - -#: wwa-profile-content.php:105 wwa-shortcodes.php:118 -msgid "Type of authenticator" -msgstr "Tipo de autentificador" - -#: wwa-profile-content.php:115 wwa-shortcodes.php:118 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type.
          Regardless of the type, you can only log in with the " -"very same authenticators you've registered." -msgstr "" -"Si se selecciona un tipo, el navegador sólo pedirá autentificadores del tipo " -"seleccionado.
          Independientemente del tipo, sólo puedes iniciar sesión " -"con los mismos autentificadores que hayas registrado." - -#: wwa-profile-content.php:119 -msgid "Authenticator Identifier" -msgstr "Identificador del autentificador" - -#: wwa-profile-content.php:122 wwa-shortcodes.php:118 -msgid "" -"An easily identifiable name for the authenticator. DOES NOT " -"affect the authentication process in anyway." -msgstr "" -"Un nombre fácilmente identificable para el autentificador. NO afecta al proceso de autenticación de ninguna manera." - -#: wwa-profile-content.php:127 wwa-shortcodes.php:118 -msgid "Login without username" -msgstr "Iniciar sesión sin nombre de usuario" - -#: wwa-profile-content.php:132 wwa-shortcodes.php:118 -msgid "" -"If registered authenticator with this feature, you can login without enter " -"your username.
          Some authenticators like U2F-only authenticators and some " -"browsers DO NOT support this feature.
          A record will be " -"stored in the authenticator permanently untill you reset it." -msgstr "" -"Si se registra el autentificador con esta función, puede iniciar la sesión " -"sin introducir su nombre de usuario.
          Algunos autenticadores, como los " -"autenticadores sólo U2F, y algunos navegadores NO admiten " -"esta función.
          El registro se almacenará en el autentificador de forma " -"permanente hasta que lo restablezca." - -#: wwa-profile-content.php:138 -msgid "Start Registration" -msgstr "Iniciar el registro" - -#: wwa-profile-content.php:143 -msgid "" -"Click Test Login to verify that the registered authenticators are working." -msgstr "" -"Haga clic en Probar inicio de sesión para verificar que los autenticadores " -"registrados funcionan." - -#: wwa-profile-content.php:144 wwa-shortcodes.php:144 -msgid "Test Login" -msgstr "Prueba de inicio de sesión" - -#: wwa-profile-content.php:146 wwa-shortcodes.php:144 -msgid "Test Login (usernameless)" -msgstr "Prueba de inicio de sesión (sin nombre de usuario)" - -#: wwa-shortcodes.php:20 -msgid "Error: The username field is empty." -msgstr "Error: El campo del nombre de usuario está vacío." - -#: wwa-shortcodes.php:88 -msgid "Authenticate with password" -msgstr "Autenticación con contraseña" - -#: wwa-shortcodes.php:105 wwa-shortcodes.php:133 wwa-shortcodes.php:166 -msgid "You haven't logged in yet." -msgstr "Todavía no te has conectado." - -#: wwa-shortcodes.php:118 -msgid "Authenticator identifier" -msgstr "Identificador del autentificador" - -#: wwa-shortcodes.php:118 -msgid "Start registration" -msgstr "Iniciar la registración" diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-fr_FR.mo b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-fr_FR.mo deleted file mode 100644 index df03b55d..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-fr_FR.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-fr_FR.po b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-fr_FR.po deleted file mode 100644 index 77a724e0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-fr_FR.po +++ /dev/null @@ -1,524 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: wp-webauthn\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: 2021-04-19 21:12+0000\n" -"Last-Translator: \n" -"Language-Team: French (France)\n" -"Language: fr-FR\n" -"Plural-Forms: nplurals=2; plural=n > 1;\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Loco-Source-Locale: fr_FR\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:" -"1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;" -"esc_html_x:1,2c\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Generator: Loco https://localise.biz/\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" -"X-Loco-Parser: loco_parse_po" - -#. Plugin Name of the plugin -msgid "WP-WebAuthn" -msgstr "WP-WebAuthn" - -#. Plugin URI of the plugin -msgid "https://flyhigher.top" -msgstr "https://flyhigher.top" - -#. Description of the plugin -msgid "" -"WP-WebAuthn allows you to safely login to your WordPress site without " -"password." -msgstr "" -"WP-WebAuthn vous permet de vous connecter en toute sécurité à votre site " -"WordPress sans mot de passe." - -#. Author of the plugin -msgid "Axton" -msgstr "Axton" - -#. Author URI of the plugin -msgid "https://axton.cc" -msgstr "https://axton.cc" - -#: wwa-admin-content.php:4 -msgid "Initializing..." -msgstr "Initialisation…" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Please follow instructions to finish registration..." -msgstr "Veuillez suivre les instructions pour finir l’enregistrement" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgctxt "action" -msgid "Registered" -msgstr "Enregistré" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Registration failed" -msgstr "Échec de l’enregistrement" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Your browser does not support WebAuthn" -msgstr "Votre navigateur ne supporte pas Webauthn" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Registrating..." -msgstr "En cours d'enregistrement…" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Please enter the authenticator identifier" -msgstr "Veuiller saisir l’identifiant du périphérique" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Loading failed, maybe try refreshing?" -msgstr "Le chargement a échoué, essayez peut-être d’actualiser ?" - -#: wwa-admin-content.php:4, wwa-admin-content.php:168, wwa-shortcodes.php:4, -#: wwa-shortcodes.php:75 -msgid "Any" -msgstr "TOus" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Platform authenticator" -msgstr "Périphérique intégré (plateforme)" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Roaming authenticator" -msgstr "Périphérique détachable (roaming)" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Remove" -msgstr "Supprimer" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Please follow instructions to finish verification..." -msgstr "Veuillez suivre les instructions pour finir la vérification" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Verifying..." -msgstr "Vérification…" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Verification failed" -msgstr "Échec de la vérification" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Verification passed! You can now log in through WebAuthn" -msgstr "" -"Vérification réussie ! Vous pouvez vous connecter en utilisant Webauthn" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "No registered authenticators" -msgstr "Aucun périphériques enregistrés" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Confirm removal of authenticator: " -msgstr "Confirmez la suppression du périphérique" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Removing..." -msgstr "Suppression en cours…" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Rename" -msgstr "Renommer :" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Rename the authenticator" -msgstr "Renommer le périphérique" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Renaming..." -msgstr "En cours de renommage…" - -#: wwa-admin-content.php:4, wwa-admin-content.php:143 -msgid "Log count: " -msgstr "Compteur :" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "Ready" -msgstr "Prêt" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "No" -msgstr "Non" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid " (Unavailable)" -msgstr "(non disponible)" - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "The site administrator has disabled usernameless login feature." -msgstr "" -"L’administrateur du site a désactivé la fonctionnalité permettant les " -"connexions sans nom d’utilisateur." - -#: wwa-admin-content.php:4, wwa-shortcodes.php:4 -msgid "" -"After removing this authenticator, you will not be able to login with " -"WebAuthn" -msgstr "" -"Après la suppression de ce périphérique, vous ne pourrez plus vous connecter " -"en utilisant Webauthn" - -#: wwa-admin-content.php:10 -msgid "" -"PHP extension gmp doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"L’extension GMP pour PHP est introuvable. WP-WebAuthn risque de ne pas " -"fonctionner." - -#: wwa-admin-content.php:13 -msgid "" -"PHP extension mbstring doesn't seem to exist, rendering WP-WebAuthn unable " -"to function." -msgstr "" -"L’extension MBString pour PHP est introuvable. WP-WebAuthn risque de ne pas " -"fonctionner." - -#: wwa-admin-content.php:16 -msgid "" -"WebAuthn features are restricted to websites in secure contexts. Please make " -"sure your website is served over HTTPS or locally with localhost" -"." -msgstr "" -"Les fonctionnalités de WebAuthn sont limitées aux sites web dans des " -"contextes sécurisés. Veuillez vous assurer que votre site web est diffusé " -"via HTTPS ou localement avec localhost." - -#: wwa-admin-content.php:62 -msgid "Settings saved." -msgstr "Paramètres sauvegardés." - -#: wwa-admin-content.php:64 -msgid "Settings NOT saved." -msgstr "Paramètres NON sauvegardés" - -#: wwa-admin-content.php:79 -msgid "Preferred login method" -msgstr "Méthode de connexion préférée" - -#: wwa-admin-content.php:83 -msgid "WebAuthn" -msgstr "WebAuthn" - -#: wwa-admin-content.php:84 -msgid "Username + Password" -msgstr "Nom d’utilisateur + mot de passe" - -#: wwa-admin-content.php:85 -msgid "" -"Since WebAuthn hasn't been fully supported by all browsers, you can only " -"choose the preferred (default) login method and CANNOT completely " -"disable the traditional Username+Password method
          Regardless of " -"the preferred method, you will be able to switch to the other with a switch " -"button at the login page.
          When the browser does not support WebAuthn, " -"the login method will default to Username+Password." -msgstr "" -"Comme Webauthn n'est pas entièrement pris en charge par tous les navigateurs," -" vous ne pouvez choisir que la méthode de connexion préférée (par défaut) et " -"NE POUVEZ PAS désactiver complètement la méthode traditionnelle du " -"nom d'utilisateur + mot de passe
          Quelle que soit la méthode " -"préférée, vous pourra passer à l'autre avec un bouton de commutation sur la " -"page de connexion.
          Lorsque le navigateur ne prend pas en charge Webauthn, " -"la méthode de connexion sera par défaut le nom d’utilisateur + mot de passe." - -#: wwa-admin-content.php:90 -msgid "Website identifier" -msgstr "Identifiant du site web" - -#: wwa-admin-content.php:93 -msgid "" -"This identifier is for identification purpose only and DOES " -"NOT affect the authentication process in anyway." -msgstr "" -"Cet identifiant est utilisé seulement à des fins d'identification et " -"N’A PAS d'incidence sur le processus d’authentification." - -#: wwa-admin-content.php:97 -msgid "Website domain" -msgstr "Domaine du site web" - -#: wwa-admin-content.php:100 -msgid "" -"This field MUST be exactly the same with the current domain " -"or parent domain." -msgstr "" -"Ce champs DOIT être exactement le même que le nom de " -"domaine courant ou le nom de domaine racine." - -#: wwa-admin-content.php:104 -msgid "Require user verification" -msgstr "Vérification de l’utilisateur requise" - -#: wwa-admin-content.php:108, wwa-admin-content.php:124, -#: wwa-admin-content.php:140, wwa-admin-content.php:187, wwa-shortcodes.php:75 -msgid "Enable" -msgstr "Activer" - -#: wwa-admin-content.php:109, wwa-admin-content.php:125, -#: wwa-admin-content.php:141, wwa-admin-content.php:188, wwa-shortcodes.php:75 -msgid "Disable" -msgstr "Désactiver" - -#: wwa-admin-content.php:110 -msgid "" -"User verification can improve security, but is not fully supported by mobile " -"devices.
          If you cannot register or verify your authenticators, please " -"consider disabling user verification." -msgstr "" -"La vérification des utilisateurs peut améliorer la sécurité, mais n’est pas " -"entièrement prise en charge par certains périphériques.
          Si vous ne " -"parvenez pas à vous connecter, veuillez envisager de désactiver la " -"vérification des utilisateurs." - -#: wwa-admin-content.php:115 -msgid "Allow to login without username" -msgstr "Autoriser les connexion sans nom d’utilisateur" - -#: wwa-admin-content.php:126 -msgid "" -"Allow users to register authenticator with usernameless authentication " -"feature and login without username.
          User verification will be " -"enabled automatically when registering authenticator with usernameless " -"authentication feature.
          Some authenticators and some browsers " -"DO NOT support this feature." -msgstr "" -"Autoriser les utilisateurs à enregistrer un périphérique avec cette fonction " -"leur permettra de se connecter sans nom d'utilisateur.
          La " -"vérification de l'utilisateur sera activée automatiquement lors de " -"l'enregistrement du périphérique.
          Certains d’entre eux et " -"certains navigateurs NE SUPPORTENT PAS cette fonctionnalité." - -#: wwa-admin-content.php:131 -msgid "Logging" -msgstr "Enregistrement" - -#: wwa-admin-content.php:143 -msgid "Clear log" -msgstr "Effacer le registre" - -#: wwa-admin-content.php:145 -msgid "" -"For debugging only. Enable only when needed.
          Note: Logs may " -"contain sensitive information." -msgstr "" -"Pour le débogage uniquement. Activer lorsque cela est nécessaire.
          " -"Remarque : les registres peuvent contenir des informations sensibles." -"" - -#: wwa-admin-content.php:154 -msgid "Log" -msgstr "Registre" - -#: wwa-admin-content.php:156 -msgid "Automatic update every 5 seconds." -msgstr "Réactualiser automatiquement toutes les 5 secondes" - -#: wwa-admin-content.php:161 -msgid "Register Authenticator" -msgstr "Enregistrer un périphérique" - -#: wwa-admin-content.php:162 -msgid "" -"You are about to associate an authenticator with the current " -"account. You can register multiple authenticators for an account. " -"
          If you want to register authenticators for other users, please log in " -"using that account." -msgstr "" -"Vous êtes sur le point d’associer un périphérique au compte " -"actuel. Vous pouvez enregistrer plusieurs périphérique pour un même " -"compte.
          Si vous souhaitez enregistrer des périphériques pour d'autres " -"utilisateurs, veuillez vous connecter à l'aide de ce compte." - -#: wwa-admin-content.php:165, wwa-shortcodes.php:75 -msgid "Type of authenticator" -msgstr "Type de périphérique" - -#: wwa-admin-content.php:169, wwa-shortcodes.php:75 -msgid "Platform authenticator (e.g. a built-in fingerprint sensor) only" -msgstr "" -"Périphérique intégré seulement (par exemple un lecteur d’empreinte digitale)" - -#: wwa-admin-content.php:170, wwa-shortcodes.php:75 -msgid "Roaming authenticator (e.g., a USB security key) only" -msgstr "Périphérique détachable seulment (clé USB, Bluetooth…) " - -#: wwa-admin-content.php:172, wwa-shortcodes.php:75 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type.
          Regardless of the type, you can only log in with the " -"very same authenticators you've registered." -msgstr "" -"Si un type est sélectionné, le navigateur demandera uniquement les " -"périphériques du type sélectionné.
          Quel que soit le type, vous ne pouvez " -"vous connecter qu'avec les mêmes périphériques que vous avez enregistrés." - -#: wwa-admin-content.php:176, wwa-shortcodes.php:75 -msgid "Authenticator identifier" -msgstr "ID du périphérique" - -#: wwa-admin-content.php:179, wwa-shortcodes.php:75 -msgid "" -"An easily identifiable name for the authenticator. DOES NOT " -"affect the authentication process in anyway." -msgstr "" -"Un nom facilement identifiable pour le périphérique. Cela n’a " -"AUCUNE incidence sur le processus d'authentification." - -#: wwa-admin-content.php:184, wwa-shortcodes.php:75 -msgid "Login without username" -msgstr "Connexion sur nom d’utilisateur" - -#: wwa-admin-content.php:189, wwa-shortcodes.php:75 -msgid "" -"If registered authenticator with this feature, you can login without enter " -"your username.
          Some authenticators like U2F-only authenticators and some " -"browsers DO NOT support this feature.
          A record will be " -"stored in the authenticator permanently untill you reset it." -msgstr "" -"Si le périphérique est enregistré avec cette fonctionnalité, vous pouvez " -"vous connecter sans entrer votre nom d’utilisateur.
          Certains " -"périphériques tels que les anciens modèles FIDO-U2F et certains navigateurs " -"NE SONT PAS compatible avec cette fonctionnalité.
          Un " -"identifiant spécifique sera stocké dans le périphérique de façon permanente " -"jusqu'à ce que vous le réinitialisiez." - -#: wwa-admin-content.php:195, wwa-shortcodes.php:75 -msgid "Start registration" -msgstr "Débuter l’enregistrement" - -#: wwa-admin-content.php:196 -msgid "Authenticators currently registered" -msgstr "Périphériques actuellement enregistrés" - -#: wwa-admin-content.php:201, wwa-admin-content.php:216, -#: wwa-shortcodes.php:113, wwa-shortcodes.php:115 -msgid "Identifier" -msgstr "Identifiant" - -#: wwa-admin-content.php:202, wwa-admin-content.php:217, -#: wwa-shortcodes.php:113, wwa-shortcodes.php:115 -msgid "Type" -msgstr "Type" - -#: wwa-admin-content.php:203, wwa-admin-content.php:218, -#: wwa-shortcodes.php:113, wwa-shortcodes.php:115 -msgctxt "time" -msgid "Registered" -msgstr "Enregistré" - -#: wwa-admin-content.php:204, wwa-admin-content.php:219, -#: wwa-shortcodes.php:113, wwa-shortcodes.php:115 -msgid "Last used" -msgstr "Dernière utilisation" - -#: wwa-admin-content.php:205, wwa-admin-content.php:220, -#: wwa-shortcodes.php:113, wwa-shortcodes.php:115 -msgid "Usernameless" -msgstr "Sans nom d’utilisateur" - -#: wwa-admin-content.php:206, wwa-admin-content.php:221, -#: wwa-shortcodes.php:113, wwa-shortcodes.php:115 -msgid "Action" -msgstr "Action" - -#: wwa-admin-content.php:211, wwa-shortcodes.php:114 -msgid "Loading..." -msgstr "Chargement…" - -#: wwa-admin-content.php:228 -msgid "Verify registration" -msgstr "Vérifier l’enregistrement" - -#: wwa-admin-content.php:229 -msgid "Click verify to verify that the registered authenticators are working." -msgstr "Cliquez pour vérifier que les périphériques enregistrés fonctionnent." - -#: wwa-admin-content.php:230, wwa-shortcodes.php:101 -msgid "Verify" -msgstr "Vérifier" - -#: wwa-admin-content.php:232, wwa-shortcodes.php:101 -msgid "Verify (usernameless)" -msgstr "Vérifier (sans nom d’utilisateur)" - -#: wwa-functions.php:120, wwa-shortcodes.php:46 -msgid "Auth" -msgstr "Connexion" - -#: wwa-functions.php:120, wwa-shortcodes.php:4, wwa-shortcodes.php:43, -#: wwa-shortcodes.php:46 -msgid "Authenticate with WebAuthn" -msgstr "Authentification avec Webauthn" - -#: wwa-functions.php:120, wwa-shortcodes.php:4 -msgid "Hold on..." -msgstr "Un instant…" - -#: wwa-functions.php:120, wwa-shortcodes.php:4 -msgid "Please proceed..." -msgstr "Veuillez continuer…" - -#: wwa-functions.php:120, wwa-shortcodes.php:4 -msgid "Authenticating..." -msgstr "Authentification…" - -#: wwa-functions.php:120, wwa-shortcodes.php:4 -msgid "Authenticated" -msgstr "Authentifié" - -#: wwa-functions.php:120, wwa-shortcodes.php:4 -msgid "Auth failed" -msgstr "Échec d’authentification" - -#: wwa-functions.php:120, wwa-shortcodes.php:46 -msgid "Username" -msgstr "Nom d’utilisateur" - -#: wwa-functions.php:120 -msgid "Username or Email Address" -msgstr "Nom d’utilisateur ou adresse email" - -#: wwa-functions.php:120 -msgid "Error: The username field is empty." -msgstr "Erreur: Le nom d’utilisateur est vide." - -#: wwa-functions.php:120, wwa-shortcodes.php:4 -msgid "Try to enter the username" -msgstr "Essayez de saisir le nom d’utilisateur" - -#: wwa-functions.php:137 -msgid "Settings" -msgstr "Paramètres" - -#: wwa-functions.php:145 -msgid "GitHub" -msgstr "GitHub" - -#: wwa-functions.php:146 -msgid "Documentation" -msgstr "Documentation" - -#: wwa-shortcodes.php:4 -msgid "Error: The username field is empty." -msgstr "Erreur : le nom d’utilisateur est vide" - -#: wwa-shortcodes.php:46 -msgid "Authenticate with password" -msgstr "Authentification avec mot de passe" - -#: wwa-shortcodes.php:63, wwa-shortcodes.php:90 -msgid "You haven't logged in yet." -msgstr "Vous n'êtes pas encore connecté·e." - -#: wwa-shortcodes.php:123 -msgid "You haven't logged in yet" -msgstr "Vous n'êtes pas encore connecté·e." diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-it_IT.mo b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-it_IT.mo deleted file mode 100644 index 634b6761..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-it_IT.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-it_IT.po b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-it_IT.po deleted file mode 100644 index ee2ed1ff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-it_IT.po +++ /dev/null @@ -1,695 +0,0 @@ -# Copyright (C) 2022 Axton -# This file is distributed under the same license as the WP-WebAuthn plugin. -msgid "" -msgstr "" -"Project-Id-Version: WP-WebAuthn 1.2.8\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-webauthn\n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: it_IT\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;" -"_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;" -"esc_html_e;esc_html_x:1,2c\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Domain: wp-webauthn\n" -"X-Generator: Poedit 3.0.1\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" - -#. Plugin Name of the plugin -msgid "WP-WebAuthn" -msgstr "WP-WebAuthn" - -#. Plugin URI of the plugin -msgid "https://flyhigher.top" -msgstr "https://flyhigher.top" - -#. Description of the plugin -msgid "" -"WP-WebAuthn allows you to safely login to your WordPress site without " -"password." -msgstr "" -"WP-WebAuthn ti permette di accedere in modo sicuro al tuo sito WordPress " -"senza password." - -#. Author of the plugin -msgid "Axton" -msgstr "Axton" - -#. Author URI of the plugin -msgid "https://axton.cc" -msgstr "https://axton.cc" - -#: wwa-admin-content.php:6 -msgid "" -"User verification is disabled by default because some mobile devices do not " -"support it (especially on Android devices). But we recommend you to " -"enable it if possible to further secure your login." -msgstr "" -"La verifica dell’utente è disattivata per impostazione predefinita perché " -"alcuni dispositivi mobili non la supportano (soprattutto quelli Android). " -"Tuttavia, vi consigliamo di attivarla, se possibile, per " -"rendere più sicuro il vostro accesso." - -#: wwa-admin-content.php:7 wwa-admin-content.php:245 -msgid "Log count: " -msgstr "Conteggio dei log: " - -#: wwa-admin-content.php:8 wwa-profile-content.php:14 wwa-shortcodes.php:26 -msgid "Loading failed, maybe try refreshing?" -msgstr "Caricamento fallito, provare ad aggiornare la scheda?" - -#: wwa-admin-content.php:16 -msgid "" -"PHP extension gmp doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"L’estensione PHP gmp non sembra esistere, rendendo WP-WebAuthn incapace di " -"funzionare." - -#: wwa-admin-content.php:20 -msgid "" -"PHP extension mbstring doesn't seem to exist, rendering WP-WebAuthn unable " -"to function." -msgstr "" -"L’estensione PHP mbstring non sembra esistere, rendendo WP-WebAuthn incapace " -"di funzionare." - -#: wwa-admin-content.php:24 -msgid "" -"PHP extension sodium doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"L’estensione PHP sodium non sembra esistere, rendendo WP-WebAuthn incapace " -"di funzionare." - -#: wwa-admin-content.php:28 -msgid "" -"WebAuthn features are restricted to websites in secure contexts. Please make " -"sure your website is served over HTTPS or locally with localhost." -msgstr "" -"Le funzioni di WebAuthn sono limitate ai siti web in contesti sicuri. " -"Assicuratevi che il vostro sito web sia servito tramite HTTPS o localmente " -"con localhost." - -#: wwa-admin-content.php:104 -msgid "Settings saved." -msgstr "Impostazioni salvate." - -#: wwa-admin-content.php:106 -msgid "Settings NOT saved." -msgstr "Impostazioni NON salvate." - -#: wwa-admin-content.php:121 -msgid "Preferred login method" -msgstr "Metodo di login preferito" - -#: wwa-admin-content.php:125 -msgid "Prefer WebAuthn" -msgstr "Preferire WebAuthn" - -#: wwa-admin-content.php:126 -msgid "Prefer password" -msgstr "Preferire la password" - -#: wwa-admin-content.php:127 wwa-profile-content.php:56 -msgid "WebAuthn Only" -msgstr "Solo WebAuthn" - -#: wwa-admin-content.php:129 -msgid "" -"When using \"WebAuthn Only\", password login will be completely disabled. " -"Please make sure your browser supports WebAuthn, otherwise you may unable to " -"login.
          User that doesn't have any registered authenticator (e.g. new " -"user) will unable to login when using \"WebAuthn Only\".
          When the browser " -"does not support WebAuthn, the login method will default to password if " -"password login is not disabled." -msgstr "" -"Quando si utilizza “Solo WebAuthn”, il login con password sarà completamente " -"disabilitato. Assicuratevi che il vostro browser supporti WebAuthn, " -"altrimenti potreste non riuscire ad accedere.
          Gli utenti che non hanno un " -"autenticatore registrato (ad esempio i nuovi utenti) non potranno accedere " -"quando si utilizza “Solo WebAuthn”.
          Se il browser non supporta WebAuthn, " -"il metodo di accesso verrà impostato di default sulla password se il login " -"con password non è disabilitato." - -#: wwa-admin-content.php:133 -msgid "Website identifier" -msgstr "Identificatore del sito web" - -#: wwa-admin-content.php:136 -msgid "" -"This identifier is for identification purpose only and DOES NOT affect the authentication process in anyway." -msgstr "" -"Questo identificatore serve solo per l’identificazione e NON influisce in alcun modo sul processo di autenticazione." - -#: wwa-admin-content.php:140 -msgid "Website domain" -msgstr "Dominio del sito web" - -#: wwa-admin-content.php:143 -msgid "" -"This field MUST be exactly the same with the current domain " -"or parent domain." -msgstr "" -"Questo campo DEVE essere esattamente lo stesso del dominio " -"corrente o del dominio principale." - -#: wwa-admin-content.php:150 -msgid "Allow to remember login" -msgstr "Consentire di ricordare il login" - -#: wwa-admin-content.php:159 wwa-admin-content.php:170 -#: wwa-admin-content.php:186 wwa-admin-content.php:242 -#: wwa-profile-content.php:130 wwa-shortcodes.php:118 -msgid "Enable" -msgstr "Attiva" - -#: wwa-admin-content.php:160 wwa-admin-content.php:171 -#: wwa-admin-content.php:187 wwa-admin-content.php:243 -#: wwa-profile-content.php:131 wwa-shortcodes.php:118 -msgid "Disable" -msgstr "Disattiva" - -#: wwa-admin-content.php:161 -msgid "" -"Show the 'Remember Me' checkbox beside the login form when using WebAuthn." -msgstr "" -"Mostra la casella di controllo “Ricordami” accanto al modulo di accesso " -"quando si utilizza WebAuthn." - -#: wwa-admin-content.php:166 -msgid "Require user verification" -msgstr "Richiedere la verifica dell’utente" - -#: wwa-admin-content.php:172 -msgid "" -"User verification can improve security, but is not fully supported by mobile " -"devices.
          If you cannot register or verify your authenticators, please " -"consider disabling user verification." -msgstr "" -"La verifica dell’utente può migliorare la sicurezza, ma non è completamente " -"supportata dai dispositivi mobili.
          Se non è possibile registrare o " -"verificare gli autenticatori, si consiglia di disattivare la verifica utente." - -#: wwa-admin-content.php:177 -msgid "Allow to login without username" -msgstr "Consentire il login senza nome utente" - -#: wwa-admin-content.php:188 -msgid "" -"Allow users to register authenticator with usernameless authentication " -"feature and login without username.
          User verification will be " -"enabled automatically when authenticating with usernameless authentication " -"feature.
          Some authenticators and some browsers DO NOT support this feature." -msgstr "" -"Consentire agli utenti di registrare l’autenticatore con la funzione di " -"autenticazione senza nome utente e di accedere senza nome utente." -"
          La verifica dell’utente viene attivata automaticamente quando ci " -"si autentica con la funzione di autenticazione senza nome.
          Alcuni autenticatori e alcuni browser NON " -"supportano questa funzione." - -#: wwa-admin-content.php:193 -msgid "Allow a specific type of authenticator" -msgstr "Consentire un tipo specifico di autenticatore" - -#: wwa-admin-content.php:202 wwa-profile-content.php:15 -#: wwa-profile-content.php:111 wwa-shortcodes.php:33 wwa-shortcodes.php:118 -msgid "Any" -msgstr "Qualsiasi" - -#: wwa-admin-content.php:203 wwa-profile-content.php:112 wwa-shortcodes.php:118 -msgid "Platform (e.g. built-in fingerprint sensors)" -msgstr "Piattaforma (ad es. sensori di impronte digitali integrati)" - -#: wwa-admin-content.php:204 wwa-profile-content.php:113 wwa-shortcodes.php:118 -msgid "Roaming (e.g. USB security keys)" -msgstr "Roaming (ad es. chiavi di sicurezza USB)" - -#: wwa-admin-content.php:206 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type when authenticating and user can only register authenticators " -"of selected type." -msgstr "" -"Se si seleziona un tipo, il browser richiederà solo gli autenticatori del " -"tipo selezionato durante l’autenticazione e l’utente potrà registrare solo " -"gli autenticatori del tipo selezionato." - -#: wwa-admin-content.php:213 -msgid "After User Registration" -msgstr "Dopo la registrazione dell’utente" - -#: wwa-admin-content.php:222 -msgid "No action" -msgstr "Nessuna azione" - -#: wwa-admin-content.php:223 -msgid "Log user in immediately" -msgstr "Accesso immediato dell’utente" - -#: wwa-admin-content.php:224 -msgid "Redirect to WP-WebAuthn guide page" -msgstr "Reindirizzamento alla pagina della guida di WP-WebAuthn" - -#: wwa-admin-content.php:226 -msgid "" -"What to do when a new user registered. Useful when \"WebAuthn Only\" is " -"enabled." -msgstr "" -"Cosa fare quando si registra un nuovo utente. Utile quando è abilitato “Solo " -"WebAuthn”." - -#: wwa-admin-content.php:233 -msgid "Logging" -msgstr "Logging" - -#: wwa-admin-content.php:245 -msgid "Clear log" -msgstr "Cancella registro" - -#: wwa-admin-content.php:247 -msgid "" -"For debugging only. Enable only when needed.
          Note: Logs may " -"contain sensitive information." -msgstr "" -"Solo per il debug. Abilitare solo se necessario.
          Nota: I registri " -"possono contenere informazioni sensibili." - -#: wwa-admin-content.php:256 -msgid "Log" -msgstr "Log" - -#: wwa-admin-content.php:258 -msgid "Automatic update every 5 seconds." -msgstr "Aggiornamento automatico ogni 5 secondi." - -#: wwa-admin-content.php:262 -msgid "" -"To register a new authenticator or edit your authenticators, please go to your profile." -msgstr "" -"Per registrare un nuovo autenticatore o modificare i propri autenticatori, " -"accedere a il proprio profilo." - -#: wwa-functions.php:148 wwa-shortcodes.php:88 -msgid "Auth" -msgstr "Autorizzazione" - -#: wwa-functions.php:149 wwa-shortcodes.php:11 wwa-shortcodes.php:85 -#: wwa-shortcodes.php:88 -msgid "Authenticate with WebAuthn" -msgstr "Autenticare con WebAuthn" - -#: wwa-functions.php:150 wwa-shortcodes.php:12 -msgid "Hold on..." -msgstr "Un attimo…" - -#: wwa-functions.php:151 wwa-shortcodes.php:13 -msgid "Please proceed..." -msgstr "Si prega di procedere…" - -#: wwa-functions.php:152 wwa-shortcodes.php:14 -msgid "Authenticating..." -msgstr "Autenticazione…" - -#: wwa-functions.php:153 wwa-shortcodes.php:15 -msgid "Authenticated" -msgstr "Autenticato" - -#: wwa-functions.php:154 wwa-shortcodes.php:16 -msgid "Auth failed" -msgstr "Autorizzazione non riuscita" - -#: wwa-functions.php:155 -msgid "" -"It looks like your browser doesn't support WebAuthn, which means you may " -"unable to login." -msgstr "" -"Sembra che il vostro browser non supporti WebAuthn, il che significa che " -"potreste non riuscire ad accedere." - -#: wwa-functions.php:156 wwa-shortcodes.php:88 -msgid "Username" -msgstr "Nome utente" - -#: wwa-functions.php:158 -msgid "Error: The username field is empty." -msgstr "Errore: il campo nome utente è vuoto." - -#: wwa-functions.php:159 wwa-shortcodes.php:42 -msgid "Try to enter the username" -msgstr "Provare a inserire il nome utente" - -#: wwa-functions.php:174 -msgid "Logging in with password has been disabled by the site manager." -msgstr "Il login con password è stato disabilitato dal gestore del sito." - -#: wwa-functions.php:180 -msgid "Logging in with password has been disabled for this account." -msgstr "L’accesso con password è stato disabilitato per questo account." - -#: wwa-functions.php:218 -msgid "" -"Logging in with password has been disabled for %s but you haven't register " -"any WebAuthn authenticator yet. You may unable to login again once you log " -"out. Register" -msgstr "" -"L’accesso con password è stato disabilitato, ma non è stato ancora " -"registrato alcun autenticatore WebAuthn. È possibile che non si riesca ad " -"accedere nuovamente una volta effettuato il logout. Registrazione" - -#: wwa-functions.php:218 wwa-functions.php:263 -msgid "the site" -msgstr "il sito" - -#: wwa-functions.php:218 -msgid "your account" -msgstr "il tuo account" - -#: wwa-functions.php:263 -msgid "" -"Logging in with password has been disabled for %s but this account haven't register any WebAuthn authenticator yet. This user may " -"unable to login." -msgstr "" -"Il login con password è stato disabilitato per %s ma questo account non ha ancora registrato alcun autenticatore WebAuthn. Questo utente " -"potrebbe non essere in grado di effettuare il login." - -#: wwa-functions.php:263 -msgid "this account" -msgstr "questo account" - -#: wwa-functions.php:291 -msgid "Settings" -msgstr "Impostazioni" - -#: wwa-functions.php:299 -msgid "GitHub" -msgstr "GitHub" - -#: wwa-functions.php:300 -msgid "Documentation" -msgstr "Documentazione" - -#: wwa-profile-content.php:7 -msgid "Initializing..." -msgstr "Inizializzazione…" - -#: wwa-profile-content.php:8 wwa-shortcodes.php:37 -msgid "Please follow instructions to finish registration..." -msgstr "Seguire le istruzioni per completare la registrazione…" - -#: wwa-profile-content.php:9 wwa-shortcodes.php:38 -msgctxt "action" -msgid "Registered" -msgstr "Registrato" - -#: wwa-profile-content.php:10 wwa-shortcodes.php:39 -msgid "Registration failed" -msgstr "Registrazione fallita" - -#: wwa-profile-content.php:11 wwa-shortcodes.php:40 -msgid "Your browser does not support WebAuthn" -msgstr "Il vostro browser non supporta WebAuthn" - -#: wwa-profile-content.php:12 wwa-shortcodes.php:41 -msgid "Registrating..." -msgstr "Registrazione…" - -#: wwa-profile-content.php:13 wwa-shortcodes.php:21 -msgid "Please enter the authenticator identifier" -msgstr "Inserire l’identificativo dell’autenticatore" - -#: wwa-profile-content.php:16 wwa-shortcodes.php:34 -msgid "Platform authenticator" -msgstr "Autenticatore di piattaforma" - -#: wwa-profile-content.php:17 wwa-shortcodes.php:35 -msgid "Roaming authenticator" -msgstr "Autenticatore di roaming" - -#: wwa-profile-content.php:18 wwa-shortcodes.php:36 -msgid "Remove" -msgstr "Rimuovi" - -#: wwa-profile-content.php:19 wwa-shortcodes.php:22 -msgid "Please follow instructions to finish verification..." -msgstr "Seguire le istruzioni per completare la verifica…" - -#: wwa-profile-content.php:20 wwa-shortcodes.php:23 -msgid "Verifying..." -msgstr "Verificazione…" - -#: wwa-profile-content.php:21 wwa-shortcodes.php:24 -msgid "Verification failed" -msgstr "Verificazione fallita" - -#: wwa-profile-content.php:22 wwa-shortcodes.php:25 -msgid "Verification passed! You can now log in through WebAuthn" -msgstr "" -"Verifica approvata! Ora è possibile effettuare l’accesso tramite WebAuthn" - -#: wwa-profile-content.php:23 wwa-shortcodes.php:32 -msgid "No registered authenticators" -msgstr "Nessun autenticatore registrato" - -#: wwa-profile-content.php:24 wwa-shortcodes.php:27 -msgid "Confirm removal of authenticator: " -msgstr "Confermare la rimozione dell’autenticatore: " - -#: wwa-profile-content.php:25 wwa-shortcodes.php:28 -msgid "Removing..." -msgstr "Rimozione…" - -#: wwa-profile-content.php:26 wwa-shortcodes.php:29 -msgid "Rename" -msgstr "Rinonima" - -#: wwa-profile-content.php:27 wwa-shortcodes.php:30 -msgid "Rename the authenticator" -msgstr "Rinominare l’autenticatore" - -#: wwa-profile-content.php:28 wwa-shortcodes.php:31 -msgid "Renaming..." -msgstr "Rinominando…" - -#: wwa-profile-content.php:29 wwa-shortcodes.php:10 -msgid "Ready" -msgstr "Pronto" - -#: wwa-profile-content.php:30 wwa-shortcodes.php:17 -msgid "No" -msgstr "No" - -#: wwa-profile-content.php:31 wwa-shortcodes.php:18 -msgid " (Unavailable)" -msgstr " (Non disponibile)" - -#: wwa-profile-content.php:32 wwa-shortcodes.php:19 -msgid "The site administrator has disabled usernameless login feature." -msgstr "" -"L’amministratore del sito ha disattivato la funzione di accesso senza nome." - -#: wwa-profile-content.php:33 wwa-shortcodes.php:43 -msgid "" -"After removing this authenticator, you will not be able to login with " -"WebAuthn" -msgstr "" -"Dopo aver rimosso l’autenticatore, non sarà più possibile effettuare il " -"login con WebAuthn" - -#: wwa-profile-content.php:34 wwa-shortcodes.php:44 -msgid " (Disabled)" -msgstr " (Disabilitato)" - -#: wwa-profile-content.php:35 wwa-shortcodes.php:45 -msgid "The site administrator only allow platform authenticators currently." -msgstr "" -"Attualmente l’amministratore del sito consente solo autenticatori di " -"piattaforma." - -#: wwa-profile-content.php:36 wwa-shortcodes.php:46 -msgid "The site administrator only allow roaming authenticators currently." -msgstr "" -"Attualmente l’amministratore del sito consente solo gli autenticatori in " -"roaming." - -#: wwa-profile-content.php:50 -msgid "" -"This site is not correctly configured to use WebAuthn. Please contact the " -"site administrator." -msgstr "" -"Questo sito non è configurato correttamente per utilizzare WebAuthn. " -"Contattare l’amministratore del sito." - -#: wwa-profile-content.php:60 -msgid "Disable password login for this account" -msgstr "Disabilita l’accesso con password per questo account" - -#: wwa-profile-content.php:62 -msgid "" -"When checked, password login will be completely disabled. Please make sure " -"your browser supports WebAuthn and you have a registered authenticator, " -"otherwise you may unable to login." -msgstr "" -"Quando è selezionata, la password di accesso sarà completamente " -"disabilitata. Assicuratevi che il vostro browser supporti WebAuthn e che " -"abbiate un autenticatore registrato, altrimenti potreste non riuscire ad " -"accedere." - -#: wwa-profile-content.php:62 -msgid "The site administrator has disabled password login for the whole site." -msgstr "" -"L’amministratore del sito ha disabilitato il login con password per l’intero " -"sito." - -#: wwa-profile-content.php:66 -msgid "Registered WebAuthn Authenticators" -msgstr "Autenticatori WebAuthn registrati" - -#: wwa-profile-content.php:71 wwa-profile-content.php:86 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Identifier" -msgstr "Identificatore" - -#: wwa-profile-content.php:72 wwa-profile-content.php:87 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Type" -msgstr "Tipo" - -#: wwa-profile-content.php:73 wwa-profile-content.php:88 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgctxt "time" -msgid "Registered" -msgstr "Registrato" - -#: wwa-profile-content.php:74 wwa-profile-content.php:89 -msgid "Last used" -msgstr "Ultimo utilizzo" - -#: wwa-profile-content.php:75 wwa-profile-content.php:90 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Usernameless" -msgstr "Senza nome utente" - -#: wwa-profile-content.php:76 wwa-profile-content.php:91 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Action" -msgstr "Azione" - -#: wwa-profile-content.php:81 wwa-shortcodes.php:157 -msgid "Loading..." -msgstr "Caricamento in corso…" - -#: wwa-profile-content.php:98 wwa-profile-content.php:101 -msgid "Register New Authenticator" -msgstr "Registrazione di un nuovo autenticatore" - -#: wwa-profile-content.php:98 wwa-profile-content.php:142 -msgid "Verify Authenticator" -msgstr "Verificare l’autenticatore" - -#: wwa-profile-content.php:102 -msgid "" -"You are about to associate an authenticator with the current account " -"%s.
          You can register multiple authenticators for an account." -msgstr "" -"Si sta per associare un autenticatore all’account corrente %s.
          È possibile registrare più autenticatori per un account." - -#: wwa-profile-content.php:105 wwa-shortcodes.php:118 -msgid "Type of authenticator" -msgstr "Tipo di autenticatore" - -#: wwa-profile-content.php:115 wwa-shortcodes.php:118 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type.
          Regardless of the type, you can only log in with the " -"very same authenticators you've registered." -msgstr "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type.
          Indipendentemente dal tipo, è possibile accedere solo " -"con gli stessi autenticatori registrati." - -#: wwa-profile-content.php:119 -msgid "Authenticator Identifier" -msgstr "Identificatore dell’autenticatore" - -#: wwa-profile-content.php:122 wwa-shortcodes.php:118 -msgid "" -"An easily identifiable name for the authenticator. DOES NOT " -"affect the authentication process in anyway." -msgstr "" -"An easily identifiable name for the authenticator. NON " -"influisce in alcun modo sul processo di autenticazione." - -#: wwa-profile-content.php:127 wwa-shortcodes.php:118 -msgid "Login without username" -msgstr "Accesso senza nome utente" - -#: wwa-profile-content.php:132 wwa-shortcodes.php:118 -msgid "" -"If registered authenticator with this feature, you can login without enter " -"your username.
          Some authenticators like U2F-only authenticators and some " -"browsers DO NOT support this feature.
          A record will be " -"stored in the authenticator permanently untill you reset it." -msgstr "" -"If registered authenticator with this feature, you can login without enter " -"your username.
          Alcuni autenticatori, come gli autenticatori solo U2F e " -"alcuni browser, NON supportano questa funzione.
          Un " -"record sarà memorizzato nell’autenticatore in modo permanente fino a quando " -"non lo si resetta." - -#: wwa-profile-content.php:138 -msgid "Start Registration" -msgstr "Inizia registrazione" - -#: wwa-profile-content.php:143 -msgid "" -"Click Test Login to verify that the registered authenticators are working." -msgstr "" -"Fare clic su Prova accesso per verificare che gli autenticatori registrati " -"funzionino." - -#: wwa-profile-content.php:144 wwa-shortcodes.php:144 -msgid "Test Login" -msgstr "Test di accesso" - -#: wwa-profile-content.php:146 wwa-shortcodes.php:144 -msgid "Test Login (usernameless)" -msgstr "Test di accesso (senza nome utente)" - -#: wwa-shortcodes.php:20 -msgid "Error: The username field is empty." -msgstr "Errore: Il campo nome utente è vuoto." - -#: wwa-shortcodes.php:88 -msgid "Authenticate with password" -msgstr "Autenticazione con password" - -#: wwa-shortcodes.php:105 wwa-shortcodes.php:133 wwa-shortcodes.php:166 -msgid "You haven't logged in yet." -msgstr "Non hai ancora effettuato il login." - -#: wwa-shortcodes.php:118 -msgid "Authenticator identifier" -msgstr "Identificatore dell’autenticatore" - -#: wwa-shortcodes.php:118 -msgid "Start registration" -msgstr "Avviare la registrazione" diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-tr_TR.mo b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-tr_TR.mo deleted file mode 100644 index d1155458..00000000 Binary files a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-tr_TR.mo and /dev/null differ diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-tr_TR.po b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-tr_TR.po deleted file mode 100644 index 2fd528a4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/languages/wp-webauthn-tr_TR.po +++ /dev/null @@ -1,644 +0,0 @@ -# Copyright (C) 2021 Axton -# This file is distributed under the same license as the WP-WebAuthn plugin. -msgid "" -msgstr "" -"Project-Id-Version: WP-WebAuthn\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-webauthn\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;" -"_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;" -"esc_html_e;esc_html_x:1,2c\n" -"X-Poedit-SourceCharset: UTF-8\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"X-Generator: Poedit 2.4.2\n" -"Last-Translator: \n" -"Language: tr_TR\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" - -#. Plugin Name of the plugin -msgid "WP-WebAuthn" -msgstr "WP-WebAuthn" - -#. Plugin URI of the plugin -msgid "https://flyhigher.top" -msgstr "https://flyhigher.top" - -#. Description of the plugin -msgid "" -"WP-WebAuthn allows you to safely login to your WordPress site without " -"password." -msgstr "" -"WP-WebAuthn, WordPress sitenize şifre olmadan güvenle giriş yapmanızı sağlar." - -#. Author of the plugin -msgid "Axton" -msgstr "Axton" - -#. Author URI of the plugin -msgid "https://axton.cc" -msgstr "https://axton.cc" - -#: wwa-admin-content.php:6 wwa-admin-content.php:202 -msgid "Log count: " -msgstr "Günlük sayısı: " - -#: wwa-admin-content.php:14 -msgid "" -"PHP extension gmp doesn't seem to exist, rendering WP-WebAuthn unable to " -"function." -msgstr "" -"PHP uzantısı gmp yok gibi görünüyor ve WP-WebAuthn işlevini yerine " -"getiremiyor." - -#: wwa-admin-content.php:18 -msgid "" -"PHP extension mbstring doesn't seem to exist, rendering WP-WebAuthn unable " -"to function." -msgstr "" -"PHP uzantısı mbstring mevcut görünmüyor ve WP-WebAuthn işlevini yerine " -"getiremiyor." - -#: wwa-admin-content.php:22 -msgid "" -"WebAuthn features are restricted to websites in secure contexts. Please make " -"sure your website is served over HTTPS or locally with localhost." -msgstr "" -"WebAuthn özellikleri, güvenli bağlamlardaki web siteleriyle sınırlıdır. " -"Lütfen web sitenizin HTTPS üzerinden veya yerel olarak localhost ile sunulduğundan emin olun." - -#: wwa-admin-content.php:87 -msgid "Settings saved." -msgstr "Ayarlar kaydedildi." - -#: wwa-admin-content.php:89 -msgid "Settings NOT saved." -msgstr "Ayarlar KAYDEDİLMEDİ." - -#: wwa-admin-content.php:104 -msgid "Preferred login method" -msgstr "Tercih edilen oturum açma yöntemi" - -#: wwa-admin-content.php:108 -msgid "Prefer WebAuthn" -msgstr "WebAuthn'u Tercih Et" - -#: wwa-admin-content.php:109 -msgid "Prefer password" -msgstr "Şifre tercih et" - -#: wwa-admin-content.php:110 wwa-profile-content.php:56 -msgid "WebAuthn Only" -msgstr "Yalnızca WebAuthn" - -#: wwa-admin-content.php:112 -msgid "" -"When using \"WebAuthn Only\", password login will be completely disabled. " -"Please make sure your browser supports WebAuthn, otherwise you may unable to " -"login.
          User that doesn't have any registered authenticator (e.g. new " -"user) will unable to login when using \"WebAuthn Only\".
          When the browser " -"does not support WebAuthn, the login method will default to password if " -"password login is not disabled." -msgstr "" -"\"Yalnızca WebAuthn\" kullanılırken, şifre girişi tamamen devre dışı " -"bırakılacaktır. Lütfen tarayıcınızın WebAuthn'u desteklediğinden emin olun, " -"aksi takdirde oturum açamayabilirsiniz.
          Kayıtlı bir kimlik " -"doğrulayıcısı olmayan kullanıcılar (ör. Yeni kullanıcı) \"Yalnızca WebAuthn" -"\" kullanırken oturum açamaz.
          Tarayıcı yaptığında WebAuthn'u " -"desteklemezse, parola ile oturum açma devre dışı bırakılmamışsa oturum açma " -"yöntemi varsayılan olarak parola olacaktır." - -#: wwa-admin-content.php:116 -msgid "Website identifier" -msgstr "Web sitesi tanımlayıcı" - -#: wwa-admin-content.php:119 -msgid "" -"This identifier is for identification purpose only and DOES NOT affect the authentication process in anyway." -msgstr "" -"Bu tanımlayıcı yalnızca tanımlama amaçlıdır ve kimlik doğrulama sürecini " -"hiçbir şekilde ETKİLEMEZ." - -#: wwa-admin-content.php:123 -msgid "Website domain" -msgstr "Web sitesi domaini" - -#: wwa-admin-content.php:126 -msgid "" -"This field MUST be exactly the same with the current domain " -"or parent domain." -msgstr "" -"Bu alan, mevcut alan adı veya üst alan adı ile tam olarak aynı " -"OLMALIDIR." - -#: wwa-admin-content.php:130 -msgid "Allow to remember login" -msgstr "Girişin hatırlanmasına izin ver" - -#: wwa-admin-content.php:139 wwa-admin-content.php:150 -#: wwa-admin-content.php:183 wwa-admin-content.php:199 -#: wwa-profile-content.php:130 wwa-shortcodes.php:118 -msgid "Enable" -msgstr "Etkinleştir" - -#: wwa-admin-content.php:140 wwa-admin-content.php:151 -#: wwa-admin-content.php:184 wwa-admin-content.php:200 -#: wwa-profile-content.php:131 wwa-shortcodes.php:118 -msgid "Disable" -msgstr "Devredışı Bırak" - -#: wwa-admin-content.php:141 -msgid "" -"Show the 'Remember Me' checkbox beside the login form when using WebAuthn." -msgstr "" -"WebAuthn'u kullanırken giriş formunun yanında 'Beni Hatırla' onay kutusunu " -"gösterin." - -#: wwa-admin-content.php:146 -msgid "Require user verification" -msgstr "Kullanıcı doğrulaması gerektir" - -#: wwa-admin-content.php:152 -msgid "" -"User verification can improve security, but is not fully supported by mobile " -"devices.
          If you cannot register or verify your authenticators, please " -"consider disabling user verification." -msgstr "" -"Kullanıcı doğrulama, güvenliği artırabilir, ancak mobil cihazlar tarafından " -"tam olarak desteklenmemektedir.
          Doğrulayıcılarınızı kaydedemiyor veya " -"doğrulayamıyorsanız, lütfen kullanıcı doğrulamasını devre dışı bırakmayı " -"düşünün." - -#: wwa-admin-content.php:157 -msgid "Allow a specific type of authenticator" -msgstr "Belirli bir kimlik doğrulayıcı türüne izin ver" - -#: wwa-admin-content.php:166 wwa-profile-content.php:15 -#: wwa-profile-content.php:111 wwa-shortcodes.php:33 wwa-shortcodes.php:118 -msgid "Any" -msgstr "Herhangi" - -#: wwa-admin-content.php:167 wwa-profile-content.php:112 wwa-shortcodes.php:118 -msgid "Platform (e.g. built-in fingerprint sensors)" -msgstr "Platform (ör. Yerleşik parmak izi sensörleri)" - -#: wwa-admin-content.php:168 wwa-profile-content.php:113 wwa-shortcodes.php:118 -msgid "Roaming (e.g. USB security keys)" -msgstr "Mobil (ör. USB güvenlik anahtarları)" - -#: wwa-admin-content.php:170 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type when authenticating and user can only register authenticators " -"of selected type." -msgstr "" -"Bir tür seçilirse, tarayıcı kimlik doğrulama sırasında yalnızca seçilen " -"türdeki kimlik doğrulayıcıları ister ve kullanıcı yalnızca seçilen türdeki " -"kimlik doğrulayıcıları kaydedebilir." - -#: wwa-admin-content.php:174 -msgid "Allow to login without username" -msgstr "Kullanıcı adı olmadan giriş yapmaya izin ver" - -#: wwa-admin-content.php:185 -msgid "" -"Allow users to register authenticator with usernameless authentication " -"feature and login without username.
          User verification will be " -"enabled automatically when authenticating with usernameless authentication " -"feature.
          Some authenticators and some browsers DO NOT support this feature." -msgstr "" -"Kullanıcıların, kimlik doğrulayıcısını gereksiz kimlik doğrulama özelliği " -"ile kaydetmesine ve kullanıcı adı olmadan oturum açmasına izin verin.
          " -" Kullanılmayan kimlik doğrulama özelliği ile kimlik doğrulaması " -"yapılırken kullanıcı doğrulama otomatik olarak etkinleştirilecektir.
          Bazı kimlik doğrulayıcılar ve bazı tarayıcılar bu özelliği " -"desteklemeyebilir." - -#: wwa-admin-content.php:190 -msgid "Logging" -msgstr "Günlük tutuluyor" - -#: wwa-admin-content.php:202 -msgid "Clear log" -msgstr "Günlüğü temizle" - -#: wwa-admin-content.php:204 -msgid "" -"For debugging only. Enable only when needed.
          Note: Logs may " -"contain sensitive information." -msgstr "" -"Yalnızca hata ayıklama için. Yalnızca gerektiğinde etkinleştirin. " -"
          Not: Günlükler hassas bilgiler içerebilir." - -#: wwa-admin-content.php:213 -msgid "Log" -msgstr "Günlük" - -#: wwa-admin-content.php:215 -msgid "Automatic update every 5 seconds." -msgstr "Her 5 saniyede bir otomatik güncelleme." - -#: wwa-admin-content.php:219 -msgid "" -"To register a new authenticator or edit your authenticators, please go to your profile." -msgstr "" -"Yeni bir kimlik doğrulayıcı kaydettirmek veya kimlik doğrulayıcılarınızı " -"düzenlemek için lütfen profilinize " -"gidin." - -#: wwa-functions.php:148 wwa-shortcodes.php:88 -msgid "Auth" -msgstr "Yetkilendirme" - -#: wwa-functions.php:149 wwa-shortcodes.php:11 wwa-shortcodes.php:85 -#: wwa-shortcodes.php:88 -msgid "Authenticate with WebAuthn" -msgstr "WebAuthn ile kimlik doğrulama" - -#: wwa-functions.php:150 wwa-shortcodes.php:12 -msgid "Hold on..." -msgstr "Bekle..." - -#: wwa-functions.php:151 wwa-shortcodes.php:13 -msgid "Please proceed..." -msgstr "Lütfen devam edin..." - -#: wwa-functions.php:152 wwa-shortcodes.php:14 -msgid "Authenticating..." -msgstr "Kimlik doğrulanıyor..." - -#: wwa-functions.php:153 wwa-shortcodes.php:15 -msgid "Authenticated" -msgstr "Kimliği doğrulandı" - -#: wwa-functions.php:154 wwa-shortcodes.php:16 -msgid "Auth failed" -msgstr "Yetkilendirme başarısız oldu" - -#: wwa-functions.php:155 -msgid "" -"It looks like your browser doesn't support WebAuthn, which means you may " -"unable to login." -msgstr "" -"Görünüşe göre tarayıcınız WebAuthn'u desteklemiyor, bu da oturum " -"açamayabileceğiniz anlamına geliyor." - -#: wwa-functions.php:156 wwa-shortcodes.php:88 -msgid "Username" -msgstr "Kullanıcı adı" - -#: wwa-functions.php:158 -msgid "Error: The username field is empty." -msgstr "Hata: Kullanıcı adı alanı boş." - -#: wwa-functions.php:159 wwa-shortcodes.php:42 -msgid "Try to enter the username" -msgstr "Kullanıcı adını girmeyi deneyin" - -#: wwa-functions.php:176 -msgid "Logging in with password has been disabled by the site manager." -msgstr "Şifre ile oturum açma site yöneticisi tarafından devre dışı bırakıldı." - -#: wwa-functions.php:182 -msgid "Logging in with password has been disabled for this account." -msgstr "Bu hesap için şifre ile giriş devre dışı bırakıldı." - -#: wwa-functions.php:220 -msgid "" -"Logging in with password has been disabled for %s but you haven't register " -"any WebAuthn authenticator yet. You may unable to login again once you log " -"out. Register" -msgstr "" -"Parola ile oturum açma %s için devre dışı bırakıldı, ancak henüz herhangi " -"bir WebAuthn doğrulayıcısı kaydetmediniz. Oturumu kapattıktan sonra tekrar " -"oturum açamayabilirsiniz. Kaydolun " - -#: wwa-functions.php:220 wwa-functions.php:265 -msgid "the site" -msgstr "site" - -#: wwa-functions.php:220 -msgid "your account" -msgstr "hesabınız" - -#: wwa-functions.php:265 -msgid "" -"Logging in with password has been disabled for %s but this account haven't register any WebAuthn authenticator yet. This user may " -"unable to login." -msgstr "" -"Şifre ile giriş %s için devre dışı bırakıldı, ancak bu hesap henüz herhangi bir WebAuthn doğrulayıcısı kaydetmedi. Bu kullanıcı " -"giriş yapamayabilir." - -#: wwa-functions.php:265 -msgid "this account" -msgstr "bu hesap" - -#: wwa-functions.php:293 -msgid "Settings" -msgstr "Ayarlar" - -#: wwa-functions.php:301 -msgid "GitHub" -msgstr "GitHub" - -#: wwa-functions.php:302 -msgid "Documentation" -msgstr "Dokümantasyon" - -#: wwa-profile-content.php:7 -msgid "Initializing..." -msgstr "Başlatılıyor..." - -#: wwa-profile-content.php:8 wwa-shortcodes.php:37 -msgid "Please follow instructions to finish registration..." -msgstr "Kaydı tamamlamak için lütfen talimatları izleyin..." - -#: wwa-profile-content.php:9 wwa-shortcodes.php:38 -msgctxt "action" -msgid "Registered" -msgstr "Kayıtlı" - -#: wwa-profile-content.php:10 wwa-shortcodes.php:39 -msgid "Registration failed" -msgstr "Kayıt başarısız" - -#: wwa-profile-content.php:11 wwa-shortcodes.php:40 -msgid "Your browser does not support WebAuthn" -msgstr "Tarayıcınız WebAuthn'u desteklemiyor" - -#: wwa-profile-content.php:12 wwa-shortcodes.php:41 -msgid "Registrating..." -msgstr "Kaydediliyor..." - -#: wwa-profile-content.php:13 wwa-shortcodes.php:21 -msgid "Please enter the authenticator identifier" -msgstr "Lütfen kimlik doğrulayıcı tanımlayıcıyı girin" - -#: wwa-profile-content.php:14 wwa-shortcodes.php:26 -msgid "Loading failed, maybe try refreshing?" -msgstr "Yükleme başarısız oldu, belki yenilemeyi deneyin?" - -#: wwa-profile-content.php:16 wwa-shortcodes.php:34 -msgid "Platform authenticator" -msgstr "Platform doğrulayıcı" - -#: wwa-profile-content.php:17 wwa-shortcodes.php:35 -msgid "Roaming authenticator" -msgstr "Mobil kimlik doğrulayıcı" - -#: wwa-profile-content.php:18 wwa-shortcodes.php:36 -msgid "Remove" -msgstr "Kaldırmak" - -#: wwa-profile-content.php:19 wwa-shortcodes.php:22 -msgid "Please follow instructions to finish verification..." -msgstr "Doğrulamayı tamamlamak için lütfen talimatları izleyin..." - -#: wwa-profile-content.php:20 wwa-shortcodes.php:23 -msgid "Verifying..." -msgstr "Doğrulanıyor..." - -#: wwa-profile-content.php:21 wwa-shortcodes.php:24 -msgid "Verification failed" -msgstr "Doğrulama başarısız oldu" - -#: wwa-profile-content.php:22 wwa-shortcodes.php:25 -msgid "Verification passed! You can now log in through WebAuthn" -msgstr "Doğrulama geçti! Artık WebAuthn aracılığıyla giriş yapabilirsiniz" - -#: wwa-profile-content.php:23 wwa-shortcodes.php:32 -msgid "No registered authenticators" -msgstr "Kayıtlı kimlik doğrulayıcı yok" - -#: wwa-profile-content.php:24 wwa-shortcodes.php:27 -msgid "Confirm removal of authenticator: " -msgstr "Kimlik doğrulayıcının kaldırılmasını onaylayın: " - -#: wwa-profile-content.php:25 wwa-shortcodes.php:28 -msgid "Removing..." -msgstr "Kaldırılıyor..." - -#: wwa-profile-content.php:26 wwa-shortcodes.php:29 -msgid "Rename" -msgstr "Yeniden adlandır" - -#: wwa-profile-content.php:27 wwa-shortcodes.php:30 -msgid "Rename the authenticator" -msgstr "Doğrulayıcıyı yeniden adlandır" - -#: wwa-profile-content.php:28 wwa-shortcodes.php:31 -msgid "Renaming..." -msgstr "Yeniden adlandırılıyor..." - -#: wwa-profile-content.php:29 wwa-shortcodes.php:10 -msgid "Ready" -msgstr "Hazır" - -#: wwa-profile-content.php:30 wwa-shortcodes.php:17 -msgid "No" -msgstr "Hayır" - -#: wwa-profile-content.php:31 wwa-shortcodes.php:18 -msgid " (Unavailable)" -msgstr " (Kullanılamaz)" - -#: wwa-profile-content.php:32 wwa-shortcodes.php:19 -msgid "The site administrator has disabled usernameless login feature." -msgstr "Site yöneticisi, gereksiz oturum açma özelliğini devre dışı bıraktı." - -#: wwa-profile-content.php:33 wwa-shortcodes.php:43 -msgid "" -"After removing this authenticator, you will not be able to login with " -"WebAuthn" -msgstr "" -"Bu doğrulayıcıyı kaldırdıktan sonra, WebAuthn ile oturum açamayacaksınız" - -#: wwa-profile-content.php:34 wwa-shortcodes.php:44 -msgid " (Disabled)" -msgstr " (Devredışı)" - -#: wwa-profile-content.php:35 wwa-shortcodes.php:45 -msgid "The site administrator only allow platform authenticators currently." -msgstr "" -"Site yöneticisi şu anda yalnızca platform kimlik doğrulayıcılarına izin " -"veriyor." - -#: wwa-profile-content.php:36 wwa-shortcodes.php:46 -msgid "The site administrator only allow roaming authenticators currently." -msgstr "" -"Site yöneticisi şu anda yalnızca mobil kimlik doğrulayıcılarına izin veriyor." - -#: wwa-profile-content.php:50 -msgid "" -"This site is not correctly configured to use WebAuthn. Please contact the " -"site administrator." -msgstr "" -"Bu site, WebAuthn kullanmak için doğru şekilde yapılandırılmamış. Lütfen " -"site yöneticisiyle iletişime geçin." - -#: wwa-profile-content.php:60 -msgid "Disable password login for this account" -msgstr "Bu hesap için şifre girişini devre dışı bırakın" - -#: wwa-profile-content.php:62 -msgid "" -"When checked, password login will be completely disabled. Please make sure " -"your browser supports WebAuthn and you have a registered authenticator, " -"otherwise you may unable to login." -msgstr "" -"İşaretlendiğinde, şifre girişi tamamen devre dışı bırakılacaktır. Lütfen " -"tarayıcınızın WebAuthn'u desteklediğinden ve kayıtlı bir kimlik " -"doğrulayıcınız olduğundan emin olun, aksi takdirde oturum açamayabilirsiniz." - -#: wwa-profile-content.php:62 -msgid "The site administrator has disabled password login for the whole site." -msgstr "Site yöneticisi tüm site için şifre girişini devre dışı bıraktı." - -#: wwa-profile-content.php:66 -msgid "Registered WebAuthn Authenticators" -msgstr "Kayıtlı WebAuthn Kimlik Doğrulayıcıları" - -#: wwa-profile-content.php:71 wwa-profile-content.php:86 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Identifier" -msgstr "Tanımlayıcı" - -#: wwa-profile-content.php:72 wwa-profile-content.php:87 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Type" -msgstr "Tip" - -#: wwa-profile-content.php:73 wwa-profile-content.php:88 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgctxt "time" -msgid "Registered" -msgstr "Kayıtlı" - -#: wwa-profile-content.php:74 wwa-profile-content.php:89 -msgid "Last used" -msgstr "Son kullanım" - -#: wwa-profile-content.php:75 wwa-profile-content.php:90 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Usernameless" -msgstr "Kullanıcı adsız" - -#: wwa-profile-content.php:76 wwa-profile-content.php:91 wwa-shortcodes.php:156 -#: wwa-shortcodes.php:158 -msgid "Action" -msgstr "Eylem" - -#: wwa-profile-content.php:81 wwa-shortcodes.php:157 -msgid "Loading..." -msgstr "Yükleniyor..." - -#: wwa-profile-content.php:98 wwa-profile-content.php:101 -msgid "Register New Authenticator" -msgstr "Yeni Kimlik Doğrulayıcıyı Kaydet" - -#: wwa-profile-content.php:98 wwa-profile-content.php:142 -msgid "Verify Authenticator" -msgstr "Kimlik Doğrulayıcıyı Doğrula" - -#: wwa-profile-content.php:102 -msgid "" -"You are about to associate an authenticator with the current account " -"%s.
          You can register multiple authenticators for an account." -msgstr "" -"Bir doğrulayıcıyı geçerli hesapla %s ilişkilendirmek " -"üzeresiniz.
          Bir hesap için birden fazla doğrulayıcı kaydedebilirsiniz." - -#: wwa-profile-content.php:105 wwa-shortcodes.php:118 -msgid "Type of authenticator" -msgstr "Doğrulayıcı türü" - -#: wwa-profile-content.php:115 wwa-shortcodes.php:118 -msgid "" -"If a type is selected, the browser will only prompt for authenticators of " -"selected type.
          Regardless of the type, you can only log in with the " -"very same authenticators you've registered." -msgstr "" -"Bir tür seçilirse, tarayıcı yalnızca seçilen türdeki doğrulayıcıları " -"soracaktır.
          Türüne bakılmaksızın, yalnızca kaydettiğiniz kimlik " -"doğrulayıcılarla giriş yapabilirsiniz." - -#: wwa-profile-content.php:119 -msgid "Authenticator Identifier" -msgstr "Kimlik Doğrulayıcı Tanımlayıcı" - -#: wwa-profile-content.php:122 wwa-shortcodes.php:118 -msgid "" -"An easily identifiable name for the authenticator. DOES NOT " -"affect the authentication process in anyway." -msgstr "" -"Kimlik doğrulayıcı için kolayca tanımlanabilen bir ad. Kimlik doğrulama " -"sürecini hiçbir şekilde ETKİLEMEZ." - -#: wwa-profile-content.php:127 wwa-shortcodes.php:118 -msgid "Login without username" -msgstr "Kullanıcı adı olmadan giriş yap" - -#: wwa-profile-content.php:132 wwa-shortcodes.php:118 -msgid "" -"If registered authenticator with this feature, you can login without enter " -"your username.
          Some authenticators like U2F-only authenticators and some " -"browsers DO NOT support this feature.
          A record will be " -"stored in the authenticator permanently untill you reset it." -msgstr "" -"Kimlik doğrulayıcısı bu özellikle kaydolduysa, kullanıcı adınızı girmeden " -"oturum açabilirsiniz.
          Yalnızca U2F kimlik doğrulayıcıları gibi bazı " -"kimlik doğrulayıcılar ve bazı tarayıcılar bu özelliği DESTEKLEMEZ.
          Kayıtlar kimlik doğrulayıcısında siz sıfırlayana kadar kalıcı " -"olarak duracak." - -#: wwa-profile-content.php:138 -msgid "Start Registration" -msgstr "Kaydı Başlat" - -#: wwa-profile-content.php:143 -msgid "" -"Click Test Login to verify that the registered authenticators are working." -msgstr "" -"Kayıtlı kimlik doğrulayıcıların çalıştığını doğrulamak için Oturum Açmayı " -"Test Et'e tıklayın." - -#: wwa-profile-content.php:144 wwa-shortcodes.php:144 -msgid "Test Login" -msgstr "Test Girişi" - -#: wwa-profile-content.php:146 wwa-shortcodes.php:144 -msgid "Test Login (usernameless)" -msgstr "Test Girişi (kullanıcı adsız)" - -#: wwa-shortcodes.php:20 -msgid "Error: The username field is empty." -msgstr "Hata: Kullanıcı adı alanı boş." - -#: wwa-shortcodes.php:88 -msgid "Authenticate with password" -msgstr "Parola ile doğrulayın" - -#: wwa-shortcodes.php:105 wwa-shortcodes.php:133 wwa-shortcodes.php:166 -msgid "You haven't logged in yet." -msgstr "Henüz giriş yapmadınız." - -#: wwa-shortcodes.php:118 -msgid "Authenticator identifier" -msgstr "Kimlik doğrulayıcı tanımlayıcı" - -#: wwa-shortcodes.php:118 -msgid "Start registration" -msgstr "Kaydı başlat" diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/readme.txt b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/readme.txt deleted file mode 100644 index 43c1973a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/readme.txt +++ /dev/null @@ -1,160 +0,0 @@ -=== WP-WebAuthn === -Contributors: axton -Donate link: https://flyhigher.top/about -Tags: u2f, fido, fido2, webauthn, passkey, login, security, password, authentication -Requires at least: 5.0 -Tested up to: 6.3 -Stable tag: 1.3.1 -Requires PHP: 7.2 -License: GPLv3 -License URI: https://www.gnu.org/licenses/gpl-3.0.html - -WP-WebAuthn enables passwordless login through FIDO2 and U2F devices like Passkey, FaceID or Windows Hello for your site. - -== Description == - -WebAuthn is a new way for you to authenticate in web. It helps you replace your passwords with devices like Passkeys, USB Keys, fingerprint scanners, Windows Hello compatible cameras, FaceID/TouchID and more. Using WebAuthn, you can login to your a website with a glance or touch. - -When using WebAuthn, you just need to click once and perform a simple verification on the authenticator, then you are logged in. **No password needed.** If your device supports Passkey, your authenticator can roam seamlessly across multiple devices for a more convenient login experience. - -WP-WebAuthn is a plug-in for WordPress to enable WebAuthn on your site. Just download and install it, and you are in the future of web authentication. - -WP-WebAuthn also supports usernameless authentication. - -This plugin has 4 built-in shortcodes and 4 built-in Gutenberg blocks, so you can add components like register form to frontend pages. - -Please refer to the [documentation](http://doc.flyhigher.top/wp-webauthn) before using the plugin. - -**PHP extensions gmp and mbstring are required.** - -**WebAuthn requires HTTPS connection or `localhost` to function normally.** - -You can contribute to this plugin on [GitHub](https://github.com/yrccondor/wp-webauthn). - -Please note that this plugin does NOT support Internet Explorer (including IE 11). To use FaceID or TouchID, you need to use iOS/iPadOS 14+. - -= Security and Privacy = - -WebAuthn has become a W3C Recommendation since March 2019, which enabling the creation and use of strong, attested, scoped, public key-based credentials by web applications, for the purpose of strongly authenticating users using hardware authenticators. WebAuthn focuses on both security and privacy, it offers the possibility to create a secure authentication process without having to transfer any private data such as recognition data and fingerprint data. It will be the future of web authentication. - -= GDPR Friendly = - -When authenticating with WebAuthn, no private data will leave user's device and no third-party involvement. The credentials transferred are not associate to any user's information but only for authentication. It's GDPR Friendly. - -== Installation == - -Notice: PHP extensions gmp and mbstring are required. - -1. Upload the plugin files to the `/wp-content/plugins/wp-webauthn` directory, or install the plugin through the WordPress plugins screen directly -2. Activate the plugin through the 'Plugins' screen in WordPress -3. Use the Settings->WP-WebAuthn screen to configure the plugin -4. Make sure that all settings are set, and you can start to register authenticators in your profile page - -== Frequently Asked Questions == - -= What languages does this plugin support? = - -This plugin supports English, Chinese (Simplified), Traditional Chinese (Hong Kong), Traditional Chinese (Taiwan), Turkish, French & German currently. If you are using WordPress in none of those languages, English will be displayed as default language. - -All translation files are hosted on [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/wp-webauthn/) and [GitHub](https://github.com/yrccondor/wp-webauthn/tree/master/languages). You can help us to translate WP-WebAuthn into other languages! - -= What should I do if the plugin could not work? = - -Make sure your are using HTTPS or host your site in `localhost`. Then check whether you have installed the gmp extension for PHP. - -If you can't solve the problem, [open an issue](https://github.com/yrccondor/wp-webauthn/issues/new) on [GitHub](https://github.com/yrccondor/wp-webauthn) with plugin log. - -= Which browsers support WebAuthn? = - -The latest version of Chrome, FireFox, Edge and Safari are support WebAuthn. You can learn more on [Can I Use](https://caniuse.com/#feat=webauthn). - -To use FaceID or TouchID, you need to use iOS/iPadOS 14+. - -== Screenshots == - -1. Verifying -2. Verifying without username on iPad -3. The login page -4. The settings page -5. Profile - -== Changelog == - -= 1.3.1 = -Update: Translations - -= 1.3.0 = -Add: Allow to login with email addresses -Add: Disable password reset -Add: After user registration -Add: Spanish-Latam translation (thanks to Eduardo Chongkan), Catalan translation (thanks to Aniol Pagès), Spanish and Italian translations (thanks to AlwaysReading) -Fix: Undefined username in Gutenberg Blocks -Fix: 2FA compatibility -Update: Translations -Update: Third party libraries - -= 1.2.8 = -Fix: privilege check for admin panel - -= 1.2.7 = -Add: Now a security warning will be shown if user verification is disabled -Fix: Style broken with some locales -Fix: privilege check for admin panel (thanks to @vanpop) -Update: Third party libraries - -= 1.2.6 = -Update: Third party libraries - -= 1.2.5 = -Update: German translation (thanks to niiconn) -Fix: HTTPS check - -= 1.2.4 = -Add: French translation (thanks to Spomky) and Turkish translate (thanks to Sn0bzy) -Fix: HTTPS check -Update: Existing translations -Update: Third party libraries - -= 1.2.3 = -Feat: Avoid locking users out if WebAuthn is not available -Update: translations -Update: Third party libraries - -= 1.2.2 = -Fix: Cannot access to js files in apache 2.4+ - -= 1.2.1 = -Feat: Allow to disable password login completely -Feat: Now we use WordPress transients instead of PHP sessions -Feat: Move register related settings to user's profile -Feat: Gutenberg block support -Feat: Traditional Chinese (Hong Kong) & Traditional Chinese (Taiwan) translation -Update: Chinese translation -Update: Third-party libraries - -= 1.1.0 = -Add: Allow to remember login option -Add: Only allow a specific type of authenticator option -Fix: Toggle button may not working in login form -Update: Chinese translation -Update: Third-party libraries - -== Upgrade Notice == - -= 1.2.5 = -Improvred HTTPS checking and updated German translation (by niiconn) - -= 1.2.4 = -Improvred HTTPS checking and added new translations - -= 1.2.3 = -Avoid locking users out if WebAuthn is not available and update translations - -= 1.2.2 = -Fixed a problem that js files were broken in apache 2.4+ - -= 1.2.1 = -New features, bug fixing and new translations - -= 1.1.0 = -2 new features & bug fixing diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/autoload.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/autoload.php deleted file mode 100644 index 5da3be60..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/autoload.php +++ /dev/null @@ -1,25 +0,0 @@ -=6.0.0", - "yoast/phpunit-polyfills": "^0.1.0" - }, - "autoload": { - "psr-4": { - "Assert\\": "lib/Assert" - }, - "files": [ - "lib/Assert/functions.php" - ] - }, - "autoload-dev": { - "psr-4": { - "Assert\\Tests\\": "tests/Assert/Tests" - }, - "files": [ - "tests/Assert/Tests/Fixtures/functions.php" - ] - }, - "scripts": { - "assert:generate-docs": "php bin/generate_method_docs.php", - "assert:cs-lint": "php-cs-fixer fix --diff -vvv --dry-run", - "assert:cs-fix": "php-cs-fixer fix . -vvv || true", - "assert:sa-code": "vendor/bin/phpstan analyse --configuration=phpstan-code.neon --no-progress --ansi -l 7 bin lib", - "assert:sa-tests": "vendor/bin/phpstan analyse --configuration=phpstan-tests.neon --no-progress --ansi -l 7 tests" - }, - "suggest": { - "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/Assert.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/Assert.php deleted file mode 100644 index 3614b345..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/Assert.php +++ /dev/null @@ -1,85 +0,0 @@ -notEmpty()->integer(); - * Assert::that($value)->nullOr()->string()->startsWith("Foo"); - * - * The assertion chain can be stateful, that means be careful when you reuse - * it. You should never pass around the chain. - */ - public static function that($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain - { - $assertionChain = new AssertionChain($value, $defaultMessage, $defaultPropertyPath); - - return $assertionChain->setAssertionClassName(static::$assertionClass); - } - - /** - * Start validation on a set of values, returns {@link AssertionChain}. - * - * @param mixed $values - * @param string|callable|null $defaultMessage - */ - public static function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain - { - return static::that($values, $defaultMessage, $defaultPropertyPath)->all(); - } - - /** - * Start validation and allow NULL, returns {@link AssertionChain}. - * - * @param mixed $value - * @param string|callable|null $defaultMessage - */ - public static function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain - { - return static::that($value, $defaultMessage, $defaultPropertyPath)->nullOr(); - } - - /** - * Create a lazy assertion object. - */ - public static function lazy(): LazyAssertion - { - $lazyAssertion = new LazyAssertion(); - - return $lazyAssertion - ->setAssertClass(\get_called_class()) - ->setExceptionClass(static::$lazyAssertionExceptionClass); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/Assertion.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/Assertion.php deleted file mode 100644 index 243e64d2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/Assertion.php +++ /dev/null @@ -1,2797 +0,0 @@ - - * - * @method static bool allAlnum(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric for all values. - * @method static bool allBase64(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined for all values. - * @method static bool allBetween(mixed[] $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit for all values. - * @method static bool allBetweenExclusive(mixed[] $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit for all values. - * @method static bool allBetweenLength(mixed[] $value, int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths for all values. - * @method static bool allBoolean(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is php boolean for all values. - * @method static bool allChoice(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices for all values. - * @method static bool allChoicesNotEmpty(array[] $values, array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content for all values. - * @method static bool allClassExists(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the class exists for all values. - * @method static bool allContains(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars for all values. - * @method static bool allCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count for all values. - * @method static bool allDate(string[] $value, string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format for all values. - * @method static bool allDefined(mixed[] $constant, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined for all values. - * @method static bool allDigit(mixed[] $value, string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit for all values. - * @method static bool allDirectory(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a directory exists for all values. - * @method static bool allE164(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number for all values. - * @method static bool allEmail(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL) for all values. - * @method static bool allEndsWith(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars for all values. - * @method static bool allEq(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==) for all values. - * @method static bool allEqArraySubset(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset for all values. - * @method static bool allExtensionLoaded(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded for all values. - * @method static bool allExtensionVersion(string[] $extension, string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed for all values. - * @method static bool allFalse(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False for all values. - * @method static bool allFile(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a file exists for all values. - * @method static bool allFloat(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php float for all values. - * @method static bool allGreaterOrEqualThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit for all values. - * @method static bool allGreaterThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit for all values. - * @method static bool allImplementsInterface(mixed[] $class, string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface for all values. - * @method static bool allInArray(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice() for all values. - * @method static bool allInteger(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer for all values. - * @method static bool allIntegerish(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish for all values. - * @method static bool allInterfaceExists(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the interface exists for all values. - * @method static bool allIp(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address for all values. - * @method static bool allIpv4(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address for all values. - * @method static bool allIpv6(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address for all values. - * @method static bool allIsArray(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array for all values. - * @method static bool allIsArrayAccessible(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object for all values. - * @method static bool allIsCallable(mixed[] $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable for all values. - * @method static bool allIsCountable(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is countable for all values. - * @method static bool allIsInstanceOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name for all values. - * @method static bool allIsJsonString(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string for all values. - * @method static bool allIsObject(mixed[] $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object for all values. - * @method static bool allIsResource(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a resource for all values. - * @method static bool allIsTraversable(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object for all values. - * @method static bool allKeyExists(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array for all values. - * @method static bool allKeyIsset(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset() for all values. - * @method static bool allKeyNotExists(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array for all values. - * @method static bool allLength(mixed[] $value, int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length for all values. - * @method static bool allLessOrEqualThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit for all values. - * @method static bool allLessThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit for all values. - * @method static bool allMax(mixed[] $value, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit for all values. - * @method static bool allMaxCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements for all values. - * @method static bool allMaxLength(mixed[] $value, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars for all values. - * @method static bool allMethodExists(string[] $value, mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object for all values. - * @method static bool allMin(mixed[] $value, mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit for all values. - * @method static bool allMinCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements for all values. - * @method static bool allMinLength(mixed[] $value, int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long for all values. - * @method static bool allNoContent(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty for all values. - * @method static bool allNotBlank(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not blank for all values. - * @method static bool allNotContains(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars for all values. - * @method static bool allNotEmpty(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not empty for all values. - * @method static bool allNotEmptyKey(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty for all values. - * @method static bool allNotEq(mixed[] $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==) for all values. - * @method static bool allNotInArray(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices for all values. - * @method static bool allNotIsInstanceOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name for all values. - * @method static bool allNotNull(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not null for all values. - * @method static bool allNotRegex(mixed[] $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex for all values. - * @method static bool allNotSame(mixed[] $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===) for all values. - * @method static bool allNull(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is null for all values. - * @method static bool allNumeric(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric for all values. - * @method static bool allObjectOrClass(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists for all values. - * @method static bool allPhpVersion(string[] $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version for all values. - * @method static bool allPropertiesExist(mixed[] $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist for all values. - * @method static bool allPropertyExists(mixed[] $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists for all values. - * @method static bool allRange(mixed[] $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers for all values. - * @method static bool allReadable(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable for all values. - * @method static bool allRegex(mixed[] $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex for all values. - * @method static bool allSame(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===) for all values. - * @method static bool allSatisfy(mixed[] $value, callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback for all values. - * @method static bool allScalar(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar for all values. - * @method static bool allStartsWith(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars for all values. - * @method static bool allString(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a string for all values. - * @method static bool allSubclassOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name for all values. - * @method static bool allTrue(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True for all values. - * @method static bool allUniqueValues(array[] $values, string|callable $message = null, string $propertyPath = null) Assert that values in array are unique (using strict equality) for all values. - * @method static bool allUrl(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an URL for all values. - * @method static bool allUuid(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID for all values. - * @method static bool allVersion(string[] $version1, string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions for all values. - * @method static bool allWriteable(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable for all values. - * @method static bool nullOrAlnum(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric or that the value is null. - * @method static bool nullOrBase64(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined or that the value is null. - * @method static bool nullOrBetween(mixed|null $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit or that the value is null. - * @method static bool nullOrBetweenExclusive(mixed|null $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit or that the value is null. - * @method static bool nullOrBetweenLength(mixed|null $value, int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths or that the value is null. - * @method static bool nullOrBoolean(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is php boolean or that the value is null. - * @method static bool nullOrChoice(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices or that the value is null. - * @method static bool nullOrChoicesNotEmpty(array|null $values, array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content or that the value is null. - * @method static bool nullOrClassExists(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the class exists or that the value is null. - * @method static bool nullOrContains(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars or that the value is null. - * @method static bool nullOrCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count or that the value is null. - * @method static bool nullOrDate(string|null $value, string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format or that the value is null. - * @method static bool nullOrDefined(mixed|null $constant, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined or that the value is null. - * @method static bool nullOrDigit(mixed|null $value, string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit or that the value is null. - * @method static bool nullOrDirectory(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a directory exists or that the value is null. - * @method static bool nullOrE164(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number or that the value is null. - * @method static bool nullOrEmail(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL) or that the value is null. - * @method static bool nullOrEndsWith(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars or that the value is null. - * @method static bool nullOrEq(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==) or that the value is null. - * @method static bool nullOrEqArraySubset(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset or that the value is null. - * @method static bool nullOrExtensionLoaded(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded or that the value is null. - * @method static bool nullOrExtensionVersion(string|null $extension, string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed or that the value is null. - * @method static bool nullOrFalse(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False or that the value is null. - * @method static bool nullOrFile(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a file exists or that the value is null. - * @method static bool nullOrFloat(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php float or that the value is null. - * @method static bool nullOrGreaterOrEqualThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit or that the value is null. - * @method static bool nullOrGreaterThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit or that the value is null. - * @method static bool nullOrImplementsInterface(mixed|null $class, string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface or that the value is null. - * @method static bool nullOrInArray(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice() or that the value is null. - * @method static bool nullOrInteger(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer or that the value is null. - * @method static bool nullOrIntegerish(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish or that the value is null. - * @method static bool nullOrInterfaceExists(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the interface exists or that the value is null. - * @method static bool nullOrIp(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address or that the value is null. - * @method static bool nullOrIpv4(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address or that the value is null. - * @method static bool nullOrIpv6(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address or that the value is null. - * @method static bool nullOrIsArray(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or that the value is null. - * @method static bool nullOrIsArrayAccessible(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object or that the value is null. - * @method static bool nullOrIsCallable(mixed|null $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable or that the value is null. - * @method static bool nullOrIsCountable(array|Countable|ResourceBundle|SimpleXMLElement|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is countable or that the value is null. - * @method static bool nullOrIsInstanceOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name or that the value is null. - * @method static bool nullOrIsJsonString(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string or that the value is null. - * @method static bool nullOrIsObject(mixed|null $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object or that the value is null. - * @method static bool nullOrIsResource(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a resource or that the value is null. - * @method static bool nullOrIsTraversable(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object or that the value is null. - * @method static bool nullOrKeyExists(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array or that the value is null. - * @method static bool nullOrKeyIsset(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset() or that the value is null. - * @method static bool nullOrKeyNotExists(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array or that the value is null. - * @method static bool nullOrLength(mixed|null $value, int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length or that the value is null. - * @method static bool nullOrLessOrEqualThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit or that the value is null. - * @method static bool nullOrLessThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit or that the value is null. - * @method static bool nullOrMax(mixed|null $value, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit or that the value is null. - * @method static bool nullOrMaxCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements or that the value is null. - * @method static bool nullOrMaxLength(mixed|null $value, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars or that the value is null. - * @method static bool nullOrMethodExists(string|null $value, mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object or that the value is null. - * @method static bool nullOrMin(mixed|null $value, mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit or that the value is null. - * @method static bool nullOrMinCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements or that the value is null. - * @method static bool nullOrMinLength(mixed|null $value, int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long or that the value is null. - * @method static bool nullOrNoContent(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty or that the value is null. - * @method static bool nullOrNotBlank(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not blank or that the value is null. - * @method static bool nullOrNotContains(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars or that the value is null. - * @method static bool nullOrNotEmpty(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not empty or that the value is null. - * @method static bool nullOrNotEmptyKey(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty or that the value is null. - * @method static bool nullOrNotEq(mixed|null $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==) or that the value is null. - * @method static bool nullOrNotInArray(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices or that the value is null. - * @method static bool nullOrNotIsInstanceOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name or that the value is null. - * @method static bool nullOrNotNull(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not null or that the value is null. - * @method static bool nullOrNotRegex(mixed|null $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex or that the value is null. - * @method static bool nullOrNotSame(mixed|null $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===) or that the value is null. - * @method static bool nullOrNull(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is null or that the value is null. - * @method static bool nullOrNumeric(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric or that the value is null. - * @method static bool nullOrObjectOrClass(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists or that the value is null. - * @method static bool nullOrPhpVersion(string|null $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version or that the value is null. - * @method static bool nullOrPropertiesExist(mixed|null $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist or that the value is null. - * @method static bool nullOrPropertyExists(mixed|null $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists or that the value is null. - * @method static bool nullOrRange(mixed|null $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers or that the value is null. - * @method static bool nullOrReadable(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable or that the value is null. - * @method static bool nullOrRegex(mixed|null $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex or that the value is null. - * @method static bool nullOrSame(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===) or that the value is null. - * @method static bool nullOrSatisfy(mixed|null $value, callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback or that the value is null. - * @method static bool nullOrScalar(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar or that the value is null. - * @method static bool nullOrStartsWith(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars or that the value is null. - * @method static bool nullOrString(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a string or that the value is null. - * @method static bool nullOrSubclassOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name or that the value is null. - * @method static bool nullOrTrue(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True or that the value is null. - * @method static bool nullOrUniqueValues(array|null $values, string|callable $message = null, string $propertyPath = null) Assert that values in array are unique (using strict equality) or that the value is null. - * @method static bool nullOrUrl(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an URL or that the value is null. - * @method static bool nullOrUuid(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID or that the value is null. - * @method static bool nullOrVersion(string|null $version1, string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions or that the value is null. - * @method static bool nullOrWriteable(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable or that the value is null. - */ -class Assertion -{ - const INVALID_FLOAT = 9; - const INVALID_INTEGER = 10; - const INVALID_DIGIT = 11; - const INVALID_INTEGERISH = 12; - const INVALID_BOOLEAN = 13; - const VALUE_EMPTY = 14; - const VALUE_NULL = 15; - const VALUE_NOT_NULL = 25; - const INVALID_STRING = 16; - const INVALID_REGEX = 17; - const INVALID_MIN_LENGTH = 18; - const INVALID_MAX_LENGTH = 19; - const INVALID_STRING_START = 20; - const INVALID_STRING_CONTAINS = 21; - const INVALID_CHOICE = 22; - const INVALID_NUMERIC = 23; - const INVALID_ARRAY = 24; - const INVALID_KEY_EXISTS = 26; - const INVALID_NOT_BLANK = 27; - const INVALID_INSTANCE_OF = 28; - const INVALID_SUBCLASS_OF = 29; - const INVALID_RANGE = 30; - const INVALID_ALNUM = 31; - const INVALID_TRUE = 32; - const INVALID_EQ = 33; - const INVALID_SAME = 34; - const INVALID_MIN = 35; - const INVALID_MAX = 36; - const INVALID_LENGTH = 37; - const INVALID_FALSE = 38; - const INVALID_STRING_END = 39; - const INVALID_UUID = 40; - const INVALID_COUNT = 41; - const INVALID_NOT_EQ = 42; - const INVALID_NOT_SAME = 43; - const INVALID_TRAVERSABLE = 44; - const INVALID_ARRAY_ACCESSIBLE = 45; - const INVALID_KEY_ISSET = 46; - const INVALID_VALUE_IN_ARRAY = 47; - const INVALID_E164 = 48; - const INVALID_BASE64 = 49; - const INVALID_NOT_REGEX = 50; - const INVALID_DIRECTORY = 101; - const INVALID_FILE = 102; - const INVALID_READABLE = 103; - const INVALID_WRITEABLE = 104; - const INVALID_CLASS = 105; - const INVALID_INTERFACE = 106; - const INVALID_FILE_NOT_EXISTS = 107; - const INVALID_EMAIL = 201; - const INTERFACE_NOT_IMPLEMENTED = 202; - const INVALID_URL = 203; - const INVALID_NOT_INSTANCE_OF = 204; - const VALUE_NOT_EMPTY = 205; - const INVALID_JSON_STRING = 206; - const INVALID_OBJECT = 207; - const INVALID_METHOD = 208; - const INVALID_SCALAR = 209; - const INVALID_LESS = 210; - const INVALID_LESS_OR_EQUAL = 211; - const INVALID_GREATER = 212; - const INVALID_GREATER_OR_EQUAL = 213; - const INVALID_DATE = 214; - const INVALID_CALLABLE = 215; - const INVALID_KEY_NOT_EXISTS = 216; - const INVALID_SATISFY = 217; - const INVALID_IP = 218; - const INVALID_BETWEEN = 219; - const INVALID_BETWEEN_EXCLUSIVE = 220; - const INVALID_EXTENSION = 222; - const INVALID_CONSTANT = 221; - const INVALID_VERSION = 223; - const INVALID_PROPERTY = 224; - const INVALID_RESOURCE = 225; - const INVALID_COUNTABLE = 226; - const INVALID_MIN_COUNT = 227; - const INVALID_MAX_COUNT = 228; - const INVALID_STRING_NOT_CONTAINS = 229; - const INVALID_UNIQUE_VALUES = 230; - - /** - * Exception to throw when an assertion failed. - * - * @var string - */ - protected static $exceptionClass = InvalidArgumentException::class; - - /** - * Assert that two values are equal (using ==). - * - * @param mixed $value - * @param mixed $value2 - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function eq($value, $value2, $message = null, string $propertyPath = null): bool - { - if ($value != $value2) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" does not equal expected value "%s".'), - static::stringify($value), - static::stringify($value2) - ); - - throw static::createException($value, $message, static::INVALID_EQ, $propertyPath, ['expected' => $value2]); - } - - return true; - } - - /** - * Assert that the array contains the subset. - * - * @param mixed $value - * @param mixed $value2 - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function eqArraySubset($value, $value2, $message = null, string $propertyPath = null): bool - { - static::isArray($value, $message, $propertyPath); - static::isArray($value2, $message, $propertyPath); - - $patched = \array_replace_recursive($value, $value2); - static::eq($patched, $value, $message, $propertyPath); - - return true; - } - - /** - * Assert that two values are the same (using ===). - * - * @param mixed $value - * @param mixed $value2 - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-template ExpectedType - * @psalm-param ExpectedType $value2 - * @psalm-assert =ExpectedType $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function same($value, $value2, $message = null, string $propertyPath = null): bool - { - if ($value !== $value2) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not the same as expected value "%s".'), - static::stringify($value), - static::stringify($value2) - ); - - throw static::createException($value, $message, static::INVALID_SAME, $propertyPath, ['expected' => $value2]); - } - - return true; - } - - /** - * Assert that two values are not equal (using ==). - * - * @param mixed $value1 - * @param mixed $value2 - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function notEq($value1, $value2, $message = null, string $propertyPath = null): bool - { - if ($value1 == $value2) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" was not expected to be equal to value "%s".'), - static::stringify($value1), - static::stringify($value2) - ); - throw static::createException($value1, $message, static::INVALID_NOT_EQ, $propertyPath, ['expected' => $value2]); - } - - return true; - } - - /** - * Assert that two values are not the same (using ===). - * - * @param mixed $value1 - * @param mixed $value2 - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-template ExpectedType - * @psalm-param ExpectedType $value2 - * @psalm-assert !=ExpectedType $value1 - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function notSame($value1, $value2, $message = null, string $propertyPath = null): bool - { - if ($value1 === $value2) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" was not expected to be the same as value "%s".'), - static::stringify($value1), - static::stringify($value2) - ); - throw static::createException($value1, $message, static::INVALID_NOT_SAME, $propertyPath, ['expected' => $value2]); - } - - return true; - } - - /** - * Assert that value is not in array of choices. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function notInArray($value, array $choices, $message = null, string $propertyPath = null): bool - { - if (true === \in_array($value, $choices)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" was not expected to be an element of the values: %s'), - static::stringify($value), - static::stringify($choices) - ); - throw static::createException($value, $message, static::INVALID_VALUE_IN_ARRAY, $propertyPath, ['choices' => $choices]); - } - - return true; - } - - /** - * Assert that value is a php integer. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert int $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function integer($value, $message = null, string $propertyPath = null): bool - { - if (!\is_int($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not an integer.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_INTEGER, $propertyPath); - } - - return true; - } - - /** - * Assert that value is a php float. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert float $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function float($value, $message = null, string $propertyPath = null): bool - { - if (!\is_float($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a float.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_FLOAT, $propertyPath); - } - - return true; - } - - /** - * Validates if an integer or integerish is a digit. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =numeric $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function digit($value, $message = null, string $propertyPath = null): bool - { - if (!\ctype_digit((string)$value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a digit.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_DIGIT, $propertyPath); - } - - return true; - } - - /** - * Assert that value is a php integer'ish. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function integerish($value, $message = null, string $propertyPath = null): bool - { - if ( - \is_resource($value) || - \is_object($value) || - \is_bool($value) || - \is_null($value) || - \is_array($value) || - (\is_string($value) && '' == $value) || - ( - \strval(\intval($value)) !== \strval($value) && - \strval(\intval($value)) !== \strval(\ltrim($value, '0')) && - '' !== \strval(\intval($value)) && - '' !== \strval(\ltrim($value, '0')) - ) - ) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not an integer or a number castable to integer.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_INTEGERISH, $propertyPath); - } - - return true; - } - - /** - * Assert that value is php boolean. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert bool $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function boolean($value, $message = null, string $propertyPath = null): bool - { - if (!\is_bool($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a boolean.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_BOOLEAN, $propertyPath); - } - - return true; - } - - /** - * Assert that value is a PHP scalar. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert scalar $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function scalar($value, $message = null, string $propertyPath = null): bool - { - if (!\is_scalar($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a scalar.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_SCALAR, $propertyPath); - } - - return true; - } - - /** - * Assert that value is not empty. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert !empty $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function notEmpty($value, $message = null, string $propertyPath = null): bool - { - if (empty($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is empty, but non empty value was expected.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::VALUE_EMPTY, $propertyPath); - } - - return true; - } - - /** - * Assert that value is empty. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert empty $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function noContent($value, $message = null, string $propertyPath = null): bool - { - if (!empty($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not empty, but empty value was expected.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::VALUE_NOT_EMPTY, $propertyPath); - } - - return true; - } - - /** - * Assert that value is null. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert null $value - * - * @return bool - */ - public static function null($value, $message = null, string $propertyPath = null): bool - { - if (null !== $value) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not null, but null value was expected.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::VALUE_NOT_NULL, $propertyPath); - } - - return true; - } - - /** - * Assert that value is not null. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert !null $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function notNull($value, $message = null, string $propertyPath = null): bool - { - if (null === $value) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is null, but non null value was expected.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::VALUE_NULL, $propertyPath); - } - - return true; - } - - /** - * Assert that value is a string. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function string($value, $message = null, string $propertyPath = null) - { - if (!\is_string($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" expected to be string, type %s given.'), - static::stringify($value), - \gettype($value) - ); - - throw static::createException($value, $message, static::INVALID_STRING, $propertyPath); - } - - return true; - } - - /** - * Assert that value matches a regex. - * - * @param mixed $value - * @param string $pattern - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function regex($value, $pattern, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - - if (!\preg_match($pattern, $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" does not match expression.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_REGEX, $propertyPath, ['pattern' => $pattern]); - } - - return true; - } - - /** - * Assert that value does not match a regex. - * - * @param mixed $value - * @param string $pattern - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert !=string $value - * - * @throws AssertionFailedException - */ - public static function notRegex($value, $pattern, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - - if (\preg_match($pattern, $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" matches expression.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_NOT_REGEX, $propertyPath, ['pattern' => $pattern]); - } - - return true; - } - - /** - * Assert that string has a given length. - * - * @param mixed $value - * @param int $length - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function length($value, $length, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($value, $message, $propertyPath); - - if (\mb_strlen($value, $encoding) !== $length) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" has to be %d exactly characters long, but length is %d.'), - static::stringify($value), - $length, - \mb_strlen($value, $encoding) - ); - - throw static::createException($value, $message, static::INVALID_LENGTH, $propertyPath, ['length' => $length, 'encoding' => $encoding]); - } - - return true; - } - - /** - * Assert that a string is at least $minLength chars long. - * - * @param mixed $value - * @param int $minLength - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function minLength($value, $minLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($value, $message, $propertyPath); - - if (\mb_strlen($value, $encoding) < $minLength) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is too short, it should have at least %d characters, but only has %d characters.'), - static::stringify($value), - $minLength, - \mb_strlen($value, $encoding) - ); - - throw static::createException($value, $message, static::INVALID_MIN_LENGTH, $propertyPath, ['min_length' => $minLength, 'encoding' => $encoding]); - } - - return true; - } - - /** - * Assert that string value is not longer than $maxLength chars. - * - * @param mixed $value - * @param int $maxLength - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function maxLength($value, $maxLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($value, $message, $propertyPath); - - if (\mb_strlen($value, $encoding) > $maxLength) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is too long, it should have no more than %d characters, but has %d characters.'), - static::stringify($value), - $maxLength, - \mb_strlen($value, $encoding) - ); - - throw static::createException($value, $message, static::INVALID_MAX_LENGTH, $propertyPath, ['max_length' => $maxLength, 'encoding' => $encoding]); - } - - return true; - } - - /** - * Assert that string length is between min and max lengths. - * - * @param mixed $value - * @param int $minLength - * @param int $maxLength - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function betweenLength($value, $minLength, $maxLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($value, $message, $propertyPath); - static::minLength($value, $minLength, $message, $propertyPath, $encoding); - static::maxLength($value, $maxLength, $message, $propertyPath, $encoding); - - return true; - } - - /** - * Assert that string starts with a sequence of chars. - * - * @param mixed $string - * @param string $needle - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $string - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function startsWith($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($string, $message, $propertyPath); - - if (0 !== \mb_strpos($string, $needle, 0, $encoding)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" does not start with "%s".'), - static::stringify($string), - static::stringify($needle) - ); - - throw static::createException($string, $message, static::INVALID_STRING_START, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]); - } - - return true; - } - - /** - * Assert that string ends with a sequence of chars. - * - * @param mixed $string - * @param string $needle - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $string - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function endsWith($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($string, $message, $propertyPath); - - $stringPosition = \mb_strlen($string, $encoding) - \mb_strlen($needle, $encoding); - - if (\mb_strripos($string, $needle, 0, $encoding) !== $stringPosition) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" does not end with "%s".'), - static::stringify($string), - static::stringify($needle) - ); - - throw static::createException($string, $message, static::INVALID_STRING_END, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]); - } - - return true; - } - - /** - * Assert that string contains a sequence of chars. - * - * @param mixed $string - * @param string $needle - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $string - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function contains($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($string, $message, $propertyPath); - - if (false === \mb_strpos($string, $needle, 0, $encoding)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" does not contain "%s".'), - static::stringify($string), - static::stringify($needle) - ); - - throw static::createException($string, $message, static::INVALID_STRING_CONTAINS, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]); - } - - return true; - } - - /** - * Assert that string does not contains a sequence of chars. - * - * @param mixed $string - * @param string $needle - * @param string|callable|null $message - * @param string|null $propertyPath - * @param string $encoding - * - * @psalm-assert =string $string - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function notContains($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool - { - static::string($string, $message, $propertyPath); - - if (false !== \mb_strpos($string, $needle, 0, $encoding)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" contains "%s".'), - static::stringify($string), - static::stringify($needle) - ); - - throw static::createException($string, $message, static::INVALID_STRING_NOT_CONTAINS, $propertyPath, ['needle' => $needle, 'encoding' => $encoding]); - } - - return true; - } - - /** - * Assert that value is in array of choices. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function choice($value, array $choices, $message = null, string $propertyPath = null): bool - { - if (!\in_array($value, $choices, true)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not an element of the valid values: %s'), - static::stringify($value), - \implode(', ', \array_map([\get_called_class(), 'stringify'], $choices)) - ); - - throw static::createException($value, $message, static::INVALID_CHOICE, $propertyPath, ['choices' => $choices]); - } - - return true; - } - - /** - * Assert that value is in array of choices. - * - * This is an alias of {@see choice()}. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function inArray($value, array $choices, $message = null, string $propertyPath = null): bool - { - return static::choice($value, $choices, $message, $propertyPath); - } - - /** - * Assert that value is numeric. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert numeric $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function numeric($value, $message = null, string $propertyPath = null): bool - { - if (!\is_numeric($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not numeric.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_NUMERIC, $propertyPath); - } - - return true; - } - - /** - * Assert that value is a resource. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert resource $value - * - * @return bool - */ - public static function isResource($value, $message = null, string $propertyPath = null): bool - { - if (!\is_resource($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a resource.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_RESOURCE, $propertyPath); - } - - return true; - } - - /** - * Assert that value is an array. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert array $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function isArray($value, $message = null, string $propertyPath = null): bool - { - if (!\is_array($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not an array.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_ARRAY, $propertyPath); - } - - return true; - } - - /** - * Assert that value is an array or a traversable object. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert iterable $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function isTraversable($value, $message = null, string $propertyPath = null): bool - { - if (!\is_array($value) && !$value instanceof Traversable) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not an array and does not implement Traversable.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_TRAVERSABLE, $propertyPath); - } - - return true; - } - - /** - * Assert that value is an array or an array-accessible object. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function isArrayAccessible($value, $message = null, string $propertyPath = null): bool - { - if (!\is_array($value) && !$value instanceof ArrayAccess) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not an array and does not implement ArrayAccess.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_ARRAY_ACCESSIBLE, $propertyPath); - } - - return true; - } - - /** - * Assert that value is countable. - * - * @param array|Countable|ResourceBundle|SimpleXMLElement $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert countable $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function isCountable($value, $message = null, string $propertyPath = null): bool - { - if (\function_exists('is_countable')) { - $assert = \is_countable($value); - } else { - $assert = \is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXMLElement; - } - - if (!$assert) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not an array and does not implement Countable.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_COUNTABLE, $propertyPath); - } - - return true; - } - - /** - * Assert that key exists in an array. - * - * @param mixed $value - * @param string|int $key - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function keyExists($value, $key, $message = null, string $propertyPath = null): bool - { - static::isArray($value, $message, $propertyPath); - - if (!\array_key_exists($key, $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Array does not contain an element with key "%s"'), - static::stringify($key) - ); - - throw static::createException($value, $message, static::INVALID_KEY_EXISTS, $propertyPath, ['key' => $key]); - } - - return true; - } - - /** - * Assert that key does not exist in an array. - * - * @param mixed $value - * @param string|int $key - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function keyNotExists($value, $key, $message = null, string $propertyPath = null): bool - { - static::isArray($value, $message, $propertyPath); - - if (\array_key_exists($key, $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Array contains an element with key "%s"'), - static::stringify($key) - ); - - throw static::createException($value, $message, static::INVALID_KEY_NOT_EXISTS, $propertyPath, ['key' => $key]); - } - - return true; - } - - /** - * Assert that values in array are unique (using strict equality). - * - * @param mixed[] $values - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function uniqueValues(array $values, $message = null, string $propertyPath = null): bool - { - foreach ($values as $key => $value) { - if (\array_search($value, $values, true) !== $key) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" occurs more than once in array'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_UNIQUE_VALUES, $propertyPath, ['value' => $value]); - } - } - - return true; - } - - /** - * Assert that key exists in an array/array-accessible object using isset(). - * - * @param mixed $value - * @param string|int $key - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function keyIsset($value, $key, $message = null, string $propertyPath = null): bool - { - static::isArrayAccessible($value, $message, $propertyPath); - - if (!isset($value[$key])) { - $message = \sprintf( - static::generateMessage($message ?: 'The element with key "%s" was not found'), - static::stringify($key) - ); - - throw static::createException($value, $message, static::INVALID_KEY_ISSET, $propertyPath, ['key' => $key]); - } - - return true; - } - - /** - * Assert that key exists in an array/array-accessible object and its value is not empty. - * - * @param mixed $value - * @param string|int $key - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function notEmptyKey($value, $key, $message = null, string $propertyPath = null): bool - { - static::keyIsset($value, $key, $message, $propertyPath); - static::notEmpty($value[$key], $message, $propertyPath); - - return true; - } - - /** - * Assert that value is not blank. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function notBlank($value, $message = null, string $propertyPath = null): bool - { - if (false === $value || (empty($value) && '0' != $value) || (\is_string($value) && '' === \trim($value))) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is blank, but was expected to contain a value.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_NOT_BLANK, $propertyPath); - } - - return true; - } - - /** - * Assert that value is instance of given class-name. - * - * @param mixed $value - * @param string $className - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-template ExpectedType of object - * @psalm-param class-string $className - * @psalm-assert ExpectedType $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function isInstanceOf($value, $className, $message = null, string $propertyPath = null): bool - { - if (!($value instanceof $className)) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" was expected to be instanceof of "%s" but is not.'), - static::stringify($value), - $className - ); - - throw static::createException($value, $message, static::INVALID_INSTANCE_OF, $propertyPath, ['class' => $className]); - } - - return true; - } - - /** - * Assert that value is not instance of given class-name. - * - * @param mixed $value - * @param string $className - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-template ExpectedType of object - * @psalm-param class-string $className - * @psalm-assert !ExpectedType $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function notIsInstanceOf($value, $className, $message = null, string $propertyPath = null): bool - { - if ($value instanceof $className) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" was not expected to be instanceof of "%s".'), - static::stringify($value), - $className - ); - - throw static::createException($value, $message, static::INVALID_NOT_INSTANCE_OF, $propertyPath, ['class' => $className]); - } - - return true; - } - - /** - * Assert that value is subclass of given class-name. - * - * @param mixed $value - * @param string $className - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function subclassOf($value, $className, $message = null, string $propertyPath = null): bool - { - if (!\is_subclass_of($value, $className)) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" was expected to be subclass of "%s".'), - static::stringify($value), - $className - ); - - throw static::createException($value, $message, static::INVALID_SUBCLASS_OF, $propertyPath, ['class' => $className]); - } - - return true; - } - - /** - * Assert that value is in range of numbers. - * - * @param mixed $value - * @param mixed $minValue - * @param mixed $maxValue - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =numeric $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function range($value, $minValue, $maxValue, $message = null, string $propertyPath = null): bool - { - static::numeric($value, $message, $propertyPath); - - if ($value < $minValue || $value > $maxValue) { - $message = \sprintf( - static::generateMessage($message ?: 'Number "%s" was expected to be at least "%d" and at most "%d".'), - static::stringify($value), - static::stringify($minValue), - static::stringify($maxValue) - ); - - throw static::createException($value, $message, static::INVALID_RANGE, $propertyPath, ['min' => $minValue, 'max' => $maxValue]); - } - - return true; - } - - /** - * Assert that a value is at least as big as a given limit. - * - * @param mixed $value - * @param mixed $minValue - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =numeric $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function min($value, $minValue, $message = null, string $propertyPath = null): bool - { - static::numeric($value, $message, $propertyPath); - - if ($value < $minValue) { - $message = \sprintf( - static::generateMessage($message ?: 'Number "%s" was expected to be at least "%s".'), - static::stringify($value), - static::stringify($minValue) - ); - - throw static::createException($value, $message, static::INVALID_MIN, $propertyPath, ['min' => $minValue]); - } - - return true; - } - - /** - * Assert that a number is smaller as a given limit. - * - * @param mixed $value - * @param mixed $maxValue - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =numeric $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function max($value, $maxValue, $message = null, string $propertyPath = null): bool - { - static::numeric($value, $message, $propertyPath); - - if ($value > $maxValue) { - $message = \sprintf( - static::generateMessage($message ?: 'Number "%s" was expected to be at most "%s".'), - static::stringify($value), - static::stringify($maxValue) - ); - - throw static::createException($value, $message, static::INVALID_MAX, $propertyPath, ['max' => $maxValue]); - } - - return true; - } - - /** - * Assert that a file exists. - * - * @param string $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function file($value, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - static::notEmpty($value, $message, $propertyPath); - - if (!\is_file($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'File "%s" was expected to exist.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_FILE, $propertyPath); - } - - return true; - } - - /** - * Assert that a directory exists. - * - * @param string $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function directory($value, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - - if (!\is_dir($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Path "%s" was expected to be a directory.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_DIRECTORY, $propertyPath); - } - - return true; - } - - /** - * Assert that the value is something readable. - * - * @param string $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function readable($value, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - - if (!\is_readable($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Path "%s" was expected to be readable.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_READABLE, $propertyPath); - } - - return true; - } - - /** - * Assert that the value is something writeable. - * - * @param string $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function writeable($value, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - - if (!\is_writable($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Path "%s" was expected to be writeable.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_WRITEABLE, $propertyPath); - } - - return true; - } - - /** - * Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL). - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function email($value, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - - if (!\filter_var($value, FILTER_VALIDATE_EMAIL)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" was expected to be a valid e-mail address.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_EMAIL, $propertyPath); - } - - return true; - } - - /** - * Assert that value is an URL. - * - * This code snipped was taken from the Symfony project and modified to the special demands of this method. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - * - * @see https://github.com/symfony/Validator/blob/master/Constraints/UrlValidator.php - * @see https://github.com/symfony/Validator/blob/master/Constraints/Url.php - */ - public static function url($value, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - - $protocols = ['http', 'https']; - - $pattern = '~^ - (%s):// # protocol - (([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth - ( - ([\pL\pN\pS\-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name - | # or - \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address - | # or - \[ - (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) - \] # an IPv6 address - ) - (:[0-9]+)? # a port (optional) - (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path - (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional) - (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional) - $~ixu'; - - $pattern = \sprintf($pattern, \implode('|', $protocols)); - - if (!\preg_match($pattern, $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" was expected to be a valid URL starting with http or https'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_URL, $propertyPath); - } - - return true; - } - - /** - * Assert that value is alphanumeric. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function alnum($value, $message = null, string $propertyPath = null): bool - { - try { - static::regex($value, '(^([a-zA-Z]{1}[a-zA-Z0-9]*)$)', $message, $propertyPath); - } catch (Throwable $e) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not alphanumeric, starting with letters and containing only letters and numbers.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_ALNUM, $propertyPath); - } - - return true; - } - - /** - * Assert that the value is boolean True. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert true $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function true($value, $message = null, string $propertyPath = null): bool - { - if (true !== $value) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not TRUE.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_TRUE, $propertyPath); - } - - return true; - } - - /** - * Assert that the value is boolean False. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert false $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function false($value, $message = null, string $propertyPath = null): bool - { - if (false !== $value) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not FALSE.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_FALSE, $propertyPath); - } - - return true; - } - - /** - * Assert that the class exists. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert class-string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function classExists($value, $message = null, string $propertyPath = null): bool - { - if (!\class_exists($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" does not exist.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_CLASS, $propertyPath); - } - - return true; - } - - /** - * Assert that the interface exists. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert class-string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function interfaceExists($value, $message = null, string $propertyPath = null): bool - { - if (!\interface_exists($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Interface "%s" does not exist.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_INTERFACE, $propertyPath); - } - - return true; - } - - /** - * Assert that the class implements the interface. - * - * @param mixed $class - * @param string $interfaceName - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function implementsInterface($class, $interfaceName, $message = null, string $propertyPath = null): bool - { - try { - $reflection = new ReflectionClass($class); - if (!$reflection->implementsInterface($interfaceName)) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" does not implement interface "%s".'), - static::stringify($class), - static::stringify($interfaceName) - ); - - throw static::createException($class, $message, static::INTERFACE_NOT_IMPLEMENTED, $propertyPath, ['interface' => $interfaceName]); - } - } catch (ReflectionException $e) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" failed reflection.'), - static::stringify($class) - ); - throw static::createException($class, $message, static::INTERFACE_NOT_IMPLEMENTED, $propertyPath, ['interface' => $interfaceName]); - } - - return true; - } - - /** - * Assert that the given string is a valid json string. - * - * NOTICE: - * Since this does a json_decode to determine its validity - * you probably should consider, when using the variable - * content afterwards, just to decode and check for yourself instead - * of using this assertion. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert =string $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function isJsonString($value, $message = null, string $propertyPath = null): bool - { - if (null === \json_decode($value) && JSON_ERROR_NONE !== \json_last_error()) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a valid JSON string.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_JSON_STRING, $propertyPath); - } - - return true; - } - - /** - * Assert that the given string is a valid UUID. - * - * Uses code from {@link https://github.com/ramsey/uuid} that is MIT licensed. - * - * @param string $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function uuid($value, $message = null, string $propertyPath = null): bool - { - $value = \str_replace(['urn:', 'uuid:', '{', '}'], '', $value); - - if ('00000000-0000-0000-0000-000000000000' === $value) { - return true; - } - - if (!\preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a valid UUID.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_UUID, $propertyPath); - } - - return true; - } - - /** - * Assert that the given string is a valid E164 Phone Number. - * - * @see https://en.wikipedia.org/wiki/E.164 - * - * @param string $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function e164($value, $message = null, string $propertyPath = null): bool - { - if (!\preg_match('/^\+?[1-9]\d{1,14}$/', $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" is not a valid E164.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_E164, $propertyPath); - } - - return true; - } - - /** - * Assert that the count of countable is equal to count. - * - * @param array|Countable|ResourceBundle|SimpleXMLElement $countable - * @param int $count - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function count($countable, $count, $message = null, string $propertyPath = null): bool - { - if ($count !== \count($countable)) { - $message = \sprintf( - static::generateMessage($message ?: 'List does not contain exactly %d elements (%d given).'), - static::stringify($count), - static::stringify(\count($countable)) - ); - - throw static::createException($countable, $message, static::INVALID_COUNT, $propertyPath, ['count' => $count]); - } - - return true; - } - - /** - * Assert that the countable have at least $count elements. - * - * @param array|Countable|ResourceBundle|SimpleXMLElement $countable - * @param int $count - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function minCount($countable, $count, $message = null, string $propertyPath = null): bool - { - if ($count > \count($countable)) { - $message = \sprintf( - static::generateMessage($message ?: 'List should have at least %d elements, but has %d elements.'), - static::stringify($count), - static::stringify(\count($countable)) - ); - - throw static::createException($countable, $message, static::INVALID_MIN_COUNT, $propertyPath, ['count' => $count]); - } - - return true; - } - - /** - * Assert that the countable have at most $count elements. - * - * @param array|Countable|ResourceBundle|SimpleXMLElement $countable - * @param int $count - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function maxCount($countable, $count, $message = null, string $propertyPath = null): bool - { - if ($count < \count($countable)) { - $message = \sprintf( - static::generateMessage($message ?: 'List should have at most %d elements, but has %d elements.'), - static::stringify($count), - static::stringify(\count($countable)) - ); - - throw static::createException($countable, $message, static::INVALID_MAX_COUNT, $propertyPath, ['count' => $count]); - } - - return true; - } - - /** - * static call handler to implement: - * - "null or assertion" delegation - * - "all" delegation. - * - * @param string $method - * @param array $args - * - * @return bool|mixed - * - * @throws AssertionFailedException - */ - public static function __callStatic($method, $args) - { - if (0 === \strpos($method, 'nullOr')) { - if (!\array_key_exists(0, $args)) { - throw new BadMethodCallException('Missing the first argument.'); - } - - if (null === $args[0]) { - return true; - } - - $method = \substr($method, 6); - - return \call_user_func_array([\get_called_class(), $method], $args); - } - - if (0 === \strpos($method, 'all')) { - if (!\array_key_exists(0, $args)) { - throw new BadMethodCallException('Missing the first argument.'); - } - - static::isTraversable($args[0]); - - $method = \substr($method, 3); - $values = \array_shift($args); - $calledClass = \get_called_class(); - - foreach ($values as $value) { - \call_user_func_array([$calledClass, $method], \array_merge([$value], $args)); - } - - return true; - } - - throw new BadMethodCallException('No assertion Assertion#'.$method.' exists.'); - } - - /** - * Determines if the values array has every choice as key and that this choice has content. - * - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function choicesNotEmpty(array $values, array $choices, $message = null, string $propertyPath = null): bool - { - static::notEmpty($values, $message, $propertyPath); - - foreach ($choices as $choice) { - static::notEmptyKey($values, $choice, $message, $propertyPath); - } - - return true; - } - - /** - * Determines that the named method is defined in the provided object. - * - * @param string $value - * @param mixed $object - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function methodExists($value, $object, $message = null, string $propertyPath = null): bool - { - static::isObject($object, $message, $propertyPath); - - if (!\method_exists($object, $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Expected "%s" does not exist in provided object.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_METHOD, $propertyPath, ['object' => \get_class($object)]); - } - - return true; - } - - /** - * Determines that the provided value is an object. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert object $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function isObject($value, $message = null, string $propertyPath = null): bool - { - if (!\is_object($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is not a valid object.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_OBJECT, $propertyPath); - } - - return true; - } - - /** - * Determines if the value is less than given limit. - * - * @param mixed $value - * @param mixed $limit - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function lessThan($value, $limit, $message = null, string $propertyPath = null): bool - { - if ($value >= $limit) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is not less than "%s".'), - static::stringify($value), - static::stringify($limit) - ); - - throw static::createException($value, $message, static::INVALID_LESS, $propertyPath, ['limit' => $limit]); - } - - return true; - } - - /** - * Determines if the value is less or equal than given limit. - * - * @param mixed $value - * @param mixed $limit - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function lessOrEqualThan($value, $limit, $message = null, string $propertyPath = null): bool - { - if ($value > $limit) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is not less or equal than "%s".'), - static::stringify($value), - static::stringify($limit) - ); - - throw static::createException($value, $message, static::INVALID_LESS_OR_EQUAL, $propertyPath, ['limit' => $limit]); - } - - return true; - } - - /** - * Determines if the value is greater than given limit. - * - * @param mixed $value - * @param mixed $limit - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function greaterThan($value, $limit, $message = null, string $propertyPath = null): bool - { - if ($value <= $limit) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is not greater than "%s".'), - static::stringify($value), - static::stringify($limit) - ); - - throw static::createException($value, $message, static::INVALID_GREATER, $propertyPath, ['limit' => $limit]); - } - - return true; - } - - /** - * Determines if the value is greater or equal than given limit. - * - * @param mixed $value - * @param mixed $limit - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function greaterOrEqualThan($value, $limit, $message = null, string $propertyPath = null): bool - { - if ($value < $limit) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is not greater or equal than "%s".'), - static::stringify($value), - static::stringify($limit) - ); - - throw static::createException($value, $message, static::INVALID_GREATER_OR_EQUAL, $propertyPath, ['limit' => $limit]); - } - - return true; - } - - /** - * Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit. - * - * @param mixed $value - * @param mixed $lowerLimit - * @param mixed $upperLimit - * @param string|callable|null $message - * @param string $propertyPath - * - * @throws AssertionFailedException - */ - public static function between($value, $lowerLimit, $upperLimit, $message = null, string $propertyPath = null): bool - { - if ($lowerLimit > $value || $value > $upperLimit) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is neither greater than or equal to "%s" nor less than or equal to "%s".'), - static::stringify($value), - static::stringify($lowerLimit), - static::stringify($upperLimit) - ); - - throw static::createException($value, $message, static::INVALID_BETWEEN, $propertyPath, ['lower' => $lowerLimit, 'upper' => $upperLimit]); - } - - return true; - } - - /** - * Assert that a value is greater than a lower limit, and less than an upper limit. - * - * @param mixed $value - * @param mixed $lowerLimit - * @param mixed $upperLimit - * @param string|callable|null $message - * @param string $propertyPath - * - * @throws AssertionFailedException - */ - public static function betweenExclusive($value, $lowerLimit, $upperLimit, $message = null, string $propertyPath = null): bool - { - if ($lowerLimit >= $value || $value >= $upperLimit) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is neither greater than "%s" nor less than "%s".'), - static::stringify($value), - static::stringify($lowerLimit), - static::stringify($upperLimit) - ); - - throw static::createException($value, $message, static::INVALID_BETWEEN_EXCLUSIVE, $propertyPath, ['lower' => $lowerLimit, 'upper' => $upperLimit]); - } - - return true; - } - - /** - * Assert that extension is loaded. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function extensionLoaded($value, $message = null, string $propertyPath = null): bool - { - if (!\extension_loaded($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Extension "%s" is required.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_EXTENSION, $propertyPath); - } - - return true; - } - - /** - * Assert that date is valid and corresponds to the given format. - * - * @param string $value - * @param string $format supports all of the options date(), except for the following: - * N, w, W, t, L, o, B, a, A, g, h, I, O, P, Z, c, r - * @param string|callable|null $message - * - * @throws AssertionFailedException - * - * @see http://php.net/manual/function.date.php#refsect1-function.date-parameters - */ - public static function date($value, $format, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - static::string($format, $message, $propertyPath); - - $dateTime = DateTime::createFromFormat('!'.$format, $value); - - if (false === $dateTime || $value !== $dateTime->format($format)) { - $message = \sprintf( - static::generateMessage($message ?: 'Date "%s" is invalid or does not match format "%s".'), - static::stringify($value), - static::stringify($format) - ); - - throw static::createException($value, $message, static::INVALID_DATE, $propertyPath, ['format' => $format]); - } - - return true; - } - - /** - * Assert that the value is an object, or a class that exists. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function objectOrClass($value, $message = null, string $propertyPath = null): bool - { - if (!\is_object($value)) { - static::classExists($value, $message, $propertyPath); - } - - return true; - } - - /** - * Assert that the value is an object or class, and that the property exists. - * - * @param mixed $value - * @param string $property - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function propertyExists($value, $property, $message = null, string $propertyPath = null): bool - { - static::objectOrClass($value); - - if (!\property_exists($value, $property)) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" does not have property "%s".'), - static::stringify($value), - static::stringify($property) - ); - - throw static::createException($value, $message, static::INVALID_PROPERTY, $propertyPath, ['property' => $property]); - } - - return true; - } - - /** - * Assert that the value is an object or class, and that the properties all exist. - * - * @param mixed $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function propertiesExist($value, array $properties, $message = null, string $propertyPath = null): bool - { - static::objectOrClass($value); - static::allString($properties, $message, $propertyPath); - - $invalidProperties = []; - foreach ($properties as $property) { - if (!\property_exists($value, $property)) { - $invalidProperties[] = $property; - } - } - - if ($invalidProperties) { - $message = \sprintf( - static::generateMessage($message ?: 'Class "%s" does not have these properties: %s.'), - static::stringify($value), - static::stringify(\implode(', ', $invalidProperties)) - ); - - throw static::createException($value, $message, static::INVALID_PROPERTY, $propertyPath, ['properties' => $properties]); - } - - return true; - } - - /** - * Assert comparison of two versions. - * - * @param string $version1 - * @param string $operator - * @param string $version2 - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function version($version1, $operator, $version2, $message = null, string $propertyPath = null): bool - { - static::notEmpty($operator, 'versionCompare operator is required and cannot be empty.'); - - if (true !== \version_compare($version1, $version2, $operator)) { - $message = \sprintf( - static::generateMessage($message ?: 'Version "%s" is not "%s" version "%s".'), - static::stringify($version1), - static::stringify($operator), - static::stringify($version2) - ); - - throw static::createException($version1, $message, static::INVALID_VERSION, $propertyPath, ['operator' => $operator, 'version' => $version2]); - } - - return true; - } - - /** - * Assert on PHP version. - * - * @param string $operator - * @param mixed $version - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function phpVersion($operator, $version, $message = null, string $propertyPath = null): bool - { - static::defined('PHP_VERSION'); - - return static::version(PHP_VERSION, $operator, $version, $message, $propertyPath); - } - - /** - * Assert that extension is loaded and a specific version is installed. - * - * @param string $extension - * @param string $operator - * @param mixed $version - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function extensionVersion($extension, $operator, $version, $message = null, string $propertyPath = null): bool - { - static::extensionLoaded($extension, $message, $propertyPath); - - return static::version(\phpversion($extension), $operator, $version, $message, $propertyPath); - } - - /** - * Determines that the provided value is callable. - * - * @param mixed $value - * @param string|callable|null $message - * @param string|null $propertyPath - * - * @psalm-assert callable $value - * - * @return bool - * - * @throws AssertionFailedException - */ - public static function isCallable($value, $message = null, string $propertyPath = null): bool - { - if (!\is_callable($value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is not a callable.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_CALLABLE, $propertyPath); - } - - return true; - } - - /** - * Assert that the provided value is valid according to a callback. - * - * If the callback returns `false` the assertion will fail. - * - * @param mixed $value - * @param callable $callback - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function satisfy($value, $callback, $message = null, string $propertyPath = null): bool - { - static::isCallable($callback); - - if (false === \call_user_func($callback, $value)) { - $message = \sprintf( - static::generateMessage($message ?: 'Provided "%s" is invalid according to custom rule.'), - static::stringify($value) - ); - - throw static::createException($value, $message, static::INVALID_SATISFY, $propertyPath); - } - - return true; - } - - /** - * Assert that value is an IPv4 or IPv6 address - * (using input_filter/FILTER_VALIDATE_IP). - * - * @param string $value - * @param int|null $flag - * @param string|callable|null $message - * - * @throws AssertionFailedException - * - * @see http://php.net/manual/filter.filters.flags.php - */ - public static function ip($value, $flag = null, $message = null, string $propertyPath = null): bool - { - static::string($value, $message, $propertyPath); - if ($flag === null) { - $filterVarResult = \filter_var($value, FILTER_VALIDATE_IP); - } else { - $filterVarResult = \filter_var($value, FILTER_VALIDATE_IP, $flag); - } - if (!$filterVarResult) { - $message = \sprintf( - static::generateMessage($message ?: 'Value "%s" was expected to be a valid IP address.'), - static::stringify($value) - ); - throw static::createException($value, $message, static::INVALID_IP, $propertyPath, ['flag' => $flag]); - } - - return true; - } - - /** - * Assert that value is an IPv4 address - * (using input_filter/FILTER_VALIDATE_IP). - * - * @param string $value - * @param int|null $flag - * @param string|callable|null $message - * - * @throws AssertionFailedException - * - * @see http://php.net/manual/filter.filters.flags.php - */ - public static function ipv4($value, $flag = null, $message = null, string $propertyPath = null): bool - { - static::ip($value, $flag | FILTER_FLAG_IPV4, static::generateMessage($message ?: 'Value "%s" was expected to be a valid IPv4 address.'), $propertyPath); - - return true; - } - - /** - * Assert that value is an IPv6 address - * (using input_filter/FILTER_VALIDATE_IP). - * - * @param string $value - * @param int|null $flag - * @param string|callable|null $message - * - * @throws AssertionFailedException - * - * @see http://php.net/manual/filter.filters.flags.php - */ - public static function ipv6($value, $flag = null, $message = null, string $propertyPath = null): bool - { - static::ip($value, $flag | FILTER_FLAG_IPV6, static::generateMessage($message ?: 'Value "%s" was expected to be a valid IPv6 address.'), $propertyPath); - - return true; - } - - /** - * Assert that a constant is defined. - * - * @param mixed $constant - * @param string|callable|null $message - */ - public static function defined($constant, $message = null, string $propertyPath = null): bool - { - if (!\defined($constant)) { - $message = \sprintf(static::generateMessage($message ?: 'Value "%s" expected to be a defined constant.'), $constant); - - throw static::createException($constant, $message, static::INVALID_CONSTANT, $propertyPath); - } - - return true; - } - - /** - * Assert that a constant is defined. - * - * @param string $value - * @param string|callable|null $message - * - * @throws AssertionFailedException - */ - public static function base64($value, $message = null, string $propertyPath = null): bool - { - if (false === \base64_decode($value, true)) { - $message = \sprintf(static::generateMessage($message ?: 'Value "%s" is not a valid base64 string.'), $value); - - throw static::createException($value, $message, static::INVALID_BASE64, $propertyPath); - } - - return true; - } - - /** - * Helper method that handles building the assertion failure exceptions. - * They are returned from this method so that the stack trace still shows - * the assertions method. - * - * @param mixed $value - * @param string|callable|null $message - * @param int $code - * - * @return mixed - */ - protected static function createException($value, $message, $code, $propertyPath = null, array $constraints = []) - { - $exceptionClass = static::$exceptionClass; - - return new $exceptionClass($message, $code, $propertyPath, $value, $constraints); - } - - /** - * Make a string version of a value. - * - * @param mixed $value - */ - protected static function stringify($value): string - { - $result = \gettype($value); - - if (\is_bool($value)) { - $result = $value ? '' : ''; - } elseif (\is_scalar($value)) { - $val = (string)$value; - - if (\mb_strlen($val) > 100) { - $val = \mb_substr($val, 0, 97).'...'; - } - - $result = $val; - } elseif (\is_array($value)) { - $result = ''; - } elseif (\is_object($value)) { - $result = \get_class($value); - } elseif (\is_resource($value)) { - $result = \get_resource_type($value); - } elseif (null === $value) { - $result = ''; - } - - return $result; - } - - /** - * Generate the message. - * - * @param string|callable|null $message - */ - protected static function generateMessage($message): string - { - if (\is_callable($message)) { - $traces = \debug_backtrace(0); - - $parameters = []; - - try { - $reflection = new ReflectionClass($traces[1]['class']); - $method = $reflection->getMethod($traces[1]['function']); - foreach ($method->getParameters() as $index => $parameter) { - if ('message' !== $parameter->getName()) { - $parameters[$parameter->getName()] = \array_key_exists($index, $traces[1]['args']) - ? $traces[1]['args'][$index] - : $parameter->getDefaultValue(); - } - } - - $parameters['::assertion'] = \sprintf('%s%s%s', $traces[1]['class'], $traces[1]['type'], $traces[1]['function']); - - $message = \call_user_func_array($message, [$parameters]); - } // @codeCoverageIgnoreStart - catch (Throwable $exception) { - $message = \sprintf('Unable to generate message : %s', $exception->getMessage()); - } // @codeCoverageIgnoreEnd - } - - return (string)$message; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/AssertionChain.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/AssertionChain.php deleted file mode 100644 index 4c444350..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/AssertionChain.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * @method AssertionChain alnum(string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric. - * @method AssertionChain base64(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined. - * @method AssertionChain between(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit. - * @method AssertionChain betweenExclusive(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit. - * @method AssertionChain betweenLength(int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths. - * @method AssertionChain boolean(string|callable $message = null, string $propertyPath = null) Assert that value is php boolean. - * @method AssertionChain choice(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. - * @method AssertionChain choicesNotEmpty(array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content. - * @method AssertionChain classExists(string|callable $message = null, string $propertyPath = null) Assert that the class exists. - * @method AssertionChain contains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars. - * @method AssertionChain count(int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count. - * @method AssertionChain date(string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format. - * @method AssertionChain defined(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined. - * @method AssertionChain digit(string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit. - * @method AssertionChain directory(string|callable $message = null, string $propertyPath = null) Assert that a directory exists. - * @method AssertionChain e164(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number. - * @method AssertionChain email(string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL). - * @method AssertionChain endsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars. - * @method AssertionChain eq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==). - * @method AssertionChain eqArraySubset(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset. - * @method AssertionChain extensionLoaded(string|callable $message = null, string $propertyPath = null) Assert that extension is loaded. - * @method AssertionChain extensionVersion(string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed. - * @method AssertionChain false(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False. - * @method AssertionChain file(string|callable $message = null, string $propertyPath = null) Assert that a file exists. - * @method AssertionChain float(string|callable $message = null, string $propertyPath = null) Assert that value is a php float. - * @method AssertionChain greaterOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit. - * @method AssertionChain greaterThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit. - * @method AssertionChain implementsInterface(string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface. - * @method AssertionChain inArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice(). - * @method AssertionChain integer(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer. - * @method AssertionChain integerish(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish. - * @method AssertionChain interfaceExists(string|callable $message = null, string $propertyPath = null) Assert that the interface exists. - * @method AssertionChain ip(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address. - * @method AssertionChain ipv4(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address. - * @method AssertionChain ipv6(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address. - * @method AssertionChain isArray(string|callable $message = null, string $propertyPath = null) Assert that value is an array. - * @method AssertionChain isArrayAccessible(string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object. - * @method AssertionChain isCallable(string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable. - * @method AssertionChain isCountable(string|callable $message = null, string $propertyPath = null) Assert that value is countable. - * @method AssertionChain isInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name. - * @method AssertionChain isJsonString(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string. - * @method AssertionChain isObject(string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object. - * @method AssertionChain isResource(string|callable $message = null, string $propertyPath = null) Assert that value is a resource. - * @method AssertionChain isTraversable(string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object. - * @method AssertionChain keyExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array. - * @method AssertionChain keyIsset(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset(). - * @method AssertionChain keyNotExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array. - * @method AssertionChain length(int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length. - * @method AssertionChain lessOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit. - * @method AssertionChain lessThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit. - * @method AssertionChain max(mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit. - * @method AssertionChain maxCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements. - * @method AssertionChain maxLength(int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars. - * @method AssertionChain methodExists(mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object. - * @method AssertionChain min(mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit. - * @method AssertionChain minCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements. - * @method AssertionChain minLength(int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long. - * @method AssertionChain noContent(string|callable $message = null, string $propertyPath = null) Assert that value is empty. - * @method AssertionChain notBlank(string|callable $message = null, string $propertyPath = null) Assert that value is not blank. - * @method AssertionChain notContains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars. - * @method AssertionChain notEmpty(string|callable $message = null, string $propertyPath = null) Assert that value is not empty. - * @method AssertionChain notEmptyKey(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty. - * @method AssertionChain notEq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==). - * @method AssertionChain notInArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices. - * @method AssertionChain notIsInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name. - * @method AssertionChain notNull(string|callable $message = null, string $propertyPath = null) Assert that value is not null. - * @method AssertionChain notRegex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex. - * @method AssertionChain notSame(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===). - * @method AssertionChain null(string|callable $message = null, string $propertyPath = null) Assert that value is null. - * @method AssertionChain numeric(string|callable $message = null, string $propertyPath = null) Assert that value is numeric. - * @method AssertionChain objectOrClass(string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists. - * @method AssertionChain phpVersion(mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version. - * @method AssertionChain propertiesExist(array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist. - * @method AssertionChain propertyExists(string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists. - * @method AssertionChain range(mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers. - * @method AssertionChain readable(string|callable $message = null, string $propertyPath = null) Assert that the value is something readable. - * @method AssertionChain regex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex. - * @method AssertionChain same(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===). - * @method AssertionChain satisfy(callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback. - * @method AssertionChain scalar(string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar. - * @method AssertionChain startsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars. - * @method AssertionChain string(string|callable $message = null, string $propertyPath = null) Assert that value is a string. - * @method AssertionChain subclassOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name. - * @method AssertionChain true(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True. - * @method AssertionChain uniqueValues(string|callable $message = null, string $propertyPath = null) Assert that values in array are unique (using strict equality). - * @method AssertionChain url(string|callable $message = null, string $propertyPath = null) Assert that value is an URL. - * @method AssertionChain uuid(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID. - * @method AssertionChain version(string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions. - * @method AssertionChain writeable(string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable. - */ -class AssertionChain -{ - /** - * @var mixed - */ - private $value; - - /** - * @var string|callable|null - */ - private $defaultMessage; - - /** - * @var string|null - */ - private $defaultPropertyPath; - - /** - * Return each assertion as always valid. - * - * @var bool - */ - private $alwaysValid = false; - - /** - * Perform assertion on every element of array or traversable. - * - * @var bool - */ - private $all = false; - - /** @var string|Assertion Class to use for assertion calls */ - private $assertionClassName = 'Assert\Assertion'; - - /** - * AssertionChain constructor. - * - * @param mixed $value - * @param string|callable|null $defaultMessage - */ - public function __construct($value, $defaultMessage = null, string $defaultPropertyPath = null) - { - $this->value = $value; - $this->defaultMessage = $defaultMessage; - $this->defaultPropertyPath = $defaultPropertyPath; - } - - /** - * Call assertion on the current value in the chain. - * - * @param string $methodName - * @param array $args - */ - public function __call($methodName, $args): AssertionChain - { - if (true === $this->alwaysValid) { - return $this; - } - - try { - $method = new \ReflectionMethod($this->assertionClassName, $methodName); - } catch (\ReflectionException $exception) { - throw new \RuntimeException("Assertion '".$methodName."' does not exist."); - } - - \array_unshift($args, $this->value); - $params = $method->getParameters(); - - foreach ($params as $idx => $param) { - if (isset($args[$idx])) { - continue; - } - - switch ($param->getName()) { - case 'message': - $args[$idx] = $this->defaultMessage; - break; - case 'propertyPath': - $args[$idx] = $this->defaultPropertyPath; - break; - } - } - - if ($this->all) { - $methodName = 'all'.$methodName; - } - - \call_user_func_array([$this->assertionClassName, $methodName], $args); - - return $this; - } - - /** - * Switch chain into validation mode for an array of values. - */ - public function all(): AssertionChain - { - $this->all = true; - - return $this; - } - - /** - * Switch chain into mode allowing nulls, ignoring further assertions. - */ - public function nullOr(): AssertionChain - { - if (null === $this->value) { - $this->alwaysValid = true; - } - - return $this; - } - - /** - * @param string $className - * - * @return $this - */ - public function setAssertionClassName($className): AssertionChain - { - if (!\is_string($className)) { - throw new LogicException('Exception class name must be passed as a string'); - } - - if (Assertion::class !== $className && !\is_subclass_of($className, Assertion::class)) { - throw new LogicException($className.' is not (a subclass of) '.Assertion::class); - } - - $this->assertionClassName = $className; - - return $this; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/AssertionFailedException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/AssertionFailedException.php deleted file mode 100644 index 7e0b2ec3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/AssertionFailedException.php +++ /dev/null @@ -1,32 +0,0 @@ -propertyPath = $propertyPath; - $this->value = $value; - $this->constraints = $constraints; - } - - /** - * User controlled way to define a sub-property causing - * the failure of a currently asserted objects. - * - * Useful to transport information about the nature of the error - * back to higher layers. - * - * @return string|null - */ - public function getPropertyPath() - { - return $this->propertyPath; - } - - /** - * Get the value that caused the assertion to fail. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * Get the constraints that applied to the failed assertion. - */ - public function getConstraints(): array - { - return $this->constraints; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/LazyAssertion.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/LazyAssertion.php deleted file mode 100644 index b3052178..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/LazyAssertion.php +++ /dev/null @@ -1,228 +0,0 @@ - - * - * @method LazyAssertion alnum(string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric. - * @method LazyAssertion base64(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined. - * @method LazyAssertion between(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit. - * @method LazyAssertion betweenExclusive(mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit. - * @method LazyAssertion betweenLength(int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths. - * @method LazyAssertion boolean(string|callable $message = null, string $propertyPath = null) Assert that value is php boolean. - * @method LazyAssertion choice(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. - * @method LazyAssertion choicesNotEmpty(array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content. - * @method LazyAssertion classExists(string|callable $message = null, string $propertyPath = null) Assert that the class exists. - * @method LazyAssertion contains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars. - * @method LazyAssertion count(int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count. - * @method LazyAssertion date(string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format. - * @method LazyAssertion defined(string|callable $message = null, string $propertyPath = null) Assert that a constant is defined. - * @method LazyAssertion digit(string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit. - * @method LazyAssertion directory(string|callable $message = null, string $propertyPath = null) Assert that a directory exists. - * @method LazyAssertion e164(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number. - * @method LazyAssertion email(string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL). - * @method LazyAssertion endsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars. - * @method LazyAssertion eq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==). - * @method LazyAssertion eqArraySubset(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset. - * @method LazyAssertion extensionLoaded(string|callable $message = null, string $propertyPath = null) Assert that extension is loaded. - * @method LazyAssertion extensionVersion(string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed. - * @method LazyAssertion false(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False. - * @method LazyAssertion file(string|callable $message = null, string $propertyPath = null) Assert that a file exists. - * @method LazyAssertion float(string|callable $message = null, string $propertyPath = null) Assert that value is a php float. - * @method LazyAssertion greaterOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit. - * @method LazyAssertion greaterThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit. - * @method LazyAssertion implementsInterface(string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface. - * @method LazyAssertion inArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice(). - * @method LazyAssertion integer(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer. - * @method LazyAssertion integerish(string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish. - * @method LazyAssertion interfaceExists(string|callable $message = null, string $propertyPath = null) Assert that the interface exists. - * @method LazyAssertion ip(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address. - * @method LazyAssertion ipv4(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address. - * @method LazyAssertion ipv6(int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address. - * @method LazyAssertion isArray(string|callable $message = null, string $propertyPath = null) Assert that value is an array. - * @method LazyAssertion isArrayAccessible(string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object. - * @method LazyAssertion isCallable(string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable. - * @method LazyAssertion isCountable(string|callable $message = null, string $propertyPath = null) Assert that value is countable. - * @method LazyAssertion isInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name. - * @method LazyAssertion isJsonString(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string. - * @method LazyAssertion isObject(string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object. - * @method LazyAssertion isResource(string|callable $message = null, string $propertyPath = null) Assert that value is a resource. - * @method LazyAssertion isTraversable(string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object. - * @method LazyAssertion keyExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array. - * @method LazyAssertion keyIsset(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset(). - * @method LazyAssertion keyNotExists(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array. - * @method LazyAssertion length(int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length. - * @method LazyAssertion lessOrEqualThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit. - * @method LazyAssertion lessThan(mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit. - * @method LazyAssertion max(mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit. - * @method LazyAssertion maxCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements. - * @method LazyAssertion maxLength(int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars. - * @method LazyAssertion methodExists(mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object. - * @method LazyAssertion min(mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit. - * @method LazyAssertion minCount(int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements. - * @method LazyAssertion minLength(int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long. - * @method LazyAssertion noContent(string|callable $message = null, string $propertyPath = null) Assert that value is empty. - * @method LazyAssertion notBlank(string|callable $message = null, string $propertyPath = null) Assert that value is not blank. - * @method LazyAssertion notContains(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars. - * @method LazyAssertion notEmpty(string|callable $message = null, string $propertyPath = null) Assert that value is not empty. - * @method LazyAssertion notEmptyKey(string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty. - * @method LazyAssertion notEq(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==). - * @method LazyAssertion notInArray(array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices. - * @method LazyAssertion notIsInstanceOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name. - * @method LazyAssertion notNull(string|callable $message = null, string $propertyPath = null) Assert that value is not null. - * @method LazyAssertion notRegex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex. - * @method LazyAssertion notSame(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===). - * @method LazyAssertion null(string|callable $message = null, string $propertyPath = null) Assert that value is null. - * @method LazyAssertion numeric(string|callable $message = null, string $propertyPath = null) Assert that value is numeric. - * @method LazyAssertion objectOrClass(string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists. - * @method LazyAssertion phpVersion(mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version. - * @method LazyAssertion propertiesExist(array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist. - * @method LazyAssertion propertyExists(string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists. - * @method LazyAssertion range(mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers. - * @method LazyAssertion readable(string|callable $message = null, string $propertyPath = null) Assert that the value is something readable. - * @method LazyAssertion regex(string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex. - * @method LazyAssertion same(mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===). - * @method LazyAssertion satisfy(callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback. - * @method LazyAssertion scalar(string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar. - * @method LazyAssertion startsWith(string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars. - * @method LazyAssertion string(string|callable $message = null, string $propertyPath = null) Assert that value is a string. - * @method LazyAssertion subclassOf(string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name. - * @method LazyAssertion true(string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True. - * @method LazyAssertion uniqueValues(string|callable $message = null, string $propertyPath = null) Assert that values in array are unique (using strict equality). - * @method LazyAssertion url(string|callable $message = null, string $propertyPath = null) Assert that value is an URL. - * @method LazyAssertion uuid(string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID. - * @method LazyAssertion version(string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions. - * @method LazyAssertion writeable(string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable. - * @method LazyAssertion all() Switch chain into validation mode for an array of values. - * @method LazyAssertion nullOr() Switch chain into mode allowing nulls, ignoring further assertions. - */ -class LazyAssertion -{ - private $currentChainFailed = false; - private $alwaysTryAll = false; - private $thisChainTryAll = false; - private $currentChain; - private $errors = []; - - /** @var string The class to use as AssertionChain factory */ - private $assertClass = Assert::class; - - /** @var string|LazyAssertionException The class to use for exceptions */ - private $exceptionClass = LazyAssertionException::class; - - /** - * @param mixed $value - * @param string|callable|null $defaultMessage - * - * @return static - */ - public function that($value, string $propertyPath = null, $defaultMessage = null) - { - $this->currentChainFailed = false; - $this->thisChainTryAll = false; - $assertClass = $this->assertClass; - $this->currentChain = $assertClass::that($value, $defaultMessage, $propertyPath); - - return $this; - } - - /** - * @return static - */ - public function tryAll() - { - if (!$this->currentChain) { - $this->alwaysTryAll = true; - } - - $this->thisChainTryAll = true; - - return $this; - } - - /** - * @param string $method - * @param array $args - * - * @return static - */ - public function __call($method, $args) - { - if (false === $this->alwaysTryAll - && false === $this->thisChainTryAll - && true === $this->currentChainFailed - ) { - return $this; - } - - try { - \call_user_func_array([$this->currentChain, $method], $args); - } catch (AssertionFailedException $e) { - $this->errors[] = $e; - $this->currentChainFailed = true; - } - - return $this; - } - - /** - * @throws LazyAssertionException - */ - public function verifyNow(): bool - { - if ($this->errors) { - throw \call_user_func([$this->exceptionClass, 'fromErrors'], $this->errors); - } - - return true; - } - - /** - * @param string $className - * - * @return static - */ - public function setAssertClass(string $className): LazyAssertion - { - if (Assert::class !== $className && !\is_subclass_of($className, Assert::class)) { - throw new LogicException($className.' is not (a subclass of) '.Assert::class); - } - - $this->assertClass = $className; - - return $this; - } - - /** - * @param string $className - * - * @return static - */ - public function setExceptionClass(string $className): LazyAssertion - { - if (LazyAssertionException::class !== $className && !\is_subclass_of($className, LazyAssertionException::class)) { - throw new LogicException($className.' is not (a subclass of) '.LazyAssertionException::class); - } - - $this->exceptionClass = $className; - - return $this; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/LazyAssertionException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/LazyAssertionException.php deleted file mode 100644 index 2ba59dd7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/LazyAssertionException.php +++ /dev/null @@ -1,53 +0,0 @@ -getPropertyPath(), $error->getMessage()); - } - - return new static($message, $errors); - } - - public function __construct($message, array $errors) - { - parent::__construct($message, 0, null, null); - - $this->errors = $errors; - } - - /** - * @return InvalidArgumentException[] - */ - public function getErrorExceptions(): array - { - return $this->errors; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/functions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/functions.php deleted file mode 100644 index 1a4e84d9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/beberlei/assert/lib/Assert/functions.php +++ /dev/null @@ -1,72 +0,0 @@ -notEmpty()->integer(); - * \Assert\that($value)->nullOr()->string()->startsWith("Foo"); - * - * The assertion chain can be stateful, that means be careful when you reuse - * it. You should never pass around the chain. - */ -function that($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain -{ - return Assert::that($value, $defaultMessage, $defaultPropertyPath); -} - -/** - * Start validation on a set of values, returns {@link AssertionChain}. - * - * @param mixed $values - * @param string|callable|null $defaultMessage - * @param string $defaultPropertyPath - */ -function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain -{ - return Assert::thatAll($values, $defaultMessage, $defaultPropertyPath); -} - -/** - * Start validation and allow NULL, returns {@link AssertionChain}. - * - * @param mixed $value - * @param string|callable|null $defaultMessage - * @param string $defaultPropertyPath - * - * @deprecated In favour of Assert::thatNullOr($value, $defaultMessage = null, $defaultPropertyPath = null) - */ -function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain -{ - return Assert::thatNullOr($value, $defaultMessage, $defaultPropertyPath); -} - -/** - * Create a lazy assertion object. - */ -function lazy(): LazyAssertion -{ - return Assert::lazy(); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/CHANGELOG.md deleted file mode 100644 index 03c3d824..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/CHANGELOG.md +++ /dev/null @@ -1,415 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -## [0.9.3](https://github.com/brick/math/releases/tag/0.9.3) - 2021-08-15 - -🚀 **Compatibility with PHP 8.1** - -- Support for custom object serialization; this removes a warning on PHP 8.1 due to the `Serializable` interface being deprecated (thanks @TRowbotham) - -## [0.9.2](https://github.com/brick/math/releases/tag/0.9.2) - 2021-01-20 - -🐛 **Bug fix** - -- Incorrect results could be returned when using the BCMath calculator, with a default scale set with `bcscale()`, on PHP >= 7.2 (#55). - -## [0.9.1](https://github.com/brick/math/releases/tag/0.9.1) - 2020-08-19 - -✨ New features - -- `BigInteger::not()` returns the bitwise `NOT` value - -🐛 **Bug fixes** - -- `BigInteger::toBytes()` could return an incorrect binary representation for some numbers -- The bitwise operations `and()`, `or()`, `xor()` on `BigInteger` could return an incorrect result when the GMP extension is not available - -## [0.9.0](https://github.com/brick/math/releases/tag/0.9.0) - 2020-08-18 - -👌 **Improvements** - -- `BigNumber::of()` now accepts `.123` and `123.` formats, both of which return a `BigDecimal` - -💥 **Breaking changes** - -- Deprecated method `BigInteger::powerMod()` has been removed - use `modPow()` instead -- Deprecated method `BigInteger::parse()` has been removed - use `fromBase()` instead - -## [0.8.17](https://github.com/brick/math/releases/tag/0.8.17) - 2020-08-19 - -🐛 **Bug fix** - -- `BigInteger::toBytes()` could return an incorrect binary representation for some numbers -- The bitwise operations `and()`, `or()`, `xor()` on `BigInteger` could return an incorrect result when the GMP extension is not available - -## [0.8.16](https://github.com/brick/math/releases/tag/0.8.16) - 2020-08-18 - -🚑 **Critical fix** - -- This version reintroduces the deprecated `BigInteger::parse()` method, that has been removed by mistake in version `0.8.9` and should have lasted for the whole `0.8` release cycle. - -✨ **New features** - -- `BigInteger::modInverse()` calculates a modular multiplicative inverse -- `BigInteger::fromBytes()` creates a `BigInteger` from a byte string -- `BigInteger::toBytes()` converts a `BigInteger` to a byte string -- `BigInteger::randomBits()` creates a pseudo-random `BigInteger` of a given bit length -- `BigInteger::randomRange()` creates a pseudo-random `BigInteger` between two bounds - -💩 **Deprecations** - -- `BigInteger::powerMod()` is now deprecated in favour of `modPow()` - -## [0.8.15](https://github.com/brick/math/releases/tag/0.8.15) - 2020-04-15 - -🐛 **Fixes** - -- added missing `ext-json` requirement, due to `BigNumber` implementing `JsonSerializable` - -⚡️ **Optimizations** - -- additional optimization in `BigInteger::remainder()` - -## [0.8.14](https://github.com/brick/math/releases/tag/0.8.14) - 2020-02-18 - -✨ **New features** - -- `BigInteger::getLowestSetBit()` returns the index of the rightmost one bit - -## [0.8.13](https://github.com/brick/math/releases/tag/0.8.13) - 2020-02-16 - -✨ **New features** - -- `BigInteger::isEven()` tests whether the number is even -- `BigInteger::isOdd()` tests whether the number is odd -- `BigInteger::testBit()` tests if a bit is set -- `BigInteger::getBitLength()` returns the number of bits in the minimal representation of the number - -## [0.8.12](https://github.com/brick/math/releases/tag/0.8.12) - 2020-02-03 - -🛠️ **Maintenance release** - -Classes are now annotated for better static analysis with [psalm](https://psalm.dev/). - -This is a maintenance release: no bug fixes, no new features, no breaking changes. - -## [0.8.11](https://github.com/brick/math/releases/tag/0.8.11) - 2020-01-23 - -✨ **New feature** - -`BigInteger::powerMod()` performs a power-with-modulo operation. Useful for crypto. - -## [0.8.10](https://github.com/brick/math/releases/tag/0.8.10) - 2020-01-21 - -✨ **New feature** - -`BigInteger::mod()` returns the **modulo** of two numbers. The *modulo* differs from the *remainder* when the signs of the operands are different. - -## [0.8.9](https://github.com/brick/math/releases/tag/0.8.9) - 2020-01-08 - -⚡️ **Performance improvements** - -A few additional optimizations in `BigInteger` and `BigDecimal` when one of the operands can be returned as is. Thanks to @tomtomsen in #24. - -## [0.8.8](https://github.com/brick/math/releases/tag/0.8.8) - 2019-04-25 - -🐛 **Bug fixes** - -- `BigInteger::toBase()` could return an empty string for zero values (BCMath & Native calculators only, GMP calculator unaffected) - -✨ **New features** - -- `BigInteger::toArbitraryBase()` converts a number to an arbitrary base, using a custom alphabet -- `BigInteger::fromArbitraryBase()` converts a string in an arbitrary base, using a custom alphabet, back to a number - -These methods can be used as the foundation to convert strings between different bases/alphabets, using BigInteger as an intermediate representation. - -💩 **Deprecations** - -- `BigInteger::parse()` is now deprecated in favour of `fromBase()` - -`BigInteger::fromBase()` works the same way as `parse()`, with 2 minor differences: - -- the `$base` parameter is required, it does not default to `10` -- it throws a `NumberFormatException` instead of an `InvalidArgumentException` when the number is malformed - -## [0.8.7](https://github.com/brick/math/releases/tag/0.8.7) - 2019-04-20 - -**Improvements** - -- Safer conversion from `float` when using custom locales -- **Much faster** `NativeCalculator` implementation 🚀 - -You can expect **at least a 3x performance improvement** for common arithmetic operations when using the library on systems without GMP or BCMath; it gets exponentially faster on multiplications with a high number of digits. This is due to calculations now being performed on whole blocks of digits (the block size depending on the platform, 32-bit or 64-bit) instead of digit-by-digit as before. - -## [0.8.6](https://github.com/brick/math/releases/tag/0.8.6) - 2019-04-11 - -**New method** - -`BigNumber::sum()` returns the sum of one or more numbers. - -## [0.8.5](https://github.com/brick/math/releases/tag/0.8.5) - 2019-02-12 - -**Bug fix**: `of()` factory methods could fail when passing a `float` in environments using a `LC_NUMERIC` locale with a decimal separator other than `'.'` (#20). - -Thanks @manowark 👍 - -## [0.8.4](https://github.com/brick/math/releases/tag/0.8.4) - 2018-12-07 - -**New method** - -`BigDecimal::sqrt()` calculates the square root of a decimal number, to a given scale. - -## [0.8.3](https://github.com/brick/math/releases/tag/0.8.3) - 2018-12-06 - -**New method** - -`BigInteger::sqrt()` calculates the square root of a number (thanks @peter279k). - -**New exception** - -`NegativeNumberException` is thrown when calling `sqrt()` on a negative number. - -## [0.8.2](https://github.com/brick/math/releases/tag/0.8.2) - 2018-11-08 - -**Performance update** - -- Further improvement of `toInt()` performance -- `NativeCalculator` can now perform some multiplications more efficiently - -## [0.8.1](https://github.com/brick/math/releases/tag/0.8.1) - 2018-11-07 - -Performance optimization of `toInt()` methods. - -## [0.8.0](https://github.com/brick/math/releases/tag/0.8.0) - 2018-10-13 - -**Breaking changes** - -The following deprecated methods have been removed. Use the new method name instead: - -| Method removed | Replacement method | -| --- | --- | -| `BigDecimal::getIntegral()` | `BigDecimal::getIntegralPart()` | -| `BigDecimal::getFraction()` | `BigDecimal::getFractionalPart()` | - ---- - -**New features** - -`BigInteger` has been augmented with 5 new methods for bitwise operations: - -| New method | Description | -| --- | --- | -| `and()` | performs a bitwise `AND` operation on two numbers | -| `or()` | performs a bitwise `OR` operation on two numbers | -| `xor()` | performs a bitwise `XOR` operation on two numbers | -| `shiftedLeft()` | returns the number shifted left by a number of bits | -| `shiftedRight()` | returns the number shifted right by a number of bits | - -Thanks to @DASPRiD 👍 - -## [0.7.3](https://github.com/brick/math/releases/tag/0.7.3) - 2018-08-20 - -**New method:** `BigDecimal::hasNonZeroFractionalPart()` - -**Renamed/deprecated methods:** - -- `BigDecimal::getIntegral()` has been renamed to `getIntegralPart()` and is now deprecated -- `BigDecimal::getFraction()` has been renamed to `getFractionalPart()` and is now deprecated - -## [0.7.2](https://github.com/brick/math/releases/tag/0.7.2) - 2018-07-21 - -**Performance update** - -`BigInteger::parse()` and `toBase()` now use GMP's built-in base conversion features when available. - -## [0.7.1](https://github.com/brick/math/releases/tag/0.7.1) - 2018-03-01 - -This is a maintenance release, no code has been changed. - -- When installed with `--no-dev`, the autoloader does not autoload tests anymore -- Tests and other files unnecessary for production are excluded from the dist package - -This will help make installations more compact. - -## [0.7.0](https://github.com/brick/math/releases/tag/0.7.0) - 2017-10-02 - -Methods renamed: - -- `BigNumber:sign()` has been renamed to `getSign()` -- `BigDecimal::unscaledValue()` has been renamed to `getUnscaledValue()` -- `BigDecimal::scale()` has been renamed to `getScale()` -- `BigDecimal::integral()` has been renamed to `getIntegral()` -- `BigDecimal::fraction()` has been renamed to `getFraction()` -- `BigRational::numerator()` has been renamed to `getNumerator()` -- `BigRational::denominator()` has been renamed to `getDenominator()` - -Classes renamed: - -- `ArithmeticException` has been renamed to `MathException` - -## [0.6.2](https://github.com/brick/math/releases/tag/0.6.2) - 2017-10-02 - -The base class for all exceptions is now `MathException`. -`ArithmeticException` has been deprecated, and will be removed in 0.7.0. - -## [0.6.1](https://github.com/brick/math/releases/tag/0.6.1) - 2017-10-02 - -A number of methods have been renamed: - -- `BigNumber:sign()` is deprecated; use `getSign()` instead -- `BigDecimal::unscaledValue()` is deprecated; use `getUnscaledValue()` instead -- `BigDecimal::scale()` is deprecated; use `getScale()` instead -- `BigDecimal::integral()` is deprecated; use `getIntegral()` instead -- `BigDecimal::fraction()` is deprecated; use `getFraction()` instead -- `BigRational::numerator()` is deprecated; use `getNumerator()` instead -- `BigRational::denominator()` is deprecated; use `getDenominator()` instead - -The old methods will be removed in version 0.7.0. - -## [0.6.0](https://github.com/brick/math/releases/tag/0.6.0) - 2017-08-25 - -- Minimum PHP version is now [7.1](https://gophp71.org/); for PHP 5.6 and PHP 7.0 support, use version `0.5` -- Deprecated method `BigDecimal::withScale()` has been removed; use `toScale()` instead -- Method `BigNumber::toInteger()` has been renamed to `toInt()` - -## [0.5.4](https://github.com/brick/math/releases/tag/0.5.4) - 2016-10-17 - -`BigNumber` classes now implement [JsonSerializable](http://php.net/manual/en/class.jsonserializable.php). -The JSON output is always a string. - -## [0.5.3](https://github.com/brick/math/releases/tag/0.5.3) - 2016-03-31 - -This is a bugfix release. Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. - -## [0.5.2](https://github.com/brick/math/releases/tag/0.5.2) - 2015-08-06 - -The `$scale` parameter of `BigDecimal::dividedBy()` is now optional again. - -## [0.5.1](https://github.com/brick/math/releases/tag/0.5.1) - 2015-07-05 - -**New method: `BigNumber::toScale()`** - -This allows to convert any `BigNumber` to a `BigDecimal` with a given scale, using rounding if necessary. - -## [0.5.0](https://github.com/brick/math/releases/tag/0.5.0) - 2015-07-04 - -**New features** -- Common `BigNumber` interface for all classes, with the following methods: - - `sign()` and derived methods (`isZero()`, `isPositive()`, ...) - - `compareTo()` and derived methods (`isEqualTo()`, `isGreaterThan()`, ...) that work across different `BigNumber` types - - `toBigInteger()`, `toBigDecimal()`, `toBigRational`() conversion methods - - `toInteger()` and `toFloat()` conversion methods to native types -- Unified `of()` behaviour: every class now accepts any type of number, provided that it can be safely converted to the current type -- New method: `BigDecimal::exactlyDividedBy()`; this method automatically computes the scale of the result, provided that the division yields a finite number of digits -- New methods: `BigRational::quotient()` and `remainder()` -- Fine-grained exceptions: `DivisionByZeroException`, `RoundingNecessaryException`, `NumberFormatException` -- Factory methods `zero()`, `one()` and `ten()` available in all classes -- Rounding mode reintroduced in `BigInteger::dividedBy()` - -This release also comes with many performance improvements. - ---- - -**Breaking changes** -- `BigInteger`: - - `getSign()` is renamed to `sign()` - - `toString()` is renamed to `toBase()` - - `BigInteger::dividedBy()` now throws an exception by default if the remainder is not zero; use `quotient()` to get the previous behaviour -- `BigDecimal`: - - `getSign()` is renamed to `sign()` - - `getUnscaledValue()` is renamed to `unscaledValue()` - - `getScale()` is renamed to `scale()` - - `getIntegral()` is renamed to `integral()` - - `getFraction()` is renamed to `fraction()` - - `divideAndRemainder()` is renamed to `quotientAndRemainder()` - - `dividedBy()` now takes a **mandatory** `$scale` parameter **before** the rounding mode - - `toBigInteger()` does not accept a `$roundingMode` parameter any more - - `toBigRational()` does not simplify the fraction any more; explicitly add `->simplified()` to get the previous behaviour -- `BigRational`: - - `getSign()` is renamed to `sign()` - - `getNumerator()` is renamed to `numerator()` - - `getDenominator()` is renamed to `denominator()` - - `of()` is renamed to `nd()`, while `parse()` is renamed to `of()` -- Miscellaneous: - - `ArithmeticException` is moved to an `Exception\` sub-namespace - - `of()` factory methods now throw `NumberFormatException` instead of `InvalidArgumentException` - -## [0.4.3](https://github.com/brick/math/releases/tag/0.4.3) - 2016-03-31 - -Backport of two bug fixes from the 0.5 branch: -- `BigInteger::parse()` did not always throw `InvalidArgumentException` as expected -- Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. - -## [0.4.2](https://github.com/brick/math/releases/tag/0.4.2) - 2015-06-16 - -New method: `BigDecimal::stripTrailingZeros()` - -## [0.4.1](https://github.com/brick/math/releases/tag/0.4.1) - 2015-06-12 - -Introducing a `BigRational` class, to perform calculations on fractions of any size. - -## [0.4.0](https://github.com/brick/math/releases/tag/0.4.0) - 2015-06-12 - -Rounding modes have been removed from `BigInteger`, and are now a concept specific to `BigDecimal`. - -`BigInteger::dividedBy()` now always returns the quotient of the division. - -## [0.3.5](https://github.com/brick/math/releases/tag/0.3.5) - 2016-03-31 - -Backport of two bug fixes from the 0.5 branch: - -- `BigInteger::parse()` did not always throw `InvalidArgumentException` as expected -- Dividing by a negative power of 1 with the same scale as the dividend could trigger an incorrect optimization which resulted in a wrong result. See #6. - -## [0.3.4](https://github.com/brick/math/releases/tag/0.3.4) - 2015-06-11 - -New methods: -- `BigInteger::remainder()` returns the remainder of a division only -- `BigInteger::gcd()` returns the greatest common divisor of two numbers - -## [0.3.3](https://github.com/brick/math/releases/tag/0.3.3) - 2015-06-07 - -Fix `toString()` not handling negative numbers. - -## [0.3.2](https://github.com/brick/math/releases/tag/0.3.2) - 2015-06-07 - -`BigInteger` and `BigDecimal` now have a `getSign()` method that returns: -- `-1` if the number is negative -- `0` if the number is zero -- `1` if the number is positive - -## [0.3.1](https://github.com/brick/math/releases/tag/0.3.1) - 2015-06-05 - -Minor performance improvements - -## [0.3.0](https://github.com/brick/math/releases/tag/0.3.0) - 2015-06-04 - -The `$roundingMode` and `$scale` parameters have been swapped in `BigDecimal::dividedBy()`. - -## [0.2.2](https://github.com/brick/math/releases/tag/0.2.2) - 2015-06-04 - -Stronger immutability guarantee for `BigInteger` and `BigDecimal`. - -So far, it would have been possible to break immutability of these classes by calling the `unserialize()` internal function. This release fixes that. - -## [0.2.1](https://github.com/brick/math/releases/tag/0.2.1) - 2015-06-02 - -Added `BigDecimal::divideAndRemainder()` - -## [0.2.0](https://github.com/brick/math/releases/tag/0.2.0) - 2015-05-22 - -- `min()` and `max()` do not accept an `array` any more, but a variable number of parameters -- **minimum PHP version is now 5.6** -- continuous integration with PHP 7 - -## [0.1.1](https://github.com/brick/math/releases/tag/0.1.1) - 2014-09-01 - -- Added `BigInteger::power()` -- Added HHVM support - -## [0.1.0](https://github.com/brick/math/releases/tag/0.1.0) - 2014-08-31 - -First beta release. - diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/LICENSE deleted file mode 100644 index f9b724f0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-present Benjamin Morel - -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/wp-webauthn/wp-webauthn-vendor/brick/math/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/SECURITY.md deleted file mode 100644 index cc8289bb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/SECURITY.md +++ /dev/null @@ -1,17 +0,0 @@ -# Security Policy - -## Supported Versions - -Only the last two release streams are supported. - -| Version | Supported | -| ------- | ------------------ | -| 0.9.x | :white_check_mark: | -| 0.8.x | :white_check_mark: | -| < 0.8 | :x: | - -## Reporting a Vulnerability - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/composer.json deleted file mode 100644 index ec196632..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "brick/math", - "description": "Arbitrary-precision arithmetic library", - "type": "library", - "keywords": [ - "Brick", - "Math", - "Arbitrary-precision", - "Arithmetic", - "BigInteger", - "BigDecimal", - "BigRational", - "Bignum" - ], - "license": "MIT", - "require": { - "php": "^7.1 || ^8.0", - "ext-json": "*" - }, - "require-dev": { - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", - "php-coveralls/php-coveralls": "^2.2", - "vimeo/psalm": "4.9.2" - }, - "autoload": { - "psr-4": { - "Brick\\Math\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Brick\\Math\\Tests\\": "tests/" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigDecimal.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigDecimal.php deleted file mode 100644 index 78246500..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigDecimal.php +++ /dev/null @@ -1,895 +0,0 @@ -value = $value; - $this->scale = $scale; - } - - /** - * Creates a BigDecimal of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigDecimal - * - * @throws MathException If the value cannot be converted to a BigDecimal. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - return parent::of($value)->toBigDecimal(); - } - - /** - * Creates a BigDecimal from an unscaled value and a scale. - * - * Example: `(12345, 3)` will result in the BigDecimal `12.345`. - * - * @param BigNumber|int|float|string $value The unscaled value. Must be convertible to a BigInteger. - * @param int $scale The scale of the number, positive or zero. - * - * @return BigDecimal - * - * @throws \InvalidArgumentException If the scale is negative. - * - * @psalm-pure - */ - public static function ofUnscaledValue($value, int $scale = 0) : BigDecimal - { - if ($scale < 0) { - throw new \InvalidArgumentException('The scale cannot be negative.'); - } - - return new BigDecimal((string) BigInteger::of($value), $scale); - } - - /** - * Returns a BigDecimal representing zero, with a scale of zero. - * - * @return BigDecimal - * - * @psalm-pure - */ - public static function zero() : BigDecimal - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigDecimal|null $zero - */ - static $zero; - - if ($zero === null) { - $zero = new BigDecimal('0'); - } - - return $zero; - } - - /** - * Returns a BigDecimal representing one, with a scale of zero. - * - * @return BigDecimal - * - * @psalm-pure - */ - public static function one() : BigDecimal - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigDecimal|null $one - */ - static $one; - - if ($one === null) { - $one = new BigDecimal('1'); - } - - return $one; - } - - /** - * Returns a BigDecimal representing ten, with a scale of zero. - * - * @return BigDecimal - * - * @psalm-pure - */ - public static function ten() : BigDecimal - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigDecimal|null $ten - */ - static $ten; - - if ($ten === null) { - $ten = new BigDecimal('10'); - } - - return $ten; - } - - /** - * Returns the sum of this number and the given one. - * - * The result has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. - */ - public function plus($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '0' && $that->scale <= $this->scale) { - return $this; - } - - if ($this->value === '0' && $this->scale <= $that->scale) { - return $that; - } - - [$a, $b] = $this->scaleValues($this, $that); - - $value = Calculator::get()->add($a, $b); - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the difference of this number and the given one. - * - * The result has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. - */ - public function minus($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '0' && $that->scale <= $this->scale) { - return $this; - } - - [$a, $b] = $this->scaleValues($this, $that); - - $value = Calculator::get()->sub($a, $b); - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the product of this number and the given one. - * - * The result has a scale of `$this->scale + $that->scale`. - * - * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigDecimal. - */ - public function multipliedBy($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '1' && $that->scale === 0) { - return $this; - } - - if ($this->value === '1' && $this->scale === 0) { - return $that; - } - - $value = Calculator::get()->mul($this->value, $that->value); - $scale = $this->scale + $that->scale; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the result of the division of this number by the given one, at the given scale. - * - * @param BigNumber|int|float|string $that The divisor. - * @param int|null $scale The desired scale, or null to use the scale of this number. - * @param int $roundingMode An optional rounding mode. - * - * @return BigDecimal - * - * @throws \InvalidArgumentException If the scale or rounding mode is invalid. - * @throws MathException If the number is invalid, is zero, or rounding was necessary. - */ - public function dividedBy($that, ?int $scale = null, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - if ($scale === null) { - $scale = $this->scale; - } elseif ($scale < 0) { - throw new \InvalidArgumentException('Scale cannot be negative.'); - } - - if ($that->value === '1' && $that->scale === 0 && $scale === $this->scale) { - return $this; - } - - $p = $this->valueWithMinScale($that->scale + $scale); - $q = $that->valueWithMinScale($this->scale - $scale); - - $result = Calculator::get()->divRound($p, $q, $roundingMode); - - return new BigDecimal($result, $scale); - } - - /** - * Returns the exact result of the division of this number by the given one. - * - * The scale of the result is automatically calculated to fit all the fraction digits. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal The result. - * - * @throws MathException If the divisor is not a valid number, is not convertible to a BigDecimal, is zero, - * or the result yields an infinite number of digits. - */ - public function exactlyDividedBy($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - [, $b] = $this->scaleValues($this, $that); - - $d = \rtrim($b, '0'); - $scale = \strlen($b) - \strlen($d); - - $calculator = Calculator::get(); - - foreach ([5, 2] as $prime) { - for (;;) { - $lastDigit = (int) $d[-1]; - - if ($lastDigit % $prime !== 0) { - break; - } - - $d = $calculator->divQ($d, (string) $prime); - $scale++; - } - } - - return $this->dividedBy($that, $scale)->stripTrailingZeros(); - } - - /** - * Returns this number exponentiated to the given value. - * - * The result has a scale of `$this->scale * $exponent`. - * - * @param int $exponent The exponent. - * - * @return BigDecimal The result. - * - * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. - */ - public function power(int $exponent) : BigDecimal - { - if ($exponent === 0) { - return BigDecimal::one(); - } - - if ($exponent === 1) { - return $this; - } - - if ($exponent < 0 || $exponent > Calculator::MAX_POWER) { - throw new \InvalidArgumentException(\sprintf( - 'The exponent %d is not in the range 0 to %d.', - $exponent, - Calculator::MAX_POWER - )); - } - - return new BigDecimal(Calculator::get()->pow($this->value, $exponent), $this->scale * $exponent); - } - - /** - * Returns the quotient of the division of this number by this given one. - * - * The quotient has a scale of `0`. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal The quotient. - * - * @throws MathException If the divisor is not a valid decimal number, or is zero. - */ - public function quotient($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - $p = $this->valueWithMinScale($that->scale); - $q = $that->valueWithMinScale($this->scale); - - $quotient = Calculator::get()->divQ($p, $q); - - return new BigDecimal($quotient, 0); - } - - /** - * Returns the remainder of the division of this number by this given one. - * - * The remainder has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal The remainder. - * - * @throws MathException If the divisor is not a valid decimal number, or is zero. - */ - public function remainder($that) : BigDecimal - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - $p = $this->valueWithMinScale($that->scale); - $q = $that->valueWithMinScale($this->scale); - - $remainder = Calculator::get()->divR($p, $q); - - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - return new BigDecimal($remainder, $scale); - } - - /** - * Returns the quotient and remainder of the division of this number by the given one. - * - * The quotient has a scale of `0`, and the remainder has a scale of `max($this->scale, $that->scale)`. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. - * - * @return BigDecimal[] An array containing the quotient and the remainder. - * - * @throws MathException If the divisor is not a valid decimal number, or is zero. - */ - public function quotientAndRemainder($that) : array - { - $that = BigDecimal::of($that); - - if ($that->isZero()) { - throw DivisionByZeroException::divisionByZero(); - } - - $p = $this->valueWithMinScale($that->scale); - $q = $that->valueWithMinScale($this->scale); - - [$quotient, $remainder] = Calculator::get()->divQR($p, $q); - - $scale = $this->scale > $that->scale ? $this->scale : $that->scale; - - $quotient = new BigDecimal($quotient, 0); - $remainder = new BigDecimal($remainder, $scale); - - return [$quotient, $remainder]; - } - - /** - * Returns the square root of this number, rounded down to the given number of decimals. - * - * @param int $scale - * - * @return BigDecimal - * - * @throws \InvalidArgumentException If the scale is negative. - * @throws NegativeNumberException If this number is negative. - */ - public function sqrt(int $scale) : BigDecimal - { - if ($scale < 0) { - throw new \InvalidArgumentException('Scale cannot be negative.'); - } - - if ($this->value === '0') { - return new BigDecimal('0', $scale); - } - - if ($this->value[0] === '-') { - throw new NegativeNumberException('Cannot calculate the square root of a negative number.'); - } - - $value = $this->value; - $addDigits = 2 * $scale - $this->scale; - - if ($addDigits > 0) { - // add zeros - $value .= \str_repeat('0', $addDigits); - } elseif ($addDigits < 0) { - // trim digits - if (-$addDigits >= \strlen($this->value)) { - // requesting a scale too low, will always yield a zero result - return new BigDecimal('0', $scale); - } - - $value = \substr($value, 0, $addDigits); - } - - $value = Calculator::get()->sqrt($value); - - return new BigDecimal($value, $scale); - } - - /** - * Returns a copy of this BigDecimal with the decimal point moved $n places to the left. - * - * @param int $n - * - * @return BigDecimal - */ - public function withPointMovedLeft(int $n) : BigDecimal - { - if ($n === 0) { - return $this; - } - - if ($n < 0) { - return $this->withPointMovedRight(-$n); - } - - return new BigDecimal($this->value, $this->scale + $n); - } - - /** - * Returns a copy of this BigDecimal with the decimal point moved $n places to the right. - * - * @param int $n - * - * @return BigDecimal - */ - public function withPointMovedRight(int $n) : BigDecimal - { - if ($n === 0) { - return $this; - } - - if ($n < 0) { - return $this->withPointMovedLeft(-$n); - } - - $value = $this->value; - $scale = $this->scale - $n; - - if ($scale < 0) { - if ($value !== '0') { - $value .= \str_repeat('0', -$scale); - } - $scale = 0; - } - - return new BigDecimal($value, $scale); - } - - /** - * Returns a copy of this BigDecimal with any trailing zeros removed from the fractional part. - * - * @return BigDecimal - */ - public function stripTrailingZeros() : BigDecimal - { - if ($this->scale === 0) { - return $this; - } - - $trimmedValue = \rtrim($this->value, '0'); - - if ($trimmedValue === '') { - return BigDecimal::zero(); - } - - $trimmableZeros = \strlen($this->value) - \strlen($trimmedValue); - - if ($trimmableZeros === 0) { - return $this; - } - - if ($trimmableZeros > $this->scale) { - $trimmableZeros = $this->scale; - } - - $value = \substr($this->value, 0, -$trimmableZeros); - $scale = $this->scale - $trimmableZeros; - - return new BigDecimal($value, $scale); - } - - /** - * Returns the absolute value of this number. - * - * @return BigDecimal - */ - public function abs() : BigDecimal - { - return $this->isNegative() ? $this->negated() : $this; - } - - /** - * Returns the negated value of this number. - * - * @return BigDecimal - */ - public function negated() : BigDecimal - { - return new BigDecimal(Calculator::get()->neg($this->value), $this->scale); - } - - /** - * {@inheritdoc} - */ - public function compareTo($that) : int - { - $that = BigNumber::of($that); - - if ($that instanceof BigInteger) { - $that = $that->toBigDecimal(); - } - - if ($that instanceof BigDecimal) { - [$a, $b] = $this->scaleValues($this, $that); - - return Calculator::get()->cmp($a, $b); - } - - return - $that->compareTo($this); - } - - /** - * {@inheritdoc} - */ - public function getSign() : int - { - return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); - } - - /** - * @return BigInteger - */ - public function getUnscaledValue() : BigInteger - { - return BigInteger::create($this->value); - } - - /** - * @return int - */ - public function getScale() : int - { - return $this->scale; - } - - /** - * Returns a string representing the integral part of this decimal number. - * - * Example: `-123.456` => `-123`. - * - * @return string - */ - public function getIntegralPart() : string - { - if ($this->scale === 0) { - return $this->value; - } - - $value = $this->getUnscaledValueWithLeadingZeros(); - - return \substr($value, 0, -$this->scale); - } - - /** - * Returns a string representing the fractional part of this decimal number. - * - * If the scale is zero, an empty string is returned. - * - * Examples: `-123.456` => '456', `123` => ''. - * - * @return string - */ - public function getFractionalPart() : string - { - if ($this->scale === 0) { - return ''; - } - - $value = $this->getUnscaledValueWithLeadingZeros(); - - return \substr($value, -$this->scale); - } - - /** - * Returns whether this decimal number has a non-zero fractional part. - * - * @return bool - */ - public function hasNonZeroFractionalPart() : bool - { - return $this->getFractionalPart() !== \str_repeat('0', $this->scale); - } - - /** - * {@inheritdoc} - */ - public function toBigInteger() : BigInteger - { - $zeroScaleDecimal = $this->scale === 0 ? $this : $this->dividedBy(1, 0); - - return BigInteger::create($zeroScaleDecimal->value); - } - - /** - * {@inheritdoc} - */ - public function toBigDecimal() : BigDecimal - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function toBigRational() : BigRational - { - $numerator = BigInteger::create($this->value); - $denominator = BigInteger::create('1' . \str_repeat('0', $this->scale)); - - return BigRational::create($numerator, $denominator, false); - } - - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - if ($scale === $this->scale) { - return $this; - } - - return $this->dividedBy(BigDecimal::one(), $scale, $roundingMode); - } - - /** - * {@inheritdoc} - */ - public function toInt() : int - { - return $this->toBigInteger()->toInt(); - } - - /** - * {@inheritdoc} - */ - public function toFloat() : float - { - return (float) (string) $this; - } - - /** - * {@inheritdoc} - */ - public function __toString() : string - { - if ($this->scale === 0) { - return $this->value; - } - - $value = $this->getUnscaledValueWithLeadingZeros(); - - return \substr($value, 0, -$this->scale) . '.' . \substr($value, -$this->scale); - } - - /** - * This method is required for serializing the object and SHOULD NOT be accessed directly. - * - * @internal - * - * @return array{value: string, scale: int} - */ - public function __serialize(): array - { - return ['value' => $this->value, 'scale' => $this->scale]; - } - - /** - * This method is only here to allow unserializing the object and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param array{value: string, scale: int} $data - * - * @return void - * - * @throws \LogicException - */ - public function __unserialize(array $data): void - { - if (isset($this->value)) { - throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); - } - - $this->value = $data['value']; - $this->scale = $data['scale']; - } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->value . ':' . $this->scale; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->value)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - [$value, $scale] = \explode(':', $value); - - $this->value = $value; - $this->scale = (int) $scale; - } - - /** - * Puts the internal values of the given decimal numbers on the same scale. - * - * @param BigDecimal $x The first decimal number. - * @param BigDecimal $y The second decimal number. - * - * @return array{string, string} The scaled integer values of $x and $y. - */ - private function scaleValues(BigDecimal $x, BigDecimal $y) : array - { - $a = $x->value; - $b = $y->value; - - if ($b !== '0' && $x->scale > $y->scale) { - $b .= \str_repeat('0', $x->scale - $y->scale); - } elseif ($a !== '0' && $x->scale < $y->scale) { - $a .= \str_repeat('0', $y->scale - $x->scale); - } - - return [$a, $b]; - } - - /** - * @param int $scale - * - * @return string - */ - private function valueWithMinScale(int $scale) : string - { - $value = $this->value; - - if ($this->value !== '0' && $scale > $this->scale) { - $value .= \str_repeat('0', $scale - $this->scale); - } - - return $value; - } - - /** - * Adds leading zeros if necessary to the unscaled value to represent the full decimal number. - * - * @return string - */ - private function getUnscaledValueWithLeadingZeros() : string - { - $value = $this->value; - $targetLength = $this->scale + 1; - $negative = ($value[0] === '-'); - $length = \strlen($value); - - if ($negative) { - $length--; - } - - if ($length >= $targetLength) { - return $this->value; - } - - if ($negative) { - $value = \substr($value, 1); - } - - $value = \str_pad($value, $targetLength, '0', STR_PAD_LEFT); - - if ($negative) { - $value = '-' . $value; - } - - return $value; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigInteger.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigInteger.php deleted file mode 100644 index f213fbed..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigInteger.php +++ /dev/null @@ -1,1184 +0,0 @@ -value = $value; - } - - /** - * Creates a BigInteger of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigInteger - * - * @throws MathException If the value cannot be converted to a BigInteger. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - return parent::of($value)->toBigInteger(); - } - - /** - * Creates a number from a string in a given base. - * - * The string can optionally be prefixed with the `+` or `-` sign. - * - * Bases greater than 36 are not supported by this method, as there is no clear consensus on which of the lowercase - * or uppercase characters should come first. Instead, this method accepts any base up to 36, and does not - * differentiate lowercase and uppercase characters, which are considered equal. - * - * For bases greater than 36, and/or custom alphabets, use the fromArbitraryBase() method. - * - * @param string $number The number to convert, in the given base. - * @param int $base The base of the number, between 2 and 36. - * - * @return BigInteger - * - * @throws NumberFormatException If the number is empty, or contains invalid chars for the given base. - * @throws \InvalidArgumentException If the base is out of range. - * - * @psalm-pure - */ - public static function fromBase(string $number, int $base) : BigInteger - { - if ($number === '') { - throw new NumberFormatException('The number cannot be empty.'); - } - - if ($base < 2 || $base > 36) { - throw new \InvalidArgumentException(\sprintf('Base %d is not in range 2 to 36.', $base)); - } - - if ($number[0] === '-') { - $sign = '-'; - $number = \substr($number, 1); - } elseif ($number[0] === '+') { - $sign = ''; - $number = \substr($number, 1); - } else { - $sign = ''; - } - - if ($number === '') { - throw new NumberFormatException('The number cannot be empty.'); - } - - $number = \ltrim($number, '0'); - - if ($number === '') { - // The result will be the same in any base, avoid further calculation. - return BigInteger::zero(); - } - - if ($number === '1') { - // The result will be the same in any base, avoid further calculation. - return new BigInteger($sign . '1'); - } - - $pattern = '/[^' . \substr(Calculator::ALPHABET, 0, $base) . ']/'; - - if (\preg_match($pattern, \strtolower($number), $matches) === 1) { - throw new NumberFormatException(\sprintf('"%s" is not a valid character in base %d.', $matches[0], $base)); - } - - if ($base === 10) { - // The number is usable as is, avoid further calculation. - return new BigInteger($sign . $number); - } - - $result = Calculator::get()->fromBase($number, $base); - - return new BigInteger($sign . $result); - } - - /** - * Parses a string containing an integer in an arbitrary base, using a custom alphabet. - * - * Because this method accepts an alphabet with any character, including dash, it does not handle negative numbers. - * - * @param string $number The number to parse. - * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. - * - * @return BigInteger - * - * @throws NumberFormatException If the given number is empty or contains invalid chars for the given alphabet. - * @throws \InvalidArgumentException If the alphabet does not contain at least 2 chars. - * - * @psalm-pure - */ - public static function fromArbitraryBase(string $number, string $alphabet) : BigInteger - { - if ($number === '') { - throw new NumberFormatException('The number cannot be empty.'); - } - - $base = \strlen($alphabet); - - if ($base < 2) { - throw new \InvalidArgumentException('The alphabet must contain at least 2 chars.'); - } - - $pattern = '/[^' . \preg_quote($alphabet, '/') . ']/'; - - if (\preg_match($pattern, $number, $matches) === 1) { - throw NumberFormatException::charNotInAlphabet($matches[0]); - } - - $number = Calculator::get()->fromArbitraryBase($number, $alphabet, $base); - - return new BigInteger($number); - } - - /** - * Translates a string of bytes containing the binary representation of a BigInteger into a BigInteger. - * - * The input string is assumed to be in big-endian byte-order: the most significant byte is in the zeroth element. - * - * If `$signed` is true, the input is assumed to be in two's-complement representation, and the leading bit is - * interpreted as a sign bit. If `$signed` is false, the input is interpreted as an unsigned number, and the - * resulting BigInteger will always be positive or zero. - * - * This method can be used to retrieve a number exported by `toBytes()`, as long as the `$signed` flags match. - * - * @param string $value The byte string. - * @param bool $signed Whether to interpret as a signed number in two's-complement representation with a leading - * sign bit. - * - * @return BigInteger - * - * @throws NumberFormatException If the string is empty. - */ - public static function fromBytes(string $value, bool $signed = true) : BigInteger - { - if ($value === '') { - throw new NumberFormatException('The byte string must not be empty.'); - } - - $twosComplement = false; - - if ($signed) { - $x = \ord($value[0]); - - if (($twosComplement = ($x >= 0x80))) { - $value = ~$value; - } - } - - $number = self::fromBase(\bin2hex($value), 16); - - if ($twosComplement) { - return $number->plus(1)->negated(); - } - - return $number; - } - - /** - * Generates a pseudo-random number in the range 0 to 2^numBits - 1. - * - * Using the default random bytes generator, this method is suitable for cryptographic use. - * - * @psalm-param callable(int): string $randomBytesGenerator - * - * @param int $numBits The number of bits. - * @param callable|null $randomBytesGenerator A function that accepts a number of bytes as an integer, and returns a - * string of random bytes of the given length. Defaults to the - * `random_bytes()` function. - * - * @return BigInteger - * - * @throws \InvalidArgumentException If $numBits is negative. - */ - public static function randomBits(int $numBits, ?callable $randomBytesGenerator = null) : BigInteger - { - if ($numBits < 0) { - throw new \InvalidArgumentException('The number of bits cannot be negative.'); - } - - if ($numBits === 0) { - return BigInteger::zero(); - } - - if ($randomBytesGenerator === null) { - $randomBytesGenerator = 'random_bytes'; - } - - $byteLength = \intdiv($numBits - 1, 8) + 1; - - $extraBits = ($byteLength * 8 - $numBits); - $bitmask = \chr(0xFF >> $extraBits); - - $randomBytes = $randomBytesGenerator($byteLength); - $randomBytes[0] = $randomBytes[0] & $bitmask; - - return self::fromBytes($randomBytes, false); - } - - /** - * Generates a pseudo-random number between `$min` and `$max`. - * - * Using the default random bytes generator, this method is suitable for cryptographic use. - * - * @psalm-param (callable(int): string)|null $randomBytesGenerator - * - * @param BigNumber|int|float|string $min The lower bound. Must be convertible to a BigInteger. - * @param BigNumber|int|float|string $max The upper bound. Must be convertible to a BigInteger. - * @param callable|null $randomBytesGenerator A function that accepts a number of bytes as an integer, - * and returns a string of random bytes of the given length. - * Defaults to the `random_bytes()` function. - * - * @return BigInteger - * - * @throws MathException If one of the parameters cannot be converted to a BigInteger, - * or `$min` is greater than `$max`. - */ - public static function randomRange($min, $max, ?callable $randomBytesGenerator = null) : BigInteger - { - $min = BigInteger::of($min); - $max = BigInteger::of($max); - - if ($min->isGreaterThan($max)) { - throw new MathException('$min cannot be greater than $max.'); - } - - if ($min->isEqualTo($max)) { - return $min; - } - - $diff = $max->minus($min); - $bitLength = $diff->getBitLength(); - - // try until the number is in range (50% to 100% chance of success) - do { - $randomNumber = self::randomBits($bitLength, $randomBytesGenerator); - } while ($randomNumber->isGreaterThan($diff)); - - return $randomNumber->plus($min); - } - - /** - * Returns a BigInteger representing zero. - * - * @return BigInteger - * - * @psalm-pure - */ - public static function zero() : BigInteger - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigInteger|null $zero - */ - static $zero; - - if ($zero === null) { - $zero = new BigInteger('0'); - } - - return $zero; - } - - /** - * Returns a BigInteger representing one. - * - * @return BigInteger - * - * @psalm-pure - */ - public static function one() : BigInteger - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigInteger|null $one - */ - static $one; - - if ($one === null) { - $one = new BigInteger('1'); - } - - return $one; - } - - /** - * Returns a BigInteger representing ten. - * - * @return BigInteger - * - * @psalm-pure - */ - public static function ten() : BigInteger - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigInteger|null $ten - */ - static $ten; - - if ($ten === null) { - $ten = new BigInteger('10'); - } - - return $ten; - } - - /** - * Returns the sum of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigInteger. - * - * @return BigInteger The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigInteger. - */ - public function plus($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - return $this; - } - - if ($this->value === '0') { - return $that; - } - - $value = Calculator::get()->add($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the difference of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigInteger. - * - * @return BigInteger The result. - * - * @throws MathException If the number is not valid, or is not convertible to a BigInteger. - */ - public function minus($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - return $this; - } - - $value = Calculator::get()->sub($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the product of this number and the given one. - * - * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigInteger. - * - * @return BigInteger The result. - * - * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigInteger. - */ - public function multipliedBy($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return $this; - } - - if ($this->value === '1') { - return $that; - } - - $value = Calculator::get()->mul($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the result of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * @param int $roundingMode An optional rounding mode. - * - * @return BigInteger The result. - * - * @throws MathException If the divisor is not a valid number, is not convertible to a BigInteger, is zero, - * or RoundingMode::UNNECESSARY is used and the remainder is not zero. - */ - public function dividedBy($that, int $roundingMode = RoundingMode::UNNECESSARY) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return $this; - } - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - $result = Calculator::get()->divRound($this->value, $that->value, $roundingMode); - - return new BigInteger($result); - } - - /** - * Returns this number exponentiated to the given value. - * - * @param int $exponent The exponent. - * - * @return BigInteger The result. - * - * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. - */ - public function power(int $exponent) : BigInteger - { - if ($exponent === 0) { - return BigInteger::one(); - } - - if ($exponent === 1) { - return $this; - } - - if ($exponent < 0 || $exponent > Calculator::MAX_POWER) { - throw new \InvalidArgumentException(\sprintf( - 'The exponent %d is not in the range 0 to %d.', - $exponent, - Calculator::MAX_POWER - )); - } - - return new BigInteger(Calculator::get()->pow($this->value, $exponent)); - } - - /** - * Returns the quotient of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function quotient($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return $this; - } - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - $quotient = Calculator::get()->divQ($this->value, $that->value); - - return new BigInteger($quotient); - } - - /** - * Returns the remainder of the division of this number by the given one. - * - * The remainder, when non-zero, has the same sign as the dividend. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function remainder($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '1') { - return BigInteger::zero(); - } - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - $remainder = Calculator::get()->divR($this->value, $that->value); - - return new BigInteger($remainder); - } - - /** - * Returns the quotient and remainder of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger[] An array containing the quotient and the remainder. - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function quotientAndRemainder($that) : array - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - throw DivisionByZeroException::divisionByZero(); - } - - [$quotient, $remainder] = Calculator::get()->divQR($this->value, $that->value); - - return [ - new BigInteger($quotient), - new BigInteger($remainder) - ]; - } - - /** - * Returns the modulo of this number and the given one. - * - * The modulo operation yields the same result as the remainder operation when both operands are of the same sign, - * and may differ when signs are different. - * - * The result of the modulo operation, when non-zero, has the same sign as the divisor. - * - * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * - * @return BigInteger - * - * @throws DivisionByZeroException If the divisor is zero. - */ - public function mod($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0') { - throw DivisionByZeroException::modulusMustNotBeZero(); - } - - $value = Calculator::get()->mod($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the modular multiplicative inverse of this BigInteger modulo $m. - * - * @param BigInteger $m - * - * @return BigInteger - * - * @throws DivisionByZeroException If $m is zero. - * @throws NegativeNumberException If $m is negative. - * @throws MathException If this BigInteger has no multiplicative inverse mod m (that is, this BigInteger - * is not relatively prime to m). - */ - public function modInverse(BigInteger $m) : BigInteger - { - if ($m->value === '0') { - throw DivisionByZeroException::modulusMustNotBeZero(); - } - - if ($m->isNegative()) { - throw new NegativeNumberException('Modulus must not be negative.'); - } - - if ($m->value === '1') { - return BigInteger::zero(); - } - - $value = Calculator::get()->modInverse($this->value, $m->value); - - if ($value === null) { - throw new MathException('Unable to compute the modInverse for the given modulus.'); - } - - return new BigInteger($value); - } - - /** - * Returns this number raised into power with modulo. - * - * This operation only works on positive numbers. - * - * @param BigNumber|int|float|string $exp The exponent. Must be positive or zero. - * @param BigNumber|int|float|string $mod The modulus. Must be strictly positive. - * - * @return BigInteger - * - * @throws NegativeNumberException If any of the operands is negative. - * @throws DivisionByZeroException If the modulus is zero. - */ - public function modPow($exp, $mod) : BigInteger - { - $exp = BigInteger::of($exp); - $mod = BigInteger::of($mod); - - if ($this->isNegative() || $exp->isNegative() || $mod->isNegative()) { - throw new NegativeNumberException('The operands cannot be negative.'); - } - - if ($mod->isZero()) { - throw DivisionByZeroException::modulusMustNotBeZero(); - } - - $result = Calculator::get()->modPow($this->value, $exp->value, $mod->value); - - return new BigInteger($result); - } - - /** - * Returns the greatest common divisor of this number and the given one. - * - * The GCD is always positive, unless both operands are zero, in which case it is zero. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function gcd($that) : BigInteger - { - $that = BigInteger::of($that); - - if ($that->value === '0' && $this->value[0] !== '-') { - return $this; - } - - if ($this->value === '0' && $that->value[0] !== '-') { - return $that; - } - - $value = Calculator::get()->gcd($this->value, $that->value); - - return new BigInteger($value); - } - - /** - * Returns the integer square root number of this number, rounded down. - * - * The result is the largest x such that x² ≤ n. - * - * @return BigInteger - * - * @throws NegativeNumberException If this number is negative. - */ - public function sqrt() : BigInteger - { - if ($this->value[0] === '-') { - throw new NegativeNumberException('Cannot calculate the square root of a negative number.'); - } - - $value = Calculator::get()->sqrt($this->value); - - return new BigInteger($value); - } - - /** - * Returns the absolute value of this number. - * - * @return BigInteger - */ - public function abs() : BigInteger - { - return $this->isNegative() ? $this->negated() : $this; - } - - /** - * Returns the inverse of this number. - * - * @return BigInteger - */ - public function negated() : BigInteger - { - return new BigInteger(Calculator::get()->neg($this->value)); - } - - /** - * Returns the integer bitwise-and combined with another integer. - * - * This method returns a negative BigInteger if and only if both operands are negative. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function and($that) : BigInteger - { - $that = BigInteger::of($that); - - return new BigInteger(Calculator::get()->and($this->value, $that->value)); - } - - /** - * Returns the integer bitwise-or combined with another integer. - * - * This method returns a negative BigInteger if and only if either of the operands is negative. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function or($that) : BigInteger - { - $that = BigInteger::of($that); - - return new BigInteger(Calculator::get()->or($this->value, $that->value)); - } - - /** - * Returns the integer bitwise-xor combined with another integer. - * - * This method returns a negative BigInteger if and only if exactly one of the operands is negative. - * - * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger - */ - public function xor($that) : BigInteger - { - $that = BigInteger::of($that); - - return new BigInteger(Calculator::get()->xor($this->value, $that->value)); - } - - /** - * Returns the bitwise-not of this BigInteger. - * - * @return BigInteger - */ - public function not() : BigInteger - { - return $this->negated()->minus(1); - } - - /** - * Returns the integer left shifted by a given number of bits. - * - * @param int $distance The distance to shift. - * - * @return BigInteger - */ - public function shiftedLeft(int $distance) : BigInteger - { - if ($distance === 0) { - return $this; - } - - if ($distance < 0) { - return $this->shiftedRight(- $distance); - } - - return $this->multipliedBy(BigInteger::of(2)->power($distance)); - } - - /** - * Returns the integer right shifted by a given number of bits. - * - * @param int $distance The distance to shift. - * - * @return BigInteger - */ - public function shiftedRight(int $distance) : BigInteger - { - if ($distance === 0) { - return $this; - } - - if ($distance < 0) { - return $this->shiftedLeft(- $distance); - } - - $operand = BigInteger::of(2)->power($distance); - - if ($this->isPositiveOrZero()) { - return $this->quotient($operand); - } - - return $this->dividedBy($operand, RoundingMode::UP); - } - - /** - * Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit. - * - * For positive BigIntegers, this is equivalent to the number of bits in the ordinary binary representation. - * Computes (ceil(log2(this < 0 ? -this : this+1))). - * - * @return int - */ - public function getBitLength() : int - { - if ($this->value === '0') { - return 0; - } - - if ($this->isNegative()) { - return $this->abs()->minus(1)->getBitLength(); - } - - return \strlen($this->toBase(2)); - } - - /** - * Returns the index of the rightmost (lowest-order) one bit in this BigInteger. - * - * Returns -1 if this BigInteger contains no one bits. - * - * @return int - */ - public function getLowestSetBit() : int - { - $n = $this; - $bitLength = $this->getBitLength(); - - for ($i = 0; $i <= $bitLength; $i++) { - if ($n->isOdd()) { - return $i; - } - - $n = $n->shiftedRight(1); - } - - return -1; - } - - /** - * Returns whether this number is even. - * - * @return bool - */ - public function isEven() : bool - { - return \in_array($this->value[-1], ['0', '2', '4', '6', '8'], true); - } - - /** - * Returns whether this number is odd. - * - * @return bool - */ - public function isOdd() : bool - { - return \in_array($this->value[-1], ['1', '3', '5', '7', '9'], true); - } - - /** - * Returns true if and only if the designated bit is set. - * - * Computes ((this & (1<shiftedRight($n)->isOdd(); - } - - /** - * {@inheritdoc} - */ - public function compareTo($that) : int - { - $that = BigNumber::of($that); - - if ($that instanceof BigInteger) { - return Calculator::get()->cmp($this->value, $that->value); - } - - return - $that->compareTo($this); - } - - /** - * {@inheritdoc} - */ - public function getSign() : int - { - return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); - } - - /** - * {@inheritdoc} - */ - public function toBigInteger() : BigInteger - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function toBigDecimal() : BigDecimal - { - return BigDecimal::create($this->value); - } - - /** - * {@inheritdoc} - */ - public function toBigRational() : BigRational - { - return BigRational::create($this, BigInteger::one(), false); - } - - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - return $this->toBigDecimal()->toScale($scale, $roundingMode); - } - - /** - * {@inheritdoc} - */ - public function toInt() : int - { - $intValue = (int) $this->value; - - if ($this->value !== (string) $intValue) { - throw IntegerOverflowException::toIntOverflow($this); - } - - return $intValue; - } - - /** - * {@inheritdoc} - */ - public function toFloat() : float - { - return (float) $this->value; - } - - /** - * Returns a string representation of this number in the given base. - * - * The output will always be lowercase for bases greater than 10. - * - * @param int $base - * - * @return string - * - * @throws \InvalidArgumentException If the base is out of range. - */ - public function toBase(int $base) : string - { - if ($base === 10) { - return $this->value; - } - - if ($base < 2 || $base > 36) { - throw new \InvalidArgumentException(\sprintf('Base %d is out of range [2, 36]', $base)); - } - - return Calculator::get()->toBase($this->value, $base); - } - - /** - * Returns a string representation of this number in an arbitrary base with a custom alphabet. - * - * Because this method accepts an alphabet with any character, including dash, it does not handle negative numbers; - * a NegativeNumberException will be thrown when attempting to call this method on a negative number. - * - * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. - * - * @return string - * - * @throws NegativeNumberException If this number is negative. - * @throws \InvalidArgumentException If the given alphabet does not contain at least 2 chars. - */ - public function toArbitraryBase(string $alphabet) : string - { - $base = \strlen($alphabet); - - if ($base < 2) { - throw new \InvalidArgumentException('The alphabet must contain at least 2 chars.'); - } - - if ($this->value[0] === '-') { - throw new NegativeNumberException(__FUNCTION__ . '() does not support negative numbers.'); - } - - return Calculator::get()->toArbitraryBase($this->value, $alphabet, $base); - } - - /** - * Returns a string of bytes containing the binary representation of this BigInteger. - * - * The string is in big-endian byte-order: the most significant byte is in the zeroth element. - * - * If `$signed` is true, the output will be in two's-complement representation, and a sign bit will be prepended to - * the output. If `$signed` is false, no sign bit will be prepended, and this method will throw an exception if the - * number is negative. - * - * The string will contain the minimum number of bytes required to represent this BigInteger, including a sign bit - * if `$signed` is true. - * - * This representation is compatible with the `fromBytes()` factory method, as long as the `$signed` flags match. - * - * @param bool $signed Whether to output a signed number in two's-complement representation with a leading sign bit. - * - * @return string - * - * @throws NegativeNumberException If $signed is false, and the number is negative. - */ - public function toBytes(bool $signed = true) : string - { - if (! $signed && $this->isNegative()) { - throw new NegativeNumberException('Cannot convert a negative number to a byte string when $signed is false.'); - } - - $hex = $this->abs()->toBase(16); - - if (\strlen($hex) % 2 !== 0) { - $hex = '0' . $hex; - } - - $baseHexLength = \strlen($hex); - - if ($signed) { - if ($this->isNegative()) { - $bin = \hex2bin($hex); - assert($bin !== false); - - $hex = \bin2hex(~$bin); - $hex = self::fromBase($hex, 16)->plus(1)->toBase(16); - - $hexLength = \strlen($hex); - - if ($hexLength < $baseHexLength) { - $hex = \str_repeat('0', $baseHexLength - $hexLength) . $hex; - } - - if ($hex[0] < '8') { - $hex = 'FF' . $hex; - } - } else { - if ($hex[0] >= '8') { - $hex = '00' . $hex; - } - } - } - - return \hex2bin($hex); - } - - /** - * {@inheritdoc} - */ - public function __toString() : string - { - return $this->value; - } - - /** - * This method is required for serializing the object and SHOULD NOT be accessed directly. - * - * @internal - * - * @return array{value: string} - */ - public function __serialize(): array - { - return ['value' => $this->value]; - } - - /** - * This method is only here to allow unserializing the object and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param array{value: string} $data - * - * @return void - * - * @throws \LogicException - */ - public function __unserialize(array $data): void - { - if (isset($this->value)) { - throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); - } - - $this->value = $data['value']; - } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->value; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->value)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - $this->value = $value; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigNumber.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigNumber.php deleted file mode 100644 index 38c8c554..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigNumber.php +++ /dev/null @@ -1,572 +0,0 @@ -[\-\+])?' . - '(?:' . - '(?:' . - '(?[0-9]+)?' . - '(?\.)?' . - '(?[0-9]+)?' . - '(?:[eE](?[\-\+]?[0-9]+))?' . - ')|(?:' . - '(?[0-9]+)' . - '\/?' . - '(?[0-9]+)' . - ')' . - ')' . - '$/'; - - /** - * Creates a BigNumber of the given value. - * - * The concrete return type is dependent on the given value, with the following rules: - * - * - BigNumber instances are returned as is - * - integer numbers are returned as BigInteger - * - floating point numbers are converted to a string then parsed as such - * - strings containing a `/` character are returned as BigRational - * - strings containing a `.` character or using an exponential notation are returned as BigDecimal - * - strings containing only digits with an optional leading `+` or `-` sign are returned as BigInteger - * - * @param BigNumber|int|float|string $value - * - * @return BigNumber - * - * @throws NumberFormatException If the format of the number is not valid. - * @throws DivisionByZeroException If the value represents a rational number with a denominator of zero. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - if ($value instanceof BigNumber) { - return $value; - } - - if (\is_int($value)) { - return new BigInteger((string) $value); - } - - /** @psalm-suppress RedundantCastGivenDocblockType We cannot trust the untyped $value here! */ - $value = \is_float($value) ? self::floatToString($value) : (string) $value; - - $throw = static function() use ($value) : void { - throw new NumberFormatException(\sprintf( - 'The given value "%s" does not represent a valid number.', - $value - )); - }; - - if (\preg_match(self::PARSE_REGEXP, $value, $matches) !== 1) { - $throw(); - } - - $getMatch = static function(string $value) use ($matches) : ?string { - return isset($matches[$value]) && $matches[$value] !== '' ? $matches[$value] : null; - }; - - $sign = $getMatch('sign'); - $numerator = $getMatch('numerator'); - $denominator = $getMatch('denominator'); - - if ($numerator !== null) { - assert($denominator !== null); - - if ($sign !== null) { - $numerator = $sign . $numerator; - } - - $numerator = self::cleanUp($numerator); - $denominator = self::cleanUp($denominator); - - if ($denominator === '0') { - throw DivisionByZeroException::denominatorMustNotBeZero(); - } - - return new BigRational( - new BigInteger($numerator), - new BigInteger($denominator), - false - ); - } - - $point = $getMatch('point'); - $integral = $getMatch('integral'); - $fractional = $getMatch('fractional'); - $exponent = $getMatch('exponent'); - - if ($integral === null && $fractional === null) { - $throw(); - } - - if ($integral === null) { - $integral = '0'; - } - - if ($point !== null || $exponent !== null) { - $fractional = ($fractional ?? ''); - $exponent = ($exponent !== null) ? (int) $exponent : 0; - - if ($exponent === PHP_INT_MIN || $exponent === PHP_INT_MAX) { - throw new NumberFormatException('Exponent too large.'); - } - - $unscaledValue = self::cleanUp(($sign ?? ''). $integral . $fractional); - - $scale = \strlen($fractional) - $exponent; - - if ($scale < 0) { - if ($unscaledValue !== '0') { - $unscaledValue .= \str_repeat('0', - $scale); - } - $scale = 0; - } - - return new BigDecimal($unscaledValue, $scale); - } - - $integral = self::cleanUp(($sign ?? '') . $integral); - - return new BigInteger($integral); - } - - /** - * Safely converts float to string, avoiding locale-dependent issues. - * - * @see https://github.com/brick/math/pull/20 - * - * @param float $float - * - * @return string - * - * @psalm-pure - * @psalm-suppress ImpureFunctionCall - */ - private static function floatToString(float $float) : string - { - $currentLocale = \setlocale(LC_NUMERIC, '0'); - \setlocale(LC_NUMERIC, 'C'); - - $result = (string) $float; - - \setlocale(LC_NUMERIC, $currentLocale); - - return $result; - } - - /** - * Proxy method to access protected constructors from sibling classes. - * - * @internal - * - * @param mixed ...$args The arguments to the constructor. - * - * @return static - * - * @psalm-pure - * @psalm-suppress TooManyArguments - * @psalm-suppress UnsafeInstantiation - */ - protected static function create(... $args) : BigNumber - { - return new static(... $args); - } - - /** - * Returns the minimum of the given values. - * - * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible - * to an instance of the class this method is called on. - * - * @return static The minimum value. - * - * @throws \InvalidArgumentException If no values are given. - * @throws MathException If an argument is not valid. - * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType - * @psalm-pure - */ - public static function min(...$values) : BigNumber - { - $min = null; - - foreach ($values as $value) { - $value = static::of($value); - - if ($min === null || $value->isLessThan($min)) { - $min = $value; - } - } - - if ($min === null) { - throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); - } - - return $min; - } - - /** - * Returns the maximum of the given values. - * - * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible - * to an instance of the class this method is called on. - * - * @return static The maximum value. - * - * @throws \InvalidArgumentException If no values are given. - * @throws MathException If an argument is not valid. - * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType - * @psalm-pure - */ - public static function max(...$values) : BigNumber - { - $max = null; - - foreach ($values as $value) { - $value = static::of($value); - - if ($max === null || $value->isGreaterThan($max)) { - $max = $value; - } - } - - if ($max === null) { - throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); - } - - return $max; - } - - /** - * Returns the sum of the given values. - * - * @param BigNumber|int|float|string ...$values The numbers to add. All the numbers need to be convertible - * to an instance of the class this method is called on. - * - * @return static The sum. - * - * @throws \InvalidArgumentException If no values are given. - * @throws MathException If an argument is not valid. - * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType - * @psalm-pure - */ - public static function sum(...$values) : BigNumber - { - /** @var BigNumber|null $sum */ - $sum = null; - - foreach ($values as $value) { - $value = static::of($value); - - $sum = $sum === null ? $value : self::add($sum, $value); - } - - if ($sum === null) { - throw new \InvalidArgumentException(__METHOD__ . '() expects at least one value.'); - } - - return $sum; - } - - /** - * Adds two BigNumber instances in the correct order to avoid a RoundingNecessaryException. - * - * @todo This could be better resolved by creating an abstract protected method in BigNumber, and leaving to - * concrete classes the responsibility to perform the addition themselves or delegate it to the given number, - * depending on their ability to perform the operation. This will also require a version bump because we're - * potentially breaking custom BigNumber implementations (if any...) - * - * @param BigNumber $a - * @param BigNumber $b - * - * @return BigNumber - * - * @psalm-pure - */ - private static function add(BigNumber $a, BigNumber $b) : BigNumber - { - if ($a instanceof BigRational) { - return $a->plus($b); - } - - if ($b instanceof BigRational) { - return $b->plus($a); - } - - if ($a instanceof BigDecimal) { - return $a->plus($b); - } - - if ($b instanceof BigDecimal) { - return $b->plus($a); - } - - /** @var BigInteger $a */ - - return $a->plus($b); - } - - /** - * Removes optional leading zeros and + sign from the given number. - * - * @param string $number The number, validated as a non-empty string of digits with optional leading sign. - * - * @return string - * - * @psalm-pure - */ - private static function cleanUp(string $number) : string - { - $firstChar = $number[0]; - - if ($firstChar === '+' || $firstChar === '-') { - $number = \substr($number, 1); - } - - $number = \ltrim($number, '0'); - - if ($number === '') { - return '0'; - } - - if ($firstChar === '-') { - return '-' . $number; - } - - return $number; - } - - /** - * Checks if this number is equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isEqualTo($that) : bool - { - return $this->compareTo($that) === 0; - } - - /** - * Checks if this number is strictly lower than the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isLessThan($that) : bool - { - return $this->compareTo($that) < 0; - } - - /** - * Checks if this number is lower than or equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isLessThanOrEqualTo($that) : bool - { - return $this->compareTo($that) <= 0; - } - - /** - * Checks if this number is strictly greater than the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isGreaterThan($that) : bool - { - return $this->compareTo($that) > 0; - } - - /** - * Checks if this number is greater than or equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool - */ - public function isGreaterThanOrEqualTo($that) : bool - { - return $this->compareTo($that) >= 0; - } - - /** - * Checks if this number equals zero. - * - * @return bool - */ - public function isZero() : bool - { - return $this->getSign() === 0; - } - - /** - * Checks if this number is strictly negative. - * - * @return bool - */ - public function isNegative() : bool - { - return $this->getSign() < 0; - } - - /** - * Checks if this number is negative or zero. - * - * @return bool - */ - public function isNegativeOrZero() : bool - { - return $this->getSign() <= 0; - } - - /** - * Checks if this number is strictly positive. - * - * @return bool - */ - public function isPositive() : bool - { - return $this->getSign() > 0; - } - - /** - * Checks if this number is positive or zero. - * - * @return bool - */ - public function isPositiveOrZero() : bool - { - return $this->getSign() >= 0; - } - - /** - * Returns the sign of this number. - * - * @return int -1 if the number is negative, 0 if zero, 1 if positive. - */ - abstract public function getSign() : int; - - /** - * Compares this number to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return int [-1,0,1] If `$this` is lower than, equal to, or greater than `$that`. - * - * @throws MathException If the number is not valid. - */ - abstract public function compareTo($that) : int; - - /** - * Converts this number to a BigInteger. - * - * @return BigInteger The converted number. - * - * @throws RoundingNecessaryException If this number cannot be converted to a BigInteger without rounding. - */ - abstract public function toBigInteger() : BigInteger; - - /** - * Converts this number to a BigDecimal. - * - * @return BigDecimal The converted number. - * - * @throws RoundingNecessaryException If this number cannot be converted to a BigDecimal without rounding. - */ - abstract public function toBigDecimal() : BigDecimal; - - /** - * Converts this number to a BigRational. - * - * @return BigRational The converted number. - */ - abstract public function toBigRational() : BigRational; - - /** - * Converts this number to a BigDecimal with the given scale, using rounding if necessary. - * - * @param int $scale The scale of the resulting `BigDecimal`. - * @param int $roundingMode A `RoundingMode` constant. - * - * @return BigDecimal - * - * @throws RoundingNecessaryException If this number cannot be converted to the given scale without rounding. - * This only applies when RoundingMode::UNNECESSARY is used. - */ - abstract public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal; - - /** - * Returns the exact value of this number as a native integer. - * - * If this number cannot be converted to a native integer without losing precision, an exception is thrown. - * Note that the acceptable range for an integer depends on the platform and differs for 32-bit and 64-bit. - * - * @return int The converted value. - * - * @throws MathException If this number cannot be exactly converted to a native integer. - */ - abstract public function toInt() : int; - - /** - * Returns an approximation of this number as a floating-point value. - * - * Note that this method can discard information as the precision of a floating-point value - * is inherently limited. - * - * If the number is greater than the largest representable floating point number, positive infinity is returned. - * If the number is less than the smallest representable floating point number, negative infinity is returned. - * - * @return float The converted value. - */ - abstract public function toFloat() : float; - - /** - * Returns a string representation of this number. - * - * The output of this method can be parsed by the `of()` factory method; - * this will yield an object equal to this one, without any information loss. - * - * @return string - */ - abstract public function __toString() : string; - - /** - * {@inheritdoc} - */ - public function jsonSerialize() : string - { - return $this->__toString(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigRational.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigRational.php deleted file mode 100644 index bee094f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/BigRational.php +++ /dev/null @@ -1,523 +0,0 @@ -isZero()) { - throw DivisionByZeroException::denominatorMustNotBeZero(); - } - - if ($denominator->isNegative()) { - $numerator = $numerator->negated(); - $denominator = $denominator->negated(); - } - } - - $this->numerator = $numerator; - $this->denominator = $denominator; - } - - /** - * Creates a BigRational of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigRational - * - * @throws MathException If the value cannot be converted to a BigRational. - * - * @psalm-pure - */ - public static function of($value) : BigNumber - { - return parent::of($value)->toBigRational(); - } - - /** - * Creates a BigRational out of a numerator and a denominator. - * - * If the denominator is negative, the signs of both the numerator and the denominator - * will be inverted to ensure that the denominator is always positive. - * - * @param BigNumber|int|float|string $numerator The numerator. Must be convertible to a BigInteger. - * @param BigNumber|int|float|string $denominator The denominator. Must be convertible to a BigInteger. - * - * @return BigRational - * - * @throws NumberFormatException If an argument does not represent a valid number. - * @throws RoundingNecessaryException If an argument represents a non-integer number. - * @throws DivisionByZeroException If the denominator is zero. - * - * @psalm-pure - */ - public static function nd($numerator, $denominator) : BigRational - { - $numerator = BigInteger::of($numerator); - $denominator = BigInteger::of($denominator); - - return new BigRational($numerator, $denominator, true); - } - - /** - * Returns a BigRational representing zero. - * - * @return BigRational - * - * @psalm-pure - */ - public static function zero() : BigRational - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigRational|null $zero - */ - static $zero; - - if ($zero === null) { - $zero = new BigRational(BigInteger::zero(), BigInteger::one(), false); - } - - return $zero; - } - - /** - * Returns a BigRational representing one. - * - * @return BigRational - * - * @psalm-pure - */ - public static function one() : BigRational - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigRational|null $one - */ - static $one; - - if ($one === null) { - $one = new BigRational(BigInteger::one(), BigInteger::one(), false); - } - - return $one; - } - - /** - * Returns a BigRational representing ten. - * - * @return BigRational - * - * @psalm-pure - */ - public static function ten() : BigRational - { - /** - * @psalm-suppress ImpureStaticVariable - * @var BigRational|null $ten - */ - static $ten; - - if ($ten === null) { - $ten = new BigRational(BigInteger::ten(), BigInteger::one(), false); - } - - return $ten; - } - - /** - * @return BigInteger - */ - public function getNumerator() : BigInteger - { - return $this->numerator; - } - - /** - * @return BigInteger - */ - public function getDenominator() : BigInteger - { - return $this->denominator; - } - - /** - * Returns the quotient of the division of the numerator by the denominator. - * - * @return BigInteger - */ - public function quotient() : BigInteger - { - return $this->numerator->quotient($this->denominator); - } - - /** - * Returns the remainder of the division of the numerator by the denominator. - * - * @return BigInteger - */ - public function remainder() : BigInteger - { - return $this->numerator->remainder($this->denominator); - } - - /** - * Returns the quotient and remainder of the division of the numerator by the denominator. - * - * @return BigInteger[] - */ - public function quotientAndRemainder() : array - { - return $this->numerator->quotientAndRemainder($this->denominator); - } - - /** - * Returns the sum of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to add. - * - * @return BigRational The result. - * - * @throws MathException If the number is not valid. - */ - public function plus($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->denominator); - $numerator = $numerator->plus($that->numerator->multipliedBy($this->denominator)); - $denominator = $this->denominator->multipliedBy($that->denominator); - - return new BigRational($numerator, $denominator, false); - } - - /** - * Returns the difference of this number and the given one. - * - * @param BigNumber|int|float|string $that The number to subtract. - * - * @return BigRational The result. - * - * @throws MathException If the number is not valid. - */ - public function minus($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->denominator); - $numerator = $numerator->minus($that->numerator->multipliedBy($this->denominator)); - $denominator = $this->denominator->multipliedBy($that->denominator); - - return new BigRational($numerator, $denominator, false); - } - - /** - * Returns the product of this number and the given one. - * - * @param BigNumber|int|float|string $that The multiplier. - * - * @return BigRational The result. - * - * @throws MathException If the multiplier is not a valid number. - */ - public function multipliedBy($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->numerator); - $denominator = $this->denominator->multipliedBy($that->denominator); - - return new BigRational($numerator, $denominator, false); - } - - /** - * Returns the result of the division of this number by the given one. - * - * @param BigNumber|int|float|string $that The divisor. - * - * @return BigRational The result. - * - * @throws MathException If the divisor is not a valid number, or is zero. - */ - public function dividedBy($that) : BigRational - { - $that = BigRational::of($that); - - $numerator = $this->numerator->multipliedBy($that->denominator); - $denominator = $this->denominator->multipliedBy($that->numerator); - - return new BigRational($numerator, $denominator, true); - } - - /** - * Returns this number exponentiated to the given value. - * - * @param int $exponent The exponent. - * - * @return BigRational The result. - * - * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. - */ - public function power(int $exponent) : BigRational - { - if ($exponent === 0) { - $one = BigInteger::one(); - - return new BigRational($one, $one, false); - } - - if ($exponent === 1) { - return $this; - } - - return new BigRational( - $this->numerator->power($exponent), - $this->denominator->power($exponent), - false - ); - } - - /** - * Returns the reciprocal of this BigRational. - * - * The reciprocal has the numerator and denominator swapped. - * - * @return BigRational - * - * @throws DivisionByZeroException If the numerator is zero. - */ - public function reciprocal() : BigRational - { - return new BigRational($this->denominator, $this->numerator, true); - } - - /** - * Returns the absolute value of this BigRational. - * - * @return BigRational - */ - public function abs() : BigRational - { - return new BigRational($this->numerator->abs(), $this->denominator, false); - } - - /** - * Returns the negated value of this BigRational. - * - * @return BigRational - */ - public function negated() : BigRational - { - return new BigRational($this->numerator->negated(), $this->denominator, false); - } - - /** - * Returns the simplified value of this BigRational. - * - * @return BigRational - */ - public function simplified() : BigRational - { - $gcd = $this->numerator->gcd($this->denominator); - - $numerator = $this->numerator->quotient($gcd); - $denominator = $this->denominator->quotient($gcd); - - return new BigRational($numerator, $denominator, false); - } - - /** - * {@inheritdoc} - */ - public function compareTo($that) : int - { - return $this->minus($that)->getSign(); - } - - /** - * {@inheritdoc} - */ - public function getSign() : int - { - return $this->numerator->getSign(); - } - - /** - * {@inheritdoc} - */ - public function toBigInteger() : BigInteger - { - $simplified = $this->simplified(); - - if (! $simplified->denominator->isEqualTo(1)) { - throw new RoundingNecessaryException('This rational number cannot be represented as an integer value without rounding.'); - } - - return $simplified->numerator; - } - - /** - * {@inheritdoc} - */ - public function toBigDecimal() : BigDecimal - { - return $this->numerator->toBigDecimal()->exactlyDividedBy($this->denominator); - } - - /** - * {@inheritdoc} - */ - public function toBigRational() : BigRational - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal - { - return $this->numerator->toBigDecimal()->dividedBy($this->denominator, $scale, $roundingMode); - } - - /** - * {@inheritdoc} - */ - public function toInt() : int - { - return $this->toBigInteger()->toInt(); - } - - /** - * {@inheritdoc} - */ - public function toFloat() : float - { - return $this->numerator->toFloat() / $this->denominator->toFloat(); - } - - /** - * {@inheritdoc} - */ - public function __toString() : string - { - $numerator = (string) $this->numerator; - $denominator = (string) $this->denominator; - - if ($denominator === '1') { - return $numerator; - } - - return $this->numerator . '/' . $this->denominator; - } - - /** - * This method is required for serializing the object and SHOULD NOT be accessed directly. - * - * @internal - * - * @return array{numerator: BigInteger, denominator: BigInteger} - */ - public function __serialize(): array - { - return ['numerator' => $this->numerator, 'denominator' => $this->denominator]; - } - - /** - * This method is only here to allow unserializing the object and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param array{numerator: BigInteger, denominator: BigInteger} $data - * - * @return void - * - * @throws \LogicException - */ - public function __unserialize(array $data): void - { - if (isset($this->numerator)) { - throw new \LogicException('__unserialize() is an internal function, it must not be called directly.'); - } - - $this->numerator = $data['numerator']; - $this->denominator = $data['denominator']; - } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->numerator . '/' . $this->denominator; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->numerator)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - [$numerator, $denominator] = \explode('/', $value); - - $this->numerator = BigInteger::of($numerator); - $this->denominator = BigInteger::of($denominator); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Exception/DivisionByZeroException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Exception/DivisionByZeroException.php deleted file mode 100644 index a4e44317..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Exception/DivisionByZeroException.php +++ /dev/null @@ -1,41 +0,0 @@ - 126) { - $char = \strtoupper(\dechex($ord)); - - if ($ord < 10) { - $char = '0' . $char; - } - } else { - $char = '"' . $char . '"'; - } - - return new self(sprintf('Char %s is not a valid character in the given alphabet.', $char)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Exception/RoundingNecessaryException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Exception/RoundingNecessaryException.php deleted file mode 100644 index 1c610056..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Exception/RoundingNecessaryException.php +++ /dev/null @@ -1,21 +0,0 @@ -init($a, $b); - - if ($aNeg && ! $bNeg) { - return -1; - } - - if ($bNeg && ! $aNeg) { - return 1; - } - - $aLen = \strlen($aDig); - $bLen = \strlen($bDig); - - if ($aLen < $bLen) { - $result = -1; - } elseif ($aLen > $bLen) { - $result = 1; - } else { - $result = $aDig <=> $bDig; - } - - return $aNeg ? -$result : $result; - } - - /** - * Adds two numbers. - * - * @param string $a The augend. - * @param string $b The addend. - * - * @return string The sum. - */ - abstract public function add(string $a, string $b) : string; - - /** - * Subtracts two numbers. - * - * @param string $a The minuend. - * @param string $b The subtrahend. - * - * @return string The difference. - */ - abstract public function sub(string $a, string $b) : string; - - /** - * Multiplies two numbers. - * - * @param string $a The multiplicand. - * @param string $b The multiplier. - * - * @return string The product. - */ - abstract public function mul(string $a, string $b) : string; - - /** - * Returns the quotient of the division of two numbers. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * - * @return string The quotient. - */ - abstract public function divQ(string $a, string $b) : string; - - /** - * Returns the remainder of the division of two numbers. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * - * @return string The remainder. - */ - abstract public function divR(string $a, string $b) : string; - - /** - * Returns the quotient and remainder of the division of two numbers. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * - * @return string[] An array containing the quotient and remainder. - */ - abstract public function divQR(string $a, string $b) : array; - - /** - * Exponentiates a number. - * - * @param string $a The base number. - * @param int $e The exponent, validated as an integer between 0 and MAX_POWER. - * - * @return string The power. - */ - abstract public function pow(string $a, int $e) : string; - - /** - * @param string $a - * @param string $b The modulus; must not be zero. - * - * @return string - */ - public function mod(string $a, string $b) : string - { - return $this->divR($this->add($this->divR($a, $b), $b), $b); - } - - /** - * Returns the modular multiplicative inverse of $x modulo $m. - * - * If $x has no multiplicative inverse mod m, this method must return null. - * - * This method can be overridden by the concrete implementation if the underlying library has built-in support. - * - * @param string $x - * @param string $m The modulus; must not be negative or zero. - * - * @return string|null - */ - public function modInverse(string $x, string $m) : ?string - { - if ($m === '1') { - return '0'; - } - - $modVal = $x; - - if ($x[0] === '-' || ($this->cmp($this->abs($x), $m) >= 0)) { - $modVal = $this->mod($x, $m); - } - - $x = '0'; - $y = '0'; - $g = $this->gcdExtended($modVal, $m, $x, $y); - - if ($g !== '1') { - return null; - } - - return $this->mod($this->add($this->mod($x, $m), $m), $m); - } - - /** - * Raises a number into power with modulo. - * - * @param string $base The base number; must be positive or zero. - * @param string $exp The exponent; must be positive or zero. - * @param string $mod The modulus; must be strictly positive. - * - * @return string The power. - */ - abstract public function modPow(string $base, string $exp, string $mod) : string; - - /** - * Returns the greatest common divisor of the two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for GCD calculations. - * - * @param string $a The first number. - * @param string $b The second number. - * - * @return string The GCD, always positive, or zero if both arguments are zero. - */ - public function gcd(string $a, string $b) : string - { - if ($a === '0') { - return $this->abs($b); - } - - if ($b === '0') { - return $this->abs($a); - } - - return $this->gcd($b, $this->divR($a, $b)); - } - - private function gcdExtended(string $a, string $b, string &$x, string &$y) : string - { - if ($a === '0') { - $x = '0'; - $y = '1'; - - return $b; - } - - $x1 = '0'; - $y1 = '0'; - - $gcd = $this->gcdExtended($this->mod($b, $a), $a, $x1, $y1); - - $x = $this->sub($y1, $this->mul($this->divQ($b, $a), $x1)); - $y = $x1; - - return $gcd; - } - - /** - * Returns the square root of the given number, rounded down. - * - * The result is the largest x such that x² ≤ n. - * The input MUST NOT be negative. - * - * @param string $n The number. - * - * @return string The square root. - */ - abstract public function sqrt(string $n) : string; - - /** - * Converts a number from an arbitrary base. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for base conversion. - * - * @param string $number The number, positive or zero, non-empty, case-insensitively validated for the given base. - * @param int $base The base of the number, validated from 2 to 36. - * - * @return string The converted number, following the Calculator conventions. - */ - public function fromBase(string $number, int $base) : string - { - return $this->fromArbitraryBase(\strtolower($number), self::ALPHABET, $base); - } - - /** - * Converts a number to an arbitrary base. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for base conversion. - * - * @param string $number The number to convert, following the Calculator conventions. - * @param int $base The base to convert to, validated from 2 to 36. - * - * @return string The converted number, lowercase. - */ - public function toBase(string $number, int $base) : string - { - $negative = ($number[0] === '-'); - - if ($negative) { - $number = \substr($number, 1); - } - - $number = $this->toArbitraryBase($number, self::ALPHABET, $base); - - if ($negative) { - return '-' . $number; - } - - return $number; - } - - /** - * Converts a non-negative number in an arbitrary base using a custom alphabet, to base 10. - * - * @param string $number The number to convert, validated as a non-empty string, - * containing only chars in the given alphabet/base. - * @param string $alphabet The alphabet that contains every digit, validated as 2 chars minimum. - * @param int $base The base of the number, validated from 2 to alphabet length. - * - * @return string The number in base 10, following the Calculator conventions. - */ - final public function fromArbitraryBase(string $number, string $alphabet, int $base) : string - { - // remove leading "zeros" - $number = \ltrim($number, $alphabet[0]); - - if ($number === '') { - return '0'; - } - - // optimize for "one" - if ($number === $alphabet[1]) { - return '1'; - } - - $result = '0'; - $power = '1'; - - $base = (string) $base; - - for ($i = \strlen($number) - 1; $i >= 0; $i--) { - $index = \strpos($alphabet, $number[$i]); - - if ($index !== 0) { - $result = $this->add($result, ($index === 1) - ? $power - : $this->mul($power, (string) $index) - ); - } - - if ($i !== 0) { - $power = $this->mul($power, $base); - } - } - - return $result; - } - - /** - * Converts a non-negative number to an arbitrary base using a custom alphabet. - * - * @param string $number The number to convert, positive or zero, following the Calculator conventions. - * @param string $alphabet The alphabet that contains every digit, validated as 2 chars minimum. - * @param int $base The base to convert to, validated from 2 to alphabet length. - * - * @return string The converted number in the given alphabet. - */ - final public function toArbitraryBase(string $number, string $alphabet, int $base) : string - { - if ($number === '0') { - return $alphabet[0]; - } - - $base = (string) $base; - $result = ''; - - while ($number !== '0') { - [$number, $remainder] = $this->divQR($number, $base); - $remainder = (int) $remainder; - - $result .= $alphabet[$remainder]; - } - - return \strrev($result); - } - - /** - * Performs a rounded division. - * - * Rounding is performed when the remainder of the division is not zero. - * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * @param int $roundingMode The rounding mode. - * - * @return string - * - * @throws \InvalidArgumentException If the rounding mode is invalid. - * @throws RoundingNecessaryException If RoundingMode::UNNECESSARY is provided but rounding is necessary. - */ - final public function divRound(string $a, string $b, int $roundingMode) : string - { - [$quotient, $remainder] = $this->divQR($a, $b); - - $hasDiscardedFraction = ($remainder !== '0'); - $isPositiveOrZero = ($a[0] === '-') === ($b[0] === '-'); - - $discardedFractionSign = function() use ($remainder, $b) : int { - $r = $this->abs($this->mul($remainder, '2')); - $b = $this->abs($b); - - return $this->cmp($r, $b); - }; - - $increment = false; - - switch ($roundingMode) { - case RoundingMode::UNNECESSARY: - if ($hasDiscardedFraction) { - throw RoundingNecessaryException::roundingNecessary(); - } - break; - - case RoundingMode::UP: - $increment = $hasDiscardedFraction; - break; - - case RoundingMode::DOWN: - break; - - case RoundingMode::CEILING: - $increment = $hasDiscardedFraction && $isPositiveOrZero; - break; - - case RoundingMode::FLOOR: - $increment = $hasDiscardedFraction && ! $isPositiveOrZero; - break; - - case RoundingMode::HALF_UP: - $increment = $discardedFractionSign() >= 0; - break; - - case RoundingMode::HALF_DOWN: - $increment = $discardedFractionSign() > 0; - break; - - case RoundingMode::HALF_CEILING: - $increment = $isPositiveOrZero ? $discardedFractionSign() >= 0 : $discardedFractionSign() > 0; - break; - - case RoundingMode::HALF_FLOOR: - $increment = $isPositiveOrZero ? $discardedFractionSign() > 0 : $discardedFractionSign() >= 0; - break; - - case RoundingMode::HALF_EVEN: - $lastDigit = (int) $quotient[-1]; - $lastDigitIsEven = ($lastDigit % 2 === 0); - $increment = $lastDigitIsEven ? $discardedFractionSign() > 0 : $discardedFractionSign() >= 0; - break; - - default: - throw new \InvalidArgumentException('Invalid rounding mode.'); - } - - if ($increment) { - return $this->add($quotient, $isPositiveOrZero ? '1' : '-1'); - } - - return $quotient; - } - - /** - * Calculates bitwise AND of two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string - */ - public function and(string $a, string $b) : string - { - return $this->bitwise('and', $a, $b); - } - - /** - * Calculates bitwise OR of two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string - */ - public function or(string $a, string $b) : string - { - return $this->bitwise('or', $a, $b); - } - - /** - * Calculates bitwise XOR of two numbers. - * - * This method can be overridden by the concrete implementation if the underlying library - * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string - */ - public function xor(string $a, string $b) : string - { - return $this->bitwise('xor', $a, $b); - } - - /** - * Performs a bitwise operation on a decimal number. - * - * @param string $operator The operator to use, must be "and", "or" or "xor". - * @param string $a The left operand. - * @param string $b The right operand. - * - * @return string - */ - private function bitwise(string $operator, string $a, string $b) : string - { - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - $aBin = $this->toBinary($aDig); - $bBin = $this->toBinary($bDig); - - $aLen = \strlen($aBin); - $bLen = \strlen($bBin); - - if ($aLen > $bLen) { - $bBin = \str_repeat("\x00", $aLen - $bLen) . $bBin; - } elseif ($bLen > $aLen) { - $aBin = \str_repeat("\x00", $bLen - $aLen) . $aBin; - } - - if ($aNeg) { - $aBin = $this->twosComplement($aBin); - } - if ($bNeg) { - $bBin = $this->twosComplement($bBin); - } - - switch ($operator) { - case 'and': - $value = $aBin & $bBin; - $negative = ($aNeg and $bNeg); - break; - - case 'or': - $value = $aBin | $bBin; - $negative = ($aNeg or $bNeg); - break; - - case 'xor': - $value = $aBin ^ $bBin; - $negative = ($aNeg xor $bNeg); - break; - - // @codeCoverageIgnoreStart - default: - throw new \InvalidArgumentException('Invalid bitwise operator.'); - // @codeCoverageIgnoreEnd - } - - if ($negative) { - $value = $this->twosComplement($value); - } - - $result = $this->toDecimal($value); - - return $negative ? $this->neg($result) : $result; - } - - /** - * @param string $number A positive, binary number. - * - * @return string - */ - private function twosComplement(string $number) : string - { - $xor = \str_repeat("\xff", \strlen($number)); - - $number ^= $xor; - - for ($i = \strlen($number) - 1; $i >= 0; $i--) { - $byte = \ord($number[$i]); - - if (++$byte !== 256) { - $number[$i] = \chr($byte); - break; - } - - $number[$i] = "\x00"; - - if ($i === 0) { - $number = "\x01" . $number; - } - } - - return $number; - } - - /** - * Converts a decimal number to a binary string. - * - * @param string $number The number to convert, positive or zero, only digits. - * - * @return string - */ - private function toBinary(string $number) : string - { - $result = ''; - - while ($number !== '0') { - [$number, $remainder] = $this->divQR($number, '256'); - $result .= \chr((int) $remainder); - } - - return \strrev($result); - } - - /** - * Returns the positive decimal representation of a binary number. - * - * @param string $bytes The bytes representing the number. - * - * @return string - */ - private function toDecimal(string $bytes) : string - { - $result = '0'; - $power = '1'; - - for ($i = \strlen($bytes) - 1; $i >= 0; $i--) { - $index = \ord($bytes[$i]); - - if ($index !== 0) { - $result = $this->add($result, ($index === 1) - ? $power - : $this->mul($power, (string) $index) - ); - } - - if ($i !== 0) { - $power = $this->mul($power, '256'); - } - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php deleted file mode 100644 index 6632b378..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php +++ /dev/null @@ -1,116 +0,0 @@ -= 0) { - return \bcmod($a, $b, 0); - } - - return \bcmod($a, $b); - } - - /** - * {@inheritdoc} - */ - public function divQR(string $a, string $b) : array - { - $q = \bcdiv($a, $b, 0); - - if (version_compare(PHP_VERSION, '7.2') >= 0) { - $r = \bcmod($a, $b, 0); - } else { - $r = \bcmod($a, $b); - } - - assert($q !== null); - assert($r !== null); - - return [$q, $r]; - } - - /** - * {@inheritdoc} - */ - public function pow(string $a, int $e) : string - { - return \bcpow($a, (string) $e, 0); - } - - /** - * {@inheritdoc} - * - * @psalm-suppress InvalidNullableReturnType - * @psalm-suppress NullableReturnStatement - */ - public function modPow(string $base, string $exp, string $mod) : string - { - return \bcpowmod($base, $exp, $mod, 0); - } - - /** - * {@inheritDoc} - * - * @psalm-suppress NullableReturnStatement - * @psalm-suppress InvalidNullableReturnType - */ - public function sqrt(string $n) : string - { - return \bcsqrt($n, 0); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Internal/Calculator/GmpCalculator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Internal/Calculator/GmpCalculator.php deleted file mode 100644 index 52d18800..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/Internal/Calculator/GmpCalculator.php +++ /dev/null @@ -1,156 +0,0 @@ -maxDigits = 9; - break; - - case 8: - $this->maxDigits = 18; - break; - - default: - throw new \RuntimeException('The platform is not 32-bit or 64-bit as expected.'); - } - } - - /** - * {@inheritdoc} - */ - public function add(string $a, string $b) : string - { - /** - * @psalm-var numeric-string $a - * @psalm-var numeric-string $b - */ - $result = $a + $b; - - if (is_int($result)) { - return (string) $result; - } - - if ($a === '0') { - return $b; - } - - if ($b === '0') { - return $a; - } - - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - $result = $aNeg === $bNeg ? $this->doAdd($aDig, $bDig) : $this->doSub($aDig, $bDig); - - if ($aNeg) { - $result = $this->neg($result); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function sub(string $a, string $b) : string - { - return $this->add($a, $this->neg($b)); - } - - /** - * {@inheritdoc} - */ - public function mul(string $a, string $b) : string - { - /** - * @psalm-var numeric-string $a - * @psalm-var numeric-string $b - */ - $result = $a * $b; - - if (is_int($result)) { - return (string) $result; - } - - if ($a === '0' || $b === '0') { - return '0'; - } - - if ($a === '1') { - return $b; - } - - if ($b === '1') { - return $a; - } - - if ($a === '-1') { - return $this->neg($b); - } - - if ($b === '-1') { - return $this->neg($a); - } - - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - $result = $this->doMul($aDig, $bDig); - - if ($aNeg !== $bNeg) { - $result = $this->neg($result); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function divQ(string $a, string $b) : string - { - return $this->divQR($a, $b)[0]; - } - - /** - * {@inheritdoc} - */ - public function divR(string $a, string $b): string - { - return $this->divQR($a, $b)[1]; - } - - /** - * {@inheritdoc} - */ - public function divQR(string $a, string $b) : array - { - if ($a === '0') { - return ['0', '0']; - } - - if ($a === $b) { - return ['1', '0']; - } - - if ($b === '1') { - return [$a, '0']; - } - - if ($b === '-1') { - return [$this->neg($a), '0']; - } - - /** @psalm-var numeric-string $a */ - $na = $a * 1; // cast to number - - if (is_int($na)) { - /** @psalm-var numeric-string $b */ - $nb = $b * 1; - - if (is_int($nb)) { - // the only division that may overflow is PHP_INT_MIN / -1, - // which cannot happen here as we've already handled a divisor of -1 above. - $r = $na % $nb; - $q = ($na - $r) / $nb; - - assert(is_int($q)); - - return [ - (string) $q, - (string) $r - ]; - } - } - - [$aNeg, $bNeg, $aDig, $bDig] = $this->init($a, $b); - - [$q, $r] = $this->doDiv($aDig, $bDig); - - if ($aNeg !== $bNeg) { - $q = $this->neg($q); - } - - if ($aNeg) { - $r = $this->neg($r); - } - - return [$q, $r]; - } - - /** - * {@inheritdoc} - */ - public function pow(string $a, int $e) : string - { - if ($e === 0) { - return '1'; - } - - if ($e === 1) { - return $a; - } - - $odd = $e % 2; - $e -= $odd; - - $aa = $this->mul($a, $a); - - /** @psalm-suppress PossiblyInvalidArgument We're sure that $e / 2 is an int now */ - $result = $this->pow($aa, $e / 2); - - if ($odd === 1) { - $result = $this->mul($result, $a); - } - - return $result; - } - - /** - * Algorithm from: https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/ - * - * {@inheritdoc} - */ - public function modPow(string $base, string $exp, string $mod) : string - { - // special case: the algorithm below fails with 0 power 0 mod 1 (returns 1 instead of 0) - if ($base === '0' && $exp === '0' && $mod === '1') { - return '0'; - } - - // special case: the algorithm below fails with power 0 mod 1 (returns 1 instead of 0) - if ($exp === '0' && $mod === '1') { - return '0'; - } - - $x = $base; - - $res = '1'; - - // numbers are positive, so we can use remainder instead of modulo - $x = $this->divR($x, $mod); - - while ($exp !== '0') { - if (in_array($exp[-1], ['1', '3', '5', '7', '9'])) { // odd - $res = $this->divR($this->mul($res, $x), $mod); - } - - $exp = $this->divQ($exp, '2'); - $x = $this->divR($this->mul($x, $x), $mod); - } - - return $res; - } - - /** - * Adapted from https://cp-algorithms.com/num_methods/roots_newton.html - * - * {@inheritDoc} - */ - public function sqrt(string $n) : string - { - if ($n === '0') { - return '0'; - } - - // initial approximation - $x = \str_repeat('9', \intdiv(\strlen($n), 2) ?: 1); - - $decreased = false; - - for (;;) { - $nx = $this->divQ($this->add($x, $this->divQ($n, $x)), '2'); - - if ($x === $nx || $this->cmp($nx, $x) > 0 && $decreased) { - break; - } - - $decreased = $this->cmp($nx, $x) < 0; - $x = $nx; - } - - return $x; - } - - /** - * Performs the addition of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string - */ - private function doAdd(string $a, string $b) : string - { - [$a, $b, $length] = $this->pad($a, $b); - - $carry = 0; - $result = ''; - - for ($i = $length - $this->maxDigits;; $i -= $this->maxDigits) { - $blockLength = $this->maxDigits; - - if ($i < 0) { - $blockLength += $i; - /** @psalm-suppress LoopInvalidation */ - $i = 0; - } - - /** @psalm-var numeric-string $blockA */ - $blockA = \substr($a, $i, $blockLength); - - /** @psalm-var numeric-string $blockB */ - $blockB = \substr($b, $i, $blockLength); - - $sum = (string) ($blockA + $blockB + $carry); - $sumLength = \strlen($sum); - - if ($sumLength > $blockLength) { - $sum = \substr($sum, 1); - $carry = 1; - } else { - if ($sumLength < $blockLength) { - $sum = \str_repeat('0', $blockLength - $sumLength) . $sum; - } - $carry = 0; - } - - $result = $sum . $result; - - if ($i === 0) { - break; - } - } - - if ($carry === 1) { - $result = '1' . $result; - } - - return $result; - } - - /** - * Performs the subtraction of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string - */ - private function doSub(string $a, string $b) : string - { - if ($a === $b) { - return '0'; - } - - // Ensure that we always subtract to a positive result: biggest minus smallest. - $cmp = $this->doCmp($a, $b); - - $invert = ($cmp === -1); - - if ($invert) { - $c = $a; - $a = $b; - $b = $c; - } - - [$a, $b, $length] = $this->pad($a, $b); - - $carry = 0; - $result = ''; - - $complement = 10 ** $this->maxDigits; - - for ($i = $length - $this->maxDigits;; $i -= $this->maxDigits) { - $blockLength = $this->maxDigits; - - if ($i < 0) { - $blockLength += $i; - /** @psalm-suppress LoopInvalidation */ - $i = 0; - } - - /** @psalm-var numeric-string $blockA */ - $blockA = \substr($a, $i, $blockLength); - - /** @psalm-var numeric-string $blockB */ - $blockB = \substr($b, $i, $blockLength); - - $sum = $blockA - $blockB - $carry; - - if ($sum < 0) { - $sum += $complement; - $carry = 1; - } else { - $carry = 0; - } - - $sum = (string) $sum; - $sumLength = \strlen($sum); - - if ($sumLength < $blockLength) { - $sum = \str_repeat('0', $blockLength - $sumLength) . $sum; - } - - $result = $sum . $result; - - if ($i === 0) { - break; - } - } - - // Carry cannot be 1 when the loop ends, as a > b - assert($carry === 0); - - $result = \ltrim($result, '0'); - - if ($invert) { - $result = $this->neg($result); - } - - return $result; - } - - /** - * Performs the multiplication of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string - */ - private function doMul(string $a, string $b) : string - { - $x = \strlen($a); - $y = \strlen($b); - - $maxDigits = \intdiv($this->maxDigits, 2); - $complement = 10 ** $maxDigits; - - $result = '0'; - - for ($i = $x - $maxDigits;; $i -= $maxDigits) { - $blockALength = $maxDigits; - - if ($i < 0) { - $blockALength += $i; - /** @psalm-suppress LoopInvalidation */ - $i = 0; - } - - $blockA = (int) \substr($a, $i, $blockALength); - - $line = ''; - $carry = 0; - - for ($j = $y - $maxDigits;; $j -= $maxDigits) { - $blockBLength = $maxDigits; - - if ($j < 0) { - $blockBLength += $j; - /** @psalm-suppress LoopInvalidation */ - $j = 0; - } - - $blockB = (int) \substr($b, $j, $blockBLength); - - $mul = $blockA * $blockB + $carry; - $value = $mul % $complement; - $carry = ($mul - $value) / $complement; - - $value = (string) $value; - $value = \str_pad($value, $maxDigits, '0', STR_PAD_LEFT); - - $line = $value . $line; - - if ($j === 0) { - break; - } - } - - if ($carry !== 0) { - $line = $carry . $line; - } - - $line = \ltrim($line, '0'); - - if ($line !== '') { - $line .= \str_repeat('0', $x - $blockALength - $i); - $result = $this->add($result, $line); - } - - if ($i === 0) { - break; - } - } - - return $result; - } - - /** - * Performs the division of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string[] The quotient and remainder. - */ - private function doDiv(string $a, string $b) : array - { - $cmp = $this->doCmp($a, $b); - - if ($cmp === -1) { - return ['0', $a]; - } - - $x = \strlen($a); - $y = \strlen($b); - - // we now know that a >= b && x >= y - - $q = '0'; // quotient - $r = $a; // remainder - $z = $y; // focus length, always $y or $y+1 - - for (;;) { - $focus = \substr($a, 0, $z); - - $cmp = $this->doCmp($focus, $b); - - if ($cmp === -1) { - if ($z === $x) { // remainder < dividend - break; - } - - $z++; - } - - $zeros = \str_repeat('0', $x - $z); - - $q = $this->add($q, '1' . $zeros); - $a = $this->sub($a, $b . $zeros); - - $r = $a; - - if ($r === '0') { // remainder == 0 - break; - } - - $x = \strlen($a); - - if ($x < $y) { // remainder < dividend - break; - } - - $z = $y; - } - - return [$q, $r]; - } - - /** - * Compares two non-signed large numbers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return int [-1, 0, 1] - */ - private function doCmp(string $a, string $b) : int - { - $x = \strlen($a); - $y = \strlen($b); - - $cmp = $x <=> $y; - - if ($cmp !== 0) { - return $cmp; - } - - return \strcmp($a, $b) <=> 0; // enforce [-1, 0, 1] - } - - /** - * Pads the left of one of the given numbers with zeros if necessary to make both numbers the same length. - * - * The numbers must only consist of digits, without leading minus sign. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return array{string, string, int} - */ - private function pad(string $a, string $b) : array - { - $x = \strlen($a); - $y = \strlen($b); - - if ($x > $y) { - $b = \str_repeat('0', $x - $y) . $b; - - return [$a, $b, $x]; - } - - if ($x < $y) { - $a = \str_repeat('0', $y - $x) . $a; - - return [$a, $b, $y]; - } - - return [$a, $b, $x]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/RoundingMode.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/RoundingMode.php deleted file mode 100644 index 06936d8d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/brick/math/src/RoundingMode.php +++ /dev/null @@ -1,107 +0,0 @@ -= 0.5; otherwise, behaves as for DOWN. - * Note that this is the rounding mode commonly taught at school. - */ - public const HALF_UP = 5; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. - * - * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves as for DOWN. - */ - public const HALF_DOWN = 6; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards positive infinity. - * - * If the result is positive, behaves as for HALF_UP; if negative, behaves as for HALF_DOWN. - */ - public const HALF_CEILING = 7; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards negative infinity. - * - * If the result is positive, behaves as for HALF_DOWN; if negative, behaves as for HALF_UP. - */ - public const HALF_FLOOR = 8; - - /** - * Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the even neighbor. - * - * Behaves as for HALF_UP if the digit to the left of the discarded fraction is odd; - * behaves as for HALF_DOWN if it's even. - * - * Note that this is the rounding mode that statistically minimizes - * cumulative error when applied repeatedly over a sequence of calculations. - * It is sometimes known as "Banker's rounding", and is chiefly used in the USA. - */ - public const HALF_EVEN = 9; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/ClassLoader.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/ClassLoader.php deleted file mode 100644 index 7824d8f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/ClassLoader.php +++ /dev/null @@ -1,579 +0,0 @@ - - * 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/wp-webauthn/wp-webauthn-vendor/composer/InstalledVersions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/InstalledVersions.php deleted file mode 100644 index 51e734a7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,359 +0,0 @@ - - * 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/wp-webauthn/wp-webauthn-vendor/composer/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/LICENSE deleted file mode 100644 index f27399a0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -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/wp-webauthn/wp-webauthn-vendor/composer/autoload_classmap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_classmap.php deleted file mode 100644 index 10611bf5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,669 +0,0 @@ - $vendorDir . '/beberlei/assert/lib/Assert/Assert.php', - 'Assert\\Assertion' => $vendorDir . '/beberlei/assert/lib/Assert/Assertion.php', - 'Assert\\AssertionChain' => $vendorDir . '/beberlei/assert/lib/Assert/AssertionChain.php', - 'Assert\\AssertionFailedException' => $vendorDir . '/beberlei/assert/lib/Assert/AssertionFailedException.php', - 'Assert\\InvalidArgumentException' => $vendorDir . '/beberlei/assert/lib/Assert/InvalidArgumentException.php', - 'Assert\\LazyAssertion' => $vendorDir . '/beberlei/assert/lib/Assert/LazyAssertion.php', - 'Assert\\LazyAssertionException' => $vendorDir . '/beberlei/assert/lib/Assert/LazyAssertionException.php', - 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Base64Url\\Base64Url' => $vendorDir . '/spomky-labs/base64url/src/Base64Url.php', - 'Brick\\Math\\BigDecimal' => $vendorDir . '/brick/math/src/BigDecimal.php', - 'Brick\\Math\\BigInteger' => $vendorDir . '/brick/math/src/BigInteger.php', - 'Brick\\Math\\BigNumber' => $vendorDir . '/brick/math/src/BigNumber.php', - 'Brick\\Math\\BigRational' => $vendorDir . '/brick/math/src/BigRational.php', - 'Brick\\Math\\Exception\\DivisionByZeroException' => $vendorDir . '/brick/math/src/Exception/DivisionByZeroException.php', - 'Brick\\Math\\Exception\\IntegerOverflowException' => $vendorDir . '/brick/math/src/Exception/IntegerOverflowException.php', - 'Brick\\Math\\Exception\\MathException' => $vendorDir . '/brick/math/src/Exception/MathException.php', - 'Brick\\Math\\Exception\\NegativeNumberException' => $vendorDir . '/brick/math/src/Exception/NegativeNumberException.php', - 'Brick\\Math\\Exception\\NumberFormatException' => $vendorDir . '/brick/math/src/Exception/NumberFormatException.php', - 'Brick\\Math\\Exception\\RoundingNecessaryException' => $vendorDir . '/brick/math/src/Exception/RoundingNecessaryException.php', - 'Brick\\Math\\Internal\\Calculator' => $vendorDir . '/brick/math/src/Internal/Calculator.php', - 'Brick\\Math\\Internal\\Calculator\\BcMathCalculator' => $vendorDir . '/brick/math/src/Internal/Calculator/BcMathCalculator.php', - 'Brick\\Math\\Internal\\Calculator\\GmpCalculator' => $vendorDir . '/brick/math/src/Internal/Calculator/GmpCalculator.php', - 'Brick\\Math\\Internal\\Calculator\\NativeCalculator' => $vendorDir . '/brick/math/src/Internal/Calculator/NativeCalculator.php', - 'Brick\\Math\\RoundingMode' => $vendorDir . '/brick/math/src/RoundingMode.php', - 'CBOR\\AbstractCBORObject' => $vendorDir . '/spomky-labs/cbor-php/src/AbstractCBORObject.php', - 'CBOR\\ByteStringObject' => $vendorDir . '/spomky-labs/cbor-php/src/ByteStringObject.php', - 'CBOR\\ByteStringWithChunkObject' => $vendorDir . '/spomky-labs/cbor-php/src/ByteStringWithChunkObject.php', - 'CBOR\\CBORObject' => $vendorDir . '/spomky-labs/cbor-php/src/CBORObject.php', - 'CBOR\\Decoder' => $vendorDir . '/spomky-labs/cbor-php/src/Decoder.php', - 'CBOR\\DecoderInterface' => $vendorDir . '/spomky-labs/cbor-php/src/DecoderInterface.php', - 'CBOR\\IndefiniteLengthByteStringObject' => $vendorDir . '/spomky-labs/cbor-php/src/IndefiniteLengthByteStringObject.php', - 'CBOR\\IndefiniteLengthListObject' => $vendorDir . '/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php', - 'CBOR\\IndefiniteLengthMapObject' => $vendorDir . '/spomky-labs/cbor-php/src/IndefiniteLengthMapObject.php', - 'CBOR\\IndefiniteLengthTextStringObject' => $vendorDir . '/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php', - 'CBOR\\InfiniteListObject' => $vendorDir . '/spomky-labs/cbor-php/src/InfiniteListObject.php', - 'CBOR\\InfiniteMapObject' => $vendorDir . '/spomky-labs/cbor-php/src/InfiniteMapObject.php', - 'CBOR\\LengthCalculator' => $vendorDir . '/spomky-labs/cbor-php/src/LengthCalculator.php', - 'CBOR\\ListObject' => $vendorDir . '/spomky-labs/cbor-php/src/ListObject.php', - 'CBOR\\MapItem' => $vendorDir . '/spomky-labs/cbor-php/src/MapItem.php', - 'CBOR\\MapObject' => $vendorDir . '/spomky-labs/cbor-php/src/MapObject.php', - 'CBOR\\NegativeIntegerObject' => $vendorDir . '/spomky-labs/cbor-php/src/NegativeIntegerObject.php', - 'CBOR\\Normalizable' => $vendorDir . '/spomky-labs/cbor-php/src/Normalizable.php', - 'CBOR\\OtherObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject.php', - 'CBOR\\OtherObject\\BreakObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/BreakObject.php', - 'CBOR\\OtherObject\\DoublePrecisionFloatObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/DoublePrecisionFloatObject.php', - 'CBOR\\OtherObject\\FalseObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/FalseObject.php', - 'CBOR\\OtherObject\\GenericObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/GenericObject.php', - 'CBOR\\OtherObject\\HalfPrecisionFloatObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php', - 'CBOR\\OtherObject\\NullObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/NullObject.php', - 'CBOR\\OtherObject\\OtherObjectManager' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/OtherObjectManager.php', - 'CBOR\\OtherObject\\OtherObjectManagerInterface' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/OtherObjectManagerInterface.php', - 'CBOR\\OtherObject\\SimpleObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/SimpleObject.php', - 'CBOR\\OtherObject\\SinglePrecisionFloatObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php', - 'CBOR\\OtherObject\\TrueObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/TrueObject.php', - 'CBOR\\OtherObject\\UndefinedObject' => $vendorDir . '/spomky-labs/cbor-php/src/OtherObject/UndefinedObject.php', - 'CBOR\\SignedIntegerObject' => $vendorDir . '/spomky-labs/cbor-php/src/SignedIntegerObject.php', - 'CBOR\\Stream' => $vendorDir . '/spomky-labs/cbor-php/src/Stream.php', - 'CBOR\\StringStream' => $vendorDir . '/spomky-labs/cbor-php/src/StringStream.php', - 'CBOR\\Tag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag.php', - 'CBOR\\TagObject' => $vendorDir . '/spomky-labs/cbor-php/src/TagObject.php', - 'CBOR\\Tag\\Base16EncodingTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/Base16EncodingTag.php', - 'CBOR\\Tag\\Base64EncodingTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/Base64EncodingTag.php', - 'CBOR\\Tag\\Base64Tag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/Base64Tag.php', - 'CBOR\\Tag\\Base64UrlEncodingTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/Base64UrlEncodingTag.php', - 'CBOR\\Tag\\Base64UrlTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/Base64UrlTag.php', - 'CBOR\\Tag\\BigFloatTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/BigFloatTag.php', - 'CBOR\\Tag\\CBOREncodingTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/CBOREncodingTag.php', - 'CBOR\\Tag\\CBORTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/CBORTag.php', - 'CBOR\\Tag\\DatetimeTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/DatetimeTag.php', - 'CBOR\\Tag\\DecimalFractionTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/DecimalFractionTag.php', - 'CBOR\\Tag\\EpochTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/EpochTag.php', - 'CBOR\\Tag\\GenericTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/GenericTag.php', - 'CBOR\\Tag\\MimeTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/MimeTag.php', - 'CBOR\\Tag\\NegativeBigIntegerTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/NegativeBigIntegerTag.php', - 'CBOR\\Tag\\PositiveBigIntegerTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/PositiveBigIntegerTag.php', - 'CBOR\\Tag\\TagManager' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/TagManager.php', - 'CBOR\\Tag\\TagManagerInterface' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/TagManagerInterface.php', - 'CBOR\\Tag\\TagObjectManager' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/TagObjectManager.php', - 'CBOR\\Tag\\TimestampTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/TimestampTag.php', - 'CBOR\\Tag\\UnsignedBigIntegerTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/UnsignedBigIntegerTag.php', - 'CBOR\\Tag\\UriTag' => $vendorDir . '/spomky-labs/cbor-php/src/Tag/UriTag.php', - 'CBOR\\TextStringObject' => $vendorDir . '/spomky-labs/cbor-php/src/TextStringObject.php', - 'CBOR\\TextStringWithChunkObject' => $vendorDir . '/spomky-labs/cbor-php/src/TextStringWithChunkObject.php', - 'CBOR\\UnsignedIntegerObject' => $vendorDir . '/spomky-labs/cbor-php/src/UnsignedIntegerObject.php', - 'CBOR\\Utils' => $vendorDir . '/spomky-labs/cbor-php/src/Utils.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'Cose\\Algorithm\\Algorithm' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Algorithm.php', - 'Cose\\Algorithm\\Mac\\HS256' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Mac/HS256.php', - 'Cose\\Algorithm\\Mac\\HS256Truncated64' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Mac/HS256Truncated64.php', - 'Cose\\Algorithm\\Mac\\HS384' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Mac/HS384.php', - 'Cose\\Algorithm\\Mac\\HS512' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Mac/HS512.php', - 'Cose\\Algorithm\\Mac\\Hmac' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Mac/Hmac.php', - 'Cose\\Algorithm\\Mac\\Mac' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Mac/Mac.php', - 'Cose\\Algorithm\\Manager' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Manager.php', - 'Cose\\Algorithm\\ManagerFactory' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/ManagerFactory.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ECDSA' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECDSA.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ECSignature' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECSignature.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES256' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES256.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES256K' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES256K.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES384' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES384.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES512' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES512.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\ED256' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/ED256.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\ED512' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/ED512.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\Ed25519' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/Ed25519.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\EdDSA' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/EdDSA.php', - 'Cose\\Algorithm\\Signature\\RSA\\PS256' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS256.php', - 'Cose\\Algorithm\\Signature\\RSA\\PS384' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS384.php', - 'Cose\\Algorithm\\Signature\\RSA\\PS512' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS512.php', - 'Cose\\Algorithm\\Signature\\RSA\\PSSRSA' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PSSRSA.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS1' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS1.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS256' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS256.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS384' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS384.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS512' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS512.php', - 'Cose\\Algorithm\\Signature\\RSA\\RSA' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RSA.php', - 'Cose\\Algorithm\\Signature\\Signature' => $vendorDir . '/web-auth/cose-lib/src/Algorithm/Signature/Signature.php', - 'Cose\\Algorithms' => $vendorDir . '/web-auth/cose-lib/src/Algorithms.php', - 'Cose\\BigInteger' => $vendorDir . '/web-auth/cose-lib/src/BigInteger.php', - 'Cose\\Hash' => $vendorDir . '/web-auth/cose-lib/src/Hash.php', - 'Cose\\Key\\Ec2Key' => $vendorDir . '/web-auth/cose-lib/src/Key/Ec2Key.php', - 'Cose\\Key\\Key' => $vendorDir . '/web-auth/cose-lib/src/Key/Key.php', - 'Cose\\Key\\OkpKey' => $vendorDir . '/web-auth/cose-lib/src/Key/OkpKey.php', - 'Cose\\Key\\RsaKey' => $vendorDir . '/web-auth/cose-lib/src/Key/RsaKey.php', - 'Cose\\Key\\SymmetricKey' => $vendorDir . '/web-auth/cose-lib/src/Key/SymmetricKey.php', - 'Cose\\Verifier' => $vendorDir . '/web-auth/cose-lib/src/Verifier.php', - 'FG\\ASN1\\ASNObject' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/ASNObject.php', - 'FG\\ASN1\\AbstractString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/AbstractString.php', - 'FG\\ASN1\\AbstractTime' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/AbstractTime.php', - 'FG\\ASN1\\Base128' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Base128.php', - 'FG\\ASN1\\Composite\\AttributeTypeAndValue' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php', - 'FG\\ASN1\\Composite\\RDNString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php', - 'FG\\ASN1\\Composite\\RelativeDistinguishedName' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php', - 'FG\\ASN1\\Construct' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Construct.php', - 'FG\\ASN1\\Exception\\NotImplementedException' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php', - 'FG\\ASN1\\Exception\\ParserException' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php', - 'FG\\ASN1\\ExplicitlyTaggedObject' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php', - 'FG\\ASN1\\Identifier' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Identifier.php', - 'FG\\ASN1\\OID' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/OID.php', - 'FG\\ASN1\\Parsable' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Parsable.php', - 'FG\\ASN1\\TemplateParser' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/TemplateParser.php', - 'FG\\ASN1\\Universal\\BMPString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php', - 'FG\\ASN1\\Universal\\BitString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php', - 'FG\\ASN1\\Universal\\Boolean' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php', - 'FG\\ASN1\\Universal\\CharacterString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php', - 'FG\\ASN1\\Universal\\Enumerated' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php', - 'FG\\ASN1\\Universal\\GeneralString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php', - 'FG\\ASN1\\Universal\\GeneralizedTime' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php', - 'FG\\ASN1\\Universal\\GraphicString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php', - 'FG\\ASN1\\Universal\\IA5String' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php', - 'FG\\ASN1\\Universal\\Integer' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php', - 'FG\\ASN1\\Universal\\NullObject' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php', - 'FG\\ASN1\\Universal\\NumericString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php', - 'FG\\ASN1\\Universal\\ObjectDescriptor' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php', - 'FG\\ASN1\\Universal\\ObjectIdentifier' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php', - 'FG\\ASN1\\Universal\\OctetString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php', - 'FG\\ASN1\\Universal\\PrintableString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php', - 'FG\\ASN1\\Universal\\RelativeObjectIdentifier' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php', - 'FG\\ASN1\\Universal\\Sequence' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php', - 'FG\\ASN1\\Universal\\Set' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/Set.php', - 'FG\\ASN1\\Universal\\T61String' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php', - 'FG\\ASN1\\Universal\\UTCTime' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php', - 'FG\\ASN1\\Universal\\UTF8String' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php', - 'FG\\ASN1\\Universal\\UniversalString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php', - 'FG\\ASN1\\Universal\\VisibleString' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php', - 'FG\\ASN1\\UnknownConstructedObject' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php', - 'FG\\ASN1\\UnknownObject' => $vendorDir . '/fgrosse/phpasn1/lib/ASN1/UnknownObject.php', - 'FG\\Utility\\BigInteger' => $vendorDir . '/fgrosse/phpasn1/lib/Utility/BigInteger.php', - 'FG\\Utility\\BigIntegerBcmath' => $vendorDir . '/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php', - 'FG\\Utility\\BigIntegerGmp' => $vendorDir . '/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php', - 'FG\\X509\\AlgorithmIdentifier' => $vendorDir . '/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php', - 'FG\\X509\\CSR\\Attributes' => $vendorDir . '/fgrosse/phpasn1/lib/X509/CSR/Attributes.php', - 'FG\\X509\\CSR\\CSR' => $vendorDir . '/fgrosse/phpasn1/lib/X509/CSR/CSR.php', - 'FG\\X509\\CertificateExtensions' => $vendorDir . '/fgrosse/phpasn1/lib/X509/CertificateExtensions.php', - 'FG\\X509\\CertificateSubject' => $vendorDir . '/fgrosse/phpasn1/lib/X509/CertificateSubject.php', - 'FG\\X509\\PrivateKey' => $vendorDir . '/fgrosse/phpasn1/lib/X509/PrivateKey.php', - 'FG\\X509\\PublicKey' => $vendorDir . '/fgrosse/phpasn1/lib/X509/PublicKey.php', - 'FG\\X509\\SAN\\DNSName' => $vendorDir . '/fgrosse/phpasn1/lib/X509/SAN/DNSName.php', - 'FG\\X509\\SAN\\IPAddress' => $vendorDir . '/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php', - 'FG\\X509\\SAN\\SubjectAlternativeNames' => $vendorDir . '/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php', - 'Jose\\Component\\Core\\Algorithm' => $vendorDir . '/web-token/jwt-core/Algorithm.php', - 'Jose\\Component\\Core\\AlgorithmManager' => $vendorDir . '/web-token/jwt-core/AlgorithmManager.php', - 'Jose\\Component\\Core\\AlgorithmManagerFactory' => $vendorDir . '/web-token/jwt-core/AlgorithmManagerFactory.php', - 'Jose\\Component\\Core\\JWK' => $vendorDir . '/web-token/jwt-core/JWK.php', - 'Jose\\Component\\Core\\JWKSet' => $vendorDir . '/web-token/jwt-core/JWKSet.php', - 'Jose\\Component\\Core\\JWT' => $vendorDir . '/web-token/jwt-core/JWT.php', - 'Jose\\Component\\Core\\Util\\BigInteger' => $vendorDir . '/web-token/jwt-core/Util/BigInteger.php', - 'Jose\\Component\\Core\\Util\\ECKey' => $vendorDir . '/web-token/jwt-core/Util/ECKey.php', - 'Jose\\Component\\Core\\Util\\ECSignature' => $vendorDir . '/web-token/jwt-core/Util/ECSignature.php', - 'Jose\\Component\\Core\\Util\\Hash' => $vendorDir . '/web-token/jwt-core/Util/Hash.php', - 'Jose\\Component\\Core\\Util\\JsonConverter' => $vendorDir . '/web-token/jwt-core/Util/JsonConverter.php', - 'Jose\\Component\\Core\\Util\\KeyChecker' => $vendorDir . '/web-token/jwt-core/Util/KeyChecker.php', - 'Jose\\Component\\Core\\Util\\RSAKey' => $vendorDir . '/web-token/jwt-core/Util/RSAKey.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\AlgorithmAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/AlgorithmAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ES256KeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/ES256KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ES384KeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/ES384KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ES512KeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/ES512KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\HS256KeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/HS256KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\HS384KeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/HS384KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\HS512KeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/HS512KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeyAnalyzerManager' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/KeyAnalyzerManager.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeyIdentifierAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/KeyIdentifierAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeysetAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/KeysetAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeysetAnalyzerManager' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/KeysetAnalyzerManager.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\Message' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/Message.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\MessageBag' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/MessageBag.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\MixedKeyTypes' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/MixedKeyTypes.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\MixedPublicAndPrivateKeys' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/MixedPublicAndPrivateKeys.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\NoneAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/NoneAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\OctAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/OctAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\RsaAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/RsaAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\UsageAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/UsageAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ZxcvbnKeyAnalyzer' => $vendorDir . '/web-token/jwt-key-mgmt/Analyzer/ZxcvbnKeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\JKUFactory' => $vendorDir . '/web-token/jwt-key-mgmt/JKUFactory.php', - 'Jose\\Component\\KeyManagement\\JWKFactory' => $vendorDir . '/web-token/jwt-key-mgmt/JWKFactory.php', - 'Jose\\Component\\KeyManagement\\KeyConverter\\ECKey' => $vendorDir . '/web-token/jwt-key-mgmt/KeyConverter/ECKey.php', - 'Jose\\Component\\KeyManagement\\KeyConverter\\KeyConverter' => $vendorDir . '/web-token/jwt-key-mgmt/KeyConverter/KeyConverter.php', - 'Jose\\Component\\KeyManagement\\KeyConverter\\RSAKey' => $vendorDir . '/web-token/jwt-key-mgmt/KeyConverter/RSAKey.php', - 'Jose\\Component\\KeyManagement\\UrlKeySetFactory' => $vendorDir . '/web-token/jwt-key-mgmt/UrlKeySetFactory.php', - 'Jose\\Component\\KeyManagement\\X5UFactory' => $vendorDir . '/web-token/jwt-key-mgmt/X5UFactory.php', - 'Jose\\Component\\Signature\\Algorithm\\ECDSA' => $vendorDir . '/web-token/jwt-signature-algorithm-ecdsa/ECDSA.php', - 'Jose\\Component\\Signature\\Algorithm\\ES256' => $vendorDir . '/web-token/jwt-signature-algorithm-ecdsa/ES256.php', - 'Jose\\Component\\Signature\\Algorithm\\ES384' => $vendorDir . '/web-token/jwt-signature-algorithm-ecdsa/ES384.php', - 'Jose\\Component\\Signature\\Algorithm\\ES512' => $vendorDir . '/web-token/jwt-signature-algorithm-ecdsa/ES512.php', - 'Jose\\Component\\Signature\\Algorithm\\EdDSA' => $vendorDir . '/web-token/jwt-signature-algorithm-eddsa/EdDSA.php', - 'Jose\\Component\\Signature\\Algorithm\\MacAlgorithm' => $vendorDir . '/web-token/jwt-signature/Algorithm/MacAlgorithm.php', - 'Jose\\Component\\Signature\\Algorithm\\PS256' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/PS256.php', - 'Jose\\Component\\Signature\\Algorithm\\PS384' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/PS384.php', - 'Jose\\Component\\Signature\\Algorithm\\PS512' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/PS512.php', - 'Jose\\Component\\Signature\\Algorithm\\RS256' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/RS256.php', - 'Jose\\Component\\Signature\\Algorithm\\RS384' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/RS384.php', - 'Jose\\Component\\Signature\\Algorithm\\RS512' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/RS512.php', - 'Jose\\Component\\Signature\\Algorithm\\RSA' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/RSA.php', - 'Jose\\Component\\Signature\\Algorithm\\RSAPKCS1' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/RSAPKCS1.php', - 'Jose\\Component\\Signature\\Algorithm\\RSAPSS' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/RSAPSS.php', - 'Jose\\Component\\Signature\\Algorithm\\SignatureAlgorithm' => $vendorDir . '/web-token/jwt-signature/Algorithm/SignatureAlgorithm.php', - 'Jose\\Component\\Signature\\Algorithm\\Util\\RSA' => $vendorDir . '/web-token/jwt-signature-algorithm-rsa/Util/RSA.php', - 'Jose\\Component\\Signature\\JWS' => $vendorDir . '/web-token/jwt-signature/JWS.php', - 'Jose\\Component\\Signature\\JWSBuilder' => $vendorDir . '/web-token/jwt-signature/JWSBuilder.php', - 'Jose\\Component\\Signature\\JWSBuilderFactory' => $vendorDir . '/web-token/jwt-signature/JWSBuilderFactory.php', - 'Jose\\Component\\Signature\\JWSLoader' => $vendorDir . '/web-token/jwt-signature/JWSLoader.php', - 'Jose\\Component\\Signature\\JWSLoaderFactory' => $vendorDir . '/web-token/jwt-signature/JWSLoaderFactory.php', - 'Jose\\Component\\Signature\\JWSTokenSupport' => $vendorDir . '/web-token/jwt-signature/JWSTokenSupport.php', - 'Jose\\Component\\Signature\\JWSVerifier' => $vendorDir . '/web-token/jwt-signature/JWSVerifier.php', - 'Jose\\Component\\Signature\\JWSVerifierFactory' => $vendorDir . '/web-token/jwt-signature/JWSVerifierFactory.php', - 'Jose\\Component\\Signature\\Serializer\\CompactSerializer' => $vendorDir . '/web-token/jwt-signature/Serializer/CompactSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JSONFlattenedSerializer' => $vendorDir . '/web-token/jwt-signature/Serializer/JSONFlattenedSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JSONGeneralSerializer' => $vendorDir . '/web-token/jwt-signature/Serializer/JSONGeneralSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JWSSerializer' => $vendorDir . '/web-token/jwt-signature/Serializer/JWSSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JWSSerializerManager' => $vendorDir . '/web-token/jwt-signature/Serializer/JWSSerializerManager.php', - 'Jose\\Component\\Signature\\Serializer\\JWSSerializerManagerFactory' => $vendorDir . '/web-token/jwt-signature/Serializer/JWSSerializerManagerFactory.php', - 'Jose\\Component\\Signature\\Serializer\\Serializer' => $vendorDir . '/web-token/jwt-signature/Serializer/Serializer.php', - 'Jose\\Component\\Signature\\Signature' => $vendorDir . '/web-token/jwt-signature/Signature.php', - 'League\\Uri\\Contracts\\AuthorityInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/AuthorityInterface.php', - 'League\\Uri\\Contracts\\DataPathInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/DataPathInterface.php', - 'League\\Uri\\Contracts\\DomainHostInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/DomainHostInterface.php', - 'League\\Uri\\Contracts\\FragmentInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/FragmentInterface.php', - 'League\\Uri\\Contracts\\HostInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/HostInterface.php', - 'League\\Uri\\Contracts\\IpHostInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/IpHostInterface.php', - 'League\\Uri\\Contracts\\PathInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/PathInterface.php', - 'League\\Uri\\Contracts\\PortInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/PortInterface.php', - 'League\\Uri\\Contracts\\QueryInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/QueryInterface.php', - 'League\\Uri\\Contracts\\SegmentedPathInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/SegmentedPathInterface.php', - 'League\\Uri\\Contracts\\UriComponentInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/UriComponentInterface.php', - 'League\\Uri\\Contracts\\UriException' => $vendorDir . '/league/uri-interfaces/src/Contracts/UriException.php', - 'League\\Uri\\Contracts\\UriInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/UriInterface.php', - 'League\\Uri\\Contracts\\UserInfoInterface' => $vendorDir . '/league/uri-interfaces/src/Contracts/UserInfoInterface.php', - 'League\\Uri\\Exceptions\\FileinfoSupportMissing' => $vendorDir . '/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php', - 'League\\Uri\\Exceptions\\IdnSupportMissing' => $vendorDir . '/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php', - 'League\\Uri\\Exceptions\\IdnaConversionFailed' => $vendorDir . '/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php', - 'League\\Uri\\Exceptions\\SyntaxError' => $vendorDir . '/league/uri-interfaces/src/Exceptions/SyntaxError.php', - 'League\\Uri\\Exceptions\\TemplateCanNotBeExpanded' => $vendorDir . '/league/uri/src/Exceptions/TemplateCanNotBeExpanded.php', - 'League\\Uri\\Http' => $vendorDir . '/league/uri/src/Http.php', - 'League\\Uri\\HttpFactory' => $vendorDir . '/league/uri/src/HttpFactory.php', - 'League\\Uri\\Idna\\Idna' => $vendorDir . '/league/uri-interfaces/src/Idna/Idna.php', - 'League\\Uri\\Idna\\IdnaInfo' => $vendorDir . '/league/uri-interfaces/src/Idna/IdnaInfo.php', - 'League\\Uri\\Uri' => $vendorDir . '/league/uri/src/Uri.php', - 'League\\Uri\\UriInfo' => $vendorDir . '/league/uri/src/UriInfo.php', - 'League\\Uri\\UriResolver' => $vendorDir . '/league/uri/src/UriResolver.php', - 'League\\Uri\\UriString' => $vendorDir . '/league/uri/src/UriString.php', - 'League\\Uri\\UriTemplate' => $vendorDir . '/league/uri/src/UriTemplate.php', - 'League\\Uri\\UriTemplate\\Expression' => $vendorDir . '/league/uri/src/UriTemplate/Expression.php', - 'League\\Uri\\UriTemplate\\Template' => $vendorDir . '/league/uri/src/UriTemplate/Template.php', - 'League\\Uri\\UriTemplate\\VarSpecifier' => $vendorDir . '/league/uri/src/UriTemplate/VarSpecifier.php', - 'League\\Uri\\UriTemplate\\VariableBag' => $vendorDir . '/league/uri/src/UriTemplate/VariableBag.php', - 'Nyholm\\Psr7Server\\ServerRequestCreator' => $vendorDir . '/nyholm/psr7-server/src/ServerRequestCreator.php', - 'Nyholm\\Psr7Server\\ServerRequestCreatorInterface' => $vendorDir . '/nyholm/psr7-server/src/ServerRequestCreatorInterface.php', - 'Nyholm\\Psr7\\Factory\\HttplugFactory' => $vendorDir . '/nyholm/psr7/src/Factory/HttplugFactory.php', - 'Nyholm\\Psr7\\Factory\\Psr17Factory' => $vendorDir . '/nyholm/psr7/src/Factory/Psr17Factory.php', - 'Nyholm\\Psr7\\MessageTrait' => $vendorDir . '/nyholm/psr7/src/MessageTrait.php', - 'Nyholm\\Psr7\\Request' => $vendorDir . '/nyholm/psr7/src/Request.php', - 'Nyholm\\Psr7\\RequestTrait' => $vendorDir . '/nyholm/psr7/src/RequestTrait.php', - 'Nyholm\\Psr7\\Response' => $vendorDir . '/nyholm/psr7/src/Response.php', - 'Nyholm\\Psr7\\ServerRequest' => $vendorDir . '/nyholm/psr7/src/ServerRequest.php', - 'Nyholm\\Psr7\\Stream' => $vendorDir . '/nyholm/psr7/src/Stream.php', - 'Nyholm\\Psr7\\StreamTrait' => $vendorDir . '/nyholm/psr7/src/StreamTrait.php', - 'Nyholm\\Psr7\\UploadedFile' => $vendorDir . '/nyholm/psr7/src/UploadedFile.php', - 'Nyholm\\Psr7\\Uri' => $vendorDir . '/nyholm/psr7/src/Uri.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Psr\\Http\\Client\\ClientExceptionInterface' => $vendorDir . '/psr/http-client/src/ClientExceptionInterface.php', - 'Psr\\Http\\Client\\ClientInterface' => $vendorDir . '/psr/http-client/src/ClientInterface.php', - 'Psr\\Http\\Client\\NetworkExceptionInterface' => $vendorDir . '/psr/http-client/src/NetworkExceptionInterface.php', - 'Psr\\Http\\Client\\RequestExceptionInterface' => $vendorDir . '/psr/http-client/src/RequestExceptionInterface.php', - 'Psr\\Http\\Message\\MessageInterface' => $vendorDir . '/psr/http-message/src/MessageInterface.php', - 'Psr\\Http\\Message\\RequestFactoryInterface' => $vendorDir . '/psr/http-factory/src/RequestFactoryInterface.php', - 'Psr\\Http\\Message\\RequestInterface' => $vendorDir . '/psr/http-message/src/RequestInterface.php', - 'Psr\\Http\\Message\\ResponseFactoryInterface' => $vendorDir . '/psr/http-factory/src/ResponseFactoryInterface.php', - 'Psr\\Http\\Message\\ResponseInterface' => $vendorDir . '/psr/http-message/src/ResponseInterface.php', - 'Psr\\Http\\Message\\ServerRequestFactoryInterface' => $vendorDir . '/psr/http-factory/src/ServerRequestFactoryInterface.php', - 'Psr\\Http\\Message\\ServerRequestInterface' => $vendorDir . '/psr/http-message/src/ServerRequestInterface.php', - 'Psr\\Http\\Message\\StreamFactoryInterface' => $vendorDir . '/psr/http-factory/src/StreamFactoryInterface.php', - 'Psr\\Http\\Message\\StreamInterface' => $vendorDir . '/psr/http-message/src/StreamInterface.php', - 'Psr\\Http\\Message\\UploadedFileFactoryInterface' => $vendorDir . '/psr/http-factory/src/UploadedFileFactoryInterface.php', - 'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php', - 'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php', - 'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php', - 'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php', - 'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php', - 'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php', - 'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php', - 'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php', - 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', - 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', - 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php', - 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', - 'Ramsey\\Collection\\AbstractArray' => $vendorDir . '/ramsey/collection/src/AbstractArray.php', - 'Ramsey\\Collection\\AbstractCollection' => $vendorDir . '/ramsey/collection/src/AbstractCollection.php', - 'Ramsey\\Collection\\AbstractSet' => $vendorDir . '/ramsey/collection/src/AbstractSet.php', - 'Ramsey\\Collection\\ArrayInterface' => $vendorDir . '/ramsey/collection/src/ArrayInterface.php', - 'Ramsey\\Collection\\Collection' => $vendorDir . '/ramsey/collection/src/Collection.php', - 'Ramsey\\Collection\\CollectionInterface' => $vendorDir . '/ramsey/collection/src/CollectionInterface.php', - 'Ramsey\\Collection\\DoubleEndedQueue' => $vendorDir . '/ramsey/collection/src/DoubleEndedQueue.php', - 'Ramsey\\Collection\\DoubleEndedQueueInterface' => $vendorDir . '/ramsey/collection/src/DoubleEndedQueueInterface.php', - 'Ramsey\\Collection\\Exception\\CollectionMismatchException' => $vendorDir . '/ramsey/collection/src/Exception/CollectionMismatchException.php', - 'Ramsey\\Collection\\Exception\\InvalidArgumentException' => $vendorDir . '/ramsey/collection/src/Exception/InvalidArgumentException.php', - 'Ramsey\\Collection\\Exception\\InvalidSortOrderException' => $vendorDir . '/ramsey/collection/src/Exception/InvalidSortOrderException.php', - 'Ramsey\\Collection\\Exception\\NoSuchElementException' => $vendorDir . '/ramsey/collection/src/Exception/NoSuchElementException.php', - 'Ramsey\\Collection\\Exception\\OutOfBoundsException' => $vendorDir . '/ramsey/collection/src/Exception/OutOfBoundsException.php', - 'Ramsey\\Collection\\Exception\\UnsupportedOperationException' => $vendorDir . '/ramsey/collection/src/Exception/UnsupportedOperationException.php', - 'Ramsey\\Collection\\Exception\\ValueExtractionException' => $vendorDir . '/ramsey/collection/src/Exception/ValueExtractionException.php', - 'Ramsey\\Collection\\GenericArray' => $vendorDir . '/ramsey/collection/src/GenericArray.php', - 'Ramsey\\Collection\\Map\\AbstractMap' => $vendorDir . '/ramsey/collection/src/Map/AbstractMap.php', - 'Ramsey\\Collection\\Map\\AbstractTypedMap' => $vendorDir . '/ramsey/collection/src/Map/AbstractTypedMap.php', - 'Ramsey\\Collection\\Map\\AssociativeArrayMap' => $vendorDir . '/ramsey/collection/src/Map/AssociativeArrayMap.php', - 'Ramsey\\Collection\\Map\\MapInterface' => $vendorDir . '/ramsey/collection/src/Map/MapInterface.php', - 'Ramsey\\Collection\\Map\\NamedParameterMap' => $vendorDir . '/ramsey/collection/src/Map/NamedParameterMap.php', - 'Ramsey\\Collection\\Map\\TypedMap' => $vendorDir . '/ramsey/collection/src/Map/TypedMap.php', - 'Ramsey\\Collection\\Map\\TypedMapInterface' => $vendorDir . '/ramsey/collection/src/Map/TypedMapInterface.php', - 'Ramsey\\Collection\\Queue' => $vendorDir . '/ramsey/collection/src/Queue.php', - 'Ramsey\\Collection\\QueueInterface' => $vendorDir . '/ramsey/collection/src/QueueInterface.php', - 'Ramsey\\Collection\\Set' => $vendorDir . '/ramsey/collection/src/Set.php', - 'Ramsey\\Collection\\Tool\\TypeTrait' => $vendorDir . '/ramsey/collection/src/Tool/TypeTrait.php', - 'Ramsey\\Collection\\Tool\\ValueExtractorTrait' => $vendorDir . '/ramsey/collection/src/Tool/ValueExtractorTrait.php', - 'Ramsey\\Collection\\Tool\\ValueToStringTrait' => $vendorDir . '/ramsey/collection/src/Tool/ValueToStringTrait.php', - 'Ramsey\\Uuid\\BinaryUtils' => $vendorDir . '/ramsey/uuid/src/BinaryUtils.php', - 'Ramsey\\Uuid\\Builder\\BuilderCollection' => $vendorDir . '/ramsey/uuid/src/Builder/BuilderCollection.php', - 'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php', - 'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php', - 'Ramsey\\Uuid\\Builder\\FallbackBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/FallbackBuilder.php', - 'Ramsey\\Uuid\\Builder\\UuidBuilderInterface' => $vendorDir . '/ramsey/uuid/src/Builder/UuidBuilderInterface.php', - 'Ramsey\\Uuid\\Codec\\CodecInterface' => $vendorDir . '/ramsey/uuid/src/Codec/CodecInterface.php', - 'Ramsey\\Uuid\\Codec\\GuidStringCodec' => $vendorDir . '/ramsey/uuid/src/Codec/GuidStringCodec.php', - 'Ramsey\\Uuid\\Codec\\OrderedTimeCodec' => $vendorDir . '/ramsey/uuid/src/Codec/OrderedTimeCodec.php', - 'Ramsey\\Uuid\\Codec\\StringCodec' => $vendorDir . '/ramsey/uuid/src/Codec/StringCodec.php', - 'Ramsey\\Uuid\\Codec\\TimestampFirstCombCodec' => $vendorDir . '/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php', - 'Ramsey\\Uuid\\Codec\\TimestampLastCombCodec' => $vendorDir . '/ramsey/uuid/src/Codec/TimestampLastCombCodec.php', - 'Ramsey\\Uuid\\Converter\\NumberConverterInterface' => $vendorDir . '/ramsey/uuid/src/Converter/NumberConverterInterface.php', - 'Ramsey\\Uuid\\Converter\\Number\\BigNumberConverter' => $vendorDir . '/ramsey/uuid/src/Converter/Number/BigNumberConverter.php', - 'Ramsey\\Uuid\\Converter\\Number\\DegradedNumberConverter' => $vendorDir . '/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php', - 'Ramsey\\Uuid\\Converter\\Number\\GenericNumberConverter' => $vendorDir . '/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php', - 'Ramsey\\Uuid\\Converter\\TimeConverterInterface' => $vendorDir . '/ramsey/uuid/src/Converter/TimeConverterInterface.php', - 'Ramsey\\Uuid\\Converter\\Time\\BigNumberTimeConverter' => $vendorDir . '/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php', - 'Ramsey\\Uuid\\Converter\\Time\\DegradedTimeConverter' => $vendorDir . '/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php', - 'Ramsey\\Uuid\\Converter\\Time\\GenericTimeConverter' => $vendorDir . '/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php', - 'Ramsey\\Uuid\\Converter\\Time\\PhpTimeConverter' => $vendorDir . '/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php', - 'Ramsey\\Uuid\\DegradedUuid' => $vendorDir . '/ramsey/uuid/src/DegradedUuid.php', - 'Ramsey\\Uuid\\DeprecatedUuidInterface' => $vendorDir . '/ramsey/uuid/src/DeprecatedUuidInterface.php', - 'Ramsey\\Uuid\\DeprecatedUuidMethodsTrait' => $vendorDir . '/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php', - 'Ramsey\\Uuid\\Exception\\BuilderNotFoundException' => $vendorDir . '/ramsey/uuid/src/Exception/BuilderNotFoundException.php', - 'Ramsey\\Uuid\\Exception\\DateTimeException' => $vendorDir . '/ramsey/uuid/src/Exception/DateTimeException.php', - 'Ramsey\\Uuid\\Exception\\DceSecurityException' => $vendorDir . '/ramsey/uuid/src/Exception/DceSecurityException.php', - 'Ramsey\\Uuid\\Exception\\InvalidArgumentException' => $vendorDir . '/ramsey/uuid/src/Exception/InvalidArgumentException.php', - 'Ramsey\\Uuid\\Exception\\InvalidBytesException' => $vendorDir . '/ramsey/uuid/src/Exception/InvalidBytesException.php', - 'Ramsey\\Uuid\\Exception\\InvalidUuidStringException' => $vendorDir . '/ramsey/uuid/src/Exception/InvalidUuidStringException.php', - 'Ramsey\\Uuid\\Exception\\NameException' => $vendorDir . '/ramsey/uuid/src/Exception/NameException.php', - 'Ramsey\\Uuid\\Exception\\NodeException' => $vendorDir . '/ramsey/uuid/src/Exception/NodeException.php', - 'Ramsey\\Uuid\\Exception\\RandomSourceException' => $vendorDir . '/ramsey/uuid/src/Exception/RandomSourceException.php', - 'Ramsey\\Uuid\\Exception\\TimeSourceException' => $vendorDir . '/ramsey/uuid/src/Exception/TimeSourceException.php', - 'Ramsey\\Uuid\\Exception\\UnableToBuildUuidException' => $vendorDir . '/ramsey/uuid/src/Exception/UnableToBuildUuidException.php', - 'Ramsey\\Uuid\\Exception\\UnsupportedOperationException' => $vendorDir . '/ramsey/uuid/src/Exception/UnsupportedOperationException.php', - 'Ramsey\\Uuid\\Exception\\UuidExceptionInterface' => $vendorDir . '/ramsey/uuid/src/Exception/UuidExceptionInterface.php', - 'Ramsey\\Uuid\\FeatureSet' => $vendorDir . '/ramsey/uuid/src/FeatureSet.php', - 'Ramsey\\Uuid\\Fields\\FieldsInterface' => $vendorDir . '/ramsey/uuid/src/Fields/FieldsInterface.php', - 'Ramsey\\Uuid\\Fields\\SerializableFieldsTrait' => $vendorDir . '/ramsey/uuid/src/Fields/SerializableFieldsTrait.php', - 'Ramsey\\Uuid\\Generator\\CombGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/CombGenerator.php', - 'Ramsey\\Uuid\\Generator\\DceSecurityGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/DceSecurityGenerator.php', - 'Ramsey\\Uuid\\Generator\\DceSecurityGeneratorInterface' => $vendorDir . '/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php', - 'Ramsey\\Uuid\\Generator\\DefaultNameGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/DefaultNameGenerator.php', - 'Ramsey\\Uuid\\Generator\\DefaultTimeGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/DefaultTimeGenerator.php', - 'Ramsey\\Uuid\\Generator\\NameGeneratorFactory' => $vendorDir . '/ramsey/uuid/src/Generator/NameGeneratorFactory.php', - 'Ramsey\\Uuid\\Generator\\NameGeneratorInterface' => $vendorDir . '/ramsey/uuid/src/Generator/NameGeneratorInterface.php', - 'Ramsey\\Uuid\\Generator\\PeclUuidNameGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php', - 'Ramsey\\Uuid\\Generator\\PeclUuidRandomGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php', - 'Ramsey\\Uuid\\Generator\\PeclUuidTimeGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php', - 'Ramsey\\Uuid\\Generator\\RandomBytesGenerator' => $vendorDir . '/ramsey/uuid/src/Generator/RandomBytesGenerator.php', - 'Ramsey\\Uuid\\Generator\\RandomGeneratorFactory' => $vendorDir . '/ramsey/uuid/src/Generator/RandomGeneratorFactory.php', - 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' => $vendorDir . '/ramsey/uuid/src/Generator/RandomGeneratorInterface.php', - 'Ramsey\\Uuid\\Generator\\RandomLibAdapter' => $vendorDir . '/ramsey/uuid/src/Generator/RandomLibAdapter.php', - 'Ramsey\\Uuid\\Generator\\TimeGeneratorFactory' => $vendorDir . '/ramsey/uuid/src/Generator/TimeGeneratorFactory.php', - 'Ramsey\\Uuid\\Generator\\TimeGeneratorInterface' => $vendorDir . '/ramsey/uuid/src/Generator/TimeGeneratorInterface.php', - 'Ramsey\\Uuid\\Guid\\Fields' => $vendorDir . '/ramsey/uuid/src/Guid/Fields.php', - 'Ramsey\\Uuid\\Guid\\Guid' => $vendorDir . '/ramsey/uuid/src/Guid/Guid.php', - 'Ramsey\\Uuid\\Guid\\GuidBuilder' => $vendorDir . '/ramsey/uuid/src/Guid/GuidBuilder.php', - 'Ramsey\\Uuid\\Lazy\\LazyUuidFromString' => $vendorDir . '/ramsey/uuid/src/Lazy/LazyUuidFromString.php', - 'Ramsey\\Uuid\\Math\\BrickMathCalculator' => $vendorDir . '/ramsey/uuid/src/Math/BrickMathCalculator.php', - 'Ramsey\\Uuid\\Math\\CalculatorInterface' => $vendorDir . '/ramsey/uuid/src/Math/CalculatorInterface.php', - 'Ramsey\\Uuid\\Math\\RoundingMode' => $vendorDir . '/ramsey/uuid/src/Math/RoundingMode.php', - 'Ramsey\\Uuid\\Nonstandard\\Fields' => $vendorDir . '/ramsey/uuid/src/Nonstandard/Fields.php', - 'Ramsey\\Uuid\\Nonstandard\\Uuid' => $vendorDir . '/ramsey/uuid/src/Nonstandard/Uuid.php', - 'Ramsey\\Uuid\\Nonstandard\\UuidBuilder' => $vendorDir . '/ramsey/uuid/src/Nonstandard/UuidBuilder.php', - 'Ramsey\\Uuid\\Nonstandard\\UuidV6' => $vendorDir . '/ramsey/uuid/src/Nonstandard/UuidV6.php', - 'Ramsey\\Uuid\\Provider\\DceSecurityProviderInterface' => $vendorDir . '/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php', - 'Ramsey\\Uuid\\Provider\\Dce\\SystemDceSecurityProvider' => $vendorDir . '/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php', - 'Ramsey\\Uuid\\Provider\\NodeProviderInterface' => $vendorDir . '/ramsey/uuid/src/Provider/NodeProviderInterface.php', - 'Ramsey\\Uuid\\Provider\\Node\\FallbackNodeProvider' => $vendorDir . '/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\Node\\NodeProviderCollection' => $vendorDir . '/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php', - 'Ramsey\\Uuid\\Provider\\Node\\RandomNodeProvider' => $vendorDir . '/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\Node\\StaticNodeProvider' => $vendorDir . '/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\Node\\SystemNodeProvider' => $vendorDir . '/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\TimeProviderInterface' => $vendorDir . '/ramsey/uuid/src/Provider/TimeProviderInterface.php', - 'Ramsey\\Uuid\\Provider\\Time\\FixedTimeProvider' => $vendorDir . '/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php', - 'Ramsey\\Uuid\\Provider\\Time\\SystemTimeProvider' => $vendorDir . '/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php', - 'Ramsey\\Uuid\\Rfc4122\\Fields' => $vendorDir . '/ramsey/uuid/src/Rfc4122/Fields.php', - 'Ramsey\\Uuid\\Rfc4122\\FieldsInterface' => $vendorDir . '/ramsey/uuid/src/Rfc4122/FieldsInterface.php', - 'Ramsey\\Uuid\\Rfc4122\\NilTrait' => $vendorDir . '/ramsey/uuid/src/Rfc4122/NilTrait.php', - 'Ramsey\\Uuid\\Rfc4122\\NilUuid' => $vendorDir . '/ramsey/uuid/src/Rfc4122/NilUuid.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidBuilder' => $vendorDir . '/ramsey/uuid/src/Rfc4122/UuidBuilder.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidInterface' => $vendorDir . '/ramsey/uuid/src/Rfc4122/UuidInterface.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV1' => $vendorDir . '/ramsey/uuid/src/Rfc4122/UuidV1.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV2' => $vendorDir . '/ramsey/uuid/src/Rfc4122/UuidV2.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV3' => $vendorDir . '/ramsey/uuid/src/Rfc4122/UuidV3.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV4' => $vendorDir . '/ramsey/uuid/src/Rfc4122/UuidV4.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV5' => $vendorDir . '/ramsey/uuid/src/Rfc4122/UuidV5.php', - 'Ramsey\\Uuid\\Rfc4122\\Validator' => $vendorDir . '/ramsey/uuid/src/Rfc4122/Validator.php', - 'Ramsey\\Uuid\\Rfc4122\\VariantTrait' => $vendorDir . '/ramsey/uuid/src/Rfc4122/VariantTrait.php', - 'Ramsey\\Uuid\\Rfc4122\\VersionTrait' => $vendorDir . '/ramsey/uuid/src/Rfc4122/VersionTrait.php', - 'Ramsey\\Uuid\\Type\\Decimal' => $vendorDir . '/ramsey/uuid/src/Type/Decimal.php', - 'Ramsey\\Uuid\\Type\\Hexadecimal' => $vendorDir . '/ramsey/uuid/src/Type/Hexadecimal.php', - 'Ramsey\\Uuid\\Type\\Integer' => $vendorDir . '/ramsey/uuid/src/Type/Integer.php', - 'Ramsey\\Uuid\\Type\\NumberInterface' => $vendorDir . '/ramsey/uuid/src/Type/NumberInterface.php', - 'Ramsey\\Uuid\\Type\\Time' => $vendorDir . '/ramsey/uuid/src/Type/Time.php', - 'Ramsey\\Uuid\\Type\\TypeInterface' => $vendorDir . '/ramsey/uuid/src/Type/TypeInterface.php', - 'Ramsey\\Uuid\\Uuid' => $vendorDir . '/ramsey/uuid/src/Uuid.php', - 'Ramsey\\Uuid\\UuidFactory' => $vendorDir . '/ramsey/uuid/src/UuidFactory.php', - 'Ramsey\\Uuid\\UuidFactoryInterface' => $vendorDir . '/ramsey/uuid/src/UuidFactoryInterface.php', - 'Ramsey\\Uuid\\UuidInterface' => $vendorDir . '/ramsey/uuid/src/UuidInterface.php', - 'Ramsey\\Uuid\\Validator\\GenericValidator' => $vendorDir . '/ramsey/uuid/src/Validator/GenericValidator.php', - 'Ramsey\\Uuid\\Validator\\ValidatorInterface' => $vendorDir . '/ramsey/uuid/src/Validator/ValidatorInterface.php', - 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'Safe\\DateTime' => $vendorDir . '/thecodingmachine/safe/lib/DateTime.php', - 'Safe\\DateTimeImmutable' => $vendorDir . '/thecodingmachine/safe/lib/DateTimeImmutable.php', - 'Safe\\Exceptions\\ApacheException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ApacheException.php', - 'Safe\\Exceptions\\ApcException' => $vendorDir . '/thecodingmachine/safe/deprecated/Exceptions/ApcException.php', - 'Safe\\Exceptions\\ApcuException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ApcuException.php', - 'Safe\\Exceptions\\ArrayException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ArrayException.php', - 'Safe\\Exceptions\\Bzip2Exception' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/Bzip2Exception.php', - 'Safe\\Exceptions\\CalendarException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/CalendarException.php', - 'Safe\\Exceptions\\ClassobjException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ClassobjException.php', - 'Safe\\Exceptions\\ComException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ComException.php', - 'Safe\\Exceptions\\CubridException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/CubridException.php', - 'Safe\\Exceptions\\CurlException' => $vendorDir . '/thecodingmachine/safe/lib/Exceptions/CurlException.php', - 'Safe\\Exceptions\\DatetimeException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/DatetimeException.php', - 'Safe\\Exceptions\\DirException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/DirException.php', - 'Safe\\Exceptions\\EioException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/EioException.php', - 'Safe\\Exceptions\\ErrorfuncException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ErrorfuncException.php', - 'Safe\\Exceptions\\ExecException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ExecException.php', - 'Safe\\Exceptions\\FileinfoException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/FileinfoException.php', - 'Safe\\Exceptions\\FilesystemException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/FilesystemException.php', - 'Safe\\Exceptions\\FilterException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/FilterException.php', - 'Safe\\Exceptions\\FpmException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/FpmException.php', - 'Safe\\Exceptions\\FtpException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/FtpException.php', - 'Safe\\Exceptions\\FunchandException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/FunchandException.php', - 'Safe\\Exceptions\\GmpException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/GmpException.php', - 'Safe\\Exceptions\\GnupgException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/GnupgException.php', - 'Safe\\Exceptions\\HashException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/HashException.php', - 'Safe\\Exceptions\\IbaseException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/IbaseException.php', - 'Safe\\Exceptions\\IbmDb2Exception' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/IbmDb2Exception.php', - 'Safe\\Exceptions\\IconvException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/IconvException.php', - 'Safe\\Exceptions\\ImageException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ImageException.php', - 'Safe\\Exceptions\\ImapException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ImapException.php', - 'Safe\\Exceptions\\InfoException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/InfoException.php', - 'Safe\\Exceptions\\IngresiiException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/IngresiiException.php', - 'Safe\\Exceptions\\InotifyException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/InotifyException.php', - 'Safe\\Exceptions\\JsonException' => $vendorDir . '/thecodingmachine/safe/lib/Exceptions/JsonException.php', - 'Safe\\Exceptions\\LdapException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/LdapException.php', - 'Safe\\Exceptions\\LibeventException' => $vendorDir . '/thecodingmachine/safe/deprecated/Exceptions/LibeventException.php', - 'Safe\\Exceptions\\LibxmlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/LibxmlException.php', - 'Safe\\Exceptions\\LzfException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/LzfException.php', - 'Safe\\Exceptions\\MailparseException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MailparseException.php', - 'Safe\\Exceptions\\MbstringException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MbstringException.php', - 'Safe\\Exceptions\\MiscException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MiscException.php', - 'Safe\\Exceptions\\MsqlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MsqlException.php', - 'Safe\\Exceptions\\MssqlException' => $vendorDir . '/thecodingmachine/safe/deprecated/Exceptions/MssqlException.php', - 'Safe\\Exceptions\\MysqlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MysqlException.php', - 'Safe\\Exceptions\\MysqliException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MysqliException.php', - 'Safe\\Exceptions\\MysqlndMsException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MysqlndMsException.php', - 'Safe\\Exceptions\\MysqlndQcException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/MysqlndQcException.php', - 'Safe\\Exceptions\\NetworkException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/NetworkException.php', - 'Safe\\Exceptions\\Oci8Exception' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/Oci8Exception.php', - 'Safe\\Exceptions\\OpcacheException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/OpcacheException.php', - 'Safe\\Exceptions\\OpensslException' => $vendorDir . '/thecodingmachine/safe/lib/Exceptions/OpensslException.php', - 'Safe\\Exceptions\\OutcontrolException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/OutcontrolException.php', - 'Safe\\Exceptions\\PasswordException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/PasswordException.php', - 'Safe\\Exceptions\\PcntlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/PcntlException.php', - 'Safe\\Exceptions\\PcreException' => $vendorDir . '/thecodingmachine/safe/lib/Exceptions/PcreException.php', - 'Safe\\Exceptions\\PdfException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/PdfException.php', - 'Safe\\Exceptions\\PgsqlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/PgsqlException.php', - 'Safe\\Exceptions\\PosixException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/PosixException.php', - 'Safe\\Exceptions\\PsException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/PsException.php', - 'Safe\\Exceptions\\PspellException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/PspellException.php', - 'Safe\\Exceptions\\ReadlineException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ReadlineException.php', - 'Safe\\Exceptions\\RpminfoException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/RpminfoException.php', - 'Safe\\Exceptions\\RrdException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/RrdException.php', - 'Safe\\Exceptions\\SafeExceptionInterface' => $vendorDir . '/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php', - 'Safe\\Exceptions\\SemException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SemException.php', - 'Safe\\Exceptions\\SessionException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SessionException.php', - 'Safe\\Exceptions\\ShmopException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ShmopException.php', - 'Safe\\Exceptions\\SimplexmlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SimplexmlException.php', - 'Safe\\Exceptions\\SocketsException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SocketsException.php', - 'Safe\\Exceptions\\SodiumException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SodiumException.php', - 'Safe\\Exceptions\\SolrException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SolrException.php', - 'Safe\\Exceptions\\SplException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SplException.php', - 'Safe\\Exceptions\\SqlsrvException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SqlsrvException.php', - 'Safe\\Exceptions\\SsdeepException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SsdeepException.php', - 'Safe\\Exceptions\\Ssh2Exception' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/Ssh2Exception.php', - 'Safe\\Exceptions\\StatsException' => $vendorDir . '/thecodingmachine/safe/deprecated/Exceptions/StatsException.php', - 'Safe\\Exceptions\\StreamException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/StreamException.php', - 'Safe\\Exceptions\\StringsException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/StringsException.php', - 'Safe\\Exceptions\\SwooleException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/SwooleException.php', - 'Safe\\Exceptions\\UodbcException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/UodbcException.php', - 'Safe\\Exceptions\\UopzException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/UopzException.php', - 'Safe\\Exceptions\\UrlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/UrlException.php', - 'Safe\\Exceptions\\VarException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/VarException.php', - 'Safe\\Exceptions\\XdiffException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/XdiffException.php', - 'Safe\\Exceptions\\XmlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/XmlException.php', - 'Safe\\Exceptions\\XmlrpcException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/XmlrpcException.php', - 'Safe\\Exceptions\\YamlException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/YamlException.php', - 'Safe\\Exceptions\\YazException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/YazException.php', - 'Safe\\Exceptions\\ZipException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ZipException.php', - 'Safe\\Exceptions\\ZlibException' => $vendorDir . '/thecodingmachine/safe/generated/Exceptions/ZlibException.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/process/Exception/ExceptionInterface.php', - 'Symfony\\Component\\Process\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/process/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\Process\\Exception\\LogicException' => $vendorDir . '/symfony/process/Exception/LogicException.php', - 'Symfony\\Component\\Process\\Exception\\ProcessFailedException' => $vendorDir . '/symfony/process/Exception/ProcessFailedException.php', - 'Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => $vendorDir . '/symfony/process/Exception/ProcessSignaledException.php', - 'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => $vendorDir . '/symfony/process/Exception/ProcessTimedOutException.php', - 'Symfony\\Component\\Process\\Exception\\RuntimeException' => $vendorDir . '/symfony/process/Exception/RuntimeException.php', - 'Symfony\\Component\\Process\\ExecutableFinder' => $vendorDir . '/symfony/process/ExecutableFinder.php', - 'Symfony\\Component\\Process\\InputStream' => $vendorDir . '/symfony/process/InputStream.php', - 'Symfony\\Component\\Process\\PhpExecutableFinder' => $vendorDir . '/symfony/process/PhpExecutableFinder.php', - 'Symfony\\Component\\Process\\PhpProcess' => $vendorDir . '/symfony/process/PhpProcess.php', - 'Symfony\\Component\\Process\\Pipes\\AbstractPipes' => $vendorDir . '/symfony/process/Pipes/AbstractPipes.php', - 'Symfony\\Component\\Process\\Pipes\\PipesInterface' => $vendorDir . '/symfony/process/Pipes/PipesInterface.php', - 'Symfony\\Component\\Process\\Pipes\\UnixPipes' => $vendorDir . '/symfony/process/Pipes/UnixPipes.php', - 'Symfony\\Component\\Process\\Pipes\\WindowsPipes' => $vendorDir . '/symfony/process/Pipes/WindowsPipes.php', - 'Symfony\\Component\\Process\\Process' => $vendorDir . '/symfony/process/Process.php', - 'Symfony\\Component\\Process\\ProcessUtils' => $vendorDir . '/symfony/process/ProcessUtils.php', - 'Symfony\\Polyfill\\Ctype\\Ctype' => $vendorDir . '/symfony/polyfill-ctype/Ctype.php', - 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php', - 'Symfony\\Polyfill\\Php80\\PhpToken' => $vendorDir . '/symfony/polyfill-php80/PhpToken.php', - 'Symfony\\Polyfill\\Php81\\Php81' => $vendorDir . '/symfony/polyfill-php81/Php81.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - 'Webauthn\\AttestationStatement\\AndroidKeyAttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AndroidSafetyNetAttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AppleAttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AppleAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AttestationObject' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationObject.php', - 'Webauthn\\AttestationStatement\\AttestationObjectLoader' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationObjectLoader.php', - 'Webauthn\\AttestationStatement\\AttestationStatement' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatement.php', - 'Webauthn\\AttestationStatement\\AttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AttestationStatementSupportManager' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatementSupportManager.php', - 'Webauthn\\AttestationStatement\\FidoU2FAttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/FidoU2FAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\NoneAttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/NoneAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\PackedAttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/PackedAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\TPMAttestationStatementSupport' => $vendorDir . '/web-auth/webauthn-lib/src/AttestationStatement/TPMAttestationStatementSupport.php', - 'Webauthn\\AttestedCredentialData' => $vendorDir . '/web-auth/webauthn-lib/src/AttestedCredentialData.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtension' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtension.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtensionsClientInputs' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientInputs.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtensionsClientOutputs' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputs.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtensionsClientOutputsLoader' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputsLoader.php', - 'Webauthn\\AuthenticationExtensions\\ExtensionOutputChecker' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputChecker.php', - 'Webauthn\\AuthenticationExtensions\\ExtensionOutputCheckerHandler' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputCheckerHandler.php', - 'Webauthn\\AuthenticationExtensions\\ExtensionOutputError' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputError.php', - 'Webauthn\\AuthenticatorAssertionResponse' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticatorAssertionResponse.php', - 'Webauthn\\AuthenticatorAssertionResponseValidator' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticatorAssertionResponseValidator.php', - 'Webauthn\\AuthenticatorAttestationResponse' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticatorAttestationResponse.php', - 'Webauthn\\AuthenticatorAttestationResponseValidator' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticatorAttestationResponseValidator.php', - 'Webauthn\\AuthenticatorData' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticatorData.php', - 'Webauthn\\AuthenticatorResponse' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticatorResponse.php', - 'Webauthn\\AuthenticatorSelectionCriteria' => $vendorDir . '/web-auth/webauthn-lib/src/AuthenticatorSelectionCriteria.php', - 'Webauthn\\CertificateChainChecker\\CertificateChainChecker' => $vendorDir . '/web-auth/webauthn-lib/src/CertificateChainChecker/CertificateChainChecker.php', - 'Webauthn\\CertificateChainChecker\\OpenSSLCertificateChainChecker' => $vendorDir . '/web-auth/webauthn-lib/src/CertificateChainChecker/OpenSSLCertificateChainChecker.php', - 'Webauthn\\CertificateToolbox' => $vendorDir . '/web-auth/webauthn-lib/src/CertificateToolbox.php', - 'Webauthn\\CollectedClientData' => $vendorDir . '/web-auth/webauthn-lib/src/CollectedClientData.php', - 'Webauthn\\Counter\\CounterChecker' => $vendorDir . '/web-auth/webauthn-lib/src/Counter/CounterChecker.php', - 'Webauthn\\Counter\\ThrowExceptionIfInvalid' => $vendorDir . '/web-auth/webauthn-lib/src/Counter/ThrowExceptionIfInvalid.php', - 'Webauthn\\Credential' => $vendorDir . '/web-auth/webauthn-lib/src/Credential.php', - 'Webauthn\\MetadataService\\AbstractDescriptor' => $vendorDir . '/web-auth/metadata-service/src/AbstractDescriptor.php', - 'Webauthn\\MetadataService\\AuthenticatorStatus' => $vendorDir . '/web-auth/metadata-service/src/AuthenticatorStatus.php', - 'Webauthn\\MetadataService\\BiometricAccuracyDescriptor' => $vendorDir . '/web-auth/metadata-service/src/BiometricAccuracyDescriptor.php', - 'Webauthn\\MetadataService\\BiometricStatusReport' => $vendorDir . '/web-auth/metadata-service/src/BiometricStatusReport.php', - 'Webauthn\\MetadataService\\CodeAccuracyDescriptor' => $vendorDir . '/web-auth/metadata-service/src/CodeAccuracyDescriptor.php', - 'Webauthn\\MetadataService\\DisplayPNGCharacteristicsDescriptor' => $vendorDir . '/web-auth/metadata-service/src/DisplayPNGCharacteristicsDescriptor.php', - 'Webauthn\\MetadataService\\DistantSingleMetadata' => $vendorDir . '/web-auth/metadata-service/src/DistantSingleMetadata.php', - 'Webauthn\\MetadataService\\EcdaaTrustAnchor' => $vendorDir . '/web-auth/metadata-service/src/EcdaaTrustAnchor.php', - 'Webauthn\\MetadataService\\ExtensionDescriptor' => $vendorDir . '/web-auth/metadata-service/src/ExtensionDescriptor.php', - 'Webauthn\\MetadataService\\MetadataService' => $vendorDir . '/web-auth/metadata-service/src/MetadataService.php', - 'Webauthn\\MetadataService\\MetadataStatement' => $vendorDir . '/web-auth/metadata-service/src/MetadataStatement.php', - 'Webauthn\\MetadataService\\MetadataStatementFetcher' => $vendorDir . '/web-auth/metadata-service/src/MetadataStatementFetcher.php', - 'Webauthn\\MetadataService\\MetadataStatementRepository' => $vendorDir . '/web-auth/metadata-service/src/MetadataStatementRepository.php', - 'Webauthn\\MetadataService\\MetadataTOCPayload' => $vendorDir . '/web-auth/metadata-service/src/MetadataTOCPayload.php', - 'Webauthn\\MetadataService\\MetadataTOCPayloadEntry' => $vendorDir . '/web-auth/metadata-service/src/MetadataTOCPayloadEntry.php', - 'Webauthn\\MetadataService\\PatternAccuracyDescriptor' => $vendorDir . '/web-auth/metadata-service/src/PatternAccuracyDescriptor.php', - 'Webauthn\\MetadataService\\RgbPaletteEntry' => $vendorDir . '/web-auth/metadata-service/src/RgbPaletteEntry.php', - 'Webauthn\\MetadataService\\RogueListEntry' => $vendorDir . '/web-auth/metadata-service/src/RogueListEntry.php', - 'Webauthn\\MetadataService\\SingleMetadata' => $vendorDir . '/web-auth/metadata-service/src/SingleMetadata.php', - 'Webauthn\\MetadataService\\StatusReport' => $vendorDir . '/web-auth/metadata-service/src/StatusReport.php', - 'Webauthn\\MetadataService\\Utils' => $vendorDir . '/web-auth/metadata-service/src/Utils.php', - 'Webauthn\\MetadataService\\VerificationMethodANDCombinations' => $vendorDir . '/web-auth/metadata-service/src/VerificationMethodANDCombinations.php', - 'Webauthn\\MetadataService\\VerificationMethodDescriptor' => $vendorDir . '/web-auth/metadata-service/src/VerificationMethodDescriptor.php', - 'Webauthn\\MetadataService\\Version' => $vendorDir . '/web-auth/metadata-service/src/Version.php', - 'Webauthn\\PublicKeyCredential' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredential.php', - 'Webauthn\\PublicKeyCredentialCreationOptions' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialCreationOptions.php', - 'Webauthn\\PublicKeyCredentialDescriptor' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php', - 'Webauthn\\PublicKeyCredentialDescriptorCollection' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptorCollection.php', - 'Webauthn\\PublicKeyCredentialEntity' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialEntity.php', - 'Webauthn\\PublicKeyCredentialLoader' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialLoader.php', - 'Webauthn\\PublicKeyCredentialOptions' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialOptions.php', - 'Webauthn\\PublicKeyCredentialParameters' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialParameters.php', - 'Webauthn\\PublicKeyCredentialRequestOptions' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php', - 'Webauthn\\PublicKeyCredentialRpEntity' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialRpEntity.php', - 'Webauthn\\PublicKeyCredentialSource' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialSource.php', - 'Webauthn\\PublicKeyCredentialSourceRepository' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialSourceRepository.php', - 'Webauthn\\PublicKeyCredentialUserEntity' => $vendorDir . '/web-auth/webauthn-lib/src/PublicKeyCredentialUserEntity.php', - 'Webauthn\\Server' => $vendorDir . '/web-auth/webauthn-lib/src/Server.php', - 'Webauthn\\StringStream' => $vendorDir . '/web-auth/webauthn-lib/src/StringStream.php', - 'Webauthn\\TokenBinding\\IgnoreTokenBindingHandler' => $vendorDir . '/web-auth/webauthn-lib/src/TokenBinding/IgnoreTokenBindingHandler.php', - 'Webauthn\\TokenBinding\\SecTokenBindingHandler' => $vendorDir . '/web-auth/webauthn-lib/src/TokenBinding/SecTokenBindingHandler.php', - 'Webauthn\\TokenBinding\\TokenBinding' => $vendorDir . '/web-auth/webauthn-lib/src/TokenBinding/TokenBinding.php', - 'Webauthn\\TokenBinding\\TokenBindingHandler' => $vendorDir . '/web-auth/webauthn-lib/src/TokenBinding/TokenBindingHandler.php', - 'Webauthn\\TokenBinding\\TokenBindingNotSupportedHandler' => $vendorDir . '/web-auth/webauthn-lib/src/TokenBinding/TokenBindingNotSupportedHandler.php', - 'Webauthn\\TrustPath\\CertificateTrustPath' => $vendorDir . '/web-auth/webauthn-lib/src/TrustPath/CertificateTrustPath.php', - 'Webauthn\\TrustPath\\EcdaaKeyIdTrustPath' => $vendorDir . '/web-auth/webauthn-lib/src/TrustPath/EcdaaKeyIdTrustPath.php', - 'Webauthn\\TrustPath\\EmptyTrustPath' => $vendorDir . '/web-auth/webauthn-lib/src/TrustPath/EmptyTrustPath.php', - 'Webauthn\\TrustPath\\TrustPath' => $vendorDir . '/web-auth/webauthn-lib/src/TrustPath/TrustPath.php', - 'Webauthn\\TrustPath\\TrustPathLoader' => $vendorDir . '/web-auth/webauthn-lib/src/TrustPath/TrustPathLoader.php', - 'Webauthn\\U2FPublicKey' => $vendorDir . '/web-auth/webauthn-lib/src/U2FPublicKey.php', - 'Webauthn\\Util\\CoseSignatureFixer' => $vendorDir . '/web-auth/webauthn-lib/src/Util/CoseSignatureFixer.php', -); diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_files.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_files.php deleted file mode 100644 index 5d68d9a9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_files.php +++ /dev/null @@ -1,103 +0,0 @@ - $vendorDir . '/beberlei/assert/lib/Assert/functions.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - 'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php', - '51fcf4e06c07cc00c920b44bcd900e7a' => $vendorDir . '/thecodingmachine/safe/deprecated/apc.php', - '47f619d9197b36cf5ab70738d7743fe2' => $vendorDir . '/thecodingmachine/safe/deprecated/libevent.php', - 'ea6bb8a12ef9b68f6ada99058e530760' => $vendorDir . '/thecodingmachine/safe/deprecated/mssql.php', - '9a29089eb3ce41a446744c68a00f118c' => $vendorDir . '/thecodingmachine/safe/deprecated/stats.php', - '72243e5536b63e298acb6476f01f1aff' => $vendorDir . '/thecodingmachine/safe/lib/special_cases.php', - '3f648889e687f31c52f949ba8a9d0873' => $vendorDir . '/thecodingmachine/safe/generated/apache.php', - 'eeb4581d958421a4244aaa4167c6a575' => $vendorDir . '/thecodingmachine/safe/generated/apcu.php', - '04cb0b3c1dac5b5ddb23c14e3d66dbe9' => $vendorDir . '/thecodingmachine/safe/generated/array.php', - '450b332a74a9a21e043c5e953485a791' => $vendorDir . '/thecodingmachine/safe/generated/bzip2.php', - '6e9b7954ecfd7cbb9ca239319d1acdb6' => $vendorDir . '/thecodingmachine/safe/generated/calendar.php', - '2c6d7e8bd2de9a272a9d4d43b0a4304a' => $vendorDir . '/thecodingmachine/safe/generated/classobj.php', - '0b8231c1ad0865447c988a4c16b4001f' => $vendorDir . '/thecodingmachine/safe/generated/com.php', - '7643a71fe1c3256058c8fee234cb86e5' => $vendorDir . '/thecodingmachine/safe/generated/cubrid.php', - '68e1365710575942efc1d55000032cee' => $vendorDir . '/thecodingmachine/safe/generated/curl.php', - '02fd26bca803106c5b942a7197c3ad8b' => $vendorDir . '/thecodingmachine/safe/generated/datetime.php', - 'f4817dcbd956cd221b1c31f6fbd5749c' => $vendorDir . '/thecodingmachine/safe/generated/dir.php', - '51c3f2d10ca61a70dbcea0e38d8e902d' => $vendorDir . '/thecodingmachine/safe/generated/eio.php', - '1d34f34327ca3e81535963016e3be2c3' => $vendorDir . '/thecodingmachine/safe/generated/errorfunc.php', - '4fd0ba2d3717b0424d474bebfdafa2b4' => $vendorDir . '/thecodingmachine/safe/generated/exec.php', - '98f4dae054bc7fb19c13be14935cbdd3' => $vendorDir . '/thecodingmachine/safe/generated/fileinfo.php', - '5530ae063ba88323eaf0a07904efdf85' => $vendorDir . '/thecodingmachine/safe/generated/filesystem.php', - '633f4f134975d70e97bddad83348e91a' => $vendorDir . '/thecodingmachine/safe/generated/filter.php', - 'fbd163fc68c5faf73d5ed4002ffd836d' => $vendorDir . '/thecodingmachine/safe/generated/fpm.php', - '21b511999d61411fab0692ff8795bbed' => $vendorDir . '/thecodingmachine/safe/generated/ftp.php', - '85fbd73fc92365cd90526b0ea03cae3a' => $vendorDir . '/thecodingmachine/safe/generated/funchand.php', - '51df9c146e0b7dcbdf358d8abd24dbdc' => $vendorDir . '/thecodingmachine/safe/generated/gmp.php', - '93bb7fe678d7dcfb1322f8e3475a48b0' => $vendorDir . '/thecodingmachine/safe/generated/gnupg.php', - 'c171ba99cf316379ff66468392bf4950' => $vendorDir . '/thecodingmachine/safe/generated/hash.php', - '5ab4aad4c28e468209fbfcceb2e5e6a5' => $vendorDir . '/thecodingmachine/safe/generated/ibase.php', - '4d57409c5e8e576b0c64c08d9d731cfb' => $vendorDir . '/thecodingmachine/safe/generated/ibmDb2.php', - 'eeb246d5403972a9d62106e4a4883496' => $vendorDir . '/thecodingmachine/safe/generated/iconv.php', - 'c28a05f498c01b810a714f7214b7a8da' => $vendorDir . '/thecodingmachine/safe/generated/image.php', - '8063cd92acdf00fd978b5599eb7cc142' => $vendorDir . '/thecodingmachine/safe/generated/imap.php', - '8bd26dbe768e9c9599edad7b198e5446' => $vendorDir . '/thecodingmachine/safe/generated/info.php', - '0c577fe603b029d4b65c84376b15dbd5' => $vendorDir . '/thecodingmachine/safe/generated/ingres-ii.php', - 'd4362910bde43c0f956b52527effd7d4' => $vendorDir . '/thecodingmachine/safe/generated/inotify.php', - '696ba49197d9b55f0428a12bb5a818e1' => $vendorDir . '/thecodingmachine/safe/generated/json.php', - '9818aaa99c8647c63f8ef62b7a368160' => $vendorDir . '/thecodingmachine/safe/generated/ldap.php', - 'bcf523ff2a195eb08e0fbb668ed784d0' => $vendorDir . '/thecodingmachine/safe/generated/libxml.php', - '68be68a9a8b95bb56cab6109ff03bc88' => $vendorDir . '/thecodingmachine/safe/generated/lzf.php', - 'bdca804bb0904ea9f53f328dfc0bb8a5' => $vendorDir . '/thecodingmachine/safe/generated/mailparse.php', - 'b0a3fcac3eaf55445796d6af26b89366' => $vendorDir . '/thecodingmachine/safe/generated/mbstring.php', - '98de16b8db03eb0cb4d318b4402215a6' => $vendorDir . '/thecodingmachine/safe/generated/misc.php', - 'c112440003b56e243b192c11fa9d836e' => $vendorDir . '/thecodingmachine/safe/generated/msql.php', - '7cefd81607cd21b8b3a15656eb6465f5' => $vendorDir . '/thecodingmachine/safe/generated/mysql.php', - 'aaf438b080089c6d0686679cd34aa72e' => $vendorDir . '/thecodingmachine/safe/generated/mysqli.php', - 'df0ef890e9afbf95f3924feb1c7a89f3' => $vendorDir . '/thecodingmachine/safe/generated/mysqlndMs.php', - 'db595fee5972867e45c5327010d78735' => $vendorDir . '/thecodingmachine/safe/generated/mysqlndQc.php', - 'cbac956836b72483dcff1ac39d5c0a0f' => $vendorDir . '/thecodingmachine/safe/generated/network.php', - '6c8f89dfbdc117d7871f572269363f25' => $vendorDir . '/thecodingmachine/safe/generated/oci8.php', - '169a669966a45c06bf55ed029122729b' => $vendorDir . '/thecodingmachine/safe/generated/opcache.php', - 'def61bf4fecd4d4bca7354919cd69302' => $vendorDir . '/thecodingmachine/safe/generated/openssl.php', - '26bb010649a6d32d4120181458aa6ef2' => $vendorDir . '/thecodingmachine/safe/generated/outcontrol.php', - '1212c201fe43c7492a085b2c71505e0f' => $vendorDir . '/thecodingmachine/safe/generated/password.php', - '002ebcb842e2c0d5b7f67fe64cc93158' => $vendorDir . '/thecodingmachine/safe/generated/pcntl.php', - '86df38612982dade72c7085ce7eca81f' => $vendorDir . '/thecodingmachine/safe/generated/pcre.php', - '1cacc3e65f82a473fbd5507c7ce4385d' => $vendorDir . '/thecodingmachine/safe/generated/pdf.php', - '1fc22f445c69ea8706e82fce301c0831' => $vendorDir . '/thecodingmachine/safe/generated/pgsql.php', - 'c70b42561584f7144bff38cd63c4eef3' => $vendorDir . '/thecodingmachine/safe/generated/posix.php', - '9923214639c32ca5173db03a177d3b63' => $vendorDir . '/thecodingmachine/safe/generated/ps.php', - '7e9c3f8eae2b5bf42205c4f1295cb7a7' => $vendorDir . '/thecodingmachine/safe/generated/pspell.php', - '91aa91f6245c349c2e2e88bd0025f199' => $vendorDir . '/thecodingmachine/safe/generated/readline.php', - 'd43773cacb9e5e8e897aa255e32007d1' => $vendorDir . '/thecodingmachine/safe/generated/rpminfo.php', - 'f053a3849e9e8383762b34b91db0320b' => $vendorDir . '/thecodingmachine/safe/generated/rrd.php', - '775b964f72f827a1bf87c65ab5b10800' => $vendorDir . '/thecodingmachine/safe/generated/sem.php', - '816428bd69c29ab5e1ed622af5dca0cd' => $vendorDir . '/thecodingmachine/safe/generated/session.php', - '5093e233bedbefaef0df262bfbab0a5c' => $vendorDir . '/thecodingmachine/safe/generated/shmop.php', - '01352920b0151f17e671266e44b52536' => $vendorDir . '/thecodingmachine/safe/generated/simplexml.php', - 'b080617b1d949683c2e37f8f01dc0e15' => $vendorDir . '/thecodingmachine/safe/generated/sockets.php', - '2708aa182ddcfe6ce27c96acaaa40f69' => $vendorDir . '/thecodingmachine/safe/generated/sodium.php', - 'f1b96cb260a5baeea9a7285cda82a1ec' => $vendorDir . '/thecodingmachine/safe/generated/solr.php', - '3fd8853757d0fe3557c179efb807afeb' => $vendorDir . '/thecodingmachine/safe/generated/spl.php', - '9312ce96a51c846913fcda5f186d58dd' => $vendorDir . '/thecodingmachine/safe/generated/sqlsrv.php', - 'd3eb383ad0b8b962b29dc4afd29d6715' => $vendorDir . '/thecodingmachine/safe/generated/ssdeep.php', - '42a09bc448f441a0b9f9367ea975c0bf' => $vendorDir . '/thecodingmachine/safe/generated/ssh2.php', - 'ef711077d356d1b33ca0b10b67b0be8f' => $vendorDir . '/thecodingmachine/safe/generated/stream.php', - '764b09f6df081cbb2807b97c6ace3866' => $vendorDir . '/thecodingmachine/safe/generated/strings.php', - 'ef241678769fee4a44aaa288f3b78aa1' => $vendorDir . '/thecodingmachine/safe/generated/swoole.php', - '0efc8f6778cba932b9e2a89e28de2452' => $vendorDir . '/thecodingmachine/safe/generated/uodbc.php', - 'd383d32907b98af53ee9208c62204fd0' => $vendorDir . '/thecodingmachine/safe/generated/uopz.php', - '2fd2e4060f7fe772660f002ce38f0b71' => $vendorDir . '/thecodingmachine/safe/generated/url.php', - '782249e03deebeaf57b9991ff5493aa0' => $vendorDir . '/thecodingmachine/safe/generated/var.php', - '344440cd1cd7200fdb4f12af0d3c587f' => $vendorDir . '/thecodingmachine/safe/generated/xdiff.php', - '3599f369219c658a5fb6c4fe66832f62' => $vendorDir . '/thecodingmachine/safe/generated/xml.php', - '7fcd313da9fae337051b091b3492c21b' => $vendorDir . '/thecodingmachine/safe/generated/xmlrpc.php', - 'd668c74cfa92d893b582356733d9a80e' => $vendorDir . '/thecodingmachine/safe/generated/yaml.php', - '4af1dca6db8c527c6eed27bff85ff0e5' => $vendorDir . '/thecodingmachine/safe/generated/yaz.php', - 'fe43ca06499ac37bc2dedd823af71eb5' => $vendorDir . '/thecodingmachine/safe/generated/zip.php', - '356736db98a6834f0a886b8d509b0ecd' => $vendorDir . '/thecodingmachine/safe/generated/zlib.php', -); diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_namespaces.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_namespaces.php deleted file mode 100644 index 15a2ff3a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/web-auth/metadata-service/src'), - 'Webauthn\\' => array($vendorDir . '/web-auth/webauthn-lib/src'), - 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), - 'Safe\\' => array($vendorDir . '/thecodingmachine/safe/lib', $vendorDir . '/thecodingmachine/safe/deprecated', $vendorDir . '/thecodingmachine/safe/generated'), - 'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'), - 'Ramsey\\Collection\\' => array($vendorDir . '/ramsey/collection/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), - 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), - 'Nyholm\\Psr7\\' => array($vendorDir . '/nyholm/psr7/src'), - 'Nyholm\\Psr7Server\\' => array($vendorDir . '/nyholm/psr7-server/src'), - 'League\\Uri\\' => array($vendorDir . '/league/uri-interfaces/src', $vendorDir . '/league/uri/src'), - 'Jose\\Component\\Signature\\Algorithm\\' => array($vendorDir . '/web-token/jwt-signature-algorithm-ecdsa', $vendorDir . '/web-token/jwt-signature-algorithm-eddsa', $vendorDir . '/web-token/jwt-signature-algorithm-rsa'), - 'Jose\\Component\\Signature\\' => array($vendorDir . '/web-token/jwt-signature'), - 'Jose\\Component\\KeyManagement\\' => array($vendorDir . '/web-token/jwt-key-mgmt'), - 'Jose\\Component\\Core\\' => array($vendorDir . '/web-token/jwt-core'), - 'FG\\' => array($vendorDir . '/fgrosse/phpasn1/lib'), - 'Cose\\' => array($vendorDir . '/web-auth/cose-lib/src'), - 'CBOR\\' => array($vendorDir . '/spomky-labs/cbor-php/src'), - 'Brick\\Math\\' => array($vendorDir . '/brick/math/src'), - 'Base64Url\\' => array($vendorDir . '/spomky-labs/base64url/src'), - 'Assert\\' => array($vendorDir . '/beberlei/assert/lib/Assert'), -); diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_real.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_real.php deleted file mode 100644 index fb9505bb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_real.php +++ /dev/null @@ -1,48 +0,0 @@ -register(true); - - $filesToLoad = \Composer\Autoload\ComposerStaticInit09e765e3690d5165ed98a315471eec7d::$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/wp-webauthn/wp-webauthn-vendor/composer/autoload_static.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_static.php deleted file mode 100644 index eb725853..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/autoload_static.php +++ /dev/null @@ -1,948 +0,0 @@ - __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - 'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php', - '51fcf4e06c07cc00c920b44bcd900e7a' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/apc.php', - '47f619d9197b36cf5ab70738d7743fe2' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/libevent.php', - 'ea6bb8a12ef9b68f6ada99058e530760' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/mssql.php', - '9a29089eb3ce41a446744c68a00f118c' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/stats.php', - '72243e5536b63e298acb6476f01f1aff' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/special_cases.php', - '3f648889e687f31c52f949ba8a9d0873' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/apache.php', - 'eeb4581d958421a4244aaa4167c6a575' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/apcu.php', - '04cb0b3c1dac5b5ddb23c14e3d66dbe9' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/array.php', - '450b332a74a9a21e043c5e953485a791' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/bzip2.php', - '6e9b7954ecfd7cbb9ca239319d1acdb6' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/calendar.php', - '2c6d7e8bd2de9a272a9d4d43b0a4304a' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/classobj.php', - '0b8231c1ad0865447c988a4c16b4001f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/com.php', - '7643a71fe1c3256058c8fee234cb86e5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/cubrid.php', - '68e1365710575942efc1d55000032cee' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/curl.php', - '02fd26bca803106c5b942a7197c3ad8b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/datetime.php', - 'f4817dcbd956cd221b1c31f6fbd5749c' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/dir.php', - '51c3f2d10ca61a70dbcea0e38d8e902d' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/eio.php', - '1d34f34327ca3e81535963016e3be2c3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/errorfunc.php', - '4fd0ba2d3717b0424d474bebfdafa2b4' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/exec.php', - '98f4dae054bc7fb19c13be14935cbdd3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/fileinfo.php', - '5530ae063ba88323eaf0a07904efdf85' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/filesystem.php', - '633f4f134975d70e97bddad83348e91a' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/filter.php', - 'fbd163fc68c5faf73d5ed4002ffd836d' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/fpm.php', - '21b511999d61411fab0692ff8795bbed' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ftp.php', - '85fbd73fc92365cd90526b0ea03cae3a' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/funchand.php', - '51df9c146e0b7dcbdf358d8abd24dbdc' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/gmp.php', - '93bb7fe678d7dcfb1322f8e3475a48b0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/gnupg.php', - 'c171ba99cf316379ff66468392bf4950' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/hash.php', - '5ab4aad4c28e468209fbfcceb2e5e6a5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ibase.php', - '4d57409c5e8e576b0c64c08d9d731cfb' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ibmDb2.php', - 'eeb246d5403972a9d62106e4a4883496' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/iconv.php', - 'c28a05f498c01b810a714f7214b7a8da' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/image.php', - '8063cd92acdf00fd978b5599eb7cc142' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/imap.php', - '8bd26dbe768e9c9599edad7b198e5446' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/info.php', - '0c577fe603b029d4b65c84376b15dbd5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ingres-ii.php', - 'd4362910bde43c0f956b52527effd7d4' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/inotify.php', - '696ba49197d9b55f0428a12bb5a818e1' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/json.php', - '9818aaa99c8647c63f8ef62b7a368160' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ldap.php', - 'bcf523ff2a195eb08e0fbb668ed784d0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/libxml.php', - '68be68a9a8b95bb56cab6109ff03bc88' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/lzf.php', - 'bdca804bb0904ea9f53f328dfc0bb8a5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mailparse.php', - 'b0a3fcac3eaf55445796d6af26b89366' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mbstring.php', - '98de16b8db03eb0cb4d318b4402215a6' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/misc.php', - 'c112440003b56e243b192c11fa9d836e' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/msql.php', - '7cefd81607cd21b8b3a15656eb6465f5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysql.php', - 'aaf438b080089c6d0686679cd34aa72e' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysqli.php', - 'df0ef890e9afbf95f3924feb1c7a89f3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysqlndMs.php', - 'db595fee5972867e45c5327010d78735' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/mysqlndQc.php', - 'cbac956836b72483dcff1ac39d5c0a0f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/network.php', - '6c8f89dfbdc117d7871f572269363f25' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/oci8.php', - '169a669966a45c06bf55ed029122729b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/opcache.php', - 'def61bf4fecd4d4bca7354919cd69302' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/openssl.php', - '26bb010649a6d32d4120181458aa6ef2' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/outcontrol.php', - '1212c201fe43c7492a085b2c71505e0f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/password.php', - '002ebcb842e2c0d5b7f67fe64cc93158' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pcntl.php', - '86df38612982dade72c7085ce7eca81f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pcre.php', - '1cacc3e65f82a473fbd5507c7ce4385d' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pdf.php', - '1fc22f445c69ea8706e82fce301c0831' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pgsql.php', - 'c70b42561584f7144bff38cd63c4eef3' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/posix.php', - '9923214639c32ca5173db03a177d3b63' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ps.php', - '7e9c3f8eae2b5bf42205c4f1295cb7a7' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/pspell.php', - '91aa91f6245c349c2e2e88bd0025f199' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/readline.php', - 'd43773cacb9e5e8e897aa255e32007d1' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/rpminfo.php', - 'f053a3849e9e8383762b34b91db0320b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/rrd.php', - '775b964f72f827a1bf87c65ab5b10800' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sem.php', - '816428bd69c29ab5e1ed622af5dca0cd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/session.php', - '5093e233bedbefaef0df262bfbab0a5c' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/shmop.php', - '01352920b0151f17e671266e44b52536' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/simplexml.php', - 'b080617b1d949683c2e37f8f01dc0e15' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sockets.php', - '2708aa182ddcfe6ce27c96acaaa40f69' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sodium.php', - 'f1b96cb260a5baeea9a7285cda82a1ec' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/solr.php', - '3fd8853757d0fe3557c179efb807afeb' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/spl.php', - '9312ce96a51c846913fcda5f186d58dd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/sqlsrv.php', - 'd3eb383ad0b8b962b29dc4afd29d6715' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ssdeep.php', - '42a09bc448f441a0b9f9367ea975c0bf' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/ssh2.php', - 'ef711077d356d1b33ca0b10b67b0be8f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/stream.php', - '764b09f6df081cbb2807b97c6ace3866' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/strings.php', - 'ef241678769fee4a44aaa288f3b78aa1' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/swoole.php', - '0efc8f6778cba932b9e2a89e28de2452' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/uodbc.php', - 'd383d32907b98af53ee9208c62204fd0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/uopz.php', - '2fd2e4060f7fe772660f002ce38f0b71' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/url.php', - '782249e03deebeaf57b9991ff5493aa0' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/var.php', - '344440cd1cd7200fdb4f12af0d3c587f' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/xdiff.php', - '3599f369219c658a5fb6c4fe66832f62' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/xml.php', - '7fcd313da9fae337051b091b3492c21b' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/xmlrpc.php', - 'd668c74cfa92d893b582356733d9a80e' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/yaml.php', - '4af1dca6db8c527c6eed27bff85ff0e5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/yaz.php', - 'fe43ca06499ac37bc2dedd823af71eb5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zip.php', - '356736db98a6834f0a886b8d509b0ecd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zlib.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'W' => - array ( - 'Webauthn\\MetadataService\\' => 25, - 'Webauthn\\' => 9, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Php81\\' => 23, - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Component\\Process\\' => 26, - 'Safe\\' => 5, - ), - 'R' => - array ( - 'Ramsey\\Uuid\\' => 12, - 'Ramsey\\Collection\\' => 18, - ), - 'P' => - array ( - 'Psr\\Log\\' => 8, - 'Psr\\Http\\Message\\' => 17, - 'Psr\\Http\\Client\\' => 16, - ), - 'N' => - array ( - 'Nyholm\\Psr7\\' => 12, - 'Nyholm\\Psr7Server\\' => 18, - ), - 'L' => - array ( - 'League\\Uri\\' => 11, - ), - 'J' => - array ( - 'Jose\\Component\\Signature\\Algorithm\\' => 35, - 'Jose\\Component\\Signature\\' => 25, - 'Jose\\Component\\KeyManagement\\' => 29, - 'Jose\\Component\\Core\\' => 20, - ), - 'F' => - array ( - 'FG\\' => 3, - ), - 'C' => - array ( - 'Cose\\' => 5, - 'CBOR\\' => 5, - ), - 'B' => - array ( - 'Brick\\Math\\' => 11, - 'Base64Url\\' => 10, - ), - 'A' => - array ( - 'Assert\\' => 7, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Webauthn\\MetadataService\\' => - array ( - 0 => __DIR__ . '/..' . '/web-auth/metadata-service/src', - ), - 'Webauthn\\' => - array ( - 0 => __DIR__ . '/..' . '/web-auth/webauthn-lib/src', - ), - 'Symfony\\Polyfill\\Php81\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', - ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Ctype\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Component\\Process\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/process', - ), - 'Safe\\' => - array ( - 0 => __DIR__ . '/..' . '/thecodingmachine/safe/lib', - 1 => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated', - 2 => __DIR__ . '/..' . '/thecodingmachine/safe/generated', - ), - 'Ramsey\\Uuid\\' => - array ( - 0 => __DIR__ . '/..' . '/ramsey/uuid/src', - ), - 'Ramsey\\Collection\\' => - array ( - 0 => __DIR__ . '/..' . '/ramsey/collection/src', - ), - 'Psr\\Log\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', - ), - 'Psr\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-message/src', - 1 => __DIR__ . '/..' . '/psr/http-factory/src', - ), - 'Psr\\Http\\Client\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-client/src', - ), - 'Nyholm\\Psr7\\' => - array ( - 0 => __DIR__ . '/..' . '/nyholm/psr7/src', - ), - 'Nyholm\\Psr7Server\\' => - array ( - 0 => __DIR__ . '/..' . '/nyholm/psr7-server/src', - ), - 'League\\Uri\\' => - array ( - 0 => __DIR__ . '/..' . '/league/uri-interfaces/src', - 1 => __DIR__ . '/..' . '/league/uri/src', - ), - 'Jose\\Component\\Signature\\Algorithm\\' => - array ( - 0 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa', - 1 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-eddsa', - 2 => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa', - ), - 'Jose\\Component\\Signature\\' => - array ( - 0 => __DIR__ . '/..' . '/web-token/jwt-signature', - ), - 'Jose\\Component\\KeyManagement\\' => - array ( - 0 => __DIR__ . '/..' . '/web-token/jwt-key-mgmt', - ), - 'Jose\\Component\\Core\\' => - array ( - 0 => __DIR__ . '/..' . '/web-token/jwt-core', - ), - 'FG\\' => - array ( - 0 => __DIR__ . '/..' . '/fgrosse/phpasn1/lib', - ), - 'Cose\\' => - array ( - 0 => __DIR__ . '/..' . '/web-auth/cose-lib/src', - ), - 'CBOR\\' => - array ( - 0 => __DIR__ . '/..' . '/spomky-labs/cbor-php/src', - ), - 'Brick\\Math\\' => - array ( - 0 => __DIR__ . '/..' . '/brick/math/src', - ), - 'Base64Url\\' => - array ( - 0 => __DIR__ . '/..' . '/spomky-labs/base64url/src', - ), - 'Assert\\' => - array ( - 0 => __DIR__ . '/..' . '/beberlei/assert/lib/Assert', - ), - ); - - public static $classMap = array ( - 'Assert\\Assert' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/Assert.php', - 'Assert\\Assertion' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/Assertion.php', - 'Assert\\AssertionChain' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/AssertionChain.php', - 'Assert\\AssertionFailedException' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/AssertionFailedException.php', - 'Assert\\InvalidArgumentException' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/InvalidArgumentException.php', - 'Assert\\LazyAssertion' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/LazyAssertion.php', - 'Assert\\LazyAssertionException' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/LazyAssertionException.php', - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Base64Url\\Base64Url' => __DIR__ . '/..' . '/spomky-labs/base64url/src/Base64Url.php', - 'Brick\\Math\\BigDecimal' => __DIR__ . '/..' . '/brick/math/src/BigDecimal.php', - 'Brick\\Math\\BigInteger' => __DIR__ . '/..' . '/brick/math/src/BigInteger.php', - 'Brick\\Math\\BigNumber' => __DIR__ . '/..' . '/brick/math/src/BigNumber.php', - 'Brick\\Math\\BigRational' => __DIR__ . '/..' . '/brick/math/src/BigRational.php', - 'Brick\\Math\\Exception\\DivisionByZeroException' => __DIR__ . '/..' . '/brick/math/src/Exception/DivisionByZeroException.php', - 'Brick\\Math\\Exception\\IntegerOverflowException' => __DIR__ . '/..' . '/brick/math/src/Exception/IntegerOverflowException.php', - 'Brick\\Math\\Exception\\MathException' => __DIR__ . '/..' . '/brick/math/src/Exception/MathException.php', - 'Brick\\Math\\Exception\\NegativeNumberException' => __DIR__ . '/..' . '/brick/math/src/Exception/NegativeNumberException.php', - 'Brick\\Math\\Exception\\NumberFormatException' => __DIR__ . '/..' . '/brick/math/src/Exception/NumberFormatException.php', - 'Brick\\Math\\Exception\\RoundingNecessaryException' => __DIR__ . '/..' . '/brick/math/src/Exception/RoundingNecessaryException.php', - 'Brick\\Math\\Internal\\Calculator' => __DIR__ . '/..' . '/brick/math/src/Internal/Calculator.php', - 'Brick\\Math\\Internal\\Calculator\\BcMathCalculator' => __DIR__ . '/..' . '/brick/math/src/Internal/Calculator/BcMathCalculator.php', - 'Brick\\Math\\Internal\\Calculator\\GmpCalculator' => __DIR__ . '/..' . '/brick/math/src/Internal/Calculator/GmpCalculator.php', - 'Brick\\Math\\Internal\\Calculator\\NativeCalculator' => __DIR__ . '/..' . '/brick/math/src/Internal/Calculator/NativeCalculator.php', - 'Brick\\Math\\RoundingMode' => __DIR__ . '/..' . '/brick/math/src/RoundingMode.php', - 'CBOR\\AbstractCBORObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/AbstractCBORObject.php', - 'CBOR\\ByteStringObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/ByteStringObject.php', - 'CBOR\\ByteStringWithChunkObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/ByteStringWithChunkObject.php', - 'CBOR\\CBORObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/CBORObject.php', - 'CBOR\\Decoder' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Decoder.php', - 'CBOR\\DecoderInterface' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/DecoderInterface.php', - 'CBOR\\IndefiniteLengthByteStringObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/IndefiniteLengthByteStringObject.php', - 'CBOR\\IndefiniteLengthListObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php', - 'CBOR\\IndefiniteLengthMapObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/IndefiniteLengthMapObject.php', - 'CBOR\\IndefiniteLengthTextStringObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php', - 'CBOR\\InfiniteListObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/InfiniteListObject.php', - 'CBOR\\InfiniteMapObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/InfiniteMapObject.php', - 'CBOR\\LengthCalculator' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/LengthCalculator.php', - 'CBOR\\ListObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/ListObject.php', - 'CBOR\\MapItem' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/MapItem.php', - 'CBOR\\MapObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/MapObject.php', - 'CBOR\\NegativeIntegerObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/NegativeIntegerObject.php', - 'CBOR\\Normalizable' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Normalizable.php', - 'CBOR\\OtherObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject.php', - 'CBOR\\OtherObject\\BreakObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/BreakObject.php', - 'CBOR\\OtherObject\\DoublePrecisionFloatObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/DoublePrecisionFloatObject.php', - 'CBOR\\OtherObject\\FalseObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/FalseObject.php', - 'CBOR\\OtherObject\\GenericObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/GenericObject.php', - 'CBOR\\OtherObject\\HalfPrecisionFloatObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php', - 'CBOR\\OtherObject\\NullObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/NullObject.php', - 'CBOR\\OtherObject\\OtherObjectManager' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/OtherObjectManager.php', - 'CBOR\\OtherObject\\OtherObjectManagerInterface' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/OtherObjectManagerInterface.php', - 'CBOR\\OtherObject\\SimpleObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/SimpleObject.php', - 'CBOR\\OtherObject\\SinglePrecisionFloatObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php', - 'CBOR\\OtherObject\\TrueObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/TrueObject.php', - 'CBOR\\OtherObject\\UndefinedObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/OtherObject/UndefinedObject.php', - 'CBOR\\SignedIntegerObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/SignedIntegerObject.php', - 'CBOR\\Stream' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Stream.php', - 'CBOR\\StringStream' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/StringStream.php', - 'CBOR\\Tag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag.php', - 'CBOR\\TagObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/TagObject.php', - 'CBOR\\Tag\\Base16EncodingTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/Base16EncodingTag.php', - 'CBOR\\Tag\\Base64EncodingTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/Base64EncodingTag.php', - 'CBOR\\Tag\\Base64Tag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/Base64Tag.php', - 'CBOR\\Tag\\Base64UrlEncodingTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/Base64UrlEncodingTag.php', - 'CBOR\\Tag\\Base64UrlTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/Base64UrlTag.php', - 'CBOR\\Tag\\BigFloatTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/BigFloatTag.php', - 'CBOR\\Tag\\CBOREncodingTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/CBOREncodingTag.php', - 'CBOR\\Tag\\CBORTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/CBORTag.php', - 'CBOR\\Tag\\DatetimeTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/DatetimeTag.php', - 'CBOR\\Tag\\DecimalFractionTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/DecimalFractionTag.php', - 'CBOR\\Tag\\EpochTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/EpochTag.php', - 'CBOR\\Tag\\GenericTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/GenericTag.php', - 'CBOR\\Tag\\MimeTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/MimeTag.php', - 'CBOR\\Tag\\NegativeBigIntegerTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/NegativeBigIntegerTag.php', - 'CBOR\\Tag\\PositiveBigIntegerTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/PositiveBigIntegerTag.php', - 'CBOR\\Tag\\TagManager' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/TagManager.php', - 'CBOR\\Tag\\TagManagerInterface' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/TagManagerInterface.php', - 'CBOR\\Tag\\TagObjectManager' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/TagObjectManager.php', - 'CBOR\\Tag\\TimestampTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/TimestampTag.php', - 'CBOR\\Tag\\UnsignedBigIntegerTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/UnsignedBigIntegerTag.php', - 'CBOR\\Tag\\UriTag' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Tag/UriTag.php', - 'CBOR\\TextStringObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/TextStringObject.php', - 'CBOR\\TextStringWithChunkObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/TextStringWithChunkObject.php', - 'CBOR\\UnsignedIntegerObject' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/UnsignedIntegerObject.php', - 'CBOR\\Utils' => __DIR__ . '/..' . '/spomky-labs/cbor-php/src/Utils.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Cose\\Algorithm\\Algorithm' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Algorithm.php', - 'Cose\\Algorithm\\Mac\\HS256' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Mac/HS256.php', - 'Cose\\Algorithm\\Mac\\HS256Truncated64' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Mac/HS256Truncated64.php', - 'Cose\\Algorithm\\Mac\\HS384' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Mac/HS384.php', - 'Cose\\Algorithm\\Mac\\HS512' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Mac/HS512.php', - 'Cose\\Algorithm\\Mac\\Hmac' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Mac/Hmac.php', - 'Cose\\Algorithm\\Mac\\Mac' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Mac/Mac.php', - 'Cose\\Algorithm\\Manager' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Manager.php', - 'Cose\\Algorithm\\ManagerFactory' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/ManagerFactory.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ECDSA' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECDSA.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ECSignature' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECSignature.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES256' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES256.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES256K' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES256K.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES384' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES384.php', - 'Cose\\Algorithm\\Signature\\ECDSA\\ES512' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES512.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\ED256' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/ED256.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\ED512' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/ED512.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\Ed25519' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/Ed25519.php', - 'Cose\\Algorithm\\Signature\\EdDSA\\EdDSA' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/EdDSA/EdDSA.php', - 'Cose\\Algorithm\\Signature\\RSA\\PS256' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS256.php', - 'Cose\\Algorithm\\Signature\\RSA\\PS384' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS384.php', - 'Cose\\Algorithm\\Signature\\RSA\\PS512' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS512.php', - 'Cose\\Algorithm\\Signature\\RSA\\PSSRSA' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/PSSRSA.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS1' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS1.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS256' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS256.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS384' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS384.php', - 'Cose\\Algorithm\\Signature\\RSA\\RS512' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS512.php', - 'Cose\\Algorithm\\Signature\\RSA\\RSA' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/RSA/RSA.php', - 'Cose\\Algorithm\\Signature\\Signature' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithm/Signature/Signature.php', - 'Cose\\Algorithms' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Algorithms.php', - 'Cose\\BigInteger' => __DIR__ . '/..' . '/web-auth/cose-lib/src/BigInteger.php', - 'Cose\\Hash' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Hash.php', - 'Cose\\Key\\Ec2Key' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Key/Ec2Key.php', - 'Cose\\Key\\Key' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Key/Key.php', - 'Cose\\Key\\OkpKey' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Key/OkpKey.php', - 'Cose\\Key\\RsaKey' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Key/RsaKey.php', - 'Cose\\Key\\SymmetricKey' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Key/SymmetricKey.php', - 'Cose\\Verifier' => __DIR__ . '/..' . '/web-auth/cose-lib/src/Verifier.php', - 'FG\\ASN1\\ASNObject' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/ASNObject.php', - 'FG\\ASN1\\AbstractString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/AbstractString.php', - 'FG\\ASN1\\AbstractTime' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/AbstractTime.php', - 'FG\\ASN1\\Base128' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Base128.php', - 'FG\\ASN1\\Composite\\AttributeTypeAndValue' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php', - 'FG\\ASN1\\Composite\\RDNString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php', - 'FG\\ASN1\\Composite\\RelativeDistinguishedName' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php', - 'FG\\ASN1\\Construct' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Construct.php', - 'FG\\ASN1\\Exception\\NotImplementedException' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php', - 'FG\\ASN1\\Exception\\ParserException' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php', - 'FG\\ASN1\\ExplicitlyTaggedObject' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php', - 'FG\\ASN1\\Identifier' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Identifier.php', - 'FG\\ASN1\\OID' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/OID.php', - 'FG\\ASN1\\Parsable' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Parsable.php', - 'FG\\ASN1\\TemplateParser' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/TemplateParser.php', - 'FG\\ASN1\\Universal\\BMPString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php', - 'FG\\ASN1\\Universal\\BitString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php', - 'FG\\ASN1\\Universal\\Boolean' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php', - 'FG\\ASN1\\Universal\\CharacterString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php', - 'FG\\ASN1\\Universal\\Enumerated' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php', - 'FG\\ASN1\\Universal\\GeneralString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php', - 'FG\\ASN1\\Universal\\GeneralizedTime' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php', - 'FG\\ASN1\\Universal\\GraphicString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php', - 'FG\\ASN1\\Universal\\IA5String' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php', - 'FG\\ASN1\\Universal\\Integer' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php', - 'FG\\ASN1\\Universal\\NullObject' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php', - 'FG\\ASN1\\Universal\\NumericString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php', - 'FG\\ASN1\\Universal\\ObjectDescriptor' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php', - 'FG\\ASN1\\Universal\\ObjectIdentifier' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php', - 'FG\\ASN1\\Universal\\OctetString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php', - 'FG\\ASN1\\Universal\\PrintableString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php', - 'FG\\ASN1\\Universal\\RelativeObjectIdentifier' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php', - 'FG\\ASN1\\Universal\\Sequence' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php', - 'FG\\ASN1\\Universal\\Set' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/Set.php', - 'FG\\ASN1\\Universal\\T61String' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php', - 'FG\\ASN1\\Universal\\UTCTime' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php', - 'FG\\ASN1\\Universal\\UTF8String' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php', - 'FG\\ASN1\\Universal\\UniversalString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php', - 'FG\\ASN1\\Universal\\VisibleString' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php', - 'FG\\ASN1\\UnknownConstructedObject' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php', - 'FG\\ASN1\\UnknownObject' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/ASN1/UnknownObject.php', - 'FG\\Utility\\BigInteger' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/Utility/BigInteger.php', - 'FG\\Utility\\BigIntegerBcmath' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php', - 'FG\\Utility\\BigIntegerGmp' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php', - 'FG\\X509\\AlgorithmIdentifier' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php', - 'FG\\X509\\CSR\\Attributes' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/CSR/Attributes.php', - 'FG\\X509\\CSR\\CSR' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/CSR/CSR.php', - 'FG\\X509\\CertificateExtensions' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/CertificateExtensions.php', - 'FG\\X509\\CertificateSubject' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/CertificateSubject.php', - 'FG\\X509\\PrivateKey' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/PrivateKey.php', - 'FG\\X509\\PublicKey' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/PublicKey.php', - 'FG\\X509\\SAN\\DNSName' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/SAN/DNSName.php', - 'FG\\X509\\SAN\\IPAddress' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php', - 'FG\\X509\\SAN\\SubjectAlternativeNames' => __DIR__ . '/..' . '/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php', - 'Jose\\Component\\Core\\Algorithm' => __DIR__ . '/..' . '/web-token/jwt-core/Algorithm.php', - 'Jose\\Component\\Core\\AlgorithmManager' => __DIR__ . '/..' . '/web-token/jwt-core/AlgorithmManager.php', - 'Jose\\Component\\Core\\AlgorithmManagerFactory' => __DIR__ . '/..' . '/web-token/jwt-core/AlgorithmManagerFactory.php', - 'Jose\\Component\\Core\\JWK' => __DIR__ . '/..' . '/web-token/jwt-core/JWK.php', - 'Jose\\Component\\Core\\JWKSet' => __DIR__ . '/..' . '/web-token/jwt-core/JWKSet.php', - 'Jose\\Component\\Core\\JWT' => __DIR__ . '/..' . '/web-token/jwt-core/JWT.php', - 'Jose\\Component\\Core\\Util\\BigInteger' => __DIR__ . '/..' . '/web-token/jwt-core/Util/BigInteger.php', - 'Jose\\Component\\Core\\Util\\ECKey' => __DIR__ . '/..' . '/web-token/jwt-core/Util/ECKey.php', - 'Jose\\Component\\Core\\Util\\ECSignature' => __DIR__ . '/..' . '/web-token/jwt-core/Util/ECSignature.php', - 'Jose\\Component\\Core\\Util\\Hash' => __DIR__ . '/..' . '/web-token/jwt-core/Util/Hash.php', - 'Jose\\Component\\Core\\Util\\JsonConverter' => __DIR__ . '/..' . '/web-token/jwt-core/Util/JsonConverter.php', - 'Jose\\Component\\Core\\Util\\KeyChecker' => __DIR__ . '/..' . '/web-token/jwt-core/Util/KeyChecker.php', - 'Jose\\Component\\Core\\Util\\RSAKey' => __DIR__ . '/..' . '/web-token/jwt-core/Util/RSAKey.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\AlgorithmAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/AlgorithmAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ES256KeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/ES256KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ES384KeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/ES384KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ES512KeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/ES512KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\HS256KeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/HS256KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\HS384KeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/HS384KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\HS512KeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/HS512KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/KeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeyAnalyzerManager' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/KeyAnalyzerManager.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeyIdentifierAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/KeyIdentifierAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeysetAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/KeysetAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\KeysetAnalyzerManager' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/KeysetAnalyzerManager.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\Message' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/Message.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\MessageBag' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/MessageBag.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\MixedKeyTypes' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/MixedKeyTypes.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\MixedPublicAndPrivateKeys' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/MixedPublicAndPrivateKeys.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\NoneAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/NoneAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\OctAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/OctAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\RsaAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/RsaAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\UsageAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/UsageAnalyzer.php', - 'Jose\\Component\\KeyManagement\\Analyzer\\ZxcvbnKeyAnalyzer' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/Analyzer/ZxcvbnKeyAnalyzer.php', - 'Jose\\Component\\KeyManagement\\JKUFactory' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/JKUFactory.php', - 'Jose\\Component\\KeyManagement\\JWKFactory' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/JWKFactory.php', - 'Jose\\Component\\KeyManagement\\KeyConverter\\ECKey' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/KeyConverter/ECKey.php', - 'Jose\\Component\\KeyManagement\\KeyConverter\\KeyConverter' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/KeyConverter/KeyConverter.php', - 'Jose\\Component\\KeyManagement\\KeyConverter\\RSAKey' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/KeyConverter/RSAKey.php', - 'Jose\\Component\\KeyManagement\\UrlKeySetFactory' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/UrlKeySetFactory.php', - 'Jose\\Component\\KeyManagement\\X5UFactory' => __DIR__ . '/..' . '/web-token/jwt-key-mgmt/X5UFactory.php', - 'Jose\\Component\\Signature\\Algorithm\\ECDSA' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa/ECDSA.php', - 'Jose\\Component\\Signature\\Algorithm\\ES256' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa/ES256.php', - 'Jose\\Component\\Signature\\Algorithm\\ES384' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa/ES384.php', - 'Jose\\Component\\Signature\\Algorithm\\ES512' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-ecdsa/ES512.php', - 'Jose\\Component\\Signature\\Algorithm\\EdDSA' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-eddsa/EdDSA.php', - 'Jose\\Component\\Signature\\Algorithm\\MacAlgorithm' => __DIR__ . '/..' . '/web-token/jwt-signature/Algorithm/MacAlgorithm.php', - 'Jose\\Component\\Signature\\Algorithm\\PS256' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/PS256.php', - 'Jose\\Component\\Signature\\Algorithm\\PS384' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/PS384.php', - 'Jose\\Component\\Signature\\Algorithm\\PS512' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/PS512.php', - 'Jose\\Component\\Signature\\Algorithm\\RS256' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/RS256.php', - 'Jose\\Component\\Signature\\Algorithm\\RS384' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/RS384.php', - 'Jose\\Component\\Signature\\Algorithm\\RS512' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/RS512.php', - 'Jose\\Component\\Signature\\Algorithm\\RSA' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/RSA.php', - 'Jose\\Component\\Signature\\Algorithm\\RSAPKCS1' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/RSAPKCS1.php', - 'Jose\\Component\\Signature\\Algorithm\\RSAPSS' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/RSAPSS.php', - 'Jose\\Component\\Signature\\Algorithm\\SignatureAlgorithm' => __DIR__ . '/..' . '/web-token/jwt-signature/Algorithm/SignatureAlgorithm.php', - 'Jose\\Component\\Signature\\Algorithm\\Util\\RSA' => __DIR__ . '/..' . '/web-token/jwt-signature-algorithm-rsa/Util/RSA.php', - 'Jose\\Component\\Signature\\JWS' => __DIR__ . '/..' . '/web-token/jwt-signature/JWS.php', - 'Jose\\Component\\Signature\\JWSBuilder' => __DIR__ . '/..' . '/web-token/jwt-signature/JWSBuilder.php', - 'Jose\\Component\\Signature\\JWSBuilderFactory' => __DIR__ . '/..' . '/web-token/jwt-signature/JWSBuilderFactory.php', - 'Jose\\Component\\Signature\\JWSLoader' => __DIR__ . '/..' . '/web-token/jwt-signature/JWSLoader.php', - 'Jose\\Component\\Signature\\JWSLoaderFactory' => __DIR__ . '/..' . '/web-token/jwt-signature/JWSLoaderFactory.php', - 'Jose\\Component\\Signature\\JWSTokenSupport' => __DIR__ . '/..' . '/web-token/jwt-signature/JWSTokenSupport.php', - 'Jose\\Component\\Signature\\JWSVerifier' => __DIR__ . '/..' . '/web-token/jwt-signature/JWSVerifier.php', - 'Jose\\Component\\Signature\\JWSVerifierFactory' => __DIR__ . '/..' . '/web-token/jwt-signature/JWSVerifierFactory.php', - 'Jose\\Component\\Signature\\Serializer\\CompactSerializer' => __DIR__ . '/..' . '/web-token/jwt-signature/Serializer/CompactSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JSONFlattenedSerializer' => __DIR__ . '/..' . '/web-token/jwt-signature/Serializer/JSONFlattenedSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JSONGeneralSerializer' => __DIR__ . '/..' . '/web-token/jwt-signature/Serializer/JSONGeneralSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JWSSerializer' => __DIR__ . '/..' . '/web-token/jwt-signature/Serializer/JWSSerializer.php', - 'Jose\\Component\\Signature\\Serializer\\JWSSerializerManager' => __DIR__ . '/..' . '/web-token/jwt-signature/Serializer/JWSSerializerManager.php', - 'Jose\\Component\\Signature\\Serializer\\JWSSerializerManagerFactory' => __DIR__ . '/..' . '/web-token/jwt-signature/Serializer/JWSSerializerManagerFactory.php', - 'Jose\\Component\\Signature\\Serializer\\Serializer' => __DIR__ . '/..' . '/web-token/jwt-signature/Serializer/Serializer.php', - 'Jose\\Component\\Signature\\Signature' => __DIR__ . '/..' . '/web-token/jwt-signature/Signature.php', - 'League\\Uri\\Contracts\\AuthorityInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/AuthorityInterface.php', - 'League\\Uri\\Contracts\\DataPathInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/DataPathInterface.php', - 'League\\Uri\\Contracts\\DomainHostInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/DomainHostInterface.php', - 'League\\Uri\\Contracts\\FragmentInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/FragmentInterface.php', - 'League\\Uri\\Contracts\\HostInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/HostInterface.php', - 'League\\Uri\\Contracts\\IpHostInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/IpHostInterface.php', - 'League\\Uri\\Contracts\\PathInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/PathInterface.php', - 'League\\Uri\\Contracts\\PortInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/PortInterface.php', - 'League\\Uri\\Contracts\\QueryInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/QueryInterface.php', - 'League\\Uri\\Contracts\\SegmentedPathInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/SegmentedPathInterface.php', - 'League\\Uri\\Contracts\\UriComponentInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/UriComponentInterface.php', - 'League\\Uri\\Contracts\\UriException' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/UriException.php', - 'League\\Uri\\Contracts\\UriInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/UriInterface.php', - 'League\\Uri\\Contracts\\UserInfoInterface' => __DIR__ . '/..' . '/league/uri-interfaces/src/Contracts/UserInfoInterface.php', - 'League\\Uri\\Exceptions\\FileinfoSupportMissing' => __DIR__ . '/..' . '/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php', - 'League\\Uri\\Exceptions\\IdnSupportMissing' => __DIR__ . '/..' . '/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php', - 'League\\Uri\\Exceptions\\IdnaConversionFailed' => __DIR__ . '/..' . '/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php', - 'League\\Uri\\Exceptions\\SyntaxError' => __DIR__ . '/..' . '/league/uri-interfaces/src/Exceptions/SyntaxError.php', - 'League\\Uri\\Exceptions\\TemplateCanNotBeExpanded' => __DIR__ . '/..' . '/league/uri/src/Exceptions/TemplateCanNotBeExpanded.php', - 'League\\Uri\\Http' => __DIR__ . '/..' . '/league/uri/src/Http.php', - 'League\\Uri\\HttpFactory' => __DIR__ . '/..' . '/league/uri/src/HttpFactory.php', - 'League\\Uri\\Idna\\Idna' => __DIR__ . '/..' . '/league/uri-interfaces/src/Idna/Idna.php', - 'League\\Uri\\Idna\\IdnaInfo' => __DIR__ . '/..' . '/league/uri-interfaces/src/Idna/IdnaInfo.php', - 'League\\Uri\\Uri' => __DIR__ . '/..' . '/league/uri/src/Uri.php', - 'League\\Uri\\UriInfo' => __DIR__ . '/..' . '/league/uri/src/UriInfo.php', - 'League\\Uri\\UriResolver' => __DIR__ . '/..' . '/league/uri/src/UriResolver.php', - 'League\\Uri\\UriString' => __DIR__ . '/..' . '/league/uri/src/UriString.php', - 'League\\Uri\\UriTemplate' => __DIR__ . '/..' . '/league/uri/src/UriTemplate.php', - 'League\\Uri\\UriTemplate\\Expression' => __DIR__ . '/..' . '/league/uri/src/UriTemplate/Expression.php', - 'League\\Uri\\UriTemplate\\Template' => __DIR__ . '/..' . '/league/uri/src/UriTemplate/Template.php', - 'League\\Uri\\UriTemplate\\VarSpecifier' => __DIR__ . '/..' . '/league/uri/src/UriTemplate/VarSpecifier.php', - 'League\\Uri\\UriTemplate\\VariableBag' => __DIR__ . '/..' . '/league/uri/src/UriTemplate/VariableBag.php', - 'Nyholm\\Psr7Server\\ServerRequestCreator' => __DIR__ . '/..' . '/nyholm/psr7-server/src/ServerRequestCreator.php', - 'Nyholm\\Psr7Server\\ServerRequestCreatorInterface' => __DIR__ . '/..' . '/nyholm/psr7-server/src/ServerRequestCreatorInterface.php', - 'Nyholm\\Psr7\\Factory\\HttplugFactory' => __DIR__ . '/..' . '/nyholm/psr7/src/Factory/HttplugFactory.php', - 'Nyholm\\Psr7\\Factory\\Psr17Factory' => __DIR__ . '/..' . '/nyholm/psr7/src/Factory/Psr17Factory.php', - 'Nyholm\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/nyholm/psr7/src/MessageTrait.php', - 'Nyholm\\Psr7\\Request' => __DIR__ . '/..' . '/nyholm/psr7/src/Request.php', - 'Nyholm\\Psr7\\RequestTrait' => __DIR__ . '/..' . '/nyholm/psr7/src/RequestTrait.php', - 'Nyholm\\Psr7\\Response' => __DIR__ . '/..' . '/nyholm/psr7/src/Response.php', - 'Nyholm\\Psr7\\ServerRequest' => __DIR__ . '/..' . '/nyholm/psr7/src/ServerRequest.php', - 'Nyholm\\Psr7\\Stream' => __DIR__ . '/..' . '/nyholm/psr7/src/Stream.php', - 'Nyholm\\Psr7\\StreamTrait' => __DIR__ . '/..' . '/nyholm/psr7/src/StreamTrait.php', - 'Nyholm\\Psr7\\UploadedFile' => __DIR__ . '/..' . '/nyholm/psr7/src/UploadedFile.php', - 'Nyholm\\Psr7\\Uri' => __DIR__ . '/..' . '/nyholm/psr7/src/Uri.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Psr\\Http\\Client\\ClientExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/ClientExceptionInterface.php', - 'Psr\\Http\\Client\\ClientInterface' => __DIR__ . '/..' . '/psr/http-client/src/ClientInterface.php', - 'Psr\\Http\\Client\\NetworkExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/NetworkExceptionInterface.php', - 'Psr\\Http\\Client\\RequestExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/RequestExceptionInterface.php', - 'Psr\\Http\\Message\\MessageInterface' => __DIR__ . '/..' . '/psr/http-message/src/MessageInterface.php', - 'Psr\\Http\\Message\\RequestFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/RequestFactoryInterface.php', - 'Psr\\Http\\Message\\RequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/RequestInterface.php', - 'Psr\\Http\\Message\\ResponseFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/ResponseFactoryInterface.php', - 'Psr\\Http\\Message\\ResponseInterface' => __DIR__ . '/..' . '/psr/http-message/src/ResponseInterface.php', - 'Psr\\Http\\Message\\ServerRequestFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/ServerRequestFactoryInterface.php', - 'Psr\\Http\\Message\\ServerRequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/ServerRequestInterface.php', - 'Psr\\Http\\Message\\StreamFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/StreamFactoryInterface.php', - 'Psr\\Http\\Message\\StreamInterface' => __DIR__ . '/..' . '/psr/http-message/src/StreamInterface.php', - 'Psr\\Http\\Message\\UploadedFileFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UploadedFileFactoryInterface.php', - 'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php', - 'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php', - 'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php', - 'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php', - 'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php', - 'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php', - 'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php', - 'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php', - 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', - 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', - 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php', - 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', - 'Ramsey\\Collection\\AbstractArray' => __DIR__ . '/..' . '/ramsey/collection/src/AbstractArray.php', - 'Ramsey\\Collection\\AbstractCollection' => __DIR__ . '/..' . '/ramsey/collection/src/AbstractCollection.php', - 'Ramsey\\Collection\\AbstractSet' => __DIR__ . '/..' . '/ramsey/collection/src/AbstractSet.php', - 'Ramsey\\Collection\\ArrayInterface' => __DIR__ . '/..' . '/ramsey/collection/src/ArrayInterface.php', - 'Ramsey\\Collection\\Collection' => __DIR__ . '/..' . '/ramsey/collection/src/Collection.php', - 'Ramsey\\Collection\\CollectionInterface' => __DIR__ . '/..' . '/ramsey/collection/src/CollectionInterface.php', - 'Ramsey\\Collection\\DoubleEndedQueue' => __DIR__ . '/..' . '/ramsey/collection/src/DoubleEndedQueue.php', - 'Ramsey\\Collection\\DoubleEndedQueueInterface' => __DIR__ . '/..' . '/ramsey/collection/src/DoubleEndedQueueInterface.php', - 'Ramsey\\Collection\\Exception\\CollectionMismatchException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/CollectionMismatchException.php', - 'Ramsey\\Collection\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/InvalidArgumentException.php', - 'Ramsey\\Collection\\Exception\\InvalidSortOrderException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/InvalidSortOrderException.php', - 'Ramsey\\Collection\\Exception\\NoSuchElementException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/NoSuchElementException.php', - 'Ramsey\\Collection\\Exception\\OutOfBoundsException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/OutOfBoundsException.php', - 'Ramsey\\Collection\\Exception\\UnsupportedOperationException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/UnsupportedOperationException.php', - 'Ramsey\\Collection\\Exception\\ValueExtractionException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/ValueExtractionException.php', - 'Ramsey\\Collection\\GenericArray' => __DIR__ . '/..' . '/ramsey/collection/src/GenericArray.php', - 'Ramsey\\Collection\\Map\\AbstractMap' => __DIR__ . '/..' . '/ramsey/collection/src/Map/AbstractMap.php', - 'Ramsey\\Collection\\Map\\AbstractTypedMap' => __DIR__ . '/..' . '/ramsey/collection/src/Map/AbstractTypedMap.php', - 'Ramsey\\Collection\\Map\\AssociativeArrayMap' => __DIR__ . '/..' . '/ramsey/collection/src/Map/AssociativeArrayMap.php', - 'Ramsey\\Collection\\Map\\MapInterface' => __DIR__ . '/..' . '/ramsey/collection/src/Map/MapInterface.php', - 'Ramsey\\Collection\\Map\\NamedParameterMap' => __DIR__ . '/..' . '/ramsey/collection/src/Map/NamedParameterMap.php', - 'Ramsey\\Collection\\Map\\TypedMap' => __DIR__ . '/..' . '/ramsey/collection/src/Map/TypedMap.php', - 'Ramsey\\Collection\\Map\\TypedMapInterface' => __DIR__ . '/..' . '/ramsey/collection/src/Map/TypedMapInterface.php', - 'Ramsey\\Collection\\Queue' => __DIR__ . '/..' . '/ramsey/collection/src/Queue.php', - 'Ramsey\\Collection\\QueueInterface' => __DIR__ . '/..' . '/ramsey/collection/src/QueueInterface.php', - 'Ramsey\\Collection\\Set' => __DIR__ . '/..' . '/ramsey/collection/src/Set.php', - 'Ramsey\\Collection\\Tool\\TypeTrait' => __DIR__ . '/..' . '/ramsey/collection/src/Tool/TypeTrait.php', - 'Ramsey\\Collection\\Tool\\ValueExtractorTrait' => __DIR__ . '/..' . '/ramsey/collection/src/Tool/ValueExtractorTrait.php', - 'Ramsey\\Collection\\Tool\\ValueToStringTrait' => __DIR__ . '/..' . '/ramsey/collection/src/Tool/ValueToStringTrait.php', - 'Ramsey\\Uuid\\BinaryUtils' => __DIR__ . '/..' . '/ramsey/uuid/src/BinaryUtils.php', - 'Ramsey\\Uuid\\Builder\\BuilderCollection' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/BuilderCollection.php', - 'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php', - 'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php', - 'Ramsey\\Uuid\\Builder\\FallbackBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/FallbackBuilder.php', - 'Ramsey\\Uuid\\Builder\\UuidBuilderInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/UuidBuilderInterface.php', - 'Ramsey\\Uuid\\Codec\\CodecInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Codec/CodecInterface.php', - 'Ramsey\\Uuid\\Codec\\GuidStringCodec' => __DIR__ . '/..' . '/ramsey/uuid/src/Codec/GuidStringCodec.php', - 'Ramsey\\Uuid\\Codec\\OrderedTimeCodec' => __DIR__ . '/..' . '/ramsey/uuid/src/Codec/OrderedTimeCodec.php', - 'Ramsey\\Uuid\\Codec\\StringCodec' => __DIR__ . '/..' . '/ramsey/uuid/src/Codec/StringCodec.php', - 'Ramsey\\Uuid\\Codec\\TimestampFirstCombCodec' => __DIR__ . '/..' . '/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php', - 'Ramsey\\Uuid\\Codec\\TimestampLastCombCodec' => __DIR__ . '/..' . '/ramsey/uuid/src/Codec/TimestampLastCombCodec.php', - 'Ramsey\\Uuid\\Converter\\NumberConverterInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/NumberConverterInterface.php', - 'Ramsey\\Uuid\\Converter\\Number\\BigNumberConverter' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/Number/BigNumberConverter.php', - 'Ramsey\\Uuid\\Converter\\Number\\DegradedNumberConverter' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php', - 'Ramsey\\Uuid\\Converter\\Number\\GenericNumberConverter' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php', - 'Ramsey\\Uuid\\Converter\\TimeConverterInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/TimeConverterInterface.php', - 'Ramsey\\Uuid\\Converter\\Time\\BigNumberTimeConverter' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php', - 'Ramsey\\Uuid\\Converter\\Time\\DegradedTimeConverter' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php', - 'Ramsey\\Uuid\\Converter\\Time\\GenericTimeConverter' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php', - 'Ramsey\\Uuid\\Converter\\Time\\PhpTimeConverter' => __DIR__ . '/..' . '/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php', - 'Ramsey\\Uuid\\DegradedUuid' => __DIR__ . '/..' . '/ramsey/uuid/src/DegradedUuid.php', - 'Ramsey\\Uuid\\DeprecatedUuidInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/DeprecatedUuidInterface.php', - 'Ramsey\\Uuid\\DeprecatedUuidMethodsTrait' => __DIR__ . '/..' . '/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php', - 'Ramsey\\Uuid\\Exception\\BuilderNotFoundException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/BuilderNotFoundException.php', - 'Ramsey\\Uuid\\Exception\\DateTimeException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/DateTimeException.php', - 'Ramsey\\Uuid\\Exception\\DceSecurityException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/DceSecurityException.php', - 'Ramsey\\Uuid\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/InvalidArgumentException.php', - 'Ramsey\\Uuid\\Exception\\InvalidBytesException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/InvalidBytesException.php', - 'Ramsey\\Uuid\\Exception\\InvalidUuidStringException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/InvalidUuidStringException.php', - 'Ramsey\\Uuid\\Exception\\NameException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/NameException.php', - 'Ramsey\\Uuid\\Exception\\NodeException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/NodeException.php', - 'Ramsey\\Uuid\\Exception\\RandomSourceException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/RandomSourceException.php', - 'Ramsey\\Uuid\\Exception\\TimeSourceException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/TimeSourceException.php', - 'Ramsey\\Uuid\\Exception\\UnableToBuildUuidException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/UnableToBuildUuidException.php', - 'Ramsey\\Uuid\\Exception\\UnsupportedOperationException' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/UnsupportedOperationException.php', - 'Ramsey\\Uuid\\Exception\\UuidExceptionInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Exception/UuidExceptionInterface.php', - 'Ramsey\\Uuid\\FeatureSet' => __DIR__ . '/..' . '/ramsey/uuid/src/FeatureSet.php', - 'Ramsey\\Uuid\\Fields\\FieldsInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Fields/FieldsInterface.php', - 'Ramsey\\Uuid\\Fields\\SerializableFieldsTrait' => __DIR__ . '/..' . '/ramsey/uuid/src/Fields/SerializableFieldsTrait.php', - 'Ramsey\\Uuid\\Generator\\CombGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/CombGenerator.php', - 'Ramsey\\Uuid\\Generator\\DceSecurityGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/DceSecurityGenerator.php', - 'Ramsey\\Uuid\\Generator\\DceSecurityGeneratorInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php', - 'Ramsey\\Uuid\\Generator\\DefaultNameGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/DefaultNameGenerator.php', - 'Ramsey\\Uuid\\Generator\\DefaultTimeGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/DefaultTimeGenerator.php', - 'Ramsey\\Uuid\\Generator\\NameGeneratorFactory' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/NameGeneratorFactory.php', - 'Ramsey\\Uuid\\Generator\\NameGeneratorInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/NameGeneratorInterface.php', - 'Ramsey\\Uuid\\Generator\\PeclUuidNameGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php', - 'Ramsey\\Uuid\\Generator\\PeclUuidRandomGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php', - 'Ramsey\\Uuid\\Generator\\PeclUuidTimeGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php', - 'Ramsey\\Uuid\\Generator\\RandomBytesGenerator' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/RandomBytesGenerator.php', - 'Ramsey\\Uuid\\Generator\\RandomGeneratorFactory' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/RandomGeneratorFactory.php', - 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/RandomGeneratorInterface.php', - 'Ramsey\\Uuid\\Generator\\RandomLibAdapter' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/RandomLibAdapter.php', - 'Ramsey\\Uuid\\Generator\\TimeGeneratorFactory' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/TimeGeneratorFactory.php', - 'Ramsey\\Uuid\\Generator\\TimeGeneratorInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Generator/TimeGeneratorInterface.php', - 'Ramsey\\Uuid\\Guid\\Fields' => __DIR__ . '/..' . '/ramsey/uuid/src/Guid/Fields.php', - 'Ramsey\\Uuid\\Guid\\Guid' => __DIR__ . '/..' . '/ramsey/uuid/src/Guid/Guid.php', - 'Ramsey\\Uuid\\Guid\\GuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Guid/GuidBuilder.php', - 'Ramsey\\Uuid\\Lazy\\LazyUuidFromString' => __DIR__ . '/..' . '/ramsey/uuid/src/Lazy/LazyUuidFromString.php', - 'Ramsey\\Uuid\\Math\\BrickMathCalculator' => __DIR__ . '/..' . '/ramsey/uuid/src/Math/BrickMathCalculator.php', - 'Ramsey\\Uuid\\Math\\CalculatorInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Math/CalculatorInterface.php', - 'Ramsey\\Uuid\\Math\\RoundingMode' => __DIR__ . '/..' . '/ramsey/uuid/src/Math/RoundingMode.php', - 'Ramsey\\Uuid\\Nonstandard\\Fields' => __DIR__ . '/..' . '/ramsey/uuid/src/Nonstandard/Fields.php', - 'Ramsey\\Uuid\\Nonstandard\\Uuid' => __DIR__ . '/..' . '/ramsey/uuid/src/Nonstandard/Uuid.php', - 'Ramsey\\Uuid\\Nonstandard\\UuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Nonstandard/UuidBuilder.php', - 'Ramsey\\Uuid\\Nonstandard\\UuidV6' => __DIR__ . '/..' . '/ramsey/uuid/src/Nonstandard/UuidV6.php', - 'Ramsey\\Uuid\\Provider\\DceSecurityProviderInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php', - 'Ramsey\\Uuid\\Provider\\Dce\\SystemDceSecurityProvider' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php', - 'Ramsey\\Uuid\\Provider\\NodeProviderInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/NodeProviderInterface.php', - 'Ramsey\\Uuid\\Provider\\Node\\FallbackNodeProvider' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\Node\\NodeProviderCollection' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php', - 'Ramsey\\Uuid\\Provider\\Node\\RandomNodeProvider' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\Node\\StaticNodeProvider' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\Node\\SystemNodeProvider' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php', - 'Ramsey\\Uuid\\Provider\\TimeProviderInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/TimeProviderInterface.php', - 'Ramsey\\Uuid\\Provider\\Time\\FixedTimeProvider' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php', - 'Ramsey\\Uuid\\Provider\\Time\\SystemTimeProvider' => __DIR__ . '/..' . '/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php', - 'Ramsey\\Uuid\\Rfc4122\\Fields' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/Fields.php', - 'Ramsey\\Uuid\\Rfc4122\\FieldsInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/FieldsInterface.php', - 'Ramsey\\Uuid\\Rfc4122\\NilTrait' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/NilTrait.php', - 'Ramsey\\Uuid\\Rfc4122\\NilUuid' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/NilUuid.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/UuidBuilder.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/UuidInterface.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV1' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/UuidV1.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV2' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/UuidV2.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV3' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/UuidV3.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV4' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/UuidV4.php', - 'Ramsey\\Uuid\\Rfc4122\\UuidV5' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/UuidV5.php', - 'Ramsey\\Uuid\\Rfc4122\\Validator' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/Validator.php', - 'Ramsey\\Uuid\\Rfc4122\\VariantTrait' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/VariantTrait.php', - 'Ramsey\\Uuid\\Rfc4122\\VersionTrait' => __DIR__ . '/..' . '/ramsey/uuid/src/Rfc4122/VersionTrait.php', - 'Ramsey\\Uuid\\Type\\Decimal' => __DIR__ . '/..' . '/ramsey/uuid/src/Type/Decimal.php', - 'Ramsey\\Uuid\\Type\\Hexadecimal' => __DIR__ . '/..' . '/ramsey/uuid/src/Type/Hexadecimal.php', - 'Ramsey\\Uuid\\Type\\Integer' => __DIR__ . '/..' . '/ramsey/uuid/src/Type/Integer.php', - 'Ramsey\\Uuid\\Type\\NumberInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Type/NumberInterface.php', - 'Ramsey\\Uuid\\Type\\Time' => __DIR__ . '/..' . '/ramsey/uuid/src/Type/Time.php', - 'Ramsey\\Uuid\\Type\\TypeInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Type/TypeInterface.php', - 'Ramsey\\Uuid\\Uuid' => __DIR__ . '/..' . '/ramsey/uuid/src/Uuid.php', - 'Ramsey\\Uuid\\UuidFactory' => __DIR__ . '/..' . '/ramsey/uuid/src/UuidFactory.php', - 'Ramsey\\Uuid\\UuidFactoryInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/UuidFactoryInterface.php', - 'Ramsey\\Uuid\\UuidInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/UuidInterface.php', - 'Ramsey\\Uuid\\Validator\\GenericValidator' => __DIR__ . '/..' . '/ramsey/uuid/src/Validator/GenericValidator.php', - 'Ramsey\\Uuid\\Validator\\ValidatorInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Validator/ValidatorInterface.php', - 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'Safe\\DateTime' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/DateTime.php', - 'Safe\\DateTimeImmutable' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/DateTimeImmutable.php', - 'Safe\\Exceptions\\ApacheException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ApacheException.php', - 'Safe\\Exceptions\\ApcException' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/Exceptions/ApcException.php', - 'Safe\\Exceptions\\ApcuException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ApcuException.php', - 'Safe\\Exceptions\\ArrayException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ArrayException.php', - 'Safe\\Exceptions\\Bzip2Exception' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/Bzip2Exception.php', - 'Safe\\Exceptions\\CalendarException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/CalendarException.php', - 'Safe\\Exceptions\\ClassobjException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ClassobjException.php', - 'Safe\\Exceptions\\ComException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ComException.php', - 'Safe\\Exceptions\\CubridException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/CubridException.php', - 'Safe\\Exceptions\\CurlException' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/Exceptions/CurlException.php', - 'Safe\\Exceptions\\DatetimeException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/DatetimeException.php', - 'Safe\\Exceptions\\DirException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/DirException.php', - 'Safe\\Exceptions\\EioException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/EioException.php', - 'Safe\\Exceptions\\ErrorfuncException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ErrorfuncException.php', - 'Safe\\Exceptions\\ExecException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ExecException.php', - 'Safe\\Exceptions\\FileinfoException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/FileinfoException.php', - 'Safe\\Exceptions\\FilesystemException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/FilesystemException.php', - 'Safe\\Exceptions\\FilterException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/FilterException.php', - 'Safe\\Exceptions\\FpmException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/FpmException.php', - 'Safe\\Exceptions\\FtpException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/FtpException.php', - 'Safe\\Exceptions\\FunchandException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/FunchandException.php', - 'Safe\\Exceptions\\GmpException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/GmpException.php', - 'Safe\\Exceptions\\GnupgException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/GnupgException.php', - 'Safe\\Exceptions\\HashException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/HashException.php', - 'Safe\\Exceptions\\IbaseException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/IbaseException.php', - 'Safe\\Exceptions\\IbmDb2Exception' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/IbmDb2Exception.php', - 'Safe\\Exceptions\\IconvException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/IconvException.php', - 'Safe\\Exceptions\\ImageException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ImageException.php', - 'Safe\\Exceptions\\ImapException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ImapException.php', - 'Safe\\Exceptions\\InfoException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/InfoException.php', - 'Safe\\Exceptions\\IngresiiException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/IngresiiException.php', - 'Safe\\Exceptions\\InotifyException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/InotifyException.php', - 'Safe\\Exceptions\\JsonException' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/Exceptions/JsonException.php', - 'Safe\\Exceptions\\LdapException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/LdapException.php', - 'Safe\\Exceptions\\LibeventException' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/Exceptions/LibeventException.php', - 'Safe\\Exceptions\\LibxmlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/LibxmlException.php', - 'Safe\\Exceptions\\LzfException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/LzfException.php', - 'Safe\\Exceptions\\MailparseException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MailparseException.php', - 'Safe\\Exceptions\\MbstringException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MbstringException.php', - 'Safe\\Exceptions\\MiscException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MiscException.php', - 'Safe\\Exceptions\\MsqlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MsqlException.php', - 'Safe\\Exceptions\\MssqlException' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/Exceptions/MssqlException.php', - 'Safe\\Exceptions\\MysqlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MysqlException.php', - 'Safe\\Exceptions\\MysqliException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MysqliException.php', - 'Safe\\Exceptions\\MysqlndMsException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MysqlndMsException.php', - 'Safe\\Exceptions\\MysqlndQcException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/MysqlndQcException.php', - 'Safe\\Exceptions\\NetworkException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/NetworkException.php', - 'Safe\\Exceptions\\Oci8Exception' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/Oci8Exception.php', - 'Safe\\Exceptions\\OpcacheException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/OpcacheException.php', - 'Safe\\Exceptions\\OpensslException' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/Exceptions/OpensslException.php', - 'Safe\\Exceptions\\OutcontrolException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/OutcontrolException.php', - 'Safe\\Exceptions\\PasswordException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/PasswordException.php', - 'Safe\\Exceptions\\PcntlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/PcntlException.php', - 'Safe\\Exceptions\\PcreException' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/Exceptions/PcreException.php', - 'Safe\\Exceptions\\PdfException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/PdfException.php', - 'Safe\\Exceptions\\PgsqlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/PgsqlException.php', - 'Safe\\Exceptions\\PosixException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/PosixException.php', - 'Safe\\Exceptions\\PsException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/PsException.php', - 'Safe\\Exceptions\\PspellException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/PspellException.php', - 'Safe\\Exceptions\\ReadlineException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ReadlineException.php', - 'Safe\\Exceptions\\RpminfoException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/RpminfoException.php', - 'Safe\\Exceptions\\RrdException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/RrdException.php', - 'Safe\\Exceptions\\SafeExceptionInterface' => __DIR__ . '/..' . '/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php', - 'Safe\\Exceptions\\SemException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SemException.php', - 'Safe\\Exceptions\\SessionException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SessionException.php', - 'Safe\\Exceptions\\ShmopException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ShmopException.php', - 'Safe\\Exceptions\\SimplexmlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SimplexmlException.php', - 'Safe\\Exceptions\\SocketsException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SocketsException.php', - 'Safe\\Exceptions\\SodiumException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SodiumException.php', - 'Safe\\Exceptions\\SolrException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SolrException.php', - 'Safe\\Exceptions\\SplException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SplException.php', - 'Safe\\Exceptions\\SqlsrvException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SqlsrvException.php', - 'Safe\\Exceptions\\SsdeepException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SsdeepException.php', - 'Safe\\Exceptions\\Ssh2Exception' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/Ssh2Exception.php', - 'Safe\\Exceptions\\StatsException' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/Exceptions/StatsException.php', - 'Safe\\Exceptions\\StreamException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/StreamException.php', - 'Safe\\Exceptions\\StringsException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/StringsException.php', - 'Safe\\Exceptions\\SwooleException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/SwooleException.php', - 'Safe\\Exceptions\\UodbcException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/UodbcException.php', - 'Safe\\Exceptions\\UopzException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/UopzException.php', - 'Safe\\Exceptions\\UrlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/UrlException.php', - 'Safe\\Exceptions\\VarException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/VarException.php', - 'Safe\\Exceptions\\XdiffException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/XdiffException.php', - 'Safe\\Exceptions\\XmlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/XmlException.php', - 'Safe\\Exceptions\\XmlrpcException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/XmlrpcException.php', - 'Safe\\Exceptions\\YamlException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/YamlException.php', - 'Safe\\Exceptions\\YazException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/YazException.php', - 'Safe\\Exceptions\\ZipException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ZipException.php', - 'Safe\\Exceptions\\ZlibException' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/Exceptions/ZlibException.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/process/Exception/ExceptionInterface.php', - 'Symfony\\Component\\Process\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/process/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\Process\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/process/Exception/LogicException.php', - 'Symfony\\Component\\Process\\Exception\\ProcessFailedException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessFailedException.php', - 'Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessSignaledException.php', - 'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessTimedOutException.php', - 'Symfony\\Component\\Process\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/process/Exception/RuntimeException.php', - 'Symfony\\Component\\Process\\ExecutableFinder' => __DIR__ . '/..' . '/symfony/process/ExecutableFinder.php', - 'Symfony\\Component\\Process\\InputStream' => __DIR__ . '/..' . '/symfony/process/InputStream.php', - 'Symfony\\Component\\Process\\PhpExecutableFinder' => __DIR__ . '/..' . '/symfony/process/PhpExecutableFinder.php', - 'Symfony\\Component\\Process\\PhpProcess' => __DIR__ . '/..' . '/symfony/process/PhpProcess.php', - 'Symfony\\Component\\Process\\Pipes\\AbstractPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/AbstractPipes.php', - 'Symfony\\Component\\Process\\Pipes\\PipesInterface' => __DIR__ . '/..' . '/symfony/process/Pipes/PipesInterface.php', - 'Symfony\\Component\\Process\\Pipes\\UnixPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/UnixPipes.php', - 'Symfony\\Component\\Process\\Pipes\\WindowsPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/WindowsPipes.php', - 'Symfony\\Component\\Process\\Process' => __DIR__ . '/..' . '/symfony/process/Process.php', - 'Symfony\\Component\\Process\\ProcessUtils' => __DIR__ . '/..' . '/symfony/process/ProcessUtils.php', - 'Symfony\\Polyfill\\Ctype\\Ctype' => __DIR__ . '/..' . '/symfony/polyfill-ctype/Ctype.php', - 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php', - 'Symfony\\Polyfill\\Php80\\PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/PhpToken.php', - 'Symfony\\Polyfill\\Php81\\Php81' => __DIR__ . '/..' . '/symfony/polyfill-php81/Php81.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - 'Webauthn\\AttestationStatement\\AndroidKeyAttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AndroidSafetyNetAttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AppleAttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AppleAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AttestationObject' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationObject.php', - 'Webauthn\\AttestationStatement\\AttestationObjectLoader' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationObjectLoader.php', - 'Webauthn\\AttestationStatement\\AttestationStatement' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatement.php', - 'Webauthn\\AttestationStatement\\AttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\AttestationStatementSupportManager' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatementSupportManager.php', - 'Webauthn\\AttestationStatement\\FidoU2FAttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/FidoU2FAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\NoneAttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/NoneAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\PackedAttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/PackedAttestationStatementSupport.php', - 'Webauthn\\AttestationStatement\\TPMAttestationStatementSupport' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestationStatement/TPMAttestationStatementSupport.php', - 'Webauthn\\AttestedCredentialData' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AttestedCredentialData.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtension' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtension.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtensionsClientInputs' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientInputs.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtensionsClientOutputs' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputs.php', - 'Webauthn\\AuthenticationExtensions\\AuthenticationExtensionsClientOutputsLoader' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputsLoader.php', - 'Webauthn\\AuthenticationExtensions\\ExtensionOutputChecker' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputChecker.php', - 'Webauthn\\AuthenticationExtensions\\ExtensionOutputCheckerHandler' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputCheckerHandler.php', - 'Webauthn\\AuthenticationExtensions\\ExtensionOutputError' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputError.php', - 'Webauthn\\AuthenticatorAssertionResponse' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticatorAssertionResponse.php', - 'Webauthn\\AuthenticatorAssertionResponseValidator' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticatorAssertionResponseValidator.php', - 'Webauthn\\AuthenticatorAttestationResponse' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticatorAttestationResponse.php', - 'Webauthn\\AuthenticatorAttestationResponseValidator' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticatorAttestationResponseValidator.php', - 'Webauthn\\AuthenticatorData' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticatorData.php', - 'Webauthn\\AuthenticatorResponse' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticatorResponse.php', - 'Webauthn\\AuthenticatorSelectionCriteria' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/AuthenticatorSelectionCriteria.php', - 'Webauthn\\CertificateChainChecker\\CertificateChainChecker' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/CertificateChainChecker/CertificateChainChecker.php', - 'Webauthn\\CertificateChainChecker\\OpenSSLCertificateChainChecker' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/CertificateChainChecker/OpenSSLCertificateChainChecker.php', - 'Webauthn\\CertificateToolbox' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/CertificateToolbox.php', - 'Webauthn\\CollectedClientData' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/CollectedClientData.php', - 'Webauthn\\Counter\\CounterChecker' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/Counter/CounterChecker.php', - 'Webauthn\\Counter\\ThrowExceptionIfInvalid' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/Counter/ThrowExceptionIfInvalid.php', - 'Webauthn\\Credential' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/Credential.php', - 'Webauthn\\MetadataService\\AbstractDescriptor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/AbstractDescriptor.php', - 'Webauthn\\MetadataService\\AuthenticatorStatus' => __DIR__ . '/..' . '/web-auth/metadata-service/src/AuthenticatorStatus.php', - 'Webauthn\\MetadataService\\BiometricAccuracyDescriptor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/BiometricAccuracyDescriptor.php', - 'Webauthn\\MetadataService\\BiometricStatusReport' => __DIR__ . '/..' . '/web-auth/metadata-service/src/BiometricStatusReport.php', - 'Webauthn\\MetadataService\\CodeAccuracyDescriptor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/CodeAccuracyDescriptor.php', - 'Webauthn\\MetadataService\\DisplayPNGCharacteristicsDescriptor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/DisplayPNGCharacteristicsDescriptor.php', - 'Webauthn\\MetadataService\\DistantSingleMetadata' => __DIR__ . '/..' . '/web-auth/metadata-service/src/DistantSingleMetadata.php', - 'Webauthn\\MetadataService\\EcdaaTrustAnchor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/EcdaaTrustAnchor.php', - 'Webauthn\\MetadataService\\ExtensionDescriptor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/ExtensionDescriptor.php', - 'Webauthn\\MetadataService\\MetadataService' => __DIR__ . '/..' . '/web-auth/metadata-service/src/MetadataService.php', - 'Webauthn\\MetadataService\\MetadataStatement' => __DIR__ . '/..' . '/web-auth/metadata-service/src/MetadataStatement.php', - 'Webauthn\\MetadataService\\MetadataStatementFetcher' => __DIR__ . '/..' . '/web-auth/metadata-service/src/MetadataStatementFetcher.php', - 'Webauthn\\MetadataService\\MetadataStatementRepository' => __DIR__ . '/..' . '/web-auth/metadata-service/src/MetadataStatementRepository.php', - 'Webauthn\\MetadataService\\MetadataTOCPayload' => __DIR__ . '/..' . '/web-auth/metadata-service/src/MetadataTOCPayload.php', - 'Webauthn\\MetadataService\\MetadataTOCPayloadEntry' => __DIR__ . '/..' . '/web-auth/metadata-service/src/MetadataTOCPayloadEntry.php', - 'Webauthn\\MetadataService\\PatternAccuracyDescriptor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/PatternAccuracyDescriptor.php', - 'Webauthn\\MetadataService\\RgbPaletteEntry' => __DIR__ . '/..' . '/web-auth/metadata-service/src/RgbPaletteEntry.php', - 'Webauthn\\MetadataService\\RogueListEntry' => __DIR__ . '/..' . '/web-auth/metadata-service/src/RogueListEntry.php', - 'Webauthn\\MetadataService\\SingleMetadata' => __DIR__ . '/..' . '/web-auth/metadata-service/src/SingleMetadata.php', - 'Webauthn\\MetadataService\\StatusReport' => __DIR__ . '/..' . '/web-auth/metadata-service/src/StatusReport.php', - 'Webauthn\\MetadataService\\Utils' => __DIR__ . '/..' . '/web-auth/metadata-service/src/Utils.php', - 'Webauthn\\MetadataService\\VerificationMethodANDCombinations' => __DIR__ . '/..' . '/web-auth/metadata-service/src/VerificationMethodANDCombinations.php', - 'Webauthn\\MetadataService\\VerificationMethodDescriptor' => __DIR__ . '/..' . '/web-auth/metadata-service/src/VerificationMethodDescriptor.php', - 'Webauthn\\MetadataService\\Version' => __DIR__ . '/..' . '/web-auth/metadata-service/src/Version.php', - 'Webauthn\\PublicKeyCredential' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredential.php', - 'Webauthn\\PublicKeyCredentialCreationOptions' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialCreationOptions.php', - 'Webauthn\\PublicKeyCredentialDescriptor' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php', - 'Webauthn\\PublicKeyCredentialDescriptorCollection' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptorCollection.php', - 'Webauthn\\PublicKeyCredentialEntity' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialEntity.php', - 'Webauthn\\PublicKeyCredentialLoader' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialLoader.php', - 'Webauthn\\PublicKeyCredentialOptions' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialOptions.php', - 'Webauthn\\PublicKeyCredentialParameters' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialParameters.php', - 'Webauthn\\PublicKeyCredentialRequestOptions' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php', - 'Webauthn\\PublicKeyCredentialRpEntity' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialRpEntity.php', - 'Webauthn\\PublicKeyCredentialSource' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialSource.php', - 'Webauthn\\PublicKeyCredentialSourceRepository' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialSourceRepository.php', - 'Webauthn\\PublicKeyCredentialUserEntity' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/PublicKeyCredentialUserEntity.php', - 'Webauthn\\Server' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/Server.php', - 'Webauthn\\StringStream' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/StringStream.php', - 'Webauthn\\TokenBinding\\IgnoreTokenBindingHandler' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TokenBinding/IgnoreTokenBindingHandler.php', - 'Webauthn\\TokenBinding\\SecTokenBindingHandler' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TokenBinding/SecTokenBindingHandler.php', - 'Webauthn\\TokenBinding\\TokenBinding' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TokenBinding/TokenBinding.php', - 'Webauthn\\TokenBinding\\TokenBindingHandler' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TokenBinding/TokenBindingHandler.php', - 'Webauthn\\TokenBinding\\TokenBindingNotSupportedHandler' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TokenBinding/TokenBindingNotSupportedHandler.php', - 'Webauthn\\TrustPath\\CertificateTrustPath' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TrustPath/CertificateTrustPath.php', - 'Webauthn\\TrustPath\\EcdaaKeyIdTrustPath' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TrustPath/EcdaaKeyIdTrustPath.php', - 'Webauthn\\TrustPath\\EmptyTrustPath' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TrustPath/EmptyTrustPath.php', - 'Webauthn\\TrustPath\\TrustPath' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TrustPath/TrustPath.php', - 'Webauthn\\TrustPath\\TrustPathLoader' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/TrustPath/TrustPathLoader.php', - 'Webauthn\\U2FPublicKey' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/U2FPublicKey.php', - 'Webauthn\\Util\\CoseSignatureFixer' => __DIR__ . '/..' . '/web-auth/webauthn-lib/src/Util/CoseSignatureFixer.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit09e765e3690d5165ed98a315471eec7d::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit09e765e3690d5165ed98a315471eec7d::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit09e765e3690d5165ed98a315471eec7d::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/installed.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/installed.json deleted file mode 100644 index 19e503fa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/installed.json +++ /dev/null @@ -1,2427 +0,0 @@ -{ - "packages": [ - { - "name": "beberlei/assert", - "version": "v3.3.2", - "version_normalized": "3.3.2.0", - "source": { - "type": "git", - "url": "https://github.com/beberlei/assert.git", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/cb70015c04be1baee6f5f5c953703347c0ac1655", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "php": "^7.0 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "*", - "phpstan/phpstan": "*", - "phpunit/phpunit": ">=6.0.0", - "yoast/phpunit-polyfills": "^0.1.0" - }, - "suggest": { - "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" - }, - "time": "2021-12-16T21:41:27+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "lib/Assert/functions.php" - ], - "psr-4": { - "Assert\\": "lib/Assert" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de", - "role": "Lead Developer" - }, - { - "name": "Richard Quadling", - "email": "rquadling@gmail.com", - "role": "Collaborator" - } - ], - "description": "Thin assertion library for input validation in business models.", - "keywords": [ - "assert", - "assertion", - "validation" - ], - "support": { - "issues": "https://github.com/beberlei/assert/issues", - "source": "https://github.com/beberlei/assert/tree/v3.3.2" - }, - "install-path": "../beberlei/assert" - }, - { - "name": "brick/math", - "version": "0.9.3", - "version_normalized": "0.9.3.0", - "source": { - "type": "git", - "url": "https://github.com/brick/math.git", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae", - "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-json": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", - "vimeo/psalm": "4.9.2" - }, - "time": "2021-08-15T20:50:18+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Brick\\Math\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Arbitrary-precision arithmetic library", - "keywords": [ - "Arbitrary-precision", - "BigInteger", - "BigRational", - "arithmetic", - "bigdecimal", - "bignum", - "brick", - "math" - ], - "support": { - "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.9.3" - }, - "funding": [ - { - "url": "https://github.com/BenMorel", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/brick/math", - "type": "tidelift" - } - ], - "install-path": "../brick/math" - }, - { - "name": "fgrosse/phpasn1", - "version": "v2.5.0", - "version_normalized": "2.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/fgrosse/PHPASN1.git", - "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/42060ed45344789fb9f21f9f1864fc47b9e3507b", - "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "~2.0", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "suggest": { - "ext-bcmath": "BCmath is the fallback extension for big integer calculations", - "ext-curl": "For loading OID information from the web if they have not bee defined statically", - "ext-gmp": "GMP is the preferred extension for big integer calculations", - "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available" - }, - "time": "2022-12-19T11:08:26+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "FG\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Friedrich Große", - "email": "friedrich.grosse@gmail.com", - "homepage": "https://github.com/FGrosse", - "role": "Author" - }, - { - "name": "All contributors", - "homepage": "https://github.com/FGrosse/PHPASN1/contributors" - } - ], - "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", - "homepage": "https://github.com/FGrosse/PHPASN1", - "keywords": [ - "DER", - "asn.1", - "asn1", - "ber", - "binary", - "decoding", - "encoding", - "x.509", - "x.690", - "x509", - "x690" - ], - "support": { - "issues": "https://github.com/fgrosse/PHPASN1/issues", - "source": "https://github.com/fgrosse/PHPASN1/tree/v2.5.0" - }, - "abandoned": true, - "install-path": "../fgrosse/phpasn1" - }, - { - "name": "league/uri", - "version": "6.7.2", - "version_normalized": "6.7.2.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/uri.git", - "reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri/zipball/d3b50812dd51f3fbf176344cc2981db03d10fe06", - "reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-json": "*", - "league/uri-interfaces": "^2.3", - "php": "^7.4 || ^8.0", - "psr/http-message": "^1.0" - }, - "conflict": { - "league/uri-schemes": "^1.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^v3.3.2", - "nyholm/psr7": "^1.5", - "php-http/psr7-integration-tests": "^1.1", - "phpstan/phpstan": "^1.2.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0.0", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpunit/phpunit": "^9.5.10", - "psr/http-factory": "^1.0" - }, - "suggest": { - "ext-fileinfo": "Needed to create Data URI from a filepath", - "ext-intl": "Needed to improve host validation", - "league/uri-components": "Needed to easily manipulate URI objects", - "psr/http-factory": "Needed to use the URI factory" - }, - "time": "2022-09-13T19:50:42+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Uri\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ignace Nyamagana Butera", - "email": "nyamsprod@gmail.com", - "homepage": "https://nyamsprod.com" - } - ], - "description": "URI manipulation library", - "homepage": "https://uri.thephpleague.com", - "keywords": [ - "data-uri", - "file-uri", - "ftp", - "hostname", - "http", - "https", - "middleware", - "parse_str", - "parse_url", - "psr-7", - "query-string", - "querystring", - "rfc3986", - "rfc3987", - "rfc6570", - "uri", - "uri-template", - "url", - "ws" - ], - "support": { - "docs": "https://uri.thephpleague.com", - "forum": "https://thephpleague.slack.com", - "issues": "https://github.com/thephpleague/uri/issues", - "source": "https://github.com/thephpleague/uri/tree/6.7.2" - }, - "funding": [ - { - "url": "https://github.com/sponsors/nyamsprod", - "type": "github" - } - ], - "install-path": "../league/uri" - }, - { - "name": "league/uri-interfaces", - "version": "2.3.0", - "version_normalized": "2.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/uri-interfaces.git", - "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", - "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-json": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19", - "phpstan/phpstan": "^0.12.90", - "phpstan/phpstan-phpunit": "^0.12.19", - "phpstan/phpstan-strict-rules": "^0.12.9", - "phpunit/phpunit": "^8.5.15 || ^9.5" - }, - "suggest": { - "ext-intl": "to use the IDNA feature", - "symfony/intl": "to use the IDNA feature via Symfony Polyfill" - }, - "time": "2021-06-28T04:27:21+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Uri\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ignace Nyamagana Butera", - "email": "nyamsprod@gmail.com", - "homepage": "https://nyamsprod.com" - } - ], - "description": "Common interface for URI representation", - "homepage": "http://github.com/thephpleague/uri-interfaces", - "keywords": [ - "rfc3986", - "rfc3987", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/thephpleague/uri-interfaces/issues", - "source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0" - }, - "funding": [ - { - "url": "https://github.com/sponsors/nyamsprod", - "type": "github" - } - ], - "install-path": "../league/uri-interfaces" - }, - { - "name": "nyholm/psr7", - "version": "1.8.0", - "version_normalized": "1.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/Nyholm/psr7.git", - "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/3cb4d163b58589e47b35103e8e5e6a6a475b47be", - "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.2", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0", - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "http-interop/http-factory-tests": "^0.9", - "php-http/message-factory": "^1.0", - "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", - "symfony/error-handler": "^4.4" - }, - "time": "2023-05-02T11:26:24+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Nyholm\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - }, - { - "name": "Martijn van der Ven", - "email": "martijn@vanderven.se" - } - ], - "description": "A fast PHP7 implementation of PSR-7", - "homepage": "https://tnyholm.se", - "keywords": [ - "psr-17", - "psr-7" - ], - "support": { - "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.8.0" - }, - "funding": [ - { - "url": "https://github.com/Zegnat", - "type": "github" - }, - { - "url": "https://github.com/nyholm", - "type": "github" - } - ], - "install-path": "../nyholm/psr7" - }, - { - "name": "nyholm/psr7-server", - "version": "0.4.2", - "version_normalized": "0.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/Nyholm/psr7-server.git", - "reference": "aab2962c970a1776447894e4fd3825a3d69dee61" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/aab2962c970a1776447894e4fd3825a3d69dee61", - "reference": "aab2962c970a1776447894e4fd3825a3d69dee61", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.1", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "nyholm/nsa": "^1.1", - "nyholm/psr7": "^1.3", - "phpunit/phpunit": "^7.0" - }, - "time": "2020-06-06T10:33:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Nyholm\\Psr7Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - }, - { - "name": "Martijn van der Ven", - "email": "martijn@vanderven.se" - } - ], - "description": "Helper classes to handle PSR-7 server requests", - "homepage": "http://tnyholm.se", - "keywords": [ - "psr-17", - "psr-7" - ], - "support": { - "issues": "https://github.com/Nyholm/psr7-server/issues", - "source": "https://github.com/Nyholm/psr7-server/tree/master" - }, - "funding": [ - { - "url": "https://github.com/Zegnat", - "type": "github" - }, - { - "url": "https://github.com/nyholm", - "type": "github" - } - ], - "install-path": "../nyholm/psr7-server" - }, - { - "name": "psr/http-client", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" - }, - "time": "2020-06-29T06:28:15+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client/tree/master" - }, - "install-path": "../psr/http-client" - }, - { - "name": "psr/http-factory", - "version": "1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "time": "2023-04-10T20:10:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" - }, - "install-path": "../psr/http-factory" - }, - { - "name": "psr/http-message", - "version": "1.1", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "time": "2023-04-04T09:50:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" - }, - "install-path": "../psr/http-message" - }, - { - "name": "psr/log", - "version": "1.1.4", - "version_normalized": "1.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2021-05-03T11:20:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, - "install-path": "../psr/log" - }, - { - "name": "ramsey/collection", - "version": "1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/collection.git", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.4 || ^8.0", - "symfony/polyfill-php81": "^1.23" - }, - "require-dev": { - "captainhook/plugin-composer": "^5.3", - "ergebnis/composer-normalize": "^2.28.3", - "fakerphp/faker": "^1.21", - "hamcrest/hamcrest-php": "^2.0", - "jangregor/phpstan-prophecy": "^1.0", - "mockery/mockery": "^1.5", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcsstandards/phpcsutils": "^1.0.0-rc1", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18.4", - "ramsey/coding-standard": "^2.0.3", - "ramsey/conventional-commits": "^1.3", - "vimeo/psalm": "^5.4" - }, - "time": "2022-12-27T19:12:24+00:00", - "type": "library", - "extra": { - "captainhook": { - "force-install": true - }, - "ramsey/conventional-commits": { - "configFile": "conventional-commits.json" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Ramsey\\Collection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "A PHP library for representing and manipulating collections.", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], - "support": { - "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.3.0" - }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ], - "install-path": "../ramsey/collection" - }, - { - "name": "ramsey/uuid", - "version": "4.2.3", - "version_normalized": "4.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "brick/math": "^0.8 || ^0.9", - "ext-json": "*", - "php": "^7.2 || ^8.0", - "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php80": "^1.14" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "moontoast/math": "^1.1", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "time": "2021-09-25T23:10:38+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - }, - "captainhook": { - "force-install": true - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "support": { - "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.2.3" - }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "install-path": "../ramsey/uuid" - }, - { - "name": "spomky-labs/base64url", - "version": "v2.0.4", - "version_normalized": "2.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/Spomky-Labs/base64url.git", - "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Spomky-Labs/base64url/zipball/7752ce931ec285da4ed1f4c5aa27e45e097be61d", - "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.11|^0.12", - "phpstan/phpstan-beberlei-assert": "^0.11|^0.12", - "phpstan/phpstan-deprecation-rules": "^0.11|^0.12", - "phpstan/phpstan-phpunit": "^0.11|^0.12", - "phpstan/phpstan-strict-rules": "^0.11|^0.12" - }, - "time": "2020-11-03T09:10:25+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Base64Url\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky-Labs/base64url/contributors" - } - ], - "description": "Base 64 URL Safe Encoding/Decoding PHP Library", - "homepage": "https://github.com/Spomky-Labs/base64url", - "keywords": [ - "base64", - "rfc4648", - "safe", - "url" - ], - "support": { - "issues": "https://github.com/Spomky-Labs/base64url/issues", - "source": "https://github.com/Spomky-Labs/base64url/tree/v2.0.4" - }, - "funding": [ - { - "url": "https://github.com/Spomky", - "type": "github" - }, - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../spomky-labs/base64url" - }, - { - "name": "spomky-labs/cbor-php", - "version": "v2.1.0", - "version_normalized": "2.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/Spomky-Labs/cbor-php.git", - "reference": "28e2712cfc0b48fae661a48ffc6896d7abe83684" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Spomky-Labs/cbor-php/zipball/28e2712cfc0b48fae661a48ffc6896d7abe83684", - "reference": "28e2712cfc0b48fae661a48ffc6896d7abe83684", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "brick/math": "^0.8.15|^0.9.0", - "ext-mbstring": "*", - "php": ">=7.3" - }, - "require-dev": { - "ekino/phpstan-banned-code": "^1.0", - "ext-json": "*", - "infection/infection": "^0.18|^0.25", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-beberlei-assert": "^1.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.12", - "roave/security-advisories": "dev-latest", - "symplify/easy-coding-standard": "^10.0" - }, - "suggest": { - "ext-bcmath": "GMP or BCMath extensions will drastically improve the library performance. BCMath extension needed to handle the Big Float and Decimal Fraction Tags", - "ext-gmp": "GMP or BCMath extensions will drastically improve the library performance" - }, - "time": "2021-12-13T12:46:26+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "CBOR\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/Spomky-Labs/cbor-php/contributors" - } - ], - "description": "CBOR Encoder/Decoder for PHP", - "keywords": [ - "Concise Binary Object Representation", - "RFC7049", - "cbor" - ], - "support": { - "issues": "https://github.com/Spomky-Labs/cbor-php/issues", - "source": "https://github.com/Spomky-Labs/cbor-php/tree/v2.1.0" - }, - "funding": [ - { - "url": "https://github.com/Spomky", - "type": "github" - }, - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../spomky-labs/cbor-php" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php81" - }, - { - "name": "symfony/process", - "version": "v5.4.28", - "version_normalized": "5.4.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "time": "2023-08-07T10:36:04+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v5.4.28" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/process" - }, - { - "name": "thecodingmachine/safe", - "version": "v1.3.3", - "version_normalized": "1.3.3.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpstan/phpstan": "^0.12", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^0.12" - }, - "time": "2020-10-28T17:51:34+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "deprecated/apc.php", - "deprecated/libevent.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "lib/special_cases.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/ingres-ii.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/msql.php", - "generated/mysql.php", - "generated/mysqli.php", - "generated/mysqlndMs.php", - "generated/mysqlndQc.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/password.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pdf.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/simplexml.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ], - "psr-4": { - "Safe\\": [ - "lib/", - "deprecated/", - "generated/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "support": { - "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v1.3.3" - }, - "install-path": "../thecodingmachine/safe" - }, - { - "name": "web-auth/cose-lib", - "version": "v3.3.12", - "version_normalized": "3.3.12.0", - "source": { - "type": "git", - "url": "https://github.com/web-auth/cose-lib.git", - "reference": "efa6ec2ba4e840bc1316a493973c9916028afeeb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-auth/cose-lib/zipball/efa6ec2ba4e840bc1316a493973c9916028afeeb", - "reference": "efa6ec2ba4e840bc1316a493973c9916028afeeb", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "beberlei/assert": "^3.2", - "ext-json": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "fgrosse/phpasn1": "^2.1", - "php": ">=7.2" - }, - "time": "2021-12-04T12:13:35+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Cose\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-auth/cose/contributors" - } - ], - "description": "CBOR Object Signing and Encryption (COSE) For PHP", - "homepage": "https://github.com/web-auth", - "keywords": [ - "COSE", - "RFC8152" - ], - "support": { - "source": "https://github.com/web-auth/cose-lib/tree/v3.3.12" - }, - "funding": [ - { - "url": "https://github.com/Spomky", - "type": "github" - }, - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-auth/cose-lib" - }, - { - "name": "web-auth/metadata-service", - "version": "v3.3.12", - "version_normalized": "3.3.12.0", - "source": { - "type": "git", - "url": "https://github.com/web-auth/webauthn-metadata-service.git", - "reference": "ef40d2b7b68c4964247d13fab52e2fa8dbd65246" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-auth/webauthn-metadata-service/zipball/ef40d2b7b68c4964247d13fab52e2fa8dbd65246", - "reference": "ef40d2b7b68c4964247d13fab52e2fa8dbd65246", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "beberlei/assert": "^3.2", - "ext-json": "*", - "league/uri": "^6.0", - "php": ">=7.2", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/log": "^1.1" - }, - "suggest": { - "web-token/jwt-key-mgmt": "Mandatory for fetching Metadata Statement from distant sources", - "web-token/jwt-signature-algorithm-ecdsa": "Mandatory for fetching Metadata Statement from distant sources" - }, - "time": "2021-11-21T11:14:31+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Webauthn\\MetadataService\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-auth/metadata-service/contributors" - } - ], - "description": "Metadata Service for FIDO2/Webauthn", - "homepage": "https://github.com/web-auth", - "keywords": [ - "FIDO2", - "fido", - "webauthn" - ], - "support": { - "source": "https://github.com/web-auth/webauthn-metadata-service/tree/v3.3.12" - }, - "funding": [ - { - "url": "https://github.com/Spomky", - "type": "github" - }, - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-auth/metadata-service" - }, - { - "name": "web-auth/webauthn-lib", - "version": "v3.3.12", - "version_normalized": "3.3.12.0", - "source": { - "type": "git", - "url": "https://github.com/web-auth/webauthn-lib.git", - "reference": "5ef9b21c8e9f8a817e524ac93290d08a9f065b33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-auth/webauthn-lib/zipball/5ef9b21c8e9f8a817e524ac93290d08a9f065b33", - "reference": "5ef9b21c8e9f8a817e524ac93290d08a9f065b33", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "beberlei/assert": "^3.2", - "ext-json": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "fgrosse/phpasn1": "^2.1", - "php": ">=7.2", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "psr/log": "^1.1", - "ramsey/uuid": "^3.8|^4.0", - "spomky-labs/base64url": "^2.0", - "spomky-labs/cbor-php": "^1.0|^2.0", - "symfony/process": "^3.0|^4.0|^5.0", - "thecodingmachine/safe": "^1.1", - "web-auth/cose-lib": "self.version", - "web-auth/metadata-service": "self.version" - }, - "suggest": { - "psr/log-implementation": "Recommended to receive logs from the library", - "web-token/jwt-key-mgmt": "Mandatory for the AndroidSafetyNet Attestation Statement support", - "web-token/jwt-signature-algorithm-ecdsa": "Recommended for the AndroidSafetyNet Attestation Statement support", - "web-token/jwt-signature-algorithm-eddsa": "Recommended for the AndroidSafetyNet Attestation Statement support", - "web-token/jwt-signature-algorithm-rsa": "Mandatory for the AndroidSafetyNet Attestation Statement support" - }, - "time": "2022-02-18T07:13:44+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Webauthn\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-auth/webauthn-library/contributors" - } - ], - "description": "FIDO2/Webauthn Support For PHP", - "homepage": "https://github.com/web-auth", - "keywords": [ - "FIDO2", - "fido", - "webauthn" - ], - "support": { - "source": "https://github.com/web-auth/webauthn-lib/tree/v3.3.12" - }, - "funding": [ - { - "url": "https://github.com/Spomky", - "type": "github" - }, - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-auth/webauthn-lib" - }, - { - "name": "web-token/jwt-core", - "version": "v2.2.11", - "version_normalized": "2.2.11.0", - "source": { - "type": "git", - "url": "https://github.com/web-token/jwt-core.git", - "reference": "53beb6f6c1eec4fa93c1c3e5d9e5701e71fa1678" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-token/jwt-core/zipball/53beb6f6c1eec4fa93c1c3e5d9e5701e71fa1678", - "reference": "53beb6f6c1eec4fa93c1c3e5d9e5701e71fa1678", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "brick/math": "^0.8.17|^0.9", - "ext-json": "*", - "ext-mbstring": "*", - "fgrosse/phpasn1": "^2.0", - "php": ">=7.2", - "spomky-labs/base64url": "^1.0|^2.0" - }, - "conflict": { - "spomky-labs/jose": "*" - }, - "time": "2021-03-17T14:55:52+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jose\\Component\\Core\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "description": "Core component of the JWT Framework.", - "homepage": "https://github.com/web-token", - "keywords": [ - "JOSE", - "JWE", - "JWK", - "JWKSet", - "JWS", - "Jot", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "bundle", - "jwa", - "jwt", - "symfony" - ], - "support": { - "source": "https://github.com/web-token/jwt-core/tree/v2.2.11" - }, - "funding": [ - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-token/jwt-core" - }, - { - "name": "web-token/jwt-key-mgmt", - "version": "v2.2.11", - "version_normalized": "2.2.11.0", - "source": { - "type": "git", - "url": "https://github.com/web-token/jwt-key-mgmt.git", - "reference": "0b116379515700d237b4e5de86879078ccb09d8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-token/jwt-key-mgmt/zipball/0b116379515700d237b4e5de86879078ccb09d8a", - "reference": "0b116379515700d237b4e5de86879078ccb09d8a", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-openssl": "*", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "web-token/jwt-core": "^2.0" - }, - "suggest": { - "ext-sodium": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys", - "php-http/httplug": "To enable JKU/X5U support.", - "php-http/message-factory": "To enable JKU/X5U support.", - "web-token/jwt-util-ecc": "To use EC key analyzers." - }, - "time": "2021-03-17T14:55:52+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jose\\Component\\KeyManagement\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-key-mgmt/contributors" - } - ], - "description": "Key Management component of the JWT Framework.", - "homepage": "https://github.com/web-token", - "keywords": [ - "JOSE", - "JWE", - "JWK", - "JWKSet", - "JWS", - "Jot", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "bundle", - "jwa", - "jwt", - "symfony" - ], - "support": { - "source": "https://github.com/web-token/jwt-key-mgmt/tree/v2.2.11" - }, - "funding": [ - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-token/jwt-key-mgmt" - }, - { - "name": "web-token/jwt-signature", - "version": "v2.2.11", - "version_normalized": "2.2.11.0", - "source": { - "type": "git", - "url": "https://github.com/web-token/jwt-signature.git", - "reference": "015b59aaf3b6e8fb9f5bd1338845b7464c7d8103" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-token/jwt-signature/zipball/015b59aaf3b6e8fb9f5bd1338845b7464c7d8103", - "reference": "015b59aaf3b6e8fb9f5bd1338845b7464c7d8103", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "web-token/jwt-core": "^2.1" - }, - "suggest": { - "web-token/jwt-signature-algorithm-ecdsa": "ECDSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-eddsa": "EdDSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-experimental": "Experimental Signature Algorithms", - "web-token/jwt-signature-algorithm-hmac": "HMAC Based Signature Algorithms", - "web-token/jwt-signature-algorithm-none": "None Signature Algorithm", - "web-token/jwt-signature-algorithm-rsa": "RSA Based Signature Algorithms" - }, - "time": "2021-03-01T19:55:28+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-signature/contributors" - } - ], - "description": "Signature component of the JWT Framework.", - "homepage": "https://github.com/web-token", - "keywords": [ - "JOSE", - "JWE", - "JWK", - "JWKSet", - "JWS", - "Jot", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "bundle", - "jwa", - "jwt", - "symfony" - ], - "support": { - "source": "https://github.com/web-token/jwt-signature/tree/v2.2.11" - }, - "funding": [ - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-token/jwt-signature" - }, - { - "name": "web-token/jwt-signature-algorithm-ecdsa", - "version": "v2.2.11", - "version_normalized": "2.2.11.0", - "source": { - "type": "git", - "url": "https://github.com/web-token/jwt-signature-algorithm-ecdsa.git", - "reference": "44cbbb4374c51f1cf48b82ae761efbf24e1a8591" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-ecdsa/zipball/44cbbb4374c51f1cf48b82ae761efbf24e1a8591", - "reference": "44cbbb4374c51f1cf48b82ae761efbf24e1a8591", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-openssl": "*", - "web-token/jwt-signature": "^2.0" - }, - "time": "2021-01-21T19:18:03+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "description": "ECDSA Based Signature Algorithms the JWT Framework.", - "homepage": "https://github.com/web-token", - "keywords": [ - "JOSE", - "JWE", - "JWK", - "JWKSet", - "JWS", - "Jot", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "bundle", - "jwa", - "jwt", - "symfony" - ], - "support": { - "source": "https://github.com/web-token/jwt-signature-algorithm-ecdsa/tree/v2.2.11" - }, - "funding": [ - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-token/jwt-signature-algorithm-ecdsa" - }, - { - "name": "web-token/jwt-signature-algorithm-eddsa", - "version": "v2.2.11", - "version_normalized": "2.2.11.0", - "source": { - "type": "git", - "url": "https://github.com/web-token/jwt-signature-algorithm-eddsa.git", - "reference": "b805ecca593c56e60e0463bd2cacc9b1341910f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-eddsa/zipball/b805ecca593c56e60e0463bd2cacc9b1341910f6", - "reference": "b805ecca593c56e60e0463bd2cacc9b1341910f6", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-sodium": "*", - "web-token/jwt-signature": "^2.1" - }, - "time": "2021-01-21T19:18:03+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "description": "EdDSA Signature Algorithm the JWT Framework.", - "homepage": "https://github.com/web-token", - "keywords": [ - "JOSE", - "JWE", - "JWK", - "JWKSet", - "JWS", - "Jot", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "bundle", - "jwa", - "jwt", - "symfony" - ], - "support": { - "source": "https://github.com/web-token/jwt-signature-algorithm-eddsa/tree/v2.2.11" - }, - "funding": [ - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-token/jwt-signature-algorithm-eddsa" - }, - { - "name": "web-token/jwt-signature-algorithm-rsa", - "version": "v2.2.11", - "version_normalized": "2.2.11.0", - "source": { - "type": "git", - "url": "https://github.com/web-token/jwt-signature-algorithm-rsa.git", - "reference": "513ad90eb5ef1886ff176727a769bda4618141b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-rsa/zipball/513ad90eb5ef1886ff176727a769bda4618141b0", - "reference": "513ad90eb5ef1886ff176727a769bda4618141b0", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "brick/math": "^0.8.17|^0.9", - "ext-openssl": "*", - "web-token/jwt-signature": "^2.1" - }, - "suggest": { - "ext-bcmath": "GMP or BCMath is highly recommended to improve the library performance", - "ext-gmp": "GMP or BCMath is highly recommended to improve the library performance" - }, - "time": "2021-01-21T19:18:03+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "description": "RSA Based Signature Algorithms the JWT Framework.", - "homepage": "https://github.com/web-token", - "keywords": [ - "JOSE", - "JWE", - "JWK", - "JWKSet", - "JWS", - "Jot", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "bundle", - "jwa", - "jwt", - "symfony" - ], - "support": { - "source": "https://github.com/web-token/jwt-signature-algorithm-rsa/tree/v2.2.11" - }, - "funding": [ - { - "url": "https://www.patreon.com/FlorentMorselli", - "type": "patreon" - } - ], - "install-path": "../web-token/jwt-signature-algorithm-rsa" - } - ], - "dev": false, - "dev-package-names": [] -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/installed.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/installed.php deleted file mode 100644 index 0363ba44..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/composer/installed.php +++ /dev/null @@ -1,308 +0,0 @@ - array( - 'name' => '__root__', - 'pretty_version' => '1.3.1', - 'version' => '1.3.1.0', - 'reference' => '7ba904e1020a15ea593301b05ecfc4d74aa61570', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => false, - ), - 'versions' => array( - '__root__' => array( - 'pretty_version' => '1.3.1', - 'version' => '1.3.1.0', - 'reference' => '7ba904e1020a15ea593301b05ecfc4d74aa61570', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'beberlei/assert' => array( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', - 'reference' => 'cb70015c04be1baee6f5f5c953703347c0ac1655', - 'type' => 'library', - 'install_path' => __DIR__ . '/../beberlei/assert', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'brick/math' => array( - 'pretty_version' => '0.9.3', - 'version' => '0.9.3.0', - 'reference' => 'ca57d18f028f84f777b2168cd1911b0dee2343ae', - 'type' => 'library', - 'install_path' => __DIR__ . '/../brick/math', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'fgrosse/phpasn1' => array( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', - 'reference' => '42060ed45344789fb9f21f9f1864fc47b9e3507b', - 'type' => 'library', - 'install_path' => __DIR__ . '/../fgrosse/phpasn1', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'league/uri' => array( - 'pretty_version' => '6.7.2', - 'version' => '6.7.2.0', - 'reference' => 'd3b50812dd51f3fbf176344cc2981db03d10fe06', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/uri', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'league/uri-interfaces' => array( - 'pretty_version' => '2.3.0', - 'version' => '2.3.0.0', - 'reference' => '00e7e2943f76d8cb50c7dfdc2f6dee356e15e383', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/uri-interfaces', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'nyholm/psr7' => array( - 'pretty_version' => '1.8.0', - 'version' => '1.8.0.0', - 'reference' => '3cb4d163b58589e47b35103e8e5e6a6a475b47be', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nyholm/psr7', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'nyholm/psr7-server' => array( - 'pretty_version' => '0.4.2', - 'version' => '0.4.2.0', - 'reference' => 'aab2962c970a1776447894e4fd3825a3d69dee61', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nyholm/psr7-server', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'php-http/message-factory-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-client' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-client', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/http-factory' => array( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-factory', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/http-factory-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-message' => array( - 'pretty_version' => '1.1', - 'version' => '1.1.0.0', - 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-message', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/http-message-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/log' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/log', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'ramsey/collection' => array( - 'pretty_version' => '1.3.0', - 'version' => '1.3.0.0', - 'reference' => 'ad7475d1c9e70b190ecffc58f2d989416af339b4', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ramsey/collection', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'ramsey/uuid' => array( - 'pretty_version' => '4.2.3', - 'version' => '4.2.3.0', - 'reference' => 'fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ramsey/uuid', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'rhumsaa/uuid' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.3', - ), - ), - 'spomky-labs/base64url' => array( - 'pretty_version' => 'v2.0.4', - 'version' => '2.0.4.0', - 'reference' => '7752ce931ec285da4ed1f4c5aa27e45e097be61d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../spomky-labs/base64url', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'spomky-labs/cbor-php' => array( - 'pretty_version' => 'v2.1.0', - 'version' => '2.1.0.0', - 'reference' => '28e2712cfc0b48fae661a48ffc6896d7abe83684', - 'type' => 'library', - 'install_path' => __DIR__ . '/../spomky-labs/cbor-php', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '707403074c8ea6e2edaf8794b0157a0bfa52157a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php81', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/process' => array( - 'pretty_version' => 'v5.4.28', - 'version' => '5.4.28.0', - 'reference' => '45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/process', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'thecodingmachine/safe' => array( - 'pretty_version' => 'v1.3.3', - 'version' => '1.3.3.0', - 'reference' => 'a8ab0876305a4cdaef31b2350fcb9811b5608dbc', - 'type' => 'library', - 'install_path' => __DIR__ . '/../thecodingmachine/safe', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-auth/cose-lib' => array( - 'pretty_version' => 'v3.3.12', - 'version' => '3.3.12.0', - 'reference' => 'efa6ec2ba4e840bc1316a493973c9916028afeeb', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-auth/cose-lib', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-auth/metadata-service' => array( - 'pretty_version' => 'v3.3.12', - 'version' => '3.3.12.0', - 'reference' => 'ef40d2b7b68c4964247d13fab52e2fa8dbd65246', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-auth/metadata-service', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-auth/webauthn-lib' => array( - 'pretty_version' => 'v3.3.12', - 'version' => '3.3.12.0', - 'reference' => '5ef9b21c8e9f8a817e524ac93290d08a9f065b33', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-auth/webauthn-lib', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-token/jwt-core' => array( - 'pretty_version' => 'v2.2.11', - 'version' => '2.2.11.0', - 'reference' => '53beb6f6c1eec4fa93c1c3e5d9e5701e71fa1678', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-token/jwt-core', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-token/jwt-key-mgmt' => array( - 'pretty_version' => 'v2.2.11', - 'version' => '2.2.11.0', - 'reference' => '0b116379515700d237b4e5de86879078ccb09d8a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-token/jwt-key-mgmt', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-token/jwt-signature' => array( - 'pretty_version' => 'v2.2.11', - 'version' => '2.2.11.0', - 'reference' => '015b59aaf3b6e8fb9f5bd1338845b7464c7d8103', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-token/jwt-signature', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-token/jwt-signature-algorithm-ecdsa' => array( - 'pretty_version' => 'v2.2.11', - 'version' => '2.2.11.0', - 'reference' => '44cbbb4374c51f1cf48b82ae761efbf24e1a8591', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-ecdsa', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-token/jwt-signature-algorithm-eddsa' => array( - 'pretty_version' => 'v2.2.11', - 'version' => '2.2.11.0', - 'reference' => 'b805ecca593c56e60e0463bd2cacc9b1341910f6', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-eddsa', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'web-token/jwt-signature-algorithm-rsa' => array( - 'pretty_version' => 'v2.2.11', - 'version' => '2.2.11.0', - 'reference' => '513ad90eb5ef1886ff176727a769bda4618141b0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../web-token/jwt-signature-algorithm-rsa', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/CHANGELOG.md deleted file mode 100644 index e4552acd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/CHANGELOG.md +++ /dev/null @@ -1,61 +0,0 @@ -#### v2.5.0 (2022-12) -* Support PHP 8.2 [#99](https://github.com/fgrosse/PHPASN1/pull/99) -* PHP 8 compatibility fix for DateTime::getLastErrors [#98](https://github.com/fgrosse/PHPASN1/pull/98) -* Support more OIDs [#95](https://github.com/fgrosse/PHPASN1/pull/95) -* FINAL RELEASE. Library is now no longer actively maintained and marked as archived on GitHub - -#### v2.4.0 (2021-12) -* Drop support for PHP 7.0 [#89](https://github.com/fgrosse/PHPASN1/pull/89) - -#### v2.3.1 (2021-12) -* Add `#[\ReturnTypeWillChange]` attributes for PHP 8.1 compatibility [#87](https://github.com/fgrosse/PHPASN1/pull/87) - -#### v2.3.0 (2021-04) -* Allow creating an unsigned CSR and adding the signature later [#82](https://github.com/fgrosse/PHPASN1/pull/82) - -#### v2.2.0 (2020-08) -* support polyfills for bcmath and gmp, and add a composer.json - suggestion for the `phpseclib/bcmath_polyfill` for servers unable - to install PHP the gmp or bcmath extensions. - -#### v.2.1.1 & &v.2.0.2 (2018-12) -* add stricter validation around some structures, highlighed - by wycheproof test suite - -#### v.2.1.0 (2018-03) -* add support for `bcmath` extension (making `gmp` optional) [#68](https://github.com/fgrosse/PHPASN1/pull/68) - -#### v.2.0.1 & v.1.5.3 (2017-12) -* add .gitattributes file to prevent examples and tests to be installed via composer when --prefer-dist was set - -#### v.2.0.0 (2017-08) -* rename `FG\ASN1\Object` to `FG\ASN1\ASNObject` because `Object` is a special class name in the next major PHP release - - when you upgrade you have to adapt all corresponding `use` and `extends` statements as well as type hints and all - usages of `Object::fromBinary(…)`. -* generally drop PHP 5.6 support - -#### v.1.5.2 (2016-10-29) -* allow empty octet strings - -#### v.1.5.1 (2015-10-02) -* add keywords to composer.json (this is a version on its own so the keywords are found on a stable version at packagist.org) - -#### v.1.5.0 (2015-10-30) -* fix a bug that would prevent you from decoding context specific tags on multiple objects [#57](https://github.com/fgrosse/PHPASN1/issues/57) - - `ExplicitlyTaggedObject::__construct` does now accept multiple objects to be tagged with a single tag - - `ExplicitlyTaggedObject::getContent` will now always return an array (even if only one object is tagged) - -#### v.1.4.2 (2015-09-29) -* fix a bug that would prevent you from decoding empty tagged objects [#57](https://github.com/fgrosse/PHPASN1/issues/57) - -#### v.1.4.1 -* improve exception messages and general error handling [#55](https ://github.com/fgrosse/PHPASN1/pull/55) - -#### v.1.4.0 -* **require PHP 5.6** -* support big integers (closes #1 and #37) -* enforce one code style via [styleci.io][9] -* track code coverage via [coveralls.io][10] -* replace obsolete `FG\ASN1\Exception\GeneralException` with `\Exception` -* `Construct` (`Sequence`, `Set`) does now implement `ArrayAccess`, `Countable` and `Iterator` so its easier to use -* add [`TemplateParser`][11] diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/LICENSE deleted file mode 100644 index 1e17eb03..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2015 Friedrich Große - -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/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/README.md deleted file mode 100644 index 5c380dbf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/README.md +++ /dev/null @@ -1,169 +0,0 @@ -PHPASN1 -======= - -[![Build Status](https://github.com/fgrosse/PHPASN1/actions/workflows/phpunit.yml/badge.svg)](https://github.com/fgrosse/PHPASN1/actions/workflows/phpunit.yml) -[![PHP 7 ready](http://php7ready.timesplinter.ch/fgrosse/PHPASN1/badge.svg)](https://travis-ci.org/fgrosse/PHPASN1) -[![Coverage Status](https://coveralls.io/repos/fgrosse/PHPASN1/badge.svg?branch=master&service=github)](https://coveralls.io/github/fgrosse/PHPASN1?branch=master) - -[![Latest Stable Version](https://poser.pugx.org/fgrosse/phpasn1/v/stable.png)](https://packagist.org/packages/fgrosse/phpasn1) -[![Total Downloads](https://poser.pugx.org/fgrosse/phpasn1/downloads.png)](https://packagist.org/packages/fgrosse/phpasn1) -[![Latest Unstable Version](https://poser.pugx.org/fgrosse/phpasn1/v/unstable.png)](https://packagist.org/packages/fgrosse/phpasn1) -[![License](https://poser.pugx.org/fgrosse/phpasn1/license.png)](https://packagist.org/packages/fgrosse/phpasn1) - ---- - -

          Notice: This library is no longer actively maintained!

          -If you are currently using PHPASN1, this might not be an immediate problem for you, since this library was always rather stable. - -However, you are advised to migrate to alternative packages to ensure that your applications remain functional also with newer PHP versions. - ---- - -A PHP Framework that allows you to encode and decode arbitrary [ASN.1][3] structures -using the [ITU-T X.690 Encoding Rules][4]. -This encoding is very frequently used in [X.509 PKI environments][5] or the communication between heterogeneous computer systems. - -The API allows you to encode ASN.1 structures to create binary data such as certificate -signing requests (CSR), X.509 certificates or certificate revocation lists (CRL). -PHPASN1 can also read [BER encoded][6] binary data into separate PHP objects that can be manipulated by the user and reencoded afterwards. - -The **changelog** can now be found at [CHANGELOG.md](CHANGELOG.md). - -## Dependencies - -PHPASN1 requires at least `PHP 7.0` and either the `gmp` or `bcmath` extension. -Support for older PHP versions (i.e. PHP 5.6) was dropped starting with `v2.0`. -If you must use an outdated PHP version consider using [PHPASN v1.5][13]. - -For the loading of object identifier names directly from the web [curl][7] is used. - -## Installation - -The preferred way to install this library is to rely on [Composer][2]: - -```bash -$ composer require fgrosse/phpasn1 -``` - -## Usage - -### Encoding ASN.1 Structures - -PHPASN1 offers you a class for each of the implemented ASN.1 universal types. -The constructors should be pretty self explanatory so you should have no big trouble getting started. -All data will be encoded using [DER encoding][8] - -```php -use FG\ASN1\OID; -use FG\ASN1\Universal\Integer; -use FG\ASN1\Universal\Boolean; -use FG\ASN1\Universal\Enumerated; -use FG\ASN1\Universal\IA5String; -use FG\ASN1\Universal\ObjectIdentifier; -use FG\ASN1\Universal\PrintableString; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\Set; -use FG\ASN1\Universal\NullObject; - -$integer = new Integer(123456); -$boolean = new Boolean(true); -$enum = new Enumerated(1); -$ia5String = new IA5String('Hello world'); - -$asnNull = new NullObject(); -$objectIdentifier1 = new ObjectIdentifier('1.2.250.1.16.9'); -$objectIdentifier2 = new ObjectIdentifier(OID::RSA_ENCRYPTION); -$printableString = new PrintableString('Foo bar'); - -$sequence = new Sequence($integer, $boolean, $enum, $ia5String); -$set = new Set($sequence, $asnNull, $objectIdentifier1, $objectIdentifier2, $printableString); - -$myBinary = $sequence->getBinary(); -$myBinary .= $set->getBinary(); - -echo base64_encode($myBinary); -``` - - -### Decoding binary data - -Decoding BER encoded binary data is just as easy as encoding it: - -```php -use FG\ASN1\ASNObject; - -$base64String = ... -$binaryData = base64_decode($base64String); -$asnObject = ASNObject::fromBinary($binaryData); - - -// do stuff -``` - -If you already know exactly how your expected data should look like you can use the `FG\ASN1\TemplateParser`: - -```php -use FG\ASN1\TemplateParser; - -// first define your template -$template = [ - Identifier::SEQUENCE => [ - Identifier::SET => [ - Identifier::OBJECT_IDENTIFIER, - Identifier::SEQUENCE => [ - Identifier::INTEGER, - Identifier::BITSTRING, - ] - ] - ] -]; - -// if your binary data is not matching the template you provided this will throw an `\Exception`: -$parser = new TemplateParser(); -$object = $parser->parseBinary($data, $template); - -// there is also a convenience function if you parse binary data from base64: -$object = $parser->parseBase64($data, $template); -``` - -You can use this function to make sure your data has exactly the format you are expecting. - -### Navigating decoded data - -All constructed classes (i.e. `Sequence` and `Set`) can be navigated by array access or using an iterator. -You can find examples -[here](https://github.com/fgrosse/PHPASN1/blob/f6442cadda9d36f3518c737e32f28300a588b777/tests/ASN1/Universal/SequenceTest.php#L148-148), -[here](https://github.com/fgrosse/PHPASN1/blob/f6442cadda9d36f3518c737e32f28300a588b777/tests/ASN1/Universal/SequenceTest.php#L121) and -[here](https://github.com/fgrosse/PHPASN1/blob/f6442cadda9d36f3518c737e32f28300a588b777/tests/ASN1/TemplateParserTest.php#L45). - - -### Give me more examples! - -To see some example usage of the API classes or some generated output check out the [examples](https://github.com/fgrosse/PHPASN1/tree/master/examples). - - -### How do I contribute? - -This project is no longer maintained and thus does not accept any new contributions. - -### Thanks - -To [all contributors][1] so far! - -## License - -This library is distributed under the [MIT License](LICENSE). - -[1]: https://github.com/fgrosse/PHPASN1/graphs/contributors -[2]: https://getcomposer.org/ -[3]: http://www.itu.int/ITU-T/asn1/ -[4]: http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=x.690 -[5]: http://en.wikipedia.org/wiki/X.509 -[6]: http://en.wikipedia.org/wiki/X.690#BER_encoding -[7]: http://php.net/manual/en/book.curl.php -[8]: http://en.wikipedia.org/wiki/X.690#DER_encoding -[9]: https://styleci.io -[10]: https://coveralls.io/github/fgrosse/PHPASN1 -[11]: https://github.com/fgrosse/PHPASN1/blob/master/tests/ASN1/TemplateParserTest.php#L16 -[12]: https://groups.google.com/d/forum/phpasn1 -[13]: https://packagist.org/packages/fgrosse/phpasn1#1.5.2 diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/composer.json deleted file mode 100644 index 130dc8f4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "fgrosse/phpasn1", - "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", - "type": "library", - "homepage": "https://github.com/FGrosse/PHPASN1", - "license": "MIT", - "authors": [ - { - "name": "Friedrich Große", - "email": "friedrich.grosse@gmail.com", - "homepage": "https://github.com/FGrosse", - "role": "Author" - }, - { - "name": "All contributors", - "homepage": "https://github.com/FGrosse/PHPASN1/contributors" - } - ], - "keywords": [ "x690", "x.690", "x.509", "x509", "asn1", "asn.1", "ber", "der", "binary", "encoding", "decoding" ], - - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "php-coveralls/php-coveralls": "~2.0" - }, - "suggest": { - "ext-gmp": "GMP is the preferred extension for big integer calculations", - "ext-bcmath": "BCmath is the fallback extension for big integer calculations", - "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available", - "ext-curl": "For loading OID information from the web if they have not bee defined statically" - }, - "autoload": { - "psr-4": { - "FG\\": "lib/" - } - }, - "autoload-dev": { - "psr-4": { - "FG\\Test\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php deleted file mode 100644 index 3b7f1621..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/ASNObject.php +++ /dev/null @@ -1,355 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use FG\ASN1\Exception\ParserException; -use FG\ASN1\Universal\BitString; -use FG\ASN1\Universal\Boolean; -use FG\ASN1\Universal\Enumerated; -use FG\ASN1\Universal\GeneralizedTime; -use FG\ASN1\Universal\Integer; -use FG\ASN1\Universal\NullObject; -use FG\ASN1\Universal\ObjectIdentifier; -use FG\ASN1\Universal\RelativeObjectIdentifier; -use FG\ASN1\Universal\OctetString; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\Set; -use FG\ASN1\Universal\UTCTime; -use FG\ASN1\Universal\IA5String; -use FG\ASN1\Universal\PrintableString; -use FG\ASN1\Universal\NumericString; -use FG\ASN1\Universal\UTF8String; -use FG\ASN1\Universal\UniversalString; -use FG\ASN1\Universal\CharacterString; -use FG\ASN1\Universal\GeneralString; -use FG\ASN1\Universal\VisibleString; -use FG\ASN1\Universal\GraphicString; -use FG\ASN1\Universal\BMPString; -use FG\ASN1\Universal\T61String; -use FG\ASN1\Universal\ObjectDescriptor; -use FG\Utility\BigInteger; -use LogicException; - -/** - * Class ASNObject is the base class for all concrete ASN.1 objects. - */ -abstract class ASNObject implements Parsable -{ - private $contentLength; - private $nrOfLengthOctets; - - /** - * Must return the number of octets of the content part. - * - * @return int - */ - abstract protected function calculateContentLength(); - - /** - * Encode the object using DER encoding. - * - * @see http://en.wikipedia.org/wiki/X.690#DER_encoding - * - * @return string the binary representation of an objects value - */ - abstract protected function getEncodedValue(); - - /** - * Return the content of this object in a non encoded form. - * This can be used to print the value in human readable form. - * - * @return mixed - */ - abstract public function getContent(); - - /** - * Return the object type octet. - * This should use the class constants of Identifier. - * - * @see Identifier - * - * @return int - */ - abstract public function getType(); - - /** - * Returns all identifier octets. If an inheriting class models a tag with - * the long form identifier format, it MUST reimplement this method to - * return all octets of the identifier. - * - * @throws LogicException If the identifier format is long form - * - * @return string Identifier as a set of octets - */ - public function getIdentifier() - { - $firstOctet = $this->getType(); - - if (Identifier::isLongForm($firstOctet)) { - throw new LogicException(sprintf('Identifier of %s uses the long form and must therefor override "ASNObject::getIdentifier()".', get_class($this))); - } - - return chr($firstOctet); - } - - /** - * Encode this object using DER encoding. - * - * @return string the full binary representation of the complete object - */ - public function getBinary() - { - $result = $this->getIdentifier(); - $result .= $this->createLengthPart(); - $result .= $this->getEncodedValue(); - - return $result; - } - - private function createLengthPart() - { - $contentLength = $this->getContentLength(); - $nrOfLengthOctets = $this->getNumberOfLengthOctets($contentLength); - - if ($nrOfLengthOctets == 1) { - return chr($contentLength); - } else { - // the first length octet determines the number subsequent length octets - $lengthOctets = chr(0x80 | ($nrOfLengthOctets - 1)); - for ($shiftLength = 8 * ($nrOfLengthOctets - 2); $shiftLength >= 0; $shiftLength -= 8) { - $lengthOctets .= chr($contentLength >> $shiftLength); - } - - return $lengthOctets; - } - } - - protected function getNumberOfLengthOctets($contentLength = null) - { - if (!isset($this->nrOfLengthOctets)) { - if ($contentLength == null) { - $contentLength = $this->getContentLength(); - } - - $this->nrOfLengthOctets = 1; - if ($contentLength > 127) { - do { // long form - $this->nrOfLengthOctets++; - $contentLength = $contentLength >> 8; - } while ($contentLength > 0); - } - } - - return $this->nrOfLengthOctets; - } - - protected function getContentLength() - { - if (!isset($this->contentLength)) { - $this->contentLength = $this->calculateContentLength(); - } - - return $this->contentLength; - } - - protected function setContentLength($newContentLength) - { - $this->contentLength = $newContentLength; - $this->getNumberOfLengthOctets($newContentLength); - } - - /** - * Returns the length of the whole object (including the identifier and length octets). - */ - public function getObjectLength() - { - $nrOfIdentifierOctets = strlen($this->getIdentifier()); - $contentLength = $this->getContentLength(); - $nrOfLengthOctets = $this->getNumberOfLengthOctets($contentLength); - - return $nrOfIdentifierOctets + $nrOfLengthOctets + $contentLength; - } - - public function __toString() - { - return $this->getContent(); - } - - /** - * Returns the name of the ASN.1 Type of this object. - * - * @see Identifier::getName() - */ - public function getTypeName() - { - return Identifier::getName($this->getType()); - } - - /** - * @param string $binaryData - * @param int $offsetIndex - * - * @throws ParserException - * - * @return \FG\ASN1\ASNObject - */ - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - if (strlen($binaryData) <= $offsetIndex) { - throw new ParserException('Can not parse binary from data: Offset index larger than input size', $offsetIndex); - } - - $identifierOctet = ord($binaryData[$offsetIndex]); - if (Identifier::isContextSpecificClass($identifierOctet) && Identifier::isConstructed($identifierOctet)) { - return ExplicitlyTaggedObject::fromBinary($binaryData, $offsetIndex); - } - - switch ($identifierOctet) { - case Identifier::BITSTRING: - return BitString::fromBinary($binaryData, $offsetIndex); - case Identifier::BOOLEAN: - return Boolean::fromBinary($binaryData, $offsetIndex); - case Identifier::ENUMERATED: - return Enumerated::fromBinary($binaryData, $offsetIndex); - case Identifier::INTEGER: - return Integer::fromBinary($binaryData, $offsetIndex); - case Identifier::NULL: - return NullObject::fromBinary($binaryData, $offsetIndex); - case Identifier::OBJECT_IDENTIFIER: - return ObjectIdentifier::fromBinary($binaryData, $offsetIndex); - case Identifier::RELATIVE_OID: - return RelativeObjectIdentifier::fromBinary($binaryData, $offsetIndex); - case Identifier::OCTETSTRING: - return OctetString::fromBinary($binaryData, $offsetIndex); - case Identifier::SEQUENCE: - return Sequence::fromBinary($binaryData, $offsetIndex); - case Identifier::SET: - return Set::fromBinary($binaryData, $offsetIndex); - case Identifier::UTC_TIME: - return UTCTime::fromBinary($binaryData, $offsetIndex); - case Identifier::GENERALIZED_TIME: - return GeneralizedTime::fromBinary($binaryData, $offsetIndex); - case Identifier::IA5_STRING: - return IA5String::fromBinary($binaryData, $offsetIndex); - case Identifier::PRINTABLE_STRING: - return PrintableString::fromBinary($binaryData, $offsetIndex); - case Identifier::NUMERIC_STRING: - return NumericString::fromBinary($binaryData, $offsetIndex); - case Identifier::UTF8_STRING: - return UTF8String::fromBinary($binaryData, $offsetIndex); - case Identifier::UNIVERSAL_STRING: - return UniversalString::fromBinary($binaryData, $offsetIndex); - case Identifier::CHARACTER_STRING: - return CharacterString::fromBinary($binaryData, $offsetIndex); - case Identifier::GENERAL_STRING: - return GeneralString::fromBinary($binaryData, $offsetIndex); - case Identifier::VISIBLE_STRING: - return VisibleString::fromBinary($binaryData, $offsetIndex); - case Identifier::GRAPHIC_STRING: - return GraphicString::fromBinary($binaryData, $offsetIndex); - case Identifier::BMP_STRING: - return BMPString::fromBinary($binaryData, $offsetIndex); - case Identifier::T61_STRING: - return T61String::fromBinary($binaryData, $offsetIndex); - case Identifier::OBJECT_DESCRIPTOR: - return ObjectDescriptor::fromBinary($binaryData, $offsetIndex); - default: - // At this point the identifier may be >1 byte. - if (Identifier::isConstructed($identifierOctet)) { - return new UnknownConstructedObject($binaryData, $offsetIndex); - } else { - $identifier = self::parseBinaryIdentifier($binaryData, $offsetIndex); - $lengthOfUnknownObject = self::parseContentLength($binaryData, $offsetIndex); - $offsetIndex += $lengthOfUnknownObject; - - return new UnknownObject($identifier, $lengthOfUnknownObject); - } - } - } - - protected static function parseIdentifier($identifierOctet, $expectedIdentifier, $offsetForExceptionHandling) - { - if (is_string($identifierOctet) || is_numeric($identifierOctet) == false) { - $identifierOctet = ord($identifierOctet); - } - - if ($identifierOctet != $expectedIdentifier) { - $message = 'Can not create an '.Identifier::getName($expectedIdentifier).' from an '.Identifier::getName($identifierOctet); - throw new ParserException($message, $offsetForExceptionHandling); - } - } - - protected static function parseBinaryIdentifier($binaryData, &$offsetIndex) - { - if (strlen($binaryData) <= $offsetIndex) { - throw new ParserException('Can not parse identifier from data: Offset index larger than input size', $offsetIndex); - } - - $identifier = $binaryData[$offsetIndex++]; - - if (Identifier::isLongForm(ord($identifier)) == false) { - return $identifier; - } - - while (true) { - if (strlen($binaryData) <= $offsetIndex) { - throw new ParserException('Can not parse identifier (long form) from data: Offset index larger than input size', $offsetIndex); - } - $nextOctet = $binaryData[$offsetIndex++]; - $identifier .= $nextOctet; - - if ((ord($nextOctet) & 0x80) === 0) { - // the most significant bit is 0 to we have reached the end of the identifier - break; - } - } - - return $identifier; - } - - protected static function parseContentLength(&$binaryData, &$offsetIndex, $minimumLength = 0) - { - if (strlen($binaryData) <= $offsetIndex) { - throw new ParserException('Can not parse content length from data: Offset index larger than input size', $offsetIndex); - } - - $contentLength = ord($binaryData[$offsetIndex++]); - if (($contentLength & 0x80) != 0) { - // bit 8 is set -> this is the long form - $nrOfLengthOctets = $contentLength & 0x7F; - $contentLength = BigInteger::create(0x00); - for ($i = 0; $i < $nrOfLengthOctets; $i++) { - if (strlen($binaryData) <= $offsetIndex) { - throw new ParserException('Can not parse content length (long form) from data: Offset index larger than input size', $offsetIndex); - } - $contentLength = $contentLength->shiftLeft(8)->add(ord($binaryData[$offsetIndex++])); - } - - if ($contentLength->compare(PHP_INT_MAX) > 0) { - throw new ParserException("Can not parse content length from data: length > maximum integer", $offsetIndex); - } - - $contentLength = $contentLength->toInteger(); - } - - if ($contentLength < $minimumLength) { - throw new ParserException('A '.get_called_class()." should have a content length of at least {$minimumLength}. Extracted length was {$contentLength}", $offsetIndex); - } - - $lenDataRemaining = strlen($binaryData) - $offsetIndex; - - if ($lenDataRemaining < $contentLength) { - throw new ParserException("Content length {$contentLength} exceeds remaining data length {$lenDataRemaining}", $offsetIndex); - } - - return $contentLength; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php deleted file mode 100644 index 7e0d7ddb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use Exception; - -abstract class AbstractString extends ASNObject implements Parsable -{ - /** @var string */ - protected $value; - private $checkStringForIllegalChars = true; - private $allowedCharacters = []; - - /** - * The abstract base class for ASN.1 classes which represent some string of character. - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - } - - public function getContent() - { - return $this->value; - } - - protected function allowCharacter($character) - { - $this->allowedCharacters[] = $character; - } - - protected function allowCharacters(...$characters) - { - foreach ($characters as $character) { - $this->allowedCharacters[] = $character; - } - } - - protected function allowNumbers() - { - foreach (range('0', '9') as $char) { - $this->allowedCharacters[] = (string) $char; - } - } - - protected function allowAllLetters() - { - $this->allowSmallLetters(); - $this->allowCapitalLetters(); - } - - protected function allowSmallLetters() - { - foreach (range('a', 'z') as $char) { - $this->allowedCharacters[] = $char; - } - } - - protected function allowCapitalLetters() - { - foreach (range('A', 'Z') as $char) { - $this->allowedCharacters[] = $char; - } - } - - protected function allowSpaces() - { - $this->allowedCharacters[] = ' '; - } - - protected function allowAll() - { - $this->checkStringForIllegalChars = false; - } - - protected function calculateContentLength() - { - return strlen($this->value); - } - - protected function getEncodedValue() - { - if ($this->checkStringForIllegalChars) { - $this->checkString(); - } - - return $this->value; - } - - protected function checkString() - { - $stringLength = $this->getContentLength(); - for ($i = 0; $i < $stringLength; $i++) { - if (in_array($this->value[$i], $this->allowedCharacters) == false) { - $typeName = Identifier::getName($this->getType()); - throw new Exception("Could not create a {$typeName} from the character sequence '{$this->value}'."); - } - } - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - $parsedObject = new static(''); - - self::parseIdentifier($binaryData[$offsetIndex], $parsedObject->getType(), $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - $string = substr($binaryData, $offsetIndex, $contentLength); - $offsetIndex += $contentLength; - - $parsedObject->value = $string; - $parsedObject->setContentLength($contentLength); - return $parsedObject; - } - - public static function isValid($string) - { - $testObject = new static($string); - try { - $testObject->checkString(); - - return true; - } catch (Exception $exception) { - return false; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php deleted file mode 100644 index 8e721ae8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/AbstractTime.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use DateInterval; -use DateTime; -use DateTimeZone; -use Exception; - -abstract class AbstractTime extends ASNObject -{ - /** @var DateTime */ - protected $value; - - public function __construct($dateTime = null, $dateTimeZone = 'UTC') - { - if ($dateTime == null || is_string($dateTime)) { - $timeZone = new DateTimeZone($dateTimeZone); - $dateTimeObject = new DateTime($dateTime, $timeZone); - if ($dateTimeObject == false) { - $errorMessage = $this->getLastDateTimeErrors(); - $className = Identifier::getName($this->getType()); - throw new Exception(sprintf("Could not create %s from date time string '%s': %s", $className, $dateTime, $errorMessage)); - } - $dateTime = $dateTimeObject; - } elseif (!$dateTime instanceof DateTime) { - throw new Exception('Invalid first argument for some instance of AbstractTime constructor'); - } - - $this->value = $dateTime; - } - - public function getContent() - { - return $this->value; - } - - protected function getLastDateTimeErrors() - { - $messages = ''; - $lastErrors = DateTime::getLastErrors() ?: ['errors' => []]; - foreach ($lastErrors['errors'] as $errorMessage) { - $messages .= "{$errorMessage}, "; - } - - return substr($messages, 0, -2); - } - - public function __toString() - { - return $this->value->format("Y-m-d\tH:i:s"); - } - - protected static function extractTimeZoneData(&$binaryData, &$offsetIndex, DateTime $dateTime) - { - $sign = $binaryData[$offsetIndex++]; - $timeOffsetHours = intval(substr($binaryData, $offsetIndex, 2)); - $timeOffsetMinutes = intval(substr($binaryData, $offsetIndex + 2, 2)); - $offsetIndex += 4; - - $interval = new DateInterval("PT{$timeOffsetHours}H{$timeOffsetMinutes}M"); - if ($sign == '+') { - $dateTime->sub($interval); - } else { - $dateTime->add($interval); - } - - return $dateTime; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Base128.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Base128.php deleted file mode 100644 index 119ee7b9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Base128.php +++ /dev/null @@ -1,63 +0,0 @@ -modulus(0x80)->toInteger()); - - $value = $value->shiftRight(7); - while ($value->compare(0) > 0) { - $octets .= chr(0x80 | $value->modulus(0x80)->toInteger()); - $value = $value->shiftRight(7); - } - - return strrev($octets); - } - - /** - * @param string $octets - * - * @throws InvalidArgumentException if the given octets represent a malformed base-128 value or the decoded value would exceed the the maximum integer length - * - * @return int - */ - public static function decode($octets) - { - $bitsPerOctet = 7; - $value = BigInteger::create(0); - $i = 0; - - while (true) { - if (!isset($octets[$i])) { - throw new InvalidArgumentException(sprintf('Malformed base-128 encoded value (0x%s).', strtoupper(bin2hex($octets)) ?: '0')); - } - - $octet = ord($octets[$i++]); - - $l1 = $value->shiftLeft($bitsPerOctet); - $r1 = $octet & 0x7f; - $value = $l1->add($r1); - - if (0 === ($octet & 0x80)) { - break; - } - } - - return (string)$value; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php deleted file mode 100644 index 3f4027c2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Composite; - -use FG\ASN1\ASNObject; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\ObjectIdentifier; - -class AttributeTypeAndValue extends Sequence -{ - /** - * @param ObjectIdentifier|string $objIdentifier - * @param \FG\ASN1\ASNObject $value - */ - public function __construct($objIdentifier, ASNObject $value) - { - if ($objIdentifier instanceof ObjectIdentifier == false) { - $objIdentifier = new ObjectIdentifier($objIdentifier); - } - parent::__construct($objIdentifier, $value); - } - - public function __toString() - { - return $this->children[0].': '.$this->children[1]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php deleted file mode 100644 index e95e7acd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Composite; - -use FG\ASN1\Universal\PrintableString; -use FG\ASN1\Universal\IA5String; -use FG\ASN1\Universal\UTF8String; - -class RDNString extends RelativeDistinguishedName -{ - /** - * @param string|\FG\ASN1\Universal\ObjectIdentifier $objectIdentifierString - * @param string|\FG\ASN1\ASNObject $value - */ - public function __construct($objectIdentifierString, $value) - { - if (PrintableString::isValid($value)) { - $value = new PrintableString($value); - } else { - if (IA5String::isValid($value)) { - $value = new IA5String($value); - } else { - $value = new UTF8String($value); - } - } - - parent::__construct($objectIdentifierString, $value); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php deleted file mode 100644 index 4185f41a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Composite; - -use FG\ASN1\Exception\NotImplementedException; -use FG\ASN1\ASNObject; -use FG\ASN1\Universal\Set; - -class RelativeDistinguishedName extends Set -{ - /** - * @param string|\FG\ASN1\Universal\ObjectIdentifier $objIdentifierString - * @param \FG\ASN1\ASNObject $value - */ - public function __construct($objIdentifierString, ASNObject $value) - { - // TODO: This does only support one element in the RelativeDistinguishedName Set but it it is defined as follows: - // RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue - parent::__construct(new AttributeTypeAndValue($objIdentifierString, $value)); - } - - public function getContent() - { - /** @var \FG\ASN1\ASNObject $firstObject */ - $firstObject = $this->children[0]; - return $firstObject->__toString(); - } - - /** - * At the current version this code can not work since the implementation of Construct requires - * the class to support a constructor without arguments. - * - * @deprecated this function is not yet implemented! Feel free to submit a pull request on github - * @param string $binaryData - * @param int $offsetIndex - * @throws NotImplementedException - */ - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - throw new NotImplementedException(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Construct.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Construct.php deleted file mode 100644 index cedf422e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Construct.php +++ /dev/null @@ -1,202 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use ArrayAccess; -use ArrayIterator; -use Countable; -use FG\ASN1\Exception\ParserException; -use Iterator; - -abstract class Construct extends ASNObject implements Countable, ArrayAccess, Iterator, Parsable -{ - /** @var \FG\ASN1\ASNObject[] */ - protected $children; - private $iteratorPosition; - - /** - * @param \FG\ASN1\ASNObject[] $children the variadic type hint is commented due to https://github.com/facebook/hhvm/issues/4858 - */ - public function __construct(/* HH_FIXME[4858]: variadic + strict */ ...$children) - { - $this->children = $children; - $this->iteratorPosition = 0; - } - - public function getContent() - { - return $this->children; - } - - #[\ReturnTypeWillChange] - public function rewind() - { - $this->iteratorPosition = 0; - } - - #[\ReturnTypeWillChange] - public function current() - { - return $this->children[$this->iteratorPosition]; - } - - #[\ReturnTypeWillChange] - public function key() - { - return $this->iteratorPosition; - } - - #[\ReturnTypeWillChange] - public function next() - { - $this->iteratorPosition++; - } - - #[\ReturnTypeWillChange] - public function valid() - { - return isset($this->children[$this->iteratorPosition]); - } - - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return array_key_exists($offset, $this->children); - } - - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->children[$offset]; - } - - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if ($offset === null) { - $offset = count($this->children); - } - - $this->children[$offset] = $value; - } - - #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - unset($this->children[$offset]); - } - - protected function calculateContentLength() - { - $length = 0; - foreach ($this->children as $component) { - $length += $component->getObjectLength(); - } - - return $length; - } - - protected function getEncodedValue() - { - $result = ''; - foreach ($this->children as $component) { - $result .= $component->getBinary(); - } - - return $result; - } - - public function addChild(ASNObject $child) - { - $this->children[] = $child; - } - - public function addChildren(array $children) - { - foreach ($children as $child) { - $this->addChild($child); - } - } - - public function __toString() - { - $nrOfChildren = $this->getNumberOfChildren(); - $childString = $nrOfChildren == 1 ? 'child' : 'children'; - - return "[{$nrOfChildren} {$childString}]"; - } - - public function getNumberOfChildren() - { - return count($this->children); - } - - /** - * @return \FG\ASN1\ASNObject[] - */ - public function getChildren() - { - return $this->children; - } - - /** - * @return \FG\ASN1\ASNObject - */ - public function getFirstChild() - { - return $this->children[0]; - } - - /** - * @param string $binaryData - * @param int $offsetIndex - * - * @throws Exception\ParserException - * - * @return Construct|static - */ - #[\ReturnTypeWillChange] - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - $parsedObject = new static(); - self::parseIdentifier($binaryData[$offsetIndex], $parsedObject->getType(), $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - $startIndex = $offsetIndex; - - $children = []; - $octetsToRead = $contentLength; - while ($octetsToRead > 0) { - $newChild = ASNObject::fromBinary($binaryData, $offsetIndex); - $octetsToRead -= $newChild->getObjectLength(); - $children[] = $newChild; - } - - if ($octetsToRead !== 0) { - throw new ParserException("Sequence length incorrect", $startIndex); - } - - $parsedObject->addChildren($children); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } - - #[\ReturnTypeWillChange] - public function count($mode = COUNT_NORMAL) - { - return count($this->children, $mode); - } - - public function getIterator() - { - return new ArrayIterator($this->children); - } -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php deleted file mode 100644 index c9f8e82e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Exception; - -class NotImplementedException extends \Exception -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php deleted file mode 100644 index 4bda4e87..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Exception; - -class ParserException extends \Exception -{ - private $errorMessage; - private $offset; - - public function __construct($errorMessage, $offset) - { - $this->errorMessage = $errorMessage; - $this->offset = $offset; - parent::__construct("ASN.1 Parser Exception at offset {$this->offset}: {$this->errorMessage}"); - } - - public function getOffset() - { - return $this->offset; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php deleted file mode 100644 index b947a959..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/ExplicitlyTaggedObject.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use FG\ASN1\Exception\ParserException; - -/** - * Class ExplicitlyTaggedObject decorate an inner object with an additional tag that gives information about - * its context specific meaning. - * - * Explanation taken from A Layman's Guide to a Subset of ASN.1, BER, and DER: - * >>> An RSA Laboratories Technical Note - * >>> Burton S. Kaliski Jr. - * >>> Revised November 1, 1993 - * - * [...] - * Explicitly tagged types are derived from other types by adding an outer tag to the underlying type. - * In effect, explicitly tagged types are structured types consisting of one component, the underlying type. - * Explicit tagging is denoted by the ASN.1 keywords [class number] EXPLICIT (see Section 5.2). - * [...] - * - * @see http://luca.ntop.org/Teaching/Appunti/asn1.html - */ -class ExplicitlyTaggedObject extends ASNObject -{ - /** @var \FG\ASN1\ASNObject[] */ - private $decoratedObjects; - private $tag; - - /** - * @param int $tag - * @param \FG\ASN1\ASNObject $objects,... - */ - public function __construct($tag, /* HH_FIXME[4858]: variadic + strict */ ...$objects) - { - $this->tag = $tag; - $this->decoratedObjects = $objects; - } - - protected function calculateContentLength() - { - $length = 0; - foreach ($this->decoratedObjects as $object) { - $length += $object->getObjectLength(); - } - - return $length; - } - - protected function getEncodedValue() - { - $encoded = ''; - foreach ($this->decoratedObjects as $object) { - $encoded .= $object->getBinary(); - } - - return $encoded; - } - - public function getContent() - { - return $this->decoratedObjects; - } - - public function __toString() - { - switch ($length = count($this->decoratedObjects)) { - case 0: - return "Context specific empty object with tag [{$this->tag}]"; - case 1: - $decoratedType = Identifier::getShortName($this->decoratedObjects[0]->getType()); - return "Context specific $decoratedType with tag [{$this->tag}]"; - default: - return "$length context specific objects with tag [{$this->tag}]"; - } - } - - public function getType() - { - return ord($this->getIdentifier()); - } - - public function getIdentifier() - { - $identifier = Identifier::create(Identifier::CLASS_CONTEXT_SPECIFIC, true, $this->tag); - - return is_int($identifier) ? chr($identifier) : $identifier; - } - - public function getTag() - { - return $this->tag; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - $identifier = self::parseBinaryIdentifier($binaryData, $offsetIndex); - $firstIdentifierOctet = ord($identifier); - assert(Identifier::isContextSpecificClass($firstIdentifierOctet), 'identifier octet should indicate context specific class'); - assert(Identifier::isConstructed($firstIdentifierOctet), 'identifier octet should indicate constructed object'); - $tag = Identifier::getTagNumber($identifier); - - $totalContentLength = self::parseContentLength($binaryData, $offsetIndex); - $remainingContentLength = $totalContentLength; - - $offsetIndexOfDecoratedObject = $offsetIndex; - $decoratedObjects = []; - - while ($remainingContentLength > 0) { - $nextObject = ASNObject::fromBinary($binaryData, $offsetIndex); - $remainingContentLength -= $nextObject->getObjectLength(); - $decoratedObjects[] = $nextObject; - } - - if ($remainingContentLength != 0) { - throw new ParserException("Context-Specific explicitly tagged object [$tag] starting at offset $offsetIndexOfDecoratedObject specifies a length of $totalContentLength octets but $remainingContentLength remain after parsing the content", $offsetIndexOfDecoratedObject); - } - - $parsedObject = new self($tag, ...$decoratedObjects); - $parsedObject->setContentLength($totalContentLength); - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php deleted file mode 100644 index b21caa34..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Identifier.php +++ /dev/null @@ -1,339 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use Exception; - -/** - * The Identifier encodes the ASN.1 tag (class and number) of the type of a data value. - * - * Every identifier whose number is in the range 0 to 30 has the following structure: - * - * Bits: 8 7 6 5 4 3 2 1 - * | Class | P/C | Tag number | - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * Bits 8 and 7 define the class of this type ( Universal, Application, Context-specific or Private). - * Bit 6 encoded whether this type is primitive or constructed - * The remaining bits 5 - 1 encode the tag number - */ -class Identifier -{ - const CLASS_UNIVERSAL = 0x00; - const CLASS_APPLICATION = 0x01; - const CLASS_CONTEXT_SPECIFIC = 0x02; - const CLASS_PRIVATE = 0x03; - - const EOC = 0x00; // unsupported for now - const BOOLEAN = 0x01; - const INTEGER = 0x02; - const BITSTRING = 0x03; - const OCTETSTRING = 0x04; - const NULL = 0x05; - const OBJECT_IDENTIFIER = 0x06; - const OBJECT_DESCRIPTOR = 0x07; - const EXTERNAL = 0x08; // unsupported for now - const REAL = 0x09; // unsupported for now - const ENUMERATED = 0x0A; - const EMBEDDED_PDV = 0x0B; // unsupported for now - const UTF8_STRING = 0x0C; - const RELATIVE_OID = 0x0D; - // value 0x0E and 0x0F are reserved for future use - - const SEQUENCE = 0x30; - const SET = 0x31; - const NUMERIC_STRING = 0x12; - const PRINTABLE_STRING = 0x13; - const T61_STRING = 0x14; // sometimes referred to as TeletextString - const VIDEOTEXT_STRING = 0x15; - const IA5_STRING = 0x16; - const UTC_TIME = 0x17; - const GENERALIZED_TIME = 0x18; - const GRAPHIC_STRING = 0x19; - const VISIBLE_STRING = 0x1A; - const GENERAL_STRING = 0x1B; - const UNIVERSAL_STRING = 0x1C; - const CHARACTER_STRING = 0x1D; // Unrestricted character type - const BMP_STRING = 0x1E; - - const LONG_FORM = 0x1F; - const IS_CONSTRUCTED = 0x20; - - /** - * Creates an identifier. Short form identifiers are returned as integers - * for BC, long form identifiers will be returned as a string of octets. - * - * @param int $class - * @param bool $isConstructed - * @param int $tagNumber - * - * @throws Exception if the given arguments are invalid - * - * @return int|string - */ - public static function create($class, $isConstructed, $tagNumber) - { - if (!is_numeric($class) || $class < self::CLASS_UNIVERSAL || $class > self::CLASS_PRIVATE) { - throw new Exception(sprintf('Invalid class %d given', $class)); - } - - if (!is_bool($isConstructed)) { - throw new Exception("\$isConstructed must be a boolean value ($isConstructed given)"); - } - - $tagNumber = self::makeNumeric($tagNumber); - if ($tagNumber < 0) { - throw new Exception(sprintf('Invalid $tagNumber %d given. You can only use positive integers.', $tagNumber)); - } - - if ($tagNumber < self::LONG_FORM) { - return ($class << 6) | ($isConstructed << 5) | $tagNumber; - } - - $firstOctet = ($class << 6) | ($isConstructed << 5) | self::LONG_FORM; - - // Tag numbers formatted in long form are base-128 encoded. See X.609#8.1.2.4 - return chr($firstOctet).Base128::encode($tagNumber); - } - - public static function isConstructed($identifierOctet) - { - return ($identifierOctet & self::IS_CONSTRUCTED) === self::IS_CONSTRUCTED; - } - - public static function isLongForm($identifierOctet) - { - return ($identifierOctet & self::LONG_FORM) === self::LONG_FORM; - } - - /** - * Return the name of the mapped ASN.1 type with a preceding "ASN.1 ". - * - * Example: ASN.1 Octet String - * - * @see Identifier::getShortName() - * - * @param int|string $identifier - * - * @return string - */ - public static function getName($identifier) - { - $identifierOctet = self::makeNumeric($identifier); - - $typeName = static::getShortName($identifier); - - if (($identifierOctet & self::LONG_FORM) < self::LONG_FORM) { - $typeName = "ASN.1 {$typeName}"; - } - - return $typeName; - } - - /** - * Return the short version of the type name. - * - * If the given identifier octet can be mapped to a known universal type this will - * return its name. Else Identifier::getClassDescription() is used to retrieve - * information about the identifier. - * - * @see Identifier::getName() - * @see Identifier::getClassDescription() - * - * @param int|string $identifier - * - * @return string - */ - public static function getShortName($identifier) - { - $identifierOctet = self::makeNumeric($identifier); - - switch ($identifierOctet) { - case self::EOC: - return 'End-of-contents octet'; - case self::BOOLEAN: - return 'Boolean'; - case self::INTEGER: - return 'Integer'; - case self::BITSTRING: - return 'Bit String'; - case self::OCTETSTRING: - return 'Octet String'; - case self::NULL: - return 'NULL'; - case self::OBJECT_IDENTIFIER: - return 'Object Identifier'; - case self::OBJECT_DESCRIPTOR: - return 'Object Descriptor'; - case self::EXTERNAL: - return 'External Type'; - case self::REAL: - return 'Real'; - case self::ENUMERATED: - return 'Enumerated'; - case self::EMBEDDED_PDV: - return 'Embedded PDV'; - case self::UTF8_STRING: - return 'UTF8 String'; - case self::RELATIVE_OID: - return 'Relative OID'; - case self::SEQUENCE: - return 'Sequence'; - case self::SET: - return 'Set'; - case self::NUMERIC_STRING: - return 'Numeric String'; - case self::PRINTABLE_STRING: - return 'Printable String'; - case self::T61_STRING: - return 'T61 String'; - case self::VIDEOTEXT_STRING: - return 'Videotext String'; - case self::IA5_STRING: - return 'IA5 String'; - case self::UTC_TIME: - return 'UTC Time'; - case self::GENERALIZED_TIME: - return 'Generalized Time'; - case self::GRAPHIC_STRING: - return 'Graphic String'; - case self::VISIBLE_STRING: - return 'Visible String'; - case self::GENERAL_STRING: - return 'General String'; - case self::UNIVERSAL_STRING: - return 'Universal String'; - case self::CHARACTER_STRING: - return 'Character String'; - case self::BMP_STRING: - return 'BMP String'; - - case 0x0E: - return 'RESERVED (0x0E)'; - case 0x0F: - return 'RESERVED (0x0F)'; - - case self::LONG_FORM: - default: - $classDescription = self::getClassDescription($identifier); - - if (is_int($identifier)) { - $identifier = chr($identifier); - } - - return "$classDescription (0x".strtoupper(bin2hex($identifier)).')'; - } - } - - /** - * Returns a textual description of the information encoded in a given identifier octet. - * - * The first three (most significant) bytes are evaluated to determine if this is a - * constructed or primitive type and if it is either universal, application, context-specific or - * private. - * - * Example: - * Constructed context-specific - * Primitive universal - * - * @param int|string $identifier - * - * @return string - */ - public static function getClassDescription($identifier) - { - $identifierOctet = self::makeNumeric($identifier); - - if (self::isConstructed($identifierOctet)) { - $classDescription = 'Constructed '; - } else { - $classDescription = 'Primitive '; - } - $classBits = $identifierOctet >> 6; - switch ($classBits) { - case self::CLASS_UNIVERSAL: - $classDescription .= 'universal'; - break; - case self::CLASS_APPLICATION: - $classDescription .= 'application'; - break; - case self::CLASS_CONTEXT_SPECIFIC: - $tagNumber = self::getTagNumber($identifier); - $classDescription = "[$tagNumber] Context-specific"; - break; - case self::CLASS_PRIVATE: - $classDescription .= 'private'; - break; - - default: - return "INVALID IDENTIFIER OCTET: {$identifierOctet}"; - } - - return $classDescription; - } - - /** - * @param int|string $identifier - * - * @return int - */ - public static function getTagNumber($identifier) - { - $firstOctet = self::makeNumeric($identifier); - $tagNumber = $firstOctet & self::LONG_FORM; - - if ($tagNumber < self::LONG_FORM) { - return $tagNumber; - } - - if (is_numeric($identifier)) { - $identifier = chr($identifier); - } - return Base128::decode(substr($identifier, 1)); - } - - public static function isUniversalClass($identifier) - { - $identifier = self::makeNumeric($identifier); - - return $identifier >> 6 == self::CLASS_UNIVERSAL; - } - - public static function isApplicationClass($identifier) - { - $identifier = self::makeNumeric($identifier); - - return $identifier >> 6 == self::CLASS_APPLICATION; - } - - public static function isContextSpecificClass($identifier) - { - $identifier = self::makeNumeric($identifier); - - return $identifier >> 6 == self::CLASS_CONTEXT_SPECIFIC; - } - - public static function isPrivateClass($identifier) - { - $identifier = self::makeNumeric($identifier); - - return $identifier >> 6 == self::CLASS_PRIVATE; - } - - private static function makeNumeric($identifierOctet) - { - if (!is_numeric($identifierOctet)) { - return ord($identifierOctet); - } else { - return $identifierOctet; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/OID.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/OID.php deleted file mode 100644 index bfaeae17..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/OID.php +++ /dev/null @@ -1,1023 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -class OID -{ - const RSA_ENCRYPTION = '1.2.840.113549.1.1.1'; - const MD5_WITH_RSA_ENCRYPTION = '1.2.840.113549.1.1.4'; - const SHA1_WITH_RSA_SIGNATURE = '1.2.840.113549.1.1.5'; - const SHA256_WITH_RSA_SIGNATURE = '1.2.840.113549.1.1.11'; - const PKCS9_EMAIL = '1.2.840.113549.1.9.1'; - const PKCS9_UNSTRUCTURED_NAME = '1.2.840.113549.1.9.2'; - const PKCS9_CONTENT_TYPE = '1.2.840.113549.1.9.3'; - const PKCS9_MESSAGE_DIGEST = '1.2.840.113549.1.9.4'; - const PKCS9_SIGNING_TIME = '1.2.840.113549.1.9.5'; - const PKCS9_EXTENSION_REQUEST = '1.2.840.113549.1.9.14'; - - // certificate extension identifier - const CERT_EXT_SUBJECT_DIRECTORY_ATTR = '2.5.29.9'; - const CERT_EXT_SUBJECT_KEY_IDENTIFIER = '2.5.29.14'; - const CERT_EXT_KEY_USAGE = '2.5.29.15'; - const CERT_EXT_PRIVATE_KEY_USAGE_PERIOD = '2.5.29.16'; - const CERT_EXT_SUBJECT_ALT_NAME = '2.5.29.17'; - const CERT_EXT_ISSUER_ALT_NAME = '2.5.29.18'; - const CERT_EXT_BASIC_CONSTRAINTS = '2.5.29.19'; - const CERT_EXT_CRL_NUMBER = '2.5.29.20'; - const CERT_EXT_REASON_CODE = '2.5.29.21'; - const CERT_EXT_INVALIDITY_DATE = '2.5.29.24'; - const CERT_EXT_DELTA_CRL_INDICATOR = '2.5.29.27'; - const CERT_EXT_ISSUING_DIST_POINT = '2.5.29.28'; - const CERT_EXT_CERT_ISSUER = '2.5.29.29'; - const CERT_EXT_NAME_CONSTRAINTS = '2.5.29.30'; - const CERT_EXT_CRL_DISTRIBUTION_POINTS = '2.5.29.31'; - const CERT_EXT_CERT_POLICIES = '2.5.29.32'; - const CERT_EXT_AUTHORITY_KEY_IDENTIFIER = '2.5.29.35'; - const CERT_EXT_EXTENDED_KEY_USAGE = '2.5.29.37'; - - // standard certificate files - const COMMON_NAME = '2.5.4.3'; - const SURNAME = '2.5.4.4'; - const SERIAL_NUMBER = '2.5.4.5'; - const COUNTRY_NAME = '2.5.4.6'; - const LOCALITY_NAME = '2.5.4.7'; - const STATE_OR_PROVINCE_NAME = '2.5.4.8'; - const STREET_ADDRESS = '2.5.4.9'; - const ORGANIZATION_NAME = '2.5.4.10'; - const OU_NAME = '2.5.4.11'; - const TITLE = '2.5.4.12'; - const DESCRIPTION = '2.5.4.13'; - const POSTAL_ADDRESS = '2.5.4.16'; - const POSTAL_CODE = '2.5.4.17'; - const AUTHORITY_REVOCATION_LIST = '2.5.4.38'; - - const AUTHORITY_INFORMATION_ACCESS = '1.3.6.1.5.5.7.1.1'; - - /** - * Returns the name of the given object identifier. - * - * Some OIDs are saved as class constants in this class. - * If the wanted oidString is not among them, this method will - * query http://oid-info.com for the right name. - * This behavior can be suppressed by setting the second method parameter to false. - * - * @param string $oidString - * @param bool $loadFromWeb - * - * @see self::loadFromWeb($oidString) - * - * @return string - */ - public static function getName($oidString, $loadFromWeb = true) - { - $oids = [ - '1.2' => 'ISO Member Body', - '1.3' => 'org', - '1.3.6.1.5.5.8.1.1' => 'hmac-md5', - '1.3.6.1.5.5.8.1.2' => 'hmac-sha1', - '1.3.132' => 'certicom-arc', - '2.23' => 'International Organizations', - '2.23.43' => 'wap', - '2.23.43.1' => 'wap-wsg', - '2.5.1.5' => 'Selected Attribute Types', - '2.5.1.5.55' => 'clearance', - '1.2.840' => 'ISO US Member Body', - '1.2.840.10040' => 'X9.57', - '1.2.840.10040.4' => 'X9.57 CM ?', - '1.2.840.10040.4.1' => 'dsaEncryption', - '1.2.840.10040.4.3' => 'dsaWithSHA1', - '1.2.840.10045' => 'ANSI X9.62', - '1.2.840.10045.1' => 'X9-62_id-fieldType', - '1.2.840.10045.1.1' => 'X9-62_prime-field', - '1.2.840.10045.1.2' => 'X9-62_characteristic-two-field', - '1.2.840.10045.1.2.3' => 'X9-62_id-characteristic-two-basis', - '1.2.840.10045.1.2.3.1' => 'X9-62_onBasis', - '1.2.840.10045.1.2.3.2' => 'X9-62_tpBasis', - '1.2.840.10045.1.2.3.3' => 'X9-62_ppBasis', - '1.2.840.10045.2' => 'X9-62_id-publicKeyType', - '1.2.840.10045.2.1' => 'X9-62_id-ecPublicKey', - '1.2.840.10045.3' => 'X9-62_ellipticCurve', - '1.2.840.10045.3.0' => 'X9-62_c-TwoCurve', - '1.2.840.10045.3.0.1' => 'X9-62_c2pnb163v1', - '1.2.840.10045.3.0.2' => 'X9-62_c2pnb163v2', - '1.2.840.10045.3.0.3' => 'X9-62_c2pnb163v3', - '1.2.840.10045.3.0.4' => 'X9-62_c2pnb176v1', - '1.2.840.10045.3.0.5' => 'X9-62_c2tnb191v1', - '1.2.840.10045.3.0.6' => 'X9-62_c2tnb191v2', - '1.2.840.10045.3.0.7' => 'X9-62_c2tnb191v3', - '1.2.840.10045.3.0.8' => 'X9-62_c2onb191v4', - '1.2.840.10045.3.0.9' => 'X9-62_c2onb191v5', - '1.2.840.10045.3.0.10' => 'X9-62_c2pnb208w1', - '1.2.840.10045.3.0.11' => 'X9-62_c2tnb239v1', - '1.2.840.10045.3.0.12' => 'X9-62_c2tnb239v2', - '1.2.840.10045.3.0.13' => 'X9-62_c2tnb239v3', - '1.2.840.10045.3.0.14' => 'X9-62_c2onb239v4', - '1.2.840.10045.3.0.15' => 'X9-62_c2onb239v5', - '1.2.840.10045.3.0.16' => 'X9-62_c2pnb272w1', - '1.2.840.10045.3.0.17' => 'X9-62_c2pnb304w1', - '1.2.840.10045.3.0.18' => 'X9-62_c2tnb359v1', - '1.2.840.10045.3.0.19' => 'X9-62_c2pnb368w1', - '1.2.840.10045.3.0.20' => 'X9-62_c2tnb431r1', - '1.2.840.10045.3.1' => 'X9-62_primeCurve', - '1.2.840.10045.3.1.1' => 'X9-62_prime192v1', - '1.2.840.10045.3.1.2' => 'X9-62_prime192v2', - '1.2.840.10045.3.1.3' => 'X9-62_prime192v3', - '1.2.840.10045.3.1.4' => 'X9-62_prime239v1', - '1.2.840.10045.3.1.5' => 'X9-62_prime239v2', - '1.2.840.10045.3.1.6' => 'X9-62_prime239v3', - '1.2.840.10045.3.1.7' => 'X9-62_prime256v1', - '1.2.840.10045.4' => 'X9-62_id-ecSigType', - '1.2.840.10045.4.1' => 'ecdsa-with-SHA1', - '1.2.840.10045.4.2' => 'ecdsa-with-Recommended', - '1.2.840.10045.4.3' => 'ecdsa-with-Specified', - '1.2.840.10045.4.3.1' => 'ecdsa-with-SHA224', - '1.2.840.10045.4.3.2' => 'ecdsa-with-SHA256', - '1.2.840.10045.4.3.3' => 'ecdsa-with-SHA384', - '1.2.840.10045.4.3.4' => 'ecdsa-with-SHA512', - '1.3.132.0' => 'secg_ellipticCurve', - '2.23.43.1.4' => 'wap-wsg-idm-ecid', - '2.23.43.1.4.1' => 'wap-wsg-idm-ecid-wtls1', - '2.23.43.1.4.3' => 'wap-wsg-idm-ecid-wtls3', - '2.23.43.1.4.4' => 'wap-wsg-idm-ecid-wtls4', - '2.23.43.1.4.5' => 'wap-wsg-idm-ecid-wtls5', - '2.23.43.1.4.6' => 'wap-wsg-idm-ecid-wtls6', - '2.23.43.1.4.7' => 'wap-wsg-idm-ecid-wtls7', - '2.23.43.1.4.8' => 'wap-wsg-idm-ecid-wtls8', - '2.23.43.1.4.9' => 'wap-wsg-idm-ecid-wtls9', - '2.23.43.1.4.10' => 'wap-wsg-idm-ecid-wtls10', - '2.23.43.1.4.11' => 'wap-wsg-idm-ecid-wtls11', - '2.23.43.1.4.12' => 'wap-wsg-idm-ecid-wtls12', - '1.2.840.113533.7.66.10' => 'cast5-cbc', - '1.2.840.113533.7.66.12' => 'pbeWithMD5AndCast5CBC', - '1.2.840.113533.7.66.13' => 'password based MAC', - '1.2.840.113533.7.66.30' => 'Diffie-Hellman based MAC', - '1.2.840.113549' => 'RSA Data Security, Inc.', - '1.2.840.113549.1' => 'RSA Data Security, Inc. PKCS', - '1.2.840.113549.1.1' => 'pkcs1', - '1.2.840.113549.1.1.1' => 'rsaEncryption', - '1.2.840.113549.1.1.2' => 'md2WithRSAEncryption', - '1.2.840.113549.1.1.3' => 'md4WithRSAEncryption', - '1.2.840.113549.1.1.4' => 'md5WithRSAEncryption', - '1.2.840.113549.1.1.5' => 'sha1WithRSAEncryption', - '1.2.840.113549.1.1.7' => 'rsaesOaep', - '1.2.840.113549.1.1.8' => 'mgf1', - '1.2.840.113549.1.1.9' => 'pSpecified', - '1.2.840.113549.1.1.10' => 'rsassaPss', - '1.2.840.113549.1.1.11' => 'sha256WithRSAEncryption', - '1.2.840.113549.1.1.12' => 'sha384WithRSAEncryption', - '1.2.840.113549.1.1.13' => 'sha512WithRSAEncryption', - '1.2.840.113549.1.1.14' => 'sha224WithRSAEncryption', - '1.2.840.113549.1.3' => 'pkcs3', - '1.2.840.113549.1.3.1' => 'dhKeyAgreement', - '1.2.840.113549.1.5' => 'pkcs5', - '1.2.840.113549.1.5.1' => 'pbeWithMD2AndDES-CBC', - '1.2.840.113549.1.5.3' => 'pbeWithMD5AndDES-CBC', - '1.2.840.113549.1.5.4' => 'pbeWithMD2AndRC2-CBC', - '1.2.840.113549.1.5.6' => 'pbeWithMD5AndRC2-CBC', - '1.2.840.113549.1.5.10' => 'pbeWithSHA1AndDES-CBC', - '1.2.840.113549.1.5.11' => 'pbeWithSHA1AndRC2-CBC', - '1.2.840.113549.1.5.12' => 'PBKDF2', - '1.2.840.113549.1.5.13' => 'PBES2', - '1.2.840.113549.1.5.14' => 'PBMAC1', - '1.2.840.113549.1.7' => 'pkcs7', - '1.2.840.113549.1.7.1' => 'pkcs7-data', - '1.2.840.113549.1.7.2' => 'pkcs7-signedData', - '1.2.840.113549.1.7.3' => 'pkcs7-envelopedData', - '1.2.840.113549.1.7.4' => 'pkcs7-signedAndEnvelopedData', - '1.2.840.113549.1.7.5' => 'pkcs7-digestData', - '1.2.840.113549.1.7.6' => 'pkcs7-encryptedData', - '1.2.840.113549.1.9' => 'pkcs9', - '1.2.840.113549.1.9.1' => 'emailAddress', - '1.2.840.113549.1.9.2' => 'unstructuredName', - '1.2.840.113549.1.9.3' => 'contentType', - '1.2.840.113549.1.9.4' => 'messageDigest', - '1.2.840.113549.1.9.5' => 'signingTime', - '1.2.840.113549.1.9.6' => 'countersignature', - '1.2.840.113549.1.9.7' => 'challengePassword', - '1.2.840.113549.1.9.8' => 'unstructuredAddress', - '1.2.840.113549.1.9.9' => 'extendedCertificateAttributes', - '1.2.840.113549.1.9.14' => 'Extension Request', - '1.2.840.113549.1.9.15' => 'S/MIME Capabilities', - '1.2.840.113549.1.9.16' => 'S/MIME', - '1.2.840.113549.1.9.16.0' => 'id-smime-mod', - '1.2.840.113549.1.9.16.1' => 'id-smime-ct', - '1.2.840.113549.1.9.16.2' => 'id-smime-aa', - '1.2.840.113549.1.9.16.3' => 'id-smime-alg', - '1.2.840.113549.1.9.16.4' => 'id-smime-cd', - '1.2.840.113549.1.9.16.5' => 'id-smime-spq', - '1.2.840.113549.1.9.16.6' => 'id-smime-cti', - '1.2.840.113549.1.9.16.0.1' => 'id-smime-mod-cms', - '1.2.840.113549.1.9.16.0.2' => 'id-smime-mod-ess', - '1.2.840.113549.1.9.16.0.3' => 'id-smime-mod-oid', - '1.2.840.113549.1.9.16.0.4' => 'id-smime-mod-msg-v3', - '1.2.840.113549.1.9.16.0.5' => 'id-smime-mod-ets-eSignature-88', - '1.2.840.113549.1.9.16.0.6' => 'id-smime-mod-ets-eSignature-97', - '1.2.840.113549.1.9.16.0.7' => 'id-smime-mod-ets-eSigPolicy-88', - '1.2.840.113549.1.9.16.0.8' => 'id-smime-mod-ets-eSigPolicy-97', - '1.2.840.113549.1.9.16.1.1' => 'id-smime-ct-receipt', - '1.2.840.113549.1.9.16.1.2' => 'id-smime-ct-authData', - '1.2.840.113549.1.9.16.1.3' => 'id-smime-ct-publishCert', - '1.2.840.113549.1.9.16.1.4' => 'id-smime-ct-TSTInfo', - '1.2.840.113549.1.9.16.1.5' => 'id-smime-ct-TDTInfo', - '1.2.840.113549.1.9.16.1.6' => 'id-smime-ct-contentInfo', - '1.2.840.113549.1.9.16.1.7' => 'id-smime-ct-DVCSRequestData', - '1.2.840.113549.1.9.16.1.8' => 'id-smime-ct-DVCSResponseData', - '1.2.840.113549.1.9.16.1.9' => 'id-smime-ct-compressedData', - '1.2.840.113549.1.9.16.1.27' => 'id-ct-asciiTextWithCRLF', - '1.2.840.113549.1.9.16.2.1' => 'id-smime-aa-receiptRequest', - '1.2.840.113549.1.9.16.2.2' => 'id-smime-aa-securityLabel', - '1.2.840.113549.1.9.16.2.3' => 'id-smime-aa-mlExpandHistory', - '1.2.840.113549.1.9.16.2.4' => 'id-smime-aa-contentHint', - '1.2.840.113549.1.9.16.2.5' => 'id-smime-aa-msgSigDigest', - '1.2.840.113549.1.9.16.2.6' => 'id-smime-aa-encapContentType', - '1.2.840.113549.1.9.16.2.7' => 'id-smime-aa-contentIdentifier', - '1.2.840.113549.1.9.16.2.8' => 'id-smime-aa-macValue', - '1.2.840.113549.1.9.16.2.9' => 'id-smime-aa-equivalentLabels', - '1.2.840.113549.1.9.16.2.10' => 'id-smime-aa-contentReference', - '1.2.840.113549.1.9.16.2.11' => 'id-smime-aa-encrypKeyPref', - '1.2.840.113549.1.9.16.2.12' => 'id-smime-aa-signingCertificate', - '1.2.840.113549.1.9.16.2.13' => 'id-smime-aa-smimeEncryptCerts', - '1.2.840.113549.1.9.16.2.14' => 'id-smime-aa-timeStampToken', - '1.2.840.113549.1.9.16.2.15' => 'id-smime-aa-ets-sigPolicyId', - '1.2.840.113549.1.9.16.2.16' => 'id-smime-aa-ets-commitmentType', - '1.2.840.113549.1.9.16.2.17' => 'id-smime-aa-ets-signerLocation', - '1.2.840.113549.1.9.16.2.18' => 'id-smime-aa-ets-signerAttr', - '1.2.840.113549.1.9.16.2.19' => 'id-smime-aa-ets-otherSigCert', - '1.2.840.113549.1.9.16.2.20' => 'id-smime-aa-ets-contentTimestamp', - '1.2.840.113549.1.9.16.2.21' => 'id-smime-aa-ets-CertificateRefs', - '1.2.840.113549.1.9.16.2.22' => 'id-smime-aa-ets-RevocationRefs', - '1.2.840.113549.1.9.16.2.23' => 'id-smime-aa-ets-certValues', - '1.2.840.113549.1.9.16.2.24' => 'id-smime-aa-ets-revocationValues', - '1.2.840.113549.1.9.16.2.25' => 'id-smime-aa-ets-escTimeStamp', - '1.2.840.113549.1.9.16.2.26' => 'id-smime-aa-ets-certCRLTimestamp', - '1.2.840.113549.1.9.16.2.27' => 'id-smime-aa-ets-archiveTimeStamp', - '1.2.840.113549.1.9.16.2.28' => 'id-smime-aa-signatureType', - '1.2.840.113549.1.9.16.2.29' => 'id-smime-aa-dvcs-dvc', - '1.2.840.113549.1.9.16.3.1' => 'id-smime-alg-ESDHwith3DES', - '1.2.840.113549.1.9.16.3.2' => 'id-smime-alg-ESDHwithRC2', - '1.2.840.113549.1.9.16.3.3' => 'id-smime-alg-3DESwrap', - '1.2.840.113549.1.9.16.3.4' => 'id-smime-alg-RC2wrap', - '1.2.840.113549.1.9.16.3.5' => 'id-smime-alg-ESDH', - '1.2.840.113549.1.9.16.3.6' => 'id-smime-alg-CMS3DESwrap', - '1.2.840.113549.1.9.16.3.7' => 'id-smime-alg-CMSRC2wrap', - '1.2.840.113549.1.9.16.3.9' => 'id-alg-PWRI-KEK', - '1.2.840.113549.1.9.16.4.1' => 'id-smime-cd-ldap', - '1.2.840.113549.1.9.16.5.1' => 'id-smime-spq-ets-sqt-uri', - '1.2.840.113549.1.9.16.5.2' => 'id-smime-spq-ets-sqt-unotice', - '1.2.840.113549.1.9.16.6.1' => 'id-smime-cti-ets-proofOfOrigin', - '1.2.840.113549.1.9.16.6.2' => 'id-smime-cti-ets-proofOfReceipt', - '1.2.840.113549.1.9.16.6.3' => 'id-smime-cti-ets-proofOfDelivery', - '1.2.840.113549.1.9.16.6.4' => 'id-smime-cti-ets-proofOfSender', - '1.2.840.113549.1.9.16.6.5' => 'id-smime-cti-ets-proofOfApproval', - '1.2.840.113549.1.9.16.6.6' => 'id-smime-cti-ets-proofOfCreation', - '1.2.840.113549.1.9.20' => 'friendlyName', - '1.2.840.113549.1.9.21' => 'localKeyID', - '1.3.6.1.4.1.311.17.1' => 'Microsoft CSP Name', - '1.3.6.1.4.1.311.17.2' => 'Microsoft Local Key set', - '1.2.840.113549.1.9.22' => 'certTypes', - '1.2.840.113549.1.9.22.1' => 'x509Certificate', - '1.2.840.113549.1.9.22.2' => 'sdsiCertificate', - - '1.2.840.113549.1.9.23' => 'crlTypes', - '1.2.840.113549.1.9.23.1' => 'x509Crl', - '1.2.840.113549.1.12' => 'pkcs12', - '1.2.840.113549.1.12.1' => 'pkcs12-pbeids', - '1.2.840.113549.1.12.1.1' => 'pbeWithSHA1And128BitRC4', - '1.2.840.113549.1.12.1.2' => 'pbeWithSHA1And40BitRC4', - '1.2.840.113549.1.12.1.3' => 'pbeWithSHA1And3-KeyTripleDES-CBC', - '1.2.840.113549.1.12.1.4' => 'pbeWithSHA1And2-KeyTripleDES-CBC', - '1.2.840.113549.1.12.1.5' => 'pbeWithSHA1And128BitRC2-CBC', - '1.2.840.113549.1.12.1.6' => 'pbeWithSHA1And40BitRC2-CBC', - '1.2.840.113549.1.12.10' => 'pkcs12-Version1', - '1.2.840.113549.1.12.10.1' => 'pkcs12-BagIds', - '1.2.840.113549.1.12.10.1.1' => 'keyBag', - '1.2.840.113549.1.12.10.1.2' => 'pkcs8ShroudedKeyBag', - '1.2.840.113549.1.12.10.1.3' => 'certBag', - '1.2.840.113549.1.12.10.1.4' => 'crlBag', - '1.2.840.113549.1.12.10.1.5' => 'secretBag', - '1.2.840.113549.1.12.10.1.6' => 'safeContentsBag', - '1.2.840.113549.2.2' => 'md2', - '1.2.840.113549.2.4' => 'md4', - '1.2.840.113549.2.5' => 'md5', - '1.2.840.113549.2.6' => 'hmacWithMD5', - '1.2.840.113549.2.7' => 'hmacWithSHA1', - '1.2.840.113549.2.8' => 'hmacWithSHA224', - '1.2.840.113549.2.9' => 'hmacWithSHA256', - '1.2.840.113549.2.10' => 'hmacWithSHA384', - '1.2.840.113549.2.11' => 'hmacWithSHA512', - '1.2.840.113549.3.2' => 'rc2-cbc', - '1.2.840.113549.3.4' => 'rc4', - '1.2.840.113549.3.7' => 'des-ede3-cbc', - '1.2.840.113549.3.8' => 'rc5-cbc', - '1.3.6.1.4.1.311.2.1.14' => 'Microsoft Extension Request', - '1.3.6.1.4.1.311.2.1.21' => 'Microsoft Individual Code Signing', - '1.3.6.1.4.1.311.2.1.22' => 'Microsoft Commercial Code Signing', - '1.3.6.1.4.1.311.10.3.1' => 'Microsoft Trust List Signing', - '1.3.6.1.4.1.311.10.3.3' => 'Microsoft Server Gated Crypto', - '1.3.6.1.4.1.311.10.3.4' => 'Microsoft Encrypted File System', - '1.3.6.1.4.1.311.20.2.2' => 'Microsoft Smartcardlogin', - '1.3.6.1.4.1.311.20.2.3' => 'Microsoft Universal Principal Name', - '1.3.6.1.4.1.188.7.1.1.2' => 'idea-cbc', - '1.3.6.1.4.1.3029.1.2' => 'bf-cbc', - '1.3.6.1.5.5.7' => 'PKIX', - '1.3.6.1.5.5.7.0' => 'id-pkix-mod', - '1.3.6.1.5.5.7.1' => 'id-pe', - '1.3.6.1.5.5.7.2' => 'id-qt', - '1.3.6.1.5.5.7.3' => 'id-kp', - '1.3.6.1.5.5.7.4' => 'id-it', - '1.3.6.1.5.5.7.5' => 'id-pkip', - '1.3.6.1.5.5.7.6' => 'id-alg', - '1.3.6.1.5.5.7.7' => 'id-cmc', - '1.3.6.1.5.5.7.8' => 'id-on', - '1.3.6.1.5.5.7.9' => 'id-pda', - '1.3.6.1.5.5.7.10' => 'id-aca', - '1.3.6.1.5.5.7.11' => 'id-qcs', - '1.3.6.1.5.5.7.12' => 'id-cct', - '1.3.6.1.5.5.7.21' => 'id-ppl', - '1.3.6.1.5.5.7.48' => 'id-ad', - '1.3.6.1.5.5.7.0.1' => 'id-pkix1-explicit-88', - '1.3.6.1.5.5.7.0.2' => 'id-pkix1-implicit-88', - '1.3.6.1.5.5.7.0.3' => 'id-pkix1-explicit-93', - '1.3.6.1.5.5.7.0.4' => 'id-pkix1-implicit-93', - '1.3.6.1.5.5.7.0.5' => 'id-mod-crmf', - '1.3.6.1.5.5.7.0.6' => 'id-mod-cmc', - '1.3.6.1.5.5.7.0.7' => 'id-mod-kea-profile-88', - '1.3.6.1.5.5.7.0.8' => 'id-mod-kea-profile-93', - '1.3.6.1.5.5.7.0.9' => 'id-mod-cmp', - '1.3.6.1.5.5.7.0.10' => 'id-mod-qualified-cert-88', - '1.3.6.1.5.5.7.0.11' => 'id-mod-qualified-cert-93', - '1.3.6.1.5.5.7.0.12' => 'id-mod-attribute-cert', - '1.3.6.1.5.5.7.0.13' => 'id-mod-timestamp-protocol', - '1.3.6.1.5.5.7.0.14' => 'id-mod-ocsp', - '1.3.6.1.5.5.7.0.15' => 'id-mod-dvcs', - '1.3.6.1.5.5.7.0.16' => 'id-mod-cmp2000', - '1.3.6.1.5.5.7.1.1' => 'Authority Information Access', - '1.3.6.1.5.5.7.1.2' => 'Biometric Info', - '1.3.6.1.5.5.7.1.3' => 'qcStatements', - '1.3.6.1.5.5.7.1.4' => 'ac-auditEntity', - '1.3.6.1.5.5.7.1.5' => 'ac-targeting', - '1.3.6.1.5.5.7.1.6' => 'aaControls', - '1.3.6.1.5.5.7.1.7' => 'sbgp-ipAddrBlock', - '1.3.6.1.5.5.7.1.8' => 'sbgp-autonomousSysNum', - '1.3.6.1.5.5.7.1.9' => 'sbgp-routerIdentifier', - '1.3.6.1.5.5.7.1.10' => 'ac-proxying', - '1.3.6.1.5.5.7.1.11' => 'Subject Information Access', - '1.3.6.1.5.5.7.1.14' => 'Proxy Certificate Information', - '1.3.6.1.5.5.7.2.1' => 'Policy Qualifier CPS', - '1.3.6.1.5.5.7.2.2' => 'Policy Qualifier User Notice', - '1.3.6.1.5.5.7.2.3' => 'textNotice', - '1.3.6.1.5.5.7.3.1' => 'TLS Web Server Authentication', - '1.3.6.1.5.5.7.3.2' => 'TLS Web Client Authentication', - '1.3.6.1.5.5.7.3.3' => 'Code Signing', - '1.3.6.1.5.5.7.3.4' => 'E-mail Protection', - '1.3.6.1.5.5.7.3.5' => 'IPSec End System', - '1.3.6.1.5.5.7.3.6' => 'IPSec Tunnel', - '1.3.6.1.5.5.7.3.7' => 'IPSec User', - '1.3.6.1.5.5.7.3.8' => 'Time Stamping', - '1.3.6.1.5.5.7.3.9' => 'OCSP Signing', - '1.3.6.1.5.5.7.3.10' => 'dvcs', - '1.3.6.1.5.5.7.4.1' => 'id-it-caProtEncCert', - '1.3.6.1.5.5.7.4.2' => 'id-it-signKeyPairTypes', - '1.3.6.1.5.5.7.4.3' => 'id-it-encKeyPairTypes', - '1.3.6.1.5.5.7.4.4' => 'id-it-preferredSymmAlg', - '1.3.6.1.5.5.7.4.5' => 'id-it-caKeyUpdateInfo', - '1.3.6.1.5.5.7.4.6' => 'id-it-currentCRL', - '1.3.6.1.5.5.7.4.7' => 'id-it-unsupportedOIDs', - '1.3.6.1.5.5.7.4.8' => 'id-it-subscriptionRequest', - '1.3.6.1.5.5.7.4.9' => 'id-it-subscriptionResponse', - '1.3.6.1.5.5.7.4.10' => 'id-it-keyPairParamReq', - '1.3.6.1.5.5.7.4.11' => 'id-it-keyPairParamRep', - '1.3.6.1.5.5.7.4.12' => 'id-it-revPassphrase', - '1.3.6.1.5.5.7.4.13' => 'id-it-implicitConfirm', - '1.3.6.1.5.5.7.4.14' => 'id-it-confirmWaitTime', - '1.3.6.1.5.5.7.4.15' => 'id-it-origPKIMessage', - '1.3.6.1.5.5.7.4.16' => 'id-it-suppLangTags', - '1.3.6.1.5.5.7.5.1' => 'id-regCtrl', - '1.3.6.1.5.5.7.5.2' => 'id-regInfo', - '1.3.6.1.5.5.7.5.1.1' => 'id-regCtrl-regToken', - '1.3.6.1.5.5.7.5.1.2' => 'id-regCtrl-authenticator', - '1.3.6.1.5.5.7.5.1.3' => 'id-regCtrl-pkiPublicationInfo', - '1.3.6.1.5.5.7.5.1.4' => 'id-regCtrl-pkiArchiveOptions', - '1.3.6.1.5.5.7.5.1.5' => 'id-regCtrl-oldCertID', - '1.3.6.1.5.5.7.5.1.6' => 'id-regCtrl-protocolEncrKey', - '1.3.6.1.5.5.7.5.2.1' => 'id-regInfo-utf8Pairs', - '1.3.6.1.5.5.7.5.2.2' => 'id-regInfo-certReq', - '1.3.6.1.5.5.7.6.1' => 'id-alg-des40', - '1.3.6.1.5.5.7.6.2' => 'id-alg-noSignature', - '1.3.6.1.5.5.7.6.3' => 'id-alg-dh-sig-hmac-sha1', - '1.3.6.1.5.5.7.6.4' => 'id-alg-dh-pop', - '1.3.6.1.5.5.7.7.1' => 'id-cmc-statusInfo', - '1.3.6.1.5.5.7.7.2' => 'id-cmc-identification', - '1.3.6.1.5.5.7.7.3' => 'id-cmc-identityProof', - '1.3.6.1.5.5.7.7.4' => 'id-cmc-dataReturn', - '1.3.6.1.5.5.7.7.5' => 'id-cmc-transactionId', - '1.3.6.1.5.5.7.7.6' => 'id-cmc-senderNonce', - '1.3.6.1.5.5.7.7.7' => 'id-cmc-recipientNonce', - '1.3.6.1.5.5.7.7.8' => 'id-cmc-addExtensions', - '1.3.6.1.5.5.7.7.9' => 'id-cmc-encryptedPOP', - '1.3.6.1.5.5.7.7.10' => 'id-cmc-decryptedPOP', - '1.3.6.1.5.5.7.7.11' => 'id-cmc-lraPOPWitness', - '1.3.6.1.5.5.7.7.15' => 'id-cmc-getCert', - '1.3.6.1.5.5.7.7.16' => 'id-cmc-getCRL', - '1.3.6.1.5.5.7.7.17' => 'id-cmc-revokeRequest', - '1.3.6.1.5.5.7.7.18' => 'id-cmc-regInfo', - '1.3.6.1.5.5.7.7.19' => 'id-cmc-responseInfo', - '1.3.6.1.5.5.7.7.21' => 'id-cmc-queryPending', - '1.3.6.1.5.5.7.7.22' => 'id-cmc-popLinkRandom', - '1.3.6.1.5.5.7.7.23' => 'id-cmc-popLinkWitness', - '1.3.6.1.5.5.7.7.24' => 'id-cmc-confirmCertAcceptance', - '1.3.6.1.5.5.7.8.1' => 'id-on-personalData', - '1.3.6.1.5.5.7.8.3' => 'Permanent Identifier', - '1.3.6.1.5.5.7.9.1' => 'id-pda-dateOfBirth', - '1.3.6.1.5.5.7.9.2' => 'id-pda-placeOfBirth', - '1.3.6.1.5.5.7.9.3' => 'id-pda-gender', - '1.3.6.1.5.5.7.9.4' => 'id-pda-countryOfCitizenship', - '1.3.6.1.5.5.7.9.5' => 'id-pda-countryOfResidence', - '1.3.6.1.5.5.7.10.1' => 'id-aca-authenticationInfo', - '1.3.6.1.5.5.7.10.2' => 'id-aca-accessIdentity', - '1.3.6.1.5.5.7.10.3' => 'id-aca-chargingIdentity', - '1.3.6.1.5.5.7.10.4' => 'id-aca-group', - '1.3.6.1.5.5.7.10.5' => 'id-aca-role', - '1.3.6.1.5.5.7.10.6' => 'id-aca-encAttrs', - '1.3.6.1.5.5.7.11.1' => 'id-qcs-pkixQCSyntax-v1', - '1.3.6.1.5.5.7.12.1' => 'id-cct-crs', - '1.3.6.1.5.5.7.12.2' => 'id-cct-PKIData', - '1.3.6.1.5.5.7.12.3' => 'id-cct-PKIResponse', - '1.3.6.1.5.5.7.21.0' => 'Any language', - '1.3.6.1.5.5.7.21.1' => 'Inherit all', - '1.3.6.1.5.5.7.21.2' => 'Independent', - '1.3.6.1.5.5.7.48.1' => 'OCSP', - '1.3.6.1.5.5.7.48.2' => 'CA Issuers', - '1.3.6.1.5.5.7.48.3' => 'AD Time Stamping', - '1.3.6.1.5.5.7.48.4' => 'ad dvcs', - '1.3.6.1.5.5.7.48.5' => 'CA Repository', - '1.3.6.1.5.5.7.48.1.1' => 'Basic OCSP Response', - '1.3.6.1.5.5.7.48.1.2' => 'OCSP Nonce', - '1.3.6.1.5.5.7.48.1.3' => 'OCSP CRL ID', - '1.3.6.1.5.5.7.48.1.4' => 'Acceptable OCSP Responses', - '1.3.6.1.5.5.7.48.1.5' => 'OCSP No Check', - '1.3.6.1.5.5.7.48.1.6' => 'OCSP Archive Cutoff', - '1.3.6.1.5.5.7.48.1.7' => 'OCSP Service Locator', - '1.3.6.1.5.5.7.48.1.8' => 'Extended OCSP Status', - '1.3.6.1.5.5.7.48.1.9' => 'id-pkix-OCSP_valid', - '1.3.6.1.5.5.7.48.1.10' => 'id-pkix-OCSP_path', - '1.3.6.1.5.5.7.48.1.11' => 'Trust Root', - '1.3.14.3.2' => 'algorithm', - '1.3.14.3.2.3' => 'md5WithRSA', - '1.3.14.3.2.6' => 'des-ecb', - '1.3.14.3.2.7' => 'des-cbc', - '1.3.14.3.2.8' => 'des-ofb', - '1.3.14.3.2.9' => 'des-cfb', - '1.3.14.3.2.11' => 'rsaSignature', - '1.3.14.3.2.12' => 'dsaEncryption-old', - '1.3.14.3.2.13' => 'dsaWithSHA', - '1.3.14.3.2.15' => 'shaWithRSAEncryption', - '1.3.14.3.2.17' => 'des-ede', - '1.3.14.3.2.18' => 'sha', - '1.3.14.3.2.26' => 'sha1', - '1.3.14.3.2.27' => 'dsaWithSHA1-old', - '1.3.14.3.2.29' => 'sha1WithRSA', - '1.3.36.3.2.1' => 'ripemd160', - '1.3.36.3.3.1.2' => 'ripemd160WithRSA', - '1.3.101.1.4.1' => 'Strong Extranet ID', - '2.5' => 'directory services (X.500)', - '2.5.4' => 'X509', - '2.5.4.3' => 'commonName', - '2.5.4.4' => 'surname', - '2.5.4.5' => 'serialNumber', - '2.5.4.6' => 'countryName', - '2.5.4.7' => 'localityName', - '2.5.4.8' => 'stateOrProvinceName', - '2.5.4.9' => 'streetAddress', - '2.5.4.10' => 'organizationName', - '2.5.4.11' => 'organizationalUnitName', - '2.5.4.12' => 'title', - '2.5.4.13' => 'description', - '2.5.4.14' => 'searchGuide', - '2.5.4.15' => 'businessCategory', - '2.5.4.16' => 'postalAddress', - '2.5.4.17' => 'postalCode', - '2.5.4.18' => 'postOfficeBox', - '2.5.4.19' => 'physicalDeliveryOfficeName', - '2.5.4.20' => 'telephoneNumber', - '2.5.4.21' => 'telexNumber', - '2.5.4.22' => 'teletexTerminalIdentifier', - '2.5.4.23' => 'facsimileTelephoneNumber', - '2.5.4.24' => 'x121Address', - '2.5.4.25' => 'internationaliSDNNumber', - '2.5.4.26' => 'registeredAddress', - '2.5.4.27' => 'destinationIndicator', - '2.5.4.28' => 'preferredDeliveryMethod', - '2.5.4.29' => 'presentationAddress', - '2.5.4.30' => 'supportedApplicationContext', - '2.5.4.31' => 'member', - '2.5.4.32' => 'owner', - '2.5.4.33' => 'roleOccupant', - '2.5.4.34' => 'seeAlso', - '2.5.4.35' => 'userPassword', - '2.5.4.36' => 'userCertificate', - '2.5.4.37' => 'cACertificate', - '2.5.4.38' => 'authorityRevocationList', - '2.5.4.39' => 'certificateRevocationList', - '2.5.4.40' => 'crossCertificatePair', - '2.5.4.41' => 'name', - '2.5.4.42' => 'givenName', - '2.5.4.43' => 'initials', - '2.5.4.44' => 'generationQualifier', - '2.5.4.45' => 'x500UniqueIdentifier', - '2.5.4.46' => 'dnQualifier', - '2.5.4.47' => 'enhancedSearchGuide', - '2.5.4.48' => 'protocolInformation', - '2.5.4.49' => 'distinguishedName', - '2.5.4.50' => 'uniqueMember', - '2.5.4.51' => 'houseIdentifier', - '2.5.4.52' => 'supportedAlgorithms', - '2.5.4.53' => 'deltaRevocationList', - '2.5.4.54' => 'dmdName', - '2.5.4.65' => 'pseudonym', - '2.5.4.72' => 'role', - '2.5.8' => 'directory services - algorithms', - '2.5.8.1.1' => 'rsa', - '2.5.8.3.100' => 'mdc2WithRSA', - '2.5.8.3.101' => 'mdc2', - '2.5.29' => 'id-ce', - '2.5.29.9' => 'X509v3 Subject Directory Attributes', - '2.5.29.14' => 'X509v3 Subject Key Identifier', - '2.5.29.15' => 'X509v3 Key Usage', - '2.5.29.16' => 'X509v3 Private Key Usage Period', - '2.5.29.17' => 'X509v3 Subject Alternative Name', - '2.5.29.18' => 'X509v3 Issuer Alternative Name', - '2.5.29.19' => 'X509v3 Basic Constraints', - '2.5.29.20' => 'X509v3 CRL Number', - '2.5.29.21' => 'X509v3 CRL Reason Code', - '2.5.29.24' => 'Invalidity Date', - '2.5.29.27' => 'X509v3 Delta CRL Indicator', - '2.5.29.28' => 'X509v3 Issuing Distribution Point', - '2.5.29.29' => 'X509v3 Certificate Issuer', - '2.5.29.30' => 'X509v3 Name Constraints', - '2.5.29.31' => 'X509v3 CRL Distribution Points', - '2.5.29.32' => 'X509v3 Certificate Policies', - '2.5.29.32.0' => 'X509v3 Any Policy', - '2.5.29.33' => 'X509v3 Policy Mappings', - '2.5.29.35' => 'X509v3 Authority Key Identifier', - '2.5.29.36' => 'X509v3 Policy Constraints', - '2.5.29.37' => 'X509v3 Extended Key Usage', - '2.5.29.46' => 'X509v3 Freshest CRL', - '2.5.29.54' => 'X509v3 Inhibit Any Policy', - '2.5.29.55' => 'X509v3 AC Targeting', - '2.5.29.56' => 'X509v3 No Revocation Available', - '2.5.29.37.0' => 'Any Extended Key Usage', - '2.16.840.1.113730' => 'Netscape Communications Corp.', - '2.16.840.1.113730.1' => 'Netscape Certificate Extension', - '2.16.840.1.113730.2' => 'Netscape Data Type', - '2.16.840.1.113730.1.1' => 'Netscape Cert Type', - '2.16.840.1.113730.1.2' => 'Netscape Base Url', - '2.16.840.1.113730.1.3' => 'Netscape Revocation Url', - '2.16.840.1.113730.1.4' => 'Netscape CA Revocation Url', - '2.16.840.1.113730.1.7' => 'Netscape Renewal Url', - '2.16.840.1.113730.1.8' => 'Netscape CA Policy Url', - '2.16.840.1.113730.1.12' => 'Netscape SSL Server Name', - '2.16.840.1.113730.1.13' => 'Netscape Comment', - '2.16.840.1.113730.2.5' => 'Netscape Certificate Sequence', - '2.16.840.1.113730.4.1' => 'Netscape Server Gated Crypto', - '1.3.6' => 'dod', - '1.3.6.1' => 'iana', - '1.3.6.1.1' => 'Directory', - '1.3.6.1.2' => 'Management', - '1.3.6.1.3' => 'Experimental', - '1.3.6.1.4' => 'Private', - '1.3.6.1.5' => 'Security', - '1.3.6.1.6' => 'SNMPv2', - '1.3.6.1.7' => 'Mail', - '1.3.6.1.4.1' => 'Enterprises', - '1.3.6.1.4.1.1466.344' => 'dcObject', - '1.2.840.113549.1.9.16.3.8' => 'zlib compression', - '2.16.840.1.101.3' => 'csor', - '2.16.840.1.101.3.4' => 'nistAlgorithms', - '2.16.840.1.101.3.4.1' => 'aes', - '2.16.840.1.101.3.4.1.1' => 'aes-128-ecb', - '2.16.840.1.101.3.4.1.2' => 'aes-128-cbc', - '2.16.840.1.101.3.4.1.3' => 'aes-128-ofb', - '2.16.840.1.101.3.4.1.4' => 'aes-128-cfb', - '2.16.840.1.101.3.4.1.5' => 'id-aes128-wrap', - '2.16.840.1.101.3.4.1.6' => 'aes-128-gcm', - '2.16.840.1.101.3.4.1.7' => 'aes-128-ccm', - '2.16.840.1.101.3.4.1.8' => 'id-aes128-wrap-pad', - '2.16.840.1.101.3.4.1.21' => 'aes-192-ecb', - '2.16.840.1.101.3.4.1.22' => 'aes-192-cbc', - '2.16.840.1.101.3.4.1.23' => 'aes-192-ofb', - '2.16.840.1.101.3.4.1.24' => 'aes-192-cfb', - '2.16.840.1.101.3.4.1.25' => 'id-aes192-wrap', - '2.16.840.1.101.3.4.1.26' => 'aes-192-gcm', - '2.16.840.1.101.3.4.1.27' => 'aes-192-ccm', - '2.16.840.1.101.3.4.1.28' => 'id-aes192-wrap-pad', - '2.16.840.1.101.3.4.1.41' => 'aes-256-ecb', - '2.16.840.1.101.3.4.1.42' => 'aes-256-cbc', - '2.16.840.1.101.3.4.1.43' => 'aes-256-ofb', - '2.16.840.1.101.3.4.1.44' => 'aes-256-cfb', - '2.16.840.1.101.3.4.1.45' => 'id-aes256-wrap', - '2.16.840.1.101.3.4.1.46' => 'aes-256-gcm', - '2.16.840.1.101.3.4.1.47' => 'aes-256-ccm', - '2.16.840.1.101.3.4.1.48' => 'id-aes256-wrap-pad', - '2.16.840.1.101.3.4.2' => 'nist_hashalgs', - '2.16.840.1.101.3.4.2.1' => 'sha256', - '2.16.840.1.101.3.4.2.2' => 'sha384', - '2.16.840.1.101.3.4.2.3' => 'sha512', - '2.16.840.1.101.3.4.2.4' => 'sha224', - '2.16.840.1.101.3.4.3' => 'dsa_with_sha2', - '2.16.840.1.101.3.4.3.1' => 'dsa_with_SHA224', - '2.16.840.1.101.3.4.3.2' => 'dsa_with_SHA256', - '2.5.29.23' => 'Hold Instruction Code', - '0.9' => 'data', - '0.9.2342' => 'pss', - '0.9.2342.19200300' => 'ucl', - '0.9.2342.19200300.100' => 'pilot', - '0.9.2342.19200300.100.1' => 'pilotAttributeType', - '0.9.2342.19200300.100.3' => 'pilotAttributeSyntax', - '0.9.2342.19200300.100.4' => 'pilotObjectClass', - '0.9.2342.19200300.100.10' => 'pilotGroups', - '2.23.42' => 'Secure Electronic Transactions', - '2.23.42.0' => 'content types', - '2.23.42.1' => 'message extensions', - '2.23.42.3' => 'set-attr', - '2.23.42.5' => 'set-policy', - '2.23.42.7' => 'certificate extensions', - '2.23.42.8' => 'set-brand', - '2.23.42.0.0' => 'setct-PANData', - '2.23.42.0.1' => 'setct-PANToken', - '2.23.42.0.2' => 'setct-PANOnly', - '2.23.42.0.3' => 'setct-OIData', - '2.23.42.0.4' => 'setct-PI', - '2.23.42.0.5' => 'setct-PIData', - '2.23.42.0.6' => 'setct-PIDataUnsigned', - '2.23.42.0.7' => 'setct-HODInput', - '2.23.42.0.8' => 'setct-AuthResBaggage', - '2.23.42.0.9' => 'setct-AuthRevReqBaggage', - '2.23.42.0.10' => 'setct-AuthRevResBaggage', - '2.23.42.0.11' => 'setct-CapTokenSeq', - '2.23.42.0.12' => 'setct-PInitResData', - '2.23.42.0.13' => 'setct-PI-TBS', - '2.23.42.0.14' => 'setct-PResData', - '2.23.42.0.16' => 'setct-AuthReqTBS', - '2.23.42.0.17' => 'setct-AuthResTBS', - '2.23.42.0.18' => 'setct-AuthResTBSX', - '2.23.42.0.19' => 'setct-AuthTokenTBS', - '2.23.42.0.20' => 'setct-CapTokenData', - '2.23.42.0.21' => 'setct-CapTokenTBS', - '2.23.42.0.22' => 'setct-AcqCardCodeMsg', - '2.23.42.0.23' => 'setct-AuthRevReqTBS', - '2.23.42.0.24' => 'setct-AuthRevResData', - '2.23.42.0.25' => 'setct-AuthRevResTBS', - '2.23.42.0.26' => 'setct-CapReqTBS', - '2.23.42.0.27' => 'setct-CapReqTBSX', - '2.23.42.0.28' => 'setct-CapResData', - '2.23.42.0.29' => 'setct-CapRevReqTBS', - '2.23.42.0.30' => 'setct-CapRevReqTBSX', - '2.23.42.0.31' => 'setct-CapRevResData', - '2.23.42.0.32' => 'setct-CredReqTBS', - '2.23.42.0.33' => 'setct-CredReqTBSX', - '2.23.42.0.34' => 'setct-CredResData', - '2.23.42.0.35' => 'setct-CredRevReqTBS', - '2.23.42.0.36' => 'setct-CredRevReqTBSX', - '2.23.42.0.37' => 'setct-CredRevResData', - '2.23.42.0.38' => 'setct-PCertReqData', - '2.23.42.0.39' => 'setct-PCertResTBS', - '2.23.42.0.40' => 'setct-BatchAdminReqData', - '2.23.42.0.41' => 'setct-BatchAdminResData', - '2.23.42.0.42' => 'setct-CardCInitResTBS', - '2.23.42.0.43' => 'setct-MeAqCInitResTBS', - '2.23.42.0.44' => 'setct-RegFormResTBS', - '2.23.42.0.45' => 'setct-CertReqData', - '2.23.42.0.46' => 'setct-CertReqTBS', - '2.23.42.0.47' => 'setct-CertResData', - '2.23.42.0.48' => 'setct-CertInqReqTBS', - '2.23.42.0.49' => 'setct-ErrorTBS', - '2.23.42.0.50' => 'setct-PIDualSignedTBE', - '2.23.42.0.51' => 'setct-PIUnsignedTBE', - '2.23.42.0.52' => 'setct-AuthReqTBE', - '2.23.42.0.53' => 'setct-AuthResTBE', - '2.23.42.0.54' => 'setct-AuthResTBEX', - '2.23.42.0.55' => 'setct-AuthTokenTBE', - '2.23.42.0.56' => 'setct-CapTokenTBE', - '2.23.42.0.57' => 'setct-CapTokenTBEX', - '2.23.42.0.58' => 'setct-AcqCardCodeMsgTBE', - '2.23.42.0.59' => 'setct-AuthRevReqTBE', - '2.23.42.0.60' => 'setct-AuthRevResTBE', - '2.23.42.0.61' => 'setct-AuthRevResTBEB', - '2.23.42.0.62' => 'setct-CapReqTBE', - '2.23.42.0.63' => 'setct-CapReqTBEX', - '2.23.42.0.64' => 'setct-CapResTBE', - '2.23.42.0.65' => 'setct-CapRevReqTBE', - '2.23.42.0.66' => 'setct-CapRevReqTBEX', - '2.23.42.0.67' => 'setct-CapRevResTBE', - '2.23.42.0.68' => 'setct-CredReqTBE', - '2.23.42.0.69' => 'setct-CredReqTBEX', - '2.23.42.0.70' => 'setct-CredResTBE', - '2.23.42.0.71' => 'setct-CredRevReqTBE', - '2.23.42.0.72' => 'setct-CredRevReqTBEX', - '2.23.42.0.73' => 'setct-CredRevResTBE', - '2.23.42.0.74' => 'setct-BatchAdminReqTBE', - '2.23.42.0.75' => 'setct-BatchAdminResTBE', - '2.23.42.0.76' => 'setct-RegFormReqTBE', - '2.23.42.0.77' => 'setct-CertReqTBE', - '2.23.42.0.78' => 'setct-CertReqTBEX', - '2.23.42.0.79' => 'setct-CertResTBE', - '2.23.42.0.80' => 'setct-CRLNotificationTBS', - '2.23.42.0.81' => 'setct-CRLNotificationResTBS', - '2.23.42.0.82' => 'setct-BCIDistributionTBS', - '2.23.42.1.1' => 'generic cryptogram', - '2.23.42.1.3' => 'merchant initiated auth', - '2.23.42.1.4' => 'setext-pinSecure', - '2.23.42.1.5' => 'setext-pinAny', - '2.23.42.1.7' => 'setext-track2', - '2.23.42.1.8' => 'additional verification', - '2.23.42.5.0' => 'set-policy-root', - '2.23.42.7.0' => 'setCext-hashedRoot', - '2.23.42.7.1' => 'setCext-certType', - '2.23.42.7.2' => 'setCext-merchData', - '2.23.42.7.3' => 'setCext-cCertRequired', - '2.23.42.7.4' => 'setCext-tunneling', - '2.23.42.7.5' => 'setCext-setExt', - '2.23.42.7.6' => 'setCext-setQualf', - '2.23.42.7.7' => 'setCext-PGWYcapabilities', - '2.23.42.7.8' => 'setCext-TokenIdentifier', - '2.23.42.7.9' => 'setCext-Track2Data', - '2.23.42.7.10' => 'setCext-TokenType', - '2.23.42.7.11' => 'setCext-IssuerCapabilities', - '2.23.42.3.0' => 'setAttr-Cert', - '2.23.42.3.1' => 'payment gateway capabilities', - '2.23.42.3.2' => 'setAttr-TokenType', - '2.23.42.3.3' => 'issuer capabilities', - '2.23.42.3.0.0' => 'set-rootKeyThumb', - '2.23.42.3.0.1' => 'set-addPolicy', - '2.23.42.3.2.1' => 'setAttr-Token-EMV', - '2.23.42.3.2.2' => 'setAttr-Token-B0Prime', - '2.23.42.3.3.3' => 'setAttr-IssCap-CVM', - '2.23.42.3.3.4' => 'setAttr-IssCap-T2', - '2.23.42.3.3.5' => 'setAttr-IssCap-Sig', - '2.23.42.3.3.3.1' => 'generate cryptogram', - '2.23.42.3.3.4.1' => 'encrypted track 2', - '2.23.42.3.3.4.2' => 'cleartext track 2', - '2.23.42.3.3.5.1' => 'ICC or token signature', - '2.23.42.3.3.5.2' => 'secure device signature', - '2.23.42.8.1' => 'set-brand-IATA-ATA', - '2.23.42.8.30' => 'set-brand-Diners', - '2.23.42.8.34' => 'set-brand-AmericanExpress', - '2.23.42.8.35' => 'set-brand-JCB', - '2.23.42.8.4' => 'set-brand-Visa', - '2.23.42.8.5' => 'set-brand-MasterCard', - '2.23.42.8.6011' => 'set-brand-Novus', - '1.2.840.113549.3.10' => 'des-cdmf', - '1.2.840.113549.1.1.6' => 'rsaOAEPEncryptionSET', - '1.0.10118.3.0.55' => 'whirlpool', - '1.2.643.2.2' => 'cryptopro', - '1.2.643.2.9' => 'cryptocom', - '1.2.643.2.2.3' => 'GOST R 34.11-94 with GOST R 34.10-2001', - '1.2.643.2.2.4' => 'GOST R 34.11-94 with GOST R 34.10-94', - '1.2.643.2.2.9' => 'GOST R 34.11-94', - '1.2.643.2.2.10' => 'HMAC GOST 34.11-94', - '1.2.643.2.2.19' => 'GOST R 34.10-2001', - '1.2.643.2.2.20' => 'GOST R 34.10-94', - '1.2.643.2.2.21' => 'GOST 28147-89', - '1.2.643.2.2.22' => 'GOST 28147-89 MAC', - '1.2.643.2.2.23' => 'GOST R 34.11-94 PRF', - '1.2.643.2.2.98' => 'GOST R 34.10-2001 DH', - '1.2.643.2.2.99' => 'GOST R 34.10-94 DH', - '1.2.643.2.2.14.1' => 'id-Gost28147-89-CryptoPro-KeyMeshing', - '1.2.643.2.2.14.0' => 'id-Gost28147-89-None-KeyMeshing', - '1.2.643.2.2.30.0' => 'id-GostR3411-94-TestParamSet', - '1.2.643.2.2.30.1' => 'id-GostR3411-94-CryptoProParamSet', - '1.2.643.2.2.31.0' => 'id-Gost28147-89-TestParamSet', - '1.2.643.2.2.31.1' => 'id-Gost28147-89-CryptoPro-A-ParamSet', - '1.2.643.2.2.31.2' => 'id-Gost28147-89-CryptoPro-B-ParamSet', - '1.2.643.2.2.31.3' => 'id-Gost28147-89-CryptoPro-C-ParamSet', - '1.2.643.2.2.31.4' => 'id-Gost28147-89-CryptoPro-D-ParamSet', - '1.2.643.2.2.31.5' => 'id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet', - '1.2.643.2.2.31.6' => 'id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet', - '1.2.643.2.2.31.7' => 'id-Gost28147-89-CryptoPro-RIC-1-ParamSet', - '1.2.643.2.2.32.0' => 'id-GostR3410-94-TestParamSet', - '1.2.643.2.2.32.2' => 'id-GostR3410-94-CryptoPro-A-ParamSet', - '1.2.643.2.2.32.3' => 'id-GostR3410-94-CryptoPro-B-ParamSet', - '1.2.643.2.2.32.4' => 'id-GostR3410-94-CryptoPro-C-ParamSet', - '1.2.643.2.2.32.5' => 'id-GostR3410-94-CryptoPro-D-ParamSet', - '1.2.643.2.2.33.1' => 'id-GostR3410-94-CryptoPro-XchA-ParamSet', - '1.2.643.2.2.33.2' => 'id-GostR3410-94-CryptoPro-XchB-ParamSet', - '1.2.643.2.2.33.3' => 'id-GostR3410-94-CryptoPro-XchC-ParamSet', - '1.2.643.2.2.35.0' => 'id-GostR3410-2001-TestParamSet', - '1.2.643.2.2.35.1' => 'id-GostR3410-2001-CryptoPro-A-ParamSet', - '1.2.643.2.2.35.2' => 'id-GostR3410-2001-CryptoPro-B-ParamSet', - '1.2.643.2.2.35.3' => 'id-GostR3410-2001-CryptoPro-C-ParamSet', - '1.2.643.2.2.36.0' => 'id-GostR3410-2001-CryptoPro-XchA-ParamSet', - '1.2.643.2.2.36.1' => 'id-GostR3410-2001-CryptoPro-XchB-ParamSet', - '1.2.643.2.2.20.1' => 'id-GostR3410-94-a', - '1.2.643.2.2.20.2' => 'id-GostR3410-94-aBis', - '1.2.643.2.2.20.3' => 'id-GostR3410-94-b', - '1.2.643.2.2.20.4' => 'id-GostR3410-94-bBis', - '1.2.643.2.9.1.6.1' => 'GOST 28147-89 Cryptocom ParamSet', - '1.2.643.2.9.1.5.3' => 'GOST 34.10-94 Cryptocom', - '1.2.643.2.9.1.5.4' => 'GOST 34.10-2001 Cryptocom', - '1.2.643.2.9.1.3.3' => 'GOST R 34.11-94 with GOST R 34.10-94 Cryptocom', - '1.2.643.2.9.1.3.4' => 'GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom', - '1.2.643.2.9.1.8.1' => 'GOST R 3410-2001 Parameter Set Cryptocom', - '1.2.392.200011.61.1.1.1.2' => 'camellia-128-cbc', - '1.2.392.200011.61.1.1.1.3' => 'camellia-192-cbc', - '1.2.392.200011.61.1.1.1.4' => 'camellia-256-cbc', - '1.2.392.200011.61.1.1.3.2' => 'id-camellia128-wrap', - '1.2.392.200011.61.1.1.3.3' => 'id-camellia192-wrap', - '1.2.392.200011.61.1.1.3.4' => 'id-camellia256-wrap', - '0.3.4401.5' => 'ntt-ds', - '0.3.4401.5.3.1.9' => 'camellia', - '0.3.4401.5.3.1.9.1' => 'camellia-128-ecb', - '0.3.4401.5.3.1.9.3' => 'camellia-128-ofb', - '0.3.4401.5.3.1.9.4' => 'camellia-128-cfb', - '0.3.4401.5.3.1.9.6' => 'camellia-128-gcm', - '0.3.4401.5.3.1.9.7' => 'camellia-128-ccm', - '0.3.4401.5.3.1.9.9' => 'camellia-128-ctr', - '0.3.4401.5.3.1.9.10' => 'camellia-128-cmac', - '0.3.4401.5.3.1.9.21' => 'camellia-192-ecb', - '0.3.4401.5.3.1.9.23' => 'camellia-192-ofb', - '0.3.4401.5.3.1.9.24' => 'camellia-192-cfb', - '0.3.4401.5.3.1.9.26' => 'camellia-192-gcm', - '0.3.4401.5.3.1.9.27' => 'camellia-192-ccm', - '0.3.4401.5.3.1.9.29' => 'camellia-192-ctr', - '0.3.4401.5.3.1.9.30' => 'camellia-192-cmac', - '0.3.4401.5.3.1.9.41' => 'camellia-256-ecb', - '0.3.4401.5.3.1.9.43' => 'camellia-256-ofb', - '0.3.4401.5.3.1.9.44' => 'camellia-256-cfb', - '0.3.4401.5.3.1.9.46' => 'camellia-256-gcm', - '0.3.4401.5.3.1.9.47' => 'camellia-256-ccm', - '0.3.4401.5.3.1.9.49' => 'camellia-256-ctr', - '0.3.4401.5.3.1.9.50' => 'camellia-256-cmac', - '1.2.410.200004' => 'kisa', - '1.2.410.200004.1.3' => 'seed-ecb', - '1.2.410.200004.1.4' => 'seed-cbc', - '1.2.410.200004.1.5' => 'seed-cfb', - '1.2.410.200004.1.6' => 'seed-ofb', - '1.2.840.10046.2.1' => 'X9.42 DH', - '1.3.36.3.3.2.8.1.1.1' => 'brainpoolP160r1', - '1.3.36.3.3.2.8.1.1.2' => 'brainpoolP160t1', - '1.3.36.3.3.2.8.1.1.3' => 'brainpoolP192r1', - '1.3.36.3.3.2.8.1.1.4' => 'brainpoolP192t1', - '1.3.36.3.3.2.8.1.1.5' => 'brainpoolP224r1', - '1.3.36.3.3.2.8.1.1.6' => 'brainpoolP224t1', - '1.3.36.3.3.2.8.1.1.7' => 'brainpoolP256r1', - '1.3.36.3.3.2.8.1.1.8' => 'brainpoolP256t1', - '1.3.36.3.3.2.8.1.1.9' => 'brainpoolP320r1', - '1.3.36.3.3.2.8.1.1.10' => 'brainpoolP320t1', - '1.3.36.3.3.2.8.1.1.11' => 'brainpoolP384r1', - '1.3.36.3.3.2.8.1.1.12' => 'brainpoolP384t1', - '1.3.36.3.3.2.8.1.1.13' => 'brainpoolP512r1', - '1.3.36.3.3.2.8.1.1.14' => 'brainpoolP512t1', - '1.3.133.16.840.63.0' => 'x9-63-scheme', - '1.3.132.1' => 'secg-scheme', - '1.3.133.16.840.63.0.2' => 'dhSinglePass-stdDH-sha1kdf-scheme', - '1.3.132.1.11.0' => 'dhSinglePass-stdDH-sha224kdf-scheme', - '1.3.132.1.11.1' => 'dhSinglePass-stdDH-sha256kdf-scheme', - '1.3.132.1.11.2' => 'dhSinglePass-stdDH-sha384kdf-scheme', - '1.3.132.1.11.3' => 'dhSinglePass-stdDH-sha512kdf-scheme', - '1.3.133.16.840.63.0.3' => 'dhSinglePass-cofactorDH-sha1kdf-scheme', - '1.3.132.1.14.0' => 'dhSinglePass-cofactorDH-sha224kdf-scheme', - '1.3.132.1.14.1' => 'dhSinglePass-cofactorDH-sha256kdf-scheme', - '1.3.132.1.14.2' => 'dhSinglePass-cofactorDH-sha384kdf-scheme', - '1.3.132.1.14.3' => 'dhSinglePass-cofactorDH-sha512kdf-scheme', - '1.3.6.1.4.1.11129.2.4.2' => 'CT Precertificate SCTs', - '1.3.6.1.4.1.11129.2.4.3' => 'CT Precertificate Poison', - '1.3.6.1.4.1.11129.2.4.4' => 'CT Precertificate Signer', - '1.3.6.1.4.1.11129.2.4.5' => 'CT Certificate SCTs', - '1.3.6.1.4.1.311.60.2.1.1' => 'jurisdictionLocalityName', - '1.3.6.1.4.1.311.60.2.1.2' => 'jurisdictionStateOrProvinceName', - '1.3.6.1.4.1.311.60.2.1.3' => 'jurisdictionCountryName', - '1.3.6.1.4.1.11591.4.11' => 'id-scrypt', - ]; - - if (array_key_exists($oidString, $oids)) { - return $oids[$oidString]; - } - - switch ($oidString) { - case self::RSA_ENCRYPTION: - return 'RSA Encryption'; - case self::MD5_WITH_RSA_ENCRYPTION: - return 'MD5 with RSA Encryption'; - case self::SHA1_WITH_RSA_SIGNATURE: - return 'SHA-1 with RSA Signature'; - - case self::PKCS9_EMAIL: - return 'PKCS #9 Email Address'; - case self::PKCS9_UNSTRUCTURED_NAME: - return 'PKCS #9 Unstructured Name'; - case self::PKCS9_CONTENT_TYPE: - return 'PKCS #9 Content Type'; - case self::PKCS9_MESSAGE_DIGEST: - return 'PKCS #9 Message Digest'; - case self::PKCS9_SIGNING_TIME: - return 'PKCS #9 Signing Time'; - - case self::COMMON_NAME: - return 'Common Name'; - case self::SURNAME: - return 'Surname'; - case self::SERIAL_NUMBER: - return 'Serial Number'; - case self::COUNTRY_NAME: - return 'Country Name'; - case self::LOCALITY_NAME: - return 'Locality Name'; - case self::STATE_OR_PROVINCE_NAME: - return 'State or Province Name'; - case self::STREET_ADDRESS: - return 'Street Address'; - case self::ORGANIZATION_NAME: - return 'Organization Name'; - case self::OU_NAME: - return 'Organization Unit Name'; - case self::TITLE: - return 'Title'; - case self::DESCRIPTION: - return 'Description'; - case self::POSTAL_ADDRESS: - return 'Postal Address'; - case self::POSTAL_CODE: - return 'Postal Code'; - case self::AUTHORITY_REVOCATION_LIST: - return 'Authority Revocation List'; - - case self::CERT_EXT_SUBJECT_DIRECTORY_ATTR: - return 'Subject directory attributes'; - case self::CERT_EXT_SUBJECT_KEY_IDENTIFIER: - return 'Subject key identifier'; - case self::CERT_EXT_KEY_USAGE: - return 'Key usage certificate extension'; - case self::CERT_EXT_PRIVATE_KEY_USAGE_PERIOD: - return 'Private key usage'; - case self::CERT_EXT_SUBJECT_ALT_NAME: - return 'Subject alternative name (SAN)'; - case self::CERT_EXT_ISSUER_ALT_NAME: - return 'Issuer alternative name'; - case self::CERT_EXT_BASIC_CONSTRAINTS: - return 'Basic constraints'; - case self::CERT_EXT_CRL_NUMBER: - return 'CRL number'; - case self::CERT_EXT_REASON_CODE: - return 'Reason code'; - case self::CERT_EXT_INVALIDITY_DATE: - return 'Invalidity code'; - case self::CERT_EXT_DELTA_CRL_INDICATOR: - return 'Delta CRL indicator'; - case self::CERT_EXT_ISSUING_DIST_POINT: - return 'Issuing distribution point'; - case self::CERT_EXT_CERT_ISSUER: - return 'Certificate issuer'; - case self::CERT_EXT_NAME_CONSTRAINTS: - return 'Name constraints'; - case self::CERT_EXT_CRL_DISTRIBUTION_POINTS: - return 'CRL distribution points'; - case self::CERT_EXT_CERT_POLICIES: - return 'Certificate policies '; - case self::CERT_EXT_AUTHORITY_KEY_IDENTIFIER: - return 'Authority key identifier'; - case self::CERT_EXT_EXTENDED_KEY_USAGE: - return 'Extended key usage'; - case self::AUTHORITY_INFORMATION_ACCESS: - return 'Certificate Authority Information Access (AIA)'; - - default: - if ($loadFromWeb) { - return self::loadFromWeb($oidString); - } else { - return $oidString; - } - } - } - - public static function loadFromWeb($oidString) - { - $ch = curl_init("http://oid-info.com/get/{$oidString}"); - - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_HEADER, 0); - - $contents = curl_exec($ch); - curl_close($ch); - - // This pattern needs to be updated as soon as the website layout of oid-info.com changes - preg_match_all('#(.+)\(\d+\)#si', $contents, $oidName); - - if (empty($oidName[1])) { - return "{$oidString} (unknown)"; - } - - $oidName = ucfirst(strtolower(preg_replace('/([A-Z][a-z])/', ' $1', $oidName[1][0]))); - $oidName = str_replace('-', ' ', $oidName); - - return "{$oidName} ({$oidString})"; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php deleted file mode 100644 index fa66b558..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use FG\ASN1\Exception\ParserException; - -/** - * The Parsable interface describes classes that can be parsed from their binary DER representation. - */ -interface Parsable -{ - /** - * Parse an instance of this class from its binary DER encoded representation. - * - * @param string $binaryData - * @param int $offsetIndex the offset at which parsing of the $binaryData is started. This parameter ill be modified - * to contain the offset index of the next object after this object has been parsed - * - * @throws ParserException if the given binary data is either invalid or not currently supported - * - * @return static - */ - public static function fromBinary(&$binaryData, &$offsetIndex = null); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php deleted file mode 100644 index 90a40b03..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/TemplateParser.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -use Exception; -use FG\ASN1\Exception\ParserException; -use FG\ASN1\Universal\Sequence; - -class TemplateParser -{ - /** - * @param string $data - * @param array $template - * @return \FG\ASN1\ASNObject|Sequence - * @throws ParserException if there was an issue parsing - */ - public function parseBase64($data, array $template) - { - // TODO test with invalid data - return $this->parseBinary(base64_decode($data), $template); - } - - /** - * @param string $binary - * @param array $template - * @return \FG\ASN1\ASNObject|Sequence - * @throws ParserException if there was an issue parsing - */ - public function parseBinary($binary, array $template) - { - $parsedObject = ASNObject::fromBinary($binary); - - foreach ($template as $key => $value) { - $this->validate($parsedObject, $key, $value); - } - - return $parsedObject; - } - - private function validate(ASNObject $object, $key, $value) - { - if (is_array($value)) { - $this->assertTypeId($key, $object); - - /* @var Construct $object */ - foreach ($value as $key => $child) { - $this->validate($object->current(), $key, $child); - $object->next(); - } - } else { - $this->assertTypeId($value, $object); - } - } - - private function assertTypeId($expectedTypeId, ASNObject $object) - { - $actualType = $object->getType(); - if ($expectedTypeId != $actualType) { - throw new Exception("Expected type ($expectedTypeId) does not match actual type ($actualType"); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php deleted file mode 100644 index 83ec6a91..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class BMPString extends AbstractString -{ - /** - * Creates a new ASN.1 BMP String. - * - * BMPString is a subtype of UniversalString that has its own - * unique tag and contains only the characters in the - * Basic Multilingual Plane (those corresponding to the first - * 64K-2 cells, less cells whose encoding is used to address - * characters outside the Basic Multilingual Plane) of ISO/IEC 10646-1. - * - * TODO The encodable characters of this type are not yet checked. - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::BMP_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php deleted file mode 100644 index 226695c5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/BitString.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use Exception; -use FG\ASN1\Exception\ParserException; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; - -class BitString extends OctetString implements Parsable -{ - private $nrOfUnusedBits; - - /** - * Creates a new ASN.1 BitString object. - * - * @param string|int $value Either the hexadecimal value as a string (spaces are allowed - leading 0x is optional) or a numeric value - * @param int $nrOfUnusedBits the number of unused bits in the last octet [optional]. - * - * @throws Exception if the second parameter is no positive numeric value - */ - public function __construct($value, $nrOfUnusedBits = 0) - { - parent::__construct($value); - - if (!is_numeric($nrOfUnusedBits) || $nrOfUnusedBits < 0) { - throw new Exception('BitString: second parameter needs to be a positive number (or zero)!'); - } - - $this->nrOfUnusedBits = $nrOfUnusedBits; - } - - public function getType() - { - return Identifier::BITSTRING; - } - - protected function calculateContentLength() - { - // add one to the length for the first octet which encodes the number of unused bits in the last octet - return parent::calculateContentLength() + 1; - } - - protected function getEncodedValue() - { - // the first octet determines the number of unused bits - $nrOfUnusedBitsOctet = chr($this->nrOfUnusedBits); - $actualContent = parent::getEncodedValue(); - - return $nrOfUnusedBitsOctet.$actualContent; - } - - public function getNumberOfUnusedBits() - { - return $this->nrOfUnusedBits; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::BITSTRING, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex, 2); - - $nrOfUnusedBits = ord($binaryData[$offsetIndex]); - $value = substr($binaryData, $offsetIndex + 1, $contentLength - 1); - - if ($nrOfUnusedBits > 7 || // no less than 1 used, otherwise non-minimal - ($contentLength - 1) == 1 && $nrOfUnusedBits > 0 || // content length only 1, no - (ord($value[strlen($value)-1])&((1<<$nrOfUnusedBits)-1)) != 0 // unused bits set - ) { - throw new ParserException("Can not parse bit string with invalid padding", $offsetIndex); - } - - $offsetIndex += $contentLength; - - $parsedObject = new self(bin2hex($value), $nrOfUnusedBits); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php deleted file mode 100644 index b73c99f1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Boolean.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\ASNObject; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Exception\ParserException; - -class Boolean extends ASNObject implements Parsable -{ - private $value; - - /** - * @param bool $value - */ - public function __construct($value) - { - $this->value = $value; - } - - public function getType() - { - return Identifier::BOOLEAN; - } - - protected function calculateContentLength() - { - return 1; - } - - protected function getEncodedValue() - { - if ($this->value == false) { - return chr(0x00); - } else { - return chr(0xFF); - } - } - - public function getContent() - { - if ($this->value == true) { - return 'TRUE'; - } else { - return 'FALSE'; - } - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::BOOLEAN, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - - if ($contentLength != 1) { - throw new ParserException("An ASN.1 Boolean should not have a length other than one. Extracted length was {$contentLength}", $offsetIndex); - } - - $value = ord($binaryData[$offsetIndex++]); - $booleanValue = $value == 0xFF ? true : false; - - $parsedObject = new self($booleanValue); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php deleted file mode 100644 index bfc170db..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class CharacterString extends AbstractString -{ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::CHARACTER_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php deleted file mode 100644 index 06d04a3a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\Identifier; - -class Enumerated extends Integer -{ - public function getType() - { - return Identifier::ENUMERATED; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php deleted file mode 100644 index fb0346f0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class GeneralString extends AbstractString -{ - /** - * Creates a new ASN.1 GeneralString. - * TODO The encodable characters of this type are not yet checked. - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::GENERAL_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php deleted file mode 100644 index ca922097..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralizedTime.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractTime; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Exception\ParserException; - -/** - * This ASN.1 universal type contains date and time information according to ISO 8601. - * - * The type consists of values representing: - * a) a calendar date, as defined in ISO 8601; and - * b) a time of day, to any of the precisions defined in ISO 8601, except for the hours value 24 which shall not be used; and - * c) the local time differential factor as defined in ISO 8601. - * - * Decoding of this type will accept the Basic Encoding Rules (BER) - * The encoding will comply with the Distinguished Encoding Rules (DER). - */ -class GeneralizedTime extends AbstractTime implements Parsable -{ - private $microseconds; - - public function __construct($dateTime = null, $dateTimeZone = 'UTC') - { - parent::__construct($dateTime, $dateTimeZone); - $this->microseconds = $this->value->format('u'); - if ($this->containsFractionalSecondsElement()) { - // DER requires us to remove trailing zeros - $this->microseconds = preg_replace('/([1-9]+)0+$/', '$1', $this->microseconds); - } - } - - public function getType() - { - return Identifier::GENERALIZED_TIME; - } - - protected function calculateContentLength() - { - $contentSize = 15; // YYYYMMDDHHmmSSZ - - if ($this->containsFractionalSecondsElement()) { - $contentSize += 1 + strlen($this->microseconds); - } - - return $contentSize; - } - - public function containsFractionalSecondsElement() - { - return intval($this->microseconds) > 0; - } - - protected function getEncodedValue() - { - $encodedContent = $this->value->format('YmdHis'); - if ($this->containsFractionalSecondsElement()) { - $encodedContent .= ".{$this->microseconds}"; - } - - return $encodedContent.'Z'; - } - - public function __toString() - { - if ($this->containsFractionalSecondsElement()) { - return $this->value->format("Y-m-d\tH:i:s.uP"); - } else { - return $this->value->format("Y-m-d\tH:i:sP"); - } - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::GENERALIZED_TIME, $offsetIndex++); - $lengthOfMinimumTimeString = 14; // YYYYMMDDHHmmSS - $contentLength = self::parseContentLength($binaryData, $offsetIndex, $lengthOfMinimumTimeString); - $maximumBytesToRead = $contentLength; - - $format = 'YmdGis'; - $content = substr($binaryData, $offsetIndex, $contentLength); - $dateTimeString = substr($content, 0, $lengthOfMinimumTimeString); - $offsetIndex += $lengthOfMinimumTimeString; - $maximumBytesToRead -= $lengthOfMinimumTimeString; - - if ($contentLength == $lengthOfMinimumTimeString) { - $localTimeZone = new \DateTimeZone(date_default_timezone_get()); - $dateTime = \DateTime::createFromFormat($format, $dateTimeString, $localTimeZone); - } else { - if ($binaryData[$offsetIndex] == '.') { - $maximumBytesToRead--; // account for the '.' - $nrOfFractionalSecondElements = 1; // account for the '.' - - while ($maximumBytesToRead > 0 - && $binaryData[$offsetIndex + $nrOfFractionalSecondElements] != '+' - && $binaryData[$offsetIndex + $nrOfFractionalSecondElements] != '-' - && $binaryData[$offsetIndex + $nrOfFractionalSecondElements] != 'Z') { - $nrOfFractionalSecondElements++; - $maximumBytesToRead--; - } - - $dateTimeString .= substr($binaryData, $offsetIndex, $nrOfFractionalSecondElements); - $offsetIndex += $nrOfFractionalSecondElements; - $format .= '.u'; - } - - $dateTime = \DateTime::createFromFormat($format, $dateTimeString, new \DateTimeZone('UTC')); - - if ($maximumBytesToRead > 0) { - if ($binaryData[$offsetIndex] == '+' - || $binaryData[$offsetIndex] == '-') { - $dateTime = static::extractTimeZoneData($binaryData, $offsetIndex, $dateTime); - } elseif ($binaryData[$offsetIndex++] != 'Z') { - throw new ParserException('Invalid ISO 8601 Time String', $offsetIndex); - } - } - } - - $parsedObject = new self($dateTime); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php deleted file mode 100644 index 4a01d67b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class GraphicString extends AbstractString -{ - /** - * Creates a new ASN.1 Graphic String. - * TODO The encodable characters of this type are not yet checked. - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::GRAPHIC_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php deleted file mode 100644 index 33a80679..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -/** - * The International Alphabet No.5 (IA5) references the encoding of the ASCII characters. - * - * Each character in the data is encoded as 1 byte. - */ -class IA5String extends AbstractString -{ - public function __construct($string) - { - parent::__construct($string); - for ($i = 1; $i < 128; $i++) { - $this->allowCharacter(chr($i)); - } - } - - public function getType() - { - return Identifier::IA5_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php deleted file mode 100644 index fe3806ba..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Integer.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use Exception; -use FG\Utility\BigInteger; -use FG\ASN1\Exception\ParserException; -use FG\ASN1\ASNObject; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; - -class Integer extends ASNObject implements Parsable -{ - /** @var int */ - private $value; - - /** - * @param int $value - * - * @throws Exception if the value is not numeric - */ - public function __construct($value) - { - if (is_numeric($value) == false) { - throw new Exception("Invalid VALUE [{$value}] for ASN1_INTEGER"); - } - $this->value = $value; - } - - public function getType() - { - return Identifier::INTEGER; - } - - public function getContent() - { - return $this->value; - } - - protected function calculateContentLength() - { - return strlen($this->getEncodedValue()); - } - - protected function getEncodedValue() - { - $value = BigInteger::create($this->value, 10); - $negative = $value->compare(0) < 0; - if ($negative) { - $value = $value->absoluteValue(); - $limit = 0x80; - } else { - $limit = 0x7f; - } - - $mod = 0xff+1; - $values = []; - while($value->compare($limit) > 0) { - $values[] = $value->modulus($mod)->toInteger(); - $value = $value->shiftRight(8); - } - - $values[] = $value->modulus($mod)->toInteger(); - $numValues = count($values); - - if ($negative) { - for ($i = 0; $i < $numValues; $i++) { - $values[$i] = 0xff - $values[$i]; - } - for ($i = 0; $i < $numValues; $i++) { - $values[$i] += 1; - if ($values[$i] <= 0xff) { - break; - } - assert($i != $numValues - 1); - $values[$i] = 0; - } - if ($values[$numValues - 1] == 0x7f) { - $values[] = 0xff; - } - } - $values = array_reverse($values); - $r = pack("C*", ...$values); - return $r; - } - - private static function ensureMinimalEncoding($binaryData, $offsetIndex) - { - // All the first nine bits cannot equal 0 or 1, which would - // be non-minimal encoding for positive and negative integers respectively - if ((ord($binaryData[$offsetIndex]) == 0x00 && (ord($binaryData[$offsetIndex+1]) & 0x80) == 0) || - (ord($binaryData[$offsetIndex]) == 0xff && (ord($binaryData[$offsetIndex+1]) & 0x80) == 0x80)) { - throw new ParserException("Integer not minimally encoded", $offsetIndex); - } - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - $parsedObject = new static(0); - self::parseIdentifier($binaryData[$offsetIndex], $parsedObject->getType(), $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex, 1); - - if ($contentLength > 1) { - self::ensureMinimalEncoding($binaryData, $offsetIndex); - } - $isNegative = (ord($binaryData[$offsetIndex]) & 0x80) != 0x00; - $number = BigInteger::create(ord($binaryData[$offsetIndex++]) & 0x7F); - - for ($i = 0; $i < $contentLength - 1; $i++) { - $number = $number->multiply(0x100)->add(ord($binaryData[$offsetIndex++])); - } - - if ($isNegative) { - $number = $number->subtract(BigInteger::create(2)->toPower(8 * $contentLength - 1)); - } - - $parsedObject = new static((string)$number); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php deleted file mode 100644 index b5293e4b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\ASNObject; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Exception\ParserException; - -class NullObject extends ASNObject implements Parsable -{ - public function getType() - { - return Identifier::NULL; - } - - protected function calculateContentLength() - { - return 0; - } - - protected function getEncodedValue() - { - return null; - } - - public function getContent() - { - return 'NULL'; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::NULL, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - - if ($contentLength != 0) { - throw new ParserException("An ASN.1 Null should not have a length other than zero. Extracted length was {$contentLength}", $offsetIndex); - } - - $parsedObject = new self(); - $parsedObject->setContentLength(0); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php deleted file mode 100644 index 13fb7c34..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class NumericString extends AbstractString -{ - /** - * Creates a new ASN.1 NumericString. - * - * The following characters are permitted: - * Digits 0,1, ... 9 - * SPACE (space) - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowNumbers(); - $this->allowSpaces(); - } - - public function getType() - { - return Identifier::NUMERIC_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php deleted file mode 100644 index 1c5d3498..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\Identifier; - -class ObjectDescriptor extends GraphicString -{ - public function __construct($objectDescription) - { - parent::__construct($objectDescription); - } - - public function getType() - { - return Identifier::OBJECT_DESCRIPTOR; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php deleted file mode 100644 index 150ce9c4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectIdentifier.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use Exception; -use FG\ASN1\Base128; -use FG\ASN1\OID; -use FG\ASN1\ASNObject; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Exception\ParserException; - -class ObjectIdentifier extends ASNObject implements Parsable -{ - protected $subIdentifiers; - protected $value; - - public function __construct($value) - { - $this->subIdentifiers = explode('.', $value); - $nrOfSubIdentifiers = count($this->subIdentifiers); - - for ($i = 0; $i < $nrOfSubIdentifiers; $i++) { - if (is_numeric($this->subIdentifiers[$i])) { - // enforce the integer type - $this->subIdentifiers[$i] = intval($this->subIdentifiers[$i]); - } else { - throw new Exception("[{$value}] is no valid object identifier (sub identifier ".($i + 1).' is not numeric)!'); - } - } - - // Merge the first to arcs of the OID registration tree (per ASN definition!) - if ($nrOfSubIdentifiers >= 2) { - $this->subIdentifiers[1] = ($this->subIdentifiers[0] * 40) + $this->subIdentifiers[1]; - unset($this->subIdentifiers[0]); - } - - $this->value = $value; - } - - public function getContent() - { - return $this->value; - } - - public function getType() - { - return Identifier::OBJECT_IDENTIFIER; - } - - protected function calculateContentLength() - { - $length = 0; - foreach ($this->subIdentifiers as $subIdentifier) { - do { - $subIdentifier = $subIdentifier >> 7; - $length++; - } while ($subIdentifier > 0); - } - - return $length; - } - - protected function getEncodedValue() - { - $encodedValue = ''; - foreach ($this->subIdentifiers as $subIdentifier) { - $encodedValue .= Base128::encode($subIdentifier); - } - - return $encodedValue; - } - - public function __toString() - { - return OID::getName($this->value); - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::OBJECT_IDENTIFIER, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex, 1); - - $firstOctet = ord($binaryData[$offsetIndex++]); - $oidString = floor($firstOctet / 40).'.'.($firstOctet % 40); - $oidString .= '.'.self::parseOid($binaryData, $offsetIndex, $contentLength - 1); - - $parsedObject = new self($oidString); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } - - /** - * Parses an object identifier except for the first octet, which is parsed - * differently. This way relative object identifiers can also be parsed - * using this. - * - * @param $binaryData - * @param $offsetIndex - * @param $octetsToRead - * - * @throws ParserException - * - * @return string - */ - protected static function parseOid(&$binaryData, &$offsetIndex, $octetsToRead) - { - $oid = ''; - - while ($octetsToRead > 0) { - $octets = ''; - - do { - if (0 === $octetsToRead) { - throw new ParserException('Malformed ASN.1 Object Identifier', $offsetIndex - 1); - } - - $octetsToRead--; - $octet = $binaryData[$offsetIndex++]; - $octets .= $octet; - } while (ord($octet) & 0x80); - - $oid .= sprintf('%d.', Base128::decode($octets)); - } - - // Remove trailing '.' - return substr($oid, 0, -1) ?: ''; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php deleted file mode 100644 index 5d69ae7b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/OctetString.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use Exception; -use FG\ASN1\ASNObject; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; - -class OctetString extends ASNObject implements Parsable -{ - protected $value; - - public function __construct($value) - { - if (is_string($value)) { - // remove gaps between hex digits - $value = preg_replace('/\s|0x/', '', $value); - } elseif (is_numeric($value)) { - $value = dechex($value); - } elseif ($value === null) { - return; - } else { - throw new Exception('OctetString: unrecognized input type!'); - } - - if (strlen($value) % 2 != 0) { - // transform values like 1F2 to 01F2 - $value = '0'.$value; - } - - $this->value = $value; - } - - public function getType() - { - return Identifier::OCTETSTRING; - } - - protected function calculateContentLength() - { - return strlen($this->value) / 2; - } - - protected function getEncodedValue() - { - $value = $this->value; - $result = ''; - - //Actual content - while (strlen($value) >= 2) { - // get the hex value byte by byte from the string and and add it to binary result - $result .= chr(hexdec(substr($value, 0, 2))); - $value = substr($value, 2); - } - - return $result; - } - - public function getContent() - { - return strtoupper($this->value); - } - - public function getBinaryContent() - { - return $this->getEncodedValue(); - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::OCTETSTRING, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - - $value = substr($binaryData, $offsetIndex, $contentLength); - $offsetIndex += $contentLength; - - $parsedObject = new self(bin2hex($value)); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php deleted file mode 100644 index fe6d4bc0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class PrintableString extends AbstractString -{ - /** - * Creates a new ASN.1 PrintableString. - * - * The ITU-T X.680 Table 8 permits the following characters: - * Latin capital letters A,B, ... Z - * Latin small letters a,b, ... z - * Digits 0,1, ... 9 - * SPACE (space) - * APOSTROPHE ' - * LEFT PARENTHESIS ( - * RIGHT PARENTHESIS ) - * PLUS SIGN + - * COMMA , - * HYPHEN-MINUS - - * FULL STOP . - * SOLIDUS / - * COLON : - * EQUALS SIGN = - * QUESTION MARK ? - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowNumbers(); - $this->allowAllLetters(); - $this->allowSpaces(); - $this->allowCharacters("'", '(', ')', '+', '-', '.', ',', '/', ':', '=', '?'); - } - - public function getType() - { - return Identifier::PRINTABLE_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php deleted file mode 100644 index 2aa9643a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/RelativeObjectIdentifier.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use Exception; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Exception\ParserException; - -class RelativeObjectIdentifier extends ObjectIdentifier implements Parsable -{ - public function __construct($subIdentifiers) - { - $this->value = $subIdentifiers; - $this->subIdentifiers = explode('.', $subIdentifiers); - $nrOfSubIdentifiers = count($this->subIdentifiers); - - for ($i = 0; $i < $nrOfSubIdentifiers; $i++) { - if (is_numeric($this->subIdentifiers[$i])) { - // enforce the integer type - $this->subIdentifiers[$i] = intval($this->subIdentifiers[$i]); - } else { - throw new Exception("[{$subIdentifiers}] is no valid object identifier (sub identifier ".($i + 1).' is not numeric)!'); - } - } - } - - public function getType() - { - return Identifier::RELATIVE_OID; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::RELATIVE_OID, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex, 1); - - try { - $oidString = self::parseOid($binaryData, $offsetIndex, $contentLength); - } catch (ParserException $e) { - throw new ParserException('Malformed ASN.1 Relative Object Identifier', $e->getOffset()); - } - - $parsedObject = new self($oidString); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php deleted file mode 100644 index 0397cf12..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\Construct; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; - -class Sequence extends Construct implements Parsable -{ - public function getType() - { - return Identifier::SEQUENCE; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php deleted file mode 100644 index 6e6d346f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\Identifier; - -class Set extends Sequence -{ - public function getType() - { - return Identifier::SET; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php deleted file mode 100644 index 56418645..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class T61String extends AbstractString -{ - /** - * Creates a new ASN.1 T61 String. - * TODO The encodable characters of this type are not yet checked. - * - * @see http://en.wikipedia.org/wiki/ITU_T.61 - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::T61_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php deleted file mode 100644 index c4d303cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractTime; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Exception\ParserException; - -/** - * This ASN.1 universal type contains the calendar date and time. - * - * The precision is one minute or one second and optionally a - * local time differential from coordinated universal time. - * - * Decoding of this type will accept the Basic Encoding Rules (BER) - * The encoding will comply with the Distinguished Encoding Rules (DER). - */ -class UTCTime extends AbstractTime implements Parsable -{ - public function getType() - { - return Identifier::UTC_TIME; - } - - protected function calculateContentLength() - { - return 13; // Content is a string o the following format: YYMMDDhhmmssZ (13 octets) - } - - protected function getEncodedValue() - { - return $this->value->format('ymdHis').'Z'; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::UTC_TIME, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex, 11); - - $format = 'ymdGi'; - $dateTimeString = substr($binaryData, $offsetIndex, 10); - $offsetIndex += 10; - - // extract optional seconds part - if ($binaryData[$offsetIndex] != 'Z' - && $binaryData[$offsetIndex] != '+' - && $binaryData[$offsetIndex] != '-') { - $dateTimeString .= substr($binaryData, $offsetIndex, 2); - $offsetIndex += 2; - $format .= 's'; - } - - $dateTime = \DateTime::createFromFormat($format, $dateTimeString, new \DateTimeZone('UTC')); - - // extract time zone settings - if ($binaryData[$offsetIndex] == '+' - || $binaryData[$offsetIndex] == '-') { - $dateTime = static::extractTimeZoneData($binaryData, $offsetIndex, $dateTime); - } elseif ($binaryData[$offsetIndex++] != 'Z') { - throw new ParserException('Invalid UTC String', $offsetIndex); - } - - $parsedObject = new self($dateTime); - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php deleted file mode 100644 index cba568d3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class UTF8String extends AbstractString -{ - /** - * Creates a new ASN.1 Universal String. - * TODO The encodable characters of this type are not yet checked. - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::UTF8_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php deleted file mode 100644 index 0c3fe1d0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class UniversalString extends AbstractString -{ - /** - * Creates a new ASN.1 Universal String. - * TODO The encodable characters of this type are not yet checked. - * - * @see http://en.wikipedia.org/wiki/Universal_Character_Set - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::UNIVERSAL_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php deleted file mode 100644 index d9326d3f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1\Universal; - -use FG\ASN1\AbstractString; -use FG\ASN1\Identifier; - -class VisibleString extends AbstractString -{ - /** - * Creates a new ASN.1 Visible String. - * TODO The encodable characters of this type are not yet checked. - * - * @param string $string - */ - public function __construct($string) - { - $this->value = $string; - $this->allowAll(); - } - - public function getType() - { - return Identifier::VISIBLE_STRING; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php deleted file mode 100644 index b19a07a1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/UnknownConstructedObject.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -class UnknownConstructedObject extends Construct -{ - private $identifier; - private $contentLength; - - /** - * @param string $binaryData - * @param int $offsetIndex - * - * @throws \FG\ASN1\Exception\ParserException - */ - public function __construct($binaryData, &$offsetIndex) - { - $this->identifier = self::parseBinaryIdentifier($binaryData, $offsetIndex); - $this->contentLength = self::parseContentLength($binaryData, $offsetIndex); - - $children = []; - $octetsToRead = $this->contentLength; - while ($octetsToRead > 0) { - $newChild = ASNObject::fromBinary($binaryData, $offsetIndex); - $octetsToRead -= $newChild->getObjectLength(); - $children[] = $newChild; - } - - parent::__construct(...$children); - } - - public function getType() - { - return ord($this->identifier); - } - - public function getIdentifier() - { - return $this->identifier; - } - - protected function calculateContentLength() - { - return $this->contentLength; - } - - protected function getEncodedValue() - { - return ''; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php deleted file mode 100644 index 4ac536a9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/ASN1/UnknownObject.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\ASN1; - -class UnknownObject extends ASNObject -{ - /** @var string */ - private $value; - - private $identifier; - - /** - * @param string|int $identifier Either the first identifier octet as int or all identifier bytes as a string - * @param int $contentLength - */ - public function __construct($identifier, $contentLength) - { - if (is_int($identifier)) { - $identifier = chr($identifier); - } - - $this->identifier = $identifier; - $this->value = "Unparsable Object ({$contentLength} bytes)"; - $this->setContentLength($contentLength); - } - - public function getContent() - { - return $this->value; - } - - public function getType() - { - return ord($this->identifier[0]); - } - - public function getIdentifier() - { - return $this->identifier; - } - - protected function calculateContentLength() - { - return $this->getContentLength(); - } - - protected function getEncodedValue() - { - return ''; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php deleted file mode 100644 index 866162cc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigInteger.php +++ /dev/null @@ -1,195 +0,0 @@ -_fromInteger($val); - } - else { - // convert to string, if not already one - $val = (string)$val; - - // validate string - if (!preg_match('/^-?[0-9]+$/', $val)) { - throw new \InvalidArgumentException('Expects a string representation of an integer.'); - } - $ret->_fromString($val); - } - - return $ret; - } - - /** - * BigInteger constructor. - * Prevent directly instantiating object, use BigInteger::create instead. - */ - protected function __construct() - { - - } - - /** - * Subclasses must provide clone functionality. - * @return BigInteger - */ - abstract public function __clone(); - - /** - * Assign the instance value from base 10 string. - * @param string $str - */ - abstract protected function _fromString($str); - - /** - * Assign the instance value from an integer type. - * @param int $integer - */ - abstract protected function _fromInteger($integer); - - /** - * Must provide string implementation that returns base 10 number. - * @return string - */ - abstract public function __toString(); - - /* INFORMATIONAL FUNCTIONS */ - - /** - * Return integer, if possible. Throws an exception if the number can not be represented as a native integer. - * @return int - * @throws \OverflowException - */ - abstract public function toInteger(); - - /** - * Is represented integer negative? - * @return bool - */ - abstract public function isNegative(); - - /** - * Compare the integer with $number, returns a negative integer if $this is less than number, returns 0 if $this is - * equal to number and returns a positive integer if $this is greater than number. - * @param BigInteger|string|int $number - * @return int - */ - abstract public function compare($number); - - /* MODIFY */ - - /** - * Add another integer $b and returns the result. - * @param BigInteger|string|int $b - * @return BigInteger - */ - abstract public function add($b); - - /** - * Subtract $b from $this and returns the result. - * @param BigInteger|string|int $b - * @return BigInteger - */ - abstract public function subtract($b); - - /** - * Multiply value. - * @param BigInteger|string|int $b - * @return BigInteger - */ - abstract public function multiply($b); - - /** - * The value $this modulus $b. - * @param BigInteger|string|int $b - * @return BigInteger - */ - abstract public function modulus($b); - - /** - * Raise $this to the power of $b and returns the result. - * @param BigInteger|string|int $b - * @return BigInteger - */ - abstract public function toPower($b); - - /** - * Shift the value to the right by a set number of bits and returns the result. - * @param int $bits - * @return BigInteger - */ - abstract public function shiftRight($bits = 8); - - /** - * Shift the value to the left by a set number of bits and returns the result. - * @param int $bits - * @return BigInteger - */ - abstract public function shiftLeft($bits = 8); - - /** - * Returns the absolute value. - * @return BigInteger - */ - abstract public function absoluteValue(); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php deleted file mode 100644 index 25ad8916..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigIntegerBcmath.php +++ /dev/null @@ -1,133 +0,0 @@ -_str = (string)$str; - } - - protected function _fromInteger($integer) - { - $this->_str = (string)$integer; - } - - public function __toString() - { - return $this->_str; - } - - public function toInteger() - { - if ($this->compare(PHP_INT_MAX) > 0 || $this->compare(PHP_INT_MIN) < 0) { - throw new \OverflowException(sprintf('Can not represent %s as integer.', $this->_str)); - } - return (int)$this->_str; - } - - public function isNegative() - { - return bccomp($this->_str, '0', 0) < 0; - } - - protected function _unwrap($number) - { - if ($number instanceof self) { - return $number->_str; - } - return $number; - } - - public function compare($number) - { - return bccomp($this->_str, $this->_unwrap($number), 0); - } - - public function add($b) - { - $ret = new self(); - $ret->_str = bcadd($this->_str, $this->_unwrap($b), 0); - return $ret; - } - - public function subtract($b) - { - $ret = new self(); - $ret->_str = bcsub($this->_str, $this->_unwrap($b), 0); - return $ret; - } - - public function multiply($b) - { - $ret = new self(); - $ret->_str = bcmul($this->_str, $this->_unwrap($b), 0); - return $ret; - } - - public function modulus($b) - { - $ret = new self(); - if ($this->isNegative()) { - // bcmod handles negative numbers differently - $b = $this->_unwrap($b); - $ret->_str = bcsub($b, bcmod(bcsub('0', $this->_str, 0), $b), 0); - } - else { - $ret->_str = bcmod($this->_str, $this->_unwrap($b)); - } - return $ret; - } - - public function toPower($b) - { - $ret = new self(); - $ret->_str = bcpow($this->_str, $this->_unwrap($b), 0); - return $ret; - } - - public function shiftRight($bits = 8) - { - $ret = new self(); - $ret->_str = bcdiv($this->_str, bcpow('2', $bits)); - return $ret; - } - - public function shiftLeft($bits = 8) { - $ret = new self(); - $ret->_str = bcmul($this->_str, bcpow('2', $bits)); - return $ret; - } - - public function absoluteValue() - { - $ret = new self(); - if (-1 === bccomp($this->_str, '0', 0)) { - $ret->_str = bcsub('0', $this->_str, 0); - } - else { - $ret->_str = $this->_str; - } - return $ret; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php deleted file mode 100644 index 0791226a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/Utility/BigIntegerGmp.php +++ /dev/null @@ -1,133 +0,0 @@ -_rh = gmp_add($this->_rh, 0); - } - - protected function _fromString($str) - { - $this->_rh = gmp_init($str, 10); - } - - protected function _fromInteger($integer) - { - $this->_rh = gmp_init($integer, 10); - } - - public function __toString() - { - return gmp_strval($this->_rh, 10); - } - - public function toInteger() - { - if ($this->compare(PHP_INT_MAX) > 0 || $this->compare(PHP_INT_MIN) < 0) { - throw new \OverflowException(sprintf('Can not represent %s as integer.', $this)); - } - return gmp_intval($this->_rh); - } - - public function isNegative() - { - return gmp_sign($this->_rh) === -1; - } - - protected function _unwrap($number) - { - if ($number instanceof self) { - return $number->_rh; - } - return $number; - } - - public function compare($number) - { - return gmp_cmp($this->_rh, $this->_unwrap($number)); - } - - public function add($b) - { - $ret = new self(); - $ret->_rh = gmp_add($this->_rh, $this->_unwrap($b)); - return $ret; - } - - public function subtract($b) - { - $ret = new self(); - $ret->_rh = gmp_sub($this->_rh, $this->_unwrap($b)); - return $ret; - } - - public function multiply($b) - { - $ret = new self(); - $ret->_rh = gmp_mul($this->_rh, $this->_unwrap($b)); - return $ret; - } - - public function modulus($b) - { - $ret = new self(); - $ret->_rh = gmp_mod($this->_rh, $this->_unwrap($b)); - return $ret; - } - - public function toPower($b) - { - if ($b instanceof self) { - // gmp_pow accepts just an integer - if ($b->compare(PHP_INT_MAX) > 0) { - throw new \UnexpectedValueException('Unable to raise to power greater than PHP_INT_MAX.'); - } - $b = gmp_intval($b->_rh); - } - $ret = new self(); - $ret->_rh = gmp_pow($this->_rh, $b); - return $ret; - } - - public function shiftRight($bits=8) - { - $ret = new self(); - $ret->_rh = gmp_div($this->_rh, gmp_pow(2, $bits)); - return $ret; - } - - public function shiftLeft($bits=8) - { - $ret = new self(); - $ret->_rh = gmp_mul($this->_rh, gmp_pow(2, $bits)); - return $ret; - } - - public function absoluteValue() - { - $ret = new self(); - $ret->_rh = gmp_abs($this->_rh); - return $ret; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php deleted file mode 100644 index a06b56f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509; - -use FG\ASN1\Universal\NullObject; -use FG\ASN1\Composite\AttributeTypeAndValue; - -class AlgorithmIdentifier extends AttributeTypeAndValue -{ - public function __construct($objectIdentifierString) - { - parent::__construct($objectIdentifierString, new NullObject()); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php deleted file mode 100644 index 5a965e2f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CSR/Attributes.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509\CSR; - -use FG\ASN1\ASNObject; -use FG\X509\CertificateExtensions; -use FG\ASN1\OID; -use FG\ASN1\Parsable; -use FG\ASN1\Construct; -use FG\ASN1\Identifier; -use FG\ASN1\Universal\Set; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\ObjectIdentifier; - -class Attributes extends Construct implements Parsable -{ - public function getType() - { - return 0xA0; - } - - public function addAttribute($objectIdentifier, Set $attribute) - { - if (is_string($objectIdentifier)) { - $objectIdentifier = new ObjectIdentifier($objectIdentifier); - } - $attributeSequence = new Sequence($objectIdentifier, $attribute); - $attributeSequence->getNumberOfLengthOctets(); // length and number of length octets is calculated - $this->addChild($attributeSequence); - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], 0xA0, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - $octetsToRead = $contentLength; - - $parsedObject = new self(); - while ($octetsToRead > 0) { - $initialOffset = $offsetIndex; // used to calculate how much bits have been read - self::parseIdentifier($binaryData[$offsetIndex], Identifier::SEQUENCE, $offsetIndex++); - self::parseContentLength($binaryData, $offsetIndex); - - $objectIdentifier = ObjectIdentifier::fromBinary($binaryData, $offsetIndex); - $oidString = $objectIdentifier->getContent(); - if ($oidString == OID::PKCS9_EXTENSION_REQUEST) { - $attribute = CertificateExtensions::fromBinary($binaryData, $offsetIndex); - } else { - $attribute = ASNObject::fromBinary($binaryData, $offsetIndex); - } - - $parsedObject->addAttribute($objectIdentifier, $attribute); - $octetsToRead -= ($offsetIndex - $initialOffset); - } - - $parsedObject->setContentLength($contentLength); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php deleted file mode 100644 index 8f2a3197..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CSR/CSR.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509\CSR; - -use FG\ASN1\OID; -use FG\ASN1\Universal\Integer; -use FG\ASN1\Universal\BitString; -use FG\ASN1\Universal\Sequence; -use FG\X509\CertificateSubject; -use FG\X509\AlgorithmIdentifier; -use FG\X509\PublicKey; - -class CSR extends Sequence -{ - const CSR_VERSION_NR = 0; - - protected $subject; - protected $publicKey; - protected $signature; - protected $signatureAlgorithm; - - protected $startSequence; - - /** - * @param string $commonName - * @param string $email - * @param string $organization - * @param string $locality - * @param string $state - * @param string $country - * @param string $organizationalUnit - * @param string $publicKey - * @param string $signature - * @param string $signatureAlgorithm - */ - public function __construct($commonName, $email, $organization, $locality, $state, $country, $organizationalUnit, $publicKey, $signature = null, $signatureAlgorithm = OID::SHA1_WITH_RSA_SIGNATURE) - { - $this->subject = new CertificateSubject( - $commonName, - $email, - $organization, - $locality, - $state, - $country, - $organizationalUnit - ); - $this->publicKey = $publicKey; - $this->signature = $signature; - $this->signatureAlgorithm = $signatureAlgorithm; - - if (isset($signature)) { - $this->createCSRSequence(); - } - } - - protected function createCSRSequence() - { - $versionNr = new Integer(self::CSR_VERSION_NR); - $publicKey = new PublicKey($this->publicKey); - $signature = new BitString($this->signature); - $signatureAlgorithm = new AlgorithmIdentifier($this->signatureAlgorithm); - - $certRequestInfo = new Sequence($versionNr, $this->subject, $publicKey); - - // Clear the underlying Construct - $this->rewind(); - $this->children = []; - $this->addChild($certRequestInfo); - $this->addChild($signatureAlgorithm); - $this->addChild($signature); - } - - public function getSignatureSubject() - { - $versionNr = new Integer(self::CSR_VERSION_NR); - $publicKey = new PublicKey($this->publicKey); - - $certRequestInfo = new Sequence($versionNr, $this->subject, $publicKey); - return $certRequestInfo->getBinary(); - } - - public function setSignature($signature, $signatureAlgorithm = OID::SHA1_WITH_RSA_SIGNATURE) - { - $this->signature = $signature; - $this->signatureAlgorithm = $signatureAlgorithm; - - $this->createCSRSequence(); - } - - public function __toString() - { - $tmp = base64_encode($this->getBinary()); - - for ($i = 0; $i < strlen($tmp); $i++) { - if (($i + 2) % 65 == 0) { - $tmp = substr($tmp, 0, $i + 1)."\n".substr($tmp, $i + 1); - } - } - - $result = '-----BEGIN CERTIFICATE REQUEST-----'.PHP_EOL; - $result .= $tmp.PHP_EOL; - $result .= '-----END CERTIFICATE REQUEST-----'; - - return $result; - } - - public function getVersion() - { - return self::CSR_VERSION_NR; - } - - public function getOrganizationName() - { - return $this->subject->getOrganization(); - } - - public function getLocalName() - { - return $this->subject->getLocality(); - } - - public function getState() - { - return $this->subject->getState(); - } - - public function getCountry() - { - return $this->subject->getCountry(); - } - - public function getOrganizationalUnit() - { - return $this->subject->getOrganizationalUnit(); - } - - public function getPublicKey() - { - return $this->publicKey; - } - - public function getSignature() - { - return $this->signature; - } - - public function getSignatureAlgorithm() - { - return $this->signatureAlgorithm; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CertificateExtensions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CertificateExtensions.php deleted file mode 100644 index 6ed1c6a7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CertificateExtensions.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509; - -use FG\ASN1\Exception\ParserException; -use FG\ASN1\OID; -use FG\ASN1\ASNObject; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Universal\OctetString; -use FG\ASN1\Universal\Set; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\ObjectIdentifier; -use FG\X509\SAN\SubjectAlternativeNames; - -class CertificateExtensions extends Set implements Parsable -{ - private $innerSequence; - private $extensions = []; - - public function __construct() - { - $this->innerSequence = new Sequence(); - parent::__construct($this->innerSequence); - } - - public function addSubjectAlternativeNames(SubjectAlternativeNames $sans) - { - $this->addExtension(OID::CERT_EXT_SUBJECT_ALT_NAME, $sans); - } - - private function addExtension($oidString, ASNObject $extension) - { - $sequence = new Sequence(); - $sequence->addChild(new ObjectIdentifier($oidString)); - $sequence->addChild($extension); - - $this->innerSequence->addChild($sequence); - $this->extensions[] = $extension; - } - - public function getContent() - { - return $this->extensions; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::SET, $offsetIndex++); - self::parseContentLength($binaryData, $offsetIndex); - - $tmpOffset = $offsetIndex; - $extensions = Sequence::fromBinary($binaryData, $offsetIndex); - $tmpOffset += 1 + $extensions->getNumberOfLengthOctets(); - - $parsedObject = new self(); - foreach ($extensions as $extension) { - if ($extension->getType() != Identifier::SEQUENCE) { - //FIXME wrong offset index - throw new ParserException('Could not parse Certificate Extensions: Expected ASN.1 Sequence but got '.$extension->getTypeName(), $offsetIndex); - } - - $tmpOffset += 1 + $extension->getNumberOfLengthOctets(); - $children = $extension->getChildren(); - if (count($children) < 2) { - throw new ParserException('Could not parse Certificate Extensions: Needs at least two child elements per extension sequence (object identifier and octet string)', $tmpOffset); - } - /** @var \FG\ASN1\ASNObject $objectIdentifier */ - $objectIdentifier = $children[0]; - - /** @var OctetString $octetString */ - $octetString = $children[1]; - - if ($objectIdentifier->getType() != Identifier::OBJECT_IDENTIFIER) { - throw new ParserException('Could not parse Certificate Extensions: Expected ASN.1 Object Identifier but got '.$extension->getTypeName(), $tmpOffset); - } - - $tmpOffset += $objectIdentifier->getObjectLength(); - - if ($objectIdentifier->getContent() == OID::CERT_EXT_SUBJECT_ALT_NAME) { - $sans = SubjectAlternativeNames::fromBinary($binaryData, $tmpOffset); - $parsedObject->addSubjectAlternativeNames($sans); - } else { - // can now only parse SANs. There might be more in the future - $tmpOffset += $octetString->getObjectLength(); - } - } - - $parsedObject->getBinary(); // Determine the number of content octets and object sizes once (just to let the equality unit tests pass :/ ) - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CertificateSubject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CertificateSubject.php deleted file mode 100644 index 0a04d574..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/CertificateSubject.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509; - -use FG\ASN1\Composite\RelativeDistinguishedName; -use FG\ASN1\Identifier; -use FG\ASN1\OID; -use FG\ASN1\Parsable; -use FG\ASN1\Composite\RDNString; -use FG\ASN1\Universal\Sequence; - -class CertificateSubject extends Sequence implements Parsable -{ - private $commonName; - private $email; - private $organization; - private $locality; - private $state; - private $country; - private $organizationalUnit; - - /** - * @param string $commonName - * @param string $email - * @param string $organization - * @param string $locality - * @param string $state - * @param string $country - * @param string $organizationalUnit - */ - public function __construct($commonName, $email, $organization, $locality, $state, $country, $organizationalUnit) - { - parent::__construct( - new RDNString(OID::COUNTRY_NAME, $country), - new RDNString(OID::STATE_OR_PROVINCE_NAME, $state), - new RDNString(OID::LOCALITY_NAME, $locality), - new RDNString(OID::ORGANIZATION_NAME, $organization), - new RDNString(OID::OU_NAME, $organizationalUnit), - new RDNString(OID::COMMON_NAME, $commonName), - new RDNString(OID::PKCS9_EMAIL, $email) - ); - - $this->commonName = $commonName; - $this->email = $email; - $this->organization = $organization; - $this->locality = $locality; - $this->state = $state; - $this->country = $country; - $this->organizationalUnit = $organizationalUnit; - } - - public function getCommonName() - { - return $this->commonName; - } - - public function getEmail() - { - return $this->email; - } - - public function getOrganization() - { - return $this->organization; - } - - public function getLocality() - { - return $this->locality; - } - - public function getState() - { - return $this->state; - } - - public function getCountry() - { - return $this->country; - } - - public function getOrganizationalUnit() - { - return $this->organizationalUnit; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::SEQUENCE, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - - $names = []; - $octetsToRead = $contentLength; - while ($octetsToRead > 0) { - $relativeDistinguishedName = RelativeDistinguishedName::fromBinary($binaryData, $offsetIndex); - $octetsToRead -= $relativeDistinguishedName->getObjectLength(); - $names[] = $relativeDistinguishedName; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php deleted file mode 100644 index d57ad865..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509; - -use FG\ASN1\OID; -use FG\ASN1\Universal\NullObject; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\BitString; -use FG\ASN1\Universal\ObjectIdentifier; - -class PrivateKey extends Sequence -{ - /** - * @param string $hexKey - * @param \FG\ASN1\ASNObject|string $algorithmIdentifierString - */ - public function __construct($hexKey, $algorithmIdentifierString = OID::RSA_ENCRYPTION) - { - parent::__construct( - new Sequence( - new ObjectIdentifier($algorithmIdentifierString), - new NullObject() - ), - new BitString($hexKey) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/PublicKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/PublicKey.php deleted file mode 100644 index ab8b4514..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/PublicKey.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509; - -use FG\ASN1\OID; -use FG\ASN1\Universal\NullObject; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\BitString; -use FG\ASN1\Universal\ObjectIdentifier; - -class PublicKey extends Sequence -{ - /** - * @param string $hexKey - * @param \FG\ASN1\ASNObject|string $algorithmIdentifierString - */ - public function __construct($hexKey, $algorithmIdentifierString = OID::RSA_ENCRYPTION) - { - parent::__construct( - new Sequence( - new ObjectIdentifier($algorithmIdentifierString), - new NullObject() - ), - new BitString($hexKey) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php deleted file mode 100644 index 502738b0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509\SAN; - -use FG\ASN1\Universal\GeneralString; - -class DNSName extends GeneralString -{ - const IDENTIFIER = 0x82; // not sure yet why this is the identifier used in SAN extensions - - public function __construct($dnsNameString) - { - parent::__construct($dnsNameString); - } - - public function getType() - { - return self::IDENTIFIER; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php deleted file mode 100644 index f55be95b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/IPAddress.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509\SAN; - -use FG\ASN1\ASNObject; -use FG\ASN1\Parsable; -use FG\ASN1\Exception\ParserException; - -class IPAddress extends ASNObject implements Parsable -{ - const IDENTIFIER = 0x87; // not sure yet why this is the identifier used in SAN extensions - - /** @var string */ - private $value; - - public function __construct($ipAddressString) - { - $this->value = $ipAddressString; - } - - public function getType() - { - return self::IDENTIFIER; - } - - public function getContent() - { - return $this->value; - } - - protected function calculateContentLength() - { - return 4; - } - - protected function getEncodedValue() - { - $ipParts = explode('.', $this->value); - $binary = chr($ipParts[0]); - $binary .= chr($ipParts[1]); - $binary .= chr($ipParts[2]); - $binary .= chr($ipParts[3]); - - return $binary; - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], self::IDENTIFIER, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - if ($contentLength != 4) { - throw new ParserException("A FG\\X509\SAN\IPAddress should have a content length of 4. Extracted length was {$contentLength}", $offsetIndex); - } - - $ipAddressString = ord($binaryData[$offsetIndex++]).'.'; - $ipAddressString .= ord($binaryData[$offsetIndex++]).'.'; - $ipAddressString .= ord($binaryData[$offsetIndex++]).'.'; - $ipAddressString .= ord($binaryData[$offsetIndex++]); - - $parsedObject = new self($ipAddressString); - $parsedObject->getObjectLength(); - - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php deleted file mode 100644 index 271ddde7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/fgrosse/phpasn1/lib/X509/SAN/SubjectAlternativeNames.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace FG\X509\SAN; - -use FG\ASN1\Exception\ParserException; -use FG\ASN1\ASNObject; -use FG\ASN1\OID; -use FG\ASN1\Parsable; -use FG\ASN1\Identifier; -use FG\ASN1\Universal\Sequence; - -/** - * See section 8.3.2.1 of ITU-T X.509. - */ -class SubjectAlternativeNames extends ASNObject implements Parsable -{ - private $alternativeNamesSequence; - - public function __construct() - { - $this->alternativeNamesSequence = new Sequence(); - } - - protected function calculateContentLength() - { - return $this->alternativeNamesSequence->getObjectLength(); - } - - public function getType() - { - return Identifier::OCTETSTRING; - } - - public function addDomainName(DNSName $domainName) - { - $this->alternativeNamesSequence->addChild($domainName); - } - - public function addIP(IPAddress $ip) - { - $this->alternativeNamesSequence->addChild($ip); - } - - public function getContent() - { - return $this->alternativeNamesSequence->getContent(); - } - - protected function getEncodedValue() - { - return $this->alternativeNamesSequence->getBinary(); - } - - public static function fromBinary(&$binaryData, &$offsetIndex = 0) - { - self::parseIdentifier($binaryData[$offsetIndex], Identifier::OCTETSTRING, $offsetIndex++); - $contentLength = self::parseContentLength($binaryData, $offsetIndex); - - if ($contentLength < 2) { - throw new ParserException('Can not parse Subject Alternative Names: The Sequence within the octet string after the Object identifier '.OID::CERT_EXT_SUBJECT_ALT_NAME." is too short ({$contentLength} octets)", $offsetIndex); - } - - $offsetOfSequence = $offsetIndex; - $sequence = Sequence::fromBinary($binaryData, $offsetIndex); - $offsetOfSequence += $sequence->getNumberOfLengthOctets() + 1; - - if ($sequence->getObjectLength() != $contentLength) { - throw new ParserException('Can not parse Subject Alternative Names: The Sequence length does not match the length of the surrounding octet string', $offsetIndex); - } - - $parsedObject = new self(); - /** @var \FG\ASN1\ASNObject $object */ - foreach ($sequence as $object) { - if ($object->getType() == DNSName::IDENTIFIER) { - $domainName = DNSName::fromBinary($binaryData, $offsetOfSequence); - $parsedObject->addDomainName($domainName); - } elseif ($object->getType() == IPAddress::IDENTIFIER) { - $ip = IPAddress::fromBinary($binaryData, $offsetOfSequence); - $parsedObject->addIP($ip); - } else { - throw new ParserException('Could not parse Subject Alternative Name: Only DNSName and IP SANs are currently supported', $offsetIndex); - } - } - - $parsedObject->getBinary(); // Determine the number of content octets and object sizes once (just to let the equality unit tests pass :/ ) - return $parsedObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/LICENSE deleted file mode 100644 index 14c82cd5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 ignace nyamagana butera - -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/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/composer.json deleted file mode 100644 index fc34cfe3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/composer.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "league/uri-interfaces", - "description" : "Common interface for URI representation", - "keywords": [ - "url", - "uri", - "rfc3986", - "rfc3987" - ], - "license": "MIT", - "homepage": "http://github.com/thephpleague/uri-interfaces", - "authors": [ - { - "name" : "Ignace Nyamagana Butera", - "email" : "nyamsprod@gmail.com", - "homepage" : "https://nyamsprod.com" - } - ], - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/nyamsprod" - } - ], - "require": { - "php" : "^7.2 || ^8.0", - "ext-json": "*" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19", - "phpstan/phpstan": "^0.12.90", - "phpstan/phpstan-strict-rules": "^0.12.9", - "phpstan/phpstan-phpunit": "^0.12.19", - "phpunit/phpunit": "^8.5.15 || ^9.5" - }, - "autoload": { - "psr-4": { - "League\\Uri\\": "src/" - } - }, - "scripts": { - "phpunit": "phpunit --coverage-text", - "phpcs": "php-cs-fixer fix --dry-run --diff -vvv --allow-risky=yes --ansi", - "phpcs:fix": "php-cs-fixer fix -vvv --allow-risky=yes --ansi", - "phpstan": "phpstan analyse -l max -c phpstan.neon src --ansi --memory-limit 192M", - "test": [ - "@phpunit", - "@phpstan", - "@phpcs:fix" - ] - }, - "scripts-descriptions": { - "phpunit": "Runs package test suite", - "phpstan": "Runs complete codebase static analysis", - "phpcs": "Runs coding style testing", - "phpcs:fix": "Fix coding style issues", - "test": "Runs all tests" - }, - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "suggest": { - "ext-intl": "to use the IDNA feature", - "symfony/intl": "to use the IDNA feature via Symfony Polyfill" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/AuthorityInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/AuthorityInterface.php deleted file mode 100644 index ed6c2b8d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/AuthorityInterface.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -use League\Uri\Exceptions\IdnSupportMissing; -use League\Uri\Exceptions\SyntaxError; - -interface AuthorityInterface extends UriComponentInterface -{ - /** - * Returns the host component of the authority. - */ - public function getHost(): ?string; - - /** - * Returns the port component of the authority. - */ - public function getPort(): ?int; - - /** - * Returns the user information component of the authority. - */ - public function getUserInfo(): ?string; - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * A null value provided for the host is equivalent to removing the host - * information. - * - * @param ?string $host - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - * @throws IdnSupportMissing for component or transformations - * requiring IDN support when IDN support is not present - * or misconfigured. - */ - public function withHost(?string $host): self; - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param ?int $port - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withPort(?int $port): self; - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; a null value for the user is equivalent to removing user - * information. - * - * @param ?string $user - * @param ?string $password - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withUserInfo(?string $user, ?string $password = null): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/DataPathInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/DataPathInterface.php deleted file mode 100644 index 1e4f3856..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/DataPathInterface.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -interface DataPathInterface extends PathInterface -{ - /** - * Retrieve the data mime type associated to the URI. - * - * If no mimetype is present, this method MUST return the default mimetype 'text/plain'. - * - * @see http://tools.ietf.org/html/rfc2397#section-2 - */ - public function getMimeType(): string; - - /** - * Retrieve the parameters associated with the Mime Type of the URI. - * - * If no parameters is present, this method MUST return the default parameter 'charset=US-ASCII'. - * - * @see http://tools.ietf.org/html/rfc2397#section-2 - */ - public function getParameters(): string; - - /** - * Retrieve the mediatype associated with the URI. - * - * If no mediatype is present, this method MUST return the default parameter 'text/plain;charset=US-ASCII'. - * - * @see http://tools.ietf.org/html/rfc2397#section-3 - * - * @return string The URI scheme. - */ - public function getMediaType(): string; - - /** - * Retrieves the data string. - * - * Retrieves the data part of the path. If no data part is provided return - * a empty string - */ - public function getData(): string; - - /** - * Tells whether the data is binary safe encoded. - */ - public function isBinaryData(): bool; - - /** - * Save the data to a specific file. - */ - public function save(string $path, string $mode = 'w'): \SplFileObject; - - /** - * Returns an instance where the data part is base64 encoded. - * - * This method MUST retain the state of the current instance, and return - * an instance where the data part is base64 encoded - */ - public function toBinary(): self; - - /** - * Returns an instance where the data part is url encoded following RFC3986 rules. - * - * This method MUST retain the state of the current instance, and return - * an instance where the data part is url encoded - */ - public function toAscii(): self; - - /** - * Return an instance with the specified mediatype parameters. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified mediatype parameters. - * - * Users must provide encoded characters. - * - * An empty parameters value is equivalent to removing the parameter. - */ - public function withParameters(string $parameters): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/DomainHostInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/DomainHostInterface.php deleted file mode 100644 index 2490310f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/DomainHostInterface.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -use League\Uri\Exceptions\SyntaxError; - -/** - * @extends \IteratorAggregate - */ -interface DomainHostInterface extends \Countable, HostInterface, \IteratorAggregate -{ - /** - * Returns the labels total number. - */ - public function count(): int; - - /** - * Iterate over the Domain labels. - * - * @return \Iterator - */ - public function getIterator(): \Iterator; - - /** - * Retrieves a single host label. - * - * If the label offset has not been set, returns the null value. - */ - public function get(int $offset): ?string; - - /** - * Returns the associated key for a specific label or all the keys. - * - * @param ?string $label - * - * @return int[] - */ - public function keys(?string $label = null): array; - - /** - * Tells whether the domain is absolute. - */ - public function isAbsolute(): bool; - - /** - * Prepends a label to the host. - */ - public function prepend(string $label): self; - - /** - * Appends a label to the host. - */ - public function append(string $label): self; - - /** - * Returns an instance with its Root label. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - public function withRootLabel(): self; - - /** - * Returns an instance without its Root label. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - public function withoutRootLabel(): self; - - /** - * Returns an instance with the modified label. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the new label - * - * If $key is non-negative, the added label will be the label at $key position from the start. - * If $key is negative, the added label will be the label at $key position from the end. - * - * @throws SyntaxError If the key is invalid - */ - public function withLabel(int $key, string $label): self; - - /** - * Returns an instance without the specified label. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified component - * - * If $key is non-negative, the removed label will be the label at $key position from the start. - * If $key is negative, the removed label will be the label at $key position from the end. - * - * @param int ...$keys - * - * @throws SyntaxError If the key is invalid - */ - public function withoutLabel(int ...$keys): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/FragmentInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/FragmentInterface.php deleted file mode 100644 index 3d80f066..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/FragmentInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -interface FragmentInterface extends UriComponentInterface -{ - /** - * Returns the decoded fragment. - */ - public function decoded(): ?string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/HostInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/HostInterface.php deleted file mode 100644 index a8b8bb35..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/HostInterface.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -interface HostInterface extends UriComponentInterface -{ - /** - * Returns the ascii representation. - */ - public function toAscii(): ?string; - - /** - * Returns the unicode representation. - */ - public function toUnicode(): ?string; - - /** - * Returns the IP version. - * - * If the host is a not an IP this method will return null - */ - public function getIpVersion(): ?string; - - /** - * Returns the IP component If the Host is an IP address. - * - * If the host is a not an IP this method will return null - */ - public function getIp(): ?string; - - /** - * Tells whether the host is a domain name. - */ - public function isDomain(): bool; - - /** - * Tells whether the host is an IP Address. - */ - public function isIp(): bool; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/IpHostInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/IpHostInterface.php deleted file mode 100644 index 1e2242ab..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/IpHostInterface.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -interface IpHostInterface extends HostInterface -{ - /** - * Returns whether or not the host is an IPv4 address. - */ - public function isIpv4(): bool; - /** - * Returns whether or not the host is an IPv6 address. - */ - public function isIpv6(): bool; - - /** - * Returns whether or not the host is an IPv6 address. - */ - public function isIpFuture(): bool; - - /** - * Returns whether or not the host has a ZoneIdentifier. - * - * @see http://tools.ietf.org/html/rfc6874#section-4 - */ - public function hasZoneIdentifier(): bool; - - /** - * Returns an host without its zone identifier according to RFC6874. - * - * This method MUST retain the state of the current instance, and return - * an instance without the host zone identifier according to RFC6874 - * - * @see http://tools.ietf.org/html/rfc6874#section-4 - */ - public function withoutZoneIdentifier(): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/PathInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/PathInterface.php deleted file mode 100644 index 389c0ff0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/PathInterface.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -use League\Uri\Exceptions\SyntaxError; - -interface PathInterface extends UriComponentInterface -{ - /** - * Returns the decoded path. - */ - public function decoded(): string; - - /** - * Returns whether or not the path is absolute or relative. - */ - public function isAbsolute(): bool; - - /** - * Returns whether or not the path has a trailing delimiter. - */ - public function hasTrailingSlash(): bool; - - /** - * Returns an instance without dot segments. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the path component normalized by removing - * the dot segment. - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withoutDotSegments(): self; - - /** - * Returns an instance with a leading slash. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the path component with a leading slash - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withLeadingSlash(): self; - - /** - * Returns an instance without a leading slash. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the path component without a leading slash - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withoutLeadingSlash(): self; - - /** - * Returns an instance with a trailing slash. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the path component with a trailing slash - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withTrailingSlash(): self; - - /** - * Returns an instance without a trailing slash. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the path component without a trailing slash - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withoutTrailingSlash(): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/PortInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/PortInterface.php deleted file mode 100644 index 7230c4ad..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/PortInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -interface PortInterface extends UriComponentInterface -{ - /** - * Returns the integer representation of the Port. - */ - public function toInt(): ?int; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/QueryInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/QueryInterface.php deleted file mode 100644 index f7081ea2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/QueryInterface.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -/** - * @extends \IteratorAggregate - */ -interface QueryInterface extends \Countable, \IteratorAggregate, UriComponentInterface -{ - /** - * Returns the query separator. - */ - public function getSeparator(): string; - - /** - * Returns the number of key/value pairs present in the object. - */ - public function count(): int; - - /** - * Returns an iterator allowing to go through all key/value pairs contained in this object. - * - * The pair is represented as an array where the first value is the pair key - * and the second value the pair value. - * - * The key of each pair is a string - * The value of each pair is a scalar or the null value - * - * @return \Iterator - */ - public function getIterator(): \Iterator; - - /** - * Returns an iterator allowing to go through all key/value pairs contained in this object. - * - * The return type is as a Iterator where its offset is the pair key and its value the pair value. - * - * The key of each pair is a string - * The value of each pair is a scalar or the null value - * - * @return iterable - */ - public function pairs(): iterable; - - /** - * Tells whether a pair with a specific name exists. - * - * @see https://url.spec.whatwg.org/#dom-urlsearchparams-has - */ - public function has(string $key): bool; - - /** - * Returns the first value associated to the given pair name. - * - * If no value is found null is returned - * - * @see https://url.spec.whatwg.org/#dom-urlsearchparams-get - */ - public function get(string $key): ?string; - - /** - * Returns all the values associated to the given pair name as an array or all - * the instance pairs. - * - * If no value is found an empty array is returned - * - * @see https://url.spec.whatwg.org/#dom-urlsearchparams-getall - * - * @return array - */ - public function getAll(string $key): array; - - /** - * Returns the store PHP variables as elements of an array. - * - * The result is similar as PHP parse_str when used with its - * second argument with the difference that variable names are - * not mangled. - * - * If a key is submitted it will returns the value attached to it or null - * - * @see http://php.net/parse_str - * @see https://wiki.php.net/rfc/on_demand_name_mangling - * - * @param ?string $key - * @return mixed the collection of stored PHP variables or the empty array if no input is given, - * the single value of a stored PHP variable or null if the variable is not present in the collection - */ - public function params(?string $key = null); - - /** - * Returns the RFC1738 encoded query. - */ - public function toRFC1738(): ?string; - - /** - * Returns the RFC3986 encoded query. - * - * @see ::getContent - */ - public function toRFC3986(): ?string; - - /** - * Returns an instance with a different separator. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the query component with a different separator - */ - public function withSeparator(string $separator): self; - - /** - * Sorts the query string by offset, maintaining offset to data correlations. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified query - * - * @see https://url.spec.whatwg.org/#dom-urlsearchparams-sort - */ - public function sort(): self; - - /** - * Returns an instance without duplicate key/value pair. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the query component normalized by removing - * duplicate pairs whose key/value are the same. - */ - public function withoutDuplicates(): self; - - /** - * Returns an instance without empty key/value where the value is the null value. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the query component normalized by removing - * empty pairs. - * - * A pair is considered empty if its value is equal to the null value - */ - public function withoutEmptyPairs(): self; - - /** - * Returns an instance where numeric indices associated to PHP's array like key are removed. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the query component normalized so that numeric indexes - * are removed from the pair key value. - * - * ie.: toto[3]=bar[3]&foo=bar becomes toto[]=bar[3]&foo=bar - */ - public function withoutNumericIndices(): self; - - /** - * Returns an instance with the a new key/value pair added to it. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified query - * - * If the pair already exists the value will replace the existing value. - * - * @see https://url.spec.whatwg.org/#dom-urlsearchparams-set - * - * @param ?string $value - */ - public function withPair(string $key, ?string $value): self; - - /** - * Returns an instance with the new pairs set to it. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified query - * - * @see ::withPair - */ - public function merge(string $query): self; - - /** - * Returns an instance without the specified keys. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified component - * - * @param string ...$keys - */ - public function withoutPair(string ...$keys): self; - - /** - * Returns a new instance with a specified key/value pair appended as a new pair. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified query - * - * @param ?string $value - */ - public function appendTo(string $key, ?string $value): self; - - /** - * Returns an instance with the new pairs appended to it. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified query - * - * If the pair already exists the value will be added to it. - */ - public function append(string $query): self; - - /** - * Returns an instance without the specified params. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified component without PHP's value. - * PHP's mangled is not taken into account. - * - * @param string ...$keys - */ - public function withoutParam(string ...$keys): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/SegmentedPathInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/SegmentedPathInterface.php deleted file mode 100644 index 53065fff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/SegmentedPathInterface.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -use League\Uri\Exceptions\SyntaxError; - -/** - * @extends \IteratorAggregate - */ -interface SegmentedPathInterface extends \Countable, \IteratorAggregate, PathInterface -{ - /** - * Returns the total number of segments in the path. - */ - public function count(): int; - - /** - * Iterate over the path segment. - * - * @return \Iterator - */ - public function getIterator(): \Iterator; - - /** - * Returns parent directory's path. - */ - public function getDirname(): string; - - /** - * Returns the path basename. - */ - public function getBasename(): string; - - /** - * Returns the basename extension. - */ - public function getExtension(): string; - - /** - * Retrieves a single path segment. - * - * If the segment offset has not been set, returns null. - */ - public function get(int $offset): ?string; - - /** - * Returns the associated key for a specific segment. - * - * If a value is specified only the keys associated with - * the given value will be returned - * - * @param ?string $segment - * - * @return int[] - */ - public function keys(?string $segment = null): array; - - /** - * Appends a segment to the path. - */ - public function append(string $segment): self; - - /** - * Prepends a segment to the path. - */ - public function prepend(string $segment): self; - - /** - * Returns an instance with the modified segment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the new segment - * - * If $key is non-negative, the added segment will be the segment at $key position from the start. - * If $key is negative, the added segment will be the segment at $key position from the end. - * - * @param ?string $segment - * - * @throws SyntaxError If the key is invalid - */ - public function withSegment(int $key, ?string $segment): self; - - /** - * Returns an instance without the specified segment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified component - * - * If $key is non-negative, the removed segment will be the segment at $key position from the start. - * If $key is negative, the removed segment will be the segment at $key position from the end. - * - * @param int ...$keys remaining keys to remove - * - * @throws SyntaxError If the key is invalid - */ - public function withoutSegment(int ...$keys): self; - - /** - * Returns an instance without duplicate delimiters. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the path component normalized by removing - * multiple consecutive empty segment - */ - public function withoutEmptySegments(): self; - - /** - * Returns an instance with the specified parent directory's path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the extension basename modified. - * - * @param ?string $path - */ - public function withDirname(?string $path): self; - - /** - * Returns an instance with the specified basename. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the extension basename modified. - * - * @param ?string $basename - */ - public function withBasename(?string $basename): self; - - /** - * Returns an instance with the specified basename extension. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the extension basename modified. - * - * @param ?string $extension - */ - public function withExtension(?string $extension): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriComponentInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriComponentInterface.php deleted file mode 100644 index c7b39bb5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriComponentInterface.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -use League\Uri\Exceptions\IdnSupportMissing; -use League\Uri\Exceptions\SyntaxError; - -interface UriComponentInterface extends \JsonSerializable -{ - /** - * Returns the instance content. - * - * If the instance is defined, the value returned MUST be encoded according to the - * selected encoding algorithm. In any case, the value MUST NOT double-encode any character - * depending on the selected encoding algorithm. - * - * To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3. - * or RFC 3987 Section 3. By default the content is encoded according to RFC3986 - * - * If the instance is not defined null is returned - */ - public function getContent(): ?string; - - /** - * Returns the instance string representation. - * - * If the instance is defined, the value returned MUST be percent-encoded, - * but MUST NOT double-encode any characters. To determine what characters - * to encode, please refer to RFC 3986, Sections 2 and 3. - * - * If the instance is not defined an empty string is returned - */ - public function __toString(): string; - - /** - * Returns the instance json representation. - * - * If the instance is defined, the value returned MUST be percent-encoded, - * but MUST NOT double-encode any characters. To determine what characters - * to encode, please refer to RFC 3986 or RFC 1738. - * - * If the instance is not defined null is returned - */ - public function jsonSerialize(): ?string; - - /** - * Returns the instance string representation with its optional URI delimiters. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode any - * characters. To determine what characters to encode, please refer to RFC 3986, - * Sections 2 and 3. - * - * If the instance is not defined an empty string is returned - */ - public function getUriComponent(): string; - - /** - * Returns an instance with the specified content. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified content. - * - * Users can provide both encoded and decoded content characters. - * - * A null value is equivalent to removing the component content. - * - * - * @param ?string $content - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - * @throws IdnSupportMissing for component or transformations - * requiring IDN support when IDN support is not present - * or misconfigured. - */ - public function withContent(?string $content): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriException.php deleted file mode 100644 index c0fec2a1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriException.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -use Throwable; - -interface UriException extends Throwable -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriInterface.php deleted file mode 100644 index b6eb6a1f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UriInterface.php +++ /dev/null @@ -1,292 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -use League\Uri\Exceptions\IdnSupportMissing; -use League\Uri\Exceptions\SyntaxError; - -interface UriInterface extends \JsonSerializable -{ - /** - * Returns the string representation as a URI reference. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - */ - public function __toString(): string; - - /** - * Returns the string representation as a URI reference. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @see ::__toString - */ - public function jsonSerialize(): string; - - /** - * Retrieve the scheme component of the URI. - * - * If no scheme is present, this method MUST return a null value. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.1. - * - * The trailing ":" character is not part of the scheme and MUST NOT be - * added. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.1 - */ - public function getScheme(): ?string; - - /** - * Retrieve the authority component of the URI. - * - * If no scheme is present, this method MUST return a null value. - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - */ - public function getAuthority(): ?string; - - /** - * Retrieve the user information component of the URI. - * - * If no scheme is present, this method MUST return a null value. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - */ - public function getUserInfo(): ?string; - - /** - * Retrieve the host component of the URI. - * - * If no host is present this method MUST return a null value. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - public function getHost(): ?string; - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - */ - public function getPort(): ?int; - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - */ - public function getPath(): string; - - /** - * Retrieve the query string of the URI. - * - * If no host is present this method MUST return a null value. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - */ - public function getQuery(): ?string; - - /** - * Retrieve the fragment component of the URI. - * - * If no host is present this method MUST return a null value. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - */ - public function getFragment(): ?string; - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * A null value provided for the scheme is equivalent to removing the scheme - * information. - * - * @param ?string $scheme - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withScheme(?string $scheme): self; - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; a null value for the user is equivalent to removing user - * information. - * - * @param ?string $user - * @param ?string $password - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withUserInfo(?string $user, ?string $password = null): self; - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * A null value provided for the host is equivalent to removing the host - * information. - * - * @param ?string $host - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - * @throws IdnSupportMissing for component or transformations - * requiring IDN support when IDN support is not present - * or misconfigured. - */ - public function withHost(?string $host): self; - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param ?int $port - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withPort(?int $port): self; - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withPath(string $path): self; - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * A null value provided for the query is equivalent to removing the query - * information. - * - * @param ?string $query - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withQuery(?string $query): self; - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * A null value provided for the fragment is equivalent to removing the fragment - * information. - * - * @param ?string $fragment - * - * @throws SyntaxError for invalid component or transformations - * that would result in a object in invalid state. - */ - public function withFragment(?string $fragment): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UserInfoInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UserInfoInterface.php deleted file mode 100644 index 6411f9b6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Contracts/UserInfoInterface.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Contracts; - -interface UserInfoInterface extends UriComponentInterface -{ - /** - * Returns the user component part. - */ - public function getUser(): ?string; - - /** - * Returns the pass component part. - */ - public function getPass(): ?string; - - /** - * Returns an instance with the specified user and/or pass. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user. - * - * An empty user is equivalent to removing the user information. - * - * @param ?string $user - * @param ?string $pass - */ - public function withUserInfo(?string $user, ?string $pass = null): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php deleted file mode 100644 index 0105b2da..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Exceptions; - -use League\Uri\Contracts\UriException; - -class FileinfoSupportMissing extends \RuntimeException implements UriException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php deleted file mode 100644 index 8ff3b538..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Exceptions; - -use League\Uri\Contracts\UriException; - -class IdnSupportMissing extends \RuntimeException implements UriException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php deleted file mode 100644 index 80259f3b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Exceptions; - -use League\Uri\Idna\IdnaInfo; - -final class IdnaConversionFailed extends SyntaxError -{ - /** @var IdnaInfo|null */ - private $idnaInfo; - - private function __construct(string $message, IdnaInfo $idnaInfo = null) - { - parent::__construct($message); - $this->idnaInfo = $idnaInfo; - } - - public static function dueToIDNAError(string $domain, IdnaInfo $idnaInfo): self - { - return new self( - 'The host `'.$domain.'` is invalid : '.implode(', ', $idnaInfo->errorList()).' .', - $idnaInfo - ); - } - - public static function dueToInvalidHost(string $domain): self - { - return new self('The host `'.$domain.'` is not a valid IDN host'); - } - - public function idnaInfo(): ?IdnaInfo - { - return $this->idnaInfo; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php deleted file mode 100644 index 1b5e4cbd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Exceptions; - -use League\Uri\Contracts\UriException; - -class SyntaxError extends \InvalidArgumentException implements UriException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Idna/Idna.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Idna/Idna.php deleted file mode 100644 index 59306874..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Idna/Idna.php +++ /dev/null @@ -1,212 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Idna; - -use League\Uri\Exceptions\IdnaConversionFailed; -use League\Uri\Exceptions\IdnSupportMissing; -use League\Uri\Exceptions\SyntaxError; -use function defined; -use function function_exists; -use function idn_to_ascii; -use function idn_to_utf8; -use function rawurldecode; -use const INTL_IDNA_VARIANT_UTS46; - -/** - * @see https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/uidna_8h.html - */ -final class Idna -{ - private const REGEXP_IDNA_PATTERN = '/[^\x20-\x7f]/'; - private const MAX_DOMAIN_LENGTH = 253; - private const MAX_LABEL_LENGTH = 63; - - /** - * General registered name regular expression. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2.2 - * @see https://regex101.com/r/fptU8V/1 - */ - private const REGEXP_REGISTERED_NAME = '/ - (?(DEFINE) - (?[a-z0-9_~\-]) # . is missing as it is used to separate labels - (?[!$&\'()*+,;=]) - (?%[A-F0-9]{2}) - (?(?:(?&unreserved)|(?&sub_delims)|(?&encoded))*) - ) - ^(?:(?®_name)\.)*(?®_name)\.?$ - /ix'; - - /** - * IDNA options. - */ - public const IDNA_DEFAULT = 0; - public const IDNA_ALLOW_UNASSIGNED = 1; - public const IDNA_USE_STD3_RULES = 2; - public const IDNA_CHECK_BIDI = 4; - public const IDNA_CHECK_CONTEXTJ = 8; - public const IDNA_NONTRANSITIONAL_TO_ASCII = 0x10; - public const IDNA_NONTRANSITIONAL_TO_UNICODE = 0x20; - public const IDNA_CHECK_CONTEXTO = 0x40; - - /** - * IDNA errors. - */ - public const ERROR_NONE = 0; - public const ERROR_EMPTY_LABEL = 1; - public const ERROR_LABEL_TOO_LONG = 2; - public const ERROR_DOMAIN_NAME_TOO_LONG = 4; - public const ERROR_LEADING_HYPHEN = 8; - public const ERROR_TRAILING_HYPHEN = 0x10; - public const ERROR_HYPHEN_3_4 = 0x20; - public const ERROR_LEADING_COMBINING_MARK = 0x40; - public const ERROR_DISALLOWED = 0x80; - public const ERROR_PUNYCODE = 0x100; - public const ERROR_LABEL_HAS_DOT = 0x200; - public const ERROR_INVALID_ACE_LABEL = 0x400; - public const ERROR_BIDI = 0x800; - public const ERROR_CONTEXTJ = 0x1000; - public const ERROR_CONTEXTO_PUNCTUATION = 0x2000; - public const ERROR_CONTEXTO_DIGITS = 0x4000; - - /** - * IDNA default options. - */ - public const IDNA2008_ASCII = self::IDNA_NONTRANSITIONAL_TO_ASCII - | self::IDNA_CHECK_BIDI - | self::IDNA_USE_STD3_RULES - | self::IDNA_CHECK_CONTEXTJ; - public const IDNA2008_UNICODE = self::IDNA_NONTRANSITIONAL_TO_UNICODE - | self::IDNA_CHECK_BIDI - | self::IDNA_USE_STD3_RULES - | self::IDNA_CHECK_CONTEXTJ; - - /** - * @codeCoverageIgnore - */ - private static function supportsIdna(): void - { - static $idnSupport; - if (null === $idnSupport) { - $idnSupport = function_exists('\idn_to_ascii') && defined('\INTL_IDNA_VARIANT_UTS46'); - } - - if (!$idnSupport) { - throw new IdnSupportMissing('IDN host can not be processed. Verify that ext/intl is installed for IDN support and that ICU is at least version 4.6.'); - } - } - - /** - * Converts the input to its IDNA ASCII form. - * - * This method returns the string converted to IDN ASCII form - * - * @throws SyntaxError if the string can not be converted to ASCII using IDN UTS46 algorithm - */ - public static function toAscii(string $domain, int $options): IdnaInfo - { - $domain = rawurldecode($domain); - - if (1 === preg_match(self::REGEXP_IDNA_PATTERN, $domain)) { - self::supportsIdna(); - - /* @param-out array{errors: int, isTransitionalDifferent: bool, result: string} $idnaInfo */ - idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $idnaInfo); - if ([] === $idnaInfo) { - return IdnaInfo::fromIntl([ - 'result' => strtolower($domain), - 'isTransitionalDifferent' => false, - 'errors' => self::validateDomainAndLabelLength($domain), - ]); - } - - /* @var array{errors: int, isTransitionalDifferent: bool, result: string} $idnaInfo */ - return IdnaInfo::fromIntl($idnaInfo); - } - - $error = self::ERROR_NONE; - if (1 !== preg_match(self::REGEXP_REGISTERED_NAME, $domain)) { - $error |= self::ERROR_DISALLOWED; - } - - return IdnaInfo::fromIntl([ - 'result' => strtolower($domain), - 'isTransitionalDifferent' => false, - 'errors' => self::validateDomainAndLabelLength($domain) | $error, - ]); - } - - /** - * Converts the input to its IDNA UNICODE form. - * - * This method returns the string converted to IDN UNICODE form - * - * @throws SyntaxError if the string can not be converted to UNICODE using IDN UTS46 algorithm - */ - public static function toUnicode(string $domain, int $options): IdnaInfo - { - $domain = rawurldecode($domain); - - if (false === stripos($domain, 'xn--')) { - return IdnaInfo::fromIntl(['result' => $domain, 'isTransitionalDifferent' => false, 'errors' => self::ERROR_NONE]); - } - - self::supportsIdna(); - - /* @param-out array{errors: int, isTransitionalDifferent: bool, result: string} $idnaInfo */ - idn_to_utf8($domain, $options, INTL_IDNA_VARIANT_UTS46, $idnaInfo); - if ([] === $idnaInfo) { - throw IdnaConversionFailed::dueToInvalidHost($domain); - } - - /* @var array{errors: int, isTransitionalDifferent: bool, result: string} $idnaInfo */ - return IdnaInfo::fromIntl($idnaInfo); - } - - /** - * Adapted from https://github.com/TRowbotham/idna. - * - * @see https://github.com/TRowbotham/idna/blob/master/src/Idna.php#L236 - */ - private static function validateDomainAndLabelLength(string $domain): int - { - $error = self::ERROR_NONE; - $labels = explode('.', $domain); - $maxDomainSize = self::MAX_DOMAIN_LENGTH; - $length = count($labels); - - // If the last label is empty and it is not the first label, then it is the root label. - // Increase the max size by 1, making it 254, to account for the root label's "." - // delimiter. This also means we don't need to check the last label's length for being too - // long. - if ($length > 1 && $labels[$length - 1] === '') { - ++$maxDomainSize; - array_pop($labels); - } - - if (strlen($domain) > $maxDomainSize) { - $error |= self::ERROR_DOMAIN_NAME_TOO_LONG; - } - - foreach ($labels as $label) { - if (strlen($label) > self::MAX_LABEL_LENGTH) { - $error |= self::ERROR_LABEL_TOO_LONG; - - break; - } - } - - return $error; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Idna/IdnaInfo.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Idna/IdnaInfo.php deleted file mode 100644 index 73610a28..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri-interfaces/src/Idna/IdnaInfo.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Idna; - -use function array_filter; -use const ARRAY_FILTER_USE_KEY; - -/** - * @see https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/uidna_8h.html - */ -final class IdnaInfo -{ - private const ERRORS = [ - Idna::ERROR_EMPTY_LABEL => 'a non-final domain name label (or the whole domain name) is empty', - Idna::ERROR_LABEL_TOO_LONG => 'a domain name label is longer than 63 bytes', - Idna::ERROR_DOMAIN_NAME_TOO_LONG => 'a domain name is longer than 255 bytes in its storage form', - Idna::ERROR_LEADING_HYPHEN => 'a label starts with a hyphen-minus ("-")', - Idna::ERROR_TRAILING_HYPHEN => 'a label ends with a hyphen-minus ("-")', - Idna::ERROR_HYPHEN_3_4 => 'a label contains hyphen-minus ("-") in the third and fourth positions', - Idna::ERROR_LEADING_COMBINING_MARK => 'a label starts with a combining mark', - Idna::ERROR_DISALLOWED => 'a label or domain name contains disallowed characters', - Idna::ERROR_PUNYCODE => 'a label starts with "xn--" but does not contain valid Punycode', - Idna::ERROR_LABEL_HAS_DOT => 'a label contains a dot=full stop', - Idna::ERROR_INVALID_ACE_LABEL => 'An ACE label does not contain a valid label string', - Idna::ERROR_BIDI => 'a label does not meet the IDNA BiDi requirements (for right-to-left characters)', - Idna::ERROR_CONTEXTJ => 'a label does not meet the IDNA CONTEXTJ requirements', - Idna::ERROR_CONTEXTO_DIGITS => 'a label does not meet the IDNA CONTEXTO requirements for digits', - Idna::ERROR_CONTEXTO_PUNCTUATION => 'a label does not meet the IDNA CONTEXTO requirements for punctuation characters. Some punctuation characters "Would otherwise have been DISALLOWED" but are allowed in certain contexts', - ]; - - /** @var string */ - private $result; - - /** @var bool */ - private $isTransitionalDifferent; - - /** @var int */ - private $errors; - - /** - * @var array - */ - private $errorList; - - private function __construct(string $result, bool $isTransitionalDifferent, int $errors) - { - $this->result = $result; - $this->errors = $errors; - $this->isTransitionalDifferent = $isTransitionalDifferent; - $this->errorList = array_filter( - self::ERRORS, - function (int $error): bool { - return 0 !== ($error & $this->errors); - }, - ARRAY_FILTER_USE_KEY - ); - } - - /** - * @param array{result:string, isTransitionalDifferent:bool, errors:int} $infos - */ - public static function fromIntl(array $infos): self - { - return new self($infos['result'], $infos['isTransitionalDifferent'], $infos['errors']); - } - - /** - * @param array{result:string, isTransitionalDifferent:bool, errors:int} $properties - */ - public static function __set_state(array $properties): self - { - return self::fromIntl($properties); - } - - public function result(): string - { - return $this->result; - } - - public function isTransitionalDifferent(): bool - { - return $this->isTransitionalDifferent; - } - - public function errors(): int - { - return $this->errors; - } - - public function error(int $error): ?string - { - return $this->errorList[$error] ?? null; - } - - /** - * @return array - */ - public function errorList(): array - { - return $this->errorList; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/LICENSE deleted file mode 100644 index 3b52528f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 ignace nyamagana butera - -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/wp-webauthn/wp-webauthn-vendor/league/uri/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/composer.json deleted file mode 100644 index 28edbd84..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/composer.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "league/uri", - "type": "library", - "description" : "URI manipulation library", - "keywords": [ - "url", - "uri", - "rfc3986", - "rfc3987", - "rfc6570", - "psr-7", - "parse_url", - "http", - "https", - "ws", - "ftp", - "data-uri", - "file-uri", - "middleware", - "parse_str", - "query-string", - "querystring", - "hostname", - "uri-template" - ], - "license": "MIT", - "homepage": "https://uri.thephpleague.com", - "authors": [ - { - "name" : "Ignace Nyamagana Butera", - "email" : "nyamsprod@gmail.com", - "homepage" : "https://nyamsprod.com" - } - ], - "support": { - "forum": "https://thephpleague.slack.com", - "docs": "https://uri.thephpleague.com", - "issues": "https://github.com/thephpleague/uri/issues" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/nyamsprod" - } - ], - "require": { - "php": "^7.4 || ^8.0", - "ext-json": "*", - "psr/http-message": "^1.0", - "league/uri-interfaces": "^2.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^v3.3.2", - "nyholm/psr7": "^1.5", - "php-http/psr7-integration-tests": "^1.1", - "phpstan/phpstan": "^1.2.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0.0", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpunit/phpunit": "^9.5.10", - "psr/http-factory": "^1.0" - }, - "autoload": { - "psr-4": { - "League\\Uri\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "LeagueTest\\Uri\\": "tests" - } - }, - "conflict": { - "league/uri-schemes": "^1.0" - }, - "scripts": { - "phpcs": "php-cs-fixer fix -v --diff --dry-run --allow-risky=yes --ansi", - "phpcs:fix": "php-cs-fixer fix -vvv --allow-risky=yes --ansi", - "phpstan": "phpstan analyse -l max -c phpstan.neon src --ansi --memory-limit=256M", - "phpunit": "XDEBUG_MODE=coverage phpunit --coverage-text", - "test": [ - "@phpunit", - "@phpstan", - "@phpcs" - ] - }, - "scripts-descriptions": { - "phpcs": "Runs coding style test suite", - "phpstan": "Runs complete codebase static analysis", - "phpunit": "Runs unit and functional testing", - "test": "Runs full test suite" - }, - "suggest": { - "league/uri-components" : "Needed to easily manipulate URI objects", - "ext-intl" : "Needed to improve host validation", - "ext-fileinfo": "Needed to create Data URI from a filepath", - "psr/http-factory": "Needed to use the URI factory" - }, - "extra": { - "branch-alias": { - "dev-master": "6.x-dev" - } - }, - "config": { - "sort-packages": true - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Exceptions/TemplateCanNotBeExpanded.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Exceptions/TemplateCanNotBeExpanded.php deleted file mode 100644 index 7c24b94c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Exceptions/TemplateCanNotBeExpanded.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\Exceptions; - -use InvalidArgumentException; -use League\Uri\Contracts\UriException; - -class TemplateCanNotBeExpanded extends InvalidArgumentException implements UriException -{ - public static function dueToUnableToProcessValueListWithPrefix(string $variableName): self - { - return new self('The ":" modifier can not be applied on "'.$variableName.'" since it is a list of values.'); - } - - public static function dueToNestedListOfValue(string $variableName): self - { - return new self('The "'.$variableName.'" can not be a nested list.'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Http.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Http.php deleted file mode 100644 index b3b8cea8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Http.php +++ /dev/null @@ -1,335 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri; - -use JsonSerializable; -use League\Uri\Contracts\UriInterface; -use League\Uri\Exceptions\SyntaxError; -use Psr\Http\Message\UriInterface as Psr7UriInterface; -use function is_object; -use function is_scalar; -use function method_exists; -use function sprintf; - -final class Http implements Psr7UriInterface, JsonSerializable -{ - private UriInterface $uri; - - private function __construct(UriInterface $uri) - { - $this->validate($uri); - $this->uri = $uri; - } - - /** - * Validate the submitted uri against PSR-7 UriInterface. - * - * @throws SyntaxError if the given URI does not follow PSR-7 UriInterface rules - */ - private function validate(UriInterface $uri): void - { - $scheme = $uri->getScheme(); - if (null === $scheme && '' === $uri->getHost()) { - throw new SyntaxError(sprintf('an URI without scheme can not contains a empty host string according to PSR-7: %s', (string) $uri)); - } - - $port = $uri->getPort(); - if (null !== $port && ($port < 0 || $port > 65535)) { - throw new SyntaxError(sprintf('The URI port is outside the established TCP and UDP port ranges: %s', (string) $uri->getPort())); - } - } - - /** - * Static method called by PHP's var export. - */ - public static function __set_state(array $components): self - { - return new self($components['uri']); - } - - /** - * Create a new instance from a string. - * - * @param string|mixed $uri - */ - public static function createFromString($uri = ''): self - { - return new self(Uri::createFromString($uri)); - } - - /** - * Create a new instance from a hash of parse_url parts. - * - * @param array $components a hash representation of the URI similar - * to PHP parse_url function result - */ - public static function createFromComponents(array $components): self - { - return new self(Uri::createFromComponents($components)); - } - - /** - * Create a new instance from the environment. - */ - public static function createFromServer(array $server): self - { - return new self(Uri::createFromServer($server)); - } - - /** - * Create a new instance from a URI and a Base URI. - * - * The returned URI must be absolute. - * - * @param mixed $uri the input URI to create - * @param mixed $base_uri the base URI used for reference - */ - public static function createFromBaseUri($uri, $base_uri = null): self - { - return new self(Uri::createFromBaseUri($uri, $base_uri)); - } - - /** - * Create a new instance from a URI object. - * - * @param Psr7UriInterface|UriInterface $uri the input URI to create - */ - public static function createFromUri($uri): self - { - if ($uri instanceof UriInterface) { - return new self($uri); - } - - return new self(Uri::createFromUri($uri)); - } - - /** - * {@inheritDoc} - */ - public function getScheme(): string - { - return (string) $this->uri->getScheme(); - } - - /** - * {@inheritDoc} - */ - public function getAuthority(): string - { - return (string) $this->uri->getAuthority(); - } - - /** - * {@inheritDoc} - */ - public function getUserInfo(): string - { - return (string) $this->uri->getUserInfo(); - } - - /** - * {@inheritDoc} - */ - public function getHost(): string - { - return (string) $this->uri->getHost(); - } - - /** - * {@inheritDoc} - */ - public function getPort(): ?int - { - return $this->uri->getPort(); - } - - /** - * {@inheritDoc} - */ - public function getPath(): string - { - return $this->uri->getPath(); - } - - /** - * {@inheritDoc} - */ - public function getQuery(): string - { - return (string) $this->uri->getQuery(); - } - - /** - * {@inheritDoc} - */ - public function getFragment(): string - { - return (string) $this->uri->getFragment(); - } - - /** - * {@inheritDoc} - */ - public function withScheme($scheme): self - { - /** @var string $scheme */ - $scheme = $this->filterInput($scheme); - if ('' === $scheme) { - $scheme = null; - } - - $uri = $this->uri->withScheme($scheme); - if ((string) $uri === (string) $this->uri) { - return $this; - } - - return new self($uri); - } - - /** - * Safely stringify input when possible. - * - * @param mixed $str the value to evaluate as a string - * - * @throws SyntaxError if the submitted data can not be converted to string - * - * @return string|mixed - */ - private function filterInput($str) - { - if (is_scalar($str) || (is_object($str) && method_exists($str, '__toString'))) { - return (string) $str; - } - - return $str; - } - - /** - * {@inheritDoc} - */ - public function withUserInfo($user, $password = null): self - { - /** @var string $user */ - $user = $this->filterInput($user); - if ('' === $user) { - $user = null; - } - - $uri = $this->uri->withUserInfo($user, $password); - if ((string) $uri === (string) $this->uri) { - return $this; - } - - return new self($uri); - } - - /** - * {@inheritDoc} - */ - public function withHost($host): self - { - /** @var string $host */ - $host = $this->filterInput($host); - if ('' === $host) { - $host = null; - } - - $uri = $this->uri->withHost($host); - if ((string) $uri === (string) $this->uri) { - return $this; - } - - return new self($uri); - } - - /** - * {@inheritDoc} - */ - public function withPort($port): self - { - $uri = $this->uri->withPort($port); - if ((string) $uri === (string) $this->uri) { - return $this; - } - - return new self($uri); - } - - /** - * {@inheritDoc} - */ - public function withPath($path): self - { - $uri = $this->uri->withPath($path); - if ((string) $uri === (string) $this->uri) { - return $this; - } - - return new self($uri); - } - - /** - * {@inheritDoc} - */ - public function withQuery($query): self - { - /** @var string $query */ - $query = $this->filterInput($query); - if ('' === $query) { - $query = null; - } - - $uri = $this->uri->withQuery($query); - if ((string) $uri === (string) $this->uri) { - return $this; - } - - return new self($uri); - } - - /** - * {@inheritDoc} - */ - public function withFragment($fragment): self - { - /** @var string $fragment */ - $fragment = $this->filterInput($fragment); - if ('' === $fragment) { - $fragment = null; - } - - $uri = $this->uri->withFragment($fragment); - if ((string) $uri === (string) $this->uri) { - return $this; - } - - return new self($uri); - } - - /** - * {@inheritDoc} - */ - public function __toString(): string - { - return $this->uri->__toString(); - } - - /** - * {@inheritDoc} - */ - public function jsonSerialize(): string - { - return $this->uri->__toString(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/HttpFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/HttpFactory.php deleted file mode 100644 index fc3bcfab..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/HttpFactory.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri; - -use Psr\Http\Message\UriFactoryInterface; -use Psr\Http\Message\UriInterface; - -final class HttpFactory implements UriFactoryInterface -{ - public function createUri(string $uri = ''): UriInterface - { - return Http::createFromString($uri); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Uri.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Uri.php deleted file mode 100644 index 77cb54bb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/Uri.php +++ /dev/null @@ -1,1337 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri; - -use finfo; -use League\Uri\Contracts\UriInterface; -use League\Uri\Exceptions\FileinfoSupportMissing; -use League\Uri\Exceptions\IdnaConversionFailed; -use League\Uri\Exceptions\IdnSupportMissing; -use League\Uri\Exceptions\SyntaxError; -use League\Uri\Idna\Idna; -use Psr\Http\Message\UriInterface as Psr7UriInterface; -use TypeError; -use function array_filter; -use function array_map; -use function base64_decode; -use function base64_encode; -use function count; -use function explode; -use function file_get_contents; -use function filter_var; -use function implode; -use function in_array; -use function inet_pton; -use function is_object; -use function is_scalar; -use function method_exists; -use function preg_match; -use function preg_replace; -use function preg_replace_callback; -use function rawurlencode; -use function sprintf; -use function str_replace; -use function strlen; -use function strpos; -use function strspn; -use function strtolower; -use function substr; -use const FILEINFO_MIME; -use const FILTER_FLAG_IPV4; -use const FILTER_FLAG_IPV6; -use const FILTER_NULL_ON_FAILURE; -use const FILTER_VALIDATE_BOOLEAN; -use const FILTER_VALIDATE_IP; - -final class Uri implements UriInterface -{ - /** - * RFC3986 invalid characters. - * - * @link https://tools.ietf.org/html/rfc3986#section-2.2 - * - * @var string - */ - private const REGEXP_INVALID_CHARS = '/[\x00-\x1f\x7f]/'; - - /** - * RFC3986 Sub delimiter characters regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc3986#section-2.2 - * - * @var string - */ - private const REGEXP_CHARS_SUBDELIM = "\!\$&'\(\)\*\+,;\=%"; - - /** - * RFC3986 unreserved characters regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc3986#section-2.3 - * - * @var string - */ - private const REGEXP_CHARS_UNRESERVED = 'A-Za-z0-9_\-\.~'; - - /** - * RFC3986 schema regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.1 - */ - private const REGEXP_SCHEME = ',^[a-z]([-a-z0-9+.]+)?$,i'; - - /** - * RFC3986 host identified by a registered name regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - private const REGEXP_HOST_REGNAME = '/^( - (?[a-z0-9_~\-\.])| - (?[!$&\'()*+,;=])| - (?%[A-F0-9]{2}) - )+$/x'; - - /** - * RFC3986 delimiters of the generic URI components regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc3986#section-2.2 - */ - private const REGEXP_HOST_GEN_DELIMS = '/[:\/?#\[\]@ ]/'; // Also includes space. - - /** - * RFC3986 IPvFuture regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - private const REGEXP_HOST_IPFUTURE = '/^ - v(?[A-F0-9])+\. - (?: - (?[a-z0-9_~\-\.])| - (?[!$&\'()*+,;=:]) # also include the : character - )+ - $/ix'; - - /** - * RFC3986 IPvFuture host and port component. - */ - private const REGEXP_HOST_PORT = ',^(?(\[.*]|[^:])*)(:(?[^/?#]*))?$,x'; - - /** - * Significant 10 bits of IP to detect Zone ID regular expression pattern. - */ - private const HOST_ADDRESS_BLOCK = "\xfe\x80"; - - /** - * Regular expression pattern to for file URI. - * contains the volume but not the volume separator. - * The volume separator may be URL-encoded (`|` as `%7C`) by ::formatPath(), - * so we account for that here. - */ - private const REGEXP_FILE_PATH = ',^(?/)?(?[a-zA-Z])(?:[:|\|]|%7C)(?.*)?,'; - - /** - * Mimetype regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc2397 - */ - private const REGEXP_MIMETYPE = ',^\w+/[-.\w]+(?:\+[-.\w]+)?$,'; - - /** - * Base64 content regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc2397 - */ - private const REGEXP_BINARY = ',(;|^)base64$,'; - - /** - * Windows file path string regular expression pattern. - * contains both the volume and volume separator. - */ - private const REGEXP_WINDOW_PATH = ',^(?[a-zA-Z][:|\|]),'; - - /** - * Supported schemes and corresponding default port. - * - * @var array - */ - private const SCHEME_DEFAULT_PORT = [ - 'data' => null, - 'file' => null, - 'ftp' => 21, - 'gopher' => 70, - 'http' => 80, - 'https' => 443, - 'ws' => 80, - 'wss' => 443, - ]; - - /** - * URI validation methods per scheme. - * - * @var array - */ - private const SCHEME_VALIDATION_METHOD = [ - 'data' => 'isUriWithSchemeAndPathOnly', - 'file' => 'isUriWithSchemeHostAndPathOnly', - 'ftp' => 'isNonEmptyHostUriWithoutFragmentAndQuery', - 'gopher' => 'isNonEmptyHostUriWithoutFragmentAndQuery', - 'http' => 'isNonEmptyHostUri', - 'https' => 'isNonEmptyHostUri', - 'ws' => 'isNonEmptyHostUriWithoutFragment', - 'wss' => 'isNonEmptyHostUriWithoutFragment', - ]; - - /** - * All ASCII letters sorted by typical frequency of occurrence. - * - * @var string - */ - private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - private ?string $scheme; - private ?string $user_info; - private ?string $host; - private ?int $port; - private ?string $authority; - private string $path = ''; - private ?string $query; - private ?string $fragment; - private ?string $uri; - - private function __construct( - ?string $scheme, - ?string $user, - ?string $pass, - ?string $host, - ?int $port, - string $path, - ?string $query, - ?string $fragment - ) { - $this->scheme = $this->formatScheme($scheme); - $this->user_info = $this->formatUserInfo($user, $pass); - $this->host = $this->formatHost($host); - $this->port = $this->formatPort($port); - $this->authority = $this->setAuthority(); - $this->path = $this->formatPath($path); - $this->query = $this->formatQueryAndFragment($query); - $this->fragment = $this->formatQueryAndFragment($fragment); - $this->assertValidState(); - } - - /** - * Format the Scheme and Host component. - * - * @param ?string $scheme - * @throws SyntaxError if the scheme is invalid - */ - private function formatScheme(?string $scheme): ?string - { - if (null === $scheme) { - return $scheme; - } - - $formatted_scheme = strtolower($scheme); - if (1 === preg_match(self::REGEXP_SCHEME, $formatted_scheme)) { - return $formatted_scheme; - } - - throw new SyntaxError(sprintf('The scheme `%s` is invalid.', $scheme)); - } - - /** - * Set the UserInfo component. - * @param ?string $user - * @param ?string $password - */ - private function formatUserInfo(?string $user, ?string $password): ?string - { - if (null === $user) { - return $user; - } - - static $user_pattern = '/(?:[^%'.self::REGEXP_CHARS_UNRESERVED.self::REGEXP_CHARS_SUBDELIM.']++|%(?![A-Fa-f0-9]{2}))/'; - $user = preg_replace_callback($user_pattern, [Uri::class, 'urlEncodeMatch'], $user); - if (null === $password) { - return $user; - } - - static $password_pattern = '/(?:[^%:'.self::REGEXP_CHARS_UNRESERVED.self::REGEXP_CHARS_SUBDELIM.']++|%(?![A-Fa-f0-9]{2}))/'; - - return $user.':'.preg_replace_callback($password_pattern, [Uri::class, 'urlEncodeMatch'], $password); - } - - /** - * Returns the RFC3986 encoded string matched. - */ - private static function urlEncodeMatch(array $matches): string - { - return rawurlencode($matches[0]); - } - - /** - * Validate and Format the Host component. - * @param ?string $host - */ - private function formatHost(?string $host): ?string - { - if (null === $host || '' === $host) { - return $host; - } - - if ('[' !== $host[0]) { - return $this->formatRegisteredName($host); - } - - return $this->formatIp($host); - } - - /** - * Validate and format a registered name. - * - * The host is converted to its ascii representation if needed - * - * @throws IdnSupportMissing if the submitted host required missing or misconfigured IDN support - * @throws SyntaxError if the submitted host is not a valid registered name - */ - private function formatRegisteredName(string $host): string - { - $formatted_host = rawurldecode($host); - if (1 === preg_match(self::REGEXP_HOST_REGNAME, $formatted_host)) { - return $formatted_host; - } - - if (1 === preg_match(self::REGEXP_HOST_GEN_DELIMS, $formatted_host)) { - throw new SyntaxError(sprintf('The host `%s` is invalid : a registered name can not contain URI delimiters or spaces', $host)); - } - - $info = Idna::toAscii($host, Idna::IDNA2008_ASCII); - if (0 !== $info->errors()) { - throw IdnaConversionFailed::dueToIDNAError($host, $info); - } - - return $info->result(); - } - - /** - * Validate and Format the IPv6/IPvfuture host. - * - * @throws SyntaxError if the submitted host is not a valid IP host - */ - private function formatIp(string $host): string - { - $ip = substr($host, 1, -1); - if (false !== filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - return $host; - } - - if (1 === preg_match(self::REGEXP_HOST_IPFUTURE, $ip, $matches) && !in_array($matches['version'], ['4', '6'], true)) { - return $host; - } - - $pos = strpos($ip, '%'); - if (false === $pos) { - throw new SyntaxError(sprintf('The host `%s` is invalid : the IP host is malformed', $host)); - } - - if (1 === preg_match(self::REGEXP_HOST_GEN_DELIMS, rawurldecode(substr($ip, $pos)))) { - throw new SyntaxError(sprintf('The host `%s` is invalid : the IP host is malformed', $host)); - } - - $ip = substr($ip, 0, $pos); - if (false === filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - throw new SyntaxError(sprintf('The host `%s` is invalid : the IP host is malformed', $host)); - } - - //Only the address block fe80::/10 can have a Zone ID attach to - //let's detect the link local significant 10 bits - if (0 === strpos((string) inet_pton($ip), self::HOST_ADDRESS_BLOCK)) { - return $host; - } - - throw new SyntaxError(sprintf('The host `%s` is invalid : the IP host is malformed', $host)); - } - - /** - * Format the Port component. - * - * @param object|null|int|string $port - * - * @throws SyntaxError - */ - private function formatPort($port = null): ?int - { - if (null === $port || '' === $port) { - return null; - } - - if (!is_int($port) && !(is_string($port) && 1 === preg_match('/^\d*$/', $port))) { - throw new SyntaxError('The port is expected to be an integer or a string representing an integer; '.gettype($port).' given.'); - } - - $port = (int) $port; - if (0 > $port) { - throw new SyntaxError(sprintf('The port `%s` is invalid', $port)); - } - - $defaultPort = self::SCHEME_DEFAULT_PORT[$this->scheme] ?? null; - if ($defaultPort === $port) { - return null; - } - - return $port; - } - - /** - * {@inheritDoc} - */ - public static function __set_state(array $components): self - { - $components['user'] = null; - $components['pass'] = null; - if (null !== $components['user_info']) { - [$components['user'], $components['pass']] = explode(':', $components['user_info'], 2) + [1 => null]; - } - - return new self( - $components['scheme'], - $components['user'], - $components['pass'], - $components['host'], - $components['port'], - $components['path'], - $components['query'], - $components['fragment'] - ); - } - - /** - * Create a new instance from a URI and a Base URI. - * - * The returned URI must be absolute. - * - * @param mixed $uri the input URI to create - * @param null|mixed $base_uri the base URI used for reference - */ - public static function createFromBaseUri($uri, $base_uri = null): UriInterface - { - if (!$uri instanceof UriInterface) { - $uri = self::createFromString($uri); - } - - if (null === $base_uri) { - if (null === $uri->getScheme()) { - throw new SyntaxError(sprintf('the URI `%s` must be absolute', (string) $uri)); - } - - if (null === $uri->getAuthority()) { - return $uri; - } - - /** @var UriInterface $uri */ - $uri = UriResolver::resolve($uri, $uri->withFragment(null)->withQuery(null)->withPath('')); - - return $uri; - } - - if (!$base_uri instanceof UriInterface) { - $base_uri = self::createFromString($base_uri); - } - - if (null === $base_uri->getScheme()) { - throw new SyntaxError(sprintf('the base URI `%s` must be absolute', (string) $base_uri)); - } - - /** @var UriInterface $uri */ - $uri = UriResolver::resolve($uri, $base_uri); - - return $uri; - } - - /** - * Create a new instance from a string. - * - * @param string|mixed $uri - */ - public static function createFromString($uri = ''): self - { - $components = UriString::parse($uri); - - return new self( - $components['scheme'], - $components['user'], - $components['pass'], - $components['host'], - $components['port'], - $components['path'], - $components['query'], - $components['fragment'] - ); - } - - /** - * Create a new instance from a hash representation of the URI similar - * to PHP parse_url function result. - */ - public static function createFromComponents(array $components = []): self - { - $components += [ - 'scheme' => null, 'user' => null, 'pass' => null, 'host' => null, - 'port' => null, 'path' => '', 'query' => null, 'fragment' => null, - ]; - - return new self( - $components['scheme'], - $components['user'], - $components['pass'], - $components['host'], - $components['port'], - $components['path'], - $components['query'], - $components['fragment'] - ); - } - - /** - * Create a new instance from a data file path. - * - * @param resource|null $context - * - * @throws FileinfoSupportMissing If ext/fileinfo is not installed - * @throws SyntaxError If the file does not exist or is not readable - */ - public static function createFromDataPath(string $path, $context = null): self - { - static $finfo_support = null; - $finfo_support = $finfo_support ?? class_exists(finfo::class); - - // @codeCoverageIgnoreStart - if (!$finfo_support) { - throw new FileinfoSupportMissing(sprintf('Please install ext/fileinfo to use the %s() method.', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $file_args = [$path, false]; - $mime_args = [$path, FILEINFO_MIME]; - if (null !== $context) { - $file_args[] = $context; - $mime_args[] = $context; - } - - $raw = @file_get_contents(...$file_args); - if (false === $raw) { - throw new SyntaxError(sprintf('The file `%s` does not exist or is not readable', $path)); - } - - $mimetype = (string) (new finfo(FILEINFO_MIME))->file(...$mime_args); - - return Uri::createFromComponents([ - 'scheme' => 'data', - 'path' => str_replace(' ', '', $mimetype.';base64,'.base64_encode($raw)), - ]); - } - - /** - * Create a new instance from a Unix path string. - */ - public static function createFromUnixPath(string $uri = ''): self - { - $uri = implode('/', array_map('rawurlencode', explode('/', $uri))); - if ('/' !== ($uri[0] ?? '')) { - return Uri::createFromComponents(['path' => $uri]); - } - - return Uri::createFromComponents(['path' => $uri, 'scheme' => 'file', 'host' => '']); - } - - /** - * Create a new instance from a local Windows path string. - */ - public static function createFromWindowsPath(string $uri = ''): self - { - $root = ''; - if (1 === preg_match(self::REGEXP_WINDOW_PATH, $uri, $matches)) { - $root = substr($matches['root'], 0, -1).':'; - $uri = substr($uri, strlen($root)); - } - $uri = str_replace('\\', '/', $uri); - $uri = implode('/', array_map('rawurlencode', explode('/', $uri))); - - //Local Windows absolute path - if ('' !== $root) { - return Uri::createFromComponents(['path' => '/'.$root.$uri, 'scheme' => 'file', 'host' => '']); - } - - //UNC Windows Path - if ('//' !== substr($uri, 0, 2)) { - return Uri::createFromComponents(['path' => $uri]); - } - - $parts = explode('/', substr($uri, 2), 2) + [1 => null]; - - return Uri::createFromComponents(['host' => $parts[0], 'path' => '/'.$parts[1], 'scheme' => 'file']); - } - - /** - * Create a new instance from a URI object. - * - * @param Psr7UriInterface|UriInterface $uri the input URI to create - */ - public static function createFromUri($uri): self - { - if ($uri instanceof UriInterface) { - $user_info = $uri->getUserInfo(); - $user = null; - $pass = null; - if (null !== $user_info) { - [$user, $pass] = explode(':', $user_info, 2) + [1 => null]; - } - - return new self( - $uri->getScheme(), - $user, - $pass, - $uri->getHost(), - $uri->getPort(), - $uri->getPath(), - $uri->getQuery(), - $uri->getFragment() - ); - } - - if (!$uri instanceof Psr7UriInterface) { - throw new TypeError(sprintf('The object must implement the `%s` or the `%s`', Psr7UriInterface::class, UriInterface::class)); - } - - $scheme = $uri->getScheme(); - if ('' === $scheme) { - $scheme = null; - } - - $fragment = $uri->getFragment(); - if ('' === $fragment) { - $fragment = null; - } - - $query = $uri->getQuery(); - if ('' === $query) { - $query = null; - } - - $host = $uri->getHost(); - if ('' === $host) { - $host = null; - } - - $user_info = $uri->getUserInfo(); - $user = null; - $pass = null; - if ('' !== $user_info) { - [$user, $pass] = explode(':', $user_info, 2) + [1 => null]; - } - - return new self( - $scheme, - $user, - $pass, - $host, - $uri->getPort(), - $uri->getPath(), - $query, - $fragment - ); - } - - /** - * Create a new instance from the environment. - */ - public static function createFromServer(array $server): self - { - [$user, $pass] = self::fetchUserInfo($server); - [$host, $port] = self::fetchHostname($server); - [$path, $query] = self::fetchRequestUri($server); - - return Uri::createFromComponents([ - 'scheme' => self::fetchScheme($server), - 'user' => $user, - 'pass' => $pass, - 'host' => $host, - 'port' => $port, - 'path' => $path, - 'query' => $query, - ]); - } - - /** - * Returns the environment scheme. - */ - private static function fetchScheme(array $server): string - { - $server += ['HTTPS' => '']; - $res = filter_var($server['HTTPS'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); - - return false !== $res ? 'https' : 'http'; - } - - /** - * Returns the environment user info. - * - * @return array{0:?string, 1:?string} - */ - private static function fetchUserInfo(array $server): array - { - $server += ['PHP_AUTH_USER' => null, 'PHP_AUTH_PW' => null, 'HTTP_AUTHORIZATION' => '']; - $user = $server['PHP_AUTH_USER']; - $pass = $server['PHP_AUTH_PW']; - if (0 === strpos(strtolower($server['HTTP_AUTHORIZATION']), 'basic')) { - $userinfo = base64_decode(substr($server['HTTP_AUTHORIZATION'], 6), true); - if (false === $userinfo) { - throw new SyntaxError('The user info could not be detected'); - } - [$user, $pass] = explode(':', $userinfo, 2) + [1 => null]; - } - - if (null !== $user) { - $user = rawurlencode($user); - } - - if (null !== $pass) { - $pass = rawurlencode($pass); - } - - return [$user, $pass]; - } - - /** - * Returns the environment host. - * - * @throws SyntaxError If the host can not be detected - * - * @return array{0:string|null, 1:int|null} - */ - private static function fetchHostname(array $server): array - { - $server += ['SERVER_PORT' => null]; - if (null !== $server['SERVER_PORT']) { - $server['SERVER_PORT'] = (int) $server['SERVER_PORT']; - } - - if (isset($server['HTTP_HOST']) && 1 === preg_match(self::REGEXP_HOST_PORT, $server['HTTP_HOST'], $matches)) { - if (isset($matches['port'])) { - $matches['port'] = (int) $matches['port']; - } - - return [ - $matches['host'], - $matches['port'] ?? $server['SERVER_PORT'], - ]; - } - - if (!isset($server['SERVER_ADDR'])) { - throw new SyntaxError('The host could not be detected'); - } - - if (false === filter_var($server['SERVER_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - $server['SERVER_ADDR'] = '['.$server['SERVER_ADDR'].']'; - } - - return [$server['SERVER_ADDR'], $server['SERVER_PORT']]; - } - - /** - * Returns the environment path. - * - * @return array{0:?string, 1:?string} - */ - private static function fetchRequestUri(array $server): array - { - $server += ['IIS_WasUrlRewritten' => null, 'UNENCODED_URL' => '', 'PHP_SELF' => '', 'QUERY_STRING' => null]; - if ('1' === $server['IIS_WasUrlRewritten'] && '' !== $server['UNENCODED_URL']) { - /** @var array{0:?string, 1:?string} $retval */ - $retval = explode('?', $server['UNENCODED_URL'], 2) + [1 => null]; - - return $retval; - } - - if (isset($server['REQUEST_URI'])) { - [$path, ] = explode('?', $server['REQUEST_URI'], 2); - $query = ('' !== $server['QUERY_STRING']) ? $server['QUERY_STRING'] : null; - - return [$path, $query]; - } - - return [$server['PHP_SELF'], $server['QUERY_STRING']]; - } - - /** - * Generate the URI authority part. - */ - private function setAuthority(): ?string - { - $authority = null; - if (null !== $this->user_info) { - $authority = $this->user_info.'@'; - } - - if (null !== $this->host) { - $authority .= $this->host; - } - - if (null !== $this->port) { - $authority .= ':'.$this->port; - } - - return $authority; - } - - /** - * Format the Path component. - */ - private function formatPath(string $path): string - { - $path = $this->formatDataPath($path); - - static $pattern = '/(?:[^'.self::REGEXP_CHARS_UNRESERVED.self::REGEXP_CHARS_SUBDELIM.'%:@\/}{]++|%(?![A-Fa-f0-9]{2}))/'; - - $path = (string) preg_replace_callback($pattern, [Uri::class, 'urlEncodeMatch'], $path); - - return $this->formatFilePath($path); - } - - /** - * Filter the Path component. - * - * @link https://tools.ietf.org/html/rfc2397 - * - * @throws SyntaxError If the path is not compliant with RFC2397 - */ - private function formatDataPath(string $path): string - { - if ('data' !== $this->scheme) { - return $path; - } - - if ('' == $path) { - return 'text/plain;charset=us-ascii,'; - } - - if (strlen($path) !== strspn($path, self::ASCII) || false === strpos($path, ',')) { - throw new SyntaxError(sprintf('The path `%s` is invalid according to RFC2937', $path)); - } - - $parts = explode(',', $path, 2) + [1 => null]; - $mediatype = explode(';', (string) $parts[0], 2) + [1 => null]; - $data = (string) $parts[1]; - $mimetype = $mediatype[0]; - if (null === $mimetype || '' === $mimetype) { - $mimetype = 'text/plain'; - } - - $parameters = $mediatype[1]; - if (null === $parameters || '' === $parameters) { - $parameters = 'charset=us-ascii'; - } - - $this->assertValidPath($mimetype, $parameters, $data); - - return $mimetype.';'.$parameters.','.$data; - } - - /** - * Assert the path is a compliant with RFC2397. - * - * @link https://tools.ietf.org/html/rfc2397 - * - * @throws SyntaxError If the mediatype or the data are not compliant with the RFC2397 - */ - private function assertValidPath(string $mimetype, string $parameters, string $data): void - { - if (1 !== preg_match(self::REGEXP_MIMETYPE, $mimetype)) { - throw new SyntaxError(sprintf('The path mimetype `%s` is invalid', $mimetype)); - } - - $is_binary = 1 === preg_match(self::REGEXP_BINARY, $parameters, $matches); - if ($is_binary) { - $parameters = substr($parameters, 0, - strlen($matches[0])); - } - - $res = array_filter(array_filter(explode(';', $parameters), [$this, 'validateParameter'])); - if ([] !== $res) { - throw new SyntaxError(sprintf('The path paremeters `%s` is invalid', $parameters)); - } - - if (!$is_binary) { - return; - } - - $res = base64_decode($data, true); - if (false === $res || $data !== base64_encode($res)) { - throw new SyntaxError(sprintf('The path data `%s` is invalid', $data)); - } - } - - /** - * Validate mediatype parameter. - */ - private function validateParameter(string $parameter): bool - { - $properties = explode('=', $parameter); - - return 2 != count($properties) || 'base64' === strtolower($properties[0]); - } - - /** - * Format path component for file scheme. - */ - private function formatFilePath(string $path): string - { - if ('file' !== $this->scheme) { - return $path; - } - - $replace = static function (array $matches): string { - return $matches['delim'].$matches['volume'].':'.$matches['rest']; - }; - - return (string) preg_replace_callback(self::REGEXP_FILE_PATH, $replace, $path); - } - - /** - * Format the Query or the Fragment component. - * - * Returns a array containing: - *
            - *
          • the formatted component (a string or null)
          • - *
          • a boolean flag telling wether the delimiter is to be added to the component - * when building the URI string representation
          • - *
          - * - * @param ?string $component - */ - private function formatQueryAndFragment(?string $component): ?string - { - if (null === $component || '' === $component) { - return $component; - } - - static $pattern = '/(?:[^'.self::REGEXP_CHARS_UNRESERVED.self::REGEXP_CHARS_SUBDELIM.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/'; - return preg_replace_callback($pattern, [Uri::class, 'urlEncodeMatch'], $component); - } - - /** - * assert the URI internal state is valid. - * - * @link https://tools.ietf.org/html/rfc3986#section-3 - * @link https://tools.ietf.org/html/rfc3986#section-3.3 - * - * @throws SyntaxError if the URI is in an invalid state according to RFC3986 - * @throws SyntaxError if the URI is in an invalid state according to scheme specific rules - */ - private function assertValidState(): void - { - if (null !== $this->authority && ('' !== $this->path && '/' !== $this->path[0])) { - throw new SyntaxError('If an authority is present the path must be empty or start with a `/`.'); - } - - if (null === $this->authority && 0 === strpos($this->path, '//')) { - throw new SyntaxError(sprintf('If there is no authority the path `%s` can not start with a `//`.', $this->path)); - } - - $pos = strpos($this->path, ':'); - if (null === $this->authority - && null === $this->scheme - && false !== $pos - && false === strpos(substr($this->path, 0, $pos), '/') - ) { - throw new SyntaxError('In absence of a scheme and an authority the first path segment cannot contain a colon (":") character.'); - } - - $validationMethod = self::SCHEME_VALIDATION_METHOD[$this->scheme] ?? null; - if (null === $validationMethod || true === $this->$validationMethod()) { - $this->uri = null; - - return; - } - - throw new SyntaxError(sprintf('The uri `%s` is invalid for the `%s` scheme.', (string) $this, $this->scheme)); - } - - /** - * URI validation for URI schemes which allows only scheme and path components. - */ - private function isUriWithSchemeAndPathOnly(): bool - { - return null === $this->authority - && null === $this->query - && null === $this->fragment; - } - - /** - * URI validation for URI schemes which allows only scheme, host and path components. - */ - private function isUriWithSchemeHostAndPathOnly(): bool - { - return null === $this->user_info - && null === $this->port - && null === $this->query - && null === $this->fragment - && !('' != $this->scheme && null === $this->host); - } - - /** - * URI validation for URI schemes which disallow the empty '' host. - */ - private function isNonEmptyHostUri(): bool - { - return '' !== $this->host - && !(null !== $this->scheme && null === $this->host); - } - - /** - * URI validation for URIs schemes which disallow the empty '' host - * and forbids the fragment component. - */ - private function isNonEmptyHostUriWithoutFragment(): bool - { - return $this->isNonEmptyHostUri() && null === $this->fragment; - } - - /** - * URI validation for URIs schemes which disallow the empty '' host - * and forbids fragment and query components. - */ - private function isNonEmptyHostUriWithoutFragmentAndQuery(): bool - { - return $this->isNonEmptyHostUri() && null === $this->fragment && null === $this->query; - } - - /** - * Generate the URI string representation from its components. - * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 - * - * @param ?string $scheme - * @param ?string $authority - * @param ?string $query - * @param ?string $fragment - */ - private function getUriString( - ?string $scheme, - ?string $authority, - string $path, - ?string $query, - ?string $fragment - ): string { - if (null !== $scheme) { - $scheme = $scheme.':'; - } - - if (null !== $authority) { - $authority = '//'.$authority; - } - - if (null !== $query) { - $query = '?'.$query; - } - - if (null !== $fragment) { - $fragment = '#'.$fragment; - } - - return $scheme.$authority.$path.$query.$fragment; - } - - public function toString(): string - { - $this->uri = $this->uri ?? $this->getUriString( - $this->scheme, - $this->authority, - $this->path, - $this->query, - $this->fragment - ); - - return $this->uri; - } - - /** - * {@inheritDoc} - */ - public function __toString(): string - { - return $this->toString(); - } - - /** - * {@inheritDoc} - */ - public function jsonSerialize(): string - { - return $this->toString(); - } - - /** - * {@inheritDoc} - * - * @return array{scheme:?string, user_info:?string, host:?string, port:?int, path:string, query:?string, fragment:?string} - */ - public function __debugInfo(): array - { - return [ - 'scheme' => $this->scheme, - 'user_info' => isset($this->user_info) ? preg_replace(',:(.*).?$,', ':***', $this->user_info) : null, - 'host' => $this->host, - 'port' => $this->port, - 'path' => $this->path, - 'query' => $this->query, - 'fragment' => $this->fragment, - ]; - } - - /** - * {@inheritDoc} - */ - public function getScheme(): ?string - { - return $this->scheme; - } - - /** - * {@inheritDoc} - */ - public function getAuthority(): ?string - { - return $this->authority; - } - - /** - * {@inheritDoc} - */ - public function getUserInfo(): ?string - { - return $this->user_info; - } - - /** - * {@inheritDoc} - */ - public function getHost(): ?string - { - return $this->host; - } - - /** - * {@inheritDoc} - */ - public function getPort(): ?int - { - return $this->port; - } - - /** - * {@inheritDoc} - */ - public function getPath(): string - { - if (0 === strpos($this->path, '//')) { - return '/'.ltrim($this->path, '/'); - } - - return $this->path; - } - - /** - * {@inheritDoc} - */ - public function getQuery(): ?string - { - return $this->query; - } - - /** - * {@inheritDoc} - */ - public function getFragment(): ?string - { - return $this->fragment; - } - - /** - * {@inheritDoc} - */ - public function withScheme($scheme): UriInterface - { - $scheme = $this->formatScheme($this->filterString($scheme)); - if ($scheme === $this->scheme) { - return $this; - } - - $clone = clone $this; - $clone->scheme = $scheme; - $clone->port = $clone->formatPort($clone->port); - $clone->authority = $clone->setAuthority(); - $clone->assertValidState(); - - return $clone; - } - - /** - * Filter a string. - * - * @param mixed $str the value to evaluate as a string - * - * @throws SyntaxError if the submitted data can not be converted to string - */ - private function filterString($str): ?string - { - if (null === $str) { - return $str; - } - - if (is_object($str) && method_exists($str, '__toString')) { - $str = (string) $str; - } - - if (!is_scalar($str)) { - throw new SyntaxError(sprintf('The component must be a string, a scalar or a stringable object; `%s` given.', gettype($str))); - } - - $str = (string) $str; - if (1 !== preg_match(self::REGEXP_INVALID_CHARS, $str)) { - return $str; - } - - throw new SyntaxError(sprintf('The component `%s` contains invalid characters.', $str)); - } - - /** - * {@inheritDoc} - */ - public function withUserInfo($user, $password = null): UriInterface - { - $user_info = null; - $user = $this->filterString($user); - if (null !== $password) { - $password = $this->filterString($password); - } - - if ('' !== $user) { - $user_info = $this->formatUserInfo($user, $password); - } - - if ($user_info === $this->user_info) { - return $this; - } - - $clone = clone $this; - $clone->user_info = $user_info; - $clone->authority = $clone->setAuthority(); - $clone->assertValidState(); - - return $clone; - } - - /** - * {@inheritDoc} - */ - public function withHost($host): UriInterface - { - $host = $this->formatHost($this->filterString($host)); - if ($host === $this->host) { - return $this; - } - - $clone = clone $this; - $clone->host = $host; - $clone->authority = $clone->setAuthority(); - $clone->assertValidState(); - - return $clone; - } - - /** - * {@inheritDoc} - */ - public function withPort($port): UriInterface - { - $port = $this->formatPort($port); - if ($port === $this->port) { - return $this; - } - - $clone = clone $this; - $clone->port = $port; - $clone->authority = $clone->setAuthority(); - $clone->assertValidState(); - - return $clone; - } - - /** - * {@inheritDoc} - * - * @param string|object $path - */ - public function withPath($path): UriInterface - { - $path = $this->filterString($path); - if (null === $path) { - throw new TypeError('A path must be a string NULL given.'); - } - - $path = $this->formatPath($path); - if ($path === $this->path) { - return $this; - } - - $clone = clone $this; - $clone->path = $path; - $clone->assertValidState(); - - return $clone; - } - - /** - * {@inheritDoc} - */ - public function withQuery($query): UriInterface - { - $query = $this->formatQueryAndFragment($this->filterString($query)); - if ($query === $this->query) { - return $this; - } - - $clone = clone $this; - $clone->query = $query; - $clone->assertValidState(); - - return $clone; - } - - /** - * {@inheritDoc} - */ - public function withFragment($fragment): UriInterface - { - $fragment = $this->formatQueryAndFragment($this->filterString($fragment)); - if ($fragment === $this->fragment) { - return $this; - } - - $clone = clone $this; - $clone->fragment = $fragment; - $clone->assertValidState(); - - return $clone; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriInfo.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriInfo.php deleted file mode 100644 index ec8473c5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriInfo.php +++ /dev/null @@ -1,215 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri; - -use League\Uri\Contracts\UriInterface; -use Psr\Http\Message\UriInterface as Psr7UriInterface; -use TypeError; -use function explode; -use function implode; -use function preg_replace_callback; -use function rawurldecode; -use function sprintf; - -final class UriInfo -{ - private const REGEXP_ENCODED_CHARS = ',%(2[D|E]|3[0-9]|4[1-9|A-F]|5[0-9|AF]|6[1-9|A-F]|7[0-9|E]),i'; - - private const WHATWG_SPECIAL_SCHEMES = ['ftp' => 21, 'http' => 80, 'https' => 443, 'ws' => 80, 'wss' => 443]; - - /** - * @codeCoverageIgnore - */ - private function __construct() - { - } - - /** - * @param Psr7UriInterface|UriInterface $uri - */ - private static function emptyComponentValue($uri): ?string - { - return $uri instanceof Psr7UriInterface ? '' : null; - } - - /** - * Filter the URI object. - * - * To be valid an URI MUST implement at least one of the following interface: - * - League\Uri\UriInterface - * - Psr\Http\Message\UriInterface - * - * @param mixed $uri the URI to validate - * - * @throws TypeError if the URI object does not implements the supported interfaces. - * - * @return Psr7UriInterface|UriInterface - */ - private static function filterUri($uri) - { - if ($uri instanceof Psr7UriInterface || $uri instanceof UriInterface) { - return $uri; - } - - throw new TypeError(sprintf('The uri must be a valid URI object received `%s`', is_object($uri) ? get_class($uri) : gettype($uri))); - } - - /** - * Normalize an URI for comparison. - * - * @param Psr7UriInterface|UriInterface $uri - * - * @return Psr7UriInterface|UriInterface - */ - private static function normalize($uri) - { - $uri = self::filterUri($uri); - $null = self::emptyComponentValue($uri); - - $path = $uri->getPath(); - if ('/' === ($path[0] ?? '') || '' !== $uri->getScheme().$uri->getAuthority()) { - $path = UriResolver::resolve($uri, $uri->withPath('')->withQuery($null))->getPath(); - } - - $query = $uri->getQuery(); - $fragment = $uri->getFragment(); - $fragmentOrig = $fragment; - $pairs = null === $query ? [] : explode('&', $query); - sort($pairs, SORT_REGULAR); - - $replace = static fn (array $matches): string => rawurldecode($matches[0]); - - $retval = preg_replace_callback(self::REGEXP_ENCODED_CHARS, $replace, [$path, implode('&', $pairs), $fragment]); - if (null !== $retval) { - [$path, $query, $fragment] = $retval + ['', $null, $null]; - } - - if ($null !== $uri->getAuthority() && '' === $path) { - $path = '/'; - } - - return $uri - ->withHost(Uri::createFromComponents(['host' => $uri->getHost()])->getHost()) - ->withPath($path) - ->withQuery([] === $pairs ? $null : $query) - ->withFragment($null === $fragmentOrig ? $fragmentOrig : $fragment); - } - - /** - * Tell whether the URI represents an absolute URI. - * - * @param Psr7UriInterface|UriInterface $uri - */ - public static function isAbsolute($uri): bool - { - return self::emptyComponentValue($uri) !== self::filterUri($uri)->getScheme(); - } - - /** - * Tell whether the URI represents a network path. - * - * @param Psr7UriInterface|UriInterface $uri - */ - public static function isNetworkPath($uri): bool - { - $uri = self::filterUri($uri); - $null = self::emptyComponentValue($uri); - - return $null === $uri->getScheme() && $null !== $uri->getAuthority(); - } - - /** - * Tell whether the URI represents an absolute path. - * - * @param Psr7UriInterface|UriInterface $uri - */ - public static function isAbsolutePath($uri): bool - { - $uri = self::filterUri($uri); - $null = self::emptyComponentValue($uri); - - return $null === $uri->getScheme() - && $null === $uri->getAuthority() - && '/' === ($uri->getPath()[0] ?? ''); - } - - /** - * Tell whether the URI represents a relative path. - * - * @param Psr7UriInterface|UriInterface $uri - */ - public static function isRelativePath($uri): bool - { - $uri = self::filterUri($uri); - $null = self::emptyComponentValue($uri); - - return $null === $uri->getScheme() - && $null === $uri->getAuthority() - && '/' !== ($uri->getPath()[0] ?? ''); - } - - /** - * Tell whether both URI refers to the same document. - * - * @param Psr7UriInterface|UriInterface $uri - * @param Psr7UriInterface|UriInterface $base_uri - */ - public static function isSameDocument($uri, $base_uri): bool - { - $uri = self::normalize($uri); - $base_uri = self::normalize($base_uri); - - return (string) $uri->withFragment($uri instanceof Psr7UriInterface ? '' : null) - === (string) $base_uri->withFragment($base_uri instanceof Psr7UriInterface ? '' : null); - } - - /** - * Returns the URI origin property as defined by WHATWG URL living standard. - * - * {@see https://url.spec.whatwg.org/#origin} - * - * For URI without a special scheme the method returns null - * For URI with the file scheme the method will return null (as this is left to the implementation decision) - * For URI with a special scheme the method returns the scheme followed by its authority (without the userinfo part) - * - * @param Psr7UriInterface|UriInterface $uri - */ - public static function getOrigin($uri): ?string - { - $scheme = self::filterUri($uri)->getScheme(); - if ('blob' === $scheme) { - $uri = Uri::createFromString($uri->getPath()); - $scheme = $uri->getScheme(); - } - - if (null === $scheme || !array_key_exists($scheme, self::WHATWG_SPECIAL_SCHEMES)) { - return null; - } - - $null = self::emptyComponentValue($uri); - - return (string) $uri->withFragment($null)->withQuery($null)->withPath('')->withUserInfo($null); - } - - /** - * @param Psr7UriInterface|UriInterface $uri - * @param Psr7UriInterface|UriInterface $base_uri - */ - public static function isCrossOrigin($uri, $base_uri): bool - { - return null === ($uriString = self::getOrigin(Uri::createFromUri($uri))) - || null === ($baseUriString = self::getOrigin(Uri::createFromUri($base_uri))) - || $uriString !== $baseUriString; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriResolver.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriResolver.php deleted file mode 100644 index 1090383c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriResolver.php +++ /dev/null @@ -1,376 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri; - -use League\Uri\Contracts\UriInterface; -use Psr\Http\Message\UriInterface as Psr7UriInterface; -use TypeError; -use function array_pop; -use function array_reduce; -use function count; -use function end; -use function explode; -use function gettype; -use function implode; -use function in_array; -use function sprintf; -use function str_repeat; -use function strpos; -use function substr; - -final class UriResolver -{ - /** - * @var array - */ - const DOT_SEGMENTS = ['.' => 1, '..' => 1]; - - /** - * @codeCoverageIgnore - */ - private function __construct() - { - } - - /** - * Resolve an URI against a base URI using RFC3986 rules. - * - * If the first argument is a UriInterface the method returns a UriInterface object - * If the first argument is a Psr7UriInterface the method returns a Psr7UriInterface object - * - * @param Psr7UriInterface|UriInterface $uri - * @param Psr7UriInterface|UriInterface $base_uri - * - * @return Psr7UriInterface|UriInterface - */ - public static function resolve($uri, $base_uri) - { - self::filterUri($uri); - self::filterUri($base_uri); - $null = $uri instanceof Psr7UriInterface ? '' : null; - - if ($null !== $uri->getScheme()) { - return $uri - ->withPath(self::removeDotSegments($uri->getPath())); - } - - if ($null !== $uri->getAuthority()) { - return $uri - ->withScheme($base_uri->getScheme()) - ->withPath(self::removeDotSegments($uri->getPath())); - } - - $user = $null; - $pass = null; - $userInfo = $base_uri->getUserInfo(); - if (null !== $userInfo) { - [$user, $pass] = explode(':', $userInfo, 2) + [1 => null]; - } - - [$uri_path, $uri_query] = self::resolvePathAndQuery($uri, $base_uri); - - return $uri - ->withPath(self::removeDotSegments($uri_path)) - ->withQuery($uri_query) - ->withHost($base_uri->getHost()) - ->withPort($base_uri->getPort()) - ->withUserInfo((string) $user, $pass) - ->withScheme($base_uri->getScheme()) - ; - } - - /** - * Filter the URI object. - * - * @param mixed $uri an URI object - * - * @throws TypeError if the URI object does not implements the supported interfaces. - */ - private static function filterUri($uri): void - { - if (!$uri instanceof UriInterface && !$uri instanceof Psr7UriInterface) { - throw new TypeError(sprintf('The uri must be a valid URI object received `%s`', gettype($uri))); - } - } - - /** - * Remove dot segments from the URI path. - */ - private static function removeDotSegments(string $path): string - { - if (false === strpos($path, '.')) { - return $path; - } - - $old_segments = explode('/', $path); - $new_path = implode('/', array_reduce($old_segments, [UriResolver::class, 'reducer'], [])); - if (isset(self::DOT_SEGMENTS[end($old_segments)])) { - $new_path .= '/'; - } - - // @codeCoverageIgnoreStart - // added because some PSR-7 implementations do not respect RFC3986 - if (0 === strpos($path, '/') && 0 !== strpos($new_path, '/')) { - return '/'.$new_path; - } - // @codeCoverageIgnoreEnd - - return $new_path; - } - - /** - * Remove dot segments. - * - * @return array - */ - private static function reducer(array $carry, string $segment): array - { - if ('..' === $segment) { - array_pop($carry); - - return $carry; - } - - if (!isset(self::DOT_SEGMENTS[$segment])) { - $carry[] = $segment; - } - - return $carry; - } - - /** - * Resolve an URI path and query component. - * - * @param Psr7UriInterface|UriInterface $uri - * @param Psr7UriInterface|UriInterface $base_uri - * - * @return array{0:string, 1:string|null} - */ - private static function resolvePathAndQuery($uri, $base_uri): array - { - $target_path = $uri->getPath(); - $target_query = $uri->getQuery(); - $null = $uri instanceof Psr7UriInterface ? '' : null; - $baseNull = $base_uri instanceof Psr7UriInterface ? '' : null; - - if (0 === strpos($target_path, '/')) { - return [$target_path, $target_query]; - } - - if ('' === $target_path) { - if ($null === $target_query) { - $target_query = $base_uri->getQuery(); - } - - $target_path = $base_uri->getPath(); - //@codeCoverageIgnoreStart - //because some PSR-7 Uri implementations allow this RFC3986 forbidden construction - if ($baseNull !== $base_uri->getAuthority() && 0 !== strpos($target_path, '/')) { - $target_path = '/'.$target_path; - } - //@codeCoverageIgnoreEnd - - return [$target_path, $target_query]; - } - - $base_path = $base_uri->getPath(); - if ($baseNull !== $base_uri->getAuthority() && '' === $base_path) { - $target_path = '/'.$target_path; - } - - if ('' !== $base_path) { - $segments = explode('/', $base_path); - array_pop($segments); - if ([] !== $segments) { - $target_path = implode('/', $segments).'/'.$target_path; - } - } - - return [$target_path, $target_query]; - } - - /** - * Relativize an URI according to a base URI. - * - * This method MUST retain the state of the submitted URI instance, and return - * an URI instance of the same type that contains the applied modifications. - * - * This method MUST be transparent when dealing with error and exceptions. - * It MUST not alter of silence them apart from validating its own parameters. - * - * @param Psr7UriInterface|UriInterface $uri - * @param Psr7UriInterface|UriInterface $base_uri - * - * @return Psr7UriInterface|UriInterface - */ - public static function relativize($uri, $base_uri) - { - self::filterUri($uri); - self::filterUri($base_uri); - $uri = self::formatHost($uri); - $base_uri = self::formatHost($base_uri); - if (!self::isRelativizable($uri, $base_uri)) { - return $uri; - } - - $null = $uri instanceof Psr7UriInterface ? '' : null; - $uri = $uri->withScheme($null)->withPort(null)->withUserInfo($null)->withHost($null); - $target_path = $uri->getPath(); - if ($target_path !== $base_uri->getPath()) { - return $uri->withPath(self::relativizePath($target_path, $base_uri->getPath())); - } - - if (self::componentEquals('getQuery', $uri, $base_uri)) { - return $uri->withPath('')->withQuery($null); - } - - if ($null === $uri->getQuery()) { - return $uri->withPath(self::formatPathWithEmptyBaseQuery($target_path)); - } - - return $uri->withPath(''); - } - - /** - * Tells whether the component value from both URI object equals. - * - * @param Psr7UriInterface|UriInterface $uri - * @param Psr7UriInterface|UriInterface $base_uri - */ - private static function componentEquals(string $method, $uri, $base_uri): bool - { - return self::getComponent($method, $uri) === self::getComponent($method, $base_uri); - } - - /** - * Returns the component value from the submitted URI object. - * - * @param Psr7UriInterface|UriInterface $uri - */ - private static function getComponent(string $method, $uri): ?string - { - $component = $uri->$method(); - if ($uri instanceof Psr7UriInterface && '' === $component) { - return null; - } - - return $component; - } - - /** - * Filter the URI object. - * - * @param Psr7UriInterface|UriInterface $uri - * - * @throws TypeError if the URI object does not implements the supported interfaces. - * - * @return Psr7UriInterface|UriInterface - */ - private static function formatHost($uri) - { - if (!$uri instanceof Psr7UriInterface) { - return $uri; - } - - $host = $uri->getHost(); - if ('' === $host) { - return $uri; - } - - return $uri->withHost((string) Uri::createFromComponents(['host' => $host])->getHost()); - } - - /** - * Tell whether the submitted URI object can be relativize. - * - * @param Psr7UriInterface|UriInterface $uri - * @param Psr7UriInterface|UriInterface $base_uri - */ - private static function isRelativizable($uri, $base_uri): bool - { - return !UriInfo::isRelativePath($uri) - && self::componentEquals('getScheme', $uri, $base_uri) - && self::componentEquals('getAuthority', $uri, $base_uri); - } - - /** - * Relative the URI for a authority-less target URI. - */ - private static function relativizePath(string $path, string $basepath): string - { - $base_segments = self::getSegments($basepath); - $target_segments = self::getSegments($path); - $target_basename = array_pop($target_segments); - array_pop($base_segments); - foreach ($base_segments as $offset => $segment) { - if (!isset($target_segments[$offset]) || $segment !== $target_segments[$offset]) { - break; - } - unset($base_segments[$offset], $target_segments[$offset]); - } - $target_segments[] = $target_basename; - - return self::formatPath( - str_repeat('../', count($base_segments)).implode('/', $target_segments), - $basepath - ); - } - - /** - * returns the path segments. - * - * @return string[] - */ - private static function getSegments(string $path): array - { - if ('' !== $path && '/' === $path[0]) { - $path = substr($path, 1); - } - - return explode('/', $path); - } - - /** - * Formatting the path to keep a valid URI. - */ - private static function formatPath(string $path, string $basepath): string - { - if ('' === $path) { - return in_array($basepath, ['', '/'], true) ? $basepath : './'; - } - - if (false === ($colon_pos = strpos($path, ':'))) { - return $path; - } - - $slash_pos = strpos($path, '/'); - if (false === $slash_pos || $colon_pos < $slash_pos) { - return "./$path"; - } - - return $path; - } - - /** - * Formatting the path to keep a resolvable URI. - */ - private static function formatPathWithEmptyBaseQuery(string $path): string - { - $target_segments = self::getSegments($path); - /** @var string $basename */ - $basename = end($target_segments); - - return '' === $basename ? './' : $basename; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriString.php deleted file mode 100644 index 674e1a43..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriString.php +++ /dev/null @@ -1,467 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri; - -use League\Uri\Exceptions\IdnaConversionFailed; -use League\Uri\Exceptions\IdnSupportMissing; -use League\Uri\Exceptions\SyntaxError; -use League\Uri\Idna\Idna; -use TypeError; -use function array_merge; -use function explode; -use function filter_var; -use function gettype; -use function inet_pton; -use function is_object; -use function is_scalar; -use function method_exists; -use function preg_match; -use function rawurldecode; -use function sprintf; -use function strpos; -use function substr; -use const FILTER_FLAG_IPV6; -use const FILTER_VALIDATE_IP; - -/** - * A class to parse a URI string according to RFC3986. - * - * @link https://tools.ietf.org/html/rfc3986 - * @package League\Uri - * @author Ignace Nyamagana Butera - * @since 6.0.0 - */ -final class UriString -{ - /** - * Default URI component values. - */ - private const URI_COMPONENTS = [ - 'scheme' => null, 'user' => null, 'pass' => null, 'host' => null, - 'port' => null, 'path' => '', 'query' => null, 'fragment' => null, - ]; - - /** - * Simple URI which do not need any parsing. - */ - private const URI_SCHORTCUTS = [ - '' => [], - '#' => ['fragment' => ''], - '?' => ['query' => ''], - '?#' => ['query' => '', 'fragment' => ''], - '/' => ['path' => '/'], - '//' => ['host' => ''], - ]; - - /** - * Range of invalid characters in URI string. - */ - private const REGEXP_INVALID_URI_CHARS = '/[\x00-\x1f\x7f]/'; - - /** - * RFC3986 regular expression URI splitter. - * - * @link https://tools.ietf.org/html/rfc3986#appendix-B - */ - private const REGEXP_URI_PARTS = ',^ - (?(?[^:/?\#]+):)? # URI scheme component - (?//(?[^/?\#]*))? # URI authority part - (?[^?\#]*) # URI path component - (?\?(?[^\#]*))? # URI query component - (?\#(?.*))? # URI fragment component - ,x'; - - /** - * URI scheme regular expresssion. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.1 - */ - private const REGEXP_URI_SCHEME = '/^([a-z][a-z\d\+\.\-]*)?$/i'; - - /** - * IPvFuture regular expression. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - private const REGEXP_IP_FUTURE = '/^ - v(?[A-F0-9])+\. - (?: - (?[a-z0-9_~\-\.])| - (?[!$&\'()*+,;=:]) # also include the : character - )+ - $/ix'; - - /** - * General registered name regular expression. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - private const REGEXP_REGISTERED_NAME = '/(?(DEFINE) - (?[a-z0-9_~\-]) # . is missing as it is used to separate labels - (?[!$&\'()*+,;=]) - (?%[A-F0-9]{2}) - (?(?:(?&unreserved)|(?&sub_delims)|(?&encoded))*) - ) - ^(?:(?®_name)\.)*(?®_name)\.?$/ix'; - - /** - * Invalid characters in host regular expression. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - */ - private const REGEXP_INVALID_HOST_CHARS = '/ - [:\/?#\[\]@ ] # gen-delims characters as well as the space character - /ix'; - - /** - * Invalid path for URI without scheme and authority regular expression. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.3 - */ - private const REGEXP_INVALID_PATH = ',^(([^/]*):)(.*)?/,'; - - /** - * Host and Port splitter regular expression. - */ - private const REGEXP_HOST_PORT = ',^(?\[.*\]|[^:]*)(:(?.*))?$,'; - - /** - * IDN Host detector regular expression. - */ - private const REGEXP_IDN_PATTERN = '/[^\x20-\x7f]/'; - - /** - * Only the address block fe80::/10 can have a Zone ID attach to - * let's detect the link local significant 10 bits. - */ - private const ZONE_ID_ADDRESS_BLOCK = "\xfe\x80"; - - /** - * Generate an URI string representation from its parsed representation - * returned by League\UriString::parse() or PHP's parse_url. - * - * If you supply your own array, you are responsible for providing - * valid components without their URI delimiters. - * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 - * @link https://tools.ietf.org/html/rfc3986#section-7.5 - * - * @param array{ - * scheme:?string, - * user:?string, - * pass:?string, - * host:?string, - * port:?int, - * path:?string, - * query:?string, - * fragment:?string - * } $components - */ - public static function build(array $components): string - { - $result = $components['path'] ?? ''; - if (isset($components['query'])) { - $result .= '?'.$components['query']; - } - - if (isset($components['fragment'])) { - $result .= '#'.$components['fragment']; - } - - $scheme = null; - if (isset($components['scheme'])) { - $scheme = $components['scheme'].':'; - } - - if (!isset($components['host'])) { - return $scheme.$result; - } - - $scheme .= '//'; - $authority = $components['host']; - if (isset($components['port'])) { - $authority .= ':'.$components['port']; - } - - if (!isset($components['user'])) { - return $scheme.$authority.$result; - } - - $authority = '@'.$authority; - if (!isset($components['pass'])) { - return $scheme.$components['user'].$authority.$result; - } - - return $scheme.$components['user'].':'.$components['pass'].$authority.$result; - } - - /** - * Parse an URI string into its components. - * - * This method parses a URI and returns an associative array containing any - * of the various components of the URI that are present. - * - * - * $components = (new Parser())->parse('http://foo@test.example.com:42?query#'); - * var_export($components); - * //will display - * array( - * 'scheme' => 'http', // the URI scheme component - * 'user' => 'foo', // the URI user component - * 'pass' => null, // the URI pass component - * 'host' => 'test.example.com', // the URI host component - * 'port' => 42, // the URI port component - * 'path' => '', // the URI path component - * 'query' => 'query', // the URI query component - * 'fragment' => '', // the URI fragment component - * ); - * - * - * The returned array is similar to PHP's parse_url return value with the following - * differences: - * - *
            - *
          • All components are always present in the returned array
          • - *
          • Empty and undefined component are treated differently. And empty component is - * set to the empty string while an undefined component is set to the `null` value.
          • - *
          • The path component is never undefined
          • - *
          • The method parses the URI following the RFC3986 rules but you are still - * required to validate the returned components against its related scheme specific rules.
          • - *
          - * - * @link https://tools.ietf.org/html/rfc3986 - * - * @param mixed $uri any scalar or stringable object - * - * @throws SyntaxError if the URI contains invalid characters - * @throws SyntaxError if the URI contains an invalid scheme - * @throws SyntaxError if the URI contains an invalid path - * - * @return array{ - * scheme:?string, - * user:?string, - * pass:?string, - * host:?string, - * port:?int, - * path:string, - * query:?string, - * fragment:?string - * } - */ - public static function parse($uri): array - { - if (is_object($uri) && method_exists($uri, '__toString')) { - $uri = (string) $uri; - } - - if (!is_scalar($uri)) { - throw new TypeError(sprintf('The uri must be a scalar or a stringable object `%s` given', gettype($uri))); - } - - $uri = (string) $uri; - - if (isset(self::URI_SCHORTCUTS[$uri])) { - /** @var array{scheme:?string, user:?string, pass:?string, host:?string, port:?int, path:string, query:?string, fragment:?string} $components */ - $components = array_merge(self::URI_COMPONENTS, self::URI_SCHORTCUTS[$uri]); - - return $components; - } - - if (1 === preg_match(self::REGEXP_INVALID_URI_CHARS, $uri)) { - throw new SyntaxError(sprintf('The uri `%s` contains invalid characters', $uri)); - } - - //if the first character is a known URI delimiter parsing can be simplified - $first_char = $uri[0]; - - //The URI is made of the fragment only - if ('#' === $first_char) { - [, $fragment] = explode('#', $uri, 2); - $components = self::URI_COMPONENTS; - $components['fragment'] = $fragment; - - return $components; - } - - //The URI is made of the query and fragment - if ('?' === $first_char) { - [, $partial] = explode('?', $uri, 2); - [$query, $fragment] = explode('#', $partial, 2) + [1 => null]; - $components = self::URI_COMPONENTS; - $components['query'] = $query; - $components['fragment'] = $fragment; - - return $components; - } - - //use RFC3986 URI regexp to split the URI - preg_match(self::REGEXP_URI_PARTS, $uri, $parts); - $parts += ['query' => '', 'fragment' => '']; - - if (':' === $parts['scheme'] || 1 !== preg_match(self::REGEXP_URI_SCHEME, $parts['scontent'])) { - throw new SyntaxError(sprintf('The uri `%s` contains an invalid scheme', $uri)); - } - - if ('' === $parts['scheme'].$parts['authority'] && 1 === preg_match(self::REGEXP_INVALID_PATH, $parts['path'])) { - throw new SyntaxError(sprintf('The uri `%s` contains an invalid path.', $uri)); - } - - /** @var array{scheme:?string, user:?string, pass:?string, host:?string, port:?int, path:string, query:?string, fragment:?string} $components */ - $components = array_merge( - self::URI_COMPONENTS, - '' === $parts['authority'] ? [] : self::parseAuthority($parts['acontent']), - [ - 'path' => $parts['path'], - 'scheme' => '' === $parts['scheme'] ? null : $parts['scontent'], - 'query' => '' === $parts['query'] ? null : $parts['qcontent'], - 'fragment' => '' === $parts['fragment'] ? null : $parts['fcontent'], - ] - ); - - return $components; - } - - /** - * Parses the URI authority part. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2 - * - * @throws SyntaxError If the port component is invalid - * - * @return array{user:?string, pass:?string, host:?string, port:?int} - */ - private static function parseAuthority(string $authority): array - { - $components = ['user' => null, 'pass' => null, 'host' => '', 'port' => null]; - if ('' === $authority) { - return $components; - } - - $parts = explode('@', $authority, 2); - if (isset($parts[1])) { - [$components['user'], $components['pass']] = explode(':', $parts[0], 2) + [1 => null]; - } - - preg_match(self::REGEXP_HOST_PORT, $parts[1] ?? $parts[0], $matches); - $matches += ['port' => '']; - - $components['port'] = self::filterPort($matches['port']); - $components['host'] = self::filterHost($matches['host']); - - return $components; - } - - /** - * Filter and format the port component. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - * - * @throws SyntaxError if the registered name is invalid - */ - private static function filterPort(string $port): ?int - { - if ('' === $port) { - return null; - } - - if (1 === preg_match('/^\d*$/', $port)) { - return (int) $port; - } - - throw new SyntaxError(sprintf('The port `%s` is invalid', $port)); - } - - /** - * Returns whether a hostname is valid. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - * - * @throws SyntaxError if the registered name is invalid - */ - private static function filterHost(string $host): string - { - if ('' === $host) { - return $host; - } - - if ('[' !== $host[0] || ']' !== substr($host, -1)) { - return self::filterRegisteredName($host); - } - - if (!self::isIpHost(substr($host, 1, -1))) { - throw new SyntaxError(sprintf('Host `%s` is invalid : the IP host is malformed', $host)); - } - - return $host; - } - - /** - * Returns whether the host is an IPv4 or a registered named. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - * - * @throws SyntaxError if the registered name is invalid - * @throws IdnSupportMissing if IDN support or ICU requirement are not available or met. - */ - private static function filterRegisteredName(string $host): string - { - $formatted_host = rawurldecode($host); - if (1 === preg_match(self::REGEXP_REGISTERED_NAME, $formatted_host)) { - return $host; - } - - //to test IDN host non-ascii characters must be present in the host - if (1 !== preg_match(self::REGEXP_IDN_PATTERN, $formatted_host)) { - throw new SyntaxError(sprintf('Host `%s` is invalid : the host is not a valid registered name', $host)); - } - - $info = Idna::toAscii($host, Idna::IDNA2008_ASCII); - if (0 !== $info->errors()) { - throw IdnaConversionFailed::dueToIDNAError($host, $info); - } - - return $host; - } - - /** - * Validates a IPv6/IPvfuture host. - * - * @link https://tools.ietf.org/html/rfc3986#section-3.2.2 - * @link https://tools.ietf.org/html/rfc6874#section-2 - * @link https://tools.ietf.org/html/rfc6874#section-4 - */ - private static function isIpHost(string $ip_host): bool - { - if (false !== filter_var($ip_host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - return true; - } - - if (1 === preg_match(self::REGEXP_IP_FUTURE, $ip_host, $matches)) { - return !in_array($matches['version'], ['4', '6'], true); - } - - $pos = strpos($ip_host, '%'); - if (false === $pos || 1 === preg_match( - self::REGEXP_INVALID_HOST_CHARS, - rawurldecode(substr($ip_host, $pos)) - )) { - return false; - } - - $ip_host = substr($ip_host, 0, $pos); - - return false !== filter_var($ip_host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) - && 0 === strpos((string) inet_pton($ip_host), self::ZONE_ID_ADDRESS_BLOCK); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate.php deleted file mode 100644 index ba7a5a33..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri; - -use League\Uri\Contracts\UriException; -use League\Uri\Contracts\UriInterface; -use League\Uri\Exceptions\SyntaxError; -use League\Uri\Exceptions\TemplateCanNotBeExpanded; -use League\Uri\UriTemplate\Template; -use League\Uri\UriTemplate\VariableBag; -use TypeError; - -/** - * Defines the URI Template syntax and the process for expanding a URI Template into a URI reference. - * - * @link https://tools.ietf.org/html/rfc6570 - * @package League\Uri - * @author Ignace Nyamagana Butera - * @since 6.1.0 - * - * Based on GuzzleHttp\UriTemplate class in Guzzle v6.5. - * @link https://github.com/guzzle/guzzle/blob/6.5/src/UriTemplate.php - */ -final class UriTemplate -{ - private Template $template; - private VariableBag $defaultVariables; - - /** - * @param object|string $template a string or an object with the __toString method - * - * @throws TypeError if the template is not a string or an object with the __toString method - * @throws SyntaxError if the template syntax is invalid - * @throws TemplateCanNotBeExpanded if the template variables are invalid - */ - public function __construct($template, array $defaultVariables = []) - { - $this->template = Template::createFromString($template); - $this->defaultVariables = $this->filterVariables($defaultVariables); - } - - public static function __set_state(array $properties): self - { - return new self($properties['template']->toString(), $properties['defaultVariables']->all()); - } - - /** - * Filters out variables for the given template. - * - * @param array> $variables - */ - private function filterVariables(array $variables): VariableBag - { - $output = new VariableBag(); - foreach ($this->template->variableNames() as $name) { - if (isset($variables[$name])) { - $output->assign($name, $variables[$name]); - } - } - - return $output; - } - - /** - * The template string. - */ - public function getTemplate(): string - { - return $this->template->toString(); - } - - /** - * Returns the names of the variables in the template, in order. - * - * @return string[] - */ - public function getVariableNames(): array - { - return $this->template->variableNames(); - } - - /** - * Returns the default values used to expand the template. - * - * The returned list only contains variables whose name is part of the current template. - * - * @return array - */ - public function getDefaultVariables(): array - { - return $this->defaultVariables->all(); - } - - /** - * Returns a new instance with the updated default variables. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the modified default variables. - * - * If present, variables whose name is not part of the current template - * possible variable names are removed. - */ - public function withDefaultVariables(array $defaultDefaultVariables): self - { - return new self( - $this->template->toString(), - $this->filterVariables($defaultDefaultVariables)->all() - ); - } - - /** - * @throws TemplateCanNotBeExpanded if the variable contains nested array values - * @throws UriException if the resulting expansion can not be converted to a UriInterface instance - */ - public function expand(array $variables = []): UriInterface - { - return Uri::createFromString( - $this->template->expand( - $this->filterVariables($variables)->replace($this->defaultVariables) - ) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/Expression.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/Expression.php deleted file mode 100644 index 99ecac98..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/Expression.php +++ /dev/null @@ -1,329 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\UriTemplate; - -use League\Uri\Exceptions\SyntaxError; -use League\Uri\Exceptions\TemplateCanNotBeExpanded; -use function array_filter; -use function array_keys; -use function array_map; -use function array_unique; -use function explode; -use function implode; -use function preg_match; -use function rawurlencode; -use function str_replace; -use function strpos; -use function substr; - -final class Expression -{ - /** - * Expression regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc6570#section-2.2 - */ - private const REGEXP_EXPRESSION = '/^\{ - (?: - (?[\.\/;\?&\=,\!@\|\+#])? - (?[^\}]*) - ) - \}$/x'; - - /** - * Reserved Operator characters. - * - * @link https://tools.ietf.org/html/rfc6570#section-2.2 - */ - private const RESERVED_OPERATOR = '=,!@|'; - - /** - * Processing behavior according to the expression type operator. - * - * @link https://tools.ietf.org/html/rfc6570#appendix-A - */ - private const OPERATOR_HASH_LOOKUP = [ - '' => ['prefix' => '', 'joiner' => ',', 'query' => false], - '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], - '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], - '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], - '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], - ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], - '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], - '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true], - ]; - - private string $operator; - /** @var array */ - private array $varSpecifiers; - private string $joiner; - /** @var array */ - private array $variableNames; - private string $expressionString; - - private function __construct(string $operator, VarSpecifier ...$varSpecifiers) - { - $this->operator = $operator; - $this->varSpecifiers = $varSpecifiers; - $this->joiner = self::OPERATOR_HASH_LOOKUP[$operator]['joiner']; - $this->variableNames = $this->setVariableNames(); - $this->expressionString = $this->setExpressionString(); - } - - /** - * @return array - */ - private function setVariableNames(): array - { - return array_unique(array_map( - static fn (VarSpecifier $varSpecifier): string => $varSpecifier->name(), - $this->varSpecifiers - )); - } - - private function setExpressionString(): string - { - $varSpecifierString = implode(',', array_map( - static fn (VarSpecifier $variable): string => $variable->toString(), - $this->varSpecifiers - )); - - return '{'.$this->operator.$varSpecifierString.'}'; - } - - /** - * {@inheritDoc} - */ - public static function __set_state(array $properties): self - { - return new self($properties['operator'], ...$properties['varSpecifiers']); - } - - /** - * @throws SyntaxError if the expression is invalid - * @throws SyntaxError if the operator used in the expression is invalid - * @throws SyntaxError if the variable specifiers is invalid - */ - public static function createFromString(string $expression): self - { - if (1 !== preg_match(self::REGEXP_EXPRESSION, $expression, $parts)) { - throw new SyntaxError('The expression "'.$expression.'" is invalid.'); - } - - /** @var array{operator:string, variables:string} $parts */ - $parts = $parts + ['operator' => '']; - if ('' !== $parts['operator'] && false !== strpos(self::RESERVED_OPERATOR, $parts['operator'])) { - throw new SyntaxError('The operator used in the expression "'.$expression.'" is reserved.'); - } - - return new Expression($parts['operator'], ...array_map( - static fn (string $varSpec): VarSpecifier => VarSpecifier::createFromString($varSpec), - explode(',', $parts['variables']) - )); - } - - /** - * Returns the expression string representation. - * - */ - public function toString(): string - { - return $this->expressionString; - } - - /** - * @return array - */ - public function variableNames(): array - { - return $this->variableNames; - } - - public function expand(VariableBag $variables): string - { - $parts = []; - foreach ($this->varSpecifiers as $varSpecifier) { - $parts[] = $this->replace($varSpecifier, $variables); - } - - $expanded = implode($this->joiner, array_filter($parts, static fn ($value): bool => '' !== $value)); - if ('' === $expanded) { - return $expanded; - } - - $prefix = self::OPERATOR_HASH_LOOKUP[$this->operator]['prefix']; - if ('' === $prefix) { - return $expanded; - } - - return $prefix.$expanded; - } - - /** - * Replaces an expression with the given variables. - * - * @throws TemplateCanNotBeExpanded if the variables is an array and a ":" modifier needs to be applied - * @throws TemplateCanNotBeExpanded if the variables contains nested array values - */ - private function replace(VarSpecifier $varSpec, VariableBag $variables): string - { - $value = $variables->fetch($varSpec->name()); - if (null === $value) { - return ''; - } - - $useQuery = self::OPERATOR_HASH_LOOKUP[$this->operator]['query']; - [$expanded, $actualQuery] = $this->inject($value, $varSpec, $useQuery); - if (!$actualQuery) { - return $expanded; - } - - if ('&' !== $this->joiner && '' === $expanded) { - return $varSpec->name(); - } - - return $varSpec->name().'='.$expanded; - } - - /** - * @param string|array $value - * - * @return array{0:string, 1:bool} - */ - private function inject($value, VarSpecifier $varSpec, bool $useQuery): array - { - if (is_string($value)) { - return $this->replaceString($value, $varSpec, $useQuery); - } - - return $this->replaceList($value, $varSpec, $useQuery); - } - - /** - * Expands an expression using a string value. - * - * @return array{0:string, 1:bool} - */ - private function replaceString(string $value, VarSpecifier $varSpec, bool $useQuery): array - { - if (':' === $varSpec->modifier()) { - $value = substr($value, 0, $varSpec->position()); - } - - $expanded = rawurlencode($value); - if ('+' === $this->operator || '#' === $this->operator) { - return [$this->decodeReserved($expanded), $useQuery]; - } - - return [$expanded, $useQuery]; - } - - /** - * Expands an expression using a list of values. - * - * @param array $value - * - * @throws TemplateCanNotBeExpanded if the variables is an array and a ":" modifier needs to be applied - * - * @return array{0:string, 1:bool} - */ - private function replaceList(array $value, VarSpecifier $varSpec, bool $useQuery): array - { - if ([] === $value) { - return ['', false]; - } - - if (':' === $varSpec->modifier()) { - throw TemplateCanNotBeExpanded::dueToUnableToProcessValueListWithPrefix($varSpec->name()); - } - - $pairs = []; - $isAssoc = $this->isAssoc($value); - foreach ($value as $key => $var) { - if ($isAssoc) { - $key = rawurlencode((string) $key); - } - - $var = rawurlencode($var); - if ('+' === $this->operator || '#' === $this->operator) { - $var = $this->decodeReserved($var); - } - - if ('*' === $varSpec->modifier()) { - if ($isAssoc) { - $var = $key.'='.$var; - } elseif ($key > 0 && $useQuery) { - $var = $varSpec->name().'='.$var; - } - } - - $pairs[$key] = $var; - } - - if ('*' === $varSpec->modifier()) { - if ($isAssoc) { - // Don't prepend the value name when using the explode - // modifier with an associative array. - $useQuery = false; - } - - return [implode($this->joiner, $pairs), $useQuery]; - } - - if ($isAssoc) { - // When an associative array is encountered and the - // explode modifier is not set, then the result must be - // a comma separated list of keys followed by their - // respective values. - foreach ($pairs as $offset => &$data) { - $data = $offset.','.$data; - } - - unset($data); - } - - return [implode(',', $pairs), $useQuery]; - } - - /** - * Determines if an array is associative. - * - * This makes the assumption that input arrays are sequences or hashes. - * This assumption is a trade-off for accuracy in favor of speed, but it - * should work in almost every case where input is supplied for a URI - * template. - */ - private function isAssoc(array $array): bool - { - return [] !== $array && 0 !== array_keys($array)[0]; - } - - /** - * Removes percent encoding on reserved characters (used with + and # modifiers). - */ - private function decodeReserved(string $str): string - { - static $delimiters = [ - ':', '/', '?', '#', '[', ']', '@', '!', '$', - '&', '\'', '(', ')', '*', '+', ',', ';', '=', - ]; - - static $delimitersEncoded = [ - '%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40', '%21', '%24', - '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', '%3B', '%3D', - ]; - - return str_replace($delimitersEncoded, $delimiters, $str); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/Template.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/Template.php deleted file mode 100644 index ecd130fe..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/Template.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\UriTemplate; - -use League\Uri\Exceptions\SyntaxError; -use League\Uri\Exceptions\TemplateCanNotBeExpanded; -use TypeError; -use function array_merge; -use function array_unique; -use function gettype; -use function is_object; -use function is_string; -use function method_exists; -use function preg_match_all; -use function preg_replace; -use function sprintf; -use function strpos; -use const PREG_SET_ORDER; - -final class Template -{ - /** - * Expression regular expression pattern. - */ - private const REGEXP_EXPRESSION_DETECTOR = '/\{[^\}]*\}/x'; - - private string $template; - /** @var array */ - private array $expressions = []; - /** @var array */ - private array $variableNames; - - private function __construct(string $template, Expression ...$expressions) - { - $this->template = $template; - $variableNames = []; - foreach ($expressions as $expression) { - $this->expressions[$expression->toString()] = $expression; - $variableNames[] = $expression->variableNames(); - } - $this->variableNames = array_unique(array_merge([], ...$variableNames)); - } - - /** - * {@inheritDoc} - */ - public static function __set_state(array $properties): self - { - return new self($properties['template'], ...array_values($properties['expressions'])); - } - - /** - * @param object|string $template a string or an object with the __toString method - * - * @throws TypeError if the template is not a string or an object with the __toString method - * @throws SyntaxError if the template contains invalid expressions - * @throws SyntaxError if the template contains invalid variable specification - */ - public static function createFromString($template): self - { - if (is_object($template) && method_exists($template, '__toString')) { - $template = (string) $template; - } - - if (!is_string($template)) { - throw new TypeError(sprintf('The template must be a string or a stringable object %s given.', gettype($template))); - } - - /** @var string $remainder */ - $remainder = preg_replace(self::REGEXP_EXPRESSION_DETECTOR, '', $template); - if (false !== strpos($remainder, '{') || false !== strpos($remainder, '}')) { - throw new SyntaxError('The template "'.$template.'" contains invalid expressions.'); - } - - $names = []; - preg_match_all(self::REGEXP_EXPRESSION_DETECTOR, $template, $findings, PREG_SET_ORDER); - $arguments = []; - foreach ($findings as $finding) { - if (!isset($names[$finding[0]])) { - $arguments[] = Expression::createFromString($finding[0]); - $names[$finding[0]] = 1; - } - } - - return new self($template, ...$arguments); - } - - public function toString(): string - { - return $this->template; - } - - /** - * @return array - */ - public function variableNames(): array - { - return $this->variableNames; - } - - /** - * @throws TemplateCanNotBeExpanded if the variables is an array and a ":" modifier needs to be applied - * @throws TemplateCanNotBeExpanded if the variables contains nested array values - */ - public function expand(VariableBag $variables): string - { - $uriString = $this->template; - /** @var Expression $expression */ - foreach ($this->expressions as $pattern => $expression) { - $uriString = str_replace($pattern, $expression->expand($variables), $uriString); - } - - return $uriString; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/VarSpecifier.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/VarSpecifier.php deleted file mode 100644 index ac49efb5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/VarSpecifier.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\UriTemplate; - -use League\Uri\Exceptions\SyntaxError; -use function preg_match; - -final class VarSpecifier -{ - /** - * Variables specification regular expression pattern. - * - * @link https://tools.ietf.org/html/rfc6570#section-2.3 - */ - private const REGEXP_VARSPEC = '/^ - (?(?:[A-z0-9_\.]|%[0-9a-fA-F]{2})+) - (?\:(?\d+)|\*)? - $/x'; - - private string $name; - private string $modifier; - private int $position; - - private function __construct(string $name, string $modifier, int $position) - { - $this->name = $name; - $this->modifier = $modifier; - $this->position = $position; - } - - /** - * {@inheritDoc} - */ - public static function __set_state(array $properties): self - { - return new self($properties['name'], $properties['modifier'], $properties['position']); - } - - public static function createFromString(string $specification): self - { - if (1 !== preg_match(self::REGEXP_VARSPEC, $specification, $parsed)) { - throw new SyntaxError('The variable specification "'.$specification.'" is invalid.'); - } - - $parsed += ['modifier' => '', 'position' => '']; - if ('' !== $parsed['position']) { - $parsed['position'] = (int) $parsed['position']; - $parsed['modifier'] = ':'; - } - - if ('' === $parsed['position']) { - $parsed['position'] = 0; - } - - if (10000 <= $parsed['position']) { - throw new SyntaxError('The variable specification "'.$specification.'" is invalid the position modifier must be lower than 10000.'); - } - - return new self($parsed['name'], $parsed['modifier'], $parsed['position']); - } - - public function toString(): string - { - if (0 < $this->position) { - return $this->name.$this->modifier.$this->position; - } - - return $this->name.$this->modifier; - } - - public function name(): string - { - return $this->name; - } - - public function modifier(): string - { - return $this->modifier; - } - - public function position(): int - { - return $this->position; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/VariableBag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/VariableBag.php deleted file mode 100644 index cf60de91..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/league/uri/src/UriTemplate/VariableBag.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace League\Uri\UriTemplate; - -use League\Uri\Exceptions\TemplateCanNotBeExpanded; -use TypeError; -use function gettype; -use function is_array; -use function is_bool; -use function is_object; -use function is_scalar; -use function method_exists; -use function sprintf; - -final class VariableBag -{ - /** - * @var array> - */ - private array $variables = []; - - /** - * @param iterable> $variables - */ - public function __construct(iterable $variables = []) - { - foreach ($variables as $name => $value) { - $this->assign($name, $value); - } - } - - public static function __set_state(array $properties): self - { - return new self($properties['variables']); - } - - /** - * @return array> - */ - public function all(): array - { - return $this->variables; - } - - /** - * Fetches the variable value if none found returns null. - * - * @return null|string|array - */ - public function fetch(string $name) - { - return $this->variables[$name] ?? null; - } - - /** - * @param string|bool|int|float|array $value - */ - public function assign(string $name, $value): void - { - $this->variables[$name] = $this->normalizeValue($value, $name, true); - } - - /** - * @param mixed $value the value to be expanded - * - * @throws TemplateCanNotBeExpanded if the value contains nested list - * - * @return string|array - */ - private function normalizeValue($value, string $name, bool $isNestedListAllowed) - { - if (is_bool($value)) { - return true === $value ? '1' : '0'; - } - - if (null === $value || is_scalar($value) || (is_object($value) && method_exists($value, '__toString'))) { - return (string) $value; - } - - if (!is_array($value)) { - throw new TypeError(sprintf('The variable '.$name.' must be NULL, a scalar or a stringable object `%s` given', gettype($value))); - } - - if (!$isNestedListAllowed) { - throw TemplateCanNotBeExpanded::dueToNestedListOfValue($name); - } - - foreach ($value as &$var) { - $var = self::normalizeValue($var, $name, false); - } - unset($var); - - return $value; - } - - /** - * Replaces elements from passed variables into the current instance. - */ - public function replace(VariableBag $variables): self - { - return new self($this->variables + $variables->variables); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/.github/FUNDING.yml b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/.github/FUNDING.yml deleted file mode 100644 index 11255a01..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -github: [nyholm, Zegnat] diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/CHANGELOG.md deleted file mode 100644 index 2e98d6ff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/CHANGELOG.md +++ /dev/null @@ -1,54 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 0.4.2 - -### Fixed - -- Support for numerical headers - -## 0.4.1 - -### Fixed - -- Support for ´HTTP_X_FORWARDED_PROTO´ - -## 0.4.0 - -### Fixed - -- Support for Host-header with port-number - -## 0.3.0 - -### Added - -- `ServerRequestCreator` is final - -### Fixed - -- Fallback to an empty Stream if UploadedFileFactory fails. - -## 0.2.0 - -### Changed - -- Make sure we use psr/http-factory - -## 0.1.2 - -### Added - -- `ServerRequestCreatorInterface` -- `ServerRequestCreator::getHeadersFromServer` - -## 0.1.1 - -### Added - -Better testing - -## 0.1.0 - -First release diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/LICENSE deleted file mode 100644 index d91e7536..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Tobias Nyholm - -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/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/README.md deleted file mode 100644 index b3f5cb3a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Helper class to create PSR-7 server request - -[![Latest Version](https://img.shields.io/github/release/Nyholm/psr7-server.svg?style=flat-square)](https://github.com/Nyholm/psr7-server/releases) -[![Build Status](https://img.shields.io/travis/Nyholm/psr7-server/master.svg?style=flat-square)](https://travis-ci.org/Nyholm/psr7-server) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Nyholm/psr7-server.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7-server) -[![Quality Score](https://img.shields.io/scrutinizer/g/Nyholm/psr7-server.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7-server) -[![Total Downloads](https://poser.pugx.org/nyholm/psr7-server/downloads)](https://packagist.org/packages/nyholm/psr7-server) -[![Monthly Downloads](https://poser.pugx.org/nyholm/psr7-server/d/monthly.png)](https://packagist.org/packages/nyholm/psr7-server) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) - -A helper class that can create ANY PSR-7 server request. - -## Installation - -```bash -composer require nyholm/psr7-server -``` - -## Usage - -```php -// Instanciate ANY PSR-17 factory implementations. Here is nyholm/psr7 as an example -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); - -$creator = new \Nyholm\Psr7Server\ServerRequestCreator( - $psr17Factory, // ServerRequestFactory - $psr17Factory, // UriFactory - $psr17Factory, // UploadedFileFactory - $psr17Factory // StreamFactory -); - -$serverRequest = $creator->fromGlobals(); -``` - -## Other packages - -* [nyholm/psr7](https://github.com/Nyholm/psr7) - A super fast PSR-7 implementation. -* [zendframework/zend-httphandlerrunner](https://github.com/zendframework/zend-httphandlerrunner) - To send/emit PSR-7 responses diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/composer.json deleted file mode 100644 index 732406da..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "nyholm/psr7-server", - "description": "Helper classes to handle PSR-7 server requests", - "license": "MIT", - "keywords": ["psr-7", "psr-17"], - "homepage": "http://tnyholm.se", - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - }, - { - "name": "Martijn van der Ven", - "email": "martijn@vanderven.se" - } - ], - "require": { - "php": "^7.1", - "psr/http-message": "^1.0", - "psr/http-factory": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0", - "nyholm/psr7": "^1.3", - "nyholm/nsa": "^1.1" - }, - "autoload": { - "psr-4": { - "Nyholm\\Psr7Server\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\Nyholm\\Psr7Server\\": "tests/" - } - }, - "scripts": { - "test": "vendor/bin/phpunit", - "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/src/ServerRequestCreator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/src/ServerRequestCreator.php deleted file mode 100644 index efecc689..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/src/ServerRequestCreator.php +++ /dev/null @@ -1,282 +0,0 @@ - - * @author Martijn van der Ven - */ -final class ServerRequestCreator implements ServerRequestCreatorInterface -{ - private $serverRequestFactory; - - private $uriFactory; - - private $uploadedFileFactory; - - private $streamFactory; - - public function __construct( - ServerRequestFactoryInterface $serverRequestFactory, - UriFactoryInterface $uriFactory, - UploadedFileFactoryInterface $uploadedFileFactory, - StreamFactoryInterface $streamFactory - ) { - $this->serverRequestFactory = $serverRequestFactory; - $this->uriFactory = $uriFactory; - $this->uploadedFileFactory = $uploadedFileFactory; - $this->streamFactory = $streamFactory; - } - - /** - * {@inheritdoc} - */ - public function fromGlobals(): ServerRequestInterface - { - $server = $_SERVER; - if (false === isset($server['REQUEST_METHOD'])) { - $server['REQUEST_METHOD'] = 'GET'; - } - - $headers = \function_exists('getallheaders') ? getallheaders() : static::getHeadersFromServer($_SERVER); - - return $this->fromArrays($server, $headers, $_COOKIE, $_GET, $_POST, $_FILES, \fopen('php://input', 'r') ?: null); - } - - /** - * {@inheritdoc} - */ - public function fromArrays(array $server, array $headers = [], array $cookie = [], array $get = [], array $post = [], array $files = [], $body = null): ServerRequestInterface - { - $method = $this->getMethodFromEnv($server); - $uri = $this->getUriFromEnvWithHTTP($server); - $protocol = isset($server['SERVER_PROTOCOL']) ? \str_replace('HTTP/', '', $server['SERVER_PROTOCOL']) : '1.1'; - - $serverRequest = $this->serverRequestFactory->createServerRequest($method, $uri, $server); - foreach ($headers as $name => $value) { - // Because PHP automatically casts array keys set with numeric strings to integers, we have to make sure - // that numeric headers will not be sent along as integers, as withAddedHeader can only accept strings. - if (\is_int($name)) { - $name = (string) $name; - } - $serverRequest = $serverRequest->withAddedHeader($name, $value); - } - - $serverRequest = $serverRequest - ->withProtocolVersion($protocol) - ->withCookieParams($cookie) - ->withQueryParams($get) - ->withParsedBody($post) - ->withUploadedFiles($this->normalizeFiles($files)); - - if (null === $body) { - return $serverRequest; - } - - if (\is_resource($body)) { - $body = $this->streamFactory->createStreamFromResource($body); - } elseif (\is_string($body)) { - $body = $this->streamFactory->createStream($body); - } elseif (!$body instanceof StreamInterface) { - throw new \InvalidArgumentException('The $body parameter to ServerRequestCreator::fromArrays must be string, resource or StreamInterface'); - } - - return $serverRequest->withBody($body); - } - - /** - * Implementation from Zend\Diactoros\marshalHeadersFromSapi(). - */ - public static function getHeadersFromServer(array $server): array - { - $headers = []; - foreach ($server as $key => $value) { - // Apache prefixes environment variables with REDIRECT_ - // if they are added by rewrite rules - if (0 === \strpos($key, 'REDIRECT_')) { - $key = \substr($key, 9); - - // We will not overwrite existing variables with the - // prefixed versions, though - if (\array_key_exists($key, $server)) { - continue; - } - } - - if ($value && 0 === \strpos($key, 'HTTP_')) { - $name = \strtr(\strtolower(\substr($key, 5)), '_', '-'); - $headers[$name] = $value; - - continue; - } - - if ($value && 0 === \strpos($key, 'CONTENT_')) { - $name = 'content-'.\strtolower(\substr($key, 8)); - $headers[$name] = $value; - - continue; - } - } - - return $headers; - } - - private function getMethodFromEnv(array $environment): string - { - if (false === isset($environment['REQUEST_METHOD'])) { - throw new \InvalidArgumentException('Cannot determine HTTP method'); - } - - return $environment['REQUEST_METHOD']; - } - - private function getUriFromEnvWithHTTP(array $environment): UriInterface - { - $uri = $this->createUriFromArray($environment); - if (empty($uri->getScheme())) { - $uri = $uri->withScheme('http'); - } - - return $uri; - } - - /** - * Return an UploadedFile instance array. - * - * @param array $files A array which respect $_FILES structure - * - * @return UploadedFileInterface[] - * - * @throws \InvalidArgumentException for unrecognized values - */ - private function normalizeFiles(array $files): array - { - $normalized = []; - - foreach ($files as $key => $value) { - if ($value instanceof UploadedFileInterface) { - $normalized[$key] = $value; - } elseif (\is_array($value) && isset($value['tmp_name'])) { - $normalized[$key] = $this->createUploadedFileFromSpec($value); - } elseif (\is_array($value)) { - $normalized[$key] = $this->normalizeFiles($value); - } else { - throw new \InvalidArgumentException('Invalid value in files specification'); - } - } - - return $normalized; - } - - /** - * Create and return an UploadedFile instance from a $_FILES specification. - * - * If the specification represents an array of values, this method will - * delegate to normalizeNestedFileSpec() and return that return value. - * - * @param array $value $_FILES struct - * - * @return array|UploadedFileInterface - */ - private function createUploadedFileFromSpec(array $value) - { - if (\is_array($value['tmp_name'])) { - return $this->normalizeNestedFileSpec($value); - } - - try { - $stream = $this->streamFactory->createStreamFromFile($value['tmp_name']); - } catch (\RuntimeException $e) { - $stream = $this->streamFactory->createStream(); - } - - return $this->uploadedFileFactory->createUploadedFile( - $stream, - (int) $value['size'], - (int) $value['error'], - $value['name'], - $value['type'] - ); - } - - /** - * Normalize an array of file specifications. - * - * Loops through all nested files and returns a normalized array of - * UploadedFileInterface instances. - * - * @return UploadedFileInterface[] - */ - private function normalizeNestedFileSpec(array $files = []): array - { - $normalizedFiles = []; - - foreach (\array_keys($files['tmp_name']) as $key) { - $spec = [ - 'tmp_name' => $files['tmp_name'][$key], - 'size' => $files['size'][$key], - 'error' => $files['error'][$key], - 'name' => $files['name'][$key], - 'type' => $files['type'][$key], - ]; - $normalizedFiles[$key] = $this->createUploadedFileFromSpec($spec); - } - - return $normalizedFiles; - } - - /** - * Create a new uri from server variable. - * - * @param array $server typically $_SERVER or similar structure - */ - private function createUriFromArray(array $server): UriInterface - { - $uri = $this->uriFactory->createUri(''); - - if (isset($server['HTTP_X_FORWARDED_PROTO'])) { - $uri = $uri->withScheme($server['HTTP_X_FORWARDED_PROTO']); - } else { - if (isset($server['REQUEST_SCHEME'])) { - $uri = $uri->withScheme($server['REQUEST_SCHEME']); - } elseif (isset($server['HTTPS'])) { - $uri = $uri->withScheme('on' === $server['HTTPS'] ? 'https' : 'http'); - } - - if (isset($server['SERVER_PORT'])) { - $uri = $uri->withPort($server['SERVER_PORT']); - } - } - - if (isset($server['HTTP_HOST'])) { - if (1 === \preg_match('/^(.+)\:(\d+)$/', $server['HTTP_HOST'], $matches)) { - $uri = $uri->withHost($matches[1])->withPort($matches[2]); - } else { - $uri = $uri->withHost($server['HTTP_HOST']); - } - } elseif (isset($server['SERVER_NAME'])) { - $uri = $uri->withHost($server['SERVER_NAME']); - } - - if (isset($server['REQUEST_URI'])) { - $uri = $uri->withPath(\current(\explode('?', $server['REQUEST_URI']))); - } - - if (isset($server['QUERY_STRING'])) { - $uri = $uri->withQuery($server['QUERY_STRING']); - } - - return $uri; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php deleted file mode 100644 index a5ab6889..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @author Martijn van der Ven - */ -interface ServerRequestCreatorInterface -{ - /** - * Create a new server request from the current environment variables. - * Defaults to a GET request to minimise the risk of an \InvalidArgumentException. - * Includes the current request headers as supplied by the server through `getallheaders()`. - * If `getallheaders()` is unavailable on the current server it will fallback to its own `getHeadersFromServer()` method. - * Defaults to php://input for the request body. - * - * @throws \InvalidArgumentException if no valid method or URI can be determined - */ - public function fromGlobals(): ServerRequestInterface; - - /** - * Create a new server request from a set of arrays. - * - * @param array $server typically $_SERVER or similar structure - * @param array $headers typically the output of getallheaders() or similar structure - * @param array $cookie typically $_COOKIE or similar structure - * @param array $get typically $_GET or similar structure - * @param array $post typically $_POST or similar structure - * @param array $files typically $_FILES or similar structure - * @param StreamInterface|resource|string|null $body Typically stdIn - * - * @throws \InvalidArgumentException if no valid method or URI can be determined - */ - public function fromArrays( - array $server, - array $headers = [], - array $cookie = [], - array $get = [], - array $post = [], - array $files = [], - $body = null - ): ServerRequestInterface; - - /** - * Get parsed headers from ($_SERVER) array. - * - * @param array $server typically $_SERVER or similar structure - */ - public static function getHeadersFromServer(array $server): array; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/.php-cs-fixer.dist.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/.php-cs-fixer.dist.php deleted file mode 100644 index 04765dec..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/.php-cs-fixer.dist.php +++ /dev/null @@ -1,25 +0,0 @@ -in(__DIR__.'/src') - ->in(__DIR__.'/tests'); - -$config = new PhpCsFixer\Config(); - -return $config->setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, - 'native_function_invocation' => ['include'=> ['@all']], - 'native_constant_invocation' => true, - 'ordered_imports' => true, - 'declare_strict_types' => false, - 'linebreak_after_opening_tag' => false, - 'single_import_per_statement' => false, - 'blank_line_after_opening_tag' => false, - 'concat_space' => ['spacing'=>'one'], - 'phpdoc_align' => ['align'=>'left'], -]) - ->setRiskyAllowed(true) - ->setFinder($finder); diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/CHANGELOG.md deleted file mode 100644 index cddd3633..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/CHANGELOG.md +++ /dev/null @@ -1,164 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.8.0 - -- Deprecate HttplugFactory, use Psr17Factory instead -- Make depencendy on php-http/message-factory optional - -## 1.7.0 - -- Bump to PHP 7.2 minimum -- Allow psr/http-message v2 -- Use copy-on-write for streams created from strings - -## 1.6.1 - -- Security fix: CVE-2023-29197 - -## 1.6.0 - -### Changed - -- Seek to the begining of the string when using Stream::create() -- Populate ServerRequest::getQueryParams() on instantiation -- Encode [reserved characters](https://www.rfc-editor.org/rfc/rfc3986#appendix-A) in userinfo in Uri -- Normalize leading slashes for Uri::getPath() -- Make Stream's constructor public -- Add some missing type checks on arguments - -## 1.5.1 - -### Fixed - -- Fixed deprecations on PHP 8.1 - -## 1.5.0 - -### Added - -- Add explicit `@return mixed` -- Add explicit return types to HttplugFactory - -### Fixed - -- Improve error handling with streams - -## 1.4.1 - -### Fixed - -- `Psr17Factory::createStreamFromFile`, `UploadedFile::moveTo`, and - `UploadedFile::getStream` no longer throw `ValueError` in PHP 8. - -## 1.4.0 - -### Removed - -The `final` keyword was replaced by `@final` annotation. - -## 1.3.2 - -### Fixed - -- `Stream::read()` must not return boolean. -- Improved exception message when using wrong HTTP status code. - -## 1.3.1 - -### Fixed - -- Allow installation on PHP8 - -## 1.3.0 - -### Added - -- Make Stream::__toString() compatible with throwing exceptions on PHP 7.4. - -### Fixed - -- Support for UTF-8 hostnames -- Support for numeric header names - -## 1.2.1 - -### Changed - -- Added `.github` and `phpstan.neon.dist` to `.gitattributes`. - -## 1.2.0 - -### Changed - -- Change minimal port number to 0 (unix socket) -- Updated `Psr17Factory::createResponse` to respect the specification. If second - argument is not used, a standard reason phrase. If an empty string is passed, - then the reason phrase will be empty. - -### Fixed - -- Check for seekable on the stream resource. -- Fixed the `Response::$reason` should never be null. - -## 1.1.0 - -### Added - -- Improved performance -- More tests for `UploadedFile` and `HttplugFactory` - -### Removed - -- Dead code - -## 1.0.1 - -### Fixed - -- Handle `fopen` failing in createStreamFromFile according to PSR-7. -- Reduce execution path to speed up performance. -- Fixed typos. -- Code style. - -## 1.0.0 - -### Added - -- Support for final PSR-17 (HTTP factories). (`Psr17Factory`) -- Support for numeric header values. -- Support for empty header values. -- All classes are final -- `HttplugFactory` that implements factory interfaces from HTTPlug. - -### Changed - -- `ServerRequest` does not extend `Request`. - -### Removed - -- The HTTPlug discovery strategy was removed since it is included in php-http/discovery 1.4. -- `UploadedFileFactory()` was removed in favor for `Psr17Factory`. -- `ServerRequestFactory()` was removed in favor for `Psr17Factory`. -- `StreamFactory`, `UriFactory`, abd `MessageFactory`. Use `HttplugFactory` instead. -- `ServerRequestFactory::createServerRequestFromArray`, `ServerRequestFactory::createServerRequestFromArrays` and - `ServerRequestFactory::createServerRequestFromGlobals`. Please use the new `nyholm/psr7-server` instead. - -## 0.3.0 - -### Added - -- Return types. -- Many `InvalidArgumentException`s are thrown when you use invalid arguments. -- Integration tests for `UploadedFile` and `ServerRequest`. - -### Changed - -- We dropped PHP7.0 support. -- PSR-17 factories have been marked as internal. They do not fall under our BC promise until PSR-17 is accepted. -- `UploadedFileFactory::createUploadedFile` does not accept a string file path. - -## 0.2.3 - -No changelog before this release diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/LICENSE deleted file mode 100644 index d6c52312..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Tobias Nyholm - -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/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/README.md deleted file mode 100644 index 7fc30bc1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# PSR-7 implementation - -[![Latest Version](https://img.shields.io/github/release/Nyholm/psr7.svg?style=flat-square)](https://github.com/Nyholm/psr7/releases) -[![Total Downloads](https://poser.pugx.org/nyholm/psr7/downloads)](https://packagist.org/packages/nyholm/psr7) -[![Monthly Downloads](https://poser.pugx.org/nyholm/psr7/d/monthly.png)](https://packagist.org/packages/nyholm/psr7) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Static analysis](https://github.com/Nyholm/psr7/actions/workflows/static.yml/badge.svg?branch=master)](https://github.com/Nyholm/psr7/actions/workflows/static.yml?query=branch%3Amaster) -[![Tests](https://github.com/Nyholm/psr7/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/Nyholm/psr7/actions/workflows/tests.yml?query=branch%3Amaster) - -A super lightweight PSR-7 implementation. Very strict and very fast. - -| Description | Guzzle | Laminas | Slim | Nyholm | -| ---- | ------ | ---- | ---- | ------ | -| Lines of code | 3.300 | 3.100 | 1.900 | 1.000 | -| PSR-7* | 66% | 100% | 75% | 100% | -| PSR-17 | No | Yes | Yes | Yes | -| HTTPlug | No | No | No | Yes | -| Performance (runs per second)** | 14.553 | 14.703 | 13.416 | 17.734 | - -\* Percent of completed tests in https://github.com/php-http/psr7-integration-tests - -\** Benchmark with 50.000 runs. See https://github.com/devanych/psr-http-benchmark (higher is better) - -## Installation - -```bash -composer require nyholm/psr7 -``` - -If you are using Symfony Flex then you get all message factories registered as services. - -## Usage - -The PSR-7 objects do not contain any other public methods than those defined in -the [PSR-7 specification](https://www.php-fig.org/psr/psr-7/). - -### Create objects - -Use the PSR-17 factory to create requests, streams, URIs etc. - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); -$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); -$stream = $psr17Factory->createStream('foobar'); -``` - -### Sending a request - -With [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send -requests like: - -```bash -composer require kriswallsmith/buzz -``` - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); -$psr18Client = new \Buzz\Client\Curl($psr17Factory); - -$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); -$response = $psr18Client->sendRequest($request); -``` - -### Create server requests - -The [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used -to create server requests from PHP superglobals. - -```bash -composer require nyholm/psr7-server -``` - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); - -$creator = new \Nyholm\Psr7Server\ServerRequestCreator( - $psr17Factory, // ServerRequestFactory - $psr17Factory, // UriFactory - $psr17Factory, // UploadedFileFactory - $psr17Factory // StreamFactory -); - -$serverRequest = $creator->fromGlobals(); -``` - -### Emitting a response - -```bash -composer require laminas/laminas-httphandlerrunner -``` - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); - -$responseBody = $psr17Factory->createStream('Hello world'); -$response = $psr17Factory->createResponse(200)->withBody($responseBody); -(new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response); -``` - -## Our goal - -This package is currently maintained by [Tobias Nyholm](http://nyholm.se) and -[Martijn van der Ven](https://vanderven.se/martijn/). They have decided that the -goal of this library should be to provide a super strict implementation of -[PSR-7](https://www.php-fig.org/psr/psr-7/) that is blazing fast. - -The package will never include any extra features nor helper methods. All our classes -and functions exist because they are required to fulfill the PSR-7 specification. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/composer.json deleted file mode 100644 index c6076159..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "nyholm/psr7", - "description": "A fast PHP7 implementation of PSR-7", - "license": "MIT", - "keywords": ["psr-7", "psr-17"], - "homepage": "https://tnyholm.se", - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - }, - { - "name": "Martijn van der Ven", - "email": "martijn@vanderven.se" - } - ], - "require": { - "php": ">=7.2", - "psr/http-message": "^1.1 || ^2.0", - "psr/http-factory": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", - "php-http/message-factory": "^1.0", - "php-http/psr7-integration-tests": "^1.0", - "http-interop/http-factory-tests": "^0.9", - "symfony/error-handler": "^4.4" - }, - "provide": { - "php-http/message-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0", - "psr/http-factory-implementation": "1.0" - }, - "autoload": { - "psr-4": { - "Nyholm\\Psr7\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\Nyholm\\Psr7\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/phpstan-baseline.neon b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/phpstan-baseline.neon deleted file mode 100644 index 9a0cf115..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/phpstan-baseline.neon +++ /dev/null @@ -1,36 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Result of && is always false\\.$#" - count: 1 - path: src/Response.php - - - - message: "#^Strict comparison using \\=\\=\\= between null and string will always evaluate to false\\.$#" - count: 1 - path: src/Response.php - - - - message: "#^Result of && is always false\\.$#" - count: 1 - path: src/ServerRequest.php - - - - message: "#^Strict comparison using \\!\\=\\= between null and null will always evaluate to false\\.$#" - count: 1 - path: src/ServerRequest.php - - - - message: "#^Result of && is always false\\.$#" - count: 1 - path: src/Stream.php - - - - message: "#^Result of && is always false\\.$#" - count: 2 - path: src/UploadedFile.php - - - - message: "#^Strict comparison using \\=\\=\\= between false and true will always evaluate to false\\.$#" - count: 2 - path: src/UploadedFile.php diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/psalm.baseline.xml b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/psalm.baseline.xml deleted file mode 100644 index fe5b92e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/psalm.baseline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - return \trigger_error((string) $e, \E_USER_ERROR); - - - diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Factory/HttplugFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Factory/HttplugFactory.php deleted file mode 100644 index cc9285dd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Factory/HttplugFactory.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - * - * @deprecated since version 1.8, use Psr17Factory instead - */ -class HttplugFactory implements MessageFactory, StreamFactory, UriFactory -{ - public function createRequest($method, $uri, array $headers = [], $body = null, $protocolVersion = '1.1'): RequestInterface - { - return new Request($method, $uri, $headers, $body, $protocolVersion); - } - - public function createResponse($statusCode = 200, $reasonPhrase = null, array $headers = [], $body = null, $version = '1.1'): ResponseInterface - { - return new Response((int) $statusCode, $headers, $body, $version, $reasonPhrase); - } - - public function createStream($body = null): StreamInterface - { - return Stream::create($body ?? ''); - } - - public function createUri($uri = ''): UriInterface - { - if ($uri instanceof UriInterface) { - return $uri; - } - - return new Uri($uri); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Factory/Psr17Factory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Factory/Psr17Factory.php deleted file mode 100644 index 440bec34..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Factory/Psr17Factory.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface -{ - public function createRequest(string $method, $uri): RequestInterface - { - return new Request($method, $uri); - } - - public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface - { - if (2 > \func_num_args()) { - // This will make the Response class to use a custom reasonPhrase - $reasonPhrase = null; - } - - return new Response($code, [], null, '1.1', $reasonPhrase); - } - - public function createStream(string $content = ''): StreamInterface - { - return Stream::create($content); - } - - public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface - { - if ('' === $filename) { - throw new \RuntimeException('Path cannot be empty'); - } - - if (false === $resource = @\fopen($filename, $mode)) { - if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) { - throw new \InvalidArgumentException(\sprintf('The mode "%s" is invalid.', $mode)); - } - - throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $filename, \error_get_last()['message'] ?? '')); - } - - return Stream::create($resource); - } - - public function createStreamFromResource($resource): StreamInterface - { - return Stream::create($resource); - } - - public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface - { - if (null === $size) { - $size = $stream->getSize(); - } - - return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType); - } - - public function createUri(string $uri = ''): UriInterface - { - return new Uri($uri); - } - - public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface - { - return new ServerRequest($method, $uri, [], null, '1.1', $serverParams); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/MessageTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/MessageTrait.php deleted file mode 100644 index 7d02383b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/MessageTrait.php +++ /dev/null @@ -1,235 +0,0 @@ - - * @author Martijn van der Ven - * - * @internal should not be used outside of Nyholm/Psr7 as it does not fall under our BC promise - */ -trait MessageTrait -{ - /** @var array Map of all registered headers, as original name => array of values */ - private $headers = []; - - /** @var array Map of lowercase header name => original name at registration */ - private $headerNames = []; - - /** @var string */ - private $protocol = '1.1'; - - /** @var StreamInterface|null */ - private $stream; - - public function getProtocolVersion(): string - { - return $this->protocol; - } - - /** - * @return static - */ - public function withProtocolVersion($version): MessageInterface - { - if (!\is_scalar($version)) { - throw new \InvalidArgumentException('Protocol version must be a string'); - } - - if ($this->protocol === $version) { - return $this; - } - - $new = clone $this; - $new->protocol = (string) $version; - - return $new; - } - - public function getHeaders(): array - { - return $this->headers; - } - - public function hasHeader($header): bool - { - return isset($this->headerNames[\strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]); - } - - public function getHeader($header): array - { - if (!\is_string($header)) { - throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); - } - - $header = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - if (!isset($this->headerNames[$header])) { - return []; - } - - $header = $this->headerNames[$header]; - - return $this->headers[$header]; - } - - public function getHeaderLine($header): string - { - return \implode(', ', $this->getHeader($header)); - } - - /** - * @return static - */ - public function withHeader($header, $value): MessageInterface - { - $value = $this->validateAndTrimHeader($header, $value); - $normalized = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - unset($new->headers[$new->headerNames[$normalized]]); - } - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - - return $new; - } - - /** - * @return static - */ - public function withAddedHeader($header, $value): MessageInterface - { - if (!\is_string($header) || '' === $header) { - throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); - } - - $new = clone $this; - $new->setHeaders([$header => $value]); - - return $new; - } - - /** - * @return static - */ - public function withoutHeader($header): MessageInterface - { - if (!\is_string($header)) { - throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); - } - - $normalized = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - if (!isset($this->headerNames[$normalized])) { - return $this; - } - - $header = $this->headerNames[$normalized]; - $new = clone $this; - unset($new->headers[$header], $new->headerNames[$normalized]); - - return $new; - } - - public function getBody(): StreamInterface - { - if (null === $this->stream) { - $this->stream = Stream::create(''); - } - - return $this->stream; - } - - /** - * @return static - */ - public function withBody(StreamInterface $body): MessageInterface - { - if ($body === $this->stream) { - return $this; - } - - $new = clone $this; - $new->stream = $body; - - return $new; - } - - private function setHeaders(array $headers): void - { - foreach ($headers as $header => $value) { - if (\is_int($header)) { - // If a header name was set to a numeric string, PHP will cast the key to an int. - // We must cast it back to a string in order to comply with validation. - $header = (string) $header; - } - $value = $this->validateAndTrimHeader($header, $value); - $normalized = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - if (isset($this->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $this->headers[$header] = \array_merge($this->headers[$header], $value); - } else { - $this->headerNames[$normalized] = $header; - $this->headers[$header] = $value; - } - } - } - - /** - * Make sure the header complies with RFC 7230. - * - * Header names must be a non-empty string consisting of token characters. - * - * Header values must be strings consisting of visible characters with all optional - * leading and trailing whitespace stripped. This method will always strip such - * optional whitespace. Note that the method does not allow folding whitespace within - * the values as this was deprecated for almost all instances by the RFC. - * - * header-field = field-name ":" OWS field-value OWS - * field-name = 1*( "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" - * / "_" / "`" / "|" / "~" / %x30-39 / ( %x41-5A / %x61-7A ) ) - * OWS = *( SP / HTAB ) - * field-value = *( ( %x21-7E / %x80-FF ) [ 1*( SP / HTAB ) ( %x21-7E / %x80-FF ) ] ) - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 - */ - private function validateAndTrimHeader($header, $values): array - { - if (!\is_string($header) || 1 !== \preg_match("@^[!#$%&'*+.^_`|~0-9A-Za-z-]+$@D", $header)) { - throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); - } - - if (!\is_array($values)) { - // This is simple, just one value. - if ((!\is_numeric($values) && !\is_string($values)) || 1 !== \preg_match("@^[ \t\x21-\x7E\x80-\xFF]*$@", (string) $values)) { - throw new \InvalidArgumentException('Header values must be RFC 7230 compatible strings'); - } - - return [\trim((string) $values, " \t")]; - } - - if (empty($values)) { - throw new \InvalidArgumentException('Header values must be a string or an array of strings, empty array given'); - } - - // Assert Non empty array - $returnValues = []; - foreach ($values as $v) { - if ((!\is_numeric($v) && !\is_string($v)) || 1 !== \preg_match("@^[ \t\x21-\x7E\x80-\xFF]*$@D", (string) $v)) { - throw new \InvalidArgumentException('Header values must be RFC 7230 compatible strings'); - } - - $returnValues[] = \trim((string) $v, " \t"); - } - - return $returnValues; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Request.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Request.php deleted file mode 100644 index d50744ee..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Request.php +++ /dev/null @@ -1,47 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Request implements RequestInterface -{ - use MessageTrait; - use RequestTrait; - - /** - * @param string $method HTTP method - * @param string|UriInterface $uri URI - * @param array $headers Request headers - * @param string|resource|StreamInterface|null $body Request body - * @param string $version Protocol version - */ - public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1') - { - if (!($uri instanceof UriInterface)) { - $uri = new Uri($uri); - } - - $this->method = $method; - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $version; - - if (!$this->hasHeader('Host')) { - $this->updateHostFromUri(); - } - - // If we got no body, defer initialization of the stream until Request::getBody() - if ('' !== $body && null !== $body) { - $this->stream = Stream::create($body); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/RequestTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/RequestTrait.php deleted file mode 100644 index 2dbb3abf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/RequestTrait.php +++ /dev/null @@ -1,127 +0,0 @@ - - * @author Martijn van der Ven - * - * @internal should not be used outside of Nyholm/Psr7 as it does not fall under our BC promise - */ -trait RequestTrait -{ - /** @var string */ - private $method; - - /** @var string|null */ - private $requestTarget; - - /** @var UriInterface|null */ - private $uri; - - public function getRequestTarget(): string - { - if (null !== $this->requestTarget) { - return $this->requestTarget; - } - - if ('' === $target = $this->uri->getPath()) { - $target = '/'; - } - if ('' !== $this->uri->getQuery()) { - $target .= '?' . $this->uri->getQuery(); - } - - return $target; - } - - /** - * @return static - */ - public function withRequestTarget($requestTarget): RequestInterface - { - if (!\is_string($requestTarget)) { - throw new \InvalidArgumentException('Request target must be a string'); - } - - if (\preg_match('#\s#', $requestTarget)) { - throw new \InvalidArgumentException('Invalid request target provided; cannot contain whitespace'); - } - - $new = clone $this; - $new->requestTarget = $requestTarget; - - return $new; - } - - public function getMethod(): string - { - return $this->method; - } - - /** - * @return static - */ - public function withMethod($method): RequestInterface - { - if (!\is_string($method)) { - throw new \InvalidArgumentException('Method must be a string'); - } - - $new = clone $this; - $new->method = $method; - - return $new; - } - - public function getUri(): UriInterface - { - return $this->uri; - } - - /** - * @return static - */ - public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface - { - if ($uri === $this->uri) { - return $this; - } - - $new = clone $this; - $new->uri = $uri; - - if (!$preserveHost || !$this->hasHeader('Host')) { - $new->updateHostFromUri(); - } - - return $new; - } - - private function updateHostFromUri(): void - { - if ('' === $host = $this->uri->getHost()) { - return; - } - - if (null !== ($port = $this->uri->getPort())) { - $host .= ':' . $port; - } - - if (isset($this->headerNames['host'])) { - $header = $this->headerNames['host']; - } else { - $this->headerNames['host'] = $header = 'Host'; - } - - // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 - $this->headers = [$header => [$host]] + $this->headers; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Response.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Response.php deleted file mode 100644 index f3e20978..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Response.php +++ /dev/null @@ -1,93 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Response implements ResponseInterface -{ - use MessageTrait; - - /** @var array Map of standard HTTP status code/reason phrases */ - private const PHRASES = [ - 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', - 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-status', 208 => 'Already Reported', - 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect', - 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 425 => 'Unordered Collection', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 451 => 'Unavailable For Legal Reasons', - 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', 511 => 'Network Authentication Required', - ]; - - /** @var string */ - private $reasonPhrase = ''; - - /** @var int */ - private $statusCode; - - /** - * @param int $status Status code - * @param array $headers Response headers - * @param string|resource|StreamInterface|null $body Response body - * @param string $version Protocol version - * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) - */ - public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) - { - // If we got no body, defer initialization of the stream until Response::getBody() - if ('' !== $body && null !== $body) { - $this->stream = Stream::create($body); - } - - $this->statusCode = $status; - $this->setHeaders($headers); - if (null === $reason && isset(self::PHRASES[$this->statusCode])) { - $this->reasonPhrase = self::PHRASES[$status]; - } else { - $this->reasonPhrase = $reason ?? ''; - } - - $this->protocol = $version; - } - - public function getStatusCode(): int - { - return $this->statusCode; - } - - public function getReasonPhrase(): string - { - return $this->reasonPhrase; - } - - /** - * @return static - */ - public function withStatus($code, $reasonPhrase = ''): ResponseInterface - { - if (!\is_int($code) && !\is_string($code)) { - throw new \InvalidArgumentException('Status code has to be an integer'); - } - - $code = (int) $code; - if ($code < 100 || $code > 599) { - throw new \InvalidArgumentException(\sprintf('Status code has to be an integer between 100 and 599. A status code of %d was given', $code)); - } - - $new = clone $this; - $new->statusCode = $code; - if ((null === $reasonPhrase || '' === $reasonPhrase) && isset(self::PHRASES[$new->statusCode])) { - $reasonPhrase = self::PHRASES[$new->statusCode]; - } - $new->reasonPhrase = $reasonPhrase; - - return $new; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/ServerRequest.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/ServerRequest.php deleted file mode 100644 index a3c5ba90..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/ServerRequest.php +++ /dev/null @@ -1,201 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class ServerRequest implements ServerRequestInterface -{ - use MessageTrait; - use RequestTrait; - - /** @var array */ - private $attributes = []; - - /** @var array */ - private $cookieParams = []; - - /** @var array|object|null */ - private $parsedBody; - - /** @var array */ - private $queryParams = []; - - /** @var array */ - private $serverParams; - - /** @var UploadedFileInterface[] */ - private $uploadedFiles = []; - - /** - * @param string $method HTTP method - * @param string|UriInterface $uri URI - * @param array $headers Request headers - * @param string|resource|StreamInterface|null $body Request body - * @param string $version Protocol version - * @param array $serverParams Typically the $_SERVER superglobal - */ - public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1', array $serverParams = []) - { - $this->serverParams = $serverParams; - - if (!($uri instanceof UriInterface)) { - $uri = new Uri($uri); - } - - $this->method = $method; - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $version; - \parse_str($uri->getQuery(), $this->queryParams); - - if (!$this->hasHeader('Host')) { - $this->updateHostFromUri(); - } - - // If we got no body, defer initialization of the stream until ServerRequest::getBody() - if ('' !== $body && null !== $body) { - $this->stream = Stream::create($body); - } - } - - public function getServerParams(): array - { - return $this->serverParams; - } - - public function getUploadedFiles(): array - { - return $this->uploadedFiles; - } - - /** - * @return static - */ - public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface - { - $new = clone $this; - $new->uploadedFiles = $uploadedFiles; - - return $new; - } - - public function getCookieParams(): array - { - return $this->cookieParams; - } - - /** - * @return static - */ - public function withCookieParams(array $cookies): ServerRequestInterface - { - $new = clone $this; - $new->cookieParams = $cookies; - - return $new; - } - - public function getQueryParams(): array - { - return $this->queryParams; - } - - /** - * @return static - */ - public function withQueryParams(array $query): ServerRequestInterface - { - $new = clone $this; - $new->queryParams = $query; - - return $new; - } - - /** - * @return array|object|null - */ - public function getParsedBody() - { - return $this->parsedBody; - } - - /** - * @return static - */ - public function withParsedBody($data): ServerRequestInterface - { - if (!\is_array($data) && !\is_object($data) && null !== $data) { - throw new \InvalidArgumentException('First parameter to withParsedBody MUST be object, array or null'); - } - - $new = clone $this; - $new->parsedBody = $data; - - return $new; - } - - public function getAttributes(): array - { - return $this->attributes; - } - - /** - * @return mixed - */ - public function getAttribute($attribute, $default = null) - { - if (!\is_string($attribute)) { - throw new \InvalidArgumentException('Attribute name must be a string'); - } - - if (false === \array_key_exists($attribute, $this->attributes)) { - return $default; - } - - return $this->attributes[$attribute]; - } - - /** - * @return static - */ - public function withAttribute($attribute, $value): ServerRequestInterface - { - if (!\is_string($attribute)) { - throw new \InvalidArgumentException('Attribute name must be a string'); - } - - $new = clone $this; - $new->attributes[$attribute] = $value; - - return $new; - } - - /** - * @return static - */ - public function withoutAttribute($attribute): ServerRequestInterface - { - if (!\is_string($attribute)) { - throw new \InvalidArgumentException('Attribute name must be a string'); - } - - if (false === \array_key_exists($attribute, $this->attributes)) { - return $this; - } - - $new = clone $this; - unset($new->attributes[$attribute]); - - return $new; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Stream.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Stream.php deleted file mode 100644 index d3bd78d1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Stream.php +++ /dev/null @@ -1,391 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Stream implements StreamInterface -{ - use StreamTrait; - - /** @var resource|null A resource reference */ - private $stream; - - /** @var bool */ - private $seekable; - - /** @var bool */ - private $readable; - - /** @var bool */ - private $writable; - - /** @var array|mixed|void|bool|null */ - private $uri; - - /** @var int|null */ - private $size; - - /** @var array Hash of readable and writable stream types */ - private const READ_WRITE_HASH = [ - 'read' => [ - 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, - 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, - 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a+' => true, - ], - 'write' => [ - 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, - 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, - 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true, - ], - ]; - - /** - * @param resource $body - */ - public function __construct($body) - { - if (!\is_resource($body)) { - throw new \InvalidArgumentException('First argument to Stream::__construct() must be resource'); - } - - $this->stream = $body; - $meta = \stream_get_meta_data($this->stream); - $this->seekable = $meta['seekable'] && 0 === \fseek($this->stream, 0, \SEEK_CUR); - $this->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]); - $this->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]); - } - - /** - * Creates a new PSR-7 stream. - * - * @param string|resource|StreamInterface $body - * - * @throws \InvalidArgumentException - */ - public static function create($body = ''): StreamInterface - { - if ($body instanceof StreamInterface) { - return $body; - } - - if (\is_string($body)) { - if (200000 <= \strlen($body)) { - $body = self::openZvalStream($body); - } else { - $resource = \fopen('php://memory', 'r+'); - \fwrite($resource, $body); - \fseek($resource, 0); - $body = $resource; - } - } - - if (!\is_resource($body)) { - throw new \InvalidArgumentException('First argument to Stream::create() must be a string, resource or StreamInterface'); - } - - return new self($body); - } - - /** - * Closes the stream when the destructed. - */ - public function __destruct() - { - $this->close(); - } - - public function close(): void - { - if (isset($this->stream)) { - if (\is_resource($this->stream)) { - \fclose($this->stream); - } - $this->detach(); - } - } - - public function detach() - { - if (!isset($this->stream)) { - return null; - } - - $result = $this->stream; - unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - private function getUri() - { - if (false !== $this->uri) { - $this->uri = $this->getMetadata('uri') ?? false; - } - - return $this->uri; - } - - public function getSize(): ?int - { - if (null !== $this->size) { - return $this->size; - } - - if (!isset($this->stream)) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($uri = $this->getUri()) { - \clearstatcache(true, $uri); - } - - $stats = \fstat($this->stream); - if (isset($stats['size'])) { - $this->size = $stats['size']; - - return $this->size; - } - - return null; - } - - public function tell(): int - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - if (false === $result = @\ftell($this->stream)) { - throw new \RuntimeException('Unable to determine stream position: ' . (\error_get_last()['message'] ?? '')); - } - - return $result; - } - - public function eof(): bool - { - return !isset($this->stream) || \feof($this->stream); - } - - public function isSeekable(): bool - { - return $this->seekable; - } - - public function seek($offset, $whence = \SEEK_SET): void - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - if (!$this->seekable) { - throw new \RuntimeException('Stream is not seekable'); - } - - if (-1 === \fseek($this->stream, $offset, $whence)) { - throw new \RuntimeException('Unable to seek to stream position "' . $offset . '" with whence ' . \var_export($whence, true)); - } - } - - public function rewind(): void - { - $this->seek(0); - } - - public function isWritable(): bool - { - return $this->writable; - } - - public function write($string): int - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - if (!$this->writable) { - throw new \RuntimeException('Cannot write to a non-writable stream'); - } - - // We can't know the size after writing anything - $this->size = null; - - if (false === $result = @\fwrite($this->stream, $string)) { - throw new \RuntimeException('Unable to write to stream: ' . (\error_get_last()['message'] ?? '')); - } - - return $result; - } - - public function isReadable(): bool - { - return $this->readable; - } - - public function read($length): string - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - - if (false === $result = @\fread($this->stream, $length)) { - throw new \RuntimeException('Unable to read from stream: ' . (\error_get_last()['message'] ?? '')); - } - - return $result; - } - - public function getContents(): string - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - if (false === $contents = @\stream_get_contents($this->stream)) { - throw new \RuntimeException('Unable to read stream contents: ' . (\error_get_last()['message'] ?? '')); - } - - return $contents; - } - - /** - * @return mixed - */ - public function getMetadata($key = null) - { - if (null !== $key && !\is_string($key)) { - throw new \InvalidArgumentException('Metadata key must be a string'); - } - - if (!isset($this->stream)) { - return $key ? null : []; - } - - $meta = \stream_get_meta_data($this->stream); - - if (null === $key) { - return $meta; - } - - return $meta[$key] ?? null; - } - - private static function openZvalStream(string $body) - { - static $wrapper; - - $wrapper ?? \stream_wrapper_register('Nyholm-Psr7-Zval', $wrapper = \get_class(new class() { - public $context; - - private $data; - private $position = 0; - - public function stream_open(): bool - { - $this->data = \stream_context_get_options($this->context)['Nyholm-Psr7-Zval']['data']; - \stream_context_set_option($this->context, 'Nyholm-Psr7-Zval', 'data', null); - - return true; - } - - public function stream_read(int $count): string - { - $result = \substr($this->data, $this->position, $count); - $this->position += \strlen($result); - - return $result; - } - - public function stream_write(string $data): int - { - $this->data = \substr_replace($this->data, $data, $this->position, \strlen($data)); - $this->position += \strlen($data); - - return \strlen($data); - } - - public function stream_tell(): int - { - return $this->position; - } - - public function stream_eof(): bool - { - return \strlen($this->data) <= $this->position; - } - - public function stream_stat(): array - { - return [ - 'mode' => 33206, // POSIX_S_IFREG | 0666 - 'nlink' => 1, - 'rdev' => -1, - 'size' => \strlen($this->data), - 'blksize' => -1, - 'blocks' => -1, - ]; - } - - public function stream_seek(int $offset, int $whence): bool - { - if (\SEEK_SET === $whence && (0 <= $offset && \strlen($this->data) >= $offset)) { - $this->position = $offset; - } elseif (\SEEK_CUR === $whence && 0 <= $offset) { - $this->position += $offset; - } elseif (\SEEK_END === $whence && (0 > $offset && 0 <= $offset = \strlen($this->data) + $offset)) { - $this->position = $offset; - } else { - return false; - } - - return true; - } - - public function stream_set_option(): bool - { - return true; - } - - public function stream_truncate(int $new_size): bool - { - if ($new_size) { - $this->data = \substr($this->data, 0, $new_size); - $this->position = \min($this->position, $new_size); - } else { - $this->data = ''; - $this->position = 0; - } - - return true; - } - })); - - $context = \stream_context_create(['Nyholm-Psr7-Zval' => ['data' => $body]]); - - if (!$stream = @\fopen('Nyholm-Psr7-Zval://', 'r+', false, $context)) { - \stream_wrapper_register('Nyholm-Psr7-Zval', $wrapper); - $stream = \fopen('Nyholm-Psr7-Zval://', 'r+', false, $context); - } - - return $stream; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/StreamTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/StreamTrait.php deleted file mode 100644 index 41a3f9d7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/StreamTrait.php +++ /dev/null @@ -1,57 +0,0 @@ -= 70400 || (new \ReflectionMethod(StreamInterface::class, '__toString'))->hasReturnType()) { - /** - * @internal - */ - trait StreamTrait - { - public function __toString(): string - { - if ($this->isSeekable()) { - $this->seek(0); - } - - return $this->getContents(); - } - } -} else { - /** - * @internal - */ - trait StreamTrait - { - /** - * @return string - */ - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - - return $this->getContents(); - } catch (\Throwable $e) { - if (\is_array($errorHandler = \set_error_handler('var_dump'))) { - $errorHandler = $errorHandler[0] ?? null; - } - \restore_error_handler(); - - if ($e instanceof \Error || $errorHandler instanceof SymfonyErrorHandler || $errorHandler instanceof SymfonyLegacyErrorHandler) { - return \trigger_error((string) $e, \E_USER_ERROR); - } - - return ''; - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/UploadedFile.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/UploadedFile.php deleted file mode 100644 index c77dca43..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/UploadedFile.php +++ /dev/null @@ -1,179 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class UploadedFile implements UploadedFileInterface -{ - /** @var array */ - private const ERRORS = [ - \UPLOAD_ERR_OK => 1, - \UPLOAD_ERR_INI_SIZE => 1, - \UPLOAD_ERR_FORM_SIZE => 1, - \UPLOAD_ERR_PARTIAL => 1, - \UPLOAD_ERR_NO_FILE => 1, - \UPLOAD_ERR_NO_TMP_DIR => 1, - \UPLOAD_ERR_CANT_WRITE => 1, - \UPLOAD_ERR_EXTENSION => 1, - ]; - - /** @var string */ - private $clientFilename; - - /** @var string */ - private $clientMediaType; - - /** @var int */ - private $error; - - /** @var string|null */ - private $file; - - /** @var bool */ - private $moved = false; - - /** @var int */ - private $size; - - /** @var StreamInterface|null */ - private $stream; - - /** - * @param StreamInterface|string|resource $streamOrFile - * @param int $size - * @param int $errorStatus - * @param string|null $clientFilename - * @param string|null $clientMediaType - */ - public function __construct($streamOrFile, $size, $errorStatus, $clientFilename = null, $clientMediaType = null) - { - if (false === \is_int($errorStatus) || !isset(self::ERRORS[$errorStatus])) { - throw new \InvalidArgumentException('Upload file error status must be an integer value and one of the "UPLOAD_ERR_*" constants'); - } - - if (false === \is_int($size)) { - throw new \InvalidArgumentException('Upload file size must be an integer'); - } - - if (null !== $clientFilename && !\is_string($clientFilename)) { - throw new \InvalidArgumentException('Upload file client filename must be a string or null'); - } - - if (null !== $clientMediaType && !\is_string($clientMediaType)) { - throw new \InvalidArgumentException('Upload file client media type must be a string or null'); - } - - $this->error = $errorStatus; - $this->size = $size; - $this->clientFilename = $clientFilename; - $this->clientMediaType = $clientMediaType; - - if (\UPLOAD_ERR_OK === $this->error) { - // Depending on the value set file or stream variable. - if (\is_string($streamOrFile) && '' !== $streamOrFile) { - $this->file = $streamOrFile; - } elseif (\is_resource($streamOrFile)) { - $this->stream = Stream::create($streamOrFile); - } elseif ($streamOrFile instanceof StreamInterface) { - $this->stream = $streamOrFile; - } else { - throw new \InvalidArgumentException('Invalid stream or file provided for UploadedFile'); - } - } - } - - /** - * @throws \RuntimeException if is moved or not ok - */ - private function validateActive(): void - { - if (\UPLOAD_ERR_OK !== $this->error) { - throw new \RuntimeException('Cannot retrieve stream due to upload error'); - } - - if ($this->moved) { - throw new \RuntimeException('Cannot retrieve stream after it has already been moved'); - } - } - - public function getStream(): StreamInterface - { - $this->validateActive(); - - if ($this->stream instanceof StreamInterface) { - return $this->stream; - } - - if (false === $resource = @\fopen($this->file, 'r')) { - throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $this->file, \error_get_last()['message'] ?? '')); - } - - return Stream::create($resource); - } - - public function moveTo($targetPath): void - { - $this->validateActive(); - - if (!\is_string($targetPath) || '' === $targetPath) { - throw new \InvalidArgumentException('Invalid path provided for move operation; must be a non-empty string'); - } - - if (null !== $this->file) { - $this->moved = 'cli' === \PHP_SAPI ? @\rename($this->file, $targetPath) : @\move_uploaded_file($this->file, $targetPath); - - if (false === $this->moved) { - throw new \RuntimeException(\sprintf('Uploaded file could not be moved to "%s": %s', $targetPath, \error_get_last()['message'] ?? '')); - } - } else { - $stream = $this->getStream(); - if ($stream->isSeekable()) { - $stream->rewind(); - } - - if (false === $resource = @\fopen($targetPath, 'w')) { - throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $targetPath, \error_get_last()['message'] ?? '')); - } - - $dest = Stream::create($resource); - - while (!$stream->eof()) { - if (!$dest->write($stream->read(1048576))) { - break; - } - } - - $this->moved = true; - } - } - - public function getSize(): int - { - return $this->size; - } - - public function getError(): int - { - return $this->error; - } - - public function getClientFilename(): ?string - { - return $this->clientFilename; - } - - public function getClientMediaType(): ?string - { - return $this->clientMediaType; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Uri.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Uri.php deleted file mode 100644 index 621e2e72..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/nyholm/psr7/src/Uri.php +++ /dev/null @@ -1,356 +0,0 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Uri implements UriInterface -{ - private const SCHEMES = ['http' => 80, 'https' => 443]; - - private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; - - private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; - - private const CHAR_GEN_DELIMS = ':\/\?#\[\]@'; - - /** @var string Uri scheme. */ - private $scheme = ''; - - /** @var string Uri user info. */ - private $userInfo = ''; - - /** @var string Uri host. */ - private $host = ''; - - /** @var int|null Uri port. */ - private $port; - - /** @var string Uri path. */ - private $path = ''; - - /** @var string Uri query string. */ - private $query = ''; - - /** @var string Uri fragment. */ - private $fragment = ''; - - public function __construct(string $uri = '') - { - if ('' !== $uri) { - if (false === $parts = \parse_url($uri)) { - throw new \InvalidArgumentException(\sprintf('Unable to parse URI: "%s"', $uri)); - } - - // Apply parse_url parts to a URI. - $this->scheme = isset($parts['scheme']) ? \strtr($parts['scheme'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; - $this->userInfo = $parts['user'] ?? ''; - $this->host = isset($parts['host']) ? \strtr($parts['host'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; - $this->port = isset($parts['port']) ? $this->filterPort($parts['port']) : null; - $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; - $this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : ''; - $this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : ''; - if (isset($parts['pass'])) { - $this->userInfo .= ':' . $parts['pass']; - } - } - } - - public function __toString(): string - { - return self::createUriString($this->scheme, $this->getAuthority(), $this->path, $this->query, $this->fragment); - } - - public function getScheme(): string - { - return $this->scheme; - } - - public function getAuthority(): string - { - if ('' === $this->host) { - return ''; - } - - $authority = $this->host; - if ('' !== $this->userInfo) { - $authority = $this->userInfo . '@' . $authority; - } - - if (null !== $this->port) { - $authority .= ':' . $this->port; - } - - return $authority; - } - - public function getUserInfo(): string - { - return $this->userInfo; - } - - public function getHost(): string - { - return $this->host; - } - - public function getPort(): ?int - { - return $this->port; - } - - public function getPath(): string - { - $path = $this->path; - - if ('' !== $path && '/' !== $path[0]) { - if ('' !== $this->host) { - // If the path is rootless and an authority is present, the path MUST be prefixed by "/" - $path = '/' . $path; - } - } elseif (isset($path[1]) && '/' === $path[1]) { - // If the path is starting with more than one "/", the - // starting slashes MUST be reduced to one. - $path = '/' . \ltrim($path, '/'); - } - - return $path; - } - - public function getQuery(): string - { - return $this->query; - } - - public function getFragment(): string - { - return $this->fragment; - } - - /** - * @return static - */ - public function withScheme($scheme): UriInterface - { - if (!\is_string($scheme)) { - throw new \InvalidArgumentException('Scheme must be a string'); - } - - if ($this->scheme === $scheme = \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { - return $this; - } - - $new = clone $this; - $new->scheme = $scheme; - $new->port = $new->filterPort($new->port); - - return $new; - } - - /** - * @return static - */ - public function withUserInfo($user, $password = null): UriInterface - { - if (!\is_string($user)) { - throw new \InvalidArgumentException('User must be a string'); - } - - $info = \preg_replace_callback('/[' . self::CHAR_GEN_DELIMS . self::CHAR_SUB_DELIMS . ']++/', [__CLASS__, 'rawurlencodeMatchZero'], $user); - if (null !== $password && '' !== $password) { - if (!\is_string($password)) { - throw new \InvalidArgumentException('Password must be a string'); - } - - $info .= ':' . \preg_replace_callback('/[' . self::CHAR_GEN_DELIMS . self::CHAR_SUB_DELIMS . ']++/', [__CLASS__, 'rawurlencodeMatchZero'], $password); - } - - if ($this->userInfo === $info) { - return $this; - } - - $new = clone $this; - $new->userInfo = $info; - - return $new; - } - - /** - * @return static - */ - public function withHost($host): UriInterface - { - if (!\is_string($host)) { - throw new \InvalidArgumentException('Host must be a string'); - } - - if ($this->host === $host = \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { - return $this; - } - - $new = clone $this; - $new->host = $host; - - return $new; - } - - /** - * @return static - */ - public function withPort($port): UriInterface - { - if ($this->port === $port = $this->filterPort($port)) { - return $this; - } - - $new = clone $this; - $new->port = $port; - - return $new; - } - - /** - * @return static - */ - public function withPath($path): UriInterface - { - if ($this->path === $path = $this->filterPath($path)) { - return $this; - } - - $new = clone $this; - $new->path = $path; - - return $new; - } - - /** - * @return static - */ - public function withQuery($query): UriInterface - { - if ($this->query === $query = $this->filterQueryAndFragment($query)) { - return $this; - } - - $new = clone $this; - $new->query = $query; - - return $new; - } - - /** - * @return static - */ - public function withFragment($fragment): UriInterface - { - if ($this->fragment === $fragment = $this->filterQueryAndFragment($fragment)) { - return $this; - } - - $new = clone $this; - $new->fragment = $fragment; - - return $new; - } - - /** - * Create a URI string from its various parts. - */ - private static function createUriString(string $scheme, string $authority, string $path, string $query, string $fragment): string - { - $uri = ''; - if ('' !== $scheme) { - $uri .= $scheme . ':'; - } - - if ('' !== $authority) { - $uri .= '//' . $authority; - } - - if ('' !== $path) { - if ('/' !== $path[0]) { - if ('' !== $authority) { - // If the path is rootless and an authority is present, the path MUST be prefixed by "/" - $path = '/' . $path; - } - } elseif (isset($path[1]) && '/' === $path[1]) { - if ('' === $authority) { - // If the path is starting with more than one "/" and no authority is present, the - // starting slashes MUST be reduced to one. - $path = '/' . \ltrim($path, '/'); - } - } - - $uri .= $path; - } - - if ('' !== $query) { - $uri .= '?' . $query; - } - - if ('' !== $fragment) { - $uri .= '#' . $fragment; - } - - return $uri; - } - - /** - * Is a given port non-standard for the current scheme? - */ - private static function isNonStandardPort(string $scheme, int $port): bool - { - return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme]; - } - - private function filterPort($port): ?int - { - if (null === $port) { - return null; - } - - $port = (int) $port; - if (0 > $port || 0xFFFF < $port) { - throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 0 and 65535', $port)); - } - - return self::isNonStandardPort($this->scheme, $port) ? $port : null; - } - - private function filterPath($path): string - { - if (!\is_string($path)) { - throw new \InvalidArgumentException('Path must be a string'); - } - - return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $path); - } - - private function filterQueryAndFragment($str): string - { - if (!\is_string($str)) { - throw new \InvalidArgumentException('Query and fragment must be a string'); - } - - return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $str); - } - - private static function rawurlencodeMatchZero(array $match): string - { - return \rawurlencode($match[0]); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/CHANGELOG.md deleted file mode 100644 index e2dc25f5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/CHANGELOG.md +++ /dev/null @@ -1,23 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.0.1 - -Allow installation with PHP 8. No code changes. - -## 1.0.0 - -First stable release. No changes since 0.3.0. - -## 0.3.0 - -Added Interface suffix on exceptions - -## 0.2.0 - -All exceptions are in `Psr\Http\Client` namespace - -## 0.1.0 - -First release diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/LICENSE deleted file mode 100644 index cd5e0020..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2017 PHP Framework Interoperability Group - -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/wp-webauthn/wp-webauthn-vendor/psr/http-client/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/README.md deleted file mode 100644 index 6876b840..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/README.md +++ /dev/null @@ -1,12 +0,0 @@ -HTTP Client -=========== - -This repository holds all the common code related to [PSR-18 (HTTP Client)][psr-url]. - -Note that this is not a HTTP Client implementation of its own. It is merely abstractions that describe the components of a HTTP Client. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: http://www.php-fig.org/psr/psr-18 -[package-url]: https://packagist.org/packages/psr/http-client -[implementation-url]: https://packagist.org/providers/psr/http-client-implementation diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/composer.json deleted file mode 100644 index c195f8ff..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "psr/http-client", - "description": "Common interface for HTTP clients", - "keywords": ["psr", "psr-18", "http", "http-client"], - "homepage": "https://github.com/php-fig/http-client", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/src/ClientExceptionInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/src/ClientExceptionInterface.php deleted file mode 100644 index aa0b9cf1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-client/src/ClientExceptionInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -=7.0.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-factory/src/RequestFactoryInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-factory/src/RequestFactoryInterface.php deleted file mode 100644 index cb39a08b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-factory/src/RequestFactoryInterface.php +++ /dev/null @@ -1,18 +0,0 @@ - `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. -> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. - diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/docs/PSR7-Usage.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/docs/PSR7-Usage.md deleted file mode 100644 index b6d048a3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/docs/PSR7-Usage.md +++ /dev/null @@ -1,159 +0,0 @@ -### PSR-7 Usage - -All PSR-7 applications comply with these interfaces -They were created to establish a standard between middleware implementations. - -> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. -> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. - - -The following examples will illustrate how basic operations are done in PSR-7. - -##### Examples - - -For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc) -All PSR-7 implementations should have the same behaviour. - -The following will be assumed: -`$request` is an object of `Psr\Http\Message\RequestInterface` and - -`$response` is an object implementing `Psr\Http\Message\RequestInterface` - - -### Working with HTTP Headers - -#### Adding headers to response: - -```php -$response->withHeader('My-Custom-Header', 'My Custom Message'); -``` - -#### Appending values to headers - -```php -$response->withAddedHeader('My-Custom-Header', 'The second message'); -``` - -#### Checking if header exists: - -```php -$request->hasHeader('My-Custom-Header'); // will return false -$response->hasHeader('My-Custom-Header'); // will return true -``` - -> Note: My-Custom-Header was only added in the Response - -#### Getting comma-separated values from a header (also applies to request) - -```php -// getting value from request headers -$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" -// getting value from response headers -$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" -``` - -#### Getting array of value from a header (also applies to request) -```php -// getting value from request headers -$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] -// getting value from response headers -$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] -``` - -#### Removing headers from HTTP Messages -```php -// removing a header from Request, removing deprecated "Content-MD5" header -$request->withoutHeader('Content-MD5'); - -// removing a header from Response -// effect: the browser won't know the size of the stream -// the browser will download the stream till it ends -$response->withoutHeader('Content-Length'); -``` - -### Working with HTTP Message Body - -When working with the PSR-7 there are two methods of implementation: -#### 1. Getting the body separately - -> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented. - -```php -$body = $response->getBody(); -// operations on body, eg. read, write, seek -// ... -// replacing the old body -$response->withBody($body); -// this last statement is optional as we working with objects -// in this case the "new" body is same with the "old" one -// the $body variable has the same value as the one in $request, only the reference is passed -``` - -#### 2. Working directly on response - -> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required - -```php -$response->getBody()->write('hello'); -``` - -### Getting the body contents - -The following snippet gets the contents of a stream contents. -> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream. -```php -$body = $response->getBody(); -$body->rewind(); // or $body->seek(0); -$bodyText = $body->getContents(); -``` -> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended. - -### Append to body - -```php -$response->getBody()->write('Hello'); // writing directly -$body = $request->getBody(); // which is a `StreamInterface` -$body->write('xxxxx'); -``` - -### Prepend to body -Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended. -The following example will explain the behaviour of streams. - -```php -// assuming our response is initially empty -$body = $repsonse->getBody(); -// writing the string "abcd" -$body->write('abcd'); - -// seeking to start of stream -$body->seek(0); -// writing 'ef' -$body->write('ef'); // at this point the stream contains "efcd" -``` - -#### Prepending by rewriting separately - -```php -// assuming our response body stream only contains: "abcd" -$body = $response->getBody(); -$body->rewind(); -$contents = $body->getContents(); // abcd -// seeking the stream to beginning -$body->rewind(); -$body->write('ef'); // stream contains "efcd" -$body->write($contents); // stream contains "efabcd" -``` - -> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`. - -#### Prepending by using contents as a string -```php -$body = $response->getBody(); -$body->rewind(); -$contents = $body->getContents(); // efabcd -$contents = 'ef'.$contents; -$body->rewind(); -$body->write($contents); -``` diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/MessageInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/MessageInterface.php deleted file mode 100644 index 8cdb4ed6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,189 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return string[][] Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders(); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader(string $name); - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader(string $name); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine(string $name); - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader(string $name, $value); - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader(string $name, $value); - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return static - */ - public function withoutHeader(string $name); - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody(); - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return static - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/RequestInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/RequestInterface.php deleted file mode 100644 index 38066df6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,131 +0,0 @@ -getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams(); - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return static - */ - public function withQueryParams(array $query); - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles(); - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles An array tree of UploadedFileInterface instances. - * @return static - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles); - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - */ - public function getParsedBody(); - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return static - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data); - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes(); - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute(string $name, $default = null); - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return static - */ - public function withAttribute(string $name, $value); - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return static - */ - public function withoutAttribute(string $name); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/StreamInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/StreamInterface.php deleted file mode 100644 index 59246639..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,160 +0,0 @@ - - * [user-info@]host[:port] - * - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority(); - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo(); - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost(); - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort(); - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath(); - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery(); - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment(); - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return static A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme(string $scheme); - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return static A new instance with the specified user information. - */ - public function withUserInfo(string $user, ?string $password = null); - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return static A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost(string $host); - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return static A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort(?int $port); - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return static A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath(string $path); - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return static A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery(string $query); - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return static A new instance with the specified fragment. - */ - public function withFragment(string $fragment); - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString(); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/LICENSE deleted file mode 100644 index 474c952b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 PHP Framework Interoperability Group - -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/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/AbstractLogger.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/AbstractLogger.php deleted file mode 100644 index e02f9daf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/AbstractLogger.php +++ /dev/null @@ -1,128 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/InvalidArgumentException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/InvalidArgumentException.php deleted file mode 100644 index 67f852d1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/InvalidArgumentException.php +++ /dev/null @@ -1,7 +0,0 @@ -logger = $logger; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/LoggerInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/LoggerInterface.php deleted file mode 100644 index 2206cfde..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/LoggerInterface.php +++ /dev/null @@ -1,125 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param array $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - abstract public function log($level, $message, array $context = array()); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/NullLogger.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/NullLogger.php deleted file mode 100644 index c8f7293b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/NullLogger.php +++ /dev/null @@ -1,30 +0,0 @@ -logger) { }` - * blocks. - */ -class NullLogger extends AbstractLogger -{ - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void - * - * @throws \Psr\Log\InvalidArgumentException - */ - public function log($level, $message, array $context = array()) - { - // noop - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/Test/DummyTest.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/Test/DummyTest.php deleted file mode 100644 index 9638c110..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/Test/DummyTest.php +++ /dev/null @@ -1,18 +0,0 @@ - ". - * - * Example ->error('Foo') would yield "error Foo". - * - * @return string[] - */ - abstract public function getLogs(); - - public function testImplements() - { - $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); - } - - /** - * @dataProvider provideLevelsAndMessages - */ - public function testLogsAtAllLevels($level, $message) - { - $logger = $this->getLogger(); - $logger->{$level}($message, array('user' => 'Bob')); - $logger->log($level, $message, array('user' => 'Bob')); - - $expected = array( - $level.' message of level '.$level.' with context: Bob', - $level.' message of level '.$level.' with context: Bob', - ); - $this->assertEquals($expected, $this->getLogs()); - } - - public function provideLevelsAndMessages() - { - return array( - LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), - LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), - LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), - LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), - LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), - LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), - LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), - LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), - ); - } - - /** - * @expectedException \Psr\Log\InvalidArgumentException - */ - public function testThrowsOnInvalidLevel() - { - $logger = $this->getLogger(); - $logger->log('invalid level', 'Foo'); - } - - public function testContextReplacement() - { - $logger = $this->getLogger(); - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); - - $expected = array('info {Message {nothing} Bob Bar a}'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testObjectCastToString() - { - if (method_exists($this, 'createPartialMock')) { - $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); - } else { - $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); - } - $dummy->expects($this->once()) - ->method('__toString') - ->will($this->returnValue('DUMMY')); - - $this->getLogger()->warning($dummy); - - $expected = array('warning DUMMY'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextCanContainAnything() - { - $closed = fopen('php://memory', 'r'); - fclose($closed); - - $context = array( - 'bool' => true, - 'null' => null, - 'string' => 'Foo', - 'int' => 0, - 'float' => 0.5, - 'nested' => array('with object' => new DummyTest), - 'object' => new \DateTime, - 'resource' => fopen('php://memory', 'r'), - 'closed' => $closed, - ); - - $this->getLogger()->warning('Crazy context data', $context); - - $expected = array('warning Crazy context data'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextExceptionKeyCanBeExceptionOrOtherValues() - { - $logger = $this->getLogger(); - $logger->warning('Random message', array('exception' => 'oops')); - $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); - - $expected = array( - 'warning Random message', - 'critical Uncaught Exception!' - ); - $this->assertEquals($expected, $this->getLogs()); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/Test/TestLogger.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/Test/TestLogger.php deleted file mode 100644 index 1be32304..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/Psr/Log/Test/TestLogger.php +++ /dev/null @@ -1,147 +0,0 @@ - $level, - 'message' => $message, - 'context' => $context, - ]; - - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } - - public function hasRecords($level) - { - return isset($this->recordsByLevel[$level]); - } - - public function hasRecord($record, $level) - { - if (is_string($record)) { - $record = ['message' => $record]; - } - return $this->hasRecordThatPasses(function ($rec) use ($record) { - if ($rec['message'] !== $record['message']) { - return false; - } - if (isset($record['context']) && $rec['context'] !== $record['context']) { - return false; - } - return true; - }, $level); - } - - public function hasRecordThatContains($message, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== false; - }, $level); - } - - public function hasRecordThatMatches($regex, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($regex) { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - - public function hasRecordThatPasses(callable $predicate, $level) - { - if (!isset($this->recordsByLevel[$level])) { - return false; - } - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if (call_user_func($predicate, $rec, $i)) { - return true; - } - } - return false; - } - - public function __call($method, $args) - { - if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = strtolower($matches[2]); - if (method_exists($this, $genericMethod)) { - $args[] = $level; - return call_user_func_array([$this, $genericMethod], $args); - } - } - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); - } - - public function reset() - { - $this->records = []; - $this->recordsByLevel = []; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/README.md deleted file mode 100644 index a9f20c43..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/README.md +++ /dev/null @@ -1,58 +0,0 @@ -PSR Log -======= - -This repository holds all interfaces/classes/traits related to -[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). - -Note that this is not a logger of its own. It is merely an interface that -describes a logger. See the specification for more details. - -Installation ------------- - -```bash -composer require psr/log -``` - -Usage ------ - -If you need a logger, you can use the interface like this: - -```php -logger = $logger; - } - - public function doSomething() - { - if ($this->logger) { - $this->logger->info('Doing work'); - } - - try { - $this->doSomethingElse(); - } catch (Exception $exception) { - $this->logger->error('Oh no!', array('exception' => $exception)); - } - - // do something useful - } -} -``` - -You can then pick one of the implementations of the interface to get a logger. - -If you want to implement the interface, you can require this package and -implement `Psr\Log\LoggerInterface` in your code. Please read the -[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -for details. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/composer.json deleted file mode 100644 index ca056953..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/psr/log/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "psr/log", - "description": "Common interface for logging libraries", - "keywords": ["psr", "psr-3", "log"], - "homepage": "https://github.com/php-fig/log", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/LICENSE deleted file mode 100644 index a7fcf120..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2022 Ben Ramsey - -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/wp-webauthn/wp-webauthn-vendor/ramsey/collection/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/README.md deleted file mode 100644 index c77ffcb1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/README.md +++ /dev/null @@ -1,70 +0,0 @@ -

          ramsey/collection

          - -

          - A PHP library for representing and manipulating collections. -

          - -

          - Source Code - Download Package - PHP Programming Language - Read License - Build Status - Codecov Code Coverage - Psalm Type Coverage -

          - -## About - -ramsey/collection is a PHP library for representing and manipulating collections. - -Much inspiration for this library came from the [Java Collections Framework][java]. - -This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). -By participating in this project and its community, you are expected to -uphold this code. - -## Installation - -Install this package as a dependency using [Composer](https://getcomposer.org). - -``` bash -composer require ramsey/collection -``` - -## Usage - -Examples of how to use this library may be found in the -[Wiki pages](https://github.com/ramsey/collection/wiki/Examples). - -## Contributing - -Contributions are welcome! To contribute, please familiarize yourself with -[CONTRIBUTING.md](CONTRIBUTING.md). - -## Coordinated Disclosure - -Keeping user information safe and secure is a top priority, and we welcome the -contribution of external security researchers. If you believe you've found a -security issue in software that is maintained in this repository, please read -[SECURITY.md][] for instructions on submitting a vulnerability report. - -## ramsey/collection for Enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of ramsey/collection and thousands of other packages are working -with Tidelift to deliver commercial support and maintenance for the open source -packages you use to build your applications. Save time, reduce risk, and improve -code health, while paying the maintainers of the exact packages you use. -[Learn more.](https://tidelift.com/subscription/pkg/packagist-ramsey-collection?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -## Copyright and License - -The ramsey/collection library is copyright © [Ben Ramsey](https://benramsey.com) -and licensed for use under the terms of the -MIT License (MIT). Please see [LICENSE](LICENSE) for more information. - - -[java]: http://docs.oracle.com/javase/8/docs/technotes/guides/collections/index.html -[security.md]: https://github.com/ramsey/collection/blob/main/SECURITY.md diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/SECURITY.md deleted file mode 100644 index 3de4c0cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/SECURITY.md +++ /dev/null @@ -1,169 +0,0 @@ - - -# Vulnerability Disclosure Policy (VDP) - -## Brand Promise - - - -Keeping user information safe and secure is a top priority, and we welcome the -contribution of external security researchers. - -## Scope - - - -If you believe you've found a security issue in software that is maintained in -this repository, we encourage you to notify us. - -| Version | In scope | Source code | -| ------- | :------: | ----------- | -| latest | ✅ | https://github.com/ramsey/collection | - -## How to Submit a Report - - - -To submit a vulnerability report, please contact us at security@ramsey.dev. -Your submission will be reviewed and validated by a member of our team. - -## Safe Harbor - - - -We support safe harbor for security researchers who: - -* Make a good faith effort to avoid privacy violations, destruction of data, and - interruption or degradation of our services. -* Only interact with accounts you own or with explicit permission of the account - holder. If you do encounter Personally Identifiable Information (PII) contact - us immediately, do not proceed with access, and immediately purge any local - information. -* Provide us with a reasonable amount of time to resolve vulnerabilities prior - to any disclosure to the public or a third party. - -We will consider activities conducted consistent with this policy to constitute -"authorized" conduct and will not pursue civil action or initiate a complaint to -law enforcement. We will help to the extent we can if legal action is initiated -by a third party against you. - -Please submit a report to us before engaging in conduct that may be inconsistent -with or unaddressed by this policy. - -## Preferences - - - -* Please provide detailed reports with reproducible steps and a clearly defined - impact. -* Include the version number of the vulnerable package in your report -* Social engineering (e.g. phishing, vishing, smishing) is prohibited. - - - -## Encryption Key for security@ramsey.dev - -For increased privacy when reporting sensitive issues, you may encrypt your -message using the following public key: - -``` ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBF+Z9gEBEACbT/pIx8RR0K18t8Z2rDnmEV44YdT7HNsMdq+D6SAlx8UUb6AU -jGIbV9dgBgGNtOLU1pxloaJwL9bWIRbj+X/Qb2WNIP//Vz1Y40ox1dSpfCUrizXx -kb4p58Xml0PsB8dg3b4RDUgKwGC37ne5xmDnigyJPbiB2XJ6Xc46oPCjh86XROTK -wEBB2lY67ClBlSlvC2V9KmbTboRQkLdQDhOaUosMb99zRb0EWqDLaFkZVjY5HI7i -0pTveE6dI12NfHhTwKjZ5pUiAZQGlKA6J1dMjY2unxHZkQj5MlMfrLSyJHZxccdJ -xD94T6OTcTHt/XmMpI2AObpewZDdChDQmcYDZXGfAhFoJmbvXsmLMGXKgzKoZ/ls -RmLsQhh7+/r8E+Pn5r+A6Hh4uAc14ApyEP0ckKeIXw1C6pepHM4E8TEXVr/IA6K/ -z6jlHORixIFX7iNOnfHh+qwOgZw40D6JnBfEzjFi+T2Cy+JzN2uy7I8UnecTMGo3 -5t6astPy6xcH6kZYzFTV7XERR6LIIVyLAiMFd8kF5MbJ8N5ElRFsFHPW+82N2HDX -c60iSaTB85k6R6xd8JIKDiaKE4sSuw2wHFCKq33d/GamYezp1wO+bVUQg88efljC -2JNFyD+vl30josqhw1HcmbE1TP3DlYeIL5jQOlxCMsgai6JtTfHFM/5MYwARAQAB -tBNzZWN1cml0eUByYW1zZXkuZGV2iQJUBBMBCAA+FiEE4drPD+/ofZ570fAYq0bv -vXQCywIFAl+Z9gECGwMFCQeGH4AFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ -q0bvvXQCywIkEA//Qcwv8MtTCy01LHZd9c7VslwhNdXQDYymcTyjcYw8x7O22m4B -3hXE6vqAplFhVxxkqXB2ef0tQuzxhPHNJgkCE4Wq4i+V6qGpaSVHQT2W6DN/NIhL -vS8OdScc6zddmIbIkSrzVVAtjwehFNEIrX3DnbbbK+Iku7vsKT5EclOluIsjlYoX -goW8IeReyDBqOe2H3hoCGw6EA0D/NYV2bJnfy53rXVIyarsXXeOLp7eNEH6Td7aW -PVSrMZJe1t+knrEGnEdrXWzlg4lCJJCtemGv+pKBUomnyISXSdqyoRCCzvQjqyig -2kRebUX8BXPW33p4OXPj9sIboUOjZwormWwqqbFMO+J4TiVCUoEoheI7emPFRcNN -QtPJrjbY1++OznBc0GRpfeUkGoU1cbRl1bnepnFIZMTDLkrVW6I1Y4q8ZVwX3BkE -N81ctFrRpHBlU36EdHvjPQmGtuiL77Qq3fWmMv7yTvK1wHJAXfEb0ZJWHZCbck3w -l0CVq0Z+UUAOM8Rp1N0N8m92xtapav0qCFU9qzf2J5qX6GRmWv+d29wPgFHzDWBm -nnrYYIA4wJLx00U6SMcVBSnNe91B+RfGY5XQhbWPjQQecOGCSDsxaFAq2MeOVJyZ -bIjLYfG9GxoLKr5R7oLRJvZI4nKKBc1Kci/crZbdiSdQhSQGlDz88F1OHeCIdQQQ -EQgAHRYhBOhdAxHd+lus86YQ57Atl5icjAcbBQJfmfdIAAoJELAtl5icjAcbFVcA -/1LqB3ZjsnXDAvvAXZVjSPqofSlpMLeRQP6IM/A9Odq0AQCZrtZc1knOMGEcjppK -Rk+sy/R0Mshy8TDuaZIRgh2Ux7kCDQRfmfYBARAAmchKzzVz7IaEq7PnZDb3szQs -T/+E9F3m39yOpV4fEB1YzObonFakXNT7Gw2tZEx0eitUMqQ/13jjfu3UdzlKl2bR -qA8LrSQRhB+PTC9A1XvwxCUYhhjGiLzJ9CZL6hBQB43qHOmE9XJPme90geLsF+gK -u39Waj1SNWzwGg+Gy1Gl5f2AJoDTxznreCuFGj+Vfaczt/hlfgqpOdb9jsmdoE7t -3DSWppA9dRHWwQSgE6J28rR4QySBcqyXS6IMykqaJn7Z26yNIaITLnHCZOSY8zhP -ha7GFsN549EOCgECbrnPt9dmI2+hQE0RO0e7SOBNsIf5sz/i7urhwuj0CbOqhjc2 -X1AEVNFCVcb6HPi/AWefdFCRu0gaWQxn5g+9nkq5slEgvzCCiKYzaBIcr8qR6Hb4 -FaOPVPxO8vndRouq57Ws8XpAwbPttioFuCqF4u9K+tK/8e2/R8QgRYJsE3Cz/Fu8 -+pZFpMnqbDEbK3DL3ss+1ed1sky+mDV8qXXeI33XW5hMFnk1JWshUjHNlQmE6ftC -U0xSTMVUtwJhzH2zDp8lEdu7qi3EsNULOl68ozDr6soWAvCbHPeTdTOnFySGCleG -/3TonsoZJs/sSPPJnxFQ1DtgQL6EbhIwa0ZwU4eKYVHZ9tjxuMX3teFzRvOrJjgs -+ywGlsIURtEckT5Y6nMAEQEAAYkCPAQYAQgAJhYhBOHazw/v6H2ee9HwGKtG7710 -AssCBQJfmfYBAhsMBQkHhh+AAAoJEKtG7710AssC8NcP/iDAcy1aZFvkA0EbZ85p -i7/+ywtE/1wF4U4/9OuLcoskqGGnl1pJNPooMOSBCfreoTB8HimT0Fln0CoaOm4Q -pScNq39JXmf4VxauqUJVARByP6zUfgYarqoaZNeuFF0S4AZJ2HhGzaQPjDz1uKVM -PE6tQSgQkFzdZ9AtRA4vElTH6yRAgmepUsOihk0b0gUtVnwtRYZ8e0Qt3ie97a73 -DxLgAgedFRUbLRYiT0vNaYbainBsLWKpN/T8odwIg/smP0Khjp/ckV60cZTdBiPR -szBTPJESMUTu0VPntc4gWwGsmhZJg/Tt/qP08XYo3VxNYBegyuWwNR66zDWvwvGH -muMv5UchuDxp6Rt3JkIO4voMT1JSjWy9p8krkPEE4V6PxAagLjdZSkt92wVLiK5x -y5gNrtPhU45YdRAKHr36OvJBJQ42CDaZ6nzrzghcIp9CZ7ANHrI+QLRM/csz+AGA -szSp6S4mc1lnxxfbOhPPpebZPn0nIAXoZnnoVKdrxBVedPQHT59ZFvKTQ9Fs7gd3 -sYNuc7tJGFGC2CxBH4ANDpOQkc5q9JJ1HSGrXU3juxIiRgfA26Q22S9c71dXjElw -Ri584QH+bL6kkYmm8xpKF6TVwhwu5xx/jBPrbWqFrtbvLNrnfPoapTihBfdIhkT6 -nmgawbBHA02D5xEqB5SU3WJu -=eJNx ------END PGP PUBLIC KEY BLOCK----- -``` diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/composer.json deleted file mode 100644 index f09106a1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/composer.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "name": "ramsey/collection", - "description": "A PHP library for representing and manipulating collections.", - "license": "MIT", - "type": "library", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "require": { - "php": "^7.4 || ^8.0", - "symfony/polyfill-php81": "^1.23" - }, - "require-dev": { - "captainhook/plugin-composer": "^5.3", - "ergebnis/composer-normalize": "^2.28.3", - "fakerphp/faker": "^1.21", - "hamcrest/hamcrest-php": "^2.0", - "jangregor/phpstan-prophecy": "^1.0", - "mockery/mockery": "^1.5", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcsstandards/phpcsutils": "^1.0.0-rc1", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18.4", - "ramsey/coding-standard": "^2.0.3", - "ramsey/conventional-commits": "^1.3", - "vimeo/psalm": "^5.4" - }, - "minimum-stability": "RC", - "prefer-stable": true, - "autoload": { - "psr-4": { - "Ramsey\\Collection\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Ramsey\\Collection\\Test\\": "tests/", - "Ramsey\\Test\\Generics\\": "tests/generics/" - }, - "files": [ - "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php" - ] - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, - "ergebnis/composer-normalize": true, - "phpstan/extension-installer": true, - "captainhook/plugin-composer": true - }, - "sort-packages": true - }, - "extra": { - "captainhook": { - "force-install": true - }, - "ramsey/conventional-commits": { - "configFile": "conventional-commits.json" - } - }, - "scripts": { - "dev:analyze": [ - "@dev:analyze:phpstan", - "@dev:analyze:psalm" - ], - "dev:analyze:phpstan": "phpstan analyse --ansi --memory-limit=1G", - "dev:analyze:psalm": "psalm", - "dev:build:clean": "git clean -fX build/", - "dev:lint": [ - "@dev:lint:syntax", - "@dev:lint:style" - ], - "dev:lint:fix": "phpcbf", - "dev:lint:style": "phpcs --colors", - "dev:lint:syntax": "parallel-lint --colors src/ tests/", - "dev:test": [ - "@dev:lint", - "@dev:analyze", - "@dev:test:unit" - ], - "dev:test:coverage:ci": "phpunit --colors=always --coverage-text --coverage-clover build/coverage/clover.xml --coverage-cobertura build/coverage/cobertura.xml --coverage-crap4j build/coverage/crap4j.xml --coverage-xml build/coverage/coverage-xml --log-junit build/junit.xml", - "dev:test:coverage:html": "phpunit --colors=always --coverage-html build/coverage/coverage-html/", - "dev:test:unit": "phpunit --colors=always", - "test": "@dev:test" - }, - "scripts-descriptions": { - "dev:analyze": "Runs all static analysis checks.", - "dev:analyze:phpstan": "Runs the PHPStan static analyzer.", - "dev:analyze:psalm": "Runs the Psalm static analyzer.", - "dev:build:clean": "Cleans the build/ directory.", - "dev:lint": "Runs all linting checks.", - "dev:lint:fix": "Auto-fixes coding standards issues, if possible.", - "dev:lint:style": "Checks for coding standards issues.", - "dev:lint:syntax": "Checks for syntax errors.", - "dev:test": "Runs linting, static analysis, and unit tests.", - "dev:test:coverage:ci": "Runs unit tests and generates CI coverage reports.", - "dev:test:coverage:html": "Runs unit tests and generates HTML coverage report.", - "dev:test:unit": "Runs unit tests.", - "test": "Runs linting, static analysis, and unit tests." - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/conventional-commits.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/conventional-commits.json deleted file mode 100644 index 5fe21d2f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/conventional-commits.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "typeCase": "kebab", - "types": [ - "chore", - "ci", - "docs", - "feat", - "fix", - "refactor", - "security", - "style", - "test" - ], - "scopeCase": "kebab", - "scopeRequired": false, - "scopes": [], - "descriptionCase": null, - "descriptionEndMark": "", - "bodyRequired": false, - "bodyWrapWidth": 72, - "requiredFooters": [] -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractArray.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractArray.php deleted file mode 100644 index 9b39dd0c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractArray.php +++ /dev/null @@ -1,208 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use ArrayIterator; -use Traversable; - -use function count; -use function serialize; -use function unserialize; - -/** - * This class provides a basic implementation of `ArrayInterface`, to minimize - * the effort required to implement this interface. - * - * @template T - * @implements ArrayInterface - */ -abstract class AbstractArray implements ArrayInterface -{ - /** - * The items of this array. - * - * @var array - */ - protected array $data = []; - - /** - * Constructs a new array object. - * - * @param array $data The initial items to add to this array. - */ - public function __construct(array $data = []) - { - // Invoke offsetSet() for each value added; in this way, sub-classes - // may provide additional logic about values added to the array object. - foreach ($data as $key => $value) { - $this[$key] = $value; - } - } - - /** - * Returns an iterator for this array. - * - * @link http://php.net/manual/en/iteratoraggregate.getiterator.php IteratorAggregate::getIterator() - * - * @return Traversable - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->data); - } - - /** - * Returns `true` if the given offset exists in this array. - * - * @link http://php.net/manual/en/arrayaccess.offsetexists.php ArrayAccess::offsetExists() - * - * @param array-key $offset The offset to check. - */ - public function offsetExists($offset): bool - { - return isset($this->data[$offset]); - } - - /** - * Returns the value at the specified offset. - * - * @link http://php.net/manual/en/arrayaccess.offsetget.php ArrayAccess::offsetGet() - * - * @param array-key $offset The offset for which a value should be returned. - * - * @return T|null the value stored at the offset, or null if the offset - * does not exist. - */ - #[\ReturnTypeWillChange] // phpcs:ignore - public function offsetGet($offset) - { - return $this->data[$offset] ?? null; - } - - /** - * Sets the given value to the given offset in the array. - * - * @link http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet() - * - * @param array-key|null $offset The offset to set. If `null`, the value may be - * set at a numerically-indexed offset. - * @param T $value The value to set at the given offset. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offsetSet($offset, $value): void - { - if ($offset === null) { - $this->data[] = $value; - } else { - $this->data[$offset] = $value; - } - } - - /** - * Removes the given offset and its value from the array. - * - * @link http://php.net/manual/en/arrayaccess.offsetunset.php ArrayAccess::offsetUnset() - * - * @param array-key $offset The offset to remove from the array. - */ - public function offsetUnset($offset): void - { - unset($this->data[$offset]); - } - - /** - * Returns a serialized string representation of this array object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.serialize.php Serializable::serialize() - * - * @return string a PHP serialized string. - */ - public function serialize(): string - { - return serialize($this->data); - } - - /** - * Returns data suitable for PHP serialization. - * - * @link https://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.serialize - * @link https://www.php.net/serialize - * - * @return array - */ - public function __serialize(): array - { - return $this->data; - } - - /** - * Converts a serialized string representation into an instance object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.unserialize.php Serializable::unserialize() - * - * @param string $serialized A PHP serialized string to unserialize. - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, ['allowed_classes' => false]); - - $this->data = $data; - } - - /** - * Adds unserialized data to the object. - * - * @param array $data - */ - public function __unserialize(array $data): void - { - $this->data = $data; - } - - /** - * Returns the number of items in this array. - * - * @link http://php.net/manual/en/countable.count.php Countable::count() - */ - public function count(): int - { - return count($this->data); - } - - public function clear(): void - { - $this->data = []; - } - - /** - * @inheritDoc - */ - public function toArray(): array - { - return $this->data; - } - - public function isEmpty(): bool - { - return count($this->data) === 0; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractCollection.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractCollection.php deleted file mode 100644 index 38ef7144..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractCollection.php +++ /dev/null @@ -1,341 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Closure; -use Ramsey\Collection\Exception\CollectionMismatchException; -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\InvalidSortOrderException; -use Ramsey\Collection\Exception\OutOfBoundsException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueExtractorTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -use function array_filter; -use function array_map; -use function array_merge; -use function array_search; -use function array_udiff; -use function array_uintersect; -use function current; -use function end; -use function in_array; -use function is_int; -use function is_object; -use function reset; -use function spl_object_id; -use function sprintf; -use function unserialize; -use function usort; - -/** - * This class provides a basic implementation of `CollectionInterface`, to - * minimize the effort required to implement this interface - * - * @template T - * @extends AbstractArray - * @implements CollectionInterface - */ -abstract class AbstractCollection extends AbstractArray implements CollectionInterface -{ - use TypeTrait; - use ValueToStringTrait; - use ValueExtractorTrait; - - /** - * @inheritDoc - */ - public function add($element): bool - { - $this[] = $element; - - return true; - } - - /** - * @inheritDoc - */ - public function contains($element, bool $strict = true): bool - { - return in_array($element, $this->data, $strict); - } - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($this->checkType($this->getType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($value), - ); - } - - if ($offset === null) { - $this->data[] = $value; - } else { - $this->data[$offset] = $value; - } - } - - /** - * @inheritDoc - */ - public function remove($element): bool - { - if (($position = array_search($element, $this->data, true)) !== false) { - unset($this[$position]); - - return true; - } - - return false; - } - - /** - * @inheritDoc - */ - public function column(string $propertyOrMethod): array - { - $temp = []; - - foreach ($this->data as $item) { - /** @var mixed $value */ - $value = $this->extractValue($item, $propertyOrMethod); - - /** @psalm-suppress MixedAssignment */ - $temp[] = $value; - } - - return $temp; - } - - /** - * @inheritDoc - */ - public function first() - { - if ($this->isEmpty()) { - throw new OutOfBoundsException('Can\'t determine first item. Collection is empty'); - } - - reset($this->data); - - /** @var T $first */ - $first = current($this->data); - - return $first; - } - - /** - * @inheritDoc - */ - public function last() - { - if ($this->isEmpty()) { - throw new OutOfBoundsException('Can\'t determine last item. Collection is empty'); - } - - /** @var T $item */ - $item = end($this->data); - reset($this->data); - - return $item; - } - - public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): CollectionInterface - { - if (!in_array($order, [self::SORT_ASC, self::SORT_DESC], true)) { - throw new InvalidSortOrderException('Invalid sort order given: ' . $order); - } - - $collection = clone $this; - - usort( - $collection->data, - /** - * @param T $a - * @param T $b - */ - function ($a, $b) use ($propertyOrMethod, $order): int { - /** @var mixed $aValue */ - $aValue = $this->extractValue($a, $propertyOrMethod); - - /** @var mixed $bValue */ - $bValue = $this->extractValue($b, $propertyOrMethod); - - return ($aValue <=> $bValue) * ($order === self::SORT_DESC ? -1 : 1); - }, - ); - - return $collection; - } - - public function filter(callable $callback): CollectionInterface - { - $collection = clone $this; - $collection->data = array_merge([], array_filter($collection->data, $callback)); - - return $collection; - } - - /** - * {@inheritdoc} - */ - public function where(string $propertyOrMethod, $value): CollectionInterface - { - return $this->filter(function ($item) use ($propertyOrMethod, $value) { - /** @var mixed $accessorValue */ - $accessorValue = $this->extractValue($item, $propertyOrMethod); - - return $accessorValue === $value; - }); - } - - public function map(callable $callback): CollectionInterface - { - return new Collection('mixed', array_map($callback, $this->data)); - } - - public function diff(CollectionInterface $other): CollectionInterface - { - $this->compareCollectionTypes($other); - - $diffAtoB = array_udiff($this->data, $other->toArray(), $this->getComparator()); - $diffBtoA = array_udiff($other->toArray(), $this->data, $this->getComparator()); - - /** @var array $diff */ - $diff = array_merge($diffAtoB, $diffBtoA); - - $collection = clone $this; - $collection->data = $diff; - - return $collection; - } - - public function intersect(CollectionInterface $other): CollectionInterface - { - $this->compareCollectionTypes($other); - - /** @var array $intersect */ - $intersect = array_uintersect($this->data, $other->toArray(), $this->getComparator()); - - $collection = clone $this; - $collection->data = $intersect; - - return $collection; - } - - public function merge(CollectionInterface ...$collections): CollectionInterface - { - $mergedCollection = clone $this; - - foreach ($collections as $index => $collection) { - if (!$collection instanceof static) { - throw new CollectionMismatchException( - sprintf('Collection with index %d must be of type %s', $index, static::class), - ); - } - - // When using generics (Collection.php, Set.php, etc), - // we also need to make sure that the internal types match each other - if ($this->getUniformType($collection) !== $this->getUniformType($this)) { - throw new CollectionMismatchException( - sprintf( - 'Collection items in collection with index %d must be of type %s', - $index, - $this->getType(), - ), - ); - } - - foreach ($collection as $key => $value) { - if (is_int($key)) { - $mergedCollection[] = $value; - } else { - $mergedCollection[$key] = $value; - } - } - } - - return $mergedCollection; - } - - /** - * @inheritDoc - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, ['allowed_classes' => [$this->getType()]]); - - $this->data = $data; - } - - /** - * @param CollectionInterface $other - */ - private function compareCollectionTypes(CollectionInterface $other): void - { - if (!$other instanceof static) { - throw new CollectionMismatchException('Collection must be of type ' . static::class); - } - - // When using generics (Collection.php, Set.php, etc), - // we also need to make sure that the internal types match each other - if ($this->getUniformType($other) !== $this->getUniformType($this)) { - throw new CollectionMismatchException('Collection items must be of type ' . $this->getType()); - } - } - - private function getComparator(): Closure - { - return /** - * @param T $a - * @param T $b - */ - function ($a, $b): int { - // If the two values are object, we convert them to unique scalars. - // If the collection contains mixed values (unlikely) where some are objects - // and some are not, we leave them as they are. - // The comparator should still work and the result of $a < $b should - // be consistent but unpredictable since not documented. - if (is_object($a) && is_object($b)) { - $a = spl_object_id($a); - $b = spl_object_id($b); - } - - return $a === $b ? 0 : ($a < $b ? 1 : -1); - }; - } - - /** - * @param CollectionInterface $collection - */ - private function getUniformType(CollectionInterface $collection): string - { - switch ($collection->getType()) { - case 'integer': - return 'int'; - case 'boolean': - return 'bool'; - case 'double': - return 'float'; - default: - return $collection->getType(); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractSet.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractSet.php deleted file mode 100644 index 1126ccb0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/AbstractSet.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * This class contains the basic implementation of a collection that does not - * allow duplicated values (a set), to minimize the effort required to implement - * this specific type of collection. - * - * @template T - * @extends AbstractCollection - */ -abstract class AbstractSet extends AbstractCollection -{ - /** - * @inheritDoc - */ - public function add($element): bool - { - if ($this->contains($element)) { - return false; - } - - return parent::add($element); - } - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($this->contains($value)) { - return; - } - - parent::offsetSet($offset, $value); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/ArrayInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/ArrayInterface.php deleted file mode 100644 index 27af6102..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/ArrayInterface.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use ArrayAccess; -use Countable; -use IteratorAggregate; -use Serializable; - -/** - * `ArrayInterface` provides traversable array functionality to data types. - * - * @template T - * @extends ArrayAccess - * @extends IteratorAggregate - */ -interface ArrayInterface extends - ArrayAccess, - Countable, - IteratorAggregate, - Serializable -{ - /** - * Removes all items from this array. - */ - public function clear(): void; - - /** - * Returns a native PHP array representation of this array object. - * - * @return array - */ - public function toArray(): array; - - /** - * Returns `true` if this array is empty. - */ - public function isEmpty(): bool; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Collection.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Collection.php deleted file mode 100644 index 532b971b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Collection.php +++ /dev/null @@ -1,104 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * A collection represents a group of objects. - * - * Each object in the collection is of a specific, defined type. - * - * This is a direct implementation of `CollectionInterface`, provided for - * the sake of convenience. - * - * Example usage: - * - * ``` php - * $collection = new \Ramsey\Collection\Collection('My\\Foo'); - * $collection->add(new \My\Foo()); - * $collection->add(new \My\Foo()); - * - * foreach ($collection as $foo) { - * // Do something with $foo - * } - * ``` - * - * It is preferable to subclass `AbstractCollection` to create your own typed - * collections. For example: - * - * ``` php - * namespace My\Foo; - * - * class FooCollection extends \Ramsey\Collection\AbstractCollection - * { - * public function getType() - * { - * return 'My\\Foo'; - * } - * } - * ``` - * - * And then use it similarly to the earlier example: - * - * ``` php - * $fooCollection = new \My\Foo\FooCollection(); - * $fooCollection->add(new \My\Foo()); - * $fooCollection->add(new \My\Foo()); - * - * foreach ($fooCollection as $foo) { - * // Do something with $foo - * } - * ``` - * - * The benefit with this approach is that you may do type-checking on the - * collection object: - * - * ``` php - * if ($collection instanceof \My\Foo\FooCollection) { - * // the collection is a collection of My\Foo objects - * } - * ``` - * - * @template T - * @extends AbstractCollection - */ -class Collection extends AbstractCollection -{ - /** - * The type of elements stored in this collection. - * - * A collection's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $collectionType; - - /** - * Constructs a collection object of the specified type, optionally with the - * specified data. - * - * @param string $collectionType The type (FQCN) associated with this - * collection. - * @param array $data The initial items to store in the collection. - */ - public function __construct(string $collectionType, array $data = []) - { - $this->collectionType = $collectionType; - parent::__construct($data); - } - - public function getType(): string - { - return $this->collectionType; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/CollectionInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/CollectionInterface.php deleted file mode 100644 index 9f86a283..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/CollectionInterface.php +++ /dev/null @@ -1,206 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * A collection represents a group of objects, known as its elements. - * - * Some collections allow duplicate elements and others do not. Some are ordered - * and others unordered. - * - * @template T - * @extends ArrayInterface - */ -interface CollectionInterface extends ArrayInterface -{ - /** - * Ascending sort type. - */ - public const SORT_ASC = 'asc'; - - /** - * Descending sort type. - */ - public const SORT_DESC = 'desc'; - - /** - * Ensures that this collection contains the specified element (optional - * operation). - * - * Returns `true` if this collection changed as a result of the call. - * (Returns `false` if this collection does not permit duplicates and - * already contains the specified element.) - * - * Collections that support this operation may place limitations on what - * elements may be added to this collection. In particular, some - * collections will refuse to add `null` elements, and others will impose - * restrictions on the type of elements that may be added. Collection - * classes should clearly specify in their documentation any restrictions - * on what elements may be added. - * - * If a collection refuses to add a particular element for any reason other - * than that it already contains the element, it must throw an exception - * (rather than returning `false`). This preserves the invariant that a - * collection always contains the specified element after this call returns. - * - * @param T $element The element to add to the collection. - * - * @return bool `true` if this collection changed as a result of the call. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function add($element): bool; - - /** - * Returns `true` if this collection contains the specified element. - * - * @param T $element The element to check whether the collection contains. - * @param bool $strict Whether to perform a strict type check on the value. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function contains($element, bool $strict = true): bool; - - /** - * Returns the type associated with this collection. - */ - public function getType(): string; - - /** - * Removes a single instance of the specified element from this collection, - * if it is present. - * - * @param T $element The element to remove from the collection. - * - * @return bool `true` if an element was removed as a result of this call. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function remove($element): bool; - - /** - * Returns the values from the given property or method. - * - * @param string $propertyOrMethod The property or method name to filter by. - * - * @return list - */ - public function column(string $propertyOrMethod): array; - - /** - * Returns the first item of the collection. - * - * @return T - */ - public function first(); - - /** - * Returns the last item of the collection. - * - * @return T - */ - public function last(); - - /** - * Sort the collection by a property or method with the given sort order. - * - * This will always leave the original collection untouched and will return - * a new one. - * - * @param string $propertyOrMethod The property or method to sort by. - * @param string $order The sort order for the resulting collection (one of - * this interface's `SORT_*` constants). - * - * @return CollectionInterface - */ - public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): self; - - /** - * Filter out items of the collection which don't match the criteria of - * given callback. - * - * This will always leave the original collection untouched and will return - * a new one. - * - * See the {@link http://php.net/manual/en/function.array-filter.php PHP array_filter() documentation} - * for examples of how the `$callback` parameter works. - * - * @param callable(T):bool $callback A callable to use for filtering elements. - * - * @return CollectionInterface - */ - public function filter(callable $callback): self; - - /** - * Create a new collection where items match the criteria of given callback. - * - * This will always leave the original collection untouched and will return - * a new one. - * - * @param string $propertyOrMethod The property or method to evaluate. - * @param mixed $value The value to match. - * - * @return CollectionInterface - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function where(string $propertyOrMethod, $value): self; - - /** - * Apply a given callback method on each item of the collection. - * - * This will always leave the original collection untouched. The new - * collection is created by mapping the callback to each item of the - * original collection. - * - * See the {@link http://php.net/manual/en/function.array-map.php PHP array_map() documentation} - * for examples of how the `$callback` parameter works. - * - * @param callable(T):TCallbackReturn $callback A callable to apply to each - * item of the collection. - * - * @return CollectionInterface - * - * @template TCallbackReturn - */ - public function map(callable $callback): self; - - /** - * Create a new collection with divergent items between current and given - * collection. - * - * @param CollectionInterface $other The collection to check for divergent - * items. - * - * @return CollectionInterface - */ - public function diff(CollectionInterface $other): self; - - /** - * Create a new collection with intersecting item between current and given - * collection. - * - * @param CollectionInterface $other The collection to check for - * intersecting items. - * - * @return CollectionInterface - */ - public function intersect(CollectionInterface $other): self; - - /** - * Merge current items and items of given collections into a new one. - * - * @param CollectionInterface ...$collections The collections to merge. - * - * @return CollectionInterface - */ - public function merge(CollectionInterface ...$collections): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/DoubleEndedQueue.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/DoubleEndedQueue.php deleted file mode 100644 index 4d1f71ea..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/DoubleEndedQueue.php +++ /dev/null @@ -1,187 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\NoSuchElementException; - -/** - * This class provides a basic implementation of `DoubleEndedQueueInterface`, to - * minimize the effort required to implement this interface. - * - * @template T - * @extends Queue - * @implements DoubleEndedQueueInterface - */ -class DoubleEndedQueue extends Queue implements DoubleEndedQueueInterface -{ - /** - * Index of the last element in the queue. - */ - private int $tail = -1; - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($this->checkType($this->getType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($value), - ); - } - - $this->tail++; - - $this->data[$this->tail] = $value; - } - - /** - * @throws InvalidArgumentException if $element is of the wrong type - * - * @inheritDoc - */ - public function addFirst($element): bool - { - if ($this->checkType($this->getType(), $element) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($element), - ); - } - - $this->index--; - - $this->data[$this->index] = $element; - - return true; - } - - /** - * @inheritDoc - */ - public function addLast($element): bool - { - return $this->add($element); - } - - /** - * @inheritDoc - */ - public function offerFirst($element): bool - { - try { - return $this->addFirst($element); - } catch (InvalidArgumentException $e) { - return false; - } - } - - /** - * @inheritDoc - */ - public function offerLast($element): bool - { - return $this->offer($element); - } - - /** - * @inheritDoc - */ - public function removeFirst() - { - return $this->remove(); - } - - /** - * @inheritDoc - */ - public function removeLast() - { - $tail = $this->pollLast(); - - if ($tail === null) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $tail; - } - - /** - * @inheritDoc - */ - public function pollFirst() - { - return $this->poll(); - } - - /** - * @inheritDoc - */ - public function pollLast() - { - if ($this->count() === 0) { - return null; - } - - $tail = $this[$this->tail]; - - unset($this[$this->tail]); - $this->tail--; - - return $tail; - } - - /** - * @inheritDoc - */ - public function firstElement() - { - return $this->element(); - } - - /** - * @inheritDoc - */ - public function lastElement() - { - if ($this->count() === 0) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $this->data[$this->tail]; - } - - /** - * @inheritDoc - */ - public function peekFirst() - { - return $this->peek(); - } - - /** - * @inheritDoc - */ - public function peekLast() - { - if ($this->count() === 0) { - return null; - } - - return $this->data[$this->tail]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/DoubleEndedQueueInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/DoubleEndedQueueInterface.php deleted file mode 100644 index 3fa4ecab..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/DoubleEndedQueueInterface.php +++ /dev/null @@ -1,317 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\NoSuchElementException; -use RuntimeException; - -/** - * A linear collection that supports element insertion and removal at both ends. - * - * Most `DoubleEndedQueueInterface` implementations place no fixed limits on the - * number of elements they may contain, but this interface supports - * capacity-restricted double-ended queues as well as those with no fixed size - * limit. - * - * This interface defines methods to access the elements at both ends of the - * double-ended queue. Methods are provided to insert, remove, and examine the - * element. Each of these methods exists in two forms: one throws an exception - * if the operation fails, the other returns a special value (either `null` or - * `false`, depending on the operation). The latter form of the insert operation - * is designed specifically for use with capacity-restricted implementations; in - * most implementations, insert operations cannot fail. - * - * The twelve methods described above are summarized in the following table: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
          Summary of DoubleEndedQueueInterface methods
          First Element (Head)Last Element (Tail)
          Throws exceptionSpecial valueThrows exceptionSpecial value
          InsertaddFirst()offerFirst()addLast()offerLast()
          RemoveremoveFirst()pollFirst()removeLast()pollLast()
          ExaminefirstElement()peekFirst()lastElement()peekLast()
          - * - * This interface extends the `QueueInterface`. When a double-ended queue is - * used as a queue, FIFO (first-in-first-out) behavior results. Elements are - * added at the end of the double-ended queue and removed from the beginning. - * The methods inherited from the `QueueInterface` are precisely equivalent to - * `DoubleEndedQueueInterface` methods as indicated in the following table: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
          Comparison of QueueInterface and DoubleEndedQueueInterface methods
          QueueInterface MethodDoubleEndedQueueInterface Method
          add()addLast()
          offer()offerLast()
          remove()removeFirst()
          poll()pollFirst()
          element()firstElement()
          peek()peekFirst()
          - * - * Double-ended queues can also be used as LIFO (last-in-first-out) stacks. When - * a double-ended queue is used as a stack, elements are pushed and popped from - * the beginning of the double-ended queue. Stack concepts are precisely - * equivalent to `DoubleEndedQueueInterface` methods as indicated in the table - * below: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
          Comparison of stack concepts and DoubleEndedQueueInterface methods
          Stack conceptDoubleEndedQueueInterface Method
          pushaddFirst()
          popremoveFirst()
          peekpeekFirst()
          - * - * Note that the `peek()` method works equally well when a double-ended queue is - * used as a queue or a stack; in either case, elements are drawn from the - * beginning of the double-ended queue. - * - * While `DoubleEndedQueueInterface` implementations are not strictly required - * to prohibit the insertion of `null` elements, they are strongly encouraged to - * do so. Users of any `DoubleEndedQueueInterface` implementations that do allow - * `null` elements are strongly encouraged *not* to take advantage of the - * ability to insert nulls. This is so because `null` is used as a special - * return value by various methods to indicated that the double-ended queue is - * empty. - * - * @template T - * @extends QueueInterface - */ -interface DoubleEndedQueueInterface extends QueueInterface -{ - /** - * Inserts the specified element at the front of this queue if it is - * possible to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted double-ended queue, it is generally - * preferable to use the `offerFirst()` method. - * - * @param T $element The element to add to the front of this queue. - * - * @return bool `true` if this queue changed as a result of the call. - * - * @throws RuntimeException if a queue refuses to add a particular element - * for any reason other than that it already contains the element. - * Implementations should use a more-specific exception that extends - * `\RuntimeException`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function addFirst($element): bool; - - /** - * Inserts the specified element at the end of this queue if it is possible - * to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted double-ended queue, it is generally - * preferable to use the `offerLast()` method. - * - * This method is equivalent to `add()`. - * - * @param T $element The element to add to the end of this queue. - * - * @return bool `true` if this queue changed as a result of the call. - * - * @throws RuntimeException if a queue refuses to add a particular element - * for any reason other than that it already contains the element. - * Implementations should use a more-specific exception that extends - * `\RuntimeException`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function addLast($element): bool; - - /** - * Inserts the specified element at the front of this queue if it is - * possible to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted queue, this method is generally - * preferable to `addFirst()`, which can fail to insert an element only by - * throwing an exception. - * - * @param T $element The element to add to the front of this queue. - * - * @return bool `true` if the element was added to this queue, else `false`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offerFirst($element): bool; - - /** - * Inserts the specified element at the end of this queue if it is possible - * to do so immediately without violating capacity restrictions. - * - * When using a capacity-restricted queue, this method is generally - * preferable to `addLast()` which can fail to insert an element only by - * throwing an exception. - * - * @param T $element The element to add to the end of this queue. - * - * @return bool `true` if the element was added to this queue, else `false`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offerLast($element): bool; - - /** - * Retrieves and removes the head of this queue. - * - * This method differs from `pollFirst()` only in that it throws an - * exception if this queue is empty. - * - * @return T the first element in this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function removeFirst(); - - /** - * Retrieves and removes the tail of this queue. - * - * This method differs from `pollLast()` only in that it throws an exception - * if this queue is empty. - * - * @return T the last element in this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function removeLast(); - - /** - * Retrieves and removes the head of this queue, or returns `null` if this - * queue is empty. - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function pollFirst(); - - /** - * Retrieves and removes the tail of this queue, or returns `null` if this - * queue is empty. - * - * @return T|null the tail of this queue, or `null` if this queue is empty. - */ - public function pollLast(); - - /** - * Retrieves, but does not remove, the head of this queue. - * - * This method differs from `peekFirst()` only in that it throws an - * exception if this queue is empty. - * - * @return T the head of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function firstElement(); - - /** - * Retrieves, but does not remove, the tail of this queue. - * - * This method differs from `peekLast()` only in that it throws an exception - * if this queue is empty. - * - * @return T the tail of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function lastElement(); - - /** - * Retrieves, but does not remove, the head of this queue, or returns `null` - * if this queue is empty. - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function peekFirst(); - - /** - * Retrieves, but does not remove, the tail of this queue, or returns `null` - * if this queue is empty. - * - * @return T|null the tail of this queue, or `null` if this queue is empty. - */ - public function peekLast(); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/CollectionMismatchException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/CollectionMismatchException.php deleted file mode 100644 index 7058bcf6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/CollectionMismatchException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -use RuntimeException; - -/** - * Thrown when attempting to operate on collections of differing types. - */ -class CollectionMismatchException extends RuntimeException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/InvalidArgumentException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/InvalidArgumentException.php deleted file mode 100644 index dcc3eac6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown to indicate an argument is not of the expected type. - */ -class InvalidArgumentException extends \InvalidArgumentException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php deleted file mode 100644 index 4491429c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -use RuntimeException; - -/** - * Thrown when attempting to use a sort order that is not recognized. - */ -class InvalidSortOrderException extends RuntimeException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/NoSuchElementException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/NoSuchElementException.php deleted file mode 100644 index cabcb9d8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/NoSuchElementException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -use RuntimeException; - -/** - * Thrown when attempting to access an element that does not exist. - */ -class NoSuchElementException extends RuntimeException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/OutOfBoundsException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/OutOfBoundsException.php deleted file mode 100644 index 4e9d16fa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/OutOfBoundsException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -/** - * Thrown when attempting to access an element out of the range of the collection. - */ -class OutOfBoundsException extends \OutOfBoundsException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php deleted file mode 100644 index 9b622897..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -use RuntimeException; - -/** - * Thrown to indicate that the requested operation is not supported. - */ -class UnsupportedOperationException extends RuntimeException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/ValueExtractionException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/ValueExtractionException.php deleted file mode 100644 index 32f2a175..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Exception/ValueExtractionException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Exception; - -use RuntimeException; - -/** - * Thrown when attempting to extract a value for a method or property that does not exist. - */ -class ValueExtractionException extends RuntimeException -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/GenericArray.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/GenericArray.php deleted file mode 100644 index 2b079aa5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/GenericArray.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * `GenericArray` represents a standard array object. - * - * @extends AbstractArray - */ -class GenericArray extends AbstractArray -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AbstractMap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AbstractMap.php deleted file mode 100644 index 37880728..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AbstractMap.php +++ /dev/null @@ -1,163 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\AbstractArray; -use Ramsey\Collection\Exception\InvalidArgumentException; - -use function array_key_exists; -use function array_keys; -use function in_array; -use function var_export; - -/** - * This class provides a basic implementation of `MapInterface`, to minimize the - * effort required to implement this interface. - * - * @template T - * @extends AbstractArray - * @implements MapInterface - */ -abstract class AbstractMap extends AbstractArray implements MapInterface -{ - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true), - ); - } - - $this->data[$offset] = $value; - } - - /** - * @inheritDoc - */ - public function containsKey($key): bool - { - return array_key_exists($key, $this->data); - } - - /** - * @inheritDoc - */ - public function containsValue($value): bool - { - return in_array($value, $this->data, true); - } - - /** - * @inheritDoc - */ - public function keys(): array - { - return array_keys($this->data); - } - - /** - * @inheritDoc - */ - public function get($key, $defaultValue = null) - { - if (!$this->containsKey($key)) { - return $defaultValue; - } - - return $this[$key]; - } - - /** - * @inheritDoc - */ - public function put($key, $value) - { - $previousValue = $this->get($key); - $this[$key] = $value; - - return $previousValue; - } - - /** - * @inheritDoc - */ - public function putIfAbsent($key, $value) - { - $currentValue = $this->get($key); - - if ($currentValue === null) { - $this[$key] = $value; - } - - return $currentValue; - } - - /** - * @inheritDoc - */ - public function remove($key) - { - $previousValue = $this->get($key); - unset($this[$key]); - - return $previousValue; - } - - /** - * @inheritDoc - */ - public function removeIf($key, $value): bool - { - if ($this->get($key) === $value) { - unset($this[$key]); - - return true; - } - - return false; - } - - /** - * @inheritDoc - */ - public function replace($key, $value) - { - $currentValue = $this->get($key); - - if ($this->containsKey($key)) { - $this[$key] = $value; - } - - return $currentValue; - } - - /** - * @inheritDoc - */ - public function replaceIf($key, $oldValue, $newValue): bool - { - if ($this->get($key) === $oldValue) { - $this[$key] = $newValue; - - return true; - } - - return false; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AbstractTypedMap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AbstractTypedMap.php deleted file mode 100644 index 486dc2e2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AbstractTypedMap.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -use function var_export; - -/** - * This class provides a basic implementation of `TypedMapInterface`, to - * minimize the effort required to implement this interface. - * - * @template K of array-key - * @template T - * @extends AbstractMap - * @implements TypedMapInterface - */ -abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface -{ - use TypeTrait; - use ValueToStringTrait; - - /** - * @param K|null $offset - * @param T $value - * - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true), - ); - } - - if ($this->checkType($this->getKeyType(), $offset) === false) { - throw new InvalidArgumentException( - 'Key must be of type ' . $this->getKeyType() . '; key is ' - . $this->toolValueToString($offset), - ); - } - - if ($this->checkType($this->getValueType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getValueType() . '; value is ' - . $this->toolValueToString($value), - ); - } - - parent::offsetSet($offset, $value); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AssociativeArrayMap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AssociativeArrayMap.php deleted file mode 100644 index 79a314d9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/AssociativeArrayMap.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -/** - * `AssociativeArrayMap` represents a standard associative array object. - * - * @template T - * @extends AbstractMap - */ -class AssociativeArrayMap extends AbstractMap -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/MapInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/MapInterface.php deleted file mode 100644 index 6ed0b296..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/MapInterface.php +++ /dev/null @@ -1,149 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\ArrayInterface; - -/** - * An object that maps keys to values. - * - * A map cannot contain duplicate keys; each key can map to at most one value. - * - * @template T - * @extends ArrayInterface - */ -interface MapInterface extends ArrayInterface -{ - /** - * Returns `true` if this map contains a mapping for the specified key. - * - * @param array-key $key The key to check in the map. - */ - public function containsKey($key): bool; - - /** - * Returns `true` if this map maps one or more keys to the specified value. - * - * This performs a strict type check on the value. - * - * @param T $value The value to check in the map. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function containsValue($value): bool; - - /** - * Return an array of the keys contained in this map. - * - * @return list - */ - public function keys(): array; - - /** - * Returns the value to which the specified key is mapped, `null` if this - * map contains no mapping for the key, or (optionally) `$defaultValue` if - * this map contains no mapping for the key. - * - * @param array-key $key The key to return from the map. - * @param T|null $defaultValue The default value to use if `$key` is not found. - * - * @return T|null the value or `null` if the key could not be found. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function get($key, $defaultValue = null); - - /** - * Associates the specified value with the specified key in this map. - * - * If the map previously contained a mapping for the key, the old value is - * replaced by the specified value. - * - * @param array-key $key The key to put or replace in the map. - * @param T $value The value to store at `$key`. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function put($key, $value); - - /** - * Associates the specified value with the specified key in this map only if - * it is not already set. - * - * If there is already a value associated with `$key`, this returns that - * value without replacing it. - * - * @param array-key $key The key to put in the map. - * @param T $value The value to store at `$key`. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function putIfAbsent($key, $value); - - /** - * Removes the mapping for a key from this map if it is present. - * - * @param array-key $key The key to remove from the map. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function remove($key); - - /** - * Removes the entry for the specified key only if it is currently mapped to - * the specified value. - * - * This performs a strict type check on the value. - * - * @param array-key $key The key to remove from the map. - * @param T $value The value to match. - * - * @return bool true if the value was removed. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function removeIf($key, $value): bool; - - /** - * Replaces the entry for the specified key only if it is currently mapped - * to some value. - * - * @param array-key $key The key to replace. - * @param T $value The value to set at `$key`. - * - * @return T|null the previous value associated with key, or `null` if - * there was no mapping for `$key`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function replace($key, $value); - - /** - * Replaces the entry for the specified key only if currently mapped to the - * specified value. - * - * This performs a strict type check on the value. - * - * @param array-key $key The key to remove from the map. - * @param T $oldValue The value to match. - * @param T $newValue The value to use as a replacement. - * - * @return bool true if the value was replaced. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function replaceIf($key, $oldValue, $newValue): bool; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/NamedParameterMap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/NamedParameterMap.php deleted file mode 100644 index 6e391e97..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/NamedParameterMap.php +++ /dev/null @@ -1,121 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -use function array_combine; -use function array_key_exists; -use function is_int; -use function var_export; - -/** - * `NamedParameterMap` represents a mapping of values to a set of named keys - * that may optionally be typed - * - * @extends AbstractMap - */ -class NamedParameterMap extends AbstractMap -{ - use TypeTrait; - use ValueToStringTrait; - - /** - * Named parameters defined for this map. - * - * @var array - */ - protected array $namedParameters; - - /** - * Constructs a new `NamedParameterMap`. - * - * @param array $namedParameters The named parameters defined for this map. - * @param array $data An initial set of data to set on this map. - */ - public function __construct(array $namedParameters, array $data = []) - { - $this->namedParameters = $this->filterNamedParameters($namedParameters); - parent::__construct($data); - } - - /** - * Returns named parameters set for this `NamedParameterMap`. - * - * @return array - */ - public function getNamedParameters(): array - { - return $this->namedParameters; - } - - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void - { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true), - ); - } - - if (!array_key_exists($offset, $this->namedParameters)) { - throw new InvalidArgumentException( - 'Attempting to set value for unconfigured parameter \'' - . $offset . '\'', - ); - } - - if ($this->checkType($this->namedParameters[$offset], $value) === false) { - throw new InvalidArgumentException( - 'Value for \'' . $offset . '\' must be of type ' - . $this->namedParameters[$offset] . '; value is ' - . $this->toolValueToString($value), - ); - } - - $this->data[$offset] = $value; - } - - /** - * Given an array of named parameters, constructs a proper mapping of - * named parameters to types. - * - * @param array $namedParameters The named parameters to filter. - * - * @return array - */ - protected function filterNamedParameters(array $namedParameters): array - { - $names = []; - $types = []; - - foreach ($namedParameters as $key => $value) { - if (is_int($key)) { - $names[] = $value; - $types[] = 'mixed'; - } else { - $names[] = $key; - $types[] = $value; - } - } - - return array_combine($names, $types) ?: []; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/TypedMap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/TypedMap.php deleted file mode 100644 index 77ef8d31..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/TypedMap.php +++ /dev/null @@ -1,132 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -use Ramsey\Collection\Tool\TypeTrait; - -/** - * A `TypedMap` represents a map of elements where key and value are typed. - * - * Each element is identified by a key with defined type and a value of defined - * type. The keys of the map must be unique. The values on the map can be - * repeated but each with its own different key. - * - * The most common case is to use a string type key, but it's not limited to - * this type of keys. - * - * This is a direct implementation of `TypedMapInterface`, provided for the sake - * of convenience. - * - * Example usage: - * - * ```php - * $map = new TypedMap('string', Foo::class); - * $map['x'] = new Foo(); - * foreach ($map as $key => $value) { - * // do something with $key, it will be a Foo::class - * } - * - * // this will throw an exception since key must be string - * $map[10] = new Foo(); - * - * // this will throw an exception since value must be a Foo - * $map['bar'] = 'bar'; - * - * // initialize map with contents - * $map = new TypedMap('string', Foo::class, [ - * new Foo(), new Foo(), new Foo() - * ]); - * ``` - * - * It is preferable to subclass `AbstractTypedMap` to create your own typed map - * implementation: - * - * ```php - * class FooTypedMap extends AbstractTypedMap - * { - * public function getKeyType() - * { - * return 'int'; - * } - * - * public function getValueType() - * { - * return Foo::class; - * } - * } - * ``` - * - * … but you also may use the `TypedMap` class: - * - * ```php - * class FooTypedMap extends TypedMap - * { - * public function __constructor(array $data = []) - * { - * parent::__construct('int', Foo::class, $data); - * } - * } - * ``` - * - * @template K of array-key - * @template T - * @extends AbstractTypedMap - */ -class TypedMap extends AbstractTypedMap -{ - use TypeTrait; - - /** - * The data type of keys stored in this collection. - * - * A map key's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $keyType; - - /** - * The data type of values stored in this collection. - * - * A map value's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $valueType; - - /** - * Constructs a map object of the specified key and value types, - * optionally with the specified data. - * - * @param string $keyType The data type of the map's keys. - * @param string $valueType The data type of the map's values. - * @param array $data The initial data to set for this map. - */ - public function __construct(string $keyType, string $valueType, array $data = []) - { - $this->keyType = $keyType; - $this->valueType = $valueType; - - parent::__construct($data); - } - - public function getKeyType(): string - { - return $this->keyType; - } - - public function getValueType(): string - { - return $this->valueType; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/TypedMapInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/TypedMapInterface.php deleted file mode 100644 index 0308109c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Map/TypedMapInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Map; - -/** - * A `TypedMapInterface` represents a map of elements where key and value are - * typed. - * - * @template T - * @extends MapInterface - */ -interface TypedMapInterface extends MapInterface -{ - /** - * Return the type used on the key. - */ - public function getKeyType(): string; - - /** - * Return the type forced on the values. - */ - public function getValueType(): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Queue.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Queue.php deleted file mode 100644 index bc8c24e1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Queue.php +++ /dev/null @@ -1,169 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\NoSuchElementException; -use Ramsey\Collection\Tool\TypeTrait; -use Ramsey\Collection\Tool\ValueToStringTrait; - -/** - * This class provides a basic implementation of `QueueInterface`, to minimize - * the effort required to implement this interface. - * - * @template T - * @extends AbstractArray - * @implements QueueInterface - */ -class Queue extends AbstractArray implements QueueInterface -{ - use TypeTrait; - use ValueToStringTrait; - - /** - * The type of elements stored in this queue. - * - * A queue's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $queueType; - - /** - * The index of the head of the queue. - */ - protected int $index = 0; - - /** - * Constructs a queue object of the specified type, optionally with the - * specified data. - * - * @param string $queueType The type (FQCN) associated with this queue. - * @param array $data The initial items to store in the collection. - */ - public function __construct(string $queueType, array $data = []) - { - $this->queueType = $queueType; - parent::__construct($data); - } - - /** - * {@inheritDoc} - * - * Since arbitrary offsets may not be manipulated in a queue, this method - * serves only to fulfill the `ArrayAccess` interface requirements. It is - * invoked by other operations when adding values to the queue. - * - * @throws InvalidArgumentException if $value is of the wrong type - */ - public function offsetSet($offset, $value): void - { - if ($this->checkType($this->getType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($value), - ); - } - - $this->data[] = $value; - } - - /** - * @throws InvalidArgumentException if $value is of the wrong type - * - * @inheritDoc - */ - public function add($element): bool - { - $this[] = $element; - - return true; - } - - /** - * @inheritDoc - */ - public function element() - { - $element = $this->peek(); - - if ($element === null) { - throw new NoSuchElementException( - 'Can\'t return element from Queue. Queue is empty.', - ); - } - - return $element; - } - - /** - * @inheritDoc - */ - public function offer($element): bool - { - try { - return $this->add($element); - } catch (InvalidArgumentException $e) { - return false; - } - } - - /** - * @inheritDoc - */ - public function peek() - { - if ($this->count() === 0) { - return null; - } - - return $this[$this->index]; - } - - /** - * @inheritDoc - */ - public function poll() - { - if ($this->count() === 0) { - return null; - } - - $head = $this[$this->index]; - - unset($this[$this->index]); - $this->index++; - - return $head; - } - - /** - * @inheritDoc - */ - public function remove() - { - $head = $this->poll(); - - if ($head === null) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $head; - } - - public function getType(): string - { - return $this->queueType; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/QueueInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/QueueInterface.php deleted file mode 100644 index 4f91487f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/QueueInterface.php +++ /dev/null @@ -1,204 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -use Ramsey\Collection\Exception\NoSuchElementException; -use RuntimeException; - -/** - * A queue is a collection in which the entities in the collection are kept in - * order. - * - * The principal operations on the queue are the addition of entities to the end - * (tail), also known as *enqueue*, and removal of entities from the front - * (head), also known as *dequeue*. This makes the queue a first-in-first-out - * (FIFO) data structure. - * - * Besides basic array operations, queues provide additional insertion, - * extraction, and inspection operations. Each of these methods exists in two - * forms: one throws an exception if the operation fails, the other returns a - * special value (either `null` or `false`, depending on the operation). The - * latter form of the insert operation is designed specifically for use with - * capacity-restricted `QueueInterface` implementations; in most - * implementations, insert operations cannot fail. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
          Summary of QueueInterface methods
          Throws exceptionReturns special value
          Insertadd()offer()
          Removeremove()poll()
          Examineelement()peek()
          - * - * Queues typically, but do not necessarily, order elements in a FIFO - * (first-in-first-out) manner. Among the exceptions are priority queues, which - * order elements according to a supplied comparator, or the elements' natural - * ordering, and LIFO queues (or stacks) which order the elements LIFO - * (last-in-first-out). Whatever the ordering used, the head of the queue is - * that element which would be removed by a call to remove() or poll(). In a - * FIFO queue, all new elements are inserted at the tail of the queue. Other - * kinds of queues may use different placement rules. Every `QueueInterface` - * implementation must specify its ordering properties. - * - * The `offer()` method inserts an element if possible, otherwise returning - * `false`. This differs from the `add()` method, which can fail to add an - * element only by throwing an unchecked exception. The `offer()` method is - * designed for use when failure is a normal, rather than exceptional - * occurrence, for example, in fixed-capacity (or "bounded") queues. - * - * The `remove()` and `poll()` methods remove and return the head of the queue. - * Exactly which element is removed from the queue is a function of the queue's - * ordering policy, which differs from implementation to implementation. The - * `remove()` and `poll()` methods differ only in their behavior when the queue - * is empty: the `remove()` method throws an exception, while the `poll()` - * method returns `null`. - * - * The `element()` and `peek()` methods return, but do not remove, the head of - * the queue. - * - * `QueueInterface` implementations generally do not allow insertion of `null` - * elements, although some implementations do not prohibit insertion of `null`. - * Even in the implementations that permit it, `null` should not be inserted - * into a queue, as `null` is also used as a special return value by the - * `poll()` method to indicate that the queue contains no elements. - * - * @template T - * @extends ArrayInterface - */ -interface QueueInterface extends ArrayInterface -{ - /** - * Ensures that this queue contains the specified element (optional - * operation). - * - * Returns `true` if this queue changed as a result of the call. (Returns - * `false` if this queue does not permit duplicates and already contains the - * specified element.) - * - * Queues that support this operation may place limitations on what elements - * may be added to this queue. In particular, some queues will refuse to add - * `null` elements, and others will impose restrictions on the type of - * elements that may be added. Queue classes should clearly specify in their - * documentation any restrictions on what elements may be added. - * - * If a queue refuses to add a particular element for any reason other than - * that it already contains the element, it must throw an exception (rather - * than returning `false`). This preserves the invariant that a queue always - * contains the specified element after this call returns. - * - * @see self::offer() - * - * @param T $element The element to add to this queue. - * - * @return bool `true` if this queue changed as a result of the call. - * - * @throws RuntimeException if a queue refuses to add a particular element - * for any reason other than that it already contains the element. - * Implementations should use a more-specific exception that extends - * `\RuntimeException`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function add($element): bool; - - /** - * Retrieves, but does not remove, the head of this queue. - * - * This method differs from `peek()` only in that it throws an exception if - * this queue is empty. - * - * @see self::peek() - * - * @return T the head of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function element(); - - /** - * Inserts the specified element into this queue if it is possible to do so - * immediately without violating capacity restrictions. - * - * When using a capacity-restricted queue, this method is generally - * preferable to `add()`, which can fail to insert an element only by - * throwing an exception. - * - * @see self::add() - * - * @param T $element The element to add to this queue. - * - * @return bool `true` if the element was added to this queue, else `false`. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offer($element): bool; - - /** - * Retrieves, but does not remove, the head of this queue, or returns `null` - * if this queue is empty. - * - * @see self::element() - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function peek(); - - /** - * Retrieves and removes the head of this queue, or returns `null` - * if this queue is empty. - * - * @see self::remove() - * - * @return T|null the head of this queue, or `null` if this queue is empty. - */ - public function poll(); - - /** - * Retrieves and removes the head of this queue. - * - * This method differs from `poll()` only in that it throws an exception if - * this queue is empty. - * - * @see self::poll() - * - * @return T the head of this queue. - * - * @throws NoSuchElementException if this queue is empty. - */ - public function remove(); - - /** - * Returns the type associated with this queue. - */ - public function getType(): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Set.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Set.php deleted file mode 100644 index c1d37ccc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Set.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * A set is a collection that contains no duplicate elements. - * - * Great care must be exercised if mutable objects are used as set elements. - * The behavior of a set is not specified if the value of an object is changed - * in a manner that affects equals comparisons while the object is an element in - * the set. - * - * Example usage: - * - * ``` php - * $foo = new \My\Foo(); - * $set = new Set(\My\Foo::class); - * - * $set->add($foo); // returns TRUE, the element don't exists - * $set->add($foo); // returns FALSE, the element already exists - * - * $bar = new \My\Foo(); - * $set->add($bar); // returns TRUE, $bar !== $foo - * ``` - * - * @template T - * @extends AbstractSet - */ -class Set extends AbstractSet -{ - /** - * The type of elements stored in this set - * - * A set's type is immutable. For this reason, this property is private. - */ - private string $setType; - - /** - * Constructs a set object of the specified type, optionally with the - * specified data. - * - * @param string $setType The type (FQCN) associated with this set. - * @param array $data The initial items to store in the set. - */ - public function __construct(string $setType, array $data = []) - { - $this->setType = $setType; - parent::__construct($data); - } - - public function getType(): string - { - return $this->setType; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/TypeTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/TypeTrait.php deleted file mode 100644 index 728d44b6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/TypeTrait.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Tool; - -use function is_array; -use function is_bool; -use function is_callable; -use function is_float; -use function is_int; -use function is_numeric; -use function is_object; -use function is_resource; -use function is_scalar; -use function is_string; - -/** - * Provides functionality to check values for specific types. - */ -trait TypeTrait -{ - /** - * Returns `true` if value is of the specified type. - * - * @param string $type The type to check the value against. - * @param mixed $value The value to check. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - protected function checkType(string $type, $value): bool - { - switch ($type) { - case 'array': - return is_array($value); - case 'bool': - case 'boolean': - return is_bool($value); - case 'callable': - return is_callable($value); - case 'float': - case 'double': - return is_float($value); - case 'int': - case 'integer': - return is_int($value); - case 'null': - return $value === null; - case 'numeric': - return is_numeric($value); - case 'object': - return is_object($value); - case 'resource': - return is_resource($value); - case 'scalar': - return is_scalar($value); - case 'string': - return is_string($value); - case 'mixed': - return true; - default: - return $value instanceof $type; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php deleted file mode 100644 index e1082428..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Tool; - -use Ramsey\Collection\Exception\ValueExtractionException; - -use function get_class; -use function is_object; -use function method_exists; -use function property_exists; -use function sprintf; - -/** - * Provides functionality to extract the value of a property or method from an object. - */ -trait ValueExtractorTrait -{ - /** - * Extracts the value of the given property or method from the object. - * - * @param mixed $object The object to extract the value from. - * @param string $propertyOrMethod The property or method for which the - * value should be extracted. - * - * @return mixed the value extracted from the specified property or method. - * - * @throws ValueExtractionException if the method or property is not defined. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - protected function extractValue($object, string $propertyOrMethod) - { - if (!is_object($object)) { - throw new ValueExtractionException('Unable to extract a value from a non-object'); - } - - if (property_exists($object, $propertyOrMethod)) { - return $object->$propertyOrMethod; - } - - if (method_exists($object, $propertyOrMethod)) { - return $object->{$propertyOrMethod}(); - } - - throw new ValueExtractionException( - // phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall - sprintf('Method or property "%s" not defined in %s', $propertyOrMethod, get_class($object)), - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/ValueToStringTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/ValueToStringTrait.php deleted file mode 100644 index cacefc8b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/collection/src/Tool/ValueToStringTrait.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection\Tool; - -use DateTimeInterface; - -use function get_class; -use function get_resource_type; -use function is_array; -use function is_bool; -use function is_callable; -use function is_object; -use function is_resource; -use function is_scalar; -use function var_export; - -/** - * Provides functionality to express a value as string - */ -trait ValueToStringTrait -{ - /** - * Returns a string representation of the value. - * - * - null value: `'NULL'` - * - boolean: `'TRUE'`, `'FALSE'` - * - array: `'Array'` - * - scalar: converted-value - * - resource: `'(type resource #number)'` - * - object with `__toString()`: result of `__toString()` - * - object DateTime: ISO 8601 date - * - object: `'(className Object)'` - * - anonymous function: same as object - * - * @param mixed $value the value to return as a string. - */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - protected function toolValueToString($value): string - { - // null - if ($value === null) { - return 'NULL'; - } - - // boolean constants - if (is_bool($value)) { - return $value ? 'TRUE' : 'FALSE'; - } - - // array - if (is_array($value)) { - return 'Array'; - } - - // scalar types (integer, float, string) - if (is_scalar($value)) { - return (string) $value; - } - - // resource - if (is_resource($value)) { - return '(' . get_resource_type($value) . ' resource #' . (int) $value . ')'; - } - - // If we don't know what it is, use var_export(). - if (!is_object($value)) { - return '(' . var_export($value, true) . ')'; - } - - // From here, $value should be an object. - - // __toString() is implemented - if (is_callable([$value, '__toString'])) { - return (string) $value->__toString(); - } - - // object of type \DateTime - if ($value instanceof DateTimeInterface) { - return $value->format('c'); - } - - // unknown type - // phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall - return '(' . get_class($value) . ' Object)'; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/LICENSE deleted file mode 100644 index 5e06cf43..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2021 Ben Ramsey - -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/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/README.md deleted file mode 100644 index 97e81a50..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/README.md +++ /dev/null @@ -1,83 +0,0 @@ -

          ramsey/uuid

          - -

          - A PHP library for generating and working with UUIDs. -

          - -

          - Source Code - Download Package - PHP Programming Language - Read License - Build Status - Codecov Code Coverage - Psalm Type Coverage -

          - -ramsey/uuid is a PHP library for generating and working with universally unique -identifiers (UUIDs). - -This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). -By participating in this project and its community, you are expected to -uphold this code. - -Much inspiration for this library came from the [Java][javauuid] and -[Python][pyuuid] UUID libraries. - -## Installation - -The preferred method of installation is via [Composer][]. Run the following -command to install the package and add it as a requirement to your project's -`composer.json`: - -```bash -composer require ramsey/uuid -``` - -## Upgrading to Version 4 - -See the documentation for a thorough upgrade guide: - -* [Upgrading ramsey/uuid Version 3 to 4](https://uuid.ramsey.dev/en/latest/upgrading/3-to-4.html) - -## Documentation - -Please see for documentation, tips, examples, and -frequently asked questions. - -## Contributing - -Contributions are welcome! To contribute, please familiarize yourself with -[CONTRIBUTING.md](CONTRIBUTING.md). - -## Coordinated Disclosure - -Keeping user information safe and secure is a top priority, and we welcome the -contribution of external security researchers. If you believe you've found a -security issue in software that is maintained in this repository, please read -[SECURITY.md][] for instructions on submitting a vulnerability report. - -## ramsey/uuid for Enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of ramsey/uuid and thousands of other packages are working with -Tidelift to deliver commercial support and maintenance for the open source -packages you use to build your applications. Save time, reduce risk, and improve -code health, while paying the maintainers of the exact packages you use. -[Learn more.](https://tidelift.com/subscription/pkg/packagist-ramsey-uuid?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -## Copyright and License - -The ramsey/uuid library is copyright © [Ben Ramsey](https://benramsey.com/) and -licensed for use under the MIT License (MIT). Please see [LICENSE][] for more -information. - -[rfc4122]: http://tools.ietf.org/html/rfc4122 -[conduct]: https://github.com/ramsey/uuid/blob/main/CODE_OF_CONDUCT.md -[javauuid]: http://docs.oracle.com/javase/6/docs/api/java/util/UUID.html -[pyuuid]: http://docs.python.org/3/library/uuid.html -[composer]: http://getcomposer.org/ -[contributing.md]: https://github.com/ramsey/uuid/blob/main/CONTRIBUTING.md -[security.md]: https://github.com/ramsey/uuid/blob/main/SECURITY.md -[license]: https://github.com/ramsey/uuid/blob/main/LICENSE diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/composer.json deleted file mode 100644 index 3f3b5ac4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/composer.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "ramsey/uuid", - "type": "library", - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "keywords": [ - "uuid", - "identifier", - "guid" - ], - "license": "MIT", - "require": { - "php": "^7.2 || ^8.0", - "ext-json": "*", - "brick/math": "^0.8 || ^0.9", - "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php80": "^1.14" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "moontoast/math": "^1.1", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - }, - "captainhook": { - "force-install": true - } - }, - "autoload": { - "psr-4": { - "Ramsey\\Uuid\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "autoload-dev": { - "psr-4": { - "Ramsey\\Uuid\\Benchmark\\": "tests/benchmark/", - "Ramsey\\Uuid\\StaticAnalysis\\": "tests/static-analysis/", - "Ramsey\\Uuid\\Test\\": "tests/" - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "scripts": { - "analyze": [ - "@phpstan", - "@psalm" - ], - "build:clean": "git clean -fX build/", - "lint": "parallel-lint src tests", - "lint:paths": "parallel-lint", - "phpbench": "phpbench run", - "phpcbf": "phpcbf -vpw --cache=build/cache/phpcs.cache", - "phpcs": "phpcs --cache=build/cache/phpcs.cache", - "phpstan": [ - "phpstan analyse --no-progress", - "phpstan analyse -c phpstan-tests.neon --no-progress" - ], - "phpunit": "phpunit --verbose --colors=always", - "phpunit-coverage": "phpunit --verbose --colors=always --coverage-html build/coverage", - "psalm": "psalm --show-info=false --config=psalm.xml", - "test": [ - "@lint", - "@phpbench", - "@phpcs", - "@phpstan", - "@psalm", - "@phpunit" - ] - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/BinaryUtils.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/BinaryUtils.php deleted file mode 100644 index fb8ba9ad..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/BinaryUtils.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -/** - * Provides binary math utilities - */ -class BinaryUtils -{ - /** - * Applies the RFC 4122 variant field to the 16-bit clock sequence - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - * - * @param int $clockSeq The 16-bit clock sequence value before the RFC 4122 - * variant is applied - * - * @return int The 16-bit clock sequence multiplexed with the UUID variant - * - * @psalm-pure - */ - public static function applyVariant(int $clockSeq): int - { - $clockSeq = $clockSeq & 0x3fff; - $clockSeq |= 0x8000; - - return $clockSeq; - } - - /** - * Applies the RFC 4122 version number to the 16-bit `time_hi_and_version` field - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - * - * @param int $timeHi The value of the 16-bit `time_hi_and_version` field - * before the RFC 4122 version is applied - * @param int $version The RFC 4122 version to apply to the `time_hi` field - * - * @return int The 16-bit time_hi field of the timestamp multiplexed with - * the UUID version number - * - * @psalm-pure - */ - public static function applyVersion(int $timeHi, int $version): int - { - $timeHi = $timeHi & 0x0fff; - $timeHi |= $version << 12; - - return $timeHi; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/BuilderCollection.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/BuilderCollection.php deleted file mode 100644 index 89fa1e3c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/BuilderCollection.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Collection\AbstractCollection; -use Ramsey\Uuid\Converter\Number\GenericNumberConverter; -use Ramsey\Uuid\Converter\Time\GenericTimeConverter; -use Ramsey\Uuid\Converter\Time\PhpTimeConverter; -use Ramsey\Uuid\Guid\GuidBuilder; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; -use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; -use Traversable; - -/** - * A collection of UuidBuilderInterface objects - * - * @extends AbstractCollection - */ -class BuilderCollection extends AbstractCollection -{ - public function getType(): string - { - return UuidBuilderInterface::class; - } - - /** - * @psalm-mutation-free - * @psalm-suppress ImpureMethodCall - * @psalm-suppress InvalidTemplateParam - */ - public function getIterator(): Traversable - { - return parent::getIterator(); - } - - /** - * Re-constructs the object from its serialized form - * - * @param string $serialized The serialized PHP string to unserialize into - * a UuidInterface instance - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress RedundantConditionGivenDocblockType - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, [ - 'allowed_classes' => [ - BrickMathCalculator::class, - GenericNumberConverter::class, - GenericTimeConverter::class, - GuidBuilder::class, - NonstandardUuidBuilder::class, - PhpTimeConverter::class, - Rfc4122UuidBuilder::class, - ], - ]); - - $this->data = array_filter( - $data, - function ($unserialized): bool { - return $unserialized instanceof UuidBuilderInterface; - } - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php deleted file mode 100644 index 7c4a6f83..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; - -/** - * @deprecated Transition to {@see Rfc4122UuidBuilder}. - * - * @psalm-immutable - */ -class DefaultUuidBuilder extends Rfc4122UuidBuilder -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php deleted file mode 100644 index 23931e41..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\Time\DegradedTimeConverter; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\DegradedUuid; -use Ramsey\Uuid\Rfc4122\Fields as Rfc4122Fields; -use Ramsey\Uuid\UuidInterface; - -/** - * @deprecated DegradedUuid instances are no longer necessary to support 32-bit - * systems. Transition to {@see DefaultUuidBuilder}. - * - * @psalm-immutable - */ -class DegradedUuidBuilder implements UuidBuilderInterface -{ - /** - * @var NumberConverterInterface - */ - private $numberConverter; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the DegradedUuid - * @param TimeConverterInterface|null $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps - */ - public function __construct( - NumberConverterInterface $numberConverter, - ?TimeConverterInterface $timeConverter = null - ) { - $this->numberConverter = $numberConverter; - $this->timeConverter = $timeConverter ?: new DegradedTimeConverter(); - } - - /** - * Builds and returns a DegradedUuid - * - * @param CodecInterface $codec The codec to use for building this DegradedUuid instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return DegradedUuid The DegradedUuidBuild returns an instance of Ramsey\Uuid\DegradedUuid - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - return new DegradedUuid( - new Rfc4122Fields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/FallbackBuilder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/FallbackBuilder.php deleted file mode 100644 index 470d2f75..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/FallbackBuilder.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Exception\BuilderNotFoundException; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\UuidInterface; - -/** - * FallbackBuilder builds a UUID by stepping through a list of UUID builders - * until a UUID can be constructed without exceptions - * - * @psalm-immutable - */ -class FallbackBuilder implements UuidBuilderInterface -{ - /** - * @var BuilderCollection - */ - private $builders; - - /** - * @param BuilderCollection $builders An array of UUID builders - */ - public function __construct(BuilderCollection $builders) - { - $this->builders = $builders; - } - - /** - * Builds and returns a UuidInterface instance using the first builder that - * succeeds - * - * @param CodecInterface $codec The codec to use for building this instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return UuidInterface an instance of a UUID object - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - $lastBuilderException = null; - - foreach ($this->builders as $builder) { - try { - return $builder->build($codec, $bytes); - } catch (UnableToBuildUuidException $exception) { - $lastBuilderException = $exception; - - continue; - } - } - - throw new BuilderNotFoundException( - 'Could not find a suitable builder for the provided codec and fields', - 0, - $lastBuilderException - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php deleted file mode 100644 index 8e58b2b4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Builder; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\UuidInterface; - -/** - * A UUID builder builds instances of UuidInterface - * - * @psalm-immutable - */ -interface UuidBuilderInterface -{ - /** - * Builds and returns a UuidInterface - * - * @param CodecInterface $codec The codec to use for building this UuidInterface instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return UuidInterface Implementations may choose to return more specific - * instances of UUIDs that implement UuidInterface - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/CodecInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/CodecInterface.php deleted file mode 100644 index 85f8a7e9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/CodecInterface.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\UuidInterface; - -/** - * A codec encodes and decodes a UUID according to defined rules - * - * @psalm-immutable - */ -interface CodecInterface -{ - /** - * Returns a hexadecimal string representation of a UuidInterface - * - * @param UuidInterface $uuid The UUID for which to create a hexadecimal - * string representation - * - * @return string Hexadecimal string representation of a UUID - * - * @psalm-return non-empty-string - */ - public function encode(UuidInterface $uuid): string; - - /** - * Returns a binary string representation of a UuidInterface - * - * @param UuidInterface $uuid The UUID for which to create a binary string - * representation - * - * @return string Binary string representation of a UUID - * - * @psalm-return non-empty-string - */ - public function encodeBinary(UuidInterface $uuid): string; - - /** - * Returns a UuidInterface derived from a hexadecimal string representation - * - * @param string $encodedUuid The hexadecimal string representation to - * convert into a UuidInterface instance - * - * @return UuidInterface An instance of a UUID decoded from a hexadecimal - * string representation - */ - public function decode(string $encodedUuid): UuidInterface; - - /** - * Returns a UuidInterface derived from a binary string representation - * - * @param string $bytes The binary string representation to convert into a - * UuidInterface instance - * - * @return UuidInterface An instance of a UUID decoded from a binary string - * representation - */ - public function decodeBytes(string $bytes): UuidInterface; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/GuidStringCodec.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/GuidStringCodec.php deleted file mode 100644 index f11e9d50..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/GuidStringCodec.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Guid\Guid; -use Ramsey\Uuid\UuidInterface; - -use function bin2hex; -use function substr; - -/** - * GuidStringCodec encodes and decodes globally unique identifiers (GUID) - * - * @see Guid - * - * @psalm-immutable - */ -class GuidStringCodec extends StringCodec -{ - public function decode(string $encodedUuid): UuidInterface - { - $bytes = $this->getBytes($encodedUuid); - - return $this->getBuilder()->build($this, $this->swapBytes($bytes)); - } - - public function decodeBytes(string $bytes): UuidInterface - { - // Specifically call parent::decode to preserve correct byte order - return parent::decode(bin2hex($bytes)); - } - - /** - * Swaps bytes according to the GUID rules - */ - private function swapBytes(string $bytes): string - { - return $bytes[3] . $bytes[2] . $bytes[1] . $bytes[0] - . $bytes[5] . $bytes[4] - . $bytes[7] . $bytes[6] - . substr($bytes, 8); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php deleted file mode 100644 index 0798ebc4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; -use Ramsey\Uuid\UuidInterface; - -use function strlen; -use function substr; - -/** - * OrderedTimeCodec encodes and decodes a UUID, optimizing the byte order for - * more efficient storage - * - * For binary representations of version 1 UUID, this codec may be used to - * reorganize the time fields, making the UUID closer to sequential when storing - * the bytes. According to Percona, this optimization can improve database - * INSERTs and SELECTs using the UUID column as a key. - * - * The string representation of the UUID will remain unchanged. Only the binary - * representation is reordered. - * - * **PLEASE NOTE:** Binary representations of UUIDs encoded with this codec must - * be decoded with this codec. Decoding using another codec can result in - * malformed UUIDs. - * - * @link https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ Storing UUID Values in MySQL - * - * @psalm-immutable - */ -class OrderedTimeCodec extends StringCodec -{ - /** - * Returns a binary string representation of a UUID, with the timestamp - * fields rearranged for optimized storage - * - * @inheritDoc - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encodeBinary(UuidInterface $uuid): string - { - if ( - !($uuid->getFields() instanceof Rfc4122FieldsInterface) - || $uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME - ) { - throw new InvalidArgumentException( - 'Expected RFC 4122 version 1 (time-based) UUID' - ); - } - - $bytes = $uuid->getFields()->getBytes(); - - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $bytes[6] . $bytes[7] - . $bytes[4] . $bytes[5] - . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3] - . substr($bytes, 8); - } - - /** - * Returns a UuidInterface derived from an ordered-time binary string - * representation - * - * @throws InvalidArgumentException if $bytes is an invalid length - * - * @inheritDoc - */ - public function decodeBytes(string $bytes): UuidInterface - { - if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - '$bytes string should contain 16 characters.' - ); - } - - // Rearrange the bytes to their original order. - $rearrangedBytes = $bytes[4] . $bytes[5] . $bytes[6] . $bytes[7] - . $bytes[2] . $bytes[3] - . $bytes[0] . $bytes[1] - . substr($bytes, 8); - - $uuid = parent::decodeBytes($rearrangedBytes); - - if ( - !($uuid->getFields() instanceof Rfc4122FieldsInterface) - || $uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME - ) { - throw new UnsupportedOperationException( - 'Attempting to decode a non-time-based UUID using ' - . 'OrderedTimeCodec' - ); - } - - return $uuid; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/StringCodec.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/StringCodec.php deleted file mode 100644 index 58c9f580..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/StringCodec.php +++ /dev/null @@ -1,138 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Exception\InvalidUuidStringException; -use Ramsey\Uuid\Rfc4122\FieldsInterface; -use Ramsey\Uuid\Uuid; -use Ramsey\Uuid\UuidInterface; - -use function hex2bin; -use function implode; -use function str_replace; -use function strlen; -use function substr; - -/** - * StringCodec encodes and decodes RFC 4122 UUIDs - * - * @link http://tools.ietf.org/html/rfc4122 - * - * @psalm-immutable - */ -class StringCodec implements CodecInterface -{ - /** - * @var UuidBuilderInterface - */ - private $builder; - - /** - * Constructs a StringCodec - * - * @param UuidBuilderInterface $builder The builder to use when encoding UUIDs - */ - public function __construct(UuidBuilderInterface $builder) - { - $this->builder = $builder; - } - - public function encode(UuidInterface $uuid): string - { - /** @var FieldsInterface $fields */ - $fields = $uuid->getFields(); - - return $fields->getTimeLow()->toString() - . '-' - . $fields->getTimeMid()->toString() - . '-' - . $fields->getTimeHiAndVersion()->toString() - . '-' - . $fields->getClockSeqHiAndReserved()->toString() - . $fields->getClockSeqLow()->toString() - . '-' - . $fields->getNode()->toString(); - } - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encodeBinary(UuidInterface $uuid): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $uuid->getFields()->getBytes(); - } - - /** - * @throws InvalidUuidStringException - * - * @inheritDoc - */ - public function decode(string $encodedUuid): UuidInterface - { - return $this->builder->build($this, $this->getBytes($encodedUuid)); - } - - public function decodeBytes(string $bytes): UuidInterface - { - if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - '$bytes string should contain 16 characters.' - ); - } - - return $this->builder->build($this, $bytes); - } - - /** - * Returns the UUID builder - */ - protected function getBuilder(): UuidBuilderInterface - { - return $this->builder; - } - - /** - * Returns a byte string of the UUID - */ - protected function getBytes(string $encodedUuid): string - { - $parsedUuid = str_replace( - ['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}', '-'], - '', - $encodedUuid - ); - - $components = [ - substr($parsedUuid, 0, 8), - substr($parsedUuid, 8, 4), - substr($parsedUuid, 12, 4), - substr($parsedUuid, 16, 4), - substr($parsedUuid, 20), - ]; - - if (!Uuid::isValid(implode('-', $components))) { - throw new InvalidUuidStringException( - 'Invalid UUID string: ' . $encodedUuid - ); - } - - return (string) hex2bin($parsedUuid); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php deleted file mode 100644 index 0e0042d0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -use Ramsey\Uuid\Exception\InvalidUuidStringException; -use Ramsey\Uuid\UuidInterface; - -use function bin2hex; -use function sprintf; -use function substr; -use function substr_replace; - -/** - * TimestampFirstCombCodec encodes and decodes COMBs, with the timestamp as the - * first 48 bits - * - * In contrast with the TimestampLastCombCodec, the TimestampFirstCombCodec - * adds the timestamp to the first 48 bits of the COMB. To generate a - * timestamp-first COMB, set the TimestampFirstCombCodec as the codec, along - * with the CombGenerator as the random generator. - * - * ``` php - * $factory = new UuidFactory(); - * - * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); - * - * $factory->setRandomGenerator(new CombGenerator( - * $factory->getRandomGenerator(), - * $factory->getNumberConverter() - * )); - * - * $timestampFirstComb = $factory->uuid4(); - * ``` - * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys - * - * @psalm-immutable - */ -class TimestampFirstCombCodec extends StringCodec -{ - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encode(UuidInterface $uuid): string - { - $bytes = $this->swapBytes($uuid->getFields()->getBytes()); - - return sprintf( - '%08s-%04s-%04s-%04s-%012s', - bin2hex(substr($bytes, 0, 4)), - bin2hex(substr($bytes, 4, 2)), - bin2hex(substr($bytes, 6, 2)), - bin2hex(substr($bytes, 8, 2)), - bin2hex(substr($bytes, 10)) - ); - } - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function encodeBinary(UuidInterface $uuid): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $this->swapBytes($uuid->getFields()->getBytes()); - } - - /** - * @throws InvalidUuidStringException - * - * @inheritDoc - */ - public function decode(string $encodedUuid): UuidInterface - { - $bytes = $this->getBytes($encodedUuid); - - return $this->getBuilder()->build($this, $this->swapBytes($bytes)); - } - - public function decodeBytes(string $bytes): UuidInterface - { - return $this->getBuilder()->build($this, $this->swapBytes($bytes)); - } - - /** - * Swaps bytes according to the timestamp-first COMB rules - */ - private function swapBytes(string $bytes): string - { - $first48Bits = substr($bytes, 0, 6); - $last48Bits = substr($bytes, -6); - - $bytes = substr_replace($bytes, $last48Bits, 0, 6); - $bytes = substr_replace($bytes, $first48Bits, -6); - - return $bytes; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php deleted file mode 100644 index 4856deae..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Codec; - -/** - * TimestampLastCombCodec encodes and decodes COMBs, with the timestamp as the - * last 48 bits - * - * The CombGenerator when used with the StringCodec (and, by proxy, the - * TimestampLastCombCodec) adds the timestamp to the last 48 bits of the COMB. - * The TimestampLastCombCodec is provided for the sake of consistency. In - * practice, it is identical to the standard StringCodec but, it may be used - * with the CombGenerator for additional context when reading code. - * - * Consider the following code. By default, the codec used by UuidFactory is the - * StringCodec, but here, we explicitly set the TimestampLastCombCodec. It is - * redundant, but it is clear that we intend this COMB to be generated with the - * timestamp appearing at the end. - * - * ``` php - * $factory = new UuidFactory(); - * - * $factory->setCodec(new TimestampLastCombCodec($factory->getUuidBuilder())); - * - * $factory->setRandomGenerator(new CombGenerator( - * $factory->getRandomGenerator(), - * $factory->getNumberConverter() - * )); - * - * $timestampLastComb = $factory->uuid4(); - * ``` - * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys - * - * @psalm-immutable - */ -class TimestampLastCombCodec extends StringCodec -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php deleted file mode 100644 index fef63fd0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Number; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Math\BrickMathCalculator; - -/** - * Previously used to integrate moontoast/math as a bignum arithmetic library, - * BigNumberConverter is deprecated in favor of GenericNumberConverter - * - * @deprecated Transition to {@see GenericNumberConverter}. - * - * @psalm-immutable - */ -class BigNumberConverter implements NumberConverterInterface -{ - /** - * @var NumberConverterInterface - */ - private $converter; - - public function __construct() - { - $this->converter = new GenericNumberConverter(new BrickMathCalculator()); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function fromHex(string $hex): string - { - return $this->converter->fromHex($hex); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function toHex(string $number): string - { - return $this->converter->toHex($number); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php deleted file mode 100644 index c9cfa686..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Number; - -/** - * @deprecated DegradedNumberConverter is no longer necessary for converting - * numbers on 32-bit systems. Transition to {@see GenericNumberConverter}. - * - * @psalm-immutable - */ -class DegradedNumberConverter extends BigNumberConverter -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php deleted file mode 100644 index 501eac0f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Number; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * GenericNumberConverter uses the provided calculator to convert decimal - * numbers to and from hexadecimal values - * - * @psalm-immutable - */ -class GenericNumberConverter implements NumberConverterInterface -{ - /** - * @var CalculatorInterface - */ - private $calculator; - - public function __construct(CalculatorInterface $calculator) - { - $this->calculator = $calculator; - } - - /** - * @inheritDoc - * @psalm-pure - * @psalm-return numeric-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function fromHex(string $hex): string - { - return $this->calculator->fromBase($hex, 16)->toString(); - } - - /** - * @inheritDoc - * @psalm-pure - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function toHex(string $number): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $this->calculator->toBase(new IntegerObject($number), 16); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php deleted file mode 100644 index b33ec31f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter; - -/** - * A number converter converts UUIDs from hexadecimal characters into - * representations of integers and vice versa - * - * @psalm-immutable - */ -interface NumberConverterInterface -{ - /** - * Converts a hexadecimal number into an string integer representation of - * the number - * - * The integer representation returned is a string representation of the - * integer, to accommodate unsigned integers greater than PHP_INT_MAX. - * - * @param string $hex The hexadecimal string representation to convert - * - * @return string String representation of an integer - * - * @psalm-return numeric-string - * - * @psalm-pure - */ - public function fromHex(string $hex): string; - - /** - * Converts a string integer representation into a hexadecimal string - * representation of the number - * - * @param string $number A string integer representation to convert; this - * must be a numeric string to accommodate unsigned integers greater - * than PHP_INT_MAX. - * - * @return string Hexadecimal string - * - * @psalm-return non-empty-string - * - * @psalm-pure - */ - public function toHex(string $number): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php deleted file mode 100644 index 7390dad8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Time; - -/** - * Previously used to integrate moontoast/math as a bignum arithmetic library, - * BigNumberTimeConverter is deprecated in favor of GenericTimeConverter - * - * @deprecated Transition to {@see GenericTimeConverter}. - * - * @psalm-immutable - */ -class BigNumberTimeConverter implements TimeConverterInterface -{ - /** - * @var TimeConverterInterface - */ - private $converter; - - public function __construct() - { - $this->converter = new GenericTimeConverter(new BrickMathCalculator()); - } - - public function calculateTime(string $seconds, string $microseconds): Hexadecimal - { - return $this->converter->calculateTime($seconds, $microseconds); - } - - public function convertTime(Hexadecimal $uuidTimestamp): Time - { - return $this->converter->convertTime($uuidTimestamp); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php deleted file mode 100644 index cdc28752..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -/** - * @deprecated DegradedTimeConverter is no longer necessary for converting - * time on 32-bit systems. Transition to {@see GenericTimeConverter}. - * - * @psalm-immutable - */ -class DegradedTimeConverter extends BigNumberTimeConverter -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php deleted file mode 100644 index a8aa64b7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php +++ /dev/null @@ -1,124 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Math\RoundingMode; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; - -use function explode; -use function str_pad; - -use const STR_PAD_LEFT; - -/** - * GenericTimeConverter uses the provided calculator to calculate and convert - * time values - * - * @psalm-immutable - */ -class GenericTimeConverter implements TimeConverterInterface -{ - /** - * The number of 100-nanosecond intervals from the Gregorian calendar epoch - * to the Unix epoch. - */ - private const GREGORIAN_TO_UNIX_INTERVALS = '122192928000000000'; - - /** - * The number of 100-nanosecond intervals in one second. - */ - private const SECOND_INTERVALS = '10000000'; - - /** - * The number of 100-nanosecond intervals in one microsecond. - */ - private const MICROSECOND_INTERVALS = '10'; - - /** - * @var CalculatorInterface - */ - private $calculator; - - public function __construct(CalculatorInterface $calculator) - { - $this->calculator = $calculator; - } - - public function calculateTime(string $seconds, string $microseconds): Hexadecimal - { - $timestamp = new Time($seconds, $microseconds); - - // Convert the seconds into a count of 100-nanosecond intervals. - $sec = $this->calculator->multiply( - $timestamp->getSeconds(), - new IntegerObject(self::SECOND_INTERVALS) - ); - - // Convert the microseconds into a count of 100-nanosecond intervals. - $usec = $this->calculator->multiply( - $timestamp->getMicroseconds(), - new IntegerObject(self::MICROSECOND_INTERVALS) - ); - - // Combine the seconds and microseconds intervals and add the count of - // 100-nanosecond intervals from the Gregorian calendar epoch to the - // Unix epoch. This gives us the correct count of 100-nanosecond - // intervals since the Gregorian calendar epoch for the given seconds - // and microseconds. - /** @var IntegerObject $uuidTime */ - $uuidTime = $this->calculator->add( - $sec, - $usec, - new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS) - ); - - $uuidTimeHex = str_pad( - $this->calculator->toHexadecimal($uuidTime)->toString(), - 16, - '0', - STR_PAD_LEFT - ); - - return new Hexadecimal($uuidTimeHex); - } - - public function convertTime(Hexadecimal $uuidTimestamp): Time - { - // From the total, subtract the number of 100-nanosecond intervals from - // the Gregorian calendar epoch to the Unix epoch. This gives us the - // number of 100-nanosecond intervals from the Unix epoch, which also - // includes the microtime. - $epochNanoseconds = $this->calculator->subtract( - $this->calculator->toInteger($uuidTimestamp), - new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS) - ); - - // Convert the 100-nanosecond intervals into seconds and microseconds. - $unixTimestamp = $this->calculator->divide( - RoundingMode::HALF_UP, - 6, - $epochNanoseconds, - new IntegerObject(self::SECOND_INTERVALS) - ); - - $split = explode('.', (string) $unixTimestamp, 2); - - return new Time($split[0], $split[1] ?? 0); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php deleted file mode 100644 index 538d2f2f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php +++ /dev/null @@ -1,183 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter\Time; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; - -use function count; -use function dechex; -use function explode; -use function is_float; -use function is_int; -use function str_pad; -use function strlen; -use function substr; - -use const STR_PAD_LEFT; -use const STR_PAD_RIGHT; - -/** - * PhpTimeConverter uses built-in PHP functions and standard math operations - * available to the PHP programming language to provide facilities for - * converting parts of time into representations that may be used in UUIDs - * - * @psalm-immutable - */ -class PhpTimeConverter implements TimeConverterInterface -{ - /** - * The number of 100-nanosecond intervals from the Gregorian calendar epoch - * to the Unix epoch. - */ - private const GREGORIAN_TO_UNIX_INTERVALS = 0x01b21dd213814000; - - /** - * The number of 100-nanosecond intervals in one second. - */ - private const SECOND_INTERVALS = 10000000; - - /** - * The number of 100-nanosecond intervals in one microsecond. - */ - private const MICROSECOND_INTERVALS = 10; - - /** - * @var CalculatorInterface - */ - private $calculator; - - /** - * @var TimeConverterInterface - */ - private $fallbackConverter; - - /** - * @var int - */ - private $phpPrecision; - - public function __construct( - ?CalculatorInterface $calculator = null, - ?TimeConverterInterface $fallbackConverter = null - ) { - if ($calculator === null) { - $calculator = new BrickMathCalculator(); - } - - if ($fallbackConverter === null) { - $fallbackConverter = new GenericTimeConverter($calculator); - } - - $this->calculator = $calculator; - $this->fallbackConverter = $fallbackConverter; - $this->phpPrecision = (int) ini_get('precision'); - } - - public function calculateTime(string $seconds, string $microseconds): Hexadecimal - { - $seconds = new IntegerObject($seconds); - $microseconds = new IntegerObject($microseconds); - - // Calculate the count of 100-nanosecond intervals since the Gregorian - // calendar epoch for the given seconds and microseconds. - $uuidTime = ((int) $seconds->toString() * self::SECOND_INTERVALS) - + ((int) $microseconds->toString() * self::MICROSECOND_INTERVALS) - + self::GREGORIAN_TO_UNIX_INTERVALS; - - // Check to see whether we've overflowed the max/min integer size. - // If so, we will default to a different time converter. - /** @psalm-suppress RedundantCondition */ - if (!is_int($uuidTime)) { - return $this->fallbackConverter->calculateTime( - $seconds->toString(), - $microseconds->toString() - ); - } - - return new Hexadecimal(str_pad(dechex($uuidTime), 16, '0', STR_PAD_LEFT)); - } - - public function convertTime(Hexadecimal $uuidTimestamp): Time - { - $timestamp = $this->calculator->toInteger($uuidTimestamp); - - // Convert the 100-nanosecond intervals into seconds and microseconds. - $splitTime = $this->splitTime( - ((int) $timestamp->toString() - self::GREGORIAN_TO_UNIX_INTERVALS) - / self::SECOND_INTERVALS - ); - - if (count($splitTime) === 0) { - return $this->fallbackConverter->convertTime($uuidTimestamp); - } - - return new Time($splitTime['sec'], $splitTime['usec']); - } - - /** - * @param int|float $time The time to split into seconds and microseconds - * - * @return string[] - */ - private function splitTime($time): array - { - $split = explode('.', (string) $time, 2); - - // If the $time value is a float but $split only has 1 element, then the - // float math was rounded up to the next second, so we want to return - // an empty array to allow use of the fallback converter. - if (is_float($time) && count($split) === 1) { - return []; - } - - if (count($split) === 1) { - return [ - 'sec' => $split[0], - 'usec' => '0', - ]; - } - - // If the microseconds are less than six characters AND the length of - // the number is greater than or equal to the PHP precision, then it's - // possible that we lost some precision for the microseconds. Return an - // empty array, so that we can choose to use the fallback converter. - if (strlen($split[1]) < 6 && strlen((string) $time) >= $this->phpPrecision) { - return []; - } - - $microseconds = $split[1]; - - // Ensure the microseconds are no longer than 6 digits. If they are, - // truncate the number to the first 6 digits and round up, if needed. - if (strlen($microseconds) > 6) { - $roundingDigit = (int) substr($microseconds, 6, 1); - $microseconds = (int) substr($microseconds, 0, 6); - - if ($roundingDigit >= 5) { - $microseconds++; - } - } - - return [ - 'sec' => $split[0], - 'usec' => str_pad((string) $microseconds, 6, '0', STR_PAD_RIGHT), - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php deleted file mode 100644 index 1e848070..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Converter; - -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Time; - -/** - * A time converter converts timestamps into representations that may be used - * in UUIDs - * - * @psalm-immutable - */ -interface TimeConverterInterface -{ - /** - * Uses the provided seconds and micro-seconds to calculate the count of - * 100-nanosecond intervals since UTC 00:00:00.00, 15 October 1582, for - * RFC 4122 variant UUIDs - * - * @link http://tools.ietf.org/html/rfc4122#section-4.2.2 RFC 4122, § 4.2.2: Generation Details - * - * @param string $seconds A string representation of the number of seconds - * since the Unix epoch for the time to calculate - * @param string $microseconds A string representation of the micro-seconds - * associated with the time to calculate - * - * @return Hexadecimal The full UUID timestamp as a Hexadecimal value - * - * @psalm-pure - */ - public function calculateTime(string $seconds, string $microseconds): Hexadecimal; - - /** - * Converts a timestamp extracted from a UUID to a Unix timestamp - * - * @param Hexadecimal $uuidTimestamp A hexadecimal representation of a UUID - * timestamp; a UUID timestamp is a count of 100-nanosecond intervals - * since UTC 00:00:00.00, 15 October 1582. - * - * @return Time An instance of {@see Time} - * - * @psalm-pure - */ - public function convertTime(Hexadecimal $uuidTimestamp): Time; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DegradedUuid.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DegradedUuid.php deleted file mode 100644 index 9166042c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DegradedUuid.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -/** - * @deprecated DegradedUuid is no longer necessary to represent UUIDs on 32-bit - * systems. Transition typehints to {@see UuidInterface}. - * - * @psalm-immutable - */ -class DegradedUuid extends Uuid -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DeprecatedUuidInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DeprecatedUuidInterface.php deleted file mode 100644 index ed6d9dec..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DeprecatedUuidInterface.php +++ /dev/null @@ -1,147 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; - -/** - * This interface encapsulates deprecated methods for ramsey/uuid; this - * interface and its methods will be removed in ramsey/uuid 5.0.0. - * - * @psalm-immutable - */ -interface DeprecatedUuidInterface -{ - /** - * @deprecated This method will be removed in 5.0.0. There is no alternative - * recommendation, so plan accordingly. - */ - public function getNumberConverter(): NumberConverterInterface; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. - * - * @return string[] - */ - public function getFieldsHex(): array; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. - */ - public function getClockSeqHiAndReservedHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. - */ - public function getClockSeqLowHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. - */ - public function getClockSequenceHex(): string; - - /** - * @deprecated In ramsey/uuid version 5.0.0, this will be removed from the - * interface. It is available at {@see UuidV1::getDateTime()}. - */ - public function getDateTime(): DateTimeInterface; - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getLeastSignificantBitsHex(): string; - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getMostSignificantBitsHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. - */ - public function getNodeHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. - */ - public function getTimeHiAndVersionHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. - */ - public function getTimeLowHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. - */ - public function getTimeMidHex(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. - */ - public function getTimestampHex(): string; - - /** - * @deprecated In ramsey/uuid version 5.0.0, this will be removed from this - * interface. It has moved to {@see \Ramsey\Uuid\Rfc4122\UuidInterface::getUrn()}. - */ - public function getUrn(): string; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. - */ - public function getVariant(): ?int; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. - */ - public function getVersion(): ?int; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php deleted file mode 100644 index 34282952..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php +++ /dev/null @@ -1,370 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeImmutable; -use DateTimeInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\DateTimeException; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Throwable; - -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * This trait encapsulates deprecated methods for ramsey/uuid; this trait and - * its methods will be removed in ramsey/uuid 5.0.0. - * - * @psalm-immutable - */ -trait DeprecatedUuidMethodsTrait -{ - /** - * @var Rfc4122FieldsInterface - */ - protected $fields; - - /** - * @var NumberConverterInterface - */ - protected $numberConverter; - - /** - * @var TimeConverterInterface - */ - protected $timeConverter; - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getClockSeqHiAndReserved(): string - { - return $this->numberConverter->fromHex($this->fields->getClockSeqHiAndReserved()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()}. - */ - public function getClockSeqHiAndReservedHex(): string - { - return $this->fields->getClockSeqHiAndReserved()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getClockSeqLow(): string - { - return $this->numberConverter->fromHex($this->fields->getClockSeqLow()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()}. - */ - public function getClockSeqLowHex(): string - { - return $this->fields->getClockSeqLow()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getClockSequence(): string - { - return $this->numberConverter->fromHex($this->fields->getClockSeq()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()}. - */ - public function getClockSequenceHex(): string - { - return $this->fields->getClockSeq()->toString(); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no alternative - * recommendation, so plan accordingly. - */ - public function getNumberConverter(): NumberConverterInterface - { - return $this->numberConverter; - } - - /** - * @deprecated In ramsey/uuid version 5.0.0, this will be removed. - * It is available at {@see UuidV1::getDateTime()}. - * - * @return DateTimeImmutable An immutable instance of DateTimeInterface - * - * @throws UnsupportedOperationException if UUID is not time-based - * @throws DateTimeException if DateTime throws an exception/error - */ - public function getDateTime(): DateTimeInterface - { - if ($this->fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); - - try { - return new DateTimeImmutable( - '@' - . $time->getSeconds()->toString() - . '.' - . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) - ); - } catch (Throwable $e) { - throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. - * - * @return string[] - */ - public function getFieldsHex(): array - { - return [ - 'time_low' => $this->fields->getTimeLow()->toString(), - 'time_mid' => $this->fields->getTimeMid()->toString(), - 'time_hi_and_version' => $this->fields->getTimeHiAndVersion()->toString(), - 'clock_seq_hi_and_reserved' => $this->fields->getClockSeqHiAndReserved()->toString(), - 'clock_seq_low' => $this->fields->getClockSeqLow()->toString(), - 'node' => $this->fields->getNode()->toString(), - ]; - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getLeastSignificantBits(): string - { - $leastSignificantHex = substr($this->getHex()->toString(), 16); - - return $this->numberConverter->fromHex($leastSignificantHex); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getLeastSignificantBitsHex(): string - { - return substr($this->getHex()->toString(), 16); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getMostSignificantBits(): string - { - $mostSignificantHex = substr($this->getHex()->toString(), 0, 16); - - return $this->numberConverter->fromHex($mostSignificantHex); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - */ - public function getMostSignificantBitsHex(): string - { - return substr($this->getHex()->toString(), 0, 16); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getNode()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getNode(): string - { - return $this->numberConverter->fromHex($this->fields->getNode()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getNode()}. - */ - public function getNodeHex(): string - { - return $this->fields->getNode()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getTimeHiAndVersion(): string - { - return $this->numberConverter->fromHex($this->fields->getTimeHiAndVersion()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()}. - */ - public function getTimeHiAndVersionHex(): string - { - return $this->fields->getTimeHiAndVersion()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getTimeLow(): string - { - return $this->numberConverter->fromHex($this->fields->getTimeLow()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()}. - */ - public function getTimeLowHex(): string - { - return $this->fields->getTimeLow()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getTimeMid(): string - { - return $this->numberConverter->fromHex($this->fields->getTimeMid()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()}. - */ - public function getTimeMidHex(): string - { - return $this->fields->getTimeMid()->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - */ - public function getTimestamp(): string - { - if ($this->fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - return $this->numberConverter->fromHex($this->fields->getTimestamp()->toString()); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()}. - */ - public function getTimestampHex(): string - { - if ($this->fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - return $this->fields->getTimestamp()->toString(); - } - - /** - * @deprecated This has moved to {@see Rfc4122FieldsInterface::getUrn()} and - * is available on {@see \Ramsey\Uuid\Rfc4122\UuidV1}, - * {@see \Ramsey\Uuid\Rfc4122\UuidV3}, {@see \Ramsey\Uuid\Rfc4122\UuidV4}, - * and {@see \Ramsey\Uuid\Rfc4122\UuidV5}. - */ - public function getUrn(): string - { - return 'urn:uuid:' . $this->toString(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. - */ - public function getVariant(): ?int - { - return $this->fields->getVariant(); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. - */ - public function getVersion(): ?int - { - return $this->fields->getVersion(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php deleted file mode 100644 index 220ffedb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that no suitable builder could be found - */ -class BuilderNotFoundException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/DateTimeException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/DateTimeException.php deleted file mode 100644 index 5f0e658b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/DateTimeException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the PHP DateTime extension encountered an exception/error - */ -class DateTimeException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/DceSecurityException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/DceSecurityException.php deleted file mode 100644 index e6d80013..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/DceSecurityException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate an exception occurred while dealing with DCE Security - * (version 2) UUIDs - */ -class DceSecurityException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php deleted file mode 100644 index 2a1fa3ac..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use InvalidArgumentException as PhpInvalidArgumentException; - -/** - * Thrown to indicate that the argument received is not valid - */ -class InvalidArgumentException extends PhpInvalidArgumentException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidBytesException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidBytesException.php deleted file mode 100644 index 1c94f659..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidBytesException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the bytes being operated on are invalid in some way - */ -class InvalidBytesException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php deleted file mode 100644 index 6d975816..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -/** - * Thrown to indicate that the string received is not a valid UUID - * - * The InvalidArgumentException that this extends is the ramsey/uuid version - * of this exception. It exists in the same namespace as this class. - */ -class InvalidUuidStringException extends InvalidArgumentException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/NameException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/NameException.php deleted file mode 100644 index fd96a1fa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/NameException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that an error occurred while attempting to hash a - * namespace and name - */ -class NameException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/NodeException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/NodeException.php deleted file mode 100644 index 0dbdd50b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/NodeException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that attempting to fetch or create a node ID encountered an error - */ -class NodeException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/RandomSourceException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/RandomSourceException.php deleted file mode 100644 index a44dd34a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/RandomSourceException.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the source of random data encountered an error - * - * This exception is used mostly to indicate that random_bytes() or random_int() - * threw an exception. However, it may be used for other sources of random data. - */ -class RandomSourceException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/TimeSourceException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/TimeSourceException.php deleted file mode 100644 index fc9cf36b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/TimeSourceException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate that the source of time encountered an error - */ -class TimeSourceException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php deleted file mode 100644 index 5ba26d8d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use RuntimeException as PhpRuntimeException; - -/** - * Thrown to indicate a builder is unable to build a UUID - */ -class UnableToBuildUuidException extends PhpRuntimeException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php deleted file mode 100644 index e1b3eda1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use LogicException as PhpLogicException; - -/** - * Thrown to indicate that the requested operation is not supported - */ -class UnsupportedOperationException extends PhpLogicException implements UuidExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php deleted file mode 100644 index a2f1c103..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Exception; - -use Throwable; - -interface UuidExceptionInterface extends Throwable -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/FeatureSet.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/FeatureSet.php deleted file mode 100644 index a8ab2fdb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/FeatureSet.php +++ /dev/null @@ -1,449 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use Ramsey\Uuid\Builder\BuilderCollection; -use Ramsey\Uuid\Builder\FallbackBuilder; -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Codec\GuidStringCodec; -use Ramsey\Uuid\Codec\StringCodec; -use Ramsey\Uuid\Converter\Number\GenericNumberConverter; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\Time\GenericTimeConverter; -use Ramsey\Uuid\Converter\Time\PhpTimeConverter; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Generator\DceSecurityGenerator; -use Ramsey\Uuid\Generator\DceSecurityGeneratorInterface; -use Ramsey\Uuid\Generator\NameGeneratorFactory; -use Ramsey\Uuid\Generator\NameGeneratorInterface; -use Ramsey\Uuid\Generator\PeclUuidNameGenerator; -use Ramsey\Uuid\Generator\PeclUuidRandomGenerator; -use Ramsey\Uuid\Generator\PeclUuidTimeGenerator; -use Ramsey\Uuid\Generator\RandomGeneratorFactory; -use Ramsey\Uuid\Generator\RandomGeneratorInterface; -use Ramsey\Uuid\Generator\TimeGeneratorFactory; -use Ramsey\Uuid\Generator\TimeGeneratorInterface; -use Ramsey\Uuid\Guid\GuidBuilder; -use Ramsey\Uuid\Math\BrickMathCalculator; -use Ramsey\Uuid\Math\CalculatorInterface; -use Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; -use Ramsey\Uuid\Provider\Dce\SystemDceSecurityProvider; -use Ramsey\Uuid\Provider\DceSecurityProviderInterface; -use Ramsey\Uuid\Provider\Node\FallbackNodeProvider; -use Ramsey\Uuid\Provider\Node\NodeProviderCollection; -use Ramsey\Uuid\Provider\Node\RandomNodeProvider; -use Ramsey\Uuid\Provider\Node\SystemNodeProvider; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\Time\SystemTimeProvider; -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; -use Ramsey\Uuid\Validator\GenericValidator; -use Ramsey\Uuid\Validator\ValidatorInterface; - -use const PHP_INT_SIZE; - -/** - * FeatureSet detects and exposes available features in the current environment - * - * A feature set is used by UuidFactory to determine the available features and - * capabilities of the environment. - */ -class FeatureSet -{ - /** - * @var bool - */ - private $disableBigNumber = false; - - /** - * @var bool - */ - private $disable64Bit = false; - - /** - * @var bool - */ - private $ignoreSystemNode = false; - - /** - * @var bool - */ - private $enablePecl = false; - - /** - * @var UuidBuilderInterface - */ - private $builder; - - /** - * @var CodecInterface - */ - private $codec; - - /** - * @var DceSecurityGeneratorInterface - */ - private $dceSecurityGenerator; - - /** - * @var NameGeneratorInterface - */ - private $nameGenerator; - - /** - * @var NodeProviderInterface - */ - private $nodeProvider; - - /** - * @var NumberConverterInterface - */ - private $numberConverter; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * @var RandomGeneratorInterface - */ - private $randomGenerator; - - /** - * @var TimeGeneratorInterface - */ - private $timeGenerator; - - /** - * @var TimeProviderInterface - */ - private $timeProvider; - - /** - * @var ValidatorInterface - */ - private $validator; - - /** - * @var CalculatorInterface - */ - private $calculator; - - /** - * @param bool $useGuids True build UUIDs using the GuidStringCodec - * @param bool $force32Bit True to force the use of 32-bit functionality - * (primarily for testing purposes) - * @param bool $forceNoBigNumber True to disable the use of moontoast/math - * (primarily for testing purposes) - * @param bool $ignoreSystemNode True to disable attempts to check for the - * system node ID (primarily for testing purposes) - * @param bool $enablePecl True to enable the use of the PeclUuidTimeGenerator - * to generate version 1 UUIDs - */ - public function __construct( - bool $useGuids = false, - bool $force32Bit = false, - bool $forceNoBigNumber = false, - bool $ignoreSystemNode = false, - bool $enablePecl = false - ) { - $this->disableBigNumber = $forceNoBigNumber; - $this->disable64Bit = $force32Bit; - $this->ignoreSystemNode = $ignoreSystemNode; - $this->enablePecl = $enablePecl; - - $this->setCalculator(new BrickMathCalculator()); - $this->builder = $this->buildUuidBuilder($useGuids); - $this->codec = $this->buildCodec($useGuids); - $this->nodeProvider = $this->buildNodeProvider(); - $this->nameGenerator = $this->buildNameGenerator(); - $this->randomGenerator = $this->buildRandomGenerator(); - $this->setTimeProvider(new SystemTimeProvider()); - $this->setDceSecurityProvider(new SystemDceSecurityProvider()); - $this->validator = new GenericValidator(); - } - - /** - * Returns the builder configured for this environment - */ - public function getBuilder(): UuidBuilderInterface - { - return $this->builder; - } - - /** - * Returns the calculator configured for this environment - */ - public function getCalculator(): CalculatorInterface - { - return $this->calculator; - } - - /** - * Returns the codec configured for this environment - */ - public function getCodec(): CodecInterface - { - return $this->codec; - } - - /** - * Returns the DCE Security generator configured for this environment - */ - public function getDceSecurityGenerator(): DceSecurityGeneratorInterface - { - return $this->dceSecurityGenerator; - } - - /** - * Returns the name generator configured for this environment - */ - public function getNameGenerator(): NameGeneratorInterface - { - return $this->nameGenerator; - } - - /** - * Returns the node provider configured for this environment - */ - public function getNodeProvider(): NodeProviderInterface - { - return $this->nodeProvider; - } - - /** - * Returns the number converter configured for this environment - */ - public function getNumberConverter(): NumberConverterInterface - { - return $this->numberConverter; - } - - /** - * Returns the random generator configured for this environment - */ - public function getRandomGenerator(): RandomGeneratorInterface - { - return $this->randomGenerator; - } - - /** - * Returns the time converter configured for this environment - */ - public function getTimeConverter(): TimeConverterInterface - { - return $this->timeConverter; - } - - /** - * Returns the time generator configured for this environment - */ - public function getTimeGenerator(): TimeGeneratorInterface - { - return $this->timeGenerator; - } - - /** - * Returns the validator configured for this environment - */ - public function getValidator(): ValidatorInterface - { - return $this->validator; - } - - /** - * Sets the calculator to use in this environment - */ - public function setCalculator(CalculatorInterface $calculator): void - { - $this->calculator = $calculator; - $this->numberConverter = $this->buildNumberConverter($calculator); - $this->timeConverter = $this->buildTimeConverter($calculator); - - /** @psalm-suppress RedundantPropertyInitializationCheck */ - if (isset($this->timeProvider)) { - $this->timeGenerator = $this->buildTimeGenerator($this->timeProvider); - } - } - - /** - * Sets the DCE Security provider to use in this environment - */ - public function setDceSecurityProvider(DceSecurityProviderInterface $dceSecurityProvider): void - { - $this->dceSecurityGenerator = $this->buildDceSecurityGenerator($dceSecurityProvider); - } - - /** - * Sets the node provider to use in this environment - */ - public function setNodeProvider(NodeProviderInterface $nodeProvider): void - { - $this->nodeProvider = $nodeProvider; - $this->timeGenerator = $this->buildTimeGenerator($this->timeProvider); - } - - /** - * Sets the time provider to use in this environment - */ - public function setTimeProvider(TimeProviderInterface $timeProvider): void - { - $this->timeProvider = $timeProvider; - $this->timeGenerator = $this->buildTimeGenerator($timeProvider); - } - - /** - * Set the validator to use in this environment - */ - public function setValidator(ValidatorInterface $validator): void - { - $this->validator = $validator; - } - - /** - * Returns a codec configured for this environment - * - * @param bool $useGuids Whether to build UUIDs using the GuidStringCodec - */ - private function buildCodec(bool $useGuids = false): CodecInterface - { - if ($useGuids) { - return new GuidStringCodec($this->builder); - } - - return new StringCodec($this->builder); - } - - /** - * Returns a DCE Security generator configured for this environment - */ - private function buildDceSecurityGenerator( - DceSecurityProviderInterface $dceSecurityProvider - ): DceSecurityGeneratorInterface { - return new DceSecurityGenerator( - $this->numberConverter, - $this->timeGenerator, - $dceSecurityProvider - ); - } - - /** - * Returns a node provider configured for this environment - */ - private function buildNodeProvider(): NodeProviderInterface - { - if ($this->ignoreSystemNode) { - return new RandomNodeProvider(); - } - - return new FallbackNodeProvider(new NodeProviderCollection([ - new SystemNodeProvider(), - new RandomNodeProvider(), - ])); - } - - /** - * Returns a number converter configured for this environment - */ - private function buildNumberConverter(CalculatorInterface $calculator): NumberConverterInterface - { - return new GenericNumberConverter($calculator); - } - - /** - * Returns a random generator configured for this environment - */ - private function buildRandomGenerator(): RandomGeneratorInterface - { - if ($this->enablePecl) { - return new PeclUuidRandomGenerator(); - } - - return (new RandomGeneratorFactory())->getGenerator(); - } - - /** - * Returns a time generator configured for this environment - * - * @param TimeProviderInterface $timeProvider The time provider to use with - * the time generator - */ - private function buildTimeGenerator(TimeProviderInterface $timeProvider): TimeGeneratorInterface - { - if ($this->enablePecl) { - return new PeclUuidTimeGenerator(); - } - - return (new TimeGeneratorFactory( - $this->nodeProvider, - $this->timeConverter, - $timeProvider - ))->getGenerator(); - } - - /** - * Returns a name generator configured for this environment - */ - private function buildNameGenerator(): NameGeneratorInterface - { - if ($this->enablePecl) { - return new PeclUuidNameGenerator(); - } - - return (new NameGeneratorFactory())->getGenerator(); - } - - /** - * Returns a time converter configured for this environment - */ - private function buildTimeConverter(CalculatorInterface $calculator): TimeConverterInterface - { - $genericConverter = new GenericTimeConverter($calculator); - - if ($this->is64BitSystem()) { - return new PhpTimeConverter($calculator, $genericConverter); - } - - return $genericConverter; - } - - /** - * Returns a UUID builder configured for this environment - * - * @param bool $useGuids Whether to build UUIDs using the GuidStringCodec - */ - private function buildUuidBuilder(bool $useGuids = false): UuidBuilderInterface - { - if ($useGuids) { - return new GuidBuilder($this->numberConverter, $this->timeConverter); - } - - /** @psalm-suppress ImpureArgument */ - return new FallbackBuilder(new BuilderCollection([ - new Rfc4122UuidBuilder($this->numberConverter, $this->timeConverter), - new NonstandardUuidBuilder($this->numberConverter, $this->timeConverter), - ])); - } - - /** - * Returns true if the PHP build is 64-bit - */ - private function is64BitSystem(): bool - { - return PHP_INT_SIZE === 8 && !$this->disable64Bit; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Fields/FieldsInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Fields/FieldsInterface.php deleted file mode 100644 index f1b7a290..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Fields/FieldsInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Fields; - -use Serializable; - -/** - * UUIDs are comprised of unsigned integers, the bytes of which are separated - * into fields and arranged in a particular layout defined by the specification - * for the variant - * - * @psalm-immutable - */ -interface FieldsInterface extends Serializable -{ - /** - * Returns the bytes that comprise the fields - */ - public function getBytes(): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php deleted file mode 100644 index 16e6525d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Fields; - -use ValueError; - -use function base64_decode; -use function sprintf; -use function strlen; - -/** - * Provides common serialization functionality to fields - * - * @psalm-immutable - */ -trait SerializableFieldsTrait -{ - /** - * @param string $bytes The bytes that comprise the fields - */ - abstract public function __construct(string $bytes); - - /** - * Returns the bytes that comprise the fields - */ - abstract public function getBytes(): string; - - /** - * Returns a string representation of object - */ - public function serialize(): string - { - return $this->getBytes(); - } - - /** - * @return array{bytes: string} - */ - public function __serialize(): array - { - return ['bytes' => $this->getBytes()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $serialized The serialized string representation of the object - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress UnusedMethodCall - */ - public function unserialize($serialized): void - { - if (strlen($serialized) === 16) { - $this->__construct($serialized); - } else { - $this->__construct(base64_decode($serialized)); - } - } - - /** - * @param array{bytes: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['bytes'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['bytes']); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/CombGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/CombGenerator.php deleted file mode 100644 index 49b09381..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/CombGenerator.php +++ /dev/null @@ -1,127 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; - -use function bin2hex; -use function explode; -use function hex2bin; -use function microtime; -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * CombGenerator generates COMBs (combined UUID/timestamp) - * - * The CombGenerator, when used with the StringCodec (and, by proxy, the - * TimestampLastCombCodec) or the TimestampFirstCombCodec, combines the current - * timestamp with a UUID (hence the name "COMB"). The timestamp either appears - * as the first or last 48 bits of the COMB, depending on the codec used. - * - * By default, COMBs will have the timestamp set as the last 48 bits of the - * identifier. - * - * ``` php - * $factory = new UuidFactory(); - * - * $factory->setRandomGenerator(new CombGenerator( - * $factory->getRandomGenerator(), - * $factory->getNumberConverter() - * )); - * - * $comb = $factory->uuid4(); - * ``` - * - * To generate a COMB with the timestamp as the first 48 bits, set the - * TimestampFirstCombCodec as the codec. - * - * ``` php - * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); - * ``` - * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys - */ -class CombGenerator implements RandomGeneratorInterface -{ - public const TIMESTAMP_BYTES = 6; - - /** - * @var RandomGeneratorInterface - */ - private $randomGenerator; - - /** - * @var NumberConverterInterface - */ - private $converter; - - public function __construct( - RandomGeneratorInterface $generator, - NumberConverterInterface $numberConverter - ) { - $this->converter = $numberConverter; - $this->randomGenerator = $generator; - } - - /** - * @throws InvalidArgumentException if $length is not a positive integer - * greater than or equal to CombGenerator::TIMESTAMP_BYTES - * - * @inheritDoc - */ - public function generate(int $length): string - { - if ($length < self::TIMESTAMP_BYTES || $length < 0) { - throw new InvalidArgumentException( - 'Length must be a positive integer greater than or equal to ' . self::TIMESTAMP_BYTES - ); - } - - $hash = ''; - if (self::TIMESTAMP_BYTES > 0 && $length > self::TIMESTAMP_BYTES) { - $hash = $this->randomGenerator->generate($length - self::TIMESTAMP_BYTES); - } - - $lsbTime = str_pad( - $this->converter->toHex($this->timestamp()), - self::TIMESTAMP_BYTES * 2, - '0', - STR_PAD_LEFT - ); - - return (string) hex2bin( - str_pad( - bin2hex($hash), - $length - self::TIMESTAMP_BYTES, - '0' - ) - . $lsbTime - ); - } - - /** - * Returns current timestamp a string integer, precise to 0.00001 seconds - */ - private function timestamp(): string - { - $time = explode(' ', microtime(false)); - - return $time[1] . substr($time[0], 2, 5); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php deleted file mode 100644 index aca8c5db..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php +++ /dev/null @@ -1,160 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Exception\DceSecurityException; -use Ramsey\Uuid\Provider\DceSecurityProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Uuid; - -use function hex2bin; -use function in_array; -use function pack; -use function str_pad; -use function strlen; -use function substr_replace; - -use const STR_PAD_LEFT; - -/** - * DceSecurityGenerator generates strings of binary data based on a local - * domain, local identifier, node ID, clock sequence, and the current time - */ -class DceSecurityGenerator implements DceSecurityGeneratorInterface -{ - private const DOMAINS = [ - Uuid::DCE_DOMAIN_PERSON, - Uuid::DCE_DOMAIN_GROUP, - Uuid::DCE_DOMAIN_ORG, - ]; - - /** - * Upper bounds for the clock sequence in DCE Security UUIDs. - */ - private const CLOCK_SEQ_HIGH = 63; - - /** - * Lower bounds for the clock sequence in DCE Security UUIDs. - */ - private const CLOCK_SEQ_LOW = 0; - - /** - * @var NumberConverterInterface - */ - private $numberConverter; - - /** - * @var TimeGeneratorInterface - */ - private $timeGenerator; - - /** - * @var DceSecurityProviderInterface - */ - private $dceSecurityProvider; - - public function __construct( - NumberConverterInterface $numberConverter, - TimeGeneratorInterface $timeGenerator, - DceSecurityProviderInterface $dceSecurityProvider - ) { - $this->numberConverter = $numberConverter; - $this->timeGenerator = $timeGenerator; - $this->dceSecurityProvider = $dceSecurityProvider; - } - - public function generate( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): string { - if (!in_array($localDomain, self::DOMAINS)) { - throw new DceSecurityException( - 'Local domain must be a valid DCE Security domain' - ); - } - - if ($localIdentifier && $localIdentifier->isNegative()) { - throw new DceSecurityException( - 'Local identifier out of bounds; it must be a value between 0 and 4294967295' - ); - } - - if ($clockSeq > self::CLOCK_SEQ_HIGH || $clockSeq < self::CLOCK_SEQ_LOW) { - throw new DceSecurityException( - 'Clock sequence out of bounds; it must be a value between 0 and 63' - ); - } - - switch ($localDomain) { - case Uuid::DCE_DOMAIN_ORG: - if ($localIdentifier === null) { - throw new DceSecurityException( - 'A local identifier must be provided for the org domain' - ); - } - - break; - case Uuid::DCE_DOMAIN_PERSON: - if ($localIdentifier === null) { - $localIdentifier = $this->dceSecurityProvider->getUid(); - } - - break; - case Uuid::DCE_DOMAIN_GROUP: - default: - if ($localIdentifier === null) { - $localIdentifier = $this->dceSecurityProvider->getGid(); - } - - break; - } - - $identifierHex = $this->numberConverter->toHex($localIdentifier->toString()); - - // The maximum value for the local identifier is 0xffffffff, or - // 4294967295. This is 8 hexadecimal digits, so if the length of - // hexadecimal digits is greater than 8, we know the value is greater - // than 0xffffffff. - if (strlen($identifierHex) > 8) { - throw new DceSecurityException( - 'Local identifier out of bounds; it must be a value between 0 and 4294967295' - ); - } - - $domainByte = pack('n', $localDomain)[1]; - $identifierBytes = (string) hex2bin(str_pad($identifierHex, 8, '0', STR_PAD_LEFT)); - - if ($node instanceof Hexadecimal) { - $node = $node->toString(); - } - - // Shift the clock sequence 8 bits to the left, so it matches 0x3f00. - if ($clockSeq !== null) { - $clockSeq = $clockSeq << 8; - } - - $bytes = $this->timeGenerator->generate($node, $clockSeq); - - // Replace bytes in the time-based UUID with DCE Security values. - $bytes = substr_replace($bytes, $identifierBytes, 0, 4); - $bytes = substr_replace($bytes, $domainByte, 9, 1); - - return $bytes; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php deleted file mode 100644 index faa29a53..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Rfc4122\UuidV2; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * A DCE Security generator generates strings of binary data based on a local - * domain, local identifier, node ID, clock sequence, and the current time - * - * @see UuidV2 - */ -interface DceSecurityGeneratorInterface -{ - /** - * Generate a binary string from a local domain, local identifier, node ID, - * clock sequence, and current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return string A binary string - */ - public function generate( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php deleted file mode 100644 index 7303e9fa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Exception\NameException; -use Ramsey\Uuid\UuidInterface; -use ValueError; - -use function hash; - -/** - * DefaultNameGenerator generates strings of binary data based on a namespace, - * name, and hashing algorithm - */ -class DefaultNameGenerator implements NameGeneratorInterface -{ - /** @psalm-pure */ - public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string - { - try { - /** @var string|bool $bytes */ - $bytes = @hash($hashAlgorithm, $ns->getBytes() . $name, true); - } catch (ValueError $e) { - $bytes = false; // keep same behavior than PHP 7 - } - - if ($bytes === false) { - throw new NameException(sprintf( - 'Unable to hash namespace and name with algorithm \'%s\'', - $hashAlgorithm - )); - } - - return (string) $bytes; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php deleted file mode 100644 index d245c7bc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php +++ /dev/null @@ -1,147 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Exception\RandomSourceException; -use Ramsey\Uuid\Exception\TimeSourceException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Throwable; - -use function ctype_xdigit; -use function dechex; -use function hex2bin; -use function is_int; -use function pack; -use function sprintf; -use function str_pad; -use function strlen; - -use const STR_PAD_LEFT; - -/** - * DefaultTimeGenerator generates strings of binary data based on a node ID, - * clock sequence, and the current time - */ -class DefaultTimeGenerator implements TimeGeneratorInterface -{ - /** - * @var NodeProviderInterface - */ - private $nodeProvider; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * @var TimeProviderInterface - */ - private $timeProvider; - - public function __construct( - NodeProviderInterface $nodeProvider, - TimeConverterInterface $timeConverter, - TimeProviderInterface $timeProvider - ) { - $this->nodeProvider = $nodeProvider; - $this->timeConverter = $timeConverter; - $this->timeProvider = $timeProvider; - } - - /** - * @throws InvalidArgumentException if the parameters contain invalid values - * @throws RandomSourceException if random_int() throws an exception/error - * - * @inheritDoc - */ - public function generate($node = null, ?int $clockSeq = null): string - { - if ($node instanceof Hexadecimal) { - $node = $node->toString(); - } - - $node = $this->getValidNode($node); - - if ($clockSeq === null) { - try { - // This does not use "stable storage"; see RFC 4122, Section 4.2.1.1. - $clockSeq = random_int(0, 0x3fff); - } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } - - $time = $this->timeProvider->getTime(); - - $uuidTime = $this->timeConverter->calculateTime( - $time->getSeconds()->toString(), - $time->getMicroseconds()->toString() - ); - - $timeHex = str_pad($uuidTime->toString(), 16, '0', STR_PAD_LEFT); - - if (strlen($timeHex) !== 16) { - throw new TimeSourceException(sprintf( - 'The generated time of \'%s\' is larger than expected', - $timeHex - )); - } - - $timeBytes = (string) hex2bin($timeHex); - - return $timeBytes[4] . $timeBytes[5] . $timeBytes[6] . $timeBytes[7] - . $timeBytes[2] . $timeBytes[3] - . $timeBytes[0] . $timeBytes[1] - . pack('n*', $clockSeq) - . $node; - } - - /** - * Uses the node provider given when constructing this instance to get - * the node ID (usually a MAC address) - * - * @param string|int|null $node A node value that may be used to override the node provider - * - * @return string 6-byte binary string representation of the node - * - * @throws InvalidArgumentException - */ - private function getValidNode($node): string - { - if ($node === null) { - $node = $this->nodeProvider->getNode(); - } - - // Convert the node to hex, if it is still an integer. - if (is_int($node)) { - $node = dechex($node); - } - - if (!ctype_xdigit((string) $node) || strlen((string) $node) > 12) { - throw new InvalidArgumentException('Invalid node value'); - } - - return (string) hex2bin(str_pad((string) $node, 12, '0', STR_PAD_LEFT)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php deleted file mode 100644 index 6f08e291..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -/** - * NameGeneratorFactory retrieves a default name generator, based on the - * environment - */ -class NameGeneratorFactory -{ - /** - * Returns a default name generator, based on the current environment - */ - public function getGenerator(): NameGeneratorInterface - { - return new DefaultNameGenerator(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php deleted file mode 100644 index cc43dd02..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\UuidInterface; - -/** - * A name generator generates strings of binary data created by hashing together - * a namespace with a name, according to a hashing algorithm - */ -interface NameGeneratorInterface -{ - /** - * Generate a binary string from a namespace and name hashed together with - * the specified hashing algorithm - * - * @param UuidInterface $ns The namespace - * @param string $name The name to use for creating a UUID - * @param string $hashAlgorithm The hashing algorithm to use - * - * @return string A binary string - * - * @psalm-pure - */ - public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php deleted file mode 100644 index 3780c5c6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Exception\NameException; -use Ramsey\Uuid\UuidInterface; - -use function sprintf; -use function uuid_generate_md5; -use function uuid_generate_sha1; -use function uuid_parse; - -/** - * PeclUuidNameGenerator generates strings of binary data from a namespace and a - * name, using ext-uuid - * - * @link https://pecl.php.net/package/uuid ext-uuid - */ -class PeclUuidNameGenerator implements NameGeneratorInterface -{ - /** @psalm-pure */ - public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string - { - switch ($hashAlgorithm) { - case 'md5': - $uuid = uuid_generate_md5($ns->toString(), $name); - - break; - case 'sha1': - $uuid = uuid_generate_sha1($ns->toString(), $name); - - break; - default: - throw new NameException(sprintf( - 'Unable to hash namespace and name with algorithm \'%s\'', - $hashAlgorithm - )); - } - - return uuid_parse($uuid); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php deleted file mode 100644 index 07c47d26..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use function uuid_create; -use function uuid_parse; - -use const UUID_TYPE_RANDOM; - -/** - * PeclUuidRandomGenerator generates strings of random binary data using ext-uuid - * - * @link https://pecl.php.net/package/uuid ext-uuid - */ -class PeclUuidRandomGenerator implements RandomGeneratorInterface -{ - public function generate(int $length): string - { - $uuid = uuid_create(UUID_TYPE_RANDOM); - - return uuid_parse($uuid); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php deleted file mode 100644 index e01f44e5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use function uuid_create; -use function uuid_parse; - -use const UUID_TYPE_TIME; - -/** - * PeclUuidTimeGenerator generates strings of binary data for time-base UUIDs, - * using ext-uuid - * - * @link https://pecl.php.net/package/uuid ext-uuid - */ -class PeclUuidTimeGenerator implements TimeGeneratorInterface -{ - /** - * @inheritDoc - */ - public function generate($node = null, ?int $clockSeq = null): string - { - $uuid = uuid_create(UUID_TYPE_TIME); - - return uuid_parse($uuid); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php deleted file mode 100644 index 12edb96a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Exception\RandomSourceException; -use Throwable; - -/** - * RandomBytesGenerator generates strings of random binary data using the - * built-in `random_bytes()` PHP function - * - * @link http://php.net/random_bytes random_bytes() - */ -class RandomBytesGenerator implements RandomGeneratorInterface -{ - /** - * @throws RandomSourceException if random_bytes() throws an exception/error - * - * @inheritDoc - */ - public function generate(int $length): string - { - try { - return random_bytes($length); - } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php deleted file mode 100644 index b723ac29..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -/** - * RandomGeneratorFactory retrieves a default random generator, based on the - * environment - */ -class RandomGeneratorFactory -{ - /** - * Returns a default random generator, based on the current environment - */ - public function getGenerator(): RandomGeneratorInterface - { - return new RandomBytesGenerator(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php deleted file mode 100644 index 5c83cb4d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -/** - * A random generator generates strings of random binary data - */ -interface RandomGeneratorInterface -{ - /** - * Generates a string of randomized binary data - * - * @param int $length The number of bytes of random binary data to generate - * - * @return string A binary string - */ - public function generate(int $length): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php deleted file mode 100644 index 24ed5692..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use RandomLib\Factory; -use RandomLib\Generator; - -/** - * RandomLibAdapter generates strings of random binary data using the - * paragonie/random-lib library - * - * @link https://packagist.org/packages/paragonie/random-lib paragonie/random-lib - */ -class RandomLibAdapter implements RandomGeneratorInterface -{ - /** - * @var Generator - */ - private $generator; - - /** - * Constructs a RandomLibAdapter - * - * By default, if no Generator is passed in, this creates a high-strength - * generator to use when generating random binary data. - * - * @param Generator|null $generator The generator to use when generating binary data - */ - public function __construct(?Generator $generator = null) - { - if ($generator === null) { - $factory = new Factory(); - $generator = $factory->getHighStrengthGenerator(); - } - - $this->generator = $generator; - } - - public function generate(int $length): string - { - return $this->generator->generate($length); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php deleted file mode 100644 index 3d55fc4d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\TimeProviderInterface; - -/** - * TimeGeneratorFactory retrieves a default time generator, based on the - * environment - */ -class TimeGeneratorFactory -{ - /** - * @var NodeProviderInterface - */ - private $nodeProvider; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * @var TimeProviderInterface - */ - private $timeProvider; - - public function __construct( - NodeProviderInterface $nodeProvider, - TimeConverterInterface $timeConverter, - TimeProviderInterface $timeProvider - ) { - $this->nodeProvider = $nodeProvider; - $this->timeConverter = $timeConverter; - $this->timeProvider = $timeProvider; - } - - /** - * Returns a default time generator, based on the current environment - */ - public function getGenerator(): TimeGeneratorInterface - { - return new DefaultTimeGenerator( - $this->nodeProvider, - $this->timeConverter, - $this->timeProvider - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php deleted file mode 100644 index 18f21c4b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Generator; - -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * A time generator generates strings of binary data based on a node ID, - * clock sequence, and the current time - */ -interface TimeGeneratorInterface -{ - /** - * Generate a binary string from a node ID, clock sequence, and current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return string A binary string - */ - public function generate($node = null, ?int $clockSeq = null): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/Fields.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/Fields.php deleted file mode 100644 index d8a1a2b1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/Fields.php +++ /dev/null @@ -1,194 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Guid; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Fields\SerializableFieldsTrait; -use Ramsey\Uuid\Rfc4122\FieldsInterface; -use Ramsey\Uuid\Rfc4122\NilTrait; -use Ramsey\Uuid\Rfc4122\VariantTrait; -use Ramsey\Uuid\Rfc4122\VersionTrait; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Uuid; - -use function bin2hex; -use function dechex; -use function hexdec; -use function pack; -use function sprintf; -use function str_pad; -use function strlen; -use function substr; -use function unpack; - -use const STR_PAD_LEFT; - -/** - * GUIDs are comprised of a set of named fields, according to RFC 4122 - * - * @see Guid - * - * @psalm-immutable - */ -final class Fields implements FieldsInterface -{ - use NilTrait; - use SerializableFieldsTrait; - use VariantTrait; - use VersionTrait; - - /** - * @var string - */ - private $bytes; - - /** - * @param string $bytes A 16-byte binary string representation of a UUID - * - * @throws InvalidArgumentException if the byte string is not exactly 16 bytes - * @throws InvalidArgumentException if the byte string does not represent a GUID - * @throws InvalidArgumentException if the byte string does not contain a valid version - */ - public function __construct(string $bytes) - { - if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($bytes) . ' bytes' - ); - } - - $this->bytes = $bytes; - - if (!$this->isCorrectVariant()) { - throw new InvalidArgumentException( - 'The byte string received does not conform to the RFC ' - . '4122 or Microsoft Corporation variants' - ); - } - - if (!$this->isCorrectVersion()) { - throw new InvalidArgumentException( - 'The byte string received does not contain a valid version' - ); - } - } - - public function getBytes(): string - { - return $this->bytes; - } - - public function getTimeLow(): Hexadecimal - { - // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v*', - hexdec(bin2hex(substr($this->bytes, 2, 2))), - hexdec(bin2hex(substr($this->bytes, 0, 2))) - ) - ); - - return new Hexadecimal((string) ($hex[1] ?? '')); - } - - public function getTimeMid(): Hexadecimal - { - // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v', - hexdec(bin2hex(substr($this->bytes, 4, 2))) - ) - ); - - return new Hexadecimal((string) ($hex[1] ?? '')); - } - - public function getTimeHiAndVersion(): Hexadecimal - { - // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v', - hexdec(bin2hex(substr($this->bytes, 6, 2))) - ) - ); - - return new Hexadecimal((string) ($hex[1] ?? '')); - } - - public function getTimestamp(): Hexadecimal - { - return new Hexadecimal(sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - $this->getTimeLow()->toString() - )); - } - - public function getClockSeq(): Hexadecimal - { - $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; - - return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); - } - - public function getClockSeqHiAndReserved(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); - } - - public function getClockSeqLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); - } - - public function getNode(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 10))); - } - - public function getVersion(): ?int - { - if ($this->isNil()) { - return null; - } - - /** @var array $parts */ - $parts = unpack('n*', $this->bytes); - - return ((int) $parts[4] >> 4) & 0x00f; - } - - private function isCorrectVariant(): bool - { - if ($this->isNil()) { - return true; - } - - $variant = $this->getVariant(); - - return $variant === Uuid::RFC_4122 || $variant === Uuid::RESERVED_MICROSOFT; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/Guid.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/Guid.php deleted file mode 100644 index b3ed096a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/Guid.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Guid; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Uuid; - -/** - * Guid represents a UUID with "native" (little-endian) byte order - * - * From Wikipedia: - * - * > The first three fields are unsigned 32- and 16-bit integers and are subject - * > to swapping, while the last two fields consist of uninterpreted bytes, not - * > subject to swapping. This byte swapping applies even for versions 3, 4, and - * > 5, where the canonical fields do not correspond to the content of the UUID. - * - * The first three fields of a GUID are encoded in little-endian byte order, - * while the last three fields are in network (big-endian) byte order. This is - * according to the history of the Microsoft definition of a GUID. - * - * According to the .NET Guid.ToByteArray method documentation: - * - * > Note that the order of bytes in the returned byte array is different from - * > the string representation of a Guid value. The order of the beginning - * > four-byte group and the next two two-byte groups is reversed, whereas the - * > order of the last two-byte group and the closing six-byte group is the - * > same. - * - * @link https://en.wikipedia.org/wiki/Universally_unique_identifier#Variants UUID Variants on Wikipedia - * @link https://docs.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid Windows GUID structure - * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid .NET Guid Struct - * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid.tobytearray .NET Guid.ToByteArray Method - * - * @psalm-immutable - */ -final class Guid extends Uuid -{ - public function __construct( - Fields $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/GuidBuilder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/GuidBuilder.php deleted file mode 100644 index 758dd6b7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Guid/GuidBuilder.php +++ /dev/null @@ -1,89 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Guid; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\UuidInterface; -use Throwable; - -/** - * GuidBuilder builds instances of Guid - * - * @see Guid - * - * @psalm-immutable - */ -class GuidBuilder implements UuidBuilderInterface -{ - /** - * @var NumberConverterInterface - */ - private $numberConverter; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Guid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps - */ - public function __construct( - NumberConverterInterface $numberConverter, - TimeConverterInterface $timeConverter - ) { - $this->numberConverter = $numberConverter; - $this->timeConverter = $timeConverter; - } - - /** - * Builds and returns a Guid - * - * @param CodecInterface $codec The codec to use for building this Guid instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return Guid The GuidBuilder returns an instance of Ramsey\Uuid\Guid\Guid - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - try { - return new Guid( - $this->buildFields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); - } catch (Throwable $e) { - throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Proxy method to allow injecting a mock, for testing - */ - protected function buildFields(string $bytes): Fields - { - return new Fields($bytes); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php deleted file mode 100644 index 8ba75796..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php +++ /dev/null @@ -1,575 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Lazy; - -use DateTimeInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Fields\FieldsInterface; -use Ramsey\Uuid\Nonstandard\UuidV6; -use Ramsey\Uuid\Rfc4122\UuidV1; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\UuidFactory; -use Ramsey\Uuid\UuidInterface; -use ValueError; - -use function assert; -use function bin2hex; -use function hex2bin; -use function sprintf; -use function str_replace; -use function substr; - -/** - * Lazy version of a UUID: its format has not been determined yet, so it is mostly only usable for string/bytes - * conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of - * increased overhead for more advanced UUID operations. - * - * @internal this type is used internally for performance reasons, and is not supposed to be directly referenced - * in consumer libraries. - * - * @psalm-immutable - * - * Note: the {@see FieldsInterface} does not declare methods that deprecated API - * relies upon: the API has been ported from the {@see \Ramsey\Uuid\Uuid} definition, - * and is deprecated anyway. - * Note: the deprecated API from {@see \Ramsey\Uuid\Uuid} is in use here (on purpose): it will be removed - * once the deprecated API is gone from this class too. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - */ -final class LazyUuidFromString implements UuidInterface -{ - public const VALID_REGEX = '/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/ms'; - /** - * @var string - * @psalm-var non-empty-string - */ - private $uuid; - /** @var UuidInterface|null */ - private $unwrapped; - - /** @psalm-param non-empty-string $uuid */ - public function __construct(string $uuid) - { - $this->uuid = $uuid; - } - - /** @psalm-pure */ - public static function fromBytes(string $bytes): self - { - $base16Uuid = bin2hex($bytes); - - return new self( - substr($base16Uuid, 0, 8) - . '-' - . substr($base16Uuid, 8, 4) - . '-' - . substr($base16Uuid, 12, 4) - . '-' - . substr($base16Uuid, 16, 4) - . '-' - . substr($base16Uuid, 20, 12) - ); - } - - public function serialize(): string - { - return $this->uuid; - } - - /** - * @return array{string: string} - * - * @psalm-return array{string: non-empty-string} - */ - public function __serialize(): array - { - return ['string' => $this->uuid]; - } - - /** - * {@inheritDoc} - * - * @param string $serialized - * - * @psalm-param non-empty-string $serialized - */ - public function unserialize($serialized): void - { - $this->uuid = $serialized; - } - - /** - * @param array{string: string} $data - * - * @psalm-param array{string: non-empty-string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getNumberConverter(): NumberConverterInterface - { - return ($this->unwrapped ?? $this->unwrap()) - ->getNumberConverter(); - } - - /** - * {@inheritDoc} - * - * @psalm-suppress DeprecatedMethod - */ - public function getFieldsHex(): array - { - return ($this->unwrapped ?? $this->unwrap()) - ->getFieldsHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getClockSeqHiAndReservedHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSeqHiAndReservedHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getClockSeqLowHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSeqLowHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getClockSequenceHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSequenceHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getDateTime(): DateTimeInterface - { - return ($this->unwrapped ?? $this->unwrap()) - ->getDateTime(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getLeastSignificantBitsHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getLeastSignificantBitsHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getMostSignificantBitsHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getMostSignificantBitsHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getNodeHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getNodeHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimeHiAndVersionHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeHiAndVersionHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimeLowHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeLowHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimeMidHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeMidHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getTimestampHex(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimestampHex(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getUrn(): string - { - return ($this->unwrapped ?? $this->unwrap()) - ->getUrn(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getVariant(): ?int - { - return ($this->unwrapped ?? $this->unwrap()) - ->getVariant(); - } - - /** @psalm-suppress DeprecatedMethod */ - public function getVersion(): ?int - { - return ($this->unwrapped ?? $this->unwrap()) - ->getVersion(); - } - - public function compareTo(UuidInterface $other): int - { - return ($this->unwrapped ?? $this->unwrap()) - ->compareTo($other); - } - - public function equals(?object $other): bool - { - if (! $other instanceof UuidInterface) { - return false; - } - - return $this->uuid === $other->toString(); - } - - /** - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificReturnType - * @psalm-suppress LessSpecificReturnStatement we know that {@see self::$uuid} is a non-empty string, so - * we know that {@see hex2bin} will retrieve a non-empty string too. - */ - public function getBytes(): string - { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return (string) hex2bin(str_replace('-', '', $this->uuid)); - } - - public function getFields(): FieldsInterface - { - return ($this->unwrapped ?? $this->unwrap()) - ->getFields(); - } - - public function getHex(): Hexadecimal - { - return ($this->unwrapped ?? $this->unwrap()) - ->getHex(); - } - - public function getInteger(): IntegerObject - { - return ($this->unwrapped ?? $this->unwrap()) - ->getInteger(); - } - - public function toString(): string - { - return $this->uuid; - } - - public function __toString(): string - { - return $this->uuid; - } - - public function jsonSerialize(): string - { - return $this->uuid; - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getClockSeqHiAndReserved(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeqHiAndReserved() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getClockSeqLow(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeqLow() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getClockSequence(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeq() - ->toString() - ); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getLeastSignificantBits(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex(substr($instance->getHex()->toString(), 16)); - } - - /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getMostSignificantBits(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex(substr($instance->getHex()->toString(), 0, 16)); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getNode()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getNode(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getNode() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimeHiAndVersion(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeHiAndVersion() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimeLow(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeLow() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimeMid(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeMid() - ->toString() - ); - } - - /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall - */ - public function getTimestamp(): string - { - $instance = ($this->unwrapped ?? $this->unwrap()); - $fields = $instance->getFields(); - - if ($fields->getVersion() !== 1) { - throw new UnsupportedOperationException('Not a time-based UUID'); - } - - return $instance->getNumberConverter() - ->fromHex($fields->getTimestamp()->toString()); - } - - public function toUuidV1(): UuidV1 - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - if ($instance instanceof UuidV1) { - return $instance; - } - - assert($instance instanceof UuidV6); - - return $instance->toUuidV1(); - } - - public function toUuidV6(): UuidV6 - { - $instance = ($this->unwrapped ?? $this->unwrap()); - - assert($instance instanceof UuidV6); - - return $instance; - } - - /** - * @psalm-suppress ImpureMethodCall the retrieval of the factory is a clear violation of purity here: this is a - * known pitfall of the design of this library, where a value object contains - * a mutable reference to a factory. We use a fixed factory here, so the violation - * will not have real-world effects, as this object is only instantiated with the - * default factory settings/features. - * @psalm-suppress InaccessibleProperty property {@see $unwrapped} is used as a cache: we don't expose it to the - * outside world, so we should be fine here. - */ - private function unwrap(): UuidInterface - { - return $this->unwrapped = (new UuidFactory()) - ->fromString($this->uuid); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/BrickMathCalculator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/BrickMathCalculator.php deleted file mode 100644 index f2d86788..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/BrickMathCalculator.php +++ /dev/null @@ -1,144 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Math; - -use Brick\Math\BigDecimal; -use Brick\Math\BigInteger; -use Brick\Math\Exception\MathException; -use Brick\Math\RoundingMode as BrickMathRounding; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Type\Decimal; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\NumberInterface; - -/** - * A calculator using the brick/math library for arbitrary-precision arithmetic - * - * @psalm-immutable - */ -final class BrickMathCalculator implements CalculatorInterface -{ - private const ROUNDING_MODE_MAP = [ - RoundingMode::UNNECESSARY => BrickMathRounding::UNNECESSARY, - RoundingMode::UP => BrickMathRounding::UP, - RoundingMode::DOWN => BrickMathRounding::DOWN, - RoundingMode::CEILING => BrickMathRounding::CEILING, - RoundingMode::FLOOR => BrickMathRounding::FLOOR, - RoundingMode::HALF_UP => BrickMathRounding::HALF_UP, - RoundingMode::HALF_DOWN => BrickMathRounding::HALF_DOWN, - RoundingMode::HALF_CEILING => BrickMathRounding::HALF_CEILING, - RoundingMode::HALF_FLOOR => BrickMathRounding::HALF_FLOOR, - RoundingMode::HALF_EVEN => BrickMathRounding::HALF_EVEN, - ]; - - public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface - { - $sum = BigInteger::of($augend->toString()); - - foreach ($addends as $addend) { - $sum = $sum->plus($addend->toString()); - } - - return new IntegerObject((string) $sum); - } - - public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahends): NumberInterface - { - $difference = BigInteger::of($minuend->toString()); - - foreach ($subtrahends as $subtrahend) { - $difference = $difference->minus($subtrahend->toString()); - } - - return new IntegerObject((string) $difference); - } - - public function multiply(NumberInterface $multiplicand, NumberInterface ...$multipliers): NumberInterface - { - $product = BigInteger::of($multiplicand->toString()); - - foreach ($multipliers as $multiplier) { - $product = $product->multipliedBy($multiplier->toString()); - } - - return new IntegerObject((string) $product); - } - - public function divide( - int $roundingMode, - int $scale, - NumberInterface $dividend, - NumberInterface ...$divisors - ): NumberInterface { - $brickRounding = $this->getBrickRoundingMode($roundingMode); - - $quotient = BigDecimal::of($dividend->toString()); - - foreach ($divisors as $divisor) { - $quotient = $quotient->dividedBy($divisor->toString(), $scale, $brickRounding); - } - - if ($scale === 0) { - return new IntegerObject((string) $quotient->toBigInteger()); - } - - return new Decimal((string) $quotient); - } - - public function fromBase(string $value, int $base): IntegerObject - { - try { - return new IntegerObject((string) BigInteger::fromBase($value, $base)); - } catch (MathException | \InvalidArgumentException $exception) { - throw new InvalidArgumentException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } - - public function toBase(IntegerObject $value, int $base): string - { - try { - return BigInteger::of($value->toString())->toBase($base); - } catch (MathException | \InvalidArgumentException $exception) { - throw new InvalidArgumentException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - } - - public function toHexadecimal(IntegerObject $value): Hexadecimal - { - return new Hexadecimal($this->toBase($value, 16)); - } - - public function toInteger(Hexadecimal $value): IntegerObject - { - return $this->fromBase($value->toString(), 16); - } - - /** - * Maps ramsey/uuid rounding modes to those used by brick/math - */ - private function getBrickRoundingMode(int $roundingMode): int - { - return self::ROUNDING_MODE_MAP[$roundingMode] ?? 0; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/CalculatorInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/CalculatorInterface.php deleted file mode 100644 index f03645d0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/CalculatorInterface.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Math; - -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\NumberInterface; - -/** - * A calculator performs arithmetic operations on numbers - * - * @psalm-immutable - */ -interface CalculatorInterface -{ - /** - * Returns the sum of all the provided parameters - * - * @param NumberInterface $augend The first addend (the integer being added to) - * @param NumberInterface ...$addends The additional integers to a add to the augend - * - * @return NumberInterface The sum of all the parameters - */ - public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface; - - /** - * Returns the difference of all the provided parameters - * - * @param NumberInterface $minuend The integer being subtracted from - * @param NumberInterface ...$subtrahends The integers to subtract from the minuend - * - * @return NumberInterface The difference after subtracting all parameters - */ - public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahends): NumberInterface; - - /** - * Returns the product of all the provided parameters - * - * @param NumberInterface $multiplicand The integer to be multiplied - * @param NumberInterface ...$multipliers The factors by which to multiply the multiplicand - * - * @return NumberInterface The product of multiplying all the provided parameters - */ - public function multiply(NumberInterface $multiplicand, NumberInterface ...$multipliers): NumberInterface; - - /** - * Returns the quotient of the provided parameters divided left-to-right - * - * @param int $roundingMode The RoundingMode constant to use for this operation - * @param int $scale The scale to use for this operation - * @param NumberInterface $dividend The integer to be divided - * @param NumberInterface ...$divisors The integers to divide $dividend by, in - * the order in which the division operations should take place - * (left-to-right) - * - * @return NumberInterface The quotient of dividing the provided parameters left-to-right - */ - public function divide( - int $roundingMode, - int $scale, - NumberInterface $dividend, - NumberInterface ...$divisors - ): NumberInterface; - - /** - * Converts a value from an arbitrary base to a base-10 integer value - * - * @param string $value The value to convert - * @param int $base The base to convert from (i.e., 2, 16, 32, etc.) - * - * @return IntegerObject The base-10 integer value of the converted value - */ - public function fromBase(string $value, int $base): IntegerObject; - - /** - * Converts a base-10 integer value to an arbitrary base - * - * @param IntegerObject $value The integer value to convert - * @param int $base The base to convert to (i.e., 2, 16, 32, etc.) - * - * @return string The value represented in the specified base - */ - public function toBase(IntegerObject $value, int $base): string; - - /** - * Converts an Integer instance to a Hexadecimal instance - */ - public function toHexadecimal(IntegerObject $value): Hexadecimal; - - /** - * Converts a Hexadecimal instance to an Integer instance - */ - public function toInteger(Hexadecimal $value): IntegerObject; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/RoundingMode.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/RoundingMode.php deleted file mode 100644 index e710270d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Math/RoundingMode.php +++ /dev/null @@ -1,146 +0,0 @@ -= 0.5; otherwise, behaves - * as for DOWN. Note that this is the rounding mode commonly taught at - * school. - */ - public const HALF_UP = 5; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round down. - * - * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves - * as for DOWN. - */ - public const HALF_DOWN = 6; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round towards positive infinity. - * - * If the result is positive, behaves as for HALF_UP; if negative, behaves - * as for HALF_DOWN. - */ - public const HALF_CEILING = 7; - - /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round towards negative infinity. - * - * If the result is positive, behaves as for HALF_DOWN; if negative, behaves - * as for HALF_UP. - */ - public const HALF_FLOOR = 8; - - /** - * Rounds towards the "nearest neighbor" unless both neighbors are - * equidistant, in which case rounds towards the even neighbor. - * - * Behaves as for HALF_UP if the digit to the left of the discarded fraction - * is odd; behaves as for HALF_DOWN if it's even. - * - * Note that this is the rounding mode that statistically minimizes - * cumulative error when applied repeatedly over a sequence of calculations. - * It is sometimes known as "Banker's rounding", and is chiefly used in the - * USA. - */ - public const HALF_EVEN = 9; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/Fields.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/Fields.php deleted file mode 100644 index 927bc6a2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/Fields.php +++ /dev/null @@ -1,133 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Fields\SerializableFieldsTrait; -use Ramsey\Uuid\Rfc4122\FieldsInterface; -use Ramsey\Uuid\Rfc4122\VariantTrait; -use Ramsey\Uuid\Type\Hexadecimal; - -use function bin2hex; -use function dechex; -use function hexdec; -use function sprintf; -use function str_pad; -use function strlen; -use function substr; - -use const STR_PAD_LEFT; - -/** - * Nonstandard UUID fields do not conform to the RFC 4122 standard - * - * Since some systems may create nonstandard UUIDs, this implements the - * Rfc4122\FieldsInterface, so that functionality of a nonstandard UUID is not - * degraded, in the event these UUIDs are expected to contain RFC 4122 fields. - * - * Internally, this class represents the fields together as a 16-byte binary - * string. - * - * @psalm-immutable - */ -final class Fields implements FieldsInterface -{ - use SerializableFieldsTrait; - use VariantTrait; - - /** - * @var string - */ - private $bytes; - - /** - * @param string $bytes A 16-byte binary string representation of a UUID - * - * @throws InvalidArgumentException if the byte string is not exactly 16 bytes - */ - public function __construct(string $bytes) - { - if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($bytes) . ' bytes' - ); - } - - $this->bytes = $bytes; - } - - public function getBytes(): string - { - return $this->bytes; - } - - public function getClockSeq(): Hexadecimal - { - $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; - - return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); - } - - public function getClockSeqHiAndReserved(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); - } - - public function getClockSeqLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); - } - - public function getNode(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 10))); - } - - public function getTimeHiAndVersion(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 6, 2))); - } - - public function getTimeLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 0, 4))); - } - - public function getTimeMid(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 4, 2))); - } - - public function getTimestamp(): Hexadecimal - { - return new Hexadecimal(sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - $this->getTimeLow()->toString() - )); - } - - public function getVersion(): ?int - { - return null; - } - - public function isNil(): bool - { - return false; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/Uuid.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/Uuid.php deleted file mode 100644 index 715f8255..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/Uuid.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Uuid as BaseUuid; - -/** - * Nonstandard\Uuid is a UUID that doesn't conform to RFC 4122 - * - * @psalm-immutable - */ -final class Uuid extends BaseUuid -{ - public function __construct( - Fields $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php deleted file mode 100644 index 0c892773..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\UuidInterface; -use Throwable; - -/** - * Nonstandard\UuidBuilder builds instances of Nonstandard\Uuid - * - * @psalm-immutable - */ -class UuidBuilder implements UuidBuilderInterface -{ - /** - * @var NumberConverterInterface - */ - private $numberConverter; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Nonstandard\Uuid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps - */ - public function __construct( - NumberConverterInterface $numberConverter, - TimeConverterInterface $timeConverter - ) { - $this->numberConverter = $numberConverter; - $this->timeConverter = $timeConverter; - } - - /** - * Builds and returns a Nonstandard\Uuid - * - * @param CodecInterface $codec The codec to use for building this instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return Uuid The Nonstandard\UuidBuilder returns an instance of - * Nonstandard\Uuid - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - try { - return new Uuid( - $this->buildFields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); - } catch (Throwable $e) { - throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Proxy method to allow injecting a mock, for testing - */ - protected function buildFields(string $bytes): Fields - { - return new Fields($bytes); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/UuidV6.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/UuidV6.php deleted file mode 100644 index 05586b3e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Nonstandard/UuidV6.php +++ /dev/null @@ -1,133 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Nonstandard; - -use DateTimeImmutable; -use DateTimeInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\DateTimeException; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Lazy\LazyUuidFromString; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Rfc4122\UuidInterface; -use Ramsey\Uuid\Rfc4122\UuidV1; -use Ramsey\Uuid\Uuid; -use Throwable; - -use function hex2bin; -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * Ordered-time, or version 6, UUIDs include timestamp, clock sequence, and node - * values that are combined into a 128-bit unsigned integer - * - * @link https://github.com/uuid6/uuid6-ietf-draft UUID version 6 IETF draft - * @link http://gh.peabody.io/uuidv6/ "Version 6" UUIDs - * - * @psalm-immutable - */ -final class UuidV6 extends Uuid implements UuidInterface -{ - /** - * Creates a version 6 (time-based) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_PEABODY) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV6 must represent a ' - . 'version 6 (ordered-time) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } - - /** - * Returns a DateTimeInterface object representing the timestamp associated - * with the UUID - * - * @return DateTimeImmutable A PHP DateTimeImmutable instance representing - * the timestamp of a version 6 UUID - */ - public function getDateTime(): DateTimeInterface - { - $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); - - try { - return new DateTimeImmutable( - '@' - . $time->getSeconds()->toString() - . '.' - . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) - ); - } catch (Throwable $e) { - throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Converts this UUID into an instance of a version 1 UUID - */ - public function toUuidV1(): UuidV1 - { - $hex = $this->getHex()->toString(); - $hex = substr($hex, 7, 5) - . substr($hex, 13, 3) - . substr($hex, 3, 4) - . '1' . substr($hex, 0, 3) - . substr($hex, 16); - - /** @var LazyUuidFromString $uuid */ - $uuid = Uuid::fromBytes((string) hex2bin($hex)); - - return $uuid->toUuidV1(); - } - - /** - * Converts a version 1 UUID into an instance of a version 6 UUID - */ - public static function fromUuidV1(UuidV1 $uuidV1): UuidV6 - { - $hex = $uuidV1->getHex()->toString(); - $hex = substr($hex, 13, 3) - . substr($hex, 8, 4) - . substr($hex, 0, 5) - . '6' . substr($hex, 5, 3) - . substr($hex, 16); - - /** @var LazyUuidFromString $uuid */ - $uuid = Uuid::fromBytes((string) hex2bin($hex)); - - return $uuid->toUuidV6(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php deleted file mode 100644 index 6d6240b7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php +++ /dev/null @@ -1,234 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Dce; - -use Ramsey\Uuid\Exception\DceSecurityException; -use Ramsey\Uuid\Provider\DceSecurityProviderInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -use function escapeshellarg; -use function preg_split; -use function str_getcsv; -use function strpos; -use function strrpos; -use function strtolower; -use function strtoupper; -use function substr; -use function trim; - -use const PREG_SPLIT_NO_EMPTY; - -/** - * SystemDceSecurityProvider retrieves the user or group identifiers from the system - */ -class SystemDceSecurityProvider implements DceSecurityProviderInterface -{ - /** - * @throws DceSecurityException if unable to get a user identifier - * - * @inheritDoc - */ - public function getUid(): IntegerObject - { - static $uid = null; - - if ($uid instanceof IntegerObject) { - return $uid; - } - - if ($uid === null) { - $uid = $this->getSystemUid(); - } - - if ($uid === '') { - throw new DceSecurityException( - 'Unable to get a user identifier using the system DCE ' - . 'Security provider; please provide a custom identifier or ' - . 'use a different provider' - ); - } - - $uid = new IntegerObject($uid); - - return $uid; - } - - /** - * @throws DceSecurityException if unable to get a group identifier - * - * @inheritDoc - */ - public function getGid(): IntegerObject - { - static $gid = null; - - if ($gid instanceof IntegerObject) { - return $gid; - } - - if ($gid === null) { - $gid = $this->getSystemGid(); - } - - if ($gid === '') { - throw new DceSecurityException( - 'Unable to get a group identifier using the system DCE ' - . 'Security provider; please provide a custom identifier or ' - . 'use a different provider' - ); - } - - $gid = new IntegerObject($gid); - - return $gid; - } - - /** - * Returns the UID from the system - */ - private function getSystemUid(): string - { - if (!$this->hasShellExec()) { - return ''; - } - - switch ($this->getOs()) { - case 'WIN': - return $this->getWindowsUid(); - case 'DAR': - case 'FRE': - case 'LIN': - default: - return trim((string) shell_exec('id -u')); - } - } - - /** - * Returns the GID from the system - */ - private function getSystemGid(): string - { - if (!$this->hasShellExec()) { - return ''; - } - - switch ($this->getOs()) { - case 'WIN': - return $this->getWindowsGid(); - case 'DAR': - case 'FRE': - case 'LIN': - default: - return trim((string) shell_exec('id -g')); - } - } - - /** - * Returns true if shell_exec() is available for use - */ - private function hasShellExec(): bool - { - $disabledFunctions = strtolower((string) ini_get('disable_functions')); - - return strpos($disabledFunctions, 'shell_exec') === false; - } - - /** - * Returns the PHP_OS string - */ - private function getOs(): string - { - return strtoupper(substr(constant('PHP_OS'), 0, 3)); - } - - /** - * Returns the user identifier for a user on a Windows system - * - * Windows does not have the same concept as an effective POSIX UID for the - * running script. Instead, each user is uniquely identified by an SID - * (security identifier). The SID includes three 32-bit unsigned integers - * that make up a unique domain identifier, followed by an RID (relative - * identifier) that we will use as the UID. The primary caveat is that this - * UID may not be unique to the system, since it is, instead, unique to the - * domain. - * - * @link https://www.lifewire.com/what-is-an-sid-number-2626005 What Is an SID Number? - * @link https://bit.ly/30vE7NM Well-known SID Structures - * @link https://bit.ly/2FWcYKJ Well-known security identifiers in Windows operating systems - * @link https://www.windows-commandline.com/get-sid-of-user/ Get SID of user - */ - private function getWindowsUid(): string - { - $response = shell_exec('whoami /user /fo csv /nh'); - - if ($response === null) { - return ''; - } - - $sid = str_getcsv(trim((string) $response))[1] ?? ''; - - if (($lastHyphen = strrpos($sid, '-')) === false) { - return ''; - } - - return trim(substr($sid, $lastHyphen + 1)); - } - - /** - * Returns a group identifier for a user on a Windows system - * - * Since Windows does not have the same concept as an effective POSIX GID - * for the running script, we will get the local group memberships for the - * user running the script. Then, we will get the SID (security identifier) - * for the first group that appears in that list. Finally, we will return - * the RID (relative identifier) for the group and use that as the GID. - * - * @link https://www.windows-commandline.com/list-of-user-groups-command-line/ List of user groups command line - */ - private function getWindowsGid(): string - { - $response = shell_exec('net user %username% | findstr /b /i "Local Group Memberships"'); - - if ($response === null) { - return ''; - } - - /** @var string[] $userGroups */ - $userGroups = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); - - $firstGroup = trim($userGroups[1] ?? '', "* \t\n\r\0\x0B"); - - if ($firstGroup === '') { - return ''; - } - - $response = shell_exec('wmic group get name,sid | findstr /b /i ' . escapeshellarg($firstGroup)); - - if ($response === null) { - return ''; - } - - /** @var string[] $userGroup */ - $userGroup = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); - - $sid = $userGroup[1] ?? ''; - - if (($lastHyphen = strrpos($sid, '-')) === false) { - return ''; - } - - return trim((string) substr($sid, $lastHyphen + 1)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php deleted file mode 100644 index 8325da69..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider; - -use Ramsey\Uuid\Rfc4122\UuidV2; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * A DCE provider provides access to local domain identifiers for version 2, - * DCE Security, UUIDs - * - * @see UuidV2 - */ -interface DceSecurityProviderInterface -{ - /** - * Returns a user identifier for the system - * - * @link https://en.wikipedia.org/wiki/User_identifier User identifier - */ - public function getUid(): IntegerObject; - - /** - * Returns a group identifier for the system - * - * @link https://en.wikipedia.org/wiki/Group_identifier Group identifier - */ - public function getGid(): IntegerObject; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php deleted file mode 100644 index cad01045..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\NodeException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * FallbackNodeProvider retrieves the system node ID by stepping through a list - * of providers until a node ID can be obtained - */ -class FallbackNodeProvider implements NodeProviderInterface -{ - /** - * @var NodeProviderCollection - */ - private $nodeProviders; - - /** - * @param NodeProviderCollection $providers Array of node providers - */ - public function __construct(NodeProviderCollection $providers) - { - $this->nodeProviders = $providers; - } - - public function getNode(): Hexadecimal - { - $lastProviderException = null; - - foreach ($this->nodeProviders as $provider) { - try { - return $provider->getNode(); - } catch (NodeException $exception) { - $lastProviderException = $exception; - - continue; - } - } - - throw new NodeException( - 'Unable to find a suitable node provider', - 0, - $lastProviderException - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php deleted file mode 100644 index 536cb603..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Collection\AbstractCollection; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * A collection of NodeProviderInterface objects - * - * @extends AbstractCollection - */ -class NodeProviderCollection extends AbstractCollection -{ - public function getType(): string - { - return NodeProviderInterface::class; - } - - /** - * Re-constructs the object from its serialized form - * - * @param string $serialized The serialized PHP string to unserialize into - * a UuidInterface instance - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress RedundantConditionGivenDocblockType - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, [ - 'allowed_classes' => [ - Hexadecimal::class, - RandomNodeProvider::class, - StaticNodeProvider::class, - SystemNodeProvider::class, - ], - ]); - - $this->data = array_filter( - $data, - function ($unserialized): bool { - return $unserialized instanceof NodeProviderInterface; - } - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php deleted file mode 100644 index 76141361..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\RandomSourceException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Throwable; - -use function bin2hex; -use function dechex; -use function hex2bin; -use function hexdec; -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * RandomNodeProvider generates a random node ID - * - * @link http://tools.ietf.org/html/rfc4122#section-4.5 RFC 4122, § 4.5: Node IDs that Do Not Identify the Host - */ -class RandomNodeProvider implements NodeProviderInterface -{ - public function getNode(): Hexadecimal - { - try { - $nodeBytes = random_bytes(6); - } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); - } - - // Split the node bytes for math on 32-bit systems. - $nodeMsb = substr($nodeBytes, 0, 3); - $nodeLsb = substr($nodeBytes, 3); - - // Set the multicast bit; see RFC 4122, section 4.5. - $nodeMsb = hex2bin( - str_pad( - dechex(hexdec(bin2hex($nodeMsb)) | 0x010000), - 6, - '0', - STR_PAD_LEFT - ) - ); - - // Recombine the node bytes. - $node = $nodeMsb . $nodeLsb; - - return new Hexadecimal(str_pad(bin2hex($node), 12, '0', STR_PAD_LEFT)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php deleted file mode 100644 index 51f1b02e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -use function dechex; -use function hexdec; -use function str_pad; -use function substr; - -use const STR_PAD_LEFT; - -/** - * StaticNodeProvider provides a static node value with the multicast bit set - * - * @link http://tools.ietf.org/html/rfc4122#section-4.5 RFC 4122, § 4.5: Node IDs that Do Not Identify the Host - */ -class StaticNodeProvider implements NodeProviderInterface -{ - /** - * @var Hexadecimal - */ - private $node; - - /** - * @param Hexadecimal $node The static node value to use - */ - public function __construct(Hexadecimal $node) - { - if (strlen($node->toString()) > 12) { - throw new InvalidArgumentException( - 'Static node value cannot be greater than 12 hexadecimal characters' - ); - } - - $this->node = $this->setMulticastBit($node); - } - - public function getNode(): Hexadecimal - { - return $this->node; - } - - /** - * Set the multicast bit for the static node value - */ - private function setMulticastBit(Hexadecimal $node): Hexadecimal - { - $nodeHex = str_pad($node->toString(), 12, '0', STR_PAD_LEFT); - $firstOctet = substr($nodeHex, 0, 2); - - $firstOctet = str_pad( - dechex(hexdec($firstOctet) | 0x01), - 2, - '0', - STR_PAD_LEFT - ); - - return new Hexadecimal($firstOctet . substr($nodeHex, 2)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php deleted file mode 100644 index d512f22a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php +++ /dev/null @@ -1,173 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Node; - -use Ramsey\Uuid\Exception\NodeException; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -use function array_filter; -use function array_map; -use function array_walk; -use function count; -use function ob_get_clean; -use function ob_start; -use function preg_match; -use function preg_match_all; -use function reset; -use function str_replace; -use function strpos; -use function strtolower; -use function strtoupper; -use function substr; - -use const GLOB_NOSORT; -use const PREG_PATTERN_ORDER; - -/** - * SystemNodeProvider retrieves the system node ID, if possible - * - * The system node ID, or host ID, is often the same as the MAC address for a - * network interface on the host. - */ -class SystemNodeProvider implements NodeProviderInterface -{ - /** - * Pattern to match nodes in ifconfig and ipconfig output. - */ - private const IFCONFIG_PATTERN = '/[^:]([0-9a-f]{2}([:-])[0-9a-f]{2}(\2[0-9a-f]{2}){4})[^:]/i'; - - /** - * Pattern to match nodes in sysfs stream output. - */ - private const SYSFS_PATTERN = '/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i'; - - public function getNode(): Hexadecimal - { - $node = $this->getNodeFromSystem(); - - if ($node === '') { - throw new NodeException( - 'Unable to fetch a node for this system' - ); - } - - return new Hexadecimal($node); - } - - /** - * Returns the system node, if it can find it - */ - protected function getNodeFromSystem(): string - { - static $node = null; - - if ($node !== null) { - return (string) $node; - } - - // First, try a Linux-specific approach. - $node = $this->getSysfs(); - - if ($node === '') { - // Search ifconfig output for MAC addresses & return the first one. - $node = $this->getIfconfig(); - } - - $node = str_replace([':', '-'], '', $node); - - return $node; - } - - /** - * Returns the network interface configuration for the system - * - * @codeCoverageIgnore - */ - protected function getIfconfig(): string - { - $disabledFunctions = strtolower((string) ini_get('disable_functions')); - - if (strpos($disabledFunctions, 'passthru') !== false) { - return ''; - } - - ob_start(); - switch (strtoupper(substr(constant('PHP_OS'), 0, 3))) { - case 'WIN': - passthru('ipconfig /all 2>&1'); - - break; - case 'DAR': - passthru('ifconfig 2>&1'); - - break; - case 'FRE': - passthru('netstat -i -f link 2>&1'); - - break; - case 'LIN': - default: - passthru('netstat -ie 2>&1'); - - break; - } - - $ifconfig = (string) ob_get_clean(); - - $node = ''; - if (preg_match_all(self::IFCONFIG_PATTERN, $ifconfig, $matches, PREG_PATTERN_ORDER)) { - $node = $matches[1][0] ?? ''; - } - - return $node; - } - - /** - * Returns MAC address from the first system interface via the sysfs interface - */ - protected function getSysfs(): string - { - $mac = ''; - - if (strtoupper(constant('PHP_OS')) === 'LINUX') { - $addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT); - - if ($addressPaths === false || count($addressPaths) === 0) { - return ''; - } - - $macs = []; - - array_walk($addressPaths, function (string $addressPath) use (&$macs): void { - if (is_readable($addressPath)) { - $macs[] = file_get_contents($addressPath); - } - }); - - $macs = array_map('trim', $macs); - - // Remove invalid entries. - $macs = array_filter($macs, function (string $address) { - return $address !== '00:00:00:00:00:00' - && preg_match(self::SYSFS_PATTERN, $address); - }); - - $mac = reset($macs); - } - - return (string) $mac; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php deleted file mode 100644 index d536b455..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider; - -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * A node provider retrieves or generates a node ID - */ -interface NodeProviderInterface -{ - /** - * Returns a node ID - * - * @return Hexadecimal The node ID as a hexadecimal string - */ - public function getNode(): Hexadecimal; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php deleted file mode 100644 index b8bfd721..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Time; - -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; - -/** - * FixedTimeProvider uses an known time to provide the time - * - * This provider allows the use of a previously-generated, or known, time - * when generating time-based UUIDs. - */ -class FixedTimeProvider implements TimeProviderInterface -{ - /** - * @var Time - */ - private $fixedTime; - - public function __construct(Time $time) - { - $this->fixedTime = $time; - } - - /** - * Sets the `usec` component of the time - * - * @param int|string|IntegerObject $value The `usec` value to set - */ - public function setUsec($value): void - { - $this->fixedTime = new Time($this->fixedTime->getSeconds(), $value); - } - - /** - * Sets the `sec` component of the time - * - * @param int|string|IntegerObject $value The `sec` value to set - */ - public function setSec($value): void - { - $this->fixedTime = new Time($value, $this->fixedTime->getMicroseconds()); - } - - public function getTime(): Time - { - return $this->fixedTime; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php deleted file mode 100644 index 3a1e09cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider\Time; - -use Ramsey\Uuid\Provider\TimeProviderInterface; -use Ramsey\Uuid\Type\Time; - -use function gettimeofday; - -/** - * SystemTimeProvider retrieves the current time using built-in PHP functions - */ -class SystemTimeProvider implements TimeProviderInterface -{ - public function getTime(): Time - { - $time = gettimeofday(); - - return new Time($time['sec'], $time['usec']); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php deleted file mode 100644 index 43588e0b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Provider; - -use Ramsey\Uuid\Type\Time; - -/** - * A time provider retrieves the current time - */ -interface TimeProviderInterface -{ - /** - * Returns a time object - */ - public function getTime(): Time; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/Fields.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/Fields.php deleted file mode 100644 index 2ccc20bb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/Fields.php +++ /dev/null @@ -1,194 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Fields\SerializableFieldsTrait; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Uuid; - -use function bin2hex; -use function dechex; -use function hexdec; -use function sprintf; -use function str_pad; -use function strlen; -use function substr; -use function unpack; - -use const STR_PAD_LEFT; - -/** - * RFC 4122 variant UUIDs are comprised of a set of named fields - * - * Internally, this class represents the fields together as a 16-byte binary - * string. - * - * @psalm-immutable - */ -final class Fields implements FieldsInterface -{ - use NilTrait; - use SerializableFieldsTrait; - use VariantTrait; - use VersionTrait; - - /** - * @var string - */ - private $bytes; - - /** - * @param string $bytes A 16-byte binary string representation of a UUID - * - * @throws InvalidArgumentException if the byte string is not exactly 16 bytes - * @throws InvalidArgumentException if the byte string does not represent an RFC 4122 UUID - * @throws InvalidArgumentException if the byte string does not contain a valid version - */ - public function __construct(string $bytes) - { - if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($bytes) . ' bytes' - ); - } - - $this->bytes = $bytes; - - if (!$this->isCorrectVariant()) { - throw new InvalidArgumentException( - 'The byte string received does not conform to the RFC 4122 variant' - ); - } - - if (!$this->isCorrectVersion()) { - throw new InvalidArgumentException( - 'The byte string received does not contain a valid RFC 4122 version' - ); - } - } - - public function getBytes(): string - { - return $this->bytes; - } - - public function getClockSeq(): Hexadecimal - { - $clockSeq = hexdec(bin2hex(substr($this->bytes, 8, 2))) & 0x3fff; - - return new Hexadecimal(str_pad(dechex($clockSeq), 4, '0', STR_PAD_LEFT)); - } - - public function getClockSeqHiAndReserved(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 8, 1))); - } - - public function getClockSeqLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 9, 1))); - } - - public function getNode(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 10))); - } - - public function getTimeHiAndVersion(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 6, 2))); - } - - public function getTimeLow(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 0, 4))); - } - - public function getTimeMid(): Hexadecimal - { - return new Hexadecimal(bin2hex(substr($this->bytes, 4, 2))); - } - - /** - * Returns the full 60-bit timestamp, without the version - * - * For version 2 UUIDs, the time_low field is the local identifier and - * should not be returned as part of the time. For this reason, we set the - * bottom 32 bits of the timestamp to 0's. As a result, there is some loss - * of fidelity of the timestamp, for version 2 UUIDs. The timestamp can be - * off by a range of 0 to 429.4967295 seconds (or 7 minutes, 9 seconds, and - * 496730 microseconds). - * - * For version 6 UUIDs, the timestamp order is reversed from the typical RFC - * 4122 order (the time bits are in the correct bit order, so that it is - * monotonically increasing). In returning the timestamp value, we put the - * bits in the order: time_low + time_mid + time_hi. - */ - public function getTimestamp(): Hexadecimal - { - switch ($this->getVersion()) { - case Uuid::UUID_TYPE_DCE_SECURITY: - $timestamp = sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - '' - ); - - break; - case Uuid::UUID_TYPE_PEABODY: - $timestamp = sprintf( - '%08s%04s%03x', - $this->getTimeLow()->toString(), - $this->getTimeMid()->toString(), - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff - ); - - break; - default: - $timestamp = sprintf( - '%03x%04s%08s', - hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, - $this->getTimeMid()->toString(), - $this->getTimeLow()->toString() - ); - } - - return new Hexadecimal($timestamp); - } - - public function getVersion(): ?int - { - if ($this->isNil()) { - return null; - } - - /** @var array $parts */ - $parts = unpack('n*', $this->bytes); - - return (int) $parts[4] >> 12; - } - - private function isCorrectVariant(): bool - { - if ($this->isNil()) { - return true; - } - - return $this->getVariant() === Uuid::RFC_4122; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php deleted file mode 100644 index a303525d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php +++ /dev/null @@ -1,126 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Fields\FieldsInterface as BaseFieldsInterface; -use Ramsey\Uuid\Type\Hexadecimal; - -/** - * RFC 4122 defines fields for a specific variant of UUID - * - * The fields of an RFC 4122 variant UUID are: - * - * * **time_low**: The low field of the timestamp, an unsigned 32-bit integer - * * **time_mid**: The middle field of the timestamp, an unsigned 16-bit integer - * * **time_hi_and_version**: The high field of the timestamp multiplexed with - * the version number, an unsigned 16-bit integer - * * **clock_seq_hi_and_reserved**: The high field of the clock sequence - * multiplexed with the variant, an unsigned 8-bit integer - * * **clock_seq_low**: The low field of the clock sequence, an unsigned - * 8-bit integer - * * **node**: The spatially unique node identifier, an unsigned 48-bit - * integer - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1 RFC 4122, § 4.1: Format - * - * @psalm-immutable - */ -interface FieldsInterface extends BaseFieldsInterface -{ - /** - * Returns the full 16-bit clock sequence, with the variant bits (two most - * significant bits) masked out - */ - public function getClockSeq(): Hexadecimal; - - /** - * Returns the high field of the clock sequence multiplexed with the variant - */ - public function getClockSeqHiAndReserved(): Hexadecimal; - - /** - * Returns the low field of the clock sequence - */ - public function getClockSeqLow(): Hexadecimal; - - /** - * Returns the node field - */ - public function getNode(): Hexadecimal; - - /** - * Returns the high field of the timestamp multiplexed with the version - */ - public function getTimeHiAndVersion(): Hexadecimal; - - /** - * Returns the low field of the timestamp - */ - public function getTimeLow(): Hexadecimal; - - /** - * Returns the middle field of the timestamp - */ - public function getTimeMid(): Hexadecimal; - - /** - * Returns the full 60-bit timestamp, without the version - */ - public function getTimestamp(): Hexadecimal; - - /** - * Returns the variant - * - * The variant number describes the layout of the UUID. The variant - * number has the following meaning: - * - * - 0 - Reserved for NCS backward compatibility - * - 2 - The RFC 4122 variant - * - 6 - Reserved, Microsoft Corporation backward compatibility - * - 7 - Reserved for future definition - * - * For RFC 4122 variant UUIDs, this value should always be the integer `2`. - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public function getVariant(): int; - - /** - * Returns the version - * - * The version number describes how the UUID was generated and has the - * following meaning: - * - * 1. Time-based UUID - * 2. DCE security UUID - * 3. Name-based UUID hashed with MD5 - * 4. Randomly generated UUID - * 5. Name-based UUID hashed with SHA-1 - * - * This returns `null` if the UUID is not an RFC 4122 variant, since version - * is only meaningful for this variant. - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public function getVersion(): ?int; - - /** - * Returns true if these fields represent a nil UUID - * - * The nil UUID is special form of UUID that is specified to have all 128 - * bits set to zero. - */ - public function isNil(): bool; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/NilTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/NilTrait.php deleted file mode 100644 index 9a9774d8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/NilTrait.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -/** - * Provides common functionality for nil UUIDs - * - * The nil UUID is special form of UUID that is specified to have all 128 bits - * set to zero. - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.7 RFC 4122, § 4.1.7: Nil UUID - * - * @psalm-immutable - */ -trait NilTrait -{ - /** - * Returns the bytes that comprise the fields - */ - abstract public function getBytes(): string; - - /** - * Returns true if the byte string represents a nil UUID - */ - public function isNil(): bool - { - return $this->getBytes() === "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/NilUuid.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/NilUuid.php deleted file mode 100644 index c49b9945..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/NilUuid.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Uuid; - -/** - * The nil UUID is special form of UUID that is specified to have all 128 bits - * set to zero - * - * @psalm-immutable - */ -final class NilUuid extends Uuid implements UuidInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php deleted file mode 100644 index 736931af..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php +++ /dev/null @@ -1,111 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\UnableToBuildUuidException; -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Nonstandard\UuidV6; -use Ramsey\Uuid\Rfc4122\UuidInterface as Rfc4122UuidInterface; -use Ramsey\Uuid\UuidInterface; -use Throwable; - -/** - * UuidBuilder builds instances of RFC 4122 UUIDs - * - * @psalm-immutable - */ -class UuidBuilder implements UuidBuilderInterface -{ - /** - * @var NumberConverterInterface - */ - private $numberConverter; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * Constructs the DefaultUuidBuilder - * - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Uuid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps - */ - public function __construct( - NumberConverterInterface $numberConverter, - TimeConverterInterface $timeConverter - ) { - $this->numberConverter = $numberConverter; - $this->timeConverter = $timeConverter; - } - - /** - * Builds and returns a Uuid - * - * @param CodecInterface $codec The codec to use for building this Uuid instance - * @param string $bytes The byte string from which to construct a UUID - * - * @return Rfc4122UuidInterface UuidBuilder returns instances of Rfc4122UuidInterface - * - * @psalm-pure - */ - public function build(CodecInterface $codec, string $bytes): UuidInterface - { - try { - $fields = $this->buildFields($bytes); - - if ($fields->isNil()) { - return new NilUuid($fields, $this->numberConverter, $codec, $this->timeConverter); - } - - switch ($fields->getVersion()) { - case 1: - return new UuidV1($fields, $this->numberConverter, $codec, $this->timeConverter); - case 2: - return new UuidV2($fields, $this->numberConverter, $codec, $this->timeConverter); - case 3: - return new UuidV3($fields, $this->numberConverter, $codec, $this->timeConverter); - case 4: - return new UuidV4($fields, $this->numberConverter, $codec, $this->timeConverter); - case 5: - return new UuidV5($fields, $this->numberConverter, $codec, $this->timeConverter); - case 6: - return new UuidV6($fields, $this->numberConverter, $codec, $this->timeConverter); - } - - throw new UnsupportedOperationException( - 'The UUID version in the given fields is not supported ' - . 'by this UUID builder' - ); - } catch (Throwable $e) { - throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Proxy method to allow injecting a mock, for testing - */ - protected function buildFields(string $bytes): FieldsInterface - { - return new Fields($bytes); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php deleted file mode 100644 index 3e4d9fae..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\UuidInterface as BaseUuidInterface; - -/** - * Also known as a Leach-Salz variant UUID, an RFC 4122 variant UUID is a - * universally unique identifier defined by RFC 4122 - * - * @link https://tools.ietf.org/html/rfc4122 RFC 4122 - * - * @psalm-immutable - */ -interface UuidInterface extends BaseUuidInterface -{ - /** - * Returns the string standard representation of the UUID as a URN - * - * @link http://en.wikipedia.org/wiki/Uniform_Resource_Name Uniform Resource Name - * @link https://tools.ietf.org/html/rfc4122#section-3 RFC 4122, § 3: Namespace Registration Template - */ - public function getUrn(): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV1.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV1.php deleted file mode 100644 index 764e42f8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV1.php +++ /dev/null @@ -1,92 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use DateTimeImmutable; -use DateTimeInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\DateTimeException; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; -use Throwable; - -use function str_pad; - -use const STR_PAD_LEFT; - -/** - * Time-based, or version 1, UUIDs include timestamp, clock sequence, and node - * values that are combined into a 128-bit unsigned integer - * - * @psalm-immutable - */ -final class UuidV1 extends Uuid implements UuidInterface -{ - /** - * Creates a version 1 (time-based) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_TIME) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV1 must represent a ' - . 'version 1 (time-based) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } - - /** - * Returns a DateTimeInterface object representing the timestamp associated - * with the UUID - * - * The timestamp value is only meaningful in a time-based UUID, which - * has version type 1. - * - * @return DateTimeImmutable A PHP DateTimeImmutable instance representing - * the timestamp of a version 1 UUID - */ - public function getDateTime(): DateTimeInterface - { - $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); - - try { - return new DateTimeImmutable( - '@' - . $time->getSeconds()->toString() - . '.' - . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) - ); - } catch (Throwable $e) { - throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV2.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV2.php deleted file mode 100644 index 74906f05..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV2.php +++ /dev/null @@ -1,143 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use DateTimeImmutable; -use DateTimeInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\DateTimeException; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Uuid; -use Throwable; - -use function hexdec; -use function str_pad; - -use const STR_PAD_LEFT; - -/** - * DCE Security version, or version 2, UUIDs include local domain identifier, - * local ID for the specified domain, and node values that are combined into a - * 128-bit unsigned integer - * - * @link https://publications.opengroup.org/c311 DCE 1.1: Authentication and Security Services - * @link https://publications.opengroup.org/c706 DCE 1.1: Remote Procedure Call - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 DCE 1.1: Auth & Sec, §5.2.1.1 - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1: Auth & Sec, §11.5.1.1 - * @link https://pubs.opengroup.org/onlinepubs/9629399/apdxa.htm DCE 1.1: RPC, Appendix A - * @link https://github.com/google/uuid Go package for UUIDs (includes DCE implementation) - * - * @psalm-immutable - */ -final class UuidV2 extends Uuid implements UuidInterface -{ - /** - * Creates a version 2 (DCE Security) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_DCE_SECURITY) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV2 must represent a ' - . 'version 2 (DCE Security) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } - - /** - * Returns a DateTimeInterface object representing the timestamp associated - * with the UUID - * - * It is important to note that a version 2 UUID suffers from some loss of - * fidelity of the timestamp, due to replacing the time_low field with the - * local identifier. When constructing the timestamp value for date - * purposes, we replace the local identifier bits with zeros. As a result, - * the timestamp can be off by a range of 0 to 429.4967295 seconds (or 7 - * minutes, 9 seconds, and 496730 microseconds). - * - * Astute observers might note this value directly corresponds to 2^32 - 1, - * or 0xffffffff. The local identifier is 32-bits, and we have set each of - * these bits to 0, so the maximum range of timestamp drift is 0x00000000 - * to 0xffffffff (counted in 100-nanosecond intervals). - * - * @return DateTimeImmutable A PHP DateTimeImmutable instance representing - * the timestamp of a version 2 UUID - */ - public function getDateTime(): DateTimeInterface - { - $time = $this->timeConverter->convertTime($this->fields->getTimestamp()); - - try { - return new DateTimeImmutable( - '@' - . $time->getSeconds()->toString() - . '.' - . str_pad($time->getMicroseconds()->toString(), 6, '0', STR_PAD_LEFT) - ); - } catch (Throwable $e) { - throw new DateTimeException($e->getMessage(), (int) $e->getCode(), $e); - } - } - - /** - * Returns the local domain used to create this version 2 UUID - */ - public function getLocalDomain(): int - { - /** @var Rfc4122FieldsInterface $fields */ - $fields = $this->getFields(); - - return (int) hexdec($fields->getClockSeqLow()->toString()); - } - - /** - * Returns the string name of the local domain - */ - public function getLocalDomainName(): string - { - return Uuid::DCE_DOMAIN_NAMES[$this->getLocalDomain()]; - } - - /** - * Returns the local identifier for the domain used to create this version 2 UUID - */ - public function getLocalIdentifier(): IntegerObject - { - /** @var Rfc4122FieldsInterface $fields */ - $fields = $this->getFields(); - - return new IntegerObject( - $this->numberConverter->fromHex($fields->getTimeLow()->toString()) - ); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV3.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV3.php deleted file mode 100644 index deaa54eb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV3.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Version 3 UUIDs are named-based, using combination of a namespace and name - * that are hashed into a 128-bit unsigned integer using MD5 - * - * @psalm-immutable - */ -final class UuidV3 extends Uuid implements UuidInterface -{ - /** - * Creates a version 3 (name-based, MD5-hashed) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_MD5) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV3 must represent a ' - . 'version 3 (name-based, MD5-hashed) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV4.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV4.php deleted file mode 100644 index 2e572462..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV4.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Random, or version 4, UUIDs are randomly or pseudo-randomly generated 128-bit - * integers - * - * @psalm-immutable - */ -final class UuidV4 extends Uuid implements UuidInterface -{ - /** - * Creates a version 4 (random) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_RANDOM) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV4 must represent a ' - . 'version 4 (random) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV5.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV5.php deleted file mode 100644 index 2ef6ab3f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/UuidV5.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Exception\InvalidArgumentException; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Uuid; - -/** - * Version 5 UUIDs are named-based, using combination of a namespace and name - * that are hashed into a 128-bit unsigned integer using SHA1 - * - * @psalm-immutable - */ -final class UuidV5 extends Uuid implements UuidInterface -{ - /** - * Creates a version 5 (name-based, SHA1-hashed) UUID - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_SHA1) { - throw new InvalidArgumentException( - 'Fields used to create a UuidV5 must represent a ' - . 'version 5 (named-based, SHA1-hashed) UUID' - ); - } - - parent::__construct($fields, $numberConverter, $codec, $timeConverter); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/Validator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/Validator.php deleted file mode 100644 index ed43c982..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/Validator.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Uuid; -use Ramsey\Uuid\Validator\ValidatorInterface; - -use function preg_match; -use function str_replace; - -/** - * Rfc4122\Validator validates strings as UUIDs of the RFC 4122 variant - * - * @psalm-immutable - */ -final class Validator implements ValidatorInterface -{ - private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-' - . '[1-5]{1}[0-9A-Fa-f]{3}-[ABab89]{1}[0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}\z'; - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function getPattern(): string - { - return self::VALID_PATTERN; - } - - public function validate(string $uuid): bool - { - $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); - - return $uuid === Uuid::NIL || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php deleted file mode 100644 index 4c981658..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -use Ramsey\Uuid\Exception\InvalidBytesException; -use Ramsey\Uuid\Uuid; - -use function decbin; -use function str_pad; -use function strlen; -use function strpos; -use function substr; -use function unpack; - -use const STR_PAD_LEFT; - -/** - * Provides common functionality for handling the variant, as defined by RFC 4122 - * - * @psalm-immutable - */ -trait VariantTrait -{ - /** - * Returns the bytes that comprise the fields - */ - abstract public function getBytes(): string; - - /** - * Returns the variant identifier, according to RFC 4122, for the given bytes - * - * The following values may be returned: - * - * - `0` -- Reserved, NCS backward compatibility. - * - `2` -- The variant specified in RFC 4122. - * - `6` -- Reserved, Microsoft Corporation backward compatibility. - * - `7` -- Reserved for future definition. - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - * - * @return int The variant identifier, according to RFC 4122 - */ - public function getVariant(): int - { - if (strlen($this->getBytes()) !== 16) { - throw new InvalidBytesException('Invalid number of bytes'); - } - - /** @var array $parts */ - $parts = unpack('n*', $this->getBytes()); - - // $parts[5] is a 16-bit, unsigned integer containing the variant bits - // of the UUID. We convert this integer into a string containing a - // binary representation, padded to 16 characters. We analyze the first - // three characters (three most-significant bits) to determine the - // variant. - $binary = str_pad( - decbin((int) $parts[5]), - 16, - '0', - STR_PAD_LEFT - ); - - $msb = substr($binary, 0, 3); - - if ($msb === '111') { - $variant = Uuid::RESERVED_FUTURE; - } elseif ($msb === '110') { - $variant = Uuid::RESERVED_MICROSOFT; - } elseif (strpos($msb, '10') === 0) { - $variant = Uuid::RFC_4122; - } else { - $variant = Uuid::RESERVED_NCS; - } - - return $variant; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php deleted file mode 100644 index cee55fbe..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Rfc4122; - -/** - * Provides common functionality for handling the version, as defined by RFC 4122 - * - * @psalm-immutable - */ -trait VersionTrait -{ - /** - * Returns the version - */ - abstract public function getVersion(): ?int; - - /** - * Returns true if these fields represent a nil UUID - */ - abstract public function isNil(): bool; - - /** - * Returns true if the version matches one of those defined by RFC 4122 - * - * @return bool True if the UUID version is valid, false otherwise - */ - private function isCorrectVersion(): bool - { - if ($this->isNil()) { - return true; - } - - switch ($this->getVersion()) { - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - return true; - } - - return false; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Decimal.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Decimal.php deleted file mode 100644 index 10f93845..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Decimal.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use ValueError; - -use function is_numeric; -use function sprintf; - -/** - * A value object representing a decimal - * - * This class exists for type-safety purposes, to ensure that decimals - * returned from ramsey/uuid methods as strings are truly decimals and not some - * other kind of string. - * - * To support values as true decimals and not as floats or doubles, we store the - * decimals as strings. - * - * @psalm-immutable - */ -final class Decimal implements NumberInterface -{ - /** - * @var string - */ - private $value; - - /** - * @var bool - */ - private $isNegative = false; - - /** - * @param mixed $value The decimal value to store - */ - public function __construct($value) - { - $value = (string) $value; - - if (!is_numeric($value)) { - throw new InvalidArgumentException( - 'Value must be a signed decimal or a string containing only ' - . 'digits 0-9 and, optionally, a decimal point or sign (+ or -)' - ); - } - - // Remove the leading +-symbol. - if (strpos($value, '+') === 0) { - $value = substr($value, 1); - } - - // For cases like `-0` or `-0.0000`, convert the value to `0`. - if (abs((float) $value) === 0.0) { - $value = '0'; - } - - if (strpos($value, '-') === 0) { - $this->isNegative = true; - } - - $this->value = $value; - } - - public function isNegative(): bool - { - return $this->isNegative; - } - - public function toString(): string - { - return $this->value; - } - - public function __toString(): string - { - return $this->toString(); - } - - public function jsonSerialize(): string - { - return $this->toString(); - } - - public function serialize(): string - { - return $this->toString(); - } - - /** - * @return array{string: string} - */ - public function __serialize(): array - { - return ['string' => $this->toString()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $serialized The serialized string representation of the object - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress UnusedMethodCall - */ - public function unserialize($serialized): void - { - $this->__construct($serialized); - } - - /** - * @param array{string: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Hexadecimal.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Hexadecimal.php deleted file mode 100644 index 88adc2e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Hexadecimal.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use ValueError; - -use function ctype_xdigit; -use function sprintf; -use function strpos; -use function strtolower; -use function substr; - -/** - * A value object representing a hexadecimal number - * - * This class exists for type-safety purposes, to ensure that hexadecimal numbers - * returned from ramsey/uuid methods as strings are truly hexadecimal and not some - * other kind of string. - * - * @psalm-immutable - */ -final class Hexadecimal implements TypeInterface -{ - /** - * @var string - */ - private $value; - - /** - * @param string $value The hexadecimal value to store - */ - public function __construct(string $value) - { - $value = strtolower($value); - - if (strpos($value, '0x') === 0) { - $value = substr($value, 2); - } - - if (!ctype_xdigit($value)) { - throw new InvalidArgumentException( - 'Value must be a hexadecimal number' - ); - } - - $this->value = $value; - } - - public function toString(): string - { - return $this->value; - } - - public function __toString(): string - { - return $this->toString(); - } - - public function jsonSerialize(): string - { - return $this->toString(); - } - - public function serialize(): string - { - return $this->toString(); - } - - /** - * @return array{string: string} - */ - public function __serialize(): array - { - return ['string' => $this->toString()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $serialized The serialized string representation of the object - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress UnusedMethodCall - */ - public function unserialize($serialized): void - { - $this->__construct($serialized); - } - - /** - * @param array{string: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Integer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Integer.php deleted file mode 100644 index 7690f6cd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Integer.php +++ /dev/null @@ -1,153 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\InvalidArgumentException; -use ValueError; - -use function ctype_digit; -use function ltrim; -use function sprintf; -use function strpos; -use function substr; - -/** - * A value object representing an integer - * - * This class exists for type-safety purposes, to ensure that integers - * returned from ramsey/uuid methods as strings are truly integers and not some - * other kind of string. - * - * To support large integers beyond PHP_INT_MAX and PHP_INT_MIN on both 64-bit - * and 32-bit systems, we store the integers as strings. - * - * @psalm-immutable - */ -final class Integer implements NumberInterface -{ - /** - * @psalm-var numeric-string - */ - private $value; - - /** - * @var bool - */ - private $isNegative = false; - - /** - * @param mixed $value The integer value to store - */ - public function __construct($value) - { - $value = (string) $value; - $sign = '+'; - - // If the value contains a sign, remove it for ctype_digit() check. - if (strpos($value, '-') === 0 || strpos($value, '+') === 0) { - $sign = substr($value, 0, 1); - $value = substr($value, 1); - } - - if (!ctype_digit($value)) { - throw new InvalidArgumentException( - 'Value must be a signed integer or a string containing only ' - . 'digits 0-9 and, optionally, a sign (+ or -)' - ); - } - - // Trim any leading zeros. - $value = ltrim($value, '0'); - - // Set to zero if the string is empty after trimming zeros. - if ($value === '') { - $value = '0'; - } - - // Add the negative sign back to the value. - if ($sign === '-' && $value !== '0') { - $value = $sign . $value; - $this->isNegative = true; - } - - /** @psalm-var numeric-string $numericValue */ - $numericValue = $value; - - $this->value = $numericValue; - } - - public function isNegative(): bool - { - return $this->isNegative; - } - - /** - * @psalm-return numeric-string - */ - public function toString(): string - { - return $this->value; - } - - public function __toString(): string - { - return $this->toString(); - } - - public function jsonSerialize(): string - { - return $this->toString(); - } - - public function serialize(): string - { - return $this->toString(); - } - - /** - * @return array{string: string} - */ - public function __serialize(): array - { - return ['string' => $this->toString()]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $serialized The serialized string representation of the object - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress UnusedMethodCall - */ - public function unserialize($serialized): void - { - $this->__construct($serialized); - } - - /** - * @param array{string: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['string'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['string']); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/NumberInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/NumberInterface.php deleted file mode 100644 index bf4ae9db..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/NumberInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -/** - * NumberInterface ensures consistency in numeric values returned by ramsey/uuid - * - * @psalm-immutable - */ -interface NumberInterface extends TypeInterface -{ - /** - * Returns true if this number is less than zero - */ - public function isNegative(): bool; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Time.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Time.php deleted file mode 100644 index dd1b8bc2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/Time.php +++ /dev/null @@ -1,139 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use Ramsey\Uuid\Exception\UnsupportedOperationException; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use ValueError; -use stdClass; - -use function json_decode; -use function json_encode; -use function sprintf; - -/** - * A value object representing a timestamp - * - * This class exists for type-safety purposes, to ensure that timestamps used - * by ramsey/uuid are truly timestamp integers and not some other kind of string - * or integer. - * - * @psalm-immutable - */ -final class Time implements TypeInterface -{ - /** - * @var IntegerObject - */ - private $seconds; - - /** - * @var IntegerObject - */ - private $microseconds; - - /** - * @param mixed $seconds - * @param mixed $microseconds - */ - public function __construct($seconds, $microseconds = 0) - { - $this->seconds = new IntegerObject($seconds); - $this->microseconds = new IntegerObject($microseconds); - } - - public function getSeconds(): IntegerObject - { - return $this->seconds; - } - - public function getMicroseconds(): IntegerObject - { - return $this->microseconds; - } - - public function toString(): string - { - return $this->seconds->toString() . '.' . $this->microseconds->toString(); - } - - public function __toString(): string - { - return $this->toString(); - } - - /** - * @return string[] - */ - public function jsonSerialize(): array - { - return [ - 'seconds' => $this->getSeconds()->toString(), - 'microseconds' => $this->getMicroseconds()->toString(), - ]; - } - - public function serialize(): string - { - return (string) json_encode($this); - } - - /** - * @return array{seconds: string, microseconds: string} - */ - public function __serialize(): array - { - return [ - 'seconds' => $this->getSeconds()->toString(), - 'microseconds' => $this->getMicroseconds()->toString(), - ]; - } - - /** - * Constructs the object from a serialized string representation - * - * @param string $serialized The serialized string representation of the object - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress UnusedMethodCall - */ - public function unserialize($serialized): void - { - /** @var stdClass $time */ - $time = json_decode($serialized); - - if (!isset($time->seconds) || !isset($time->microseconds)) { - throw new UnsupportedOperationException( - 'Attempted to unserialize an invalid value' - ); - } - - $this->__construct($time->seconds, $time->microseconds); - } - - /** - * @param array{seconds: string, microseconds: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['seconds']) || !isset($data['microseconds'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->__construct($data['seconds'], $data['microseconds']); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/TypeInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/TypeInterface.php deleted file mode 100644 index da2d8b20..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Type/TypeInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Type; - -use JsonSerializable; -use Serializable; - -/** - * TypeInterface ensures consistency in typed values returned by ramsey/uuid - * - * @psalm-immutable - */ -interface TypeInterface extends JsonSerializable, Serializable -{ - public function toString(): string; - - public function __toString(): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Uuid.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Uuid.php deleted file mode 100644 index 945480ba..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Uuid.php +++ /dev/null @@ -1,664 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Fields\FieldsInterface; -use Ramsey\Uuid\Lazy\LazyUuidFromString; -use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use ValueError; - -use function assert; -use function bin2hex; -use function preg_match; -use function sprintf; -use function str_replace; -use function strcmp; -use function strlen; -use function strtolower; -use function substr; - -/** - * Uuid provides constants and static methods for working with and generating UUIDs - * - * @psalm-immutable - */ -class Uuid implements UuidInterface -{ - use DeprecatedUuidMethodsTrait; - - /** - * When this namespace is specified, the name string is a fully-qualified - * domain name - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; - - /** - * When this namespace is specified, the name string is a URL - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; - - /** - * When this namespace is specified, the name string is an ISO OID - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8'; - - /** - * When this namespace is specified, the name string is an X.500 DN in DER - * or a text output format - * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs - */ - public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8'; - - /** - * The nil UUID is a special form of UUID that is specified to have all 128 - * bits set to zero - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.7 RFC 4122, § 4.1.7: Nil UUID - */ - public const NIL = '00000000-0000-0000-0000-000000000000'; - - /** - * Variant: reserved, NCS backward compatibility - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RESERVED_NCS = 0; - - /** - * Variant: the UUID layout specified in RFC 4122 - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RFC_4122 = 2; - - /** - * Variant: reserved, Microsoft Corporation backward compatibility - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RESERVED_MICROSOFT = 6; - - /** - * Variant: reserved for future definition - * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant - */ - public const RESERVED_FUTURE = 7; - - /** - * @deprecated Use {@see ValidatorInterface::getPattern()} instead. - */ - public const VALID_PATTERN = '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$'; - - /** - * Version 1 (time-based) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_TIME = 1; - - /** - * Version 2 (DCE Security) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_DCE_SECURITY = 2; - - /** - * @deprecated Use {@see Uuid::UUID_TYPE_DCE_SECURITY} instead. - */ - public const UUID_TYPE_IDENTIFIER = 2; - - /** - * Version 3 (name-based and hashed with MD5) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_HASH_MD5 = 3; - - /** - * Version 4 (random) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_RANDOM = 4; - - /** - * Version 5 (name-based and hashed with SHA1) UUID - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version - */ - public const UUID_TYPE_HASH_SHA1 = 5; - - /** - * Version 6 (ordered-time) UUID - * - * This is named `UUID_TYPE_PEABODY`, since the specification is still in - * draft form, and the primary author/editor's name is Brad Peabody. - * - * @link https://github.com/uuid6/uuid6-ietf-draft UUID version 6 IETF draft - * @link http://gh.peabody.io/uuidv6/ "Version 6" UUIDs - */ - public const UUID_TYPE_PEABODY = 6; - - /** - * DCE Security principal domain - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_PERSON = 0; - - /** - * DCE Security group domain - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_GROUP = 1; - - /** - * DCE Security organization domain - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_ORG = 2; - - /** - * DCE Security domain string names - * - * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap11.htm#tagcjh_14_05_01_01 DCE 1.1, §11.5.1.1 - */ - public const DCE_DOMAIN_NAMES = [ - self::DCE_DOMAIN_PERSON => 'person', - self::DCE_DOMAIN_GROUP => 'group', - self::DCE_DOMAIN_ORG => 'org', - ]; - - /** - * @var UuidFactoryInterface|null - */ - private static $factory = null; - - /** - * @var bool flag to detect if the UUID factory was replaced internally, which disables all optimizations - * for the default/happy path internal scenarios - */ - private static $factoryReplaced = false; - - /** - * @var CodecInterface - */ - protected $codec; - - /** - * The fields that make up this UUID - * - * @var Rfc4122FieldsInterface - */ - protected $fields; - - /** - * @var NumberConverterInterface - */ - protected $numberConverter; - - /** - * @var TimeConverterInterface - */ - protected $timeConverter; - - /** - * Creates a universally unique identifier (UUID) from an array of fields - * - * Unless you're making advanced use of this library to generate identifiers - * that deviate from RFC 4122, you probably do not want to instantiate a - * UUID directly. Use the static methods, instead: - * - * ``` - * use Ramsey\Uuid\Uuid; - * - * $timeBasedUuid = Uuid::uuid1(); - * $namespaceMd5Uuid = Uuid::uuid3(Uuid::NAMESPACE_URL, 'http://php.net/'); - * $randomUuid = Uuid::uuid4(); - * $namespaceSha1Uuid = Uuid::uuid5(Uuid::NAMESPACE_URL, 'http://php.net/'); - * ``` - * - * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps - */ - public function __construct( - Rfc4122FieldsInterface $fields, - NumberConverterInterface $numberConverter, - CodecInterface $codec, - TimeConverterInterface $timeConverter - ) { - $this->fields = $fields; - $this->codec = $codec; - $this->numberConverter = $numberConverter; - $this->timeConverter = $timeConverter; - } - - /** - * @psalm-return non-empty-string - */ - public function __toString(): string - { - return $this->toString(); - } - - /** - * Converts the UUID to a string for JSON serialization - */ - public function jsonSerialize(): string - { - return $this->toString(); - } - - /** - * Converts the UUID to a string for PHP serialization - */ - public function serialize(): string - { - return $this->getFields()->getBytes(); - } - - /** - * @return array{bytes: string} - */ - public function __serialize(): array - { - return ['bytes' => $this->serialize()]; - } - - /** - * Re-constructs the object from its serialized form - * - * @param string $serialized The serialized PHP string to unserialize into - * a UuidInterface instance - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - */ - public function unserialize($serialized): void - { - if (strlen($serialized) === 16) { - /** @var Uuid $uuid */ - $uuid = self::getFactory()->fromBytes($serialized); - } else { - /** @var Uuid $uuid */ - $uuid = self::getFactory()->fromString($serialized); - } - - $this->codec = $uuid->codec; - $this->numberConverter = $uuid->numberConverter; - $this->fields = $uuid->fields; - $this->timeConverter = $uuid->timeConverter; - } - - /** - * @param array{bytes: string} $data - */ - public function __unserialize(array $data): void - { - // @codeCoverageIgnoreStart - if (!isset($data['bytes'])) { - throw new ValueError(sprintf('%s(): Argument #1 ($data) is invalid', __METHOD__)); - } - // @codeCoverageIgnoreEnd - - $this->unserialize($data['bytes']); - } - - public function compareTo(UuidInterface $other): int - { - $compare = strcmp($this->toString(), $other->toString()); - - if ($compare < 0) { - return -1; - } - - if ($compare > 0) { - return 1; - } - - return 0; - } - - public function equals(?object $other): bool - { - if (!$other instanceof UuidInterface) { - return false; - } - - return $this->compareTo($other) === 0; - } - - /** - * @psalm-return non-empty-string - */ - public function getBytes(): string - { - return $this->codec->encodeBinary($this); - } - - public function getFields(): FieldsInterface - { - return $this->fields; - } - - public function getHex(): Hexadecimal - { - return new Hexadecimal(str_replace('-', '', $this->toString())); - } - - public function getInteger(): IntegerObject - { - return new IntegerObject($this->numberConverter->fromHex($this->getHex()->toString())); - } - - /** - * @psalm-return non-empty-string - */ - public function toString(): string - { - return $this->codec->encode($this); - } - - /** - * Returns the factory used to create UUIDs - */ - public static function getFactory(): UuidFactoryInterface - { - if (self::$factory === null) { - self::$factory = new UuidFactory(); - } - - return self::$factory; - } - - /** - * Sets the factory used to create UUIDs - * - * @param UuidFactoryInterface $factory A factory that will be used by this - * class to create UUIDs - */ - public static function setFactory(UuidFactoryInterface $factory): void - { - // Note: non-strict equality is intentional here. If the factory is configured differently, every assumption - // around purity is broken, and we have to internally decide everything differently. - // phpcs:ignore SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator - self::$factoryReplaced = ($factory != new UuidFactory()); - - self::$factory = $factory; - } - - /** - * Creates a UUID from a byte string - * - * @param string $bytes A binary string - * - * @return UuidInterface A UuidInterface instance created from a binary - * string representation - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - */ - public static function fromBytes(string $bytes): UuidInterface - { - if (! self::$factoryReplaced && strlen($bytes) === 16) { - $base16Uuid = bin2hex($bytes); - - // Note: we are calling `fromString` internally because we don't know if the given `$bytes` is a valid UUID - return self::fromString( - substr($base16Uuid, 0, 8) - . '-' - . substr($base16Uuid, 8, 4) - . '-' - . substr($base16Uuid, 12, 4) - . '-' - . substr($base16Uuid, 16, 4) - . '-' - . substr($base16Uuid, 20, 12) - ); - } - - return self::getFactory()->fromBytes($bytes); - } - - /** - * Creates a UUID from the string standard representation - * - * @param string $uuid A hexadecimal string - * - * @return UuidInterface A UuidInterface instance created from a hexadecimal - * string representation - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - */ - public static function fromString(string $uuid): UuidInterface - { - if (! self::$factoryReplaced && preg_match(LazyUuidFromString::VALID_REGEX, $uuid) === 1) { - assert($uuid !== ''); - - return new LazyUuidFromString(strtolower($uuid)); - } - - return self::getFactory()->fromString($uuid); - } - - /** - * Creates a UUID from a DateTimeInterface instance - * - * @param DateTimeInterface $dateTime The date and time - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID created from a DateTimeInterface instance - */ - public static function fromDateTime( - DateTimeInterface $dateTime, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - return self::getFactory()->fromDateTime($dateTime, $node, $clockSeq); - } - - /** - * Creates a UUID from a 128-bit integer string - * - * @param string $integer String representation of 128-bit integer - * - * @return UuidInterface A UuidInterface instance created from the string - * representation of a 128-bit integer - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ - public static function fromInteger(string $integer): UuidInterface - { - return self::getFactory()->fromInteger($integer); - } - - /** - * Returns true if the provided string is a valid UUID - * - * @param string $uuid A string to validate as a UUID - * - * @return bool True if the string is a valid UUID, false otherwise - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ - public static function isValid(string $uuid): bool - { - return self::getFactory()->getValidator()->validate($uuid); - } - - /** - * Returns a version 1 (time-based) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID - */ - public static function uuid1($node = null, ?int $clockSeq = null): UuidInterface - { - return self::getFactory()->uuid1($node, $clockSeq); - } - - /** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes (in a version 2 UUID, the lower 8 bits of this number - * are replaced with the domain). - * - * @return UuidInterface A UuidInterface instance that represents a - * version 2 UUID - */ - public static function uuid2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - return self::getFactory()->uuid2($localDomain, $localIdentifier, $node, $clockSeq); - } - - /** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 3 UUID - * - * @psalm-suppress ImpureMethodCall we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ - public static function uuid3($ns, string $name): UuidInterface - { - return self::getFactory()->uuid3($ns, $name); - } - - /** - * Returns a version 4 (random) UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 4 UUID - */ - public static function uuid4(): UuidInterface - { - return self::getFactory()->uuid4(); - } - - /** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 5 UUID - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-suppress ImpureMethodCall we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. - */ - public static function uuid5($ns, string $name): UuidInterface - { - return self::getFactory()->uuid5($ns, $name); - } - - /** - * Returns a version 6 (ordered-time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 6 UUID - */ - public static function uuid6( - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - return self::getFactory()->uuid6($node, $clockSeq); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidFactory.php deleted file mode 100644 index 6f2cea06..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidFactory.php +++ /dev/null @@ -1,493 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Builder\UuidBuilderInterface; -use Ramsey\Uuid\Codec\CodecInterface; -use Ramsey\Uuid\Converter\NumberConverterInterface; -use Ramsey\Uuid\Converter\TimeConverterInterface; -use Ramsey\Uuid\Generator\DceSecurityGeneratorInterface; -use Ramsey\Uuid\Generator\DefaultTimeGenerator; -use Ramsey\Uuid\Generator\NameGeneratorInterface; -use Ramsey\Uuid\Generator\RandomGeneratorInterface; -use Ramsey\Uuid\Generator\TimeGeneratorInterface; -use Ramsey\Uuid\Lazy\LazyUuidFromString; -use Ramsey\Uuid\Provider\NodeProviderInterface; -use Ramsey\Uuid\Provider\Time\FixedTimeProvider; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Type\Time; -use Ramsey\Uuid\Validator\ValidatorInterface; - -use function bin2hex; -use function hex2bin; -use function pack; -use function str_pad; -use function strtolower; -use function substr; -use function substr_replace; -use function unpack; - -use const STR_PAD_LEFT; - -class UuidFactory implements UuidFactoryInterface -{ - /** - * @var CodecInterface - */ - private $codec; - - /** - * @var DceSecurityGeneratorInterface - */ - private $dceSecurityGenerator; - - /** - * @var NameGeneratorInterface - */ - private $nameGenerator; - - /** - * @var NodeProviderInterface - */ - private $nodeProvider; - - /** - * @var NumberConverterInterface - */ - private $numberConverter; - - /** - * @var RandomGeneratorInterface - */ - private $randomGenerator; - - /** - * @var TimeConverterInterface - */ - private $timeConverter; - - /** - * @var TimeGeneratorInterface - */ - private $timeGenerator; - - /** - * @var UuidBuilderInterface - */ - private $uuidBuilder; - - /** - * @var ValidatorInterface - */ - private $validator; - - /** @var bool whether the feature set was provided from outside, or we can operate under "default" assumptions */ - private $isDefaultFeatureSet; - - /** - * @param FeatureSet $features A set of available features in the current environment - */ - public function __construct(?FeatureSet $features = null) - { - $this->isDefaultFeatureSet = $features === null; - - $features = $features ?: new FeatureSet(); - - $this->codec = $features->getCodec(); - $this->dceSecurityGenerator = $features->getDceSecurityGenerator(); - $this->nameGenerator = $features->getNameGenerator(); - $this->nodeProvider = $features->getNodeProvider(); - $this->numberConverter = $features->getNumberConverter(); - $this->randomGenerator = $features->getRandomGenerator(); - $this->timeConverter = $features->getTimeConverter(); - $this->timeGenerator = $features->getTimeGenerator(); - $this->uuidBuilder = $features->getBuilder(); - $this->validator = $features->getValidator(); - } - - /** - * Returns the codec used by this factory - */ - public function getCodec(): CodecInterface - { - return $this->codec; - } - - /** - * Sets the codec to use for this factory - * - * @param CodecInterface $codec A UUID encoder-decoder - */ - public function setCodec(CodecInterface $codec): void - { - $this->isDefaultFeatureSet = false; - - $this->codec = $codec; - } - - /** - * Returns the name generator used by this factory - */ - public function getNameGenerator(): NameGeneratorInterface - { - return $this->nameGenerator; - } - - /** - * Sets the name generator to use for this factory - * - * @param NameGeneratorInterface $nameGenerator A generator to generate - * binary data, based on a namespace and name - */ - public function setNameGenerator(NameGeneratorInterface $nameGenerator): void - { - $this->isDefaultFeatureSet = false; - - $this->nameGenerator = $nameGenerator; - } - - /** - * Returns the node provider used by this factory - */ - public function getNodeProvider(): NodeProviderInterface - { - return $this->nodeProvider; - } - - /** - * Returns the random generator used by this factory - */ - public function getRandomGenerator(): RandomGeneratorInterface - { - return $this->randomGenerator; - } - - /** - * Returns the time generator used by this factory - */ - public function getTimeGenerator(): TimeGeneratorInterface - { - return $this->timeGenerator; - } - - /** - * Sets the time generator to use for this factory - * - * @param TimeGeneratorInterface $generator A generator to generate binary - * data, based on the time - */ - public function setTimeGenerator(TimeGeneratorInterface $generator): void - { - $this->isDefaultFeatureSet = false; - - $this->timeGenerator = $generator; - } - - /** - * Returns the DCE Security generator used by this factory - */ - public function getDceSecurityGenerator(): DceSecurityGeneratorInterface - { - return $this->dceSecurityGenerator; - } - - /** - * Sets the DCE Security generator to use for this factory - * - * @param DceSecurityGeneratorInterface $generator A generator to generate - * binary data, based on a local domain and local identifier - */ - public function setDceSecurityGenerator(DceSecurityGeneratorInterface $generator): void - { - $this->isDefaultFeatureSet = false; - - $this->dceSecurityGenerator = $generator; - } - - /** - * Returns the number converter used by this factory - */ - public function getNumberConverter(): NumberConverterInterface - { - return $this->numberConverter; - } - - /** - * Sets the random generator to use for this factory - * - * @param RandomGeneratorInterface $generator A generator to generate binary - * data, based on some random input - */ - public function setRandomGenerator(RandomGeneratorInterface $generator): void - { - $this->isDefaultFeatureSet = false; - - $this->randomGenerator = $generator; - } - - /** - * Sets the number converter to use for this factory - * - * @param NumberConverterInterface $converter A converter to use for working - * with large integers (i.e. integers greater than PHP_INT_MAX) - */ - public function setNumberConverter(NumberConverterInterface $converter): void - { - $this->isDefaultFeatureSet = false; - - $this->numberConverter = $converter; - } - - /** - * Returns the UUID builder used by this factory - */ - public function getUuidBuilder(): UuidBuilderInterface - { - return $this->uuidBuilder; - } - - /** - * Sets the UUID builder to use for this factory - * - * @param UuidBuilderInterface $builder A builder for constructing instances - * of UuidInterface - */ - public function setUuidBuilder(UuidBuilderInterface $builder): void - { - $this->isDefaultFeatureSet = false; - - $this->uuidBuilder = $builder; - } - - /** - * @psalm-mutation-free - */ - public function getValidator(): ValidatorInterface - { - return $this->validator; - } - - /** - * Sets the validator to use for this factory - * - * @param ValidatorInterface $validator A validator to use for validating - * whether a string is a valid UUID - */ - public function setValidator(ValidatorInterface $validator): void - { - $this->isDefaultFeatureSet = false; - - $this->validator = $validator; - } - - /** - * @psalm-pure - */ - public function fromBytes(string $bytes): UuidInterface - { - return $this->codec->decodeBytes($bytes); - } - - /** - * @psalm-pure - */ - public function fromString(string $uuid): UuidInterface - { - $uuid = strtolower($uuid); - - return $this->codec->decode($uuid); - } - - /** - * @psalm-pure - */ - public function fromInteger(string $integer): UuidInterface - { - $hex = $this->numberConverter->toHex($integer); - $hex = str_pad($hex, 32, '0', STR_PAD_LEFT); - - return $this->fromString($hex); - } - - public function fromDateTime( - DateTimeInterface $dateTime, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - $timeProvider = new FixedTimeProvider( - new Time($dateTime->format('U'), $dateTime->format('u')) - ); - - $timeGenerator = new DefaultTimeGenerator( - $this->nodeProvider, - $this->timeConverter, - $timeProvider - ); - - $nodeHex = $node ? $node->toString() : null; - - $bytes = $timeGenerator->generate($nodeHex, $clockSeq); - - return $this->uuidFromBytesAndVersion($bytes, 1); - } - - /** - * @inheritDoc - */ - public function uuid1($node = null, ?int $clockSeq = null): UuidInterface - { - $bytes = $this->timeGenerator->generate($node, $clockSeq); - - return $this->uuidFromBytesAndVersion($bytes, 1); - } - - public function uuid2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface { - $bytes = $this->dceSecurityGenerator->generate( - $localDomain, - $localIdentifier, - $node, - $clockSeq - ); - - return $this->uuidFromBytesAndVersion($bytes, 2); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function uuid3($ns, string $name): UuidInterface - { - return $this->uuidFromNsAndName($ns, $name, 3, 'md5'); - } - - public function uuid4(): UuidInterface - { - $bytes = $this->randomGenerator->generate(16); - - return $this->uuidFromBytesAndVersion($bytes, 4); - } - - /** - * @inheritDoc - * @psalm-pure - */ - public function uuid5($ns, string $name): UuidInterface - { - return $this->uuidFromNsAndName($ns, $name, 5, 'sha1'); - } - - public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface - { - $nodeHex = $node ? $node->toString() : null; - $bytes = $this->timeGenerator->generate($nodeHex, $clockSeq); - - // Rearrange the bytes, according to the UUID version 6 specification. - $v6 = $bytes[6] . $bytes[7] . $bytes[4] . $bytes[5] - . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3]; - $v6 = bin2hex($v6); - - // Drop the first four bits, while adding an empty four bits for the - // version field. This allows us to reconstruct the correct time from - // the bytes of this UUID. - $v6Bytes = hex2bin(substr($v6, 1, 12) . '0' . substr($v6, -3)); - $v6Bytes .= substr($bytes, 8); - - return $this->uuidFromBytesAndVersion($v6Bytes, 6); - } - - /** - * Returns a Uuid created from the provided byte string - * - * Uses the configured builder and codec and the provided byte string to - * construct a Uuid object. - * - * @param string $bytes The byte string from which to construct a UUID - * - * @return UuidInterface An instance of UuidInterface, created from the - * provided bytes - * - * @psalm-pure - */ - public function uuid(string $bytes): UuidInterface - { - return $this->uuidBuilder->build($this->codec, $bytes); - } - - /** - * Returns a version 3 or 5 namespaced Uuid - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to hash together with the namespace - * @param int $version The version of UUID to create (3 or 5) - * @param string $hashAlgorithm The hashing algorithm to use when hashing - * together the namespace and name - * - * @return UuidInterface An instance of UuidInterface, created by hashing - * together the provided namespace and name - * - * @psalm-pure - */ - private function uuidFromNsAndName($ns, string $name, int $version, string $hashAlgorithm): UuidInterface - { - if (!($ns instanceof UuidInterface)) { - $ns = $this->fromString($ns); - } - - $bytes = $this->nameGenerator->generate($ns, $name, $hashAlgorithm); - - return $this->uuidFromBytesAndVersion(substr($bytes, 0, 16), $version); - } - - /** - * Returns an RFC 4122 variant Uuid, created from the provided bytes and version - * - * @param string $bytes The byte string to convert to a UUID - * @param int $version The RFC 4122 version to apply to the UUID - * - * @return UuidInterface An instance of UuidInterface, created from the - * byte string and version - * - * @psalm-pure - */ - private function uuidFromBytesAndVersion(string $bytes, int $version): UuidInterface - { - /** @var array $unpackedTime */ - $unpackedTime = unpack('n*', substr($bytes, 6, 2)); - $timeHi = (int) $unpackedTime[1]; - $timeHiAndVersion = pack('n*', BinaryUtils::applyVersion($timeHi, $version)); - - /** @var array $unpackedClockSeq */ - $unpackedClockSeq = unpack('n*', substr($bytes, 8, 2)); - $clockSeqHi = (int) $unpackedClockSeq[1]; - $clockSeqHiAndReserved = pack('n*', BinaryUtils::applyVariant($clockSeqHi)); - - $bytes = substr_replace($bytes, $timeHiAndVersion, 6, 2); - $bytes = substr_replace($bytes, $clockSeqHiAndReserved, 8, 2); - - if ($this->isDefaultFeatureSet) { - return LazyUuidFromString::fromBytes($bytes); - } - - return $this->uuid($bytes); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidFactoryInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidFactoryInterface.php deleted file mode 100644 index 468cc637..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidFactoryInterface.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use DateTimeInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Ramsey\Uuid\Validator\ValidatorInterface; - -/** - * UuidFactoryInterface defines common functionality all `UuidFactory` instances - * must implement - */ -interface UuidFactoryInterface -{ - /** - * Returns the validator to use for the factory - * - * @psalm-mutation-free - */ - public function getValidator(): ValidatorInterface; - - /** - * Returns a version 1 (time-based) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID - */ - public function uuid1($node = null, ?int $clockSeq = null): UuidInterface; - - /** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 2 UUID - */ - public function uuid2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface; - - /** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 3 UUID - * - * @psalm-pure - */ - public function uuid3($ns, string $name): UuidInterface; - - /** - * Returns a version 4 (random) UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 4 UUID - */ - public function uuid4(): UuidInterface; - - /** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * @param string $name The name to use for creating a UUID - * - * @return UuidInterface A UuidInterface instance that represents a - * version 5 UUID - * - * @psalm-pure - */ - public function uuid5($ns, string $name): UuidInterface; - - /** - * Returns a version 6 (ordered-time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 6 UUID - */ - public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface; - - /** - * Creates a UUID from a byte string - * - * @param string $bytes A binary string - * - * @return UuidInterface A UuidInterface instance created from a binary - * string representation - * - * @psalm-pure - */ - public function fromBytes(string $bytes): UuidInterface; - - /** - * Creates a UUID from the string standard representation - * - * @param string $uuid A hexadecimal string - * - * @return UuidInterface A UuidInterface instance created from a hexadecimal - * string representation - * - * @psalm-pure - */ - public function fromString(string $uuid): UuidInterface; - - /** - * Creates a UUID from a 128-bit integer string - * - * @param string $integer String representation of 128-bit integer - * - * @return UuidInterface A UuidInterface instance created from the string - * representation of a 128-bit integer - * - * @psalm-pure - */ - public function fromInteger(string $integer): UuidInterface; - - /** - * Creates a UUID from a DateTimeInterface instance - * - * @param DateTimeInterface $dateTime The date and time - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID created from a DateTimeInterface instance - */ - public function fromDateTime( - DateTimeInterface $dateTime, - ?Hexadecimal $node = null, - ?int $clockSeq = null - ): UuidInterface; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidInterface.php deleted file mode 100644 index f22eb0f9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/UuidInterface.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use JsonSerializable; -use Ramsey\Uuid\Fields\FieldsInterface; -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; -use Serializable; - -/** - * A UUID is a universally unique identifier adhering to an agreed-upon - * representation format and standard for generation - * - * @psalm-immutable - */ -interface UuidInterface extends - DeprecatedUuidInterface, - JsonSerializable, - Serializable -{ - /** - * Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than - * the other UUID - * - * The first of two UUIDs is greater than the second if the most - * significant field in which the UUIDs differ is greater for the first - * UUID. - * - * * Q. What's the value of being able to sort UUIDs? - * * A. Use them as keys in a B-Tree or similar mapping. - * - * @param UuidInterface $other The UUID to compare - * - * @return int -1, 0, or 1 if the UUID is less than, equal to, or greater than $other - */ - public function compareTo(UuidInterface $other): int; - - /** - * Returns true if the UUID is equal to the provided object - * - * The result is true if and only if the argument is not null, is a UUID - * object, has the same variant, and contains the same value, bit for bit, - * as the UUID. - * - * @param object|null $other An object to test for equality with this UUID - * - * @return bool True if the other object is equal to this UUID - */ - public function equals(?object $other): bool; - - /** - * Returns the binary string representation of the UUID - * - * @psalm-return non-empty-string - */ - public function getBytes(): string; - - /** - * Returns the fields that comprise this UUID - */ - public function getFields(): FieldsInterface; - - /** - * Returns the hexadecimal representation of the UUID - */ - public function getHex(): Hexadecimal; - - /** - * Returns the integer representation of the UUID - */ - public function getInteger(): IntegerObject; - - /** - * Returns the string standard representation of the UUID - * - * @psalm-return non-empty-string - */ - public function toString(): string; - - /** - * Casts the UUID to the string standard representation - * - * @psalm-return non-empty-string - */ - public function __toString(): string; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Validator/GenericValidator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Validator/GenericValidator.php deleted file mode 100644 index fd609551..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Validator/GenericValidator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Validator; - -use Ramsey\Uuid\Uuid; - -use function preg_match; -use function str_replace; - -/** - * GenericValidator validates strings as UUIDs of any variant - * - * @psalm-immutable - */ -final class GenericValidator implements ValidatorInterface -{ - /** - * Regular expression pattern for matching a UUID of any variant. - */ - private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\z'; - - /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty - */ - public function getPattern(): string - { - return self::VALID_PATTERN; - } - - public function validate(string $uuid): bool - { - $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); - - return $uuid === Uuid::NIL || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Validator/ValidatorInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Validator/ValidatorInterface.php deleted file mode 100644 index 3d4bd6f2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/Validator/ValidatorInterface.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid\Validator; - -/** - * A validator validates a string as a proper UUID - * - * @psalm-immutable - */ -interface ValidatorInterface -{ - /** - * Returns the regular expression pattern used by this validator - * - * @return string The regular expression pattern this validator uses - * - * @psalm-return non-empty-string - */ - public function getPattern(): string; - - /** - * Returns true if the provided string represents a UUID - * - * @param string $uuid The string to validate as a UUID - * - * @return bool True if the string is a valid UUID, false otherwise - */ - public function validate(string $uuid): bool; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/functions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/functions.php deleted file mode 100644 index f5df1488..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/ramsey/uuid/src/functions.php +++ /dev/null @@ -1,123 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - * phpcs:disable Squiz.Functions.GlobalFunction - */ - -declare(strict_types=1); - -namespace Ramsey\Uuid; - -use Ramsey\Uuid\Type\Hexadecimal; -use Ramsey\Uuid\Type\Integer as IntegerObject; - -/** - * Returns a version 1 (time-based) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return non-empty-string Version 1 UUID as a string - */ -function v1($node = null, ?int $clockSeq = null): string -{ - return Uuid::uuid1($node, $clockSeq)->toString(); -} - -/** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return non-empty-string Version 2 UUID as a string - */ -function v2( - int $localDomain, - ?IntegerObject $localIdentifier = null, - ?Hexadecimal $node = null, - ?int $clockSeq = null -): string { - return Uuid::uuid2($localDomain, $localIdentifier, $node, $clockSeq)->toString(); -} - -/** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * - * @return non-empty-string Version 3 UUID as a string - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ -function v3($ns, string $name): string -{ - return Uuid::uuid3($ns, $name)->toString(); -} - -/** - * Returns a version 4 (random) UUID - * - * @return non-empty-string Version 4 UUID as a string - */ -function v4(): string -{ - return Uuid::uuid4()->toString(); -} - -/** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name - * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) - * - * @return non-empty-string Version 5 UUID as a string - * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - */ -function v5($ns, string $name): string -{ - return Uuid::uuid5($ns, $name)->toString(); -} - -/** - * Returns a version 6 (ordered-time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes - * - * @return non-empty-string Version 6 UUID as a string - */ -function v6(?Hexadecimal $node = null, ?int $clockSeq = null): string -{ - return Uuid::uuid6($node, $clockSeq)->toString(); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/.github/FUNDING.yml b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/.github/FUNDING.yml deleted file mode 100644 index 726574c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: Spomky -patreon: FlorentMorselli diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/LICENSE deleted file mode 100644 index 506ff485..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2018 Spomky-Labs - -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/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/composer.json deleted file mode 100644 index 1f3941b9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "spomky-labs/base64url", - "description": "Base 64 URL Safe Encoding/Decoding PHP Library", - "type": "library", - "license": "MIT", - "keywords": ["Base64", "URL", "Safe", "RFC4648"], - "homepage": "https://github.com/Spomky-Labs/base64url", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky-Labs/base64url/contributors" - } - ], - "autoload": { - "psr-4": { - "Base64Url\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Base64Url\\Test\\": "tests/" - } - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.11|^0.12", - "phpstan/phpstan-beberlei-assert": "^0.11|^0.12", - "phpstan/phpstan-deprecation-rules": "^0.11|^0.12", - "phpstan/phpstan-phpunit": "^0.11|^0.12", - "phpstan/phpstan-strict-rules": "^0.11|^0.12" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/src/Base64Url.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/src/Base64Url.php deleted file mode 100644 index 260215ae..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/base64url/src/Base64Url.php +++ /dev/null @@ -1,56 +0,0 @@ -=7.3", - "brick/math": "^0.8.15|^0.9.0", - "ext-mbstring": "*" - }, - "require-dev": { - "ext-json": "*", - "ekino/phpstan-banned-code": "^1.0", - "infection/infection": "^0.18|^0.25", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-beberlei-assert": "^1.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.12", - "roave/security-advisories": "dev-latest", - "symplify/easy-coding-standard": "^10.0" - }, - "config": { - "sort-packages": true - }, - "suggest": { - "ext-gmp": "GMP or BCMath extensions will drastically improve the library performance", - "ext-bcmath": "GMP or BCMath extensions will drastically improve the library performance. BCMath extension needed to handle the Big Float and Decimal Fraction Tags" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/AbstractCBORObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/AbstractCBORObject.php deleted file mode 100644 index a14d2626..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/AbstractCBORObject.php +++ /dev/null @@ -1,50 +0,0 @@ -majorType = $majorType; - $this->additionalInformation = $additionalInformation; - } - - public function __toString(): string - { - return chr($this->majorType << 5 | $this->additionalInformation); - } - - public function getMajorType(): int - { - return $this->majorType; - } - - public function getAdditionalInformation(): int - { - return $this->additionalInformation; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ByteStringObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ByteStringObject.php deleted file mode 100644 index 450f7ee2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ByteStringObject.php +++ /dev/null @@ -1,76 +0,0 @@ -length = $length; - $this->value = $data; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->length !== null) { - $result .= $this->length; - } - - return $result . $this->value; - } - - public static function create(string $data): self - { - return new self($data); - } - - public function getValue(): string - { - return $this->value; - } - - public function getLength(): int - { - return mb_strlen($this->value, '8bit'); - } - - public function normalize(): string - { - return $this->value; - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false): string - { - return $this->value; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ByteStringWithChunkObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ByteStringWithChunkObject.php deleted file mode 100644 index d173e2f7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ByteStringWithChunkObject.php +++ /dev/null @@ -1,21 +0,0 @@ -tagManager = $tagManager ?? $this->generateTagManager(); - $this->otherObjectManager = $otherTypeManager ?? $this->generateOtherObjectManager(); - } - - public static function create( - ?TagManagerInterface $tagManager = null, - ?OtherObjectManagerInterface $otherObjectManager = null - ): self { - return new self($tagManager, $otherObjectManager); - } - - public function withTagManager(TagManagerInterface $tagManager): self - { - $this->tagManager = $tagManager; - - return $this; - } - - public function withOtherObjectManager(OtherObjectManagerInterface $otherObjectManager): self - { - $this->otherObjectManager = $otherObjectManager; - - return $this; - } - - public function decode(Stream $stream): CBORObject - { - return $this->process($stream, false); - } - - private function process(Stream $stream, bool $breakable): CBORObject - { - $ib = ord($stream->read(1)); - $mt = $ib >> 5; - $ai = $ib & 0b00011111; - $val = null; - switch ($ai) { - case CBORObject::LENGTH_1_BYTE: //24 - case CBORObject::LENGTH_2_BYTES: //25 - case CBORObject::LENGTH_4_BYTES: //26 - case CBORObject::LENGTH_8_BYTES: //27 - $val = $stream->read(2 ** ($ai & 0b00000111)); - break; - case CBORObject::FUTURE_USE_1: //28 - case CBORObject::FUTURE_USE_2: //29 - case CBORObject::FUTURE_USE_3: //30 - throw new InvalidArgumentException(sprintf( - 'Cannot parse the data. Found invalid Additional Information "%s" (%d).', - str_pad(decbin($ai), 8, '0', STR_PAD_LEFT), - $ai - )); - case CBORObject::LENGTH_INDEFINITE: //31 - return $this->processInfinite($stream, $mt, $breakable); - } - - return $this->processFinite($stream, $mt, $ai, $val); - } - - private function processFinite(Stream $stream, int $mt, int $ai, ?string $val): CBORObject - { - switch ($mt) { - case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER: //0 - return UnsignedIntegerObject::createObjectForValue($ai, $val); - case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: //1 - return NegativeIntegerObject::createObjectForValue($ai, $val); - case CBORObject::MAJOR_TYPE_BYTE_STRING: //2 - $length = $val === null ? $ai : Utils::binToInt($val); - - return ByteStringObject::create($stream->read($length)); - case CBORObject::MAJOR_TYPE_TEXT_STRING: //3 - $length = $val === null ? $ai : Utils::binToInt($val); - - return TextStringObject::create($stream->read($length)); - case CBORObject::MAJOR_TYPE_LIST: //4 - $object = ListObject::create(); - $nbItems = $val === null ? $ai : Utils::binToInt($val); - for ($i = 0; $i < $nbItems; ++$i) { - $object->add($this->process($stream, false)); - } - - return $object; - case CBORObject::MAJOR_TYPE_MAP: //5 - $object = MapObject::create(); - $nbItems = $val === null ? $ai : Utils::binToInt($val); - for ($i = 0; $i < $nbItems; ++$i) { - $object->add($this->process($stream, false), $this->process($stream, false)); - } - - return $object; - case CBORObject::MAJOR_TYPE_TAG: //6 - return $this->tagManager->createObjectForValue($ai, $val, $this->process($stream, false)); - case CBORObject::MAJOR_TYPE_OTHER_TYPE: //7 - return $this->otherObjectManager->createObjectForValue($ai, $val); - default: - throw new RuntimeException(sprintf( - 'Unsupported major type "%s" (%d).', - str_pad(decbin($mt), 5, '0', STR_PAD_LEFT), - $mt - )); // Should never append - } - } - - private function processInfinite(Stream $stream, int $mt, bool $breakable): CBORObject - { - switch ($mt) { - case CBORObject::MAJOR_TYPE_BYTE_STRING: //2 - $object = IndefiniteLengthByteStringObject::create(); - while (! ($it = $this->process($stream, true)) instanceof BreakObject) { - if (! $it instanceof ByteStringObject) { - throw new RuntimeException( - 'Unable to parse the data. Infinite Byte String object can only get Byte String objects.' - ); - } - $object->add($it); - } - - return $object; - case CBORObject::MAJOR_TYPE_TEXT_STRING: //3 - $object = IndefiniteLengthTextStringObject::create(); - while (! ($it = $this->process($stream, true)) instanceof BreakObject) { - if (! $it instanceof TextStringObject) { - throw new RuntimeException( - 'Unable to parse the data. Infinite Text String object can only get Text String objects.' - ); - } - $object->add($it); - } - - return $object; - case CBORObject::MAJOR_TYPE_LIST: //4 - $object = IndefiniteLengthListObject::create(); - $it = $this->process($stream, true); - while (! $it instanceof BreakObject) { - $object->add($it); - $it = $this->process($stream, true); - } - - return $object; - case CBORObject::MAJOR_TYPE_MAP: //5 - $object = IndefiniteLengthMapObject::create(); - while (! ($it = $this->process($stream, true)) instanceof BreakObject) { - $object->add($it, $this->process($stream, false)); - } - - return $object; - case CBORObject::MAJOR_TYPE_OTHER_TYPE: //7 - if (! $breakable) { - throw new InvalidArgumentException('Cannot parse the data. No enclosing indefinite.'); - } - - return BreakObject::create(); - case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER: //0 - case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: //1 - case CBORObject::MAJOR_TYPE_TAG: //6 - default: - throw new InvalidArgumentException(sprintf( - 'Cannot parse the data. Found infinite length for Major Type "%s" (%d).', - str_pad(decbin($mt), 5, '0', STR_PAD_LEFT), - $mt - )); - } - } - - private function generateTagManager(): TagManagerInterface - { - return TagManager::create() - ->add(DatetimeTag::class) - ->add(TimestampTag::class) - - ->add(UnsignedBigIntegerTag::class) - ->add(NegativeBigIntegerTag::class) - - ->add(DecimalFractionTag::class) - ->add(BigFloatTag::class) - - ->add(Base64UrlEncodingTag::class) - ->add(Base64EncodingTag::class) - ->add(Base16EncodingTag::class) - ->add(CBOREncodingTag::class) - - ->add(UriTag::class) - ->add(Base64UrlTag::class) - ->add(Base64Tag::class) - ->add(MimeTag::class) - - ->add(CBORTag::class) - ; - } - - private function generateOtherObjectManager(): OtherObjectManagerInterface - { - return OtherObjectManager::create() - ->add(BreakObject::class) - ->add(SimpleObject::class) - ->add(FalseObject::class) - ->add(TrueObject::class) - ->add(NullObject::class) - ->add(UndefinedObject::class) - ->add(HalfPrecisionFloatObject::class) - ->add(SinglePrecisionFloatObject::class) - ->add(DoublePrecisionFloatObject::class) - ; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/DecoderInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/DecoderInterface.php deleted file mode 100644 index 3d7b1924..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/DecoderInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -chunks as $chunk) { - $result .= $chunk->__toString(); - } - - return $result . "\xFF"; - } - - public static function create(): self - { - return new self(); - } - - public function add(ByteStringObject $chunk): self - { - $this->chunks[] = $chunk; - - return $this; - } - - public function append(string $chunk): self - { - $this->add(ByteStringObject::create($chunk)); - - return $this; - } - - public function getValue(): string - { - $result = ''; - foreach ($this->chunks as $chunk) { - $result .= $chunk->getValue(); - } - - return $result; - } - - public function getLength(): int - { - $length = 0; - foreach ($this->chunks as $chunk) { - $length += $chunk->getLength(); - } - - return $length; - } - - public function normalize(): string - { - $result = ''; - foreach ($this->chunks as $chunk) { - $result .= $chunk->normalize(); - } - - return $result; - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false): string - { - $result = ''; - foreach ($this->chunks as $chunk) { - $result .= $chunk->getNormalizedData($ignoreTags); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php deleted file mode 100644 index 2bf44fb4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthListObject.php +++ /dev/null @@ -1,167 +0,0 @@ - - * @phpstan-implements IteratorAggregate - * @final - */ -class IndefiniteLengthListObject extends AbstractCBORObject implements Countable, IteratorAggregate, Normalizable, ArrayAccess -{ - private const MAJOR_TYPE = self::MAJOR_TYPE_LIST; - - private const ADDITIONAL_INFORMATION = self::LENGTH_INDEFINITE; - - /** - * @var CBORObject[] - */ - private $data = []; - - public function __construct() - { - parent::__construct(self::MAJOR_TYPE, self::ADDITIONAL_INFORMATION); - } - - public function __toString(): string - { - $result = parent::__toString(); - foreach ($this->data as $object) { - $result .= (string) $object; - } - - return $result . "\xFF"; - } - - public static function create(): self - { - return new self(); - } - - /** - * @return mixed[] - */ - public function normalize(): array - { - return array_map(static function (CBORObject $object) { - return $object instanceof Normalizable ? $object->normalize() : $object; - }, $this->data); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - * - * @return mixed[] - */ - public function getNormalizedData(bool $ignoreTags = false): array - { - return array_map(static function (CBORObject $object) use ($ignoreTags) { - return $object->getNormalizedData($ignoreTags); - }, $this->data); - } - - public function add(CBORObject $item): self - { - $this->data[] = $item; - - return $this; - } - - public function has(int $index): bool - { - return array_key_exists($index, $this->data); - } - - public function remove(int $index): self - { - if (! $this->has($index)) { - return $this; - } - unset($this->data[$index]); - $this->data = array_values($this->data); - - return $this; - } - - public function get(int $index): CBORObject - { - if (! $this->has($index)) { - throw new InvalidArgumentException('Index not found.'); - } - - return $this->data[$index]; - } - - public function set(int $index, CBORObject $object): self - { - if (! $this->has($index)) { - throw new InvalidArgumentException('Index not found.'); - } - - $this->data[$index] = $object; - - return $this; - } - - /** - * @deprecated The method will be removed on v3.0. No replacement - */ - public function count(): int - { - return count($this->data); - } - - /** - * @return Iterator - */ - public function getIterator(): Iterator - { - return new ArrayIterator($this->data); - } - - public function offsetExists($offset): bool - { - return $this->has($offset); - } - - public function offsetGet($offset): CBORObject - { - return $this->get($offset); - } - - public function offsetSet($offset, $value): void - { - if ($offset === null) { - $this->add($value); - - return; - } - - $this->set($offset, $value); - } - - public function offsetUnset($offset): void - { - $this->remove($offset); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthMapObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthMapObject.php deleted file mode 100644 index 7bc7a1c1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthMapObject.php +++ /dev/null @@ -1,201 +0,0 @@ - - * @phpstan-implements IteratorAggregate - * @final - */ -class IndefiniteLengthMapObject extends AbstractCBORObject implements Countable, IteratorAggregate, Normalizable, ArrayAccess -{ - private const MAJOR_TYPE = self::MAJOR_TYPE_MAP; - - private const ADDITIONAL_INFORMATION = self::LENGTH_INDEFINITE; - - /** - * @var MapItem[] - */ - private $data = []; - - public function __construct() - { - parent::__construct(self::MAJOR_TYPE, self::ADDITIONAL_INFORMATION); - } - - public function __toString(): string - { - $result = parent::__toString(); - foreach ($this->data as $object) { - $result .= (string) $object->getKey(); - $result .= (string) $object->getValue(); - } - - return $result . "\xFF"; - } - - public static function create(): self - { - return new self(); - } - - /** - * @deprecated The method will be removed on v3.0. Please use "add" instead - */ - public function append(CBORObject $key, CBORObject $value): self - { - return $this->add($key, $value); - } - - public function add(CBORObject $key, CBORObject $value): self - { - if (! $key instanceof Normalizable) { - throw new InvalidArgumentException('Invalid key. Shall be normalizable'); - } - $this->data[$key->normalize()] = MapItem::create($key, $value); - - return $this; - } - - /** - * @param int|string $key - */ - public function has($key): bool - { - return array_key_exists($key, $this->data); - } - - /** - * @param int|string $index - */ - public function remove($index): self - { - if (! $this->has($index)) { - return $this; - } - unset($this->data[$index]); - $this->data = array_values($this->data); - - return $this; - } - - /** - * @param int|string $index - */ - public function get($index): CBORObject - { - if (! $this->has($index)) { - throw new InvalidArgumentException('Index not found.'); - } - - return $this->data[$index]->getValue(); - } - - public function set(MapItem $object): self - { - $key = $object->getKey(); - if (! $key instanceof Normalizable) { - throw new InvalidArgumentException('Invalid key. Shall be normalizable'); - } - - $this->data[$key->normalize()] = $object; - - return $this; - } - - /** - * @deprecated The method will be removed on v3.0. No replacement - */ - public function count(): int - { - return count($this->data); - } - - /** - * @return Iterator - */ - public function getIterator(): Iterator - { - return new ArrayIterator($this->data); - } - - /** - * @return mixed[] - */ - public function normalize(): array - { - return array_reduce($this->data, static function (array $carry, MapItem $item): array { - $key = $item->getKey(); - if (! $key instanceof Normalizable) { - throw new InvalidArgumentException('Invalid key. Shall be normalizable'); - } - $valueObject = $item->getValue(); - $carry[$key->normalize()] = $valueObject instanceof Normalizable ? $valueObject->normalize() : $valueObject; - - return $carry; - }, []); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - * - * @return mixed[] - */ - public function getNormalizedData(bool $ignoreTags = false): array - { - return array_reduce($this->data, static function (array $carry, MapItem $item) use ($ignoreTags): array { - $key = $item->getKey(); - $valueObject = $item->getValue(); - $carry[$key->getNormalizedData($ignoreTags)] = $valueObject->getNormalizedData($ignoreTags); - - return $carry; - }, []); - } - - public function offsetExists($offset): bool - { - return $this->has($offset); - } - - public function offsetGet($offset): CBORObject - { - return $this->get($offset); - } - - public function offsetSet($offset, $value): void - { - if (! $offset instanceof CBORObject) { - throw new InvalidArgumentException('Invalid key'); - } - if (! $value instanceof CBORObject) { - throw new InvalidArgumentException('Invalid value'); - } - - $this->set(MapItem::create($offset, $value)); - } - - public function offsetUnset($offset): void - { - $this->remove($offset); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php deleted file mode 100644 index 108528e2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/IndefiniteLengthTextStringObject.php +++ /dev/null @@ -1,106 +0,0 @@ -data as $object) { - $result .= (string) $object; - } - - return $result . "\xFF"; - } - - public static function create(): self - { - return new self(); - } - - public function add(TextStringObject $chunk): self - { - $this->data[] = $chunk; - - return $this; - } - - public function append(string $chunk): self - { - $this->add(TextStringObject::create($chunk)); - - return $this; - } - - public function getValue(): string - { - $result = ''; - foreach ($this->data as $object) { - $result .= $object->getValue(); - } - - return $result; - } - - public function getLength(): int - { - $length = 0; - foreach ($this->data as $object) { - $length += $object->getLength(); - } - - return $length; - } - - public function normalize(): string - { - $result = ''; - foreach ($this->data as $object) { - $result .= $object->normalize(); - } - - return $result; - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false): string - { - $result = ''; - foreach ($this->data as $object) { - $result .= $object->getNormalizedData($ignoreTags); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/InfiniteListObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/InfiniteListObject.php deleted file mode 100644 index 526d74cc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/InfiniteListObject.php +++ /dev/null @@ -1,21 +0,0 @@ - $data - * - * @return array{int, null|string} - */ - public static function getLengthOfArray(array $data): array - { - $length = count($data); - - return self::computeLength($length); - } - - /** - * @return array{int, null|string} - */ - private static function computeLength(int $length): array - { - switch (true) { - case $length <= 23: - return [$length, null]; - case $length <= 0xFF: - return [CBORObject::LENGTH_1_BYTE, chr($length)]; - case $length <= 0xFFFF: - return [CBORObject::LENGTH_2_BYTES, self::hex2bin(dechex($length))]; - case $length <= 0xFFFFFFFF: - return [CBORObject::LENGTH_4_BYTES, self::hex2bin(dechex($length))]; - case BigInteger::of($length)->isLessThanOrEqualTo(BigInteger::fromBase('FFFFFFFFFFFFFFFF', 16)): - return [CBORObject::LENGTH_8_BYTES, self::hex2bin(dechex($length))]; - default: - return [CBORObject::LENGTH_INDEFINITE, null]; - } - } - - private static function hex2bin(string $data): string - { - $data = str_pad($data, (int) (2 ** ceil(log(mb_strlen($data, '8bit'), 2))), '0', STR_PAD_LEFT); - $result = hex2bin($data); - if ($result === false) { - throw new InvalidArgumentException('Unable to convert the data'); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ListObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ListObject.php deleted file mode 100644 index f3a32133..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/ListObject.php +++ /dev/null @@ -1,187 +0,0 @@ - - * @phpstan-implements IteratorAggregate - */ -class ListObject extends AbstractCBORObject implements Countable, IteratorAggregate, Normalizable, ArrayAccess -{ - private const MAJOR_TYPE = self::MAJOR_TYPE_LIST; - - /** - * @var CBORObject[] - */ - private $data; - - /** - * @var string|null - */ - private $length; - - /** - * @param CBORObject[] $data - */ - public function __construct(array $data = []) - { - [$additionalInformation, $length] = LengthCalculator::getLengthOfArray($data); - array_map(static function ($item): void { - if (! $item instanceof CBORObject) { - throw new InvalidArgumentException('The list must contain only CBORObject objects.'); - } - }, $data); - - parent::__construct(self::MAJOR_TYPE, $additionalInformation); - $this->data = array_values($data); - $this->length = $length; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->length !== null) { - $result .= $this->length; - } - foreach ($this->data as $object) { - $result .= (string) $object; - } - - return $result; - } - - /** - * @param CBORObject[] $data - */ - public static function create(array $data = []): self - { - return new self($data); - } - - public function add(CBORObject $object): self - { - $this->data[] = $object; - [$this->additionalInformation, $this->length] = LengthCalculator::getLengthOfArray($this->data); - - return $this; - } - - public function has(int $index): bool - { - return array_key_exists($index, $this->data); - } - - public function remove(int $index): self - { - if (! $this->has($index)) { - return $this; - } - unset($this->data[$index]); - $this->data = array_values($this->data); - [$this->additionalInformation, $this->length] = LengthCalculator::getLengthOfArray($this->data); - - return $this; - } - - public function get(int $index): CBORObject - { - if (! $this->has($index)) { - throw new InvalidArgumentException('Index not found.'); - } - - return $this->data[$index]; - } - - public function set(int $index, CBORObject $object): self - { - if (! $this->has($index)) { - throw new InvalidArgumentException('Index not found.'); - } - - $this->data[$index] = $object; - [$this->additionalInformation, $this->length] = LengthCalculator::getLengthOfArray($this->data); - - return $this; - } - - /** - * @return array - */ - public function normalize(): array - { - return array_map(static function (CBORObject $object) { - return $object instanceof Normalizable ? $object->normalize() : $object; - }, $this->data); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - * - * @return array - */ - public function getNormalizedData(bool $ignoreTags = false): array - { - return array_map(static function (CBORObject $object) use ($ignoreTags) { - return $object->getNormalizedData($ignoreTags); - }, $this->data); - } - - public function count(): int - { - return count($this->data); - } - - /** - * @return Iterator - */ - public function getIterator(): Iterator - { - return new ArrayIterator($this->data); - } - - public function offsetExists($offset): bool - { - return $this->has($offset); - } - - public function offsetGet($offset): CBORObject - { - return $this->get($offset); - } - - public function offsetSet($offset, $value): void - { - if ($offset === null) { - $this->add($value); - - return; - } - - $this->set($offset, $value); - } - - public function offsetUnset($offset): void - { - $this->remove($offset); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/MapItem.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/MapItem.php deleted file mode 100644 index 39578a6e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/MapItem.php +++ /dev/null @@ -1,48 +0,0 @@ -key = $key; - $this->value = $value; - } - - public static function create(CBORObject $key, CBORObject $value): self - { - return new self($key, $value); - } - - public function getKey(): CBORObject - { - return $this->key; - } - - public function getValue(): CBORObject - { - return $this->value; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/MapObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/MapObject.php deleted file mode 100644 index 9c71332e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/MapObject.php +++ /dev/null @@ -1,217 +0,0 @@ - - * @phpstan-implements IteratorAggregate - */ -final class MapObject extends AbstractCBORObject implements Countable, IteratorAggregate, Normalizable, ArrayAccess -{ - private const MAJOR_TYPE = self::MAJOR_TYPE_MAP; - - /** - * @var MapItem[] - */ - private $data; - - /** - * @var string|null - */ - private $length; - - /** - * @param MapItem[] $data - */ - public function __construct(array $data = []) - { - [$additionalInformation, $length] = LengthCalculator::getLengthOfArray($data); - array_map(static function ($item): void { - if (! $item instanceof MapItem) { - throw new InvalidArgumentException('The list must contain only MapItem objects.'); - } - }, $data); - - parent::__construct(self::MAJOR_TYPE, $additionalInformation); - $this->data = $data; - $this->length = $length; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->length !== null) { - $result .= $this->length; - } - foreach ($this->data as $object) { - $result .= $object->getKey() - ->__toString() - ; - $result .= $object->getValue() - ->__toString() - ; - } - - return $result; - } - - /** - * @param MapItem[] $data - */ - public static function create(array $data = []): self - { - return new self($data); - } - - public function add(CBORObject $key, CBORObject $value): self - { - if (! $key instanceof Normalizable) { - throw new InvalidArgumentException('Invalid key. Shall be normalizable'); - } - $this->data[$key->normalize()] = MapItem::create($key, $value); - [$this->additionalInformation, $this->length] = LengthCalculator::getLengthOfArray($this->data); - - return $this; - } - - /** - * @param int|string $key - */ - public function has($key): bool - { - return array_key_exists($key, $this->data); - } - - /** - * @param int|string $index - */ - public function remove($index): self - { - if (! $this->has($index)) { - return $this; - } - unset($this->data[$index]); - $this->data = array_values($this->data); - [$this->additionalInformation, $this->length] = LengthCalculator::getLengthOfArray($this->data); - - return $this; - } - - /** - * @param int|string $index - */ - public function get($index): CBORObject - { - if (! $this->has($index)) { - throw new InvalidArgumentException('Index not found.'); - } - - return $this->data[$index]->getValue(); - } - - public function set(MapItem $object): self - { - $key = $object->getKey(); - if (! $key instanceof Normalizable) { - throw new InvalidArgumentException('Invalid key. Shall be normalizable'); - } - - $this->data[$key->normalize()] = $object; - [$this->additionalInformation, $this->length] = LengthCalculator::getLengthOfArray($this->data); - - return $this; - } - - public function count(): int - { - return count($this->data); - } - - /** - * @return Iterator - */ - public function getIterator(): Iterator - { - return new ArrayIterator($this->data); - } - - /** - * @return array - */ - public function normalize(): array - { - return array_reduce($this->data, static function (array $carry, MapItem $item): array { - $key = $item->getKey(); - if (! $key instanceof Normalizable) { - throw new InvalidArgumentException('Invalid key. Shall be normalizable'); - } - $valueObject = $item->getValue(); - $carry[$key->normalize()] = $valueObject instanceof Normalizable ? $valueObject->normalize() : $valueObject; - - return $carry; - }, []); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - * - * @return array - */ - public function getNormalizedData(bool $ignoreTags = false): array - { - return array_reduce($this->data, static function (array $carry, MapItem $item) use ($ignoreTags): array { - $key = $item->getKey(); - $valueObject = $item->getValue(); - $carry[$key->getNormalizedData($ignoreTags)] = $valueObject->getNormalizedData($ignoreTags); - - return $carry; - }, []); - } - - public function offsetExists($offset): bool - { - return $this->has($offset); - } - - public function offsetGet($offset): CBORObject - { - return $this->get($offset); - } - - public function offsetSet($offset, $value): void - { - if (! $offset instanceof CBORObject) { - throw new InvalidArgumentException('Invalid key'); - } - if (! $value instanceof CBORObject) { - throw new InvalidArgumentException('Invalid value'); - } - - $this->set(MapItem::create($offset, $value)); - } - - public function offsetUnset($offset): void - { - $this->remove($offset); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/NegativeIntegerObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/NegativeIntegerObject.php deleted file mode 100644 index ad1bbe1e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/NegativeIntegerObject.php +++ /dev/null @@ -1,136 +0,0 @@ -data = $data; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->data !== null) { - $result .= $this->data; - } - - return $result; - } - - public static function createObjectForValue(int $additionalInformation, ?string $data): self - { - return new self($additionalInformation, $data); - } - - public static function create(int $value): self - { - return self::createFromString((string) $value); - } - - public static function createFromString(string $value): self - { - $integer = BigInteger::of($value); - - return self::createBigInteger($integer); - } - - public function getValue(): string - { - if ($this->data === null) { - return (string) (-1 - $this->additionalInformation); - } - - $result = Utils::binToBigInteger($this->data); - $minusOne = BigInteger::of(-1); - - return $minusOne->minus($result) - ->toBase(10) - ; - } - - public function normalize(): string - { - return $this->getValue(); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false): string - { - return $this->getValue(); - } - - private static function createBigInteger(BigInteger $integer): self - { - if ($integer->isGreaterThanOrEqualTo(BigInteger::zero())) { - throw new InvalidArgumentException('The value must be a negative integer.'); - } - - $minusOne = BigInteger::of(-1); - $computed_value = $minusOne->minus($integer); - - switch (true) { - case $computed_value->isLessThan(BigInteger::of(24)): - $ai = $computed_value->toInt(); - $data = null; - break; - case $computed_value->isLessThan(BigInteger::fromBase('FF', 16)): - $ai = 24; - $data = self::hex2bin(str_pad($computed_value->toBase(16), 2, '0', STR_PAD_LEFT)); - break; - case $computed_value->isLessThan(BigInteger::fromBase('FFFF', 16)): - $ai = 25; - $data = self::hex2bin(str_pad($computed_value->toBase(16), 4, '0', STR_PAD_LEFT)); - break; - case $computed_value->isLessThan(BigInteger::fromBase('FFFFFFFF', 16)): - $ai = 26; - $data = self::hex2bin(str_pad($computed_value->toBase(16), 8, '0', STR_PAD_LEFT)); - break; - default: - throw new InvalidArgumentException( - 'Out of range. Please use NegativeBigIntegerTag tag with ByteStringObject object instead.' - ); - } - - return new self($ai, $data); - } - - private static function hex2bin(string $data): string - { - $result = hex2bin($data); - if ($result === false) { - throw new InvalidArgumentException('Unable to convert the data'); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Normalizable.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Normalizable.php deleted file mode 100644 index 3b776621..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Normalizable.php +++ /dev/null @@ -1,22 +0,0 @@ -data = $data; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->data !== null) { - $result .= $this->data; - } - - return $result; - } - - public function getContent(): ?string - { - return $this->data; - } - - /** - * @return int[] - */ - abstract public static function supportedAdditionalInformation(): array; - - abstract public static function createFromLoadedData(int $additionalInformation, ?string $data): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/BreakObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/BreakObject.php deleted file mode 100644 index 339f11b3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/BreakObject.php +++ /dev/null @@ -1,47 +0,0 @@ -normalize(); - } - - /** - * @return float|int - */ - public function normalize() - { - $exponent = $this->getExponent(); - $mantissa = $this->getMantissa(); - $sign = $this->getSign(); - - if ($exponent === 0) { - $val = $mantissa * 2 ** (-(1022 + 52)); - } elseif ($exponent !== 0b11111111111) { - $val = ($mantissa + (1 << 52)) * 2 ** ($exponent - (1023 + 52)); - } else { - $val = $mantissa === 0 ? INF : NAN; - } - - return $sign * $val; - } - - public function getExponent(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - - return Utils::binToBigInteger($data)->shiftedRight(52)->and(Utils::hexToBigInteger('7ff'))->toInt(); - } - - public function getMantissa(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - - return Utils::binToBigInteger($data)->and(Utils::hexToBigInteger('fffffffffffff'))->toInt(); - } - - public function getSign(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - $sign = Utils::binToBigInteger($data)->shiftedRight(63); - - return $sign->isEqualTo(BigInteger::one()) ? -1 : 1; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/FalseObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/FalseObject.php deleted file mode 100644 index c3ce42ab..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/FalseObject.php +++ /dev/null @@ -1,53 +0,0 @@ -normalize(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/GenericObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/GenericObject.php deleted file mode 100644 index fb9fccc4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/GenericObject.php +++ /dev/null @@ -1,43 +0,0 @@ -data; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php deleted file mode 100644 index 1f05c5bb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/HalfPrecisionFloatObject.php +++ /dev/null @@ -1,97 +0,0 @@ -normalize(); - } - - /** - * @return float|int - */ - public function normalize() - { - $exponent = $this->getExponent(); - $mantissa = $this->getMantissa(); - $sign = $this->getSign(); - - if ($exponent === 0) { - $val = $mantissa * 2 ** (-24); - } elseif ($exponent !== 0b11111) { - $val = ($mantissa + (1 << 10)) * 2 ** ($exponent - 25); - } else { - $val = $mantissa === 0 ? INF : NAN; - } - - return $sign * $val; - } - - public function getExponent(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - - return Utils::binToBigInteger($data)->shiftedRight(10)->and(Utils::hexToBigInteger('1f'))->toInt(); - } - - public function getMantissa(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - - return Utils::binToBigInteger($data)->and(Utils::hexToBigInteger('3ff'))->toInt(); - } - - public function getSign(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - $sign = Utils::binToBigInteger($data)->shiftedRight(15); - - return $sign->isEqualTo(BigInteger::one()) ? -1 : 1; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/NullObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/NullObject.php deleted file mode 100644 index a960acf4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/NullObject.php +++ /dev/null @@ -1,53 +0,0 @@ -normalize(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/OtherObjectManager.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/OtherObjectManager.php deleted file mode 100644 index 88edcd19..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/OtherObjectManager.php +++ /dev/null @@ -1,59 +0,0 @@ -classes[$ai] = $class; - } - - return $this; - } - - public function getClassForValue(int $value): string - { - return array_key_exists($value, $this->classes) ? $this->classes[$value] : GenericObject::class; - } - - public function createObjectForValue(int $value, ?string $data): OtherObject - { - /** @var OtherObject $class */ - $class = $this->getClassForValue($value); - - return $class::createFromLoadedData($value, $data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/OtherObjectManagerInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/OtherObjectManagerInterface.php deleted file mode 100644 index 6c0336de..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/OtherObjectManagerInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -data === null) { - return $this->getAdditionalInformation(); - } - - return Utils::binToInt($this->data); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false): int - { - return $this->normalize(); - } - - public static function create(int $value): self - { - switch (true) { - case $value < 32: - return new self($value, null); - case $value < 256: - return new self(24, chr($value)); - default: - throw new InvalidArgumentException('The value is not a valid simple value.'); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php deleted file mode 100644 index 3c3af613..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/SinglePrecisionFloatObject.php +++ /dev/null @@ -1,96 +0,0 @@ -normalize(); - } - - /** - * @return float|int - */ - public function normalize() - { - $exponent = $this->getExponent(); - $mantissa = $this->getMantissa(); - $sign = $this->getSign(); - - if ($exponent === 0) { - $val = $mantissa * 2 ** (-(126 + 23)); - } elseif ($exponent !== 0b11111111) { - $val = ($mantissa + (1 << 23)) * 2 ** ($exponent - (127 + 23)); - } else { - $val = $mantissa === 0 ? INF : NAN; - } - - return $sign * $val; - } - - public function getExponent(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - - return Utils::binToBigInteger($data)->shiftedRight(23)->and(Utils::hexToBigInteger('ff'))->toInt(); - } - - public function getMantissa(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - - return Utils::binToBigInteger($data)->and(Utils::hexToBigInteger('7fffff'))->toInt(); - } - - public function getSign(): int - { - $data = $this->data; - Utils::assertString($data, 'Invalid data'); - $sign = Utils::binToBigInteger($data)->shiftedRight(31); - - return $sign->isEqualTo(BigInteger::one()) ? -1 : 1; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/TrueObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/TrueObject.php deleted file mode 100644 index d348a1ba..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/TrueObject.php +++ /dev/null @@ -1,53 +0,0 @@ -normalize(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/UndefinedObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/UndefinedObject.php deleted file mode 100644 index 0b4bf899..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/OtherObject/UndefinedObject.php +++ /dev/null @@ -1,49 +0,0 @@ -resource = $resource; - } - - public static function create(string $data): self - { - return new self($data); - } - - public function read(int $length): string - { - if ($length === 0) { - return ''; - } - - $alreadyRead = 0; - $data = ''; - while ($alreadyRead < $length) { - $left = $length - $alreadyRead; - $sizeToRead = $left < 1024 && $left > 0 ? $left : 1024; - $newData = fread($this->resource, $sizeToRead); - $alreadyRead += $sizeToRead; - - if ($newData === false) { - throw new RuntimeException('Unable to read the memory'); - } - if (mb_strlen($newData, '8bit') < $sizeToRead) { - throw new InvalidArgumentException(sprintf( - 'Out of range. Expected: %d, read: %d.', - $length, - mb_strlen($data, '8bit') - )); - } - $data .= $newData; - } - - if (mb_strlen($data, '8bit') !== $length) { - throw new InvalidArgumentException(sprintf( - 'Out of range. Expected: %d, read: %d.', - $length, - mb_strlen($data, '8bit') - )); - } - - return $data; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag.php deleted file mode 100644 index 9d7171a9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag.php +++ /dev/null @@ -1,99 +0,0 @@ -data = $data; - $this->object = $object; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->data !== null) { - $result .= $this->data; - } - - return $result . $this->object; - } - - public function getData(): ?string - { - return $this->data; - } - - abstract public static function getTagId(): int; - - abstract public static function createFromLoadedData( - int $additionalInformation, - ?string $data, - CBORObject $object - ): self; - - public function getValue(): CBORObject - { - return $this->object; - } - - /** - * @return array{int, null|string} - */ - protected static function determineComponents(int $tag): array - { - switch (true) { - case $tag < 0: - throw new InvalidArgumentException('The value must be a positive integer.'); - case $tag < 24: - return [$tag, null]; - case $tag < 0xFF: - return [24, self::hex2bin(dechex($tag))]; - case $tag < 0xFFFF: - return [25, self::hex2bin(dechex($tag))]; - case $tag < 0xFFFFFFFF: - return [26, self::hex2bin(dechex($tag))]; - default: - throw new InvalidArgumentException( - 'Out of range. Please use PositiveBigIntegerTag tag with ByteStringObject object instead.' - ); - } - } - - private static function hex2bin(string $data): string - { - $result = hex2bin($data); - if ($result === false) { - throw new InvalidArgumentException('Unable to convert the data'); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base16EncodingTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base16EncodingTag.php deleted file mode 100644 index 1130358d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base16EncodingTag.php +++ /dev/null @@ -1,57 +0,0 @@ -object->getNormalizedData($ignoreTags); - } - - if (! $this->object instanceof ByteStringObject && ! $this->object instanceof IndefiniteLengthByteStringObject && ! $this->object instanceof TextStringObject && ! $this->object instanceof IndefiniteLengthTextStringObject) { - return $this->object->getNormalizedData($ignoreTags); - } - - return bin2hex($this->object->getNormalizedData($ignoreTags)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64EncodingTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64EncodingTag.php deleted file mode 100644 index 6f8bb60e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64EncodingTag.php +++ /dev/null @@ -1,63 +0,0 @@ -object->getNormalizedData($ignoreTags); - } - - if (! $this->object instanceof ByteStringObject && ! $this->object instanceof IndefiniteLengthByteStringObject && ! $this->object instanceof TextStringObject && ! $this->object instanceof IndefiniteLengthTextStringObject) { - return $this->object->getNormalizedData($ignoreTags); - } - - $result = base64_decode($this->object->getNormalizedData($ignoreTags), true); - if ($result === false) { - throw new InvalidArgumentException('Unable to decode the data'); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64Tag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64Tag.php deleted file mode 100644 index b6693270..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64Tag.php +++ /dev/null @@ -1,57 +0,0 @@ -object->getNormalizedData($ignoreTags); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64UrlEncodingTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64UrlEncodingTag.php deleted file mode 100644 index 4dbaaf82..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64UrlEncodingTag.php +++ /dev/null @@ -1,58 +0,0 @@ -object->getNormalizedData($ignoreTags); - } - - if (! $this->object instanceof ByteStringObject && ! $this->object instanceof IndefiniteLengthByteStringObject && ! $this->object instanceof TextStringObject && ! $this->object instanceof IndefiniteLengthTextStringObject) { - return $this->object->getNormalizedData($ignoreTags); - } - - return Utils::decode($this->object->getNormalizedData($ignoreTags)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64UrlTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64UrlTag.php deleted file mode 100644 index 1d7d27f6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/Base64UrlTag.php +++ /dev/null @@ -1,57 +0,0 @@ -object->getNormalizedData($ignoreTags); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/BigFloatTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/BigFloatTag.php deleted file mode 100644 index c6a33b24..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/BigFloatTag.php +++ /dev/null @@ -1,108 +0,0 @@ -get(0); - if (! $e instanceof UnsignedIntegerObject && ! $e instanceof NegativeIntegerObject) { - throw new InvalidArgumentException('The exponent must be a Signed Integer or an Unsigned Integer object.'); - } - $m = $object->get(1); - if (! $m instanceof UnsignedIntegerObject && ! $m instanceof NegativeIntegerObject && ! $m instanceof NegativeBigIntegerTag && ! $m instanceof UnsignedBigIntegerTag) { - throw new InvalidArgumentException( - 'The mantissa must be a Positive or Negative Signed Integer or an Unsigned Integer object.' - ); - } - - parent::__construct($additionalInformation, $data, $object); - } - - public static function getTagId(): int - { - return self::TAG_BIG_FLOAT; - } - - public static function createFromLoadedData(int $additionalInformation, ?string $data, CBORObject $object): Tag - { - return new self($additionalInformation, $data, $object); - } - - public static function create(CBORObject $object): Tag - { - [$ai, $data] = self::determineComponents(self::TAG_BIG_FLOAT); - - return new self($ai, $data, $object); - } - - public static function createFromExponentAndMantissa(CBORObject $e, CBORObject $m): Tag - { - $object = ListObject::create() - ->add($e) - ->add($m) - ; - - return self::create($object); - } - - public function normalize() - { - /** @var ListObject $object */ - $object = $this->object; - /** @var UnsignedIntegerObject|NegativeIntegerObject $e */ - $e = $object->get(0); - /** @var UnsignedIntegerObject|NegativeIntegerObject|NegativeBigIntegerTag|UnsignedBigIntegerTag $m */ - $m = $object->get(1); - - return rtrim(bcmul($m->normalize(), bcpow('2', $e->normalize(), 100), 100), '0'); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - if ($ignoreTags) { - return $this->object->getNormalizedData($ignoreTags); - } - - if (! $this->object instanceof ListObject || count($this->object) !== 2) { - return $this->object->getNormalizedData($ignoreTags); - } - - return $this->normalize(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/CBOREncodingTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/CBOREncodingTag.php deleted file mode 100644 index 612a6d31..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/CBOREncodingTag.php +++ /dev/null @@ -1,57 +0,0 @@ -object->getNormalizedData($ignoreTags); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/CBORTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/CBORTag.php deleted file mode 100644 index fbb8581f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/CBORTag.php +++ /dev/null @@ -1,54 +0,0 @@ -object instanceof Normalizable ? $this->object->normalize() : $this->object; - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - return $this->object->getNormalizedData($ignoreTags); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/DatetimeTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/DatetimeTag.php deleted file mode 100644 index ac078374..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/DatetimeTag.php +++ /dev/null @@ -1,84 +0,0 @@ -object; - $result = DateTimeImmutable::createFromFormat(DATE_RFC3339, $object->normalize()); - if ($result !== false) { - return $result; - } - - $formatted = DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.uP', $object->normalize()); - if ($formatted === false) { - throw new InvalidArgumentException('Invalid data. Cannot be converted into a datetime object'); - } - - return $formatted; - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - if ($ignoreTags) { - return $this->object->getNormalizedData($ignoreTags); - } - - return $this->normalize(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/DecimalFractionTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/DecimalFractionTag.php deleted file mode 100644 index 76b5c6a7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/DecimalFractionTag.php +++ /dev/null @@ -1,114 +0,0 @@ -get(0); - if (! $e instanceof UnsignedIntegerObject && ! $e instanceof NegativeIntegerObject) { - throw new InvalidArgumentException('The exponent must be a Signed Integer or an Unsigned Integer object.'); - } - $m = $object->get(1); - if (! $m instanceof UnsignedIntegerObject && ! $m instanceof NegativeIntegerObject && ! $m instanceof NegativeBigIntegerTag && ! $m instanceof UnsignedBigIntegerTag) { - throw new InvalidArgumentException( - 'The mantissa must be a Positive or Negative Signed Integer or an Unsigned Integer object.' - ); - } - - parent::__construct(self::TAG_DECIMAL_FRACTION, null, $object); - } - - public static function create(CBORObject $object): self - { - return new self($object); - } - - public static function getTagId(): int - { - return self::TAG_DECIMAL_FRACTION; - } - - public static function createFromLoadedData(int $additionalInformation, ?string $data, CBORObject $object): Tag - { - return new self($object); - } - - public static function createFromExponentAndMantissa(CBORObject $e, CBORObject $m): Tag - { - $object = ListObject::create() - ->add($e) - ->add($m) - ; - - return self::create($object); - } - - public function normalize() - { - /** @var ListObject $object */ - $object = $this->object; - /** @var UnsignedIntegerObject|NegativeIntegerObject $e */ - $e = $object->get(0); - /** @var UnsignedIntegerObject|NegativeIntegerObject|NegativeBigIntegerTag|UnsignedBigIntegerTag $m */ - $m = $object->get(1); - - return rtrim(bcmul($m->normalize(), bcpow('10', $e->normalize(), 100), 100), '0'); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - if ($ignoreTags) { - return $this->object->getNormalizedData($ignoreTags); - } - - if (! $this->object instanceof ListObject || count($this->object) !== 2) { - return $this->object->getNormalizedData($ignoreTags); - } - $e = $this->object->get(0); - $m = $this->object->get(1); - - if (! $e instanceof UnsignedIntegerObject && ! $e instanceof NegativeIntegerObject) { - return $this->object->getNormalizedData($ignoreTags); - } - if (! $m instanceof UnsignedIntegerObject && ! $m instanceof NegativeIntegerObject && ! $m instanceof NegativeBigIntegerTag && ! $m instanceof UnsignedBigIntegerTag) { - return $this->object->getNormalizedData($ignoreTags); - } - - return $this->normalize(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/EpochTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/EpochTag.php deleted file mode 100644 index aa00c73f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/EpochTag.php +++ /dev/null @@ -1,21 +0,0 @@ -object; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/MimeTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/MimeTag.php deleted file mode 100644 index bf5d2bb1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/MimeTag.php +++ /dev/null @@ -1,66 +0,0 @@ -object; - - return $object->normalize(); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - return $this->object->getNormalizedData($ignoreTags); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/NegativeBigIntegerTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/NegativeBigIntegerTag.php deleted file mode 100644 index 15726366..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/NegativeBigIntegerTag.php +++ /dev/null @@ -1,83 +0,0 @@ -object; - $integer = BigInteger::fromBase(bin2hex($object->getValue()), 16); - $minusOne = BigInteger::of(-1); - - return $minusOne->minus($integer) - ->toBase(10) - ; - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - if ($ignoreTags) { - return $this->object->getNormalizedData($ignoreTags); - } - - if (! $this->object instanceof ByteStringObject) { - return $this->object->getNormalizedData($ignoreTags); - } - $integer = BigInteger::fromBase(bin2hex($this->object->getValue()), 16); - $minusOne = BigInteger::of(-1); - - return $minusOne->minus($integer) - ->toBase(10) - ; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/PositiveBigIntegerTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/PositiveBigIntegerTag.php deleted file mode 100644 index 0a35896c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/PositiveBigIntegerTag.php +++ /dev/null @@ -1,21 +0,0 @@ -classes[$class::getTagId()] = $class; - - return $this; - } - - public function getClassForValue(int $value): string - { - return array_key_exists($value, $this->classes) ? $this->classes[$value] : GenericTag::class; - } - - public function createObjectForValue(int $additionalInformation, ?string $data, CBORObject $object): Tag - { - $value = $additionalInformation; - if ($additionalInformation >= 24) { - Utils::assertString($data, 'Invalid data'); - $value = Utils::binToInt($data); - } - /** @var Tag $class */ - $class = $this->getClassForValue($value); - - return $class::createFromLoadedData($additionalInformation, $data, $object); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/TagManagerInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/TagManagerInterface.php deleted file mode 100644 index 37e38620..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/TagManagerInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -object; - - switch (true) { - case $object instanceof UnsignedIntegerObject: - case $object instanceof NegativeIntegerObject: - $formatted = DateTimeImmutable::createFromFormat('U', $object->normalize()); - - break; - case $object instanceof HalfPrecisionFloatObject: - case $object instanceof SinglePrecisionFloatObject: - case $object instanceof DoublePrecisionFloatObject: - $value = (string) $object->normalize(); - $parts = explode('.', $value); - if (isset($parts[1])) { - if (mb_strlen($parts[1], '8bit') > 6) { - $parts[1] = mb_substr($parts[1], 0, 6, '8bit'); - } else { - $parts[1] = str_pad($parts[1], 6, '0', STR_PAD_RIGHT); - } - } - $formatted = DateTimeImmutable::createFromFormat('U.u', implode('.', $parts)); - - break; - default: - throw new InvalidArgumentException('Unable to normalize the object'); - } - - if ($formatted === false) { - throw new InvalidArgumentException('Invalid data. Cannot be converted into a datetime object'); - } - - return $formatted; - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - if ($ignoreTags) { - return $this->object->getNormalizedData($ignoreTags); - } - switch (true) { - case $this->object instanceof UnsignedIntegerObject: - case $this->object instanceof NegativeIntegerObject: - case $this->object instanceof HalfPrecisionFloatObject: - case $this->object instanceof SinglePrecisionFloatObject: - case $this->object instanceof DoublePrecisionFloatObject: - return $this->normalize(); - default: - return $this->object->getNormalizedData($ignoreTags); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/UnsignedBigIntegerTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/UnsignedBigIntegerTag.php deleted file mode 100644 index 37e5bd7b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/UnsignedBigIntegerTag.php +++ /dev/null @@ -1,78 +0,0 @@ -object; - - return Utils::hexToString($object->normalize()); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - if ($ignoreTags) { - return $this->object->getNormalizedData($ignoreTags); - } - - if (! $this->object instanceof ByteStringObject) { - return $this->object->getNormalizedData($ignoreTags); - } - - return Utils::hexToString($this->object->getValue()); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/UriTag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/UriTag.php deleted file mode 100644 index c14f1732..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Tag/UriTag.php +++ /dev/null @@ -1,66 +0,0 @@ -object; - - return $object->normalize(); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false) - { - return $this->object->getNormalizedData($ignoreTags); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/TagObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/TagObject.php deleted file mode 100644 index 0ccb5c80..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/TagObject.php +++ /dev/null @@ -1,21 +0,0 @@ -data = $data; - $this->length = $length; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->length !== null) { - $result .= $this->length; - } - - return $result . $this->data; - } - - public static function create(string $data): self - { - return new self($data); - } - - public function getValue(): string - { - return $this->data; - } - - public function getLength(): int - { - return mb_strlen($this->data, 'utf8'); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false): string - { - return $this->data; - } - - public function normalize() - { - return $this->data; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/TextStringWithChunkObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/TextStringWithChunkObject.php deleted file mode 100644 index 0cb6b960..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/TextStringWithChunkObject.php +++ /dev/null @@ -1,21 +0,0 @@ -data = $data; - } - - public function __toString(): string - { - $result = parent::__toString(); - if ($this->data !== null) { - $result .= $this->data; - } - - return $result; - } - - public static function createObjectForValue(int $additionalInformation, ?string $data): self - { - return new self($additionalInformation, $data); - } - - public static function create(int $value): self - { - return self::createFromString((string) $value); - } - - public static function createFromHex(string $value): self - { - $integer = BigInteger::fromBase($value, 16); - - return self::createBigInteger($integer); - } - - public static function createFromString(string $value): self - { - $integer = BigInteger::of($value); - - return self::createBigInteger($integer); - } - - public function getMajorType(): int - { - return self::MAJOR_TYPE; - } - - public function getValue(): string - { - if ($this->data === null) { - return (string) $this->additionalInformation; - } - - $integer = BigInteger::fromBase(bin2hex($this->data), 16); - - return $integer->toBase(10); - } - - public function normalize(): string - { - return $this->getValue(); - } - - /** - * @deprecated The method will be removed on v3.0. Please rely on the CBOR\Normalizable interface - */ - public function getNormalizedData(bool $ignoreTags = false): string - { - return $this->getValue(); - } - - private static function createBigInteger(BigInteger $integer): self - { - if ($integer->isLessThan(BigInteger::zero())) { - throw new InvalidArgumentException('The value must be a positive integer.'); - } - - switch (true) { - case $integer->isLessThan(BigInteger::of(24)): - $ai = $integer->toInt(); - $data = null; - break; - case $integer->isLessThan(BigInteger::fromBase('FF', 16)): - $ai = 24; - $data = self::hex2bin(str_pad($integer->toBase(16), 2, '0', STR_PAD_LEFT)); - break; - case $integer->isLessThan(BigInteger::fromBase('FFFF', 16)): - $ai = 25; - $data = self::hex2bin(str_pad($integer->toBase(16), 4, '0', STR_PAD_LEFT)); - break; - case $integer->isLessThan(BigInteger::fromBase('FFFFFFFF', 16)): - $ai = 26; - $data = self::hex2bin(str_pad($integer->toBase(16), 8, '0', STR_PAD_LEFT)); - break; - default: - throw new InvalidArgumentException( - 'Out of range. Please use PositiveBigIntegerTag tag with ByteStringObject object instead.' - ); - } - - return new self($ai, $data); - } - - private static function hex2bin(string $data): string - { - $result = hex2bin($data); - if ($result === false) { - throw new InvalidArgumentException('Unable to convert the data'); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Utils.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Utils.php deleted file mode 100644 index b671ed6e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/spomky-labs/cbor-php/src/Utils.php +++ /dev/null @@ -1,69 +0,0 @@ -toInt(); - } - - public static function binToBigInteger(string $value): BigInteger - { - return self::hexToBigInteger(bin2hex($value)); - } - - public static function hexToInt(string $value): int - { - return self::hexToBigInteger($value)->toInt(); - } - - public static function hexToBigInteger(string $value): BigInteger - { - return BigInteger::fromBase($value, 16); - } - - public static function hexToString(string $value): string - { - return BigInteger::fromBase(bin2hex($value), 16)->toBase(10); - } - - public static function decode(string $data): string - { - $decoded = base64_decode(strtr($data, '-_', '+/'), true); - if ($decoded === false) { - throw new InvalidArgumentException('Invalid data provided'); - } - - return $decoded; - } - - /** - * @param mixed|null $data - */ - public static function assertString($data, ?string $message = null): void - { - if (! is_string($data)) { - throw new InvalidArgumentException($message ?? ''); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/Ctype.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index ba75a2c9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param mixed $int - * @param string $function - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int, $function) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 3f853aaf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -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/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/README.md deleted file mode 100644 index b144d03c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Ctype -======================== - -This component provides `ctype_*` functions to users who run php versions without the ctype extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/bootstrap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/bootstrap80.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f8611..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/composer.json deleted file mode 100644 index 1b3efff5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-ctype/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-ctype", - "type": "library", - "description": "Symfony polyfill for ctype functions", - "keywords": ["polyfill", "compatibility", "portable", "ctype"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 5593b1d8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Fabien Potencier - -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/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Php80.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 362dd1a9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/PhpToken.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/PhpToken.php deleted file mode 100644 index fe6e6910..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class PhpToken implements \Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/README.md deleted file mode 100644 index 3816c559..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- [`Stringable`](https://php.net/stringable) interface -- [`fdiv`](https://php.net/fdiv) -- [`ValueError`](https://php.net/valueerror) class -- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`PhpToken`](https://php.net/phptoken) class -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 2b955423..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#[Attribute(Attribute::TARGET_CLASS)] -final class Attribute -{ - public const TARGET_CLASS = 1; - public const TARGET_FUNCTION = 2; - public const TARGET_METHOD = 4; - public const TARGET_PROPERTY = 8; - public const TARGET_CLASS_CONSTANT = 16; - public const TARGET_PARAMETER = 32; - public const TARGET_ALL = 63; - public const IS_REPEATABLE = 64; - - /** @var int */ - public $flags; - - public function __construct(int $flags = self::TARGET_ALL) - { - $this->flags = $flags; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php deleted file mode 100644 index bd1212f6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { - class PhpToken extends Symfony\Polyfill\Php80\PhpToken - { - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php deleted file mode 100644 index 7c62d750..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - interface Stringable - { - /** - * @return string - */ - public function __toString(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php deleted file mode 100644 index 01c6c6c8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class UnhandledMatchError extends Error - { - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php deleted file mode 100644 index 783dbc28..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class ValueError extends Error - { - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/bootstrap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/bootstrap.php deleted file mode 100644 index e5f7dbc1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/bootstrap.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/composer.json deleted file mode 100644 index bd9a3262..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/LICENSE deleted file mode 100644 index efb17f98..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2021 Fabien Potencier - -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/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/Php81.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/Php81.php deleted file mode 100644 index f0507b76..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/Php81.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php81; - -/** - * @author Nicolas Grekas - * - * @internal - */ -final class Php81 -{ - public static function array_is_list(array $array): bool - { - if ([] === $array || $array === array_values($array)) { - return true; - } - - $nextKey = -1; - - foreach ($array as $k => $v) { - if ($k !== ++$nextKey) { - return false; - } - } - - return true; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/README.md deleted file mode 100644 index 7d8dd190..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Symfony Polyfill / Php81 -======================== - -This component provides features added to PHP 8.1 core: - -- [`array_is_list`](https://php.net/array_is_list) -- [`enum_exists`](https://php.net/enum-exists) -- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant -- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php deleted file mode 100644 index cb7720a8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80100) { - #[Attribute(Attribute::TARGET_METHOD)] - final class ReturnTypeWillChange - { - public function __construct() - { - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/bootstrap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/bootstrap.php deleted file mode 100644 index 9f872e02..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/bootstrap.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php81 as p; - -if (\PHP_VERSION_ID >= 80100) { - return; -} - -if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { - define('MYSQLI_REFRESH_REPLICA', 64); -} - -if (!function_exists('array_is_list')) { - function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } -} - -if (!function_exists('enum_exists')) { - function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/composer.json deleted file mode 100644 index 149b5982..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/polyfill-php81/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-php81", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/CHANGELOG.md deleted file mode 100644 index 31b9ee6a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/CHANGELOG.md +++ /dev/null @@ -1,116 +0,0 @@ -CHANGELOG -========= - -5.2.0 ------ - - * added `Process::setOptions()` to set `Process` specific options - * added option `create_new_console` to allow a subprocess to continue - to run after the main script exited, both on Linux and on Windows - -5.1.0 ------ - - * added `Process::getStartTime()` to retrieve the start time of the process as float - -5.0.0 ------ - - * removed `Process::inheritEnvironmentVariables()` - * removed `PhpProcess::setPhpBinary()` - * `Process` must be instantiated with a command array, use `Process::fromShellCommandline()` when the command should be parsed by the shell - * removed `Process::setCommandLine()` - -4.4.0 ------ - - * deprecated `Process::inheritEnvironmentVariables()`: env variables are always inherited. - * added `Process::getLastOutputTime()` method - -4.2.0 ------ - - * added the `Process::fromShellCommandline()` to run commands in a shell wrapper - * deprecated passing a command as string when creating a `Process` instance - * deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods - * added the `Process::waitUntil()` method to wait for the process only for a - specific output, then continue the normal execution of your application - -4.1.0 ------ - - * added the `Process::isTtySupported()` method that allows to check for TTY support - * made `PhpExecutableFinder` look for the `PHP_BINARY` env var when searching the php binary - * added the `ProcessSignaledException` class to properly catch signaled process errors - -4.0.0 ------ - - * environment variables will always be inherited - * added a second `array $env = []` argument to the `start()`, `run()`, - `mustRun()`, and `restart()` methods of the `Process` class - * added a second `array $env = []` argument to the `start()` method of the - `PhpProcess` class - * the `ProcessUtils::escapeArgument()` method has been removed - * the `areEnvironmentVariablesInherited()`, `getOptions()`, and `setOptions()` - methods of the `Process` class have been removed - * support for passing `proc_open()` options has been removed - * removed the `ProcessBuilder` class, use the `Process` class instead - * removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class - * passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not - supported anymore - -3.4.0 ------ - - * deprecated the ProcessBuilder class - * deprecated calling `Process::start()` without setting a valid working directory beforehand (via `setWorkingDirectory()` or constructor) - -3.3.0 ------ - - * added command line arrays in the `Process` class - * added `$env` argument to `Process::start()`, `run()`, `mustRun()` and `restart()` methods - * deprecated the `ProcessUtils::escapeArgument()` method - * deprecated not inheriting environment variables - * deprecated configuring `proc_open()` options - * deprecated configuring enhanced Windows compatibility - * deprecated configuring enhanced sigchild compatibility - -2.5.0 ------ - - * added support for PTY mode - * added the convenience method "mustRun" - * deprecation: Process::setStdin() is deprecated in favor of Process::setInput() - * deprecation: Process::getStdin() is deprecated in favor of Process::getInput() - * deprecation: Process::setInput() and ProcessBuilder::setInput() do not accept non-scalar types - -2.4.0 ------ - - * added the ability to define an idle timeout - -2.3.0 ------ - - * added ProcessUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows - * added Process::signal() - * added Process::getPid() - * added support for a TTY mode - -2.2.0 ------ - - * added ProcessBuilder::setArguments() to reset the arguments on a builder - * added a way to retrieve the standard and error output incrementally - * added Process:restart() - -2.1.0 ------ - - * added support for non-blocking processes (start(), wait(), isRunning(), stop()) - * enhanced Windows compatibility - * added Process::getExitCodeText() that returns a string representation for - the exit code returned by the process - * added ProcessBuilder diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ExceptionInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ExceptionInterface.php deleted file mode 100644 index bd4a6040..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * Marker Interface for the Process Component. - * - * @author Johannes M. Schmitt - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/InvalidArgumentException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/InvalidArgumentException.php deleted file mode 100644 index 926ee211..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * InvalidArgumentException for the Process Component. - * - * @author Romain Neutron - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/LogicException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/LogicException.php deleted file mode 100644 index be3d490d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/LogicException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * LogicException for the Process Component. - * - * @author Romain Neutron - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessFailedException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessFailedException.php deleted file mode 100644 index 328acfde..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessFailedException.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception for failed processes. - * - * @author Johannes M. Schmitt - */ -class ProcessFailedException extends RuntimeException -{ - private $process; - - public function __construct(Process $process) - { - if ($process->isSuccessful()) { - throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); - } - - $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", - $process->getCommandLine(), - $process->getExitCode(), - $process->getExitCodeText(), - $process->getWorkingDirectory() - ); - - if (!$process->isOutputDisabled()) { - $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", - $process->getOutput(), - $process->getErrorOutput() - ); - } - - parent::__construct($error); - - $this->process = $process; - } - - public function getProcess() - { - return $this->process; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessSignaledException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessSignaledException.php deleted file mode 100644 index d4d32275..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessSignaledException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process has been signaled. - * - * @author Sullivan Senechal - */ -final class ProcessSignaledException extends RuntimeException -{ - private $process; - - public function __construct(Process $process) - { - $this->process = $process; - - parent::__construct(sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); - } - - public function getProcess(): Process - { - return $this->process; - } - - public function getSignal(): int - { - return $this->getProcess()->getTermSignal(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessTimedOutException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessTimedOutException.php deleted file mode 100644 index 94391a45..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/ProcessTimedOutException.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process times out. - * - * @author Johannes M. Schmitt - */ -class ProcessTimedOutException extends RuntimeException -{ - public const TYPE_GENERAL = 1; - public const TYPE_IDLE = 2; - - private $process; - private $timeoutType; - - public function __construct(Process $process, int $timeoutType) - { - $this->process = $process; - $this->timeoutType = $timeoutType; - - parent::__construct(sprintf( - 'The process "%s" exceeded the timeout of %s seconds.', - $process->getCommandLine(), - $this->getExceededTimeout() - )); - } - - public function getProcess() - { - return $this->process; - } - - public function isGeneralTimeout() - { - return self::TYPE_GENERAL === $this->timeoutType; - } - - public function isIdleTimeout() - { - return self::TYPE_IDLE === $this->timeoutType; - } - - public function getExceededTimeout() - { - switch ($this->timeoutType) { - case self::TYPE_GENERAL: - return $this->process->getTimeout(); - - case self::TYPE_IDLE: - return $this->process->getIdleTimeout(); - - default: - throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/RuntimeException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/RuntimeException.php deleted file mode 100644 index adead253..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * RuntimeException for the Process Component. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/ExecutableFinder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/ExecutableFinder.php deleted file mode 100644 index eb8f0629..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/ExecutableFinder.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -/** - * Generic executable finder. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class ExecutableFinder -{ - private $suffixes = ['.exe', '.bat', '.cmd', '.com']; - - /** - * Replaces default suffixes of executable. - */ - public function setSuffixes(array $suffixes) - { - $this->suffixes = $suffixes; - } - - /** - * Adds new possible suffix to check for executable. - */ - public function addSuffix(string $suffix) - { - $this->suffixes[] = $suffix; - } - - /** - * Finds an executable by name. - * - * @param string $name The executable name (without the extension) - * @param string|null $default The default to return if no executable is found - * @param array $extraDirs Additional dirs to check into - * - * @return string|null - */ - public function find(string $name, string $default = null, array $extraDirs = []) - { - if (\ini_get('open_basedir')) { - $searchPath = array_merge(explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs); - $dirs = []; - foreach ($searchPath as $path) { - // Silencing against https://bugs.php.net/69240 - if (@is_dir($path)) { - $dirs[] = $path; - } else { - if (basename($path) == $name && @is_executable($path)) { - return $path; - } - } - } - } else { - $dirs = array_merge( - explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), - $extraDirs - ); - } - - $suffixes = ['']; - if ('\\' === \DIRECTORY_SEPARATOR) { - $pathExt = getenv('PATHEXT'); - $suffixes = array_merge($pathExt ? explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes); - } - foreach ($suffixes as $suffix) { - foreach ($dirs as $dir) { - if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { - return $file; - } - } - } - - return $default; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/InputStream.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/InputStream.php deleted file mode 100644 index 240665f3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/InputStream.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * Provides a way to continuously write to the input of a Process until the InputStream is closed. - * - * @author Nicolas Grekas - * - * @implements \IteratorAggregate - */ -class InputStream implements \IteratorAggregate -{ - /** @var callable|null */ - private $onEmpty = null; - private $input = []; - private $open = true; - - /** - * Sets a callback that is called when the write buffer becomes empty. - */ - public function onEmpty(callable $onEmpty = null) - { - $this->onEmpty = $onEmpty; - } - - /** - * Appends an input to the write buffer. - * - * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, - * stream resource or \Traversable - */ - public function write($input) - { - if (null === $input) { - return; - } - if ($this->isClosed()) { - throw new RuntimeException(sprintf('"%s" is closed.', static::class)); - } - $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); - } - - /** - * Closes the write buffer. - */ - public function close() - { - $this->open = false; - } - - /** - * Tells whether the write buffer is closed or not. - */ - public function isClosed() - { - return !$this->open; - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - $this->open = true; - - while ($this->open || $this->input) { - if (!$this->input) { - yield ''; - continue; - } - $current = array_shift($this->input); - - if ($current instanceof \Iterator) { - yield from $current; - } else { - yield $current; - } - if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) { - $this->write($onEmpty($this)); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -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/wp-webauthn/wp-webauthn-vendor/symfony/process/PhpExecutableFinder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/PhpExecutableFinder.php deleted file mode 100644 index bed6c3dc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/PhpExecutableFinder.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -/** - * An executable finder specifically designed for the PHP executable. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class PhpExecutableFinder -{ - private $executableFinder; - - public function __construct() - { - $this->executableFinder = new ExecutableFinder(); - } - - /** - * Finds The PHP executable. - * - * @return string|false - */ - public function find(bool $includeArgs = true) - { - if ($php = getenv('PHP_BINARY')) { - if (!is_executable($php)) { - $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v'; - if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) { - if (!is_executable($php)) { - return false; - } - } else { - return false; - } - } - - if (@is_dir($php)) { - return false; - } - - return $php; - } - - $args = $this->findArguments(); - $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; - - // PHP_BINARY return the current sapi executable - if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) { - return \PHP_BINARY.$args; - } - - if ($php = getenv('PHP_PATH')) { - if (!@is_executable($php) || @is_dir($php)) { - return false; - } - - return $php; - } - - if ($php = getenv('PHP_PEAR_PHP_BIN')) { - if (@is_executable($php) && !@is_dir($php)) { - return $php; - } - } - - if (@is_executable($php = \PHP_BINDIR.('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php')) && !@is_dir($php)) { - return $php; - } - - $dirs = [\PHP_BINDIR]; - if ('\\' === \DIRECTORY_SEPARATOR) { - $dirs[] = 'C:\xampp\php\\'; - } - - return $this->executableFinder->find('php', false, $dirs); - } - - /** - * Finds the PHP executable arguments. - * - * @return array - */ - public function findArguments() - { - $arguments = []; - if ('phpdbg' === \PHP_SAPI) { - $arguments[] = '-qrr'; - } - - return $arguments; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/PhpProcess.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/PhpProcess.php deleted file mode 100644 index 2bc338e5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/PhpProcess.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * PhpProcess runs a PHP script in an independent process. - * - * $p = new PhpProcess(''); - * $p->run(); - * print $p->getOutput()."\n"; - * - * @author Fabien Potencier - */ -class PhpProcess extends Process -{ - /** - * @param string $script The PHP script to run (as a string) - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param int $timeout The timeout in seconds - * @param array|null $php Path to the PHP binary to use with any additional arguments - */ - public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null) - { - if (null === $php) { - $executableFinder = new PhpExecutableFinder(); - $php = $executableFinder->find(false); - $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); - } - if ('phpdbg' === \PHP_SAPI) { - $file = tempnam(sys_get_temp_dir(), 'dbg'); - file_put_contents($file, $script); - register_shutdown_function('unlink', $file); - $php[] = $file; - $script = null; - } - - parent::__construct($php, $cwd, $env, $script, $timeout); - } - - /** - * {@inheritdoc} - */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) - { - throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); - } - - /** - * {@inheritdoc} - */ - public function start(callable $callback = null, array $env = []) - { - if (null === $this->getCommandLine()) { - throw new RuntimeException('Unable to find the PHP executable.'); - } - - parent::start($callback, $env); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/AbstractPipes.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/AbstractPipes.php deleted file mode 100644 index 656dc032..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/AbstractPipes.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * @author Romain Neutron - * - * @internal - */ -abstract class AbstractPipes implements PipesInterface -{ - public $pipes = []; - - private $inputBuffer = ''; - private $input; - private $blocked = true; - private $lastError; - - /** - * @param resource|string|int|float|bool|\Iterator|null $input - */ - public function __construct($input) - { - if (\is_resource($input) || $input instanceof \Iterator) { - $this->input = $input; - } elseif (\is_string($input)) { - $this->inputBuffer = $input; - } else { - $this->inputBuffer = (string) $input; - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - foreach ($this->pipes as $pipe) { - if (\is_resource($pipe)) { - fclose($pipe); - } - } - $this->pipes = []; - } - - /** - * Returns true if a system call has been interrupted. - */ - protected function hasSystemCallBeenInterrupted(): bool - { - $lastError = $this->lastError; - $this->lastError = null; - - // stream_select returns false when the `select` system call is interrupted by an incoming signal - return null !== $lastError && false !== stripos($lastError, 'interrupted system call'); - } - - /** - * Unblocks streams. - */ - protected function unblock() - { - if (!$this->blocked) { - return; - } - - foreach ($this->pipes as $pipe) { - stream_set_blocking($pipe, 0); - } - if (\is_resource($this->input)) { - stream_set_blocking($this->input, 0); - } - - $this->blocked = false; - } - - /** - * Writes input to stdin. - * - * @throws InvalidArgumentException When an input iterator yields a non supported value - */ - protected function write(): ?array - { - if (!isset($this->pipes[0])) { - return null; - } - $input = $this->input; - - if ($input instanceof \Iterator) { - if (!$input->valid()) { - $input = null; - } elseif (\is_resource($input = $input->current())) { - stream_set_blocking($input, 0); - } elseif (!isset($this->inputBuffer[0])) { - if (!\is_string($input)) { - if (!\is_scalar($input)) { - throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); - } - $input = (string) $input; - } - $this->inputBuffer = $input; - $this->input->next(); - $input = null; - } else { - $input = null; - } - } - - $r = $e = []; - $w = [$this->pipes[0]]; - - // let's have a look if something changed in streams - if (false === @stream_select($r, $w, $e, 0, 0)) { - return null; - } - - foreach ($w as $stdin) { - if (isset($this->inputBuffer[0])) { - $written = fwrite($stdin, $this->inputBuffer); - $this->inputBuffer = substr($this->inputBuffer, $written); - if (isset($this->inputBuffer[0])) { - return [$this->pipes[0]]; - } - } - - if ($input) { - while (true) { - $data = fread($input, self::CHUNK_SIZE); - if (!isset($data[0])) { - break; - } - $written = fwrite($stdin, $data); - $data = substr($data, $written); - if (isset($data[0])) { - $this->inputBuffer = $data; - - return [$this->pipes[0]]; - } - } - if (feof($input)) { - if ($this->input instanceof \Iterator) { - $this->input->next(); - } else { - $this->input = null; - } - } - } - } - - // no input to read on resource, buffer is empty - if (!isset($this->inputBuffer[0]) && !($this->input instanceof \Iterator ? $this->input->valid() : $this->input)) { - $this->input = null; - fclose($this->pipes[0]); - unset($this->pipes[0]); - } elseif (!$w) { - return [$this->pipes[0]]; - } - - return null; - } - - /** - * @internal - */ - public function handleError(int $type, string $msg) - { - $this->lastError = $msg; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/PipesInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/PipesInterface.php deleted file mode 100644 index 50eb5c47..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/PipesInterface.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -/** - * PipesInterface manages descriptors and pipes for the use of proc_open. - * - * @author Romain Neutron - * - * @internal - */ -interface PipesInterface -{ - public const CHUNK_SIZE = 16384; - - /** - * Returns an array of descriptors for the use of proc_open. - */ - public function getDescriptors(): array; - - /** - * Returns an array of filenames indexed by their related stream in case these pipes use temporary files. - * - * @return string[] - */ - public function getFiles(): array; - - /** - * Reads data in file handles and pipes. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close pipes if they've reached EOF - * - * @return string[] An array of read data indexed by their fd - */ - public function readAndWrite(bool $blocking, bool $close = false): array; - - /** - * Returns if the current state has open file handles or pipes. - */ - public function areOpen(): bool; - - /** - * Returns if pipes are able to read output. - */ - public function haveReadSupport(): bool; - - /** - * Closes file handles and pipes. - */ - public function close(); -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/UnixPipes.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/UnixPipes.php deleted file mode 100644 index 5a0e9d47..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/UnixPipes.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Process; - -/** - * UnixPipes implementation uses unix pipes as handles. - * - * @author Romain Neutron - * - * @internal - */ -class UnixPipes extends AbstractPipes -{ - private $ttyMode; - private $ptyMode; - private $haveReadSupport; - - public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveReadSupport) - { - $this->ttyMode = $ttyMode; - $this->ptyMode = $ptyMode; - $this->haveReadSupport = $haveReadSupport; - - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - /** - * {@inheritdoc} - */ - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('/dev/null', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - if ($this->ttyMode) { - return [ - ['file', '/dev/tty', 'r'], - ['file', '/dev/tty', 'w'], - ['file', '/dev/tty', 'w'], - ]; - } - - if ($this->ptyMode && Process::isPtySupported()) { - return [ - ['pty'], - ['pty'], - ['pty'], - ]; - } - - return [ - ['pipe', 'r'], - ['pipe', 'w'], // stdout - ['pipe', 'w'], // stderr - ]; - } - - /** - * {@inheritdoc} - */ - public function getFiles(): array - { - return []; - } - - /** - * {@inheritdoc} - */ - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - - $read = $e = []; - $r = $this->pipes; - unset($r[0]); - - // let's have a look if something changed in streams - set_error_handler([$this, 'handleError']); - if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { - restore_error_handler(); - // if a system call has been interrupted, forget about it, let's try again - // otherwise, an error occurred, let's reset pipes - if (!$this->hasSystemCallBeenInterrupted()) { - $this->pipes = []; - } - - return $read; - } - restore_error_handler(); - - foreach ($r as $pipe) { - // prior PHP 5.4 the array passed to stream_select is modified and - // lose key association, we have to find back the key - $read[$type = array_search($pipe, $this->pipes, true)] = ''; - - do { - $data = @fread($pipe, self::CHUNK_SIZE); - $read[$type] .= $data; - } while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1]))); - - if (!isset($read[$type][0])) { - unset($read[$type]); - } - - if ($close && feof($pipe)) { - fclose($pipe); - unset($this->pipes[$type]); - } - } - - return $read; - } - - /** - * {@inheritdoc} - */ - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - /** - * {@inheritdoc} - */ - public function areOpen(): bool - { - return (bool) $this->pipes; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/WindowsPipes.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/WindowsPipes.php deleted file mode 100644 index bca84f57..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Pipes/WindowsPipes.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Process; - -/** - * WindowsPipes implementation uses temporary files as handles. - * - * @see https://bugs.php.net/51800 - * @see https://bugs.php.net/65650 - * - * @author Romain Neutron - * - * @internal - */ -class WindowsPipes extends AbstractPipes -{ - private $files = []; - private $fileHandles = []; - private $lockHandles = []; - private $readBytes = [ - Process::STDOUT => 0, - Process::STDERR => 0, - ]; - private $haveReadSupport; - - public function __construct($input, bool $haveReadSupport) - { - $this->haveReadSupport = $haveReadSupport; - - if ($this->haveReadSupport) { - // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. - // Workaround for this problem is to use temporary files instead of pipes on Windows platform. - // - // @see https://bugs.php.net/51800 - $pipes = [ - Process::STDOUT => Process::OUT, - Process::STDERR => Process::ERR, - ]; - $tmpDir = sys_get_temp_dir(); - $lastError = 'unknown reason'; - set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); - for ($i = 0;; ++$i) { - foreach ($pipes as $pipe => $name) { - $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); - - if (!$h = fopen($file.'.lock', 'w')) { - if (file_exists($file.'.lock')) { - continue 2; - } - restore_error_handler(); - throw new RuntimeException('A temporary file could not be opened to write the process output: '.$lastError); - } - if (!flock($h, \LOCK_EX | \LOCK_NB)) { - continue 2; - } - if (isset($this->lockHandles[$pipe])) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - } - $this->lockHandles[$pipe] = $h; - - if (!($h = fopen($file, 'w')) || !fclose($h) || !$h = fopen($file, 'r')) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - unset($this->lockHandles[$pipe]); - continue 2; - } - $this->fileHandles[$pipe] = $h; - $this->files[$pipe] = $file; - } - break; - } - restore_error_handler(); - } - - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - /** - * {@inheritdoc} - */ - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('NUL', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - // We're not using pipe on Windows platform as it hangs (https://bugs.php.net/51800) - // We're not using file handles as it can produce corrupted output https://bugs.php.net/65650 - // So we redirect output within the commandline and pass the nul device to the process - return [ - ['pipe', 'r'], - ['file', 'NUL', 'w'], - ['file', 'NUL', 'w'], - ]; - } - - /** - * {@inheritdoc} - */ - public function getFiles(): array - { - return $this->files; - } - - /** - * {@inheritdoc} - */ - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - $read = $r = $e = []; - - if ($blocking) { - if ($w) { - @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); - } elseif ($this->fileHandles) { - usleep(Process::TIMEOUT_PRECISION * 1E6); - } - } - foreach ($this->fileHandles as $type => $fileHandle) { - $data = stream_get_contents($fileHandle, -1, $this->readBytes[$type]); - - if (isset($data[0])) { - $this->readBytes[$type] += \strlen($data); - $read[$type] = $data; - } - if ($close) { - ftruncate($fileHandle, 0); - fclose($fileHandle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - unset($this->fileHandles[$type], $this->lockHandles[$type]); - } - } - - return $read; - } - - /** - * {@inheritdoc} - */ - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - /** - * {@inheritdoc} - */ - public function areOpen(): bool - { - return $this->pipes && $this->fileHandles; - } - - /** - * {@inheritdoc} - */ - public function close() - { - parent::close(); - foreach ($this->fileHandles as $type => $handle) { - ftruncate($handle, 0); - fclose($handle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - } - $this->fileHandles = $this->lockHandles = []; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Process.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Process.php deleted file mode 100644 index 30ebeb6b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/Process.php +++ /dev/null @@ -1,1652 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Exception\ProcessSignaledException; -use Symfony\Component\Process\Exception\ProcessTimedOutException; -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Pipes\PipesInterface; -use Symfony\Component\Process\Pipes\UnixPipes; -use Symfony\Component\Process\Pipes\WindowsPipes; - -/** - * Process is a thin wrapper around proc_* functions to easily - * start independent PHP processes. - * - * @author Fabien Potencier - * @author Romain Neutron - * - * @implements \IteratorAggregate - */ -class Process implements \IteratorAggregate -{ - public const ERR = 'err'; - public const OUT = 'out'; - - public const STATUS_READY = 'ready'; - public const STATUS_STARTED = 'started'; - public const STATUS_TERMINATED = 'terminated'; - - public const STDIN = 0; - public const STDOUT = 1; - public const STDERR = 2; - - // Timeout Precision in seconds. - public const TIMEOUT_PRECISION = 0.2; - - public const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking - public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory - public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating - public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating - - private $callback; - private $hasCallback = false; - private $commandline; - private $cwd; - private $env = []; - private $input; - private $starttime; - private $lastOutputTime; - private $timeout; - private $idleTimeout; - private $exitcode; - private $fallbackStatus = []; - private $processInformation; - private $outputDisabled = false; - private $stdout; - private $stderr; - private $process; - private $status = self::STATUS_READY; - private $incrementalOutputOffset = 0; - private $incrementalErrorOutputOffset = 0; - private $tty = false; - private $pty; - private $options = ['suppress_errors' => true, 'bypass_shell' => true]; - - private $useFileHandles = false; - /** @var PipesInterface */ - private $processPipes; - - private $latestSignal; - - private static $sigchild; - - /** - * Exit codes translation table. - * - * User-defined errors must use exit codes in the 64-113 range. - */ - public static $exitCodes = [ - 0 => 'OK', - 1 => 'General error', - 2 => 'Misuse of shell builtins', - - 126 => 'Invoked command cannot execute', - 127 => 'Command not found', - 128 => 'Invalid exit argument', - - // signals - 129 => 'Hangup', - 130 => 'Interrupt', - 131 => 'Quit and dump core', - 132 => 'Illegal instruction', - 133 => 'Trace/breakpoint trap', - 134 => 'Process aborted', - 135 => 'Bus error: "access to undefined portion of memory object"', - 136 => 'Floating point exception: "erroneous arithmetic operation"', - 137 => 'Kill (terminate immediately)', - 138 => 'User-defined 1', - 139 => 'Segmentation violation', - 140 => 'User-defined 2', - 141 => 'Write to pipe with no one reading', - 142 => 'Signal raised by alarm', - 143 => 'Termination (request to terminate)', - // 144 - not defined - 145 => 'Child process terminated, stopped (or continued*)', - 146 => 'Continue if stopped', - 147 => 'Stop executing temporarily', - 148 => 'Terminal stop signal', - 149 => 'Background process attempting to read from tty ("in")', - 150 => 'Background process attempting to write to tty ("out")', - 151 => 'Urgent data available on socket', - 152 => 'CPU time limit exceeded', - 153 => 'File size limit exceeded', - 154 => 'Signal raised by timer counting virtual time: "virtual timer expired"', - 155 => 'Profiling timer expired', - // 156 - not defined - 157 => 'Pollable event', - // 158 - not defined - 159 => 'Bad syscall', - ]; - - /** - * @param array $command The command to run and its arguments listed as separate entries - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @throws LogicException When proc_open is not installed - */ - public function __construct(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) - { - if (!\function_exists('proc_open')) { - throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); - } - - $this->commandline = $command; - $this->cwd = $cwd; - - // on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started - // on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected - // @see : https://bugs.php.net/51800 - // @see : https://bugs.php.net/50524 - if (null === $this->cwd && (\defined('ZEND_THREAD_SAFE') || '\\' === \DIRECTORY_SEPARATOR)) { - $this->cwd = getcwd(); - } - if (null !== $env) { - $this->setEnv($env); - } - - $this->setInput($input); - $this->setTimeout($timeout); - $this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR; - $this->pty = false; - } - - /** - * Creates a Process instance as a command-line to be run in a shell wrapper. - * - * Command-lines are parsed by the shell of your OS (/bin/sh on Unix-like, cmd.exe on Windows.) - * This allows using e.g. pipes or conditional execution. In this mode, signals are sent to the - * shell wrapper and not to your commands. - * - * In order to inject dynamic values into command-lines, we strongly recommend using placeholders. - * This will save escaping values, which is not portable nor secure anyway: - * - * $process = Process::fromShellCommandline('my_command "${:MY_VAR}"'); - * $process->run(null, ['MY_VAR' => $theValue]); - * - * @param string $command The command line to pass to the shell of the OS - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @return static - * - * @throws LogicException When proc_open is not installed - */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) - { - $process = new static([], $cwd, $env, $input, $timeout); - $process->commandline = $command; - - return $process; - } - - /** - * @return array - */ - public function __sleep() - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - if ($this->options['create_new_console'] ?? false) { - $this->processPipes->close(); - } else { - $this->stop(0); - } - } - - public function __clone() - { - $this->resetProcessData(); - } - - /** - * Runs the process. - * - * The callback receives the type of output (out or err) and - * some bytes from the output in real-time. It allows to have feedback - * from the independent process during execution. - * - * The STDOUT and STDERR are also available after the process is finished - * via the getOutput() and getErrorOutput() methods. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return int The exit status code - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException In case a callback is provided and output has been disabled - * - * @final - */ - public function run(callable $callback = null, array $env = []): int - { - $this->start($callback, $env); - - return $this->wait(); - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @return $this - * - * @throws ProcessFailedException if the process didn't terminate successfully - * - * @final - */ - public function mustRun(callable $callback = null, array $env = []): self - { - if (0 !== $this->run($callback, $env)) { - throw new ProcessFailedException($this); - } - - return $this; - } - - /** - * Starts the process and returns after writing the input to STDIN. - * - * This method blocks until all STDIN data is sent to the process then it - * returns while the process runs in the background. - * - * The termination of the process can be awaited with wait(). - * - * The callback receives the type of output (out or err) and some bytes from - * the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws LogicException In case a callback is provided and output has been disabled - */ - public function start(callable $callback = null, array $env = []) - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $this->resetProcessData(); - $this->starttime = $this->lastOutputTime = microtime(true); - $this->callback = $this->buildCallback($callback); - $this->hasCallback = null !== $callback; - $descriptors = $this->getDescriptors(); - - if ($this->env) { - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->env, $env, 'strcasecmp') : $this->env; - } - - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->getDefaultEnv(), $env, 'strcasecmp') : $this->getDefaultEnv(); - - if (\is_array($commandline = $this->commandline)) { - $commandline = implode(' ', array_map([$this, 'escapeArgument'], $commandline)); - - if ('\\' !== \DIRECTORY_SEPARATOR) { - // exec is mandatory to deal with sending a signal to the process - $commandline = 'exec '.$commandline; - } - } else { - $commandline = $this->replacePlaceholders($commandline, $env); - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $commandline = $this->prepareWindowsCommandLine($commandline, $env); - } elseif (!$this->useFileHandles && $this->isSigchildEnabled()) { - // last exit code is output on the fourth pipe and caught to work around --enable-sigchild - $descriptors[3] = ['pipe', 'w']; - - // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input - $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; - $commandline .= 'pid=$!; echo $pid >&3; wait $pid 2>/dev/null; code=$?; echo $code >&3; exit $code'; - - // Workaround for the bug, when PTS functionality is enabled. - // @see : https://bugs.php.net/69442 - $ptsWorkaround = fopen(__FILE__, 'r'); - } - - $envPairs = []; - foreach ($env as $k => $v) { - if (false !== $v && false === \in_array($k, ['argc', 'argv', 'ARGC', 'ARGV'], true)) { - $envPairs[] = $k.'='.$v; - } - } - - if (!is_dir($this->cwd)) { - throw new RuntimeException(sprintf('The provided cwd "%s" does not exist.', $this->cwd)); - } - - $this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); - - if (!\is_resource($this->process)) { - throw new RuntimeException('Unable to launch a new process.'); - } - $this->status = self::STATUS_STARTED; - - if (isset($descriptors[3])) { - $this->fallbackStatus['pid'] = (int) fgets($this->processPipes->pipes[3]); - } - - if ($this->tty) { - return; - } - - $this->updateStatus(false); - $this->checkTimeout(); - } - - /** - * Restarts the process. - * - * Be warned that the process is cloned before being started. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return static - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * - * @see start() - * - * @final - */ - public function restart(callable $callback = null, array $env = []): self - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $process = clone $this; - $process->start($callback, $env); - - return $process; - } - - /** - * Waits for the process to terminate. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A valid PHP callback - * - * @return int The exitcode of the process - * - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException When process is not yet started - */ - public function wait(callable $callback = null) - { - $this->requireProcessIsStarted(__FUNCTION__); - - $this->updateStatus(false); - - if (null !== $callback) { - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait".'); - } - $this->callback = $this->buildCallback($callback); - } - - do { - $this->checkTimeout(); - $running = $this->isRunning() && ('\\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); - $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - } while ($running); - - while ($this->isRunning()) { - $this->checkTimeout(); - usleep(1000); - } - - if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) { - throw new ProcessSignaledException($this); - } - - return $this->exitcode; - } - - /** - * Waits until the callback returns true. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @throws RuntimeException When process timed out - * @throws LogicException When process is not yet started - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function waitUntil(callable $callback): bool - { - $this->requireProcessIsStarted(__FUNCTION__); - $this->updateStatus(false); - - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".'); - } - $callback = $this->buildCallback($callback); - - $ready = false; - while (true) { - $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); - $output = $this->processPipes->readAndWrite($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - foreach ($output as $type => $data) { - if (3 !== $type) { - $ready = $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data) || $ready; - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - if ($ready) { - return true; - } - if (!$running) { - return false; - } - - usleep(1000); - } - } - - /** - * Returns the Pid (process identifier), if applicable. - * - * @return int|null The process id if running, null otherwise - */ - public function getPid() - { - return $this->isRunning() ? $this->processInformation['pid'] : null; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * - * @return $this - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - public function signal(int $signal) - { - $this->doSignal($signal, true); - - return $this; - } - - /** - * Disables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - * @throws LogicException if an idle timeout is set - */ - public function disableOutput() - { - if ($this->isRunning()) { - throw new RuntimeException('Disabling output while the process is running is not possible.'); - } - if (null !== $this->idleTimeout) { - throw new LogicException('Output cannot be disabled while an idle timeout is set.'); - } - - $this->outputDisabled = true; - - return $this; - } - - /** - * Enables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - */ - public function enableOutput() - { - if ($this->isRunning()) { - throw new RuntimeException('Enabling output while the process is running is not possible.'); - } - - $this->outputDisabled = false; - - return $this; - } - - /** - * Returns true in case the output is disabled, false otherwise. - * - * @return bool - */ - public function isOutputDisabled() - { - return $this->outputDisabled; - } - - /** - * Returns the current output of the process (STDOUT). - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stdout, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the output incrementally. - * - * In comparison with the getOutput method which always return the whole - * output, this one returns the new output since the last call. - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - $this->incrementalOutputOffset = ftell($this->stdout); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). - * - * @param int $flags A bit field of Process::ITER_* flags - * - * @return \Generator - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - #[\ReturnTypeWillChange] - public function getIterator(int $flags = 0) - { - $this->readPipesForOutput(__FUNCTION__, false); - - $clearOutput = !(self::ITER_KEEP_OUTPUT & $flags); - $blocking = !(self::ITER_NON_BLOCKING & $flags); - $yieldOut = !(self::ITER_SKIP_OUT & $flags); - $yieldErr = !(self::ITER_SKIP_ERR & $flags); - - while (null !== $this->callback || ($yieldOut && !feof($this->stdout)) || ($yieldErr && !feof($this->stderr))) { - if ($yieldOut) { - $out = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - - if (isset($out[0])) { - if ($clearOutput) { - $this->clearOutput(); - } else { - $this->incrementalOutputOffset = ftell($this->stdout); - } - - yield self::OUT => $out; - } - } - - if ($yieldErr) { - $err = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - - if (isset($err[0])) { - if ($clearOutput) { - $this->clearErrorOutput(); - } else { - $this->incrementalErrorOutputOffset = ftell($this->stderr); - } - - yield self::ERR => $err; - } - } - - if (!$blocking && !isset($out[0]) && !isset($err[0])) { - yield self::OUT => ''; - } - - $this->checkTimeout(); - $this->readPipesForOutput(__FUNCTION__, $blocking); - } - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearOutput() - { - ftruncate($this->stdout, 0); - fseek($this->stdout, 0); - $this->incrementalOutputOffset = 0; - - return $this; - } - - /** - * Returns the current error output of the process (STDERR). - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getErrorOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stderr, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the errorOutput incrementally. - * - * In comparison with the getErrorOutput method which always return the - * whole error output, this one returns the new error output since the last - * call. - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalErrorOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - $this->incrementalErrorOutputOffset = ftell($this->stderr); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearErrorOutput() - { - ftruncate($this->stderr, 0); - fseek($this->stderr, 0); - $this->incrementalErrorOutputOffset = 0; - - return $this; - } - - /** - * Returns the exit code returned by the process. - * - * @return int|null The exit status code, null if the Process is not terminated - */ - public function getExitCode() - { - $this->updateStatus(false); - - return $this->exitcode; - } - - /** - * Returns a string representation for the exit code returned by the process. - * - * This method relies on the Unix exit code status standardization - * and might not be relevant for other operating systems. - * - * @return string|null A string representation for the exit status code, null if the Process is not terminated - * - * @see http://tldp.org/LDP/abs/html/exitcodes.html - * @see http://en.wikipedia.org/wiki/Unix_signal - */ - public function getExitCodeText() - { - if (null === $exitcode = $this->getExitCode()) { - return null; - } - - return self::$exitCodes[$exitcode] ?? 'Unknown error'; - } - - /** - * Checks if the process ended successfully. - * - * @return bool - */ - public function isSuccessful() - { - return 0 === $this->getExitCode(); - } - - /** - * Returns true if the child process has been terminated by an uncaught signal. - * - * It always returns false on Windows. - * - * @return bool - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenSignaled() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['signaled']; - } - - /** - * Returns the number of the signal that caused the child process to terminate its execution. - * - * It is only meaningful if hasBeenSignaled() returns true. - * - * @return int - * - * @throws RuntimeException In case --enable-sigchild is activated - * @throws LogicException In case the process is not terminated - */ - public function getTermSignal() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - if ($this->isSigchildEnabled() && -1 === $this->processInformation['termsig']) { - throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal cannot be retrieved.'); - } - - return $this->processInformation['termsig']; - } - - /** - * Returns true if the child process has been stopped by a signal. - * - * It always returns false on Windows. - * - * @return bool - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenStopped() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopped']; - } - - /** - * Returns the number of the signal that caused the child process to stop its execution. - * - * It is only meaningful if hasBeenStopped() returns true. - * - * @return int - * - * @throws LogicException In case the process is not terminated - */ - public function getStopSignal() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopsig']; - } - - /** - * Checks if the process is currently running. - * - * @return bool - */ - public function isRunning() - { - if (self::STATUS_STARTED !== $this->status) { - return false; - } - - $this->updateStatus(false); - - return $this->processInformation['running']; - } - - /** - * Checks if the process has been started with no regard to the current state. - * - * @return bool - */ - public function isStarted() - { - return self::STATUS_READY != $this->status; - } - - /** - * Checks if the process is terminated. - * - * @return bool - */ - public function isTerminated() - { - $this->updateStatus(false); - - return self::STATUS_TERMINATED == $this->status; - } - - /** - * Gets the process status. - * - * The status is one of: ready, started, terminated. - * - * @return string - */ - public function getStatus() - { - $this->updateStatus(false); - - return $this->status; - } - - /** - * Stops the process. - * - * @param int|float $timeout The timeout in seconds - * @param int|null $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) - * - * @return int|null The exit-code of the process or null if it's not running - */ - public function stop(float $timeout = 10, int $signal = null) - { - $timeoutMicro = microtime(true) + $timeout; - if ($this->isRunning()) { - // given SIGTERM may not be defined and that "proc_terminate" uses the constant value and not the constant itself, we use the same here - $this->doSignal(15, false); - do { - usleep(1000); - } while ($this->isRunning() && microtime(true) < $timeoutMicro); - - if ($this->isRunning()) { - // Avoid exception here: process is supposed to be running, but it might have stopped just - // after this line. In any case, let's silently discard the error, we cannot do anything. - $this->doSignal($signal ?: 9, false); - } - } - - if ($this->isRunning()) { - if (isset($this->fallbackStatus['pid'])) { - unset($this->fallbackStatus['pid']); - - return $this->stop(0, $signal); - } - $this->close(); - } - - return $this->exitcode; - } - - /** - * Adds a line to the STDOUT stream. - * - * @internal - */ - public function addOutput(string $line) - { - $this->lastOutputTime = microtime(true); - - fseek($this->stdout, 0, \SEEK_END); - fwrite($this->stdout, $line); - fseek($this->stdout, $this->incrementalOutputOffset); - } - - /** - * Adds a line to the STDERR stream. - * - * @internal - */ - public function addErrorOutput(string $line) - { - $this->lastOutputTime = microtime(true); - - fseek($this->stderr, 0, \SEEK_END); - fwrite($this->stderr, $line); - fseek($this->stderr, $this->incrementalErrorOutputOffset); - } - - /** - * Gets the last output time in seconds. - */ - public function getLastOutputTime(): ?float - { - return $this->lastOutputTime; - } - - /** - * Gets the command line to be executed. - * - * @return string - */ - public function getCommandLine() - { - return \is_array($this->commandline) ? implode(' ', array_map([$this, 'escapeArgument'], $this->commandline)) : $this->commandline; - } - - /** - * Gets the process timeout in seconds (max. runtime). - * - * @return float|null - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Gets the process idle timeout in seconds (max. time since last output). - * - * @return float|null - */ - public function getIdleTimeout() - { - return $this->idleTimeout; - } - - /** - * Sets the process timeout (max. runtime) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws InvalidArgumentException if the timeout is negative - */ - public function setTimeout(?float $timeout) - { - $this->timeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Sets the process idle timeout (max. time since last output) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws LogicException if the output is disabled - * @throws InvalidArgumentException if the timeout is negative - */ - public function setIdleTimeout(?float $timeout) - { - if (null !== $timeout && $this->outputDisabled) { - throw new LogicException('Idle timeout cannot be set while the output is disabled.'); - } - - $this->idleTimeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Enables or disables the TTY mode. - * - * @return $this - * - * @throws RuntimeException In case the TTY mode is not supported - */ - public function setTty(bool $tty) - { - if ('\\' === \DIRECTORY_SEPARATOR && $tty) { - throw new RuntimeException('TTY mode is not supported on Windows platform.'); - } - - if ($tty && !self::isTtySupported()) { - throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.'); - } - - $this->tty = $tty; - - return $this; - } - - /** - * Checks if the TTY mode is enabled. - * - * @return bool - */ - public function isTty() - { - return $this->tty; - } - - /** - * Sets PTY mode. - * - * @return $this - */ - public function setPty(bool $bool) - { - $this->pty = $bool; - - return $this; - } - - /** - * Returns PTY state. - * - * @return bool - */ - public function isPty() - { - return $this->pty; - } - - /** - * Gets the working directory. - * - * @return string|null - */ - public function getWorkingDirectory() - { - if (null === $this->cwd) { - // getcwd() will return false if any one of the parent directories does not have - // the readable or search mode set, even if the current directory does - return getcwd() ?: null; - } - - return $this->cwd; - } - - /** - * Sets the current working directory. - * - * @return $this - */ - public function setWorkingDirectory(string $cwd) - { - $this->cwd = $cwd; - - return $this; - } - - /** - * Gets the environment variables. - * - * @return array - */ - public function getEnv() - { - return $this->env; - } - - /** - * Sets the environment variables. - * - * @param array $env The new environment variables - * - * @return $this - */ - public function setEnv(array $env) - { - $this->env = $env; - - return $this; - } - - /** - * Gets the Process input. - * - * @return resource|string|\Iterator|null - */ - public function getInput() - { - return $this->input; - } - - /** - * Sets the input. - * - * This content will be passed to the underlying process standard input. - * - * @param string|int|float|bool|resource|\Traversable|null $input The content - * - * @return $this - * - * @throws LogicException In case the process is running - */ - public function setInput($input) - { - if ($this->isRunning()) { - throw new LogicException('Input cannot be set while the process is running.'); - } - - $this->input = ProcessUtils::validateInput(__METHOD__, $input); - - return $this; - } - - /** - * Performs a check between the timeout definition and the time the process started. - * - * In case you run a background process (with the start method), you should - * trigger this method regularly to ensure the process timeout - * - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function checkTimeout() - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL); - } - - if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE); - } - } - - /** - * @throws LogicException in case process is not started - */ - public function getStartTime(): float - { - if (!$this->isStarted()) { - throw new LogicException('Start time is only available after process start.'); - } - - return $this->starttime; - } - - /** - * Defines options to pass to the underlying proc_open(). - * - * @see https://php.net/proc_open for the options supported by PHP. - * - * Enabling the "create_new_console" option allows a subprocess to continue - * to run after the main process exited, on both Windows and *nix - */ - public function setOptions(array $options) - { - if ($this->isRunning()) { - throw new RuntimeException('Setting options while the process is running is not possible.'); - } - - $defaultOptions = $this->options; - $existingOptions = ['blocking_pipes', 'create_process_group', 'create_new_console']; - - foreach ($options as $key => $value) { - if (!\in_array($key, $existingOptions)) { - $this->options = $defaultOptions; - throw new LogicException(sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); - } - $this->options[$key] = $value; - } - } - - /** - * Returns whether TTY is supported on the current operating system. - */ - public static function isTtySupported(): bool - { - static $isTtySupported; - - if (null === $isTtySupported) { - $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes); - } - - return $isTtySupported; - } - - /** - * Returns whether PTY is supported on the current operating system. - * - * @return bool - */ - public static function isPtySupported() - { - static $result; - - if (null !== $result) { - return $result; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - return $result = false; - } - - return $result = (bool) @proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes); - } - - /** - * Creates the descriptors needed by the proc_open. - */ - private function getDescriptors(): array - { - if ($this->input instanceof \Iterator) { - $this->input->rewind(); - } - if ('\\' === \DIRECTORY_SEPARATOR) { - $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $this->hasCallback); - } else { - $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $this->hasCallback); - } - - return $this->processPipes->getDescriptors(); - } - - /** - * Builds up the callback used by wait(). - * - * The callbacks adds all occurred output to the specific buffer and calls - * the user callback (if present) with the received output. - * - * @param callable|null $callback The user defined PHP callback - * - * @return \Closure - */ - protected function buildCallback(callable $callback = null) - { - if ($this->outputDisabled) { - return function ($type, $data) use ($callback): bool { - return null !== $callback && $callback($type, $data); - }; - } - - $out = self::OUT; - - return function ($type, $data) use ($callback, $out): bool { - if ($out == $type) { - $this->addOutput($data); - } else { - $this->addErrorOutput($data); - } - - return null !== $callback && $callback($type, $data); - }; - } - - /** - * Updates the status of the process, reads pipes. - * - * @param bool $blocking Whether to use a blocking read call - */ - protected function updateStatus(bool $blocking) - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - $this->processInformation = proc_get_status($this->process); - $running = $this->processInformation['running']; - - $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - if ($this->fallbackStatus && $this->isSigchildEnabled()) { - $this->processInformation = $this->fallbackStatus + $this->processInformation; - } - - if (!$running) { - $this->close(); - } - } - - /** - * Returns whether PHP has been compiled with the '--enable-sigchild' option or not. - * - * @return bool - */ - protected function isSigchildEnabled() - { - if (null !== self::$sigchild) { - return self::$sigchild; - } - - if (!\function_exists('phpinfo')) { - return self::$sigchild = false; - } - - ob_start(); - phpinfo(\INFO_GENERAL); - - return self::$sigchild = str_contains(ob_get_clean(), '--enable-sigchild'); - } - - /** - * Reads pipes for the freshest output. - * - * @param string $caller The name of the method that needs fresh outputs - * @param bool $blocking Whether to use blocking calls or not - * - * @throws LogicException in case output has been disabled or process is not started - */ - private function readPipesForOutput(string $caller, bool $blocking = false) - { - if ($this->outputDisabled) { - throw new LogicException('Output has been disabled.'); - } - - $this->requireProcessIsStarted($caller); - - $this->updateStatus($blocking); - } - - /** - * Validates and returns the filtered timeout. - * - * @throws InvalidArgumentException if the given timeout is a negative number - */ - private function validateTimeout(?float $timeout): ?float - { - $timeout = (float) $timeout; - - if (0.0 === $timeout) { - $timeout = null; - } elseif ($timeout < 0) { - throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); - } - - return $timeout; - } - - /** - * Reads pipes, executes callback. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close file handles or not - */ - private function readPipes(bool $blocking, bool $close) - { - $result = $this->processPipes->readAndWrite($blocking, $close); - - $callback = $this->callback; - foreach ($result as $type => $data) { - if (3 !== $type) { - $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data); - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - } - - /** - * Closes process resource, closes file handles, sets the exitcode. - * - * @return int The exitcode - */ - private function close(): int - { - $this->processPipes->close(); - if (\is_resource($this->process)) { - proc_close($this->process); - } - $this->exitcode = $this->processInformation['exitcode']; - $this->status = self::STATUS_TERMINATED; - - if (-1 === $this->exitcode) { - if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) { - // if process has been signaled, no exitcode but a valid termsig, apply Unix convention - $this->exitcode = 128 + $this->processInformation['termsig']; - } elseif ($this->isSigchildEnabled()) { - $this->processInformation['signaled'] = true; - $this->processInformation['termsig'] = -1; - } - } - - // Free memory from self-reference callback created by buildCallback - // Doing so in other contexts like __destruct or by garbage collector is ineffective - // Now pipes are closed, so the callback is no longer necessary - $this->callback = null; - - return $this->exitcode; - } - - /** - * Resets data related to the latest run of the process. - */ - private function resetProcessData() - { - $this->starttime = null; - $this->callback = null; - $this->exitcode = null; - $this->fallbackStatus = []; - $this->processInformation = null; - $this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->process = null; - $this->latestSignal = null; - $this->status = self::STATUS_READY; - $this->incrementalOutputOffset = 0; - $this->incrementalErrorOutputOffset = 0; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * @param bool $throwException Whether to throw exception in case signal failed - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - private function doSignal(int $signal, bool $throwException): bool - { - if (null === $pid = $this->getPid()) { - if ($throwException) { - throw new LogicException('Cannot send signal on a non running process.'); - } - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - exec(sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); - if ($exitCode && $this->isRunning()) { - if ($throwException) { - throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); - } - - return false; - } - } else { - if (!$this->isSigchildEnabled()) { - $ok = @proc_terminate($this->process, $signal); - } elseif (\function_exists('posix_kill')) { - $ok = @posix_kill($pid, $signal); - } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { - $ok = false === fgets($pipes[2]); - } - if (!$ok) { - if ($throwException) { - throw new RuntimeException(sprintf('Error while sending signal "%s".', $signal)); - } - - return false; - } - } - - $this->latestSignal = $signal; - $this->fallbackStatus['signaled'] = true; - $this->fallbackStatus['exitcode'] = -1; - $this->fallbackStatus['termsig'] = $this->latestSignal; - - return true; - } - - private function prepareWindowsCommandLine(string $cmd, array &$env): string - { - $uid = uniqid('', true); - $varCount = 0; - $varCache = []; - $cmd = preg_replace_callback( - '/"(?:( - [^"%!^]*+ - (?: - (?: !LF! | "(?:\^[%!^])?+" ) - [^"%!^]*+ - )++ - ) | [^"]*+ )"/x', - function ($m) use (&$env, &$varCache, &$varCount, $uid) { - if (!isset($m[1])) { - return $m[0]; - } - if (isset($varCache[$m[0]])) { - return $varCache[$m[0]]; - } - if (str_contains($value = $m[1], "\0")) { - $value = str_replace("\0", '?', $value); - } - if (false === strpbrk($value, "\"%!\n")) { - return '"'.$value.'"'; - } - - $value = str_replace(['!LF!', '"^!"', '"^%"', '"^^"', '""'], ["\n", '!', '%', '^', '"'], $value); - $value = '"'.preg_replace('/(\\\\*)"/', '$1$1\\"', $value).'"'; - $var = $uid.++$varCount; - - $env[$var] = $value; - - return $varCache[$m[0]] = '!'.$var.'!'; - }, - $cmd - ); - - $cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; - foreach ($this->processPipes->getFiles() as $offset => $filename) { - $cmd .= ' '.$offset.'>"'.$filename.'"'; - } - - return $cmd; - } - - /** - * Ensures the process is running or terminated, throws a LogicException if the process has a not started. - * - * @throws LogicException if the process has not run - */ - private function requireProcessIsStarted(string $functionName) - { - if (!$this->isStarted()) { - throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName)); - } - } - - /** - * Ensures the process is terminated, throws a LogicException if the process has a status different than "terminated". - * - * @throws LogicException if the process is not yet terminated - */ - private function requireProcessIsTerminated(string $functionName) - { - if (!$this->isTerminated()) { - throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName)); - } - } - - /** - * Escapes a string to be used as a shell argument. - */ - private function escapeArgument(?string $argument): string - { - if ('' === $argument || null === $argument) { - return '""'; - } - if ('\\' !== \DIRECTORY_SEPARATOR) { - return "'".str_replace("'", "'\\''", $argument)."'"; - } - if (str_contains($argument, "\0")) { - $argument = str_replace("\0", '?', $argument); - } - if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { - return $argument; - } - $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); - - return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"'; - } - - private function replacePlaceholders(string $commandline, array $env) - { - return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) { - if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) { - throw new InvalidArgumentException(sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); - } - - return $this->escapeArgument($env[$matches[1]]); - }, $commandline); - } - - private function getDefaultEnv(): array - { - $env = getenv(); - $env = ('\\' === \DIRECTORY_SEPARATOR ? array_intersect_ukey($env, $_SERVER, 'strcasecmp') : array_intersect_key($env, $_SERVER)) ?: $env; - - return $_ENV + ('\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($env, $_ENV, 'strcasecmp') : $env); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/ProcessUtils.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/ProcessUtils.php deleted file mode 100644 index 2a7aff71..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/ProcessUtils.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * ProcessUtils is a bunch of utility methods. - * - * This class contains static methods only and is not meant to be instantiated. - * - * @author Martin Hasoň - */ -class ProcessUtils -{ - /** - * This class should not be instantiated. - */ - private function __construct() - { - } - - /** - * Validates and normalizes a Process input. - * - * @param string $caller The name of method call that validates the input - * @param mixed $input The input to validate - * - * @return mixed - * - * @throws InvalidArgumentException In case the input is not valid - */ - public static function validateInput(string $caller, $input) - { - if (null !== $input) { - if (\is_resource($input)) { - return $input; - } - if (\is_string($input)) { - return $input; - } - if (\is_scalar($input)) { - return (string) $input; - } - if ($input instanceof Process) { - return $input->getIterator($input::ITER_SKIP_ERR); - } - if ($input instanceof \Iterator) { - return $input; - } - if ($input instanceof \Traversable) { - return new \IteratorIterator($input); - } - - throw new InvalidArgumentException(sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); - } - - return $input; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/README.md deleted file mode 100644 index 8777de4a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Process Component -================= - -The Process component executes commands in sub-processes. - -Sponsor -------- - -The Process component for Symfony 5.4/6.0 is [backed][1] by [SensioLabs][2]. - -As the creator of Symfony, SensioLabs supports companies using Symfony, with an -offering encompassing consultancy, expertise, services, training, and technical -assistance to ensure the success of web application development projects. - -Help Symfony by [sponsoring][3] its development! - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/process.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) - -[1]: https://symfony.com/backers -[2]: https://sensiolabs.com -[3]: https://symfony.com/sponsor diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/composer.json deleted file mode 100644 index 1669eba5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/symfony/process/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "symfony/process", - "type": "library", - "description": "Executes commands in sub-processes", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Process\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/LICENSE deleted file mode 100644 index 4188a9bb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 TheCodingMachine - -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. \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/README.md deleted file mode 100644 index 3c2ee624..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/README.md +++ /dev/null @@ -1,178 +0,0 @@ -[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/safe/v/stable.svg)](https://packagist.org/packages/thecodingmachine/safe) -[![Total Downloads](https://poser.pugx.org/thecodingmachine/safe/downloads.svg)](https://packagist.org/packages/thecodingmachine/safe) -[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/safe/v/unstable.svg)](https://packagist.org/packages/thecodingmachine/safe) -[![License](https://poser.pugx.org/thecodingmachine/safe/license.svg)](https://packagist.org/packages/thecodingmachine/safe) -[![Build Status](https://travis-ci.org/thecodingmachine/safe.svg?branch=master)](https://travis-ci.org/thecodingmachine/safe) -[![Continuous Integration](https://github.com/thecodingmachine/safe/workflows/Continuous%20Integration/badge.svg)](https://github.com/thecodingmachine/safe/actions) -[![codecov](https://codecov.io/gh/thecodingmachine/safe/branch/master/graph/badge.svg)](https://codecov.io/gh/thecodingmachine/safe) - -Safe PHP -======== - -**Work in progress** - -A set of core PHP functions rewritten to throw exceptions instead of returning `false` when an error is encountered. - -## The problem - -Most PHP core functions were written before exception handling was added to the language. Therefore, most PHP functions -do not throw exceptions. Instead, they return `false` in case of error. - -But most of us are too lazy to check explicitly for every single return of every core PHP function. - -```php -// This code is incorrect. Twice. -// "file_get_contents" can return false if the file does not exists -// "json_decode" can return false if the file content is not valid JSON -$content = file_get_contents('foobar.json'); -$foobar = json_decode($content); -``` - -The correct version of this code would be: - -```php -$content = file_get_contents('foobar.json'); -if ($content === false) { - throw new FileLoadingException('Could not load file foobar.json'); -} -$foobar = json_decode($content); -if (json_last_error() !== JSON_ERROR_NONE) { - throw new FileLoadingException('foobar.json does not contain valid JSON: '.json_last_error_msg()); -} -``` - -Obviously, while this snippet is correct, it is less easy to read. - -## The solution - -Enter *thecodingmachine/safe* aka Safe-PHP. - -Safe-PHP redeclares all core PHP functions. The new PHP functions act exactly as the old ones, except they -throw exceptions properly when an error is encountered. The "safe" functions have the same name as the core PHP -functions, except they are in the `Safe` namespace. - -```php -use function Safe\file_get_contents; -use function Safe\json_decode; - -// This code is both safe and simple! -$content = file_get_contents('foobar.json'); -$foobar = json_decode($content); -``` - -All PHP functions that can return `false` on error are part of Safe. -In addition, Safe also provide 2 'Safe' classes: `Safe\DateTime` and `Safe\DateTimeImmutable` whose methods will throw exceptions instead of returning false. - -## PHPStan integration - -> Yeah... but I must explicitly think about importing the "safe" variant of the function, for each and every file of my application. -> I'm sure I will forget some "use function" statements! - -Fear not! thecodingmachine/safe comes with a PHPStan rule. - -Never heard of [PHPStan](https://github.com/phpstan/phpstan) before? -Check it out, it's an amazing code analyzer for PHP. - -Simply install the Safe rule in your PHPStan setup (explained in the "Installation" section) and PHPStan will let you know each time you are using an "unsafe" function. - -The code below will trigger this warning: - -```php -$content = file_get_contents('foobar.json'); -``` - -> Function file_get_contents is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\file_get_contents;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library. - -## Installation - -Use composer to install Safe-PHP: - -```bash -$ composer require thecodingmachine/safe -``` - -*Highly recommended*: install PHPStan and PHPStan extension: - -```bash -$ composer require --dev thecodingmachine/phpstan-safe-rule -``` - -Now, edit your `phpstan.neon` file and add these rules: - -```yml -includes: - - vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon -``` - -## Automated refactoring - -You have a large legacy codebase and want to use "Safe-PHP" functions throughout your project? PHPStan will help you -find these functions but changing the namespace of the functions one function at a time might be a tedious task. - -Fortunately, Safe comes bundled with a "Rector" configuration file. [Rector](https://github.com/rectorphp/rector) is a command-line -tool that performs instant refactoring of your application. - -Run - -```bash -$ composer require --dev rector/rector:^0.7 -``` - -to install `rector/rector`. - -Run - -```bash -vendor/bin/rector process src/ --config vendor/thecodingmachine/safe/rector-migrate-0.7.php -``` - -to run `rector/rector`. - -*Note:* do not forget to replace "src/" with the path to your source directory. - -**Important:** the refactoring only performs a "dumb" replacement of functions. It will not modify the way -"false" return values are handled. So if your code was already performing error handling, you will have to deal -with it manually. - -Especially, you should look for error handling that was already performed, like: - -```php -if (!mkdir($dirPath)) { - // Do something on error -} -``` - -This code will be refactored by Rector to: - -```php -if (!\Safe\mkdir($dirPath)) { - // Do something on error -} -``` - -You should then (manually) refactor it to: - -```php -try { - \Safe\mkdir($dirPath)); -} catch (\Safe\FilesystemException $e) { - // Do something on error -} -``` - -## Performance impact - -Safe is loading 1000+ functions from ~85 files on each request. Yet, the performance impact of this loading is quite low. - -In case you worry, using Safe will "cost" you ~700µs on each request. The [performance section](performance/README.md) -contains more information regarding the way we tested the performance impact of Safe. - -## Learn more - -Read [the release article on TheCodingMachine's blog](https://thecodingmachine.io/introducing-safe-php) if you want to -learn more about what triggered the development of Safe-PHP. - -## Contributing - -The files that contain all the functions are auto-generated from the PHP doc. -Read the [CONTRIBUTING.md](CONTRIBUTING.md) file to learn how to regenerate these files and to contribute to this library. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/composer.json deleted file mode 100644 index 2cd03fcc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/composer.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "name": "thecodingmachine/safe", - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "license": "MIT", - "autoload": { - "psr-4": { - "Safe\\": [ - "lib/", - "deprecated/", - "generated/" - ] - }, - "files": [ - "deprecated/apc.php", - "deprecated/libevent.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "lib/special_cases.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/ingres-ii.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/msql.php", - "generated/mysql.php", - "generated/mysqli.php", - "generated/mysqlndMs.php", - "generated/mysqlndQc.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/password.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pdf.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/simplexml.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ] - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpstan/phpstan": "^0.12", - "thecodingmachine/phpstan-strict-rules": "^0.12", - "squizlabs/php_codesniffer": "^3.2" - }, - "scripts": { - "phpstan": "phpstan analyse lib -c phpstan.neon --level=max --no-progress -vvv", - "cs-fix": "phpcbf", - "cs-check": "phpcs" - }, - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - } -} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/deprecated/Exceptions/ApcException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/deprecated/Exceptions/ApcException.php deleted file mode 100644 index f344490d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/deprecated/Exceptions/ApcException.php +++ /dev/null @@ -1,11 +0,0 @@ - - * - * - * - * The mode parameter consists of three octal - * number components specifying access restrictions for the owner, - * the user group in which the owner is in, and to everybody else in - * this order. One component can be computed by adding up the needed - * permissions for that target user base. Number 1 means that you - * grant execute rights, number 2 means that you make the file - * writeable, number 4 means that you make the file readable. Add - * up these numbers to specify needed rights. You can also read more - * about modes on Unix systems with 'man 1 chmod' - * and 'man 2 chmod'. - * - * - * - * - */ -function chmod(string $filename, int $mode): void -{ - error_clear_last(); - $result = \chmod($filename, $mode); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Attempts to change the owner of the file filename - * to user user. Only the superuser may change the - * owner of a file. - * - * @param string $filename Path to the file. - * @param string|int $user A user name or number. - * @throws FilesystemException - * - */ -function chown(string $filename, $user): void -{ - error_clear_last(); - $result = \chown($filename, $user); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Makes a copy of the file source to - * dest. - * - * If you wish to move a file, use the rename function. - * - * @param string $source Path to the source file. - * @param string $dest The destination path. If dest is a URL, the - * copy operation may fail if the wrapper does not support overwriting of - * existing files. - * - * If the destination file already exists, it will be overwritten. - * @param resource $context A valid context resource created with - * stream_context_create. - * @throws FilesystemException - * - */ -function copy(string $source, string $dest, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $result = \copy($source, $dest, $context); - } else { - $result = \copy($source, $dest); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Given a string containing a directory, this function will return the - * number of bytes available on the corresponding filesystem or disk - * partition. - * - * @param string $directory A directory of the filesystem or disk partition. - * - * Given a file name instead of a directory, the behaviour of the - * function is unspecified and may differ between operating systems and - * PHP versions. - * @return float Returns the number of available bytes as a float. - * @throws FilesystemException - * - */ -function disk_free_space(string $directory): float -{ - error_clear_last(); - $result = \disk_free_space($directory); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Given a string containing a directory, this function will return the total - * number of bytes on the corresponding filesystem or disk partition. - * - * @param string $directory A directory of the filesystem or disk partition. - * @return float Returns the total number of bytes as a float. - * @throws FilesystemException - * - */ -function disk_total_space(string $directory): float -{ - error_clear_last(); - $result = \disk_total_space($directory); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * The file pointed to by handle is closed. - * - * @param resource $handle The file pointer must be valid, and must point to a file successfully - * opened by fopen or fsockopen. - * @throws FilesystemException - * - */ -function fclose($handle): void -{ - error_clear_last(); - $result = \fclose($handle); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * This function forces a write of all buffered output to the resource - * pointed to by the file handle. - * - * @param resource $handle The file pointer must be valid, and must point to - * a file successfully opened by fopen or - * fsockopen (and not yet closed by - * fclose). - * @throws FilesystemException - * - */ -function fflush($handle): void -{ - error_clear_last(); - $result = \fflush($handle); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * This function is similar to file, except that - * file_get_contents returns the file in a - * string, starting at the specified offset - * up to maxlen bytes. On failure, - * file_get_contents will return FALSE. - * - * file_get_contents is the preferred way to read the - * contents of a file into a string. It will use memory mapping techniques if - * supported by your OS to enhance performance. - * - * @param string $filename Name of the file to read. - * @param bool $use_include_path The FILE_USE_INCLUDE_PATH constant can be used - * to trigger include path - * search. - * This is not possible if strict typing - * is enabled, since FILE_USE_INCLUDE_PATH is an - * int. Use TRUE instead. - * @param resource|null $context A valid context resource created with - * stream_context_create. If you don't need to use a - * custom context, you can skip this parameter by NULL. - * @param int $offset The offset where the reading starts on the original stream. - * Negative offsets count from the end of the stream. - * - * Seeking (offset) is not supported with remote files. - * Attempting to seek on non-local files may work with small offsets, but this - * is unpredictable because it works on the buffered stream. - * @param int $maxlen Maximum length of data read. The default is to read until end - * of file is reached. Note that this parameter is applied to the - * stream processed by the filters. - * @return string The function returns the read data. - * @throws FilesystemException - * - */ -function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, int $maxlen = null): string -{ - error_clear_last(); - if ($maxlen !== null) { - $result = \file_get_contents($filename, $use_include_path, $context, $offset, $maxlen); - } elseif ($offset !== 0) { - $result = \file_get_contents($filename, $use_include_path, $context, $offset); - } elseif ($context !== null) { - $result = \file_get_contents($filename, $use_include_path, $context); - } else { - $result = \file_get_contents($filename, $use_include_path); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * This function is identical to calling fopen, - * fwrite and fclose successively - * to write data to a file. - * - * If filename does not exist, the file is created. - * Otherwise, the existing file is overwritten, unless the - * FILE_APPEND flag is set. - * - * @param string $filename Path to the file where to write the data. - * @param mixed $data The data to write. Can be either a string, an - * array or a stream resource. - * - * If data is a stream resource, the - * remaining buffer of that stream will be copied to the specified file. - * This is similar with using stream_copy_to_stream. - * - * You can also specify the data parameter as a single - * dimension array. This is equivalent to - * file_put_contents($filename, implode('', $array)). - * @param int $flags The value of flags can be any combination of - * the following flags, joined with the binary OR (|) - * operator. - * - * - * Available flags - * - * - * - * Flag - * Description - * - * - * - * - * - * FILE_USE_INCLUDE_PATH - * - * - * Search for filename in the include directory. - * See include_path for more - * information. - * - * - * - * - * FILE_APPEND - * - * - * If file filename already exists, append - * the data to the file instead of overwriting it. - * - * - * - * - * LOCK_EX - * - * - * Acquire an exclusive lock on the file while proceeding to the - * writing. In other words, a flock call happens - * between the fopen call and the - * fwrite call. This is not identical to an - * fopen call with mode "x". - * - * - * - * - * - * @param resource $context A valid context resource created with - * stream_context_create. - * @return int This function returns the number of bytes that were written to the file. - * @throws FilesystemException - * - */ -function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int -{ - error_clear_last(); - if ($context !== null) { - $result = \file_put_contents($filename, $data, $flags, $context); - } else { - $result = \file_put_contents($filename, $data, $flags); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Reads an entire file into an array. - * - * @param string $filename Path to the file. - * @param int $flags The optional parameter flags can be one, or - * more, of the following constants: - * - * - * - * FILE_USE_INCLUDE_PATH - * - * - * - * Search for the file in the include_path. - * - * - * - * - * - * FILE_IGNORE_NEW_LINES - * - * - * - * Omit newline at the end of each array element - * - * - * - * - * - * FILE_SKIP_EMPTY_LINES - * - * - * - * Skip empty lines - * - * - * - * - * @param resource $context - * @return array Returns the file in an array. Each element of the array corresponds to a - * line in the file, with the newline still attached. Upon failure, - * file returns FALSE. - * @throws FilesystemException - * - */ -function file(string $filename, int $flags = 0, $context = null): array -{ - error_clear_last(); - if ($context !== null) { - $result = \file($filename, $flags, $context); - } else { - $result = \file($filename, $flags); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * - * - * @param string $filename Path to the file. - * @return int Returns the time the file was last accessed. - * The time is returned as a Unix timestamp. - * @throws FilesystemException - * - */ -function fileatime(string $filename): int -{ - error_clear_last(); - $result = \fileatime($filename); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Gets the inode change time of a file. - * - * @param string $filename Path to the file. - * @return int Returns the time the file was last changed. - * The time is returned as a Unix timestamp. - * @throws FilesystemException - * - */ -function filectime(string $filename): int -{ - error_clear_last(); - $result = \filectime($filename); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Gets the file inode. - * - * @param string $filename Path to the file. - * @return int Returns the inode number of the file. - * @throws FilesystemException - * - */ -function fileinode(string $filename): int -{ - error_clear_last(); - $result = \fileinode($filename); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * This function returns the time when the data blocks of a file were being - * written to, that is, the time when the content of the file was changed. - * - * @param string $filename Path to the file. - * @return int Returns the time the file was last modified. - * The time is returned as a Unix timestamp, which is - * suitable for the date function. - * @throws FilesystemException - * - */ -function filemtime(string $filename): int -{ - error_clear_last(); - $result = \filemtime($filename); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Gets the file owner. - * - * @param string $filename Path to the file. - * @return int Returns the user ID of the owner of the file. - * The user ID is returned in numerical format, use - * posix_getpwuid to resolve it to a username. - * @throws FilesystemException - * - */ -function fileowner(string $filename): int -{ - error_clear_last(); - $result = \fileowner($filename); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Gets the size for the given file. - * - * @param string $filename Path to the file. - * @return int Returns the size of the file in bytes, or FALSE (and generates an error - * of level E_WARNING) in case of an error. - * @throws FilesystemException - * - */ -function filesize(string $filename): int -{ - error_clear_last(); - $result = \filesize($filename); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * flock allows you to perform a simple reader/writer - * model which can be used on virtually every platform (including most Unix - * derivatives and even Windows). - * - * On versions of PHP before 5.3.2, the lock is released also by - * fclose (which is also called automatically when script - * finished). - * - * PHP supports a portable way of locking complete files in an advisory way - * (which means all accessing programs have to use the same way of locking - * or it will not work). By default, this function will block until the - * requested lock is acquired; this may be controlled with the LOCK_NB option documented below. - * - * @param resource $handle A file system pointer resource - * that is typically created using fopen. - * @param int $operation operation is one of the following: - * - * - * - * LOCK_SH to acquire a shared lock (reader). - * - * - * - * - * LOCK_EX to acquire an exclusive lock (writer). - * - * - * - * - * LOCK_UN to release a lock (shared or exclusive). - * - * - * - * - * It is also possible to add LOCK_NB as a bitmask to one - * of the above operations, if flock should not - * block during the locking attempt. - * @param int|null $wouldblock The optional third argument is set to 1 if the lock would block - * (EWOULDBLOCK errno condition). - * @throws FilesystemException - * - */ -function flock($handle, int $operation, ?int &$wouldblock = null): void -{ - error_clear_last(); - $result = \flock($handle, $operation, $wouldblock); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * fopen binds a named resource, specified by - * filename, to a stream. - * - * @param string $filename If filename is of the form "scheme://...", it - * is assumed to be a URL and PHP will search for a protocol handler - * (also known as a wrapper) for that scheme. If no wrappers for that - * protocol are registered, PHP will emit a notice to help you track - * potential problems in your script and then continue as though - * filename specifies a regular file. - * - * If PHP has decided that filename specifies - * a local file, then it will try to open a stream on that file. - * The file must be accessible to PHP, so you need to ensure that - * the file access permissions allow this access. - * If you have enabled - * open_basedir further - * restrictions may apply. - * - * If PHP has decided that filename specifies - * a registered protocol, and that protocol is registered as a - * network URL, PHP will check to make sure that - * allow_url_fopen is - * enabled. If it is switched off, PHP will emit a warning and - * the fopen call will fail. - * - * The list of supported protocols can be found in . Some protocols (also referred to as - * wrappers) support context - * and/or php.ini options. Refer to the specific page for the - * protocol in use for a list of options which can be set. (e.g. - * php.ini value user_agent used by the - * http wrapper). - * - * On the Windows platform, be careful to escape any backslashes - * used in the path to the file, or use forward slashes. - * - * - * - * ]]> - * - * - * @param string $mode The mode parameter specifies the type of access - * you require to the stream. It may be any of the following: - * - * - * A list of possible modes for fopen - * using mode - * - * - * - * - * mode - * Description - * - * - * - * - * 'r' - * - * Open for reading only; place the file pointer at the - * beginning of the file. - * - * - * - * 'r+' - * - * Open for reading and writing; place the file pointer at - * the beginning of the file. - * - * - * - * 'w' - * - * Open for writing only; place the file pointer at the - * beginning of the file and truncate the file to zero length. - * If the file does not exist, attempt to create it. - * - * - * - * 'w+' - * - * Open for reading and writing; place the file pointer at - * the beginning of the file and truncate the file to zero - * length. If the file does not exist, attempt to create it. - * - * - * - * 'a' - * - * Open for writing only; place the file pointer at the end of - * the file. If the file does not exist, attempt to create it. - * In this mode, fseek has no effect, writes are always appended. - * - * - * - * 'a+' - * - * Open for reading and writing; place the file pointer at - * the end of the file. If the file does not exist, attempt to - * create it. In this mode, fseek only affects - * the reading position, writes are always appended. - * - * - * - * 'x' - * - * Create and open for writing only; place the file pointer at the - * beginning of the file. If the file already exists, the - * fopen call will fail by returning FALSE and - * generating an error of level E_WARNING. If - * the file does not exist, attempt to create it. This is equivalent - * to specifying O_EXCL|O_CREAT flags for the - * underlying open(2) system call. - * - * - * - * 'x+' - * - * Create and open for reading and writing; otherwise it has the - * same behavior as 'x'. - * - * - * - * 'c' - * - * Open the file for writing only. If the file does not exist, it is - * created. If it exists, it is neither truncated (as opposed to - * 'w'), nor the call to this function fails (as is - * the case with 'x'). The file pointer is - * positioned on the beginning of the file. This may be useful if it's - * desired to get an advisory lock (see flock) - * before attempting to modify the file, as using - * 'w' could truncate the file before the lock - * was obtained (if truncation is desired, - * ftruncate can be used after the lock is - * requested). - * - * - * - * 'c+' - * - * Open the file for reading and writing; otherwise it has the same - * behavior as 'c'. - * - * - * - * 'e' - * - * Set close-on-exec flag on the opened file descriptor. Only - * available in PHP compiled on POSIX.1-2008 conform systems. - * - * - * - * - * - * - * Different operating system families have different line-ending - * conventions. When you write a text file and want to insert a line - * break, you need to use the correct line-ending character(s) for your - * operating system. Unix based systems use \n as the - * line ending character, Windows based systems use \r\n - * as the line ending characters and Macintosh based systems (Mac OS Classic) used - * \r as the line ending character. - * - * If you use the wrong line ending characters when writing your files, you - * might find that other applications that open those files will "look - * funny". - * - * Windows offers a text-mode translation flag ('t') - * which will transparently translate \n to - * \r\n when working with the file. In contrast, you - * can also use 'b' to force binary mode, which will not - * translate your data. To use these flags, specify either - * 'b' or 't' as the last character - * of the mode parameter. - * - * The default translation mode is 'b'. - * You can use the 't' - * mode if you are working with plain-text files and you use - * \n to delimit your line endings in your script, but - * expect your files to be readable with applications such as old versions of notepad. You - * should use the 'b' in all other cases. - * - * If you specify the 't' flag when working with binary files, you - * may experience strange problems with your data, including broken image - * files and strange problems with \r\n characters. - * - * For portability, it is also strongly recommended that - * you re-write code that uses or relies upon the 't' - * mode so that it uses the correct line endings and - * 'b' mode instead. - * @param bool $use_include_path The optional third use_include_path parameter - * can be set to '1' or TRUE if you want to search for the file in the - * include_path, too. - * @param resource $context - * @return resource Returns a file pointer resource on success - * @throws FilesystemException - * - */ -function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) -{ - error_clear_last(); - if ($context !== null) { - $result = \fopen($filename, $mode, $use_include_path, $context); - } else { - $result = \fopen($filename, $mode, $use_include_path); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * fputcsv formats a line (passed as a - * fields array) as CSV and writes it (terminated by a - * newline) to the specified file handle. - * - * @param resource $handle The file pointer must be valid, and must point to - * a file successfully opened by fopen or - * fsockopen (and not yet closed by - * fclose). - * @param array $fields An array of strings. - * @param string $delimiter The optional delimiter parameter sets the field - * delimiter (one character only). - * @param string $enclosure The optional enclosure parameter sets the field - * enclosure (one character only). - * @param string $escape_char The optional escape_char parameter sets the - * escape character (at most one character). - * An empty string ("") disables the proprietary escape mechanism. - * @return int Returns the length of the written string. - * @throws FilesystemException - * - */ -function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = '"', string $escape_char = "\\"): int -{ - error_clear_last(); - $result = \fputcsv($handle, $fields, $delimiter, $enclosure, $escape_char); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * fread reads up to - * length bytes from the file pointer - * referenced by handle. Reading stops as soon as one - * of the following conditions is met: - * - * - * - * length bytes have been read - * - * - * - * - * EOF (end of file) is reached - * - * - * - * - * a packet becomes available or the - * socket timeout occurs (for network streams) - * - * - * - * - * if the stream is read buffered and it does not represent a plain file, at - * most one read of up to a number of bytes equal to the chunk size (usually - * 8192) is made; depending on the previously buffered data, the size of the - * returned data may be larger than the chunk size. - * - * - * - * - * @param resource $handle A file system pointer resource - * that is typically created using fopen. - * @param int $length Up to length number of bytes read. - * @return string Returns the read string. - * @throws FilesystemException - * - */ -function fread($handle, int $length): string -{ - error_clear_last(); - $result = \fread($handle, $length); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Takes the filepointer, handle, and truncates the file to - * length, size. - * - * @param resource $handle The file pointer. - * - * The handle must be open for writing. - * @param int $size The size to truncate to. - * - * If size is larger than the file then the file - * is extended with null bytes. - * - * If size is smaller than the file then the file - * is truncated to that size. - * @throws FilesystemException - * - */ -function ftruncate($handle, int $size): void -{ - error_clear_last(); - $result = \ftruncate($handle, $size); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * - * - * @param resource $handle A file system pointer resource - * that is typically created using fopen. - * @param string $string The string that is to be written. - * @param int $length If the length argument is given, writing will - * stop after length bytes have been written or - * the end of string is reached, whichever comes - * first. - * - * Note that if the length argument is given, - * then the magic_quotes_runtime - * configuration option will be ignored and no slashes will be - * stripped from string. - * @return int - * @throws FilesystemException - * - */ -function fwrite($handle, string $string, int $length = null): int -{ - error_clear_last(); - if ($length !== null) { - $result = \fwrite($handle, $string, $length); - } else { - $result = \fwrite($handle, $string); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * The glob function searches for all the pathnames - * matching pattern according to the rules used by - * the libc glob() function, which is similar to the rules used by common - * shells. - * - * @param string $pattern The pattern. No tilde expansion or parameter substitution is done. - * - * Special characters: - * - * - * - * * - Matches zero or more characters. - * - * - * - * - * ? - Matches exactly one character (any character). - * - * - * - * - * [...] - Matches one character from a group of - * characters. If the first character is !, - * matches any character not in the group. - * - * - * - * - * \ - Escapes the following character, - * except when the GLOB_NOESCAPE flag is used. - * - * - * - * @param int $flags Valid flags: - * - * - * - * GLOB_MARK - Adds a slash (a backslash on Windows) to each directory returned - * - * - * - * - * GLOB_NOSORT - Return files as they appear in the - * directory (no sorting). When this flag is not used, the pathnames are - * sorted alphabetically - * - * - * - * - * GLOB_NOCHECK - Return the search pattern if no - * files matching it were found - * - * - * - * - * GLOB_NOESCAPE - Backslashes do not quote - * metacharacters - * - * - * - * - * GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', - * or 'c' - * - * - * - * - * GLOB_ONLYDIR - Return only directory entries - * which match the pattern - * - * - * - * - * GLOB_ERR - Stop on read errors (like unreadable - * directories), by default errors are ignored. - * - * - * - * @return array Returns an array containing the matched files/directories, an empty array - * if no file matched. - * @throws FilesystemException - * - */ -function glob(string $pattern, int $flags = 0): array -{ - error_clear_last(); - $result = \glob($pattern, $flags); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Attempts to change the group of the symlink filename - * to group. - * - * Only the superuser may change the group of a symlink arbitrarily; other - * users may change the group of a symlink to any group of which that user is - * a member. - * - * @param string $filename Path to the symlink. - * @param string|int $group The group specified by name or number. - * @throws FilesystemException - * - */ -function lchgrp(string $filename, $group): void -{ - error_clear_last(); - $result = \lchgrp($filename, $group); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Attempts to change the owner of the symlink filename - * to user user. - * - * Only the superuser may change the owner of a symlink. - * - * @param string $filename Path to the file. - * @param string|int $user User name or number. - * @throws FilesystemException - * - */ -function lchown(string $filename, $user): void -{ - error_clear_last(); - $result = \lchown($filename, $user); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * link creates a hard link. - * - * @param string $target Target of the link. - * @param string $link The link name. - * @throws FilesystemException - * - */ -function link(string $target, string $link): void -{ - error_clear_last(); - $result = \link($target, $link); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Attempts to create the directory specified by pathname. - * - * @param string $pathname The directory path. - * @param int $mode The mode is 0777 by default, which means the widest possible - * access. For more information on modes, read the details - * on the chmod page. - * - * mode is ignored on Windows. - * - * Note that you probably want to specify the mode as an octal number, - * which means it should have a leading zero. The mode is also modified - * by the current umask, which you can change using - * umask. - * @param bool $recursive Allows the creation of nested directories specified in the - * pathname. - * @param resource $context - * @throws FilesystemException - * - */ -function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $result = \mkdir($pathname, $mode, $recursive, $context); - } else { - $result = \mkdir($pathname, $mode, $recursive); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * parse_ini_file loads in the - * ini file specified in filename, - * and returns the settings in it in an associative array. - * - * The structure of the ini file is the same as the php.ini's. - * - * @param string $filename The filename of the ini file being parsed. If a relative path is used, - * it is evaluated relative to the current working directory, then the - * include_path. - * @param bool $process_sections By setting the process_sections - * parameter to TRUE, you get a multidimensional array, with - * the section names and settings included. The default - * for process_sections is FALSE - * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or - * INI_SCANNER_RAW. If INI_SCANNER_RAW - * is supplied, then option values will not be parsed. - * - * - * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. - * In this mode boolean, null and integer types are preserved when possible. - * String values "true", "on" and "yes" - * are converted to TRUE. "false", "off", "no" - * and "none" are considered FALSE. "null" is converted to NULL - * in typed mode. Also, all numeric strings are converted to integer type if it is possible. - * @return array The settings are returned as an associative array on success. - * @throws FilesystemException - * - */ -function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array -{ - error_clear_last(); - $result = \parse_ini_file($filename, $process_sections, $scanner_mode); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * parse_ini_string returns the settings in string - * ini in an associative array. - * - * The structure of the ini string is the same as the php.ini's. - * - * @param string $ini The contents of the ini file being parsed. - * @param bool $process_sections By setting the process_sections - * parameter to TRUE, you get a multidimensional array, with - * the section names and settings included. The default - * for process_sections is FALSE - * @param int $scanner_mode Can either be INI_SCANNER_NORMAL (default) or - * INI_SCANNER_RAW. If INI_SCANNER_RAW - * is supplied, then option values will not be parsed. - * - * - * As of PHP 5.6.1 can also be specified as INI_SCANNER_TYPED. - * In this mode boolean, null and integer types are preserved when possible. - * String values "true", "on" and "yes" - * are converted to TRUE. "false", "off", "no" - * and "none" are considered FALSE. "null" is converted to NULL - * in typed mode. Also, all numeric strings are converted to integer type if it is possible. - * @return array The settings are returned as an associative array on success. - * @throws FilesystemException - * - */ -function parse_ini_string(string $ini, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array -{ - error_clear_last(); - $result = \parse_ini_string($ini, $process_sections, $scanner_mode); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Reads a file and writes it to the output buffer. - * - * @param string $filename The filename being read. - * @param bool $use_include_path You can use the optional second parameter and set it to TRUE, if - * you want to search for the file in the include_path, too. - * @param resource $context A context stream resource. - * @return int Returns the number of bytes read from the file on success - * @throws FilesystemException - * - */ -function readfile(string $filename, bool $use_include_path = false, $context = null): int -{ - error_clear_last(); - if ($context !== null) { - $result = \readfile($filename, $use_include_path, $context); - } else { - $result = \readfile($filename, $use_include_path); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * readlink does the same as the readlink C function. - * - * @param string $path The symbolic link path. - * @return string Returns the contents of the symbolic link path. - * @throws FilesystemException - * - */ -function readlink(string $path): string -{ - error_clear_last(); - $result = \readlink($path); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * realpath expands all symbolic links and - * resolves references to /./, /../ and extra / characters in - * the input path and returns the canonicalized - * absolute pathname. - * - * @param string $path The path being checked. - * - * - * Whilst a path must be supplied, the value can be an empty string. - * In this case, the value is interpreted as the current directory. - * - * - * - * Whilst a path must be supplied, the value can be an empty string. - * In this case, the value is interpreted as the current directory. - * @return string Returns the canonicalized absolute pathname on success. The resulting path - * will have no symbolic link, /./ or /../ components. Trailing delimiters, - * such as \ and /, are also removed. - * - * realpath returns FALSE on failure, e.g. if - * the file does not exist. - * @throws FilesystemException - * - */ -function realpath(string $path): string -{ - error_clear_last(); - $result = \realpath($path); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Attempts to rename oldname to - * newname, moving it between directories if necessary. - * If renaming a file and newname exists, - * it will be overwritten. If renaming a directory and - * newname exists, - * this function will emit a warning. - * - * @param string $oldname The old name. - * - * The wrapper used in oldname - * must match the wrapper used in - * newname. - * @param string $newname The new name. - * @param resource $context - * @throws FilesystemException - * - */ -function rename(string $oldname, string $newname, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $result = \rename($oldname, $newname, $context); - } else { - $result = \rename($oldname, $newname); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Sets the file position indicator for handle - * to the beginning of the file stream. - * - * @param resource $handle The file pointer must be valid, and must point to a file - * successfully opened by fopen. - * @throws FilesystemException - * - */ -function rewind($handle): void -{ - error_clear_last(); - $result = \rewind($handle); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Attempts to remove the directory named by dirname. - * The directory must be empty, and the relevant permissions must permit this. - * A E_WARNING level error will be generated on failure. - * - * @param string $dirname Path to the directory. - * @param resource $context - * @throws FilesystemException - * - */ -function rmdir(string $dirname, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $result = \rmdir($dirname, $context); - } else { - $result = \rmdir($dirname); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * symlink creates a symbolic link to the existing - * target with the specified name - * link. - * - * @param string $target Target of the link. - * @param string $link The link name. - * @throws FilesystemException - * - */ -function symlink(string $target, string $link): void -{ - error_clear_last(); - $result = \symlink($target, $link); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Creates a file with a unique filename, with access permission set to 0600, in the specified directory. - * If the directory does not exist or is not writable, tempnam may - * generate a file in the system's temporary directory, and return - * the full path to that file, including its name. - * - * @param string $dir The directory where the temporary filename will be created. - * @param string $prefix The prefix of the generated temporary filename. - * @return string Returns the new temporary filename (with path). - * @throws FilesystemException - * - */ -function tempnam(string $dir, string $prefix): string -{ - error_clear_last(); - $result = \tempnam($dir, $prefix); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Creates a temporary file with a unique name in read-write (w+) mode and - * returns a file handle. - * - * The file is automatically removed when closed (for example, by calling - * fclose, or when there are no remaining references to - * the file handle returned by tmpfile), or when the - * script ends. - * - * @return resource Returns a file handle, similar to the one returned by - * fopen, for the new file. - * @throws FilesystemException - * - */ -function tmpfile() -{ - error_clear_last(); - $result = \tmpfile(); - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } - return $result; -} - - -/** - * Attempts to set the access and modification times of the file named in the - * filename parameter to the value given in - * time. - * Note that the access time is always modified, regardless of the number - * of parameters. - * - * If the file does not exist, it will be created. - * - * @param string $filename The name of the file being touched. - * @param int $time The touch time. If time is not supplied, - * the current system time is used. - * @param int $atime If present, the access time of the given filename is set to - * the value of atime. Otherwise, it is set to - * the value passed to the time parameter. - * If neither are present, the current system time is used. - * @throws FilesystemException - * - */ -function touch(string $filename, int $time = null, int $atime = null): void -{ - error_clear_last(); - if ($atime !== null) { - $result = \touch($filename, $time, $atime); - } elseif ($time !== null) { - $result = \touch($filename, $time); - } else { - $result = \touch($filename); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} - - -/** - * Deletes filename. Similar to the Unix C unlink() - * function. An E_WARNING level error will be generated on - * failure. - * - * @param string $filename Path to the file. - * @param resource $context - * @throws FilesystemException - * - */ -function unlink(string $filename, $context = null): void -{ - error_clear_last(); - if ($context !== null) { - $result = \unlink($filename, $context); - } else { - $result = \unlink($filename); - } - if ($result === false) { - throw FilesystemException::createFromPhpError(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/filter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/filter.php deleted file mode 100644 index 2d836c6c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/filter.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * - * - * channels will be 3 for RGB pictures and 4 for CMYK - * pictures. - * - * bits is the number of bits for each color. - * - * For some image types, the presence of channels and - * bits values can be a bit - * confusing. As an example, GIF always uses 3 channels - * per pixel, but the number of bits per pixel cannot be calculated for an - * animated GIF with a global color table. - * - * On failure, FALSE is returned. - * @throws ImageException - * - */ -function getimagesize(string $filename, array &$imageinfo = null): array -{ - error_clear_last(); - $result = \getimagesize($filename, $imageinfo); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * image2wbmp outputs or save a WBMP - * version of the given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|null $filename Path to the saved file. If not given, the raw image stream will be - * output directly. - * @param int $foreground You can set the foreground color with this parameter by setting an - * identifier obtained from imagecolorallocate. - * The default foreground color is black. - * @throws ImageException - * - */ -function image2wbmp($image, ?string $filename = null, int $foreground = null): void -{ - error_clear_last(); - if ($foreground !== null) { - $result = \image2wbmp($image, $filename, $foreground); - } elseif ($filename !== null) { - $result = \image2wbmp($image, $filename); - } else { - $result = \image2wbmp($image); - } - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $affine Array with keys 0 to 5. - * @param array $clip Array with keys "x", "y", "width" and "height". - * @return resource Return affined image resource on success. - * @throws ImageException - * - */ -function imageaffine($image, array $affine, array $clip = null) -{ - error_clear_last(); - if ($clip !== null) { - $result = \imageaffine($image, $affine, $clip); - } else { - $result = \imageaffine($image, $affine); - } - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Returns the concatenation of two affine transformation matrices, - * what is useful if multiple transformations should be applied to the same - * image in one go. - * - * @param array $m1 An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @param array $m2 An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @throws ImageException - * - */ -function imageaffinematrixconcat(array $m1, array $m2): array -{ - error_clear_last(); - $result = \imageaffinematrixconcat($m1, $m2); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Returns an affine transformation matrix. - * - * @param int $type One of the IMG_AFFINE_* constants. - * @param array|float $options If type is IMG_AFFINE_TRANSLATE - * or IMG_AFFINE_SCALE, - * options has to be an array with keys x - * and y, both having float values. - * - * If type is IMG_AFFINE_ROTATE, - * IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, - * options has to be a float specifying the angle. - * @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys - * 0 to 5 and float values). - * @throws ImageException - * - */ -function imageaffinematrixget(int $type, $options = null): array -{ - error_clear_last(); - if ($options !== null) { - $result = \imageaffinematrixget($type, $options); - } else { - $result = \imageaffinematrixget($type); - } - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagealphablending allows for two different - * modes of drawing on truecolor images. In blending mode, the - * alpha channel component of the color supplied to all drawing function, - * such as imagesetpixel determines how much of the - * underlying color should be allowed to shine through. As a result, gd - * automatically blends the existing color at that point with the drawing color, - * and stores the result in the image. The resulting pixel is opaque. In - * non-blending mode, the drawing color is copied literally with its alpha channel - * information, replacing the destination pixel. Blending mode is not available - * when drawing on palette images. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $blendmode Whether to enable the blending mode or not. On true color images - * the default value is TRUE otherwise the default value is FALSE - * @throws ImageException - * - */ -function imagealphablending($image, bool $blendmode): void -{ - error_clear_last(); - $result = \imagealphablending($image, $blendmode); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Activate the fast drawing antialiased methods for lines and wired polygons. - * It does not support alpha components. It works using a direct blend - * operation. It works only with truecolor images. - * - * Thickness and styled are not supported. - * - * Using antialiased primitives with transparent background color can end with - * some unexpected results. The blend method uses the background color as any - * other colors. The lack of alpha component support does not allow an alpha - * based antialiasing method. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $enabled Whether to enable antialiasing or not. - * @throws ImageException - * - */ -function imageantialias($image, bool $enabled): void -{ - error_clear_last(); - $result = \imageantialias($image, $enabled); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagearc draws an arc of circle centered at the given - * coordinates. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $cx x-coordinate of the center. - * @param int $cy y-coordinate of the center. - * @param int $width The arc width. - * @param int $height The arc height. - * @param int $start The arc start angle, in degrees. - * @param int $end The arc end angle, in degrees. - * 0° is located at the three-o'clock position, and the arc is drawn - * clockwise. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagearc($image, int $cx, int $cy, int $width, int $height, int $start, int $end, int $color): void -{ - error_clear_last(); - $result = \imagearc($image, $cx, $cy, $width, $height, $start, $end, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or saves a BMP version of the given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * - * NULL is invalid if the compressed arguments is - * not used. - * @param bool $compressed Whether the BMP should be compressed with run-length encoding (RLE), or not. - * @throws ImageException - * - */ -function imagebmp($image, $to = null, bool $compressed = true): void -{ - error_clear_last(); - $result = \imagebmp($image, $to, $compressed); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagechar draws the first character of - * c in the image identified by - * image with its upper-left at - * x,y (top left is 0, - * 0) with the color color. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or any of your - * own font identifiers registered with imageloadfont. - * @param int $x x-coordinate of the start. - * @param int $y y-coordinate of the start. - * @param string $c The character to draw. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagechar($image, int $font, int $x, int $y, string $c, int $color): void -{ - error_clear_last(); - $result = \imagechar($image, $font, $x, $y, $c, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws the character c vertically at the specified - * coordinate on the given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or any of your - * own font identifiers registered with imageloadfont. - * @param int $x x-coordinate of the start. - * @param int $y y-coordinate of the start. - * @param string $c The character to draw. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagecharup($image, int $font, int $x, int $y, string $c, int $color): void -{ - error_clear_last(); - $result = \imagecharup($image, $font, $x, $y, $c, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Returns the index of the color of the pixel at the - * specified location in the image specified by image. - * - * If the image is a - * truecolor image, this function returns the RGB value of that pixel as - * integer. Use bitshifting and masking to access the distinct red, green and blue - * component values: - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate of the point. - * @param int $y y-coordinate of the point. - * @return int Returns the index of the color. - * @throws ImageException - * - */ -function imagecolorat($image, int $x, int $y): int -{ - error_clear_last(); - $result = \imagecolorat($image, $x, $y); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * De-allocates a color previously allocated with - * imagecolorallocate or - * imagecolorallocatealpha. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $color The color identifier. - * @throws ImageException - * - */ -function imagecolordeallocate($image, int $color): void -{ - error_clear_last(); - $result = \imagecolordeallocate($image, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Makes the colors of the palette version of an image more closely match the true color version. - * - * @param resource $image1 A truecolor image resource. - * @param resource $image2 A palette image resource pointing to an image that has the same - * size as image1. - * @throws ImageException - * - */ -function imagecolormatch($image1, $image2): void -{ - error_clear_last(); - $result = \imagecolormatch($image1, $image2); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Applies a convolution matrix on the image, using the given coefficient and - * offset. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $matrix A 3x3 matrix: an array of three arrays of three floats. - * @param float $div The divisor of the result of the convolution, used for normalization. - * @param float $offset Color offset. - * @throws ImageException - * - */ -function imageconvolution($image, array $matrix, float $div, float $offset): void -{ - error_clear_last(); - $result = \imageconvolution($image, $matrix, $div, $offset); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Copy a part of src_im onto - * dst_im starting at the x,y coordinates - * src_x, src_y with - * a width of src_w and a height of - * src_h. The portion defined will be copied - * onto the x,y coordinates, dst_x and - * dst_y. - * - * @param resource $dst_im Destination image resource. - * @param resource $src_im Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $src_w Source width. - * @param int $src_h Source height. - * @throws ImageException - * - */ -function imagecopy($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h): void -{ - error_clear_last(); - $result = \imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Copy a part of src_im onto - * dst_im starting at the x,y coordinates - * src_x, src_y with - * a width of src_w and a height of - * src_h. The portion defined will be copied - * onto the x,y coordinates, dst_x and - * dst_y. - * - * @param resource $dst_im Destination image resource. - * @param resource $src_im Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $src_w Source width. - * @param int $src_h Source height. - * @param int $pct The two images will be merged according to pct - * which can range from 0 to 100. When pct = 0, - * no action is taken, when 100 this function behaves identically - * to imagecopy for pallete images, except for - * ignoring alpha components, while it implements alpha transparency - * for true colour images. - * @throws ImageException - * - */ -function imagecopymerge($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): void -{ - error_clear_last(); - $result = \imagecopymerge($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagecopymergegray copy a part of src_im onto - * dst_im starting at the x,y coordinates - * src_x, src_y with - * a width of src_w and a height of - * src_h. The portion defined will be copied - * onto the x,y coordinates, dst_x and - * dst_y. - * - * This function is identical to imagecopymerge except - * that when merging it preserves the hue of the source by converting - * the destination pixels to gray scale before the copy operation. - * - * @param resource $dst_im Destination image resource. - * @param resource $src_im Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $src_w Source width. - * @param int $src_h Source height. - * @param int $pct The src_im will be changed to grayscale according - * to pct where 0 is fully grayscale and 100 is - * unchanged. When pct = 100 this function behaves - * identically to imagecopy for pallete images, except for - * ignoring alpha components, while - * it implements alpha transparency for true colour images. - * @throws ImageException - * - */ -function imagecopymergegray($dst_im, $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): void -{ - error_clear_last(); - $result = \imagecopymergegray($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagecopyresampled copies a rectangular - * portion of one image to another image, smoothly interpolating pixel - * values so that, in particular, reducing the size of an image still - * retains a great deal of clarity. - * - * In other words, imagecopyresampled will take a - * rectangular area from src_image of width - * src_w and height src_h at - * position (src_x,src_y) - * and place it in a rectangular area of dst_image - * of width dst_w and height dst_h - * at position (dst_x,dst_y). - * - * If the source and destination coordinates and width and heights - * differ, appropriate stretching or shrinking of the image fragment - * will be performed. The coordinates refer to the upper left - * corner. This function can be used to copy regions within the - * same image (if dst_image is the same as - * src_image) but if the regions overlap the - * results will be unpredictable. - * - * @param resource $dst_image Destination image resource. - * @param resource $src_image Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $dst_w Destination width. - * @param int $dst_h Destination height. - * @param int $src_w Source width. - * @param int $src_h Source height. - * @throws ImageException - * - */ -function imagecopyresampled($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): void -{ - error_clear_last(); - $result = \imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagecopyresized copies a rectangular - * portion of one image to another image. - * dst_image is the destination image, - * src_image is the source image identifier. - * - * In other words, imagecopyresized will take a - * rectangular area from src_image of width - * src_w and height src_h at - * position (src_x,src_y) - * and place it in a rectangular area of dst_image - * of width dst_w and height dst_h - * at position (dst_x,dst_y). - * - * If the source and destination coordinates and width and heights - * differ, appropriate stretching or shrinking of the image fragment - * will be performed. The coordinates refer to the upper left - * corner. This function can be used to copy regions within the - * same image (if dst_image is the same as - * src_image) but if the regions overlap the - * results will be unpredictable. - * - * @param resource $dst_image Destination image resource. - * @param resource $src_image Source image resource. - * @param int $dst_x x-coordinate of destination point. - * @param int $dst_y y-coordinate of destination point. - * @param int $src_x x-coordinate of source point. - * @param int $src_y y-coordinate of source point. - * @param int $dst_w Destination width. - * @param int $dst_h Destination height. - * @param int $src_w Source width. - * @param int $src_h Source height. - * @throws ImageException - * - */ -function imagecopyresized($dst_image, $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_w, int $dst_h, int $src_w, int $src_h): void -{ - error_clear_last(); - $result = \imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagecreate returns an image identifier - * representing a blank image of specified size. - * - * In general, we recommend the use of - * imagecreatetruecolor instead of - * imagecreate so that image processing occurs on the - * highest quality image possible. If you want to output a palette image, then - * imagetruecolortopalette should be called immediately - * before saving the image with imagepng or - * imagegif. - * - * @param int $width The image width. - * @param int $height The image height. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreate(int $width, int $height) -{ - error_clear_last(); - $result = \imagecreate($width, $height); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefrombmp returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the BMP image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefrombmp(string $filename) -{ - error_clear_last(); - $result = \imagecreatefrombmp($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Create a new image from GD file or URL. - * - * @param string $filename Path to the GD file. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgd(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromgd($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Create a new image from GD2 file or URL. - * - * @param string $filename Path to the GD2 image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgd2(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromgd2($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Create a new image from a given part of GD2 file or URL. - * - * @param string $filename Path to the GD2 image. - * @param int $srcX x-coordinate of source point. - * @param int $srcY y-coordinate of source point. - * @param int $width Source width. - * @param int $height Source height. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgd2part(string $filename, int $srcX, int $srcY, int $width, int $height) -{ - error_clear_last(); - $result = \imagecreatefromgd2part($filename, $srcX, $srcY, $width, $height); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefromgif returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the GIF image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromgif(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromgif($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefromjpeg returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the JPEG image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromjpeg(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromjpeg($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefrompng returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the PNG image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefrompng(string $filename) -{ - error_clear_last(); - $result = \imagecreatefrompng($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefromwbmp returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the WBMP image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromwbmp(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromwbmp($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefromwebp returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the WebP image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromwebp(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromwebp($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefromxbm returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the XBM image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromxbm(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromxbm($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatefromxpm returns an image identifier - * representing the image obtained from the given filename. - * - * @param string $filename Path to the XPM image. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatefromxpm(string $filename) -{ - error_clear_last(); - $result = \imagecreatefromxpm($filename); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagecreatetruecolor returns an image identifier - * representing a black image of the specified size. - * - * @param int $width Image width. - * @param int $height Image height. - * @return resource Returns an image resource identifier on success, FALSE on errors. - * @throws ImageException - * - */ -function imagecreatetruecolor(int $width, int $height) -{ - error_clear_last(); - $result = \imagecreatetruecolor($width, $height); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Crops an image to the given rectangular area and returns the resulting image. - * The given image is not modified. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $rect The cropping rectangle as array with keys - * x, y, width and - * height. - * @return resource Return cropped image resource on success. - * @throws ImageException - * - */ -function imagecrop($image, array $rect) -{ - error_clear_last(); - $result = \imagecrop($image, $rect); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Automatically crops an image according to the given - * mode. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $mode One of the following constants: - * @param float $threshold - * @param int $color - * @return resource Returns a cropped image resource on success. - * If the complete image was cropped, imagecrop returns FALSE. - * @throws ImageException - * - */ -function imagecropauto($image, int $mode = IMG_CROP_DEFAULT, float $threshold = .5, int $color = -1) -{ - error_clear_last(); - $result = \imagecropauto($image, $mode, $threshold, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * This function is deprecated. Use combination of - * imagesetstyle and imageline - * instead. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 Upper left x coordinate. - * @param int $y1 Upper left y coordinate 0, 0 is the top left corner of the image. - * @param int $x2 Bottom right x coordinate. - * @param int $y2 Bottom right y coordinate. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagedashedline($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $result = \imagedashedline($image, $x1, $y1, $x2, $y2, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagedestroy frees any memory associated - * with image image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @throws ImageException - * - */ -function imagedestroy($image): void -{ - error_clear_last(); - $result = \imagedestroy($image); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws an ellipse centered at the specified coordinates. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $cx x-coordinate of the center. - * @param int $cy y-coordinate of the center. - * @param int $width The ellipse width. - * @param int $height The ellipse height. - * @param int $color The color of the ellipse. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imageellipse($image, int $cx, int $cy, int $width, int $height, int $color): void -{ - error_clear_last(); - $result = \imageellipse($image, $cx, $cy, $width, $height, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Performs a flood fill starting at the given coordinate (top left is 0, 0) - * with the given color in the - * image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate of start point. - * @param int $y y-coordinate of start point. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefill($image, int $x, int $y, int $color): void -{ - error_clear_last(); - $result = \imagefill($image, $x, $y, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a partial arc centered at the specified coordinate in the - * given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $cx x-coordinate of the center. - * @param int $cy y-coordinate of the center. - * @param int $width The arc width. - * @param int $height The arc height. - * @param int $start The arc start angle, in degrees. - * @param int $end The arc end angle, in degrees. - * 0° is located at the three-o'clock position, and the arc is drawn - * clockwise. - * @param int $color A color identifier created with imagecolorallocate. - * @param int $style A bitwise OR of the following possibilities: - * - * IMG_ARC_PIE - * IMG_ARC_CHORD - * IMG_ARC_NOFILL - * IMG_ARC_EDGED - * - * IMG_ARC_PIE and IMG_ARC_CHORD are - * mutually exclusive; IMG_ARC_CHORD just - * connects the starting and ending angles with a straight line, while - * IMG_ARC_PIE produces a rounded edge. - * IMG_ARC_NOFILL indicates that the arc - * or chord should be outlined, not filled. IMG_ARC_EDGED, - * used together with IMG_ARC_NOFILL, indicates that the - * beginning and ending angles should be connected to the center - this is a - * good way to outline (rather than fill) a 'pie slice'. - * @throws ImageException - * - */ -function imagefilledarc($image, int $cx, int $cy, int $width, int $height, int $start, int $end, int $color, int $style): void -{ - error_clear_last(); - $result = \imagefilledarc($image, $cx, $cy, $width, $height, $start, $end, $color, $style); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws an ellipse centered at the specified coordinate on the given - * image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $cx x-coordinate of the center. - * @param int $cy y-coordinate of the center. - * @param int $width The ellipse width. - * @param int $height The ellipse height. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefilledellipse($image, int $cx, int $cy, int $width, int $height, int $color): void -{ - error_clear_last(); - $result = \imagefilledellipse($image, $cx, $cy, $width, $height, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagefilledpolygon creates a filled polygon - * in the given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $points An array containing the x and y - * coordinates of the polygons vertices consecutively. - * @param int $num_points Total number of points (vertices), which must be at least 3. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefilledpolygon($image, array $points, int $num_points, int $color): void -{ - error_clear_last(); - $result = \imagefilledpolygon($image, $points, $num_points, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Creates a rectangle filled with color in the given - * image starting at point 1 and ending at point 2. - * 0, 0 is the top left corner of the image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 x-coordinate for point 1. - * @param int $y1 y-coordinate for point 1. - * @param int $x2 x-coordinate for point 2. - * @param int $y2 y-coordinate for point 2. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefilledrectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $result = \imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagefilltoborder performs a flood fill - * whose border color is defined by border. - * The starting point for the fill is x, - * y (top left is 0, 0) and the region is - * filled with color color. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate of start. - * @param int $y y-coordinate of start. - * @param int $border The border color. A color identifier created with imagecolorallocate. - * @param int $color The fill color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagefilltoborder($image, int $x, int $y, int $border, int $color): void -{ - error_clear_last(); - $result = \imagefilltoborder($image, $x, $y, $border, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagefilter applies the given filter - * filtertype on the image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $filtertype filtertype can be one of the following: - * - * - * - * IMG_FILTER_NEGATE: Reverses all colors of - * the image. - * - * - * - * - * IMG_FILTER_GRAYSCALE: Converts the image into - * grayscale by changing the red, green and blue components to their - * weighted sum using the same coefficients as the REC.601 luma (Y') - * calculation. The alpha components are retained. For palette images the - * result may differ due to palette limitations. - * - * - * - * - * IMG_FILTER_BRIGHTNESS: Changes the brightness - * of the image. Use arg1 to set the level of - * brightness. The range for the brightness is -255 to 255. - * - * - * - * - * IMG_FILTER_CONTRAST: Changes the contrast of - * the image. Use arg1 to set the level of - * contrast. - * - * - * - * - * IMG_FILTER_COLORIZE: Like - * IMG_FILTER_GRAYSCALE, except you can specify the - * color. Use arg1, arg2 and - * arg3 in the form of - * red, green, - * blue and arg4 for the - * alpha channel. The range for each color is 0 to 255. - * - * - * - * - * IMG_FILTER_EDGEDETECT: Uses edge detection to - * highlight the edges in the image. - * - * - * - * - * IMG_FILTER_EMBOSS: Embosses the image. - * - * - * - * - * IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using - * the Gaussian method. - * - * - * - * - * IMG_FILTER_SELECTIVE_BLUR: Blurs the image. - * - * - * - * - * IMG_FILTER_MEAN_REMOVAL: Uses mean removal to - * achieve a "sketchy" effect. - * - * - * - * - * IMG_FILTER_SMOOTH: Makes the image smoother. - * Use arg1 to set the level of smoothness. - * - * - * - * - * IMG_FILTER_PIXELATE: Applies pixelation effect - * to the image, use arg1 to set the block size - * and arg2 to set the pixelation effect mode. - * - * - * - * - * IMG_FILTER_SCATTER: Applies scatter effect - * to the image, use arg1 and - * arg2 to define the effect strength and - * additionally arg3 to only apply the - * on select pixel colors. - * - * - * - * @param int $arg1 - * - * - * IMG_FILTER_BRIGHTNESS: Brightness level. - * - * - * - * - * IMG_FILTER_CONTRAST: Contrast level. - * - * - * - * - * IMG_FILTER_COLORIZE: Value of red component. - * - * - * - * - * IMG_FILTER_SMOOTH: Smoothness level. - * - * - * - * - * IMG_FILTER_PIXELATE: Block size in pixels. - * - * - * - * - * IMG_FILTER_SCATTER: Effect substraction level. - * This must not be higher or equal to the addition level set with - * arg2. - * - * - * - * @param int $arg2 - * - * - * IMG_FILTER_COLORIZE: Value of green component. - * - * - * - * - * IMG_FILTER_PIXELATE: Whether to use advanced pixelation - * effect or not (defaults to FALSE). - * - * - * - * - * IMG_FILTER_SCATTER: Effect addition level. - * - * - * - * @param int $arg3 - * - * - * IMG_FILTER_COLORIZE: Value of blue component. - * - * - * - * - * IMG_FILTER_SCATTER: Optional array indexed color values - * to apply effect at. - * - * - * - * @param int $arg4 - * - * - * IMG_FILTER_COLORIZE: Alpha channel, A value - * between 0 and 127. 0 indicates completely opaque while 127 indicates - * completely transparent. - * - * - * - * @throws ImageException - * - */ -function imagefilter($image, int $filtertype, int $arg1 = null, int $arg2 = null, int $arg3 = null, int $arg4 = null): void -{ - error_clear_last(); - if ($arg4 !== null) { - $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3, $arg4); - } elseif ($arg3 !== null) { - $result = \imagefilter($image, $filtertype, $arg1, $arg2, $arg3); - } elseif ($arg2 !== null) { - $result = \imagefilter($image, $filtertype, $arg1, $arg2); - } elseif ($arg1 !== null) { - $result = \imagefilter($image, $filtertype, $arg1); - } else { - $result = \imagefilter($image, $filtertype); - } - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Flips the image image using the given - * mode. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $mode Flip mode, this can be one of the IMG_FLIP_* constants: - * - * - * - * - * - * Constant - * Meaning - * - * - * - * - * IMG_FLIP_HORIZONTAL - * - * Flips the image horizontally. - * - * - * - * IMG_FLIP_VERTICAL - * - * Flips the image vertically. - * - * - * - * IMG_FLIP_BOTH - * - * Flips the image both horizontally and vertically. - * - * - * - * - * - * @throws ImageException - * - */ -function imageflip($image, int $mode): void -{ - error_clear_last(); - $result = \imageflip($image, $mode); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Applies gamma correction to the given gd image - * given an input and an output gamma. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param float $inputgamma The input gamma. - * @param float $outputgamma The output gamma. - * @throws ImageException - * - */ -function imagegammacorrect($image, float $inputgamma, float $outputgamma): void -{ - error_clear_last(); - $result = \imagegammacorrect($image, $inputgamma, $outputgamma); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs a GD image to the given to. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * @throws ImageException - * - */ -function imagegd($image, $to = null): void -{ - error_clear_last(); - $result = \imagegd($image, $to); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs a GD2 image to the given to. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * @param int $chunk_size Chunk size. - * @param int $type Either IMG_GD2_RAW or - * IMG_GD2_COMPRESSED. Default is - * IMG_GD2_RAW. - * @throws ImageException - * - */ -function imagegd2($image, $to = null, int $chunk_size = 128, int $type = IMG_GD2_RAW): void -{ - error_clear_last(); - $result = \imagegd2($image, $to, $chunk_size, $type); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagegif creates the GIF - * file in to from the image image. The - * image argument is the return from the - * imagecreate or imagecreatefrom* - * function. - * - * The image format will be GIF87a unless the - * image has been made transparent with - * imagecolortransparent, in which case the - * image format will be GIF89a. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * @throws ImageException - * - */ -function imagegif($image, $to = null): void -{ - error_clear_last(); - $result = \imagegif($image, $to); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Grabs a screenshot of the whole screen. - * - * @return resource Returns an image resource identifier on success, FALSE on failure. - * @throws ImageException - * - */ -function imagegrabscreen() -{ - error_clear_last(); - $result = \imagegrabscreen(); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Grabs a window or its client area using a windows handle (HWND property in COM instance) - * - * @param int $window_handle The HWND window ID. - * @param int $client_area Include the client area of the application window. - * @return resource Returns an image resource identifier on success, FALSE on failure. - * @throws ImageException - * - */ -function imagegrabwindow(int $window_handle, int $client_area = 0) -{ - error_clear_last(); - $result = \imagegrabwindow($window_handle, $client_area); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagejpeg creates a JPEG file from - * the given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * @param int $quality quality is optional, and ranges from 0 (worst - * quality, smaller file) to 100 (best quality, biggest file). The - * default (-1) uses the default IJG quality value (about 75). - * @throws ImageException - * - */ -function imagejpeg($image, $to = null, int $quality = -1): void -{ - error_clear_last(); - $result = \imagejpeg($image, $to, $quality); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Set the alpha blending flag to use layering effects. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $effect One of the following constants: - * - * - * IMG_EFFECT_REPLACE - * - * - * Use pixel replacement (equivalent of passing TRUE to - * imagealphablending) - * - * - * - * - * IMG_EFFECT_ALPHABLEND - * - * - * Use normal pixel blending (equivalent of passing FALSE to - * imagealphablending) - * - * - * - * - * IMG_EFFECT_NORMAL - * - * - * Same as IMG_EFFECT_ALPHABLEND. - * - * - * - * - * IMG_EFFECT_OVERLAY - * - * - * Overlay has the effect that black background pixels will remain - * black, white background pixels will remain white, but grey - * background pixels will take the colour of the foreground pixel. - * - * - * - * - * IMG_EFFECT_MULTIPLY - * - * - * Overlays with a multiply effect. - * - * - * - * - * @throws ImageException - * - */ -function imagelayereffect($image, int $effect): void -{ - error_clear_last(); - $result = \imagelayereffect($image, $effect); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a line between the two given points. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 x-coordinate for first point. - * @param int $y1 y-coordinate for first point. - * @param int $x2 x-coordinate for second point. - * @param int $y2 y-coordinate for second point. - * @param int $color The line color. A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imageline($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $result = \imageline($image, $x1, $y1, $x2, $y2, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imageloadfont loads a user-defined bitmap and returns - * its identifier. - * - * @param string $file The font file format is currently binary and architecture - * dependent. This means you should generate the font files on the - * same type of CPU as the machine you are running PHP on. - * - * - * Font file format - * - * - * - * byte position - * C data type - * description - * - * - * - * - * byte 0-3 - * int - * number of characters in the font - * - * - * byte 4-7 - * int - * - * value of first character in the font (often 32 for space) - * - * - * - * byte 8-11 - * int - * pixel width of each character - * - * - * byte 12-15 - * int - * pixel height of each character - * - * - * byte 16- - * char - * - * array with character data, one byte per pixel in each - * character, for a total of (nchars*width*height) bytes. - * - * - * - * - * - * @return int The font identifier which is always bigger than 5 to avoid conflicts with - * built-in fontss. - * @throws ImageException - * - */ -function imageloadfont(string $file): int -{ - error_clear_last(); - $result = \imageloadfont($file); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imageopenpolygon draws an open polygon on the given - * image. Contrary to imagepolygon, - * no line is drawn between the last and the first point. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $points An array containing the polygon's vertices, e.g.: - * - * - * - * - * points[0] - * = x0 - * - * - * points[1] - * = y0 - * - * - * points[2] - * = x1 - * - * - * points[3] - * = y1 - * - * - * - * - * @param int $num_points Total number of points (vertices), which must be at least 3. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imageopenpolygon($image, array $points, int $num_points, int $color): void -{ - error_clear_last(); - $result = \imageopenpolygon($image, $points, $num_points, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or saves a PNG image from the given - * image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * - * NULL is invalid if the quality and - * filters arguments are not used. - * @param int $quality Compression level: from 0 (no compression) to 9. - * The default (-1) uses the zlib compression default. - * For more information see the zlib manual. - * @param int $filters Allows reducing the PNG file size. It is a bitmask field which may be - * set to any combination of the PNG_FILTER_XXX - * constants. PNG_NO_FILTER or - * PNG_ALL_FILTERS may also be used to respectively - * disable or activate all filters. - * The default value (-1) disables filtering. - * @throws ImageException - * - */ -function imagepng($image, $to = null, int $quality = -1, int $filters = -1): void -{ - error_clear_last(); - $result = \imagepng($image, $to, $quality, $filters); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagepolygon creates a polygon in the given - * image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $points An array containing the polygon's vertices, e.g.: - * - * - * - * - * points[0] - * = x0 - * - * - * points[1] - * = y0 - * - * - * points[2] - * = x1 - * - * - * points[3] - * = y1 - * - * - * - * - * @param int $num_points Total number of points (vertices), which must be at least 3. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagepolygon($image, array $points, int $num_points, int $color): void -{ - error_clear_last(); - $result = \imagepolygon($image, $points, $num_points, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagerectangle creates a rectangle starting at - * the specified coordinates. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 Upper left x coordinate. - * @param int $y1 Upper left y coordinate - * 0, 0 is the top left corner of the image. - * @param int $x2 Bottom right x coordinate. - * @param int $y2 Bottom right y coordinate. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagerectangle($image, int $x1, int $y1, int $x2, int $y2, int $color): void -{ - error_clear_last(); - $result = \imagerectangle($image, $x1, $y1, $x2, $y2, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Rotates the image image using the given - * angle in degrees. - * - * The center of rotation is the center of the image, and the rotated - * image may have different dimensions than the original image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param float $angle Rotation angle, in degrees. The rotation angle is interpreted as the - * number of degrees to rotate the image anticlockwise. - * @param int $bgd_color Specifies the color of the uncovered zone after the rotation - * @param int $dummy This parameter is unused. - * @return resource Returns an image resource for the rotated image. - * @throws ImageException - * - */ -function imagerotate($image, float $angle, int $bgd_color, int $dummy = 0) -{ - error_clear_last(); - $result = \imagerotate($image, $angle, $bgd_color, $dummy); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagesavealpha sets the flag which determines whether to retain - * full alpha channel information (as opposed to single-color transparency) - * when saving PNG images. - * - * Alphablending has to be disabled (imagealphablending($im, false)) - * to retain the alpha-channel in the first place. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $saveflag Whether to save the alpha channel or not. Defaults to FALSE. - * @throws ImageException - * - */ -function imagesavealpha($image, bool $saveflag): void -{ - error_clear_last(); - $result = \imagesavealpha($image, $saveflag); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagescale scales an image using the given - * interpolation algorithm. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $new_width The width to scale the image to. - * @param int $new_height The height to scale the image to. If omitted or negative, the aspect - * ratio will be preserved. - * @param int $mode One of IMG_NEAREST_NEIGHBOUR, - * IMG_BILINEAR_FIXED, - * IMG_BICUBIC, - * IMG_BICUBIC_FIXED or anything else (will use two - * pass). - * - * - * IMG_WEIGHTED4 is not yet supported. - * - * - * @return resource Return the scaled image resource on success. - * @throws ImageException - * - */ -function imagescale($image, int $new_width, int $new_height = -1, int $mode = IMG_BILINEAR_FIXED) -{ - error_clear_last(); - $result = \imagescale($image, $new_width, $new_height, $mode); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagesetbrush sets the brush image to be - * used by all line drawing functions (such as imageline - * and imagepolygon) when drawing with the special - * colors IMG_COLOR_BRUSHED or - * IMG_COLOR_STYLEDBRUSHED. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param resource $brush An image resource. - * @throws ImageException - * - */ -function imagesetbrush($image, $brush): void -{ - error_clear_last(); - $result = \imagesetbrush($image, $brush); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetclip sets the current clipping rectangle, i.e. - * the area beyond which no pixels will be drawn. - * - * @param resource $im An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x1 The x-coordinate of the upper left corner. - * @param int $y1 The y-coordinate of the upper left corner. - * @param int $x2 The x-coordinate of the lower right corner. - * @param int $y2 The y-coordinate of the lower right corner. - * @throws ImageException - * - */ -function imagesetclip($im, int $x1, int $y1, int $x2, int $y2): void -{ - error_clear_last(); - $result = \imagesetclip($im, $x1, $y1, $x2, $y2); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Sets the interpolation method, setting an interpolation method affects the rendering - * of various functions in GD, such as the imagerotate function. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $method The interpolation method, which can be one of the following: - * - * - * - * IMG_BELL: Bell filter. - * - * - * - * - * IMG_BESSEL: Bessel filter. - * - * - * - * - * IMG_BICUBIC: Bicubic interpolation. - * - * - * - * - * IMG_BICUBIC_FIXED: Fixed point implementation of the bicubic interpolation. - * - * - * - * - * IMG_BILINEAR_FIXED: Fixed point implementation of the bilinear interpolation (default (also on image creation)). - * - * - * - * - * IMG_BLACKMAN: Blackman window function. - * - * - * - * - * IMG_BOX: Box blur filter. - * - * - * - * - * IMG_BSPLINE: Spline interpolation. - * - * - * - * - * IMG_CATMULLROM: Cubic Hermite spline interpolation. - * - * - * - * - * IMG_GAUSSIAN: Gaussian function. - * - * - * - * - * IMG_GENERALIZED_CUBIC: Generalized cubic spline fractal interpolation. - * - * - * - * - * IMG_HERMITE: Hermite interpolation. - * - * - * - * - * IMG_HAMMING: Hamming filter. - * - * - * - * - * IMG_HANNING: Hanning filter. - * - * - * - * - * IMG_MITCHELL: Mitchell filter. - * - * - * - * - * IMG_POWER: Power interpolation. - * - * - * - * - * IMG_QUADRATIC: Inverse quadratic interpolation. - * - * - * - * - * IMG_SINC: Sinc function. - * - * - * - * - * IMG_NEAREST_NEIGHBOUR: Nearest neighbour interpolation. - * - * - * - * - * IMG_WEIGHTED4: Weighting filter. - * - * - * - * - * IMG_TRIANGLE: Triangle interpolation. - * - * - * - * @throws ImageException - * - */ -function imagesetinterpolation($image, int $method = IMG_BILINEAR_FIXED): void -{ - error_clear_last(); - $result = \imagesetinterpolation($image, $method); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetpixel draws a pixel at the specified - * coordinate. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $x x-coordinate. - * @param int $y y-coordinate. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagesetpixel($image, int $x, int $y, int $color): void -{ - error_clear_last(); - $result = \imagesetpixel($image, $x, $y, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetstyle sets the style to be used by all - * line drawing functions (such as imageline - * and imagepolygon) when drawing with the special - * color IMG_COLOR_STYLED or lines of images with color - * IMG_COLOR_STYLEDBRUSHED. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param array $style An array of pixel colors. You can use the - * IMG_COLOR_TRANSPARENT constant to add a - * transparent pixel. - * Note that style must not be an empty array. - * @throws ImageException - * - */ -function imagesetstyle($image, array $style): void -{ - error_clear_last(); - $result = \imagesetstyle($image, $style); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesetthickness sets the thickness of the lines - * drawn when drawing rectangles, polygons, arcs etc. to - * thickness pixels. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $thickness Thickness, in pixels. - * @throws ImageException - * - */ -function imagesetthickness($image, int $thickness): void -{ - error_clear_last(); - $result = \imagesetthickness($image, $thickness); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * imagesettile sets the tile image to be - * used by all region filling functions (such as imagefill - * and imagefilledpolygon) when filling with the special - * color IMG_COLOR_TILED. - * - * A tile is an image used to fill an area with a repeated pattern. Any - * GD image can be used as a tile, and by setting the transparent color index of the tile - * image with imagecolortransparent, a tile allows certain parts - * of the underlying area to shine through can be created. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param resource $tile The image resource to be used as a tile. - * @throws ImageException - * - */ -function imagesettile($image, $tile): void -{ - error_clear_last(); - $result = \imagesettile($image, $tile); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a string at the given coordinates. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or any of your - * own font identifiers registered with imageloadfont. - * @param int $x x-coordinate of the upper left corner. - * @param int $y y-coordinate of the upper left corner. - * @param string $string The string to be written. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagestring($image, int $font, int $x, int $y, string $string, int $color): void -{ - error_clear_last(); - $result = \imagestring($image, $font, $x, $y, $string, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Draws a string vertically at the given - * coordinates. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param int $font Can be 1, 2, 3, 4, 5 for built-in - * fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or any of your - * own font identifiers registered with imageloadfont. - * @param int $x x-coordinate of the bottom left corner. - * @param int $y y-coordinate of the bottom left corner. - * @param string $string The string to be written. - * @param int $color A color identifier created with imagecolorallocate. - * @throws ImageException - * - */ -function imagestringup($image, int $font, int $x, int $y, string $string, int $color): void -{ - error_clear_last(); - $result = \imagestringup($image, $font, $x, $y, $string, $color); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Returns the width of the given image resource. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @return int Return the width of the images. - * @throws ImageException - * - */ -function imagesx($image): int -{ - error_clear_last(); - $result = \imagesx($image); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Returns the height of the given image resource. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @return int Return the height of the images. - * @throws ImageException - * - */ -function imagesy($image): int -{ - error_clear_last(); - $result = \imagesy($image); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagetruecolortopalette converts a truecolor image - * to a palette image. The code for this function was originally drawn from - * the Independent JPEG Group library code, which is excellent. The code - * has been modified to preserve as much alpha channel information as - * possible in the resulting palette, in addition to preserving colors as - * well as possible. This does not work as well as might be hoped. It is - * usually best to simply produce a truecolor output image instead, which - * guarantees the highest output quality. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param bool $dither Indicates if the image should be dithered - if it is TRUE then - * dithering will be used which will result in a more speckled image but - * with better color approximation. - * @param int $ncolors Sets the maximum number of colors that should be retained in the palette. - * @throws ImageException - * - */ -function imagetruecolortopalette($image, bool $dither, int $ncolors): void -{ - error_clear_last(); - $result = \imagetruecolortopalette($image, $dither, $ncolors); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * This function calculates and returns the bounding box in pixels - * for a TrueType text. - * - * @param float $size The font size in points. - * @param float $angle Angle in degrees in which text will be measured. - * @param string $fontfile The path to the TrueType font you wish to use. - * - * Depending on which version of the GD library PHP is using, when - * fontfile does not begin with a leading - * / then .ttf will be appended - * to the filename and the library will attempt to search for that - * filename along a library-defined font path. - * - * When using versions of the GD library lower than 2.0.18, a space character, - * rather than a semicolon, was used as the 'path separator' for different font files. - * Unintentional use of this feature will result in the warning message: - * Warning: Could not find/open font. For these affected versions, the - * only solution is moving the font to a path which does not contain spaces. - * - * In many cases where a font resides in the same directory as the script using it - * the following trick will alleviate any include problems. - * - * - * ]]> - * - * - * Note that open_basedir does - * not apply to fontfile. - * @param string $text The string to be measured. - * @return array imagettfbbox returns an array with 8 - * elements representing four points making the bounding box of the - * text on success and FALSE on error. - * - * - * - * - * key - * contents - * - * - * - * - * 0 - * lower left corner, X position - * - * - * 1 - * lower left corner, Y position - * - * - * 2 - * lower right corner, X position - * - * - * 3 - * lower right corner, Y position - * - * - * 4 - * upper right corner, X position - * - * - * 5 - * upper right corner, Y position - * - * - * 6 - * upper left corner, X position - * - * - * 7 - * upper left corner, Y position - * - * - * - * - * - * The points are relative to the text regardless of the - * angle, so "upper left" means in the top left-hand - * corner seeing the text horizontally. - * @throws ImageException - * - */ -function imagettfbbox(float $size, float $angle, string $fontfile, string $text): array -{ - error_clear_last(); - $result = \imagettfbbox($size, $angle, $fontfile, $text); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Writes the given text into the image using TrueType - * fonts. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param float $size The font size in points. - * @param float $angle The angle in degrees, with 0 degrees being left-to-right reading text. - * Higher values represent a counter-clockwise rotation. For example, a - * value of 90 would result in bottom-to-top reading text. - * @param int $x The coordinates given by x and - * y will define the basepoint of the first - * character (roughly the lower-left corner of the character). This - * is different from the imagestring, where - * x and y define the - * upper-left corner of the first character. For example, "top left" - * is 0, 0. - * @param int $y The y-ordinate. This sets the position of the fonts baseline, not the - * very bottom of the character. - * @param int $color The color index. Using the negative of a color index has the effect of - * turning off antialiasing. See imagecolorallocate. - * @param string $fontfile The path to the TrueType font you wish to use. - * - * Depending on which version of the GD library PHP is using, when - * fontfile does not begin with a leading - * / then .ttf will be appended - * to the filename and the library will attempt to search for that - * filename along a library-defined font path. - * - * When using versions of the GD library lower than 2.0.18, a space character, - * rather than a semicolon, was used as the 'path separator' for different font files. - * Unintentional use of this feature will result in the warning message: - * Warning: Could not find/open font. For these affected versions, the - * only solution is moving the font to a path which does not contain spaces. - * - * In many cases where a font resides in the same directory as the script using it - * the following trick will alleviate any include problems. - * - * - * ]]> - * - * - * Note that open_basedir does - * not apply to fontfile. - * @param string $text The text string in UTF-8 encoding. - * - * May include decimal numeric character references (of the form: - * &#8364;) to access characters in a font beyond position 127. - * The hexadecimal format (like &#xA9;) is supported. - * Strings in UTF-8 encoding can be passed directly. - * - * Named entities, such as &copy;, are not supported. Consider using - * html_entity_decode - * to decode these named entities into UTF-8 strings. - * - * If a character is used in the string which is not supported by the - * font, a hollow rectangle will replace the character. - * @return array Returns an array with 8 elements representing four points making the - * bounding box of the text. The order of the points is lower left, lower - * right, upper right, upper left. The points are relative to the text - * regardless of the angle, so "upper left" means in the top left-hand - * corner when you see the text horizontally. - * @throws ImageException - * - */ -function imagettftext($image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text): array -{ - error_clear_last(); - $result = \imagettftext($image, $size, $angle, $x, $y, $color, $fontfile, $text); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * imagewbmp outputs or save a WBMP - * version of the given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * @param int $foreground You can set the foreground color with this parameter by setting an - * identifier obtained from imagecolorallocate. - * The default foreground color is black. - * @throws ImageException - * - */ -function imagewbmp($image, $to = null, int $foreground = null): void -{ - error_clear_last(); - if ($foreground !== null) { - $result = \imagewbmp($image, $to, $foreground); - } else { - $result = \imagewbmp($image, $to); - } - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or saves a WebP version of the given image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - * @param int $quality quality ranges from 0 (worst - * quality, smaller file) to 100 (best quality, biggest file). - * @throws ImageException - * - */ -function imagewebp($image, $to = null, int $quality = 80): void -{ - error_clear_last(); - $result = \imagewebp($image, $to, $quality); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Outputs or save an XBM version of the given - * image. - * - * @param resource $image An image resource, returned by one of the image creation functions, - * such as imagecreatetruecolor. - * @param string|null $filename The path to save the file to, given as string. If NULL, the raw image stream will be output directly. - * - * The filename (without the .xbm extension) is also - * used for the C identifiers of the XBM, whereby non - * alphanumeric characters of the current locale are substituted by - * underscores. If filename is set to NULL, - * image is used to build the C identifiers. - * @param int $foreground You can set the foreground color with this parameter by setting an - * identifier obtained from imagecolorallocate. - * The default foreground color is black. All other colors are treated as - * background. - * @throws ImageException - * - */ -function imagexbm($image, ?string $filename, int $foreground = null): void -{ - error_clear_last(); - if ($foreground !== null) { - $result = \imagexbm($image, $filename, $foreground); - } else { - $result = \imagexbm($image, $filename); - } - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Embeds binary IPTC data into a JPEG image. - * - * @param string $iptcdata The data to be written. - * @param string $jpeg_file_name Path to the JPEG image. - * @param int $spool Spool flag. If the spool flag is less than 2 then the JPEG will be - * returned as a string. Otherwise the JPEG will be printed to STDOUT. - * @return string|bool If spool is less than 2, the JPEG will be returned. Otherwise returns TRUE on success. - * @throws ImageException - * - */ -function iptcembed(string $iptcdata, string $jpeg_file_name, int $spool = 0) -{ - error_clear_last(); - $result = \iptcembed($iptcdata, $jpeg_file_name, $spool); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Parses an IPTC block into its single tags. - * - * @param string $iptcblock A binary IPTC block. - * @return array Returns an array using the tagmarker as an index and the value as the - * value. It returns FALSE on error or if no IPTC data was found. - * @throws ImageException - * - */ -function iptcparse(string $iptcblock): array -{ - error_clear_last(); - $result = \iptcparse($iptcblock); - if ($result === false) { - throw ImageException::createFromPhpError(); - } - return $result; -} - - -/** - * Converts a JPEG file into a WBMP file. - * - * @param string $jpegname Path to JPEG file. - * @param string $wbmpname Path to destination WBMP file. - * @param int $dest_height Destination image height. - * @param int $dest_width Destination image width. - * @param int $threshold Threshold value, between 0 and 8 (inclusive). - * @throws ImageException - * - */ -function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void -{ - error_clear_last(); - $result = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} - - -/** - * Converts a PNG file into a WBMP file. - * - * @param string $pngname Path to PNG file. - * @param string $wbmpname Path to destination WBMP file. - * @param int $dest_height Destination image height. - * @param int $dest_width Destination image width. - * @param int $threshold Threshold value, between 0 and 8 (inclusive). - * @throws ImageException - * - */ -function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void -{ - error_clear_last(); - $result = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold); - if ($result === false) { - throw ImageException::createFromPhpError(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/imap.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/imap.php deleted file mode 100644 index acd8672c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/imap.php +++ /dev/null @@ -1,1481 +0,0 @@ - - * - * - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_add($link_identifier, string $dn, array $entry, array $serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_add($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Does the same thing as ldap_bind but returns the LDAP result resource to be parsed with ldap_parse_result. - * - * @param resource $link_identifier - * @param string|null $bind_rdn - * @param string|null $bind_password - * @param array $serverctrls - * @return resource Returns an LDAP result identifier. - * @throws LdapException - * - */ -function ldap_bind_ext($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null, array $serverctrls = null) -{ - error_clear_last(); - $result = \ldap_bind_ext($link_identifier, $bind_rdn, $bind_password, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Binds to the LDAP directory with specified RDN and password. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string|null $bind_rdn - * @param string|null $bind_password - * @throws LdapException - * - */ -function ldap_bind($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null): void -{ - error_clear_last(); - $result = \ldap_bind($link_identifier, $bind_rdn, $bind_password); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Retrieve the pagination information send by the server. - * - * @param resource $link An LDAP link identifier, returned by ldap_connect. - * @param resource $result - * @param string|null $cookie An opaque structure sent by the server. - * @param int|null $estimated The estimated number of entries to retrieve. - * @throws LdapException - * - */ -function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void -{ - error_clear_last(); - $result = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Enable LDAP pagination by sending the pagination control (page size, cookie...). - * - * @param resource $link An LDAP link identifier, returned by ldap_connect. - * @param int $pagesize The number of entries by page. - * @param bool $iscritical Indicates whether the pagination is critical or not. - * If true and if the server doesn't support pagination, the search - * will return no result. - * @param string $cookie An opaque structure sent by the server - * (ldap_control_paged_result_response). - * @throws LdapException - * - */ -function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void -{ - error_clear_last(); - $result = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Returns the number of entries stored in the result of previous search - * operations. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_identifier The internal LDAP result. - * @return int Returns number of entries in the result. - * @throws LdapException - * - */ -function ldap_count_entries($link_identifier, $result_identifier): int -{ - error_clear_last(); - $result = \ldap_count_entries($link_identifier, $result_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Does the same thing as ldap_delete but returns the LDAP result resource to be parsed with ldap_parse_result. - * - * @param resource $link_identifier - * @param string $dn - * @param array $serverctrls - * @return resource Returns an LDAP result identifier. - * @throws LdapException - * - */ -function ldap_delete_ext($link_identifier, string $dn, array $serverctrls = null) -{ - error_clear_last(); - $result = \ldap_delete_ext($link_identifier, $dn, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Deletes a particular entry in LDAP directory. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_delete($link_identifier, string $dn, array $serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_delete($link_identifier, $dn, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Performs a PASSWD extended operation. - * - * @param resource $link An LDAP link identifier, returned by ldap_connect. - * @param string $user dn of the user to change the password of. - * @param string $oldpw The old password of this user. May be ommited depending of server configuration. - * @param string $newpw The new password for this user. May be omitted or empty to have a generated password. - * @param array $serverctrls If provided, a password policy request control is send with the request and this is - * filled with an array of LDAP Controls - * returned with the request. - * @return mixed Returns the generated password if newpw is empty or omitted. - * Otherwise returns TRUE on success. - * @throws LdapException - * - */ -function ldap_exop_passwd($link, string $user = "", string $oldpw = "", string $newpw = "", array &$serverctrls = null) -{ - error_clear_last(); - $result = \ldap_exop_passwd($link, $user, $oldpw, $newpw, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Performs a WHOAMI extended operation and returns the data. - * - * @param resource $link An LDAP link identifier, returned by ldap_connect. - * @return string The data returned by the server. - * @throws LdapException - * - */ -function ldap_exop_whoami($link): string -{ - error_clear_last(); - $result = \ldap_exop_whoami($link); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Performs an extended operation on the specified link with - * reqoid the OID of the operation and - * reqdata the data. - * - * @param resource $link An LDAP link identifier, returned by ldap_connect. - * @param string $reqoid The extended operation request OID. You may use one of LDAP_EXOP_START_TLS, LDAP_EXOP_MODIFY_PASSWD, LDAP_EXOP_REFRESH, LDAP_EXOP_WHO_AM_I, LDAP_EXOP_TURN, or a string with the OID of the operation you want to send. - * @param string $reqdata The extended operation request data. May be NULL for some operations like LDAP_EXOP_WHO_AM_I, may also need to be BER encoded. - * @param array|null $serverctrls Array of LDAP Controls to send with the request. - * @param string|null $retdata Will be filled with the extended operation response data if provided. - * If not provided you may use ldap_parse_exop on the result object - * later to get this data. - * @param string|null $retoid Will be filled with the response OID if provided, usually equal to the request OID. - * @return mixed When used with retdata, returns TRUE on success. - * When used without retdata, returns a result identifier. - * @throws LdapException - * - */ -function ldap_exop($link, string $reqoid, string $reqdata = null, ?array $serverctrls = null, ?string &$retdata = null, ?string &$retoid = null) -{ - error_clear_last(); - $result = \ldap_exop($link, $reqoid, $reqdata, $serverctrls, $retdata, $retoid); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Splits the DN returned by ldap_get_dn and breaks it - * up into its component parts. Each part is known as Relative Distinguished - * Name, or RDN. - * - * @param string $dn The distinguished name of an LDAP entity. - * @param int $with_attrib Used to request if the RDNs are returned with only values or their - * attributes as well. To get RDNs with the attributes (i.e. in - * attribute=value format) set with_attrib to 0 - * and to get only values set it to 1. - * @return array Returns an array of all DN components. - * The first element in the array has count key and - * represents the number of returned values, next elements are numerically - * indexed DN components. - * @throws LdapException - * - */ -function ldap_explode_dn(string $dn, int $with_attrib): array -{ - error_clear_last(); - $result = \ldap_explode_dn($dn, $with_attrib); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Gets the first attribute in the given entry. Remaining attributes are - * retrieved by calling ldap_next_attribute successively. - * - * Similar to reading entries, attributes are also read one by one from a - * particular entry. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_entry_identifier - * @return string Returns the first attribute in the entry on success and FALSE on - * error. - * @throws LdapException - * - */ -function ldap_first_attribute($link_identifier, $result_entry_identifier): string -{ - error_clear_last(); - $result = \ldap_first_attribute($link_identifier, $result_entry_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Returns the entry identifier for first entry in the result. This entry - * identifier is then supplied to ldap_next_entry - * routine to get successive entries from the result. - * - * Entries in the LDAP result are read sequentially using the - * ldap_first_entry and - * ldap_next_entry functions. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_identifier - * @return resource Returns the result entry identifier for the first entry on success and - * FALSE on error. - * @throws LdapException - * - */ -function ldap_first_entry($link_identifier, $result_identifier) -{ - error_clear_last(); - $result = \ldap_first_entry($link_identifier, $result_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Frees up the memory allocated internally to store the result. All result - * memory will be automatically freed when the script terminates. - * - * Typically all the memory allocated for the LDAP result gets freed at the - * end of the script. In case the script is making successive searches which - * return large result sets, ldap_free_result could be - * called to keep the runtime memory usage by the script low. - * - * @param resource $result_identifier - * @throws LdapException - * - */ -function ldap_free_result($result_identifier): void -{ - error_clear_last(); - $result = \ldap_free_result($result_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Reads attributes and values from an entry in the search result. - * - * Having located a specific entry in the directory, you can find out what - * information is held for that entry by using this call. You would use this - * call for an application which "browses" directory entries and/or where you - * do not know the structure of the directory entries. In many applications - * you will be searching for a specific attribute such as an email address or - * a surname, and won't care what other data is held. - * - * - * - * - * - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_entry_identifier - * @return array Returns a complete entry information in a multi-dimensional array - * on success and FALSE on error. - * @throws LdapException - * - */ -function ldap_get_attributes($link_identifier, $result_entry_identifier): array -{ - error_clear_last(); - $result = \ldap_get_attributes($link_identifier, $result_entry_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Finds out the DN of an entry in the result. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_entry_identifier - * @return string Returns the DN of the result entry and FALSE on error. - * @throws LdapException - * - */ -function ldap_get_dn($link_identifier, $result_entry_identifier): string -{ - error_clear_last(); - $result = \ldap_get_dn($link_identifier, $result_entry_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Reads multiple entries from the given result, and then reading the - * attributes and multiple values. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_identifier - * @return array Returns a complete result information in a multi-dimensional array on - * success and FALSE on error. - * - * The structure of the array is as follows. - * The attribute index is converted to lowercase. (Attributes are - * case-insensitive for directory servers, but not when used as - * array indices.) - * - * - * - * - * - * @throws LdapException - * - */ -function ldap_get_entries($link_identifier, $result_identifier): array -{ - error_clear_last(); - $result = \ldap_get_entries($link_identifier, $result_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Sets retval to the value of the specified option. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param int $option The parameter option can be one of: - * - * - * - * - * Option - * Type - * since - * - * - * - * - * LDAP_OPT_DEREF - * integer - * - * - * - * LDAP_OPT_SIZELIMIT - * integer - * - * - * - * LDAP_OPT_TIMELIMIT - * integer - * - * - * - * LDAP_OPT_NETWORK_TIMEOUT - * integer - * - * - * - * LDAP_OPT_PROTOCOL_VERSION - * integer - * - * - * - * LDAP_OPT_ERROR_NUMBER - * integer - * - * - * - * LDAP_OPT_DIAGNOSTIC_MESSAGE - * integer - * - * - * - * LDAP_OPT_REFERRALS - * bool - * - * - * - * LDAP_OPT_RESTART - * bool - * - * - * - * LDAP_OPT_HOST_NAME - * string - * - * - * - * LDAP_OPT_ERROR_STRING - * string - * - * - * - * LDAP_OPT_MATCHED_DN - * string - * - * - * - * LDAP_OPT_SERVER_CONTROLS - * array - * - * - * - * LDAP_OPT_CLIENT_CONTROLS - * array - * - * - * - * LDAP_OPT_X_KEEPALIVE_IDLE - * int - * 7.1 - * - * - * LDAP_OPT_X_KEEPALIVE_PROBES - * int - * 7.1 - * - * - * LDAP_OPT_X_KEEPALIVE_INTERVAL - * int - * 7.1 - * - * - * LDAP_OPT_X_TLS_CACERTDIR - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_CACERTFILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_CERTFILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_CIPHER_SUITE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRLCHECK - * integer - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRL_NONE - * integer - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRL_PEER - * integer - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRL_ALL - * integer - * 7.1 - * - * - * LDAP_OPT_X_TLS_CRLFILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_DHFILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_KEYILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_PACKAGE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_PROTOCOL_MIN - * integer - * 7.1 - * - * - * LDAP_OPT_X_TLS_RANDOM_FILE - * string - * 7.1 - * - * - * LDAP_OPT_X_TLS_REQUIRE_CERT - * integer - * - * - * - * - * - * @param mixed $retval This will be set to the option value. - * @throws LdapException - * - */ -function ldap_get_option($link_identifier, int $option, &$retval): void -{ - error_clear_last(); - $result = \ldap_get_option($link_identifier, $option, $retval); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Reads all the values of the attribute in the entry in the result. - * - * This function is used exactly like ldap_get_values - * except that it handles binary data and not string data. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_entry_identifier - * @param string $attribute - * @return array Returns an array of values for the attribute on success and FALSE on - * error. Individual values are accessed by integer index in the array. The - * first index is 0. The number of values can be found by indexing "count" - * in the resultant array. - * @throws LdapException - * - */ -function ldap_get_values_len($link_identifier, $result_entry_identifier, string $attribute): array -{ - error_clear_last(); - $result = \ldap_get_values_len($link_identifier, $result_entry_identifier, $attribute); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Reads all the values of the attribute in the entry in the result. - * - * This call needs a result_entry_identifier, - * so needs to be preceded by one of the ldap search calls and one - * of the calls to get an individual entry. - * - * You application will either be hard coded to look for certain - * attributes (such as "surname" or "mail") or you will have to use - * the ldap_get_attributes call to work out - * what attributes exist for a given entry. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_entry_identifier - * @param string $attribute - * @return array Returns an array of values for the attribute on success and FALSE on - * error. The number of values can be found by indexing "count" in the - * resultant array. Individual values are accessed by integer index in the - * array. The first index is 0. - * - * LDAP allows more than one entry for an attribute, so it can, for example, - * store a number of email addresses for one person's directory entry all - * labeled with the attribute "mail" - * - * - * return_value["count"] = number of values for attribute - * return_value[0] = first value of attribute - * return_value[i] = ith value of attribute - * - * - * @throws LdapException - * - */ -function ldap_get_values($link_identifier, $result_entry_identifier, string $attribute): array -{ - error_clear_last(); - $result = \ldap_get_values($link_identifier, $result_entry_identifier, $attribute); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Performs the search for a specified filter on the - * directory with the scope LDAP_SCOPE_ONELEVEL. - * - * LDAP_SCOPE_ONELEVEL means that the search should only - * return information that is at the level immediately below the - * base_dn given in the call. - * (Equivalent to typing "ls" and getting a list of files and folders in the - * current working directory.) - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $base_dn The base DN for the directory. - * @param string $filter - * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn"). - * Note that the "dn" is always returned irrespective of which attributes - * types are requested. - * - * Using this parameter is much more efficient than the default action - * (which is to return all attributes and their associated values). - * The use of this parameter should therefore be considered good - * practice. - * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0 - * both attributes types and attribute values are fetched which is the - * default behaviour. - * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0 - * means no limit. - * - * This parameter can NOT override server-side preset sizelimit. You can - * set it lower though. - * - * Some directory server hosts will be configured to return no more than - * a preset number of entries. If this occurs, the server will indicate - * that it has only returned a partial results set. This also occurs if - * you use this parameter to limit the count of fetched entries. - * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting - * this to 0 means no limit. - * - * This parameter can NOT override server-side preset timelimit. You can - * set it lower though. - * @param int $deref Specifies how aliases should be handled during the search. It can be - * one of the following: - * - * - * - * LDAP_DEREF_NEVER - (default) aliases are never - * dereferenced. - * - * - * - * - * LDAP_DEREF_SEARCHING - aliases should be - * dereferenced during the search but not when locating the base object - * of the search. - * - * - * - * - * LDAP_DEREF_FINDING - aliases should be - * dereferenced when locating the base object but not during the search. - * - * - * - * - * LDAP_DEREF_ALWAYS - aliases should be dereferenced - * always. - * - * - * - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @return resource Returns a search result identifier. - * @throws LdapException - * - */ -function ldap_list($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null) -{ - error_clear_last(); - if ($serverctrls !== null) { - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); - } elseif ($deref !== LDAP_DEREF_NEVER) { - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); - } elseif ($timelimit !== -1) { - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); - } elseif ($sizelimit !== -1) { - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); - } elseif ($attrsonly !== 0) { - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly); - } elseif ($attributes !== null) { - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes); - } else { - $result = \ldap_list($link_identifier, $base_dn, $filter); - } - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Does the same thing as ldap_mod_add but returns the LDAP result resource to be parsed with ldap_parse_result. - * - * @param resource $link_identifier - * @param string $dn - * @param array $entry - * @param array $serverctrls - * @return resource Returns an LDAP result identifier. - * @throws LdapException - * - */ -function ldap_mod_add_ext($link_identifier, string $dn, array $entry, array $serverctrls = null) -{ - error_clear_last(); - $result = \ldap_mod_add_ext($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Adds one or more attribute values to the specified dn. - * To add a whole new object see ldap_add function. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $entry An associative array listing the attirbute values to add. If an attribute was not existing yet it will be added. If an attribute is existing you can only add values to it if it supports multiple values. - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_mod_add($link_identifier, string $dn, array $entry, array $serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_mod_add($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Does the same thing as ldap_mod_del but returns the LDAP result resource to be parsed with ldap_parse_result. - * - * @param resource $link_identifier - * @param string $dn - * @param array $entry - * @param array $serverctrls - * @return resource Returns an LDAP result identifier. - * @throws LdapException - * - */ -function ldap_mod_del_ext($link_identifier, string $dn, array $entry, array $serverctrls = null) -{ - error_clear_last(); - $result = \ldap_mod_del_ext($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Removes one or more attribute values from the specified dn. - * Object deletions are done by the - * ldap_delete function. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $entry - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_mod_del($link_identifier, string $dn, array $entry, array $serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_mod_del($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Does the same thing as ldap_mod_replace but returns the LDAP result resource to be parsed with ldap_parse_result. - * - * @param resource $link_identifier - * @param string $dn - * @param array $entry - * @param array $serverctrls - * @return resource Returns an LDAP result identifier. - * @throws LdapException - * - */ -function ldap_mod_replace_ext($link_identifier, string $dn, array $entry, array $serverctrls = null) -{ - error_clear_last(); - $result = \ldap_mod_replace_ext($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Replaces one or more attributes from the specified dn. - * It may also add or remove attributes. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $entry An associative array listing the attributes to replace. Sending an empty array as value will remove the attribute, while sending an attribute not existing yet on this entry will add it. - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_mod_replace($link_identifier, string $dn, array $entry, array $serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_mod_replace($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Modifies an existing entry in the LDAP directory. Allows detailed - * specification of the modifications to perform. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param array $entry An array that specifies the modifications to make. Each entry in this - * array is an associative array with two or three keys: - * attrib maps to the name of the attribute to modify, - * modtype maps to the type of modification to perform, - * and (depending on the type of modification) values - * maps to an array of attribute values relevant to the modification. - * - * Possible values for modtype include: - * - * - * LDAP_MODIFY_BATCH_ADD - * - * - * Each value specified through values is added (as - * an additional value) to the attribute named by - * attrib. - * - * - * - * - * LDAP_MODIFY_BATCH_REMOVE - * - * - * Each value specified through values is removed - * from the attribute named by attrib. Any value of - * the attribute not contained in the values array - * will remain untouched. - * - * - * - * - * LDAP_MODIFY_BATCH_REMOVE_ALL - * - * - * All values are removed from the attribute named by - * attrib. A values entry must - * not be provided. - * - * - * - * - * LDAP_MODIFY_BATCH_REPLACE - * - * - * All current values of the attribute named by - * attrib are replaced with the values specified - * through values. - * - * - * - * - * - * Each value specified through values is added (as - * an additional value) to the attribute named by - * attrib. - * - * Each value specified through values is removed - * from the attribute named by attrib. Any value of - * the attribute not contained in the values array - * will remain untouched. - * - * All values are removed from the attribute named by - * attrib. A values entry must - * not be provided. - * - * All current values of the attribute named by - * attrib are replaced with the values specified - * through values. - * - * Note that any value for attrib must be a string, any - * value for values must be an array of strings, and - * any value for modtype must be one of the - * LDAP_MODIFY_BATCH_* constants listed above. - * @param array $serverctrls Each value specified through values is added (as - * an additional value) to the attribute named by - * attrib. - * @throws LdapException - * - */ -function ldap_modify_batch($link_identifier, string $dn, array $entry, array $serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_modify_batch($link_identifier, $dn, $entry, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Retrieves the attributes in an entry. The first call to - * ldap_next_attribute is made with the - * result_entry_identifier returned from - * ldap_first_attribute. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param resource $result_entry_identifier - * @return string Returns the next attribute in an entry on success and FALSE on - * error. - * @throws LdapException - * - */ -function ldap_next_attribute($link_identifier, $result_entry_identifier): string -{ - error_clear_last(); - $result = \ldap_next_attribute($link_identifier, $result_entry_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Parse LDAP extended operation data from result object result - * - * @param resource $link An LDAP link identifier, returned by ldap_connect. - * @param resource $result An LDAP result resource, returned by ldap_exop. - * @param string|null $retdata Will be filled by the response data. - * @param string|null $retoid Will be filled by the response OID. - * @throws LdapException - * - */ -function ldap_parse_exop($link, $result, ?string &$retdata = null, ?string &$retoid = null): void -{ - error_clear_last(); - $result = \ldap_parse_exop($link, $result, $retdata, $retoid); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Parses an LDAP search result. - * - * @param resource $link An LDAP link identifier, returned by ldap_connect. - * @param resource $result An LDAP result resource, returned by ldap_list or - * ldap_search. - * @param int|null $errcode A reference to a variable that will be set to the LDAP error code in - * the result, or 0 if no error occurred. - * @param string|null $matcheddn A reference to a variable that will be set to a matched DN if one was - * recognised within the request, otherwise it will be set to NULL. - * @param string|null $errmsg A reference to a variable that will be set to the LDAP error message in - * the result, or an empty string if no error occurred. - * @param array|null $referrals A reference to a variable that will be set to an array set - * to all of the referral strings in the result, or an empty array if no - * referrals were returned. - * @param array|null $serverctrls An array of LDAP Controls which have been sent with the response. - * @throws LdapException - * - */ -function ldap_parse_result($link, $result, ?int &$errcode, ?string &$matcheddn = null, ?string &$errmsg = null, ?array &$referrals = null, ?array &$serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Performs the search for a specified filter on the - * directory with the scope LDAP_SCOPE_BASE. So it is - * equivalent to reading an entry from the directory. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $base_dn The base DN for the directory. - * @param string $filter An empty filter is not allowed. If you want to retrieve absolutely all - * information for this entry, use a filter of - * objectClass=*. If you know which entry types are - * used on the directory server, you might use an appropriate filter such - * as objectClass=inetOrgPerson. - * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn"). - * Note that the "dn" is always returned irrespective of which attributes - * types are requested. - * - * Using this parameter is much more efficient than the default action - * (which is to return all attributes and their associated values). - * The use of this parameter should therefore be considered good - * practice. - * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0 - * both attributes types and attribute values are fetched which is the - * default behaviour. - * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0 - * means no limit. - * - * This parameter can NOT override server-side preset sizelimit. You can - * set it lower though. - * - * Some directory server hosts will be configured to return no more than - * a preset number of entries. If this occurs, the server will indicate - * that it has only returned a partial results set. This also occurs if - * you use this parameter to limit the count of fetched entries. - * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting - * this to 0 means no limit. - * - * This parameter can NOT override server-side preset timelimit. You can - * set it lower though. - * @param int $deref Specifies how aliases should be handled during the search. It can be - * one of the following: - * - * - * - * LDAP_DEREF_NEVER - (default) aliases are never - * dereferenced. - * - * - * - * - * LDAP_DEREF_SEARCHING - aliases should be - * dereferenced during the search but not when locating the base object - * of the search. - * - * - * - * - * LDAP_DEREF_FINDING - aliases should be - * dereferenced when locating the base object but not during the search. - * - * - * - * - * LDAP_DEREF_ALWAYS - aliases should be dereferenced - * always. - * - * - * - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @return resource Returns a search result identifier. - * @throws LdapException - * - */ -function ldap_read($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null) -{ - error_clear_last(); - if ($serverctrls !== null) { - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); - } elseif ($deref !== LDAP_DEREF_NEVER) { - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); - } elseif ($timelimit !== -1) { - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); - } elseif ($sizelimit !== -1) { - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); - } elseif ($attrsonly !== 0) { - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly); - } elseif ($attributes !== null) { - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes); - } else { - $result = \ldap_read($link_identifier, $base_dn, $filter); - } - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Does the same thing as ldap_rename but returns the LDAP result resource to be parsed with ldap_parse_result. - * - * @param resource $link_identifier - * @param string $dn - * @param string $newrdn - * @param string $newparent - * @param bool $deleteoldrdn - * @param array $serverctrls - * @return resource Returns an LDAP result identifier. - * @throws LdapException - * - */ -function ldap_rename_ext($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $serverctrls = null) -{ - error_clear_last(); - $result = \ldap_rename_ext($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * The entry specified by dn is renamed/moved. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $dn The distinguished name of an LDAP entity. - * @param string $newrdn The new RDN. - * @param string $newparent The new parent/superior entry. - * @param bool $deleteoldrdn If TRUE the old RDN value(s) is removed, else the old RDN value(s) - * is retained as non-distinguished values of the entry. - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @throws LdapException - * - */ -function ldap_rename($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $serverctrls = null): void -{ - error_clear_last(); - $result = \ldap_rename($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * - * - * @param resource $link - * @param string $binddn - * @param string $password - * @param string $sasl_mech - * @param string $sasl_realm - * @param string $sasl_authc_id - * @param string $sasl_authz_id - * @param string $props - * @throws LdapException - * - */ -function ldap_sasl_bind($link, string $binddn = null, string $password = null, string $sasl_mech = null, string $sasl_realm = null, string $sasl_authc_id = null, string $sasl_authz_id = null, string $props = null): void -{ - error_clear_last(); - $result = \ldap_sasl_bind($link, $binddn, $password, $sasl_mech, $sasl_realm, $sasl_authc_id, $sasl_authz_id, $props); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Performs the search for a specified filter on the directory with the scope - * of LDAP_SCOPE_SUBTREE. This is equivalent to searching - * the entire directory. - * - * From 4.0.5 on it's also possible to do parallel searches. To do this - * you use an array of link identifiers, rather than a single identifier, - * as the first argument. If you don't want the same base DN and the - * same filter for all the searches, you can also use an array of base DNs - * and/or an array of filters. Those arrays must be of the same size as - * the link identifier array since the first entries of the arrays are - * used for one search, the second entries are used for another, and so - * on. When doing parallel searches an array of search result - * identifiers is returned, except in case of error, then the entry - * corresponding to the search will be FALSE. This is very much like - * the value normally returned, except that a result identifier is always - * returned when a search was made. There are some rare cases where the - * normal search returns FALSE while the parallel search returns an - * identifier. - * - * @param resource|array $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param string $base_dn The base DN for the directory. - * @param string $filter The search filter can be simple or advanced, using boolean operators in - * the format described in the LDAP documentation (see the Netscape Directory SDK or - * RFC4515 for full - * information on filters). - * @param array $attributes An array of the required attributes, e.g. array("mail", "sn", "cn"). - * Note that the "dn" is always returned irrespective of which attributes - * types are requested. - * - * Using this parameter is much more efficient than the default action - * (which is to return all attributes and their associated values). - * The use of this parameter should therefore be considered good - * practice. - * @param int $attrsonly Should be set to 1 if only attribute types are wanted. If set to 0 - * both attributes types and attribute values are fetched which is the - * default behaviour. - * @param int $sizelimit Enables you to limit the count of entries fetched. Setting this to 0 - * means no limit. - * - * This parameter can NOT override server-side preset sizelimit. You can - * set it lower though. - * - * Some directory server hosts will be configured to return no more than - * a preset number of entries. If this occurs, the server will indicate - * that it has only returned a partial results set. This also occurs if - * you use this parameter to limit the count of fetched entries. - * @param int $timelimit Sets the number of seconds how long is spend on the search. Setting - * this to 0 means no limit. - * - * This parameter can NOT override server-side preset timelimit. You can - * set it lower though. - * @param int $deref Specifies how aliases should be handled during the search. It can be - * one of the following: - * - * - * - * LDAP_DEREF_NEVER - (default) aliases are never - * dereferenced. - * - * - * - * - * LDAP_DEREF_SEARCHING - aliases should be - * dereferenced during the search but not when locating the base object - * of the search. - * - * - * - * - * LDAP_DEREF_FINDING - aliases should be - * dereferenced when locating the base object but not during the search. - * - * - * - * - * LDAP_DEREF_ALWAYS - aliases should be dereferenced - * always. - * - * - * - * @param array $serverctrls Array of LDAP Controls to send with the request. - * @return resource Returns a search result identifier. - * @throws LdapException - * - */ -function ldap_search($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null) -{ - error_clear_last(); - if ($serverctrls !== null) { - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); - } elseif ($deref !== LDAP_DEREF_NEVER) { - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); - } elseif ($timelimit !== -1) { - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); - } elseif ($sizelimit !== -1) { - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); - } elseif ($attrsonly !== 0) { - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly); - } elseif ($attributes !== null) { - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes); - } else { - $result = \ldap_search($link_identifier, $base_dn, $filter); - } - if ($result === false) { - throw LdapException::createFromPhpError(); - } - return $result; -} - - -/** - * Sets the value of the specified option to be newval. - * - * @param resource|null $link_identifier An LDAP link identifier, returned by ldap_connect. - * @param int $option The parameter option can be one of: - * - * - * - * - * Option - * Type - * Available since - * - * - * - * - * LDAP_OPT_DEREF - * integer - * - * - * - * LDAP_OPT_SIZELIMIT - * integer - * - * - * - * LDAP_OPT_TIMELIMIT - * integer - * - * - * - * LDAP_OPT_NETWORK_TIMEOUT - * integer - * PHP 5.3.0 - * - * - * LDAP_OPT_PROTOCOL_VERSION - * integer - * - * - * - * LDAP_OPT_ERROR_NUMBER - * integer - * - * - * - * LDAP_OPT_REFERRALS - * bool - * - * - * - * LDAP_OPT_RESTART - * bool - * - * - * - * LDAP_OPT_HOST_NAME - * string - * - * - * - * LDAP_OPT_ERROR_STRING - * string - * - * - * - * LDAP_OPT_DIAGNOSTIC_MESSAGE - * string - * - * - * - * LDAP_OPT_MATCHED_DN - * string - * - * - * - * LDAP_OPT_SERVER_CONTROLS - * array - * - * - * - * LDAP_OPT_CLIENT_CONTROLS - * array - * - * - * - * LDAP_OPT_X_KEEPALIVE_IDLE - * int - * PHP 7.1.0 - * - * - * LDAP_OPT_X_KEEPALIVE_PROBES - * int - * PHP 7.1.0 - * - * - * LDAP_OPT_X_KEEPALIVE_INTERVAL - * int - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_CACERTDIR - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_CACERTFILE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_CERTFILE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_CIPHER_SUITE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_CRLCHECK - * integer - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_CRLFILE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_DHFILE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_KEYFILE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_PROTOCOL_MIN - * integer - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_RANDOM_FILE - * string - * PHP 7.1.0 - * - * - * LDAP_OPT_X_TLS_REQUIRE_CERT - * integer - * PHP 7.0.5 - * - * - * - * - * - * LDAP_OPT_SERVER_CONTROLS and - * LDAP_OPT_CLIENT_CONTROLS require a list of - * controls, this means that the value must be an array of controls. A - * control consists of an oid identifying the control, - * an optional value, and an optional flag for - * criticality. In PHP a control is given by an - * array containing an element with the key oid - * and string value, and two optional elements. The optional - * elements are key value with string value - * and key iscritical with boolean value. - * iscritical defaults to FALSE - * if not supplied. See draft-ietf-ldapext-ldap-c-api-xx.txt - * for details. See also the second example below. - * @param mixed $newval The new value for the specified option. - * @throws LdapException - * - */ -function ldap_set_option($link_identifier, int $option, $newval): void -{ - error_clear_last(); - $result = \ldap_set_option($link_identifier, $option, $newval); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} - - -/** - * Unbinds from the LDAP directory. - * - * @param resource $link_identifier An LDAP link identifier, returned by ldap_connect. - * @throws LdapException - * - */ -function ldap_unbind($link_identifier): void -{ - error_clear_last(); - $result = \ldap_unbind($link_identifier); - if ($result === false) { - throw LdapException::createFromPhpError(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/libxml.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/libxml.php deleted file mode 100644 index cef784c4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/libxml.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * The above example will output: - * - * example: , this is a test - * example: , this is a test - * ]]> - * - * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. - * - * - * - * - * If the pattern contains named subpatterns, $matches - * additionally contains entries for keys with the subpattern name. - * - * - * If the pattern contains duplicate named subpatterns, only the rightmost - * subpattern is stored in $matches[NAME]. - * - * - * - * ]]> - * - * The above example will output: - * - * - * [1] => bar - * ) - * ]]> - * - * - * - * - * - * - * PREG_SET_ORDER - * - * - * Orders results so that $matches[0] is an array of first set - * of matches, $matches[1] is an array of second set of matches, - * and so on. - * - * - * - * ]]> - * - * The above example will output: - * - * example: , example: - * this is a test, this is a test - * ]]> - * - * - * - * - * - * - * PREG_OFFSET_CAPTURE - * - * - * If this flag is passed, for every occurring match the appendant string - * offset (in bytes) will also be returned. Note that this changes the value of - * matches into an array of arrays where every element is an - * array consisting of the matched string at offset 0 - * and its string offset into subject at offset - * 1. - * - * - * - * ]]> - * - * The above example will output: - * - * Array - * ( - * [0] => Array - * ( - * [0] => foobarbaz - * [1] => 0 - * ) - * - * ) - * - * [1] => Array - * ( - * [0] => Array - * ( - * [0] => foo - * [1] => 0 - * ) - * - * ) - * - * [2] => Array - * ( - * [0] => Array - * ( - * [0] => bar - * [1] => 3 - * ) - * - * ) - * - * [3] => Array - * ( - * [0] => Array - * ( - * [0] => baz - * [1] => 6 - * ) - * - * ) - * - * ) - * ]]> - * - * - * - * - * - * - * PREG_UNMATCHED_AS_NULL - * - * - * If this flag is passed, unmatched subpatterns are reported as NULL; - * otherwise they are reported as an empty string. - * - * - * - * - * - * Orders results so that $matches[0] is an array of full - * pattern matches, $matches[1] is an array of strings matched by - * the first parenthesized subpattern, and so on. - * - * - * - * - * ]]> - * - * The above example will output: - * - * example: , this is a test - * example: , this is a test - * ]]> - * - * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. - * - * - * - * The above example will output: - * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. - * - * If the pattern contains named subpatterns, $matches - * additionally contains entries for keys with the subpattern name. - * - * If the pattern contains duplicate named subpatterns, only the rightmost - * subpattern is stored in $matches[NAME]. - * - * - * - * ]]> - * - * The above example will output: - * - * - * [1] => bar - * ) - * ]]> - * - * - * - * The above example will output: - * - * Orders results so that $matches[0] is an array of first set - * of matches, $matches[1] is an array of second set of matches, - * and so on. - * - * - * - * ]]> - * - * The above example will output: - * - * example: , example: - * this is a test, this is a test - * ]]> - * - * - * - * The above example will output: - * - * If this flag is passed, for every occurring match the appendant string - * offset (in bytes) will also be returned. Note that this changes the value of - * matches into an array of arrays where every element is an - * array consisting of the matched string at offset 0 - * and its string offset into subject at offset - * 1. - * - * - * - * ]]> - * - * The above example will output: - * - * Array - * ( - * [0] => Array - * ( - * [0] => foobarbaz - * [1] => 0 - * ) - * - * ) - * - * [1] => Array - * ( - * [0] => Array - * ( - * [0] => foo - * [1] => 0 - * ) - * - * ) - * - * [2] => Array - * ( - * [0] => Array - * ( - * [0] => bar - * [1] => 3 - * ) - * - * ) - * - * [3] => Array - * ( - * [0] => Array - * ( - * [0] => baz - * [1] => 6 - * ) - * - * ) - * - * ) - * ]]> - * - * - * - * The above example will output: - * - * If this flag is passed, unmatched subpatterns are reported as NULL; - * otherwise they are reported as an empty string. - * - * If no order flag is given, PREG_PATTERN_ORDER is - * assumed. - * @param int $offset Orders results so that $matches[0] is an array of full - * pattern matches, $matches[1] is an array of strings matched by - * the first parenthesized subpattern, and so on. - * - * - * - * - * ]]> - * - * The above example will output: - * - * example: , this is a test - * example: , this is a test - * ]]> - * - * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. - * - * - * - * The above example will output: - * - * So, $out[0] contains array of strings that matched full pattern, - * and $out[1] contains array of strings enclosed by tags. - * - * If the pattern contains named subpatterns, $matches - * additionally contains entries for keys with the subpattern name. - * - * If the pattern contains duplicate named subpatterns, only the rightmost - * subpattern is stored in $matches[NAME]. - * - * - * - * ]]> - * - * The above example will output: - * - * - * [1] => bar - * ) - * ]]> - * - * - * - * The above example will output: - * @return int Returns the number of full pattern matches (which might be zero). - * @throws PcreException - * - */ -function preg_match_all(string $pattern, string $subject, array &$matches = null, int $flags = PREG_PATTERN_ORDER, int $offset = 0): int -{ - error_clear_last(); - $result = \preg_match_all($pattern, $subject, $matches, $flags, $offset); - if ($result === false) { - throw PcreException::createFromPhpError(); - } - return $result; -} - - -/** - * Searches subject for a match to the regular - * expression given in pattern. - * - * @param string $pattern The pattern to search for, as a string. - * @param string $subject The input string. - * @param array $matches If matches is provided, then it is filled with - * the results of search. $matches[0] will contain the - * text that matched the full pattern, $matches[1] - * will have the text that matched the first captured parenthesized - * subpattern, and so on. - * @param int $flags flags can be a combination of the following flags: - * - * - * PREG_OFFSET_CAPTURE - * - * - * If this flag is passed, for every occurring match the appendant string - * offset (in bytes) will also be returned. Note that this changes the value of - * matches into an array where every element is an - * array consisting of the matched string at offset 0 - * and its string offset into subject at offset - * 1. - * - * - * - * ]]> - * - * The above example will output: - * - * Array - * ( - * [0] => foobarbaz - * [1] => 0 - * ) - * - * [1] => Array - * ( - * [0] => foo - * [1] => 0 - * ) - * - * [2] => Array - * ( - * [0] => bar - * [1] => 3 - * ) - * - * [3] => Array - * ( - * [0] => baz - * [1] => 6 - * ) - * - * ) - * ]]> - * - * - * - * - * - * - * PREG_UNMATCHED_AS_NULL - * - * - * If this flag is passed, unmatched subpatterns are reported as NULL; - * otherwise they are reported as an empty string. - * - * - * - * ]]> - * - * The above example will output: - * - * - * string(2) "ac" - * [1]=> - * string(1) "a" - * [2]=> - * string(0) "" - * [3]=> - * string(1) "c" - * } - * array(4) { - * [0]=> - * string(2) "ac" - * [1]=> - * string(1) "a" - * [2]=> - * NULL - * [3]=> - * string(1) "c" - * } - * ]]> - * - * - * - * - * - * - * - * If this flag is passed, for every occurring match the appendant string - * offset (in bytes) will also be returned. Note that this changes the value of - * matches into an array where every element is an - * array consisting of the matched string at offset 0 - * and its string offset into subject at offset - * 1. - * - * - * - * ]]> - * - * The above example will output: - * - * Array - * ( - * [0] => foobarbaz - * [1] => 0 - * ) - * - * [1] => Array - * ( - * [0] => foo - * [1] => 0 - * ) - * - * [2] => Array - * ( - * [0] => bar - * [1] => 3 - * ) - * - * [3] => Array - * ( - * [0] => baz - * [1] => 6 - * ) - * - * ) - * ]]> - * - * - * - * The above example will output: - * - * If this flag is passed, unmatched subpatterns are reported as NULL; - * otherwise they are reported as an empty string. - * - * - * - * ]]> - * - * The above example will output: - * - * - * string(2) "ac" - * [1]=> - * string(1) "a" - * [2]=> - * string(0) "" - * [3]=> - * string(1) "c" - * } - * array(4) { - * [0]=> - * string(2) "ac" - * [1]=> - * string(1) "a" - * [2]=> - * NULL - * [3]=> - * string(1) "c" - * } - * ]]> - * - * - * - * The above example will output: - * @param int $offset If this flag is passed, for every occurring match the appendant string - * offset (in bytes) will also be returned. Note that this changes the value of - * matches into an array where every element is an - * array consisting of the matched string at offset 0 - * and its string offset into subject at offset - * 1. - * - * - * - * ]]> - * - * The above example will output: - * - * Array - * ( - * [0] => foobarbaz - * [1] => 0 - * ) - * - * [1] => Array - * ( - * [0] => foo - * [1] => 0 - * ) - * - * [2] => Array - * ( - * [0] => bar - * [1] => 3 - * ) - * - * [3] => Array - * ( - * [0] => baz - * [1] => 6 - * ) - * - * ) - * ]]> - * - * - * - * The above example will output: - * @return int preg_match returns 1 if the pattern - * matches given subject, 0 if it does not. - * @throws PcreException - * - */ -function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int -{ - error_clear_last(); - $result = \preg_match($pattern, $subject, $matches, $flags, $offset); - if ($result === false) { - throw PcreException::createFromPhpError(); - } - return $result; -} - - -/** - * Split the given string by a regular expression. - * - * @param string $pattern The pattern to search for, as a string. - * @param string $subject The input string. - * @param int|null $limit If specified, then only substrings up to limit - * are returned with the rest of the string being placed in the last - * substring. A limit of -1 or 0 means "no limit". - * @param int $flags flags can be any combination of the following - * flags (combined with the | bitwise operator): - * - * - * PREG_SPLIT_NO_EMPTY - * - * - * If this flag is set, only non-empty pieces will be returned by - * preg_split. - * - * - * - * - * PREG_SPLIT_DELIM_CAPTURE - * - * - * If this flag is set, parenthesized expression in the delimiter pattern - * will be captured and returned as well. - * - * - * - * - * PREG_SPLIT_OFFSET_CAPTURE - * - * - * If this flag is set, for every occurring match the appendant string - * offset will also be returned. Note that this changes the return - * value in an array where every element is an array consisting of the - * matched string at offset 0 and its string offset - * into subject at offset 1. - * - * - * - * - * - * If this flag is set, for every occurring match the appendant string - * offset will also be returned. Note that this changes the return - * value in an array where every element is an array consisting of the - * matched string at offset 0 and its string offset - * into subject at offset 1. - * @return array Returns an array containing substrings of subject - * split along boundaries matched by pattern. - * @throws PcreException - * - */ -function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array -{ - error_clear_last(); - $result = \preg_split($pattern, $subject, $limit, $flags); - if ($result === false) { - throw PcreException::createFromPhpError(); - } - return $result; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/pdf.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/pdf.php deleted file mode 100644 index d039b27a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/pdf.php +++ /dev/null @@ -1,1553 +0,0 @@ - - * ]]> - * - * - * - * @param string $prompt The prompt message. - * @param callable $callback The callback function takes one parameter; the - * user input returned. - * @throws ReadlineException - * - */ -function readline_callback_handler_install(string $prompt, callable $callback): void -{ - error_clear_last(); - $result = \readline_callback_handler_install($prompt, $callback); - if ($result === false) { - throw ReadlineException::createFromPhpError(); - } -} - - -/** - * This function clears the entire command line history. - * - * @throws ReadlineException - * - */ -function readline_clear_history(): void -{ - error_clear_last(); - $result = \readline_clear_history(); - if ($result === false) { - throw ReadlineException::createFromPhpError(); - } -} - - -/** - * This function registers a completion function. This is the same kind of - * functionality you'd get if you hit your tab key while using Bash. - * - * @param callable $function You must supply the name of an existing function which accepts a - * partial command line and returns an array of possible matches. - * @throws ReadlineException - * - */ -function readline_completion_function(callable $function): void -{ - error_clear_last(); - $result = \readline_completion_function($function); - if ($result === false) { - throw ReadlineException::createFromPhpError(); - } -} - - -/** - * This function reads a command history from a file. - * - * @param string $filename Path to the filename containing the command history. - * @throws ReadlineException - * - */ -function readline_read_history(string $filename = null): void -{ - error_clear_last(); - if ($filename !== null) { - $result = \readline_read_history($filename); - } else { - $result = \readline_read_history(); - } - if ($result === false) { - throw ReadlineException::createFromPhpError(); - } -} - - -/** - * This function writes the command history to a file. - * - * @param string $filename Path to the saved file. - * @throws ReadlineException - * - */ -function readline_write_history(string $filename = null): void -{ - error_clear_last(); - if ($filename !== null) { - $result = \readline_write_history($filename); - } else { - $result = \readline_write_history(); - } - if ($result === false) { - throw ReadlineException::createFromPhpError(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/rpminfo.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/rpminfo.php deleted file mode 100644 index 44de1ce2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/rpminfo.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * - * @param int $length If length is given and is positive, the string - * returned will contain at most length characters - * beginning from start (depending on the length of - * string). - * - * If length is given and is negative, then that many - * characters will be omitted from the end of string - * (after the start position has been calculated when a - * start is negative). If - * start denotes the position of this truncation or - * beyond, FALSE will be returned. - * - * If length is given and is 0, - * FALSE or NULL, an empty string will be returned. - * - * If length is omitted, the substring starting from - * start until the end of the string will be - * returned. - * @return string Returns the extracted part of string;, or - * an empty string. - * @throws StringsException - * - */ -function substr(string $string, int $start, int $length = null): string -{ - error_clear_last(); - if ($length !== null) { - $result = \substr($string, $start, $length); - } else { - $result = \substr($string, $start); - } - if ($result === false) { - throw StringsException::createFromPhpError(); - } - return $result; -} - - -/** - * Operates as sprintf but accepts an array of - * arguments, rather than a variable number of arguments. - * - * @param string $format The format string is composed of zero or more directives: - * ordinary characters (excluding %) that are - * copied directly to the result and conversion - * specifications, each of which results in fetching its - * own parameter. - * - * A conversion specification follows this prototype: - * %[argnum$][flags][width][.precision]specifier. - * - * An integer followed by a dollar sign $, - * to specify which number argument to treat in the conversion. - * - * - * Flags - * - * - * - * Flag - * Description - * - * - * - * - * - - * - * Left-justify within the given field width; - * Right justification is the default - * - * - * - * + - * - * Prefix positive numbers with a plus sign - * +; Default only negative - * are prefixed with a negative sign. - * - * - * - * (space) - * - * Pads the result with spaces. - * This is the default. - * - * - * - * 0 - * - * Only left-pads numbers with zeros. - * With s specifiers this can - * also right-pad with zeros. - * - * - * - * '(char) - * - * Pads the result with the character (char). - * - * - * - * - * - * - * An integer that says how many characters (minimum) - * this conversion should result in. - * - * A period . followed by an integer - * who's meaning depends on the specifier: - * - * - * - * For e, E, - * f and F - * specifiers: this is the number of digits to be printed - * after the decimal point (by default, this is 6). - * - * - * - * - * For g and G - * specifiers: this is the maximum number of significant - * digits to be printed. - * - * - * - * - * For s specifier: it acts as a cutoff point, - * setting a maximum character limit to the string. - * - * - * - * - * - * If the period is specified without an explicit value for precision, - * 0 is assumed. - * - * - * - * - * Specifiers - * - * - * - * Specifier - * Description - * - * - * - * - * % - * - * A literal percent character. No argument is required. - * - * - * - * b - * - * The argument is treated as an integer and presented - * as a binary number. - * - * - * - * c - * - * The argument is treated as an integer and presented - * as the character with that ASCII. - * - * - * - * d - * - * The argument is treated as an integer and presented - * as a (signed) decimal number. - * - * - * - * e - * - * The argument is treated as scientific notation (e.g. 1.2e+2). - * The precision specifier stands for the number of digits after the - * decimal point since PHP 5.2.1. In earlier versions, it was taken as - * number of significant digits (one less). - * - * - * - * E - * - * Like the e specifier but uses - * uppercase letter (e.g. 1.2E+2). - * - * - * - * f - * - * The argument is treated as a float and presented - * as a floating-point number (locale aware). - * - * - * - * F - * - * The argument is treated as a float and presented - * as a floating-point number (non-locale aware). - * Available as of PHP 5.0.3. - * - * - * - * g - * - * - * General format. - * - * - * Let P equal the precision if nonzero, 6 if the precision is omitted, - * or 1 if the precision is zero. - * Then, if a conversion with style E would have an exponent of X: - * - * - * If P > X ≥ −4, the conversion is with style f and precision P − (X + 1). - * Otherwise, the conversion is with style e and precision P − 1. - * - * - * - * - * G - * - * Like the g specifier but uses - * E and f. - * - * - * - * o - * - * The argument is treated as an integer and presented - * as an octal number. - * - * - * - * s - * - * The argument is treated and presented as a string. - * - * - * - * u - * - * The argument is treated as an integer and presented - * as an unsigned decimal number. - * - * - * - * x - * - * The argument is treated as an integer and presented - * as a hexadecimal number (with lowercase letters). - * - * - * - * X - * - * The argument is treated as an integer and presented - * as a hexadecimal number (with uppercase letters). - * - * - * - * - * - * - * General format. - * - * Let P equal the precision if nonzero, 6 if the precision is omitted, - * or 1 if the precision is zero. - * Then, if a conversion with style E would have an exponent of X: - * - * If P > X ≥ −4, the conversion is with style f and precision P − (X + 1). - * Otherwise, the conversion is with style e and precision P − 1. - * - * The c type specifier ignores padding and width - * - * Attempting to use a combination of the string and width specifiers with character sets that require more than one byte per character may result in unexpected results - * - * Variables will be co-erced to a suitable type for the specifier: - * - * Type Handling - * - * - * - * Type - * Specifiers - * - * - * - * - * string - * s - * - * - * integer - * - * d, - * u, - * c, - * o, - * x, - * X, - * b - * - * - * - * double - * - * g, - * G, - * e, - * E, - * f, - * F - * - * - * - * - * - * @param array $args - * @return string Return array values as a formatted string according to - * format. - * @throws StringsException - * - */ -function vsprintf(string $format, array $args): string -{ - error_clear_last(); - $result = \vsprintf($format, $args); - if ($result === false) { - throw StringsException::createFromPhpError(); - } - return $result; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/swoole.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/swoole.php deleted file mode 100644 index 334d96bd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/generated/swoole.php +++ /dev/null @@ -1,108 +0,0 @@ -format('Y-m-d H:i:s.u'), $datetime->getTimezone()); - } - - /** - * @param string $format - * @param string $time - * @param DateTimeZone|null $timezone - * @throws DatetimeException - */ - public static function createFromFormat($format, $time, $timezone = null): self - { - $datetime = parent::createFromFormat($format, $time, $timezone); - if ($datetime === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($datetime); - } - - /** - * @param DateTimeInterface $datetime2 The date to compare to. - * @param boolean $absolute [optional] Whether to return absolute difference. - * @return DateInterval The DateInterval object representing the difference between the two dates. - * @throws DatetimeException - */ - public function diff($datetime2, $absolute = false): DateInterval - { - /** @var \DateInterval|false $result */ - $result = parent::diff($datetime2, $absolute); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return $result; - } - - /** - * @param string $modify A date/time string. Valid formats are explained in Date and Time Formats. - * @return DateTime Returns the DateTime object for method chaining. - * @throws DatetimeException - */ - public function modify($modify): self - { - /** @var DateTime|false $result */ - $result = parent::modify($modify); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return $result; - } - - /** - * @param int $year - * @param int $month - * @param int $day - * @return DateTime - * @throws DatetimeException - */ - public function setDate($year, $month, $day): self - { - /** @var DateTime|false $result */ - $result = parent::setDate($year, $month, $day); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/DateTimeImmutable.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/DateTimeImmutable.php deleted file mode 100644 index 114ec3a3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/DateTimeImmutable.php +++ /dev/null @@ -1,262 +0,0 @@ -innerDateTime = new parent($time, $timezone); - } - - //switch between regular datetime and safe version - public static function createFromRegular(\DateTimeImmutable $datetime): self - { - $safeDatetime = new self($datetime->format('Y-m-d H:i:s.u'), $datetime->getTimezone()); //we need to also update the wrapper to not break the operators '<' and '>' - $safeDatetime->innerDateTime = $datetime; //to make sure we don't lose information because of the format(). - return $safeDatetime; - } - - //usefull if you need to switch back to regular DateTimeImmutable (for example when using DatePeriod) - public function getInnerDateTime(): \DateTimeImmutable - { - return $this->innerDateTime; - } - - ///////////////////////////////////////////////////////////////////////////// - // overload functions with false errors - - /** - * @param string $format - * @param string $time - * @param DateTimeZone|null $timezone - * @throws DatetimeException - */ - public static function createFromFormat($format, $time, $timezone = null): self - { - $datetime = parent::createFromFormat($format, $time, $timezone); - if ($datetime === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($datetime); - } - - /** - * @param string $format - * @return string - * @throws DatetimeException - */ - public function format($format): string - { - /** @var string|false $result */ - $result = $this->innerDateTime->format($format); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return $result; - } - - /** - * @param DateTimeInterface $datetime2 - * @param bool $absolute - * @return DateInterval - * @throws DatetimeException - */ - public function diff($datetime2, $absolute = false): DateInterval - { - /** @var \DateInterval|false $result */ - $result = $this->innerDateTime->diff($datetime2, $absolute); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return $result; - } - - /** - * @param string $modify - * @return DateTimeImmutable - * @throws DatetimeException - */ - public function modify($modify): self - { - /** @var \DateTimeImmutable|false $result */ - $result = $this->innerDateTime->modify($modify); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($result); //we have to recreate a safe datetime because modify create a new instance of \DateTimeImmutable - } - - /** - * @param int $year - * @param int $month - * @param int $day - * @return DateTimeImmutable - * @throws DatetimeException - */ - public function setDate($year, $month, $day): self - { - /** @var \DateTimeImmutable|false $result */ - $result = $this->innerDateTime->setDate($year, $month, $day); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($result); //we have to recreate a safe datetime because modify create a new instance of \DateTimeImmutable - } - - /** - * @param int $year - * @param int $week - * @param int $day - * @return DateTimeImmutable - * @throws DatetimeException - */ - public function setISODate($year, $week, $day = 1): self - { - /** @var \DateTimeImmutable|false $result */ - $result = $this->innerDateTime->setISODate($year, $week, $day); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($result); //we have to recreate a safe datetime because modify create a new instance of \DateTimeImmutable - } - - /** - * @param int $hour - * @param int $minute - * @param int $second - * @param int $microseconds - * @return DateTimeImmutable - * @throws DatetimeException - */ - public function setTime($hour, $minute, $second = 0, $microseconds = 0): self - { - /** @var \DateTimeImmutable|false $result */ - $result = $this->innerDateTime->setTime($hour, $minute, $second, $microseconds); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($result); - } - - /** - * @param int $unixtimestamp - * @return DateTimeImmutable - * @throws DatetimeException - */ - public function setTimestamp($unixtimestamp): self - { - /** @var \DateTimeImmutable|false $result */ - $result = $this->innerDateTime->setTimestamp($unixtimestamp); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($result); - } - - /** - * @param DateTimeZone $timezone - * @return DateTimeImmutable - * @throws DatetimeException - */ - public function setTimezone($timezone): self - { - /** @var \DateTimeImmutable|false $result */ - $result = $this->innerDateTime->setTimezone($timezone); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($result); - } - - /** - * @param DateInterval $interval - * @return DateTimeImmutable - * @throws DatetimeException - */ - public function sub($interval): self - { - /** @var \DateTimeImmutable|false $result */ - $result = $this->innerDateTime->sub($interval); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return self::createFromRegular($result); - } - - /** - * @throws DatetimeException - */ - public function getOffset(): int - { - /** @var int|false $result */ - $result = $this->innerDateTime->getOffset(); - if ($result === false) { - throw DatetimeException::createFromPhpError(); - } - return $result; - } - - ////////////////////////////////////////////////////////////////////////////////////////// - //overload getters to use the inner datetime immutable instead of itself - - /** - * @param DateInterval $interval - * @return DateTimeImmutable - */ - public function add($interval): self - { - return self::createFromRegular($this->innerDateTime->add($interval)); - } - - /** - * @param DateTime $dateTime - * @return DateTimeImmutable - */ - public static function createFromMutable($dateTime): self - { - return self::createFromRegular(parent::createFromMutable($dateTime)); - } - - /** - * @param mixed[] $array - * @return DateTimeImmutable - */ - public static function __set_state($array): self - { - return self::createFromRegular(parent::__set_state($array)); - } - - public function getTimezone(): DateTimeZone - { - return $this->innerDateTime->getTimezone(); - } - - public function getTimestamp(): int - { - return $this->innerDateTime->getTimestamp(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php deleted file mode 100644 index 2814066b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php +++ /dev/null @@ -1,15 +0,0 @@ - 'PREG_INTERNAL_ERROR: Internal error', - PREG_BACKTRACK_LIMIT_ERROR => 'PREG_BACKTRACK_LIMIT_ERROR: Backtrack limit reached', - PREG_RECURSION_LIMIT_ERROR => 'PREG_RECURSION_LIMIT_ERROR: Recursion limit reached', - PREG_BAD_UTF8_ERROR => 'PREG_BAD_UTF8_ERROR: Invalid UTF8 character', - PREG_BAD_UTF8_OFFSET_ERROR => 'PREG_BAD_UTF8_OFFSET_ERROR', - PREG_JIT_STACKLIMIT_ERROR => 'PREG_JIT_STACKLIMIT_ERROR', - ]; - $errMsg = $errorMap[preg_last_error()] ?? 'Unknown PCRE error: '.preg_last_error(); - return new self($errMsg, \preg_last_error()); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php deleted file mode 100644 index fbea6ad2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/thecodingmachine/safe/lib/Exceptions/SafeExceptionInterface.php +++ /dev/null @@ -1,9 +0,0 @@ -services(); - - $services->set(RenameFunctionRector::class) - ->call('configure', [[ RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [ - 'apache_getenv' => 'Safe\apache_getenv', - 'apache_get_version' => 'Safe\apache_get_version', - 'apache_request_headers' => 'Safe\apache_request_headers', - 'apache_reset_timeout' => 'Safe\apache_reset_timeout', - 'apache_response_headers' => 'Safe\apache_response_headers', - 'apache_setenv' => 'Safe\apache_setenv', - 'apcu_cache_info' => 'Safe\apcu_cache_info', - 'apcu_cas' => 'Safe\apcu_cas', - 'apcu_dec' => 'Safe\apcu_dec', - 'apcu_fetch' => 'Safe\apcu_fetch', - 'apcu_inc' => 'Safe\apcu_inc', - 'apcu_sma_info' => 'Safe\apcu_sma_info', - 'apc_fetch' => 'Safe\apc_fetch', - 'array_combine' => 'Safe\array_combine', - 'array_flip' => 'Safe\array_flip', - 'array_replace' => 'Safe\array_replace', - 'array_replace_recursive' => 'Safe\array_replace_recursive', - 'array_walk_recursive' => 'Safe\array_walk_recursive', - 'arsort' => 'Safe\arsort', - 'asort' => 'Safe\asort', - 'base64_decode' => 'Safe\base64_decode', - 'bzclose' => 'Safe\bzclose', - 'bzflush' => 'Safe\bzflush', - 'bzread' => 'Safe\bzread', - 'bzwrite' => 'Safe\bzwrite', - 'chdir' => 'Safe\chdir', - 'chgrp' => 'Safe\chgrp', - 'chmod' => 'Safe\chmod', - 'chown' => 'Safe\chown', - 'chroot' => 'Safe\chroot', - 'class_alias' => 'Safe\class_alias', - 'class_implements' => 'Safe\class_implements', - 'class_parents' => 'Safe\class_parents', - 'class_uses' => 'Safe\class_uses', - 'cli_set_process_title' => 'Safe\cli_set_process_title', - 'closelog' => 'Safe\closelog', - 'com_event_sink' => 'Safe\com_event_sink', - 'com_load_typelib' => 'Safe\com_load_typelib', - 'com_print_typeinfo' => 'Safe\com_print_typeinfo', - 'convert_uudecode' => 'Safe\convert_uudecode', - 'convert_uuencode' => 'Safe\convert_uuencode', - 'copy' => 'Safe\copy', - 'create_function' => 'Safe\create_function', - 'cubrid_free_result' => 'Safe\cubrid_free_result', - 'cubrid_get_charset' => 'Safe\cubrid_get_charset', - 'cubrid_get_client_info' => 'Safe\cubrid_get_client_info', - 'cubrid_get_db_parameter' => 'Safe\cubrid_get_db_parameter', - 'cubrid_get_server_info' => 'Safe\cubrid_get_server_info', - 'cubrid_insert_id' => 'Safe\cubrid_insert_id', - 'cubrid_lob2_new' => 'Safe\cubrid_lob2_new', - 'cubrid_lob2_size' => 'Safe\cubrid_lob2_size', - 'cubrid_lob2_size64' => 'Safe\cubrid_lob2_size64', - 'cubrid_lob2_tell' => 'Safe\cubrid_lob2_tell', - 'cubrid_lob2_tell64' => 'Safe\cubrid_lob2_tell64', - 'cubrid_set_db_parameter' => 'Safe\cubrid_set_db_parameter', - 'curl_escape' => 'Safe\curl_escape', - 'curl_exec' => 'Safe\curl_exec', - 'curl_getinfo' => 'Safe\curl_getinfo', - 'curl_init' => 'Safe\curl_init', - 'curl_multi_errno' => 'Safe\curl_multi_errno', - 'curl_multi_info_read' => 'Safe\curl_multi_info_read', - 'curl_multi_init' => 'Safe\curl_multi_init', - 'curl_setopt' => 'Safe\curl_setopt', - 'curl_share_errno' => 'Safe\curl_share_errno', - 'curl_share_setopt' => 'Safe\curl_share_setopt', - 'curl_unescape' => 'Safe\curl_unescape', - 'date' => 'Safe\date', - 'date_parse' => 'Safe\date_parse', - 'date_parse_from_format' => 'Safe\date_parse_from_format', - 'date_sunrise' => 'Safe\date_sunrise', - 'date_sunset' => 'Safe\date_sunset', - 'date_sun_info' => 'Safe\date_sun_info', - 'db2_autocommit' => 'Safe\db2_autocommit', - 'db2_bind_param' => 'Safe\db2_bind_param', - 'db2_client_info' => 'Safe\db2_client_info', - 'db2_close' => 'Safe\db2_close', - 'db2_commit' => 'Safe\db2_commit', - 'db2_execute' => 'Safe\db2_execute', - 'db2_free_result' => 'Safe\db2_free_result', - 'db2_free_stmt' => 'Safe\db2_free_stmt', - 'db2_get_option' => 'Safe\db2_get_option', - 'db2_pclose' => 'Safe\db2_pclose', - 'db2_rollback' => 'Safe\db2_rollback', - 'db2_server_info' => 'Safe\db2_server_info', - 'db2_set_option' => 'Safe\db2_set_option', - 'define' => 'Safe\define', - 'deflate_add' => 'Safe\deflate_add', - 'deflate_init' => 'Safe\deflate_init', - 'disk_free_space' => 'Safe\disk_free_space', - 'disk_total_space' => 'Safe\disk_total_space', - 'dl' => 'Safe\dl', - 'dns_get_record' => 'Safe\dns_get_record', - 'eio_busy' => 'Safe\eio_busy', - 'eio_chmod' => 'Safe\eio_chmod', - 'eio_chown' => 'Safe\eio_chown', - 'eio_close' => 'Safe\eio_close', - 'eio_custom' => 'Safe\eio_custom', - 'eio_dup2' => 'Safe\eio_dup2', - 'eio_event_loop' => 'Safe\eio_event_loop', - 'eio_fallocate' => 'Safe\eio_fallocate', - 'eio_fchmod' => 'Safe\eio_fchmod', - 'eio_fdatasync' => 'Safe\eio_fdatasync', - 'eio_fstat' => 'Safe\eio_fstat', - 'eio_fstatvfs' => 'Safe\eio_fstatvfs', - 'eio_fsync' => 'Safe\eio_fsync', - 'eio_ftruncate' => 'Safe\eio_ftruncate', - 'eio_futime' => 'Safe\eio_futime', - 'eio_grp' => 'Safe\eio_grp', - 'eio_lstat' => 'Safe\eio_lstat', - 'eio_mkdir' => 'Safe\eio_mkdir', - 'eio_mknod' => 'Safe\eio_mknod', - 'eio_nop' => 'Safe\eio_nop', - 'eio_readahead' => 'Safe\eio_readahead', - 'eio_readdir' => 'Safe\eio_readdir', - 'eio_readlink' => 'Safe\eio_readlink', - 'eio_rename' => 'Safe\eio_rename', - 'eio_rmdir' => 'Safe\eio_rmdir', - 'eio_seek' => 'Safe\eio_seek', - 'eio_sendfile' => 'Safe\eio_sendfile', - 'eio_stat' => 'Safe\eio_stat', - 'eio_statvfs' => 'Safe\eio_statvfs', - 'eio_symlink' => 'Safe\eio_symlink', - 'eio_sync' => 'Safe\eio_sync', - 'eio_syncfs' => 'Safe\eio_syncfs', - 'eio_sync_file_range' => 'Safe\eio_sync_file_range', - 'eio_truncate' => 'Safe\eio_truncate', - 'eio_unlink' => 'Safe\eio_unlink', - 'eio_utime' => 'Safe\eio_utime', - 'eio_write' => 'Safe\eio_write', - 'error_log' => 'Safe\error_log', - 'fastcgi_finish_request' => 'Safe\fastcgi_finish_request', - 'fbird_blob_cancel' => 'Safe\fbird_blob_cancel', - 'fclose' => 'Safe\fclose', - 'fflush' => 'Safe\fflush', - 'file' => 'Safe\file', - 'fileatime' => 'Safe\fileatime', - 'filectime' => 'Safe\filectime', - 'fileinode' => 'Safe\fileinode', - 'filemtime' => 'Safe\filemtime', - 'fileowner' => 'Safe\fileowner', - 'filesize' => 'Safe\filesize', - 'file_get_contents' => 'Safe\file_get_contents', - 'file_put_contents' => 'Safe\file_put_contents', - 'filter_input_array' => 'Safe\filter_input_array', - 'filter_var_array' => 'Safe\filter_var_array', - 'finfo_close' => 'Safe\finfo_close', - 'finfo_open' => 'Safe\finfo_open', - 'flock' => 'Safe\flock', - 'fopen' => 'Safe\fopen', - 'fputcsv' => 'Safe\fputcsv', - 'fread' => 'Safe\fread', - 'fsockopen' => 'Safe\fsockopen', - 'ftp_alloc' => 'Safe\ftp_alloc', - 'ftp_append' => 'Safe\ftp_append', - 'ftp_cdup' => 'Safe\ftp_cdup', - 'ftp_chdir' => 'Safe\ftp_chdir', - 'ftp_chmod' => 'Safe\ftp_chmod', - 'ftp_close' => 'Safe\ftp_close', - 'ftp_connect' => 'Safe\ftp_connect', - 'ftp_delete' => 'Safe\ftp_delete', - 'ftp_fget' => 'Safe\ftp_fget', - 'ftp_fput' => 'Safe\ftp_fput', - 'ftp_get' => 'Safe\ftp_get', - 'ftp_login' => 'Safe\ftp_login', - 'ftp_mkdir' => 'Safe\ftp_mkdir', - 'ftp_mlsd' => 'Safe\ftp_mlsd', - 'ftp_nlist' => 'Safe\ftp_nlist', - 'ftp_pasv' => 'Safe\ftp_pasv', - 'ftp_put' => 'Safe\ftp_put', - 'ftp_pwd' => 'Safe\ftp_pwd', - 'ftp_rename' => 'Safe\ftp_rename', - 'ftp_rmdir' => 'Safe\ftp_rmdir', - 'ftp_site' => 'Safe\ftp_site', - 'ftp_ssl_connect' => 'Safe\ftp_ssl_connect', - 'ftp_systype' => 'Safe\ftp_systype', - 'ftruncate' => 'Safe\ftruncate', - 'fwrite' => 'Safe\fwrite', - 'getallheaders' => 'Safe\getallheaders', - 'getcwd' => 'Safe\getcwd', - 'gethostname' => 'Safe\gethostname', - 'getimagesize' => 'Safe\getimagesize', - 'getlastmod' => 'Safe\getlastmod', - 'getmygid' => 'Safe\getmygid', - 'getmyinode' => 'Safe\getmyinode', - 'getmypid' => 'Safe\getmypid', - 'getmyuid' => 'Safe\getmyuid', - 'getopt' => 'Safe\getopt', - 'getprotobyname' => 'Safe\getprotobyname', - 'getprotobynumber' => 'Safe\getprotobynumber', - 'get_headers' => 'Safe\get_headers', - 'glob' => 'Safe\glob', - 'gmdate' => 'Safe\gmdate', - 'gmp_binomial' => 'Safe\gmp_binomial', - 'gmp_export' => 'Safe\gmp_export', - 'gmp_import' => 'Safe\gmp_import', - 'gmp_random_seed' => 'Safe\gmp_random_seed', - 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', - 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', - 'gnupg_addsignkey' => 'Safe\gnupg_addsignkey', - 'gnupg_cleardecryptkeys' => 'Safe\gnupg_cleardecryptkeys', - 'gnupg_clearencryptkeys' => 'Safe\gnupg_clearencryptkeys', - 'gnupg_clearsignkeys' => 'Safe\gnupg_clearsignkeys', - 'gnupg_setarmor' => 'Safe\gnupg_setarmor', - 'gnupg_setsignmode' => 'Safe\gnupg_setsignmode', - 'gzclose' => 'Safe\gzclose', - 'gzcompress' => 'Safe\gzcompress', - 'gzdecode' => 'Safe\gzdecode', - 'gzdeflate' => 'Safe\gzdeflate', - 'gzencode' => 'Safe\gzencode', - 'gzgets' => 'Safe\gzgets', - 'gzgetss' => 'Safe\gzgetss', - 'gzinflate' => 'Safe\gzinflate', - 'gzpassthru' => 'Safe\gzpassthru', - 'gzrewind' => 'Safe\gzrewind', - 'gzuncompress' => 'Safe\gzuncompress', - 'hash_hkdf' => 'Safe\hash_hkdf', - 'hash_update_file' => 'Safe\hash_update_file', - 'header_register_callback' => 'Safe\header_register_callback', - 'hex2bin' => 'Safe\hex2bin', - 'highlight_file' => 'Safe\highlight_file', - 'highlight_string' => 'Safe\highlight_string', - 'ibase_add_user' => 'Safe\ibase_add_user', - 'ibase_backup' => 'Safe\ibase_backup', - 'ibase_blob_cancel' => 'Safe\ibase_blob_cancel', - 'ibase_blob_create' => 'Safe\ibase_blob_create', - 'ibase_blob_get' => 'Safe\ibase_blob_get', - 'ibase_close' => 'Safe\ibase_close', - 'ibase_commit' => 'Safe\ibase_commit', - 'ibase_commit_ret' => 'Safe\ibase_commit_ret', - 'ibase_connect' => 'Safe\ibase_connect', - 'ibase_delete_user' => 'Safe\ibase_delete_user', - 'ibase_drop_db' => 'Safe\ibase_drop_db', - 'ibase_free_event_handler' => 'Safe\ibase_free_event_handler', - 'ibase_free_query' => 'Safe\ibase_free_query', - 'ibase_free_result' => 'Safe\ibase_free_result', - 'ibase_maintain_db' => 'Safe\ibase_maintain_db', - 'ibase_modify_user' => 'Safe\ibase_modify_user', - 'ibase_name_result' => 'Safe\ibase_name_result', - 'ibase_pconnect' => 'Safe\ibase_pconnect', - 'ibase_restore' => 'Safe\ibase_restore', - 'ibase_rollback' => 'Safe\ibase_rollback', - 'ibase_rollback_ret' => 'Safe\ibase_rollback_ret', - 'ibase_service_attach' => 'Safe\ibase_service_attach', - 'ibase_service_detach' => 'Safe\ibase_service_detach', - 'iconv' => 'Safe\iconv', - 'iconv_get_encoding' => 'Safe\iconv_get_encoding', - 'iconv_set_encoding' => 'Safe\iconv_set_encoding', - 'image2wbmp' => 'Safe\image2wbmp', - 'imageaffine' => 'Safe\imageaffine', - 'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat', - 'imageaffinematrixget' => 'Safe\imageaffinematrixget', - 'imagealphablending' => 'Safe\imagealphablending', - 'imageantialias' => 'Safe\imageantialias', - 'imagearc' => 'Safe\imagearc', - 'imagebmp' => 'Safe\imagebmp', - 'imagechar' => 'Safe\imagechar', - 'imagecharup' => 'Safe\imagecharup', - 'imagecolorat' => 'Safe\imagecolorat', - 'imagecolordeallocate' => 'Safe\imagecolordeallocate', - 'imagecolormatch' => 'Safe\imagecolormatch', - 'imageconvolution' => 'Safe\imageconvolution', - 'imagecopy' => 'Safe\imagecopy', - 'imagecopymerge' => 'Safe\imagecopymerge', - 'imagecopymergegray' => 'Safe\imagecopymergegray', - 'imagecopyresampled' => 'Safe\imagecopyresampled', - 'imagecopyresized' => 'Safe\imagecopyresized', - 'imagecreate' => 'Safe\imagecreate', - 'imagecreatefrombmp' => 'Safe\imagecreatefrombmp', - 'imagecreatefromgd' => 'Safe\imagecreatefromgd', - 'imagecreatefromgd2' => 'Safe\imagecreatefromgd2', - 'imagecreatefromgd2part' => 'Safe\imagecreatefromgd2part', - 'imagecreatefromgif' => 'Safe\imagecreatefromgif', - 'imagecreatefromjpeg' => 'Safe\imagecreatefromjpeg', - 'imagecreatefrompng' => 'Safe\imagecreatefrompng', - 'imagecreatefromwbmp' => 'Safe\imagecreatefromwbmp', - 'imagecreatefromwebp' => 'Safe\imagecreatefromwebp', - 'imagecreatefromxbm' => 'Safe\imagecreatefromxbm', - 'imagecreatefromxpm' => 'Safe\imagecreatefromxpm', - 'imagecreatetruecolor' => 'Safe\imagecreatetruecolor', - 'imagecrop' => 'Safe\imagecrop', - 'imagecropauto' => 'Safe\imagecropauto', - 'imagedashedline' => 'Safe\imagedashedline', - 'imagedestroy' => 'Safe\imagedestroy', - 'imageellipse' => 'Safe\imageellipse', - 'imagefill' => 'Safe\imagefill', - 'imagefilledarc' => 'Safe\imagefilledarc', - 'imagefilledellipse' => 'Safe\imagefilledellipse', - 'imagefilledpolygon' => 'Safe\imagefilledpolygon', - 'imagefilledrectangle' => 'Safe\imagefilledrectangle', - 'imagefilltoborder' => 'Safe\imagefilltoborder', - 'imagefilter' => 'Safe\imagefilter', - 'imageflip' => 'Safe\imageflip', - 'imagegammacorrect' => 'Safe\imagegammacorrect', - 'imagegd' => 'Safe\imagegd', - 'imagegd2' => 'Safe\imagegd2', - 'imagegif' => 'Safe\imagegif', - 'imagegrabscreen' => 'Safe\imagegrabscreen', - 'imagegrabwindow' => 'Safe\imagegrabwindow', - 'imagejpeg' => 'Safe\imagejpeg', - 'imagelayereffect' => 'Safe\imagelayereffect', - 'imageline' => 'Safe\imageline', - 'imageloadfont' => 'Safe\imageloadfont', - 'imageopenpolygon' => 'Safe\imageopenpolygon', - 'imagepng' => 'Safe\imagepng', - 'imagepolygon' => 'Safe\imagepolygon', - 'imagerectangle' => 'Safe\imagerectangle', - 'imagerotate' => 'Safe\imagerotate', - 'imagesavealpha' => 'Safe\imagesavealpha', - 'imagescale' => 'Safe\imagescale', - 'imagesetbrush' => 'Safe\imagesetbrush', - 'imagesetclip' => 'Safe\imagesetclip', - 'imagesetinterpolation' => 'Safe\imagesetinterpolation', - 'imagesetpixel' => 'Safe\imagesetpixel', - 'imagesetstyle' => 'Safe\imagesetstyle', - 'imagesetthickness' => 'Safe\imagesetthickness', - 'imagesettile' => 'Safe\imagesettile', - 'imagestring' => 'Safe\imagestring', - 'imagestringup' => 'Safe\imagestringup', - 'imagesx' => 'Safe\imagesx', - 'imagesy' => 'Safe\imagesy', - 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', - 'imagettfbbox' => 'Safe\imagettfbbox', - 'imagettftext' => 'Safe\imagettftext', - 'imagewbmp' => 'Safe\imagewbmp', - 'imagewebp' => 'Safe\imagewebp', - 'imagexbm' => 'Safe\imagexbm', - 'imap_append' => 'Safe\imap_append', - 'imap_check' => 'Safe\imap_check', - 'imap_clearflag_full' => 'Safe\imap_clearflag_full', - 'imap_close' => 'Safe\imap_close', - 'imap_createmailbox' => 'Safe\imap_createmailbox', - 'imap_deletemailbox' => 'Safe\imap_deletemailbox', - 'imap_fetchstructure' => 'Safe\imap_fetchstructure', - 'imap_gc' => 'Safe\imap_gc', - 'imap_headerinfo' => 'Safe\imap_headerinfo', - 'imap_mail' => 'Safe\imap_mail', - 'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo', - 'imap_mail_compose' => 'Safe\imap_mail_compose', - 'imap_mail_copy' => 'Safe\imap_mail_copy', - 'imap_mail_move' => 'Safe\imap_mail_move', - 'imap_mutf7_to_utf8' => 'Safe\imap_mutf7_to_utf8', - 'imap_num_msg' => 'Safe\imap_num_msg', - 'imap_open' => 'Safe\imap_open', - 'imap_renamemailbox' => 'Safe\imap_renamemailbox', - 'imap_savebody' => 'Safe\imap_savebody', - 'imap_setacl' => 'Safe\imap_setacl', - 'imap_setflag_full' => 'Safe\imap_setflag_full', - 'imap_set_quota' => 'Safe\imap_set_quota', - 'imap_sort' => 'Safe\imap_sort', - 'imap_subscribe' => 'Safe\imap_subscribe', - 'imap_thread' => 'Safe\imap_thread', - 'imap_timeout' => 'Safe\imap_timeout', - 'imap_undelete' => 'Safe\imap_undelete', - 'imap_unsubscribe' => 'Safe\imap_unsubscribe', - 'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7', - 'inet_ntop' => 'Safe\inet_ntop', - 'inflate_add' => 'Safe\inflate_add', - 'inflate_get_read_len' => 'Safe\inflate_get_read_len', - 'inflate_get_status' => 'Safe\inflate_get_status', - 'inflate_init' => 'Safe\inflate_init', - 'ingres_autocommit' => 'Safe\ingres_autocommit', - 'ingres_close' => 'Safe\ingres_close', - 'ingres_commit' => 'Safe\ingres_commit', - 'ingres_connect' => 'Safe\ingres_connect', - 'ingres_execute' => 'Safe\ingres_execute', - 'ingres_field_name' => 'Safe\ingres_field_name', - 'ingres_field_type' => 'Safe\ingres_field_type', - 'ingres_free_result' => 'Safe\ingres_free_result', - 'ingres_pconnect' => 'Safe\ingres_pconnect', - 'ingres_result_seek' => 'Safe\ingres_result_seek', - 'ingres_rollback' => 'Safe\ingres_rollback', - 'ingres_set_environment' => 'Safe\ingres_set_environment', - 'ini_get' => 'Safe\ini_get', - 'ini_set' => 'Safe\ini_set', - 'inotify_init' => 'Safe\inotify_init', - 'inotify_rm_watch' => 'Safe\inotify_rm_watch', - 'iptcembed' => 'Safe\iptcembed', - 'iptcparse' => 'Safe\iptcparse', - 'jdtounix' => 'Safe\jdtounix', - 'jpeg2wbmp' => 'Safe\jpeg2wbmp', - 'json_decode' => 'Safe\json_decode', - 'json_encode' => 'Safe\json_encode', - 'json_last_error_msg' => 'Safe\json_last_error_msg', - 'krsort' => 'Safe\krsort', - 'ksort' => 'Safe\ksort', - 'lchgrp' => 'Safe\lchgrp', - 'lchown' => 'Safe\lchown', - 'ldap_add' => 'Safe\ldap_add', - 'ldap_add_ext' => 'Safe\ldap_add_ext', - 'ldap_bind' => 'Safe\ldap_bind', - 'ldap_bind_ext' => 'Safe\ldap_bind_ext', - 'ldap_control_paged_result' => 'Safe\ldap_control_paged_result', - 'ldap_control_paged_result_response' => 'Safe\ldap_control_paged_result_response', - 'ldap_count_entries' => 'Safe\ldap_count_entries', - 'ldap_delete' => 'Safe\ldap_delete', - 'ldap_delete_ext' => 'Safe\ldap_delete_ext', - 'ldap_exop' => 'Safe\ldap_exop', - 'ldap_exop_passwd' => 'Safe\ldap_exop_passwd', - 'ldap_exop_whoami' => 'Safe\ldap_exop_whoami', - 'ldap_explode_dn' => 'Safe\ldap_explode_dn', - 'ldap_first_attribute' => 'Safe\ldap_first_attribute', - 'ldap_first_entry' => 'Safe\ldap_first_entry', - 'ldap_free_result' => 'Safe\ldap_free_result', - 'ldap_get_attributes' => 'Safe\ldap_get_attributes', - 'ldap_get_dn' => 'Safe\ldap_get_dn', - 'ldap_get_entries' => 'Safe\ldap_get_entries', - 'ldap_get_option' => 'Safe\ldap_get_option', - 'ldap_get_values' => 'Safe\ldap_get_values', - 'ldap_get_values_len' => 'Safe\ldap_get_values_len', - 'ldap_list' => 'Safe\ldap_list', - 'ldap_modify_batch' => 'Safe\ldap_modify_batch', - 'ldap_mod_add' => 'Safe\ldap_mod_add', - 'ldap_mod_add_ext' => 'Safe\ldap_mod_add_ext', - 'ldap_mod_del' => 'Safe\ldap_mod_del', - 'ldap_mod_del_ext' => 'Safe\ldap_mod_del_ext', - 'ldap_mod_replace' => 'Safe\ldap_mod_replace', - 'ldap_mod_replace_ext' => 'Safe\ldap_mod_replace_ext', - 'ldap_next_attribute' => 'Safe\ldap_next_attribute', - 'ldap_parse_exop' => 'Safe\ldap_parse_exop', - 'ldap_parse_result' => 'Safe\ldap_parse_result', - 'ldap_read' => 'Safe\ldap_read', - 'ldap_rename' => 'Safe\ldap_rename', - 'ldap_rename_ext' => 'Safe\ldap_rename_ext', - 'ldap_sasl_bind' => 'Safe\ldap_sasl_bind', - 'ldap_search' => 'Safe\ldap_search', - 'ldap_set_option' => 'Safe\ldap_set_option', - 'ldap_unbind' => 'Safe\ldap_unbind', - 'libxml_get_last_error' => 'Safe\libxml_get_last_error', - 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', - 'link' => 'Safe\link', - 'lzf_compress' => 'Safe\lzf_compress', - 'lzf_decompress' => 'Safe\lzf_decompress', - 'mailparse_msg_extract_part_file' => 'Safe\mailparse_msg_extract_part_file', - 'mailparse_msg_free' => 'Safe\mailparse_msg_free', - 'mailparse_msg_parse' => 'Safe\mailparse_msg_parse', - 'mailparse_msg_parse_file' => 'Safe\mailparse_msg_parse_file', - 'mailparse_stream_encode' => 'Safe\mailparse_stream_encode', - 'mb_chr' => 'Safe\mb_chr', - 'mb_detect_order' => 'Safe\mb_detect_order', - 'mb_encoding_aliases' => 'Safe\mb_encoding_aliases', - 'mb_eregi_replace' => 'Safe\mb_eregi_replace', - 'mb_ereg_replace' => 'Safe\mb_ereg_replace', - 'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback', - 'mb_ereg_search_getregs' => 'Safe\mb_ereg_search_getregs', - 'mb_ereg_search_init' => 'Safe\mb_ereg_search_init', - 'mb_ereg_search_regs' => 'Safe\mb_ereg_search_regs', - 'mb_ereg_search_setpos' => 'Safe\mb_ereg_search_setpos', - 'mb_http_output' => 'Safe\mb_http_output', - 'mb_internal_encoding' => 'Safe\mb_internal_encoding', - 'mb_ord' => 'Safe\mb_ord', - 'mb_parse_str' => 'Safe\mb_parse_str', - 'mb_regex_encoding' => 'Safe\mb_regex_encoding', - 'mb_send_mail' => 'Safe\mb_send_mail', - 'mb_split' => 'Safe\mb_split', - 'mb_str_split' => 'Safe\mb_str_split', - 'md5_file' => 'Safe\md5_file', - 'metaphone' => 'Safe\metaphone', - 'mime_content_type' => 'Safe\mime_content_type', - 'mkdir' => 'Safe\mkdir', - 'mktime' => 'Safe\mktime', - 'msg_queue_exists' => 'Safe\msg_queue_exists', - 'msg_receive' => 'Safe\msg_receive', - 'msg_remove_queue' => 'Safe\msg_remove_queue', - 'msg_send' => 'Safe\msg_send', - 'msg_set_queue' => 'Safe\msg_set_queue', - 'msql_affected_rows' => 'Safe\msql_affected_rows', - 'msql_close' => 'Safe\msql_close', - 'msql_connect' => 'Safe\msql_connect', - 'msql_create_db' => 'Safe\msql_create_db', - 'msql_data_seek' => 'Safe\msql_data_seek', - 'msql_db_query' => 'Safe\msql_db_query', - 'msql_drop_db' => 'Safe\msql_drop_db', - 'msql_field_len' => 'Safe\msql_field_len', - 'msql_field_name' => 'Safe\msql_field_name', - 'msql_field_seek' => 'Safe\msql_field_seek', - 'msql_field_table' => 'Safe\msql_field_table', - 'msql_field_type' => 'Safe\msql_field_type', - 'msql_free_result' => 'Safe\msql_free_result', - 'msql_pconnect' => 'Safe\msql_pconnect', - 'msql_query' => 'Safe\msql_query', - 'msql_select_db' => 'Safe\msql_select_db', - 'mysqli_get_cache_stats' => 'Safe\mysqli_get_cache_stats', - 'mysqli_get_client_stats' => 'Safe\mysqli_get_client_stats', - 'mysqlnd_ms_dump_servers' => 'Safe\mysqlnd_ms_dump_servers', - 'mysqlnd_ms_fabric_select_global' => 'Safe\mysqlnd_ms_fabric_select_global', - 'mysqlnd_ms_fabric_select_shard' => 'Safe\mysqlnd_ms_fabric_select_shard', - 'mysqlnd_ms_get_last_used_connection' => 'Safe\mysqlnd_ms_get_last_used_connection', - 'mysqlnd_qc_clear_cache' => 'Safe\mysqlnd_qc_clear_cache', - 'mysqlnd_qc_set_is_select' => 'Safe\mysqlnd_qc_set_is_select', - 'mysqlnd_qc_set_storage_handler' => 'Safe\mysqlnd_qc_set_storage_handler', - 'mysql_close' => 'Safe\mysql_close', - 'mysql_connect' => 'Safe\mysql_connect', - 'mysql_create_db' => 'Safe\mysql_create_db', - 'mysql_data_seek' => 'Safe\mysql_data_seek', - 'mysql_db_name' => 'Safe\mysql_db_name', - 'mysql_db_query' => 'Safe\mysql_db_query', - 'mysql_drop_db' => 'Safe\mysql_drop_db', - 'mysql_fetch_lengths' => 'Safe\mysql_fetch_lengths', - 'mysql_field_flags' => 'Safe\mysql_field_flags', - 'mysql_field_len' => 'Safe\mysql_field_len', - 'mysql_field_name' => 'Safe\mysql_field_name', - 'mysql_field_seek' => 'Safe\mysql_field_seek', - 'mysql_free_result' => 'Safe\mysql_free_result', - 'mysql_get_host_info' => 'Safe\mysql_get_host_info', - 'mysql_get_proto_info' => 'Safe\mysql_get_proto_info', - 'mysql_get_server_info' => 'Safe\mysql_get_server_info', - 'mysql_info' => 'Safe\mysql_info', - 'mysql_list_dbs' => 'Safe\mysql_list_dbs', - 'mysql_list_fields' => 'Safe\mysql_list_fields', - 'mysql_list_processes' => 'Safe\mysql_list_processes', - 'mysql_list_tables' => 'Safe\mysql_list_tables', - 'mysql_num_fields' => 'Safe\mysql_num_fields', - 'mysql_num_rows' => 'Safe\mysql_num_rows', - 'mysql_query' => 'Safe\mysql_query', - 'mysql_real_escape_string' => 'Safe\mysql_real_escape_string', - 'mysql_result' => 'Safe\mysql_result', - 'mysql_select_db' => 'Safe\mysql_select_db', - 'mysql_set_charset' => 'Safe\mysql_set_charset', - 'mysql_tablename' => 'Safe\mysql_tablename', - 'mysql_thread_id' => 'Safe\mysql_thread_id', - 'mysql_unbuffered_query' => 'Safe\mysql_unbuffered_query', - 'natcasesort' => 'Safe\natcasesort', - 'natsort' => 'Safe\natsort', - 'ob_end_clean' => 'Safe\ob_end_clean', - 'ob_end_flush' => 'Safe\ob_end_flush', - 'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name', - 'oci_bind_by_name' => 'Safe\oci_bind_by_name', - 'oci_cancel' => 'Safe\oci_cancel', - 'oci_close' => 'Safe\oci_close', - 'oci_commit' => 'Safe\oci_commit', - 'oci_connect' => 'Safe\oci_connect', - 'oci_define_by_name' => 'Safe\oci_define_by_name', - 'oci_execute' => 'Safe\oci_execute', - 'oci_fetch_all' => 'Safe\oci_fetch_all', - 'oci_field_name' => 'Safe\oci_field_name', - 'oci_field_precision' => 'Safe\oci_field_precision', - 'oci_field_scale' => 'Safe\oci_field_scale', - 'oci_field_size' => 'Safe\oci_field_size', - 'oci_field_type' => 'Safe\oci_field_type', - 'oci_field_type_raw' => 'Safe\oci_field_type_raw', - 'oci_free_descriptor' => 'Safe\oci_free_descriptor', - 'oci_free_statement' => 'Safe\oci_free_statement', - 'oci_new_collection' => 'Safe\oci_new_collection', - 'oci_new_connect' => 'Safe\oci_new_connect', - 'oci_new_cursor' => 'Safe\oci_new_cursor', - 'oci_new_descriptor' => 'Safe\oci_new_descriptor', - 'oci_num_fields' => 'Safe\oci_num_fields', - 'oci_num_rows' => 'Safe\oci_num_rows', - 'oci_parse' => 'Safe\oci_parse', - 'oci_pconnect' => 'Safe\oci_pconnect', - 'oci_result' => 'Safe\oci_result', - 'oci_rollback' => 'Safe\oci_rollback', - 'oci_server_version' => 'Safe\oci_server_version', - 'oci_set_action' => 'Safe\oci_set_action', - 'oci_set_call_timeout' => 'Safe\oci_set_call_timeout', - 'oci_set_client_identifier' => 'Safe\oci_set_client_identifier', - 'oci_set_client_info' => 'Safe\oci_set_client_info', - 'oci_set_db_operation' => 'Safe\oci_set_db_operation', - 'oci_set_edition' => 'Safe\oci_set_edition', - 'oci_set_module_name' => 'Safe\oci_set_module_name', - 'oci_set_prefetch' => 'Safe\oci_set_prefetch', - 'oci_statement_type' => 'Safe\oci_statement_type', - 'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback', - 'odbc_autocommit' => 'Safe\odbc_autocommit', - 'odbc_binmode' => 'Safe\odbc_binmode', - 'odbc_columnprivileges' => 'Safe\odbc_columnprivileges', - 'odbc_columns' => 'Safe\odbc_columns', - 'odbc_commit' => 'Safe\odbc_commit', - 'odbc_data_source' => 'Safe\odbc_data_source', - 'odbc_exec' => 'Safe\odbc_exec', - 'odbc_execute' => 'Safe\odbc_execute', - 'odbc_fetch_into' => 'Safe\odbc_fetch_into', - 'odbc_field_len' => 'Safe\odbc_field_len', - 'odbc_field_name' => 'Safe\odbc_field_name', - 'odbc_field_num' => 'Safe\odbc_field_num', - 'odbc_field_scale' => 'Safe\odbc_field_scale', - 'odbc_field_type' => 'Safe\odbc_field_type', - 'odbc_foreignkeys' => 'Safe\odbc_foreignkeys', - 'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo', - 'odbc_longreadlen' => 'Safe\odbc_longreadlen', - 'odbc_prepare' => 'Safe\odbc_prepare', - 'odbc_primarykeys' => 'Safe\odbc_primarykeys', - 'odbc_result' => 'Safe\odbc_result', - 'odbc_result_all' => 'Safe\odbc_result_all', - 'odbc_rollback' => 'Safe\odbc_rollback', - 'odbc_setoption' => 'Safe\odbc_setoption', - 'odbc_specialcolumns' => 'Safe\odbc_specialcolumns', - 'odbc_statistics' => 'Safe\odbc_statistics', - 'odbc_tableprivileges' => 'Safe\odbc_tableprivileges', - 'odbc_tables' => 'Safe\odbc_tables', - 'opcache_compile_file' => 'Safe\opcache_compile_file', - 'opcache_get_status' => 'Safe\opcache_get_status', - 'opendir' => 'Safe\opendir', - 'openlog' => 'Safe\openlog', - 'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length', - 'openssl_csr_export' => 'Safe\openssl_csr_export', - 'openssl_csr_export_to_file' => 'Safe\openssl_csr_export_to_file', - 'openssl_csr_get_subject' => 'Safe\openssl_csr_get_subject', - 'openssl_csr_new' => 'Safe\openssl_csr_new', - 'openssl_csr_sign' => 'Safe\openssl_csr_sign', - 'openssl_decrypt' => 'Safe\openssl_decrypt', - 'openssl_dh_compute_key' => 'Safe\openssl_dh_compute_key', - 'openssl_digest' => 'Safe\openssl_digest', - 'openssl_encrypt' => 'Safe\openssl_encrypt', - 'openssl_open' => 'Safe\openssl_open', - 'openssl_pbkdf2' => 'Safe\openssl_pbkdf2', - 'openssl_pkcs7_decrypt' => 'Safe\openssl_pkcs7_decrypt', - 'openssl_pkcs7_encrypt' => 'Safe\openssl_pkcs7_encrypt', - 'openssl_pkcs7_read' => 'Safe\openssl_pkcs7_read', - 'openssl_pkcs7_sign' => 'Safe\openssl_pkcs7_sign', - 'openssl_pkcs12_export' => 'Safe\openssl_pkcs12_export', - 'openssl_pkcs12_export_to_file' => 'Safe\openssl_pkcs12_export_to_file', - 'openssl_pkcs12_read' => 'Safe\openssl_pkcs12_read', - 'openssl_pkey_export' => 'Safe\openssl_pkey_export', - 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', - 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', - 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', - 'openssl_pkey_new' => 'Safe\openssl_pkey_new', - 'openssl_private_decrypt' => 'Safe\openssl_private_decrypt', - 'openssl_private_encrypt' => 'Safe\openssl_private_encrypt', - 'openssl_public_decrypt' => 'Safe\openssl_public_decrypt', - 'openssl_public_encrypt' => 'Safe\openssl_public_encrypt', - 'openssl_random_pseudo_bytes' => 'Safe\openssl_random_pseudo_bytes', - 'openssl_seal' => 'Safe\openssl_seal', - 'openssl_sign' => 'Safe\openssl_sign', - 'openssl_x509_export' => 'Safe\openssl_x509_export', - 'openssl_x509_export_to_file' => 'Safe\openssl_x509_export_to_file', - 'openssl_x509_fingerprint' => 'Safe\openssl_x509_fingerprint', - 'openssl_x509_read' => 'Safe\openssl_x509_read', - 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', - 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', - 'pack' => 'Safe\pack', - 'parse_ini_file' => 'Safe\parse_ini_file', - 'parse_ini_string' => 'Safe\parse_ini_string', - 'parse_url' => 'Safe\parse_url', - 'password_hash' => 'Safe\password_hash', - 'pcntl_exec' => 'Safe\pcntl_exec', - 'pcntl_getpriority' => 'Safe\pcntl_getpriority', - 'pcntl_setpriority' => 'Safe\pcntl_setpriority', - 'pcntl_signal_dispatch' => 'Safe\pcntl_signal_dispatch', - 'pcntl_sigprocmask' => 'Safe\pcntl_sigprocmask', - 'pcntl_strerror' => 'Safe\pcntl_strerror', - 'PDF_activate_item' => 'Safe\PDF_activate_item', - 'PDF_add_locallink' => 'Safe\PDF_add_locallink', - 'PDF_add_nameddest' => 'Safe\PDF_add_nameddest', - 'PDF_add_note' => 'Safe\PDF_add_note', - 'PDF_add_pdflink' => 'Safe\PDF_add_pdflink', - 'PDF_add_thumbnail' => 'Safe\PDF_add_thumbnail', - 'PDF_add_weblink' => 'Safe\PDF_add_weblink', - 'PDF_attach_file' => 'Safe\PDF_attach_file', - 'PDF_begin_layer' => 'Safe\PDF_begin_layer', - 'PDF_begin_page' => 'Safe\PDF_begin_page', - 'PDF_begin_page_ext' => 'Safe\PDF_begin_page_ext', - 'PDF_circle' => 'Safe\PDF_circle', - 'PDF_clip' => 'Safe\PDF_clip', - 'PDF_close' => 'Safe\PDF_close', - 'PDF_closepath' => 'Safe\PDF_closepath', - 'PDF_closepath_fill_stroke' => 'Safe\PDF_closepath_fill_stroke', - 'PDF_closepath_stroke' => 'Safe\PDF_closepath_stroke', - 'PDF_close_pdi' => 'Safe\PDF_close_pdi', - 'PDF_close_pdi_page' => 'Safe\PDF_close_pdi_page', - 'PDF_concat' => 'Safe\PDF_concat', - 'PDF_continue_text' => 'Safe\PDF_continue_text', - 'PDF_curveto' => 'Safe\PDF_curveto', - 'PDF_delete' => 'Safe\PDF_delete', - 'PDF_end_layer' => 'Safe\PDF_end_layer', - 'PDF_end_page' => 'Safe\PDF_end_page', - 'PDF_end_page_ext' => 'Safe\PDF_end_page_ext', - 'PDF_end_pattern' => 'Safe\PDF_end_pattern', - 'PDF_end_template' => 'Safe\PDF_end_template', - 'PDF_fill' => 'Safe\PDF_fill', - 'PDF_fill_stroke' => 'Safe\PDF_fill_stroke', - 'PDF_fit_image' => 'Safe\PDF_fit_image', - 'PDF_fit_pdi_page' => 'Safe\PDF_fit_pdi_page', - 'PDF_fit_textline' => 'Safe\PDF_fit_textline', - 'PDF_initgraphics' => 'Safe\PDF_initgraphics', - 'PDF_lineto' => 'Safe\PDF_lineto', - 'PDF_makespotcolor' => 'Safe\PDF_makespotcolor', - 'PDF_moveto' => 'Safe\PDF_moveto', - 'PDF_open_file' => 'Safe\PDF_open_file', - 'PDF_place_image' => 'Safe\PDF_place_image', - 'PDF_place_pdi_page' => 'Safe\PDF_place_pdi_page', - 'PDF_rect' => 'Safe\PDF_rect', - 'PDF_restore' => 'Safe\PDF_restore', - 'PDF_rotate' => 'Safe\PDF_rotate', - 'PDF_save' => 'Safe\PDF_save', - 'PDF_scale' => 'Safe\PDF_scale', - 'PDF_setcolor' => 'Safe\PDF_setcolor', - 'PDF_setdash' => 'Safe\PDF_setdash', - 'PDF_setdashpattern' => 'Safe\PDF_setdashpattern', - 'PDF_setflat' => 'Safe\PDF_setflat', - 'PDF_setfont' => 'Safe\PDF_setfont', - 'PDF_setgray' => 'Safe\PDF_setgray', - 'PDF_setgray_fill' => 'Safe\PDF_setgray_fill', - 'PDF_setgray_stroke' => 'Safe\PDF_setgray_stroke', - 'PDF_setlinejoin' => 'Safe\PDF_setlinejoin', - 'PDF_setlinewidth' => 'Safe\PDF_setlinewidth', - 'PDF_setmatrix' => 'Safe\PDF_setmatrix', - 'PDF_setmiterlimit' => 'Safe\PDF_setmiterlimit', - 'PDF_setrgbcolor' => 'Safe\PDF_setrgbcolor', - 'PDF_setrgbcolor_fill' => 'Safe\PDF_setrgbcolor_fill', - 'PDF_setrgbcolor_stroke' => 'Safe\PDF_setrgbcolor_stroke', - 'PDF_set_border_color' => 'Safe\PDF_set_border_color', - 'PDF_set_border_dash' => 'Safe\PDF_set_border_dash', - 'PDF_set_border_style' => 'Safe\PDF_set_border_style', - 'PDF_set_info' => 'Safe\PDF_set_info', - 'PDF_set_layer_dependency' => 'Safe\PDF_set_layer_dependency', - 'PDF_set_parameter' => 'Safe\PDF_set_parameter', - 'PDF_set_text_pos' => 'Safe\PDF_set_text_pos', - 'PDF_set_value' => 'Safe\PDF_set_value', - 'PDF_show' => 'Safe\PDF_show', - 'PDF_show_xy' => 'Safe\PDF_show_xy', - 'PDF_skew' => 'Safe\PDF_skew', - 'PDF_stroke' => 'Safe\PDF_stroke', - 'pg_cancel_query' => 'Safe\pg_cancel_query', - 'pg_client_encoding' => 'Safe\pg_client_encoding', - 'pg_close' => 'Safe\pg_close', - 'pg_connect' => 'Safe\pg_connect', - 'pg_connection_reset' => 'Safe\pg_connection_reset', - 'pg_convert' => 'Safe\pg_convert', - 'pg_copy_from' => 'Safe\pg_copy_from', - 'pg_copy_to' => 'Safe\pg_copy_to', - 'pg_dbname' => 'Safe\pg_dbname', - 'pg_delete' => 'Safe\pg_delete', - 'pg_end_copy' => 'Safe\pg_end_copy', - 'pg_execute' => 'Safe\pg_execute', - 'pg_field_name' => 'Safe\pg_field_name', - 'pg_field_table' => 'Safe\pg_field_table', - 'pg_field_type' => 'Safe\pg_field_type', - 'pg_flush' => 'Safe\pg_flush', - 'pg_free_result' => 'Safe\pg_free_result', - 'pg_host' => 'Safe\pg_host', - 'pg_insert' => 'Safe\pg_insert', - 'pg_last_error' => 'Safe\pg_last_error', - 'pg_last_notice' => 'Safe\pg_last_notice', - 'pg_last_oid' => 'Safe\pg_last_oid', - 'pg_lo_close' => 'Safe\pg_lo_close', - 'pg_lo_export' => 'Safe\pg_lo_export', - 'pg_lo_import' => 'Safe\pg_lo_import', - 'pg_lo_open' => 'Safe\pg_lo_open', - 'pg_lo_read' => 'Safe\pg_lo_read', - 'pg_lo_read_all' => 'Safe\pg_lo_read_all', - 'pg_lo_seek' => 'Safe\pg_lo_seek', - 'pg_lo_truncate' => 'Safe\pg_lo_truncate', - 'pg_lo_unlink' => 'Safe\pg_lo_unlink', - 'pg_lo_write' => 'Safe\pg_lo_write', - 'pg_meta_data' => 'Safe\pg_meta_data', - 'pg_options' => 'Safe\pg_options', - 'pg_parameter_status' => 'Safe\pg_parameter_status', - 'pg_pconnect' => 'Safe\pg_pconnect', - 'pg_ping' => 'Safe\pg_ping', - 'pg_port' => 'Safe\pg_port', - 'pg_prepare' => 'Safe\pg_prepare', - 'pg_put_line' => 'Safe\pg_put_line', - 'pg_query' => 'Safe\pg_query', - 'pg_query_params' => 'Safe\pg_query_params', - 'pg_result_error_field' => 'Safe\pg_result_error_field', - 'pg_result_seek' => 'Safe\pg_result_seek', - 'pg_select' => 'Safe\pg_select', - 'pg_send_execute' => 'Safe\pg_send_execute', - 'pg_send_prepare' => 'Safe\pg_send_prepare', - 'pg_send_query' => 'Safe\pg_send_query', - 'pg_send_query_params' => 'Safe\pg_send_query_params', - 'pg_socket' => 'Safe\pg_socket', - 'pg_trace' => 'Safe\pg_trace', - 'pg_tty' => 'Safe\pg_tty', - 'pg_update' => 'Safe\pg_update', - 'pg_version' => 'Safe\pg_version', - 'phpcredits' => 'Safe\phpcredits', - 'phpinfo' => 'Safe\phpinfo', - 'png2wbmp' => 'Safe\png2wbmp', - 'posix_access' => 'Safe\posix_access', - 'posix_getgrnam' => 'Safe\posix_getgrnam', - 'posix_getpgid' => 'Safe\posix_getpgid', - 'posix_initgroups' => 'Safe\posix_initgroups', - 'posix_kill' => 'Safe\posix_kill', - 'posix_mkfifo' => 'Safe\posix_mkfifo', - 'posix_mknod' => 'Safe\posix_mknod', - 'posix_setegid' => 'Safe\posix_setegid', - 'posix_seteuid' => 'Safe\posix_seteuid', - 'posix_setgid' => 'Safe\posix_setgid', - 'posix_setpgid' => 'Safe\posix_setpgid', - 'posix_setrlimit' => 'Safe\posix_setrlimit', - 'posix_setuid' => 'Safe\posix_setuid', - 'preg_match' => 'Safe\preg_match', - 'preg_match_all' => 'Safe\preg_match_all', - 'preg_replace' => 'Safe\preg_replace', - 'preg_split' => 'Safe\preg_split', - 'proc_get_status' => 'Safe\proc_get_status', - 'proc_nice' => 'Safe\proc_nice', - 'pspell_add_to_personal' => 'Safe\pspell_add_to_personal', - 'pspell_add_to_session' => 'Safe\pspell_add_to_session', - 'pspell_clear_session' => 'Safe\pspell_clear_session', - 'pspell_config_create' => 'Safe\pspell_config_create', - 'pspell_config_data_dir' => 'Safe\pspell_config_data_dir', - 'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir', - 'pspell_config_ignore' => 'Safe\pspell_config_ignore', - 'pspell_config_mode' => 'Safe\pspell_config_mode', - 'pspell_config_personal' => 'Safe\pspell_config_personal', - 'pspell_config_repl' => 'Safe\pspell_config_repl', - 'pspell_config_runtogether' => 'Safe\pspell_config_runtogether', - 'pspell_config_save_repl' => 'Safe\pspell_config_save_repl', - 'pspell_new' => 'Safe\pspell_new', - 'pspell_new_config' => 'Safe\pspell_new_config', - 'pspell_save_wordlist' => 'Safe\pspell_save_wordlist', - 'pspell_store_replacement' => 'Safe\pspell_store_replacement', - 'ps_add_launchlink' => 'Safe\ps_add_launchlink', - 'ps_add_locallink' => 'Safe\ps_add_locallink', - 'ps_add_note' => 'Safe\ps_add_note', - 'ps_add_pdflink' => 'Safe\ps_add_pdflink', - 'ps_add_weblink' => 'Safe\ps_add_weblink', - 'ps_arc' => 'Safe\ps_arc', - 'ps_arcn' => 'Safe\ps_arcn', - 'ps_begin_page' => 'Safe\ps_begin_page', - 'ps_begin_pattern' => 'Safe\ps_begin_pattern', - 'ps_begin_template' => 'Safe\ps_begin_template', - 'ps_circle' => 'Safe\ps_circle', - 'ps_clip' => 'Safe\ps_clip', - 'ps_close' => 'Safe\ps_close', - 'ps_closepath' => 'Safe\ps_closepath', - 'ps_closepath_stroke' => 'Safe\ps_closepath_stroke', - 'ps_close_image' => 'Safe\ps_close_image', - 'ps_continue_text' => 'Safe\ps_continue_text', - 'ps_curveto' => 'Safe\ps_curveto', - 'ps_delete' => 'Safe\ps_delete', - 'ps_end_page' => 'Safe\ps_end_page', - 'ps_end_pattern' => 'Safe\ps_end_pattern', - 'ps_end_template' => 'Safe\ps_end_template', - 'ps_fill' => 'Safe\ps_fill', - 'ps_fill_stroke' => 'Safe\ps_fill_stroke', - 'ps_get_parameter' => 'Safe\ps_get_parameter', - 'ps_hyphenate' => 'Safe\ps_hyphenate', - 'ps_include_file' => 'Safe\ps_include_file', - 'ps_lineto' => 'Safe\ps_lineto', - 'ps_moveto' => 'Safe\ps_moveto', - 'ps_new' => 'Safe\ps_new', - 'ps_open_file' => 'Safe\ps_open_file', - 'ps_place_image' => 'Safe\ps_place_image', - 'ps_rect' => 'Safe\ps_rect', - 'ps_restore' => 'Safe\ps_restore', - 'ps_rotate' => 'Safe\ps_rotate', - 'ps_save' => 'Safe\ps_save', - 'ps_scale' => 'Safe\ps_scale', - 'ps_setcolor' => 'Safe\ps_setcolor', - 'ps_setdash' => 'Safe\ps_setdash', - 'ps_setflat' => 'Safe\ps_setflat', - 'ps_setfont' => 'Safe\ps_setfont', - 'ps_setgray' => 'Safe\ps_setgray', - 'ps_setlinecap' => 'Safe\ps_setlinecap', - 'ps_setlinejoin' => 'Safe\ps_setlinejoin', - 'ps_setlinewidth' => 'Safe\ps_setlinewidth', - 'ps_setmiterlimit' => 'Safe\ps_setmiterlimit', - 'ps_setoverprintmode' => 'Safe\ps_setoverprintmode', - 'ps_setpolydash' => 'Safe\ps_setpolydash', - 'ps_set_border_color' => 'Safe\ps_set_border_color', - 'ps_set_border_dash' => 'Safe\ps_set_border_dash', - 'ps_set_border_style' => 'Safe\ps_set_border_style', - 'ps_set_info' => 'Safe\ps_set_info', - 'ps_set_parameter' => 'Safe\ps_set_parameter', - 'ps_set_text_pos' => 'Safe\ps_set_text_pos', - 'ps_set_value' => 'Safe\ps_set_value', - 'ps_shading' => 'Safe\ps_shading', - 'ps_shading_pattern' => 'Safe\ps_shading_pattern', - 'ps_shfill' => 'Safe\ps_shfill', - 'ps_show' => 'Safe\ps_show', - 'ps_show2' => 'Safe\ps_show2', - 'ps_show_xy' => 'Safe\ps_show_xy', - 'ps_show_xy2' => 'Safe\ps_show_xy2', - 'ps_stroke' => 'Safe\ps_stroke', - 'ps_symbol' => 'Safe\ps_symbol', - 'ps_translate' => 'Safe\ps_translate', - 'putenv' => 'Safe\putenv', - 'readfile' => 'Safe\readfile', - 'readgzfile' => 'Safe\readgzfile', - 'readline_add_history' => 'Safe\readline_add_history', - 'readline_callback_handler_install' => 'Safe\readline_callback_handler_install', - 'readline_clear_history' => 'Safe\readline_clear_history', - 'readline_completion_function' => 'Safe\readline_completion_function', - 'readline_read_history' => 'Safe\readline_read_history', - 'readline_write_history' => 'Safe\readline_write_history', - 'readlink' => 'Safe\readlink', - 'realpath' => 'Safe\realpath', - 'register_tick_function' => 'Safe\register_tick_function', - 'rename' => 'Safe\rename', - 'rewind' => 'Safe\rewind', - 'rewinddir' => 'Safe\rewinddir', - 'rmdir' => 'Safe\rmdir', - 'rpmaddtag' => 'Safe\rpmaddtag', - 'rrd_create' => 'Safe\rrd_create', - 'rsort' => 'Safe\rsort', - 'sapi_windows_cp_conv' => 'Safe\sapi_windows_cp_conv', - 'sapi_windows_cp_set' => 'Safe\sapi_windows_cp_set', - 'sapi_windows_generate_ctrl_event' => 'Safe\sapi_windows_generate_ctrl_event', - 'sapi_windows_vt100_support' => 'Safe\sapi_windows_vt100_support', - 'scandir' => 'Safe\scandir', - 'sem_acquire' => 'Safe\sem_acquire', - 'sem_get' => 'Safe\sem_get', - 'sem_release' => 'Safe\sem_release', - 'sem_remove' => 'Safe\sem_remove', - 'session_abort' => 'Safe\session_abort', - 'session_decode' => 'Safe\session_decode', - 'session_destroy' => 'Safe\session_destroy', - 'session_regenerate_id' => 'Safe\session_regenerate_id', - 'session_reset' => 'Safe\session_reset', - 'session_unset' => 'Safe\session_unset', - 'session_write_close' => 'Safe\session_write_close', - 'settype' => 'Safe\settype', - 'set_include_path' => 'Safe\set_include_path', - 'set_time_limit' => 'Safe\set_time_limit', - 'sha1_file' => 'Safe\sha1_file', - 'shmop_delete' => 'Safe\shmop_delete', - 'shmop_read' => 'Safe\shmop_read', - 'shmop_write' => 'Safe\shmop_write', - 'shm_put_var' => 'Safe\shm_put_var', - 'shm_remove' => 'Safe\shm_remove', - 'shm_remove_var' => 'Safe\shm_remove_var', - 'shuffle' => 'Safe\shuffle', - 'simplexml_import_dom' => 'Safe\simplexml_import_dom', - 'simplexml_load_file' => 'Safe\simplexml_load_file', - 'simplexml_load_string' => 'Safe\simplexml_load_string', - 'sleep' => 'Safe\sleep', - 'socket_accept' => 'Safe\socket_accept', - 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', - 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', - 'socket_bind' => 'Safe\socket_bind', - 'socket_connect' => 'Safe\socket_connect', - 'socket_create' => 'Safe\socket_create', - 'socket_create_listen' => 'Safe\socket_create_listen', - 'socket_create_pair' => 'Safe\socket_create_pair', - 'socket_export_stream' => 'Safe\socket_export_stream', - 'socket_getpeername' => 'Safe\socket_getpeername', - 'socket_getsockname' => 'Safe\socket_getsockname', - 'socket_get_option' => 'Safe\socket_get_option', - 'socket_import_stream' => 'Safe\socket_import_stream', - 'socket_listen' => 'Safe\socket_listen', - 'socket_read' => 'Safe\socket_read', - 'socket_send' => 'Safe\socket_send', - 'socket_sendmsg' => 'Safe\socket_sendmsg', - 'socket_sendto' => 'Safe\socket_sendto', - 'socket_set_block' => 'Safe\socket_set_block', - 'socket_set_nonblock' => 'Safe\socket_set_nonblock', - 'socket_set_option' => 'Safe\socket_set_option', - 'socket_shutdown' => 'Safe\socket_shutdown', - 'socket_write' => 'Safe\socket_write', - 'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export', - 'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import', - 'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release', - 'sodium_crypto_pwhash' => 'Safe\sodium_crypto_pwhash', - 'sodium_crypto_pwhash_str' => 'Safe\sodium_crypto_pwhash_str', - 'solr_get_version' => 'Safe\solr_get_version', - 'sort' => 'Safe\sort', - 'soundex' => 'Safe\soundex', - 'spl_autoload_register' => 'Safe\spl_autoload_register', - 'spl_autoload_unregister' => 'Safe\spl_autoload_unregister', - 'sprintf' => 'Safe\sprintf', - 'sqlsrv_begin_transaction' => 'Safe\sqlsrv_begin_transaction', - 'sqlsrv_cancel' => 'Safe\sqlsrv_cancel', - 'sqlsrv_client_info' => 'Safe\sqlsrv_client_info', - 'sqlsrv_close' => 'Safe\sqlsrv_close', - 'sqlsrv_commit' => 'Safe\sqlsrv_commit', - 'sqlsrv_configure' => 'Safe\sqlsrv_configure', - 'sqlsrv_execute' => 'Safe\sqlsrv_execute', - 'sqlsrv_free_stmt' => 'Safe\sqlsrv_free_stmt', - 'sqlsrv_get_field' => 'Safe\sqlsrv_get_field', - 'sqlsrv_next_result' => 'Safe\sqlsrv_next_result', - 'sqlsrv_num_fields' => 'Safe\sqlsrv_num_fields', - 'sqlsrv_num_rows' => 'Safe\sqlsrv_num_rows', - 'sqlsrv_prepare' => 'Safe\sqlsrv_prepare', - 'sqlsrv_query' => 'Safe\sqlsrv_query', - 'sqlsrv_rollback' => 'Safe\sqlsrv_rollback', - 'ssdeep_fuzzy_compare' => 'Safe\ssdeep_fuzzy_compare', - 'ssdeep_fuzzy_hash' => 'Safe\ssdeep_fuzzy_hash', - 'ssdeep_fuzzy_hash_filename' => 'Safe\ssdeep_fuzzy_hash_filename', - 'ssh2_auth_agent' => 'Safe\ssh2_auth_agent', - 'ssh2_auth_hostbased_file' => 'Safe\ssh2_auth_hostbased_file', - 'ssh2_auth_password' => 'Safe\ssh2_auth_password', - 'ssh2_auth_pubkey_file' => 'Safe\ssh2_auth_pubkey_file', - 'ssh2_connect' => 'Safe\ssh2_connect', - 'ssh2_disconnect' => 'Safe\ssh2_disconnect', - 'ssh2_exec' => 'Safe\ssh2_exec', - 'ssh2_publickey_add' => 'Safe\ssh2_publickey_add', - 'ssh2_publickey_init' => 'Safe\ssh2_publickey_init', - 'ssh2_publickey_remove' => 'Safe\ssh2_publickey_remove', - 'ssh2_scp_recv' => 'Safe\ssh2_scp_recv', - 'ssh2_scp_send' => 'Safe\ssh2_scp_send', - 'ssh2_sftp' => 'Safe\ssh2_sftp', - 'ssh2_sftp_chmod' => 'Safe\ssh2_sftp_chmod', - 'ssh2_sftp_mkdir' => 'Safe\ssh2_sftp_mkdir', - 'ssh2_sftp_rename' => 'Safe\ssh2_sftp_rename', - 'ssh2_sftp_rmdir' => 'Safe\ssh2_sftp_rmdir', - 'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink', - 'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink', - 'stream_context_set_params' => 'Safe\stream_context_set_params', - 'stream_copy_to_stream' => 'Safe\stream_copy_to_stream', - 'stream_filter_append' => 'Safe\stream_filter_append', - 'stream_filter_prepend' => 'Safe\stream_filter_prepend', - 'stream_filter_register' => 'Safe\stream_filter_register', - 'stream_filter_remove' => 'Safe\stream_filter_remove', - 'stream_get_contents' => 'Safe\stream_get_contents', - 'stream_isatty' => 'Safe\stream_isatty', - 'stream_resolve_include_path' => 'Safe\stream_resolve_include_path', - 'stream_set_blocking' => 'Safe\stream_set_blocking', - 'stream_set_timeout' => 'Safe\stream_set_timeout', - 'stream_socket_accept' => 'Safe\stream_socket_accept', - 'stream_socket_client' => 'Safe\stream_socket_client', - 'stream_socket_pair' => 'Safe\stream_socket_pair', - 'stream_socket_server' => 'Safe\stream_socket_server', - 'stream_socket_shutdown' => 'Safe\stream_socket_shutdown', - 'stream_supports_lock' => 'Safe\stream_supports_lock', - 'stream_wrapper_register' => 'Safe\stream_wrapper_register', - 'stream_wrapper_restore' => 'Safe\stream_wrapper_restore', - 'stream_wrapper_unregister' => 'Safe\stream_wrapper_unregister', - 'strptime' => 'Safe\strptime', - 'strtotime' => 'Safe\strtotime', - 'substr' => 'Safe\substr', - 'swoole_async_write' => 'Safe\swoole_async_write', - 'swoole_async_writefile' => 'Safe\swoole_async_writefile', - 'swoole_event_defer' => 'Safe\swoole_event_defer', - 'swoole_event_del' => 'Safe\swoole_event_del', - 'swoole_event_write' => 'Safe\swoole_event_write', - 'symlink' => 'Safe\symlink', - 'syslog' => 'Safe\syslog', - 'system' => 'Safe\system', - 'tempnam' => 'Safe\tempnam', - 'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr', - 'time_nanosleep' => 'Safe\time_nanosleep', - 'time_sleep_until' => 'Safe\time_sleep_until', - 'tmpfile' => 'Safe\tmpfile', - 'touch' => 'Safe\touch', - 'uasort' => 'Safe\uasort', - 'uksort' => 'Safe\uksort', - 'unlink' => 'Safe\unlink', - 'unpack' => 'Safe\unpack', - 'uopz_extend' => 'Safe\uopz_extend', - 'uopz_implement' => 'Safe\uopz_implement', - 'usort' => 'Safe\usort', - 'virtual' => 'Safe\virtual', - 'vsprintf' => 'Safe\vsprintf', - 'xdiff_file_bdiff' => 'Safe\xdiff_file_bdiff', - 'xdiff_file_bpatch' => 'Safe\xdiff_file_bpatch', - 'xdiff_file_diff' => 'Safe\xdiff_file_diff', - 'xdiff_file_diff_binary' => 'Safe\xdiff_file_diff_binary', - 'xdiff_file_patch_binary' => 'Safe\xdiff_file_patch_binary', - 'xdiff_file_rabdiff' => 'Safe\xdiff_file_rabdiff', - 'xdiff_string_bpatch' => 'Safe\xdiff_string_bpatch', - 'xdiff_string_patch' => 'Safe\xdiff_string_patch', - 'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary', - 'xmlrpc_set_type' => 'Safe\xmlrpc_set_type', - 'xml_parser_create' => 'Safe\xml_parser_create', - 'xml_parser_create_ns' => 'Safe\xml_parser_create_ns', - 'xml_set_object' => 'Safe\xml_set_object', - 'yaml_parse' => 'Safe\yaml_parse', - 'yaml_parse_file' => 'Safe\yaml_parse_file', - 'yaml_parse_url' => 'Safe\yaml_parse_url', - 'yaz_ccl_parse' => 'Safe\yaz_ccl_parse', - 'yaz_close' => 'Safe\yaz_close', - 'yaz_connect' => 'Safe\yaz_connect', - 'yaz_database' => 'Safe\yaz_database', - 'yaz_element' => 'Safe\yaz_element', - 'yaz_present' => 'Safe\yaz_present', - 'yaz_search' => 'Safe\yaz_search', - 'yaz_wait' => 'Safe\yaz_wait', - 'zip_entry_close' => 'Safe\zip_entry_close', - 'zip_entry_open' => 'Safe\zip_entry_open', - 'zip_entry_read' => 'Safe\zip_entry_read', - 'zlib_decode' => 'Safe\zlib_decode', -]]]); -}; diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/LICENSE deleted file mode 100644 index 25cfdd66..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Spomky-Labs - -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/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/composer.json deleted file mode 100644 index 34d0f1ee..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "web-auth/cose-lib", - "type": "library", - "license": "MIT", - "description": "CBOR Object Signing and Encryption (COSE) For PHP", - "keywords": ["COSE", "RFC8152"], - "homepage": "https://github.com/web-auth", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-auth/cose/contributors" - } - ], - "require": { - "php": ">=7.2", - "ext-json": "*", - "ext-openssl": "*", - "ext-mbstring": "*", - "fgrosse/phpasn1": "^2.1", - "beberlei/assert": "^3.2" - }, - "autoload": { - "psr-4": { - "Cose\\": "src/" - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Algorithm.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Algorithm.php deleted file mode 100644 index c79e4057..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Algorithm.php +++ /dev/null @@ -1,19 +0,0 @@ -checKey($key); - $signature = hash_hmac($this->getHashAlgorithm(), $data, $key->get(-1), true); - - return mb_substr($signature, 0, intdiv($this->getSignatureLength(), 8), '8bit'); - } - - public function verify(string $data, Key $key, string $signature): bool - { - return hash_equals($this->hash($data, $key), $signature); - } - - abstract protected function getHashAlgorithm(): string; - - abstract protected function getSignatureLength(): int; - - private function checKey(Key $key): void - { - Assertion::eq($key->type(), 4, 'Invalid key. Must be of type symmetric'); - Assertion::true($key->has(-1), 'Invalid key. The value of the key is missing'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Mac/Mac.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Mac/Mac.php deleted file mode 100644 index c4051cb0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Mac/Mac.php +++ /dev/null @@ -1,24 +0,0 @@ -algorithms[$identifier] = $algorithm; - } - - public function list(): iterable - { - yield from array_keys($this->algorithms); - } - - /** - * @return Algorithm[] - */ - public function all(): iterable - { - yield from $this->algorithms; - } - - public function has(int $identifier): bool - { - return array_key_exists($identifier, $this->algorithms); - } - - public function get(int $identifier): Algorithm - { - Assertion::true($this->has($identifier), 'Unsupported algorithm'); - - return $this->algorithms[$identifier]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/ManagerFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/ManagerFactory.php deleted file mode 100644 index c3fb032a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/ManagerFactory.php +++ /dev/null @@ -1,50 +0,0 @@ -algorithms[$alias] = $algorithm; - } - - public function list(): iterable - { - yield from array_keys($this->algorithms); - } - - public function all(): iterable - { - yield from array_keys($this->algorithms); - } - - public function create(array $aliases): Manager - { - $manager = new Manager(); - foreach ($aliases as $alias) { - Assertion::keyExists($this->algorithms, $alias, sprintf('The algorithm with alias "%s" is not supported', $alias)); - $manager->add($this->algorithms[$alias]); - } - - return $manager; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECDSA.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECDSA.php deleted file mode 100644 index 6bac0061..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECDSA.php +++ /dev/null @@ -1,53 +0,0 @@ -handleKey($key); - openssl_sign($data, $signature, $key->asPEM(), $this->getHashAlgorithm()); - - return ECSignature::fromAsn1($signature, $this->getSignaturePartLength()); - } - - public function verify(string $data, Key $key, string $signature): bool - { - $key = $this->handleKey($key); - $publicKey = $key->toPublic(); - $signature = ECSignature::toAsn1($signature, $this->getSignaturePartLength()); - - return 1 === openssl_verify($data, $signature, $publicKey->asPEM(), $this->getHashAlgorithm()); - } - - abstract protected function getCurve(): int; - - abstract protected function getHashAlgorithm(): int; - - abstract protected function getSignaturePartLength(): int; - - private function handleKey(Key $key): Ec2Key - { - $key = new Ec2Key($key->getData()); - Assertion::eq($key->curve(), $this->getCurve(), 'This key cannot be used with this algorithm'); - - return $key; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECSignature.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECSignature.php deleted file mode 100644 index c4690e91..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ECSignature.php +++ /dev/null @@ -1,144 +0,0 @@ - self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : ''; - - $bin = hex2bin( - self::ASN1_SEQUENCE - .$lengthPrefix.dechex($totalLength) - .self::ASN1_INTEGER.dechex($lengthR).$pointR - .self::ASN1_INTEGER.dechex($lengthS).$pointS - ); - if (false === $bin) { - throw new InvalidArgumentException('Unable to convert into ASN.1'); - } - - return $bin; - } - - public static function fromAsn1(string $signature, int $length): string - { - $message = bin2hex($signature); - $position = 0; - - if (self::ASN1_SEQUENCE !== self::readAsn1Content($message, $position, self::BYTE_SIZE)) { - throw new InvalidArgumentException('Invalid data. Should start with a sequence.'); - } - - // @phpstan-ignore-next-line - if (self::ASN1_LENGTH_2BYTES === self::readAsn1Content($message, $position, self::BYTE_SIZE)) { - $position += self::BYTE_SIZE; - } - - $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); - $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); - - $bin = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT).str_pad($pointS, $length, '0', STR_PAD_LEFT)); - if (false === $bin) { - throw new InvalidArgumentException('Unable to convert from ASN.1'); - } - - return $bin; - } - - private static function octetLength(string $data): int - { - return intdiv(mb_strlen($data, '8bit'), self::BYTE_SIZE); - } - - private static function preparePositiveInteger(string $data): string - { - if (mb_substr($data, 0, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) { - return self::ASN1_NEGATIVE_INTEGER.$data; - } - - while ( - self::ASN1_NEGATIVE_INTEGER === mb_substr($data, 0, self::BYTE_SIZE, '8bit') - && mb_substr($data, 2, self::BYTE_SIZE, '8bit') <= self::ASN1_BIG_INTEGER_LIMIT - ) { - $data = mb_substr($data, 2, null, '8bit'); - } - - return $data; - } - - private static function readAsn1Content(string $message, int &$position, int $length): string - { - $content = mb_substr($message, $position, $length, '8bit'); - $position += $length; - - return $content; - } - - private static function readAsn1Integer(string $message, int &$position): string - { - if (self::ASN1_INTEGER !== self::readAsn1Content($message, $position, self::BYTE_SIZE)) { - throw new InvalidArgumentException('Invalid data. Should contain an integer.'); - } - - $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE)); - - return self::readAsn1Content($message, $position, $length * self::BYTE_SIZE); - } - - private static function retrievePositiveInteger(string $data): string - { - while ( - self::ASN1_NEGATIVE_INTEGER === mb_substr($data, 0, self::BYTE_SIZE, '8bit') - && mb_substr($data, 2, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT - ) { - $data = mb_substr($data, 2, null, '8bit'); - } - - return $data; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES256.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES256.php deleted file mode 100644 index 5726ee4d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/ECDSA/ES256.php +++ /dev/null @@ -1,41 +0,0 @@ -handleKey($key); - Assertion::true($key->isPrivate(), 'The key is not private'); - - $x = $key->x(); - $d = $key->d(); - $secret = $d.$x; - - switch ($key->curve()) { - case OkpKey::CURVE_ED25519: - return sodium_crypto_sign_detached($data, $secret); - default: - throw new InvalidArgumentException('Unsupported curve'); - } - } - - public function verify(string $data, Key $key, string $signature): bool - { - $key = $this->handleKey($key); - - switch ($key->curve()) { - case OkpKey::CURVE_ED25519: - return sodium_crypto_sign_verify_detached($signature, $data, $key->x()); - default: - throw new InvalidArgumentException('Unsupported curve'); - } - } - - public static function identifier(): int - { - return Algorithms::COSE_ALGORITHM_EdDSA; - } - - private function handleKey(Key $key): OkpKey - { - return new OkpKey($key->getData()); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS256.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS256.php deleted file mode 100644 index 40bbeb0e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/RSA/PS256.php +++ /dev/null @@ -1,31 +0,0 @@ -handleKey($key); - $modulusLength = mb_strlen($key->n(), '8bit'); - - $em = $this->encodeEMSAPSS($data, 8 * $modulusLength - 1, $this->getHashAlgorithm()); - $message = BigInteger::createFromBinaryString($em); - $signature = $this->exponentiate($key, $message); - - return $this->convertIntegerToOctetString($signature, $modulusLength); - } - - public function verify(string $data, Key $key, string $signature): bool - { - $key = $this->handleKey($key); - $modulusLength = mb_strlen($key->n(), '8bit'); - - if (mb_strlen($signature, '8bit') !== $modulusLength) { - throw new InvalidArgumentException('Invalid modulus length'); - } - $s2 = BigInteger::createFromBinaryString($signature); - $m2 = $this->exponentiate($key, $s2); - $em = $this->convertIntegerToOctetString($m2, $modulusLength); - $modBits = 8 * $modulusLength; - - return $this->verifyEMSAPSS($data, $em, $modBits - 1, $this->getHashAlgorithm()); - } - - /** - * Exponentiate with or without Chinese Remainder Theorem. - * Operation with primes 'p' and 'q' is appox. 2x faster. - */ - public function exponentiate(RsaKey $key, BigInteger $c): BigInteger - { - if ($c->compare(BigInteger::createFromDecimal(0)) < 0 || $c->compare(BigInteger::createFromBinaryString($key->n())) > 0) { - throw new RuntimeException(); - } - if ($key->isPublic() || !$key->hasPrimes() || !$key->hasExponents() || !$key->hasCoefficient()) { - return $c->modPow(BigInteger::createFromBinaryString($key->e()), BigInteger::createFromBinaryString($key->n())); - } - - [$p, $q] = $key->primes(); - [$dP, $dQ] = $key->exponents(); - $qInv = BigInteger::createFromBinaryString($key->QInv()); - - $m1 = $c->modPow($dP, $p); - $m2 = $c->modPow($dQ, $q); - $h = $qInv->multiply($m1->subtract($m2)->add($p))->mod($p); - - return $m2->add($h->multiply($q)); - } - - abstract protected function getHashAlgorithm(): Hash; - - private function handleKey(Key $key): RsaKey - { - return new RsaKey($key->getData()); - } - - private function convertIntegerToOctetString(BigInteger $x, int $xLen): string - { - $x = $x->toBytes(); - if (mb_strlen($x, '8bit') > $xLen) { - throw new RuntimeException('Unable to convert the integer'); - } - - return str_pad($x, $xLen, chr(0), STR_PAD_LEFT); - } - - /** - * MGF1. - */ - private function getMGF1(string $mgfSeed, int $maskLen, Hash $mgfHash): string - { - $t = ''; - $count = ceil($maskLen / $mgfHash->getLength()); - for ($i = 0; $i < $count; ++$i) { - $c = pack('N', $i); - $t .= $mgfHash->hash($mgfSeed.$c); - } - - return mb_substr($t, 0, $maskLen, '8bit'); - } - - /** - * EMSA-PSS-ENCODE. - */ - private function encodeEMSAPSS(string $message, int $modulusLength, Hash $hash): string - { - $emLen = ($modulusLength + 1) >> 3; - $sLen = $hash->getLength(); - $mHash = $hash->hash($message); - if ($emLen <= $hash->getLength() + $sLen + 2) { - throw new RuntimeException(); - } - $salt = random_bytes($sLen); - $m2 = "\0\0\0\0\0\0\0\0".$mHash.$salt; - $h = $hash->hash($m2); - $ps = str_repeat(chr(0), $emLen - $sLen - $hash->getLength() - 2); - $db = $ps.chr(1).$salt; - $dbMask = $this->getMGF1($h, $emLen - $hash->getLength() - 1, $hash); - $maskedDB = $db ^ $dbMask; - $maskedDB[0] = ~chr(0xFF << ($modulusLength & 7)) & $maskedDB[0]; - - return $maskedDB.$h.chr(0xBC); - } - - /** - * EMSA-PSS-VERIFY. - */ - private function verifyEMSAPSS(string $m, string $em, int $emBits, Hash $hash): bool - { - $emLen = ($emBits + 1) >> 3; - $sLen = $hash->getLength(); - $mHash = $hash->hash($m); - if ($emLen < $hash->getLength() + $sLen + 2) { - throw new InvalidArgumentException(); - } - if ($em[mb_strlen($em, '8bit') - 1] !== chr(0xBC)) { - throw new InvalidArgumentException(); - } - $maskedDB = mb_substr($em, 0, -$hash->getLength() - 1, '8bit'); - $h = mb_substr($em, -$hash->getLength() - 1, $hash->getLength(), '8bit'); - $temp = chr(0xFF << ($emBits & 7)); - if ((~$maskedDB[0] & $temp) !== $temp) { - throw new InvalidArgumentException(); - } - $dbMask = $this->getMGF1($h, $emLen - $hash->getLength() - 1, $hash/*MGF*/); - $db = $maskedDB ^ $dbMask; - $db[0] = ~chr(0xFF << ($emBits & 7)) & $db[0]; - $temp = $emLen - $hash->getLength() - $sLen - 2; - if (mb_substr($db, 0, $temp, '8bit') !== str_repeat(chr(0), $temp)) { - throw new InvalidArgumentException(); - } - if (1 !== ord($db[$temp])) { - throw new InvalidArgumentException(); - } - $salt = mb_substr($db, $temp + 1, null, '8bit'); // should be $sLen long - $m2 = "\0\0\0\0\0\0\0\0".$mHash.$salt; - $h2 = $hash->hash($m2); - - return hash_equals($h, $h2); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS1.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS1.php deleted file mode 100644 index 61b0400e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/RSA/RS1.php +++ /dev/null @@ -1,29 +0,0 @@ -handleKey($key); - Assertion::true($key->isPrivate(), 'The key is not private'); - - if (false === openssl_sign($data, $signature, $key->asPem(), $this->getHashAlgorithm())) { - throw new InvalidArgumentException('Unable to sign the data'); - } - - return $signature; - } - - public function verify(string $data, Key $key, string $signature): bool - { - $key = $this->handleKey($key); - - return 1 === openssl_verify($data, $signature, $key->asPem(), $this->getHashAlgorithm()); - } - - abstract protected function getHashAlgorithm(): int; - - private function handleKey(Key $key): RsaKey - { - return new RsaKey($key->getData()); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/Signature.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/Signature.php deleted file mode 100644 index 9bf9c64f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Algorithm/Signature/Signature.php +++ /dev/null @@ -1,24 +0,0 @@ - OPENSSL_ALGO_SHA256, - self::COSE_ALGORITHM_ES384 => OPENSSL_ALGO_SHA384, - self::COSE_ALGORITHM_ES512 => OPENSSL_ALGO_SHA512, - self::COSE_ALGORITHM_RS256 => OPENSSL_ALGO_SHA256, - self::COSE_ALGORITHM_RS384 => OPENSSL_ALGO_SHA384, - self::COSE_ALGORITHM_RS512 => OPENSSL_ALGO_SHA512, - self::COSE_ALGORITHM_RS1 => OPENSSL_ALGO_SHA1, - ]; - - public const COSE_HASH_MAP = [ - self::COSE_ALGORITHM_ES256K => 'sha256', - self::COSE_ALGORITHM_ES256 => 'sha256', - self::COSE_ALGORITHM_ES384 => 'sha384', - self::COSE_ALGORITHM_ES512 => 'sha512', - self::COSE_ALGORITHM_RS256 => 'sha256', - self::COSE_ALGORITHM_RS384 => 'sha384', - self::COSE_ALGORITHM_RS512 => 'sha512', - self::COSE_ALGORITHM_PS256 => 'sha256', - self::COSE_ALGORITHM_PS384 => 'sha384', - self::COSE_ALGORITHM_PS512 => 'sha512', - self::COSE_ALGORITHM_RS1 => 'sha1', - ]; - - /** - * @throws AssertionFailedException - */ - public static function getOpensslAlgorithmFor(int $algorithmIdentifier): int - { - Assertion::keyExists(self::COSE_ALGORITHM_MAP, $algorithmIdentifier, 'The specified algorithm identifier is not supported'); - - return self::COSE_ALGORITHM_MAP[$algorithmIdentifier]; - } - - /** - * @throws AssertionFailedException - */ - public static function getHashAlgorithmFor(int $algorithmIdentifier): string - { - Assertion::keyExists(self::COSE_HASH_MAP, $algorithmIdentifier, 'The specified algorithm identifier is not supported'); - - return self::COSE_HASH_MAP[$algorithmIdentifier]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/BigInteger.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/BigInteger.php deleted file mode 100644 index a7c59eb5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/BigInteger.php +++ /dev/null @@ -1,154 +0,0 @@ -value = $value; - } - - public static function createFromBinaryString(string $value): self - { - $res = unpack('H*', $value); - if (false === $res) { - throw new InvalidArgumentException('Unable to convert the data from binary'); - } - $data = current($res); - - return new self(BrickBigInteger::fromBase($data, 16)); - } - - public static function createFromDecimal(int $value): self - { - return new self(BrickBigInteger::of($value)); - } - - /** - * Converts a BigInteger to a binary string. - */ - public function toBytes(): string - { - if ($this->value->isEqualTo(BrickBigInteger::zero())) { - return ''; - } - - $temp = $this->value->toBase(16); - $temp = 0 !== (mb_strlen($temp, '8bit') & 1) ? '0'.$temp : $temp; - $temp = hex2bin($temp); - if (false === $temp) { - throw new InvalidArgumentException('Unable to convert the data into binary'); - } - - return ltrim($temp, chr(0)); - } - - /** - * Adds two BigIntegers. - * - * @param BigInteger $y - * - * @return BigInteger - */ - public function add(self $y): self - { - $value = $this->value->plus($y->value); - - return new self($value); - } - - /** - * Subtracts two BigIntegers. - * - * @param BigInteger $y - * - * @return BigInteger - */ - public function subtract(self $y): self - { - $value = $this->value->minus($y->value); - - return new self($value); - } - - /** - * Multiplies two BigIntegers. - * - * @param BigInteger $x - * - * @return BigInteger - */ - public function multiply(self $x): self - { - $value = $this->value->multipliedBy($x->value); - - return new self($value); - } - - /** - * Performs modular exponentiation. - * - * @param BigInteger $e - * @param BigInteger $n - * - * @return BigInteger - */ - public function modPow(self $e, self $n): self - { - $value = $this->value->modPow($e->value, $n->value); - - return new self($value); - } - - /** - * Performs modular exponentiation. - * - * @param BigInteger $d - * - * @return BigInteger - */ - public function mod(self $d): self - { - $value = $this->value->mod($d->value); - - return new self($value); - } - - /** - * Compares two numbers. - * - * @param BigInteger $y - */ - public function compare(self $y): int - { - return $this->value->compareTo($y->value); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Hash.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Hash.php deleted file mode 100644 index 2f3722cc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Hash.php +++ /dev/null @@ -1,103 +0,0 @@ -hash = $hash; - $this->length = $length; - $this->t = $t; - } - - /** - * @return Hash - */ - public static function sha1(): self - { - return new self('sha1', 20, "\x30\x21\x30\x09\x06\x05\x2b\x0e\x03\x02\x1a\x05\x00\x04\x14"); - } - - /** - * @return Hash - */ - public static function sha256(): self - { - return new self('sha256', 32, "\x30\x31\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01\x05\x00\x04\x20"); - } - - /** - * @return Hash - */ - public static function sha384(): self - { - return new self('sha384', 48, "\x30\x41\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x02\x05\x00\x04\x30"); - } - - /** - * @return Hash - */ - public static function sha512(): self - { - return new self('sha512', 64, "\x30\x51\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x03\x05\x00\x04\x40"); - } - - public function getLength(): int - { - return $this->length; - } - - /** - * Compute the HMAC. - */ - public function hash(string $text): string - { - return hash($this->hash, $text, true); - } - - public function name(): string - { - return $this->hash; - } - - public function t(): string - { - return $this->t; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/Ec2Key.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/Ec2Key.php deleted file mode 100644 index b4a48eca..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/Ec2Key.php +++ /dev/null @@ -1,145 +0,0 @@ - '1.2.840.10045.3.1.7', // NIST P-256 / secp256r1 - self::CURVE_P256K => '1.3.132.0.10', // NIST P-256K / secp256k1 - self::CURVE_P384 => '1.3.132.0.34', // NIST P-384 / secp384r1 - self::CURVE_P521 => '1.3.132.0.35', // NIST P-521 / secp521r1 - ]; - - private const CURVE_KEY_LENGTH = [ - self::CURVE_P256 => 32, - self::CURVE_P256K => 32, - self::CURVE_P384 => 48, - self::CURVE_P521 => 66, - ]; - - public function __construct(array $data) - { - parent::__construct($data); - Assertion::eq($data[self::TYPE], self::TYPE_EC2, 'Invalid EC2 key. The key type does not correspond to an EC2 key'); - Assertion::keyExists($data, self::DATA_CURVE, 'Invalid EC2 key. The curve is missing'); - Assertion::keyExists($data, self::DATA_X, 'Invalid EC2 key. The x coordinate is missing'); - Assertion::keyExists($data, self::DATA_Y, 'Invalid EC2 key. The y coordinate is missing'); - Assertion::length($data[self::DATA_X], self::CURVE_KEY_LENGTH[$data[self::DATA_CURVE]], 'Invalid length for x coordinate', null, '8bit'); - Assertion::length($data[self::DATA_Y], self::CURVE_KEY_LENGTH[$data[self::DATA_CURVE]], 'Invalid length for y coordinate', null, '8bit'); - Assertion::inArray((int) $data[self::DATA_CURVE], self::SUPPORTED_CURVES, 'The curve is not supported'); - } - - public function toPublic(): self - { - $data = $this->getData(); - unset($data[self::DATA_D]); - - return new self($data); - } - - public function x(): string - { - return $this->get(self::DATA_X); - } - - public function y(): string - { - return $this->get(self::DATA_Y); - } - - public function isPrivate(): bool - { - return array_key_exists(self::DATA_D, $this->getData()); - } - - public function d(): string - { - Assertion::true($this->isPrivate(), 'The key is not private'); - - return $this->get(self::DATA_D); - } - - public function curve(): int - { - return (int) $this->get(self::DATA_CURVE); - } - - public function asPEM(): string - { - if ($this->isPrivate()) { - $der = new Sequence( - new Integer(1), - new OctetString(bin2hex($this->d())), - new ExplicitlyTaggedObject(0, new ObjectIdentifier($this->getCurveOid())), - new ExplicitlyTaggedObject(1, new BitString(bin2hex($this->getUncompressedCoordinates()))) - ); - - return $this->pem('EC PRIVATE KEY', $der->getBinary()); - } - - $der = new Sequence( - new Sequence( - new ObjectIdentifier('1.2.840.10045.2.1'), - new ObjectIdentifier($this->getCurveOid()) - ), - new BitString(bin2hex($this->getUncompressedCoordinates())) - ); - - return $this->pem('PUBLIC KEY', $der->getBinary()); - } - - public function getUncompressedCoordinates(): string - { - return "\x04".$this->x().$this->y(); - } - - private function getCurveOid(): string - { - return self::NAMED_CURVE_OID[$this->curve()]; - } - - private function pem(string $type, string $der): string - { - return sprintf("-----BEGIN %s-----\n", mb_strtoupper($type)). - chunk_split(base64_encode($der), 64, "\n"). - sprintf("-----END %s-----\n", mb_strtoupper($type)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/Key.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/Key.php deleted file mode 100644 index afb9c52c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/Key.php +++ /dev/null @@ -1,91 +0,0 @@ -data = $data; - } - - public static function createFromData(array $data): self - { - Assertion::keyExists($data, self::TYPE, 'Invalid key: the type is not defined'); - switch ($data[self::TYPE]) { - case 1: - return new OkpKey($data); - case 2: - return new Ec2Key($data); - case 3: - return new RsaKey($data); - case 4: - return new SymmetricKey($data); - default: - return new self($data); - } - } - - /** - * @return int|string - */ - public function type() - { - return $this->data[self::TYPE]; - } - - public function alg(): int - { - return (int) $this->get(self::ALG); - } - - public function getData(): array - { - return $this->data; - } - - public function has(int $key): bool - { - return array_key_exists($key, $this->data); - } - - /** - * @return mixed - */ - public function get(int $key) - { - Assertion::keyExists($this->data, $key, sprintf('The key has no data at index %d', $key)); - - return $this->data[$key]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/OkpKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/OkpKey.php deleted file mode 100644 index 2baabd4f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/OkpKey.php +++ /dev/null @@ -1,67 +0,0 @@ -get(self::DATA_X); - } - - public function isPrivate(): bool - { - return array_key_exists(self::DATA_D, $this->getData()); - } - - public function d(): string - { - Assertion::true($this->isPrivate(), 'The key is not private'); - - return $this->get(self::DATA_D); - } - - public function curve(): int - { - return (int) $this->get(self::DATA_CURVE); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/RsaKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/RsaKey.php deleted file mode 100644 index 96371f7f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/RsaKey.php +++ /dev/null @@ -1,207 +0,0 @@ -get(self::DATA_N); - } - - public function e(): string - { - return $this->get(self::DATA_E); - } - - public function d(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_D); - } - - public function p(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_P); - } - - public function q(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_Q); - } - - public function dP(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_DP); - } - - public function dQ(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_DQ); - } - - public function QInv(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_QI); - } - - public function other(): array - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_OTHER); - } - - public function rI(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_RI); - } - - public function dI(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_DI); - } - - public function tI(): string - { - Assertion::true($this->isPrivate(), 'The key is not private.'); - - return $this->get(self::DATA_TI); - } - - public function hasPrimes(): bool - { - return $this->has(self::DATA_P) && $this->has(self::DATA_Q); - } - - public function primes(): array - { - return [ - $this->p(), - $this->q(), - ]; - } - - public function hasExponents(): bool - { - return $this->has(self::DATA_DP) && $this->has(self::DATA_DQ); - } - - public function exponents(): array - { - return [ - $this->dP(), - $this->dQ(), - ]; - } - - public function hasCoefficient(): bool - { - return $this->has(self::DATA_QI); - } - - public function isPublic(): bool - { - return !$this->isPrivate(); - } - - public function isPrivate(): bool - { - return array_key_exists(self::DATA_D, $this->getData()); - } - - public function asPem(): string - { - Assertion::false($this->isPrivate(), 'Unsupported for private keys.'); - $bitSring = new Sequence( - new Integer($this->fromBase64ToInteger($this->n())), - new Integer($this->fromBase64ToInteger($this->e())) - ); - - $der = new Sequence( - new Sequence( - new ObjectIdentifier('1.2.840.113549.1.1.1'), - new NullObject() - ), - new BitString(bin2hex($bitSring->getBinary())) - ); - - return $this->pem('PUBLIC KEY', $der->getBinary()); - } - - private function fromBase64ToInteger(string $value): string - { - $data = unpack('H*', $value); - if (false === $data) { - throw new InvalidArgumentException('Unable to convert to an integer'); - } - - $hex = current($data); - - return BigInteger::fromBase($hex, 16)->toBase(10); - } - - private function pem(string $type, string $der): string - { - return sprintf("-----BEGIN %s-----\n", mb_strtoupper($type)). - chunk_split(base64_encode($der), 64, "\n"). - sprintf("-----END %s-----\n", mb_strtoupper($type)); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/SymmetricKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/SymmetricKey.php deleted file mode 100644 index 1e63562d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Key/SymmetricKey.php +++ /dev/null @@ -1,33 +0,0 @@ -get(self::DATA_K); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Verifier.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Verifier.php deleted file mode 100644 index d300be8e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/cose-lib/src/Verifier.php +++ /dev/null @@ -1,18 +0,0 @@ -=7.2", - "ext-json": "*", - "beberlei/assert": "^3.2", - "league/uri": "^6.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log-implementation": "Recommended to receive logs from the library" - }, - "autoload": { - "psr-4": { - "Webauthn\\MetadataService\\": "src/" - } - }, - "suggest": { - "web-token/jwt-key-mgmt": "Mandatory for fetching Metadata Statement from distant sources", - "web-token/jwt-signature-algorithm-ecdsa": "Mandatory for fetching Metadata Statement from distant sources" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/AbstractDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/AbstractDescriptor.php deleted file mode 100644 index 06dba720..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/AbstractDescriptor.php +++ /dev/null @@ -1,49 +0,0 @@ -maxRetries = $maxRetries; - $this->blockSlowdown = $blockSlowdown; - } - - public function getMaxRetries(): ?int - { - return $this->maxRetries; - } - - public function getBlockSlowdown(): ?int - { - return $this->blockSlowdown; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/AuthenticatorStatus.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/AuthenticatorStatus.php deleted file mode 100644 index a6873c8b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/AuthenticatorStatus.php +++ /dev/null @@ -1,58 +0,0 @@ -FRR = $FRR; - $this->FAR = $FAR; - $this->EER = $EER; - $this->FAAR = $FAAR; - $this->maxReferenceDataSets = $maxReferenceDataSets; - parent::__construct($maxRetries, $blockSlowdown); - } - - public function getFAR(): ?float - { - return $this->FAR; - } - - public function getFRR(): ?float - { - return $this->FRR; - } - - public function getEER(): ?float - { - return $this->EER; - } - - public function getFAAR(): ?float - { - return $this->FAAR; - } - - public function getMaxReferenceDataSets(): ?int - { - return $this->maxReferenceDataSets; - } - - public static function createFromArray(array $data): self - { - return new self( - $data['FAR'] ?? null, - $data['FRR'] ?? null, - $data['EER'] ?? null, - $data['FAAR'] ?? null, - $data['maxReferenceDataSets'] ?? null, - $data['maxRetries'] ?? null, - $data['blockSlowdown'] ?? null - ); - } - - public function jsonSerialize(): array - { - $data = [ - 'FAR' => $this->FAR, - 'FRR' => $this->FRR, - 'EER' => $this->EER, - 'FAAR' => $this->FAAR, - 'maxReferenceDataSets' => $this->maxReferenceDataSets, - 'maxRetries' => $this->getMaxRetries(), - 'blockSlowdown' => $this->getBlockSlowdown(), - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/BiometricStatusReport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/BiometricStatusReport.php deleted file mode 100644 index dae9c974..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/BiometricStatusReport.php +++ /dev/null @@ -1,118 +0,0 @@ -certLevel; - } - - public function getModality(): int - { - return $this->modality; - } - - public function getEffectiveDate(): ?string - { - return $this->effectiveDate; - } - - public function getCertificationDescriptor(): ?string - { - return $this->certificationDescriptor; - } - - public function getCertificateNumber(): ?string - { - return $this->certificateNumber; - } - - public function getCertificationPolicyVersion(): ?string - { - return $this->certificationPolicyVersion; - } - - public function getCertificationRequirementsVersion(): ?string - { - return $this->certificationRequirementsVersion; - } - - public static function createFromArray(array $data): self - { - $object = new self(); - $object->certLevel = $data['certLevel'] ?? null; - $object->modality = $data['modality'] ?? null; - $object->effectiveDate = $data['effectiveDate'] ?? null; - $object->certificationDescriptor = $data['certificationDescriptor'] ?? null; - $object->certificateNumber = $data['certificateNumber'] ?? null; - $object->certificationPolicyVersion = $data['certificationPolicyVersion'] ?? null; - $object->certificationRequirementsVersion = $data['certificationRequirementsVersion'] ?? null; - - return $object; - } - - public function jsonSerialize(): array - { - $data = [ - 'certLevel' => $this->certLevel, - 'modality' => $this->modality, - 'effectiveDate' => $this->effectiveDate, - 'certificationDescriptor' => $this->certificationDescriptor, - 'certificateNumber' => $this->certificateNumber, - 'certificationPolicyVersion' => $this->certificationPolicyVersion, - 'certificationRequirementsVersion' => $this->certificationRequirementsVersion, - ]; - - return array_filter($data, static function ($var): bool {return null !== $var; }); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/CodeAccuracyDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/CodeAccuracyDescriptor.php deleted file mode 100644 index 1ef25fa7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/CodeAccuracyDescriptor.php +++ /dev/null @@ -1,73 +0,0 @@ -base = $base; - $this->minLength = $minLength; - parent::__construct($maxRetries, $blockSlowdown); - } - - public function getBase(): int - { - return $this->base; - } - - public function getMinLength(): int - { - return $this->minLength; - } - - public static function createFromArray(array $data): self - { - Assertion::keyExists($data, 'base', Utils::logicException('The parameter "base" is missing')); - Assertion::keyExists($data, 'minLength', Utils::logicException('The parameter "minLength" is missing')); - - return new self( - $data['base'], - $data['minLength'], - $data['maxRetries'] ?? null, - $data['blockSlowdown'] ?? null - ); - } - - public function jsonSerialize(): array - { - $data = [ - 'base' => $this->base, - 'minLength' => $this->minLength, - 'maxRetries' => $this->getMaxRetries(), - 'blockSlowdown' => $this->getBlockSlowdown(), - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/DisplayPNGCharacteristicsDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/DisplayPNGCharacteristicsDescriptor.php deleted file mode 100644 index deb9e6b2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/DisplayPNGCharacteristicsDescriptor.php +++ /dev/null @@ -1,172 +0,0 @@ -width = $width; - $this->height = $height; - $this->bitDepth = $bitDepth; - $this->colorType = $colorType; - $this->compression = $compression; - $this->filter = $filter; - $this->interlace = $interlace; - } - - public function addPalette(RgbPaletteEntry $rgbPaletteEntry): self - { - $this->plte[] = $rgbPaletteEntry; - - return $this; - } - - public function getWidth(): int - { - return $this->width; - } - - public function getHeight(): int - { - return $this->height; - } - - public function getBitDepth(): int - { - return $this->bitDepth; - } - - public function getColorType(): int - { - return $this->colorType; - } - - public function getCompression(): int - { - return $this->compression; - } - - public function getFilter(): int - { - return $this->filter; - } - - public function getInterlace(): int - { - return $this->interlace; - } - - /** - * @return RgbPaletteEntry[] - */ - public function getPlte(): array - { - return $this->plte; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - foreach (['width', 'compression', 'height', 'bitDepth', 'colorType', 'compression', 'filter', 'interlace'] as $key) { - Assertion::keyExists($data, $key, sprintf('Invalid data. The key "%s" is missing', $key)); - } - $object = new self( - $data['width'], - $data['height'], - $data['bitDepth'], - $data['colorType'], - $data['compression'], - $data['filter'], - $data['interlace'] - ); - if (isset($data['plte'])) { - $plte = $data['plte']; - Assertion::isArray($plte, Utils::logicException('Invalid "plte" parameter')); - foreach ($plte as $item) { - $object->addPalette(RgbPaletteEntry::createFromArray($item)); - } - } - - return $object; - } - - public function jsonSerialize(): array - { - $data = [ - 'width' => $this->width, - 'height' => $this->height, - 'bitDepth' => $this->bitDepth, - 'colorType' => $this->colorType, - 'compression' => $this->compression, - 'filter' => $this->filter, - 'interlace' => $this->interlace, - 'plte' => $this->plte, - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/DistantSingleMetadata.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/DistantSingleMetadata.php deleted file mode 100644 index b7c2991e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/DistantSingleMetadata.php +++ /dev/null @@ -1,82 +0,0 @@ -uri = $uri; - $this->isBase64Encoded = $isBase64Encoded; - $this->httpClient = $httpClient; - $this->requestFactory = $requestFactory; - $this->additionalHeaders = $additionalHeaders; - } - - public function getMetadataStatement(): MetadataStatement - { - $payload = $this->fetch(); - $json = $this->isBase64Encoded ? Base64Url::decode($payload) : $payload; - $data = json_decode($json, true); - - return MetadataStatement::createFromArray($data); - } - - private function fetch(): string - { - $request = $this->requestFactory->createRequest('GET', $this->uri); - foreach ($this->additionalHeaders as $k => $v) { - $request = $request->withHeader($k, $v); - } - $response = $this->httpClient->sendRequest($request); - Assertion::eq(200, $response->getStatusCode(), sprintf('Unable to contact the server. Response code is %d', $response->getStatusCode())); - $content = $response->getBody()->getContents(); - Assertion::notEmpty($content, 'Unable to contact the server. The response has no content'); - - return $content; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/EcdaaTrustAnchor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/EcdaaTrustAnchor.php deleted file mode 100644 index 97a68553..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/EcdaaTrustAnchor.php +++ /dev/null @@ -1,123 +0,0 @@ -X = $X; - $this->Y = $Y; - $this->c = $c; - $this->sx = $sx; - $this->sy = $sy; - $this->G1Curve = $G1Curve; - } - - public function getX(): string - { - return $this->X; - } - - public function getY(): string - { - return $this->Y; - } - - public function getC(): string - { - return $this->c; - } - - public function getSx(): string - { - return $this->sx; - } - - public function getSy(): string - { - return $this->sy; - } - - public function getG1Curve(): string - { - return $this->G1Curve; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - foreach (['X', 'Y', 'c', 'sx', 'sy', 'G1Curve'] as $key) { - Assertion::keyExists($data, $key, sprintf('Invalid data. The key "%s" is missing', $key)); - } - - return new self( - Base64Url::decode($data['X']), - Base64Url::decode($data['Y']), - Base64Url::decode($data['c']), - Base64Url::decode($data['sx']), - Base64Url::decode($data['sy']), - $data['G1Curve'] - ); - } - - public function jsonSerialize(): array - { - $data = [ - 'X' => Base64Url::encode($this->X), - 'Y' => Base64Url::encode($this->Y), - 'c' => Base64Url::encode($this->c), - 'sx' => Base64Url::encode($this->sx), - 'sy' => Base64Url::encode($this->sy), - 'G1Curve' => $this->G1Curve, - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/ExtensionDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/ExtensionDescriptor.php deleted file mode 100644 index 3a520304..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/ExtensionDescriptor.php +++ /dev/null @@ -1,106 +0,0 @@ -id = $id; - $this->tag = $tag; - $this->data = $data; - $this->fail_if_unknown = $fail_if_unknown; - } - - public function getId(): string - { - return $this->id; - } - - public function getTag(): ?int - { - return $this->tag; - } - - public function getData(): ?string - { - return $this->data; - } - - public function isFailIfUnknown(): bool - { - return $this->fail_if_unknown; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - Assertion::keyExists($data, 'id', Utils::logicException('Invalid data. The parameter "id" is missing')); - Assertion::string($data['id'], Utils::logicException('Invalid data. The parameter "id" shall be a string')); - Assertion::keyExists($data, 'fail_if_unknown', Utils::logicException('Invalid data. The parameter "fail_if_unknown" is missing')); - Assertion::boolean($data['fail_if_unknown'], Utils::logicException('Invalid data. The parameter "fail_if_unknown" shall be a boolean')); - if (array_key_exists('tag', $data)) { - Assertion::integer($data['tag'], Utils::logicException('Invalid data. The parameter "tag" shall be a positive integer')); - } - if (array_key_exists('data', $data)) { - Assertion::string($data['data'], Utils::logicException('Invalid data. The parameter "data" shall be a string')); - } - - return new self( - $data['id'], - $data['tag'] ?? null, - $data['data'] ?? null, - $data['fail_if_unknown'] - ); - } - - public function jsonSerialize(): array - { - $result = [ - 'id' => $this->id, - 'tag' => $this->tag, - 'data' => $this->data, - 'fail_if_unknown' => $this->fail_if_unknown, - ]; - - return Utils::filterNullValues($result); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataService.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataService.php deleted file mode 100644 index 2912e098..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataService.php +++ /dev/null @@ -1,283 +0,0 @@ -serviceUri = $serviceUri; - $this->httpClient = $httpClient; - $this->requestFactory = $requestFactory; - $this->additionalQueryStringValues = $additionalQueryStringValues; - $this->additionalHeaders = $additionalHeaders; - $this->logger = $logger ?? new NullLogger(); - } - - public function addQueryStringValues(array $additionalQueryStringValues): self - { - $this->additionalQueryStringValues = $additionalQueryStringValues; - - return $this; - } - - public function addHeaders(array $additionalHeaders): self - { - $this->additionalHeaders = $additionalHeaders; - - return $this; - } - - public function setLogger(LoggerInterface $logger): self - { - $this->logger = $logger; - - return $this; - } - - public function has(string $aaguid): bool - { - try { - $toc = $this->fetchMetadataTOCPayload(); - } catch (Throwable $e) { - return false; - } - foreach ($toc->getEntries() as $entry) { - if ($entry->getAaguid() === $aaguid && null !== $entry->getUrl()) { - return true; - } - } - - return false; - } - - public function get(string $aaguid): MetadataStatement - { - $toc = $this->fetchMetadataTOCPayload(); - foreach ($toc->getEntries() as $entry) { - if ($entry->getAaguid() === $aaguid && null !== $entry->getUrl()) { - $mds = $this->fetchMetadataStatementFor($entry); - $mds - ->setStatusReports($entry->getStatusReports()) - ->setRootCertificates($toc->getRootCertificates()) - ; - - return $mds; - } - } - - throw new InvalidArgumentException(sprintf('The Metadata Statement with AAGUID "%s" is missing', $aaguid)); - } - - /** - * @deprecated This method is deprecated since v3.3 and will be removed in v4.0 - */ - public function getMetadataStatementFor(MetadataTOCPayloadEntry $entry, string $hashingFunction = 'sha256'): MetadataStatement - { - return $this->fetchMetadataStatementFor($entry, $hashingFunction); - } - - public function fetchMetadataStatementFor(MetadataTOCPayloadEntry $entry, string $hashingFunction = 'sha256'): MetadataStatement - { - $this->logger->info('Trying to get the metadata statement for a given entry', ['entry' => $entry]); - try { - $hash = $entry->getHash(); - $url = $entry->getUrl(); - if (null === $hash || null === $url) { - throw new LogicException('The Metadata Statement has not been published'); - } - $uri = $this->buildUri($url); - $result = $this->fetchMetadataStatement($uri, true, $hash, $hashingFunction); - $this->logger->info('The metadata statement exists'); - $this->logger->debug('Metadata Statement', ['mds' => $result]); - - return $result; - } catch (Throwable $throwable) { - $this->logger->error('An error occurred', [ - 'exception' => $throwable, - ]); - throw $throwable; - } - } - - /** - * @deprecated This method is deprecated since v3.3 and will be removed in v4.0 - */ - public function getMetadataTOCPayload(): MetadataTOCPayload - { - return $this->fetchMetadataTOCPayload(); - } - - private function fetchMetadataTOCPayload(): MetadataTOCPayload - { - $this->logger->info('Trying to get the metadata service TOC payload'); - try { - $uri = $this->buildUri($this->serviceUri); - $toc = $this->fetchTableOfContent($uri); - $this->logger->info('The TOC payload has been received'); - $this->logger->debug('TOC payload', ['toc' => $toc]); - - return $toc; - } catch (Throwable $throwable) { - $this->logger->error('An error occurred', [ - 'exception' => $throwable, - ]); - throw $throwable; - } - } - - private function buildUri(string $uri): string - { - $parsedUri = UriString::parse($uri); - $queryString = $parsedUri['query']; - $query = []; - if (null !== $queryString) { - parse_str($queryString, $query); - } - foreach ($this->additionalQueryStringValues as $k => $v) { - if (!isset($query[$k])) { - $query[$k] = $v; - continue; - } - if (!is_array($query[$k])) { - $query[$k] = [$query[$k], $v]; - continue; - } - $query[$k][] = $v; - } - $parsedUri['query'] = 0 === count($query) ? null : http_build_query($query, '', '&', PHP_QUERY_RFC3986); - - return UriString::build($parsedUri); - } - - private function fetchTableOfContent(string $uri): MetadataTOCPayload - { - $content = $this->fetch($uri); - $rootCertificates = []; - $payload = $this->getJwsPayload($content, $rootCertificates); - $data = json_decode($payload, true); - - $toc = MetadataTOCPayload::createFromArray($data); - $toc->setRootCertificates($rootCertificates); - - return $toc; - } - - private function fetchMetadataStatement(string $uri, bool $isBase64UrlEncoded, string $hash = '', string $hashingFunction = 'sha256'): MetadataStatement - { - $payload = $this->fetch($uri); - if ('' !== $hash) { - Assertion::true(hash_equals($hash, hash($hashingFunction, $payload, true)), 'The hash cannot be verified. The metadata statement shall be rejected'); - } - $json = $isBase64UrlEncoded ? Base64Url::decode($payload) : $payload; - $data = json_decode($json, true); - - return MetadataStatement::createFromArray($data); - } - - private function fetch(string $uri): string - { - $request = $this->requestFactory->createRequest('GET', $uri); - foreach ($this->additionalHeaders as $k => $v) { - $request = $request->withHeader($k, $v); - } - $response = $this->httpClient->sendRequest($request); - Assertion::eq(200, $response->getStatusCode(), sprintf('Unable to contact the server. Response code is %d', $response->getStatusCode())); - $content = $response->getBody()->getContents(); - Assertion::notEmpty($content, 'Unable to contact the server. The response has no content'); - - return $content; - } - - private function getJwsPayload(string $token, array &$rootCertificates): string - { - $jws = (new CompactSerializer())->unserialize($token); - Assertion::eq(1, $jws->countSignatures(), 'Invalid response from the metadata service. Only one signature shall be present.'); - $signature = $jws->getSignature(0); - $payload = $jws->getPayload(); - Assertion::notEmpty($payload, 'Invalid response from the metadata service. The token payload is empty.'); - $header = $signature->getProtectedHeader(); - Assertion::keyExists($header, 'alg', 'The "alg" parameter is missing.'); - Assertion::eq($header['alg'], 'ES256', 'The expected "alg" parameter value should be "ES256".'); - Assertion::keyExists($header, 'x5c', 'The "x5c" parameter is missing.'); - Assertion::isArray($header['x5c'], 'The "x5c" parameter should be an array.'); - $key = JWKFactory::createFromX5C($header['x5c']); - $rootCertificates = array_map(static function (string $x509): string { - return CertificateToolbox::fixPEMStructure($x509); - }, $header['x5c']); - $algorithm = new ES256(); - $isValid = $algorithm->verify($key, $signature->getEncodedProtectedHeader().'.'.$jws->getEncodedPayload(), $signature->getSignature()); - Assertion::true($isValid, 'Invalid response from the metadata service. The token signature is invalid.'); - - return $jws->getPayload(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatement.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatement.php deleted file mode 100644 index 5b915bf6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatement.php +++ /dev/null @@ -1,602 +0,0 @@ - - */ - private $statusReports = []; - - /** - * @var string[] - */ - private $rootCertificates = []; - - public static function createFromString(string $statement): self - { - $data = json_decode($statement, true); - Assertion::isArray($data, 'Invalid Metadata Statement'); - - return self::createFromArray($data); - } - - public function getLegalHeader(): ?string - { - return $this->legalHeader; - } - - public function getAaid(): ?string - { - return $this->aaid; - } - - public function getAaguid(): ?string - { - return $this->aaguid; - } - - /** - * @return string[] - */ - public function getAttestationCertificateKeyIdentifiers(): array - { - return $this->attestationCertificateKeyIdentifiers; - } - - public function getDescription(): string - { - return $this->description; - } - - /** - * @return string[] - */ - public function getAlternativeDescriptions(): array - { - return $this->alternativeDescriptions; - } - - public function getAuthenticatorVersion(): int - { - return $this->authenticatorVersion; - } - - public function getProtocolFamily(): string - { - return $this->protocolFamily; - } - - /** - * @return Version[] - */ - public function getUpv(): array - { - return $this->upv; - } - - public function getAssertionScheme(): ?string - { - return $this->assertionScheme; - } - - public function getAuthenticationAlgorithm(): ?int - { - return $this->authenticationAlgorithm; - } - - /** - * @return int[] - */ - public function getAuthenticationAlgorithms(): array - { - return $this->authenticationAlgorithms; - } - - public function getPublicKeyAlgAndEncoding(): ?int - { - return $this->publicKeyAlgAndEncoding; - } - - /** - * @return int[] - */ - public function getPublicKeyAlgAndEncodings(): array - { - return $this->publicKeyAlgAndEncodings; - } - - /** - * @return int[] - */ - public function getAttestationTypes(): array - { - return $this->attestationTypes; - } - - /** - * @return VerificationMethodANDCombinations[] - */ - public function getUserVerificationDetails(): array - { - return $this->userVerificationDetails; - } - - public function getKeyProtection(): int - { - return $this->keyProtection; - } - - public function isKeyRestricted(): ?bool - { - return (bool) $this->isKeyRestricted; - } - - public function isFreshUserVerificationRequired(): ?bool - { - return (bool) $this->isFreshUserVerificationRequired; - } - - public function getMatcherProtection(): int - { - return $this->matcherProtection; - } - - public function getCryptoStrength(): ?int - { - return $this->cryptoStrength; - } - - public function getOperatingEnv(): ?string - { - return $this->operatingEnv; - } - - public function getAttachmentHint(): int - { - return $this->attachmentHint; - } - - public function isSecondFactorOnly(): ?bool - { - return (bool) $this->isSecondFactorOnly; - } - - public function getTcDisplay(): int - { - return $this->tcDisplay; - } - - public function getTcDisplayContentType(): ?string - { - return $this->tcDisplayContentType; - } - - /** - * @return DisplayPNGCharacteristicsDescriptor[] - */ - public function getTcDisplayPNGCharacteristics(): array - { - return $this->tcDisplayPNGCharacteristics; - } - - /** - * @return string[] - */ - public function getAttestationRootCertificates(): array - { - return $this->attestationRootCertificates; - } - - /** - * @return EcdaaTrustAnchor[] - */ - public function getEcdaaTrustAnchors(): array - { - return $this->ecdaaTrustAnchors; - } - - public function getIcon(): ?string - { - return $this->icon; - } - - /** - * @return ExtensionDescriptor[] - */ - public function getSupportedExtensions(): array - { - return $this->supportedExtensions; - } - - public static function createFromArray(array $data): self - { - $object = new self(); - foreach (['description', 'protocolFamily'] as $key) { - if (!isset($data[$key])) { - throw new InvalidArgumentException(sprintf('The parameter "%s" is missing', $key)); - } - } - $object->legalHeader = $data['legalHeader'] ?? null; - $object->aaid = $data['aaid'] ?? null; - $object->aaguid = $data['aaguid'] ?? null; - $object->attestationCertificateKeyIdentifiers = $data['attestationCertificateKeyIdentifiers'] ?? []; - $object->description = $data['description']; - $object->alternativeDescriptions = $data['alternativeDescriptions'] ?? []; - $object->authenticatorVersion = $data['authenticatorVersion'] ?? 0; - $object->protocolFamily = $data['protocolFamily']; - if (isset($data['upv'])) { - $upv = $data['upv']; - Assertion::isArray($upv, 'Invalid Metadata Statement'); - foreach ($upv as $value) { - Assertion::isArray($value, 'Invalid Metadata Statement'); - $object->upv[] = Version::createFromArray($value); - } - } - $object->assertionScheme = $data['assertionScheme'] ?? null; - $object->authenticationAlgorithm = $data['authenticationAlgorithm'] ?? null; - $object->authenticationAlgorithms = $data['authenticationAlgorithms'] ?? []; - $object->publicKeyAlgAndEncoding = $data['publicKeyAlgAndEncoding'] ?? null; - $object->publicKeyAlgAndEncodings = $data['publicKeyAlgAndEncodings'] ?? []; - $object->attestationTypes = $data['attestationTypes'] ?? []; - if (isset($data['userVerificationDetails'])) { - $userVerificationDetails = $data['userVerificationDetails']; - Assertion::isArray($userVerificationDetails, 'Invalid Metadata Statement'); - foreach ($userVerificationDetails as $value) { - Assertion::isArray($value, 'Invalid Metadata Statement'); - $object->userVerificationDetails[] = VerificationMethodANDCombinations::createFromArray($value); - } - } - $object->keyProtection = $data['keyProtection'] ?? 0; - $object->isKeyRestricted = $data['isKeyRestricted'] ?? null; - $object->isFreshUserVerificationRequired = $data['isFreshUserVerificationRequired'] ?? null; - $object->matcherProtection = $data['matcherProtection'] ?? 0; - $object->cryptoStrength = $data['cryptoStrength'] ?? null; - $object->operatingEnv = $data['operatingEnv'] ?? null; - $object->attachmentHint = $data['attachmentHint'] ?? 0; - $object->isSecondFactorOnly = $data['isSecondFactorOnly'] ?? null; - $object->tcDisplay = $data['tcDisplay'] ?? 0; - $object->tcDisplayContentType = $data['tcDisplayContentType'] ?? null; - if (isset($data['tcDisplayPNGCharacteristics'])) { - $tcDisplayPNGCharacteristics = $data['tcDisplayPNGCharacteristics']; - Assertion::isArray($tcDisplayPNGCharacteristics, 'Invalid Metadata Statement'); - foreach ($tcDisplayPNGCharacteristics as $tcDisplayPNGCharacteristic) { - Assertion::isArray($tcDisplayPNGCharacteristic, 'Invalid Metadata Statement'); - $object->tcDisplayPNGCharacteristics[] = DisplayPNGCharacteristicsDescriptor::createFromArray($tcDisplayPNGCharacteristic); - } - } - $object->attestationRootCertificates = $data['attestationRootCertificates'] ?? []; - $object->ecdaaTrustAnchors = $data['ecdaaTrustAnchors'] ?? []; - $object->icon = $data['icon'] ?? null; - if (isset($data['supportedExtensions'])) { - $supportedExtensions = $data['supportedExtensions']; - Assertion::isArray($supportedExtensions, 'Invalid Metadata Statement'); - foreach ($supportedExtensions as $supportedExtension) { - Assertion::isArray($supportedExtension, 'Invalid Metadata Statement'); - $object->supportedExtensions[] = ExtensionDescriptor::createFromArray($supportedExtension); - } - } - $object->rootCertificates = $data['rootCertificates'] ?? []; - if (isset($data['statusReports'])) { - $reports = $data['statusReports']; - Assertion::isArray($reports, 'Invalid Metadata Statement'); - foreach ($reports as $report) { - Assertion::isArray($report, 'Invalid Metadata Statement'); - $object->statusReports[] = StatusReport::createFromArray($report); - } - } - - return $object; - } - - public function jsonSerialize(): array - { - $data = [ - 'legalHeader' => $this->legalHeader, - 'aaid' => $this->aaid, - 'aaguid' => $this->aaguid, - 'attestationCertificateKeyIdentifiers' => $this->attestationCertificateKeyIdentifiers, - 'description' => $this->description, - 'alternativeDescriptions' => $this->alternativeDescriptions, - 'authenticatorVersion' => $this->authenticatorVersion, - 'protocolFamily' => $this->protocolFamily, - 'upv' => $this->upv, - 'assertionScheme' => $this->assertionScheme, - 'authenticationAlgorithm' => $this->authenticationAlgorithm, - 'authenticationAlgorithms' => $this->authenticationAlgorithms, - 'publicKeyAlgAndEncoding' => $this->publicKeyAlgAndEncoding, - 'publicKeyAlgAndEncodings' => $this->publicKeyAlgAndEncodings, - 'attestationTypes' => $this->attestationTypes, - 'userVerificationDetails' => $this->userVerificationDetails, - 'keyProtection' => $this->keyProtection, - 'isKeyRestricted' => $this->isKeyRestricted, - 'isFreshUserVerificationRequired' => $this->isFreshUserVerificationRequired, - 'matcherProtection' => $this->matcherProtection, - 'cryptoStrength' => $this->cryptoStrength, - 'operatingEnv' => $this->operatingEnv, - 'attachmentHint' => $this->attachmentHint, - 'isSecondFactorOnly' => $this->isSecondFactorOnly, - 'tcDisplay' => $this->tcDisplay, - 'tcDisplayContentType' => $this->tcDisplayContentType, - 'tcDisplayPNGCharacteristics' => array_map(static function (DisplayPNGCharacteristicsDescriptor $object): array { - return $object->jsonSerialize(); - }, $this->tcDisplayPNGCharacteristics), - 'attestationRootCertificates' => $this->attestationRootCertificates, - 'ecdaaTrustAnchors' => array_map(static function (EcdaaTrustAnchor $object): array { - return $object->jsonSerialize(); - }, $this->ecdaaTrustAnchors), - 'icon' => $this->icon, - 'supportedExtensions' => array_map(static function (ExtensionDescriptor $object): array { - return $object->jsonSerialize(); - }, $this->supportedExtensions), - 'rootCertificates' => $this->rootCertificates, - 'statusReports' => $this->statusReports, - ]; - - return Utils::filterNullValues($data); - } - - /** - * @return StatusReport[] - */ - public function getStatusReports(): array - { - return $this->statusReports; - } - - /** - * @param StatusReport[] $statusReports - */ - public function setStatusReports(array $statusReports): self - { - $this->statusReports = $statusReports; - - return $this; - } - - /** - * @return string[] - */ - public function getRootCertificates(): array - { - return $this->rootCertificates; - } - - /** - * @param string[] $rootCertificates - */ - public function setRootCertificates(array $rootCertificates): self - { - $this->rootCertificates = $rootCertificates; - - return $this; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatementFetcher.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatementFetcher.php deleted file mode 100644 index b8ab6379..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatementFetcher.php +++ /dev/null @@ -1,85 +0,0 @@ -createRequest('GET', $uri); - foreach ($additionalHeaders as $k => $v) { - $request = $request->withHeader($k, $v); - } - $response = $client->sendRequest($request); - Assertion::eq(200, $response->getStatusCode(), sprintf('Unable to contact the server. Response code is %d', $response->getStatusCode())); - $content = $response->getBody()->getContents(); - Assertion::notEmpty($content, 'Unable to contact the server. The response has no content'); - - return $content; - } - - private static function getJwsPayload(string $token): string - { - $jws = (new CompactSerializer())->unserialize($token); - Assertion::eq(1, $jws->countSignatures(), 'Invalid response from the metadata service. Only one signature shall be present.'); - $signature = $jws->getSignature(0); - $payload = $jws->getPayload(); - Assertion::notEmpty($payload, 'Invalid response from the metadata service. The token payload is empty.'); - $header = $signature->getProtectedHeader(); - Assertion::keyExists($header, 'alg', 'The "alg" parameter is missing.'); - Assertion::eq($header['alg'], 'ES256', 'The expected "alg" parameter value should be "ES256".'); - Assertion::keyExists($header, 'x5c', 'The "x5c" parameter is missing.'); - Assertion::isArray($header['x5c'], 'The "x5c" parameter should be an array.'); - $key = JWKFactory::createFromX5C($header['x5c']); - $algorithm = new ES256(); - $isValid = $algorithm->verify($key, $signature->getEncodedProtectedHeader().'.'.$jws->getEncodedPayload(), $signature->getSignature()); - Assertion::true($isValid, 'Invalid response from the metadata service. The token signature is invalid.'); - - return $jws->getPayload(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatementRepository.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatementRepository.php deleted file mode 100644 index c1bd6913..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataStatementRepository.php +++ /dev/null @@ -1,26 +0,0 @@ -no = $no; - $this->nextUpdate = $nextUpdate; - $this->legalHeader = $legalHeader; - } - - public function addEntry(MetadataTOCPayloadEntry $entry): self - { - $this->entries[] = $entry; - - return $this; - } - - public function getLegalHeader(): ?string - { - return $this->legalHeader; - } - - public function getNo(): int - { - return $this->no; - } - - public function getNextUpdate(): string - { - return $this->nextUpdate; - } - - /** - * @return MetadataTOCPayloadEntry[] - */ - public function getEntries(): array - { - return $this->entries; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - foreach (['no', 'nextUpdate', 'entries'] as $key) { - Assertion::keyExists($data, $key, Utils::logicException(sprintf('Invalid data. The parameter "%s" is missing', $key))); - } - Assertion::integer($data['no'], Utils::logicException('Invalid data. The parameter "no" shall be an integer')); - Assertion::string($data['nextUpdate'], Utils::logicException('Invalid data. The parameter "nextUpdate" shall be a string')); - Assertion::isArray($data['entries'], Utils::logicException('Invalid data. The parameter "entries" shall be a n array of entries')); - if (array_key_exists('legalHeader', $data)) { - Assertion::string($data['legalHeader'], Utils::logicException('Invalid data. The parameter "legalHeader" shall be a string')); - } - $object = new self( - $data['no'], - $data['nextUpdate'], - $data['legalHeader'] ?? null - ); - foreach ($data['entries'] as $k => $entry) { - $object->addEntry(MetadataTOCPayloadEntry::createFromArray($entry)); - } - $object->rootCertificates = $data['rootCertificates'] ?? []; - - return $object; - } - - public function jsonSerialize(): array - { - $data = [ - 'legalHeader' => $this->legalHeader, - 'nextUpdate' => $this->nextUpdate, - 'no' => $this->no, - 'entries' => array_map(static function (MetadataTOCPayloadEntry $object): array { - return $object->jsonSerialize(); - }, $this->entries), - 'rootCertificates' => $this->rootCertificates, - ]; - - return Utils::filterNullValues($data); - } - - /** - * @return string[] - */ - public function getRootCertificates(): array - { - return $this->rootCertificates; - } - - /** - * @param string[] $rootCertificates - */ - public function setRootCertificates(array $rootCertificates): self - { - $this->rootCertificates = $rootCertificates; - - return $this; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataTOCPayloadEntry.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataTOCPayloadEntry.php deleted file mode 100644 index 16b1a311..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/MetadataTOCPayloadEntry.php +++ /dev/null @@ -1,188 +0,0 @@ -aaid = $aaid; - $this->aaguid = $aaguid; - $this->attestationCertificateKeyIdentifiers = $attestationCertificateKeyIdentifiers; - $this->hash = Base64Url::decode($hash); - $this->url = $url; - $this->timeOfLastStatusChange = $timeOfLastStatusChange; - $this->rogueListURL = $rogueListURL; - $this->rogueListHash = $rogueListHash; - } - - public function getAaid(): ?string - { - return $this->aaid; - } - - public function getAaguid(): ?string - { - return $this->aaguid; - } - - public function getAttestationCertificateKeyIdentifiers(): array - { - return $this->attestationCertificateKeyIdentifiers; - } - - public function getHash(): ?string - { - return $this->hash; - } - - public function getUrl(): ?string - { - return $this->url; - } - - public function addStatusReports(StatusReport $statusReport): self - { - $this->statusReports[] = $statusReport; - - return $this; - } - - /** - * @return StatusReport[] - */ - public function getStatusReports(): array - { - return $this->statusReports; - } - - public function getTimeOfLastStatusChange(): string - { - return $this->timeOfLastStatusChange; - } - - public function getRogueListURL(): string - { - return $this->rogueListURL; - } - - public function getRogueListHash(): string - { - return $this->rogueListHash; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - Assertion::keyExists($data, 'timeOfLastStatusChange', Utils::logicException('Invalid data. The parameter "timeOfLastStatusChange" is missing')); - Assertion::keyExists($data, 'statusReports', Utils::logicException('Invalid data. The parameter "statusReports" is missing')); - Assertion::isArray($data['statusReports'], Utils::logicException('Invalid data. The parameter "statusReports" shall be an array of StatusReport objects')); - $object = new self( - $data['aaid'] ?? null, - $data['aaguid'] ?? null, - $data['attestationCertificateKeyIdentifiers'] ?? [], - $data['hash'] ?? null, - $data['url'] ?? null, - $data['timeOfLastStatusChange'], - $data['rogueListURL'] ?? null, - $data['rogueListHash'] ?? null - ); - foreach ($data['statusReports'] as $statusReport) { - $object->addStatusReports(StatusReport::createFromArray($statusReport)); - } - - return $object; - } - - public function jsonSerialize(): array - { - $data = [ - 'aaid' => $this->aaid, - 'aaguid' => $this->aaguid, - 'attestationCertificateKeyIdentifiers' => $this->attestationCertificateKeyIdentifiers, - 'hash' => Base64Url::encode($this->hash), - 'url' => $this->url, - 'statusReports' => array_map(static function (StatusReport $object): array { - return $object->jsonSerialize(); - }, $this->statusReports), - 'timeOfLastStatusChange' => $this->timeOfLastStatusChange, - 'rogueListURL' => $this->rogueListURL, - 'rogueListHash' => $this->rogueListHash, - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/PatternAccuracyDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/PatternAccuracyDescriptor.php deleted file mode 100644 index 6f401b8f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/PatternAccuracyDescriptor.php +++ /dev/null @@ -1,66 +0,0 @@ -minComplexity = $minComplexity; - parent::__construct($maxRetries, $blockSlowdown); - } - - public function getMinComplexity(): int - { - return $this->minComplexity; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - Assertion::keyExists($data, 'minComplexity', Utils::logicException('The key "minComplexity" is missing')); - foreach (['minComplexity', 'maxRetries', 'blockSlowdown'] as $key) { - if (array_key_exists($key, $data)) { - Assertion::integer($data[$key], Utils::logicException(sprintf('Invalid data. The value of "%s" must be a positive integer', $key))); - } - } - - return new self( - $data['minComplexity'], - $data['maxRetries'] ?? null, - $data['blockSlowdown'] ?? null - ); - } - - public function jsonSerialize(): array - { - $data = [ - 'minComplexity' => $this->minComplexity, - 'maxRetries' => $this->getMaxRetries(), - 'blockSlowdown' => $this->getBlockSlowdown(), - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/RgbPaletteEntry.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/RgbPaletteEntry.php deleted file mode 100644 index d5eb5867..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/RgbPaletteEntry.php +++ /dev/null @@ -1,84 +0,0 @@ -r = $r; - $this->g = $g; - $this->b = $b; - } - - public function getR(): int - { - return $this->r; - } - - public function getG(): int - { - return $this->g; - } - - public function getB(): int - { - return $this->b; - } - - public static function createFromArray(array $data): self - { - foreach (['r', 'g', 'b'] as $key) { - Assertion::keyExists($data, $key, sprintf('The key "%s" is missing', $key)); - Assertion::integer($data[$key], sprintf('The key "%s" is invalid', $key)); - } - - return new self( - $data['r'], - $data['g'], - $data['b'] - ); - } - - public function jsonSerialize(): array - { - return [ - 'r' => $this->r, - 'g' => $this->g, - 'b' => $this->b, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/RogueListEntry.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/RogueListEntry.php deleted file mode 100644 index 83c1d447..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/RogueListEntry.php +++ /dev/null @@ -1,67 +0,0 @@ -sk = $sk; - $this->date = $date; - } - - public function getSk(): string - { - return $this->sk; - } - - public function getDate(): ?string - { - return $this->date; - } - - public static function createFromArray(array $data): self - { - Assertion::keyExists($data, 'sk', 'The key "sk" is missing'); - Assertion::string($data['sk'], 'The key "sk" is invalid'); - Assertion::keyExists($data, 'date', 'The key "date" is missing'); - Assertion::string($data['date'], 'The key "date" is invalid'); - - return new self( - $data['sk'], - $data['date'] - ); - } - - public function jsonSerialize(): array - { - return [ - 'sk' => $this->sk, - 'date' => $this->date, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/SingleMetadata.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/SingleMetadata.php deleted file mode 100644 index f3e3cd4c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/SingleMetadata.php +++ /dev/null @@ -1,53 +0,0 @@ -data = $data; - $this->isBase64Encoded = $isBase64Encoded; - } - - public function getMetadataStatement(): MetadataStatement - { - if (null === $this->statement) { - $json = $this->data; - if ($this->isBase64Encoded) { - $json = base64_decode($this->data, true); - } - $statement = json_decode($json, true); - $this->statement = MetadataStatement::createFromArray($statement); - } - - return $this->statement; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/StatusReport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/StatusReport.php deleted file mode 100644 index 60166384..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/StatusReport.php +++ /dev/null @@ -1,166 +0,0 @@ -status = $status; - $this->effectiveDate = $effectiveDate; - $this->certificate = $certificate; - $this->url = $url; - $this->certificationDescriptor = $certificationDescriptor; - $this->certificateNumber = $certificateNumber; - $this->certificationPolicyVersion = $certificationPolicyVersion; - $this->certificationRequirementsVersion = $certificationRequirementsVersion; - } - - public function isCompromised(): bool - { - return in_array($this->status, [ - AuthenticatorStatus::ATTESTATION_KEY_COMPROMISE, - AuthenticatorStatus::USER_KEY_PHYSICAL_COMPROMISE, - AuthenticatorStatus::USER_KEY_REMOTE_COMPROMISE, - AuthenticatorStatus::USER_VERIFICATION_BYPASS, - ], true); - } - - public function getStatus(): string - { - return $this->status; - } - - public function getEffectiveDate(): ?string - { - return $this->effectiveDate; - } - - public function getCertificate(): ?string - { - return $this->certificate; - } - - public function getUrl(): ?string - { - return $this->url; - } - - public function getCertificationDescriptor(): ?string - { - return $this->certificationDescriptor; - } - - public function getCertificateNumber(): ?string - { - return $this->certificateNumber; - } - - public function getCertificationPolicyVersion(): ?string - { - return $this->certificationPolicyVersion; - } - - public function getCertificationRequirementsVersion(): ?string - { - return $this->certificationRequirementsVersion; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - Assertion::keyExists($data, 'status', Utils::logicException('The key "status" is missing')); - foreach (['effectiveDate', 'certificate', 'url', 'certificationDescriptor', 'certificateNumber', 'certificationPolicyVersion', 'certificationRequirementsVersion'] as $key) { - if (isset($data[$key])) { - Assertion::nullOrString($data[$key], Utils::logicException(sprintf('The value of the key "%s" is invalid', $key))); - } - } - - return new self( - $data['status'], - $data['effectiveDate'] ?? null, - $data['certificate'] ?? null, - $data['url'] ?? null, - $data['certificationDescriptor'] ?? null, - $data['certificateNumber'] ?? null, - $data['certificationPolicyVersion'] ?? null, - $data['certificationRequirementsVersion'] ?? null - ); - } - - public function jsonSerialize(): array - { - $data = [ - 'status' => $this->status, - 'effectiveDate' => $this->effectiveDate, - 'certificate' => $this->certificate, - 'url' => $this->url, - 'certificationDescriptor' => $this->certificationDescriptor, - 'certificateNumber' => $this->certificateNumber, - 'certificationPolicyVersion' => $this->certificationPolicyVersion, - 'certificationRequirementsVersion' => $this->certificationRequirementsVersion, - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/Utils.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/Utils.php deleted file mode 100644 index 469475a8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/Utils.php +++ /dev/null @@ -1,35 +0,0 @@ -verificationMethods[] = $verificationMethodDescriptor; - - return $this; - } - - /** - * @return VerificationMethodDescriptor[] - */ - public function getVerificationMethods(): array - { - return $this->verificationMethods; - } - - public static function createFromArray(array $data): self - { - $object = new self(); - - foreach ($data as $datum) { - Assertion::isArray($datum, Utils::logicException('Invalid data')); - $object->addVerificationMethodDescriptor(VerificationMethodDescriptor::createFromArray($datum)); - } - - return $object; - } - - public function jsonSerialize(): array - { - return array_map(static function (VerificationMethodDescriptor $object): array { - return $object->jsonSerialize(); - }, $this->verificationMethods); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/VerificationMethodDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/VerificationMethodDescriptor.php deleted file mode 100644 index 0105900d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/VerificationMethodDescriptor.php +++ /dev/null @@ -1,168 +0,0 @@ -userVerification = $userVerification; - $this->caDesc = $caDesc; - $this->baDesc = $baDesc; - $this->paDesc = $paDesc; - } - - public function getUserVerification(): int - { - return $this->userVerification; - } - - public function userPresence(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_PRESENCE); - } - - public function fingerprint(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_FINGERPRINT); - } - - public function passcode(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_PASSCODE); - } - - public function voicePrint(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_VOICEPRINT); - } - - public function facePrint(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_FACEPRINT); - } - - public function location(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_LOCATION); - } - - public function eyePrint(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_EYEPRINT); - } - - public function pattern(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_PATTERN); - } - - public function handprint(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_HANDPRINT); - } - - public function none(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_NONE); - } - - public function all(): bool - { - return 0 !== ($this->userVerification & self::USER_VERIFY_ALL); - } - - public function getCaDesc(): ?CodeAccuracyDescriptor - { - return $this->caDesc; - } - - public function getBaDesc(): ?BiometricAccuracyDescriptor - { - return $this->baDesc; - } - - public function getPaDesc(): ?PatternAccuracyDescriptor - { - return $this->paDesc; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - Assertion::keyExists($data, 'userVerification', Utils::logicException('The parameter "userVerification" is missing')); - Assertion::integer($data['userVerification'], Utils::logicException('The parameter "userVerification" is invalid')); - foreach (['caDesc', 'baDesc', 'paDesc'] as $key) { - if (isset($data[$key])) { - Assertion::isArray($data[$key], Utils::logicException(sprintf('Invalid parameter "%s"', $key))); - } - } - - return new self( - $data['userVerification'], - isset($data['caDesc']) ? CodeAccuracyDescriptor::createFromArray($data['caDesc']) : null, - isset($data['baDesc']) ? BiometricAccuracyDescriptor::createFromArray($data['baDesc']) : null, - isset($data['paDesc']) ? PatternAccuracyDescriptor::createFromArray($data['paDesc']) : null - ); - } - - public function jsonSerialize(): array - { - $data = [ - 'userVerification' => $this->userVerification, - 'caDesc' => null === $this->caDesc ? null : $this->caDesc->jsonSerialize(), - 'baDesc' => null === $this->baDesc ? null : $this->baDesc->jsonSerialize(), - 'paDesc' => null === $this->paDesc ? null : $this->paDesc->jsonSerialize(), - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/Version.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/Version.php deleted file mode 100644 index 53efda8a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/metadata-service/src/Version.php +++ /dev/null @@ -1,80 +0,0 @@ -major = $major; - $this->minor = $minor; - } - - public function getMajor(): ?int - { - return $this->major; - } - - public function getMinor(): ?int - { - return $this->minor; - } - - public static function createFromArray(array $data): self - { - $data = Utils::filterNullValues($data); - foreach (['major', 'minor'] as $key) { - if (array_key_exists($key, $data)) { - Assertion::integer($data[$key], sprintf('Invalid value for key "%s"', $key)); - } - } - - return new self( - $data['major'] ?? null, - $data['minor'] ?? null - ); - } - - public function jsonSerialize(): array - { - $data = [ - 'major' => $this->major, - 'minor' => $this->minor, - ]; - - return Utils::filterNullValues($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/LICENSE deleted file mode 100644 index 25cfdd66..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Spomky-Labs - -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/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/composer.json deleted file mode 100644 index 72ff1da9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "web-auth/webauthn-lib", - "type": "library", - "license": "MIT", - "description": "FIDO2/Webauthn Support For PHP", - "keywords": ["FIDO", "FIDO2", "webauthn"], - "homepage": "https://github.com/web-auth", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-auth/webauthn-library/contributors" - } - ], - "require": { - "php": ">=7.2", - "ext-json": "*", - "ext-openssl": "*", - "ext-mbstring": "*", - "beberlei/assert": "^3.2", - "fgrosse/phpasn1": "^2.1", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "psr/log": "^1.1", - "ramsey/uuid": "^3.8|^4.0", - "spomky-labs/base64url": "^2.0", - "spomky-labs/cbor-php": "^1.0|^2.0", - "symfony/process": "^3.0|^4.0|^5.0", - "thecodingmachine/safe": "^1.1", - "web-auth/cose-lib": "self.version", - "web-auth/metadata-service": "self.version" - }, - "autoload": { - "psr-4": { - "Webauthn\\": "src/" - } - }, - "suggest": { - "psr/log-implementation": "Recommended to receive logs from the library", - "web-token/jwt-key-mgmt": "Mandatory for the AndroidSafetyNet Attestation Statement support", - "web-token/jwt-signature-algorithm-rsa": "Mandatory for the AndroidSafetyNet Attestation Statement support", - "web-token/jwt-signature-algorithm-ecdsa": "Recommended for the AndroidSafetyNet Attestation Statement support", - "web-token/jwt-signature-algorithm-eddsa": "Recommended for the AndroidSafetyNet Attestation Statement support" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php deleted file mode 100644 index 308bd955..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php +++ /dev/null @@ -1,147 +0,0 @@ -decoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - } - - public function name(): string - { - return 'android-key'; - } - - /** - * @param mixed[] $attestation - */ - public function load(array $attestation): AttestationStatement - { - Assertion::keyExists($attestation, 'attStmt', 'Invalid attestation object'); - foreach (['sig', 'x5c', 'alg'] as $key) { - Assertion::keyExists($attestation['attStmt'], $key, sprintf('The attestation statement value "%s" is missing.', $key)); - } - $certificates = $attestation['attStmt']['x5c']; - Assertion::isArray($certificates, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - Assertion::greaterThan(count($certificates), 0, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - Assertion::allString($certificates, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - $certificates = CertificateToolbox::convertAllDERToPEM($certificates); - - return AttestationStatement::createBasic($attestation['fmt'], $attestation['attStmt'], new CertificateTrustPath($certificates)); - } - - public function isValid(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - $trustPath = $attestationStatement->getTrustPath(); - Assertion::isInstanceOf($trustPath, CertificateTrustPath::class, 'Invalid trust path'); - - $certificates = $trustPath->getCertificates(); - - //Decode leaf attestation certificate - $leaf = $certificates[0]; - $this->checkCertificateAndGetPublicKey($leaf, $clientDataJSONHash, $authenticatorData); - - $signedData = $authenticatorData->getAuthData().$clientDataJSONHash; - $alg = $attestationStatement->get('alg'); - - return 1 === openssl_verify($signedData, $attestationStatement->get('sig'), $leaf, Algorithms::getOpensslAlgorithmFor((int) $alg)); - } - - private function checkCertificateAndGetPublicKey(string $certificate, string $clientDataHash, AuthenticatorData $authenticatorData): void - { - $resource = openssl_pkey_get_public($certificate); - $details = openssl_pkey_get_details($resource); - Assertion::isArray($details, 'Unable to read the certificate'); - - //Check that authData publicKey matches the public key in the attestation certificate - $attestedCredentialData = $authenticatorData->getAttestedCredentialData(); - Assertion::notNull($attestedCredentialData, 'No attested credential data found'); - $publicKeyData = $attestedCredentialData->getCredentialPublicKey(); - Assertion::notNull($publicKeyData, 'No attested public key found'); - $publicDataStream = new StringStream($publicKeyData); - $coseKey = $this->decoder->decode($publicDataStream)->getNormalizedData(false); - Assertion::true($publicDataStream->isEOF(), 'Invalid public key data. Presence of extra bytes.'); - $publicDataStream->close(); - $publicKey = Key::createFromData($coseKey); - - Assertion::true(($publicKey instanceof Ec2Key) || ($publicKey instanceof RsaKey), 'Unsupported key type'); - Assertion::eq($publicKey->asPEM(), $details['key'], 'Invalid key'); - - /*---------------------------*/ - $certDetails = openssl_x509_parse($certificate); - - //Find Android KeyStore Extension with OID “1.3.6.1.4.1.11129.2.1.17” in certificate extensions - Assertion::isArray($certDetails, 'The certificate is not valid'); - Assertion::keyExists($certDetails, 'extensions', 'The certificate has no extension'); - Assertion::isArray($certDetails['extensions'], 'The certificate has no extension'); - Assertion::keyExists($certDetails['extensions'], '1.3.6.1.4.1.11129.2.1.17', 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is missing'); - $extension = $certDetails['extensions']['1.3.6.1.4.1.11129.2.1.17']; - $extensionAsAsn1 = ASNObject::fromBinary($extension); - Assertion::isInstanceOf($extensionAsAsn1, Sequence::class, 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is invalid'); - $objects = $extensionAsAsn1->getChildren(); - - //Check that attestationChallenge is set to the clientDataHash. - Assertion::keyExists($objects, 4, 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is invalid'); - Assertion::isInstanceOf($objects[4], OctetString::class, 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is invalid'); - Assertion::eq($clientDataHash, hex2bin(($objects[4])->getContent()), 'The client data hash is not valid'); - - //Check that both teeEnforced and softwareEnforced structures don’t contain allApplications(600) tag. - Assertion::keyExists($objects, 6, 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is invalid'); - $softwareEnforcedFlags = $objects[6]; - Assertion::isInstanceOf($softwareEnforcedFlags, Sequence::class, 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is invalid'); - $this->checkAbsenceOfAllApplicationsTag($softwareEnforcedFlags); - - Assertion::keyExists($objects, 7, 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is invalid'); - $teeEnforcedFlags = $objects[6]; - Assertion::isInstanceOf($teeEnforcedFlags, Sequence::class, 'The certificate extension "1.3.6.1.4.1.11129.2.1.17" is invalid'); - $this->checkAbsenceOfAllApplicationsTag($teeEnforcedFlags); - } - - private function checkAbsenceOfAllApplicationsTag(Sequence $sequence): void - { - foreach ($sequence->getChildren() as $tag) { - Assertion::isInstanceOf($tag, ExplicitlyTaggedObject::class, 'Invalid tag'); - /* @var ExplicitlyTaggedObject $tag */ - Assertion::notEq(600, (int) $tag->getTag(), 'Forbidden tag 600 found'); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php deleted file mode 100644 index 29286ba7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php +++ /dev/null @@ -1,292 +0,0 @@ -jwsSerializer = new CompactSerializer(); - $this->initJwsVerifier(); - - //To be removed in 4.0 - $this->leeway = $leeway ?? 0; - $this->maxAge = $maxAge ?? 60000; - $this->apiKey = $apiKey; - $this->client = $client; - $this->requestFactory = $requestFactory; - } - - public function enableApiVerification(ClientInterface $client, string $apiKey, RequestFactoryInterface $requestFactory): self - { - $this->apiKey = $apiKey; - $this->client = $client; - $this->requestFactory = $requestFactory; - - return $this; - } - - public function setMaxAge(int $maxAge): self - { - $this->maxAge = $maxAge; - - return $this; - } - - public function setLeeway(int $leeway): self - { - $this->leeway = $leeway; - - return $this; - } - - public function name(): string - { - return 'android-safetynet'; - } - - /** - * @param mixed[] $attestation - */ - public function load(array $attestation): AttestationStatement - { - Assertion::keyExists($attestation, 'attStmt', 'Invalid attestation object'); - foreach (['ver', 'response'] as $key) { - Assertion::keyExists($attestation['attStmt'], $key, sprintf('The attestation statement value "%s" is missing.', $key)); - Assertion::notEmpty($attestation['attStmt'][$key], sprintf('The attestation statement value "%s" is empty.', $key)); - } - $jws = $this->jwsSerializer->unserialize($attestation['attStmt']['response']); - $jwsHeader = $jws->getSignature(0)->getProtectedHeader(); - Assertion::keyExists($jwsHeader, 'x5c', 'The response in the attestation statement must contain a "x5c" header.'); - Assertion::notEmpty($jwsHeader['x5c'], 'The "x5c" parameter in the attestation statement response must contain at least one certificate.'); - $certificates = $this->convertCertificatesToPem($jwsHeader['x5c']); - $attestation['attStmt']['jws'] = $jws; - - return AttestationStatement::createBasic( - $this->name(), - $attestation['attStmt'], - new CertificateTrustPath($certificates) - ); - } - - public function isValid(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - $trustPath = $attestationStatement->getTrustPath(); - Assertion::isInstanceOf($trustPath, CertificateTrustPath::class, 'Invalid trust path'); - $certificates = $trustPath->getCertificates(); - $firstCertificate = current($certificates); - Assertion::string($firstCertificate, 'No certificate'); - - $parsedCertificate = openssl_x509_parse($firstCertificate); - Assertion::isArray($parsedCertificate, 'Invalid attestation object'); - Assertion::keyExists($parsedCertificate, 'subject', 'Invalid attestation object'); - Assertion::keyExists($parsedCertificate['subject'], 'CN', 'Invalid attestation object'); - Assertion::eq($parsedCertificate['subject']['CN'], 'attest.android.com', 'Invalid attestation object'); - - /** @var JWS $jws */ - $jws = $attestationStatement->get('jws'); - $payload = $jws->getPayload(); - $this->validatePayload($payload, $clientDataJSONHash, $authenticatorData); - - //Check the signature - $this->validateSignature($jws, $trustPath); - - //Check against Google service - $this->validateUsingGoogleApi($attestationStatement); - - return true; - } - - private function validatePayload(?string $payload, string $clientDataJSONHash, AuthenticatorData $authenticatorData): void - { - Assertion::notNull($payload, 'Invalid attestation object'); - $payload = JsonConverter::decode($payload); - Assertion::isArray($payload, 'Invalid attestation object'); - Assertion::keyExists($payload, 'nonce', 'Invalid attestation object. "nonce" is missing.'); - Assertion::eq($payload['nonce'], base64_encode(hash('sha256', $authenticatorData->getAuthData().$clientDataJSONHash, true)), 'Invalid attestation object. Invalid nonce'); - Assertion::keyExists($payload, 'ctsProfileMatch', 'Invalid attestation object. "ctsProfileMatch" is missing.'); - Assertion::true($payload['ctsProfileMatch'], 'Invalid attestation object. "ctsProfileMatch" value is false.'); - Assertion::keyExists($payload, 'timestampMs', 'Invalid attestation object. Timestamp is missing.'); - Assertion::integer($payload['timestampMs'], 'Invalid attestation object. Timestamp shall be an integer.'); - $currentTime = time() * 1000; - Assertion::lessOrEqualThan($payload['timestampMs'], $currentTime + $this->leeway, sprintf('Invalid attestation object. Issued in the future. Current time: %d. Response time: %d', $currentTime, $payload['timestampMs'])); - Assertion::lessOrEqualThan($currentTime - $payload['timestampMs'], $this->maxAge, sprintf('Invalid attestation object. Too old. Current time: %d. Response time: %d', $currentTime, $payload['timestampMs'])); - } - - private function validateSignature(JWS $jws, CertificateTrustPath $trustPath): void - { - $jwk = JWKFactory::createFromCertificate($trustPath->getCertificates()[0]); - $isValid = $this->jwsVerifier->verifyWithKey($jws, $jwk, 0); - Assertion::true($isValid, 'Invalid response signature'); - } - - private function validateUsingGoogleApi(AttestationStatement $attestationStatement): void - { - if (null === $this->client || null === $this->apiKey || null === $this->requestFactory) { - return; - } - $uri = sprintf('https://www.googleapis.com/androidcheck/v1/attestations/verify?key=%s', urlencode($this->apiKey)); - $requestBody = sprintf('{"signedAttestation":"%s"}', $attestationStatement->get('response')); - $request = $this->requestFactory->createRequest('POST', $uri); - $request = $request->withHeader('content-type', 'application/json'); - $request->getBody()->write($requestBody); - - $response = $this->client->sendRequest($request); - $this->checkGoogleApiResponse($response); - $responseBody = $this->getResponseBody($response); - $responseBodyJson = json_decode($responseBody, true); - Assertion::keyExists($responseBodyJson, 'isValidSignature', 'Invalid response.'); - Assertion::boolean($responseBodyJson['isValidSignature'], 'Invalid response.'); - Assertion::true($responseBodyJson['isValidSignature'], 'Invalid response.'); - } - - private function getResponseBody(ResponseInterface $response): string - { - $responseBody = ''; - $response->getBody()->rewind(); - while (true) { - $tmp = $response->getBody()->read(1024); - if ('' === $tmp) { - break; - } - $responseBody .= $tmp; - } - - return $responseBody; - } - - private function checkGoogleApiResponse(ResponseInterface $response): void - { - Assertion::eq(200, $response->getStatusCode(), 'Request did not succeeded'); - Assertion::true($response->hasHeader('content-type'), 'Unrecognized response'); - - foreach ($response->getHeader('content-type') as $header) { - if (0 === mb_strpos($header, 'application/json')) { - return; - } - } - - throw new InvalidArgumentException('Unrecognized response'); - } - - /** - * @param string[] $certificates - * - * @return string[] - */ - private function convertCertificatesToPem(array $certificates): array - { - foreach ($certificates as $k => $v) { - $certificates[$k] = CertificateToolbox::fixPEMStructure($v); - } - - return $certificates; - } - - private function initJwsVerifier(): void - { - $algorithmClasses = [ - Algorithm\RS256::class, Algorithm\RS384::class, Algorithm\RS512::class, - Algorithm\PS256::class, Algorithm\PS384::class, Algorithm\PS512::class, - Algorithm\ES256::class, Algorithm\ES384::class, Algorithm\ES512::class, - Algorithm\EdDSA::class, - ]; - /* @var AlgorithmInterface[] $algorithms */ - $algorithms = []; - foreach ($algorithmClasses as $algorithm) { - if (class_exists($algorithm)) { - /* @var AlgorithmInterface $algorithm */ - $algorithms[] = new $algorithm(); - } - } - $algorithmManager = new AlgorithmManager($algorithms); - $this->jwsVerifier = new JWSVerifier($algorithmManager); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AppleAttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AppleAttestationStatementSupport.php deleted file mode 100644 index 53ee6480..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AppleAttestationStatementSupport.php +++ /dev/null @@ -1,119 +0,0 @@ -decoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - } - - public function name(): string - { - return 'apple'; - } - - /** - * @param mixed[] $attestation - */ - public function load(array $attestation): AttestationStatement - { - Assertion::keyExists($attestation, 'attStmt', 'Invalid attestation object'); - foreach (['x5c'] as $key) { - Assertion::keyExists($attestation['attStmt'], $key, sprintf('The attestation statement value "%s" is missing.', $key)); - } - $certificates = $attestation['attStmt']['x5c']; - Assertion::isArray($certificates, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - Assertion::greaterThan(count($certificates), 0, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - Assertion::allString($certificates, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - $certificates = CertificateToolbox::convertAllDERToPEM($certificates); - - return AttestationStatement::createAnonymizationCA($attestation['fmt'], $attestation['attStmt'], new CertificateTrustPath($certificates)); - } - - public function isValid(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - $trustPath = $attestationStatement->getTrustPath(); - Assertion::isInstanceOf($trustPath, CertificateTrustPath::class, 'Invalid trust path'); - - $certificates = $trustPath->getCertificates(); - - //Decode leaf attestation certificate - $leaf = $certificates[0]; - - $this->checkCertificateAndGetPublicKey($leaf, $clientDataJSONHash, $authenticatorData); - - return true; - } - - private function checkCertificateAndGetPublicKey(string $certificate, string $clientDataHash, AuthenticatorData $authenticatorData): void - { - $resource = openssl_pkey_get_public($certificate); - $details = openssl_pkey_get_details($resource); - Assertion::isArray($details, 'Unable to read the certificate'); - - //Check that authData publicKey matches the public key in the attestation certificate - $attestedCredentialData = $authenticatorData->getAttestedCredentialData(); - Assertion::notNull($attestedCredentialData, 'No attested credential data found'); - $publicKeyData = $attestedCredentialData->getCredentialPublicKey(); - Assertion::notNull($publicKeyData, 'No attested public key found'); - $publicDataStream = new StringStream($publicKeyData); - $coseKey = $this->decoder->decode($publicDataStream)->getNormalizedData(false); - Assertion::true($publicDataStream->isEOF(), 'Invalid public key data. Presence of extra bytes.'); - $publicDataStream->close(); - $publicKey = Key::createFromData($coseKey); - - Assertion::true(($publicKey instanceof Ec2Key) || ($publicKey instanceof RsaKey), 'Unsupported key type'); - - //We check the attested key corresponds to the key in the certificate - Assertion::eq($publicKey->asPEM(), $details['key'], 'Invalid key'); - - /*---------------------------*/ - $certDetails = openssl_x509_parse($certificate); - - //Find Apple Extension with OID “1.2.840.113635.100.8.2” in certificate extensions - Assertion::isArray($certDetails, 'The certificate is not valid'); - Assertion::keyExists($certDetails, 'extensions', 'The certificate has no extension'); - Assertion::isArray($certDetails['extensions'], 'The certificate has no extension'); - Assertion::keyExists($certDetails['extensions'], '1.2.840.113635.100.8.2', 'The certificate extension "1.2.840.113635.100.8.2" is missing'); - $extension = $certDetails['extensions']['1.2.840.113635.100.8.2']; - - $nonceToHash = $authenticatorData->getAuthData().$clientDataHash; - $nonce = hash('sha256', $nonceToHash); - - //'3024a1220420' corresponds to the Sequence+Explicitly Tagged Object + Octet Object - Assertion::eq('3024a1220420'.$nonce, bin2hex($extension), 'The client data hash is not valid'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationObject.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationObject.php deleted file mode 100644 index 47d0bc93..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationObject.php +++ /dev/null @@ -1,81 +0,0 @@ -rawAttestationObject = $rawAttestationObject; - $this->attStmt = $attStmt; - $this->authData = $authData; - $this->metadataStatement = $metadataStatement; - } - - public function getRawAttestationObject(): string - { - return $this->rawAttestationObject; - } - - public function getAttStmt(): AttestationStatement - { - return $this->attStmt; - } - - public function setAttStmt(AttestationStatement $attStmt): void - { - $this->attStmt = $attStmt; - } - - public function getAuthData(): AuthenticatorData - { - return $this->authData; - } - - public function getMetadataStatement(): ?MetadataStatement - { - return $this->metadataStatement; - } - - public function setMetadataStatement(MetadataStatement $metadataStatement): self - { - $this->metadataStatement = $metadataStatement; - - return $this; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationObjectLoader.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationObjectLoader.php deleted file mode 100644 index f02e19e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationObjectLoader.php +++ /dev/null @@ -1,148 +0,0 @@ -decoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - $this->attestationStatementSupportManager = $attestationStatementSupportManager; - $this->logger = $logger ?? new NullLogger(); - } - - public static function create(AttestationStatementSupportManager $attestationStatementSupportManager): self - { - return new self($attestationStatementSupportManager); - } - - public function load(string $data): AttestationObject - { - try { - $this->logger->info('Trying to load the data', ['data' => $data]); - $decodedData = Base64Url::decode($data); - $stream = new StringStream($decodedData); - $parsed = $this->decoder->decode($stream); - - $this->logger->info('Loading the Attestation Statement'); - $attestationObject = $parsed->getNormalizedData(); - Assertion::true($stream->isEOF(), 'Invalid attestation object. Presence of extra bytes.'); - $stream->close(); - Assertion::isArray($attestationObject, 'Invalid attestation object'); - Assertion::keyExists($attestationObject, 'authData', 'Invalid attestation object'); - Assertion::keyExists($attestationObject, 'fmt', 'Invalid attestation object'); - Assertion::keyExists($attestationObject, 'attStmt', 'Invalid attestation object'); - $authData = $attestationObject['authData']; - - $attestationStatementSupport = $this->attestationStatementSupportManager->get($attestationObject['fmt']); - $attestationStatement = $attestationStatementSupport->load($attestationObject); - $this->logger->info('Attestation Statement loaded'); - $this->logger->debug('Attestation Statement loaded', ['attestationStatement' => $attestationStatement]); - - $authDataStream = new StringStream($authData); - $rp_id_hash = $authDataStream->read(32); - $flags = $authDataStream->read(1); - $signCount = $authDataStream->read(4); - $signCount = unpack('N', $signCount)[1]; - $this->logger->debug(sprintf('Signature counter: %d', $signCount)); - - $attestedCredentialData = null; - if (0 !== (ord($flags) & self::FLAG_AT)) { - $this->logger->info('Attested Credential Data is present'); - $aaguid = Uuid::fromBytes($authDataStream->read(16)); - $credentialLength = $authDataStream->read(2); - $credentialLength = unpack('n', $credentialLength)[1]; - $credentialId = $authDataStream->read($credentialLength); - $credentialPublicKey = $this->decoder->decode($authDataStream); - Assertion::isInstanceOf($credentialPublicKey, MapObject::class, 'The data does not contain a valid credential public key.'); - $attestedCredentialData = new AttestedCredentialData($aaguid, $credentialId, (string) $credentialPublicKey); - $this->logger->info('Attested Credential Data loaded'); - $this->logger->debug('Attested Credential Data loaded', ['at' => $attestedCredentialData]); - } - - $extension = null; - if (0 !== (ord($flags) & self::FLAG_ED)) { - $this->logger->info('Extension Data loaded'); - $extension = $this->decoder->decode($authDataStream); - $extension = AuthenticationExtensionsClientOutputsLoader::load($extension); - $this->logger->info('Extension Data loaded'); - $this->logger->debug('Extension Data loaded', ['ed' => $extension]); - } - Assertion::true($authDataStream->isEOF(), 'Invalid authentication data. Presence of extra bytes.'); - $authDataStream->close(); - - $authenticatorData = new AuthenticatorData($authData, $rp_id_hash, $flags, $signCount, $attestedCredentialData, $extension); - $attestationObject = new AttestationObject($data, $attestationStatement, $authenticatorData); - $this->logger->info('Attestation Object loaded'); - $this->logger->debug('Attestation Object', ['ed' => $attestationObject]); - - return $attestationObject; - } catch (Throwable $throwable) { - $this->logger->error('An error occurred', [ - 'exception' => $throwable, - ]); - throw $throwable; - } - } - - public function setLogger(LoggerInterface $logger): self - { - $this->logger = $logger; - - return $this; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatement.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatement.php deleted file mode 100644 index 1622f64b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatement.php +++ /dev/null @@ -1,175 +0,0 @@ -fmt = $fmt; - $this->attStmt = $attStmt; - $this->type = $type; - $this->trustPath = $trustPath; - } - - /** - * @param mixed[] $attStmt - */ - public static function createNone(string $fmt, array $attStmt, TrustPath $trustPath): self - { - return new self($fmt, $attStmt, self::TYPE_NONE, $trustPath); - } - - /** - * @param mixed[] $attStmt - */ - public static function createBasic(string $fmt, array $attStmt, TrustPath $trustPath): self - { - return new self($fmt, $attStmt, self::TYPE_BASIC, $trustPath); - } - - /** - * @param mixed[] $attStmt - */ - public static function createSelf(string $fmt, array $attStmt, TrustPath $trustPath): self - { - return new self($fmt, $attStmt, self::TYPE_SELF, $trustPath); - } - - /** - * @param mixed[] $attStmt - */ - public static function createAttCA(string $fmt, array $attStmt, TrustPath $trustPath): self - { - return new self($fmt, $attStmt, self::TYPE_ATTCA, $trustPath); - } - - /** - * @param mixed[] $attStmt - */ - public static function createEcdaa(string $fmt, array $attStmt, TrustPath $trustPath): self - { - return new self($fmt, $attStmt, self::TYPE_ECDAA, $trustPath); - } - - public static function createAnonymizationCA(string $fmt, array $attStmt, TrustPath $trustPath): self - { - return new self($fmt, $attStmt, self::TYPE_ANONCA, $trustPath); - } - - public function getFmt(): string - { - return $this->fmt; - } - - /** - * @return mixed[] - */ - public function getAttStmt(): array - { - return $this->attStmt; - } - - public function has(string $key): bool - { - return array_key_exists($key, $this->attStmt); - } - - /** - * @return mixed - */ - public function get(string $key) - { - Assertion::true($this->has($key), sprintf('The attestation statement has no key "%s".', $key)); - - return $this->attStmt[$key]; - } - - public function getTrustPath(): TrustPath - { - return $this->trustPath; - } - - public function getType(): string - { - return $this->type; - } - - /** - * @param mixed[] $data - */ - public static function createFromArray(array $data): self - { - foreach (['fmt', 'attStmt', 'trustPath', 'type'] as $key) { - Assertion::keyExists($data, $key, sprintf('The key "%s" is missing', $key)); - } - - return new self( - $data['fmt'], - $data['attStmt'], - $data['type'], - TrustPathLoader::loadTrustPath($data['trustPath']) - ); - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - return [ - 'fmt' => $this->fmt, - 'attStmt' => $this->attStmt, - 'trustPath' => $this->trustPath->jsonSerialize(), - 'type' => $this->type, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatementSupport.php deleted file mode 100644 index 76f1dd43..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/AttestationStatementSupport.php +++ /dev/null @@ -1,28 +0,0 @@ -attestationStatementSupports[$attestationStatementSupport->name()] = $attestationStatementSupport; - } - - public function has(string $name): bool - { - return array_key_exists($name, $this->attestationStatementSupports); - } - - public function get(string $name): AttestationStatementSupport - { - Assertion::true($this->has($name), sprintf('The attestation statement format "%s" is not supported.', $name)); - - return $this->attestationStatementSupports[$name]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/FidoU2FAttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/FidoU2FAttestationStatementSupport.php deleted file mode 100644 index 7fe326d8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/FidoU2FAttestationStatementSupport.php +++ /dev/null @@ -1,118 +0,0 @@ -decoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - } - - public function name(): string - { - return 'fido-u2f'; - } - - /** - * @param mixed[] $attestation - */ - public function load(array $attestation): AttestationStatement - { - Assertion::keyExists($attestation, 'attStmt', 'Invalid attestation object'); - foreach (['sig', 'x5c'] as $key) { - Assertion::keyExists($attestation['attStmt'], $key, sprintf('The attestation statement value "%s" is missing.', $key)); - } - $certificates = $attestation['attStmt']['x5c']; - Assertion::isArray($certificates, 'The attestation statement value "x5c" must be a list with one certificate.'); - Assertion::count($certificates, 1, 'The attestation statement value "x5c" must be a list with one certificate.'); - Assertion::allString($certificates, 'The attestation statement value "x5c" must be a list with one certificate.'); - - reset($certificates); - $certificates = CertificateToolbox::convertAllDERToPEM($certificates); - $this->checkCertificate($certificates[0]); - - return AttestationStatement::createBasic($attestation['fmt'], $attestation['attStmt'], new CertificateTrustPath($certificates)); - } - - public function isValid(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - Assertion::eq( - $authenticatorData->getAttestedCredentialData()->getAaguid()->toString(), - '00000000-0000-0000-0000-000000000000', - 'Invalid AAGUID for fido-u2f attestation statement. Shall be "00000000-0000-0000-0000-000000000000"' - ); - $trustPath = $attestationStatement->getTrustPath(); - Assertion::isInstanceOf($trustPath, CertificateTrustPath::class, 'Invalid trust path'); - $dataToVerify = "\0"; - $dataToVerify .= $authenticatorData->getRpIdHash(); - $dataToVerify .= $clientDataJSONHash; - $dataToVerify .= $authenticatorData->getAttestedCredentialData()->getCredentialId(); - $dataToVerify .= $this->extractPublicKey($authenticatorData->getAttestedCredentialData()->getCredentialPublicKey()); - - return 1 === openssl_verify($dataToVerify, $attestationStatement->get('sig'), $trustPath->getCertificates()[0], OPENSSL_ALGO_SHA256); - } - - private function extractPublicKey(?string $publicKey): string - { - Assertion::notNull($publicKey, 'The attested credential data does not contain a valid public key.'); - - $publicKeyStream = new StringStream($publicKey); - $coseKey = $this->decoder->decode($publicKeyStream); - Assertion::true($publicKeyStream->isEOF(), 'Invalid public key. Presence of extra bytes.'); - $publicKeyStream->close(); - Assertion::isInstanceOf($coseKey, MapObject::class, 'The attested credential data does not contain a valid public key.'); - - $coseKey = $coseKey->getNormalizedData(); - $ec2Key = new Ec2Key($coseKey + [Ec2Key::TYPE => 2, Ec2Key::DATA_CURVE => Ec2Key::CURVE_P256]); - - return "\x04".$ec2Key->x().$ec2Key->y(); - } - - private function checkCertificate(string $publicKey): void - { - try { - $resource = openssl_pkey_get_public($publicKey); - $details = openssl_pkey_get_details($resource); - } catch (Throwable $throwable) { - throw new InvalidArgumentException('Invalid certificate or certificate chain', 0, $throwable); - } - Assertion::isArray($details, 'Invalid certificate or certificate chain'); - Assertion::keyExists($details, 'ec', 'Invalid certificate or certificate chain'); - Assertion::keyExists($details['ec'], 'curve_name', 'Invalid certificate or certificate chain'); - Assertion::eq($details['ec']['curve_name'], 'prime256v1', 'Invalid certificate or certificate chain'); - Assertion::keyExists($details['ec'], 'curve_oid', 'Invalid certificate or certificate chain'); - Assertion::eq($details['ec']['curve_oid'], '1.2.840.10045.3.1.7', 'Invalid certificate or certificate chain'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/NoneAttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/NoneAttestationStatementSupport.php deleted file mode 100644 index 8719ae7d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/NoneAttestationStatementSupport.php +++ /dev/null @@ -1,42 +0,0 @@ -getAttStmt()); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/PackedAttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/PackedAttestationStatementSupport.php deleted file mode 100644 index 58fb6370..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/PackedAttestationStatementSupport.php +++ /dev/null @@ -1,194 +0,0 @@ -decoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - $this->algorithmManager = $algorithmManager; - } - - public function name(): string - { - return 'packed'; - } - - /** - * @param mixed[] $attestation - */ - public function load(array $attestation): AttestationStatement - { - Assertion::keyExists($attestation['attStmt'], 'sig', 'The attestation statement value "sig" is missing.'); - Assertion::keyExists($attestation['attStmt'], 'alg', 'The attestation statement value "alg" is missing.'); - Assertion::string($attestation['attStmt']['sig'], 'The attestation statement value "sig" is missing.'); - switch (true) { - case array_key_exists('x5c', $attestation['attStmt']): - return $this->loadBasicType($attestation); - case array_key_exists('ecdaaKeyId', $attestation['attStmt']): - return $this->loadEcdaaType($attestation['attStmt']); - default: - return $this->loadEmptyType($attestation); - } - } - - public function isValid(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - $trustPath = $attestationStatement->getTrustPath(); - switch (true) { - case $trustPath instanceof CertificateTrustPath: - return $this->processWithCertificate($clientDataJSONHash, $attestationStatement, $authenticatorData, $trustPath); - case $trustPath instanceof EcdaaKeyIdTrustPath: - return $this->processWithECDAA(); - case $trustPath instanceof EmptyTrustPath: - return $this->processWithSelfAttestation($clientDataJSONHash, $attestationStatement, $authenticatorData); - default: - throw new InvalidArgumentException('Unsupported attestation statement'); - } - } - - /** - * @param mixed[] $attestation - */ - private function loadBasicType(array $attestation): AttestationStatement - { - $certificates = $attestation['attStmt']['x5c']; - Assertion::isArray($certificates, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - Assertion::minCount($certificates, 1, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - $certificates = CertificateToolbox::convertAllDERToPEM($certificates); - - return AttestationStatement::createBasic($attestation['fmt'], $attestation['attStmt'], new CertificateTrustPath($certificates)); - } - - private function loadEcdaaType(array $attestation): AttestationStatement - { - $ecdaaKeyId = $attestation['attStmt']['ecdaaKeyId']; - Assertion::string($ecdaaKeyId, 'The attestation statement value "ecdaaKeyId" is invalid.'); - - return AttestationStatement::createEcdaa($attestation['fmt'], $attestation['attStmt'], new EcdaaKeyIdTrustPath($attestation['ecdaaKeyId'])); - } - - /** - * @param mixed[] $attestation - */ - private function loadEmptyType(array $attestation): AttestationStatement - { - return AttestationStatement::createSelf($attestation['fmt'], $attestation['attStmt'], new EmptyTrustPath()); - } - - private function checkCertificate(string $attestnCert, AuthenticatorData $authenticatorData): void - { - $parsed = openssl_x509_parse($attestnCert); - Assertion::isArray($parsed, 'Invalid certificate'); - - //Check version - Assertion::false(!isset($parsed['version']) || 2 !== $parsed['version'], 'Invalid certificate version'); - - //Check subject field - Assertion::false(!isset($parsed['name']) || false === mb_strpos($parsed['name'], '/OU=Authenticator Attestation'), 'Invalid certificate name. The Subject Organization Unit must be "Authenticator Attestation"'); - - //Check extensions - Assertion::false(!isset($parsed['extensions']) || !is_array($parsed['extensions']), 'Certificate extensions are missing'); - - //Check certificate is not a CA cert - Assertion::false(!isset($parsed['extensions']['basicConstraints']) || 'CA:FALSE' !== $parsed['extensions']['basicConstraints'], 'The Basic Constraints extension must have the CA component set to false'); - - $attestedCredentialData = $authenticatorData->getAttestedCredentialData(); - Assertion::notNull($attestedCredentialData, 'No attested credential available'); - - // id-fido-gen-ce-aaguid OID check - Assertion::false(in_array('1.3.6.1.4.1.45724.1.1.4', $parsed['extensions'], true) && !hash_equals($attestedCredentialData->getAaguid()->getBytes(), $parsed['extensions']['1.3.6.1.4.1.45724.1.1.4']), 'The value of the "aaguid" does not match with the certificate'); - } - - private function processWithCertificate(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData, CertificateTrustPath $trustPath): bool - { - $certificates = $trustPath->getCertificates(); - - // Check leaf certificate - $this->checkCertificate($certificates[0], $authenticatorData); - - // Get the COSE algorithm identifier and the corresponding OpenSSL one - $coseAlgorithmIdentifier = (int) $attestationStatement->get('alg'); - $opensslAlgorithmIdentifier = Algorithms::getOpensslAlgorithmFor($coseAlgorithmIdentifier); - - // Verification of the signature - $signedData = $authenticatorData->getAuthData().$clientDataJSONHash; - $result = openssl_verify($signedData, $attestationStatement->get('sig'), $certificates[0], $opensslAlgorithmIdentifier); - - return 1 === $result; - } - - private function processWithECDAA(): bool - { - throw new RuntimeException('ECDAA not supported'); - } - - private function processWithSelfAttestation(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - $attestedCredentialData = $authenticatorData->getAttestedCredentialData(); - Assertion::notNull($attestedCredentialData, 'No attested credential available'); - $credentialPublicKey = $attestedCredentialData->getCredentialPublicKey(); - Assertion::notNull($credentialPublicKey, 'No credential public key available'); - $publicKeyStream = new StringStream($credentialPublicKey); - $publicKey = $this->decoder->decode($publicKeyStream); - Assertion::true($publicKeyStream->isEOF(), 'Invalid public key. Presence of extra bytes.'); - $publicKeyStream->close(); - Assertion::isInstanceOf($publicKey, MapObject::class, 'The attested credential data does not contain a valid public key.'); - $publicKey = $publicKey->getNormalizedData(false); - $publicKey = new Key($publicKey); - Assertion::eq($publicKey->alg(), (int) $attestationStatement->get('alg'), 'The algorithm of the attestation statement and the key are not identical.'); - - $dataToVerify = $authenticatorData->getAuthData().$clientDataJSONHash; - $algorithm = $this->algorithmManager->get((int) $attestationStatement->get('alg')); - if (!$algorithm instanceof Signature) { - throw new RuntimeException('Invalid algorithm'); - } - $signature = CoseSignatureFixer::fix($attestationStatement->get('sig'), $algorithm); - - return $algorithm->verify($dataToVerify, $publicKey, $signature); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/TPMAttestationStatementSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/TPMAttestationStatementSupport.php deleted file mode 100644 index b43effb4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestationStatement/TPMAttestationStatementSupport.php +++ /dev/null @@ -1,309 +0,0 @@ -checkCertInfo($attestation['attStmt']['certInfo']); - Assertion::eq('8017', bin2hex($certInfo['type']), 'Invalid attestation object'); - - $pubArea = $this->checkPubArea($attestation['attStmt']['pubArea']); - $pubAreaAttestedNameAlg = mb_substr($certInfo['attestedName'], 0, 2, '8bit'); - $pubAreaHash = hash($this->getTPMHash($pubAreaAttestedNameAlg), $attestation['attStmt']['pubArea'], true); - $attestedName = $pubAreaAttestedNameAlg.$pubAreaHash; - Assertion::eq($attestedName, $certInfo['attestedName'], 'Invalid attested name'); - - $attestation['attStmt']['parsedCertInfo'] = $certInfo; - $attestation['attStmt']['parsedPubArea'] = $pubArea; - - $certificates = CertificateToolbox::convertAllDERToPEM($attestation['attStmt']['x5c']); - Assertion::minCount($certificates, 1, 'The attestation statement value "x5c" must be a list with at least one certificate.'); - - return AttestationStatement::createAttCA( - $this->name(), - $attestation['attStmt'], - new CertificateTrustPath($certificates) - ); - } - - public function isValid(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - $attToBeSigned = $authenticatorData->getAuthData().$clientDataJSONHash; - $attToBeSignedHash = hash(Algorithms::getHashAlgorithmFor((int) $attestationStatement->get('alg')), $attToBeSigned, true); - Assertion::eq($attestationStatement->get('parsedCertInfo')['extraData'], $attToBeSignedHash, 'Invalid attestation hash'); - $this->checkUniquePublicKey( - $attestationStatement->get('parsedPubArea')['unique'], - $authenticatorData->getAttestedCredentialData()->getCredentialPublicKey() - ); - - switch (true) { - case $attestationStatement->getTrustPath() instanceof CertificateTrustPath: - return $this->processWithCertificate($clientDataJSONHash, $attestationStatement, $authenticatorData); - case $attestationStatement->getTrustPath() instanceof EcdaaKeyIdTrustPath: - return $this->processWithECDAA(); - default: - throw new InvalidArgumentException('Unsupported attestation statement'); - } - } - - private function checkUniquePublicKey(string $unique, string $cborPublicKey): void - { - $cborDecoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - $publicKey = $cborDecoder->decode(new StringStream($cborPublicKey)); - Assertion::isInstanceOf($publicKey, MapObject::class, 'Invalid public key'); - $key = new Key($publicKey->getNormalizedData(false)); - - switch ($key->type()) { - case Key::TYPE_OKP: - $uniqueFromKey = (new OkpKey($key->getData()))->x(); - break; - case Key::TYPE_EC2: - $ec2Key = new Ec2Key($key->getData()); - $uniqueFromKey = "\x04".$ec2Key->x().$ec2Key->y(); - break; - case Key::TYPE_RSA: - $uniqueFromKey = (new RsaKey($key->getData()))->n(); - break; - default: - throw new InvalidArgumentException('Invalid or unsupported key type.'); - } - - Assertion::eq($unique, $uniqueFromKey, 'Invalid pubArea.unique value'); - } - - /** - * @return mixed[] - */ - private function checkCertInfo(string $data): array - { - $certInfo = new StringStream($data); - - $magic = $certInfo->read(4); - Assertion::eq('ff544347', bin2hex($magic), 'Invalid attestation object'); - - $type = $certInfo->read(2); - - $qualifiedSignerLength = unpack('n', $certInfo->read(2))[1]; - $qualifiedSigner = $certInfo->read($qualifiedSignerLength); //Ignored - - $extraDataLength = unpack('n', $certInfo->read(2))[1]; - $extraData = $certInfo->read($extraDataLength); - - $clockInfo = $certInfo->read(17); //Ignore - - $firmwareVersion = $certInfo->read(8); - - $attestedNameLength = unpack('n', $certInfo->read(2))[1]; - $attestedName = $certInfo->read($attestedNameLength); - - $attestedQualifiedNameLength = unpack('n', $certInfo->read(2))[1]; - $attestedQualifiedName = $certInfo->read($attestedQualifiedNameLength); //Ignore - Assertion::true($certInfo->isEOF(), 'Invalid certificate information. Presence of extra bytes.'); - $certInfo->close(); - - return [ - 'magic' => $magic, - 'type' => $type, - 'qualifiedSigner' => $qualifiedSigner, - 'extraData' => $extraData, - 'clockInfo' => $clockInfo, - 'firmwareVersion' => $firmwareVersion, - 'attestedName' => $attestedName, - 'attestedQualifiedName' => $attestedQualifiedName, - ]; - } - - /** - * @return mixed[] - */ - private function checkPubArea(string $data): array - { - $pubArea = new StringStream($data); - - $type = $pubArea->read(2); - - $nameAlg = $pubArea->read(2); - - $objectAttributes = $pubArea->read(4); - - $authPolicyLength = unpack('n', $pubArea->read(2))[1]; - $authPolicy = $pubArea->read($authPolicyLength); - - $parameters = $this->getParameters($type, $pubArea); - - $uniqueLength = unpack('n', $pubArea->read(2))[1]; - $unique = $pubArea->read($uniqueLength); - Assertion::true($pubArea->isEOF(), 'Invalid public area. Presence of extra bytes.'); - $pubArea->close(); - - return [ - 'type' => $type, - 'nameAlg' => $nameAlg, - 'objectAttributes' => $objectAttributes, - 'authPolicy' => $authPolicy, - 'parameters' => $parameters, - 'unique' => $unique, - ]; - } - - /** - * @return mixed[] - */ - private function getParameters(string $type, StringStream $stream): array - { - switch (bin2hex($type)) { - case '0001': - case '0014': - case '0016': - return [ - 'symmetric' => $stream->read(2), - 'scheme' => $stream->read(2), - 'keyBits' => unpack('n', $stream->read(2))[1], - 'exponent' => $this->getExponent($stream->read(4)), - ]; - case '0018': - return [ - 'symmetric' => $stream->read(2), - 'scheme' => $stream->read(2), - 'curveId' => $stream->read(2), - 'kdf' => $stream->read(2), - ]; - default: - throw new InvalidArgumentException('Unsupported type'); - } - } - - private function getExponent(string $exponent): string - { - return '00000000' === bin2hex($exponent) ? Base64Url::decode('AQAB') : $exponent; - } - - private function getTPMHash(string $nameAlg): string - { - switch (bin2hex($nameAlg)) { - case '0004': - return 'sha1'; //: "TPM_ALG_SHA1", - case '000b': - return 'sha256'; //: "TPM_ALG_SHA256", - case '000c': - return 'sha384'; //: "TPM_ALG_SHA384", - case '000d': - return 'sha512'; //: "TPM_ALG_SHA512", - default: - throw new InvalidArgumentException('Unsupported hash algorithm'); - } - } - - private function processWithCertificate(string $clientDataJSONHash, AttestationStatement $attestationStatement, AuthenticatorData $authenticatorData): bool - { - $trustPath = $attestationStatement->getTrustPath(); - Assertion::isInstanceOf($trustPath, CertificateTrustPath::class, 'Invalid trust path'); - - $certificates = $trustPath->getCertificates(); - - // Check certificate CA chain and returns the Attestation Certificate - $this->checkCertificate($certificates[0], $authenticatorData); - - // Get the COSE algorithm identifier and the corresponding OpenSSL one - $coseAlgorithmIdentifier = (int) $attestationStatement->get('alg'); - $opensslAlgorithmIdentifier = Algorithms::getOpensslAlgorithmFor($coseAlgorithmIdentifier); - - $result = openssl_verify($attestationStatement->get('certInfo'), $attestationStatement->get('sig'), $certificates[0], $opensslAlgorithmIdentifier); - - return 1 === $result; - } - - private function checkCertificate(string $attestnCert, AuthenticatorData $authenticatorData): void - { - $parsed = openssl_x509_parse($attestnCert); - Assertion::isArray($parsed, 'Invalid certificate'); - - //Check version - Assertion::false(!isset($parsed['version']) || 2 !== $parsed['version'], 'Invalid certificate version'); - - //Check subject field is empty - Assertion::false(!isset($parsed['subject']) || !is_array($parsed['subject']) || 0 !== count($parsed['subject']), 'Invalid certificate name. The Subject should be empty'); - - // Check period of validity - Assertion::keyExists($parsed, 'validFrom_time_t', 'Invalid certificate start date.'); - Assertion::integer($parsed['validFrom_time_t'], 'Invalid certificate start date.'); - $startDate = (new DateTimeImmutable())->setTimestamp($parsed['validFrom_time_t']); - Assertion::true($startDate < new DateTimeImmutable(), 'Invalid certificate start date.'); - - Assertion::keyExists($parsed, 'validTo_time_t', 'Invalid certificate end date.'); - Assertion::integer($parsed['validTo_time_t'], 'Invalid certificate end date.'); - $endDate = (new DateTimeImmutable())->setTimestamp($parsed['validTo_time_t']); - Assertion::true($endDate > new DateTimeImmutable(), 'Invalid certificate end date.'); - - //Check extensions - Assertion::false(!isset($parsed['extensions']) || !is_array($parsed['extensions']), 'Certificate extensions are missing'); - - //Check subjectAltName - Assertion::false(!isset($parsed['extensions']['subjectAltName']), 'The "subjectAltName" is missing'); - - //Check extendedKeyUsage - Assertion::false(!isset($parsed['extensions']['extendedKeyUsage']), 'The "subjectAltName" is missing'); - Assertion::eq($parsed['extensions']['extendedKeyUsage'], '2.23.133.8.3', 'The "extendedKeyUsage" is invalid'); - - // id-fido-gen-ce-aaguid OID check - Assertion::false(in_array('1.3.6.1.4.1.45724.1.1.4', $parsed['extensions'], true) && !hash_equals($authenticatorData->getAttestedCredentialData()->getAaguid()->getBytes(), $parsed['extensions']['1.3.6.1.4.1.45724.1.1.4']), 'The value of the "aaguid" does not match with the certificate'); - } - - private function processWithECDAA(): bool - { - throw new RuntimeException('ECDAA not supported'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestedCredentialData.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestedCredentialData.php deleted file mode 100644 index 329f2c6b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AttestedCredentialData.php +++ /dev/null @@ -1,113 +0,0 @@ -aaguid = $aaguid; - $this->credentialId = $credentialId; - $this->credentialPublicKey = $credentialPublicKey; - } - - public function getAaguid(): UuidInterface - { - return $this->aaguid; - } - - public function setAaguid(UuidInterface $aaguid): void - { - $this->aaguid = $aaguid; - } - - public function getCredentialId(): string - { - return $this->credentialId; - } - - public function getCredentialPublicKey(): ?string - { - return $this->credentialPublicKey; - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - Assertion::keyExists($json, 'aaguid', 'Invalid input. "aaguid" is missing.'); - Assertion::keyExists($json, 'credentialId', 'Invalid input. "credentialId" is missing.'); - switch (true) { - case 36 === mb_strlen($json['aaguid'], '8bit'): - $uuid = Uuid::fromString($json['aaguid']); - break; - default: // Kept for compatibility with old format - $decoded = base64_decode($json['aaguid'], true); - $uuid = Uuid::fromBytes($decoded); - } - $credentialId = base64_decode($json['credentialId'], true); - - $credentialPublicKey = null; - if (isset($json['credentialPublicKey'])) { - $credentialPublicKey = base64_decode($json['credentialPublicKey'], true); - } - - return new self( - $uuid, - $credentialId, - $credentialPublicKey - ); - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $result = [ - 'aaguid' => $this->aaguid->toString(), - 'credentialId' => base64_encode($this->credentialId), - ]; - if (null !== $this->credentialPublicKey) { - $result['credentialPublicKey'] = base64_encode($this->credentialPublicKey); - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtension.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtension.php deleted file mode 100644 index 8a29b1c6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtension.php +++ /dev/null @@ -1,59 +0,0 @@ -name = $name; - $this->value = $value; - } - - public function name(): string - { - return $this->name; - } - - /** - * @return mixed - */ - public function value() - { - return $this->value; - } - - /** - * @return mixed - */ - public function jsonSerialize() - { - return $this->value; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientInputs.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientInputs.php deleted file mode 100644 index 2f171e7f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientInputs.php +++ /dev/null @@ -1,88 +0,0 @@ -extensions[$extension->name()] = $extension; - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - $object = new self(); - foreach ($json as $k => $v) { - $object->add(new AuthenticationExtension($k, $v)); - } - - return $object; - } - - public function has(string $key): bool - { - return array_key_exists($key, $this->extensions); - } - - /** - * @return mixed - */ - public function get(string $key) - { - Assertion::true($this->has($key), sprintf('The extension with key "%s" is not available', $key)); - - return $this->extensions[$key]; - } - - /** - * @return AuthenticationExtension[] - */ - public function jsonSerialize(): array - { - return array_map(static function (AuthenticationExtension $object) { - return $object->jsonSerialize(); - }, $this->extensions); - } - - /** - * @return Iterator - */ - public function getIterator(): Iterator - { - return new ArrayIterator($this->extensions); - } - - public function count(int $mode = COUNT_NORMAL): int - { - return count($this->extensions, $mode); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputs.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputs.php deleted file mode 100644 index d6ed0ffb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputs.php +++ /dev/null @@ -1,97 +0,0 @@ -extensions[$extension->name()] = $extension; - } - - public static function createFromString(string $data): self - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - $object = new self(); - foreach ($json as $k => $v) { - $object->add(new AuthenticationExtension($k, $v)); - } - - return $object; - } - - public function has(string $key): bool - { - return array_key_exists($key, $this->extensions); - } - - /** - * @return mixed - */ - public function get(string $key) - { - Assertion::true($this->has($key), sprintf('The extension with key "%s" is not available', $key)); - - return $this->extensions[$key]; - } - - /** - * @return AuthenticationExtension[] - */ - public function jsonSerialize(): array - { - return array_map(static function (AuthenticationExtension $object) { - return $object->jsonSerialize(); - }, $this->extensions); - } - - /** - * @return Iterator - */ - public function getIterator(): Iterator - { - return new ArrayIterator($this->extensions); - } - - public function count(int $mode = COUNT_NORMAL): int - { - return count($this->extensions, $mode); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputsLoader.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputsLoader.php deleted file mode 100644 index b4f69bf9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/AuthenticationExtensionsClientOutputsLoader.php +++ /dev/null @@ -1,34 +0,0 @@ -getNormalizedData(); - $extensions = new AuthenticationExtensionsClientOutputs(); - foreach ($data as $key => $value) { - Assertion::string($key, 'Invalid extension key'); - $extensions->add(new AuthenticationExtension($key, $value)); - } - - return $extensions; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputChecker.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputChecker.php deleted file mode 100644 index e53c88e5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputChecker.php +++ /dev/null @@ -1,22 +0,0 @@ -checkers[] = $checker; - } - - /** - * @throws ExtensionOutputError - */ - public function check(AuthenticationExtensionsClientInputs $inputs, AuthenticationExtensionsClientOutputs $outputs): void - { - foreach ($this->checkers as $checker) { - $checker->check($inputs, $outputs); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputError.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputError.php deleted file mode 100644 index f16072f6..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticationExtensions/ExtensionOutputError.php +++ /dev/null @@ -1,36 +0,0 @@ -authenticationExtension = $authenticationExtension; - } - - public function getAuthenticationExtension(): AuthenticationExtension - { - return $this->authenticationExtension; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAssertionResponse.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAssertionResponse.php deleted file mode 100644 index ec325e6e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAssertionResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -authenticatorData = $authenticatorData; - $this->signature = $signature; - $this->userHandle = $userHandle; - } - - public function getAuthenticatorData(): AuthenticatorData - { - return $this->authenticatorData; - } - - public function getSignature(): string - { - return $this->signature; - } - - public function getUserHandle(): ?string - { - if (null === $this->userHandle || '' === $this->userHandle) { - return $this->userHandle; - } - - return base64_decode($this->userHandle, true); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAssertionResponseValidator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAssertionResponseValidator.php deleted file mode 100644 index 7550243a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAssertionResponseValidator.php +++ /dev/null @@ -1,272 +0,0 @@ -publicKeyCredentialSourceRepository = $publicKeyCredentialSourceRepository; - $this->decoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - $this->tokenBindingHandler = $tokenBindingHandler; - $this->extensionOutputCheckerHandler = $extensionOutputCheckerHandler; - $this->algorithmManager = $algorithmManager; - $this->counterChecker = $counterChecker ?? new ThrowExceptionIfInvalid(); - $this->logger = $logger ?? new NullLogger(); - } - - /** - * @see https://www.w3.org/TR/webauthn/#verifying-assertion - */ - public function check(string $credentialId, AuthenticatorAssertionResponse $authenticatorAssertionResponse, PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions, ServerRequestInterface $request, ?string $userHandle, array $securedRelyingPartyId = []): PublicKeyCredentialSource - { - try { - $this->logger->info('Checking the authenticator assertion response', [ - 'credentialId' => $credentialId, - 'authenticatorAssertionResponse' => $authenticatorAssertionResponse, - 'publicKeyCredentialRequestOptions' => $publicKeyCredentialRequestOptions, - 'host' => $request->getUri()->getHost(), - 'userHandle' => $userHandle, - ]); - /** @see 7.2.1 */ - if (0 !== count($publicKeyCredentialRequestOptions->getAllowCredentials())) { - Assertion::true($this->isCredentialIdAllowed($credentialId, $publicKeyCredentialRequestOptions->getAllowCredentials()), 'The credential ID is not allowed.'); - } - - /** @see 7.2.2 */ - $publicKeyCredentialSource = $this->publicKeyCredentialSourceRepository->findOneByCredentialId($credentialId); - Assertion::notNull($publicKeyCredentialSource, 'The credential ID is invalid.'); - - /** @see 7.2.3 */ - $attestedCredentialData = $publicKeyCredentialSource->getAttestedCredentialData(); - $credentialUserHandle = $publicKeyCredentialSource->getUserHandle(); - $responseUserHandle = $authenticatorAssertionResponse->getUserHandle(); - - /** @see 7.2.2 User Handle*/ - if (null !== $userHandle) { //If the user was identified before the authentication ceremony was initiated, - Assertion::eq($credentialUserHandle, $userHandle, 'Invalid user handle'); - if (null !== $responseUserHandle && '' !== $responseUserHandle) { - Assertion::eq($credentialUserHandle, $responseUserHandle, 'Invalid user handle'); - } - } else { - Assertion::notEmpty($responseUserHandle, 'User handle is mandatory'); - Assertion::eq($credentialUserHandle, $responseUserHandle, 'Invalid user handle'); - } - - $credentialPublicKey = $attestedCredentialData->getCredentialPublicKey(); - $isU2F = U2FPublicKey::isU2FKey($credentialPublicKey); - if ($isU2F) { - $credentialPublicKey = U2FPublicKey::createCOSEKey($credentialPublicKey); - } - Assertion::notNull($credentialPublicKey, 'No public key available.'); - $stream = new StringStream($credentialPublicKey); - $credentialPublicKeyStream = $this->decoder->decode($stream); - Assertion::true($stream->isEOF(), 'Invalid key. Presence of extra bytes.'); - $stream->close(); - - /** @see 7.2.4 */ - /** @see 7.2.5 */ - //Nothing to do. Use of objects directly - - /** @see 7.2.6 */ - $C = $authenticatorAssertionResponse->getClientDataJSON(); - - /** @see 7.2.7 */ - Assertion::eq('webauthn.get', $C->getType(), 'The client data type is not "webauthn.get".'); - - /** @see 7.2.8 */ - Assertion::true(hash_equals($publicKeyCredentialRequestOptions->getChallenge(), $C->getChallenge()), 'Invalid challenge.'); - - /** @see 7.2.9 */ - $rpId = $publicKeyCredentialRequestOptions->getRpId() ?? $request->getUri()->getHost(); - $facetId = $this->getFacetId($rpId, $publicKeyCredentialRequestOptions->getExtensions(), $authenticatorAssertionResponse->getAuthenticatorData()->getExtensions()); - $parsedRelyingPartyId = parse_url($C->getOrigin()); - Assertion::isArray($parsedRelyingPartyId, 'Invalid origin'); - if (!in_array($facetId, $securedRelyingPartyId, true)) { - $scheme = $parsedRelyingPartyId['scheme'] ?? ''; - Assertion::eq('https', $scheme, 'Invalid scheme. HTTPS required.'); - } - $clientDataRpId = $parsedRelyingPartyId['host'] ?? ''; - Assertion::notEmpty($clientDataRpId, 'Invalid origin rpId.'); - $rpIdLength = mb_strlen($facetId); - Assertion::eq(mb_substr('.'.$clientDataRpId, -($rpIdLength + 1)), '.'.$facetId, 'rpId mismatch.'); - - /** @see 7.2.10 */ - if (null !== $C->getTokenBinding()) { - $this->tokenBindingHandler->check($C->getTokenBinding(), $request); - } - - $expectedRpIdHash = $isU2F ? $C->getOrigin() : $facetId; - // u2f response has full origin in rpIdHash - /** @see 7.2.11 */ - $rpIdHash = hash('sha256', $expectedRpIdHash, true); - Assertion::true(hash_equals($rpIdHash, $authenticatorAssertionResponse->getAuthenticatorData()->getRpIdHash()), 'rpId hash mismatch.'); - - /** @see 7.2.12 */ - Assertion::true($authenticatorAssertionResponse->getAuthenticatorData()->isUserPresent(), 'User was not present'); - /** @see 7.2.13 */ - if (AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_REQUIRED === $publicKeyCredentialRequestOptions->getUserVerification()) { - Assertion::true($authenticatorAssertionResponse->getAuthenticatorData()->isUserVerified(), 'User authentication required.'); - } - - /** @see 7.2.14 */ - $extensionsClientOutputs = $authenticatorAssertionResponse->getAuthenticatorData()->getExtensions(); - if (null !== $extensionsClientOutputs) { - $this->extensionOutputCheckerHandler->check( - $publicKeyCredentialRequestOptions->getExtensions(), - $extensionsClientOutputs - ); - } - - /** @see 7.2.15 */ - $getClientDataJSONHash = hash('sha256', $authenticatorAssertionResponse->getClientDataJSON()->getRawData(), true); - - /** @see 7.2.16 */ - $dataToVerify = $authenticatorAssertionResponse->getAuthenticatorData()->getAuthData().$getClientDataJSONHash; - $signature = $authenticatorAssertionResponse->getSignature(); - $coseKey = new Key($credentialPublicKeyStream->getNormalizedData()); - $algorithm = $this->algorithmManager->get($coseKey->alg()); - Assertion::isInstanceOf($algorithm, Signature::class, 'Invalid algorithm identifier. Should refer to a signature algorithm'); - $signature = CoseSignatureFixer::fix($signature, $algorithm); - Assertion::true($algorithm->verify($dataToVerify, $coseKey, $signature), 'Invalid signature.'); - - /** @see 7.2.17 */ - $storedCounter = $publicKeyCredentialSource->getCounter(); - $responseCounter = $authenticatorAssertionResponse->getAuthenticatorData()->getSignCount(); - if (0 !== $responseCounter || 0 !== $storedCounter) { - $this->counterChecker->check($publicKeyCredentialSource, $responseCounter); - } - $publicKeyCredentialSource->setCounter($responseCounter); - $this->publicKeyCredentialSourceRepository->saveCredentialSource($publicKeyCredentialSource); - - /** @see 7.2.18 */ - //All good. We can continue. - $this->logger->info('The assertion is valid'); - $this->logger->debug('Public Key Credential Source', ['publicKeyCredentialSource' => $publicKeyCredentialSource]); - - return $publicKeyCredentialSource; - } catch (Throwable $throwable) { - $this->logger->error('An error occurred', [ - 'exception' => $throwable, - ]); - throw $throwable; - } - } - - public function setLogger(LoggerInterface $logger): self - { - $this->logger = $logger; - - return $this; - } - - public function setCounterChecker(CounterChecker $counterChecker): self - { - $this->counterChecker = $counterChecker; - - return $this; - } - - /** - * @param array $allowedCredentials - */ - private function isCredentialIdAllowed(string $credentialId, array $allowedCredentials): bool - { - foreach ($allowedCredentials as $allowedCredential) { - if (hash_equals($allowedCredential->getId(), $credentialId)) { - return true; - } - } - - return false; - } - - private function getFacetId(string $rpId, AuthenticationExtensionsClientInputs $authenticationExtensionsClientInputs, ?AuthenticationExtensionsClientOutputs $authenticationExtensionsClientOutputs): string - { - if (null === $authenticationExtensionsClientOutputs || !$authenticationExtensionsClientInputs->has('appid') || !$authenticationExtensionsClientOutputs->has('appid')) { - return $rpId; - } - $appId = $authenticationExtensionsClientInputs->get('appid')->value(); - $wasUsed = $authenticationExtensionsClientOutputs->get('appid')->value(); - if (!is_string($appId) || true !== $wasUsed) { - return $rpId; - } - - return $appId; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAttestationResponse.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAttestationResponse.php deleted file mode 100644 index 7ac9e19f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAttestationResponse.php +++ /dev/null @@ -1,38 +0,0 @@ -attestationObject = $attestationObject; - } - - public function getAttestationObject(): AttestationObject - { - return $this->attestationObject; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAttestationResponseValidator.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAttestationResponseValidator.php deleted file mode 100644 index 47fb4d28..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorAttestationResponseValidator.php +++ /dev/null @@ -1,384 +0,0 @@ -attestationStatementSupportManager = $attestationStatementSupportManager; - $this->publicKeyCredentialSource = $publicKeyCredentialSource; - $this->tokenBindingHandler = $tokenBindingHandler; - $this->extensionOutputCheckerHandler = $extensionOutputCheckerHandler; - $this->metadataStatementRepository = $metadataStatementRepository; - $this->logger = $logger ?? new NullLogger(); - } - - public function setLogger(LoggerInterface $logger): self - { - $this->logger = $logger; - - return $this; - } - - public function setCertificateChainChecker(CertificateChainChecker $certificateChainChecker): self - { - $this->certificateChainChecker = $certificateChainChecker; - - return $this; - } - - public function setMetadataStatementRepository(MetadataStatementRepository $metadataStatementRepository): self - { - $this->metadataStatementRepository = $metadataStatementRepository; - - return $this; - } - - /** - * @see https://www.w3.org/TR/webauthn/#registering-a-new-credential - */ - public function check(AuthenticatorAttestationResponse $authenticatorAttestationResponse, PublicKeyCredentialCreationOptions $publicKeyCredentialCreationOptions, ServerRequestInterface $request, array $securedRelyingPartyId = []): PublicKeyCredentialSource - { - try { - $this->logger->info('Checking the authenticator attestation response', [ - 'authenticatorAttestationResponse' => $authenticatorAttestationResponse, - 'publicKeyCredentialCreationOptions' => $publicKeyCredentialCreationOptions, - 'host' => $request->getUri()->getHost(), - ]); - /** @see 7.1.1 */ - //Nothing to do - - /** @see 7.1.2 */ - $C = $authenticatorAttestationResponse->getClientDataJSON(); - - /** @see 7.1.3 */ - Assertion::eq('webauthn.create', $C->getType(), 'The client data type is not "webauthn.create".'); - - /** @see 7.1.4 */ - Assertion::true(hash_equals($publicKeyCredentialCreationOptions->getChallenge(), $C->getChallenge()), 'Invalid challenge.'); - - /** @see 7.1.5 */ - $rpId = $publicKeyCredentialCreationOptions->getRp()->getId() ?? $request->getUri()->getHost(); - $facetId = $this->getFacetId($rpId, $publicKeyCredentialCreationOptions->getExtensions(), $authenticatorAttestationResponse->getAttestationObject()->getAuthData()->getExtensions()); - - $parsedRelyingPartyId = parse_url($C->getOrigin()); - Assertion::isArray($parsedRelyingPartyId, sprintf('The origin URI "%s" is not valid', $C->getOrigin())); - Assertion::keyExists($parsedRelyingPartyId, 'scheme', 'Invalid origin rpId.'); - $clientDataRpId = $parsedRelyingPartyId['host'] ?? ''; - Assertion::notEmpty($clientDataRpId, 'Invalid origin rpId.'); - $rpIdLength = mb_strlen($facetId); - Assertion::eq(mb_substr('.'.$clientDataRpId, -($rpIdLength + 1)), '.'.$facetId, 'rpId mismatch.'); - - if (!in_array($facetId, $securedRelyingPartyId, true)) { - $scheme = $parsedRelyingPartyId['scheme'] ?? ''; - Assertion::eq('https', $scheme, 'Invalid scheme. HTTPS required.'); - } - - /** @see 7.1.6 */ - if (null !== $C->getTokenBinding()) { - $this->tokenBindingHandler->check($C->getTokenBinding(), $request); - } - - /** @see 7.1.7 */ - $clientDataJSONHash = hash('sha256', $authenticatorAttestationResponse->getClientDataJSON()->getRawData(), true); - - /** @see 7.1.8 */ - $attestationObject = $authenticatorAttestationResponse->getAttestationObject(); - - /** @see 7.1.9 */ - $rpIdHash = hash('sha256', $facetId, true); - Assertion::true(hash_equals($rpIdHash, $attestationObject->getAuthData()->getRpIdHash()), 'rpId hash mismatch.'); - - /** @see 7.1.10 */ - Assertion::true($attestationObject->getAuthData()->isUserPresent(), 'User was not present'); - /** @see 7.1.11 */ - if (AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_REQUIRED === $publicKeyCredentialCreationOptions->getAuthenticatorSelection()->getUserVerification()) { - Assertion::true($attestationObject->getAuthData()->isUserVerified(), 'User authentication required.'); - } - - /** @see 7.1.12 */ - $extensionsClientOutputs = $attestationObject->getAuthData()->getExtensions(); - if (null !== $extensionsClientOutputs) { - $this->extensionOutputCheckerHandler->check( - $publicKeyCredentialCreationOptions->getExtensions(), - $extensionsClientOutputs - ); - } - - /** @see 7.1.13 */ - $this->checkMetadataStatement($publicKeyCredentialCreationOptions, $attestationObject); - $fmt = $attestationObject->getAttStmt()->getFmt(); - Assertion::true($this->attestationStatementSupportManager->has($fmt), 'Unsupported attestation statement format.'); - - /** @see 7.1.14 */ - $attestationStatementSupport = $this->attestationStatementSupportManager->get($fmt); - Assertion::true($attestationStatementSupport->isValid($clientDataJSONHash, $attestationObject->getAttStmt(), $attestationObject->getAuthData()), 'Invalid attestation statement.'); - - /** @see 7.1.15 */ - /** @see 7.1.16 */ - /** @see 7.1.17 */ - Assertion::true($attestationObject->getAuthData()->hasAttestedCredentialData(), 'There is no attested credential data.'); - $attestedCredentialData = $attestationObject->getAuthData()->getAttestedCredentialData(); - Assertion::notNull($attestedCredentialData, 'There is no attested credential data.'); - $credentialId = $attestedCredentialData->getCredentialId(); - Assertion::null($this->publicKeyCredentialSource->findOneByCredentialId($credentialId), 'The credential ID already exists.'); - - /** @see 7.1.18 */ - /** @see 7.1.19 */ - $publicKeyCredentialSource = $this->createPublicKeyCredentialSource( - $credentialId, - $attestedCredentialData, - $attestationObject, - $publicKeyCredentialCreationOptions->getUser()->getId() - ); - $this->logger->info('The attestation is valid'); - $this->logger->debug('Public Key Credential Source', ['publicKeyCredentialSource' => $publicKeyCredentialSource]); - - return $publicKeyCredentialSource; - } catch (Throwable $throwable) { - $this->logger->error('An error occurred', [ - 'exception' => $throwable, - ]); - throw $throwable; - } - } - - private function checkCertificateChain(AttestationStatement $attestationStatement, ?MetadataStatement $metadataStatement): void - { - $trustPath = $attestationStatement->getTrustPath(); - if (!$trustPath instanceof CertificateTrustPath) { - return; - } - $authenticatorCertificates = $trustPath->getCertificates(); - - if (null === $metadataStatement) { - // @phpstan-ignore-next-line - null === $this->certificateChainChecker ? CertificateToolbox::checkChain($authenticatorCertificates) : $this->certificateChainChecker->check($authenticatorCertificates, [], null); - - return; - } - - $metadataStatementCertificates = $metadataStatement->getAttestationRootCertificates(); - $rootStatementCertificates = $metadataStatement->getRootCertificates(); - foreach ($metadataStatementCertificates as $key => $metadataStatementCertificate) { - $metadataStatementCertificates[$key] = CertificateToolbox::fixPEMStructure($metadataStatementCertificate); - } - $trustedCertificates = array_merge( - $metadataStatementCertificates, - $rootStatementCertificates - ); - - // @phpstan-ignore-next-line - null === $this->certificateChainChecker ? CertificateToolbox::checkChain($authenticatorCertificates, $trustedCertificates) : $this->certificateChainChecker->check($authenticatorCertificates, $trustedCertificates); - } - - private function checkMetadataStatement(PublicKeyCredentialCreationOptions $publicKeyCredentialCreationOptions, AttestationObject $attestationObject): void - { - $attestationStatement = $attestationObject->getAttStmt(); - $attestedCredentialData = $attestationObject->getAuthData()->getAttestedCredentialData(); - Assertion::notNull($attestedCredentialData, 'No attested credential data found'); - $aaguid = $attestedCredentialData->getAaguid()->toString(); - if (PublicKeyCredentialCreationOptions::ATTESTATION_CONVEYANCE_PREFERENCE_NONE === $publicKeyCredentialCreationOptions->getAttestation()) { - $this->logger->debug('No attestation is asked.'); - //No attestation is asked. We shall ensure that the data is anonymous. - if ( - '00000000-0000-0000-0000-000000000000' === $aaguid - && (AttestationStatement::TYPE_NONE === $attestationStatement->getType() || AttestationStatement::TYPE_SELF === $attestationStatement->getType())) { - $this->logger->debug('The Attestation Statement is anonymous.'); - $this->checkCertificateChain($attestationStatement, null); - - return; - } - $this->logger->debug('Anonymization required. AAGUID and Attestation Statement changed.', [ - 'aaguid' => $aaguid, - 'AttestationStatement' => $attestationStatement, - ]); - $attestedCredentialData->setAaguid( - Uuid::fromString('00000000-0000-0000-0000-000000000000') - ); - $attestationObject->setAttStmt(AttestationStatement::createNone('none', [], new EmptyTrustPath())); - - return; - } - if (AttestationStatement::TYPE_NONE === $attestationStatement->getType()) { - $this->logger->debug('No attestation returned.'); - //No attestation is returned. We shall ensure that the AAGUID is a null one. - if ('00000000-0000-0000-0000-000000000000' !== $aaguid) { - $this->logger->debug('Anonymization required. AAGUID and Attestation Statement changed.', [ - 'aaguid' => $aaguid, - 'AttestationStatement' => $attestationStatement, - ]); - $attestedCredentialData->setAaguid( - Uuid::fromString('00000000-0000-0000-0000-000000000000') - ); - - return; - } - - return; - } - - //The MDS Repository is mandatory here - Assertion::notNull($this->metadataStatementRepository, 'The Metadata Statement Repository is mandatory when requesting attestation objects.'); - $metadataStatement = $this->metadataStatementRepository->findOneByAAGUID($aaguid); - - // We check the last status report - $this->checkStatusReport(null === $metadataStatement ? [] : $metadataStatement->getStatusReports()); - - // We check the certificate chain (if any) - $this->checkCertificateChain($attestationStatement, $metadataStatement); - - // If no Attestation Statement has been returned or if null AAGUID (=00000000-0000-0000-0000-000000000000) - // => nothing to check - if ('00000000-0000-0000-0000-000000000000' === $aaguid || AttestationStatement::TYPE_NONE === $attestationStatement->getType()) { - return; - } - - // At this point, the Metadata Statement is mandatory - Assertion::notNull($metadataStatement, sprintf('The Metadata Statement for the AAGUID "%s" is missing', $aaguid)); - - // Check Attestation Type is allowed - if (0 !== count($metadataStatement->getAttestationTypes())) { - $type = $this->getAttestationType($attestationStatement); - Assertion::inArray($type, $metadataStatement->getAttestationTypes(), 'Invalid attestation statement. The attestation type is not allowed for this authenticator'); - } - } - - /** - * @param StatusReport[] $statusReports - */ - private function checkStatusReport(array $statusReports): void - { - if (0 !== count($statusReports)) { - $lastStatusReport = end($statusReports); - if ($lastStatusReport->isCompromised()) { - throw new LogicException('The authenticator is compromised and cannot be used'); - } - } - } - - private function createPublicKeyCredentialSource(string $credentialId, AttestedCredentialData $attestedCredentialData, AttestationObject $attestationObject, string $userHandle): PublicKeyCredentialSource - { - return new PublicKeyCredentialSource( - $credentialId, - PublicKeyCredentialDescriptor::CREDENTIAL_TYPE_PUBLIC_KEY, - [], - $attestationObject->getAttStmt()->getType(), - $attestationObject->getAttStmt()->getTrustPath(), - $attestedCredentialData->getAaguid(), - $attestedCredentialData->getCredentialPublicKey(), - $userHandle, - $attestationObject->getAuthData()->getSignCount() - ); - } - - private function getAttestationType(AttestationStatement $attestationStatement): int - { - switch ($attestationStatement->getType()) { - case AttestationStatement::TYPE_BASIC: - return MetadataStatement::ATTESTATION_BASIC_FULL; - case AttestationStatement::TYPE_SELF: - return MetadataStatement::ATTESTATION_BASIC_SURROGATE; - case AttestationStatement::TYPE_ATTCA: - return MetadataStatement::ATTESTATION_ATTCA; - case AttestationStatement::TYPE_ECDAA: - return MetadataStatement::ATTESTATION_ECDAA; - default: - throw new InvalidArgumentException('Invalid attestation type'); - } - } - - private function getFacetId(string $rpId, AuthenticationExtensionsClientInputs $authenticationExtensionsClientInputs, ?AuthenticationExtensionsClientOutputs $authenticationExtensionsClientOutputs): string - { - if (null === $authenticationExtensionsClientOutputs || !$authenticationExtensionsClientInputs->has('appid') || !$authenticationExtensionsClientOutputs->has('appid')) { - return $rpId; - } - $appId = $authenticationExtensionsClientInputs->get('appid')->value(); - $wasUsed = $authenticationExtensionsClientOutputs->get('appid')->value(); - if (!is_string($appId) || true !== $wasUsed) { - return $rpId; - } - - return $appId; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorData.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorData.php deleted file mode 100644 index 086ae50b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorData.php +++ /dev/null @@ -1,124 +0,0 @@ -rpIdHash = $rpIdHash; - $this->flags = $flags; - $this->signCount = $signCount; - $this->attestedCredentialData = $attestedCredentialData; - $this->extensions = $extensions; - $this->authData = $authData; - } - - public function getAuthData(): string - { - return $this->authData; - } - - public function getRpIdHash(): string - { - return $this->rpIdHash; - } - - public function isUserPresent(): bool - { - return 0 !== (ord($this->flags) & self::FLAG_UP) ? true : false; - } - - public function isUserVerified(): bool - { - return 0 !== (ord($this->flags) & self::FLAG_UV) ? true : false; - } - - public function hasAttestedCredentialData(): bool - { - return 0 !== (ord($this->flags) & self::FLAG_AT) ? true : false; - } - - public function hasExtensions(): bool - { - return 0 !== (ord($this->flags) & self::FLAG_ED) ? true : false; - } - - public function getReservedForFutureUse1(): int - { - return ord($this->flags) & self::FLAG_RFU1; - } - - public function getReservedForFutureUse2(): int - { - return ord($this->flags) & self::FLAG_RFU2; - } - - public function getSignCount(): int - { - return $this->signCount; - } - - public function getAttestedCredentialData(): ?AttestedCredentialData - { - return $this->attestedCredentialData; - } - - public function getExtensions(): ?AuthenticationExtensionsClientOutputs - { - return null !== $this->extensions && $this->hasExtensions() ? $this->extensions : null; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorResponse.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorResponse.php deleted file mode 100644 index 2bcee456..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorResponse.php +++ /dev/null @@ -1,35 +0,0 @@ -clientDataJSON = $clientDataJSON; - } - - public function getClientDataJSON(): CollectedClientData - { - return $this->clientDataJSON; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorSelectionCriteria.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorSelectionCriteria.php deleted file mode 100644 index 7f700dd0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/AuthenticatorSelectionCriteria.php +++ /dev/null @@ -1,167 +0,0 @@ -authenticatorAttachment = $authenticatorAttachment; - $this->requireResidentKey = $requireResidentKey ?? false; - $this->userVerification = $userVerification ?? self::USER_VERIFICATION_REQUIREMENT_PREFERRED; - $this->residentKey = $residentKey ?? self::RESIDENT_KEY_REQUIREMENT_NONE; - } - - public static function create(): self - { - return new self(); - } - - public function setAuthenticatorAttachment(?string $authenticatorAttachment): self - { - $this->authenticatorAttachment = $authenticatorAttachment; - - return $this; - } - - public function setRequireResidentKey(bool $requireResidentKey): self - { - $this->requireResidentKey = $requireResidentKey; - - return $this; - } - - public function setUserVerification(string $userVerification): self - { - $this->userVerification = $userVerification; - - return $this; - } - - public function setResidentKey(?string $residentKey): self - { - $this->residentKey = $residentKey; - - return $this; - } - - public function getAuthenticatorAttachment(): ?string - { - return $this->authenticatorAttachment; - } - - public function isRequireResidentKey(): bool - { - return $this->requireResidentKey; - } - - public function getUserVerification(): string - { - return $this->userVerification; - } - - public function getResidentKey(): ?string - { - return $this->residentKey; - } - - public static function createFromString(string $data): self - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - return self::create() - ->setAuthenticatorAttachment($json['authenticatorAttachment'] ?? null) - ->setRequireResidentKey($json['requireResidentKey'] ?? false) - ->setUserVerification($json['userVerification'] ?? self::USER_VERIFICATION_REQUIREMENT_PREFERRED) - ->setResidentKey($json['residentKey'] ?? self::RESIDENT_KEY_REQUIREMENT_NONE) - ; - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $json = [ - 'requireResidentKey' => $this->requireResidentKey, - 'userVerification' => $this->userVerification, - ]; - if (null !== $this->authenticatorAttachment) { - $json['authenticatorAttachment'] = $this->authenticatorAttachment; - } - if (null !== $this->residentKey) { - $json['residentKey'] = $this->residentKey; - } - - return $json; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CertificateChainChecker/CertificateChainChecker.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CertificateChainChecker/CertificateChainChecker.php deleted file mode 100644 index 12e9974e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CertificateChainChecker/CertificateChainChecker.php +++ /dev/null @@ -1,23 +0,0 @@ -client = $client; - $this->requestFactory = $requestFactory; - } - - public function addRootCertificate(string $certificate): self - { - $this->rootCertificates[] = $certificate; - - return $this; - } - - /** - * @param string[] $authenticatorCertificates - * @param string[] $trustedCertificates - */ - public function check(array $authenticatorCertificates, array $trustedCertificates): void - { - if (0 === count($trustedCertificates)) { - $this->checkCertificatesValidity($authenticatorCertificates, true); - - return; - } - $this->checkCertificatesValidity($authenticatorCertificates, false); - - $hasCrls = false; - $processArguments = ['-no-CAfile', '-no-CApath']; - - $caDirname = $this->createTemporaryDirectory(); - $processArguments[] = '--CApath'; - $processArguments[] = $caDirname; - - foreach ($trustedCertificates as $certificate) { - $this->saveToTemporaryFile($caDirname, $certificate, 'webauthn-trusted-', '.pem'); - $crl = $this->getCrls($certificate); - if ('' !== $crl) { - $hasCrls = true; - $this->saveToTemporaryFile($caDirname, $crl, 'webauthn-trusted-crl-', '.crl'); - } - } - - $rehashProcess = new Process(['openssl', 'rehash', $caDirname]); - $rehashProcess->run(); - while ($rehashProcess->isRunning()) { - //Just wait - } - if (!$rehashProcess->isSuccessful()) { - throw new InvalidArgumentException('Invalid certificate or certificate chain'); - } - - $filenames = []; - $leafCertificate = array_shift($authenticatorCertificates); - $leafFilename = $this->saveToTemporaryFile(sys_get_temp_dir(), $leafCertificate, 'webauthn-leaf-', '.pem'); - $crl = $this->getCrls($leafCertificate); - if ('' !== $crl) { - $hasCrls = true; - $this->saveToTemporaryFile($caDirname, $crl, 'webauthn-leaf-crl-', '.pem'); - } - $filenames[] = $leafFilename; - - foreach ($authenticatorCertificates as $certificate) { - $untrustedFilename = $this->saveToTemporaryFile(sys_get_temp_dir(), $certificate, 'webauthn-untrusted-', '.pem'); - $crl = $this->getCrls($certificate); - if ('' !== $crl) { - $hasCrls = true; - $this->saveToTemporaryFile($caDirname, $crl, 'webauthn-untrusted-crl-', '.pem'); - } - $processArguments[] = '-untrusted'; - $processArguments[] = $untrustedFilename; - $filenames[] = $untrustedFilename; - } - - $processArguments[] = $leafFilename; - if ($hasCrls) { - array_unshift($processArguments, '-crl_check'); - array_unshift($processArguments, '-crl_check_all'); - //array_unshift($processArguments, '-crl_download'); - array_unshift($processArguments, '-extended_crl'); - } - array_unshift($processArguments, 'openssl', 'verify'); - - $process = new Process($processArguments); - $process->run(); - while ($process->isRunning()) { - //Just wait - } - - foreach ($filenames as $filename) { - try { - unlink($filename); - } catch (FilesystemException $e) { - continue; - } - } - $this->deleteDirectory($caDirname); - - if (!$process->isSuccessful()) { - throw new InvalidArgumentException('Invalid certificate or certificate chain'); - } - } - - /** - * @param string[] $certificates - */ - private function checkCertificatesValidity(array $certificates, bool $allowRootCertificate): void - { - foreach ($certificates as $certificate) { - $parsed = openssl_x509_parse($certificate); - Assertion::isArray($parsed, 'Unable to read the certificate'); - if (false === $allowRootCertificate) { - $this->checkRootCertificate($parsed); - } - - Assertion::keyExists($parsed, 'validTo_time_t', 'The certificate has no validity period'); - Assertion::keyExists($parsed, 'validFrom_time_t', 'The certificate has no validity period'); - Assertion::lessOrEqualThan(time(), $parsed['validTo_time_t'], 'The certificate expired'); - Assertion::greaterOrEqualThan(time(), $parsed['validFrom_time_t'], 'The certificate is not usable yet'); - } - } - - /** - * @param array $parsed - */ - private function checkRootCertificate(array $parsed): void - { - Assertion::keyExists($parsed, 'subject', 'The certificate has no subject'); - Assertion::keyExists($parsed, 'issuer', 'The certificate has no issuer'); - $subject = $parsed['subject']; - $issuer = $parsed['issuer']; - ksort($subject); - ksort($issuer); - Assertion::notEq($subject, $issuer, 'Root certificates are not allowed'); - } - - private function createTemporaryDirectory(): string - { - $caDir = tempnam(sys_get_temp_dir(), 'webauthn-ca-'); - if (file_exists($caDir)) { - unlink($caDir); - } - mkdir($caDir); - if (!is_dir($caDir)) { - throw new RuntimeException(sprintf('Directory "%s" was not created', $caDir)); - } - - return $caDir; - } - - private function deleteDirectory(string $dirname): void - { - $rehashProcess = new Process(['rm', '-rf', $dirname]); - $rehashProcess->run(); - while ($rehashProcess->isRunning()) { - //Just wait - } - } - - private function saveToTemporaryFile(string $folder, string $certificate, string $prefix, string $suffix): string - { - $filename = tempnam($folder, $prefix); - rename($filename, $filename.$suffix); - file_put_contents($filename.$suffix, $certificate, FILE_APPEND); - - return $filename.$suffix; - } - - private function getCrls(string $certificate): string - { - $parsed = openssl_x509_parse($certificate); - if (false === $parsed || !isset($parsed['extensions']['crlDistributionPoints'])) { - return ''; - } - $endpoint = $parsed['extensions']['crlDistributionPoints']; - $pos = mb_strpos($endpoint, 'URI:'); - if (!is_int($pos)) { - return ''; - } - - $endpoint = trim(mb_substr($endpoint, $pos + 4)); - $request = $this->requestFactory->createRequest('GET', $endpoint); - $response = $this->client->sendRequest($request); - - if (200 !== $response->getStatusCode()) { - return ''; - } - - return $response->getBody()->getContents(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CertificateToolbox.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CertificateToolbox.php deleted file mode 100644 index 51a08ab9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CertificateToolbox.php +++ /dev/null @@ -1,223 +0,0 @@ -run(); - while ($rehashProcess->isRunning()) { - //Just wait - } - if (!$rehashProcess->isSuccessful()) { - throw new InvalidArgumentException('Invalid certificate or certificate chain'); - } - - $filenames = []; - $leafCertificate = array_shift($authenticatorCertificates); - $leafFilename = self::prepareCertificate(sys_get_temp_dir(), $leafCertificate, 'webauthn-leaf-', '.pem'); - $filenames[] = $leafFilename; - - foreach ($authenticatorCertificates as $certificate) { - $untrustedFilename = self::prepareCertificate(sys_get_temp_dir(), $certificate, 'webauthn-untrusted-', '.pem'); - $processArguments[] = '-untrusted'; - $processArguments[] = $untrustedFilename; - $filenames[] = $untrustedFilename; - } - - $processArguments[] = $leafFilename; - array_unshift($processArguments, 'openssl', 'verify'); - - $process = new Process($processArguments); - $process->run(); - while ($process->isRunning()) { - //Just wait - } - - foreach ($filenames as $filename) { - try { - unlink($filename); - } catch (FilesystemException $e) { - continue; - } - } - self::deleteDirectory($caDirname); - - if (!$process->isSuccessful()) { - throw new InvalidArgumentException('Invalid certificate or certificate chain'); - } - } - - public static function fixPEMStructure(string $certificate, string $type = 'CERTIFICATE'): string - { - $pemCert = '-----BEGIN '.$type.'-----'.PHP_EOL; - $pemCert .= chunk_split($certificate, 64, PHP_EOL); - $pemCert .= '-----END '.$type.'-----'.PHP_EOL; - - return $pemCert; - } - - public static function convertDERToPEM(string $certificate, string $type = 'CERTIFICATE'): string - { - $derCertificate = self::unusedBytesFix($certificate); - - return self::fixPEMStructure(base64_encode($derCertificate), $type); - } - - /** - * @param string[] $certificates - * - * @return string[] - */ - public static function convertAllDERToPEM(array $certificates, string $type = 'CERTIFICATE'): array - { - $certs = []; - foreach ($certificates as $publicKey) { - $certs[] = self::convertDERToPEM($publicKey, $type); - } - - return $certs; - } - - private static function unusedBytesFix(string $certificate): string - { - $certificateHash = hash('sha256', $certificate); - if (in_array($certificateHash, self::getCertificateHashes(), true)) { - $certificate[mb_strlen($certificate, '8bit') - 257] = "\0"; - } - - return $certificate; - } - - /** - * @param string[] $certificates - */ - private static function checkCertificatesValidity(array $certificates, bool $allowRootCertificate): void - { - foreach ($certificates as $certificate) { - $parsed = openssl_x509_parse($certificate); - Assertion::isArray($parsed, 'Unable to read the certificate'); - if (false === $allowRootCertificate) { - self::checkRootCertificate($parsed); - } - - Assertion::keyExists($parsed, 'validTo_time_t', 'The certificate has no validity period'); - Assertion::keyExists($parsed, 'validFrom_time_t', 'The certificate has no validity period'); - Assertion::lessOrEqualThan(time(), $parsed['validTo_time_t'], 'The certificate expired'); - Assertion::greaterOrEqualThan(time(), $parsed['validFrom_time_t'], 'The certificate is not usable yet'); - } - } - - /** - * @param array $parsed - */ - private static function checkRootCertificate(array $parsed): void - { - Assertion::keyExists($parsed, 'subject', 'The certificate has no subject'); - Assertion::keyExists($parsed, 'issuer', 'The certificate has no issuer'); - $subject = $parsed['subject']; - $issuer = $parsed['issuer']; - ksort($subject); - ksort($issuer); - Assertion::notEq($subject, $issuer, 'Root certificates are not allowed'); - } - - /** - * @return string[] - */ - private static function getCertificateHashes(): array - { - return [ - '349bca1031f8c82c4ceca38b9cebf1a69df9fb3b94eed99eb3fb9aa3822d26e8', - 'dd574527df608e47ae45fbba75a2afdd5c20fd94a02419381813cd55a2a3398f', - '1d8764f0f7cd1352df6150045c8f638e517270e8b5dda1c63ade9c2280240cae', - 'd0edc9a91a1677435a953390865d208c55b3183c6759c9b5a7ff494c322558eb', - '6073c436dcd064a48127ddbf6032ac1a66fd59a0c24434f070d4e564c124c897', - 'ca993121846c464d666096d35f13bf44c1b05af205f9b4a1e00cf6cc10c5e511', - ]; - } - - private static function createTemporaryDirectory(): string - { - $caDir = tempnam(sys_get_temp_dir(), 'webauthn-ca-'); - if (file_exists($caDir)) { - unlink($caDir); - } - mkdir($caDir); - if (!is_dir($caDir)) { - throw new RuntimeException(sprintf('Directory "%s" was not created', $caDir)); - } - - return $caDir; - } - - private static function deleteDirectory(string $dirname): void - { - $rehashProcess = new Process(['rm', '-rf', $dirname]); - $rehashProcess->run(); - while ($rehashProcess->isRunning()) { - //Just wait - } - } - - private static function prepareCertificate(string $folder, string $certificate, string $prefix, string $suffix): string - { - $untrustedFilename = tempnam($folder, $prefix); - rename($untrustedFilename, $untrustedFilename.$suffix); - file_put_contents($untrustedFilename.$suffix, $certificate, FILE_APPEND); - file_put_contents($untrustedFilename.$suffix, PHP_EOL, FILE_APPEND); - - return $untrustedFilename.$suffix; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CollectedClientData.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CollectedClientData.php deleted file mode 100644 index d020cca8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/CollectedClientData.php +++ /dev/null @@ -1,145 +0,0 @@ -type = $this->findData($data, 'type'); - $this->challenge = $this->findData($data, 'challenge', true, true); - $this->origin = $this->findData($data, 'origin'); - $this->tokenBinding = $this->findData($data, 'tokenBinding', false); - $this->rawData = $rawData; - $this->data = $data; - } - - public static function createFormJson(string $data): self - { - $rawData = Base64Url::decode($data); - $json = json_decode($rawData, true); - Assertion::isArray($json, 'Invalid collected client data'); - - return new self($rawData, $json); - } - - public function getType(): string - { - return $this->type; - } - - public function getChallenge(): string - { - return $this->challenge; - } - - public function getOrigin(): string - { - return $this->origin; - } - - public function getTokenBinding(): ?TokenBinding - { - return null === $this->tokenBinding ? null : TokenBinding::createFormArray($this->tokenBinding); - } - - public function getRawData(): string - { - return $this->rawData; - } - - /** - * @return string[] - */ - public function all(): array - { - return array_keys($this->data); - } - - public function has(string $key): bool - { - return array_key_exists($key, $this->data); - } - - /** - * @return mixed - */ - public function get(string $key) - { - if (!$this->has($key)) { - throw new InvalidArgumentException(sprintf('The key "%s" is missing', $key)); - } - - return $this->data[$key]; - } - - /** - * @param mixed[] $json - * - * @return mixed|null - */ - private function findData(array $json, string $key, bool $isRequired = true, bool $isB64 = false) - { - if (!array_key_exists($key, $json)) { - if ($isRequired) { - throw new InvalidArgumentException(sprintf('The key "%s" is missing', $key)); - } - - return; - } - - return $isB64 ? Base64Url::decode($json[$key]) : $json[$key]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Counter/CounterChecker.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Counter/CounterChecker.php deleted file mode 100644 index ed128bb1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Counter/CounterChecker.php +++ /dev/null @@ -1,21 +0,0 @@ -logger = $logger ?? new NullLogger(); - } - - public function check(PublicKeyCredentialSource $publicKeyCredentialSource, int $currentCounter): void - { - try { - Assertion::greaterThan($currentCounter, $publicKeyCredentialSource->getCounter(), 'Invalid counter.'); - } catch (Throwable $throwable) { - $this->logger->error('The counter is invalid', [ - 'current' => $currentCounter, - 'new' => $publicKeyCredentialSource->getCounter(), - ]); - throw $throwable; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Credential.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Credential.php deleted file mode 100644 index bfaaadd7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Credential.php +++ /dev/null @@ -1,46 +0,0 @@ -id = $id; - $this->type = $type; - } - - public function getId(): string - { - return $this->id; - } - - public function getType(): string - { - return $this->type; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredential.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredential.php deleted file mode 100644 index 66758a9e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredential.php +++ /dev/null @@ -1,62 +0,0 @@ -rawId = $rawId; - $this->response = $response; - } - - public function __toString() - { - return json_encode($this); - } - - public function getRawId(): string - { - return $this->rawId; - } - - public function getResponse(): AuthenticatorResponse - { - return $this->response; - } - - /** - * @param string[] $transport - */ - public function getPublicKeyCredentialDescriptor(array $transport = []): PublicKeyCredentialDescriptor - { - return new PublicKeyCredentialDescriptor($this->getType(), $this->getRawId(), $transport); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialCreationOptions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialCreationOptions.php deleted file mode 100644 index 84a3d287..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialCreationOptions.php +++ /dev/null @@ -1,261 +0,0 @@ -rp = $rp; - $this->user = $user; - $this->pubKeyCredParams = $pubKeyCredParams; - $this->authenticatorSelection = $authenticatorSelection ?? new AuthenticatorSelectionCriteria(); - $this->attestation = $attestation ?? self::ATTESTATION_CONVEYANCE_PREFERENCE_NONE; - $this->excludeCredentials($excludeCredentials) - ; - } - - /** - * @param PublicKeyCredentialParameters[] $pubKeyCredParams - */ - public static function create(PublicKeyCredentialRpEntity $rp, PublicKeyCredentialUserEntity $user, string $challenge, array $pubKeyCredParams): self - { - return new self($rp, $user, $challenge, $pubKeyCredParams); - } - - public function addPubKeyCredParam(PublicKeyCredentialParameters $pubKeyCredParam): self - { - $this->pubKeyCredParams[] = $pubKeyCredParam; - - return $this; - } - - /** - * @param PublicKeyCredentialParameters[] $pubKeyCredParams - */ - public function addPubKeyCredParams(array $pubKeyCredParams): self - { - foreach ($pubKeyCredParams as $pubKeyCredParam) { - $this->addPubKeyCredParam($pubKeyCredParam); - } - - return $this; - } - - public function excludeCredential(PublicKeyCredentialDescriptor $excludeCredential): self - { - $this->excludeCredentials[] = $excludeCredential; - - return $this; - } - - /** - * @param PublicKeyCredentialDescriptor[] $excludeCredentials - */ - public function excludeCredentials(array $excludeCredentials): self - { - foreach ($excludeCredentials as $excludeCredential) { - $this->excludeCredential($excludeCredential); - } - - return $this; - } - - public function setAuthenticatorSelection(AuthenticatorSelectionCriteria $authenticatorSelection): self - { - $this->authenticatorSelection = $authenticatorSelection; - - return $this; - } - - public function setAttestation(string $attestation): self - { - Assertion::inArray($attestation, [ - self::ATTESTATION_CONVEYANCE_PREFERENCE_NONE, - self::ATTESTATION_CONVEYANCE_PREFERENCE_DIRECT, - self::ATTESTATION_CONVEYANCE_PREFERENCE_INDIRECT, - self::ATTESTATION_CONVEYANCE_PREFERENCE_ENTERPRISE, - ], 'Invalid attestation conveyance mode'); - $this->attestation = $attestation; - - return $this; - } - - public function getRp(): PublicKeyCredentialRpEntity - { - return $this->rp; - } - - public function getUser(): PublicKeyCredentialUserEntity - { - return $this->user; - } - - /** - * @return PublicKeyCredentialParameters[] - */ - public function getPubKeyCredParams(): array - { - return $this->pubKeyCredParams; - } - - /** - * @return PublicKeyCredentialDescriptor[] - */ - public function getExcludeCredentials(): array - { - return $this->excludeCredentials; - } - - public function getAuthenticatorSelection(): AuthenticatorSelectionCriteria - { - return $this->authenticatorSelection; - } - - public function getAttestation(): string - { - return $this->attestation; - } - - public static function createFromString(string $data): PublicKeyCredentialOptions - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - public static function createFromArray(array $json): PublicKeyCredentialOptions - { - Assertion::keyExists($json, 'rp', 'Invalid input. "rp" is missing.'); - Assertion::keyExists($json, 'pubKeyCredParams', 'Invalid input. "pubKeyCredParams" is missing.'); - Assertion::isArray($json['pubKeyCredParams'], 'Invalid input. "pubKeyCredParams" is not an array.'); - Assertion::keyExists($json, 'challenge', 'Invalid input. "challenge" is missing.'); - Assertion::keyExists($json, 'attestation', 'Invalid input. "attestation" is missing.'); - Assertion::keyExists($json, 'user', 'Invalid input. "user" is missing.'); - Assertion::keyExists($json, 'authenticatorSelection', 'Invalid input. "authenticatorSelection" is missing.'); - - $pubKeyCredParams = []; - foreach ($json['pubKeyCredParams'] as $pubKeyCredParam) { - $pubKeyCredParams[] = PublicKeyCredentialParameters::createFromArray($pubKeyCredParam); - } - $excludeCredentials = []; - if (isset($json['excludeCredentials'])) { - foreach ($json['excludeCredentials'] as $excludeCredential) { - $excludeCredentials[] = PublicKeyCredentialDescriptor::createFromArray($excludeCredential); - } - } - - return self::create( - PublicKeyCredentialRpEntity::createFromArray($json['rp']), - PublicKeyCredentialUserEntity::createFromArray($json['user']), - Base64Url::decode($json['challenge']), - $pubKeyCredParams - ) - ->excludeCredentials($excludeCredentials) - ->setAuthenticatorSelection(AuthenticatorSelectionCriteria::createFromArray($json['authenticatorSelection'])) - ->setAttestation($json['attestation']) - ->setTimeout($json['timeout'] ?? null) - ->setExtensions(isset($json['extensions']) ? AuthenticationExtensionsClientInputs::createFromArray($json['extensions']) : new AuthenticationExtensionsClientInputs()) - ; - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $json = [ - 'rp' => $this->rp->jsonSerialize(), - 'pubKeyCredParams' => array_map(static function (PublicKeyCredentialParameters $object): array { - return $object->jsonSerialize(); - }, $this->pubKeyCredParams), - 'challenge' => Base64Url::encode($this->challenge), - 'attestation' => $this->attestation, - 'user' => $this->user->jsonSerialize(), - 'authenticatorSelection' => $this->authenticatorSelection->jsonSerialize(), - ]; - - if (0 !== count($this->excludeCredentials)) { - $json['excludeCredentials'] = array_map(static function (PublicKeyCredentialDescriptor $object): array { - return $object->jsonSerialize(); - }, $this->excludeCredentials); - } - - if (0 !== $this->extensions->count()) { - $json['extensions'] = $this->extensions; - } - - if (null !== $this->timeout) { - $json['timeout'] = $this->timeout; - } - - return $json; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php deleted file mode 100644 index 0008f105..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php +++ /dev/null @@ -1,112 +0,0 @@ -type = $type; - $this->id = $id; - $this->transports = $transports; - } - - public function getType(): string - { - return $this->type; - } - - public function getId(): string - { - return $this->id; - } - - /** - * @return string[] - */ - public function getTransports(): array - { - return $this->transports; - } - - public static function createFromString(string $data): self - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - Assertion::keyExists($json, 'type', 'Invalid input. "type" is missing.'); - Assertion::keyExists($json, 'id', 'Invalid input. "id" is missing.'); - - return new self( - $json['type'], - Base64Url::decode($json['id']), - $json['transports'] ?? [] - ); - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $json = [ - 'type' => $this->type, - 'id' => Base64Url::encode($this->id), - ]; - if (0 !== count($this->transports)) { - $json['transports'] = $this->transports; - } - - return $json; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptorCollection.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptorCollection.php deleted file mode 100644 index 822b4731..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptorCollection.php +++ /dev/null @@ -1,95 +0,0 @@ -publicKeyCredentialDescriptors[$publicKeyCredentialDescriptor->getId()] = $publicKeyCredentialDescriptor; - } - - public function has(string $id): bool - { - return array_key_exists($id, $this->publicKeyCredentialDescriptors); - } - - public function remove(string $id): void - { - if (!$this->has($id)) { - return; - } - - unset($this->publicKeyCredentialDescriptors[$id]); - } - - /** - * @return Iterator - */ - public function getIterator(): Iterator - { - return new ArrayIterator($this->publicKeyCredentialDescriptors); - } - - public function count(int $mode = COUNT_NORMAL): int - { - return count($this->publicKeyCredentialDescriptors, $mode); - } - - /** - * @return array[] - */ - public function jsonSerialize(): array - { - return array_map(static function (PublicKeyCredentialDescriptor $object): array { - return $object->jsonSerialize(); - }, $this->publicKeyCredentialDescriptors); - } - - public static function createFromString(string $data): self - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - $collection = new self(); - foreach ($json as $item) { - $collection->add(PublicKeyCredentialDescriptor::createFromArray($item)); - } - - return $collection; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialEntity.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialEntity.php deleted file mode 100644 index 8e7533d3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialEntity.php +++ /dev/null @@ -1,60 +0,0 @@ -name = $name; - $this->icon = $icon; - } - - public function getName(): string - { - return $this->name; - } - - public function getIcon(): ?string - { - return $this->icon; - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $json = [ - 'name' => $this->name, - ]; - if (null !== $this->icon) { - $json['icon'] = $this->icon; - } - - return $json; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialLoader.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialLoader.php deleted file mode 100644 index 8fef7fe9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialLoader.php +++ /dev/null @@ -1,181 +0,0 @@ -decoder = new Decoder(new TagObjectManager(), new OtherObjectManager()); - $this->attestationObjectLoader = $attestationObjectLoader; - $this->logger = $logger ?? new NullLogger(); - } - - public static function create(AttestationObjectLoader $attestationObjectLoader): self - { - return new self($attestationObjectLoader); - } - - public function setLogger(LoggerInterface $logger): self - { - $this->logger = $logger; - - return $this; - } - - /** - * @param mixed[] $json - */ - public function loadArray(array $json): PublicKeyCredential - { - $this->logger->info('Trying to load data from an array', ['data' => $json]); - try { - foreach (['id', 'rawId', 'type'] as $key) { - Assertion::keyExists($json, $key, sprintf('The parameter "%s" is missing', $key)); - Assertion::string($json[$key], sprintf('The parameter "%s" shall be a string', $key)); - } - Assertion::keyExists($json, 'response', 'The parameter "response" is missing'); - Assertion::isArray($json['response'], 'The parameter "response" shall be an array'); - Assertion::eq($json['type'], 'public-key', sprintf('Unsupported type "%s"', $json['type'])); - - $id = Base64Url::decode($json['id']); - $rawId = Base64Url::decode($json['rawId']); - Assertion::true(hash_equals($id, $rawId)); - - $publicKeyCredential = new PublicKeyCredential( - $json['id'], - $json['type'], - $rawId, - $this->createResponse($json['response']) - ); - $this->logger->info('The data has been loaded'); - $this->logger->debug('Public Key Credential', ['publicKeyCredential' => $publicKeyCredential]); - - return $publicKeyCredential; - } catch (Throwable $throwable) { - $this->logger->error('An error occurred', [ - 'exception' => $throwable, - ]); - throw $throwable; - } - } - - public function load(string $data): PublicKeyCredential - { - $this->logger->info('Trying to load data from a string', ['data' => $data]); - try { - $json = json_decode($data, true); - - return $this->loadArray($json); - } catch (Throwable $throwable) { - $this->logger->error('An error occurred', [ - 'exception' => $throwable, - ]); - throw $throwable; - } - } - - /** - * @param mixed[] $response - */ - private function createResponse(array $response): AuthenticatorResponse - { - Assertion::keyExists($response, 'clientDataJSON', 'Invalid data. The parameter "clientDataJSON" is missing'); - Assertion::string($response['clientDataJSON'], 'Invalid data. The parameter "clientDataJSON" is invalid'); - switch (true) { - case array_key_exists('attestationObject', $response): - Assertion::string($response['attestationObject'], 'Invalid data. The parameter "attestationObject " is invalid'); - $attestationObject = $this->attestationObjectLoader->load($response['attestationObject']); - - return new AuthenticatorAttestationResponse(CollectedClientData::createFormJson($response['clientDataJSON']), $attestationObject); - case array_key_exists('authenticatorData', $response) && array_key_exists('signature', $response): - $authData = Base64Url::decode($response['authenticatorData']); - - $authDataStream = new StringStream($authData); - $rp_id_hash = $authDataStream->read(32); - $flags = $authDataStream->read(1); - $signCount = $authDataStream->read(4); - $signCount = unpack('N', $signCount)[1]; - - $attestedCredentialData = null; - if (0 !== (ord($flags) & self::FLAG_AT)) { - $aaguid = Uuid::fromBytes($authDataStream->read(16)); - $credentialLength = $authDataStream->read(2); - $credentialLength = unpack('n', $credentialLength)[1]; - $credentialId = $authDataStream->read($credentialLength); - $credentialPublicKey = $this->decoder->decode($authDataStream); - Assertion::isInstanceOf($credentialPublicKey, MapObject::class, 'The data does not contain a valid credential public key.'); - $attestedCredentialData = new AttestedCredentialData($aaguid, $credentialId, (string) $credentialPublicKey); - } - - $extension = null; - if (0 !== (ord($flags) & self::FLAG_ED)) { - $extension = $this->decoder->decode($authDataStream); - $extension = AuthenticationExtensionsClientOutputsLoader::load($extension); - } - Assertion::true($authDataStream->isEOF(), 'Invalid authentication data. Presence of extra bytes.'); - $authDataStream->close(); - $authenticatorData = new AuthenticatorData($authData, $rp_id_hash, $flags, $signCount, $attestedCredentialData, $extension); - - return new AuthenticatorAssertionResponse( - CollectedClientData::createFormJson($response['clientDataJSON']), - $authenticatorData, - Base64Url::decode($response['signature']), - $response['userHandle'] ?? null - ); - default: - throw new InvalidArgumentException('Unable to create the response object'); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialOptions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialOptions.php deleted file mode 100644 index 6d5e79d7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialOptions.php +++ /dev/null @@ -1,104 +0,0 @@ -challenge = $challenge; - $this->setTimeout($timeout); - $this->extensions = $extensions ?? new AuthenticationExtensionsClientInputs(); - } - - public function setTimeout(?int $timeout): self - { - $this->timeout = $timeout; - - return $this; - } - - public function addExtension(AuthenticationExtension $extension): self - { - $this->extensions->add($extension); - - return $this; - } - - /** - * @param AuthenticationExtension[] $extensions - */ - public function addExtensions(array $extensions): self - { - foreach ($extensions as $extension) { - $this->addExtension($extension); - } - - return $this; - } - - public function setExtensions(AuthenticationExtensionsClientInputs $extensions): self - { - $this->extensions = $extensions; - - return $this; - } - - public function getChallenge(): string - { - return $this->challenge; - } - - public function getTimeout(): ?int - { - return $this->timeout; - } - - public function getExtensions(): AuthenticationExtensionsClientInputs - { - return $this->extensions; - } - - abstract public static function createFromString(string $data): self; - - /** - * @param mixed[] $json - */ - abstract public static function createFromArray(array $json): self; -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialParameters.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialParameters.php deleted file mode 100644 index 9b422450..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialParameters.php +++ /dev/null @@ -1,82 +0,0 @@ -type = $type; - $this->alg = $alg; - } - - public function getType(): string - { - return $this->type; - } - - public function getAlg(): int - { - return $this->alg; - } - - public static function createFromString(string $data): self - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - Assertion::keyExists($json, 'type', 'Invalid input. "type" is missing.'); - Assertion::string($json['type'], 'Invalid input. "type" is not a string.'); - Assertion::keyExists($json, 'alg', 'Invalid input. "alg" is missing.'); - Assertion::integer($json['alg'], 'Invalid input. "alg" is not an integer.'); - - return new self( - $json['type'], - $json['alg'] - ); - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - return [ - 'type' => $this->type, - 'alg' => $this->alg, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php deleted file mode 100644 index f11d1c01..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRequestOptions.php +++ /dev/null @@ -1,194 +0,0 @@ -setRpId($rpId) - ->allowCredentials($allowCredentials) - ->setUserVerification($userVerification) - ; - } - - public static function create(string $challenge): self - { - return new self($challenge); - } - - public function setRpId(?string $rpId): self - { - $this->rpId = $rpId; - - return $this; - } - - public function allowCredential(PublicKeyCredentialDescriptor $allowCredential): self - { - $this->allowCredentials[] = $allowCredential; - - return $this; - } - - /** - * @param PublicKeyCredentialDescriptor[] $allowCredentials - */ - public function allowCredentials(array $allowCredentials): self - { - foreach ($allowCredentials as $allowCredential) { - $this->allowCredential($allowCredential); - } - - return $this; - } - - public function setUserVerification(?string $userVerification): self - { - if (null === $userVerification) { - $this->rpId = null; - - return $this; - } - Assertion::inArray($userVerification, [ - self::USER_VERIFICATION_REQUIREMENT_REQUIRED, - self::USER_VERIFICATION_REQUIREMENT_PREFERRED, - self::USER_VERIFICATION_REQUIREMENT_DISCOURAGED, - ], 'Invalid user verification requirement'); - $this->userVerification = $userVerification; - - return $this; - } - - public function getRpId(): ?string - { - return $this->rpId; - } - - /** - * @return PublicKeyCredentialDescriptor[] - */ - public function getAllowCredentials(): array - { - return $this->allowCredentials; - } - - public function getUserVerification(): ?string - { - return $this->userVerification; - } - - public static function createFromString(string $data): PublicKeyCredentialOptions - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): PublicKeyCredentialOptions - { - Assertion::keyExists($json, 'challenge', 'Invalid input. "challenge" is missing.'); - - $allowCredentials = []; - $allowCredentialList = $json['allowCredentials'] ?? []; - foreach ($allowCredentialList as $allowCredential) { - $allowCredentials[] = PublicKeyCredentialDescriptor::createFromArray($allowCredential); - } - - return self::create(Base64Url::decode($json['challenge'])) - ->setRpId($json['rpId'] ?? null) - ->allowCredentials($allowCredentials) - ->setUserVerification($json['userVerification'] ?? null) - ->setTimeout($json['timeout'] ?? null) - ->setExtensions(isset($json['extensions']) ? AuthenticationExtensionsClientInputs::createFromArray($json['extensions']) : new AuthenticationExtensionsClientInputs()) - ; - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $json = [ - 'challenge' => Base64Url::encode($this->challenge), - ]; - - if (null !== $this->rpId) { - $json['rpId'] = $this->rpId; - } - - if (null !== $this->userVerification) { - $json['userVerification'] = $this->userVerification; - } - - if (0 !== count($this->allowCredentials)) { - $json['allowCredentials'] = array_map(static function (PublicKeyCredentialDescriptor $object): array { - return $object->jsonSerialize(); - }, $this->allowCredentials); - } - - if (0 !== $this->extensions->count()) { - $json['extensions'] = $this->extensions->jsonSerialize(); - } - - if (null !== $this->timeout) { - $json['timeout'] = $this->timeout; - } - - return $json; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRpEntity.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRpEntity.php deleted file mode 100644 index 336ce514..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialRpEntity.php +++ /dev/null @@ -1,62 +0,0 @@ -id = $id; - } - - public function getId(): ?string - { - return $this->id; - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - Assertion::keyExists($json, 'name', 'Invalid input. "name" is missing.'); - - return new self( - $json['name'], - $json['id'] ?? null, - $json['icon'] ?? null - ); - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $json = parent::jsonSerialize(); - if (null !== $this->id) { - $json['id'] = $this->id; - } - - return $json; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialSource.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialSource.php deleted file mode 100644 index 8c8ad323..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialSource.php +++ /dev/null @@ -1,240 +0,0 @@ -publicKeyCredentialId = $publicKeyCredentialId; - $this->type = $type; - $this->transports = $transports; - $this->aaguid = $aaguid; - $this->credentialPublicKey = $credentialPublicKey; - $this->userHandle = $userHandle; - $this->counter = $counter; - $this->attestationType = $attestationType; - $this->trustPath = $trustPath; - $this->otherUI = $otherUI; - } - - public function getPublicKeyCredentialId(): string - { - return $this->publicKeyCredentialId; - } - - public function getPublicKeyCredentialDescriptor(): PublicKeyCredentialDescriptor - { - return new PublicKeyCredentialDescriptor( - $this->type, - $this->publicKeyCredentialId, - $this->transports - ); - } - - public function getAttestationType(): string - { - return $this->attestationType; - } - - public function getTrustPath(): TrustPath - { - return $this->trustPath; - } - - public function getAttestedCredentialData(): AttestedCredentialData - { - return new AttestedCredentialData( - $this->aaguid, - $this->publicKeyCredentialId, - $this->credentialPublicKey - ); - } - - public function getType(): string - { - return $this->type; - } - - /** - * @return string[] - */ - public function getTransports(): array - { - return $this->transports; - } - - public function getAaguid(): UuidInterface - { - return $this->aaguid; - } - - public function getCredentialPublicKey(): string - { - return $this->credentialPublicKey; - } - - public function getUserHandle(): string - { - return $this->userHandle; - } - - public function getCounter(): int - { - return $this->counter; - } - - public function setCounter(int $counter): void - { - $this->counter = $counter; - } - - public function getOtherUI(): ?array - { - return $this->otherUI; - } - - public function setOtherUI(?array $otherUI): self - { - $this->otherUI = $otherUI; - - return $this; - } - - /** - * @param mixed[] $data - */ - public static function createFromArray(array $data): self - { - $keys = array_keys(get_class_vars(self::class)); - foreach ($keys as $key) { - if ('otherUI' === $key) { - continue; - } - Assertion::keyExists($data, $key, sprintf('The parameter "%s" is missing', $key)); - } - switch (true) { - case 36 === mb_strlen($data['aaguid'], '8bit'): - $uuid = Uuid::fromString($data['aaguid']); - break; - default: // Kept for compatibility with old format - $decoded = base64_decode($data['aaguid'], true); - $uuid = Uuid::fromBytes($decoded); - } - - try { - return new self( - Base64Url::decode($data['publicKeyCredentialId']), - $data['type'], - $data['transports'], - $data['attestationType'], - TrustPathLoader::loadTrustPath($data['trustPath']), - $uuid, - Base64Url::decode($data['credentialPublicKey']), - Base64Url::decode($data['userHandle']), - $data['counter'], - $data['otherUI'] ?? null - ); - } catch (Throwable $throwable) { - throw new InvalidArgumentException('Unable to load the data', $throwable->getCode(), $throwable); - } - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - return [ - 'publicKeyCredentialId' => Base64Url::encode($this->publicKeyCredentialId), - 'type' => $this->type, - 'transports' => $this->transports, - 'attestationType' => $this->attestationType, - 'trustPath' => $this->trustPath->jsonSerialize(), - 'aaguid' => $this->aaguid->toString(), - 'credentialPublicKey' => Base64Url::encode($this->credentialPublicKey), - 'userHandle' => Base64Url::encode($this->userHandle), - 'counter' => $this->counter, - 'otherUI' => $this->otherUI, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialSourceRepository.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialSourceRepository.php deleted file mode 100644 index 66a0734e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/PublicKeyCredentialSourceRepository.php +++ /dev/null @@ -1,26 +0,0 @@ -id = $id; - $this->displayName = $displayName; - } - - public function getId(): string - { - return $this->id; - } - - public function getDisplayName(): string - { - return $this->displayName; - } - - public static function createFromString(string $data): self - { - $data = json_decode($data, true); - Assertion::isArray($data, 'Invalid data'); - - return self::createFromArray($data); - } - - /** - * @param mixed[] $json - */ - public static function createFromArray(array $json): self - { - Assertion::keyExists($json, 'name', 'Invalid input. "name" is missing.'); - Assertion::keyExists($json, 'id', 'Invalid input. "id" is missing.'); - Assertion::keyExists($json, 'displayName', 'Invalid input. "displayName" is missing.'); - $id = base64_decode($json['id'], true); - - return new self( - $json['name'], - $id, - $json['displayName'], - $json['icon'] ?? null - ); - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - $json = parent::jsonSerialize(); - $json['id'] = base64_encode($this->id); - $json['displayName'] = $this->displayName; - - return $json; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Server.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Server.php deleted file mode 100644 index b1c0dca7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Server.php +++ /dev/null @@ -1,351 +0,0 @@ -rpEntity = $relyingParty; - $this->logger = new NullLogger(); - - $this->coseAlgorithmManagerFactory = new ManagerFactory(); - $this->coseAlgorithmManagerFactory->add('RS1', new RSA\RS1()); - $this->coseAlgorithmManagerFactory->add('RS256', new RSA\RS256()); - $this->coseAlgorithmManagerFactory->add('RS384', new RSA\RS384()); - $this->coseAlgorithmManagerFactory->add('RS512', new RSA\RS512()); - $this->coseAlgorithmManagerFactory->add('PS256', new RSA\PS256()); - $this->coseAlgorithmManagerFactory->add('PS384', new RSA\PS384()); - $this->coseAlgorithmManagerFactory->add('PS512', new RSA\PS512()); - $this->coseAlgorithmManagerFactory->add('ES256', new ECDSA\ES256()); - $this->coseAlgorithmManagerFactory->add('ES256K', new ECDSA\ES256K()); - $this->coseAlgorithmManagerFactory->add('ES384', new ECDSA\ES384()); - $this->coseAlgorithmManagerFactory->add('ES512', new ECDSA\ES512()); - $this->coseAlgorithmManagerFactory->add('Ed25519', new EdDSA\Ed25519()); - - $this->selectedAlgorithms = ['RS256', 'RS512', 'PS256', 'PS512', 'ES256', 'ES512', 'Ed25519']; - $this->publicKeyCredentialSourceRepository = $publicKeyCredentialSourceRepository; - $this->tokenBindingHandler = new IgnoreTokenBindingHandler(); - $this->extensionOutputCheckerHandler = new ExtensionOutputCheckerHandler(); - $this->metadataStatementRepository = $metadataStatementRepository; - } - - public function setMetadataStatementRepository(MetadataStatementRepository $metadataStatementRepository): self - { - $this->metadataStatementRepository = $metadataStatementRepository; - - return $this; - } - - /** - * @param string[] $selectedAlgorithms - */ - public function setSelectedAlgorithms(array $selectedAlgorithms): self - { - $this->selectedAlgorithms = $selectedAlgorithms; - - return $this; - } - - public function setTokenBindingHandler(TokenBindingHandler $tokenBindingHandler): self - { - $this->tokenBindingHandler = $tokenBindingHandler; - - return $this; - } - - public function addAlgorithm(string $alias, Algorithm $algorithm): self - { - $this->coseAlgorithmManagerFactory->add($alias, $algorithm); - $this->selectedAlgorithms[] = $alias; - $this->selectedAlgorithms = array_unique($this->selectedAlgorithms); - - return $this; - } - - public function setExtensionOutputCheckerHandler(ExtensionOutputCheckerHandler $extensionOutputCheckerHandler): self - { - $this->extensionOutputCheckerHandler = $extensionOutputCheckerHandler; - - return $this; - } - - /** - * @param string[] $securedRelyingPartyId - */ - public function setSecuredRelyingPartyId(array $securedRelyingPartyId): self - { - Assertion::allString($securedRelyingPartyId, 'Invalid list. Shall be a list of strings'); - $this->securedRelyingPartyId = $securedRelyingPartyId; - - return $this; - } - - /** - * @param PublicKeyCredentialDescriptor[] $excludedPublicKeyDescriptors - */ - public function generatePublicKeyCredentialCreationOptions(PublicKeyCredentialUserEntity $userEntity, ?string $attestationMode = null, array $excludedPublicKeyDescriptors = [], ?AuthenticatorSelectionCriteria $criteria = null, ?AuthenticationExtensionsClientInputs $extensions = null): PublicKeyCredentialCreationOptions - { - $coseAlgorithmManager = $this->coseAlgorithmManagerFactory->create($this->selectedAlgorithms); - $publicKeyCredentialParametersList = []; - foreach ($coseAlgorithmManager->all() as $algorithm) { - $publicKeyCredentialParametersList[] = new PublicKeyCredentialParameters( - PublicKeyCredentialDescriptor::CREDENTIAL_TYPE_PUBLIC_KEY, - $algorithm::identifier() - ); - } - $criteria = $criteria ?? new AuthenticatorSelectionCriteria(); - $extensions = $extensions ?? new AuthenticationExtensionsClientInputs(); - $challenge = random_bytes($this->challengeSize); - - return PublicKeyCredentialCreationOptions::create( - $this->rpEntity, - $userEntity, - $challenge, - $publicKeyCredentialParametersList - ) - ->excludeCredentials($excludedPublicKeyDescriptors) - ->setAuthenticatorSelection($criteria) - ->setAttestation($attestationMode ?? PublicKeyCredentialCreationOptions::ATTESTATION_CONVEYANCE_PREFERENCE_NONE) - ->setExtensions($extensions) - ->setTimeout($this->timeout) - ; - } - - /** - * @param PublicKeyCredentialDescriptor[] $allowedPublicKeyDescriptors - */ - public function generatePublicKeyCredentialRequestOptions(?string $userVerification = null, array $allowedPublicKeyDescriptors = [], ?AuthenticationExtensionsClientInputs $extensions = null): PublicKeyCredentialRequestOptions - { - return PublicKeyCredentialRequestOptions::create(random_bytes($this->challengeSize)) - ->setRpId($this->rpEntity->getId()) - ->setUserVerification($userVerification ?? PublicKeyCredentialRequestOptions::USER_VERIFICATION_REQUIREMENT_PREFERRED) - ->allowCredentials($allowedPublicKeyDescriptors) - ->setTimeout($this->timeout) - ->setExtensions($extensions ?? new AuthenticationExtensionsClientInputs()) - ; - } - - public function loadAndCheckAttestationResponse(string $data, PublicKeyCredentialCreationOptions $publicKeyCredentialCreationOptions, ServerRequestInterface $serverRequest): PublicKeyCredentialSource - { - $attestationStatementSupportManager = $this->getAttestationStatementSupportManager(); - $attestationObjectLoader = AttestationObjectLoader::create($attestationStatementSupportManager) - ->setLogger($this->logger) - ; - $publicKeyCredentialLoader = PublicKeyCredentialLoader::create($attestationObjectLoader) - ->setLogger($this->logger) - ; - - $publicKeyCredential = $publicKeyCredentialLoader->load($data); - $authenticatorResponse = $publicKeyCredential->getResponse(); - Assertion::isInstanceOf($authenticatorResponse, AuthenticatorAttestationResponse::class, 'Not an authenticator attestation response'); - - $authenticatorAttestationResponseValidator = new AuthenticatorAttestationResponseValidator( - $attestationStatementSupportManager, - $this->publicKeyCredentialSourceRepository, - $this->tokenBindingHandler, - $this->extensionOutputCheckerHandler, - $this->metadataStatementRepository - ); - $authenticatorAttestationResponseValidator->setLogger($this->logger); - - return $authenticatorAttestationResponseValidator->check($authenticatorResponse, $publicKeyCredentialCreationOptions, $serverRequest, $this->securedRelyingPartyId); - } - - public function loadAndCheckAssertionResponse(string $data, PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions, ?PublicKeyCredentialUserEntity $userEntity, ServerRequestInterface $serverRequest): PublicKeyCredentialSource - { - $attestationStatementSupportManager = $this->getAttestationStatementSupportManager(); - $attestationObjectLoader = AttestationObjectLoader::create($attestationStatementSupportManager) - ->setLogger($this->logger) - ; - $publicKeyCredentialLoader = PublicKeyCredentialLoader::create($attestationObjectLoader) - ->setLogger($this->logger) - ; - - $publicKeyCredential = $publicKeyCredentialLoader->load($data); - $authenticatorResponse = $publicKeyCredential->getResponse(); - Assertion::isInstanceOf($authenticatorResponse, AuthenticatorAssertionResponse::class, 'Not an authenticator assertion response'); - - $authenticatorAssertionResponseValidator = new AuthenticatorAssertionResponseValidator( - $this->publicKeyCredentialSourceRepository, - $this->tokenBindingHandler, - $this->extensionOutputCheckerHandler, - $this->coseAlgorithmManagerFactory->create($this->selectedAlgorithms), - $this->counterChecker - ); - $authenticatorAssertionResponseValidator->setLogger($this->logger); - - return $authenticatorAssertionResponseValidator->check( - $publicKeyCredential->getRawId(), - $authenticatorResponse, - $publicKeyCredentialRequestOptions, - $serverRequest, - null !== $userEntity ? $userEntity->getId() : null, - $this->securedRelyingPartyId - ); - } - - public function setCounterChecker(CounterChecker $counterChecker): self - { - $this->counterChecker = $counterChecker; - - return $this; - } - - public function setLogger(LoggerInterface $logger): self - { - $this->logger = $logger; - - return $this; - } - - public function enforceAndroidSafetyNetVerification(ClientInterface $client, string $apiKey, RequestFactoryInterface $requestFactory): self - { - $this->httpClient = $client; - $this->googleApiKey = $apiKey; - $this->requestFactory = $requestFactory; - - return $this; - } - - private function getAttestationStatementSupportManager(): AttestationStatementSupportManager - { - $attestationStatementSupportManager = new AttestationStatementSupportManager(); - $attestationStatementSupportManager->add(new NoneAttestationStatementSupport()); - $attestationStatementSupportManager->add(new FidoU2FAttestationStatementSupport()); - if (class_exists(RS256::class) && class_exists(JWKFactory::class)) { - $androidSafetyNetAttestationStatementSupport = new AndroidSafetyNetAttestationStatementSupport(); - if (null !== $this->httpClient && null !== $this->googleApiKey && null !== $this->requestFactory) { - $androidSafetyNetAttestationStatementSupport - ->enableApiVerification($this->httpClient, $this->googleApiKey, $this->requestFactory) - ->setLeeway(2000) - ->setMaxAge(60000) - ; - } - $attestationStatementSupportManager->add($androidSafetyNetAttestationStatementSupport); - } - $attestationStatementSupportManager->add(new AndroidKeyAttestationStatementSupport()); - $attestationStatementSupportManager->add(new TPMAttestationStatementSupport()); - $coseAlgorithmManager = $this->coseAlgorithmManagerFactory->create($this->selectedAlgorithms); - $attestationStatementSupportManager->add(new PackedAttestationStatementSupport($coseAlgorithmManager)); - - return $attestationStatementSupportManager; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/StringStream.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/StringStream.php deleted file mode 100644 index b60acee4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/StringStream.php +++ /dev/null @@ -1,73 +0,0 @@ -length = mb_strlen($data, '8bit'); - $resource = fopen('php://memory', 'rb+'); - fwrite($resource, $data); - rewind($resource); - $this->data = $resource; - } - - public function read(int $length): string - { - if (0 === $length) { - return ''; - } - $read = fread($this->data, $length); - $bytesRead = mb_strlen($read, '8bit'); - Assertion::length($read, $length, sprintf('Out of range. Expected: %d, read: %d.', $length, $bytesRead), null, '8bit'); - $this->totalRead += $bytesRead; - - return $read; - } - - public function close(): void - { - fclose($this->data); - } - - public function isEOF(): bool - { - return $this->totalRead === $this->length; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/IgnoreTokenBindingHandler.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/IgnoreTokenBindingHandler.php deleted file mode 100644 index 4272acf0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/IgnoreTokenBindingHandler.php +++ /dev/null @@ -1,24 +0,0 @@ -getStatus()) { - return; - } - - Assertion::true($request->hasHeader('Sec-Token-Binding'), 'The header parameter "Sec-Token-Binding" is missing.'); - $tokenBindingIds = $request->getHeader('Sec-Token-Binding'); - Assertion::count($tokenBindingIds, 1, 'The header parameter "Sec-Token-Binding" is invalid.'); - $tokenBindingId = reset($tokenBindingIds); - Assertion::eq($tokenBindingId, $tokenBinding->getId(), 'The header parameter "Sec-Token-Binding" is invalid.'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/TokenBinding.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/TokenBinding.php deleted file mode 100644 index 1a0adf73..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/TokenBinding.php +++ /dev/null @@ -1,82 +0,0 @@ -status = $status; - $this->id = $id; - } - - /** - * @param mixed[] $json - */ - public static function createFormArray(array $json): self - { - Assertion::keyExists($json, 'status', 'The member "status" is required'); - $status = $json['status']; - Assertion::inArray( - $status, - self::getSupportedStatus(), - sprintf('The member "status" is invalid. Supported values are: %s', implode(', ', self::getSupportedStatus())) - ); - $id = array_key_exists('id', $json) ? Base64Url::decode($json['id']) : null; - - return new self($status, $id); - } - - public function getStatus(): string - { - return $this->status; - } - - public function getId(): ?string - { - return $this->id; - } - - /** - * @return string[] - */ - private static function getSupportedStatus(): array - { - return [ - self::TOKEN_BINDING_STATUS_PRESENT, - self::TOKEN_BINDING_STATUS_SUPPORTED, - self::TOKEN_BINDING_STATUS_NOT_SUPPORTED, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/TokenBindingHandler.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/TokenBindingHandler.php deleted file mode 100644 index e81386ae..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TokenBinding/TokenBindingHandler.php +++ /dev/null @@ -1,21 +0,0 @@ -getStatus(), 'Token binding not supported.'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/CertificateTrustPath.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/CertificateTrustPath.php deleted file mode 100644 index b2916ae0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/CertificateTrustPath.php +++ /dev/null @@ -1,61 +0,0 @@ -certificates = $certificates; - } - - /** - * @return string[] - */ - public function getCertificates(): array - { - return $this->certificates; - } - - /** - * {@inheritdoc} - */ - public static function createFromArray(array $data): TrustPath - { - Assertion::keyExists($data, 'x5c', 'The trust path type is invalid'); - - return new CertificateTrustPath($data['x5c']); - } - - /** - * @return mixed[] - */ - public function jsonSerialize(): array - { - return [ - 'type' => self::class, - 'x5c' => $this->certificates, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/EcdaaKeyIdTrustPath.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/EcdaaKeyIdTrustPath.php deleted file mode 100644 index 0a575566..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/EcdaaKeyIdTrustPath.php +++ /dev/null @@ -1,55 +0,0 @@ -ecdaaKeyId = $ecdaaKeyId; - } - - public function getEcdaaKeyId(): string - { - return $this->ecdaaKeyId; - } - - /** - * @return string[] - */ - public function jsonSerialize(): array - { - return [ - 'type' => self::class, - 'ecdaaKeyId' => $this->ecdaaKeyId, - ]; - } - - /** - * {@inheritdoc} - */ - public static function createFromArray(array $data): TrustPath - { - Assertion::keyExists($data, 'ecdaaKeyId', 'The trust path type is invalid'); - - return new EcdaaKeyIdTrustPath($data['ecdaaKeyId']); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/EmptyTrustPath.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/EmptyTrustPath.php deleted file mode 100644 index 518ab0b9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/EmptyTrustPath.php +++ /dev/null @@ -1,35 +0,0 @@ - self::class, - ]; - } - - /** - * {@inheritdoc} - */ - public static function createFromArray(array $data): TrustPath - { - return new EmptyTrustPath(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/TrustPath.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/TrustPath.php deleted file mode 100644 index f83cfd94..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/TrustPath/TrustPath.php +++ /dev/null @@ -1,24 +0,0 @@ - EmptyTrustPath::class, - 'ecdaa_key_id' => EcdaaKeyIdTrustPath::class, - 'x5c' => CertificateTrustPath::class, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/U2FPublicKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/U2FPublicKey.php deleted file mode 100644 index 2bba5148..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/U2FPublicKey.php +++ /dev/null @@ -1,46 +0,0 @@ - MapItem::create( - new UnsignedIntegerObject(1, null), - new UnsignedIntegerObject(2, null) - ), - 3 => MapItem::create( - new UnsignedIntegerObject(3, null), - new NegativeIntegerObject(6, null) - ), - -1 => MapItem::create( - new NegativeIntegerObject(0, null), - new UnsignedIntegerObject(1, null) - ), - -2 => MapItem::create( - new NegativeIntegerObject(1, null), - new ByteStringObject(substr($publicKey, 1, 32)) - ), - -3 => MapItem::create( - new NegativeIntegerObject(2, null), - new ByteStringObject(substr($publicKey, 33)) - ), - ]); - - return $mapObject->__toString(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Util/CoseSignatureFixer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Util/CoseSignatureFixer.php deleted file mode 100644 index 3a01fba3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-auth/webauthn-lib/src/Util/CoseSignatureFixer.php +++ /dev/null @@ -1,54 +0,0 @@ -add($algorithm); - } - } - - /** - * Returns true if the algorithm is supported. - * - * @param string $algorithm The algorithm - */ - public function has(string $algorithm): bool - { - return array_key_exists($algorithm, $this->algorithms); - } - - /** - * Returns the list of names of supported algorithms. - * - * @return string[] - */ - public function list(): array - { - return array_keys($this->algorithms); - } - - /** - * Returns the algorithm if supported, otherwise throw an exception. - * - * @param string $algorithm The algorithm - * - * @throws InvalidArgumentException if the algorithm is not supported - */ - public function get(string $algorithm): Algorithm - { - if (!$this->has($algorithm)) { - throw new InvalidArgumentException(sprintf('The algorithm "%s" is not supported.', $algorithm)); - } - - return $this->algorithms[$algorithm]; - } - - /** - * Adds an algorithm to the manager. - */ - public function add(Algorithm $algorithm): void - { - $name = $algorithm->name(); - $this->algorithms[$name] = $algorithm; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/AlgorithmManagerFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/AlgorithmManagerFactory.php deleted file mode 100644 index 34e76313..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/AlgorithmManagerFactory.php +++ /dev/null @@ -1,80 +0,0 @@ -algorithms[$alias] = $algorithm; - } - - /** - * Returns the list of aliases. - * - * @return string[] - */ - public function aliases(): array - { - return array_keys($this->algorithms); - } - - /** - * Returns all algorithms supported by this factory. - * This is an associative array. Keys are the aliases of the algorithms. - * - * @return Algorithm[] - */ - public function all(): array - { - return $this->algorithms; - } - - /** - * Create an algorithm manager using the given aliases. - * - * @param string[] $aliases - * - * @throws InvalidArgumentException if the alias is invalid or is not supported - */ - public function create(array $aliases): AlgorithmManager - { - $algorithms = []; - foreach ($aliases as $alias) { - if (!is_string($alias)) { - throw new InvalidArgumentException('Invalid alias'); - } - if (!isset($this->algorithms[$alias])) { - throw new InvalidArgumentException(sprintf('The algorithm with the alias "%s" is not supported.', $alias)); - } - $algorithms[] = $this->algorithms[$alias]; - } - - return new AlgorithmManager($algorithms); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWK.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWK.php deleted file mode 100644 index b029cd59..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWK.php +++ /dev/null @@ -1,146 +0,0 @@ -values = $values; - } - - /** - * Creates a JWK object using the given Json string. - * - * @throws InvalidArgumentException if the data is not valid - * - * @return JWK - */ - public static function createFromJson(string $json): self - { - $data = json_decode($json, true); - if (!is_array($data)) { - throw new InvalidArgumentException('Invalid argument.'); - } - - return new self($data); - } - - /** - * Returns the values to be serialized. - */ - public function jsonSerialize(): array - { - return $this->values; - } - - /** - * Get the value with a specific key. - * - * @param string $key The key - * - * @throws InvalidArgumentException if the key does not exist - * - * @return null|mixed - */ - public function get(string $key) - { - if (!$this->has($key)) { - throw new InvalidArgumentException(sprintf('The value identified by "%s" does not exist.', $key)); - } - - return $this->values[$key]; - } - - /** - * Returns true if the JWK has the value identified by. - * - * @param string $key The key - */ - public function has(string $key): bool - { - return array_key_exists($key, $this->values); - } - - /** - * Get all values stored in the JWK object. - * - * @return array Values of the JWK object - */ - public function all(): array - { - return $this->values; - } - - /** - * Returns the thumbprint of the key. - * - * @see https://tools.ietf.org/html/rfc7638 - * - * @throws InvalidArgumentException if the hashing function is not supported - */ - public function thumbprint(string $hash_algorithm): string - { - if (!in_array($hash_algorithm, hash_algos(), true)) { - throw new InvalidArgumentException(sprintf('The hash algorithm "%s" is not supported.', $hash_algorithm)); - } - $values = array_intersect_key($this->values, array_flip(['kty', 'n', 'e', 'crv', 'x', 'y', 'k'])); - ksort($values); - $input = json_encode($values, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - if (false === $input) { - throw new InvalidArgumentException('Unable to compute the key thumbprint'); - } - - return Base64Url::encode(hash($hash_algorithm, $input, true)); - } - - /** - * Returns the associated public key. - * This method has no effect for: - * - public keys - * - shared keys - * - unknown keys. - * - * Known keys are "oct", "RSA", "EC" and "OKP". - * - * @return JWK - */ - public function toPublic(): self - { - $values = array_diff_key($this->values, array_flip(['p', 'd', 'q', 'dp', 'dq', 'qi'])); - - return new self($values); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWKSet.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWKSet.php deleted file mode 100644 index c72cea23..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWKSet.php +++ /dev/null @@ -1,340 +0,0 @@ - $key) { - if (!$key instanceof JWK) { - throw new InvalidArgumentException('Invalid list. Should only contains JWK objects'); - } - - if ($key->has('kid')) { - unset($keys[$k]); - $this->keys[$key->get('kid')] = $key; - } else { - $this->keys[] = $key; - } - } - } - - /** - * Creates a JWKSet object using the given values. - * - * @throws InvalidArgumentException if the keyset is not valid - * - * @return JWKSet - */ - public static function createFromKeyData(array $data): self - { - if (!isset($data['keys'])) { - throw new InvalidArgumentException('Invalid data.'); - } - if (!is_array($data['keys'])) { - throw new InvalidArgumentException('Invalid data.'); - } - - $jwkset = new self([]); - foreach ($data['keys'] as $key) { - $jwk = new JWK($key); - if ($jwk->has('kid')) { - $jwkset->keys[$jwk->get('kid')] = $jwk; - } else { - $jwkset->keys[] = $jwk; - } - } - - return $jwkset; - } - - /** - * Creates a JWKSet object using the given Json string. - * - * @throws InvalidArgumentException if the data is not valid - * - * @return JWKSet - */ - public static function createFromJson(string $json): self - { - $data = json_decode($json, true); - if (!is_array($data)) { - throw new InvalidArgumentException('Invalid argument.'); - } - - return self::createFromKeyData($data); - } - - /** - * Returns an array of keys stored in the key set. - * - * @return JWK[] - */ - public function all(): array - { - return $this->keys; - } - - /** - * Add key to store in the key set. - * This method is immutable and will return a new object. - * - * @return JWKSet - */ - public function with(JWK $jwk): self - { - $clone = clone $this; - - if ($jwk->has('kid')) { - $clone->keys[$jwk->get('kid')] = $jwk; - } else { - $clone->keys[] = $jwk; - } - - return $clone; - } - - /** - * Remove key from the key set. - * This method is immutable and will return a new object. - * - * @param int|string $key Key to remove from the key set - * - * @return JWKSet - */ - public function without($key): self - { - if (!$this->has($key)) { - return $this; - } - - $clone = clone $this; - unset($clone->keys[$key]); - - return $clone; - } - - /** - * Returns true if the key set contains a key with the given index. - * - * @param int|string $index - */ - public function has($index): bool - { - return array_key_exists($index, $this->keys); - } - - /** - * Returns the key with the given index. Throws an exception if the index is not present in the key store. - * - * @param int|string $index - * - * @throws InvalidArgumentException if the index is not defined - */ - public function get($index): JWK - { - if (!$this->has($index)) { - throw new InvalidArgumentException('Undefined index.'); - } - - return $this->keys[$index]; - } - - /** - * Returns the values to be serialized. - */ - public function jsonSerialize(): array - { - return ['keys' => array_values($this->keys)]; - } - - /** - * Returns the number of keys in the key set. - * - * @param int $mode - */ - public function count($mode = COUNT_NORMAL): int - { - return count($this->keys, $mode); - } - - /** - * Try to find a key that fits on the selected requirements. - * Returns null if not found. - * - * @param string $type Must be 'sig' (signature) or 'enc' (encryption) - * @param null|Algorithm $algorithm Specifies the algorithm to be used - * @param array $restrictions More restrictions such as 'kid' or 'kty' - * - * @throws InvalidArgumentException if the key type is not valid (must be "sig" or "enc") - */ - public function selectKey(string $type, ?Algorithm $algorithm = null, array $restrictions = []): ?JWK - { - if (!in_array($type, ['enc', 'sig'], true)) { - throw new InvalidArgumentException('Allowed key types are "sig" or "enc".'); - } - - $result = []; - foreach ($this->keys as $key) { - $ind = 0; - - $can_use = $this->canKeyBeUsedFor($type, $key); - if (false === $can_use) { - continue; - } - $ind += $can_use; - - $alg = $this->canKeyBeUsedWithAlgorithm($algorithm, $key); - if (false === $alg) { - continue; - } - $ind += $alg; - - if (false === $this->doesKeySatisfyRestrictions($restrictions, $key)) { - continue; - } - - $result[] = ['key' => $key, 'ind' => $ind]; - } - - if (0 === count($result)) { - return null; - } - - usort($result, [$this, 'sortKeys']); - - return $result[0]['key']; - } - - /** - * Internal method only. Should not be used. - * - * @internal - * @internal - */ - public static function sortKeys(array $a, array $b): int - { - if ($a['ind'] === $b['ind']) { - return 0; - } - - return ($a['ind'] > $b['ind']) ? -1 : 1; - } - - /** - * Internal method only. Should not be used. - * - * @internal - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->keys); - } - - /** - * @throws InvalidArgumentException if the key does not fulfill with the "key_ops" constraint - * - * @return bool|int - */ - private function canKeyBeUsedFor(string $type, JWK $key) - { - if ($key->has('use')) { - return $type === $key->get('use') ? 1 : false; - } - if ($key->has('key_ops')) { - $key_ops = $key->get('key_ops'); - if (!is_array($key_ops)) { - throw new InvalidArgumentException('Invalid key parameter "key_ops". Should be a list of key operations'); - } - - return $type === self::convertKeyOpsToKeyUse($key_ops) ? 1 : false; - } - - return 0; - } - - /** - * @return bool|int - */ - private function canKeyBeUsedWithAlgorithm(?Algorithm $algorithm, JWK $key) - { - if (null === $algorithm) { - return 0; - } - if (!in_array($key->get('kty'), $algorithm->allowedKeyTypes(), true)) { - return false; - } - if ($key->has('alg')) { - return $algorithm->name() === $key->get('alg') ? 2 : false; - } - - return 1; - } - - private function doesKeySatisfyRestrictions(array $restrictions, JWK $key): bool - { - foreach ($restrictions as $k => $v) { - if (!$key->has($k) || $v !== $key->get($k)) { - return false; - } - } - - return true; - } - - /** - * @throws InvalidArgumentException if the key operation is not supported - */ - private static function convertKeyOpsToKeyUse(array $key_ops): string - { - switch (true) { - case in_array('verify', $key_ops, true): - case in_array('sign', $key_ops, true): - return 'sig'; - - case in_array('encrypt', $key_ops, true): - case in_array('decrypt', $key_ops, true): - case in_array('wrapKey', $key_ops, true): - case in_array('unwrapKey', $key_ops, true): - case in_array('deriveKey', $key_ops, true): - case in_array('deriveBits', $key_ops, true): - return 'enc'; - - default: - throw new InvalidArgumentException(sprintf('Unsupported key operation value "%s"', implode(', ', $key_ops))); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWT.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWT.php deleted file mode 100644 index d3a6065f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/JWT.php +++ /dev/null @@ -1,23 +0,0 @@ -value = $value; - } - - /** - * @return BigInteger - */ - public static function createFromBinaryString(string $value): self - { - $res = unpack('H*', $value); - if (false === $res) { - throw new InvalidArgumentException('Unable to convert the value'); - } - $data = current($res); - - return new self(BrickBigInteger::fromBase($data, 16)); - } - - /** - * @return BigInteger - */ - public static function createFromDecimal(int $value): self - { - return new self(BrickBigInteger::of($value)); - } - - /** - * @return BigInteger - */ - public static function createFromBigInteger(BrickBigInteger $value): self - { - return new self($value); - } - - /** - * Converts a BigInteger to a binary string. - */ - public function toBytes(): string - { - if ($this->value->isEqualTo(BrickBigInteger::zero())) { - return ''; - } - - $temp = $this->value->toBase(16); - $temp = 0 !== (mb_strlen($temp, '8bit') & 1) ? '0'.$temp : $temp; - $temp = hex2bin($temp); - if (false === $temp) { - throw new InvalidArgumentException('Unable to convert the value into bytes'); - } - - return ltrim($temp, chr(0)); - } - - /** - * Adds two BigIntegers. - * - * @param BigInteger $y - * - * @return BigInteger - */ - public function add(self $y): self - { - $value = $this->value->plus($y->value); - - return new self($value); - } - - /** - * Subtracts two BigIntegers. - * - * @param BigInteger $y - * - * @return BigInteger - */ - public function subtract(self $y): self - { - $value = $this->value->minus($y->value); - - return new self($value); - } - - /** - * Multiplies two BigIntegers. - * - * @param BigInteger $x - * - * @return BigInteger - */ - public function multiply(self $x): self - { - $value = $this->value->multipliedBy($x->value); - - return new self($value); - } - - /** - * Divides two BigIntegers. - * - * @param BigInteger $x - * - * @return BigInteger - */ - public function divide(self $x): self - { - $value = $this->value->dividedBy($x->value); - - return new self($value); - } - - /** - * Performs modular exponentiation. - * - * @param BigInteger $e - * @param BigInteger $n - * - * @return BigInteger - */ - public function modPow(self $e, self $n): self - { - $value = $this->value->modPow($e->value, $n->value); - - return new self($value); - } - - /** - * Performs modular exponentiation. - * - * @param BigInteger $d - * - * @return BigInteger - */ - public function mod(self $d): self - { - $value = $this->value->mod($d->value); - - return new self($value); - } - - public function modInverse(BigInteger $m): BigInteger - { - return new self($this->value->modInverse($m->value)); - } - - /** - * Compares two numbers. - * - * @param BigInteger $y - */ - public function compare(self $y): int - { - return $this->value->compareTo($y->value); - } - - /** - * @param BigInteger $y - */ - public function equals(self $y): bool - { - return $this->value->isEqualTo($y->value); - } - - /** - * @param BigInteger $y - * - * @return BigInteger - */ - public static function random(self $y): self - { - return new self(BrickBigInteger::randomRange(0, $y->value)); - } - - /** - * @param BigInteger $y - * - * @return BigInteger - */ - public function gcd(self $y): self - { - return new self($this->value->gcd($y->value)); - } - - /** - * @param BigInteger $y - */ - public function lowerThan(self $y): bool - { - return $this->value->isLessThan($y->value); - } - - public function isEven(): bool - { - return $this->value->isEven(); - } - - public function get(): BrickBigInteger - { - return $this->value; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/ECKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/ECKey.php deleted file mode 100644 index 3e05827a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/ECKey.php +++ /dev/null @@ -1,366 +0,0 @@ -has('d')) { - return self::convertPrivateKeyToPEM($jwk); - } - - return self::convertPublicKeyToPEM($jwk); - } - - /** - * @throws InvalidArgumentException if the curve is not supported - */ - public static function convertPublicKeyToPEM(JWK $jwk): string - { - switch ($jwk->get('crv')) { - case 'P-256': - $der = self::p256PublicKey(); - - break; - - case 'secp256k1': - $der = self::p256KPublicKey(); - - break; - - case 'P-384': - $der = self::p384PublicKey(); - - break; - - case 'P-521': - $der = self::p521PublicKey(); - - break; - - default: - throw new InvalidArgumentException('Unsupported curve.'); - } - $der .= self::getKey($jwk); - $pem = '-----BEGIN PUBLIC KEY-----'.PHP_EOL; - $pem .= chunk_split(base64_encode($der), 64, PHP_EOL); - $pem .= '-----END PUBLIC KEY-----'.PHP_EOL; - - return $pem; - } - - /** - * @throws InvalidArgumentException if the curve is not supported - */ - public static function convertPrivateKeyToPEM(JWK $jwk): string - { - switch ($jwk->get('crv')) { - case 'P-256': - $der = self::p256PrivateKey($jwk); - - break; - - case 'secp256k1': - $der = self::p256KPrivateKey($jwk); - - break; - - case 'P-384': - $der = self::p384PrivateKey($jwk); - - break; - - case 'P-521': - $der = self::p521PrivateKey($jwk); - - break; - - default: - throw new InvalidArgumentException('Unsupported curve.'); - } - $der .= self::getKey($jwk); - $pem = '-----BEGIN EC PRIVATE KEY-----'.PHP_EOL; - $pem .= chunk_split(base64_encode($der), 64, PHP_EOL); - $pem .= '-----END EC PRIVATE KEY-----'.PHP_EOL; - - return $pem; - } - - /** - * Creates a EC key with the given curve and additional values. - * - * @param string $curve The curve - * @param array $values values to configure the key - */ - public static function createECKey(string $curve, array $values = []): JWK - { - $jwk = self::createECKeyUsingOpenSSL($curve); - $values = array_merge($values, $jwk); - - return new JWK($values); - } - - /** - * @throws InvalidArgumentException if the curve is not supported - */ - private static function getNistCurveSize(string $curve): int - { - switch ($curve) { - case 'P-256': - case 'secp256k1': - return 256; - - case 'P-384': - return 384; - - case 'P-521': - return 521; - - default: - throw new InvalidArgumentException(sprintf('The curve "%s" is not supported.', $curve)); - } - } - - /** - * @throws RuntimeException if the extension OpenSSL is not available - * @throws RuntimeException if the key cannot be created - */ - private static function createECKeyUsingOpenSSL(string $curve): array - { - if (!extension_loaded('openssl')) { - throw new RuntimeException('Please install the OpenSSL extension'); - } - $key = openssl_pkey_new([ - 'curve_name' => self::getOpensslCurveName($curve), - 'private_key_type' => OPENSSL_KEYTYPE_EC, - ]); - if (false === $key) { - throw new RuntimeException('Unable to create the key'); - } - $result = openssl_pkey_export($key, $out); - if (false === $result) { - throw new RuntimeException('Unable to create the key'); - } - $res = openssl_pkey_get_private($out); - if (false === $res) { - throw new RuntimeException('Unable to create the key'); - } - $details = openssl_pkey_get_details($res); - if (false === $details) { - throw new InvalidArgumentException('Unable to get the key details'); - } - $nistCurveSize = self::getNistCurveSize($curve); - - return [ - 'kty' => 'EC', - 'crv' => $curve, - 'd' => Base64Url::encode(str_pad($details['ec']['d'], (int) ceil($nistCurveSize / 8), "\0", STR_PAD_LEFT)), - 'x' => Base64Url::encode(str_pad($details['ec']['x'], (int) ceil($nistCurveSize / 8), "\0", STR_PAD_LEFT)), - 'y' => Base64Url::encode(str_pad($details['ec']['y'], (int) ceil($nistCurveSize / 8), "\0", STR_PAD_LEFT)), - ]; - } - - /** - * @throws InvalidArgumentException if the curve is not supported - */ - private static function getOpensslCurveName(string $curve): string - { - switch ($curve) { - case 'P-256': - return 'prime256v1'; - - case 'secp256k1': - return 'secp256k1'; - - case 'P-384': - return 'secp384r1'; - - case 'P-521': - return 'secp521r1'; - - default: - throw new InvalidArgumentException(sprintf('The curve "%s" is not supported.', $curve)); - } - } - - private static function p256PublicKey(): string - { - return pack( - 'H*', - '3059' // SEQUENCE, length 89 - .'3013' // SEQUENCE, length 19 - .'0607' // OID, length 7 - .'2a8648ce3d0201' // 1.2.840.10045.2.1 = EC Public Key - .'0608' // OID, length 8 - .'2a8648ce3d030107' // 1.2.840.10045.3.1.7 = P-256 Curve - .'0342' // BIT STRING, length 66 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function p256KPublicKey(): string - { - return pack( - 'H*', - '3056' // SEQUENCE, length 86 - .'3010' // SEQUENCE, length 16 - .'0607' // OID, length 7 - .'2a8648ce3d0201' // 1.2.840.10045.2.1 = EC Public Key - .'0605' // OID, length 8 - .'2B8104000A' // 1.3.132.0.10 secp256k1 - .'0342' // BIT STRING, length 66 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function p384PublicKey(): string - { - return pack( - 'H*', - '3076' // SEQUENCE, length 118 - .'3010' // SEQUENCE, length 16 - .'0607' // OID, length 7 - .'2a8648ce3d0201' // 1.2.840.10045.2.1 = EC Public Key - .'0605' // OID, length 5 - .'2b81040022' // 1.3.132.0.34 = P-384 Curve - .'0362' // BIT STRING, length 98 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function p521PublicKey(): string - { - return pack( - 'H*', - '30819b' // SEQUENCE, length 154 - .'3010' // SEQUENCE, length 16 - .'0607' // OID, length 7 - .'2a8648ce3d0201' // 1.2.840.10045.2.1 = EC Public Key - .'0605' // OID, length 5 - .'2b81040023' // 1.3.132.0.35 = P-521 Curve - .'038186' // BIT STRING, length 134 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function p256PrivateKey(JWK $jwk): string - { - $d = unpack('H*', str_pad(Base64Url::decode($jwk->get('d')), 32, "\0", STR_PAD_LEFT)); - if (!is_array($d) || !isset($d[1])) { - throw new InvalidArgumentException('Unable to get the private key'); - } - - return pack( - 'H*', - '3077' // SEQUENCE, length 87+length($d)=32 - .'020101' // INTEGER, 1 - .'0420' // OCTET STRING, length($d) = 32 - .$d[1] - .'a00a' // TAGGED OBJECT #0, length 10 - .'0608' // OID, length 8 - .'2a8648ce3d030107' // 1.3.132.0.34 = P-256 Curve - .'a144' // TAGGED OBJECT #1, length 68 - .'0342' // BIT STRING, length 66 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function p256KPrivateKey(JWK $jwk): string - { - $d = unpack('H*', str_pad(Base64Url::decode($jwk->get('d')), 32, "\0", STR_PAD_LEFT)); - if (!is_array($d) || !isset($d[1])) { - throw new InvalidArgumentException('Unable to get the private key'); - } - - return pack( - 'H*', - '3074' // SEQUENCE, length 84+length($d)=32 - .'020101' // INTEGER, 1 - .'0420' // OCTET STRING, length($d) = 32 - .$d[1] - .'a007' // TAGGED OBJECT #0, length 7 - .'0605' // OID, length 5 - .'2b8104000a' // 1.3.132.0.10 secp256k1 - .'a144' // TAGGED OBJECT #1, length 68 - .'0342' // BIT STRING, length 66 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function p384PrivateKey(JWK $jwk): string - { - $d = unpack('H*', str_pad(Base64Url::decode($jwk->get('d')), 48, "\0", STR_PAD_LEFT)); - if (!is_array($d) || !isset($d[1])) { - throw new InvalidArgumentException('Unable to get the private key'); - } - - return pack( - 'H*', - '3081a4' // SEQUENCE, length 116 + length($d)=48 - .'020101' // INTEGER, 1 - .'0430' // OCTET STRING, length($d) = 30 - .$d[1] - .'a007' // TAGGED OBJECT #0, length 7 - .'0605' // OID, length 5 - .'2b81040022' // 1.3.132.0.34 = P-384 Curve - .'a164' // TAGGED OBJECT #1, length 100 - .'0362' // BIT STRING, length 98 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function p521PrivateKey(JWK $jwk): string - { - $d = unpack('H*', str_pad(Base64Url::decode($jwk->get('d')), 66, "\0", STR_PAD_LEFT)); - if (!is_array($d) || !isset($d[1])) { - throw new InvalidArgumentException('Unable to get the private key'); - } - - return pack( - 'H*', - '3081dc' // SEQUENCE, length 154 + length($d)=66 - .'020101' // INTEGER, 1 - .'0442' // OCTET STRING, length(d) = 66 - .$d[1] - .'a007' // TAGGED OBJECT #0, length 7 - .'0605' // OID, length 5 - .'2b81040023' // 1.3.132.0.35 = P-521 Curve - .'a18189' // TAGGED OBJECT #1, length 137 - .'038186' // BIT STRING, length 134 - .'00' // prepend with NUL - pubkey will follow - ); - } - - private static function getKey(JWK $jwk): string - { - $nistCurveSize = self::getNistCurveSize($jwk->get('crv')); - $length = (int) ceil($nistCurveSize / 8); - - return - "\04" - .str_pad(Base64Url::decode($jwk->get('x')), $length, "\0", STR_PAD_LEFT) - .str_pad(Base64Url::decode($jwk->get('y')), $length, "\0", STR_PAD_LEFT); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/ECSignature.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/ECSignature.php deleted file mode 100644 index 763d8cd0..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/ECSignature.php +++ /dev/null @@ -1,143 +0,0 @@ - self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : ''; - - $bin = hex2bin( - self::ASN1_SEQUENCE - .$lengthPrefix.dechex($totalLength) - .self::ASN1_INTEGER.dechex($lengthR).$pointR - .self::ASN1_INTEGER.dechex($lengthS).$pointS - ); - if (!is_string($bin)) { - throw new InvalidArgumentException('Unable to parse the data'); - } - - return $bin; - } - - /** - * @throws InvalidArgumentException if the signature is not an ASN.1 sequence - */ - public static function fromAsn1(string $signature, int $length): string - { - $message = bin2hex($signature); - $position = 0; - - if (self::ASN1_SEQUENCE !== self::readAsn1Content($message, $position, self::BYTE_SIZE)) { - throw new InvalidArgumentException('Invalid data. Should start with a sequence.'); - } - - if (self::ASN1_LENGTH_2BYTES === self::readAsn1Content($message, $position, self::BYTE_SIZE)) { - $position += self::BYTE_SIZE; - } - - $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); - $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); - - $bin = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT).str_pad($pointS, $length, '0', STR_PAD_LEFT)); - if (!is_string($bin)) { - throw new InvalidArgumentException('Unable to parse the data'); - } - - return $bin; - } - - private static function octetLength(string $data): int - { - return (int) (mb_strlen($data, '8bit') / self::BYTE_SIZE); - } - - private static function preparePositiveInteger(string $data): string - { - if (mb_substr($data, 0, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) { - return self::ASN1_NEGATIVE_INTEGER.$data; - } - - while (0 === mb_strpos($data, self::ASN1_NEGATIVE_INTEGER, 0, '8bit') - && mb_substr($data, 2, self::BYTE_SIZE, '8bit') <= self::ASN1_BIG_INTEGER_LIMIT) { - $data = mb_substr($data, 2, null, '8bit'); - } - - return $data; - } - - private static function readAsn1Content(string $message, int &$position, int $length): string - { - $content = mb_substr($message, $position, $length, '8bit'); - $position += $length; - - return $content; - } - - /** - * @throws InvalidArgumentException if the data is not an integer - */ - private static function readAsn1Integer(string $message, int &$position): string - { - if (self::ASN1_INTEGER !== self::readAsn1Content($message, $position, self::BYTE_SIZE)) { - throw new InvalidArgumentException('Invalid data. Should contain an integer.'); - } - - $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE)); - - return self::readAsn1Content($message, $position, $length * self::BYTE_SIZE); - } - - private static function retrievePositiveInteger(string $data): string - { - while (0 === mb_strpos($data, self::ASN1_NEGATIVE_INTEGER, 0, '8bit') - && mb_substr($data, 2, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) { - $data = mb_substr($data, 2, null, '8bit'); - } - - return $data; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/Hash.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/Hash.php deleted file mode 100644 index ef038c53..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/Hash.php +++ /dev/null @@ -1,103 +0,0 @@ -hash = $hash; - $this->length = $length; - $this->t = $t; - } - - /** - * @return Hash - */ - public static function sha1(): self - { - return new self('sha1', 20, "\x30\x21\x30\x09\x06\x05\x2b\x0e\x03\x02\x1a\x05\x00\x04\x14"); - } - - /** - * @return Hash - */ - public static function sha256(): self - { - return new self('sha256', 32, "\x30\x31\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01\x05\x00\x04\x20"); - } - - /** - * @return Hash - */ - public static function sha384(): self - { - return new self('sha384', 48, "\x30\x41\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x02\x05\x00\x04\x30"); - } - - /** - * @return Hash - */ - public static function sha512(): self - { - return new self('sha512', 64, "\x30\x51\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x03\x05\x00\x04\x40"); - } - - public function getLength(): int - { - return $this->length; - } - - /** - * Compute the HMAC. - */ - public function hash(string $text): string - { - return hash($this->hash, $text, true); - } - - public function name(): string - { - return $this->hash; - } - - public function t(): string - { - return $this->t; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/JsonConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/JsonConverter.php deleted file mode 100644 index 259083d7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/JsonConverter.php +++ /dev/null @@ -1,55 +0,0 @@ -getCode(), $throwable); - } - } - - /** - * @throws RuntimeException if the payload cannot be decoded - * - * @return mixed - */ - public static function decode(string $payload) - { - try { - return json_decode($payload, true, 512, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } catch (Throwable $throwable) { - throw new RuntimeException('Invalid content.', $throwable->getCode(), $throwable); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/KeyChecker.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/KeyChecker.php deleted file mode 100644 index 30ae84bc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/KeyChecker.php +++ /dev/null @@ -1,121 +0,0 @@ -has('use')) { - self::checkUsage($key, $usage); - } - if ($key->has('key_ops')) { - self::checkOperation($key, $usage); - } - } - - /** - * @throws InvalidArgumentException if the key is not suitable for the selected algorithm - */ - public static function checkKeyAlgorithm(JWK $key, string $algorithm): void - { - if (!$key->has('alg')) { - return; - } - if ($key->get('alg') !== $algorithm) { - throw new InvalidArgumentException(sprintf('Key is only allowed for algorithm "%s".', $key->get('alg'))); - } - } - - /** - * @throws InvalidArgumentException if the key is not suitable for the selected operation - */ - private static function checkOperation(JWK $key, string $usage): void - { - $ops = $key->get('key_ops'); - if (!is_array($ops)) { - throw new InvalidArgumentException('Invalid key parameter "key_ops". Should be a list of key operations'); - } - - switch ($usage) { - case 'verification': - if (!in_array('verify', $ops, true)) { - throw new InvalidArgumentException('Key cannot be used to verify a signature'); - } - - break; - - case 'signature': - if (!in_array('sign', $ops, true)) { - throw new InvalidArgumentException('Key cannot be used to sign'); - } - - break; - - case 'encryption': - if (!in_array('encrypt', $ops, true) && !in_array('wrapKey', $ops, true) && !in_array('deriveKey', $ops, true)) { - throw new InvalidArgumentException('Key cannot be used to encrypt'); - } - - break; - - case 'decryption': - if (!in_array('decrypt', $ops, true) && !in_array('unwrapKey', $ops, true) && !in_array('deriveBits', $ops, true)) { - throw new InvalidArgumentException('Key cannot be used to decrypt'); - } - - break; - - default: - throw new InvalidArgumentException('Unsupported key usage.'); - } - } - - /** - * @throws InvalidArgumentException if the key is not suitable for the selected operation - */ - private static function checkUsage(JWK $key, string $usage): void - { - $use = $key->get('use'); - - switch ($usage) { - case 'verification': - case 'signature': - if ('sig' !== $use) { - throw new InvalidArgumentException('Key cannot be used to sign or verify a signature.'); - } - - break; - - case 'encryption': - case 'decryption': - if ('enc' !== $use) { - throw new InvalidArgumentException('Key cannot be used to encrypt or decrypt.'); - } - - break; - - default: - throw new InvalidArgumentException('Unsupported key usage.'); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/RSAKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/RSAKey.php deleted file mode 100644 index 843ba4c3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/Util/RSAKey.php +++ /dev/null @@ -1,315 +0,0 @@ -values = $data->all(); - $this->populateBigIntegers(); - $this->private = array_key_exists('d', $this->values); - } - - /** - * @return RSAKey - */ - public static function createFromJWK(JWK $jwk): self - { - return new self($jwk); - } - - public function getModulus(): BigInteger - { - return $this->modulus; - } - - public function getModulusLength(): int - { - return $this->modulus_length; - } - - public function getExponent(): BigInteger - { - $d = $this->getPrivateExponent(); - if (null !== $d) { - return $d; - } - - return $this->getPublicExponent(); - } - - public function getPublicExponent(): BigInteger - { - return $this->public_exponent; - } - - public function getPrivateExponent(): ?BigInteger - { - return $this->private_exponent; - } - - /** - * @return BigInteger[] - */ - public function getPrimes(): array - { - return $this->primes; - } - - /** - * @return BigInteger[] - */ - public function getExponents(): array - { - return $this->exponents; - } - - public function getCoefficient(): ?BigInteger - { - return $this->coefficient; - } - - public function isPublic(): bool - { - return !array_key_exists('d', $this->values); - } - - /** - * @param RSAKey $private - * - * @return RSAKey - */ - public static function toPublic(self $private): self - { - $data = $private->toArray(); - $keys = ['p', 'd', 'q', 'dp', 'dq', 'qi']; - foreach ($keys as $key) { - if (array_key_exists($key, $data)) { - unset($data[$key]); - } - } - - return new self(new JWK($data)); - } - - public function toArray(): array - { - return $this->values; - } - - public function toPEM(): string - { - if (null === $this->sequence) { - $this->sequence = new Sequence(); - if (array_key_exists('d', $this->values)) { - $this->initPrivateKey(); - } else { - $this->initPublicKey(); - } - } - $result = '-----BEGIN '.($this->private ? 'RSA PRIVATE' : 'PUBLIC').' KEY-----'.PHP_EOL; - $result .= chunk_split(base64_encode($this->sequence->getBinary()), 64, PHP_EOL); - $result .= '-----END '.($this->private ? 'RSA PRIVATE' : 'PUBLIC').' KEY-----'.PHP_EOL; - - return $result; - } - - /** - * Exponentiate with or without Chinese Remainder Theorem. - * Operation with primes 'p' and 'q' is appox. 2x faster. - * - * @param RSAKey $key - * - * @throws RuntimeException if the exponentiation cannot be achieved - */ - public static function exponentiate(self $key, BigInteger $c): BigInteger - { - if ($c->compare(BigInteger::createFromDecimal(0)) < 0 || $c->compare($key->getModulus()) > 0) { - throw new RuntimeException(); - } - if ($key->isPublic() || null === $key->getCoefficient() || 0 === count($key->getPrimes()) || 0 === count($key->getExponents())) { - return $c->modPow($key->getExponent(), $key->getModulus()); - } - - $p = $key->getPrimes()[0]; - $q = $key->getPrimes()[1]; - $dP = $key->getExponents()[0]; - $dQ = $key->getExponents()[1]; - $qInv = $key->getCoefficient(); - - $m1 = $c->modPow($dP, $p); - $m2 = $c->modPow($dQ, $q); - $h = $qInv->multiply($m1->subtract($m2)->add($p))->mod($p); - - return $m2->add($h->multiply($q)); - } - - private function populateBigIntegers(): void - { - $this->modulus = $this->convertBase64StringToBigInteger($this->values['n']); - $this->modulus_length = mb_strlen($this->getModulus()->toBytes(), '8bit'); - $this->public_exponent = $this->convertBase64StringToBigInteger($this->values['e']); - - if (!$this->isPublic()) { - $this->private_exponent = $this->convertBase64StringToBigInteger($this->values['d']); - - if (array_key_exists('p', $this->values) && array_key_exists('q', $this->values)) { - $this->primes = [ - $this->convertBase64StringToBigInteger($this->values['p']), - $this->convertBase64StringToBigInteger($this->values['q']), - ]; - if (array_key_exists('dp', $this->values) && array_key_exists('dq', $this->values) && array_key_exists('qi', $this->values)) { - $this->exponents = [ - $this->convertBase64StringToBigInteger($this->values['dp']), - $this->convertBase64StringToBigInteger($this->values['dq']), - ]; - $this->coefficient = $this->convertBase64StringToBigInteger($this->values['qi']); - } - } - } - } - - private function convertBase64StringToBigInteger(string $value): BigInteger - { - return BigInteger::createFromBinaryString(Base64Url::decode($value)); - } - - private function initPublicKey(): void - { - $oid_sequence = new Sequence(); - $oid_sequence->addChild(new ObjectIdentifier('1.2.840.113549.1.1.1')); - $oid_sequence->addChild(new NullObject()); - $this->sequence->addChild($oid_sequence); - $n = new Integer($this->fromBase64ToInteger($this->values['n'])); - $e = new Integer($this->fromBase64ToInteger($this->values['e'])); - $key_sequence = new Sequence(); - $key_sequence->addChild($n); - $key_sequence->addChild($e); - $key_bit_string = new BitString(bin2hex($key_sequence->getBinary())); - $this->sequence->addChild($key_bit_string); - } - - private function initPrivateKey(): void - { - $this->sequence->addChild(new Integer(0)); - $oid_sequence = new Sequence(); - $oid_sequence->addChild(new ObjectIdentifier('1.2.840.113549.1.1.1')); - $oid_sequence->addChild(new NullObject()); - $this->sequence->addChild($oid_sequence); - $v = new Integer(0); - $n = new Integer($this->fromBase64ToInteger($this->values['n'])); - $e = new Integer($this->fromBase64ToInteger($this->values['e'])); - $d = new Integer($this->fromBase64ToInteger($this->values['d'])); - $p = new Integer($this->fromBase64ToInteger($this->values['p'])); - $q = new Integer($this->fromBase64ToInteger($this->values['q'])); - $dp = array_key_exists('dp', $this->values) ? new Integer($this->fromBase64ToInteger($this->values['dp'])) : new Integer(0); - $dq = array_key_exists('dq', $this->values) ? new Integer($this->fromBase64ToInteger($this->values['dq'])) : new Integer(0); - $qi = array_key_exists('qi', $this->values) ? new Integer($this->fromBase64ToInteger($this->values['qi'])) : new Integer(0); - $key_sequence = new Sequence(); - $key_sequence->addChild($v); - $key_sequence->addChild($n); - $key_sequence->addChild($e); - $key_sequence->addChild($d); - $key_sequence->addChild($p); - $key_sequence->addChild($q); - $key_sequence->addChild($dp); - $key_sequence->addChild($dq); - $key_sequence->addChild($qi); - $key_octet_string = new OctetString(bin2hex($key_sequence->getBinary())); - $this->sequence->addChild($key_octet_string); - } - - /** - * @param string $value - * - * @return string - */ - private function fromBase64ToInteger($value) - { - $unpacked = unpack('H*', Base64Url::decode($value)); - if (!is_array($unpacked) || 0 === count($unpacked)) { - throw new InvalidArgumentException('Unable to get the private key'); - } - - return \Brick\Math\BigInteger::fromBase(current($unpacked), 16)->toBase(10); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/composer.json deleted file mode 100644 index 30bf70fa..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-core/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "web-token/jwt-core", - "description": "Core component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": ["JWS", "JWT", "JWE", "JWA", "JWK", "JWKSet", "Jot", "Jose", "RFC7515", "RFC7516", "RFC7517", "RFC7518", "RFC7519", "RFC7520", "Bundle", "Symfony"], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - },{ - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Core\\": "" - } - }, - "require": { - "php": ">=7.2", - "ext-json": "*", - "ext-mbstring": "*", - "brick/math": "^0.8.17|^0.9", - "fgrosse/phpasn1": "^2.0", - "spomky-labs/base64url": "^1.0|^2.0" - }, - "conflict": { - "spomky-labs/jose": "*" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/CONTRIBUTING.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/CONTRIBUTING.md deleted file mode 100644 index fc360e5d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -# Contributing - -This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is READ ONLY. -Please do not submit any Pull Requests here. It will be automatically closed. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/FUNDING.yml b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/PULL_REQUEST_TEMPLATE.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d4ff96cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,3 +0,0 @@ -Please do not submit any Pull Requests here. It will be automatically closed. - -You should submit it here: https://github.com/web-token/jwt-framework/pulls diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/AlgorithmAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/AlgorithmAnalyzer.php deleted file mode 100644 index edb88888..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/AlgorithmAnalyzer.php +++ /dev/null @@ -1,26 +0,0 @@ -has('alg')) { - $bag->add(Message::medium('The parameter "alg" should be added.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES256KeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES256KeyAnalyzer.php deleted file mode 100644 index 2b7b71c4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES256KeyAnalyzer.php +++ /dev/null @@ -1,61 +0,0 @@ -get('kty')) { - return; - } - if (!$jwk->has('crv')) { - $bag->add(Message::high('Invalid key. The components "crv" is missing.')); - - return; - } - if ('P-256' !== $jwk->get('crv')) { - return; - } - $x = Base64Url::decode($jwk->get('x')); - $xLength = 8 * mb_strlen($x, '8bit'); - $y = Base64Url::decode($jwk->get('y')); - $yLength = 8 * mb_strlen($y, '8bit'); - if ($yLength !== $xLength || 256 !== $yLength) { - $bag->add(Message::high('Invalid key. The components "x" and "y" size shall be 256 bits.')); - } - $xBI = BigInteger::fromBase(bin2hex($x), 16); - $yBI = BigInteger::fromBase(bin2hex($y), 16); - $curve = NistCurve::curve256(); - if (!$curve->contains($xBI, $yBI)) { - $bag->add(Message::high('Invalid key. The point is not on the curve.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES384KeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES384KeyAnalyzer.php deleted file mode 100644 index 70bd52c5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES384KeyAnalyzer.php +++ /dev/null @@ -1,61 +0,0 @@ -get('kty')) { - return; - } - if (!$jwk->has('crv')) { - $bag->add(Message::high('Invalid key. The components "crv" is missing.')); - - return; - } - if ('P-384' !== $jwk->get('crv')) { - return; - } - $x = Base64Url::decode($jwk->get('x')); - $xLength = 8 * mb_strlen($x, '8bit'); - $y = Base64Url::decode($jwk->get('y')); - $yLength = 8 * mb_strlen($y, '8bit'); - if ($yLength !== $xLength || 384 !== $yLength) { - $bag->add(Message::high('Invalid key. The components "x" and "y" size shall be 384 bits.')); - } - $xBI = BigInteger::fromBase(bin2hex($x), 16); - $yBI = BigInteger::fromBase(bin2hex($y), 16); - $curve = NistCurve::curve384(); - if (!$curve->contains($xBI, $yBI)) { - $bag->add(Message::high('Invalid key. The point is not on the curve.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES512KeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES512KeyAnalyzer.php deleted file mode 100644 index b729dee2..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ES512KeyAnalyzer.php +++ /dev/null @@ -1,61 +0,0 @@ -get('kty')) { - return; - } - if (!$jwk->has('crv')) { - $bag->add(Message::high('Invalid key. The components "crv" is missing.')); - - return; - } - if ('P-521' !== $jwk->get('crv')) { - return; - } - $x = Base64Url::decode($jwk->get('x')); - $xLength = 8 * mb_strlen($x, '8bit'); - $y = Base64Url::decode($jwk->get('y')); - $yLength = 8 * mb_strlen($y, '8bit'); - if ($yLength !== $xLength || 528 !== $yLength) { - $bag->add(Message::high('Invalid key. The components "x" and "y" size shall be 528 bits.')); - } - $xBI = BigInteger::fromBase(bin2hex($x), 16); - $yBI = BigInteger::fromBase(bin2hex($y), 16); - $curve = NistCurve::curve521(); - if (!$curve->contains($xBI, $yBI)) { - $bag->add(Message::high('Invalid key. The point is not on the curve.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS256KeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS256KeyAnalyzer.php deleted file mode 100644 index 4e4e4851..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS256KeyAnalyzer.php +++ /dev/null @@ -1,35 +0,0 @@ -get('kty')) { - return; - } - if (!$jwk->has('alg') || 'HS256' !== $jwk->get('alg')) { - return; - } - $k = Base64Url::decode($jwk->get('k')); - $kLength = 8 * mb_strlen($k, '8bit'); - if ($kLength < 256) { - $bag->add(Message::high('HS256 algorithm requires at least 256 bits key length.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS384KeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS384KeyAnalyzer.php deleted file mode 100644 index 75174e96..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS384KeyAnalyzer.php +++ /dev/null @@ -1,35 +0,0 @@ -get('kty')) { - return; - } - if (!$jwk->has('alg') || 'HS384' !== $jwk->get('alg')) { - return; - } - $k = Base64Url::decode($jwk->get('k')); - $kLength = 8 * mb_strlen($k, '8bit'); - if ($kLength < 384) { - $bag->add(Message::high('HS384 algorithm requires at least 384 bits key length.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS512KeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS512KeyAnalyzer.php deleted file mode 100644 index 1147aecc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/HS512KeyAnalyzer.php +++ /dev/null @@ -1,35 +0,0 @@ -get('kty')) { - return; - } - if (!$jwk->has('alg') || 'HS512' !== $jwk->get('alg')) { - return; - } - $k = Base64Url::decode($jwk->get('k')); - $kLength = 8 * mb_strlen($k, '8bit'); - if ($kLength < 512) { - $bag->add(Message::high('HS512 algorithm requires at least 512 bits key length.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeyAnalyzer.php deleted file mode 100644 index 978c57d9..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeyAnalyzer.php +++ /dev/null @@ -1,24 +0,0 @@ -analyzers[] = $analyzer; - } - - /** - * This method will analyze the JWK object using all analyzers. - * It returns a message bag that may contains messages. - */ - public function analyze(JWK $jwk): MessageBag - { - $bag = new MessageBag(); - foreach ($this->analyzers as $analyzer) { - $analyzer->analyze($jwk, $bag); - } - - return $bag; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeyIdentifierAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeyIdentifierAnalyzer.php deleted file mode 100644 index a4e7708b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeyIdentifierAnalyzer.php +++ /dev/null @@ -1,26 +0,0 @@ -has('kid')) { - $bag->add(Message::medium('The parameter "kid" should be added.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeysetAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeysetAnalyzer.php deleted file mode 100644 index 6447e103..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/KeysetAnalyzer.php +++ /dev/null @@ -1,24 +0,0 @@ -analyzers[] = $analyzer; - } - - /** - * This method will analyze the JWKSet object using all analyzers. - * It returns a message bag that may contains messages. - */ - public function analyze(JWKSet $jwkset): MessageBag - { - $bag = new MessageBag(); - foreach ($this->analyzers as $analyzer) { - $analyzer->analyze($jwkset, $bag); - } - - return $bag; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/Message.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/Message.php deleted file mode 100644 index 19653cae..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/Message.php +++ /dev/null @@ -1,97 +0,0 @@ -message = $message; - $this->severity = $severity; - } - - /** - * Creates a message with severity=low. - * - * @return Message - */ - public static function low(string $message): self - { - return new self($message, self::SEVERITY_LOW); - } - - /** - * Creates a message with severity=medium. - * - * @return Message - */ - public static function medium(string $message): self - { - return new self($message, self::SEVERITY_MEDIUM); - } - - /** - * Creates a message with severity=high. - * - * @return Message - */ - public static function high(string $message): self - { - return new self($message, self::SEVERITY_HIGH); - } - - /** - * Returns the message. - */ - public function getMessage(): string - { - return $this->message; - } - - /** - * Returns the severity of the message. - */ - public function getSeverity(): string - { - return $this->severity; - } - - public function jsonSerialize(): array - { - return [ - 'message' => $this->message, - 'severity' => $this->severity, - ]; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MessageBag.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MessageBag.php deleted file mode 100644 index 515ac7fd..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MessageBag.php +++ /dev/null @@ -1,71 +0,0 @@ -messages[] = $message; - } - - /** - * Returns all messages. - * - * @return Message[] - */ - public function all(): array - { - return $this->messages; - } - - /** - * {@inheritdoc} - */ - public function jsonSerialize(): array - { - return array_values($this->messages); - } - - /** - * {@inheritdoc} - */ - public function count(): int - { - return count($this->messages); - } - - /** - * {@inheritdoc} - */ - public function getIterator(): Traversable - { - return new ArrayIterator($this->messages); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MixedKeyTypes.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MixedKeyTypes.php deleted file mode 100644 index af8e1e06..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MixedKeyTypes.php +++ /dev/null @@ -1,49 +0,0 @@ -count()) { - return; - } - - $hasSymmetricKeys = false; - $hasAsymmetricKeys = false; - - foreach ($jwkset as $jwk) { - switch ($jwk->get('kty')) { - case 'oct': - $hasSymmetricKeys = true; - - break; - - case 'OKP': - case 'RSA': - case 'EC': - $hasAsymmetricKeys = true; - - break; - } - } - - if ($hasAsymmetricKeys && $hasSymmetricKeys) { - $bag->add(Message::medium('This key set mixes symmetric and assymetric keys.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MixedPublicAndPrivateKeys.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MixedPublicAndPrivateKeys.php deleted file mode 100644 index 94ce3519..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/MixedPublicAndPrivateKeys.php +++ /dev/null @@ -1,48 +0,0 @@ -count()) { - return; - } - - $hasPublicKeys = false; - $hasPrivateKeys = false; - - foreach ($jwkset as $jwk) { - switch ($jwk->get('kty')) { - case 'OKP': - case 'RSA': - case 'EC': - if ($jwk->has('d')) { - $hasPrivateKeys = true; - } else { - $hasPublicKeys = true; - } - - break; - } - } - - if ($hasPrivateKeys && $hasPublicKeys) { - $bag->add(Message::high('This key set mixes public and private keys.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/NoneAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/NoneAnalyzer.php deleted file mode 100644 index 38b33f28..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/NoneAnalyzer.php +++ /dev/null @@ -1,28 +0,0 @@ -get('kty')) { - return; - } - - $bag->add(Message::high('This key is a meant to be used with the algorithm "none". This algorithm is not secured and should be used with care.')); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/OctAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/OctAnalyzer.php deleted file mode 100644 index 70a4761a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/OctAnalyzer.php +++ /dev/null @@ -1,32 +0,0 @@ -get('kty')) { - return; - } - $k = Base64Url::decode($jwk->get('k')); - $kLength = 8 * mb_strlen($k, '8bit'); - if ($kLength < 128) { - $bag->add(Message::high('The key length is less than 128 bits.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/RsaAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/RsaAnalyzer.php deleted file mode 100644 index 2a5743bf..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/RsaAnalyzer.php +++ /dev/null @@ -1,54 +0,0 @@ -get('kty')) { - return; - } - - $this->checkExponent($jwk, $bag); - $this->checkModulus($jwk, $bag); - } - - private function checkExponent(JWK $jwk, MessageBag $bag): void - { - $exponent = unpack('l', str_pad(Base64Url::decode($jwk->get('e')), 4, "\0")); - if (!is_array($exponent) || !isset($exponent[1])) { - throw new InvalidArgumentException('Unable to get the private key'); - } - if ($exponent[1] < 65537) { - $bag->add(Message::high('The exponent is too low. It should be at least 65537.')); - } - } - - private function checkModulus(JWK $jwk, MessageBag $bag): void - { - $n = 8 * mb_strlen(Base64Url::decode($jwk->get('n')), '8bit'); - if ($n < 2048) { - $bag->add(Message::high('The key length is less than 2048 bits.')); - } - if ($jwk->has('d') && (!$jwk->has('p') || !$jwk->has('q') || !$jwk->has('dp') || !$jwk->has('dq') || !$jwk->has('p') || !$jwk->has('qi'))) { - $bag->add(Message::medium('The key is a private RSA key, but Chinese Remainder Theorem primes are missing. These primes are not mandatory, but signatures and decryption processes are faster when available.')); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/UsageAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/UsageAnalyzer.php deleted file mode 100644 index 2edb19fe..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/UsageAnalyzer.php +++ /dev/null @@ -1,32 +0,0 @@ -has('use')) { - $bag->add(Message::medium('The parameter "use" should be added.')); - } elseif (!in_array($jwk->get('use'), ['sig', 'enc'], true)) { - $bag->add(Message::high(sprintf('The parameter "use" has an unsupported value "%s". Please use "sig" (signature) or "enc" (encryption).', $jwk->get('use')))); - } - if ($jwk->has('key_ops') && !in_array($jwk->get('key_ops'), ['sign', 'verify', 'encrypt', 'decrypt', 'wrapKey', 'unwrapKey'], true)) { - $bag->add(Message::high(sprintf('The parameter "key_ops" has an unsupported value "%s". Please use one of the following values: %s.', $jwk->get('use'), implode(', ', ['verify', 'sign', 'encryp', 'decrypt', 'wrapKey', 'unwrapKey'])))); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ZxcvbnKeyAnalyzer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ZxcvbnKeyAnalyzer.php deleted file mode 100644 index 66a0457d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/Analyzer/ZxcvbnKeyAnalyzer.php +++ /dev/null @@ -1,48 +0,0 @@ -get('kty')) { - return; - } - $k = Base64Url::decode($jwk->get('k')); - if (class_exists(Zxcvbn::class)) { - $zxcvbn = new Zxcvbn(); - $strength = $zxcvbn->passwordStrength($k); - - switch (true) { - case $strength['score'] < 3: - $bag->add(Message::high('The octet string is weak and easily guessable. Please change your key as soon as possible.')); - - break; - - case 3 === $strength['score']: - $bag->add(Message::medium('The octet string is safe, but a longer key is preferable.')); - - break; - - default: - break; - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/JKUFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/JKUFactory.php deleted file mode 100644 index 6f404c7f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/JKUFactory.php +++ /dev/null @@ -1,39 +0,0 @@ -getContent($url, $header); - $data = JsonConverter::decode($content); - if (!is_array($data)) { - throw new RuntimeException('Invalid content.'); - } - - return JWKSet::createFromKeyData($data); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/JWKFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/JWKFactory.php deleted file mode 100644 index 4620089e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/JWKFactory.php +++ /dev/null @@ -1,328 +0,0 @@ - $size) { - throw new InvalidArgumentException('Key length is too short. It needs to be at least 512 bits.'); - } - - $key = openssl_pkey_new([ - 'private_key_bits' => $size, - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - ]); - if (false === $key) { - throw new InvalidArgumentException('Unable to create the key'); - } - $details = openssl_pkey_get_details($key); - if (!is_array($details)) { - throw new InvalidArgumentException('Unable to create the key'); - } - $rsa = RSAKey::createFromKeyDetails($details['rsa']); - $values = array_merge( - $values, - $rsa->toArray() - ); - - return new JWK($values); - } - - /** - * Creates a EC key with the given curve and additional values. - * - * @param string $curve The curve - * @param array $values values to configure the key - */ - public static function createECKey(string $curve, array $values = []): JWK - { - return ECKey::createECKey($curve, $values); - } - - /** - * Creates a octet key with the given key size and additional values. - * - * @param int $size The key size in bits - * @param array $values values to configure the key - * - * @throws InvalidArgumentException if the key has an invalid size - */ - public static function createOctKey(int $size, array $values = []): JWK - { - if (0 !== $size % 8) { - throw new InvalidArgumentException('Invalid key size.'); - } - $values = array_merge( - $values, - [ - 'kty' => 'oct', - 'k' => Base64Url::encode(random_bytes($size / 8)), - ] - ); - - return new JWK($values); - } - - /** - * Creates a OKP key with the given curve and additional values. - * - * @param string $curve The curve - * @param array $values values to configure the key - * - * @throws InvalidArgumentException if the extension "sobium" is not available - * @throws InvalidArgumentException if the curve is not supported - */ - public static function createOKPKey(string $curve, array $values = []): JWK - { - if (!extension_loaded('sodium')) { - throw new RuntimeException('The extension "sodium" is not available. Please install it to use this method'); - } - - switch ($curve) { - case 'X25519': - $keyPair = sodium_crypto_box_keypair(); - $secret = sodium_crypto_box_secretkey($keyPair); - $x = sodium_crypto_box_publickey($keyPair); - - break; - - case 'Ed25519': - $keyPair = sodium_crypto_sign_keypair(); - $secret = sodium_crypto_sign_secretkey($keyPair); - $x = sodium_crypto_sign_publickey($keyPair); - - break; - - default: - throw new InvalidArgumentException(sprintf('Unsupported "%s" curve', $curve)); - } - $secretLength = mb_strlen($secret, '8bit'); - $d = mb_substr($secret, 0, -$secretLength / 2, '8bit'); - - $values = array_merge( - $values, - [ - 'kty' => 'OKP', - 'crv' => $curve, - 'd' => Base64Url::encode($d), - 'x' => Base64Url::encode($x), - ] - ); - - return new JWK($values); - } - - /** - * Creates a none key with the given additional values. - * Please note that this key type is not pat of any specification. - * It is used to prevent the use of the "none" algorithm with other key types. - * - * @param array $values values to configure the key - */ - public static function createNoneKey(array $values = []): JWK - { - $values = array_merge( - $values, - [ - 'kty' => 'none', - 'alg' => 'none', - 'use' => 'sig', - ] - ); - - return new JWK($values); - } - - /** - * Creates a key from a Json string. - * - * @throws InvalidArgumentException if the key or keyset is not valid - * - * @return JWK|JWKSet - */ - public static function createFromJsonObject(string $value) - { - $json = json_decode($value, true); - if (!is_array($json)) { - throw new InvalidArgumentException('Invalid key or key set.'); - } - - return self::createFromValues($json); - } - - /** - * Creates a key or key set from the given input. - * - * @return JWK|JWKSet - */ - public static function createFromValues(array $values) - { - if (array_key_exists('keys', $values) && is_array($values['keys'])) { - return JWKSet::createFromKeyData($values); - } - - return new JWK($values); - } - - /** - * This method create a JWK object using a shared secret. - */ - public static function createFromSecret(string $secret, array $additional_values = []): JWK - { - $values = array_merge( - $additional_values, - [ - 'kty' => 'oct', - 'k' => Base64Url::encode($secret), - ] - ); - - return new JWK($values); - } - - /** - * This method will try to load a X.509 certificate and convert it into a public key. - */ - public static function createFromCertificateFile(string $file, array $additional_values = []): JWK - { - $values = KeyConverter::loadKeyFromCertificateFile($file); - $values = array_merge($values, $additional_values); - - return new JWK($values); - } - - /** - * Extract a keyfrom a key set identified by the given index . - * - * @param int|string $index - */ - public static function createFromKeySet(JWKSet $jwkset, $index): JWK - { - return $jwkset->get($index); - } - - /** - * This method will try to load a PKCS#12 file and convert it into a public key. - * - * @throws InvalidArgumentException if the certificate cannot be loaded - */ - public static function createFromPKCS12CertificateFile(string $file, ?string $secret = '', array $additional_values = []): JWK - { - try { - $content = file_get_contents($file); - if (!is_string($content)) { - throw new RuntimeException('Unable to read the file.'); - } - openssl_pkcs12_read($content, $certs, $secret); - } catch (Throwable $throwable) { - throw new RuntimeException('Unable to load the certificates.', $throwable->getCode(), $throwable); - } - if (!is_array($certs) || !array_key_exists('pkey', $certs)) { - throw new RuntimeException('Unable to load the certificates.'); - } - - return self::createFromKey($certs['pkey'], null, $additional_values); - } - - /** - * This method will try to convert a X.509 certificate into a public key. - */ - public static function createFromCertificate(string $certificate, array $additional_values = []): JWK - { - $values = KeyConverter::loadKeyFromCertificate($certificate); - $values = array_merge($values, $additional_values); - - return new JWK($values); - } - - /** - * This method will try to convert a X.509 certificate resource into a public key. - * - * @param resource $res - */ - public static function createFromX509Resource($res, array $additional_values = []): JWK - { - $values = KeyConverter::loadKeyFromX509Resource($res); - $values = array_merge($values, $additional_values); - - return new JWK($values); - } - - /** - * This method will try to load and convert a key file into a JWK object. - * If the key is encrypted, the password must be set. - */ - public static function createFromKeyFile(string $file, ?string $password = null, array $additional_values = []): JWK - { - $values = KeyConverter::loadFromKeyFile($file, $password); - $values = array_merge($values, $additional_values); - - return new JWK($values); - } - - /** - * This method will try to load and convert a key into a JWK object. - * If the key is encrypted, the password must be set. - */ - public static function createFromKey(string $key, ?string $password = null, array $additional_values = []): JWK - { - $values = KeyConverter::loadFromKey($key, $password); - $values = array_merge($values, $additional_values); - - return new JWK($values); - } - - /** - * This method will try to load and convert a X.509 certificate chain into a public key. - * - * Be careful! The certificate chain is loaded, but it is NOT VERIFIED by any mean! - * It is mandatory to verify the root CA or intermediate CA are trusted. - * If not done, it may lead to potential security issues. - */ - public static function createFromX5C(array $x5c, array $additional_values = []): JWK - { - $values = KeyConverter::loadFromX5C($x5c); - $values = array_merge($values, $additional_values); - - return new JWK($values); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/ECKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/ECKey.php deleted file mode 100644 index a93501b5..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/ECKey.php +++ /dev/null @@ -1,307 +0,0 @@ -loadJWK($data); - } - - public static function createFromPEM(string $pem): self - { - $data = self::loadPEM($pem); - - return new self($data); - } - - /** - * @param ECKey $private - * - * @return ECKey - */ - public static function toPublic(self $private): self - { - $data = $private->toArray(); - if (array_key_exists('d', $data)) { - unset($data['d']); - } - - return new self($data); - } - - /** - * @return array - */ - public function toArray() - { - return $this->values; - } - - /** - * @throws InvalidArgumentException if the key cannot be loaded - * @throws ParserException if the key cannot be loaded - */ - private static function loadPEM(string $data): array - { - $data = base64_decode(preg_replace('#-.*-|\r|\n#', '', $data), true); - $asnObject = ASNObject::fromBinary($data); - if (!$asnObject instanceof Sequence) { - throw new InvalidArgumentException('Unable to load the key.'); - } - $children = $asnObject->getChildren(); - if (self::isPKCS8($children)) { - $children = self::loadPKCS8($children); - } - - if (4 === count($children)) { - return self::loadPrivatePEM($children); - } - if (2 === count($children)) { - return self::loadPublicPEM($children); - } - - throw new InvalidArgumentException('Unable to load the key.'); - } - - /** - * @param ASNObject[] $children - * - * @throws InvalidArgumentException if the key cannot be loaded - * @throws ParserException if the key cannot be loaded - */ - private static function loadPKCS8(array $children): array - { - $binary = hex2bin($children[2]->getContent()); - $asnObject = ASNObject::fromBinary($binary); - if (!$asnObject instanceof Sequence) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - return $asnObject->getChildren(); - } - - /** - * @throws InvalidArgumentException if the key cannot be loaded - */ - private static function loadPublicPEM(array $children): array - { - if (!$children[0] instanceof Sequence) { - throw new InvalidArgumentException('Unsupported key type.'); - } - - $sub = $children[0]->getChildren(); - if (!$sub[0] instanceof ObjectIdentifier) { - throw new InvalidArgumentException('Unsupported key type.'); - } - if ('1.2.840.10045.2.1' !== $sub[0]->getContent()) { - throw new InvalidArgumentException('Unsupported key type.'); - } - if (!$sub[1] instanceof ObjectIdentifier) { - throw new InvalidArgumentException('Unsupported key type.'); - } - if (!$children[1] instanceof BitString) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - $bits = $children[1]->getContent(); - $bits_length = mb_strlen($bits, '8bit'); - if (0 !== mb_strpos($bits, '04', 0, '8bit')) { - throw new InvalidArgumentException('Unsupported key type'); - } - - $values = ['kty' => 'EC']; - $values['crv'] = self::getCurve($sub[1]->getContent()); - - $xBin = hex2bin(mb_substr($bits, 2, ($bits_length - 2) / 2, '8bit')); - $yBin = hex2bin(mb_substr($bits, (int) (($bits_length - 2) / 2 + 2), ($bits_length - 2) / 2, '8bit')); - if (!is_string($xBin) || !is_string($yBin)) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - $values['x'] = Base64Url::encode($xBin); - $values['y'] = Base64Url::encode($yBin); - - return $values; - } - - /** - * @throws InvalidArgumentException if the OID is not supported - */ - private static function getCurve(string $oid): string - { - $curves = self::getSupportedCurves(); - $curve = array_search($oid, $curves, true); - if (!is_string($curve)) { - throw new InvalidArgumentException('Unsupported OID.'); - } - - return $curve; - } - - private static function getSupportedCurves(): array - { - return [ - 'P-256' => '1.2.840.10045.3.1.7', - 'P-384' => '1.3.132.0.34', - 'P-521' => '1.3.132.0.35', - ]; - } - - /** - * @throws InvalidArgumentException if the key cannot be loaded - */ - private static function verifyVersion(ASNObject $children): void - { - if (!$children instanceof Integer || '1' !== $children->getContent()) { - throw new InvalidArgumentException('Unable to load the key.'); - } - } - - /** - * @throws InvalidArgumentException if the key cannot be loaded - */ - private static function getXAndY(ASNObject $children, string &$x, string &$y): void - { - if (!$children instanceof ExplicitlyTaggedObject || !is_array($children->getContent())) { - throw new InvalidArgumentException('Unable to load the key.'); - } - if (!$children->getContent()[0] instanceof BitString) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - $bits = $children->getContent()[0]->getContent(); - $bits_length = mb_strlen($bits, '8bit'); - - if (0 !== mb_strpos($bits, '04', 0, '8bit')) { - throw new InvalidArgumentException('Unsupported key type'); - } - - $x = mb_substr($bits, 2, (int) (($bits_length - 2) / 2), '8bit'); - $y = mb_substr($bits, (int) (($bits_length - 2) / 2 + 2), (int) (($bits_length - 2) / 2), '8bit'); - } - - /** - * @throws InvalidArgumentException if the key cannot be loaded - */ - private static function getD(ASNObject $children): string - { - if (!$children instanceof OctetString) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - return $children->getContent(); - } - - /** - * @throws InvalidArgumentException if the key cannot be loaded - */ - private static function loadPrivatePEM(array $children): array - { - self::verifyVersion($children[0]); - $x = ''; - $y = ''; - $d = self::getD($children[1]); - self::getXAndY($children[3], $x, $y); - - if (!$children[2] instanceof ExplicitlyTaggedObject || !is_array($children[2]->getContent())) { - throw new InvalidArgumentException('Unable to load the key.'); - } - if (!$children[2]->getContent()[0] instanceof ObjectIdentifier) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - $curve = $children[2]->getContent()[0]->getContent(); - $dBin = hex2bin($d); - $xBin = hex2bin($x); - $yBin = hex2bin($y); - if (!is_string($dBin) || !is_string($xBin) || !is_string($yBin)) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - $values = ['kty' => 'EC']; - $values['crv'] = self::getCurve($curve); - $values['d'] = Base64Url::encode($dBin); - $values['x'] = Base64Url::encode($xBin); - $values['y'] = Base64Url::encode($yBin); - - return $values; - } - - /** - * @param ASNObject[] $children - */ - private static function isPKCS8(array $children): bool - { - if (3 !== count($children)) { - return false; - } - - $classes = [0 => Integer::class, 1 => Sequence::class, 2 => OctetString::class]; - foreach ($classes as $k => $class) { - if (!$children[$k] instanceof $class) { - return false; - } - } - - return true; - } - - /** - * @throws InvalidArgumentException if the key is invalid - */ - private function loadJWK(array $jwk): void - { - $keys = [ - 'kty' => 'The key parameter "kty" is missing.', - 'crv' => 'Curve parameter is missing', - 'x' => 'Point parameters are missing.', - 'y' => 'Point parameters are missing.', - ]; - foreach ($keys as $k => $v) { - if (!array_key_exists($k, $jwk)) { - throw new InvalidArgumentException($v); - } - } - - if ('EC' !== $jwk['kty']) { - throw new InvalidArgumentException('JWK is not an Elliptic Curve key.'); - } - $this->values = $jwk; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/KeyConverter.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/KeyConverter.php deleted file mode 100644 index 4b986f24..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/KeyConverter.php +++ /dev/null @@ -1,272 +0,0 @@ - $cert) { - $x5c[$id] = '-----BEGIN CERTIFICATE-----'.PHP_EOL.chunk_split($cert, 64, PHP_EOL).'-----END CERTIFICATE-----'; - $x509 = openssl_x509_read($x5c[$id]); - if (false === $x509) { - throw new InvalidArgumentException('Unable to load the certificate chain'); - } - $parsed = openssl_x509_parse($x509); - if (false === $parsed) { - throw new InvalidArgumentException('Unable to load the certificate chain'); - } - } - - return self::loadKeyFromCertificate(reset($x5c)); - } - - private static function loadKeyFromDER(string $der, ?string $password = null): array - { - $pem = self::convertDerToPem($der); - - return self::loadKeyFromPEM($pem, $password); - } - - /** - * @throws InvalidArgumentException if the OpenSSL extension is not available - * @throws InvalidArgumentException if the key cannot be loaded - */ - private static function loadKeyFromPEM(string $pem, ?string $password = null): array - { - if (1 === preg_match('#DEK-Info: (.+),(.+)#', $pem, $matches)) { - $pem = self::decodePem($pem, $matches, $password); - } - - if (!extension_loaded('openssl')) { - throw new RuntimeException('Please install the OpenSSL extension'); - } - self::sanitizePEM($pem); - $res = openssl_pkey_get_private($pem); - if (false === $res) { - $res = openssl_pkey_get_public($pem); - } - if (false === $res) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - $details = openssl_pkey_get_details($res); - if (!is_array($details) || !array_key_exists('type', $details)) { - throw new InvalidArgumentException('Unable to get details of the key'); - } - - switch ($details['type']) { - case OPENSSL_KEYTYPE_EC: - $ec_key = ECKey::createFromPEM($pem); - - return $ec_key->toArray(); - - case OPENSSL_KEYTYPE_RSA: - $rsa_key = RSAKey::createFromPEM($pem); - - return $rsa_key->toArray(); - - default: - throw new InvalidArgumentException('Unsupported key type'); - } - } - - /** - * This method modifies the PEM to get 64 char lines and fix bug with old OpenSSL versions. - */ - private static function sanitizePEM(string &$pem): void - { - preg_match_all('#(-.*-)#', $pem, $matches, PREG_PATTERN_ORDER); - $ciphertext = preg_replace('#-.*-|\r|\n| #', '', $pem); - - $pem = $matches[0][0].PHP_EOL; - $pem .= chunk_split($ciphertext, 64, PHP_EOL); - $pem .= $matches[0][1].PHP_EOL; - } - - /** - * @param string[] $matches - * - * @throws InvalidArgumentException if the password to decrypt the key is not provided - * @throws InvalidArgumentException if the key cannot be loaded - */ - private static function decodePem(string $pem, array $matches, ?string $password = null): string - { - if (null === $password) { - throw new InvalidArgumentException('Password required for encrypted keys.'); - } - - $iv = pack('H*', trim($matches[2])); - $iv_sub = mb_substr($iv, 0, 8, '8bit'); - $symkey = pack('H*', md5($password.$iv_sub)); - $symkey .= pack('H*', md5($symkey.$password.$iv_sub)); - $key = preg_replace('#^(?:Proc-Type|DEK-Info): .*#m', '', $pem); - $ciphertext = base64_decode(preg_replace('#-.*-|\r|\n#', '', $key), true); - if (!is_string($ciphertext)) { - throw new InvalidArgumentException('Unable to encode the data.'); - } - - $decoded = openssl_decrypt($ciphertext, mb_strtolower($matches[1]), $symkey, OPENSSL_RAW_DATA, $iv); - if (false === $decoded) { - throw new RuntimeException('Unable to decrypt the key'); - } - $number = preg_match_all('#-{5}.*-{5}#', $pem, $result); - if (2 !== $number) { - throw new InvalidArgumentException('Unable to load the key'); - } - - $pem = $result[0][0].PHP_EOL; - $pem .= chunk_split(base64_encode($decoded), 64); - $pem .= $result[0][1].PHP_EOL; - - return $pem; - } - - private static function convertDerToPem(string $der_data): string - { - $pem = chunk_split(base64_encode($der_data), 64, PHP_EOL); - - return '-----BEGIN CERTIFICATE-----'.PHP_EOL.$pem.'-----END CERTIFICATE-----'.PHP_EOL; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/RSAKey.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/RSAKey.php deleted file mode 100644 index a52eb642..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/KeyConverter/RSAKey.php +++ /dev/null @@ -1,263 +0,0 @@ -loadJWK($data); - } - - /** - * @return RSAKey - */ - public static function createFromKeyDetails(array $details): self - { - $values = ['kty' => 'RSA']; - $keys = [ - 'n' => 'n', - 'e' => 'e', - 'd' => 'd', - 'p' => 'p', - 'q' => 'q', - 'dp' => 'dmp1', - 'dq' => 'dmq1', - 'qi' => 'iqmp', - ]; - foreach ($details as $key => $value) { - if (in_array($key, $keys, true)) { - $value = Base64Url::encode($value); - $values[array_search($key, $keys, true)] = $value; - } - } - - return new self($values); - } - - /** - * @throws RuntimeException if the extension OpenSSL is not available - * @throws InvalidArgumentException if the key cannot be loaded - * - * @return RSAKey - */ - public static function createFromPEM(string $pem): self - { - if (!extension_loaded('openssl')) { - throw new RuntimeException('Please install the OpenSSL extension'); - } - $res = openssl_pkey_get_private($pem); - if (false === $res) { - $res = openssl_pkey_get_public($pem); - } - if (false === $res) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - $details = openssl_pkey_get_details($res); - if (!is_array($details) || !isset($details['rsa'])) { - throw new InvalidArgumentException('Unable to load the key.'); - } - - return self::createFromKeyDetails($details['rsa']); - } - - /** - * @return RSAKey - */ - public static function createFromJWK(JWK $jwk): self - { - return new self($jwk->all()); - } - - public function isPublic(): bool - { - return !array_key_exists('d', $this->values); - } - - /** - * @param RSAKey $private - * - * @return RSAKey - */ - public static function toPublic(self $private): self - { - $data = $private->toArray(); - $keys = ['p', 'd', 'q', 'dp', 'dq', 'qi']; - foreach ($keys as $key) { - if (array_key_exists($key, $data)) { - unset($data[$key]); - } - } - - return new self($data); - } - - public function toArray(): array - { - return $this->values; - } - - public function toJwk(): JWK - { - return new JWK($this->values); - } - - /** - * This method will try to add Chinese Remainder Theorem (CRT) parameters. - * With those primes, the decryption process is really fast. - */ - public function optimize(): void - { - if (array_key_exists('d', $this->values)) { - $this->populateCRT(); - } - } - - /** - * @throws InvalidArgumentException if the key is invalid or not an RSA key - */ - private function loadJWK(array $jwk): void - { - if (!array_key_exists('kty', $jwk)) { - throw new InvalidArgumentException('The key parameter "kty" is missing.'); - } - if ('RSA' !== $jwk['kty']) { - throw new InvalidArgumentException('The JWK is not a RSA key.'); - } - - $this->values = $jwk; - } - - /** - * This method adds Chinese Remainder Theorem (CRT) parameters if primes 'p' and 'q' are available. - * If 'p' and 'q' are missing, they are computed and added to the key data. - */ - private function populateCRT(): void - { - if (!array_key_exists('p', $this->values) && !array_key_exists('q', $this->values)) { - $d = BigInteger::createFromBinaryString(Base64Url::decode($this->values['d'])); - $e = BigInteger::createFromBinaryString(Base64Url::decode($this->values['e'])); - $n = BigInteger::createFromBinaryString(Base64Url::decode($this->values['n'])); - - [$p, $q] = $this->findPrimeFactors($d, $e, $n); - $this->values['p'] = Base64Url::encode($p->toBytes()); - $this->values['q'] = Base64Url::encode($q->toBytes()); - } - - if (array_key_exists('dp', $this->values) && array_key_exists('dq', $this->values) && array_key_exists('qi', $this->values)) { - return; - } - - $one = BigInteger::createFromDecimal(1); - $d = BigInteger::createFromBinaryString(Base64Url::decode($this->values['d'])); - $p = BigInteger::createFromBinaryString(Base64Url::decode($this->values['p'])); - $q = BigInteger::createFromBinaryString(Base64Url::decode($this->values['q'])); - - $this->values['dp'] = Base64Url::encode($d->mod($p->subtract($one))->toBytes()); - $this->values['dq'] = Base64Url::encode($d->mod($q->subtract($one))->toBytes()); - $this->values['qi'] = Base64Url::encode($q->modInverse($p)->toBytes()); - } - - /** - * @throws RuntimeException if the prime factors cannot be found - * - * @return BigInteger[] - */ - private function findPrimeFactors(BigInteger $d, BigInteger $e, BigInteger $n): array - { - $zero = BigInteger::createFromDecimal(0); - $one = BigInteger::createFromDecimal(1); - $two = BigInteger::createFromDecimal(2); - - $k = $d->multiply($e)->subtract($one); - - if ($k->isEven()) { - $r = $k; - $t = $zero; - - do { - $r = $r->divide($two); - $t = $t->add($one); - } while ($r->isEven()); - - $found = false; - $y = null; - - for ($i = 1; $i <= 100; ++$i) { - $g = BigInteger::random($n->subtract($one)); - $y = $g->modPow($r, $n); - - if ($y->equals($one) || $y->equals($n->subtract($one))) { - continue; - } - - for ($j = $one; $j->lowerThan($t->subtract($one)); $j = $j->add($one)) { - $x = $y->modPow($two, $n); - - if ($x->equals($one)) { - $found = true; - - break; - } - - if ($x->equals($n->subtract($one))) { - continue; - } - - $y = $x; - } - - $x = $y->modPow($two, $n); - if ($x->equals($one)) { - $found = true; - - break; - } - } - if (null === $y) { - throw new InvalidArgumentException('Unable to find prime factors.'); - } - if (true === $found) { - $p = $y->subtract($one)->gcd($n); - $q = $n->divide($p); - - return [$p, $q]; - } - } - - throw new InvalidArgumentException('Unable to find prime factors.'); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/LICENSE deleted file mode 100644 index 37cf976b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -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/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/README.md deleted file mode 100644 index 62651e50..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/README.md +++ /dev/null @@ -1,15 +0,0 @@ -PHP JWT Key Management Component -================================ - -This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is READ ONLY. - -**Please do not submit any Pull Request here.** -You should go to [the main repository](https://github.com/web-token/jwt-framework) instead. - -# Documentation - -The official documentation is available as https://web-token.spomky-labs.com/ - -# Licence - -This software is release under [MIT licence](LICENSE). diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/UrlKeySetFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/UrlKeySetFactory.php deleted file mode 100644 index e880fd6c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/UrlKeySetFactory.php +++ /dev/null @@ -1,58 +0,0 @@ -client = $client; - $this->requestFactory = $requestFactory; - } - - /** - * @throws RuntimeException if the response content is invalid - */ - protected function getContent(string $url, array $header = []): string - { - $request = $this->requestFactory->createRequest('GET', $url); - foreach ($header as $k => $v) { - $request = $request->withHeader($k, $v); - } - $response = $this->client->sendRequest($request); - - if ($response->getStatusCode() >= 400) { - throw new RuntimeException('Unable to get the key set.', $response->getStatusCode()); - } - - return $response->getBody()->getContents(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/X5UFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/X5UFactory.php deleted file mode 100644 index 8b81c995..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/X5UFactory.php +++ /dev/null @@ -1,56 +0,0 @@ -getContent($url, $header); - $data = JsonConverter::decode($content); - if (!is_array($data)) { - throw new RuntimeException('Invalid content.'); - } - - $keys = []; - foreach ($data as $kid => $cert) { - if (false === mb_strpos($cert, '-----BEGIN CERTIFICATE-----')) { - $cert = '-----BEGIN CERTIFICATE-----'.PHP_EOL.$cert.PHP_EOL.'-----END CERTIFICATE-----'; - } - $jwk = KeyConverter::loadKeyFromCertificate($cert); - if (is_string($kid)) { - $jwk['kid'] = $kid; - $keys[$kid] = new JWK($jwk); - } else { - $keys[] = new JWK($jwk); - } - } - - return new JWKSet($keys); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/composer.json deleted file mode 100644 index 8a3cb323..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-key-mgmt/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "web-token/jwt-key-mgmt", - "description": "Key Management component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": ["JWS", "JWT", "JWE", "JWA", "JWK", "JWKSet", "Jot", "Jose", "RFC7515", "RFC7516", "RFC7517", "RFC7518", "RFC7519", "RFC7520", "Bundle", "Symfony"], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - },{ - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-key-mgmt/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\KeyManagement\\": "" - } - }, - "require": { - "ext-openssl": "*", - "psr/http-factory": "^1.0", - "psr/http-client": "^1.0", - "web-token/jwt-core": "^2.0" - }, - "suggest": { - "ext-sodium": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys", - "web-token/jwt-util-ecc": "To use EC key analyzers.", - "php-http/message-factory": "To enable JKU/X5U support.", - "php-http/httplug": "To enable JKU/X5U support." - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/CONTRIBUTING.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/CONTRIBUTING.md deleted file mode 100644 index fc360e5d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -# Contributing - -This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is READ ONLY. -Please do not submit any Pull Requests here. It will be automatically closed. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/FUNDING.yml b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/PULL_REQUEST_TEMPLATE.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d4ff96cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,3 +0,0 @@ -Please do not submit any Pull Requests here. It will be automatically closed. - -You should submit it here: https://github.com/web-token/jwt-framework/pulls diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/ECDSA.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/ECDSA.php deleted file mode 100644 index 75b28a26..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/ECDSA.php +++ /dev/null @@ -1,80 +0,0 @@ -checkKey($key); - if (!$key->has('d')) { - throw new InvalidArgumentException('The EC key is not private'); - } - $pem = ECKey::convertPrivateKeyToPEM($key); - openssl_sign($input, $signature, $pem, $this->getHashAlgorithm()); - - return ECSignature::fromAsn1($signature, $this->getSignaturePartLength()); - } - - public function verify(JWK $key, string $input, string $signature): bool - { - $this->checkKey($key); - - try { - $der = ECSignature::toAsn1($signature, $this->getSignaturePartLength()); - $pem = ECKey::convertPublicKeyToPEM($key); - - return 1 === openssl_verify($input, $der, $pem, $this->getHashAlgorithm()); - } catch (Throwable $e) { - return false; - } - } - - abstract protected function getHashAlgorithm(): string; - - abstract protected function getSignaturePartLength(): int; - - private function checkKey(JWK $key): void - { - if (!in_array($key->get('kty'), $this->allowedKeyTypes(), true)) { - throw new InvalidArgumentException('Wrong key type.'); - } - foreach (['x', 'y', 'crv'] as $k) { - if (!$key->has($k)) { - throw new InvalidArgumentException(sprintf('The key parameter "%s" is missing.', $k)); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/ES256.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/ES256.php deleted file mode 100644 index 1999e7d4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-ecdsa/ES256.php +++ /dev/null @@ -1,32 +0,0 @@ -checkKey($key); - if (!$key->has('d')) { - throw new InvalidArgumentException('The EC key is not private'); - } - $x = Base64Url::decode($key->get('x')); - $d = Base64Url::decode($key->get('d')); - $secret = $d.$x; - - switch ($key->get('crv')) { - case 'Ed25519': - return sodium_crypto_sign_detached($input, $secret); - - default: - throw new InvalidArgumentException('Unsupported curve'); - } - } - - /** - * @throws InvalidArgumentException if the curve is not supported - */ - public function verify(JWK $key, string $input, string $signature): bool - { - $this->checkKey($key); - - $public = Base64Url::decode($key->get('x')); - - switch ($key->get('crv')) { - case 'Ed25519': - return sodium_crypto_sign_verify_detached($signature, $input, $public); - - default: - throw new InvalidArgumentException('Unsupported curve'); - } - } - - public function name(): string - { - return 'EdDSA'; - } - - /** - * @throws InvalidArgumentException if the key type is not valid - * @throws InvalidArgumentException if a mandatory key parameter is missing - * @throws InvalidArgumentException if the curve is not suuported - */ - private function checkKey(JWK $key): void - { - if (!in_array($key->get('kty'), $this->allowedKeyTypes(), true)) { - throw new InvalidArgumentException('Wrong key type.'); - } - foreach (['x', 'crv'] as $k) { - if (!$key->has($k)) { - throw new InvalidArgumentException(sprintf('The key parameter "%s" is missing.', $k)); - } - } - if ('Ed25519' !== $key->get('crv')) { - throw new InvalidArgumentException('Unsupported curve.'); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/LICENSE deleted file mode 100644 index 37cf976b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -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/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/README.md deleted file mode 100644 index 39f21ff4..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/README.md +++ /dev/null @@ -1,15 +0,0 @@ -EdDSA Based Signature Algorithms For JWT-Framework -================================================== - -This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is READ ONLY. - -**Please do not submit any Pull Request here.** -You should go to [the main repository](https://github.com/web-token/jwt-framework) instead. - -# Documentation - -The official documentation is available as https://web-token.spomky-labs.com/ - -# Licence - -This software is release under [MIT licence](LICENSE). diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/composer.json deleted file mode 100644 index d1d45b40..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-eddsa/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "web-token/jwt-signature-algorithm-eddsa", - "description": "EdDSA Signature Algorithm the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": ["JWS", "JWT", "JWE", "JWA", "JWK", "JWKSet", "Jot", "Jose", "RFC7515", "RFC7516", "RFC7517", "RFC7518", "RFC7519", "RFC7520", "Bundle", "Symfony"], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - },{ - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, - "require": { - "ext-sodium": "*", - "web-token/jwt-signature": "^2.1" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/CONTRIBUTING.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/CONTRIBUTING.md deleted file mode 100644 index fc360e5d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -# Contributing - -This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is READ ONLY. -Please do not submit any Pull Requests here. It will be automatically closed. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/FUNDING.yml b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/PULL_REQUEST_TEMPLATE.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d4ff96cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,3 +0,0 @@ -Please do not submit any Pull Requests here. It will be automatically closed. - -You should submit it here: https://github.com/web-token/jwt-framework/pulls diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/LICENSE deleted file mode 100644 index 37cf976b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -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/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/PS256.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/PS256.php deleted file mode 100644 index dfaabd58..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/PS256.php +++ /dev/null @@ -1,27 +0,0 @@ -checkKey($key); - $pub = RSAKey::createFromJWK($key->toPublic()); - - return JoseRSA::verify($pub, $input, $signature, $this->getAlgorithm(), $this->getSignatureMethod()); - } - - /** - * @throws InvalidArgumentException if the key is not private - */ - public function sign(JWK $key, string $input): string - { - $this->checkKey($key); - if (!$key->has('d')) { - throw new InvalidArgumentException('The key is not a private key.'); - } - - $priv = RSAKey::createFromJWK($key); - - return JoseRSA::sign($priv, $input, $this->getAlgorithm(), $this->getSignatureMethod()); - } - - abstract protected function getAlgorithm(): string; - - abstract protected function getSignatureMethod(): int; - - /** - * @throws InvalidArgumentException if the key type is not allowed - * @throws InvalidArgumentException if the key is invalid - */ - private function checkKey(JWK $key): void - { - if (!in_array($key->get('kty'), $this->allowedKeyTypes(), true)) { - throw new InvalidArgumentException('Wrong key type.'); - } - foreach (['n', 'e'] as $k) { - if (!$key->has($k)) { - throw new InvalidArgumentException(sprintf('The key parameter "%s" is missing.', $k)); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/RSAPKCS1.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/RSAPKCS1.php deleted file mode 100644 index da2fd807..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/RSAPKCS1.php +++ /dev/null @@ -1,75 +0,0 @@ -checkKey($key); - $pub = RSAKey::createFromJWK($key->toPublic()); - - return 1 === openssl_verify($input, $signature, $pub->toPEM(), $this->getAlgorithm()); - } - - /** - * @throws InvalidArgumentException if the key is not private - * @throws InvalidArgumentException if the data cannot be signed - */ - public function sign(JWK $key, string $input): string - { - $this->checkKey($key); - if (!$key->has('d')) { - throw new InvalidArgumentException('The key is not a private key.'); - } - - $priv = RSAKey::createFromJWK($key); - - $result = openssl_sign($input, $signature, $priv->toPEM(), $this->getAlgorithm()); - if (true !== $result) { - throw new RuntimeException('Unable to sign'); - } - - return $signature; - } - - abstract protected function getAlgorithm(): string; - - /** - * @throws InvalidArgumentException if the key type is not allowed - * @throws InvalidArgumentException if the key is not valid - */ - private function checkKey(JWK $key): void - { - if (!in_array($key->get('kty'), $this->allowedKeyTypes(), true)) { - throw new InvalidArgumentException('Wrong key type.'); - } - foreach (['n', 'e'] as $k) { - if (!$key->has($k)) { - throw new InvalidArgumentException(sprintf('The key parameter "%s" is missing.', $k)); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/RSAPSS.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/RSAPSS.php deleted file mode 100644 index 9112c417..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/RSAPSS.php +++ /dev/null @@ -1,69 +0,0 @@ -checkKey($key); - $pub = RSAKey::createFromJWK($key->toPublic()); - - return JoseRSA::verify($pub, $input, $signature, $this->getAlgorithm(), JoseRSA::SIGNATURE_PSS); - } - - /** - * @throws InvalidArgumentException if the key is not private - */ - public function sign(JWK $key, string $input): string - { - $this->checkKey($key); - if (!$key->has('d')) { - throw new InvalidArgumentException('The key is not a private key.'); - } - - $priv = RSAKey::createFromJWK($key); - - return JoseRSA::sign($priv, $input, $this->getAlgorithm(), JoseRSA::SIGNATURE_PSS); - } - - abstract protected function getAlgorithm(): string; - - /** - * @throws InvalidArgumentException if the key type is not allowed - * @throws InvalidArgumentException if the key is not valid - */ - private function checkKey(JWK $key): void - { - if (!in_array($key->get('kty'), $this->allowedKeyTypes(), true)) { - throw new InvalidArgumentException('Wrong key type.'); - } - foreach (['n', 'e'] as $k) { - if (!$key->has($k)) { - throw new InvalidArgumentException(sprintf('The key parameter "%s" is missing.', $k)); - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/Util/RSA.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/Util/RSA.php deleted file mode 100644 index b0f7e313..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/Util/RSA.php +++ /dev/null @@ -1,251 +0,0 @@ -toPEM(), $hash); - if (true !== $result) { - throw new RuntimeException('Unable to sign the data'); - } - - return $signature; - - default: - throw new InvalidArgumentException('Unsupported mode.'); - } - } - - /** - * Create a signature. - */ - public static function signWithPSS(RSAKey $key, string $message, string $hash): string - { - $em = self::encodeEMSAPSS($message, 8 * $key->getModulusLength() - 1, Hash::$hash()); - $message = BigInteger::createFromBinaryString($em); - $signature = RSAKey::exponentiate($key, $message); - - return self::convertIntegerToOctetString($signature, $key->getModulusLength()); - } - - /** - * Create a signature. - * - * @deprecated Please use openssl_sign - */ - public static function signWithPKCS15(RSAKey $key, string $message, string $hash): string - { - $em = self::encodeEMSA15($message, $key->getModulusLength(), Hash::$hash()); - $message = BigInteger::createFromBinaryString($em); - $signature = RSAKey::exponentiate($key, $message); - - return self::convertIntegerToOctetString($signature, $key->getModulusLength()); - } - - /** - * @throws InvalidArgumentException if the signature mode is not supported - */ - public static function verify(RSAKey $key, string $message, string $signature, string $hash, int $mode): bool - { - switch ($mode) { - case self::SIGNATURE_PSS: - return self::verifyWithPSS($key, $message, $signature, $hash); - - case self::SIGNATURE_PKCS1: - return 1 === openssl_verify($message, $signature, $key->toPEM(), $hash); - - default: - throw new InvalidArgumentException('Unsupported mode.'); - } - } - - /** - * Verifies a signature. - * - * @throws RuntimeException if the signature cannot be verified - */ - public static function verifyWithPSS(RSAKey $key, string $message, string $signature, string $hash): bool - { - if (mb_strlen($signature, '8bit') !== $key->getModulusLength()) { - throw new RuntimeException(); - } - $s2 = BigInteger::createFromBinaryString($signature); - $m2 = RSAKey::exponentiate($key, $s2); - $em = self::convertIntegerToOctetString($m2, $key->getModulusLength()); - $modBits = 8 * $key->getModulusLength(); - - return self::verifyEMSAPSS($message, $em, $modBits - 1, Hash::$hash()); - } - - /** - * Verifies a signature. - * - * @deprecated Please use openssl_sign - * - * @throws RuntimeException if the signature cannot be verified - */ - public static function verifyWithPKCS15(RSAKey $key, string $message, string $signature, string $hash): bool - { - if (mb_strlen($signature, '8bit') !== $key->getModulusLength()) { - throw new RuntimeException(); - } - $signature = BigInteger::createFromBinaryString($signature); - $m2 = RSAKey::exponentiate($key, $signature); - $em = self::convertIntegerToOctetString($m2, $key->getModulusLength()); - - return hash_equals($em, self::encodeEMSA15($message, $key->getModulusLength(), Hash::$hash())); - } - - /** - * @throws RuntimeException if the value cannot be converted - */ - private static function convertIntegerToOctetString(BigInteger $x, int $xLen): string - { - $x = $x->toBytes(); - if (mb_strlen($x, '8bit') > $xLen) { - throw new RuntimeException(); - } - - return str_pad($x, $xLen, chr(0), STR_PAD_LEFT); - } - - /** - * MGF1. - */ - private static function getMGF1(string $mgfSeed, int $maskLen, Hash $mgfHash): string - { - $t = ''; - $count = ceil($maskLen / $mgfHash->getLength()); - for ($i = 0; $i < $count; ++$i) { - $c = pack('N', $i); - $t .= $mgfHash->hash($mgfSeed.$c); - } - - return mb_substr($t, 0, $maskLen, '8bit'); - } - - /** - * EMSA-PSS-ENCODE. - * - * @throws RuntimeException if the message length is invalid - */ - private static function encodeEMSAPSS(string $message, int $modulusLength, Hash $hash): string - { - $emLen = ($modulusLength + 1) >> 3; - $sLen = $hash->getLength(); - $mHash = $hash->hash($message); - if ($emLen <= $hash->getLength() + $sLen + 2) { - throw new RuntimeException(); - } - $salt = random_bytes($sLen); - $m2 = "\0\0\0\0\0\0\0\0".$mHash.$salt; - $h = $hash->hash($m2); - $ps = str_repeat(chr(0), $emLen - $sLen - $hash->getLength() - 2); - $db = $ps.chr(1).$salt; - $dbMask = self::getMGF1($h, $emLen - $hash->getLength() - 1, $hash); - $maskedDB = $db ^ $dbMask; - $maskedDB[0] = ~chr(0xFF << ($modulusLength & 7)) & $maskedDB[0]; - $em = $maskedDB.$h.chr(0xBC); - - return $em; - } - - /** - * EMSA-PSS-VERIFY. - * - * @throws InvalidArgumentException if the signature cannot be verified - */ - private static function verifyEMSAPSS(string $m, string $em, int $emBits, Hash $hash): bool - { - $emLen = ($emBits + 1) >> 3; - $sLen = $hash->getLength(); - $mHash = $hash->hash($m); - if ($emLen < $hash->getLength() + $sLen + 2) { - throw new InvalidArgumentException(); - } - if ($em[mb_strlen($em, '8bit') - 1] !== chr(0xBC)) { - throw new InvalidArgumentException(); - } - $maskedDB = mb_substr($em, 0, -$hash->getLength() - 1, '8bit'); - $h = mb_substr($em, -$hash->getLength() - 1, $hash->getLength(), '8bit'); - $temp = chr(0xFF << ($emBits & 7)); - if ((~$maskedDB[0] & $temp) !== $temp) { - throw new InvalidArgumentException(); - } - $dbMask = self::getMGF1($h, $emLen - $hash->getLength() - 1, $hash/*MGF*/); - $db = $maskedDB ^ $dbMask; - $db[0] = ~chr(0xFF << ($emBits & 7)) & $db[0]; - $temp = $emLen - $hash->getLength() - $sLen - 2; - if (mb_substr($db, 0, $temp, '8bit') !== str_repeat(chr(0), $temp)) { - throw new InvalidArgumentException(); - } - if (1 !== ord($db[$temp])) { - throw new InvalidArgumentException(); - } - $salt = mb_substr($db, $temp + 1, null, '8bit'); // should be $sLen long - $m2 = "\0\0\0\0\0\0\0\0".$mHash.$salt; - $h2 = $hash->hash($m2); - - return hash_equals($h, $h2); - } - - /** - * @throws RuntimeException if the value cannot be encoded - */ - private static function encodeEMSA15(string $m, int $emBits, Hash $hash): string - { - $h = $hash->hash($m); - $t = $hash->t(); - $t .= $h; - $tLen = mb_strlen($t, '8bit'); - if ($emBits < $tLen + 11) { - throw new RuntimeException(); - } - $ps = str_repeat(chr(0xFF), $emBits - $tLen - 3); - - return "\0\1{$ps}\0{$t}"; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/composer.json deleted file mode 100644 index eb57efa8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature-algorithm-rsa/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "web-token/jwt-signature-algorithm-rsa", - "description": "RSA Based Signature Algorithms the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": ["JWS", "JWT", "JWE", "JWA", "JWK", "JWKSet", "Jot", "Jose", "RFC7515", "RFC7516", "RFC7517", "RFC7518", "RFC7519", "RFC7520", "Bundle", "Symfony"], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - },{ - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, - "require": { - "brick/math": "^0.8.17|^0.9", - "ext-openssl": "*", - "web-token/jwt-signature": "^2.1" - }, - "suggest": { - "ext-gmp": "GMP or BCMath is highly recommended to improve the library performance", - "ext-bcmath": "GMP or BCMath is highly recommended to improve the library performance" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/CONTRIBUTING.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/CONTRIBUTING.md deleted file mode 100644 index fc360e5d..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -# Contributing - -This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is READ ONLY. -Please do not submit any Pull Requests here. It will be automatically closed. diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/FUNDING.yml b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/PULL_REQUEST_TEMPLATE.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d4ff96cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,3 +0,0 @@ -Please do not submit any Pull Requests here. It will be automatically closed. - -You should submit it here: https://github.com/web-token/jwt-framework/pulls diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Algorithm/MacAlgorithm.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Algorithm/MacAlgorithm.php deleted file mode 100644 index 2304b367..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Algorithm/MacAlgorithm.php +++ /dev/null @@ -1,37 +0,0 @@ -payload = $payload; - $this->encodedPayload = $encodedPayload; - $this->isPayloadDetached = $isPayloadDetached; - } - - public function getPayload(): ?string - { - return $this->payload; - } - - /** - * Returns true if the payload is detached. - */ - public function isPayloadDetached(): bool - { - return $this->isPayloadDetached; - } - - /** - * Returns the Base64Url encoded payload. - * If the payload is detached, this method returns null. - */ - public function getEncodedPayload(): ?string - { - if (true === $this->isPayloadDetached()) { - return null; - } - - return $this->encodedPayload; - } - - /** - * Returns the signatures associated with the JWS. - * - * @return Signature[] - */ - public function getSignatures(): array - { - return $this->signatures; - } - - /** - * Returns the signature at the given index. - * - * @throws InvalidArgumentException if the signature index does not exist - */ - public function getSignature(int $id): Signature - { - if (isset($this->signatures[$id])) { - return $this->signatures[$id]; - } - - throw new InvalidArgumentException('The signature does not exist.'); - } - - /** - * This method adds a signature to the JWS object. - * Its returns a new JWS object. - * - * @internal - * - * @return JWS - */ - public function addSignature(string $signature, array $protectedHeader, ?string $encodedProtectedHeader, array $header = []): self - { - $jws = clone $this; - $jws->signatures[] = new Signature($signature, $protectedHeader, $encodedProtectedHeader, $header); - - return $jws; - } - - /** - * Returns the number of signature associated with the JWS. - */ - public function countSignatures(): int - { - return count($this->signatures); - } - - /** - * This method splits the JWS into a list of JWSs. - * It is only useful when the JWS contains more than one signature (JSON General Serialization). - * - * @return JWS[] - */ - public function split(): array - { - $result = []; - foreach ($this->signatures as $signature) { - $jws = new self( - $this->payload, - $this->encodedPayload, - $this->isPayloadDetached - ); - $jws = $jws->addSignature( - $signature->getSignature(), - $signature->getProtectedHeader(), - $signature->getEncodedProtectedHeader(), - $signature->getHeader() - ); - - $result[] = $jws; - } - - return $result; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSBuilder.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSBuilder.php deleted file mode 100644 index afffd12f..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSBuilder.php +++ /dev/null @@ -1,235 +0,0 @@ -signatureAlgorithmManager = $signatureAlgorithmManager; - } - - /** - * Returns the algorithm manager associated to the builder. - */ - public function getSignatureAlgorithmManager(): AlgorithmManager - { - return $this->signatureAlgorithmManager; - } - - /** - * Reset the current data. - * - * @return JWSBuilder - */ - public function create(): self - { - $this->payload = null; - $this->isPayloadDetached = false; - $this->signatures = []; - $this->isPayloadEncoded = null; - - return $this; - } - - /** - * Set the payload. - * This method will return a new JWSBuilder object. - * - * @throws InvalidArgumentException if the payload is not UTF-8 encoded - * - * @return JWSBuilder - */ - public function withPayload(string $payload, bool $isPayloadDetached = false): self - { - if (false === mb_detect_encoding($payload, 'UTF-8', true)) { - throw new InvalidArgumentException('The payload must be encoded in UTF-8'); - } - $clone = clone $this; - $clone->payload = $payload; - $clone->isPayloadDetached = $isPayloadDetached; - - return $clone; - } - - /** - * Adds the information needed to compute the signature. - * This method will return a new JWSBuilder object. - * - * @throws InvalidArgumentException if the payload encoding is inconsistent - * - * @return JWSBuilder - */ - public function addSignature(JWK $signatureKey, array $protectedHeader, array $header = []): self - { - $this->checkB64AndCriticalHeader($protectedHeader); - $isPayloadEncoded = $this->checkIfPayloadIsEncoded($protectedHeader); - if (null === $this->isPayloadEncoded) { - $this->isPayloadEncoded = $isPayloadEncoded; - } elseif ($this->isPayloadEncoded !== $isPayloadEncoded) { - throw new InvalidArgumentException('Foreign payload encoding detected.'); - } - $this->checkDuplicatedHeaderParameters($protectedHeader, $header); - KeyChecker::checkKeyUsage($signatureKey, 'signature'); - $algorithm = $this->findSignatureAlgorithm($signatureKey, $protectedHeader, $header); - KeyChecker::checkKeyAlgorithm($signatureKey, $algorithm->name()); - $clone = clone $this; - $clone->signatures[] = [ - 'signature_algorithm' => $algorithm, - 'signature_key' => $signatureKey, - 'protected_header' => $protectedHeader, - 'header' => $header, - ]; - - return $clone; - } - - /** - * Computes all signatures and return the expected JWS object. - * - * @throws RuntimeException if the payload is not set - * @throws RuntimeException if no signature is defined - */ - public function build(): JWS - { - if (null === $this->payload) { - throw new RuntimeException('The payload is not set.'); - } - if (0 === count($this->signatures)) { - throw new RuntimeException('At least one signature must be set.'); - } - - $encodedPayload = false === $this->isPayloadEncoded ? $this->payload : Base64Url::encode($this->payload); - $jws = new JWS($this->payload, $encodedPayload, $this->isPayloadDetached); - foreach ($this->signatures as $signature) { - /** @var MacAlgorithm|SignatureAlgorithm $algorithm */ - $algorithm = $signature['signature_algorithm']; - /** @var JWK $signatureKey */ - $signatureKey = $signature['signature_key']; - /** @var array $protectedHeader */ - $protectedHeader = $signature['protected_header']; - /** @var array $header */ - $header = $signature['header']; - $encodedProtectedHeader = 0 === count($protectedHeader) ? null : Base64Url::encode(JsonConverter::encode($protectedHeader)); - $input = sprintf('%s.%s', $encodedProtectedHeader, $encodedPayload); - if ($algorithm instanceof SignatureAlgorithm) { - $s = $algorithm->sign($signatureKey, $input); - } else { - $s = $algorithm->hash($signatureKey, $input); - } - $jws = $jws->addSignature($s, $protectedHeader, $encodedProtectedHeader, $header); - } - - return $jws; - } - - private function checkIfPayloadIsEncoded(array $protectedHeader): bool - { - return !array_key_exists('b64', $protectedHeader) || true === $protectedHeader['b64']; - } - - /** - * @throws LogicException if the header parameter "crit" is missing, invalid or does not contain "b64" when "b64" is set - */ - private function checkB64AndCriticalHeader(array $protectedHeader): void - { - if (!array_key_exists('b64', $protectedHeader)) { - return; - } - if (!array_key_exists('crit', $protectedHeader)) { - throw new LogicException('The protected header parameter "crit" is mandatory when protected header parameter "b64" is set.'); - } - if (!is_array($protectedHeader['crit'])) { - throw new LogicException('The protected header parameter "crit" must be an array.'); - } - if (!in_array('b64', $protectedHeader['crit'], true)) { - throw new LogicException('The protected header parameter "crit" must contain "b64" when protected header parameter "b64" is set.'); - } - } - - /** - * @throws InvalidArgumentException if the header parameter "alg" is missing or the algorithm is not allowed/not supported - * - * @return MacAlgorithm|SignatureAlgorithm - */ - private function findSignatureAlgorithm(JWK $key, array $protectedHeader, array $header): Algorithm - { - $completeHeader = array_merge($header, $protectedHeader); - if (!array_key_exists('alg', $completeHeader)) { - throw new InvalidArgumentException('No "alg" parameter set in the header.'); - } - if ($key->has('alg') && $key->get('alg') !== $completeHeader['alg']) { - throw new InvalidArgumentException(sprintf('The algorithm "%s" is not allowed with this key.', $completeHeader['alg'])); - } - - $algorithm = $this->signatureAlgorithmManager->get($completeHeader['alg']); - if (!$algorithm instanceof SignatureAlgorithm && !$algorithm instanceof MacAlgorithm) { - throw new InvalidArgumentException(sprintf('The algorithm "%s" is not supported.', $completeHeader['alg'])); - } - - return $algorithm; - } - - /** - * @throws InvalidArgumentException if the header contains duplicated entries - */ - private function checkDuplicatedHeaderParameters(array $header1, array $header2): void - { - $inter = array_intersect_key($header1, $header2); - if (0 !== count($inter)) { - throw new InvalidArgumentException(sprintf('The header contains duplicated entries: %s.', implode(', ', array_keys($inter)))); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSBuilderFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSBuilderFactory.php deleted file mode 100644 index dbdf115a..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSBuilderFactory.php +++ /dev/null @@ -1,41 +0,0 @@ -signatureAlgorithmManagerFactory = $signatureAlgorithmManagerFactory; - } - - /** - * This method creates a JWSBuilder using the given algorithm aliases. - * - * @param string[] $algorithms - */ - public function create(array $algorithms): JWSBuilder - { - $algorithmManager = $this->signatureAlgorithmManagerFactory->create($algorithms); - - return new JWSBuilder($algorithmManager); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSLoader.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSLoader.php deleted file mode 100644 index f19b449e..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSLoader.php +++ /dev/null @@ -1,124 +0,0 @@ -serializerManager = $serializerManager; - $this->jwsVerifier = $jwsVerifier; - $this->headerCheckerManager = $headerCheckerManager; - } - - /** - * Returns the JWSVerifier associated to the JWSLoader. - */ - public function getJwsVerifier(): JWSVerifier - { - return $this->jwsVerifier; - } - - /** - * Returns the Header Checker Manager associated to the JWSLoader. - */ - public function getHeaderCheckerManager(): ?HeaderCheckerManager - { - return $this->headerCheckerManager; - } - - /** - * Returns the JWSSerializer associated to the JWSLoader. - */ - public function getSerializerManager(): JWSSerializerManager - { - return $this->serializerManager; - } - - /** - * This method will try to load and verify the token using the given key. - * It returns a JWS and will populate the $signature variable in case of success, otherwise an exception is thrown. - * - * @throws Exception if the token cannot be loaded or verified - */ - public function loadAndVerifyWithKey(string $token, JWK $key, ?int &$signature, ?string $payload = null): JWS - { - $keyset = new JWKSet([$key]); - - return $this->loadAndVerifyWithKeySet($token, $keyset, $signature, $payload); - } - - /** - * This method will try to load and verify the token using the given key set. - * It returns a JWS and will populate the $signature variable in case of success, otherwise an exception is thrown. - * - * @throws Exception if the token cannot be loaded or verified - */ - public function loadAndVerifyWithKeySet(string $token, JWKSet $keyset, ?int &$signature, ?string $payload = null): JWS - { - try { - $jws = $this->serializerManager->unserialize($token); - $nbSignatures = $jws->countSignatures(); - for ($i = 0; $i < $nbSignatures; ++$i) { - if ($this->processSignature($jws, $keyset, $i, $payload)) { - $signature = $i; - - return $jws; - } - } - } catch (Throwable $e) { - // Nothing to do. Exception thrown just after - } - - throw new Exception('Unable to load and verify the token.'); - } - - private function processSignature(JWS $jws, JWKSet $keyset, int $signature, ?string $payload): bool - { - try { - if (null !== $this->headerCheckerManager) { - $this->headerCheckerManager->check($jws, $signature); - } - - return $this->jwsVerifier->verifyWithKeySet($jws, $keyset, $signature, $payload); - } catch (Throwable $e) { - return false; - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSLoaderFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSLoaderFactory.php deleted file mode 100644 index 8f29650c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSLoaderFactory.php +++ /dev/null @@ -1,59 +0,0 @@ -jwsSerializerManagerFactory = $jwsSerializerManagerFactory; - $this->jwsVerifierFactory = $jwsVerifierFactory; - $this->headerCheckerManagerFactory = $headerCheckerManagerFactory; - } - - /** - * Creates a JWSLoader using the given serializer aliases, signature algorithm aliases and (optionally) - * the header checker aliases. - */ - public function create(array $serializers, array $algorithms, array $headerCheckers = []): JWSLoader - { - $serializerManager = $this->jwsSerializerManagerFactory->create($serializers); - $jwsVerifier = $this->jwsVerifierFactory->create($algorithms); - if (null !== $this->headerCheckerManagerFactory) { - $headerCheckerManager = $this->headerCheckerManagerFactory->create($headerCheckers); - } else { - $headerCheckerManager = null; - } - - return new JWSLoader($serializerManager, $jwsVerifier, $headerCheckerManager); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSTokenSupport.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSTokenSupport.php deleted file mode 100644 index f2f586f3..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSTokenSupport.php +++ /dev/null @@ -1,42 +0,0 @@ - $jwt->countSignatures()) { - throw new InvalidArgumentException('Unknown signature index.'); - } - $protectedHeader = $jwt->getSignature($index)->getProtectedHeader(); - $unprotectedHeader = $jwt->getSignature($index)->getHeader(); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSVerifier.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSVerifier.php deleted file mode 100644 index 42d12a66..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSVerifier.php +++ /dev/null @@ -1,170 +0,0 @@ -signatureAlgorithmManager = $signatureAlgorithmManager; - } - - /** - * Returns the algorithm manager associated to the JWSVerifier. - */ - public function getSignatureAlgorithmManager(): AlgorithmManager - { - return $this->signatureAlgorithmManager; - } - - /** - * This method will try to verify the JWS object using the given key and for the given signature. - * It returns true if the signature is verified, otherwise false. - * - * @return bool true if the verification of the signature succeeded, else false - */ - public function verifyWithKey(JWS $jws, JWK $jwk, int $signature, ?string $detachedPayload = null): bool - { - $jwkset = new JWKSet([$jwk]); - - return $this->verifyWithKeySet($jws, $jwkset, $signature, $detachedPayload); - } - - /** - * This method will try to verify the JWS object using the given key set and for the given signature. - * It returns true if the signature is verified, otherwise false. - * - * @param JWS $jws A JWS object - * @param JWKSet $jwkset The signature will be verified using keys in the key set - * @param JWK $jwk The key used to verify the signature in case of success - * @param null|string $detachedPayload If not null, the value must be the detached payload encoded in Base64 URL safe. If the input contains a payload, throws an exception. - * - * @throws InvalidArgumentException if there is no key in the keyset - * @throws InvalidArgumentException if the token does not contain any signature - * - * @return bool true if the verification of the signature succeeded, else false - */ - public function verifyWithKeySet(JWS $jws, JWKSet $jwkset, int $signatureIndex, ?string $detachedPayload = null, JWK &$jwk = null): bool - { - if (0 === $jwkset->count()) { - throw new InvalidArgumentException('There is no key in the key set.'); - } - if (0 === $jws->countSignatures()) { - throw new InvalidArgumentException('The JWS does not contain any signature.'); - } - $this->checkPayload($jws, $detachedPayload); - $signature = $jws->getSignature($signatureIndex); - - return $this->verifySignature($jws, $jwkset, $signature, $detachedPayload, $jwk); - } - - private function verifySignature(JWS $jws, JWKSet $jwkset, Signature $signature, ?string $detachedPayload = null, JWK &$successJwk = null): bool - { - $input = $this->getInputToVerify($jws, $signature, $detachedPayload); - $algorithm = $this->getAlgorithm($signature); - foreach ($jwkset->all() as $jwk) { - try { - KeyChecker::checkKeyUsage($jwk, 'verification'); - KeyChecker::checkKeyAlgorithm($jwk, $algorithm->name()); - if (true === $algorithm->verify($jwk, $input, $signature->getSignature())) { - $successJwk = $jwk; - - return true; - } - } catch (Throwable $e) { - //We do nothing, we continue with other keys - continue; - } - } - - return false; - } - - private function getInputToVerify(JWS $jws, Signature $signature, ?string $detachedPayload): string - { - $isPayloadEmpty = $this->isPayloadEmpty($jws->getPayload()); - $encodedProtectedHeader = $signature->getEncodedProtectedHeader(); - if (!$signature->hasProtectedHeaderParameter('b64') || true === $signature->getProtectedHeaderParameter('b64')) { - if (null !== $jws->getEncodedPayload()) { - return sprintf('%s.%s', $encodedProtectedHeader, $jws->getEncodedPayload()); - } - - $payload = $isPayloadEmpty ? $detachedPayload : $jws->getPayload(); - - return sprintf('%s.%s', $encodedProtectedHeader, Base64Url::encode($payload)); - } - - $payload = $isPayloadEmpty ? $detachedPayload : $jws->getPayload(); - - return sprintf('%s.%s', $encodedProtectedHeader, $payload); - } - - /** - * @throws InvalidArgumentException if the payload is set when a detached payload is provided or no payload is defined - */ - private function checkPayload(JWS $jws, ?string $detachedPayload = null): void - { - $isPayloadEmpty = $this->isPayloadEmpty($jws->getPayload()); - if (null !== $detachedPayload && !$isPayloadEmpty) { - throw new InvalidArgumentException('A detached payload is set, but the JWS already has a payload.'); - } - if ($isPayloadEmpty && null === $detachedPayload) { - throw new InvalidArgumentException('The JWS has a detached payload, but no payload is provided.'); - } - } - - /** - * @throws InvalidArgumentException if the header parameter "alg" is missing or invalid - * - * @return MacAlgorithm|SignatureAlgorithm - */ - private function getAlgorithm(Signature $signature): Algorithm - { - $completeHeader = array_merge($signature->getProtectedHeader(), $signature->getHeader()); - if (!isset($completeHeader['alg'])) { - throw new InvalidArgumentException('No "alg" parameter set in the header.'); - } - - $algorithm = $this->signatureAlgorithmManager->get($completeHeader['alg']); - if (!$algorithm instanceof SignatureAlgorithm && !$algorithm instanceof MacAlgorithm) { - throw new InvalidArgumentException(sprintf('The algorithm "%s" is not supported or is not a signature or MAC algorithm.', $completeHeader['alg'])); - } - - return $algorithm; - } - - private function isPayloadEmpty(?string $payload): bool - { - return null === $payload || '' === $payload; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSVerifierFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSVerifierFactory.php deleted file mode 100644 index 67a65e84..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/JWSVerifierFactory.php +++ /dev/null @@ -1,41 +0,0 @@ -algorithmManagerFactory = $algorithmManagerFactory; - } - - /** - * Creates a JWSVerifier using the given signature algorithm aliases. - * - * @param string[] $algorithms - */ - public function create(array $algorithms): JWSVerifier - { - $algorithmManager = $this->algorithmManagerFactory->create($algorithms); - - return new JWSVerifier($algorithmManager); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/LICENSE b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/LICENSE deleted file mode 100644 index 37cf976b..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -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/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/README.md b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/README.md deleted file mode 100644 index 26f0befc..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/README.md +++ /dev/null @@ -1,15 +0,0 @@ -PHP JWT Signature Component -=========================== - -This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is READ ONLY. - -**Please do not submit any Pull Request here.** -You should go to [the main repository](https://github.com/web-token/jwt-framework) instead. - -# Documentation - -The official documentation is available as https://web-token.spomky-labs.com/ - -# Licence - -This software is release under [MIT licence](LICENSE). diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/CompactSerializer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/CompactSerializer.php deleted file mode 100644 index a4bdab26..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/CompactSerializer.php +++ /dev/null @@ -1,96 +0,0 @@ -getSignature($signatureIndex); - if (0 !== count($signature->getHeader())) { - throw new LogicException('The signature contains unprotected header parameters and cannot be converted into compact JSON.'); - } - $isEmptyPayload = null === $jws->getEncodedPayload() || '' === $jws->getEncodedPayload(); - if (!$this->isPayloadEncoded($signature->getProtectedHeader()) && !$isEmptyPayload) { - if (1 !== preg_match('/^[\x{20}-\x{2d}|\x{2f}-\x{7e}]*$/u', $jws->getPayload())) { - throw new LogicException('Unable to convert the JWS with non-encoded payload.'); - } - } - - return sprintf( - '%s.%s.%s', - $signature->getEncodedProtectedHeader(), - $jws->getEncodedPayload(), - Base64Url::encode($signature->getSignature()) - ); - } - - /** - * @throws InvalidArgumentException if the input is invalid - */ - public function unserialize(string $input): JWS - { - $parts = explode('.', $input); - if (3 !== count($parts)) { - throw new InvalidArgumentException('Unsupported input'); - } - - try { - $encodedProtectedHeader = $parts[0]; - $protectedHeader = JsonConverter::decode(Base64Url::decode($parts[0])); - $hasPayload = '' !== $parts[1]; - if (!$hasPayload) { - $payload = null; - $encodedPayload = null; - } else { - $encodedPayload = $parts[1]; - $payload = $this->isPayloadEncoded($protectedHeader) ? Base64Url::decode($encodedPayload) : $encodedPayload; - } - $signature = Base64Url::decode($parts[2]); - - $jws = new JWS($payload, $encodedPayload, !$hasPayload); - - return $jws->addSignature($signature, $protectedHeader, $encodedProtectedHeader); - } catch (Throwable $throwable) { - throw new InvalidArgumentException('Unsupported input', $throwable->getCode(), $throwable); - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JSONFlattenedSerializer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JSONFlattenedSerializer.php deleted file mode 100644 index 0d4f54ec..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JSONFlattenedSerializer.php +++ /dev/null @@ -1,110 +0,0 @@ -getSignature($signatureIndex); - - $data = []; - $values = [ - 'payload' => $jws->getEncodedPayload(), - 'protected' => $signature->getEncodedProtectedHeader(), - 'header' => $signature->getHeader(), - ]; - $encodedPayload = $jws->getEncodedPayload(); - if (null !== $encodedPayload && '' !== $encodedPayload) { - $data['payload'] = $encodedPayload; - } - $encodedProtectedHeader = $signature->getEncodedProtectedHeader(); - if (null !== $encodedProtectedHeader && '' !== $encodedProtectedHeader) { - $data['protected'] = $encodedProtectedHeader; - } - $header = $signature->getHeader(); - if (0 !== count($header)) { - $data['header'] = $header; - } - $data['signature'] = Base64Url::encode($signature->getSignature()); - - return JsonConverter::encode($data); - } - - /** - * @throws InvalidArgumentException if the input is not supported - * @throws InvalidArgumentException if the JWS header is invalid - */ - public function unserialize(string $input): JWS - { - $data = JsonConverter::decode($input); - if (!is_array($data)) { - throw new InvalidArgumentException('Unsupported input.'); - } - if (!isset($data['signature'])) { - throw new InvalidArgumentException('Unsupported input.'); - } - $signature = Base64Url::decode($data['signature']); - - if (isset($data['protected'])) { - $encodedProtectedHeader = $data['protected']; - $protectedHeader = JsonConverter::decode(Base64Url::decode($data['protected'])); - } else { - $encodedProtectedHeader = null; - $protectedHeader = []; - } - if (isset($data['header'])) { - if (!is_array($data['header'])) { - throw new InvalidArgumentException('Bad header.'); - } - $header = $data['header']; - } else { - $header = []; - } - - if (isset($data['payload'])) { - $encodedPayload = $data['payload']; - $payload = $this->isPayloadEncoded($protectedHeader) ? Base64Url::decode($encodedPayload) : $encodedPayload; - } else { - $payload = null; - $encodedPayload = null; - } - - $jws = new JWS($payload, $encodedPayload, null === $encodedPayload); - - return $jws->addSignature($signature, $protectedHeader, $encodedProtectedHeader, $header); - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JSONGeneralSerializer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JSONGeneralSerializer.php deleted file mode 100644 index 1a88bab1..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JSONGeneralSerializer.php +++ /dev/null @@ -1,167 +0,0 @@ -countSignatures()) { - throw new LogicException('No signature.'); - } - - $data = []; - $this->checkPayloadEncoding($jws); - - if (false === $jws->isPayloadDetached()) { - $data['payload'] = $jws->getEncodedPayload(); - } - - $data['signatures'] = []; - foreach ($jws->getSignatures() as $signature) { - $tmp = ['signature' => Base64Url::encode($signature->getSignature())]; - $values = [ - 'protected' => $signature->getEncodedProtectedHeader(), - 'header' => $signature->getHeader(), - ]; - - foreach ($values as $key => $value) { - if ((is_string($value) && '' !== $value) || (is_array($value) && 0 !== count($value))) { - $tmp[$key] = $value; - } - } - $data['signatures'][] = $tmp; - } - - return JsonConverter::encode($data); - } - - /** - * @throws InvalidArgumentException if the input is not supported - */ - public function unserialize(string $input): JWS - { - $data = JsonConverter::decode($input); - if (!isset($data['signatures'])) { - throw new InvalidArgumentException('Unsupported input.'); - } - - $isPayloadEncoded = null; - $rawPayload = $data['payload'] ?? null; - $signatures = []; - foreach ($data['signatures'] as $signature) { - if (!isset($signature['signature'])) { - throw new InvalidArgumentException('Unsupported input.'); - } - [$encodedProtectedHeader, $protectedHeader, $header] = $this->processHeaders($signature); - $signatures[] = [ - 'signature' => Base64Url::decode($signature['signature']), - 'protected' => $protectedHeader, - 'encoded_protected' => $encodedProtectedHeader, - 'header' => $header, - ]; - $isPayloadEncoded = $this->processIsPayloadEncoded($isPayloadEncoded, $protectedHeader); - } - - $payload = $this->processPayload($rawPayload, $isPayloadEncoded); - $jws = new JWS($payload, $rawPayload); - foreach ($signatures as $signature) { - $jws = $jws->addSignature( - $signature['signature'], - $signature['protected'], - $signature['encoded_protected'], - $signature['header'] - ); - } - - return $jws; - } - - /** - * @throws InvalidArgumentException if the payload encoding is invalid - */ - private function processIsPayloadEncoded(?bool $isPayloadEncoded, array $protectedHeader): bool - { - if (null === $isPayloadEncoded) { - return $this->isPayloadEncoded($protectedHeader); - } - if ($this->isPayloadEncoded($protectedHeader) !== $isPayloadEncoded) { - throw new InvalidArgumentException('Foreign payload encoding detected.'); - } - - return $isPayloadEncoded; - } - - private function processHeaders(array $signature): array - { - $encodedProtectedHeader = $signature['protected'] ?? null; - $protectedHeader = null === $encodedProtectedHeader ? [] : JsonConverter::decode(Base64Url::decode($encodedProtectedHeader)); - $header = array_key_exists('header', $signature) ? $signature['header'] : []; - - return [$encodedProtectedHeader, $protectedHeader, $header]; - } - - private function processPayload(?string $rawPayload, ?bool $isPayloadEncoded): ?string - { - if (null === $rawPayload) { - return null; - } - - return false === $isPayloadEncoded ? $rawPayload : Base64Url::decode($rawPayload); - } - - // @throws LogicException if the payload encoding is invalid - private function checkPayloadEncoding(JWS $jws): void - { - if ($jws->isPayloadDetached()) { - return; - } - $is_encoded = null; - foreach ($jws->getSignatures() as $signature) { - if (null === $is_encoded) { - $is_encoded = $this->isPayloadEncoded($signature->getProtectedHeader()); - } - if (false === $jws->isPayloadDetached()) { - if ($is_encoded !== $this->isPayloadEncoded($signature->getProtectedHeader())) { - throw new LogicException('Foreign payload encoding detected.'); - } - } - } - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JWSSerializer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JWSSerializer.php deleted file mode 100644 index c2edd373..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JWSSerializer.php +++ /dev/null @@ -1,38 +0,0 @@ -add($serializer); - } - } - - /** - * @return string[] - */ - public function list(): array - { - return array_keys($this->serializers); - } - - /** - * Converts a JWS into a string. - * - * @throws InvalidArgumentException if the serializer is not supported - */ - public function serialize(string $name, JWS $jws, ?int $signatureIndex = null): string - { - if (!isset($this->serializers[$name])) { - throw new InvalidArgumentException(sprintf('Unsupported serializer "%s".', $name)); - } - - return $this->serializers[$name]->serialize($jws, $signatureIndex); - } - - /** - * Loads data and return a JWS object. - * - * @param string $input A string that represents a JWS - * @param null|string $name the name of the serializer if the input is unserialized - * - * @throws InvalidArgumentException if the input is not supported - */ - public function unserialize(string $input, ?string &$name = null): JWS - { - foreach ($this->serializers as $serializer) { - try { - $jws = $serializer->unserialize($input); - $name = $serializer->name(); - - return $jws; - } catch (InvalidArgumentException $e) { - continue; - } - } - - throw new InvalidArgumentException('Unsupported input.'); - } - - private function add(JWSSerializer $serializer): void - { - $this->serializers[$serializer->name()] = $serializer; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JWSSerializerManagerFactory.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JWSSerializerManagerFactory.php deleted file mode 100644 index 7e346eed..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/JWSSerializerManagerFactory.php +++ /dev/null @@ -1,63 +0,0 @@ -serializers[$name])) { - throw new InvalidArgumentException(sprintf('Unsupported serializer "%s".', $name)); - } - $serializers[] = $this->serializers[$name]; - } - - return new JWSSerializerManager($serializers); - } - - /** - * @return string[] - */ - public function names(): array - { - return array_keys($this->serializers); - } - - /** - * @return JWSSerializer[] - */ - public function all(): array - { - return $this->serializers; - } - - public function add(JWSSerializer $serializer): void - { - $this->serializers[$serializer->name()] = $serializer; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/Serializer.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/Serializer.php deleted file mode 100644 index 48a11477..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/Serializer/Serializer.php +++ /dev/null @@ -1,24 +0,0 @@ -protectedHeader = null === $encodedProtectedHeader ? [] : $protectedHeader; - $this->encodedProtectedHeader = $encodedProtectedHeader; - $this->signature = $signature; - $this->header = $header; - } - - /** - * The protected header associated with the signature. - */ - public function getProtectedHeader(): array - { - return $this->protectedHeader; - } - - /** - * The unprotected header associated with the signature. - */ - public function getHeader(): array - { - return $this->header; - } - - /** - * The protected header associated with the signature. - */ - public function getEncodedProtectedHeader(): ?string - { - return $this->encodedProtectedHeader; - } - - /** - * Returns the value of the protected header of the specified key. - * - * @param string $key The key - * - * @throws InvalidArgumentException if the header parameter does not exist - * - * @return null|mixed Header value - */ - public function getProtectedHeaderParameter(string $key) - { - if ($this->hasProtectedHeaderParameter($key)) { - return $this->getProtectedHeader()[$key]; - } - - throw new InvalidArgumentException(sprintf('The protected header "%s" does not exist', $key)); - } - - /** - * Returns true if the protected header has the given parameter. - * - * @param string $key The key - */ - public function hasProtectedHeaderParameter(string $key): bool - { - return array_key_exists($key, $this->getProtectedHeader()); - } - - /** - * Returns the value of the unprotected header of the specified key. - * - * @param string $key The key - * - * @return null|mixed Header value - */ - public function getHeaderParameter(string $key) - { - if ($this->hasHeaderParameter($key)) { - return $this->header[$key]; - } - - throw new InvalidArgumentException(sprintf('The header "%s" does not exist', $key)); - } - - /** - * Returns true if the unprotected header has the given parameter. - * - * @param string $key The key - */ - public function hasHeaderParameter(string $key): bool - { - return array_key_exists($key, $this->header); - } - - /** - * Returns the value of the signature. - */ - public function getSignature(): string - { - return $this->signature; - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/composer.json b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/composer.json deleted file mode 100644 index 92508bf7..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn-vendor/web-token/jwt-signature/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "web-token/jwt-signature", - "description": "Signature component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": ["JWS", "JWT", "JWE", "JWA", "JWK", "JWKSet", "Jot", "Jose", "RFC7515", "RFC7516", "RFC7517", "RFC7518", "RFC7519", "RFC7520", "Bundle", "Symfony"], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - },{ - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-signature/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\": "" - } - }, - "require": { - "web-token/jwt-core": "^2.1" - }, - "suggest": { - "web-token/jwt-signature-algorithm-ecdsa": "ECDSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-eddsa": "EdDSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-hmac": "HMAC Based Signature Algorithms", - "web-token/jwt-signature-algorithm-none": "None Signature Algorithm", - "web-token/jwt-signature-algorithm-rsa": "RSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-experimental": "Experimental Signature Algorithms" - } -} diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn.php deleted file mode 100644 index cfeabab8..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wp-webauthn.php +++ /dev/null @@ -1,86 +0,0 @@ - '{}', - 'user_credentials_meta' => '{}', - 'user_id' => array(), - 'first_choice' => 'true', - 'website_name' => get_bloginfo('name'), - 'website_domain' => $site_domain === NULL ? "" : $site_domain, - 'remember_me' => 'false', - 'email_login' => 'false', - 'user_verification' => 'false', - 'usernameless_login' => 'false', - 'allow_authenticator_type' => 'none', - 'password_reset' => 'off', - 'after_user_registration' => 'none', - 'logging' => 'false' - ); - update_option('wwa_options', $wwa_init_options); - include('wwa-version.php'); - update_option('wwa_version', $wwa_version); - update_option('wwa_log', array()); - update_option('wwa_init', md5(date('Y-m-d H:i:s'))); - }else{ - include('wwa-version.php'); - if(!get_option('wwa_version') || get_option('wwa_version')['version'] != $wwa_version['version']){ - update_option('wwa_version', $wwa_version); //update version - } - } -} - -// Wrap WP-WebAuthn settings -function wwa_get_option($option_name){ - $val = get_option('wwa_options'); - if(isset($val[$option_name])){ - return $val[$option_name]; - }else{ - return false; - } -} - -function wwa_update_option($option_name, $option_value){ - $options = get_option('wwa_options'); - $options[$option_name] = $option_value; - update_option('wwa_options',$options); - return true; -} - -include('wwa-menus.php'); -include('wwa-functions.php'); -include('wwa-ajax.php'); -include('wwa-shortcodes.php'); -?> \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-admin-content.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-admin-content.php deleted file mode 100644 index 8053e3cb..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-admin-content.php +++ /dev/null @@ -1,321 +0,0 @@ - admin_url('admin-ajax.php'), - 'i18n_1' => __('User verification is disabled by default because some mobile devices do not support it (especially on Android devices). But we recommend you to enable it if possible to further secure your login.', 'wp-webauthn'), - 'i18n_2' => __('Log count: ', 'wp-webauthn'), - 'i18n_3' => __('Loading failed, maybe try refreshing?', 'wp-webauthn') -)); -wp_enqueue_style('wwa_admin', plugins_url('css/admin.css', __FILE__)); -?> -
          - -

          your profile.', 'wp-webauthn'), admin_url('profile.php'));?>

          - diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-ajax.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-ajax.php deleted file mode 100644 index 899a8f31..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-ajax.php +++ /dev/null @@ -1,1256 +0,0 @@ -read(); - if(isset($data[base64_encode($publicKeyCredentialId)])){ - return PublicKeyCredentialSource::createFromArray($data[base64_encode($publicKeyCredentialId)]); - } - return null; - } - - // Get one credential's meta by credential ID - public function findOneMetaByCredentialId(string $publicKeyCredentialId): ?array { - $meta = json_decode(wwa_get_option("user_credentials_meta"), true); - if(isset($meta[base64_encode($publicKeyCredentialId)])){ - return $meta[base64_encode($publicKeyCredentialId)]; - } - return null; - } - - // Get all credentials of one user - public function findAllForUserEntity(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity): array { - $sources = []; - foreach($this->read() as $data){ - $source = PublicKeyCredentialSource::createFromArray($data); - if($source->getUserHandle() === $publicKeyCredentialUserEntity->getId()){ - $sources[] = $source; - } - } - return $sources; - } - - public function findCredentialsForUserEntityByType(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity, string $credentialType): array { - $credentialsForUserEntity = $this->findAllForUserEntity($publicKeyCredentialUserEntity); - $credentialsByType = []; - foreach($credentialsForUserEntity as $credential){ - if($this->findOneMetaByCredentialId($credential->getPublicKeyCredentialId())["authenticator_type"] === $credentialType){ - $credentialsByType[] = $credential; - } - } - return $credentialsByType; - } - - // Save credential into database - public function saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource, bool $usernameless = false): void { - $data = $this->read(); - $data_key = base64_encode($publicKeyCredentialSource->getPublicKeyCredentialId()); - $data[$data_key] = $publicKeyCredentialSource; - $this->write($data, $data_key, $usernameless); - } - - // Update credential's last used - public function updateCredentialLastUsed(string $publicKeyCredentialId): void { - $credential = $this->findOneMetaByCredentialId($publicKeyCredentialId); - if($credential !== null){ - $credential["last_used"] = date('Y-m-d H:i:s', current_time('timestamp')); - $meta = json_decode(wwa_get_option("user_credentials_meta"), true); - $meta[base64_encode($publicKeyCredentialId)] = $credential; - wwa_update_option("user_credentials_meta", json_encode($meta)); - } - } - - // List all authenticators - public function getShowList(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity): array { - $data = json_decode(wwa_get_option("user_credentials_meta"), true); - $arr = array(); - $user_id = $publicKeyCredentialUserEntity->getId(); - foreach($data as $key => $value){ - if($user_id === $value["user"]){ - array_push($arr, array( - "key" => rtrim(strtr(base64_encode($key), '+/', '-_'), '='), - "name" => base64_decode($value["human_name"]), - "type" => $value["authenticator_type"], - "added" => $value["added"], - "usernameless" => isset($value["usernameless"]) ? $value["usernameless"] : false, - "last_used" => isset($value["last_used"]) ? $value["last_used"] : "-" - )); - } - } - return array_map(function($item){return array("key" => $item["key"], "name" => $item["name"], "type" => $item["type"], "added" => $item["added"], "usernameless" => $item["usernameless"], "last_used" => $item["last_used"]);}, $arr); - } - - // Modify an authenticator - public function modifyAuthenticator(string $id, string $name, PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity, string $action, string $res_id): string { - $keys = $this->findAllForUserEntity($publicKeyCredentialUserEntity); - $user_id = $publicKeyCredentialUserEntity->getId(); - - // Check if the user has the authenticator - foreach($keys as $item){ - if($item->getUserHandle() === $user_id){ - if(base64_encode($item->getPublicKeyCredentialId()) === base64_decode(str_pad(strtr($id, '-_', '+/'), strlen($id) % 4, '=', STR_PAD_RIGHT))){ - if($action === "rename"){ - $this->renameCredential(base64_encode($item->getPublicKeyCredentialId()), $name, $res_id); - }else if($action === "remove"){ - $this->removeCredential(base64_encode($item->getPublicKeyCredentialId()), $res_id); - } - wwa_add_log($res_id, "ajax_modify_authenticator: Done"); - return "true"; - } - } - } - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Authenticator not found, exit"); - return "Not Found."; - } - - // Rename a credential from database by credential ID - private function renameCredential(string $id, string $name, string $res_id): void { - $meta = json_decode(wwa_get_option("user_credentials_meta"), true); - wwa_add_log($res_id, "ajax_modify_authenticator: Rename \"".base64_decode($meta[$id]["human_name"])."\" -> \"".$name."\""); - $meta[$id]["human_name"] = base64_encode($name); - wwa_update_option("user_credentials_meta", json_encode($meta)); - } - - // Remove a credential from database by credential ID - private function removeCredential(string $id, string $res_id): void { - $data = $this->read(); - unset($data[$id]); - $this->write($data, ''); - $meta = json_decode(wwa_get_option("user_credentials_meta"), true); - wwa_add_log($res_id, "ajax_modify_authenticator: Remove \"".base64_decode($meta[$id]["human_name"])."\""); - unset($meta[$id]); - wwa_update_option("user_credentials_meta", json_encode($meta)); - } - - // Read credential database - private function read(): array { - if(wwa_get_option("user_credentials") !== NULL){ - try{ - return json_decode(wwa_get_option("user_credentials"), true); - }catch(\Throwable $exception) { - return []; - } - } - return []; - } - - // Save credentials data - private function write(array $data, string $key, bool $usernameless = false): void { - if(isset($_POST["type"]) && ($_POST["type"] === "platform" || $_POST["type"] == "cross-platform" || $_POST["type"] === "none") && $key !== ''){ - // Save credentials's meta separately - $source = $data[$key]->getUserHandle(); - $meta = json_decode(wwa_get_option("user_credentials_meta"), true); - $meta[$key] = array("human_name" => base64_encode(sanitize_text_field($_POST["name"])), "added" => date('Y-m-d H:i:s', current_time('timestamp')), "authenticator_type" => $_POST["type"], "user" => $source, "usernameless" => $usernameless, "last_used" => "-"); - wwa_update_option("user_credentials_meta", json_encode($meta)); - } - wwa_update_option("user_credentials", json_encode($data)); - } -} - -// Bind an authenticator -function wwa_ajax_create(){ - try{ - $res_id = wwa_generate_random_string(5); - $client_id = strval(time()).wwa_generate_random_string(24); - - wwa_init_new_options(); - - wwa_add_log($res_id, "ajax_create: Start"); - - if(!current_user_can("read")){ - wwa_add_log($res_id, "ajax_create: (ERROR)Permission denied, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } - - if(wwa_get_option("website_name") === "" || wwa_get_option('website_domain') ===""){ - wwa_add_log($res_id, "ajax_create: (ERROR)Plugin not configured, exit"); - wwa_wp_die("Not configured.", $client_id); - } - - // Check queries - if(!isset($_GET["name"]) || !isset($_GET["type"]) || !isset($_GET["usernameless"])){ - wwa_add_log($res_id, "ajax_create: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - }else{ - // Sanitize the input - $wwa_get = array(); - $wwa_get["name"] = sanitize_text_field($_GET["name"]); - $wwa_get["type"] = sanitize_text_field($_GET["type"]); - $wwa_get["usernameless"] = sanitize_text_field($_GET["usernameless"]); - wwa_add_log($res_id, "ajax_create: name => \"".$wwa_get["name"]."\", type => \"".$wwa_get["type"]."\", usernameless => \"".$wwa_get["usernameless"]."\""); - } - - $user_info = wp_get_current_user(); - - if(isset($_GET["user_id"])){ - $user_id = intval(sanitize_text_field($_GET["user_id"])); - if($user_id <= 0){ - wwa_add_log($res_id, "ajax_create: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request."); - } - - if($user_info->ID !== $user_id){ - if(!current_user_can("edit_user", $user_id)){ - wwa_add_log($res_id, "ajax_create: (ERROR)No permission, exit"); - wwa_wp_die("Something went wrong."); - } - $user_info = get_user_by('id', $user_id); - - if($user_info === false){ - wwa_add_log($res_id, "ajax_create: (ERROR)Wrong user ID, exit"); - wwa_wp_die("Something went wrong."); - } - } - } - - // Empty authenticator name - if($wwa_get["name"] === ""){ - wwa_add_log($res_id, "ajax_create: (ERROR)Empty name, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - - // Usernameless authentication not allowed - if($wwa_get["usernameless"] === "true" && wwa_get_option("usernameless_login") !== "true"){ - wwa_add_log($res_id, "ajax_create: (ERROR)Usernameless authentication not allowed, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - - // Check authenticator type - $allow_authenticator_type = wwa_get_option("allow_authenticator_type"); - if($allow_authenticator_type !== false && $allow_authenticator_type !== "none"){ - if($allow_authenticator_type != $wwa_get["type"]){ - wwa_add_log($res_id, "ajax_create: (ERROR)Credential type error, type => \"".$wwa_get["type"]."\", allow_authenticator_type => \"".$allow_authenticator_type."\", exit"); - wwa_wp_die("Bad Request.", $client_id); - } - } - - $rpEntity = new PublicKeyCredentialRpEntity( - wwa_get_option("website_name"), - wwa_get_option("website_domain") - ); - $publicKeyCredentialSourceRepository = new PublicKeyCredentialSourceRepository(); - - $server = new Server( - $rpEntity, - $publicKeyCredentialSourceRepository, - null - ); - - wwa_add_log($res_id, "ajax_create: user => \"".$user_info->user_login."\""); - - // Get user ID or create one - $user_key = ""; - if(!isset(wwa_get_option("user_id")[$user_info->user_login])){ - wwa_add_log($res_id, "ajax_create: User not initialized, initialize"); - $user_array = wwa_get_option("user_id"); - $user_key = hash("sha256", $user_info->user_login."-".$user_info->display_name."-".wwa_generate_random_string(10)); - $user_array[$user_info->user_login] = $user_key; - wwa_update_option("user_id", $user_array); - }else{ - $user_key = wwa_get_option("user_id")[$user_info->user_login]; - } - - $user = array( - "login" => $user_info->user_login, - "id" => $user_key, - "display" => $user_info->display_name, - "icon" => get_avatar_url($user_info->user_email, array("scheme" => "https")) - ); - - $userEntity = new PublicKeyCredentialUserEntity( - $user["login"], - $user["id"], - $user["display"], - $user["icon"] - ); - - $credentialSourceRepository = new PublicKeyCredentialSourceRepository(); - - $credentialSources = $credentialSourceRepository->findAllForUserEntity($userEntity); - - // Convert the Credential Sources into Public Key Credential Descriptors for excluding - $excludeCredentials = array_map(function (PublicKeyCredentialSource $credential) { - return $credential->getPublicKeyCredentialDescriptor(); - }, $credentialSources); - - wwa_add_log($res_id, "ajax_create: excludeCredentials => ".json_encode($excludeCredentials)); - - // Set authenticator type - if($wwa_get["type"] === "platform"){ - $authenticator_type = AuthenticatorSelectionCriteria::AUTHENTICATOR_ATTACHMENT_PLATFORM; - }else if($wwa_get["type"] === "cross-platform"){ - $authenticator_type = AuthenticatorSelectionCriteria::AUTHENTICATOR_ATTACHMENT_CROSS_PLATFORM; - }else{ - $authenticator_type = AuthenticatorSelectionCriteria::AUTHENTICATOR_ATTACHMENT_NO_PREFERENCE; - } - - // Set user verification - if(wwa_get_option("user_verification") === "true"){ - wwa_add_log($res_id, "ajax_create: user_verification => \"true\""); - $user_verification = AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_REQUIRED; - }else{ - wwa_add_log($res_id, "ajax_create: user_verification => \"false\""); - $user_verification = AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_DISCOURAGED; - } - - $resident_key = false; - // Set usernameless authentication - if($wwa_get["usernameless"] === "true"){ - wwa_add_log($res_id, "ajax_create: Usernameless set, user_verification => \"true\""); - $user_verification = AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_REQUIRED; - $resident_key = true; - } - - // Create authenticator selection - $authenticatorSelectionCriteria = new AuthenticatorSelectionCriteria( - $authenticator_type, - $resident_key, - $user_verification - ); - - // Create a creation challenge - $publicKeyCredentialCreationOptions = $server->generatePublicKeyCredentialCreationOptions( - $userEntity, - PublicKeyCredentialCreationOptions::ATTESTATION_CONVEYANCE_PREFERENCE_NONE, - $excludeCredentials, - $authenticatorSelectionCriteria - ); - - // Save for future use - wwa_set_temp_val("pkcco", base64_encode(serialize($publicKeyCredentialCreationOptions)), $client_id); - wwa_set_temp_val("bind_config", array("name" => $wwa_get["name"], "type" => $wwa_get["type"], "usernameless" => $resident_key), $client_id); - - header("Content-Type: application/json"); - $publicKeyCredentialCreationOptions = json_decode(json_encode($publicKeyCredentialCreationOptions), true); - $publicKeyCredentialCreationOptions["clientID"] = $client_id; - echo json_encode($publicKeyCredentialCreationOptions); - wwa_add_log($res_id, "ajax_create: Challenge sent"); - exit; - }catch(\Exception $exception){ - wwa_add_log($res_id, "ajax_create: (ERROR)".$exception->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($exception)); - wwa_add_log($res_id, "ajax_create: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - }catch(\Error $error){ - wwa_add_log($res_id, "ajax_create: (ERROR)".$error->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($error)); - wwa_add_log($res_id, "ajax_create: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } -} -add_action("wp_ajax_wwa_create" , "wwa_ajax_create"); - -// Verify the attestation -function wwa_ajax_create_response(){ - $client_id = false; - try{ - $res_id = wwa_generate_random_string(5); - - wwa_init_new_options(); - - wwa_add_log($res_id, "ajax_create_response: Client response received"); - - if(!isset($_POST["clientid"])){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Missing parameters, exit"); - wp_die("Bad Request."); - }else{ - if(strlen($_POST["clientid"]) < 34 || strlen($_POST["clientid"]) > 35){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Wrong client ID, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - // Sanitize the input - $client_id = sanitize_text_field($_POST["clientid"]); - } - - if(!current_user_can("read")){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Permission denied, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } - - // Check POST - if(!isset($_POST["data"]) || !isset($_POST["name"]) || !isset($_POST["type"]) || !isset($_POST["usernameless"])){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - }else{ - // Sanitize the input - $wwa_post = array(); - $wwa_post["name"] = sanitize_text_field($_POST["name"]); - $wwa_post["type"] = sanitize_text_field($_POST["type"]); - $wwa_post["usernameless"] = sanitize_text_field($_POST["usernameless"]); - wwa_add_log($res_id, "ajax_create_response: name => \"".$wwa_post["name"]."\", type => \"".$wwa_post["type"]."\", usernameless => \"".$wwa_post["usernameless"]."\""); - wwa_add_log($res_id, "ajax_create_response: data => ".base64_decode($_POST["data"])); - } - - if(isset($_GET["user_id"])){ - $user_id = intval(sanitize_text_field($_POST["user_id"])); - if($user_id <= 0){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request."); - } - - if(wp_get_current_user()->ID !== $user_id){ - if(!current_user_can("edit_user", $user_id)){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)No permission, exit"); - wwa_wp_die("Something went wrong."); - } - } - } - - $temp_val = array( - "pkcco" => wwa_get_temp_val("pkcco", $client_id), - "bind_config" => wwa_get_temp_val("bind_config", $client_id) - ); - - // May not get the challenge yet - if($temp_val["pkcco"] === false || $temp_val["bind_config"] === false){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Challenge not found in transient, exit"); - wwa_wp_die("Bad request.", $client_id); - } - - // Check parameters - if($temp_val["bind_config"]["type"] !== "platform" && $temp_val["bind_config"]["type"] !== "cross-platform" && $temp_val["bind_config"]["type"] !== "none"){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Wrong type, exit"); - wwa_wp_die("Bad request.", $client_id); - } - - if($temp_val["bind_config"]["type"] !== $wwa_post["type"] || $temp_val["bind_config"]["name"] !== $wwa_post["name"]){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - - // Check global unique credential ID - $credential_id = base64_decode(json_decode(base64_decode($_POST["data"]), true)["rawId"]); - $publicKeyCredentialSourceRepository = new PublicKeyCredentialSourceRepository(); - if($publicKeyCredentialSourceRepository->findOneMetaByCredentialId($credential_id) !== null){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)Credential ID not unique, ID => \"".base64_encode($credential_id)."\" , exit"); - wwa_wp_die("Something went wrong.", $client_id); - }else{ - wwa_add_log($res_id, "ajax_create_response: Credential ID unique check passed"); - } - - $psr17Factory = new Psr17Factory(); - $creator = new ServerRequestCreator( - $psr17Factory, - $psr17Factory, - $psr17Factory, - $psr17Factory - ); - - $serverRequest = $creator->fromGlobals(); - - $rpEntity = new PublicKeyCredentialRpEntity( - wwa_get_option("website_name"), - wwa_get_option("website_domain") - ); - - $server = new Server( - $rpEntity, - $publicKeyCredentialSourceRepository, - null - ); - - // Allow to bypass scheme verification when under localhost - $current_domain = wwa_get_option('website_domain'); - if($current_domain === "localhost" || $current_domain === "127.0.0.1"){ - $server->setSecuredRelyingPartyId([$current_domain]); - wwa_add_log($res_id, "ajax_create_response: Localhost, bypass HTTPS check"); - } - - // Verify - try { - $publicKeyCredentialSource = $server->loadAndCheckAttestationResponse( - base64_decode($_POST["data"]), - unserialize(base64_decode($temp_val["pkcco"])), - $serverRequest - ); - - wwa_add_log($res_id, "ajax_create_response: Challenge verified"); - - $publicKeyCredentialSourceRepository->saveCredentialSource($publicKeyCredentialSource, $temp_val["bind_config"]["usernameless"]); - - if($temp_val["bind_config"]["usernameless"]){ - wwa_add_log($res_id, "ajax_create_response: Authenticator added with usernameless authentication feature"); - }else{ - wwa_add_log($res_id, "ajax_create_response: Authenticator added"); - } - - // Success - echo "true"; - }catch(\Throwable $exception){ - // Failed to verify - wwa_add_log($res_id, "ajax_create_response: (ERROR)".$exception->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($exception)); - wwa_add_log($res_id, "ajax_create_response: (ERROR)Challenge not verified, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } - - // Destroy transients - wwa_destroy_temp_val($client_id); - exit; - }catch(\Exception $exception){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)".$exception->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($exception)); - wwa_add_log($res_id, "ajax_create_response: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - }catch(\Error $error){ - wwa_add_log($res_id, "ajax_create_response: (ERROR)".$error->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($error)); - wwa_add_log($res_id, "ajax_create_response: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } -} -add_action("wp_ajax_wwa_create_response" , "wwa_ajax_create_response"); - -// Auth challenge -function wwa_ajax_auth_start(){ - try{ - $res_id = wwa_generate_random_string(5); - $client_id = strval(time()).wwa_generate_random_string(24); - - wwa_init_new_options(); - - wwa_add_log($res_id, "ajax_auth: Start"); - - // Check queries - if(!isset($_GET["type"])){ - wwa_add_log($res_id, "ajax_auth: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - }else{ - // Sanitize the input - $wwa_get = array(); - $wwa_get["type"] = sanitize_text_field($_GET["type"]); - if(isset($_GET["user"])){ - $wwa_get["user"] = sanitize_text_field($_GET["user"]); - } - if(isset($_GET["usernameless"])){ - $wwa_get["usernameless"] = sanitize_text_field($_GET["usernameless"]); - // Usernameless authentication not allowed - if($wwa_get["usernameless"] === "true" && wwa_get_option("usernameless_login") !== "true"){ - wwa_add_log($res_id, "ajax_auth: (ERROR)Usernameless authentication not allowed, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - } - } - - if($wwa_get["type"] === "test" && !current_user_can('read')){ - // Test but not logged in - wwa_add_log($res_id, "ajax_auth: (ERROR)Permission denied, exit"); - wwa_wp_die("Bad request.", $client_id); - } - - $user_key = ""; - $usernameless_flag = false; - $user_icon = null; - $user_exist = true; - if($wwa_get["type"] === "test"){ - if(isset($wwa_get["usernameless"])){ - if($wwa_get["usernameless"] !== "true"){ - // Logged in and testing, if the user haven't bound any authenticator yet, exit - $user_info = wp_get_current_user(); - - if(isset($_GET["user_id"])){ - $user_id = intval(sanitize_text_field($_GET["user_id"])); - if($user_id <= 0){ - wwa_add_log($res_id, "ajax_auth: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request."); - } - - if($user_info->ID !== $user_id){ - if(!current_user_can("edit_user", $user_id)){ - wwa_add_log($res_id, "ajax_auth: (ERROR)No permission, exit"); - wwa_wp_die("Something went wrong."); - } - $user_info = get_user_by('id', $user_id); - - if($user_info === false){ - wwa_add_log($res_id, "ajax_auth: (ERROR)Wrong user ID, exit"); - wwa_wp_die("Something went wrong."); - } - } - } - - wwa_add_log($res_id, "ajax_auth: type => \"test\", user => \"".$user_info->user_login."\", usernameless => \"false\""); - - if(!isset(wwa_get_option("user_id")[$user_info->user_login])){ - wwa_add_log($res_id, "ajax_auth: (ERROR)User not initialized, exit"); - wwa_wp_die("User not inited.", $client_id); - }else{ - $user_key = wwa_get_option("user_id")[$user_info->user_login]; - $user_icon = get_avatar_url($user_info->user_email, array("scheme" => "https")); - } - }else{ - if(wwa_get_option("usernameless_login") === "true"){ - wwa_add_log($res_id, "ajax_auth: type => \"test\", usernameless => \"true\""); - $usernameless_flag = true; - }else{ - wwa_add_log($res_id, "ajax_auth: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - } - }else{ - wwa_add_log($res_id, "ajax_auth: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - }else{ - // Not testing, create a fake user ID if the user does not exist or haven't bound any authenticator yet - if(isset($wwa_get["user"]) && $wwa_get["user"] !== ""){ - $wp_user = wwa_get_user($wwa_get["user"]); - if(wwa_get_option("email_login") === "true" && is_email($wwa_get["user"])){ - wwa_add_log($res_id, "ajax_auth: email_login => \"true\", trying to find user by email address \"".$wwa_get["user"]."\""); - } - if($wp_user !== false){ - $user_info = $wp_user; - $user_icon = get_avatar_url($user_info->user_email, array("scheme" => "https")); - wwa_add_log($res_id, "ajax_auth: type => \"auth\", user => \"".$user_info->user_login."\""); - if(!isset(wwa_get_option("user_id")[$user_info->user_login])){ - wwa_add_log($res_id, "ajax_auth: User not initialized, initialize"); - $user_key = hash("sha256", $wwa_get["user"]."-".$wwa_get["user"]."-".wwa_generate_random_string(10)); - $user_exist = false; - }else{ - $user_key = wwa_get_option("user_id")[$user_info->user_login]; - } - }else{ - $user_info = new stdClass(); - $user_info->user_login = $wwa_get["user"]; - $user_info->display_name = $wwa_get["user"]; - $user_key = hash("sha256", $wwa_get["user"]."-".$wwa_get["user"]."-".wwa_generate_random_string(10)); - wwa_add_log($res_id, "ajax_auth: User not exists, create a fake id"); - wwa_add_log($res_id, "ajax_auth: type => \"auth\", user => \"".$wwa_get["user"]."\""); - $user_exist = false; - } - }else{ - if(wwa_get_option("usernameless_login") === "true"){ - $usernameless_flag = true; - wwa_add_log($res_id, "ajax_auth: Empty username, try usernameless authentication"); - }else{ - wwa_add_log($res_id, "ajax_auth: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - } - } - - if(!$usernameless_flag){ - $userEntity = new PublicKeyCredentialUserEntity( - $user_info->user_login, - $user_key, - $user_info->display_name, - $user_icon - ); - } - - $credentialSourceRepository = new PublicKeyCredentialSourceRepository(); - $rpEntity = new PublicKeyCredentialRpEntity( - wwa_get_option('website_name'), - wwa_get_option('website_domain') - ); - - $server = new Server( - $rpEntity, - $credentialSourceRepository, - null - ); - - if($usernameless_flag){ - // Usernameless authentication, return empty allowed credentials list - wwa_add_log($res_id, "ajax_auth: Usernameless authentication, allowedCredentials => []"); - $allowedCredentials = array(); - }else{ - // Get the list of authenticators associated to the user - // $credentialSources = $credentialSourceRepository->findAllForUserEntity($userEntity); - $allow_authenticator_type = wwa_get_option('allow_authenticator_type'); - if($allow_authenticator_type === false || $allow_authenticator_type === 'none'){ - $credentialSources = $credentialSourceRepository->findAllForUserEntity($userEntity); - }else if($allow_authenticator_type !== false && $allow_authenticator_type !== 'none'){ - wwa_add_log($res_id, "ajax_auth: allow_authenticator_type => \"".$allow_authenticator_type."\", filter authenticators"); - $credentialSources = $credentialSourceRepository->findCredentialsForUserEntityByType($userEntity, $allow_authenticator_type); - } - - // Logged in and testing, if the user haven't bind a authenticator yet, exit - if(count($credentialSources) === 0 && $wwa_get["type"] === "test" && current_user_can('read')){ - wwa_add_log($res_id, "ajax_auth: (ERROR)No authenticator, exit"); - wwa_wp_die("User not inited.", $client_id); - } - - // Convert the Credential Sources into Public Key Credential Descriptors for excluding - $allowedCredentials = array_map(function(PublicKeyCredentialSource $credential){ - return $credential->getPublicKeyCredentialDescriptor(); - }, $credentialSources); - - wwa_add_log($res_id, "ajax_auth: allowedCredentials => ".json_encode($allowedCredentials)); - } - - // Set user verification - if(wwa_get_option("user_verification") === "true"){ - wwa_add_log($res_id, "ajax_auth: user_verification => \"true\""); - $user_verification = AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_REQUIRED; - }else{ - wwa_add_log($res_id, "ajax_auth: user_verification => \"false\""); - $user_verification = AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_DISCOURAGED; - } - - if($usernameless_flag){ - wwa_add_log($res_id, "ajax_auth: Usernameless authentication, user_verification => \"true\""); - $user_verification = AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_REQUIRED; - } - - // Create a auth challenge - $publicKeyCredentialRequestOptions = $server->generatePublicKeyCredentialRequestOptions( - $user_verification, - $allowedCredentials - ); - - // Save for future use - wwa_set_temp_val("pkcco_auth", base64_encode(serialize($publicKeyCredentialRequestOptions)), $client_id); - wwa_set_temp_val("auth_type", $wwa_get["type"], $client_id); - wwa_set_temp_val("user_exist", $user_exist, $client_id); - if(!$usernameless_flag){ - wwa_set_temp_val("user_name_auth", $user_info->user_login, $client_id); - } - wwa_set_temp_val("usernameless_auth", serialize($usernameless_flag), $client_id); - - // Save the user entity if is not logged in and not usernameless - if(!($wwa_get["type"] === "test" && current_user_can("read")) && !$usernameless_flag){ - wwa_set_temp_val("user_auth", serialize($userEntity), $client_id); - } - - header("Content-Type: application/json"); - $publicKeyCredentialRequestOptions = json_decode(json_encode($publicKeyCredentialRequestOptions), true); - $publicKeyCredentialRequestOptions["clientID"] = $client_id; - echo json_encode($publicKeyCredentialRequestOptions); - wwa_add_log($res_id, "ajax_auth: Challenge sent"); - exit; - }catch(\Exception $exception){ - wwa_add_log($res_id, "ajax_auth: (ERROR)".$exception->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($exception)); - wwa_add_log($res_id, "ajax_auth: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - }catch(\Error $error){ - wwa_add_log($res_id, "ajax_auth: (ERROR)".$error->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($error)); - wwa_add_log($res_id, "ajax_auth: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } -} -add_action("wp_ajax_wwa_auth_start" , "wwa_ajax_auth_start"); -add_action("wp_ajax_nopriv_wwa_auth_start" , "wwa_ajax_auth_start"); - -function wwa_ajax_auth(){ - $client_id = false; - try{ - $res_id = wwa_generate_random_string(5); - - wwa_init_new_options(); - - wwa_add_log($res_id, "ajax_auth_response: Client response received"); - - if(!isset($_POST["clientid"])){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Missing parameters, exit"); - wp_die("Bad Request."); - }else{ - if(strlen($_POST["clientid"]) < 34 || strlen($_POST["clientid"]) > 35){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong client ID, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - // Sanitize the input - $client_id = sanitize_text_field($_POST["clientid"]); - } - - // Check POST - if(!isset($_POST["type"]) || !isset($_POST["data"]) || !isset($_POST["remember"])){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - }else{ - // Sanitize the input - $wwa_post = array(); - $wwa_post["type"] = sanitize_text_field($_POST["type"]); - $wwa_post["remember"] = sanitize_text_field($_POST["remember"]); - } - - $temp_val = array( - "pkcco_auth" => wwa_get_temp_val("pkcco_auth", $client_id), - "auth_type" => wwa_get_temp_val("auth_type", $client_id), - "usernameless_auth" => wwa_get_temp_val("usernameless_auth", $client_id), - "user_auth" => wwa_get_temp_val("user_auth", $client_id), - "user_name_auth" => wwa_get_temp_val("user_name_auth", $client_id), - "user_exist" => wwa_get_temp_val("user_exist", $client_id), - ); - - if($temp_val["auth_type"] === false || $wwa_post["type"] !== $temp_val["auth_type"]){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - - // Check remember me - if($wwa_post["remember"] !== "true" && $wwa_post["remember"] !== "false"){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - }else if(wwa_get_option("remember_me") !== "true" && $wwa_post["remember"] === "true"){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request.", $client_id); - } - - // May not get the challenge yet - if($temp_val["pkcco_auth"] === false || $temp_val["usernameless_auth"] === false || ($wwa_post["type"] !== "test" && $wwa_post["type"] !== "auth")){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Challenge not found in transient, exit"); - wwa_wp_die("Bad request.", $client_id); - } - - $temp_val["usernameless_auth"] = unserialize($temp_val["usernameless_auth"]); - - if($temp_val["usernameless_auth"] === false && $temp_val["user_name_auth"] === false){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Username not found in transient, exit"); - wwa_wp_die("Bad request.", $client_id); - } - if($wwa_post["type"] === "test" && !current_user_can("read")){ - // Test but not logged in - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Permission denied, exit"); - wwa_wp_die("Bad request.", $client_id); - } - if(!($wwa_post["type"] === "test" && current_user_can("read")) && ($temp_val["usernameless_auth"] === false && $temp_val["user_auth"] === false)){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Permission denied, exit"); - wwa_wp_die("Bad request.", $client_id); - } - - $usernameless_flag = $temp_val["usernameless_auth"]; - - $psr17Factory = new Psr17Factory(); - $creator = new ServerRequestCreator( - $psr17Factory, - $psr17Factory, - $psr17Factory, - $psr17Factory - ); - - $serverRequest = $creator->fromGlobals(); - $publicKeyCredentialSourceRepository = new PublicKeyCredentialSourceRepository(); - - // If user entity is not saved, read from WordPress - $user_key = ""; - if($wwa_post["type"] === "test" && current_user_can('read') && !$usernameless_flag){ - $user_info = wp_get_current_user(); - - if(isset($_GET["user_id"])){ - $user_id = intval(sanitize_text_field($_POST["user_id"])); - if($user_id <= 0){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request."); - } - - if($user_info->ID !== $user_id){ - if(!current_user_can("edit_user", $user_id)){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)No permission, exit"); - wwa_wp_die("Something went wrong."); - } - $user_info = get_user_by('id', $user_id); - - if($user_info === false){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong user ID, exit"); - wwa_wp_die("Something went wrong."); - } - } - } - - if(!isset(wwa_get_option("user_id")[$user_info->user_login])){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)User not initialized, exit"); - wwa_wp_die("User not inited.", $client_id); - }else{ - $user_key = wwa_get_option("user_id")[$user_info->user_login]; - $user_icon = get_avatar_url($user_info->user_email, array("scheme" => "https")); - } - - $userEntity = new PublicKeyCredentialUserEntity( - $user_info->user_login, - $user_key, - $user_info->display_name, - $user_icon - ); - - wwa_add_log($res_id, "ajax_auth_response: type => \"test\", user => \"".$user_info->user_login."\""); - }else{ - if($usernameless_flag){ - $data_array = json_decode(base64_decode($_POST["data"]), true); - if(!isset($data_array["response"]["userHandle"]) || !isset($data_array["rawId"])){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Client data not correct, exit"); - wwa_wp_die("Bad request.", $client_id); - } - - wwa_add_log($res_id, "ajax_auth_response: type => \"".$wwa_post["type"]."\""); - wwa_add_log($res_id, "ajax_auth_response: Usernameless authentication, try to find user by credential_id => \"".$data_array["rawId"]."\", userHandle => \"".$data_array["response"]["userHandle"]."\""); - - $credential_meta = $publicKeyCredentialSourceRepository->findOneMetaByCredentialId(base64_decode($data_array["rawId"])); - - if($credential_meta !== null){ - $allow_authenticator_type = wwa_get_option("allow_authenticator_type"); - if($allow_authenticator_type !== false && $allow_authenticator_type !== 'none'){ - if($credential_meta["authenticator_type"] !== $allow_authenticator_type){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Credential type error, authenticator_type => \"".$credential_meta["authenticator_type"]."\", allow_authenticator_type => \"".$allow_authenticator_type."\", exit"); - wwa_wp_die("Bad request.", $client_id); - } - } - if($credential_meta["usernameless"] === true){ - wwa_add_log($res_id, "ajax_auth_response: Credential found, usernameless => \"true\", user_key => \"".$credential_meta["user"]."\""); - - // Try to find user - $all_user = wwa_get_option("user_id"); - $user_login_name = false; - foreach($all_user as $user => $user_id){ - if($user_id === $credential_meta["user"]){ - $user_login_name = $user; - break; - } - } - - // Match userHandle - if($credential_meta["user"] === base64_decode($data_array["response"]["userHandle"])){ - // Found user - if($user_login_name !== false){ - wwa_add_log($res_id, "ajax_auth_response: Found user => \"".$user_login_name."\", user_key => \"".$credential_meta["user"]."\""); - - // Testing, verify user - if($wwa_post["type"] === "test" && current_user_can('read')){ - $user_wp = wp_get_current_user(); - if($user_login_name !== $user_wp->user_login){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Credential found, but user not match, exit"); - wwa_wp_die("Bad request.", $client_id); - } - } - - $user_info = get_user_by('login', $user_login_name); - - if($user_info === false){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong user ID, exit"); - wwa_wp_die("Something went wrong."); - } - - $userEntity = new PublicKeyCredentialUserEntity( - $user_info->user_login, - $credential_meta["user"], - $user_info->display_name, - get_avatar_url($user_info->user_email, array("scheme" => "https")) - ); - }else{ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Credential found, but user not found, exit"); - wwa_wp_die("Bad request.", $client_id); - } - }else{ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Credential found, but userHandle not matched, exit"); - wwa_wp_die("Bad request.", $client_id); - } - }else{ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Credential found, but usernameless => \"false\", exit"); - wwa_wp_die("Bad request.", $client_id); - } - }else{ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Credential not found, exit"); - wwa_wp_die("Bad request.", $client_id); - } - }else{ - wwa_add_log($res_id, "ajax_auth_response: type => \"auth\", user => \"".$temp_val["user_name_auth"]."\""); - $userEntity = unserialize($temp_val["user_auth"]); - } - } - - wwa_add_log($res_id, "ajax_auth_response: data => ".base64_decode($_POST["data"])); - - if($temp_val["user_exist"]){ - $rpEntity = new PublicKeyCredentialRpEntity( - wwa_get_option("website_name"), - wwa_get_option("website_domain") - ); - - $server = new Server( - $rpEntity, - $publicKeyCredentialSourceRepository, - null - ); - - // Allow to bypass scheme verification when under localhost - $current_domain = wwa_get_option("website_domain"); - if($current_domain === "localhost" || $current_domain === "127.0.0.1"){ - $server->setSecuredRelyingPartyId([$current_domain]); - wwa_add_log($res_id, "ajax_auth_response: Localhost, bypass HTTPS check"); - } - - // Verify - try { - $server->loadAndCheckAssertionResponse( - base64_decode($_POST["data"]), - unserialize(base64_decode($temp_val["pkcco_auth"])), - $userEntity, - $serverRequest - ); - - wwa_add_log($res_id, "ajax_auth_response: Challenge verified"); - - // Success - $publicKeyCredentialSourceRepository->updateCredentialLastUsed(base64_decode(json_decode(base64_decode($_POST["data"]), true)["rawId"])); - if(!($wwa_post["type"] === "test" && current_user_can("read"))){ - // Log user in - if (!is_user_logged_in()) { - include("wwa-compatibility.php"); - - if(!$usernameless_flag){ - $user_login = $temp_val["user_name_auth"]; - }else{ - $user_login = $user_login_name; - } - - $user = get_user_by("login", $user_login); - - if($user_info === false){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Wrong user ID, exit"); - wwa_wp_die("Something went wrong."); - } - - $user_id = $user->ID; - - wwa_add_log($res_id, "ajax_auth_response: Log in user => \"".$user_login."\""); - - $remember_flag = false; - - if ($wwa_post["remember"] === "true" && (wwa_get_option("remember_me") === false ? "false" : wwa_get_option("remember_me")) !== "false") { - $remember_flag = true; - wwa_add_log($res_id, "ajax_auth_response: Remember login for 14 days"); - } - - wp_set_current_user($user_id, $user_login); - if(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] === "on"){ - wp_set_auth_cookie($user_id, $remember_flag, true); - }else{ - wp_set_auth_cookie($user_id, $remember_flag); - } - do_action("wp_login", $user_login, $user); - } - } - echo "true"; - }catch(\Throwable $exception){ - // Failed to verify - wwa_add_log($res_id, "ajax_auth_response: (ERROR)".$exception->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($exception)); - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Challenge not verified, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } - }else{ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)User not exists or has no authenticator, exit without verification"); - wwa_wp_die("Something went wrong.", $client_id); - } - - // Destroy session - wwa_destroy_temp_val($client_id); - exit; - }catch(\Exception $exception){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)".$exception->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($exception)); - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - }catch(\Error $error){ - wwa_add_log($res_id, "ajax_auth_response: (ERROR)".$error->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($error)); - wwa_add_log($res_id, "ajax_auth_response: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong.", $client_id); - } -} -add_action("wp_ajax_wwa_auth" , "wwa_ajax_auth"); -add_action("wp_ajax_nopriv_wwa_auth" , "wwa_ajax_auth"); - -// Get authenticator list -function wwa_ajax_authenticator_list(){ - $res_id = wwa_generate_random_string(5); - - wwa_init_new_options(); - - if(!current_user_can("read")){ - wwa_add_log($res_id, "ajax_authenticator_list: (ERROR)Missing parameters, exit"); - wwa_wp_die("Something went wrong."); - } - - $user_info = wp_get_current_user(); - - if(isset($_GET["user_id"])){ - $user_id = intval(sanitize_text_field($_GET["user_id"])); - if($user_id <= 0){ - wwa_add_log($res_id, "ajax_authenticator_list: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request."); - } - - if($user_info->ID !== $user_id){ - if(!current_user_can("edit_user", $user_id)){ - wwa_add_log($res_id, "ajax_authenticator_list: (ERROR)No permission, exit"); - wwa_wp_die("Something went wrong."); - } - $user_info = get_user_by('id', $user_id); - - if($user_info === false){ - wwa_add_log($res_id, "ajax_authenticator_list: (ERROR)Wrong user ID, exit"); - wwa_wp_die("Something went wrong."); - } - } - } - - header('Content-Type: application/json'); - - $user_key = ""; - if(!isset(wwa_get_option("user_id")[$user_info->user_login])){ - // The user haven't bound any authenticator, return empty list - echo "[]"; - exit; - }else{ - $user_key = wwa_get_option("user_id")[$user_info->user_login]; - } - - $userEntity = new PublicKeyCredentialUserEntity( - $user_info->user_login, - $user_key, - $user_info->display_name, - get_avatar_url($user_info->user_email, array("scheme" => "https")) - ); - - $publicKeyCredentialSourceRepository = new PublicKeyCredentialSourceRepository(); - echo json_encode($publicKeyCredentialSourceRepository->getShowList($userEntity)); - exit; -} -add_action("wp_ajax_wwa_authenticator_list" , "wwa_ajax_authenticator_list"); - -// Modify an authenticator -function wwa_ajax_modify_authenticator(){ - try{ - $res_id = wwa_generate_random_string(5); - - wwa_init_new_options(); - - wwa_add_log($res_id, "ajax_modify_authenticator: Start"); - - if(!current_user_can("read")){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Permission denied, exit"); - wwa_wp_die("Bad Request."); - } - - if(!isset($_GET["id"]) || !isset($_GET["target"])){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request."); - } - - $user_info = wp_get_current_user(); - - if(isset($_GET["user_id"])){ - $user_id = intval(sanitize_text_field($_GET["user_id"])); - if($user_id <= 0){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Wrong parameters, exit"); - wwa_wp_die("Bad Request."); - } - - if($user_info->ID !== $user_id){ - if(!current_user_can("edit_user", $user_id)){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)No permission, exit"); - wwa_wp_die("Something went wrong."); - } - $user_info = get_user_by('id', $user_id); - - if($user_info === false){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Wrong user ID, exit"); - wwa_wp_die("Something went wrong."); - } - } - } - - if($_GET["target"] !== "rename" && $_GET["target"] !== "remove"){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Wrong target, exit"); - wwa_wp_die("Bad Request."); - } - - if($_GET["target"] === "rename" && !isset($_GET["name"])){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Missing parameters, exit"); - wwa_wp_die("Bad Request."); - } - - $user_key = ""; - if(!isset(wwa_get_option("user_id")[$user_info->user_login])){ - // The user haven't bound any authenticator, exit - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)User not initialized, exit"); - wwa_wp_die("User not inited."); - }else{ - $user_key = wwa_get_option("user_id")[$user_info->user_login]; - } - - $userEntity = new PublicKeyCredentialUserEntity( - $user_info->user_login, - $user_key, - $user_info->display_name, - get_avatar_url($user_info->user_email, array("scheme" => "https")) - ); - - wwa_add_log($res_id, "ajax_modify_authenticator: user => \"".$user_info->user_login."\""); - - $publicKeyCredentialSourceRepository = new PublicKeyCredentialSourceRepository(); - - if($_GET["target"] === "rename"){ - echo $publicKeyCredentialSourceRepository->modifyAuthenticator($_GET["id"], sanitize_text_field($_GET["name"]), $userEntity, "rename", $res_id); - }else if($_GET["target"] === "remove"){ - echo $publicKeyCredentialSourceRepository->modifyAuthenticator($_GET["id"], "", $userEntity, "remove", $res_id); - } - exit; - }catch(\Exception $exception){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)".$exception->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($exception)); - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong."); - }catch(\Error $error){ - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)".$error->getMessage()); - wwa_add_log($res_id, wwa_generate_call_trace($error)); - wwa_add_log($res_id, "ajax_modify_authenticator: (ERROR)Unknown error, exit"); - wwa_wp_die("Something went wrong."); - } -} -add_action("wp_ajax_wwa_modify_authenticator" , "wwa_ajax_modify_authenticator"); - -// Print log -function wwa_ajax_get_log(){ - if(!wwa_validate_privileges()){ - wwa_wp_die("Bad Request."); - } - - header('Content-Type: application/json'); - - $log = get_option("wwa_log"); - - if($log === false){ - echo "[]"; - }else{ - echo json_encode($log); - } - - exit; -} -add_action("wp_ajax_wwa_get_log" , "wwa_ajax_get_log"); - -// Clear log -function wwa_ajax_clear_log(){ - if(!wwa_validate_privileges()){ - wwa_wp_die("Bad Request."); - } - - $log = get_option("wwa_log"); - - if($log !== false){ - update_option("wwa_log", array()); - } - - echo "true"; - exit; -} -add_action("wp_ajax_wwa_clear_log" , "wwa_ajax_clear_log"); -?> \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-compatibility.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-compatibility.php deleted file mode 100644 index 8c946c0c..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-compatibility.php +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-functions.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-functions.php deleted file mode 100644 index c97cec41..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-functions.php +++ /dev/null @@ -1,401 +0,0 @@ -getTraceAsString()); - $trace = array_reverse($trace); - array_shift($trace); - array_pop($trace); - $length = count($trace); - $result = array(); - - for($i = 0; $i < $length; $i++){ - $result[] = ($i + 1).')'.substr($trace[$i], strpos($trace[$i], ' ')); - } - - return "Traceback:\n ".implode("\n ", $result); -} - -// Delete all credentials when deleting user -function wwa_delete_user($user_id){ - $res_id = wwa_generate_random_string(5); - - $user_data = get_userdata($user_id); - $all_user_meta = wwa_get_option('user_id'); - $user_key = ''; - - // Delete user meta - foreach($all_user_meta as $user => $id){ - if($user === $user_data->user_login){ - $user_key = $id; - wwa_add_log($res_id, "Delete user_key => \"".$id."\""); - unset($all_user_meta[$user]); - } - } - - // Delete credentials - $all_credentials_meta = json_decode(wwa_get_option('user_credentials_meta'), true); - $all_credentials = json_decode(wwa_get_option('user_credentials'), true); - foreach($all_credentials_meta as $credential => $meta){ - if($user_key === $meta['user']){ - wwa_add_log($res_id, "Delete credential => \"".$credential."\""); - unset($all_credentials_meta[$credential]); - unset($all_credentials[$credential]); - } - } - wwa_update_option('user_id', $all_user_meta); - wwa_update_option('user_credentials_meta', json_encode($all_credentials_meta)); - wwa_update_option('user_credentials', json_encode($all_credentials)); - wwa_add_log($res_id, "Deleted user => \"".$user_data->user_login."\""); -} -add_action('delete_user', 'wwa_delete_user'); - -// Add CSS and JS in login page -function wwa_login_js(){ - $wwa_not_allowed = false; - if(!function_exists('mb_substr') || !function_exists('gmp_intval') || !wwa_check_ssl() && (parse_url(site_url(), PHP_URL_HOST) !== 'localhost' && parse_url(site_url(), PHP_URL_HOST) !== '127.0.0.1')){ - $wwa_not_allowed = true; - } - wp_enqueue_script('wwa_login', plugins_url('js/login.js', __FILE__), array(), get_option('wwa_version')['version'], true); - $first_choice = wwa_get_option('first_choice'); - wp_localize_script('wwa_login', 'php_vars', array( - 'ajax_url' => admin_url('admin-ajax.php'), - 'admin_url' => admin_url(), - 'usernameless' => (wwa_get_option('usernameless_login') === false ? 'false' : wwa_get_option('usernameless_login')), - 'remember_me' => (wwa_get_option('remember_me') === false ? 'false' : wwa_get_option('remember_me')), - 'email_login' => (wwa_get_option('email_login') === false ? 'false' : wwa_get_option('email_login')), - 'allow_authenticator_type' => (wwa_get_option('allow_authenticator_type') === false ? "none" : wwa_get_option('allow_authenticator_type')), - 'webauthn_only' => ($first_choice === 'webauthn' && !$wwa_not_allowed) ? 'true' : 'false', - 'password_reset' => ((wwa_get_option('password_reset') === false || wwa_get_option('password_reset') === 'off') ? 'false' : 'true'), - 'separator' => apply_filters('login_link_separator', ' | '), - 'i18n_1' => __('Auth', 'wp-webauthn'), - 'i18n_2' => __('Authenticate with WebAuthn', 'wp-webauthn'), - 'i18n_3' => __('Hold on...', 'wp-webauthn'), - 'i18n_4' => __('Please proceed...', 'wp-webauthn'), - 'i18n_5' => __('Authenticating...', 'wp-webauthn'), - 'i18n_6' => ' '.__('Authenticated', 'wp-webauthn').'', - 'i18n_7' => ' '.__('Auth failed', 'wp-webauthn').'', - 'i18n_8' => __('It looks like your browser doesn\'t support WebAuthn, which means you may unable to login.', 'wp-webauthn'), - 'i18n_9' => __('Username', 'wp-webauthn'), - 'i18n_10' => __('Username or Email Address'), - 'i18n_11' => __('Error: The username field is empty.', 'wp-webauthn'), - 'i18n_12' => ''.__('Try to enter the username', 'wp-webauthn').'' - )); - if($first_choice === 'true' || $first_choice === 'webauthn'){ - wp_enqueue_script('wwa_default', plugins_url('js/default_wa.js', __FILE__), array(), get_option('wwa_version')['version'], true); - } - wp_enqueue_style('wwa_login_css', plugins_url('css/login.css', __FILE__), array(), get_option('wwa_version')['version']); -} -add_action('login_enqueue_scripts', 'wwa_login_js', 999); - -// Disable password login -function wwa_disable_password($user){ - if(!function_exists('mb_substr') || !function_exists('gmp_intval') || !wwa_check_ssl() && (parse_url(site_url(), PHP_URL_HOST) !== 'localhost' && parse_url(site_url(), PHP_URL_HOST) !== '127.0.0.1')){ - return $user; - } - if(wwa_get_option('first_choice') === 'webauthn'){ - return new WP_Error('wwa_password_disabled', __('Logging in with password has been disabled by the site manager.', 'wp-webauthn')); - } - if(is_wp_error($user)){ - return $user; - } - if(get_the_author_meta('webauthn_only', $user->ID) === 'true'){ - return new WP_Error('wwa_password_disabled_for_account', __('Logging in with password has been disabled for this account.', 'wp-webauthn')); - } - return $user; -} -add_filter('wp_authenticate_user', 'wwa_disable_password', 10, 1); - -function wwa_handle_user_register($user_id){ - if(wwa_get_option('password_reset') === 'admin' || wwa_get_option('password_reset') === 'all'){ - update_user_option($user_id, 'default_password_nag', false); - } - if(wwa_get_option('after_user_registration') === 'login'){ - wp_set_current_user($user_id); - wp_set_auth_cookie($user_id); - wp_redirect(admin_url('profile.php?wwa_registered=true#wwa-webauthn-start')); - exit; - } -} -add_action('register_new_user', 'wwa_handle_user_register'); - -// Disable Password Reset URL & Redirect -function wwa_disable_lost_password(){ - if((wwa_get_option('password_reset') === 'admin' || wwa_get_option('password_reset') === 'all') && isset( $_GET['action'] )){ - if(in_array($_GET['action'], array('lostpassword', 'retrievepassword', 'resetpass', 'rp'))){ - wp_redirect(wp_login_url(), 302); - exit; - } - } -} -function wwa_handle_lost_password_html_link($link){ - if(wwa_get_option('password_reset') === 'admin' || wwa_get_option('password_reset') === 'all'){ - return ''; - } - return $link; -} -function wwa_handle_password(){ - if(wwa_get_option('password_reset') === 'admin' || wwa_get_option('password_reset') === 'all'){ - if(wwa_get_option('password_reset') === 'admin'){ - if(current_user_can('edit_users')){ - return true; - } - } - return false; - } - return true; -} -if(wwa_get_option('password_reset') === 'admin' || wwa_get_option('password_reset') === 'all'){ - add_action('login_init', 'wwa_disable_lost_password'); - add_filter('lost_password_html_link', 'wwa_handle_lost_password_html_link'); - add_filter('show_password_fields', 'wwa_handle_password'); - add_filter('allow_password_reset', 'wwa_handle_password'); -} - -// Show a notice in admin pages -function wwa_no_authenticator_warning(){ - $user_info = wp_get_current_user(); - $first_choice = wwa_get_option('first_choice'); - $check_self = true; - if($first_choice !== 'webauthn' && get_the_author_meta('webauthn_only', $user_info->ID ) !== 'true'){ - $check_self = false; - } - - if($check_self){ - // Check current user - $user_id = ''; - $show_notice_flag = false; - if(!isset(wwa_get_option('user_id')[$user_info->user_login])){ - $show_notice_flag = true; - }else{ - $user_id = wwa_get_option('user_id')[$user_info->user_login]; - } - - if(!$show_notice_flag){ - $show_notice_flag = true; - $data = json_decode(wwa_get_option('user_credentials_meta'), true); - foreach($data as $value){ - if($user_id === $value['user']){ - $show_notice_flag = false; - break; - } - } - } - - if($show_notice_flag){?> -
          -

          Register', 'wp-webauthn'), $first_choice === 'webauthn' ? __('the site', 'wp-webauthn') : __('your account', 'wp-webauthn'), admin_url('profile.php'));?>

          -
          - ID){ - $user_id_wp = intval($_GET['user_id']); - if($user_id_wp <= 0){ - return; - } - if(!current_user_can('edit_user', $user_id_wp)){ - return; - } - $user_info = get_user_by('id', $user_id_wp); - - if($user_info === false){ - return; - } - - if($first_choice !== 'webauthn' && get_the_author_meta('webauthn_only', $user_info->ID) !== 'true'){ - return; - } - - $user_id = ''; - $show_notice_flag = false; - if(!isset(wwa_get_option('user_id')[$user_info->user_login])){ - $show_notice_flag = true; - }else{ - $user_id = wwa_get_option('user_id')[$user_info->user_login]; - } - - if(!$show_notice_flag){ - $show_notice_flag = true; - $data = json_decode(wwa_get_option('user_credentials_meta'), true); - foreach($data as $value){ - if($user_id === $value['user']){ - $show_notice_flag = false; - break; - } - } - } - - if($show_notice_flag){ ?> -
          -

          this account haven\'t register any WebAuthn authenticator yet. This user may unable to login.', 'wp-webauthn'), $first_choice === 'webauthn' ? __('the site', 'wp-webauthn') : __('this account', 'wp-webauthn'));?>

          -
          - '.__('Settings', 'wp-webauthn').''; - } - return $links_array; -} -add_filter('plugin_action_links', 'wwa_settings_link', 10, 2); - -function wwa_meta_link($links_array, $plugin_file_name){ - if($plugin_file_name === 'wp-webauthn/wp-webauthn.php'){ - $links_array[] = ''.__('GitHub', 'wp-webauthn').''; - $links_array[] = ''.__('Documentation', 'wp-webauthn').''; - } - return $links_array; -} -add_filter('plugin_row_meta', 'wwa_meta_link', 10, 2); - -// Check if we are under HTTPS -function wwa_check_ssl() { - if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' && $_SERVER['HTTPS'] !== '') { - return true; - } - if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] === 'on') { - return true; - } - if (isset($_SERVER['SERVER_PROTOCOL']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/3.0') { - return true; - } - if (isset($_SERVER['REQUEST_SCHEME']) && ($_SERVER['REQUEST_SCHEME'] === 'quic' || $_SERVER['REQUEST_SCHEME'] === 'https')) { - return true; - } - return false; -} - -// Check user privileges -function wwa_validate_privileges() { - $user = wp_get_current_user(); - $allowed_roles = array('administrator'); - if(array_intersect($allowed_roles, $user->roles)){ - return true; - } - return false; -} - -// Get user by username or email -function wwa_get_user($username) { - if(wwa_get_option('email_login') !== 'true'){ - return get_user_by('login', $username); - }else{ - if(is_email($username)){ - return get_user_by('email', $username); - } - return get_user_by('login', $username); - } -} -?> diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-menus.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-menus.php deleted file mode 100644 index 83545651..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-menus.php +++ /dev/null @@ -1,50 +0,0 @@ - admin_url('admin-ajax.php'), - 'user_id' => $user->ID, - 'i18n_1' => __('Initializing...', 'wp-webauthn'), - 'i18n_2' => __('Please follow instructions to finish registration...', 'wp-webauthn'), - 'i18n_3' => ''._x('Registered', 'action', 'wp-webauthn').'', - 'i18n_4' => ''.__('Registration failed', 'wp-webauthn').'', - 'i18n_5' => __('Your browser does not support WebAuthn', 'wp-webauthn'), - 'i18n_6' => __('Registrating...', 'wp-webauthn'), - 'i18n_7' => __('Please enter the authenticator identifier', 'wp-webauthn'), - 'i18n_8' => __('Loading failed, maybe try refreshing?', 'wp-webauthn'), - 'i18n_9' => __('Any', 'wp-webauthn'), - 'i18n_10' => __('Platform authenticator', 'wp-webauthn'), - 'i18n_11' => __('Roaming authenticator', 'wp-webauthn'), - 'i18n_12' => __('Remove', 'wp-webauthn'), - 'i18n_13' => __('Please follow instructions to finish verification...', 'wp-webauthn'), - 'i18n_14' => __('Verifying...', 'wp-webauthn'), - 'i18n_15' => ''.__('Verification failed', 'wp-webauthn').'', - 'i18n_16' => ''.__('Verification passed! You can now log in through WebAuthn', 'wp-webauthn').'', - 'i18n_17' => __('No registered authenticators', 'wp-webauthn'), - 'i18n_18' => __('Confirm removal of authenticator: ', 'wp-webauthn'), - 'i18n_19' => __('Removing...', 'wp-webauthn'), - 'i18n_20' => __('Rename', 'wp-webauthn'), - 'i18n_21' => __('Rename the authenticator', 'wp-webauthn'), - 'i18n_22' => __('Renaming...', 'wp-webauthn'), - 'i18n_24' => __('Ready', 'wp-webauthn'), - 'i18n_25' => __('No', 'wp-webauthn'), - 'i18n_26' => __(' (Unavailable)', 'wp-webauthn'), - 'i18n_27' => __('The site administrator has disabled usernameless login feature.', 'wp-webauthn'), - 'i18n_28' => __('After removing this authenticator, you will not be able to login with WebAuthn', 'wp-webauthn'), - 'i18n_29' => __(' (Disabled)', 'wp-webauthn'), - 'i18n_30' => __('The site administrator only allow platform authenticators currently.', 'wp-webauthn'), - 'i18n_31' => __('The site administrator only allow roaming authenticators currently.', 'wp-webauthn') -)); -wp_enqueue_style('wwa_profile', plugins_url('css/admin.css', __FILE__)); -wp_localize_script('wwa_profile', 'configs', array('usernameless' => (wwa_get_option('usernameless_login') === false ? "false" : wwa_get_option('usernameless_login')), 'allow_authenticator_type' => (wwa_get_option('allow_authenticator_type') === false ? "none" : wwa_get_option('allow_authenticator_type')))); -?> -
          -

          WebAuthn

          -user_login])){ - $user_id = $user_ids[$user->user_login]; - $count = 0; - $data = json_decode(wwa_get_option("user_credentials_meta"), true); - foreach($data as $key => $value){ - if($user_id === $value["user"]){ - $count++; - } - } - } - } - if($count === 0){ -?> -
          - -
          - -
          - -
          - - - - - - -
          - -


          -
          -

          -
          - - - - - - - - - - - - - - - - - - - - - - - - - - -
          -
          -

          -

          -   -
          - -

          -

          %s.
          You can register multiple authenticators for an account.', 'wp-webauthn'), $user->user_login);?>

          - - - - - - - - - - - - - - - -
          - - -

          Regardless of the type, you can only log in with the very same authenticators you\'ve registered.', 'wp-webauthn');?>

          -
          - -

          DOES NOT affect the authentication process in anyway.', 'wp-webauthn');?>

          -
          -
          -
          -
          -

          Some authenticators like U2F-only authenticators and some browsers DO NOT support this feature.
          A record will be stored in the authenticator permanently untill you reset it.', 'wp-webauthn');?>

          -
          -
          -      -
          -
          - -

          -

          -      - -

                - -
          \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-shortcodes.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-shortcodes.php deleted file mode 100644 index a02a46fe..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-shortcodes.php +++ /dev/null @@ -1,181 +0,0 @@ - admin_url('admin-ajax.php'), - 'admin_url' => admin_url(), - 'usernameless' => (wwa_get_option('usernameless_login') === false ? "false" : wwa_get_option('usernameless_login')), - 'remember_me' => (wwa_get_option('remember_me') === false ? "false" : wwa_get_option('remember_me')), - 'allow_authenticator_type' => (wwa_get_option('allow_authenticator_type') === false ? "none" : wwa_get_option('allow_authenticator_type')), - 'i18n_1' => __('Ready', 'wp-webauthn'), - 'i18n_2' => __('Authenticate with WebAuthn', 'wp-webauthn'), - 'i18n_3' => __('Hold on...', 'wp-webauthn'), - 'i18n_4' => __('Please proceed...', 'wp-webauthn'), - 'i18n_5' => __('Authenticating...', 'wp-webauthn'), - 'i18n_6' => ''.__('Authenticated', 'wp-webauthn'), - 'i18n_7' => ''.__('Auth failed', 'wp-webauthn').'', - 'i18n_8' => __('No', 'wp-webauthn'), - 'i18n_9' => __(' (Unavailable)', 'wp-webauthn'), - 'i18n_10' => __('The site administrator has disabled usernameless login feature.', 'wp-webauthn'), - 'i18n_11' => __('Error: The username field is empty.', 'wp-webauthn'), - 'i18n_12' => __('Please enter the authenticator identifier', 'wp-webauthn'), - 'i18n_13' => __('Please follow instructions to finish verification...', 'wp-webauthn'), - 'i18n_14' => __('Verifying...', 'wp-webauthn'), - 'i18n_15' => ''.__('Verification failed', 'wp-webauthn').'', - 'i18n_16' => ''.__('Verification passed! You can now log in through WebAuthn', 'wp-webauthn').'', - 'i18n_17' => __('Loading failed, maybe try refreshing?', 'wp-webauthn'), - 'i18n_18' => __('Confirm removal of authenticator: ', 'wp-webauthn'), - 'i18n_19' => __('Removing...', 'wp-webauthn'), - 'i18n_20' => __('Rename', 'wp-webauthn'), - 'i18n_21' => __('Rename the authenticator', 'wp-webauthn'), - 'i18n_22' => __('Renaming...', 'wp-webauthn'), - 'i18n_23' => __('No registered authenticators', 'wp-webauthn'), - 'i18n_24' => __('Any', 'wp-webauthn'), - 'i18n_25' => __('Platform authenticator', 'wp-webauthn'), - 'i18n_26' => __('Roaming authenticator', 'wp-webauthn'), - 'i18n_27' => __('Remove', 'wp-webauthn'), - 'i18n_28' => __('Please follow instructions to finish registration...', 'wp-webauthn'), - 'i18n_29' => ''._x('Registered', 'action', 'wp-webauthn').'', - 'i18n_30' => ''.__('Registration failed', 'wp-webauthn').'', - 'i18n_31' => __('Your browser does not support WebAuthn', 'wp-webauthn'), - 'i18n_32' => __('Registrating...', 'wp-webauthn'), - 'i18n_33' => ''.__('Try to enter the username', 'wp-webauthn').'', - 'i18n_34' => __('After removing this authenticator, you will not be able to login with WebAuthn', 'wp-webauthn'), - 'i18n_35' => __(' (Disabled)', 'wp-webauthn'), - 'i18n_36' => __('The site administrator only allow platform authenticators currently.', 'wp-webauthn'), - 'i18n_37' => __('The site administrator only allow roaming authenticators currently.', 'wp-webauthn') - )); -} - -// Login form -function wwa_login_form_shortcode($vals){ - extract(shortcode_atts( - array( - 'traditional' => 'true', - 'username' => '', - 'auto_hide' => 'true', - 'to' => '' - ), $vals) - ); - - if($auto_hide === "true" && current_user_can("read")){ - return ''; - } - - // Load Javascript & CSS - if(!wp_script_is('wwa_frontend_js')){ - wwa_localize_frontend(); - } - wp_enqueue_style('wwa_frondend_css', plugins_url('css/frontend.css', __FILE__), array(), get_option('wwa_version')['version']); - - $html_form = ''; - - return $html_form; -} -add_shortcode('wwa_login_form', 'wwa_login_form_shortcode'); - -// Register form -function wwa_register_form_shortcode($vals){ - extract(shortcode_atts( - array( - 'display' => 'true' - ), $vals) - ); - - // If always display - if(!current_user_can("read")){ - if($display === "true"){ - return '

          '.__('You haven\'t logged in yet.', 'wp-webauthn').'

          '; - }else{ - return ''; - } - } - - // Load Javascript & CSS - if(!wp_script_is('wwa_frontend_js')){ - wwa_localize_frontend(); - } - wp_enqueue_style('wwa_frondend_css', plugins_url('css/frontend.css', __FILE__), array(), get_option('wwa_version')['version']); - - $allowed_type = wwa_get_option('allow_authenticator_type') === false ? 'none' : wwa_get_option('allow_authenticator_type'); - return '

          '.__('If a type is selected, the browser will only prompt for authenticators of selected type.
          Regardless of the type, you can only log in with the very same authenticators you\'ve registered.', 'wp-webauthn').'

          '.__('An easily identifiable name for the authenticator. DOES NOT affect the authentication process in anyway.', 'wp-webauthn').'

          '.((wwa_get_option('usernameless_login') === "true") ? '

          '.__('If registered authenticator with this feature, you can login without enter your username.
          Some authenticators like U2F-only authenticators and some browsers DO NOT support this feature.
          A record will be stored in the authenticator permanently untill you reset it.', 'wp-webauthn').'

          ' : '').'

               

          '; -} -add_shortcode('wwa_register_form', 'wwa_register_form_shortcode'); - -// Verify button -function wwa_verify_button_shortcode($vals){ - extract(shortcode_atts( - array( - 'display' => 'true' - ), $vals) - ); - - // If always display - if(!current_user_can("read")){ - if($display === "true"){ - return '

          '.__('You haven\'t logged in yet.', 'wp-webauthn').'

          '; - }else{ - return ''; - } - } - - // Load Javascript - if(!wp_script_is('wwa_frontend_js')){ - wwa_localize_frontend(); - } - - return '

               '.(wwa_get_option('usernameless_login') === "true" ? '
               ' : '').'

          '; -} -add_shortcode('wwa_verify_button', 'wwa_verify_button_shortcode'); - -// Authenticator list -function wwa_list_shortcode($vals){ - extract(shortcode_atts( - array( - 'display' => 'true' - ), $vals) - ); - - $thead = '
          '; - $tbody = ''; - $tfoot = '
          '.__('Identifier', 'wp-webauthn').''.__('Type', 'wp-webauthn').''._x('Registered', 'time', 'wp-webauthn').''.__('Last used', 'time', 'wp-webauthn').''.__('Usernameless', 'wp-webauthn').''.__('Action', 'wp-webauthn').'
          '.__('Loading...', 'wp-webauthn').'
          '.__('Identifier', 'wp-webauthn').''.__('Type', 'wp-webauthn').''._x('Registered', 'time', 'wp-webauthn').''.__('Last used', 'time', 'wp-webauthn').''.__('Usernameless', 'wp-webauthn').''.__('Action', 'wp-webauthn').'

          '; - - // If always display - if(!current_user_can("read")){ - if($display === "true"){ - // Load CSS - wp_enqueue_style('wwa_frondend_css', plugins_url('css/frontend.css', __FILE__), array(), get_option('wwa_version')['version']); - - return $thead.''.__('You haven\'t logged in yet.', 'wp-webauthn').''.$tfoot; - }else{ - return ''; - } - } - - // Load Javascript & CSS - if(!wp_script_is('wwa_frontend_js')){ - wwa_localize_frontend(); - } - wp_enqueue_style('wwa_frondend_css', plugins_url('css/frontend.css', __FILE__), array(), get_option('wwa_version')['version']); - - return $thead.$tbody.$tfoot; -} -add_shortcode('wwa_list', 'wwa_list_shortcode'); -?> \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-version.php b/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-version.php deleted file mode 100644 index 00d03298..00000000 --- a/wp-content/upgrade-temp-backup/plugins/wp-webauthn/wwa-version.php +++ /dev/null @@ -1,6 +0,0 @@ - '1.3.1', - 'commit' => '79260d5' -); -?> \ No newline at end of file

          WP-WebAuthn

          -localhost
          .', 'wp-webauthn')); - $wwa_not_allowed = true; -} -// Only admin can change settings -if( - (isset($_POST['wwa_ref']) && $_POST['wwa_ref'] === 'true') - && check_admin_referer('wwa_options_update') - && wwa_validate_privileges() - && ($_POST['first_choice'] === 'true' || $_POST['first_choice'] === 'false' || $_POST['first_choice'] === 'webauthn') - && ($_POST['remember_me'] === 'true' || $_POST['remember_me'] === 'false') - && ($_POST['email_login'] === 'true' || $_POST['email_login'] === 'false') - && ($_POST['user_verification'] === 'true' || $_POST['user_verification'] === 'false') - && ($_POST['usernameless_login'] === 'true' || $_POST['usernameless_login'] === 'false') - && ($_POST['allow_authenticator_type'] === 'none' || $_POST['allow_authenticator_type'] === 'platform' || $_POST['allow_authenticator_type'] === 'cross-platform') - && ($_POST['password_reset'] === 'off' || $_POST['password_reset'] === 'admin' || $_POST['password_reset'] === 'all') - && ($_POST['after_user_registration'] === 'none' || $_POST['after_user_registration'] === 'login') - && ($_POST['logging'] === 'true' || $_POST['logging'] === 'false') -){ - $res_id = wwa_generate_random_string(5); - if(sanitize_text_field($_POST['logging']) === 'true' && wwa_get_option('logging') === 'false'){ - // Initialize log - if(!function_exists('gmp_intval')){ - wwa_add_log($res_id, 'Warning: PHP extension gmp not found', true); - } - if(!function_exists('mb_substr')){ - wwa_add_log($res_id, 'Warning: PHP extension mbstring not found', true); - } - if(!function_exists('sodium_crypto_sign_detached')){ - wwa_add_log($res_id, 'Warning: PHP extension sodium not found', true); - } - if(!wwa_check_ssl() && (parse_url(site_url(), PHP_URL_HOST) !== 'localhost' && parse_url(site_url(), PHP_URL_HOST) !== '127.0.0.1')){ - wwa_add_log($res_id, 'Warning: Not in security context', true); - } - wwa_add_log($res_id, 'PHP Version => '.phpversion().', WordPress Version => '.get_bloginfo('version').', WP-WebAuthn Version => '.get_option('wwa_version')['version'], true); - wwa_add_log($res_id, 'Current config: first_choice => "'.wwa_get_option('first_choice').'", website_name => "'.wwa_get_option('website_name').'", website_domain => "'.wwa_get_option('website_domain').'", remember_me => "'.wwa_get_option('remember_me').'", email_login => "'.wwa_get_option('email_login').'", user_verification => "'.wwa_get_option('user_verification').'", allow_authenticator_type => "'.wwa_get_option('allow_authenticator_type').'", usernameless_login => "'.wwa_get_option('usernameless_login').'", password_reset => "'.wwa_get_option('password_reset').'", after_user_registration => "'.wwa_get_option('after_user_registration').'"', true); - wwa_add_log($res_id, 'Logger initialized', true); - } - wwa_update_option('logging', sanitize_text_field($_POST['logging'])); - - $post_first_choice = sanitize_text_field($_POST['first_choice']); - if($post_first_choice !== wwa_get_option('first_choice')){ - wwa_add_log($res_id, 'first_choice: "'.wwa_get_option('first_choice').'"->"'.$post_first_choice.'"'); - } - wwa_update_option('first_choice', $post_first_choice); - - $post_website_name = sanitize_text_field($_POST['website_name']); - if($post_website_name !== wwa_get_option('website_name')){ - wwa_add_log($res_id, 'website_name: "'.wwa_get_option('website_name').'"->"'.$post_website_name.'"'); - } - wwa_update_option('website_name', $post_website_name); - - $post_website_domain = str_replace('https:', '', str_replace('/', '', sanitize_text_field($_POST['website_domain']))); - if($post_website_domain !== wwa_get_option('website_domain')){ - wwa_add_log($res_id, 'website_domain: "'.wwa_get_option('website_domain').'"->"'.$post_website_domain.'"'); - } - wwa_update_option('website_domain', $post_website_domain); - - $post_remember_me = sanitize_text_field($_POST['remember_me']); - if($post_remember_me !== wwa_get_option('remember_me')){ - wwa_add_log($res_id, 'remember_me: "'.wwa_get_option('remember_me').'"->"'.$post_remember_me.'"'); - } - wwa_update_option('remember_me', $post_remember_me); - - $post_email_login = sanitize_text_field($_POST['email_login']); - if($post_email_login !== wwa_get_option('email_login')){ - wwa_add_log($res_id, 'email_login: "'.wwa_get_option('email_login').'"->"'.$post_email_login.'"'); - } - wwa_update_option('email_login', $post_email_login); - - $post_user_verification = sanitize_text_field($_POST['user_verification']); - if($post_user_verification !== wwa_get_option('user_verification')){ - wwa_add_log($res_id, 'user_verification: "'.wwa_get_option('user_verification').'"->"'.$post_user_verification.'"'); - } - wwa_update_option('user_verification', $post_user_verification); - - $post_allow_authenticator_type = sanitize_text_field($_POST['allow_authenticator_type']); - if($post_allow_authenticator_type !== wwa_get_option('allow_authenticator_type')){ - wwa_add_log($res_id, 'allow_authenticator_type: "'.wwa_get_option('allow_authenticator_type').'"->"'.$post_allow_authenticator_type.'"'); - } - wwa_update_option('allow_authenticator_type', $post_allow_authenticator_type); - - $post_usernameless_login = sanitize_text_field($_POST['usernameless_login']); - if($post_usernameless_login !== wwa_get_option('usernameless_login')){ - wwa_add_log($res_id, 'usernameless_login: "'.wwa_get_option('usernameless_login').'"->"'.$post_usernameless_login.'"'); - } - wwa_update_option('usernameless_login', $post_usernameless_login); - - $post_password_reset = sanitize_text_field($_POST['password_reset']); - if($post_password_reset !== wwa_get_option('password_reset')){ - wwa_add_log($res_id, 'password_reset: "'.wwa_get_option('password_reset').'"->"'.$post_password_reset.'"'); - } - wwa_update_option('password_reset', $post_password_reset); - - $post_after_user_registration = sanitize_text_field($_POST['after_user_registration']); - if($post_after_user_registration !== wwa_get_option('after_user_registration')){ - wwa_add_log($res_id, 'after_user_registration: "'.wwa_get_option('after_user_registration').'"->"'.$post_after_user_registration.'"'); - } - wwa_update_option('after_user_registration', $post_after_user_registration); - - add_settings_error('wwa_settings', 'save_success', __('Settings saved.', 'wp-webauthn'), 'success'); -}elseif((isset($_POST['wwa_ref']) && $_POST['wwa_ref'] === 'true')){ - add_settings_error('wwa_settings', 'save_error', __('Settings NOT saved.', 'wp-webauthn')); -} -settings_errors('wwa_settings'); - -wp_localize_script('wwa_admin', 'configs', array('usernameless' => (wwa_get_option('usernameless_login') === false ? 'false' : wwa_get_option('usernameless_login')), 'allow_authenticator_type' => (wwa_get_option('allow_authenticator_type') === false ? 'none' : wwa_get_option('allow_authenticator_type')))); - -// Only admin can change settings -if(wwa_validate_privileges()){ ?> -
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - - -

          User that doesn\'t have any registered authenticator (e.g. new user) will unable to login when using "WebAuthn Only".
          When the browser does not support WebAuthn, the login method will default to password if password login is not disabled.', 'wp-webauthn');?>

          -
          - -

          DOES NOT affect the authentication process in anyway.', 'wp-webauthn');?>

          -
          - -

          MUST be exactly the same with the current domain or parent domain.', 'wp-webauthn');?>

          -
          - -
          -
          -
          -

          -
          -
          - -
          -
          -
          -

          Note that if enabled attackers may be able to brute force the correspondences between email addresses and users.', 'wp-webauthn');?>

          -
          -
          - -
          -
          -
          -

          If you cannot register or verify your authenticators, please consider disabling user verification.', 'wp-webauthn');?>

          -
          -
          - -
          -
          -
          -

          User verification will be enabled automatically when authenticating with usernameless authentication feature.
          Some authenticators and some browsers DO NOT support this feature.', 'wp-webauthn');?>

          -
          -
          - - -

          -
          - - -

          If "Everyone except administrators" is selected, only administrators with the "Edit user" permission will be able to update passwords (for all users).', 'wp-webauthn');?>

          -
          - - -

          By default, new users have to login manually after registration. If "WebAuthn Only" is enabled, they will not be able to login.
          When using "Log user in", new users will be logged in automatically and redirected to their profile settings so that they can set up WebAuthn authenticators.', 'wp-webauthn');?>

          -
          - -
          -
          -
          -

          -       -

          -

          Note: Logs may contain sensitive information.', 'wp-webauthn');?>

          -
          -
          - 0)){ -?> - id="wwa-remove-log"> -

          - -

          -
          -